@midscene/cli 1.17.6 → 1.17.8-beta-20261106101231.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.
package/dist/lib/index.js CHANGED
@@ -4587,9 +4587,7 @@ defineYamlBatchTest(test, testOptions);
4587
4587
  "use strict";
4588
4588
  var core_ = __webpack_require__("@midscene/core");
4589
4589
  const cli_namespaceObject = require("@midscene/shared/cli");
4590
- var package_namespaceObject = {
4591
- rE: "1.17.6"
4592
- };
4590
+ var package_namespaceObject = JSON.parse('{"rE":"1.17.8-beta-20261106101231.0"}');
4593
4591
  var external_node_fs_ = __webpack_require__("node:fs");
4594
4592
  var external_node_fs_namespaceObject = /*#__PURE__*/ __webpack_require__.t(external_node_fs_, 2);
4595
4593
  var external_node_path_ = __webpack_require__("node:path");
@@ -10273,7 +10271,7 @@ Usage:
10273
10271
  type: 'boolean',
10274
10272
  description: 'Whether to dismiss the HarmonyOS keyboard after text input'
10275
10273
  }
10276
- }).version('version', 'Show version number', "1.17.6").help().epilogue(`For complete list of configuration options, please visit:
10274
+ }).version('version', 'Show version number', "1.17.8-beta-20261106101231.0").help().epilogue(`For complete list of configuration options, please visit:
10277
10275
  • Web options: https://midscenejs.com/automate-with-scripts-in-yaml#the-web-part
10278
10276
  • Android options: https://midscenejs.com/automate-with-scripts-in-yaml#the-android-part
10279
10277
  • HarmonyOS options: https://midscenejs.com/automate-with-scripts-in-yaml#the-harmony-part
@@ -10325,2085 +10323,2520 @@ Native cases/steps Test projects use the midscene-test command.`).wrap(yargs().t
10325
10323
  return files.filter((file)=>file.endsWith('.yml') || file.endsWith('.yaml')).sort();
10326
10324
  }
10327
10325
  var external_node_process_ = __webpack_require__("node:process");
10328
- /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ function isNothing(subject) {
10329
- return null == subject;
10330
- }
10331
- function js_yaml_isObject(subject) {
10332
- return 'object' == typeof subject && null !== subject;
10333
- }
10334
- function toArray(sequence) {
10335
- if (Array.isArray(sequence)) return sequence;
10336
- if (isNothing(sequence)) return [];
10337
- return [
10338
- sequence
10339
- ];
10340
- }
10341
- function js_yaml_extend(target, source) {
10342
- var index, length, key, sourceKeys;
10343
- if (source) {
10344
- sourceKeys = Object.keys(source);
10345
- for(index = 0, length = sourceKeys.length; index < length; index += 1){
10346
- key = sourceKeys[index];
10347
- target[key] = source[key];
10326
+ function getDefaultExportFromCjs(x) {
10327
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
10328
+ }
10329
+ var jsYaml = {};
10330
+ var loader = {};
10331
+ var common = {};
10332
+ var hasRequiredCommon;
10333
+ function requireCommon() {
10334
+ if (hasRequiredCommon) return common;
10335
+ hasRequiredCommon = 1;
10336
+ function isNothing(subject) {
10337
+ return null == subject;
10338
+ }
10339
+ function isObject(subject) {
10340
+ return "object" == typeof subject && null !== subject;
10341
+ }
10342
+ function toArray(sequence) {
10343
+ if (Array.isArray(sequence)) return sequence;
10344
+ if (isNothing(sequence)) return [];
10345
+ return [
10346
+ sequence
10347
+ ];
10348
+ }
10349
+ function extend(target, source) {
10350
+ if (source) {
10351
+ const sourceKeys = Object.keys(source);
10352
+ for(let index = 0, length = sourceKeys.length; index < length; index += 1){
10353
+ const key = sourceKeys[index];
10354
+ target[key] = source[key];
10355
+ }
10348
10356
  }
10357
+ return target;
10349
10358
  }
10350
- return target;
10351
- }
10352
- function repeat(string, count) {
10353
- var result = '', cycle;
10354
- for(cycle = 0; cycle < count; cycle += 1)result += string;
10355
- return result;
10356
- }
10357
- function isNegativeZero(number) {
10358
- return 0 === number && -1 / 0 === 1 / number;
10359
- }
10360
- var isNothing_1 = isNothing;
10361
- var isObject_1 = js_yaml_isObject;
10362
- var toArray_1 = toArray;
10363
- var repeat_1 = repeat;
10364
- var isNegativeZero_1 = isNegativeZero;
10365
- var extend_1 = js_yaml_extend;
10366
- var common = {
10367
- isNothing: isNothing_1,
10368
- isObject: isObject_1,
10369
- toArray: toArray_1,
10370
- repeat: repeat_1,
10371
- isNegativeZero: isNegativeZero_1,
10372
- extend: extend_1
10373
- };
10374
- function formatError(exception, compact) {
10375
- var where = '', message = exception.reason || '(unknown reason)';
10376
- if (!exception.mark) return message;
10377
- if (exception.mark.name) where += 'in "' + exception.mark.name + '" ';
10378
- where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')';
10379
- if (!compact && exception.mark.snippet) where += '\n\n' + exception.mark.snippet;
10380
- return message + ' ' + where;
10381
- }
10382
- function YAMLException$1(reason, mark) {
10383
- Error.call(this);
10384
- this.name = 'YAMLException';
10385
- this.reason = reason;
10386
- this.mark = mark;
10387
- this.message = formatError(this, false);
10388
- if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor);
10389
- else this.stack = new Error().stack || '';
10390
- }
10391
- YAMLException$1.prototype = Object.create(Error.prototype);
10392
- YAMLException$1.prototype.constructor = YAMLException$1;
10393
- YAMLException$1.prototype.toString = function(compact) {
10394
- return this.name + ': ' + formatError(this, compact);
10395
- };
10396
- var js_yaml_exception = YAMLException$1;
10397
- function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
10398
- var head = '';
10399
- var tail = '';
10400
- var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
10401
- if (position - lineStart > maxHalfLength) {
10402
- head = ' ... ';
10403
- lineStart = position - maxHalfLength + head.length;
10404
- }
10405
- if (lineEnd - position > maxHalfLength) {
10406
- tail = ' ...';
10407
- lineEnd = position + maxHalfLength - tail.length;
10359
+ function repeat(string, count) {
10360
+ let result = "";
10361
+ for(let cycle = 0; cycle < count; cycle += 1)result += string;
10362
+ return result;
10408
10363
  }
10409
- return {
10410
- str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, '→') + tail,
10411
- pos: position - lineStart + head.length
10364
+ function isNegativeZero(number) {
10365
+ return 0 === number && -1 / 0 === 1 / number;
10366
+ }
10367
+ common.isNothing = isNothing;
10368
+ common.isObject = isObject;
10369
+ common.toArray = toArray;
10370
+ common.repeat = repeat;
10371
+ common.isNegativeZero = isNegativeZero;
10372
+ common.extend = extend;
10373
+ return common;
10374
+ }
10375
+ var exception;
10376
+ var hasRequiredException;
10377
+ function requireException() {
10378
+ if (hasRequiredException) return exception;
10379
+ hasRequiredException = 1;
10380
+ function formatError(exception2, compact) {
10381
+ let where = "";
10382
+ const message = exception2.reason || "(unknown reason)";
10383
+ if (!exception2.mark) return message;
10384
+ if (exception2.mark.name) where += 'in "' + exception2.mark.name + '" ';
10385
+ where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")";
10386
+ if (!compact && exception2.mark.snippet) where += "\n\n" + exception2.mark.snippet;
10387
+ return message + " " + where;
10388
+ }
10389
+ function YAMLException2(reason, mark) {
10390
+ Error.call(this);
10391
+ this.name = "YAMLException";
10392
+ this.reason = reason;
10393
+ this.mark = mark;
10394
+ this.message = formatError(this, false);
10395
+ if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor);
10396
+ else this.stack = new Error().stack || "";
10397
+ }
10398
+ YAMLException2.prototype = Object.create(Error.prototype);
10399
+ YAMLException2.prototype.constructor = YAMLException2;
10400
+ YAMLException2.prototype.toString = function(compact) {
10401
+ return this.name + ": " + formatError(this, compact);
10412
10402
  };
10413
- }
10414
- function padStart(string, max) {
10415
- return common.repeat(' ', max - string.length) + string;
10416
- }
10417
- function makeSnippet(mark, options) {
10418
- options = Object.create(options || null);
10419
- if (!mark.buffer) return null;
10420
- if (!options.maxLength) options.maxLength = 79;
10421
- if ('number' != typeof options.indent) options.indent = 1;
10422
- if ('number' != typeof options.linesBefore) options.linesBefore = 3;
10423
- if ('number' != typeof options.linesAfter) options.linesAfter = 2;
10424
- var re = /\r?\n|\r|\0/g;
10425
- var lineStarts = [
10426
- 0
10403
+ exception = YAMLException2;
10404
+ return exception;
10405
+ }
10406
+ var snippet;
10407
+ var hasRequiredSnippet;
10408
+ function requireSnippet() {
10409
+ if (hasRequiredSnippet) return snippet;
10410
+ hasRequiredSnippet = 1;
10411
+ const common2 = requireCommon();
10412
+ function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
10413
+ let head = "";
10414
+ let tail = "";
10415
+ const maxHalfLength = Math.floor(maxLineLength / 2) - 1;
10416
+ if (position - lineStart > maxHalfLength) {
10417
+ head = " ... ";
10418
+ lineStart = position - maxHalfLength + head.length;
10419
+ }
10420
+ if (lineEnd - position > maxHalfLength) {
10421
+ tail = " ...";
10422
+ lineEnd = position + maxHalfLength - tail.length;
10423
+ }
10424
+ return {
10425
+ str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "→") + tail,
10426
+ pos: position - lineStart + head.length
10427
+ };
10428
+ }
10429
+ function padStart(string, max) {
10430
+ return common2.repeat(" ", max - string.length) + string;
10431
+ }
10432
+ function makeSnippet(mark, options) {
10433
+ options = Object.create(options || null);
10434
+ if (!mark.buffer) return null;
10435
+ if (!options.maxLength) options.maxLength = 79;
10436
+ if ("number" != typeof options.indent) options.indent = 1;
10437
+ if ("number" != typeof options.linesBefore) options.linesBefore = 3;
10438
+ if ("number" != typeof options.linesAfter) options.linesAfter = 2;
10439
+ const re = /\r?\n|\r|\0/g;
10440
+ const lineStarts = [
10441
+ 0
10442
+ ];
10443
+ const lineEnds = [];
10444
+ let match;
10445
+ let foundLineNo = -1;
10446
+ while(match = re.exec(mark.buffer)){
10447
+ lineEnds.push(match.index);
10448
+ lineStarts.push(match.index + match[0].length);
10449
+ if (mark.position <= match.index && foundLineNo < 0) foundLineNo = lineStarts.length - 2;
10450
+ }
10451
+ if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
10452
+ let result = "";
10453
+ const lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
10454
+ const maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
10455
+ for(let i = 1; i <= options.linesBefore; i++){
10456
+ if (foundLineNo - i < 0) break;
10457
+ const line2 = getLine(mark.buffer, lineStarts[foundLineNo - i], lineEnds[foundLineNo - i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), maxLineLength);
10458
+ result = common2.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line2.str + "\n" + result;
10459
+ }
10460
+ const line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
10461
+ result += common2.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n";
10462
+ result += common2.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n";
10463
+ for(let i = 1; i <= options.linesAfter; i++){
10464
+ if (foundLineNo + i >= lineEnds.length) break;
10465
+ const line2 = getLine(mark.buffer, lineStarts[foundLineNo + i], lineEnds[foundLineNo + i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), maxLineLength);
10466
+ result += common2.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line2.str + "\n";
10467
+ }
10468
+ return result.replace(/\n$/, "");
10469
+ }
10470
+ snippet = makeSnippet;
10471
+ return snippet;
10472
+ }
10473
+ var js_yaml_type;
10474
+ var hasRequiredType;
10475
+ function requireType() {
10476
+ if (hasRequiredType) return js_yaml_type;
10477
+ hasRequiredType = 1;
10478
+ const YAMLException2 = requireException();
10479
+ const TYPE_CONSTRUCTOR_OPTIONS = [
10480
+ "kind",
10481
+ "multi",
10482
+ "resolve",
10483
+ "construct",
10484
+ "instanceOf",
10485
+ "predicate",
10486
+ "represent",
10487
+ "representName",
10488
+ "defaultStyle",
10489
+ "styleAliases"
10427
10490
  ];
10428
- var lineEnds = [];
10429
- var match;
10430
- var foundLineNo = -1;
10431
- while(match = re.exec(mark.buffer)){
10432
- lineEnds.push(match.index);
10433
- lineStarts.push(match.index + match[0].length);
10434
- if (mark.position <= match.index && foundLineNo < 0) foundLineNo = lineStarts.length - 2;
10435
- }
10436
- if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
10437
- var result = '', i, line;
10438
- var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
10439
- var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
10440
- for(i = 1; i <= options.linesBefore; i++){
10441
- if (foundLineNo - i < 0) break;
10442
- line = getLine(mark.buffer, lineStarts[foundLineNo - i], lineEnds[foundLineNo - i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]), maxLineLength);
10443
- result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + ' | ' + line.str + '\n' + result;
10444
- }
10445
- line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
10446
- result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + ' | ' + line.str + '\n';
10447
- result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + "^\n";
10448
- for(i = 1; i <= options.linesAfter; i++){
10449
- if (foundLineNo + i >= lineEnds.length) break;
10450
- line = getLine(mark.buffer, lineStarts[foundLineNo + i], lineEnds[foundLineNo + i], mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]), maxLineLength);
10451
- result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + ' | ' + line.str + '\n';
10452
- }
10453
- return result.replace(/\n$/, '');
10454
- }
10455
- var snippet = makeSnippet;
10456
- var TYPE_CONSTRUCTOR_OPTIONS = [
10457
- 'kind',
10458
- 'multi',
10459
- 'resolve',
10460
- 'construct',
10461
- 'instanceOf',
10462
- 'predicate',
10463
- 'represent',
10464
- 'representName',
10465
- 'defaultStyle',
10466
- 'styleAliases'
10467
- ];
10468
- var YAML_NODE_KINDS = [
10469
- 'scalar',
10470
- 'sequence',
10471
- 'mapping'
10472
- ];
10473
- function compileStyleAliases(map) {
10474
- var result = {};
10475
- if (null !== map) Object.keys(map).forEach(function(style) {
10476
- map[style].forEach(function(alias) {
10477
- result[String(alias)] = style;
10478
- });
10479
- });
10480
- return result;
10481
- }
10482
- function Type$1(tag, options) {
10483
- options = options || {};
10484
- Object.keys(options).forEach(function(name) {
10485
- if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) throw new js_yaml_exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
10486
- });
10487
- this.options = options;
10488
- this.tag = tag;
10489
- this.kind = options['kind'] || null;
10490
- this.resolve = options['resolve'] || function() {
10491
- return true;
10492
- };
10493
- this.construct = options['construct'] || function(data) {
10494
- return data;
10495
- };
10496
- this.instanceOf = options['instanceOf'] || null;
10497
- this.predicate = options['predicate'] || null;
10498
- this.represent = options['represent'] || null;
10499
- this.representName = options['representName'] || null;
10500
- this.defaultStyle = options['defaultStyle'] || null;
10501
- this.multi = options['multi'] || false;
10502
- this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
10503
- if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) throw new js_yaml_exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
10504
- }
10505
- var js_yaml_type = Type$1;
10506
- function compileList(schema, name) {
10507
- var result = [];
10508
- schema[name].forEach(function(currentType) {
10509
- var newIndex = result.length;
10510
- result.forEach(function(previousType, previousIndex) {
10511
- if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) newIndex = previousIndex;
10491
+ const YAML_NODE_KINDS = [
10492
+ "scalar",
10493
+ "sequence",
10494
+ "mapping"
10495
+ ];
10496
+ function compileStyleAliases(map2) {
10497
+ const result = {};
10498
+ if (null !== map2) Object.keys(map2).forEach(function(style) {
10499
+ map2[style].forEach(function(alias) {
10500
+ result[String(alias)] = style;
10501
+ });
10512
10502
  });
10513
- result[newIndex] = currentType;
10514
- });
10515
- return result;
10516
- }
10517
- function compileMap() {
10518
- var result = {
10519
- scalar: {},
10520
- sequence: {},
10521
- mapping: {},
10522
- fallback: {},
10523
- multi: {
10524
- scalar: [],
10525
- sequence: [],
10526
- mapping: [],
10527
- fallback: []
10528
- }
10529
- }, index, length;
10530
- function collectType(type) {
10531
- if (type.multi) {
10532
- result.multi[type.kind].push(type);
10533
- result.multi['fallback'].push(type);
10534
- } else result[type.kind][type.tag] = result['fallback'][type.tag] = type;
10535
- }
10536
- for(index = 0, length = arguments.length; index < length; index += 1)arguments[index].forEach(collectType);
10537
- return result;
10538
- }
10539
- function Schema$1(definition) {
10540
- return this.extend(definition);
10541
- }
10542
- Schema$1.prototype.extend = function(definition) {
10543
- var implicit = [];
10544
- var explicit = [];
10545
- if (definition instanceof js_yaml_type) explicit.push(definition);
10546
- else if (Array.isArray(definition)) explicit = explicit.concat(definition);
10547
- else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
10548
- if (definition.implicit) implicit = implicit.concat(definition.implicit);
10549
- if (definition.explicit) explicit = explicit.concat(definition.explicit);
10550
- } else throw new js_yaml_exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
10551
- implicit.forEach(function(type$1) {
10552
- if (!(type$1 instanceof js_yaml_type)) throw new js_yaml_exception('Specified list of YAML types (or a single Type object) contains a non-Type object.');
10553
- if (type$1.loadKind && 'scalar' !== type$1.loadKind) throw new js_yaml_exception('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
10554
- if (type$1.multi) throw new js_yaml_exception('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.');
10555
- });
10556
- explicit.forEach(function(type$1) {
10557
- if (!(type$1 instanceof js_yaml_type)) throw new js_yaml_exception('Specified list of YAML types (or a single Type object) contains a non-Type object.');
10558
- });
10559
- var result = Object.create(Schema$1.prototype);
10560
- result.implicit = (this.implicit || []).concat(implicit);
10561
- result.explicit = (this.explicit || []).concat(explicit);
10562
- result.compiledImplicit = compileList(result, 'implicit');
10563
- result.compiledExplicit = compileList(result, 'explicit');
10564
- result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
10565
- return result;
10566
- };
10567
- var js_yaml_schema = Schema$1;
10568
- var js_yaml_str = new js_yaml_type('tag:yaml.org,2002:str', {
10569
- kind: 'scalar',
10570
- construct: function(data) {
10571
- return null !== data ? data : '';
10503
+ return result;
10572
10504
  }
10573
- });
10574
- var seq = new js_yaml_type('tag:yaml.org,2002:seq', {
10575
- kind: 'sequence',
10576
- construct: function(data) {
10577
- return null !== data ? data : [];
10505
+ function Type2(tag, options) {
10506
+ options = options || {};
10507
+ Object.keys(options).forEach(function(name) {
10508
+ if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) throw new YAMLException2('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
10509
+ });
10510
+ this.options = options;
10511
+ this.tag = tag;
10512
+ this.kind = options["kind"] || null;
10513
+ this.resolve = options["resolve"] || function() {
10514
+ return true;
10515
+ };
10516
+ this.construct = options["construct"] || function(data) {
10517
+ return data;
10518
+ };
10519
+ this.instanceOf = options["instanceOf"] || null;
10520
+ this.predicate = options["predicate"] || null;
10521
+ this.represent = options["represent"] || null;
10522
+ this.representName = options["representName"] || null;
10523
+ this.defaultStyle = options["defaultStyle"] || null;
10524
+ this.multi = options["multi"] || false;
10525
+ this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
10526
+ if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) throw new YAMLException2('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
10527
+ }
10528
+ js_yaml_type = Type2;
10529
+ return js_yaml_type;
10530
+ }
10531
+ var schema;
10532
+ var hasRequiredSchema;
10533
+ function requireSchema() {
10534
+ if (hasRequiredSchema) return schema;
10535
+ hasRequiredSchema = 1;
10536
+ const YAMLException2 = requireException();
10537
+ const Type2 = requireType();
10538
+ function compileList(schema2, name) {
10539
+ const result = [];
10540
+ schema2[name].forEach(function(currentType) {
10541
+ let newIndex = result.length;
10542
+ result.forEach(function(previousType, previousIndex) {
10543
+ if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) newIndex = previousIndex;
10544
+ });
10545
+ result[newIndex] = currentType;
10546
+ });
10547
+ return result;
10578
10548
  }
10579
- });
10580
- var js_yaml_map = new js_yaml_type('tag:yaml.org,2002:map', {
10581
- kind: 'mapping',
10582
- construct: function(data) {
10583
- return null !== data ? data : {};
10549
+ function compileMap() {
10550
+ const result = {
10551
+ scalar: {},
10552
+ sequence: {},
10553
+ mapping: {},
10554
+ fallback: {},
10555
+ multi: {
10556
+ scalar: [],
10557
+ sequence: [],
10558
+ mapping: [],
10559
+ fallback: []
10560
+ }
10561
+ };
10562
+ function collectType(type2) {
10563
+ if (type2.multi) {
10564
+ result.multi[type2.kind].push(type2);
10565
+ result.multi["fallback"].push(type2);
10566
+ } else result[type2.kind][type2.tag] = result["fallback"][type2.tag] = type2;
10567
+ }
10568
+ for(let index = 0, length = arguments.length; index < length; index += 1)arguments[index].forEach(collectType);
10569
+ return result;
10584
10570
  }
10585
- });
10586
- var failsafe = new js_yaml_schema({
10587
- explicit: [
10588
- js_yaml_str,
10589
- seq,
10590
- js_yaml_map
10591
- ]
10592
- });
10593
- function resolveYamlNull(data) {
10594
- if (null === data) return true;
10595
- var max = data.length;
10596
- return 1 === max && '~' === data || 4 === max && ('null' === data || 'Null' === data || 'NULL' === data);
10597
- }
10598
- function constructYamlNull() {
10599
- return null;
10600
- }
10601
- function isNull(object) {
10602
- return null === object;
10603
- }
10604
- var _null = new js_yaml_type('tag:yaml.org,2002:null', {
10605
- kind: 'scalar',
10606
- resolve: resolveYamlNull,
10607
- construct: constructYamlNull,
10608
- predicate: isNull,
10609
- represent: {
10610
- canonical: function() {
10611
- return '~';
10612
- },
10613
- lowercase: function() {
10614
- return 'null';
10615
- },
10616
- uppercase: function() {
10617
- return 'NULL';
10618
- },
10619
- camelcase: function() {
10620
- return 'Null';
10621
- },
10622
- empty: function() {
10623
- return '';
10571
+ function Schema2(definition) {
10572
+ return this.extend(definition);
10573
+ }
10574
+ Schema2.prototype.extend = function(definition) {
10575
+ let implicit = [];
10576
+ let explicit = [];
10577
+ if (definition instanceof Type2) explicit.push(definition);
10578
+ else if (Array.isArray(definition)) explicit = explicit.concat(definition);
10579
+ else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
10580
+ if (definition.implicit) implicit = implicit.concat(definition.implicit);
10581
+ if (definition.explicit) explicit = explicit.concat(definition.explicit);
10582
+ } else throw new YAMLException2("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
10583
+ implicit.forEach(function(type2) {
10584
+ if (!(type2 instanceof Type2)) throw new YAMLException2("Specified list of YAML types (or a single Type object) contains a non-Type object.");
10585
+ if (type2.loadKind && "scalar" !== type2.loadKind) throw new YAMLException2("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
10586
+ if (type2.multi) throw new YAMLException2("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
10587
+ });
10588
+ explicit.forEach(function(type2) {
10589
+ if (!(type2 instanceof Type2)) throw new YAMLException2("Specified list of YAML types (or a single Type object) contains a non-Type object.");
10590
+ });
10591
+ const result = Object.create(Schema2.prototype);
10592
+ result.implicit = (this.implicit || []).concat(implicit);
10593
+ result.explicit = (this.explicit || []).concat(explicit);
10594
+ result.compiledImplicit = compileList(result, "implicit");
10595
+ result.compiledExplicit = compileList(result, "explicit");
10596
+ result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
10597
+ return result;
10598
+ };
10599
+ schema = Schema2;
10600
+ return schema;
10601
+ }
10602
+ var js_yaml_str;
10603
+ var hasRequiredStr;
10604
+ function requireStr() {
10605
+ if (hasRequiredStr) return js_yaml_str;
10606
+ hasRequiredStr = 1;
10607
+ const Type2 = requireType();
10608
+ js_yaml_str = new Type2("tag:yaml.org,2002:str", {
10609
+ kind: "scalar",
10610
+ construct: function(data) {
10611
+ return null !== data ? data : "";
10624
10612
  }
10625
- },
10626
- defaultStyle: 'lowercase'
10627
- });
10628
- function resolveYamlBoolean(data) {
10629
- if (null === data) return false;
10630
- var max = data.length;
10631
- return 4 === max && ('true' === data || 'True' === data || 'TRUE' === data) || 5 === max && ('false' === data || 'False' === data || 'FALSE' === data);
10632
- }
10633
- function constructYamlBoolean(data) {
10634
- return 'true' === data || 'True' === data || 'TRUE' === data;
10635
- }
10636
- function isBoolean(object) {
10637
- return '[object Boolean]' === Object.prototype.toString.call(object);
10638
- }
10639
- var bool = new js_yaml_type('tag:yaml.org,2002:bool', {
10640
- kind: 'scalar',
10641
- resolve: resolveYamlBoolean,
10642
- construct: constructYamlBoolean,
10643
- predicate: isBoolean,
10644
- represent: {
10645
- lowercase: function(object) {
10646
- return object ? 'true' : 'false';
10613
+ });
10614
+ return js_yaml_str;
10615
+ }
10616
+ var seq;
10617
+ var hasRequiredSeq;
10618
+ function requireSeq() {
10619
+ if (hasRequiredSeq) return seq;
10620
+ hasRequiredSeq = 1;
10621
+ const Type2 = requireType();
10622
+ seq = new Type2("tag:yaml.org,2002:seq", {
10623
+ kind: "sequence",
10624
+ construct: function(data) {
10625
+ return null !== data ? data : [];
10626
+ }
10627
+ });
10628
+ return seq;
10629
+ }
10630
+ var map;
10631
+ var hasRequiredMap;
10632
+ function requireMap() {
10633
+ if (hasRequiredMap) return map;
10634
+ hasRequiredMap = 1;
10635
+ const Type2 = requireType();
10636
+ map = new Type2("tag:yaml.org,2002:map", {
10637
+ kind: "mapping",
10638
+ construct: function(data) {
10639
+ return null !== data ? data : {};
10640
+ }
10641
+ });
10642
+ return map;
10643
+ }
10644
+ var failsafe;
10645
+ var hasRequiredFailsafe;
10646
+ function requireFailsafe() {
10647
+ if (hasRequiredFailsafe) return failsafe;
10648
+ hasRequiredFailsafe = 1;
10649
+ const Schema2 = requireSchema();
10650
+ failsafe = new Schema2({
10651
+ explicit: [
10652
+ requireStr(),
10653
+ requireSeq(),
10654
+ requireMap()
10655
+ ]
10656
+ });
10657
+ return failsafe;
10658
+ }
10659
+ var _null;
10660
+ var hasRequired_null;
10661
+ function require_null() {
10662
+ if (hasRequired_null) return _null;
10663
+ hasRequired_null = 1;
10664
+ const Type2 = requireType();
10665
+ function resolveYamlNull(data) {
10666
+ if (null === data) return true;
10667
+ const max = data.length;
10668
+ return 1 === max && "~" === data || 4 === max && ("null" === data || "Null" === data || "NULL" === data);
10669
+ }
10670
+ function constructYamlNull() {
10671
+ return null;
10672
+ }
10673
+ function isNull(object) {
10674
+ return null === object;
10675
+ }
10676
+ _null = new Type2("tag:yaml.org,2002:null", {
10677
+ kind: "scalar",
10678
+ resolve: resolveYamlNull,
10679
+ construct: constructYamlNull,
10680
+ predicate: isNull,
10681
+ represent: {
10682
+ canonical: function() {
10683
+ return "~";
10684
+ },
10685
+ lowercase: function() {
10686
+ return "null";
10687
+ },
10688
+ uppercase: function() {
10689
+ return "NULL";
10690
+ },
10691
+ camelcase: function() {
10692
+ return "Null";
10693
+ },
10694
+ empty: function() {
10695
+ return "";
10696
+ }
10647
10697
  },
10648
- uppercase: function(object) {
10649
- return object ? 'TRUE' : 'FALSE';
10698
+ defaultStyle: "lowercase"
10699
+ });
10700
+ return _null;
10701
+ }
10702
+ var bool;
10703
+ var hasRequiredBool;
10704
+ function requireBool() {
10705
+ if (hasRequiredBool) return bool;
10706
+ hasRequiredBool = 1;
10707
+ const Type2 = requireType();
10708
+ function resolveYamlBoolean(data) {
10709
+ if (null === data) return false;
10710
+ const max = data.length;
10711
+ return 4 === max && ("true" === data || "True" === data || "TRUE" === data) || 5 === max && ("false" === data || "False" === data || "FALSE" === data);
10712
+ }
10713
+ function constructYamlBoolean(data) {
10714
+ return "true" === data || "True" === data || "TRUE" === data;
10715
+ }
10716
+ function isBoolean(object) {
10717
+ return "[object Boolean]" === Object.prototype.toString.call(object);
10718
+ }
10719
+ bool = new Type2("tag:yaml.org,2002:bool", {
10720
+ kind: "scalar",
10721
+ resolve: resolveYamlBoolean,
10722
+ construct: constructYamlBoolean,
10723
+ predicate: isBoolean,
10724
+ represent: {
10725
+ lowercase: function(object) {
10726
+ return object ? "true" : "false";
10727
+ },
10728
+ uppercase: function(object) {
10729
+ return object ? "TRUE" : "FALSE";
10730
+ },
10731
+ camelcase: function(object) {
10732
+ return object ? "True" : "False";
10733
+ }
10650
10734
  },
10651
- camelcase: function(object) {
10652
- return object ? 'True' : 'False';
10653
- }
10654
- },
10655
- defaultStyle: 'lowercase'
10656
- });
10657
- function isHexCode(c) {
10658
- return 0x30 <= c && c <= 0x39 || 0x41 <= c && c <= 0x46 || 0x61 <= c && c <= 0x66;
10659
- }
10660
- function isOctCode(c) {
10661
- return 0x30 <= c && c <= 0x37;
10662
- }
10663
- function isDecCode(c) {
10664
- return 0x30 <= c && c <= 0x39;
10665
- }
10666
- function resolveYamlInteger(data) {
10667
- if (null === data) return false;
10668
- var max = data.length, index = 0, hasDigits = false, ch;
10669
- if (!max) return false;
10670
- ch = data[index];
10671
- if ('-' === ch || '+' === ch) ch = data[++index];
10672
- if ('0' === ch) {
10673
- if (index + 1 === max) return true;
10674
- ch = data[++index];
10675
- if ('b' === ch) {
10676
- index++;
10677
- for(; index < max; index++){
10678
- ch = data[index];
10679
- if ('_' !== ch) {
10680
- if ('0' !== ch && '1' !== ch) return false;
10735
+ defaultStyle: "lowercase"
10736
+ });
10737
+ return bool;
10738
+ }
10739
+ var js_yaml_int;
10740
+ var hasRequiredInt;
10741
+ function requireInt() {
10742
+ if (hasRequiredInt) return js_yaml_int;
10743
+ hasRequiredInt = 1;
10744
+ const common2 = requireCommon();
10745
+ const Type2 = requireType();
10746
+ function isHexCode(c) {
10747
+ return c >= 48 && c <= 57 || c >= 65 && c <= 70 || c >= 97 && c <= 102;
10748
+ }
10749
+ function isOctCode(c) {
10750
+ return c >= 48 && c <= 55;
10751
+ }
10752
+ function isDecCode(c) {
10753
+ return c >= 48 && c <= 57;
10754
+ }
10755
+ function resolveYamlInteger(data) {
10756
+ if (null === data) return false;
10757
+ const max = data.length;
10758
+ let index = 0;
10759
+ let hasDigits = false;
10760
+ if (!max) return false;
10761
+ let ch = data[index];
10762
+ if ("-" === ch || "+" === ch) ch = data[++index];
10763
+ if ("0" === ch) {
10764
+ if (index + 1 === max) return true;
10765
+ ch = data[++index];
10766
+ if ("b" === ch) {
10767
+ index++;
10768
+ for(; index < max; index++){
10769
+ ch = data[index];
10770
+ if ("0" !== ch && "1" !== ch) return false;
10681
10771
  hasDigits = true;
10682
10772
  }
10773
+ return hasDigits && isFinite(parseYamlInteger(data));
10683
10774
  }
10684
- return hasDigits && '_' !== ch;
10685
- }
10686
- if ('x' === ch) {
10687
- index++;
10688
- for(; index < max; index++){
10689
- ch = data[index];
10690
- if ('_' !== ch) {
10775
+ if ("x" === ch) {
10776
+ index++;
10777
+ for(; index < max; index++){
10691
10778
  if (!isHexCode(data.charCodeAt(index))) return false;
10692
10779
  hasDigits = true;
10693
10780
  }
10781
+ return hasDigits && isFinite(parseYamlInteger(data));
10694
10782
  }
10695
- return hasDigits && '_' !== ch;
10696
- }
10697
- if ('o' === ch) {
10698
- index++;
10699
- for(; index < max; index++){
10700
- ch = data[index];
10701
- if ('_' !== ch) {
10783
+ if ("o" === ch) {
10784
+ index++;
10785
+ for(; index < max; index++){
10702
10786
  if (!isOctCode(data.charCodeAt(index))) return false;
10703
10787
  hasDigits = true;
10704
10788
  }
10789
+ return hasDigits && isFinite(parseYamlInteger(data));
10705
10790
  }
10706
- return hasDigits && '_' !== ch;
10707
10791
  }
10708
- }
10709
- if ('_' === ch) return false;
10710
- for(; index < max; index++){
10711
- ch = data[index];
10712
- if ('_' !== ch) {
10792
+ for(; index < max; index++){
10713
10793
  if (!isDecCode(data.charCodeAt(index))) return false;
10714
10794
  hasDigits = true;
10715
10795
  }
10716
- }
10717
- if (!hasDigits || '_' === ch) return false;
10718
- return true;
10719
- }
10720
- function constructYamlInteger(data) {
10721
- var value = data, sign = 1, ch;
10722
- if (-1 !== value.indexOf('_')) value = value.replace(/_/g, '');
10723
- ch = value[0];
10724
- if ('-' === ch || '+' === ch) {
10725
- if ('-' === ch) sign = -1;
10726
- value = value.slice(1);
10727
- ch = value[0];
10728
- }
10729
- if ('0' === value) return 0;
10730
- if ('0' === ch) {
10731
- if ('b' === value[1]) return sign * parseInt(value.slice(2), 2);
10732
- if ('x' === value[1]) return sign * parseInt(value.slice(2), 16);
10733
- if ('o' === value[1]) return sign * parseInt(value.slice(2), 8);
10734
- }
10735
- return sign * parseInt(value, 10);
10736
- }
10737
- function isInteger(object) {
10738
- return '[object Number]' === Object.prototype.toString.call(object) && object % 1 === 0 && !common.isNegativeZero(object);
10739
- }
10740
- var js_yaml_int = new js_yaml_type('tag:yaml.org,2002:int', {
10741
- kind: 'scalar',
10742
- resolve: resolveYamlInteger,
10743
- construct: constructYamlInteger,
10744
- predicate: isInteger,
10745
- represent: {
10746
- binary: function(obj) {
10747
- return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1);
10748
- },
10749
- octal: function(obj) {
10750
- return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1);
10751
- },
10752
- decimal: function(obj) {
10753
- return obj.toString(10);
10796
+ if (!hasDigits) return false;
10797
+ return isFinite(parseYamlInteger(data));
10798
+ }
10799
+ function parseYamlInteger(data) {
10800
+ let value = data;
10801
+ let sign = 1;
10802
+ let ch = value[0];
10803
+ if ("-" === ch || "+" === ch) {
10804
+ if ("-" === ch) sign = -1;
10805
+ value = value.slice(1);
10806
+ ch = value[0];
10807
+ }
10808
+ if ("0" === value) return 0;
10809
+ if ("0" === ch) {
10810
+ if ("b" === value[1]) return sign * parseInt(value.slice(2), 2);
10811
+ if ("x" === value[1]) return sign * parseInt(value.slice(2), 16);
10812
+ if ("o" === value[1]) return sign * parseInt(value.slice(2), 8);
10813
+ }
10814
+ return sign * parseInt(value, 10);
10815
+ }
10816
+ function constructYamlInteger(data) {
10817
+ return parseYamlInteger(data);
10818
+ }
10819
+ function isInteger(object) {
10820
+ return "[object Number]" === Object.prototype.toString.call(object) && object % 1 === 0 && !common2.isNegativeZero(object);
10821
+ }
10822
+ js_yaml_int = new Type2("tag:yaml.org,2002:int", {
10823
+ kind: "scalar",
10824
+ resolve: resolveYamlInteger,
10825
+ construct: constructYamlInteger,
10826
+ predicate: isInteger,
10827
+ represent: {
10828
+ binary: function(obj) {
10829
+ return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
10830
+ },
10831
+ octal: function(obj) {
10832
+ return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
10833
+ },
10834
+ decimal: function(obj) {
10835
+ return obj.toString(10);
10836
+ },
10837
+ hexadecimal: function(obj) {
10838
+ return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
10839
+ }
10754
10840
  },
10755
- hexadecimal: function(obj) {
10756
- return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1);
10841
+ defaultStyle: "decimal",
10842
+ styleAliases: {
10843
+ binary: [
10844
+ 2,
10845
+ "bin"
10846
+ ],
10847
+ octal: [
10848
+ 8,
10849
+ "oct"
10850
+ ],
10851
+ decimal: [
10852
+ 10,
10853
+ "dec"
10854
+ ],
10855
+ hexadecimal: [
10856
+ 16,
10857
+ "hex"
10858
+ ]
10757
10859
  }
10758
- },
10759
- defaultStyle: 'decimal',
10760
- styleAliases: {
10761
- binary: [
10762
- 2,
10763
- 'bin'
10764
- ],
10765
- octal: [
10766
- 8,
10767
- 'oct'
10768
- ],
10769
- decimal: [
10770
- 10,
10771
- 'dec'
10772
- ],
10773
- hexadecimal: [
10774
- 16,
10775
- 'hex'
10860
+ });
10861
+ return js_yaml_int;
10862
+ }
10863
+ var js_yaml_float;
10864
+ var hasRequiredFloat;
10865
+ function requireFloat() {
10866
+ if (hasRequiredFloat) return js_yaml_float;
10867
+ hasRequiredFloat = 1;
10868
+ const common2 = requireCommon();
10869
+ const Type2 = requireType();
10870
+ const YAML_FLOAT_PATTERN = new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
10871
+ const YAML_FLOAT_SPECIAL_PATTERN = new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
10872
+ function resolveYamlFloat(data) {
10873
+ if (null === data) return false;
10874
+ if (!YAML_FLOAT_PATTERN.test(data)) return false;
10875
+ if (isFinite(parseFloat(data, 10))) return true;
10876
+ return YAML_FLOAT_SPECIAL_PATTERN.test(data);
10877
+ }
10878
+ function constructYamlFloat(data) {
10879
+ let value = data.toLowerCase();
10880
+ const sign = "-" === value[0] ? -1 : 1;
10881
+ if ("+-".indexOf(value[0]) >= 0) value = value.slice(1);
10882
+ if (".inf" === value) return 1 === sign ? 1 / 0 : -1 / 0;
10883
+ if (".nan" === value) return NaN;
10884
+ return sign * parseFloat(value, 10);
10885
+ }
10886
+ const SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
10887
+ function representYamlFloat(object, style) {
10888
+ if (isNaN(object)) switch(style){
10889
+ case "lowercase":
10890
+ return ".nan";
10891
+ case "uppercase":
10892
+ return ".NAN";
10893
+ case "camelcase":
10894
+ return ".NaN";
10895
+ }
10896
+ else if (1 / 0 === object) switch(style){
10897
+ case "lowercase":
10898
+ return ".inf";
10899
+ case "uppercase":
10900
+ return ".INF";
10901
+ case "camelcase":
10902
+ return ".Inf";
10903
+ }
10904
+ else if (-1 / 0 === object) switch(style){
10905
+ case "lowercase":
10906
+ return "-.inf";
10907
+ case "uppercase":
10908
+ return "-.INF";
10909
+ case "camelcase":
10910
+ return "-.Inf";
10911
+ }
10912
+ else if (common2.isNegativeZero(object)) return "-0.0";
10913
+ const res = object.toString(10);
10914
+ return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
10915
+ }
10916
+ function isFloat(object) {
10917
+ return "[object Number]" === Object.prototype.toString.call(object) && (object % 1 !== 0 || common2.isNegativeZero(object));
10918
+ }
10919
+ js_yaml_float = new Type2("tag:yaml.org,2002:float", {
10920
+ kind: "scalar",
10921
+ resolve: resolveYamlFloat,
10922
+ construct: constructYamlFloat,
10923
+ predicate: isFloat,
10924
+ represent: representYamlFloat,
10925
+ defaultStyle: "lowercase"
10926
+ });
10927
+ return js_yaml_float;
10928
+ }
10929
+ var json;
10930
+ var hasRequiredJson;
10931
+ function requireJson() {
10932
+ if (hasRequiredJson) return json;
10933
+ hasRequiredJson = 1;
10934
+ json = requireFailsafe().extend({
10935
+ implicit: [
10936
+ require_null(),
10937
+ requireBool(),
10938
+ requireInt(),
10939
+ requireFloat()
10776
10940
  ]
10941
+ });
10942
+ return json;
10943
+ }
10944
+ var core;
10945
+ var hasRequiredCore;
10946
+ function requireCore() {
10947
+ if (hasRequiredCore) return core;
10948
+ hasRequiredCore = 1;
10949
+ core = requireJson();
10950
+ return core;
10951
+ }
10952
+ var js_yaml_timestamp;
10953
+ var hasRequiredTimestamp;
10954
+ function requireTimestamp() {
10955
+ if (hasRequiredTimestamp) return js_yaml_timestamp;
10956
+ hasRequiredTimestamp = 1;
10957
+ const Type2 = requireType();
10958
+ const YAML_DATE_REGEXP = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$");
10959
+ const YAML_TIMESTAMP_REGEXP = 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]))?))?$");
10960
+ function resolveYamlTimestamp(data) {
10961
+ if (null === data) return false;
10962
+ if (null !== YAML_DATE_REGEXP.exec(data)) return true;
10963
+ if (null !== YAML_TIMESTAMP_REGEXP.exec(data)) return true;
10964
+ return false;
10777
10965
  }
10778
- });
10779
- var YAML_FLOAT_PATTERN = new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
10780
- function resolveYamlFloat(data) {
10781
- if (null === data) return false;
10782
- if (!YAML_FLOAT_PATTERN.test(data) || '_' === data[data.length - 1]) return false;
10783
- return true;
10784
- }
10785
- function constructYamlFloat(data) {
10786
- var value, sign;
10787
- value = data.replace(/_/g, '').toLowerCase();
10788
- sign = '-' === value[0] ? -1 : 1;
10789
- if ('+-'.indexOf(value[0]) >= 0) value = value.slice(1);
10790
- if ('.inf' === value) return 1 === sign ? 1 / 0 : -1 / 0;
10791
- if ('.nan' === value) return NaN;
10792
- return sign * parseFloat(value, 10);
10793
- }
10794
- var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
10795
- function representYamlFloat(object, style) {
10796
- var res;
10797
- if (isNaN(object)) switch(style){
10798
- case 'lowercase':
10799
- return '.nan';
10800
- case 'uppercase':
10801
- return '.NAN';
10802
- case 'camelcase':
10803
- return '.NaN';
10804
- }
10805
- else if (1 / 0 === object) switch(style){
10806
- case 'lowercase':
10807
- return '.inf';
10808
- case 'uppercase':
10809
- return '.INF';
10810
- case 'camelcase':
10811
- return '.Inf';
10812
- }
10813
- else if (-1 / 0 === object) switch(style){
10814
- case 'lowercase':
10815
- return '-.inf';
10816
- case 'uppercase':
10817
- return '-.INF';
10818
- case 'camelcase':
10819
- return '-.Inf';
10820
- }
10821
- else if (common.isNegativeZero(object)) return '-0.0';
10822
- res = object.toString(10);
10823
- return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
10824
- }
10825
- function isFloat(object) {
10826
- return '[object Number]' === Object.prototype.toString.call(object) && (object % 1 !== 0 || common.isNegativeZero(object));
10827
- }
10828
- var js_yaml_float = new js_yaml_type('tag:yaml.org,2002:float', {
10829
- kind: 'scalar',
10830
- resolve: resolveYamlFloat,
10831
- construct: constructYamlFloat,
10832
- predicate: isFloat,
10833
- represent: representYamlFloat,
10834
- defaultStyle: 'lowercase'
10835
- });
10836
- var json = failsafe.extend({
10837
- implicit: [
10838
- _null,
10839
- bool,
10840
- js_yaml_int,
10841
- js_yaml_float
10842
- ]
10843
- });
10844
- var core = json;
10845
- var YAML_DATE_REGEXP = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$");
10846
- var YAML_TIMESTAMP_REGEXP = 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]))?))?$");
10847
- function resolveYamlTimestamp(data) {
10848
- if (null === data) return false;
10849
- if (null !== YAML_DATE_REGEXP.exec(data)) return true;
10850
- if (null !== YAML_TIMESTAMP_REGEXP.exec(data)) return true;
10851
- return false;
10852
- }
10853
- function constructYamlTimestamp(data) {
10854
- var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
10855
- match = YAML_DATE_REGEXP.exec(data);
10856
- if (null === match) match = YAML_TIMESTAMP_REGEXP.exec(data);
10857
- if (null === match) throw new Error('Date resolve error');
10858
- year = +match[1];
10859
- month = match[2] - 1;
10860
- day = +match[3];
10861
- if (!match[4]) return new Date(Date.UTC(year, month, day));
10862
- hour = +match[4];
10863
- minute = +match[5];
10864
- second = +match[6];
10865
- if (match[7]) {
10866
- fraction = match[7].slice(0, 3);
10867
- while(fraction.length < 3)fraction += '0';
10868
- fraction *= 1;
10869
- }
10870
- if (match[9]) {
10871
- tz_hour = +match[10];
10872
- tz_minute = +(match[11] || 0);
10873
- delta = (60 * tz_hour + tz_minute) * 60000;
10874
- if ('-' === match[9]) delta = -delta;
10875
- }
10876
- date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
10877
- if (delta) date.setTime(date.getTime() - delta);
10878
- return date;
10879
- }
10880
- function representYamlTimestamp(object) {
10881
- return object.toISOString();
10882
- }
10883
- var js_yaml_timestamp = new js_yaml_type('tag:yaml.org,2002:timestamp', {
10884
- kind: 'scalar',
10885
- resolve: resolveYamlTimestamp,
10886
- construct: constructYamlTimestamp,
10887
- instanceOf: Date,
10888
- represent: representYamlTimestamp
10889
- });
10890
- function resolveYamlMerge(data) {
10891
- return '<<' === data || null === data;
10892
- }
10893
- var merge = new js_yaml_type('tag:yaml.org,2002:merge', {
10894
- kind: 'scalar',
10895
- resolve: resolveYamlMerge
10896
- });
10897
- var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
10898
- function resolveYamlBinary(data) {
10899
- if (null === data) return false;
10900
- var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
10901
- for(idx = 0; idx < max; idx++){
10902
- code = map.indexOf(data.charAt(idx));
10903
- if (!(code > 64)) {
10904
- if (code < 0) return false;
10905
- bitlen += 6;
10906
- }
10907
- }
10908
- return bitlen % 8 === 0;
10909
- }
10910
- function constructYamlBinary(data) {
10911
- var idx, tailbits, input = data.replace(/[\r\n=]/g, ''), max = input.length, map = BASE64_MAP, bits = 0, result = [];
10912
- for(idx = 0; idx < max; idx++){
10913
- if (idx % 4 === 0 && idx) {
10914
- result.push(bits >> 16 & 0xFF);
10915
- result.push(bits >> 8 & 0xFF);
10916
- result.push(0xFF & bits);
10917
- }
10918
- bits = bits << 6 | map.indexOf(input.charAt(idx));
10919
- }
10920
- tailbits = max % 4 * 6;
10921
- if (0 === tailbits) {
10922
- result.push(bits >> 16 & 0xFF);
10923
- result.push(bits >> 8 & 0xFF);
10924
- result.push(0xFF & bits);
10925
- } else if (18 === tailbits) {
10926
- result.push(bits >> 10 & 0xFF);
10927
- result.push(bits >> 2 & 0xFF);
10928
- } else if (12 === tailbits) result.push(bits >> 4 & 0xFF);
10929
- return new Uint8Array(result);
10930
- }
10931
- function representYamlBinary(object) {
10932
- var result = '', bits = 0, idx, tail, max = object.length, map = BASE64_MAP;
10933
- for(idx = 0; idx < max; idx++){
10934
- if (idx % 3 === 0 && idx) {
10935
- result += map[bits >> 18 & 0x3F];
10936
- result += map[bits >> 12 & 0x3F];
10937
- result += map[bits >> 6 & 0x3F];
10938
- result += map[0x3F & bits];
10939
- }
10940
- bits = (bits << 8) + object[idx];
10941
- }
10942
- tail = max % 3;
10943
- if (0 === tail) {
10944
- result += map[bits >> 18 & 0x3F];
10945
- result += map[bits >> 12 & 0x3F];
10946
- result += map[bits >> 6 & 0x3F];
10947
- result += map[0x3F & bits];
10948
- } else if (2 === tail) {
10949
- result += map[bits >> 10 & 0x3F];
10950
- result += map[bits >> 4 & 0x3F];
10951
- result += map[bits << 2 & 0x3F];
10952
- result += map[64];
10953
- } else if (1 === tail) {
10954
- result += map[bits >> 2 & 0x3F];
10955
- result += map[bits << 4 & 0x3F];
10956
- result += map[64];
10957
- result += map[64];
10966
+ function constructYamlTimestamp(data) {
10967
+ let fraction = 0;
10968
+ let delta = null;
10969
+ let match = YAML_DATE_REGEXP.exec(data);
10970
+ if (null === match) match = YAML_TIMESTAMP_REGEXP.exec(data);
10971
+ if (null === match) throw new Error("Date resolve error");
10972
+ const year = +match[1];
10973
+ const month = match[2] - 1;
10974
+ const day = +match[3];
10975
+ if (!match[4]) return new Date(Date.UTC(year, month, day));
10976
+ const hour = +match[4];
10977
+ const minute = +match[5];
10978
+ const second = +match[6];
10979
+ if (match[7]) {
10980
+ fraction = match[7].slice(0, 3);
10981
+ while(fraction.length < 3)fraction += "0";
10982
+ fraction *= 1;
10983
+ }
10984
+ if (match[9]) {
10985
+ const tzHour = +match[10];
10986
+ const tzMinute = +(match[11] || 0);
10987
+ delta = (60 * tzHour + tzMinute) * 6e4;
10988
+ if ("-" === match[9]) delta = -delta;
10989
+ }
10990
+ const date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
10991
+ if (delta) date.setTime(date.getTime() - delta);
10992
+ return date;
10993
+ }
10994
+ function representYamlTimestamp(object) {
10995
+ return object.toISOString();
10996
+ }
10997
+ js_yaml_timestamp = new Type2("tag:yaml.org,2002:timestamp", {
10998
+ kind: "scalar",
10999
+ resolve: resolveYamlTimestamp,
11000
+ construct: constructYamlTimestamp,
11001
+ instanceOf: Date,
11002
+ represent: representYamlTimestamp
11003
+ });
11004
+ return js_yaml_timestamp;
11005
+ }
11006
+ var merge;
11007
+ var hasRequiredMerge;
11008
+ function requireMerge() {
11009
+ if (hasRequiredMerge) return merge;
11010
+ hasRequiredMerge = 1;
11011
+ const Type2 = requireType();
11012
+ function resolveYamlMerge(data) {
11013
+ return "<<" === data || null === data;
11014
+ }
11015
+ merge = new Type2("tag:yaml.org,2002:merge", {
11016
+ kind: "scalar",
11017
+ resolve: resolveYamlMerge
11018
+ });
11019
+ return merge;
11020
+ }
11021
+ var binary;
11022
+ var hasRequiredBinary;
11023
+ function requireBinary() {
11024
+ if (hasRequiredBinary) return binary;
11025
+ hasRequiredBinary = 1;
11026
+ const Type2 = requireType();
11027
+ const BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
11028
+ function resolveYamlBinary(data) {
11029
+ if (null === data) return false;
11030
+ let bitlen = 0;
11031
+ const max = data.length;
11032
+ const map2 = BASE64_MAP;
11033
+ for(let idx = 0; idx < max; idx++){
11034
+ const code = map2.indexOf(data.charAt(idx));
11035
+ if (!(code > 64)) {
11036
+ if (code < 0) return false;
11037
+ bitlen += 6;
11038
+ }
11039
+ }
11040
+ return bitlen % 8 === 0;
11041
+ }
11042
+ function constructYamlBinary(data) {
11043
+ const input = data.replace(/[\r\n=]/g, "");
11044
+ const max = input.length;
11045
+ const map2 = BASE64_MAP;
11046
+ let bits = 0;
11047
+ const result = [];
11048
+ for(let idx = 0; idx < max; idx++){
11049
+ if (idx % 4 === 0 && idx) {
11050
+ result.push(bits >> 16 & 255);
11051
+ result.push(bits >> 8 & 255);
11052
+ result.push(255 & bits);
11053
+ }
11054
+ bits = bits << 6 | map2.indexOf(input.charAt(idx));
11055
+ }
11056
+ const tailbits = max % 4 * 6;
11057
+ if (0 === tailbits) {
11058
+ result.push(bits >> 16 & 255);
11059
+ result.push(bits >> 8 & 255);
11060
+ result.push(255 & bits);
11061
+ } else if (18 === tailbits) {
11062
+ result.push(bits >> 10 & 255);
11063
+ result.push(bits >> 2 & 255);
11064
+ } else if (12 === tailbits) result.push(bits >> 4 & 255);
11065
+ return new Uint8Array(result);
11066
+ }
11067
+ function representYamlBinary(object) {
11068
+ let result = "";
11069
+ let bits = 0;
11070
+ const max = object.length;
11071
+ const map2 = BASE64_MAP;
11072
+ for(let idx = 0; idx < max; idx++){
11073
+ if (idx % 3 === 0 && idx) {
11074
+ result += map2[bits >> 18 & 63];
11075
+ result += map2[bits >> 12 & 63];
11076
+ result += map2[bits >> 6 & 63];
11077
+ result += map2[63 & bits];
11078
+ }
11079
+ bits = (bits << 8) + object[idx];
11080
+ }
11081
+ const tail = max % 3;
11082
+ if (0 === tail) {
11083
+ result += map2[bits >> 18 & 63];
11084
+ result += map2[bits >> 12 & 63];
11085
+ result += map2[bits >> 6 & 63];
11086
+ result += map2[63 & bits];
11087
+ } else if (2 === tail) {
11088
+ result += map2[bits >> 10 & 63];
11089
+ result += map2[bits >> 4 & 63];
11090
+ result += map2[bits << 2 & 63];
11091
+ result += map2[64];
11092
+ } else if (1 === tail) {
11093
+ result += map2[bits >> 2 & 63];
11094
+ result += map2[bits << 4 & 63];
11095
+ result += map2[64];
11096
+ result += map2[64];
11097
+ }
11098
+ return result;
10958
11099
  }
10959
- return result;
10960
- }
10961
- function isBinary(obj) {
10962
- return '[object Uint8Array]' === Object.prototype.toString.call(obj);
10963
- }
10964
- var binary = new js_yaml_type('tag:yaml.org,2002:binary', {
10965
- kind: 'scalar',
10966
- resolve: resolveYamlBinary,
10967
- construct: constructYamlBinary,
10968
- predicate: isBinary,
10969
- represent: representYamlBinary
10970
- });
10971
- var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
10972
- var _toString$2 = Object.prototype.toString;
10973
- function resolveYamlOmap(data) {
10974
- if (null === data) return true;
10975
- var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
10976
- for(index = 0, length = object.length; index < length; index += 1){
10977
- pair = object[index];
10978
- pairHasKey = false;
10979
- if ('[object Object]' !== _toString$2.call(pair)) return false;
10980
- for(pairKey in pair)if (_hasOwnProperty$3.call(pair, pairKey)) if (pairHasKey) return false;
10981
- else pairHasKey = true;
10982
- if (!pairHasKey) return false;
10983
- if (-1 !== objectKeys.indexOf(pairKey)) return false;
10984
- objectKeys.push(pairKey);
10985
- }
10986
- return true;
10987
- }
10988
- function constructYamlOmap(data) {
10989
- return null !== data ? data : [];
10990
- }
10991
- var omap = new js_yaml_type('tag:yaml.org,2002:omap', {
10992
- kind: 'sequence',
10993
- resolve: resolveYamlOmap,
10994
- construct: constructYamlOmap
10995
- });
10996
- var _toString$1 = Object.prototype.toString;
10997
- function resolveYamlPairs(data) {
10998
- if (null === data) return true;
10999
- var index, length, pair, keys, result, object = data;
11000
- result = new Array(object.length);
11001
- for(index = 0, length = object.length; index < length; index += 1){
11002
- pair = object[index];
11003
- if ('[object Object]' !== _toString$1.call(pair)) return false;
11004
- keys = Object.keys(pair);
11005
- if (1 !== keys.length) return false;
11006
- result[index] = [
11007
- keys[0],
11008
- pair[keys[0]]
11009
- ];
11100
+ function isBinary(obj) {
11101
+ return "[object Uint8Array]" === Object.prototype.toString.call(obj);
11010
11102
  }
11011
- return true;
11012
- }
11013
- function constructYamlPairs(data) {
11014
- if (null === data) return [];
11015
- var index, length, pair, keys, result, object = data;
11016
- result = new Array(object.length);
11017
- for(index = 0, length = object.length; index < length; index += 1){
11018
- pair = object[index];
11019
- keys = Object.keys(pair);
11020
- result[index] = [
11021
- keys[0],
11022
- pair[keys[0]]
11023
- ];
11103
+ binary = new Type2("tag:yaml.org,2002:binary", {
11104
+ kind: "scalar",
11105
+ resolve: resolveYamlBinary,
11106
+ construct: constructYamlBinary,
11107
+ predicate: isBinary,
11108
+ represent: representYamlBinary
11109
+ });
11110
+ return binary;
11111
+ }
11112
+ var omap;
11113
+ var hasRequiredOmap;
11114
+ function requireOmap() {
11115
+ if (hasRequiredOmap) return omap;
11116
+ hasRequiredOmap = 1;
11117
+ const Type2 = requireType();
11118
+ const _hasOwnProperty = Object.prototype.hasOwnProperty;
11119
+ const _toString = Object.prototype.toString;
11120
+ function resolveYamlOmap(data) {
11121
+ if (null === data) return true;
11122
+ const objectKeys = {};
11123
+ const object = data;
11124
+ for(let index = 0, length = object.length; index < length; index += 1){
11125
+ const pair = object[index];
11126
+ let pairHasKey = false;
11127
+ if ("[object Object]" !== _toString.call(pair)) return false;
11128
+ let pairKey;
11129
+ for(pairKey in pair)if (_hasOwnProperty.call(pair, pairKey)) if (pairHasKey) return false;
11130
+ else pairHasKey = true;
11131
+ if (!pairHasKey) return false;
11132
+ if (_hasOwnProperty.call(objectKeys, pairKey)) return false;
11133
+ Object.defineProperty(objectKeys, pairKey, {
11134
+ value: true
11135
+ });
11136
+ }
11137
+ return true;
11024
11138
  }
11025
- return result;
11026
- }
11027
- var pairs = new js_yaml_type('tag:yaml.org,2002:pairs', {
11028
- kind: 'sequence',
11029
- resolve: resolveYamlPairs,
11030
- construct: constructYamlPairs
11031
- });
11032
- var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
11033
- function resolveYamlSet(data) {
11034
- if (null === data) return true;
11035
- var key, object = data;
11036
- for(key in object)if (_hasOwnProperty$2.call(object, key)) {
11037
- if (null !== object[key]) return false;
11038
- }
11039
- return true;
11040
- }
11041
- function constructYamlSet(data) {
11042
- return null !== data ? data : {};
11043
- }
11044
- var js_yaml_set = new js_yaml_type('tag:yaml.org,2002:set', {
11045
- kind: 'mapping',
11046
- resolve: resolveYamlSet,
11047
- construct: constructYamlSet
11048
- });
11049
- var _default = core.extend({
11050
- implicit: [
11051
- js_yaml_timestamp,
11052
- merge
11053
- ],
11054
- explicit: [
11055
- binary,
11056
- omap,
11057
- pairs,
11058
- js_yaml_set
11059
- ]
11060
- });
11061
- var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
11062
- var CONTEXT_FLOW_IN = 1;
11063
- var CONTEXT_FLOW_OUT = 2;
11064
- var CONTEXT_BLOCK_IN = 3;
11065
- var CONTEXT_BLOCK_OUT = 4;
11066
- var CHOMPING_CLIP = 1;
11067
- var CHOMPING_STRIP = 2;
11068
- var CHOMPING_KEEP = 3;
11069
- var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
11070
- var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
11071
- var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
11072
- var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
11073
- var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
11074
- function _class(obj) {
11075
- return Object.prototype.toString.call(obj);
11076
- }
11077
- function is_EOL(c) {
11078
- return 0x0A === c || 0x0D === c;
11079
- }
11080
- function is_WHITE_SPACE(c) {
11081
- return 0x09 === c || 0x20 === c;
11082
- }
11083
- function is_WS_OR_EOL(c) {
11084
- return 0x09 === c || 0x20 === c || 0x0A === c || 0x0D === c;
11085
- }
11086
- function is_FLOW_INDICATOR(c) {
11087
- return 0x2C === c || 0x5B === c || 0x5D === c || 0x7B === c || 0x7D === c;
11088
- }
11089
- function fromHexCode(c) {
11090
- var lc;
11091
- if (0x30 <= c && c <= 0x39) return c - 0x30;
11092
- lc = 0x20 | c;
11093
- if (0x61 <= lc && lc <= 0x66) return lc - 0x61 + 10;
11094
- return -1;
11095
- }
11096
- function escapedHexLen(c) {
11097
- if (0x78 === c) return 2;
11098
- if (0x75 === c) return 4;
11099
- if (0x55 === c) return 8;
11100
- return 0;
11101
- }
11102
- function fromDecimalCode(c) {
11103
- if (0x30 <= c && c <= 0x39) return c - 0x30;
11104
- return -1;
11105
- }
11106
- function simpleEscapeSequence(c) {
11107
- return 0x30 === c ? '\x00' : 0x61 === c ? '\x07' : 0x62 === c ? '\x08' : 0x74 === c ? '\x09' : 0x09 === c ? '\x09' : 0x6E === c ? '\x0A' : 0x76 === c ? '\x0B' : 0x66 === c ? '\x0C' : 0x72 === c ? '\x0D' : 0x65 === c ? '\x1B' : 0x20 === c ? ' ' : 0x22 === c ? '\x22' : 0x2F === c ? '/' : 0x5C === c ? '\x5C' : 0x4E === c ? '\x85' : 0x5F === c ? '\xA0' : 0x4C === c ? '\u2028' : 0x50 === c ? '\u2029' : '';
11108
- }
11109
- function charFromCodepoint(c) {
11110
- if (c <= 0xFFFF) return String.fromCharCode(c);
11111
- return String.fromCharCode((c - 0x010000 >> 10) + 0xD800, (c - 0x010000 & 0x03FF) + 0xDC00);
11112
- }
11113
- var simpleEscapeCheck = new Array(256);
11114
- var simpleEscapeMap = new Array(256);
11115
- for(var js_yaml_i = 0; js_yaml_i < 256; js_yaml_i++){
11116
- simpleEscapeCheck[js_yaml_i] = simpleEscapeSequence(js_yaml_i) ? 1 : 0;
11117
- simpleEscapeMap[js_yaml_i] = simpleEscapeSequence(js_yaml_i);
11118
- }
11119
- function State$1(input, options) {
11120
- this.input = input;
11121
- this.filename = options['filename'] || null;
11122
- this.schema = options['schema'] || _default;
11123
- this.onWarning = options['onWarning'] || null;
11124
- this.legacy = options['legacy'] || false;
11125
- this.json = options['json'] || false;
11126
- this.listener = options['listener'] || null;
11127
- this.implicitTypes = this.schema.compiledImplicit;
11128
- this.typeMap = this.schema.compiledTypeMap;
11129
- this.length = input.length;
11130
- this.position = 0;
11131
- this.line = 0;
11132
- this.lineStart = 0;
11133
- this.lineIndent = 0;
11134
- this.firstTabInLine = -1;
11135
- this.documents = [];
11136
- }
11137
- function generateError(state, message) {
11138
- var mark = {
11139
- name: state.filename,
11140
- buffer: state.input.slice(0, -1),
11141
- position: state.position,
11142
- line: state.line,
11143
- column: state.position - state.lineStart
11144
- };
11145
- mark.snippet = snippet(mark);
11146
- return new js_yaml_exception(message, mark);
11147
- }
11148
- function throwError(state, message) {
11149
- throw generateError(state, message);
11150
- }
11151
- function throwWarning(state, message) {
11152
- if (state.onWarning) state.onWarning.call(null, generateError(state, message));
11153
- }
11154
- var directiveHandlers = {
11155
- YAML: function(state, name, args) {
11156
- var match, major, minor;
11157
- if (null !== state.version) throwError(state, 'duplication of %YAML directive');
11158
- if (1 !== args.length) throwError(state, 'YAML directive accepts exactly one argument');
11159
- match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
11160
- if (null === match) throwError(state, 'ill-formed argument of the YAML directive');
11161
- major = parseInt(match[1], 10);
11162
- minor = parseInt(match[2], 10);
11163
- if (1 !== major) throwError(state, 'unacceptable YAML version of the document');
11164
- state.version = args[0];
11165
- state.checkLineBreaks = minor < 2;
11166
- if (1 !== minor && 2 !== minor) throwWarning(state, 'unsupported YAML version of the document');
11167
- },
11168
- TAG: function(state, name, args) {
11169
- var handle, prefix;
11170
- if (2 !== args.length) throwError(state, 'TAG directive accepts exactly two arguments');
11171
- handle = args[0];
11172
- prefix = args[1];
11173
- if (!PATTERN_TAG_HANDLE.test(handle)) throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
11174
- if (_hasOwnProperty$1.call(state.tagMap, handle)) throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
11175
- if (!PATTERN_TAG_URI.test(prefix)) throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
11176
- try {
11177
- prefix = decodeURIComponent(prefix);
11178
- } catch (err) {
11179
- throwError(state, 'tag prefix is malformed: ' + prefix);
11139
+ function constructYamlOmap(data) {
11140
+ return null !== data ? data : [];
11141
+ }
11142
+ omap = new Type2("tag:yaml.org,2002:omap", {
11143
+ kind: "sequence",
11144
+ resolve: resolveYamlOmap,
11145
+ construct: constructYamlOmap
11146
+ });
11147
+ return omap;
11148
+ }
11149
+ var pairs;
11150
+ var hasRequiredPairs;
11151
+ function requirePairs() {
11152
+ if (hasRequiredPairs) return pairs;
11153
+ hasRequiredPairs = 1;
11154
+ const Type2 = requireType();
11155
+ const _toString = Object.prototype.toString;
11156
+ function resolveYamlPairs(data) {
11157
+ if (null === data) return true;
11158
+ const object = data;
11159
+ const result = new Array(object.length);
11160
+ for(let index = 0, length = object.length; index < length; index += 1){
11161
+ const pair = object[index];
11162
+ if ("[object Object]" !== _toString.call(pair)) return false;
11163
+ const keys = Object.keys(pair);
11164
+ if (1 !== keys.length) return false;
11165
+ result[index] = [
11166
+ keys[0],
11167
+ pair[keys[0]]
11168
+ ];
11180
11169
  }
11181
- state.tagMap[handle] = prefix;
11170
+ return true;
11182
11171
  }
11183
- };
11184
- function captureSegment(state, start, end, checkJson) {
11185
- var _position, _length, _character, _result;
11186
- if (start < end) {
11187
- _result = state.input.slice(start, end);
11188
- if (checkJson) for(_position = 0, _length = _result.length; _position < _length; _position += 1){
11189
- _character = _result.charCodeAt(_position);
11190
- if (!(0x09 === _character || 0x20 <= _character && _character <= 0x10FFFF)) throwError(state, 'expected valid JSON character');
11172
+ function constructYamlPairs(data) {
11173
+ if (null === data) return [];
11174
+ const object = data;
11175
+ const result = new Array(object.length);
11176
+ for(let index = 0, length = object.length; index < length; index += 1){
11177
+ const pair = object[index];
11178
+ const keys = Object.keys(pair);
11179
+ result[index] = [
11180
+ keys[0],
11181
+ pair[keys[0]]
11182
+ ];
11191
11183
  }
11192
- else if (PATTERN_NON_PRINTABLE.test(_result)) throwError(state, 'the stream contains non-printable characters');
11193
- state.result += _result;
11184
+ return result;
11194
11185
  }
11195
- }
11196
- function mergeMappings(state, destination, source, overridableKeys) {
11197
- var sourceKeys, key, index, quantity;
11198
- if (!common.isObject(source)) throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
11199
- sourceKeys = Object.keys(source);
11200
- for(index = 0, quantity = sourceKeys.length; index < quantity; index += 1){
11201
- key = sourceKeys[index];
11202
- if (!_hasOwnProperty$1.call(destination, key)) {
11203
- destination[key] = source[key];
11204
- overridableKeys[key] = true;
11186
+ pairs = new Type2("tag:yaml.org,2002:pairs", {
11187
+ kind: "sequence",
11188
+ resolve: resolveYamlPairs,
11189
+ construct: constructYamlPairs
11190
+ });
11191
+ return pairs;
11192
+ }
11193
+ var js_yaml_set;
11194
+ var hasRequiredSet;
11195
+ function requireSet() {
11196
+ if (hasRequiredSet) return js_yaml_set;
11197
+ hasRequiredSet = 1;
11198
+ const Type2 = requireType();
11199
+ const _hasOwnProperty = Object.prototype.hasOwnProperty;
11200
+ function resolveYamlSet(data) {
11201
+ if (null === data) return true;
11202
+ const object = data;
11203
+ for(const key in object)if (_hasOwnProperty.call(object, key)) {
11204
+ if (null !== object[key]) return false;
11205
11205
  }
11206
+ return true;
11206
11207
  }
11207
- }
11208
- function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
11209
- var index, quantity;
11210
- if (Array.isArray(keyNode)) {
11211
- keyNode = Array.prototype.slice.call(keyNode);
11212
- for(index = 0, quantity = keyNode.length; index < quantity; index += 1){
11213
- if (Array.isArray(keyNode[index])) throwError(state, 'nested arrays are not supported inside keys');
11214
- if ('object' == typeof keyNode && '[object Object]' === _class(keyNode[index])) keyNode[index] = '[object Object]';
11215
- }
11216
- }
11217
- if ('object' == typeof keyNode && '[object Object]' === _class(keyNode)) keyNode = '[object Object]';
11218
- keyNode = String(keyNode);
11219
- if (null === _result) _result = {};
11220
- if ('tag:yaml.org,2002:merge' === keyTag) if (Array.isArray(valueNode)) for(index = 0, quantity = valueNode.length; index < quantity; index += 1)mergeMappings(state, _result, valueNode[index], overridableKeys);
11221
- else mergeMappings(state, _result, valueNode, overridableKeys);
11222
- else {
11223
- if (!state.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) {
11224
- state.line = startLine || state.line;
11225
- state.lineStart = startLineStart || state.lineStart;
11226
- state.position = startPos || state.position;
11227
- throwError(state, 'duplicated mapping key');
11208
+ function constructYamlSet(data) {
11209
+ return null !== data ? data : {};
11210
+ }
11211
+ js_yaml_set = new Type2("tag:yaml.org,2002:set", {
11212
+ kind: "mapping",
11213
+ resolve: resolveYamlSet,
11214
+ construct: constructYamlSet
11215
+ });
11216
+ return js_yaml_set;
11217
+ }
11218
+ var _default;
11219
+ var hasRequired_default;
11220
+ function require_default() {
11221
+ if (hasRequired_default) return _default;
11222
+ hasRequired_default = 1;
11223
+ _default = requireCore().extend({
11224
+ implicit: [
11225
+ requireTimestamp(),
11226
+ requireMerge()
11227
+ ],
11228
+ explicit: [
11229
+ requireBinary(),
11230
+ requireOmap(),
11231
+ requirePairs(),
11232
+ requireSet()
11233
+ ]
11234
+ });
11235
+ return _default;
11236
+ }
11237
+ var hasRequiredLoader;
11238
+ function requireLoader() {
11239
+ if (hasRequiredLoader) return loader;
11240
+ hasRequiredLoader = 1;
11241
+ const common2 = requireCommon();
11242
+ const YAMLException2 = requireException();
11243
+ const makeSnippet = requireSnippet();
11244
+ const DEFAULT_SCHEMA2 = require_default();
11245
+ const _hasOwnProperty = Object.prototype.hasOwnProperty;
11246
+ const CONTEXT_FLOW_IN = 1;
11247
+ const CONTEXT_FLOW_OUT = 2;
11248
+ const CONTEXT_BLOCK_IN = 3;
11249
+ const CONTEXT_BLOCK_OUT = 4;
11250
+ const CHOMPING_CLIP = 1;
11251
+ const CHOMPING_STRIP = 2;
11252
+ const CHOMPING_KEEP = 3;
11253
+ const PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
11254
+ const PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
11255
+ const PATTERN_FLOW_INDICATORS = /[,\[\]{}]/;
11256
+ const PATTERN_TAG_HANDLE = /^(?:!|!!|![0-9A-Za-z-]+!)$/;
11257
+ const PATTERN_TAG_URI = /^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;
11258
+ function _class(obj) {
11259
+ return Object.prototype.toString.call(obj);
11260
+ }
11261
+ function isEol(c) {
11262
+ return 10 === c || 13 === c;
11263
+ }
11264
+ function isWhiteSpace(c) {
11265
+ return 9 === c || 32 === c;
11266
+ }
11267
+ function isWsOrEol(c) {
11268
+ return 9 === c || 32 === c || 10 === c || 13 === c;
11269
+ }
11270
+ function isFlowIndicator(c) {
11271
+ return 44 === c || 91 === c || 93 === c || 123 === c || 125 === c;
11272
+ }
11273
+ function fromHexCode(c) {
11274
+ if (c >= 48 && c <= 57) return c - 48;
11275
+ const lc = 32 | c;
11276
+ if (lc >= 97 && lc <= 102) return lc - 97 + 10;
11277
+ return -1;
11278
+ }
11279
+ function escapedHexLen(c) {
11280
+ if (120 === c) return 2;
11281
+ if (117 === c) return 4;
11282
+ if (85 === c) return 8;
11283
+ return 0;
11284
+ }
11285
+ function fromDecimalCode(c) {
11286
+ if (c >= 48 && c <= 57) return c - 48;
11287
+ return -1;
11288
+ }
11289
+ function simpleEscapeSequence(c) {
11290
+ switch(c){
11291
+ case 48:
11292
+ return "\0";
11293
+ case 97:
11294
+ return "\x07";
11295
+ case 98:
11296
+ return "\b";
11297
+ case 116:
11298
+ return " ";
11299
+ case 9:
11300
+ return " ";
11301
+ case 110:
11302
+ return "\n";
11303
+ case 118:
11304
+ return "\v";
11305
+ case 102:
11306
+ return "\f";
11307
+ case 114:
11308
+ return "\r";
11309
+ case 101:
11310
+ return "\x1B";
11311
+ case 32:
11312
+ return " ";
11313
+ case 34:
11314
+ return '"';
11315
+ case 47:
11316
+ return "/";
11317
+ case 92:
11318
+ return "\\";
11319
+ case 78:
11320
+ return "…";
11321
+ case 95:
11322
+ return " ";
11323
+ case 76:
11324
+ return "\u2028";
11325
+ case 80:
11326
+ return "\u2029";
11327
+ default:
11328
+ return "";
11228
11329
  }
11229
- if ('__proto__' === keyNode) Object.defineProperty(_result, keyNode, {
11330
+ }
11331
+ function charFromCodepoint(c) {
11332
+ if (c <= 65535) return String.fromCharCode(c);
11333
+ return String.fromCharCode((c - 65536 >> 10) + 55296, (c - 65536 & 1023) + 56320);
11334
+ }
11335
+ function setProperty(object, key, value) {
11336
+ if ("__proto__" === key) Object.defineProperty(object, key, {
11230
11337
  configurable: true,
11231
11338
  enumerable: true,
11232
11339
  writable: true,
11233
- value: valueNode
11340
+ value
11234
11341
  });
11235
- else _result[keyNode] = valueNode;
11236
- delete overridableKeys[keyNode];
11342
+ else object[key] = value;
11343
+ }
11344
+ const simpleEscapeCheck = new Array(256);
11345
+ const simpleEscapeMap = new Array(256);
11346
+ for(let i = 0; i < 256; i++){
11347
+ simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
11348
+ simpleEscapeMap[i] = simpleEscapeSequence(i);
11349
+ }
11350
+ function State(input, options) {
11351
+ this.input = input;
11352
+ this.filename = options["filename"] || null;
11353
+ this.schema = options["schema"] || DEFAULT_SCHEMA2;
11354
+ this.onWarning = options["onWarning"] || null;
11355
+ this.legacy = options["legacy"] || false;
11356
+ this.json = options["json"] || false;
11357
+ this.listener = options["listener"] || null;
11358
+ this.maxDepth = "number" == typeof options["maxDepth"] ? options["maxDepth"] : 100;
11359
+ this.maxTotalMergeKeys = "number" == typeof options["maxTotalMergeKeys"] ? options["maxTotalMergeKeys"] : 1e4;
11360
+ this.implicitTypes = this.schema.compiledImplicit;
11361
+ this.typeMap = this.schema.compiledTypeMap;
11362
+ this.length = input.length;
11363
+ this.position = 0;
11364
+ this.line = 0;
11365
+ this.lineStart = 0;
11366
+ this.lineIndent = 0;
11367
+ this.depth = 0;
11368
+ this.totalMergeKeys = 0;
11369
+ this.firstTabInLine = -1;
11370
+ this.documents = [];
11371
+ this.anchorMapTransactions = [];
11372
+ }
11373
+ function generateError(state, message) {
11374
+ const mark = {
11375
+ name: state.filename,
11376
+ buffer: state.input.slice(0, -1),
11377
+ position: state.position,
11378
+ line: state.line,
11379
+ column: state.position - state.lineStart
11380
+ };
11381
+ mark.snippet = makeSnippet(mark);
11382
+ return new YAMLException2(message, mark);
11383
+ }
11384
+ function throwError(state, message) {
11385
+ throw generateError(state, message);
11386
+ }
11387
+ function throwWarning(state, message) {
11388
+ if (state.onWarning) state.onWarning.call(null, generateError(state, message));
11389
+ }
11390
+ function storeAnchor(state, name, value) {
11391
+ const transactions = state.anchorMapTransactions;
11392
+ if (0 !== transactions.length) {
11393
+ const transaction = transactions[transactions.length - 1];
11394
+ if (!_hasOwnProperty.call(transaction, name)) transaction[name] = {
11395
+ existed: _hasOwnProperty.call(state.anchorMap, name),
11396
+ value: state.anchorMap[name]
11397
+ };
11398
+ }
11399
+ state.anchorMap[name] = value;
11237
11400
  }
11238
- return _result;
11239
- }
11240
- function readLineBreak(state) {
11241
- var ch;
11242
- ch = state.input.charCodeAt(state.position);
11243
- if (0x0A === ch) state.position++;
11244
- else if (0x0D === ch) {
11245
- state.position++;
11246
- if (0x0A === state.input.charCodeAt(state.position)) state.position++;
11247
- } else throwError(state, 'a line break is expected');
11248
- state.line += 1;
11249
- state.lineStart = state.position;
11250
- state.firstTabInLine = -1;
11251
- }
11252
- function skipSeparationSpace(state, allowComments, checkIndent) {
11253
- var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
11254
- while(0 !== ch){
11255
- while(is_WHITE_SPACE(ch)){
11256
- if (0x09 === ch && -1 === state.firstTabInLine) state.firstTabInLine = state.position;
11257
- ch = state.input.charCodeAt(++state.position);
11401
+ function beginAnchorTransaction(state) {
11402
+ state.anchorMapTransactions.push(/* @__PURE__ */ Object.create(null));
11403
+ }
11404
+ function commitAnchorTransaction(state) {
11405
+ const transaction = state.anchorMapTransactions.pop();
11406
+ const transactions = state.anchorMapTransactions;
11407
+ if (0 === transactions.length) return;
11408
+ const parent = transactions[transactions.length - 1];
11409
+ const names = Object.keys(transaction);
11410
+ for(let index = 0, length = names.length; index < length; index += 1){
11411
+ const name = names[index];
11412
+ if (!_hasOwnProperty.call(parent, name)) parent[name] = transaction[name];
11258
11413
  }
11259
- if (allowComments && 0x23 === ch) do ch = state.input.charCodeAt(++state.position);
11260
- while (0x0A !== ch && 0x0D !== ch && 0 !== ch);
11261
- if (is_EOL(ch)) {
11262
- readLineBreak(state);
11263
- ch = state.input.charCodeAt(state.position);
11264
- lineBreaks++;
11265
- state.lineIndent = 0;
11266
- while(0x20 === ch){
11267
- state.lineIndent++;
11268
- ch = state.input.charCodeAt(++state.position);
11269
- }
11270
- } else break;
11271
11414
  }
11272
- if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) throwWarning(state, 'deficient indentation');
11273
- return lineBreaks;
11274
- }
11275
- function testDocumentSeparator(state) {
11276
- var _position = state.position, ch;
11277
- ch = state.input.charCodeAt(_position);
11278
- if ((0x2D === ch || 0x2E === ch) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
11279
- _position += 3;
11280
- ch = state.input.charCodeAt(_position);
11281
- if (0 === ch || is_WS_OR_EOL(ch)) return true;
11415
+ function rollbackAnchorTransaction(state) {
11416
+ const transaction = state.anchorMapTransactions.pop();
11417
+ const names = Object.keys(transaction);
11418
+ for(let index = names.length - 1; index >= 0; index -= 1){
11419
+ const entry = transaction[names[index]];
11420
+ if (entry.existed) state.anchorMap[names[index]] = entry.value;
11421
+ else delete state.anchorMap[names[index]];
11422
+ }
11282
11423
  }
11283
- return false;
11284
- }
11285
- function writeFoldedLines(state, count) {
11286
- if (1 === count) state.result += ' ';
11287
- else if (count > 1) state.result += common.repeat('\n', count - 1);
11288
- }
11289
- function readPlainScalar(state, nodeIndent, withinFlowCollection) {
11290
- var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
11291
- ch = state.input.charCodeAt(state.position);
11292
- if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || 0x23 === ch || 0x26 === ch || 0x2A === ch || 0x21 === ch || 0x7C === ch || 0x3E === ch || 0x27 === ch || 0x22 === ch || 0x25 === ch || 0x40 === ch || 0x60 === ch) return false;
11293
- if (0x3F === ch || 0x2D === ch) {
11294
- following = state.input.charCodeAt(state.position + 1);
11295
- if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) return false;
11296
- }
11297
- state.kind = 'scalar';
11298
- state.result = '';
11299
- captureStart = captureEnd = state.position;
11300
- hasPendingContent = false;
11301
- while(0 !== ch){
11302
- if (0x3A === ch) {
11303
- following = state.input.charCodeAt(state.position + 1);
11304
- if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) break;
11305
- } else if (0x23 === ch) {
11306
- preceding = state.input.charCodeAt(state.position - 1);
11307
- if (is_WS_OR_EOL(preceding)) break;
11308
- } else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) break;
11309
- else if (is_EOL(ch)) {
11310
- _line = state.line;
11311
- _lineStart = state.lineStart;
11312
- _lineIndent = state.lineIndent;
11313
- skipSeparationSpace(state, false, -1);
11314
- if (state.lineIndent >= nodeIndent) {
11315
- hasPendingContent = true;
11316
- ch = state.input.charCodeAt(state.position);
11317
- continue;
11424
+ function snapshotState(state) {
11425
+ return {
11426
+ position: state.position,
11427
+ line: state.line,
11428
+ lineStart: state.lineStart,
11429
+ lineIndent: state.lineIndent,
11430
+ firstTabInLine: state.firstTabInLine,
11431
+ tag: state.tag,
11432
+ anchor: state.anchor,
11433
+ kind: state.kind,
11434
+ result: state.result
11435
+ };
11436
+ }
11437
+ function restoreState(state, snapshot) {
11438
+ state.position = snapshot.position;
11439
+ state.line = snapshot.line;
11440
+ state.lineStart = snapshot.lineStart;
11441
+ state.lineIndent = snapshot.lineIndent;
11442
+ state.firstTabInLine = snapshot.firstTabInLine;
11443
+ state.tag = snapshot.tag;
11444
+ state.anchor = snapshot.anchor;
11445
+ state.kind = snapshot.kind;
11446
+ state.result = snapshot.result;
11447
+ }
11448
+ const directiveHandlers = {
11449
+ YAML: function(state, name, args) {
11450
+ if (null !== state.version) throwError(state, "duplication of %YAML directive");
11451
+ if (1 !== args.length) throwError(state, "YAML directive accepts exactly one argument");
11452
+ const match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
11453
+ if (null === match) throwError(state, "ill-formed argument of the YAML directive");
11454
+ const major = parseInt(match[1], 10);
11455
+ const minor = parseInt(match[2], 10);
11456
+ if (1 !== major) throwError(state, "unacceptable YAML version of the document");
11457
+ state.version = args[0];
11458
+ state.checkLineBreaks = minor < 2;
11459
+ if (1 !== minor && 2 !== minor) throwWarning(state, "unsupported YAML version of the document");
11460
+ },
11461
+ TAG: function(state, name, args) {
11462
+ let prefix;
11463
+ if (2 !== args.length) throwError(state, "TAG directive accepts exactly two arguments");
11464
+ const handle = args[0];
11465
+ prefix = args[1];
11466
+ if (!PATTERN_TAG_HANDLE.test(handle)) throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
11467
+ if (_hasOwnProperty.call(state.tagMap, handle)) throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
11468
+ if (!PATTERN_TAG_URI.test(prefix)) throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
11469
+ try {
11470
+ prefix = decodeURIComponent(prefix);
11471
+ } catch (err) {
11472
+ throwError(state, "tag prefix is malformed: " + prefix);
11318
11473
  }
11319
- state.position = captureEnd;
11320
- state.line = _line;
11321
- state.lineStart = _lineStart;
11322
- state.lineIndent = _lineIndent;
11323
- break;
11474
+ state.tagMap[handle] = prefix;
11324
11475
  }
11325
- if (hasPendingContent) {
11326
- captureSegment(state, captureStart, captureEnd, false);
11327
- writeFoldedLines(state, state.line - _line);
11328
- captureStart = captureEnd = state.position;
11329
- hasPendingContent = false;
11476
+ };
11477
+ function captureSegment(state, start, end, checkJson) {
11478
+ if (start < end) {
11479
+ const _result = state.input.slice(start, end);
11480
+ if (checkJson) for(let _position = 0, _length = _result.length; _position < _length; _position += 1){
11481
+ const _character = _result.charCodeAt(_position);
11482
+ if (!(9 === _character || _character >= 32 && _character <= 1114111)) throwError(state, "expected valid JSON character");
11483
+ }
11484
+ else if (PATTERN_NON_PRINTABLE.test(_result)) throwError(state, "the stream contains non-printable characters");
11485
+ state.result += _result;
11486
+ }
11487
+ }
11488
+ function chargeMergeWork(state) {
11489
+ state.totalMergeKeys++;
11490
+ if (-1 !== state.maxTotalMergeKeys && state.totalMergeKeys > state.maxTotalMergeKeys) throwError(state, "merge keys exceeded maxTotalMergeKeys (" + state.maxTotalMergeKeys + ")");
11491
+ }
11492
+ function mergeMappings(state, destination, source, overridableKeys) {
11493
+ if (!common2.isObject(source)) throwError(state, "cannot merge mappings; the provided source object is unacceptable");
11494
+ chargeMergeWork(state);
11495
+ const sourceKeys = Object.keys(source);
11496
+ for(let index = 0, quantity = sourceKeys.length; index < quantity; index += 1){
11497
+ const key = sourceKeys[index];
11498
+ chargeMergeWork(state);
11499
+ if (!_hasOwnProperty.call(destination, key)) {
11500
+ setProperty(destination, key, source[key]);
11501
+ overridableKeys[key] = true;
11502
+ }
11330
11503
  }
11331
- if (!is_WHITE_SPACE(ch)) captureEnd = state.position + 1;
11332
- ch = state.input.charCodeAt(++state.position);
11333
11504
  }
11334
- captureSegment(state, captureStart, captureEnd, false);
11335
- if (state.result) return true;
11336
- state.kind = _kind;
11337
- state.result = _result;
11338
- return false;
11339
- }
11340
- function readSingleQuotedScalar(state, nodeIndent) {
11341
- var ch, captureStart, captureEnd;
11342
- ch = state.input.charCodeAt(state.position);
11343
- if (0x27 !== ch) return false;
11344
- state.kind = 'scalar';
11345
- state.result = '';
11346
- state.position++;
11347
- captureStart = captureEnd = state.position;
11348
- while(0 !== (ch = state.input.charCodeAt(state.position)))if (0x27 === ch) {
11349
- captureSegment(state, captureStart, state.position, true);
11350
- ch = state.input.charCodeAt(++state.position);
11351
- if (0x27 !== ch) return true;
11352
- captureStart = state.position;
11353
- state.position++;
11354
- captureEnd = state.position;
11355
- } else if (is_EOL(ch)) {
11356
- captureSegment(state, captureStart, captureEnd, true);
11357
- writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
11358
- captureStart = captureEnd = state.position;
11359
- } else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, 'unexpected end of the document within a single quoted scalar');
11360
- else {
11361
- state.position++;
11362
- captureEnd = state.position;
11505
+ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
11506
+ if (Array.isArray(keyNode)) {
11507
+ keyNode = Array.prototype.slice.call(keyNode);
11508
+ for(let index = 0, quantity = keyNode.length; index < quantity; index += 1){
11509
+ if (Array.isArray(keyNode[index])) throwError(state, "nested arrays are not supported inside keys");
11510
+ if ("object" == typeof keyNode && "[object Object]" === _class(keyNode[index])) keyNode[index] = "[object Object]";
11511
+ }
11512
+ }
11513
+ if ("object" == typeof keyNode && "[object Object]" === _class(keyNode)) keyNode = "[object Object]";
11514
+ keyNode = String(keyNode);
11515
+ if (null === _result) _result = {};
11516
+ if ("tag:yaml.org,2002:merge" === keyTag) if (Array.isArray(valueNode)) {
11517
+ if (valueNode.length > 100) throwError(state, "abnormal merge sequence size");
11518
+ for(let index = 0, quantity = valueNode.length; index < quantity; index += 1)mergeMappings(state, _result, valueNode[index], overridableKeys);
11519
+ } else mergeMappings(state, _result, valueNode, overridableKeys);
11520
+ else {
11521
+ if (!state.json && !_hasOwnProperty.call(overridableKeys, keyNode) && _hasOwnProperty.call(_result, keyNode)) {
11522
+ state.line = startLine || state.line;
11523
+ state.lineStart = startLineStart || state.lineStart;
11524
+ state.position = startPos || state.position;
11525
+ throwError(state, "duplicated mapping key");
11526
+ }
11527
+ setProperty(_result, keyNode, valueNode);
11528
+ delete overridableKeys[keyNode];
11529
+ }
11530
+ return _result;
11363
11531
  }
11364
- throwError(state, 'unexpected end of the stream within a single quoted scalar');
11365
- }
11366
- function readDoubleQuotedScalar(state, nodeIndent) {
11367
- var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
11368
- ch = state.input.charCodeAt(state.position);
11369
- if (0x22 !== ch) return false;
11370
- state.kind = 'scalar';
11371
- state.result = '';
11372
- state.position++;
11373
- captureStart = captureEnd = state.position;
11374
- while(0 !== (ch = state.input.charCodeAt(state.position)))if (0x22 === ch) {
11375
- captureSegment(state, captureStart, state.position, true);
11376
- state.position++;
11377
- return true;
11378
- } else if (0x5C === ch) {
11379
- captureSegment(state, captureStart, state.position, true);
11380
- ch = state.input.charCodeAt(++state.position);
11381
- if (is_EOL(ch)) skipSeparationSpace(state, false, nodeIndent);
11382
- else if (ch < 256 && simpleEscapeCheck[ch]) {
11383
- state.result += simpleEscapeMap[ch];
11532
+ function readLineBreak(state) {
11533
+ const ch = state.input.charCodeAt(state.position);
11534
+ if (10 === ch) state.position++;
11535
+ else if (13 === ch) {
11384
11536
  state.position++;
11385
- } else if ((tmp = escapedHexLen(ch)) > 0) {
11386
- hexLength = tmp;
11387
- hexResult = 0;
11388
- for(; hexLength > 0; hexLength--){
11537
+ if (10 === state.input.charCodeAt(state.position)) state.position++;
11538
+ } else throwError(state, "a line break is expected");
11539
+ state.line += 1;
11540
+ state.lineStart = state.position;
11541
+ state.firstTabInLine = -1;
11542
+ }
11543
+ function skipSeparationSpace(state, allowComments, checkIndent) {
11544
+ let lineBreaks = 0;
11545
+ let ch = state.input.charCodeAt(state.position);
11546
+ while(0 !== ch){
11547
+ while(isWhiteSpace(ch)){
11548
+ if (9 === ch && -1 === state.firstTabInLine) state.firstTabInLine = state.position;
11389
11549
  ch = state.input.charCodeAt(++state.position);
11390
- if ((tmp = fromHexCode(ch)) >= 0) hexResult = (hexResult << 4) + tmp;
11391
- else throwError(state, 'expected hexadecimal character');
11392
11550
  }
11393
- state.result += charFromCodepoint(hexResult);
11394
- state.position++;
11395
- } else throwError(state, 'unknown escape sequence');
11551
+ if (allowComments && 35 === ch) do ch = state.input.charCodeAt(++state.position);
11552
+ while (10 !== ch && 13 !== ch && 0 !== ch);
11553
+ if (isEol(ch)) {
11554
+ readLineBreak(state);
11555
+ ch = state.input.charCodeAt(state.position);
11556
+ lineBreaks++;
11557
+ state.lineIndent = 0;
11558
+ while(32 === ch){
11559
+ state.lineIndent++;
11560
+ ch = state.input.charCodeAt(++state.position);
11561
+ }
11562
+ } else break;
11563
+ }
11564
+ if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) throwWarning(state, "deficient indentation");
11565
+ return lineBreaks;
11566
+ }
11567
+ function testDocumentSeparator(state) {
11568
+ let _position = state.position;
11569
+ let ch = state.input.charCodeAt(_position);
11570
+ if ((45 === ch || 46 === ch) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
11571
+ _position += 3;
11572
+ ch = state.input.charCodeAt(_position);
11573
+ if (0 === ch || isWsOrEol(ch)) return true;
11574
+ }
11575
+ return false;
11576
+ }
11577
+ function writeFoldedLines(state, count) {
11578
+ if (1 === count) state.result += " ";
11579
+ else if (count > 1) state.result += common2.repeat("\n", count - 1);
11580
+ }
11581
+ function readPlainScalar(state, nodeIndent, withinFlowCollection) {
11582
+ let captureStart;
11583
+ let captureEnd;
11584
+ let hasPendingContent;
11585
+ let _line;
11586
+ let _lineStart;
11587
+ let _lineIndent;
11588
+ const _kind = state.kind;
11589
+ const _result = state.result;
11590
+ let ch = state.input.charCodeAt(state.position);
11591
+ if (isWsOrEol(ch) || isFlowIndicator(ch) || 35 === ch || 38 === ch || 42 === ch || 33 === ch || 124 === ch || 62 === ch || 39 === ch || 34 === ch || 37 === ch || 64 === ch || 96 === ch) return false;
11592
+ if (63 === ch || 45 === ch) {
11593
+ const following = state.input.charCodeAt(state.position + 1);
11594
+ if (isWsOrEol(following) || withinFlowCollection && isFlowIndicator(following)) return false;
11595
+ }
11596
+ state.kind = "scalar";
11597
+ state.result = "";
11396
11598
  captureStart = captureEnd = state.position;
11397
- } else if (is_EOL(ch)) {
11398
- captureSegment(state, captureStart, captureEnd, true);
11399
- writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
11599
+ hasPendingContent = false;
11600
+ while(0 !== ch){
11601
+ if (58 === ch) {
11602
+ const following = state.input.charCodeAt(state.position + 1);
11603
+ if (isWsOrEol(following) || withinFlowCollection && isFlowIndicator(following)) break;
11604
+ } else if (35 === ch) {
11605
+ const preceding = state.input.charCodeAt(state.position - 1);
11606
+ if (isWsOrEol(preceding)) break;
11607
+ } else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && isFlowIndicator(ch)) break;
11608
+ else if (isEol(ch)) {
11609
+ _line = state.line;
11610
+ _lineStart = state.lineStart;
11611
+ _lineIndent = state.lineIndent;
11612
+ skipSeparationSpace(state, false, -1);
11613
+ if (state.lineIndent >= nodeIndent) {
11614
+ hasPendingContent = true;
11615
+ ch = state.input.charCodeAt(state.position);
11616
+ continue;
11617
+ }
11618
+ state.position = captureEnd;
11619
+ state.line = _line;
11620
+ state.lineStart = _lineStart;
11621
+ state.lineIndent = _lineIndent;
11622
+ break;
11623
+ }
11624
+ if (hasPendingContent) {
11625
+ captureSegment(state, captureStart, captureEnd, false);
11626
+ writeFoldedLines(state, state.line - _line);
11627
+ captureStart = captureEnd = state.position;
11628
+ hasPendingContent = false;
11629
+ }
11630
+ if (!isWhiteSpace(ch)) captureEnd = state.position + 1;
11631
+ ch = state.input.charCodeAt(++state.position);
11632
+ }
11633
+ captureSegment(state, captureStart, captureEnd, false);
11634
+ if (state.result) return true;
11635
+ state.kind = _kind;
11636
+ state.result = _result;
11637
+ return false;
11638
+ }
11639
+ function readSingleQuotedScalar(state, nodeIndent) {
11640
+ let captureStart;
11641
+ let captureEnd;
11642
+ let ch = state.input.charCodeAt(state.position);
11643
+ if (39 !== ch) return false;
11644
+ state.kind = "scalar";
11645
+ state.result = "";
11646
+ state.position++;
11400
11647
  captureStart = captureEnd = state.position;
11401
- } else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, 'unexpected end of the document within a double quoted scalar');
11402
- else {
11648
+ while(0 !== (ch = state.input.charCodeAt(state.position)))if (39 === ch) {
11649
+ captureSegment(state, captureStart, state.position, true);
11650
+ ch = state.input.charCodeAt(++state.position);
11651
+ if (39 !== ch) return true;
11652
+ captureStart = state.position;
11653
+ state.position++;
11654
+ captureEnd = state.position;
11655
+ } else if (isEol(ch)) {
11656
+ captureSegment(state, captureStart, captureEnd, true);
11657
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
11658
+ captureStart = captureEnd = state.position;
11659
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a single quoted scalar");
11660
+ else {
11661
+ state.position++;
11662
+ if (!isWhiteSpace(ch)) captureEnd = state.position;
11663
+ }
11664
+ throwError(state, "unexpected end of the stream within a single quoted scalar");
11665
+ }
11666
+ function readDoubleQuotedScalar(state, nodeIndent) {
11667
+ let captureStart;
11668
+ let captureEnd;
11669
+ let tmp;
11670
+ let ch = state.input.charCodeAt(state.position);
11671
+ if (34 !== ch) return false;
11672
+ state.kind = "scalar";
11673
+ state.result = "";
11403
11674
  state.position++;
11404
- captureEnd = state.position;
11405
- }
11406
- throwError(state, 'unexpected end of the stream within a double quoted scalar');
11407
- }
11408
- function readFlowCollection(state, nodeIndent) {
11409
- var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = Object.create(null), keyNode, keyTag, valueNode, ch;
11410
- ch = state.input.charCodeAt(state.position);
11411
- if (0x5B === ch) {
11412
- terminator = 0x5D;
11413
- isMapping = false;
11414
- _result = [];
11415
- } else {
11416
- if (0x7B !== ch) return false;
11417
- terminator = 0x7D;
11418
- isMapping = true;
11419
- _result = {};
11420
- }
11421
- if (null !== state.anchor) state.anchorMap[state.anchor] = _result;
11422
- ch = state.input.charCodeAt(++state.position);
11423
- while(0 !== ch){
11424
- skipSeparationSpace(state, true, nodeIndent);
11425
- ch = state.input.charCodeAt(state.position);
11426
- if (ch === terminator) {
11675
+ captureStart = captureEnd = state.position;
11676
+ while(0 !== (ch = state.input.charCodeAt(state.position)))if (34 === ch) {
11677
+ captureSegment(state, captureStart, state.position, true);
11427
11678
  state.position++;
11428
- state.tag = _tag;
11429
- state.anchor = _anchor;
11430
- state.kind = isMapping ? 'mapping' : 'sequence';
11431
- state.result = _result;
11432
11679
  return true;
11680
+ } else if (92 === ch) {
11681
+ captureSegment(state, captureStart, state.position, true);
11682
+ ch = state.input.charCodeAt(++state.position);
11683
+ if (isEol(ch)) skipSeparationSpace(state, false, nodeIndent);
11684
+ else if (ch < 256 && simpleEscapeCheck[ch]) {
11685
+ state.result += simpleEscapeMap[ch];
11686
+ state.position++;
11687
+ } else if ((tmp = escapedHexLen(ch)) > 0) {
11688
+ let hexLength = tmp;
11689
+ let hexResult = 0;
11690
+ for(; hexLength > 0; hexLength--){
11691
+ ch = state.input.charCodeAt(++state.position);
11692
+ if ((tmp = fromHexCode(ch)) >= 0) hexResult = (hexResult << 4) + tmp;
11693
+ else throwError(state, "expected hexadecimal character");
11694
+ }
11695
+ state.result += charFromCodepoint(hexResult);
11696
+ state.position++;
11697
+ } else throwError(state, "unknown escape sequence");
11698
+ captureStart = captureEnd = state.position;
11699
+ } else if (isEol(ch)) {
11700
+ captureSegment(state, captureStart, captureEnd, true);
11701
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
11702
+ captureStart = captureEnd = state.position;
11703
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) throwError(state, "unexpected end of the document within a double quoted scalar");
11704
+ else {
11705
+ state.position++;
11706
+ if (!isWhiteSpace(ch)) captureEnd = state.position;
11707
+ }
11708
+ throwError(state, "unexpected end of the stream within a double quoted scalar");
11709
+ }
11710
+ function readFlowCollection(state, nodeIndent) {
11711
+ let readNext = true;
11712
+ let _line;
11713
+ let _lineStart;
11714
+ let _pos;
11715
+ const _tag = state.tag;
11716
+ let _result;
11717
+ const _anchor = state.anchor;
11718
+ let terminator;
11719
+ let isPair;
11720
+ let isExplicitPair;
11721
+ let isMapping;
11722
+ const overridableKeys = /* @__PURE__ */ Object.create(null);
11723
+ let keyNode;
11724
+ let keyTag;
11725
+ let valueNode;
11726
+ let ch = state.input.charCodeAt(state.position);
11727
+ if (91 === ch) {
11728
+ terminator = 93;
11729
+ isMapping = false;
11730
+ _result = [];
11731
+ } else {
11732
+ if (123 !== ch) return false;
11733
+ terminator = 125;
11734
+ isMapping = true;
11735
+ _result = {};
11433
11736
  }
11434
- if (readNext) {
11435
- if (0x2C === ch) throwError(state, "expected the node content, but found ','");
11436
- } else throwError(state, 'missed comma between flow collection entries');
11437
- keyTag = keyNode = valueNode = null;
11438
- isPair = isExplicitPair = false;
11439
- if (0x3F === ch) {
11440
- following = state.input.charCodeAt(state.position + 1);
11441
- if (is_WS_OR_EOL(following)) {
11442
- isPair = isExplicitPair = true;
11737
+ if (null !== state.anchor) storeAnchor(state, state.anchor, _result);
11738
+ ch = state.input.charCodeAt(++state.position);
11739
+ while(0 !== ch){
11740
+ skipSeparationSpace(state, true, nodeIndent);
11741
+ ch = state.input.charCodeAt(state.position);
11742
+ if (ch === terminator) {
11443
11743
  state.position++;
11744
+ state.tag = _tag;
11745
+ state.anchor = _anchor;
11746
+ state.kind = isMapping ? "mapping" : "sequence";
11747
+ state.result = _result;
11748
+ return true;
11749
+ }
11750
+ if (readNext) {
11751
+ if (44 === ch) throwError(state, "expected the node content, but found ','");
11752
+ } else throwError(state, "missed comma between flow collection entries");
11753
+ keyTag = keyNode = valueNode = null;
11754
+ isPair = isExplicitPair = false;
11755
+ if (63 === ch) {
11756
+ const following = state.input.charCodeAt(state.position + 1);
11757
+ if (isWsOrEol(following)) {
11758
+ isPair = isExplicitPair = true;
11759
+ state.position++;
11760
+ skipSeparationSpace(state, true, nodeIndent);
11761
+ }
11762
+ }
11763
+ _line = state.line;
11764
+ _lineStart = state.lineStart;
11765
+ _pos = state.position;
11766
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
11767
+ keyTag = state.tag;
11768
+ keyNode = state.result;
11769
+ skipSeparationSpace(state, true, nodeIndent);
11770
+ ch = state.input.charCodeAt(state.position);
11771
+ if ((isExplicitPair || state.line === _line) && 58 === ch) {
11772
+ isPair = true;
11773
+ ch = state.input.charCodeAt(++state.position);
11444
11774
  skipSeparationSpace(state, true, nodeIndent);
11775
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
11776
+ valueNode = state.result;
11445
11777
  }
11446
- }
11447
- _line = state.line;
11448
- _lineStart = state.lineStart;
11449
- _pos = state.position;
11450
- composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
11451
- keyTag = state.tag;
11452
- keyNode = state.result;
11453
- skipSeparationSpace(state, true, nodeIndent);
11454
- ch = state.input.charCodeAt(state.position);
11455
- if ((isExplicitPair || state.line === _line) && 0x3A === ch) {
11456
- isPair = true;
11457
- ch = state.input.charCodeAt(++state.position);
11778
+ if (isMapping) storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
11779
+ else if (isPair) _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
11780
+ else _result.push(keyNode);
11458
11781
  skipSeparationSpace(state, true, nodeIndent);
11459
- composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
11460
- valueNode = state.result;
11461
- }
11462
- if (isMapping) storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
11463
- else if (isPair) _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
11464
- else _result.push(keyNode);
11465
- skipSeparationSpace(state, true, nodeIndent);
11466
- ch = state.input.charCodeAt(state.position);
11467
- if (0x2C === ch) {
11468
- readNext = true;
11469
- ch = state.input.charCodeAt(++state.position);
11470
- } else readNext = false;
11471
- }
11472
- throwError(state, 'unexpected end of the stream within a flow collection');
11473
- }
11474
- function readBlockScalar(state, nodeIndent) {
11475
- var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
11476
- ch = state.input.charCodeAt(state.position);
11477
- if (0x7C === ch) folding = false;
11478
- else {
11479
- if (0x3E !== ch) return false;
11480
- folding = true;
11481
- }
11482
- state.kind = 'scalar';
11483
- state.result = '';
11484
- while(0 !== ch){
11485
- ch = state.input.charCodeAt(++state.position);
11486
- if (0x2B === ch || 0x2D === ch) if (CHOMPING_CLIP === chomping) chomping = 0x2B === ch ? CHOMPING_KEEP : CHOMPING_STRIP;
11487
- else throwError(state, 'repeat of a chomping mode identifier');
11488
- else if ((tmp = fromDecimalCode(ch)) >= 0) if (0 === tmp) throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
11489
- else if (detectedIndent) throwError(state, 'repeat of an indentation width identifier');
11782
+ ch = state.input.charCodeAt(state.position);
11783
+ if (44 === ch) {
11784
+ readNext = true;
11785
+ ch = state.input.charCodeAt(++state.position);
11786
+ } else readNext = false;
11787
+ }
11788
+ throwError(state, "unexpected end of the stream within a flow collection");
11789
+ }
11790
+ function readBlockScalar(state, nodeIndent) {
11791
+ let folding;
11792
+ let chomping = CHOMPING_CLIP;
11793
+ let didReadContent = false;
11794
+ let detectedIndent = false;
11795
+ let textIndent = nodeIndent;
11796
+ let emptyLines = 0;
11797
+ let atMoreIndented = false;
11798
+ let tmp;
11799
+ let ch = state.input.charCodeAt(state.position);
11800
+ if (124 === ch) folding = false;
11490
11801
  else {
11491
- textIndent = nodeIndent + tmp - 1;
11492
- detectedIndent = true;
11802
+ if (62 !== ch) return false;
11803
+ folding = true;
11493
11804
  }
11494
- else break;
11495
- }
11496
- if (is_WHITE_SPACE(ch)) {
11497
- do ch = state.input.charCodeAt(++state.position);
11498
- while (is_WHITE_SPACE(ch));
11499
- if (0x23 === ch) do ch = state.input.charCodeAt(++state.position);
11500
- while (!is_EOL(ch) && 0 !== ch);
11501
- }
11502
- while(0 !== ch){
11503
- readLineBreak(state);
11504
- state.lineIndent = 0;
11505
- ch = state.input.charCodeAt(state.position);
11506
- while((!detectedIndent || state.lineIndent < textIndent) && 0x20 === ch){
11507
- state.lineIndent++;
11805
+ state.kind = "scalar";
11806
+ state.result = "";
11807
+ while(0 !== ch){
11508
11808
  ch = state.input.charCodeAt(++state.position);
11809
+ if (43 === ch || 45 === ch) if (CHOMPING_CLIP === chomping) chomping = 43 === ch ? CHOMPING_KEEP : CHOMPING_STRIP;
11810
+ else throwError(state, "repeat of a chomping mode identifier");
11811
+ else if ((tmp = fromDecimalCode(ch)) >= 0) if (0 === tmp) throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
11812
+ else if (detectedIndent) throwError(state, "repeat of an indentation width identifier");
11813
+ else {
11814
+ textIndent = nodeIndent + tmp - 1;
11815
+ detectedIndent = true;
11816
+ }
11817
+ else break;
11509
11818
  }
11510
- if (!detectedIndent && state.lineIndent > textIndent) textIndent = state.lineIndent;
11511
- if (is_EOL(ch)) {
11512
- emptyLines++;
11513
- continue;
11819
+ if (isWhiteSpace(ch)) {
11820
+ do ch = state.input.charCodeAt(++state.position);
11821
+ while (isWhiteSpace(ch));
11822
+ if (35 === ch) do ch = state.input.charCodeAt(++state.position);
11823
+ while (!isEol(ch) && 0 !== ch);
11514
11824
  }
11515
- if (state.lineIndent < textIndent) {
11516
- if (chomping === CHOMPING_KEEP) state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
11517
- else if (chomping === CHOMPING_CLIP) {
11518
- if (didReadContent) state.result += '\n';
11825
+ while(0 !== ch){
11826
+ readLineBreak(state);
11827
+ state.lineIndent = 0;
11828
+ ch = state.input.charCodeAt(state.position);
11829
+ while((!detectedIndent || state.lineIndent < textIndent) && 32 === ch){
11830
+ state.lineIndent++;
11831
+ ch = state.input.charCodeAt(++state.position);
11519
11832
  }
11520
- break;
11521
- }
11522
- if (folding) if (is_WHITE_SPACE(ch)) {
11523
- atMoreIndented = true;
11524
- state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
11525
- } else if (atMoreIndented) {
11526
- atMoreIndented = false;
11527
- state.result += common.repeat('\n', emptyLines + 1);
11528
- } else if (0 === emptyLines) {
11529
- if (didReadContent) state.result += ' ';
11530
- } else state.result += common.repeat('\n', emptyLines);
11531
- else state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
11532
- didReadContent = true;
11533
- detectedIndent = true;
11534
- emptyLines = 0;
11535
- captureStart = state.position;
11536
- while(!is_EOL(ch) && 0 !== ch)ch = state.input.charCodeAt(++state.position);
11537
- captureSegment(state, captureStart, state.position, false);
11538
- }
11539
- return true;
11540
- }
11541
- function readBlockSequence(state, nodeIndent) {
11542
- var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
11543
- if (-1 !== state.firstTabInLine) return false;
11544
- if (null !== state.anchor) state.anchorMap[state.anchor] = _result;
11545
- ch = state.input.charCodeAt(state.position);
11546
- while(0 !== ch){
11547
- if (-1 !== state.firstTabInLine) {
11548
- state.position = state.firstTabInLine;
11549
- throwError(state, 'tab characters must not be used in indentation');
11550
- }
11551
- if (0x2D !== ch) break;
11552
- following = state.input.charCodeAt(state.position + 1);
11553
- if (!is_WS_OR_EOL(following)) break;
11554
- detected = true;
11555
- state.position++;
11556
- if (skipSeparationSpace(state, true, -1)) {
11557
- if (state.lineIndent <= nodeIndent) {
11558
- _result.push(null);
11559
- ch = state.input.charCodeAt(state.position);
11833
+ if (!detectedIndent && state.lineIndent > textIndent) textIndent = state.lineIndent;
11834
+ if (isEol(ch)) {
11835
+ emptyLines++;
11560
11836
  continue;
11561
11837
  }
11838
+ if (!detectedIndent && 0 === textIndent) throwError(state, "missing indentation for block scalar");
11839
+ if (state.lineIndent < textIndent) {
11840
+ if (chomping === CHOMPING_KEEP) state.result += common2.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
11841
+ else if (chomping === CHOMPING_CLIP) {
11842
+ if (didReadContent) state.result += "\n";
11843
+ }
11844
+ break;
11845
+ }
11846
+ if (folding) if (isWhiteSpace(ch)) {
11847
+ atMoreIndented = true;
11848
+ state.result += common2.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
11849
+ } else if (atMoreIndented) {
11850
+ atMoreIndented = false;
11851
+ state.result += common2.repeat("\n", emptyLines + 1);
11852
+ } else if (0 === emptyLines) {
11853
+ if (didReadContent) state.result += " ";
11854
+ } else state.result += common2.repeat("\n", emptyLines);
11855
+ else state.result += common2.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
11856
+ didReadContent = true;
11857
+ detectedIndent = true;
11858
+ emptyLines = 0;
11859
+ const captureStart = state.position;
11860
+ while(!isEol(ch) && 0 !== ch)ch = state.input.charCodeAt(++state.position);
11861
+ captureSegment(state, captureStart, state.position, false);
11562
11862
  }
11563
- _line = state.line;
11564
- composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
11565
- _result.push(state.result);
11566
- skipSeparationSpace(state, true, -1);
11567
- ch = state.input.charCodeAt(state.position);
11568
- if ((state.line === _line || state.lineIndent > nodeIndent) && 0 !== ch) throwError(state, 'bad indentation of a sequence entry');
11569
- else if (state.lineIndent < nodeIndent) break;
11570
- }
11571
- if (detected) {
11572
- state.tag = _tag;
11573
- state.anchor = _anchor;
11574
- state.kind = 'sequence';
11575
- state.result = _result;
11576
11863
  return true;
11577
11864
  }
11578
- return false;
11579
- }
11580
- function readBlockMapping(state, nodeIndent, flowIndent) {
11581
- var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
11582
- if (-1 !== state.firstTabInLine) return false;
11583
- if (null !== state.anchor) state.anchorMap[state.anchor] = _result;
11584
- ch = state.input.charCodeAt(state.position);
11585
- while(0 !== ch){
11586
- if (!atExplicitKey && -1 !== state.firstTabInLine) {
11587
- state.position = state.firstTabInLine;
11588
- throwError(state, 'tab characters must not be used in indentation');
11589
- }
11590
- following = state.input.charCodeAt(state.position + 1);
11591
- _line = state.line;
11592
- if ((0x3F === ch || 0x3A === ch) && is_WS_OR_EOL(following)) {
11593
- if (0x3F === ch) {
11594
- if (atExplicitKey) {
11595
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
11596
- keyTag = keyNode = valueNode = null;
11865
+ function readBlockSequence(state, nodeIndent) {
11866
+ const _tag = state.tag;
11867
+ const _anchor = state.anchor;
11868
+ const _result = [];
11869
+ let detected = false;
11870
+ if (-1 !== state.firstTabInLine) return false;
11871
+ if (null !== state.anchor) storeAnchor(state, state.anchor, _result);
11872
+ let ch = state.input.charCodeAt(state.position);
11873
+ while(0 !== ch){
11874
+ if (-1 !== state.firstTabInLine) {
11875
+ state.position = state.firstTabInLine;
11876
+ throwError(state, "tab characters must not be used in indentation");
11877
+ }
11878
+ if (45 !== ch) break;
11879
+ const following = state.input.charCodeAt(state.position + 1);
11880
+ if (!isWsOrEol(following)) break;
11881
+ detected = true;
11882
+ state.position++;
11883
+ if (skipSeparationSpace(state, true, -1)) {
11884
+ if (state.lineIndent <= nodeIndent) {
11885
+ _result.push(null);
11886
+ ch = state.input.charCodeAt(state.position);
11887
+ continue;
11597
11888
  }
11598
- detected = true;
11599
- atExplicitKey = true;
11600
- allowCompact = true;
11601
- } else if (atExplicitKey) {
11602
- atExplicitKey = false;
11603
- allowCompact = true;
11604
- } else throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
11605
- state.position += 1;
11606
- ch = following;
11607
- } else {
11608
- _keyLine = state.line;
11609
- _keyLineStart = state.lineStart;
11610
- _keyPos = state.position;
11611
- if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) break;
11612
- if (state.line === _line) {
11613
- ch = state.input.charCodeAt(state.position);
11614
- while(is_WHITE_SPACE(ch))ch = state.input.charCodeAt(++state.position);
11615
- if (0x3A === ch) {
11616
- ch = state.input.charCodeAt(++state.position);
11617
- if (!is_WS_OR_EOL(ch)) throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
11889
+ }
11890
+ const _line = state.line;
11891
+ composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
11892
+ _result.push(state.result);
11893
+ skipSeparationSpace(state, true, -1);
11894
+ ch = state.input.charCodeAt(state.position);
11895
+ if ((state.line === _line || state.lineIndent > nodeIndent) && 0 !== ch) throwError(state, "bad indentation of a sequence entry");
11896
+ else if (state.lineIndent < nodeIndent) break;
11897
+ }
11898
+ if (detected) {
11899
+ state.tag = _tag;
11900
+ state.anchor = _anchor;
11901
+ state.kind = "sequence";
11902
+ state.result = _result;
11903
+ return true;
11904
+ }
11905
+ return false;
11906
+ }
11907
+ function readBlockMapping(state, nodeIndent, flowIndent) {
11908
+ let allowCompact;
11909
+ let _keyLine;
11910
+ let _keyLineStart;
11911
+ let _keyPos;
11912
+ const _tag = state.tag;
11913
+ const _anchor = state.anchor;
11914
+ const _result = {};
11915
+ const overridableKeys = /* @__PURE__ */ Object.create(null);
11916
+ let keyTag = null;
11917
+ let keyNode = null;
11918
+ let valueNode = null;
11919
+ let atExplicitKey = false;
11920
+ let detected = false;
11921
+ if (-1 !== state.firstTabInLine) return false;
11922
+ if (null !== state.anchor) storeAnchor(state, state.anchor, _result);
11923
+ let ch = state.input.charCodeAt(state.position);
11924
+ while(0 !== ch){
11925
+ if (!atExplicitKey && -1 !== state.firstTabInLine) {
11926
+ state.position = state.firstTabInLine;
11927
+ throwError(state, "tab characters must not be used in indentation");
11928
+ }
11929
+ const following = state.input.charCodeAt(state.position + 1);
11930
+ const _line = state.line;
11931
+ if ((63 === ch || 58 === ch) && isWsOrEol(following)) {
11932
+ if (63 === ch) {
11618
11933
  if (atExplicitKey) {
11619
11934
  storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
11620
11935
  keyTag = keyNode = valueNode = null;
11621
11936
  }
11622
11937
  detected = true;
11938
+ atExplicitKey = true;
11939
+ allowCompact = true;
11940
+ } else if (atExplicitKey) {
11623
11941
  atExplicitKey = false;
11624
- allowCompact = false;
11625
- keyTag = state.tag;
11626
- keyNode = state.result;
11627
- } else if (detected) throwError(state, 'can not read an implicit mapping pair; a colon is missed');
11942
+ allowCompact = true;
11943
+ } else throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
11944
+ state.position += 1;
11945
+ ch = following;
11946
+ } else {
11947
+ _keyLine = state.line;
11948
+ _keyLineStart = state.lineStart;
11949
+ _keyPos = state.position;
11950
+ if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) break;
11951
+ if (state.line === _line) {
11952
+ ch = state.input.charCodeAt(state.position);
11953
+ while(isWhiteSpace(ch))ch = state.input.charCodeAt(++state.position);
11954
+ if (58 === ch) {
11955
+ ch = state.input.charCodeAt(++state.position);
11956
+ if (!isWsOrEol(ch)) throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
11957
+ if (atExplicitKey) {
11958
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
11959
+ keyTag = keyNode = valueNode = null;
11960
+ }
11961
+ detected = true;
11962
+ atExplicitKey = false;
11963
+ allowCompact = false;
11964
+ keyTag = state.tag;
11965
+ keyNode = state.result;
11966
+ } else if (detected) throwError(state, "can not read an implicit mapping pair; a colon is missed");
11967
+ else {
11968
+ state.tag = _tag;
11969
+ state.anchor = _anchor;
11970
+ return true;
11971
+ }
11972
+ } else if (detected) throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
11628
11973
  else {
11629
11974
  state.tag = _tag;
11630
11975
  state.anchor = _anchor;
11631
11976
  return true;
11632
11977
  }
11633
- } else if (detected) throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
11634
- else {
11635
- state.tag = _tag;
11636
- state.anchor = _anchor;
11637
- return true;
11638
- }
11639
- }
11640
- if (state.line === _line || state.lineIndent > nodeIndent) {
11641
- if (atExplicitKey) {
11642
- _keyLine = state.line;
11643
- _keyLineStart = state.lineStart;
11644
- _keyPos = state.position;
11645
11978
  }
11646
- if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) if (atExplicitKey) keyNode = state.result;
11647
- else valueNode = state.result;
11648
- if (!atExplicitKey) {
11649
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
11650
- keyTag = keyNode = valueNode = null;
11979
+ if (state.line === _line || state.lineIndent > nodeIndent) {
11980
+ if (atExplicitKey) {
11981
+ _keyLine = state.line;
11982
+ _keyLineStart = state.lineStart;
11983
+ _keyPos = state.position;
11984
+ }
11985
+ if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) if (atExplicitKey) keyNode = state.result;
11986
+ else valueNode = state.result;
11987
+ if (!atExplicitKey) {
11988
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
11989
+ keyTag = keyNode = valueNode = null;
11990
+ }
11991
+ skipSeparationSpace(state, true, -1);
11992
+ ch = state.input.charCodeAt(state.position);
11651
11993
  }
11652
- skipSeparationSpace(state, true, -1);
11653
- ch = state.input.charCodeAt(state.position);
11994
+ if ((state.line === _line || state.lineIndent > nodeIndent) && 0 !== ch) throwError(state, "bad indentation of a mapping entry");
11995
+ else if (state.lineIndent < nodeIndent) break;
11654
11996
  }
11655
- if ((state.line === _line || state.lineIndent > nodeIndent) && 0 !== ch) throwError(state, 'bad indentation of a mapping entry');
11656
- else if (state.lineIndent < nodeIndent) break;
11657
- }
11658
- if (atExplicitKey) storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
11659
- if (detected) {
11660
- state.tag = _tag;
11661
- state.anchor = _anchor;
11662
- state.kind = 'mapping';
11663
- state.result = _result;
11997
+ if (atExplicitKey) storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
11998
+ if (detected) {
11999
+ state.tag = _tag;
12000
+ state.anchor = _anchor;
12001
+ state.kind = "mapping";
12002
+ state.result = _result;
12003
+ }
12004
+ return detected;
11664
12005
  }
11665
- return detected;
11666
- }
11667
- function readTagProperty(state) {
11668
- var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
11669
- ch = state.input.charCodeAt(state.position);
11670
- if (0x21 !== ch) return false;
11671
- if (null !== state.tag) throwError(state, 'duplication of a tag property');
11672
- ch = state.input.charCodeAt(++state.position);
11673
- if (0x3C === ch) {
11674
- isVerbatim = true;
12006
+ function readTagProperty(state) {
12007
+ let isVerbatim = false;
12008
+ let isNamed = false;
12009
+ let tagHandle;
12010
+ let tagName;
12011
+ let ch = state.input.charCodeAt(state.position);
12012
+ if (33 !== ch) return false;
12013
+ if (null !== state.tag) throwError(state, "duplication of a tag property");
11675
12014
  ch = state.input.charCodeAt(++state.position);
11676
- } else if (0x21 === ch) {
11677
- isNamed = true;
11678
- tagHandle = '!!';
11679
- ch = state.input.charCodeAt(++state.position);
11680
- } else tagHandle = '!';
11681
- _position = state.position;
11682
- if (isVerbatim) {
11683
- do ch = state.input.charCodeAt(++state.position);
11684
- while (0 !== ch && 0x3E !== ch);
11685
- if (state.position < state.length) {
11686
- tagName = state.input.slice(_position, state.position);
12015
+ if (60 === ch) {
12016
+ isVerbatim = true;
11687
12017
  ch = state.input.charCodeAt(++state.position);
11688
- } else throwError(state, 'unexpected end of the stream within a verbatim tag');
11689
- } else {
11690
- while(0 !== ch && !is_WS_OR_EOL(ch)){
11691
- if (0x21 === ch) if (isNamed) throwError(state, 'tag suffix cannot contain exclamation marks');
11692
- else {
11693
- tagHandle = state.input.slice(_position - 1, state.position + 1);
11694
- if (!PATTERN_TAG_HANDLE.test(tagHandle)) throwError(state, 'named tag handle cannot contain such characters');
11695
- isNamed = true;
11696
- _position = state.position + 1;
11697
- }
12018
+ } else if (33 === ch) {
12019
+ isNamed = true;
12020
+ tagHandle = "!!";
11698
12021
  ch = state.input.charCodeAt(++state.position);
11699
- }
11700
- tagName = state.input.slice(_position, state.position);
11701
- if (PATTERN_FLOW_INDICATORS.test(tagName)) throwError(state, 'tag suffix cannot contain flow indicator characters');
11702
- }
11703
- if (tagName && !PATTERN_TAG_URI.test(tagName)) throwError(state, 'tag name cannot contain such characters: ' + tagName);
11704
- try {
11705
- tagName = decodeURIComponent(tagName);
11706
- } catch (err) {
11707
- throwError(state, 'tag name is malformed: ' + tagName);
11708
- }
11709
- if (isVerbatim) state.tag = tagName;
11710
- else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) state.tag = state.tagMap[tagHandle] + tagName;
11711
- else if ('!' === tagHandle) state.tag = '!' + tagName;
11712
- else if ('!!' === tagHandle) state.tag = 'tag:yaml.org,2002:' + tagName;
11713
- else throwError(state, 'undeclared tag handle "' + tagHandle + '"');
11714
- return true;
11715
- }
11716
- function readAnchorProperty(state) {
11717
- var _position, ch;
11718
- ch = state.input.charCodeAt(state.position);
11719
- if (0x26 !== ch) return false;
11720
- if (null !== state.anchor) throwError(state, 'duplication of an anchor property');
11721
- ch = state.input.charCodeAt(++state.position);
11722
- _position = state.position;
11723
- while(0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch))ch = state.input.charCodeAt(++state.position);
11724
- if (state.position === _position) throwError(state, 'name of an anchor node must contain at least one character');
11725
- state.anchor = state.input.slice(_position, state.position);
11726
- return true;
11727
- }
11728
- function readAlias(state) {
11729
- var _position, alias, ch;
11730
- ch = state.input.charCodeAt(state.position);
11731
- if (0x2A !== ch) return false;
11732
- ch = state.input.charCodeAt(++state.position);
11733
- _position = state.position;
11734
- while(0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch))ch = state.input.charCodeAt(++state.position);
11735
- if (state.position === _position) throwError(state, 'name of an alias node must contain at least one character');
11736
- alias = state.input.slice(_position, state.position);
11737
- if (!_hasOwnProperty$1.call(state.anchorMap, alias)) throwError(state, 'unidentified alias "' + alias + '"');
11738
- state.result = state.anchorMap[alias];
11739
- skipSeparationSpace(state, true, -1);
11740
- return true;
11741
- }
11742
- function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
11743
- var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type, flowIndent, blockIndent;
11744
- if (null !== state.listener) state.listener('open', state);
11745
- state.tag = null;
11746
- state.anchor = null;
11747
- state.kind = null;
11748
- state.result = null;
11749
- allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
11750
- if (allowToSeek) {
11751
- if (skipSeparationSpace(state, true, -1)) {
11752
- atNewLine = true;
11753
- if (state.lineIndent > parentIndent) indentStatus = 1;
11754
- else if (state.lineIndent === parentIndent) indentStatus = 0;
11755
- else if (state.lineIndent < parentIndent) indentStatus = -1;
11756
- }
11757
- }
11758
- if (1 === indentStatus) while(readTagProperty(state) || readAnchorProperty(state))if (skipSeparationSpace(state, true, -1)) {
11759
- atNewLine = true;
11760
- allowBlockCollections = allowBlockStyles;
11761
- if (state.lineIndent > parentIndent) indentStatus = 1;
11762
- else if (state.lineIndent === parentIndent) indentStatus = 0;
11763
- else if (state.lineIndent < parentIndent) indentStatus = -1;
11764
- } else allowBlockCollections = false;
11765
- if (allowBlockCollections) allowBlockCollections = atNewLine || allowCompact;
11766
- if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) {
11767
- flowIndent = CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext ? parentIndent : parentIndent + 1;
11768
- blockIndent = state.position - state.lineStart;
11769
- if (1 === indentStatus) if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) hasContent = true;
11770
- else {
11771
- if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) hasContent = true;
11772
- else if (readAlias(state)) {
11773
- hasContent = true;
11774
- if (null !== state.tag || null !== state.anchor) throwError(state, 'alias node should not have any properties');
11775
- } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
11776
- hasContent = true;
11777
- if (null === state.tag) state.tag = '?';
11778
- }
11779
- if (null !== state.anchor) state.anchorMap[state.anchor] = state.result;
11780
- }
11781
- else if (0 === indentStatus) hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
11782
- }
11783
- if (null === state.tag) {
11784
- if (null !== state.anchor) state.anchorMap[state.anchor] = state.result;
11785
- } else if ('?' === state.tag) {
11786
- if (null !== state.result && 'scalar' !== state.kind) throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
11787
- for(typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1){
11788
- type = state.implicitTypes[typeIndex];
11789
- if (type.resolve(state.result)) {
11790
- state.result = type.construct(state.result);
11791
- state.tag = type.tag;
11792
- if (null !== state.anchor) state.anchorMap[state.anchor] = state.result;
11793
- break;
12022
+ } else tagHandle = "!";
12023
+ let _position = state.position;
12024
+ if (isVerbatim) {
12025
+ do ch = state.input.charCodeAt(++state.position);
12026
+ while (0 !== ch && 62 !== ch);
12027
+ if (state.position < state.length) {
12028
+ tagName = state.input.slice(_position, state.position);
12029
+ ch = state.input.charCodeAt(++state.position);
12030
+ } else throwError(state, "unexpected end of the stream within a verbatim tag");
12031
+ } else {
12032
+ while(0 !== ch && !isWsOrEol(ch)){
12033
+ if (33 === ch) if (isNamed) throwError(state, "tag suffix cannot contain exclamation marks");
12034
+ else {
12035
+ tagHandle = state.input.slice(_position - 1, state.position + 1);
12036
+ if (!PATTERN_TAG_HANDLE.test(tagHandle)) throwError(state, "named tag handle cannot contain such characters");
12037
+ isNamed = true;
12038
+ _position = state.position + 1;
12039
+ }
12040
+ ch = state.input.charCodeAt(++state.position);
11794
12041
  }
12042
+ tagName = state.input.slice(_position, state.position);
12043
+ if (PATTERN_FLOW_INDICATORS.test(tagName)) throwError(state, "tag suffix cannot contain flow indicator characters");
11795
12044
  }
11796
- } else if ('!' !== state.tag) {
11797
- if (_hasOwnProperty$1.call(state.typeMap[state.kind || 'fallback'], state.tag)) type = state.typeMap[state.kind || 'fallback'][state.tag];
11798
- else {
11799
- type = null;
11800
- typeList = state.typeMap.multi[state.kind || 'fallback'];
11801
- for(typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1)if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
11802
- type = typeList[typeIndex];
11803
- break;
11804
- }
12045
+ if (tagName && !PATTERN_TAG_URI.test(tagName)) throwError(state, "tag name cannot contain such characters: " + tagName);
12046
+ try {
12047
+ tagName = decodeURIComponent(tagName);
12048
+ } catch (err) {
12049
+ throwError(state, "tag name is malformed: " + tagName);
11805
12050
  }
11806
- if (!type) throwError(state, 'unknown tag !<' + state.tag + '>');
11807
- if (null !== state.result && type.kind !== state.kind) throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
11808
- if (type.resolve(state.result, state.tag)) {
11809
- state.result = type.construct(state.result, state.tag);
11810
- if (null !== state.anchor) state.anchorMap[state.anchor] = state.result;
11811
- } else throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
12051
+ if (isVerbatim) state.tag = tagName;
12052
+ else if (_hasOwnProperty.call(state.tagMap, tagHandle)) state.tag = state.tagMap[tagHandle] + tagName;
12053
+ else if ("!" === tagHandle) state.tag = "!" + tagName;
12054
+ else if ("!!" === tagHandle) state.tag = "tag:yaml.org,2002:" + tagName;
12055
+ else throwError(state, 'undeclared tag handle "' + tagHandle + '"');
12056
+ return true;
11812
12057
  }
11813
- if (null !== state.listener) state.listener('close', state);
11814
- return null !== state.tag || null !== state.anchor || hasContent;
11815
- }
11816
- function readDocument(state) {
11817
- var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
11818
- state.version = null;
11819
- state.checkLineBreaks = state.legacy;
11820
- state.tagMap = Object.create(null);
11821
- state.anchorMap = Object.create(null);
11822
- while(0 !== (ch = state.input.charCodeAt(state.position))){
11823
- skipSeparationSpace(state, true, -1);
11824
- ch = state.input.charCodeAt(state.position);
11825
- if (state.lineIndent > 0 || 0x25 !== ch) break;
11826
- hasDirectives = true;
12058
+ function readAnchorProperty(state) {
12059
+ let ch = state.input.charCodeAt(state.position);
12060
+ if (38 !== ch) return false;
12061
+ if (null !== state.anchor) throwError(state, "duplication of an anchor property");
11827
12062
  ch = state.input.charCodeAt(++state.position);
11828
- _position = state.position;
11829
- while(0 !== ch && !is_WS_OR_EOL(ch))ch = state.input.charCodeAt(++state.position);
11830
- directiveName = state.input.slice(_position, state.position);
11831
- directiveArgs = [];
11832
- if (directiveName.length < 1) throwError(state, 'directive name must not be less than one character in length');
11833
- while(0 !== ch){
11834
- while(is_WHITE_SPACE(ch))ch = state.input.charCodeAt(++state.position);
11835
- if (0x23 === ch) {
11836
- do ch = state.input.charCodeAt(++state.position);
11837
- while (0 !== ch && !is_EOL(ch));
11838
- break;
12063
+ const _position = state.position;
12064
+ while(0 !== ch && !isWsOrEol(ch) && !isFlowIndicator(ch))ch = state.input.charCodeAt(++state.position);
12065
+ if (state.position === _position) throwError(state, "name of an anchor node must contain at least one character");
12066
+ state.anchor = state.input.slice(_position, state.position);
12067
+ return true;
12068
+ }
12069
+ function readAlias(state) {
12070
+ let ch = state.input.charCodeAt(state.position);
12071
+ if (42 !== ch) return false;
12072
+ ch = state.input.charCodeAt(++state.position);
12073
+ const _position = state.position;
12074
+ while(0 !== ch && !isWsOrEol(ch) && !isFlowIndicator(ch))ch = state.input.charCodeAt(++state.position);
12075
+ if (state.position === _position) throwError(state, "name of an alias node must contain at least one character");
12076
+ const alias = state.input.slice(_position, state.position);
12077
+ if (!_hasOwnProperty.call(state.anchorMap, alias)) throwError(state, 'unidentified alias "' + alias + '"');
12078
+ state.result = state.anchorMap[alias];
12079
+ skipSeparationSpace(state, true, -1);
12080
+ return true;
12081
+ }
12082
+ function tryReadBlockMappingFromProperty(state, propertyStart, nodeIndent, flowIndent) {
12083
+ const fallbackState = snapshotState(state);
12084
+ beginAnchorTransaction(state);
12085
+ restoreState(state, propertyStart);
12086
+ state.tag = null;
12087
+ state.anchor = null;
12088
+ state.kind = null;
12089
+ state.result = null;
12090
+ if (readBlockMapping(state, nodeIndent, flowIndent) && "mapping" === state.kind) {
12091
+ commitAnchorTransaction(state);
12092
+ return true;
12093
+ }
12094
+ rollbackAnchorTransaction(state);
12095
+ restoreState(state, fallbackState);
12096
+ return false;
12097
+ }
12098
+ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
12099
+ let allowBlockScalars;
12100
+ let allowBlockCollections;
12101
+ let indentStatus = 1;
12102
+ let atNewLine = false;
12103
+ let hasContent = false;
12104
+ let propertyStart = null;
12105
+ let type2;
12106
+ let flowIndent;
12107
+ let blockIndent;
12108
+ if (state.depth >= state.maxDepth) throwError(state, "nesting exceeded maxDepth (" + state.maxDepth + ")");
12109
+ state.depth += 1;
12110
+ if (null !== state.listener) state.listener("open", state);
12111
+ state.tag = null;
12112
+ state.anchor = null;
12113
+ state.kind = null;
12114
+ state.result = null;
12115
+ const allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
12116
+ if (allowToSeek) {
12117
+ if (skipSeparationSpace(state, true, -1)) {
12118
+ atNewLine = true;
12119
+ if (state.lineIndent > parentIndent) indentStatus = 1;
12120
+ else if (state.lineIndent === parentIndent) indentStatus = 0;
12121
+ else if (state.lineIndent < parentIndent) indentStatus = -1;
12122
+ }
12123
+ }
12124
+ if (1 === indentStatus) while(true){
12125
+ const ch = state.input.charCodeAt(state.position);
12126
+ const propertyState = snapshotState(state);
12127
+ if (atNewLine && (33 === ch && null !== state.tag || 38 === ch && null !== state.anchor)) break;
12128
+ if (!readTagProperty(state) && !readAnchorProperty(state)) break;
12129
+ if (null === propertyStart) propertyStart = propertyState;
12130
+ if (skipSeparationSpace(state, true, -1)) {
12131
+ atNewLine = true;
12132
+ allowBlockCollections = allowBlockStyles;
12133
+ if (state.lineIndent > parentIndent) indentStatus = 1;
12134
+ else if (state.lineIndent === parentIndent) indentStatus = 0;
12135
+ else if (state.lineIndent < parentIndent) indentStatus = -1;
12136
+ } else allowBlockCollections = false;
12137
+ }
12138
+ if (allowBlockCollections) allowBlockCollections = atNewLine || allowCompact;
12139
+ if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) {
12140
+ flowIndent = CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext ? parentIndent : parentIndent + 1;
12141
+ blockIndent = state.position - state.lineStart;
12142
+ if (1 === indentStatus) if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) hasContent = true;
12143
+ else {
12144
+ const ch = state.input.charCodeAt(state.position);
12145
+ if (null !== propertyStart && allowBlockStyles && !allowBlockCollections && 124 !== ch && 62 !== ch && tryReadBlockMappingFromProperty(state, propertyStart, propertyStart.position - propertyStart.lineStart, flowIndent)) hasContent = true;
12146
+ else if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) hasContent = true;
12147
+ else if (readAlias(state)) {
12148
+ hasContent = true;
12149
+ if (null !== state.tag || null !== state.anchor) throwError(state, "alias node should not have any properties");
12150
+ } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
12151
+ hasContent = true;
12152
+ if (null === state.tag) state.tag = "?";
12153
+ }
12154
+ if (null !== state.anchor) storeAnchor(state, state.anchor, state.result);
11839
12155
  }
11840
- if (is_EOL(ch)) break;
11841
- _position = state.position;
11842
- while(0 !== ch && !is_WS_OR_EOL(ch))ch = state.input.charCodeAt(++state.position);
11843
- directiveArgs.push(state.input.slice(_position, state.position));
11844
- }
11845
- if (0 !== ch) readLineBreak(state);
11846
- if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) directiveHandlers[directiveName](state, directiveName, directiveArgs);
11847
- else throwWarning(state, 'unknown document directive "' + directiveName + '"');
11848
- }
11849
- skipSeparationSpace(state, true, -1);
11850
- if (0 === state.lineIndent && 0x2D === state.input.charCodeAt(state.position) && 0x2D === state.input.charCodeAt(state.position + 1) && 0x2D === state.input.charCodeAt(state.position + 2)) {
11851
- state.position += 3;
12156
+ else if (0 === indentStatus) hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
12157
+ }
12158
+ if (null === state.tag) {
12159
+ if (null !== state.anchor) storeAnchor(state, state.anchor, state.result);
12160
+ } else if ("?" === state.tag) {
12161
+ if (null !== state.result && "scalar" !== state.kind) throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
12162
+ for(let typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1){
12163
+ type2 = state.implicitTypes[typeIndex];
12164
+ if (type2.resolve(state.result)) {
12165
+ state.result = type2.construct(state.result);
12166
+ state.tag = type2.tag;
12167
+ if (null !== state.anchor) storeAnchor(state, state.anchor, state.result);
12168
+ break;
12169
+ }
12170
+ }
12171
+ } else if ("!" !== state.tag) {
12172
+ if (_hasOwnProperty.call(state.typeMap[state.kind || "fallback"], state.tag)) type2 = state.typeMap[state.kind || "fallback"][state.tag];
12173
+ else {
12174
+ type2 = null;
12175
+ const typeList = state.typeMap.multi[state.kind || "fallback"];
12176
+ for(let typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1)if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
12177
+ type2 = typeList[typeIndex];
12178
+ break;
12179
+ }
12180
+ }
12181
+ if (!type2) throwError(state, "unknown tag !<" + state.tag + ">");
12182
+ if (null !== state.result && type2.kind !== state.kind) throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type2.kind + '", not "' + state.kind + '"');
12183
+ if (type2.resolve(state.result, state.tag)) {
12184
+ state.result = type2.construct(state.result, state.tag);
12185
+ if (null !== state.anchor) storeAnchor(state, state.anchor, state.result);
12186
+ } else throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
12187
+ }
12188
+ if (null !== state.listener) state.listener("close", state);
12189
+ state.depth -= 1;
12190
+ return null !== state.tag || null !== state.anchor || hasContent;
12191
+ }
12192
+ function readDocument(state) {
12193
+ const documentStart = state.position;
12194
+ let hasDirectives = false;
12195
+ let ch;
12196
+ state.version = null;
12197
+ state.checkLineBreaks = state.legacy;
12198
+ state.tagMap = /* @__PURE__ */ Object.create(null);
12199
+ state.anchorMap = /* @__PURE__ */ Object.create(null);
12200
+ while(0 !== (ch = state.input.charCodeAt(state.position))){
12201
+ skipSeparationSpace(state, true, -1);
12202
+ ch = state.input.charCodeAt(state.position);
12203
+ if (state.lineIndent > 0 || 37 !== ch) break;
12204
+ hasDirectives = true;
12205
+ ch = state.input.charCodeAt(++state.position);
12206
+ let _position = state.position;
12207
+ while(0 !== ch && !isWsOrEol(ch))ch = state.input.charCodeAt(++state.position);
12208
+ const directiveName = state.input.slice(_position, state.position);
12209
+ const directiveArgs = [];
12210
+ if (directiveName.length < 1) throwError(state, "directive name must not be less than one character in length");
12211
+ while(0 !== ch){
12212
+ while(isWhiteSpace(ch))ch = state.input.charCodeAt(++state.position);
12213
+ if (35 === ch) {
12214
+ do ch = state.input.charCodeAt(++state.position);
12215
+ while (0 !== ch && !isEol(ch));
12216
+ break;
12217
+ }
12218
+ if (isEol(ch)) break;
12219
+ _position = state.position;
12220
+ while(0 !== ch && !isWsOrEol(ch))ch = state.input.charCodeAt(++state.position);
12221
+ directiveArgs.push(state.input.slice(_position, state.position));
12222
+ }
12223
+ if (0 !== ch) readLineBreak(state);
12224
+ if (_hasOwnProperty.call(directiveHandlers, directiveName)) directiveHandlers[directiveName](state, directiveName, directiveArgs);
12225
+ else throwWarning(state, 'unknown document directive "' + directiveName + '"');
12226
+ }
11852
12227
  skipSeparationSpace(state, true, -1);
11853
- } else if (hasDirectives) throwError(state, 'directives end mark is expected');
11854
- composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
11855
- skipSeparationSpace(state, true, -1);
11856
- 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');
11857
- state.documents.push(state.result);
11858
- if (state.position === state.lineStart && testDocumentSeparator(state)) {
11859
- if (0x2E === state.input.charCodeAt(state.position)) {
12228
+ if (0 === state.lineIndent && 45 === state.input.charCodeAt(state.position) && 45 === state.input.charCodeAt(state.position + 1) && 45 === state.input.charCodeAt(state.position + 2)) {
11860
12229
  state.position += 3;
11861
12230
  skipSeparationSpace(state, true, -1);
12231
+ } else if (hasDirectives) throwError(state, "directives end mark is expected");
12232
+ composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
12233
+ skipSeparationSpace(state, true, -1);
12234
+ 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");
12235
+ state.documents.push(state.result);
12236
+ if (state.position === state.lineStart && testDocumentSeparator(state)) {
12237
+ if (46 === state.input.charCodeAt(state.position)) {
12238
+ state.position += 3;
12239
+ skipSeparationSpace(state, true, -1);
12240
+ }
12241
+ return;
11862
12242
  }
11863
- return;
12243
+ if (state.position < state.length - 1) throwError(state, "end of the stream or a document separator is expected");
11864
12244
  }
11865
- if (!(state.position < state.length - 1)) return;
11866
- throwError(state, 'end of the stream or a document separator is expected');
11867
- }
11868
- function loadDocuments(input, options) {
11869
- input = String(input);
11870
- options = options || {};
11871
- if (0 !== input.length) {
11872
- if (0x0A !== input.charCodeAt(input.length - 1) && 0x0D !== input.charCodeAt(input.length - 1)) input += '\n';
11873
- if (0xFEFF === input.charCodeAt(0)) input = input.slice(1);
11874
- }
11875
- var state = new State$1(input, options);
11876
- var nullpos = input.indexOf('\0');
11877
- if (-1 !== nullpos) {
11878
- state.position = nullpos;
11879
- throwError(state, 'null byte is not allowed in input');
11880
- }
11881
- state.input += '\0';
11882
- while(0x20 === state.input.charCodeAt(state.position)){
11883
- state.lineIndent += 1;
11884
- state.position += 1;
11885
- }
11886
- while(state.position < state.length - 1)readDocument(state);
11887
- return state.documents;
11888
- }
11889
- function loadAll$1(input, iterator, options) {
11890
- if (null !== iterator && 'object' == typeof iterator && void 0 === options) {
11891
- options = iterator;
11892
- iterator = null;
11893
- }
11894
- var documents = loadDocuments(input, options);
11895
- if ('function' != typeof iterator) return documents;
11896
- for(var index = 0, length = documents.length; index < length; index += 1)iterator(documents[index]);
11897
- }
11898
- function load$1(input, options) {
11899
- var documents = loadDocuments(input, options);
11900
- if (0 === documents.length) return;
11901
- if (1 === documents.length) return documents[0];
11902
- throw new js_yaml_exception('expected a single document in the stream, but found more');
11903
- }
11904
- var loadAll_1 = loadAll$1;
11905
- var load_1 = load$1;
11906
- var loader = {
11907
- loadAll: loadAll_1,
11908
- load: load_1
11909
- };
11910
- var _toString = Object.prototype.toString;
11911
- var _hasOwnProperty = Object.prototype.hasOwnProperty;
11912
- var CHAR_BOM = 0xFEFF;
11913
- var CHAR_TAB = 0x09;
11914
- var CHAR_LINE_FEED = 0x0A;
11915
- var CHAR_CARRIAGE_RETURN = 0x0D;
11916
- var CHAR_SPACE = 0x20;
11917
- var CHAR_EXCLAMATION = 0x21;
11918
- var CHAR_DOUBLE_QUOTE = 0x22;
11919
- var CHAR_SHARP = 0x23;
11920
- var CHAR_PERCENT = 0x25;
11921
- var CHAR_AMPERSAND = 0x26;
11922
- var CHAR_SINGLE_QUOTE = 0x27;
11923
- var CHAR_ASTERISK = 0x2A;
11924
- var CHAR_COMMA = 0x2C;
11925
- var CHAR_MINUS = 0x2D;
11926
- var CHAR_COLON = 0x3A;
11927
- var CHAR_EQUALS = 0x3D;
11928
- var CHAR_GREATER_THAN = 0x3E;
11929
- var CHAR_QUESTION = 0x3F;
11930
- var CHAR_COMMERCIAL_AT = 0x40;
11931
- var CHAR_LEFT_SQUARE_BRACKET = 0x5B;
11932
- var CHAR_RIGHT_SQUARE_BRACKET = 0x5D;
11933
- var CHAR_GRAVE_ACCENT = 0x60;
11934
- var CHAR_LEFT_CURLY_BRACKET = 0x7B;
11935
- var CHAR_VERTICAL_LINE = 0x7C;
11936
- var CHAR_RIGHT_CURLY_BRACKET = 0x7D;
11937
- var ESCAPE_SEQUENCES = {};
11938
- ESCAPE_SEQUENCES[0x00] = '\\0';
11939
- ESCAPE_SEQUENCES[0x07] = '\\a';
11940
- ESCAPE_SEQUENCES[0x08] = '\\b';
11941
- ESCAPE_SEQUENCES[0x09] = '\\t';
11942
- ESCAPE_SEQUENCES[0x0A] = '\\n';
11943
- ESCAPE_SEQUENCES[0x0B] = '\\v';
11944
- ESCAPE_SEQUENCES[0x0C] = '\\f';
11945
- ESCAPE_SEQUENCES[0x0D] = '\\r';
11946
- ESCAPE_SEQUENCES[0x1B] = '\\e';
11947
- ESCAPE_SEQUENCES[0x22] = '\\"';
11948
- ESCAPE_SEQUENCES[0x5C] = '\\\\';
11949
- ESCAPE_SEQUENCES[0x85] = '\\N';
11950
- ESCAPE_SEQUENCES[0xA0] = '\\_';
11951
- ESCAPE_SEQUENCES[0x2028] = '\\L';
11952
- ESCAPE_SEQUENCES[0x2029] = '\\P';
11953
- var DEPRECATED_BOOLEANS_SYNTAX = [
11954
- 'y',
11955
- 'Y',
11956
- 'yes',
11957
- 'Yes',
11958
- 'YES',
11959
- 'on',
11960
- 'On',
11961
- 'ON',
11962
- 'n',
11963
- 'N',
11964
- 'no',
11965
- 'No',
11966
- 'NO',
11967
- 'off',
11968
- 'Off',
11969
- 'OFF'
11970
- ];
11971
- var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
11972
- function compileStyleMap(schema, map) {
11973
- var result, keys, index, length, tag, style, type;
11974
- if (null === map) return {};
11975
- result = {};
11976
- keys = Object.keys(map);
11977
- for(index = 0, length = keys.length; index < length; index += 1){
11978
- tag = keys[index];
11979
- style = String(map[tag]);
11980
- if ('!!' === tag.slice(0, 2)) tag = 'tag:yaml.org,2002:' + tag.slice(2);
11981
- type = schema.compiledTypeMap['fallback'][tag];
11982
- if (type && _hasOwnProperty.call(type.styleAliases, style)) style = type.styleAliases[style];
11983
- result[tag] = style;
12245
+ function loadDocuments(input, options) {
12246
+ input = String(input);
12247
+ options = options || {};
12248
+ if (0 !== input.length) {
12249
+ if (10 !== input.charCodeAt(input.length - 1) && 13 !== input.charCodeAt(input.length - 1)) input += "\n";
12250
+ if (65279 === input.charCodeAt(0)) input = input.slice(1);
12251
+ }
12252
+ const state = new State(input, options);
12253
+ const nullpos = input.indexOf("\0");
12254
+ if (-1 !== nullpos) {
12255
+ state.position = nullpos;
12256
+ throwError(state, "null byte is not allowed in input");
12257
+ }
12258
+ state.input += "\0";
12259
+ while(32 === state.input.charCodeAt(state.position)){
12260
+ state.lineIndent += 1;
12261
+ state.position += 1;
12262
+ }
12263
+ while(state.position < state.length - 1)readDocument(state);
12264
+ return state.documents;
12265
+ }
12266
+ function loadAll2(input, iterator, options) {
12267
+ if (null !== iterator && "object" == typeof iterator && void 0 === options) {
12268
+ options = iterator;
12269
+ iterator = null;
12270
+ }
12271
+ const documents = loadDocuments(input, options);
12272
+ if ("function" != typeof iterator) return documents;
12273
+ for(let index = 0, length = documents.length; index < length; index += 1)iterator(documents[index]);
12274
+ }
12275
+ function load2(input, options) {
12276
+ const documents = loadDocuments(input, options);
12277
+ if (0 === documents.length) return;
12278
+ if (1 === documents.length) return documents[0];
12279
+ throw new YAMLException2("expected a single document in the stream, but found more");
12280
+ }
12281
+ loader.loadAll = loadAll2;
12282
+ loader.load = load2;
12283
+ return loader;
12284
+ }
12285
+ var dumper = {};
12286
+ var hasRequiredDumper;
12287
+ function requireDumper() {
12288
+ if (hasRequiredDumper) return dumper;
12289
+ hasRequiredDumper = 1;
12290
+ const common2 = requireCommon();
12291
+ const YAMLException2 = requireException();
12292
+ const DEFAULT_SCHEMA2 = require_default();
12293
+ const _toString = Object.prototype.toString;
12294
+ const _hasOwnProperty = Object.prototype.hasOwnProperty;
12295
+ const CHAR_BOM = 65279;
12296
+ const CHAR_TAB = 9;
12297
+ const CHAR_LINE_FEED = 10;
12298
+ const CHAR_CARRIAGE_RETURN = 13;
12299
+ const CHAR_SPACE = 32;
12300
+ const CHAR_EXCLAMATION = 33;
12301
+ const CHAR_DOUBLE_QUOTE = 34;
12302
+ const CHAR_SHARP = 35;
12303
+ const CHAR_PERCENT = 37;
12304
+ const CHAR_AMPERSAND = 38;
12305
+ const CHAR_SINGLE_QUOTE = 39;
12306
+ const CHAR_ASTERISK = 42;
12307
+ const CHAR_COMMA = 44;
12308
+ const CHAR_MINUS = 45;
12309
+ const CHAR_COLON = 58;
12310
+ const CHAR_EQUALS = 61;
12311
+ const CHAR_GREATER_THAN = 62;
12312
+ const CHAR_QUESTION = 63;
12313
+ const CHAR_COMMERCIAL_AT = 64;
12314
+ const CHAR_LEFT_SQUARE_BRACKET = 91;
12315
+ const CHAR_RIGHT_SQUARE_BRACKET = 93;
12316
+ const CHAR_GRAVE_ACCENT = 96;
12317
+ const CHAR_LEFT_CURLY_BRACKET = 123;
12318
+ const CHAR_VERTICAL_LINE = 124;
12319
+ const CHAR_RIGHT_CURLY_BRACKET = 125;
12320
+ const ESCAPE_SEQUENCES = {};
12321
+ ESCAPE_SEQUENCES[0] = "\\0";
12322
+ ESCAPE_SEQUENCES[7] = "\\a";
12323
+ ESCAPE_SEQUENCES[8] = "\\b";
12324
+ ESCAPE_SEQUENCES[9] = "\\t";
12325
+ ESCAPE_SEQUENCES[10] = "\\n";
12326
+ ESCAPE_SEQUENCES[11] = "\\v";
12327
+ ESCAPE_SEQUENCES[12] = "\\f";
12328
+ ESCAPE_SEQUENCES[13] = "\\r";
12329
+ ESCAPE_SEQUENCES[27] = "\\e";
12330
+ ESCAPE_SEQUENCES[34] = '\\"';
12331
+ ESCAPE_SEQUENCES[92] = "\\\\";
12332
+ ESCAPE_SEQUENCES[133] = "\\N";
12333
+ ESCAPE_SEQUENCES[160] = "\\_";
12334
+ ESCAPE_SEQUENCES[8232] = "\\L";
12335
+ ESCAPE_SEQUENCES[8233] = "\\P";
12336
+ const DEPRECATED_BOOLEANS_SYNTAX = [
12337
+ "y",
12338
+ "Y",
12339
+ "yes",
12340
+ "Yes",
12341
+ "YES",
12342
+ "on",
12343
+ "On",
12344
+ "ON",
12345
+ "n",
12346
+ "N",
12347
+ "no",
12348
+ "No",
12349
+ "NO",
12350
+ "off",
12351
+ "Off",
12352
+ "OFF"
12353
+ ];
12354
+ const DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
12355
+ function compileStyleMap(schema2, map2) {
12356
+ if (null === map2) return {};
12357
+ const result = {};
12358
+ const keys = Object.keys(map2);
12359
+ for(let index = 0, length = keys.length; index < length; index += 1){
12360
+ let tag = keys[index];
12361
+ let style = String(map2[tag]);
12362
+ if ("!!" === tag.slice(0, 2)) tag = "tag:yaml.org,2002:" + tag.slice(2);
12363
+ const type2 = schema2.compiledTypeMap["fallback"][tag];
12364
+ if (type2 && _hasOwnProperty.call(type2.styleAliases, style)) style = type2.styleAliases[style];
12365
+ result[tag] = style;
12366
+ }
12367
+ return result;
11984
12368
  }
11985
- return result;
11986
- }
11987
- function encodeHex(character) {
11988
- var string, handle, length;
11989
- string = character.toString(16).toUpperCase();
11990
- if (character <= 0xFF) {
11991
- handle = 'x';
11992
- length = 2;
11993
- } else if (character <= 0xFFFF) {
11994
- handle = 'u';
11995
- length = 4;
11996
- } else if (character <= 0xFFFFFFFF) {
11997
- handle = 'U';
11998
- length = 8;
11999
- } else throw new js_yaml_exception('code point within a string may not be greater than 0xFFFFFFFF');
12000
- return '\\' + handle + common.repeat('0', length - string.length) + string;
12001
- }
12002
- var QUOTING_TYPE_SINGLE = 1, QUOTING_TYPE_DOUBLE = 2;
12003
- function State(options) {
12004
- this.schema = options['schema'] || _default;
12005
- this.indent = Math.max(1, options['indent'] || 2);
12006
- this.noArrayIndent = options['noArrayIndent'] || false;
12007
- this.skipInvalid = options['skipInvalid'] || false;
12008
- this.flowLevel = common.isNothing(options['flowLevel']) ? -1 : options['flowLevel'];
12009
- this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
12010
- this.sortKeys = options['sortKeys'] || false;
12011
- this.lineWidth = options['lineWidth'] || 80;
12012
- this.noRefs = options['noRefs'] || false;
12013
- this.noCompatMode = options['noCompatMode'] || false;
12014
- this.condenseFlow = options['condenseFlow'] || false;
12015
- this.quotingType = '"' === options['quotingType'] ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
12016
- this.forceQuotes = options['forceQuotes'] || false;
12017
- this.replacer = 'function' == typeof options['replacer'] ? options['replacer'] : null;
12018
- this.implicitTypes = this.schema.compiledImplicit;
12019
- this.explicitTypes = this.schema.compiledExplicit;
12020
- this.tag = null;
12021
- this.result = '';
12022
- this.duplicates = [];
12023
- this.usedDuplicates = null;
12024
- }
12025
- function indentString(string, spaces) {
12026
- var ind = common.repeat(' ', spaces), position = 0, next = -1, result = '', line, length = string.length;
12027
- while(position < length){
12028
- next = string.indexOf('\n', position);
12029
- if (-1 === next) {
12030
- line = string.slice(position);
12031
- position = length;
12032
- } else {
12033
- line = string.slice(position, next + 1);
12034
- position = next + 1;
12369
+ function encodeHex(character) {
12370
+ let handle;
12371
+ let length;
12372
+ const string = character.toString(16).toUpperCase();
12373
+ if (character <= 255) {
12374
+ handle = "x";
12375
+ length = 2;
12376
+ } else if (character <= 65535) {
12377
+ handle = "u";
12378
+ length = 4;
12379
+ } else if (character <= 4294967295) {
12380
+ handle = "U";
12381
+ length = 8;
12382
+ } else throw new YAMLException2("code point within a string may not be greater than 0xFFFFFFFF");
12383
+ return "\\" + handle + common2.repeat("0", length - string.length) + string;
12384
+ }
12385
+ const QUOTING_TYPE_SINGLE = 1;
12386
+ const QUOTING_TYPE_DOUBLE = 2;
12387
+ function State(options) {
12388
+ this.schema = options["schema"] || DEFAULT_SCHEMA2;
12389
+ this.indent = Math.max(1, options["indent"] || 2);
12390
+ this.noArrayIndent = options["noArrayIndent"] || false;
12391
+ this.skipInvalid = options["skipInvalid"] || false;
12392
+ this.flowLevel = common2.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
12393
+ this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
12394
+ this.sortKeys = options["sortKeys"] || false;
12395
+ this.lineWidth = options["lineWidth"] || 80;
12396
+ this.noRefs = options["noRefs"] || false;
12397
+ this.noCompatMode = options["noCompatMode"] || false;
12398
+ this.condenseFlow = options["condenseFlow"] || false;
12399
+ this.quotingType = '"' === options["quotingType"] ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
12400
+ this.forceQuotes = options["forceQuotes"] || false;
12401
+ this.replacer = "function" == typeof options["replacer"] ? options["replacer"] : null;
12402
+ this.implicitTypes = this.schema.compiledImplicit;
12403
+ this.explicitTypes = this.schema.compiledExplicit;
12404
+ this.tag = null;
12405
+ this.result = "";
12406
+ this.duplicates = [];
12407
+ this.usedDuplicates = null;
12408
+ }
12409
+ function indentString(string, spaces) {
12410
+ const ind = common2.repeat(" ", spaces);
12411
+ let position = 0;
12412
+ let result = "";
12413
+ const length = string.length;
12414
+ while(position < length){
12415
+ let line;
12416
+ const next = string.indexOf("\n", position);
12417
+ if (-1 === next) {
12418
+ line = string.slice(position);
12419
+ position = length;
12420
+ } else {
12421
+ line = string.slice(position, next + 1);
12422
+ position = next + 1;
12423
+ }
12424
+ if (line.length && "\n" !== line) result += ind;
12425
+ result += line;
12035
12426
  }
12036
- if (line.length && '\n' !== line) result += ind;
12037
- result += line;
12427
+ return result;
12038
12428
  }
12039
- return result;
12040
- }
12041
- function generateNextLine(state, level) {
12042
- return '\n' + common.repeat(' ', state.indent * level);
12043
- }
12044
- function testImplicitResolving(state, str) {
12045
- var index, length, type;
12046
- for(index = 0, length = state.implicitTypes.length; index < length; index += 1){
12047
- type = state.implicitTypes[index];
12048
- if (type.resolve(str)) return true;
12429
+ function generateNextLine(state, level) {
12430
+ return "\n" + common2.repeat(" ", state.indent * level);
12049
12431
  }
12050
- return false;
12051
- }
12052
- function isWhitespace(c) {
12053
- return c === CHAR_SPACE || c === CHAR_TAB;
12054
- }
12055
- function isPrintable(c) {
12056
- return 0x00020 <= c && c <= 0x00007E || 0x000A1 <= c && c <= 0x00D7FF && 0x2028 !== c && 0x2029 !== c || 0x0E000 <= c && c <= 0x00FFFD && c !== CHAR_BOM || 0x10000 <= c && c <= 0x10FFFF;
12057
- }
12058
- function isNsCharOrWhitespace(c) {
12059
- return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
12060
- }
12061
- function isPlainSafe(c, prev, inblock) {
12062
- var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
12063
- var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
12064
- return (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && 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 && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar;
12065
- }
12066
- function isPlainSafeFirst(c) {
12067
- return isPrintable(c) && c !== CHAR_BOM && !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;
12068
- }
12069
- function isPlainSafeLast(c) {
12070
- return !isWhitespace(c) && c !== CHAR_COLON;
12071
- }
12072
- function codePointAt(string, pos) {
12073
- var first = string.charCodeAt(pos), second;
12074
- if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {
12075
- second = string.charCodeAt(pos + 1);
12076
- if (second >= 0xDC00 && second <= 0xDFFF) return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
12077
- }
12078
- return first;
12079
- }
12080
- function needIndentIndicator(string) {
12081
- var leadingSpaceRe = /^\n* /;
12082
- return leadingSpaceRe.test(string);
12083
- }
12084
- var STYLE_PLAIN = 1, STYLE_SINGLE = 2, STYLE_LITERAL = 3, STYLE_FOLDED = 4, STYLE_DOUBLE = 5;
12085
- function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
12086
- var i;
12087
- var char = 0;
12088
- var prevChar = null;
12089
- var hasLineBreak = false;
12090
- var hasFoldableLine = false;
12091
- var shouldTrackWidth = -1 !== lineWidth;
12092
- var previousLineBreak = -1;
12093
- var plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1));
12094
- if (singleLineOnly || forceQuotes) for(i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++){
12095
- char = codePointAt(string, i);
12096
- if (!isPrintable(char)) return STYLE_DOUBLE;
12097
- plain = plain && isPlainSafe(char, prevChar, inblock);
12098
- prevChar = char;
12432
+ function testImplicitResolving(state, str2) {
12433
+ for(let index = 0, length = state.implicitTypes.length; index < length; index += 1){
12434
+ const type2 = state.implicitTypes[index];
12435
+ if (type2.resolve(str2)) return true;
12436
+ }
12437
+ return false;
12099
12438
  }
12100
- else {
12101
- for(i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++){
12439
+ function isWhitespace(c) {
12440
+ return c === CHAR_SPACE || c === CHAR_TAB;
12441
+ }
12442
+ function isPrintable(c) {
12443
+ return c >= 32 && c <= 126 || c >= 161 && c <= 55295 && 8232 !== c && 8233 !== c || c >= 57344 && c <= 65533 && c !== CHAR_BOM || c >= 65536 && c <= 1114111;
12444
+ }
12445
+ function isNsCharOrWhitespace(c) {
12446
+ return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
12447
+ }
12448
+ function isPlainSafe(c, prev, inblock) {
12449
+ const cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
12450
+ const cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
12451
+ return (inblock ? cIsNsCharOrWhitespace : cIsNsCharOrWhitespace && 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 && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar;
12452
+ }
12453
+ function isPlainSafeFirst(c) {
12454
+ return isPrintable(c) && c !== CHAR_BOM && !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;
12455
+ }
12456
+ function isPlainSafeLast(c) {
12457
+ return !isWhitespace(c) && c !== CHAR_COLON;
12458
+ }
12459
+ function codePointAt(string, pos) {
12460
+ const first = string.charCodeAt(pos);
12461
+ let second;
12462
+ if (first >= 55296 && first <= 56319 && pos + 1 < string.length) {
12463
+ second = string.charCodeAt(pos + 1);
12464
+ if (second >= 56320 && second <= 57343) return (first - 55296) * 1024 + second - 56320 + 65536;
12465
+ }
12466
+ return first;
12467
+ }
12468
+ function needIndentIndicator(string) {
12469
+ const leadingSpaceRe = /^\n* /;
12470
+ return leadingSpaceRe.test(string);
12471
+ }
12472
+ const STYLE_PLAIN = 1;
12473
+ const STYLE_SINGLE = 2;
12474
+ const STYLE_LITERAL = 3;
12475
+ const STYLE_FOLDED = 4;
12476
+ const STYLE_DOUBLE = 5;
12477
+ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
12478
+ let i;
12479
+ let char = 0;
12480
+ let prevChar = null;
12481
+ let hasLineBreak = false;
12482
+ let hasFoldableLine = false;
12483
+ const shouldTrackWidth = -1 !== lineWidth;
12484
+ let previousLineBreak = -1;
12485
+ let plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1));
12486
+ if (singleLineOnly || forceQuotes) for(i = 0; i < string.length; char >= 65536 ? i += 2 : i++){
12102
12487
  char = codePointAt(string, i);
12103
- if (char === CHAR_LINE_FEED) {
12104
- hasLineBreak = true;
12105
- if (shouldTrackWidth) {
12106
- hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && ' ' !== string[previousLineBreak + 1];
12107
- previousLineBreak = i;
12108
- }
12109
- } else if (!isPrintable(char)) return STYLE_DOUBLE;
12488
+ if (!isPrintable(char)) return STYLE_DOUBLE;
12110
12489
  plain = plain && isPlainSafe(char, prevChar, inblock);
12111
12490
  prevChar = char;
12112
12491
  }
12113
- hasFoldableLine = hasFoldableLine || shouldTrackWidth && i - previousLineBreak - 1 > lineWidth && ' ' !== string[previousLineBreak + 1];
12114
- }
12115
- if (!hasLineBreak && !hasFoldableLine) {
12116
- if (plain && !forceQuotes && !testAmbiguousType(string)) return STYLE_PLAIN;
12492
+ else {
12493
+ for(i = 0; i < string.length; char >= 65536 ? i += 2 : i++){
12494
+ char = codePointAt(string, i);
12495
+ if (char === CHAR_LINE_FEED) {
12496
+ hasLineBreak = true;
12497
+ if (shouldTrackWidth) {
12498
+ hasFoldableLine = hasFoldableLine || i - previousLineBreak - 1 > lineWidth && " " !== string[previousLineBreak + 1];
12499
+ previousLineBreak = i;
12500
+ }
12501
+ } else if (!isPrintable(char)) return STYLE_DOUBLE;
12502
+ plain = plain && isPlainSafe(char, prevChar, inblock);
12503
+ prevChar = char;
12504
+ }
12505
+ hasFoldableLine = hasFoldableLine || shouldTrackWidth && i - previousLineBreak - 1 > lineWidth && " " !== string[previousLineBreak + 1];
12506
+ }
12507
+ if (!hasLineBreak && !hasFoldableLine) {
12508
+ if (plain && !forceQuotes && !testAmbiguousType(string)) return STYLE_PLAIN;
12509
+ return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
12510
+ }
12511
+ if (indentPerLevel > 9 && needIndentIndicator(string)) return STYLE_DOUBLE;
12512
+ if (!forceQuotes) return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
12117
12513
  return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
12118
12514
  }
12119
- if (indentPerLevel > 9 && needIndentIndicator(string)) return STYLE_DOUBLE;
12120
- if (!forceQuotes) return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
12121
- return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
12122
- }
12123
- function writeScalar(state, string, level, iskey, inblock) {
12124
- state.dump = function() {
12125
- if (0 === string.length) return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
12126
- if (!state.noCompatMode) {
12127
- if (-1 !== DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) || DEPRECATED_BASE60_SYNTAX.test(string)) return state.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string + '"' : "'" + string + "'";
12128
- }
12129
- var indent = state.indent * Math.max(1, level);
12130
- var lineWidth = -1 === state.lineWidth ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
12131
- var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
12132
- function testAmbiguity(string) {
12133
- return testImplicitResolving(state, string);
12134
- }
12135
- switch(chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)){
12136
- case STYLE_PLAIN:
12137
- return string;
12138
- case STYLE_SINGLE:
12139
- return "'" + string.replace(/'/g, "''") + "'";
12140
- case STYLE_LITERAL:
12141
- return '|' + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
12142
- case STYLE_FOLDED:
12143
- return '>' + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
12144
- case STYLE_DOUBLE:
12145
- return '"' + escapeString(string) + '"';
12146
- default:
12147
- throw new js_yaml_exception('impossible error: invalid scalar style');
12148
- }
12149
- }();
12150
- }
12151
- function blockHeader(string, indentPerLevel) {
12152
- var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
12153
- var clip = '\n' === string[string.length - 1];
12154
- var keep = clip && ('\n' === string[string.length - 2] || '\n' === string);
12155
- var chomp = keep ? '+' : clip ? '' : '-';
12156
- return indentIndicator + chomp + '\n';
12157
- }
12158
- function dropEndingNewline(string) {
12159
- return '\n' === string[string.length - 1] ? string.slice(0, -1) : string;
12160
- }
12161
- function foldString(string, width) {
12162
- var lineRe = /(\n+)([^\n]*)/g;
12163
- var result = function() {
12164
- var nextLF = string.indexOf('\n');
12165
- nextLF = -1 !== nextLF ? nextLF : string.length;
12166
- lineRe.lastIndex = nextLF;
12167
- return foldLine(string.slice(0, nextLF), width);
12168
- }();
12169
- var prevMoreIndented = '\n' === string[0] || ' ' === string[0];
12170
- var moreIndented;
12171
- var match;
12172
- while(match = lineRe.exec(string)){
12173
- var prefix = match[1], line = match[2];
12174
- moreIndented = ' ' === line[0];
12175
- result += prefix + (prevMoreIndented || moreIndented || '' === line ? '' : '\n') + foldLine(line, width);
12176
- prevMoreIndented = moreIndented;
12515
+ function writeScalar(state, string, level, iskey, inblock) {
12516
+ state.dump = function() {
12517
+ if (0 === string.length) return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
12518
+ if (!state.noCompatMode) {
12519
+ if (-1 !== DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) || DEPRECATED_BASE60_SYNTAX.test(string)) return state.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string + '"' : "'" + string + "'";
12520
+ }
12521
+ const indent = state.indent * Math.max(1, level);
12522
+ const lineWidth = -1 === state.lineWidth ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
12523
+ const singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
12524
+ function testAmbiguity(string2) {
12525
+ return testImplicitResolving(state, string2);
12526
+ }
12527
+ switch(chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)){
12528
+ case STYLE_PLAIN:
12529
+ return string;
12530
+ case STYLE_SINGLE:
12531
+ return "'" + string.replace(/'/g, "''") + "'";
12532
+ case STYLE_LITERAL:
12533
+ return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
12534
+ case STYLE_FOLDED:
12535
+ return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
12536
+ case STYLE_DOUBLE:
12537
+ return '"' + escapeString(string) + '"';
12538
+ default:
12539
+ throw new YAMLException2("impossible error: invalid scalar style");
12540
+ }
12541
+ }();
12177
12542
  }
12178
- return result;
12179
- }
12180
- function foldLine(line, width) {
12181
- if ('' === line || ' ' === line[0]) return line;
12182
- var breakRe = / [^ ]/g;
12183
- var match;
12184
- var start = 0, end, curr = 0, next = 0;
12185
- var result = '';
12186
- while(match = breakRe.exec(line)){
12187
- next = match.index;
12188
- if (next - start > width) {
12189
- end = curr > start ? curr : next;
12190
- result += '\n' + line.slice(start, end);
12191
- start = end + 1;
12192
- }
12193
- curr = next;
12194
- }
12195
- result += '\n';
12196
- if (line.length - start > width && curr > start) result += line.slice(start, curr) + '\n' + line.slice(curr + 1);
12197
- else result += line.slice(start);
12198
- return result.slice(1);
12199
- }
12200
- function escapeString(string) {
12201
- var result = '';
12202
- var char = 0;
12203
- var escapeSeq;
12204
- for(var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++){
12205
- char = codePointAt(string, i);
12206
- escapeSeq = ESCAPE_SEQUENCES[char];
12207
- if (!escapeSeq && isPrintable(char)) {
12208
- result += string[i];
12209
- if (char >= 0x10000) result += string[i + 1];
12210
- } else result += escapeSeq || encodeHex(char);
12543
+ function blockHeader(string, indentPerLevel) {
12544
+ const indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
12545
+ const clip = "\n" === string[string.length - 1];
12546
+ const keep = clip && ("\n" === string[string.length - 2] || "\n" === string);
12547
+ const chomp = keep ? "+" : clip ? "" : "-";
12548
+ return indentIndicator + chomp + "\n";
12549
+ }
12550
+ function dropEndingNewline(string) {
12551
+ return "\n" === string[string.length - 1] ? string.slice(0, -1) : string;
12552
+ }
12553
+ function foldString(string, width) {
12554
+ const lineRe = /(\n+)([^\n]*)/g;
12555
+ let result = function() {
12556
+ let nextLF = string.indexOf("\n");
12557
+ nextLF = -1 !== nextLF ? nextLF : string.length;
12558
+ lineRe.lastIndex = nextLF;
12559
+ return foldLine(string.slice(0, nextLF), width);
12560
+ }();
12561
+ let prevMoreIndented = "\n" === string[0] || " " === string[0];
12562
+ let moreIndented;
12563
+ let match;
12564
+ while(match = lineRe.exec(string)){
12565
+ const prefix = match[1];
12566
+ const line = match[2];
12567
+ moreIndented = " " === line[0];
12568
+ result += prefix + (prevMoreIndented || moreIndented || "" === line ? "" : "\n") + foldLine(line, width);
12569
+ prevMoreIndented = moreIndented;
12570
+ }
12571
+ return result;
12211
12572
  }
12212
- return result;
12213
- }
12214
- function writeFlowSequence(state, level, object) {
12215
- var _result = '', _tag = state.tag, index, length, value;
12216
- for(index = 0, length = object.length; index < length; index += 1){
12217
- value = object[index];
12218
- if (state.replacer) value = state.replacer.call(object, String(index), value);
12219
- if (writeNode(state, level, value, false, false) || void 0 === value && writeNode(state, level, null, false, false)) {
12220
- if ('' !== _result) _result += ',' + (state.condenseFlow ? '' : ' ');
12221
- _result += state.dump;
12222
- }
12223
- }
12224
- state.tag = _tag;
12225
- state.dump = '[' + _result + ']';
12226
- }
12227
- function writeBlockSequence(state, level, object, compact) {
12228
- var _result = '', _tag = state.tag, index, length, value;
12229
- for(index = 0, length = object.length; index < length; index += 1){
12230
- value = object[index];
12231
- if (state.replacer) value = state.replacer.call(object, String(index), value);
12232
- if (writeNode(state, level + 1, value, true, true, false, true) || void 0 === value && writeNode(state, level + 1, null, true, true, false, true)) {
12233
- if (!compact || '' !== _result) _result += generateNextLine(state, level);
12234
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) _result += '-';
12235
- else _result += '- ';
12236
- _result += state.dump;
12237
- }
12238
- }
12239
- state.tag = _tag;
12240
- state.dump = _result || '[]';
12241
- }
12242
- function writeFlowMapping(state, level, object) {
12243
- var _result = '', _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer;
12244
- for(index = 0, length = objectKeyList.length; index < length; index += 1){
12245
- pairBuffer = '';
12246
- if ('' !== _result) pairBuffer += ', ';
12247
- if (state.condenseFlow) pairBuffer += '"';
12248
- objectKey = objectKeyList[index];
12249
- objectValue = object[objectKey];
12250
- if (state.replacer) objectValue = state.replacer.call(object, objectKey, objectValue);
12251
- if (writeNode(state, level, objectKey, false, false)) {
12252
- if (state.dump.length > 1024) pairBuffer += '? ';
12253
- pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
12254
- if (writeNode(state, level, objectValue, false, false)) {
12255
- pairBuffer += state.dump;
12256
- _result += pairBuffer;
12573
+ function foldLine(line, width) {
12574
+ if ("" === line || " " === line[0]) return line;
12575
+ const breakRe = / [^ ]/g;
12576
+ let match;
12577
+ let start = 0;
12578
+ let end;
12579
+ let curr = 0;
12580
+ let next = 0;
12581
+ let result = "";
12582
+ while(match = breakRe.exec(line)){
12583
+ next = match.index;
12584
+ if (next - start > width) {
12585
+ end = curr > start ? curr : next;
12586
+ result += "\n" + line.slice(start, end);
12587
+ start = end + 1;
12257
12588
  }
12589
+ curr = next;
12258
12590
  }
12591
+ result += "\n";
12592
+ if (line.length - start > width && curr > start) result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
12593
+ else result += line.slice(start);
12594
+ return result.slice(1);
12259
12595
  }
12260
- state.tag = _tag;
12261
- state.dump = '{' + _result + '}';
12262
- }
12263
- function writeBlockMapping(state, level, object, compact) {
12264
- var _result = '', _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer;
12265
- if (true === state.sortKeys) objectKeyList.sort();
12266
- else if ('function' == typeof state.sortKeys) objectKeyList.sort(state.sortKeys);
12267
- else if (state.sortKeys) throw new js_yaml_exception('sortKeys must be a boolean or a function');
12268
- for(index = 0, length = objectKeyList.length; index < length; index += 1){
12269
- pairBuffer = '';
12270
- if (!compact || '' !== _result) pairBuffer += generateNextLine(state, level);
12271
- objectKey = objectKeyList[index];
12272
- objectValue = object[objectKey];
12273
- if (state.replacer) objectValue = state.replacer.call(object, objectKey, objectValue);
12274
- if (writeNode(state, level + 1, objectKey, true, true, true)) {
12275
- explicitPair = null !== state.tag && '?' !== state.tag || state.dump && state.dump.length > 1024;
12276
- if (explicitPair) if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += '?';
12277
- else pairBuffer += '? ';
12596
+ function escapeString(string) {
12597
+ let result = "";
12598
+ let char = 0;
12599
+ for(let i = 0; i < string.length; char >= 65536 ? i += 2 : i++){
12600
+ char = codePointAt(string, i);
12601
+ const escapeSeq = ESCAPE_SEQUENCES[char];
12602
+ if (!escapeSeq && isPrintable(char)) {
12603
+ result += string[i];
12604
+ if (char >= 65536) result += string[i + 1];
12605
+ } else result += escapeSeq || encodeHex(char);
12606
+ }
12607
+ return result;
12608
+ }
12609
+ function writeFlowSequence(state, level, object) {
12610
+ let _result = "";
12611
+ const _tag = state.tag;
12612
+ for(let index = 0, length = object.length; index < length; index += 1){
12613
+ let value = object[index];
12614
+ if (state.replacer) value = state.replacer.call(object, String(index), value);
12615
+ if (writeNode(state, level, value, false, false) || void 0 === value && writeNode(state, level, null, false, false)) {
12616
+ if ("" !== _result) _result += "," + (state.condenseFlow ? "" : " ");
12617
+ _result += state.dump;
12618
+ }
12619
+ }
12620
+ state.tag = _tag;
12621
+ state.dump = "[" + _result + "]";
12622
+ }
12623
+ function writeBlockSequence(state, level, object, compact) {
12624
+ let _result = "";
12625
+ const _tag = state.tag;
12626
+ for(let index = 0, length = object.length; index < length; index += 1){
12627
+ let value = object[index];
12628
+ if (state.replacer) value = state.replacer.call(object, String(index), value);
12629
+ if (writeNode(state, level + 1, value, true, true, false, true) || void 0 === value && writeNode(state, level + 1, null, true, true, false, true)) {
12630
+ if (!compact || "" !== _result) _result += generateNextLine(state, level);
12631
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) _result += "-";
12632
+ else _result += "- ";
12633
+ _result += state.dump;
12634
+ }
12635
+ }
12636
+ state.tag = _tag;
12637
+ state.dump = _result || "[]";
12638
+ }
12639
+ function writeFlowMapping(state, level, object) {
12640
+ let _result = "";
12641
+ const _tag = state.tag;
12642
+ const objectKeyList = Object.keys(object);
12643
+ for(let index = 0, length = objectKeyList.length; index < length; index += 1){
12644
+ let pairBuffer = "";
12645
+ if ("" !== _result) pairBuffer += ", ";
12646
+ if (state.condenseFlow) pairBuffer += '"';
12647
+ const objectKey = objectKeyList[index];
12648
+ let objectValue = object[objectKey];
12649
+ if (state.replacer) objectValue = state.replacer.call(object, objectKey, objectValue);
12650
+ if (writeNode(state, level, objectKey, false, false)) {
12651
+ if (state.dump.length > 1024) pairBuffer += "? ";
12652
+ pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
12653
+ if (writeNode(state, level, objectValue, false, false)) {
12654
+ pairBuffer += state.dump;
12655
+ _result += pairBuffer;
12656
+ }
12657
+ }
12658
+ }
12659
+ state.tag = _tag;
12660
+ state.dump = "{" + _result + "}";
12661
+ }
12662
+ function writeBlockMapping(state, level, object, compact) {
12663
+ let _result = "";
12664
+ const _tag = state.tag;
12665
+ const objectKeyList = Object.keys(object);
12666
+ if (true === state.sortKeys) objectKeyList.sort();
12667
+ else if ("function" == typeof state.sortKeys) objectKeyList.sort(state.sortKeys);
12668
+ else if (state.sortKeys) throw new YAMLException2("sortKeys must be a boolean or a function");
12669
+ for(let index = 0, length = objectKeyList.length; index < length; index += 1){
12670
+ let pairBuffer = "";
12671
+ if (!compact || "" !== _result) pairBuffer += generateNextLine(state, level);
12672
+ const objectKey = objectKeyList[index];
12673
+ let objectValue = object[objectKey];
12674
+ if (state.replacer) objectValue = state.replacer.call(object, objectKey, objectValue);
12675
+ if (!writeNode(state, level + 1, objectKey, true, true, true)) continue;
12676
+ const explicitPair = null !== state.tag && "?" !== state.tag || state.dump && state.dump.length > 1024;
12677
+ if (explicitPair) if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += "?";
12678
+ else pairBuffer += "? ";
12278
12679
  pairBuffer += state.dump;
12279
12680
  if (explicitPair) pairBuffer += generateNextLine(state, level);
12280
12681
  if (writeNode(state, level + 1, objectValue, true, explicitPair)) {
12281
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += ':';
12282
- else pairBuffer += ': ';
12682
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) pairBuffer += ":";
12683
+ else pairBuffer += ": ";
12283
12684
  pairBuffer += state.dump;
12284
12685
  _result += pairBuffer;
12285
12686
  }
12286
12687
  }
12287
- }
12288
- state.tag = _tag;
12289
- state.dump = _result || '{}';
12290
- }
12291
- function detectType(state, object, explicit) {
12292
- var _result, typeList, index, length, type, style;
12293
- typeList = explicit ? state.explicitTypes : state.implicitTypes;
12294
- for(index = 0, length = typeList.length; index < length; index += 1){
12295
- type = typeList[index];
12296
- if ((type.instanceOf || type.predicate) && (!type.instanceOf || 'object' == typeof object && object instanceof type.instanceOf) && (!type.predicate || type.predicate(object))) {
12297
- if (explicit) if (type.multi && type.representName) state.tag = type.representName(object);
12298
- else state.tag = type.tag;
12299
- else state.tag = '?';
12300
- if (type.represent) {
12301
- style = state.styleMap[type.tag] || type.defaultStyle;
12302
- if ('[object Function]' === _toString.call(type.represent)) _result = type.represent(object, style);
12303
- else if (_hasOwnProperty.call(type.represent, style)) _result = type.represent[style](object, style);
12304
- else throw new js_yaml_exception('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
12305
- state.dump = _result;
12688
+ state.tag = _tag;
12689
+ state.dump = _result || "{}";
12690
+ }
12691
+ function detectType(state, object, explicit) {
12692
+ const typeList = explicit ? state.explicitTypes : state.implicitTypes;
12693
+ for(let index = 0, length = typeList.length; index < length; index += 1){
12694
+ const type2 = typeList[index];
12695
+ if ((type2.instanceOf || type2.predicate) && (!type2.instanceOf || "object" == typeof object && object instanceof type2.instanceOf) && (!type2.predicate || type2.predicate(object))) {
12696
+ if (explicit) if (type2.multi && type2.representName) state.tag = type2.representName(object);
12697
+ else state.tag = type2.tag;
12698
+ else state.tag = "?";
12699
+ if (type2.represent) {
12700
+ const style = state.styleMap[type2.tag] || type2.defaultStyle;
12701
+ let _result;
12702
+ if ("[object Function]" === _toString.call(type2.represent)) _result = type2.represent(object, style);
12703
+ else if (_hasOwnProperty.call(type2.represent, style)) _result = type2.represent[style](object, style);
12704
+ else throw new YAMLException2("!<" + type2.tag + '> tag resolver accepts not "' + style + '" style');
12705
+ state.dump = _result;
12706
+ }
12707
+ return true;
12306
12708
  }
12307
- return true;
12308
12709
  }
12710
+ return false;
12309
12711
  }
12310
- return false;
12311
- }
12312
- function writeNode(state, level, object, block, compact, iskey, isblockseq) {
12313
- state.tag = null;
12314
- state.dump = object;
12315
- if (!detectType(state, object, false)) detectType(state, object, true);
12316
- var type = _toString.call(state.dump);
12317
- var inblock = block;
12318
- var tagStr;
12319
- if (block) block = state.flowLevel < 0 || state.flowLevel > level;
12320
- var objectOrArray = '[object Object]' === type || '[object Array]' === type, duplicateIndex, duplicate;
12321
- if (objectOrArray) {
12322
- duplicateIndex = state.duplicates.indexOf(object);
12323
- duplicate = -1 !== duplicateIndex;
12324
- }
12325
- if (null !== state.tag && '?' !== state.tag || duplicate || 2 !== state.indent && level > 0) compact = false;
12326
- if (duplicate && state.usedDuplicates[duplicateIndex]) state.dump = '*ref_' + duplicateIndex;
12327
- else {
12328
- if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) state.usedDuplicates[duplicateIndex] = true;
12329
- if ('[object Object]' === type) if (block && 0 !== Object.keys(state.dump).length) {
12330
- writeBlockMapping(state, level, state.dump, compact);
12331
- if (duplicate) state.dump = '&ref_' + duplicateIndex + state.dump;
12332
- } else {
12333
- writeFlowMapping(state, level, state.dump);
12334
- if (duplicate) state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
12335
- }
12336
- else if ('[object Array]' === type) if (block && 0 !== state.dump.length) {
12337
- state.noArrayIndent && !isblockseq && level > 0 ? writeBlockSequence(state, level - 1, state.dump, compact) : writeBlockSequence(state, level, state.dump, compact);
12338
- if (duplicate) state.dump = '&ref_' + duplicateIndex + state.dump;
12339
- } else {
12340
- writeFlowSequence(state, level, state.dump);
12341
- if (duplicate) state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
12342
- }
12343
- else if ('[object String]' === type) {
12344
- if ('?' !== state.tag) writeScalar(state, state.dump, level, iskey, inblock);
12345
- } else {
12346
- if ('[object Undefined]' === type) return false;
12347
- if (state.skipInvalid) return false;
12348
- throw new js_yaml_exception('unacceptable kind of an object to dump ' + type);
12349
- }
12350
- if (null !== state.tag && '?' !== state.tag) {
12351
- tagStr = encodeURI('!' === state.tag[0] ? state.tag.slice(1) : state.tag).replace(/!/g, '%21');
12352
- tagStr = '!' === state.tag[0] ? '!' + tagStr : 'tag:yaml.org,2002:' === tagStr.slice(0, 18) ? '!!' + tagStr.slice(18) : '!<' + tagStr + '>';
12353
- state.dump = tagStr + ' ' + state.dump;
12712
+ function writeNode(state, level, object, block, compact, iskey, isblockseq) {
12713
+ state.tag = null;
12714
+ state.dump = object;
12715
+ if (!detectType(state, object, false)) detectType(state, object, true);
12716
+ const type2 = _toString.call(state.dump);
12717
+ const inblock = block;
12718
+ if (block) block = state.flowLevel < 0 || state.flowLevel > level;
12719
+ const objectOrArray = "[object Object]" === type2 || "[object Array]" === type2;
12720
+ let duplicateIndex;
12721
+ let duplicate;
12722
+ if (objectOrArray) {
12723
+ duplicateIndex = state.duplicates.indexOf(object);
12724
+ duplicate = -1 !== duplicateIndex;
12725
+ }
12726
+ if (null !== state.tag && "?" !== state.tag || duplicate || 2 !== state.indent && level > 0) compact = false;
12727
+ if (duplicate && state.usedDuplicates[duplicateIndex]) state.dump = "*ref_" + duplicateIndex;
12728
+ else {
12729
+ if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) state.usedDuplicates[duplicateIndex] = true;
12730
+ if ("[object Object]" === type2) if (block && 0 !== Object.keys(state.dump).length) {
12731
+ writeBlockMapping(state, level, state.dump, compact);
12732
+ if (duplicate) state.dump = "&ref_" + duplicateIndex + state.dump;
12733
+ } else {
12734
+ writeFlowMapping(state, level, state.dump);
12735
+ if (duplicate) state.dump = "&ref_" + duplicateIndex + " " + state.dump;
12736
+ }
12737
+ else if ("[object Array]" === type2) if (block && 0 !== state.dump.length) {
12738
+ state.noArrayIndent && !isblockseq && level > 0 ? writeBlockSequence(state, level - 1, state.dump, compact) : writeBlockSequence(state, level, state.dump, compact);
12739
+ if (duplicate) state.dump = "&ref_" + duplicateIndex + state.dump;
12740
+ } else {
12741
+ writeFlowSequence(state, level, state.dump);
12742
+ if (duplicate) state.dump = "&ref_" + duplicateIndex + " " + state.dump;
12743
+ }
12744
+ else if ("[object String]" === type2) {
12745
+ if ("?" !== state.tag) writeScalar(state, state.dump, level, iskey, inblock);
12746
+ } else {
12747
+ if ("[object Undefined]" === type2) return false;
12748
+ if (state.skipInvalid) return false;
12749
+ throw new YAMLException2("unacceptable kind of an object to dump " + type2);
12750
+ }
12751
+ if (null !== state.tag && "?" !== state.tag) {
12752
+ let tagStr = encodeURI("!" === state.tag[0] ? state.tag.slice(1) : state.tag).replace(/!/g, "%21");
12753
+ tagStr = "!" === state.tag[0] ? "!" + tagStr : "tag:yaml.org,2002:" === tagStr.slice(0, 18) ? "!!" + tagStr.slice(18) : "!<" + tagStr + ">";
12754
+ state.dump = tagStr + " " + state.dump;
12755
+ }
12354
12756
  }
12757
+ return true;
12355
12758
  }
12356
- return true;
12357
- }
12358
- function getDuplicateReferences(object, state) {
12359
- var objects = [], duplicatesIndexes = [], index, length;
12360
- inspectNode(object, objects, duplicatesIndexes);
12361
- for(index = 0, length = duplicatesIndexes.length; index < length; index += 1)state.duplicates.push(objects[duplicatesIndexes[index]]);
12362
- state.usedDuplicates = new Array(length);
12363
- }
12364
- function inspectNode(object, objects, duplicatesIndexes) {
12365
- var objectKeyList, index, length;
12366
- if (null !== object && 'object' == typeof object) {
12367
- index = objects.indexOf(object);
12368
- if (-1 !== index) {
12369
- if (-1 === duplicatesIndexes.indexOf(index)) duplicatesIndexes.push(index);
12370
- } else {
12371
- objects.push(object);
12372
- if (Array.isArray(object)) for(index = 0, length = object.length; index < length; index += 1)inspectNode(object[index], objects, duplicatesIndexes);
12373
- else {
12374
- objectKeyList = Object.keys(object);
12375
- for(index = 0, length = objectKeyList.length; index < length; index += 1)inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
12759
+ function getDuplicateReferences(object, state) {
12760
+ const objects = [];
12761
+ const duplicatesIndexes = [];
12762
+ inspectNode(object, objects, duplicatesIndexes);
12763
+ const length = duplicatesIndexes.length;
12764
+ for(let index = 0; index < length; index += 1)state.duplicates.push(objects[duplicatesIndexes[index]]);
12765
+ state.usedDuplicates = new Array(length);
12766
+ }
12767
+ function inspectNode(object, objects, duplicatesIndexes) {
12768
+ if (null !== object && "object" == typeof object) {
12769
+ const index = objects.indexOf(object);
12770
+ if (-1 !== index) {
12771
+ if (-1 === duplicatesIndexes.indexOf(index)) duplicatesIndexes.push(index);
12772
+ } else {
12773
+ objects.push(object);
12774
+ if (Array.isArray(object)) for(let i = 0, length = object.length; i < length; i += 1)inspectNode(object[i], objects, duplicatesIndexes);
12775
+ else {
12776
+ const objectKeyList = Object.keys(object);
12777
+ for(let i = 0, length = objectKeyList.length; i < length; i += 1)inspectNode(object[objectKeyList[i]], objects, duplicatesIndexes);
12778
+ }
12376
12779
  }
12377
12780
  }
12378
12781
  }
12379
- }
12380
- function dump$1(input, options) {
12381
- options = options || {};
12382
- var state = new State(options);
12383
- if (!state.noRefs) getDuplicateReferences(input, state);
12384
- var value = input;
12385
- if (state.replacer) value = state.replacer.call({
12386
- '': value
12387
- }, '', value);
12388
- if (writeNode(state, 0, value, true, true)) return state.dump + '\n';
12389
- return '';
12390
- }
12391
- var dump_1 = dump$1;
12392
- var dumper = {
12393
- dump: dump_1
12394
- };
12395
- function renamed(from, to) {
12396
- return function() {
12397
- throw new Error('Function yaml.' + from + " is removed in js-yaml 4. Use yaml." + to + ' instead, which is now safe by default.');
12782
+ function dump2(input, options) {
12783
+ options = options || {};
12784
+ const state = new State(options);
12785
+ if (!state.noRefs) getDuplicateReferences(input, state);
12786
+ let value = input;
12787
+ if (state.replacer) value = state.replacer.call({
12788
+ "": value
12789
+ }, "", value);
12790
+ if (writeNode(state, 0, value, true, true)) return state.dump + "\n";
12791
+ return "";
12792
+ }
12793
+ dumper.dump = dump2;
12794
+ return dumper;
12795
+ }
12796
+ var hasRequiredJsYaml;
12797
+ function requireJsYaml() {
12798
+ if (hasRequiredJsYaml) return jsYaml;
12799
+ hasRequiredJsYaml = 1;
12800
+ const loader2 = requireLoader();
12801
+ const dumper2 = requireDumper();
12802
+ function renamed(from, to) {
12803
+ return function() {
12804
+ throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
12805
+ };
12806
+ }
12807
+ jsYaml.Type = requireType();
12808
+ jsYaml.Schema = requireSchema();
12809
+ jsYaml.FAILSAFE_SCHEMA = requireFailsafe();
12810
+ jsYaml.JSON_SCHEMA = requireJson();
12811
+ jsYaml.CORE_SCHEMA = requireCore();
12812
+ jsYaml.DEFAULT_SCHEMA = require_default();
12813
+ jsYaml.load = loader2.load;
12814
+ jsYaml.loadAll = loader2.loadAll;
12815
+ jsYaml.dump = dumper2.dump;
12816
+ jsYaml.YAMLException = requireException();
12817
+ jsYaml.types = {
12818
+ binary: requireBinary(),
12819
+ float: requireFloat(),
12820
+ map: requireMap(),
12821
+ null: require_null(),
12822
+ pairs: requirePairs(),
12823
+ set: requireSet(),
12824
+ timestamp: requireTimestamp(),
12825
+ bool: requireBool(),
12826
+ int: requireInt(),
12827
+ merge: requireMerge(),
12828
+ omap: requireOmap(),
12829
+ seq: requireSeq(),
12830
+ str: requireStr()
12398
12831
  };
12399
- }
12400
- var JSON_SCHEMA = json;
12401
- var load = loader.load;
12402
- loader.loadAll;
12403
- dumper.dump;
12404
- renamed('safeLoad', 'load');
12405
- renamed('safeLoadAll', 'loadAll');
12406
- renamed('safeDump', 'dump');
12832
+ jsYaml.safeLoad = renamed("safeLoad", "load");
12833
+ jsYaml.safeLoadAll = renamed("safeLoadAll", "loadAll");
12834
+ jsYaml.safeDump = renamed("safeDump", "dump");
12835
+ return jsYaml;
12836
+ }
12837
+ var jsYamlExports = requireJsYaml();
12838
+ const yaml = /* @__PURE__ */ getDefaultExportFromCjs(jsYamlExports);
12839
+ const { Type, Schema, FAILSAFE_SCHEMA, JSON_SCHEMA, CORE_SCHEMA, DEFAULT_SCHEMA, load, loadAll, dump, YAMLException, types: js_yaml_types, safeLoad, safeLoadAll, safeDump } = yaml;
12407
12840
  var external_lodash_merge_ = __webpack_require__("lodash.merge");
12408
12841
  var external_lodash_merge_default = /*#__PURE__*/ __webpack_require__.n(external_lodash_merge_);
12409
12842
  async function expandFilePatterns(patterns, basePath) {