@midscene/cli 0.8.17 → 0.8.18-beta-20250107062545.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.
Files changed (3) hide show
  1. package/dist/es/index.js +187 -3060
  2. package/dist/lib/index.js +337 -3198
  3. package/package.json +3 -3
package/dist/es/index.js CHANGED
@@ -519,40 +519,40 @@ var require_balanced_match = __commonJS({
519
519
  "../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(exports, module) {
520
520
  "use strict";
521
521
  module.exports = balanced;
522
- function balanced(a, b, str2) {
522
+ function balanced(a, b, str) {
523
523
  if (a instanceof RegExp)
524
- a = maybeMatch(a, str2);
524
+ a = maybeMatch(a, str);
525
525
  if (b instanceof RegExp)
526
- b = maybeMatch(b, str2);
527
- var r = range(a, b, str2);
526
+ b = maybeMatch(b, str);
527
+ var r = range(a, b, str);
528
528
  return r && {
529
529
  start: r[0],
530
530
  end: r[1],
531
- pre: str2.slice(0, r[0]),
532
- body: str2.slice(r[0] + a.length, r[1]),
533
- post: str2.slice(r[1] + b.length)
531
+ pre: str.slice(0, r[0]),
532
+ body: str.slice(r[0] + a.length, r[1]),
533
+ post: str.slice(r[1] + b.length)
534
534
  };
535
535
  }
536
- function maybeMatch(reg, str2) {
537
- var m = str2.match(reg);
536
+ function maybeMatch(reg, str) {
537
+ var m = str.match(reg);
538
538
  return m ? m[0] : null;
539
539
  }
540
540
  balanced.range = range;
541
- function range(a, b, str2) {
541
+ function range(a, b, str) {
542
542
  var begs, beg, left, right, result;
543
- var ai = str2.indexOf(a);
544
- var bi = str2.indexOf(b, ai + 1);
543
+ var ai = str.indexOf(a);
544
+ var bi = str.indexOf(b, ai + 1);
545
545
  var i = ai;
546
546
  if (ai >= 0 && bi > 0) {
547
547
  if (a === b) {
548
548
  return [ai, bi];
549
549
  }
550
550
  begs = [];
551
- left = str2.length;
551
+ left = str.length;
552
552
  while (i >= 0 && !result) {
553
553
  if (i == ai) {
554
554
  begs.push(i);
555
- ai = str2.indexOf(a, i + 1);
555
+ ai = str.indexOf(a, i + 1);
556
556
  } else if (begs.length == 1) {
557
557
  result = [begs.pop(), bi];
558
558
  } else {
@@ -561,7 +561,7 @@ var require_balanced_match = __commonJS({
561
561
  left = beg;
562
562
  right = bi;
563
563
  }
564
- bi = str2.indexOf(b, i + 1);
564
+ bi = str.indexOf(b, i + 1);
565
565
  }
566
566
  i = ai < bi && ai >= 0 ? ai : bi;
567
567
  }
@@ -585,22 +585,22 @@ var require_brace_expansion = __commonJS({
585
585
  var escClose = "\0CLOSE" + Math.random() + "\0";
586
586
  var escComma = "\0COMMA" + Math.random() + "\0";
587
587
  var escPeriod = "\0PERIOD" + Math.random() + "\0";
588
- function numeric(str2) {
589
- return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0);
588
+ function numeric(str) {
589
+ return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
590
590
  }
591
- function escapeBraces(str2) {
592
- return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
591
+ function escapeBraces(str) {
592
+ return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
593
593
  }
594
- function unescapeBraces(str2) {
595
- return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
594
+ function unescapeBraces(str) {
595
+ return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
596
596
  }
597
- function parseCommaParts(str2) {
598
- if (!str2)
597
+ function parseCommaParts(str) {
598
+ if (!str)
599
599
  return [""];
600
600
  var parts = [];
601
- var m = balanced("{", "}", str2);
601
+ var m = balanced("{", "}", str);
602
602
  if (!m)
603
- return str2.split(",");
603
+ return str.split(",");
604
604
  var pre = m.pre;
605
605
  var body = m.body;
606
606
  var post = m.post;
@@ -614,16 +614,16 @@ var require_brace_expansion = __commonJS({
614
614
  parts.push.apply(parts, p);
615
615
  return parts;
616
616
  }
617
- function expandTop(str2) {
618
- if (!str2)
617
+ function expandTop(str) {
618
+ if (!str)
619
619
  return [];
620
- if (str2.substr(0, 2) === "{}") {
621
- str2 = "\\{\\}" + str2.substr(2);
620
+ if (str.substr(0, 2) === "{}") {
621
+ str = "\\{\\}" + str.substr(2);
622
622
  }
623
- return expand2(escapeBraces(str2), true).map(unescapeBraces);
623
+ return expand2(escapeBraces(str), true).map(unescapeBraces);
624
624
  }
625
- function embrace(str2) {
626
- return "{" + str2 + "}";
625
+ function embrace(str) {
626
+ return "{" + str + "}";
627
627
  }
628
628
  function isPadded(el) {
629
629
  return /^-?0\d/.test(el);
@@ -634,11 +634,11 @@ var require_brace_expansion = __commonJS({
634
634
  function gte(i, y) {
635
635
  return i >= y;
636
636
  }
637
- function expand2(str2, isTop) {
637
+ function expand2(str, isTop) {
638
638
  var expansions = [];
639
- var m = balanced("{", "}", str2);
639
+ var m = balanced("{", "}", str);
640
640
  if (!m)
641
- return [str2];
641
+ return [str];
642
642
  var pre = m.pre;
643
643
  var post = m.post.length ? expand2(m.post, false) : [""];
644
644
  if (/\$$/.test(m.pre)) {
@@ -653,10 +653,10 @@ var require_brace_expansion = __commonJS({
653
653
  var isOptions = m.body.indexOf(",") >= 0;
654
654
  if (!isSequence && !isOptions) {
655
655
  if (m.post.match(/,.*\}/)) {
656
- str2 = m.pre + "{" + m.body + escClose + m.post;
657
- return expand2(str2);
656
+ str = m.pre + "{" + m.body + escClose + m.post;
657
+ return expand2(str);
658
658
  }
659
- return [str2];
659
+ return [str];
660
660
  }
661
661
  var n;
662
662
  if (isSequence) {
@@ -889,7 +889,7 @@ var init_ast = __esm({
889
889
  star = qmark + "*?";
890
890
  starNoEmpty = qmark + "+?";
891
891
  _AST = class _AST {
892
- constructor(type2, parent, options = {}) {
892
+ constructor(type, parent, options = {}) {
893
893
  __privateAdd(this, _fillNegs);
894
894
  __privateAdd(this, _partsToRegExp);
895
895
  __publicField(this, "type");
@@ -906,14 +906,14 @@ var init_ast = __esm({
906
906
  // set to true if it's an extglob with no children
907
907
  // (which really means one child of '')
908
908
  __privateAdd(this, _emptyExt, false);
909
- this.type = type2;
910
- if (type2)
909
+ this.type = type;
910
+ if (type)
911
911
  __privateSet(this, _hasMagic, true);
912
912
  __privateSet(this, _parent, parent);
913
913
  __privateSet(this, _root, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _root) : this);
914
914
  __privateSet(this, _options, __privateGet(this, _root) === this ? options : __privateGet(__privateGet(this, _root), _options));
915
915
  __privateSet(this, _negs, __privateGet(this, _root) === this ? [] : __privateGet(__privateGet(this, _root), _negs));
916
- if (type2 === "!" && !__privateGet(__privateGet(this, _root), _filledNegs))
916
+ if (type === "!" && !__privateGet(__privateGet(this, _root), _filledNegs))
917
917
  __privateGet(this, _negs).push(this);
918
918
  __privateSet(this, _parentIndex, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0);
919
919
  }
@@ -1215,7 +1215,7 @@ var init_ast = __esm({
1215
1215
  return this;
1216
1216
  };
1217
1217
  _parseAST = new WeakSet();
1218
- parseAST_fn = function(str2, ast, pos, opt) {
1218
+ parseAST_fn = function(str, ast, pos, opt) {
1219
1219
  var _a4, _b2;
1220
1220
  let escaping = false;
1221
1221
  let inBrace = false;
@@ -1224,8 +1224,8 @@ var init_ast = __esm({
1224
1224
  if (ast.type === null) {
1225
1225
  let i2 = pos;
1226
1226
  let acc2 = "";
1227
- while (i2 < str2.length) {
1228
- const c = str2.charAt(i2++);
1227
+ while (i2 < str.length) {
1228
+ const c = str.charAt(i2++);
1229
1229
  if (escaping || c === "\\") {
1230
1230
  escaping = !escaping;
1231
1231
  acc2 += c;
@@ -1248,11 +1248,11 @@ var init_ast = __esm({
1248
1248
  acc2 += c;
1249
1249
  continue;
1250
1250
  }
1251
- if (!opt.noext && isExtglobType(c) && str2.charAt(i2) === "(") {
1251
+ if (!opt.noext && isExtglobType(c) && str.charAt(i2) === "(") {
1252
1252
  ast.push(acc2);
1253
1253
  acc2 = "";
1254
1254
  const ext2 = new _AST(c, ast);
1255
- i2 = __privateMethod(_a4 = _AST, _parseAST, parseAST_fn).call(_a4, str2, ext2, i2, opt);
1255
+ i2 = __privateMethod(_a4 = _AST, _parseAST, parseAST_fn).call(_a4, str, ext2, i2, opt);
1256
1256
  ast.push(ext2);
1257
1257
  continue;
1258
1258
  }
@@ -1265,8 +1265,8 @@ var init_ast = __esm({
1265
1265
  let part = new _AST(null, ast);
1266
1266
  const parts = [];
1267
1267
  let acc = "";
1268
- while (i < str2.length) {
1269
- const c = str2.charAt(i++);
1268
+ while (i < str.length) {
1269
+ const c = str.charAt(i++);
1270
1270
  if (escaping || c === "\\") {
1271
1271
  escaping = !escaping;
1272
1272
  acc += c;
@@ -1289,12 +1289,12 @@ var init_ast = __esm({
1289
1289
  acc += c;
1290
1290
  continue;
1291
1291
  }
1292
- if (isExtglobType(c) && str2.charAt(i) === "(") {
1292
+ if (isExtglobType(c) && str.charAt(i) === "(") {
1293
1293
  part.push(acc);
1294
1294
  acc = "";
1295
1295
  const ext2 = new _AST(c, part);
1296
1296
  part.push(ext2);
1297
- i = __privateMethod(_b2 = _AST, _parseAST, parseAST_fn).call(_b2, str2, ext2, i, opt);
1297
+ i = __privateMethod(_b2 = _AST, _parseAST, parseAST_fn).call(_b2, str, ext2, i, opt);
1298
1298
  continue;
1299
1299
  }
1300
1300
  if (c === "|") {
@@ -1317,7 +1317,7 @@ var init_ast = __esm({
1317
1317
  }
1318
1318
  ast.type = null;
1319
1319
  __privateSet(ast, _hasMagic, void 0);
1320
- __privateSet(ast, _parts, [str2.substring(pos - 1)]);
1320
+ __privateSet(ast, _parts, [str.substring(pos - 1)]);
1321
1321
  return i;
1322
1322
  };
1323
1323
  _partsToRegExp = new WeakSet();
@@ -1498,8 +1498,8 @@ var init_esm = __esm({
1498
1498
  },
1499
1499
  AST: class AST extends orig.AST {
1500
1500
  /* c8 ignore start */
1501
- constructor(type2, parent, options = {}) {
1502
- super(type2, parent, ext(def, options));
1501
+ constructor(type, parent, options = {}) {
1502
+ super(type, parent, ext(def, options));
1503
1503
  }
1504
1504
  /* c8 ignore stop */
1505
1505
  static fromGlob(pattern, options = {}) {
@@ -1616,7 +1616,7 @@ var init_esm = __esm({
1616
1616
  const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
1617
1617
  this.globParts = this.preprocess(rawGlobParts);
1618
1618
  this.debug(this.pattern, this.globParts);
1619
- let set2 = this.globParts.map((s, _, __) => {
1619
+ let set = this.globParts.map((s, _, __) => {
1620
1620
  if (this.isWindows && this.windowsNoMagicRoot) {
1621
1621
  const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
1622
1622
  const isDrive = /^[a-z]:/i.test(s[0]);
@@ -1628,8 +1628,8 @@ var init_esm = __esm({
1628
1628
  }
1629
1629
  return s.map((ss) => this.parse(ss));
1630
1630
  });
1631
- this.debug(this.pattern, set2);
1632
- this.set = set2.filter((s) => s.indexOf(false) === -1);
1631
+ this.debug(this.pattern, set);
1632
+ this.set = set.filter((s) => s.indexOf(false) === -1);
1633
1633
  if (this.isWindows) {
1634
1634
  for (let i = 0; i < this.set.length; i++) {
1635
1635
  const p = this.set[i];
@@ -1685,19 +1685,19 @@ var init_esm = __esm({
1685
1685
  // get rid of adjascent ** and resolve .. portions
1686
1686
  levelOneOptimize(globParts) {
1687
1687
  return globParts.map((parts) => {
1688
- parts = parts.reduce((set2, part) => {
1689
- const prev = set2[set2.length - 1];
1688
+ parts = parts.reduce((set, part) => {
1689
+ const prev = set[set.length - 1];
1690
1690
  if (part === "**" && prev === "**") {
1691
- return set2;
1691
+ return set;
1692
1692
  }
1693
1693
  if (part === "..") {
1694
1694
  if (prev && prev !== ".." && prev !== "." && prev !== "**") {
1695
- set2.pop();
1696
- return set2;
1695
+ set.pop();
1696
+ return set;
1697
1697
  }
1698
1698
  }
1699
- set2.push(part);
1700
- return set2;
1699
+ set.push(part);
1700
+ return set;
1701
1701
  }, []);
1702
1702
  return parts.length === 0 ? [""] : parts;
1703
1703
  });
@@ -2015,15 +2015,15 @@ var init_esm = __esm({
2015
2015
  makeRe() {
2016
2016
  if (this.regexp || this.regexp === false)
2017
2017
  return this.regexp;
2018
- const set2 = this.set;
2019
- if (!set2.length) {
2018
+ const set = this.set;
2019
+ if (!set.length) {
2020
2020
  this.regexp = false;
2021
2021
  return this.regexp;
2022
2022
  }
2023
2023
  const options = this.options;
2024
2024
  const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
2025
2025
  const flags = new Set(options.nocase ? ["i"] : []);
2026
- let re = set2.map((pattern) => {
2026
+ let re = set.map((pattern) => {
2027
2027
  const pp = pattern.map((p) => {
2028
2028
  if (p instanceof RegExp) {
2029
2029
  for (const f of p.flags.split(""))
@@ -2052,7 +2052,7 @@ var init_esm = __esm({
2052
2052
  });
2053
2053
  return pp.filter((p) => p !== GLOBSTAR).join("/");
2054
2054
  }).join("|");
2055
- const [open, close] = set2.length > 1 ? ["(?:", ")"] : ["", ""];
2055
+ const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
2056
2056
  re = "^" + open + re + close + "$";
2057
2057
  if (this.negate)
2058
2058
  re = "^(?!" + re + ").+$";
@@ -2089,16 +2089,16 @@ var init_esm = __esm({
2089
2089
  }
2090
2090
  const ff = this.slashSplit(f);
2091
2091
  this.debug(this.pattern, "split", ff);
2092
- const set2 = this.set;
2093
- this.debug(this.pattern, "set", set2);
2092
+ const set = this.set;
2093
+ this.debug(this.pattern, "set", set);
2094
2094
  let filename = ff[ff.length - 1];
2095
2095
  if (!filename) {
2096
2096
  for (let i = ff.length - 2; !filename && i >= 0; i--) {
2097
2097
  filename = ff[i];
2098
2098
  }
2099
2099
  }
2100
- for (let i = 0; i < set2.length; i++) {
2101
- const pattern = set2[i];
2100
+ for (let i = 0; i < set.length; i++) {
2101
+ const pattern = set[i];
2102
2102
  let file = ff;
2103
2103
  if (options.matchBase && pattern.length === 1) {
2104
2104
  file = [filename];
@@ -2135,8 +2135,8 @@ var init_esm2 = __esm({
2135
2135
  perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
2136
2136
  warned = /* @__PURE__ */ new Set();
2137
2137
  PROCESS = typeof process === "object" && !!process ? process : {};
2138
- emitWarning = (msg, type2, code, fn) => {
2139
- typeof PROCESS.emitWarning === "function" ? PROCESS.emitWarning(msg, type2, code, fn) : console.error(`[${code}] ${type2}: ${msg}`);
2138
+ emitWarning = (msg, type, code, fn) => {
2139
+ typeof PROCESS.emitWarning === "function" ? PROCESS.emitWarning(msg, type, code, fn) : console.error(`[${code}] ${type}: ${msg}`);
2140
2140
  };
2141
2141
  AC = globalThis.AbortController;
2142
2142
  AS = globalThis.AbortSignal;
@@ -4574,7 +4574,7 @@ var init_esm4 = __esm({
4574
4574
  *
4575
4575
  * @internal
4576
4576
  */
4577
- constructor(name, type2 = UNKNOWN, root, roots, nocase, children, opts) {
4577
+ constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
4578
4578
  __privateAdd(this, _resolveParts);
4579
4579
  __privateAdd(this, _readdirSuccess);
4580
4580
  __privateAdd(this, _markENOENT);
@@ -4665,7 +4665,7 @@ var init_esm4 = __esm({
4665
4665
  __privateAdd(this, _asyncReaddirInFlight, void 0);
4666
4666
  this.name = name;
4667
4667
  __privateSet(this, _matchName, nocase ? normalizeNocase(name) : normalize(name));
4668
- __privateSet(this, _type, type2 & TYPEMASK);
4668
+ __privateSet(this, _type, type & TYPEMASK);
4669
4669
  this.nocase = nocase;
4670
4670
  this.roots = roots;
4671
4671
  this.root = root || this;
@@ -4930,8 +4930,8 @@ var init_esm4 = __esm({
4930
4930
  isUnknown() {
4931
4931
  return (__privateGet(this, _type) & IFMT) === UNKNOWN;
4932
4932
  }
4933
- isType(type2) {
4934
- return this[`is${type2}`]();
4933
+ isType(type) {
4934
+ return this[`is${type}`]();
4935
4935
  }
4936
4936
  getType() {
4937
4937
  return this.isUnknown() ? "Unknown" : this.isDirectory() ? "Directory" : this.isFile() ? "File" : this.isSymbolicLink() ? "SymbolicLink" : this.isFIFO() ? "FIFO" : this.isCharacterDevice() ? "CharacterDevice" : this.isBlockDevice() ? "BlockDevice" : (
@@ -5486,8 +5486,8 @@ var init_esm4 = __esm({
5486
5486
  };
5487
5487
  _readdirAddNewChild = new WeakSet();
5488
5488
  readdirAddNewChild_fn = function(e, c) {
5489
- const type2 = entToType(e);
5490
- const child = this.newChild(e.name, type2, { parent: this });
5489
+ const type = entToType(e);
5490
+ const child = this.newChild(e.name, type, { parent: this });
5491
5491
  const ifmt = __privateGet(child, _type) & IFMT;
5492
5492
  if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {
5493
5493
  __privateSet(child, _type, __privateGet(child, _type) | ENOTDIR);
@@ -5567,8 +5567,8 @@ var init_esm4 = __esm({
5567
5567
  *
5568
5568
  * @internal
5569
5569
  */
5570
- constructor(name, type2 = UNKNOWN, root, roots, nocase, children, opts) {
5571
- super(name, type2, root, roots, nocase, children, opts);
5570
+ constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
5571
+ super(name, type, root, roots, nocase, children, opts);
5572
5572
  /**
5573
5573
  * Separator for generating path strings.
5574
5574
  */
@@ -5581,8 +5581,8 @@ var init_esm4 = __esm({
5581
5581
  /**
5582
5582
  * @internal
5583
5583
  */
5584
- newChild(name, type2 = UNKNOWN, opts = {}) {
5585
- return new _PathWin32(name, type2, this.root, this.roots, this.nocase, this.childrenCache(), opts);
5584
+ newChild(name, type = UNKNOWN, opts = {}) {
5585
+ return new _PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
5586
5586
  }
5587
5587
  /**
5588
5588
  * @internal
@@ -5620,8 +5620,8 @@ var init_esm4 = __esm({
5620
5620
  *
5621
5621
  * @internal
5622
5622
  */
5623
- constructor(name, type2 = UNKNOWN, root, roots, nocase, children, opts) {
5624
- super(name, type2, root, roots, nocase, children, opts);
5623
+ constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
5624
+ super(name, type, root, roots, nocase, children, opts);
5625
5625
  /**
5626
5626
  * separator for parsing path strings
5627
5627
  */
@@ -5646,8 +5646,8 @@ var init_esm4 = __esm({
5646
5646
  /**
5647
5647
  * @internal
5648
5648
  */
5649
- newChild(name, type2 = UNKNOWN, opts = {}) {
5650
- return new _PathPosix(name, type2, this.root, this.roots, this.nocase, this.childrenCache(), opts);
5649
+ newChild(name, type = UNKNOWN, opts = {}) {
5650
+ return new _PathPosix(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
5651
5651
  }
5652
5652
  };
5653
5653
  PathScurryBase = class {
@@ -7315,16 +7315,16 @@ var init_glob = __esm({
7315
7315
  debug: !!this.opts.debug
7316
7316
  });
7317
7317
  const mms = this.pattern.map((p) => new Minimatch(p, mmo));
7318
- const [matchSet, globParts] = mms.reduce((set2, m) => {
7319
- set2[0].push(...m.set);
7320
- set2[1].push(...m.globParts);
7321
- return set2;
7318
+ const [matchSet, globParts] = mms.reduce((set, m) => {
7319
+ set[0].push(...m.set);
7320
+ set[1].push(...m.globParts);
7321
+ return set;
7322
7322
  }, [[], []]);
7323
- this.patterns = matchSet.map((set2, i) => {
7323
+ this.patterns = matchSet.map((set, i) => {
7324
7324
  const g = globParts[i];
7325
7325
  if (!g)
7326
7326
  throw new Error("invalid pattern object");
7327
- return new Pattern(set2, g, 0, this.platform);
7327
+ return new Pattern(set, g, 0, this.platform);
7328
7328
  });
7329
7329
  }
7330
7330
  walk() {
@@ -7471,2880 +7471,6 @@ var init_esm5 = __esm({
7471
7471
  }
7472
7472
  });
7473
7473
 
7474
- // ../../node_modules/.pnpm/minimist@1.2.5/node_modules/minimist/index.js
7475
- var require_minimist = __commonJS({
7476
- "../../node_modules/.pnpm/minimist@1.2.5/node_modules/minimist/index.js"(exports, module) {
7477
- "use strict";
7478
- module.exports = function(args, opts) {
7479
- if (!opts)
7480
- opts = {};
7481
- var flags = { bools: {}, strings: {}, unknownFn: null };
7482
- if (typeof opts["unknown"] === "function") {
7483
- flags.unknownFn = opts["unknown"];
7484
- }
7485
- if (typeof opts["boolean"] === "boolean" && opts["boolean"]) {
7486
- flags.allBools = true;
7487
- } else {
7488
- [].concat(opts["boolean"]).filter(Boolean).forEach(function(key2) {
7489
- flags.bools[key2] = true;
7490
- });
7491
- }
7492
- var aliases = {};
7493
- Object.keys(opts.alias || {}).forEach(function(key2) {
7494
- aliases[key2] = [].concat(opts.alias[key2]);
7495
- aliases[key2].forEach(function(x) {
7496
- aliases[x] = [key2].concat(aliases[key2].filter(function(y) {
7497
- return x !== y;
7498
- }));
7499
- });
7500
- });
7501
- [].concat(opts.string).filter(Boolean).forEach(function(key2) {
7502
- flags.strings[key2] = true;
7503
- if (aliases[key2]) {
7504
- flags.strings[aliases[key2]] = true;
7505
- }
7506
- });
7507
- var defaults2 = opts["default"] || {};
7508
- var argv = { _: [] };
7509
- Object.keys(flags.bools).forEach(function(key2) {
7510
- setArg(key2, defaults2[key2] === void 0 ? false : defaults2[key2]);
7511
- });
7512
- var notFlags = [];
7513
- if (args.indexOf("--") !== -1) {
7514
- notFlags = args.slice(args.indexOf("--") + 1);
7515
- args = args.slice(0, args.indexOf("--"));
7516
- }
7517
- function argDefined(key2, arg2) {
7518
- return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
7519
- }
7520
- function setArg(key2, val, arg2) {
7521
- if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {
7522
- if (flags.unknownFn(arg2) === false)
7523
- return;
7524
- }
7525
- var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
7526
- setKey(argv, key2.split("."), value2);
7527
- (aliases[key2] || []).forEach(function(x) {
7528
- setKey(argv, x.split("."), value2);
7529
- });
7530
- }
7531
- function setKey(obj, keys, value2) {
7532
- var o = obj;
7533
- for (var i2 = 0; i2 < keys.length - 1; i2++) {
7534
- var key2 = keys[i2];
7535
- if (key2 === "__proto__")
7536
- return;
7537
- if (o[key2] === void 0)
7538
- o[key2] = {};
7539
- if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype)
7540
- o[key2] = {};
7541
- if (o[key2] === Array.prototype)
7542
- o[key2] = [];
7543
- o = o[key2];
7544
- }
7545
- var key2 = keys[keys.length - 1];
7546
- if (key2 === "__proto__")
7547
- return;
7548
- if (o === Object.prototype || o === Number.prototype || o === String.prototype)
7549
- o = {};
7550
- if (o === Array.prototype)
7551
- o = [];
7552
- if (o[key2] === void 0 || flags.bools[key2] || typeof o[key2] === "boolean") {
7553
- o[key2] = value2;
7554
- } else if (Array.isArray(o[key2])) {
7555
- o[key2].push(value2);
7556
- } else {
7557
- o[key2] = [o[key2], value2];
7558
- }
7559
- }
7560
- function aliasIsBoolean(key2) {
7561
- return aliases[key2].some(function(x) {
7562
- return flags.bools[x];
7563
- });
7564
- }
7565
- for (var i = 0; i < args.length; i++) {
7566
- var arg = args[i];
7567
- if (/^--.+=/.test(arg)) {
7568
- var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
7569
- var key = m[1];
7570
- var value = m[2];
7571
- if (flags.bools[key]) {
7572
- value = value !== "false";
7573
- }
7574
- setArg(key, value, arg);
7575
- } else if (/^--no-.+/.test(arg)) {
7576
- var key = arg.match(/^--no-(.+)/)[1];
7577
- setArg(key, false, arg);
7578
- } else if (/^--.+/.test(arg)) {
7579
- var key = arg.match(/^--(.+)/)[1];
7580
- var next = args[i + 1];
7581
- if (next !== void 0 && !/^-/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
7582
- setArg(key, next, arg);
7583
- i++;
7584
- } else if (/^(true|false)$/.test(next)) {
7585
- setArg(key, next === "true", arg);
7586
- i++;
7587
- } else {
7588
- setArg(key, flags.strings[key] ? "" : true, arg);
7589
- }
7590
- } else if (/^-[^-]+/.test(arg)) {
7591
- var letters = arg.slice(1, -1).split("");
7592
- var broken = false;
7593
- for (var j = 0; j < letters.length; j++) {
7594
- var next = arg.slice(j + 2);
7595
- if (next === "-") {
7596
- setArg(letters[j], next, arg);
7597
- continue;
7598
- }
7599
- if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
7600
- setArg(letters[j], next.split("=")[1], arg);
7601
- broken = true;
7602
- break;
7603
- }
7604
- if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
7605
- setArg(letters[j], next, arg);
7606
- broken = true;
7607
- break;
7608
- }
7609
- if (letters[j + 1] && letters[j + 1].match(/\W/)) {
7610
- setArg(letters[j], arg.slice(j + 2), arg);
7611
- broken = true;
7612
- break;
7613
- } else {
7614
- setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg);
7615
- }
7616
- }
7617
- var key = arg.slice(-1)[0];
7618
- if (!broken && key !== "-") {
7619
- if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
7620
- setArg(key, args[i + 1], arg);
7621
- i++;
7622
- } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
7623
- setArg(key, args[i + 1] === "true", arg);
7624
- i++;
7625
- } else {
7626
- setArg(key, flags.strings[key] ? "" : true, arg);
7627
- }
7628
- }
7629
- } else {
7630
- if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
7631
- argv._.push(
7632
- flags.strings["_"] || !isNumber(arg) ? arg : Number(arg)
7633
- );
7634
- }
7635
- if (opts.stopEarly) {
7636
- argv._.push.apply(argv._, args.slice(i + 1));
7637
- break;
7638
- }
7639
- }
7640
- }
7641
- Object.keys(defaults2).forEach(function(key2) {
7642
- if (!hasKey(argv, key2.split("."))) {
7643
- setKey(argv, key2.split("."), defaults2[key2]);
7644
- (aliases[key2] || []).forEach(function(x) {
7645
- setKey(argv, x.split("."), defaults2[key2]);
7646
- });
7647
- }
7648
- });
7649
- if (opts["--"]) {
7650
- argv["--"] = new Array();
7651
- notFlags.forEach(function(key2) {
7652
- argv["--"].push(key2);
7653
- });
7654
- } else {
7655
- notFlags.forEach(function(key2) {
7656
- argv._.push(key2);
7657
- });
7658
- }
7659
- return argv;
7660
- };
7661
- function hasKey(obj, keys) {
7662
- var o = obj;
7663
- keys.slice(0, -1).forEach(function(key2) {
7664
- o = o[key2] || {};
7665
- });
7666
- var key = keys[keys.length - 1];
7667
- return key in o;
7668
- }
7669
- function isNumber(x) {
7670
- if (typeof x === "number")
7671
- return true;
7672
- if (/^0x[0-9a-f]+$/i.test(x))
7673
- return true;
7674
- return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
7675
- }
7676
- }
7677
- });
7678
-
7679
- // src/args.ts
7680
- var init_args = __esm({
7681
- "src/args.ts"() {
7682
- "use strict";
7683
- }
7684
- });
7685
-
7686
- // ../../node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs
7687
- function isNothing(subject) {
7688
- return typeof subject === "undefined" || subject === null;
7689
- }
7690
- function isObject(subject) {
7691
- return typeof subject === "object" && subject !== null;
7692
- }
7693
- function toArray(sequence) {
7694
- if (Array.isArray(sequence))
7695
- return sequence;
7696
- else if (isNothing(sequence))
7697
- return [];
7698
- return [sequence];
7699
- }
7700
- function extend(target, source) {
7701
- var index, length, key, sourceKeys;
7702
- if (source) {
7703
- sourceKeys = Object.keys(source);
7704
- for (index = 0, length = sourceKeys.length; index < length; index += 1) {
7705
- key = sourceKeys[index];
7706
- target[key] = source[key];
7707
- }
7708
- }
7709
- return target;
7710
- }
7711
- function repeat(string, count) {
7712
- var result = "", cycle;
7713
- for (cycle = 0; cycle < count; cycle += 1) {
7714
- result += string;
7715
- }
7716
- return result;
7717
- }
7718
- function isNegativeZero(number) {
7719
- return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
7720
- }
7721
- function formatError(exception2, compact) {
7722
- var where = "", message = exception2.reason || "(unknown reason)";
7723
- if (!exception2.mark)
7724
- return message;
7725
- if (exception2.mark.name) {
7726
- where += 'in "' + exception2.mark.name + '" ';
7727
- }
7728
- where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")";
7729
- if (!compact && exception2.mark.snippet) {
7730
- where += "\n\n" + exception2.mark.snippet;
7731
- }
7732
- return message + " " + where;
7733
- }
7734
- function YAMLException$1(reason, mark) {
7735
- Error.call(this);
7736
- this.name = "YAMLException";
7737
- this.reason = reason;
7738
- this.mark = mark;
7739
- this.message = formatError(this, false);
7740
- if (Error.captureStackTrace) {
7741
- Error.captureStackTrace(this, this.constructor);
7742
- } else {
7743
- this.stack = new Error().stack || "";
7744
- }
7745
- }
7746
- function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
7747
- var head = "";
7748
- var tail = "";
7749
- var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
7750
- if (position - lineStart > maxHalfLength) {
7751
- head = " ... ";
7752
- lineStart = position - maxHalfLength + head.length;
7753
- }
7754
- if (lineEnd - position > maxHalfLength) {
7755
- tail = " ...";
7756
- lineEnd = position + maxHalfLength - tail.length;
7757
- }
7758
- return {
7759
- str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "→") + tail,
7760
- pos: position - lineStart + head.length
7761
- // relative position
7762
- };
7763
- }
7764
- function padStart(string, max) {
7765
- return common.repeat(" ", max - string.length) + string;
7766
- }
7767
- function makeSnippet(mark, options) {
7768
- options = Object.create(options || null);
7769
- if (!mark.buffer)
7770
- return null;
7771
- if (!options.maxLength)
7772
- options.maxLength = 79;
7773
- if (typeof options.indent !== "number")
7774
- options.indent = 1;
7775
- if (typeof options.linesBefore !== "number")
7776
- options.linesBefore = 3;
7777
- if (typeof options.linesAfter !== "number")
7778
- options.linesAfter = 2;
7779
- var re = /\r?\n|\r|\0/g;
7780
- var lineStarts = [0];
7781
- var lineEnds = [];
7782
- var match2;
7783
- var foundLineNo = -1;
7784
- while (match2 = re.exec(mark.buffer)) {
7785
- lineEnds.push(match2.index);
7786
- lineStarts.push(match2.index + match2[0].length);
7787
- if (mark.position <= match2.index && foundLineNo < 0) {
7788
- foundLineNo = lineStarts.length - 2;
7789
- }
7790
- }
7791
- if (foundLineNo < 0)
7792
- foundLineNo = lineStarts.length - 1;
7793
- var result = "", i, line;
7794
- var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
7795
- var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
7796
- for (i = 1; i <= options.linesBefore; i++) {
7797
- if (foundLineNo - i < 0)
7798
- break;
7799
- line = getLine(
7800
- mark.buffer,
7801
- lineStarts[foundLineNo - i],
7802
- lineEnds[foundLineNo - i],
7803
- mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
7804
- maxLineLength
7805
- );
7806
- result = common.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result;
7807
- }
7808
- line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
7809
- result += common.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n";
7810
- result += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n";
7811
- for (i = 1; i <= options.linesAfter; i++) {
7812
- if (foundLineNo + i >= lineEnds.length)
7813
- break;
7814
- line = getLine(
7815
- mark.buffer,
7816
- lineStarts[foundLineNo + i],
7817
- lineEnds[foundLineNo + i],
7818
- mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
7819
- maxLineLength
7820
- );
7821
- result += common.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line.str + "\n";
7822
- }
7823
- return result.replace(/\n$/, "");
7824
- }
7825
- function compileStyleAliases(map2) {
7826
- var result = {};
7827
- if (map2 !== null) {
7828
- Object.keys(map2).forEach(function(style) {
7829
- map2[style].forEach(function(alias) {
7830
- result[String(alias)] = style;
7831
- });
7832
- });
7833
- }
7834
- return result;
7835
- }
7836
- function Type$1(tag, options) {
7837
- options = options || {};
7838
- Object.keys(options).forEach(function(name) {
7839
- if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
7840
- throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
7841
- }
7842
- });
7843
- this.options = options;
7844
- this.tag = tag;
7845
- this.kind = options["kind"] || null;
7846
- this.resolve = options["resolve"] || function() {
7847
- return true;
7848
- };
7849
- this.construct = options["construct"] || function(data) {
7850
- return data;
7851
- };
7852
- this.instanceOf = options["instanceOf"] || null;
7853
- this.predicate = options["predicate"] || null;
7854
- this.represent = options["represent"] || null;
7855
- this.representName = options["representName"] || null;
7856
- this.defaultStyle = options["defaultStyle"] || null;
7857
- this.multi = options["multi"] || false;
7858
- this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
7859
- if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
7860
- throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
7861
- }
7862
- }
7863
- function compileList(schema2, name) {
7864
- var result = [];
7865
- schema2[name].forEach(function(currentType) {
7866
- var newIndex = result.length;
7867
- result.forEach(function(previousType, previousIndex) {
7868
- if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
7869
- newIndex = previousIndex;
7870
- }
7871
- });
7872
- result[newIndex] = currentType;
7873
- });
7874
- return result;
7875
- }
7876
- function compileMap() {
7877
- var result = {
7878
- scalar: {},
7879
- sequence: {},
7880
- mapping: {},
7881
- fallback: {},
7882
- multi: {
7883
- scalar: [],
7884
- sequence: [],
7885
- mapping: [],
7886
- fallback: []
7887
- }
7888
- }, index, length;
7889
- function collectType(type2) {
7890
- if (type2.multi) {
7891
- result.multi[type2.kind].push(type2);
7892
- result.multi["fallback"].push(type2);
7893
- } else {
7894
- result[type2.kind][type2.tag] = result["fallback"][type2.tag] = type2;
7895
- }
7896
- }
7897
- for (index = 0, length = arguments.length; index < length; index += 1) {
7898
- arguments[index].forEach(collectType);
7899
- }
7900
- return result;
7901
- }
7902
- function Schema$1(definition) {
7903
- return this.extend(definition);
7904
- }
7905
- function resolveYamlNull(data) {
7906
- if (data === null)
7907
- return true;
7908
- var max = data.length;
7909
- return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
7910
- }
7911
- function constructYamlNull() {
7912
- return null;
7913
- }
7914
- function isNull(object) {
7915
- return object === null;
7916
- }
7917
- function resolveYamlBoolean(data) {
7918
- if (data === null)
7919
- return false;
7920
- var max = data.length;
7921
- return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
7922
- }
7923
- function constructYamlBoolean(data) {
7924
- return data === "true" || data === "True" || data === "TRUE";
7925
- }
7926
- function isBoolean(object) {
7927
- return Object.prototype.toString.call(object) === "[object Boolean]";
7928
- }
7929
- function isHexCode(c) {
7930
- return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
7931
- }
7932
- function isOctCode(c) {
7933
- return 48 <= c && c <= 55;
7934
- }
7935
- function isDecCode(c) {
7936
- return 48 <= c && c <= 57;
7937
- }
7938
- function resolveYamlInteger(data) {
7939
- if (data === null)
7940
- return false;
7941
- var max = data.length, index = 0, hasDigits = false, ch;
7942
- if (!max)
7943
- return false;
7944
- ch = data[index];
7945
- if (ch === "-" || ch === "+") {
7946
- ch = data[++index];
7947
- }
7948
- if (ch === "0") {
7949
- if (index + 1 === max)
7950
- return true;
7951
- ch = data[++index];
7952
- if (ch === "b") {
7953
- index++;
7954
- for (; index < max; index++) {
7955
- ch = data[index];
7956
- if (ch === "_")
7957
- continue;
7958
- if (ch !== "0" && ch !== "1")
7959
- return false;
7960
- hasDigits = true;
7961
- }
7962
- return hasDigits && ch !== "_";
7963
- }
7964
- if (ch === "x") {
7965
- index++;
7966
- for (; index < max; index++) {
7967
- ch = data[index];
7968
- if (ch === "_")
7969
- continue;
7970
- if (!isHexCode(data.charCodeAt(index)))
7971
- return false;
7972
- hasDigits = true;
7973
- }
7974
- return hasDigits && ch !== "_";
7975
- }
7976
- if (ch === "o") {
7977
- index++;
7978
- for (; index < max; index++) {
7979
- ch = data[index];
7980
- if (ch === "_")
7981
- continue;
7982
- if (!isOctCode(data.charCodeAt(index)))
7983
- return false;
7984
- hasDigits = true;
7985
- }
7986
- return hasDigits && ch !== "_";
7987
- }
7988
- }
7989
- if (ch === "_")
7990
- return false;
7991
- for (; index < max; index++) {
7992
- ch = data[index];
7993
- if (ch === "_")
7994
- continue;
7995
- if (!isDecCode(data.charCodeAt(index))) {
7996
- return false;
7997
- }
7998
- hasDigits = true;
7999
- }
8000
- if (!hasDigits || ch === "_")
8001
- return false;
8002
- return true;
8003
- }
8004
- function constructYamlInteger(data) {
8005
- var value = data, sign = 1, ch;
8006
- if (value.indexOf("_") !== -1) {
8007
- value = value.replace(/_/g, "");
8008
- }
8009
- ch = value[0];
8010
- if (ch === "-" || ch === "+") {
8011
- if (ch === "-")
8012
- sign = -1;
8013
- value = value.slice(1);
8014
- ch = value[0];
8015
- }
8016
- if (value === "0")
8017
- return 0;
8018
- if (ch === "0") {
8019
- if (value[1] === "b")
8020
- return sign * parseInt(value.slice(2), 2);
8021
- if (value[1] === "x")
8022
- return sign * parseInt(value.slice(2), 16);
8023
- if (value[1] === "o")
8024
- return sign * parseInt(value.slice(2), 8);
8025
- }
8026
- return sign * parseInt(value, 10);
8027
- }
8028
- function isInteger(object) {
8029
- return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object));
8030
- }
8031
- function resolveYamlFloat(data) {
8032
- if (data === null)
8033
- return false;
8034
- if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_`
8035
- // Probably should update regexp & check speed
8036
- data[data.length - 1] === "_") {
8037
- return false;
8038
- }
8039
- return true;
8040
- }
8041
- function constructYamlFloat(data) {
8042
- var value, sign;
8043
- value = data.replace(/_/g, "").toLowerCase();
8044
- sign = value[0] === "-" ? -1 : 1;
8045
- if ("+-".indexOf(value[0]) >= 0) {
8046
- value = value.slice(1);
8047
- }
8048
- if (value === ".inf") {
8049
- return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
8050
- } else if (value === ".nan") {
8051
- return NaN;
8052
- }
8053
- return sign * parseFloat(value, 10);
8054
- }
8055
- function representYamlFloat(object, style) {
8056
- var res;
8057
- if (isNaN(object)) {
8058
- switch (style) {
8059
- case "lowercase":
8060
- return ".nan";
8061
- case "uppercase":
8062
- return ".NAN";
8063
- case "camelcase":
8064
- return ".NaN";
8065
- }
8066
- } else if (Number.POSITIVE_INFINITY === object) {
8067
- switch (style) {
8068
- case "lowercase":
8069
- return ".inf";
8070
- case "uppercase":
8071
- return ".INF";
8072
- case "camelcase":
8073
- return ".Inf";
8074
- }
8075
- } else if (Number.NEGATIVE_INFINITY === object) {
8076
- switch (style) {
8077
- case "lowercase":
8078
- return "-.inf";
8079
- case "uppercase":
8080
- return "-.INF";
8081
- case "camelcase":
8082
- return "-.Inf";
8083
- }
8084
- } else if (common.isNegativeZero(object)) {
8085
- return "-0.0";
8086
- }
8087
- res = object.toString(10);
8088
- return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
8089
- }
8090
- function isFloat(object) {
8091
- return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
8092
- }
8093
- function resolveYamlTimestamp(data) {
8094
- if (data === null)
8095
- return false;
8096
- if (YAML_DATE_REGEXP.exec(data) !== null)
8097
- return true;
8098
- if (YAML_TIMESTAMP_REGEXP.exec(data) !== null)
8099
- return true;
8100
- return false;
8101
- }
8102
- function constructYamlTimestamp(data) {
8103
- var match2, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
8104
- match2 = YAML_DATE_REGEXP.exec(data);
8105
- if (match2 === null)
8106
- match2 = YAML_TIMESTAMP_REGEXP.exec(data);
8107
- if (match2 === null)
8108
- throw new Error("Date resolve error");
8109
- year = +match2[1];
8110
- month = +match2[2] - 1;
8111
- day = +match2[3];
8112
- if (!match2[4]) {
8113
- return new Date(Date.UTC(year, month, day));
8114
- }
8115
- hour = +match2[4];
8116
- minute = +match2[5];
8117
- second = +match2[6];
8118
- if (match2[7]) {
8119
- fraction = match2[7].slice(0, 3);
8120
- while (fraction.length < 3) {
8121
- fraction += "0";
8122
- }
8123
- fraction = +fraction;
8124
- }
8125
- if (match2[9]) {
8126
- tz_hour = +match2[10];
8127
- tz_minute = +(match2[11] || 0);
8128
- delta = (tz_hour * 60 + tz_minute) * 6e4;
8129
- if (match2[9] === "-")
8130
- delta = -delta;
8131
- }
8132
- date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
8133
- if (delta)
8134
- date.setTime(date.getTime() - delta);
8135
- return date;
8136
- }
8137
- function representYamlTimestamp(object) {
8138
- return object.toISOString();
8139
- }
8140
- function resolveYamlMerge(data) {
8141
- return data === "<<" || data === null;
8142
- }
8143
- function resolveYamlBinary(data) {
8144
- if (data === null)
8145
- return false;
8146
- var code, idx, bitlen = 0, max = data.length, map2 = BASE64_MAP;
8147
- for (idx = 0; idx < max; idx++) {
8148
- code = map2.indexOf(data.charAt(idx));
8149
- if (code > 64)
8150
- continue;
8151
- if (code < 0)
8152
- return false;
8153
- bitlen += 6;
8154
- }
8155
- return bitlen % 8 === 0;
8156
- }
8157
- function constructYamlBinary(data) {
8158
- var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map2 = BASE64_MAP, bits = 0, result = [];
8159
- for (idx = 0; idx < max; idx++) {
8160
- if (idx % 4 === 0 && idx) {
8161
- result.push(bits >> 16 & 255);
8162
- result.push(bits >> 8 & 255);
8163
- result.push(bits & 255);
8164
- }
8165
- bits = bits << 6 | map2.indexOf(input.charAt(idx));
8166
- }
8167
- tailbits = max % 4 * 6;
8168
- if (tailbits === 0) {
8169
- result.push(bits >> 16 & 255);
8170
- result.push(bits >> 8 & 255);
8171
- result.push(bits & 255);
8172
- } else if (tailbits === 18) {
8173
- result.push(bits >> 10 & 255);
8174
- result.push(bits >> 2 & 255);
8175
- } else if (tailbits === 12) {
8176
- result.push(bits >> 4 & 255);
8177
- }
8178
- return new Uint8Array(result);
8179
- }
8180
- function representYamlBinary(object) {
8181
- var result = "", bits = 0, idx, tail, max = object.length, map2 = BASE64_MAP;
8182
- for (idx = 0; idx < max; idx++) {
8183
- if (idx % 3 === 0 && idx) {
8184
- result += map2[bits >> 18 & 63];
8185
- result += map2[bits >> 12 & 63];
8186
- result += map2[bits >> 6 & 63];
8187
- result += map2[bits & 63];
8188
- }
8189
- bits = (bits << 8) + object[idx];
8190
- }
8191
- tail = max % 3;
8192
- if (tail === 0) {
8193
- result += map2[bits >> 18 & 63];
8194
- result += map2[bits >> 12 & 63];
8195
- result += map2[bits >> 6 & 63];
8196
- result += map2[bits & 63];
8197
- } else if (tail === 2) {
8198
- result += map2[bits >> 10 & 63];
8199
- result += map2[bits >> 4 & 63];
8200
- result += map2[bits << 2 & 63];
8201
- result += map2[64];
8202
- } else if (tail === 1) {
8203
- result += map2[bits >> 2 & 63];
8204
- result += map2[bits << 4 & 63];
8205
- result += map2[64];
8206
- result += map2[64];
8207
- }
8208
- return result;
8209
- }
8210
- function isBinary(obj) {
8211
- return Object.prototype.toString.call(obj) === "[object Uint8Array]";
8212
- }
8213
- function resolveYamlOmap(data) {
8214
- if (data === null)
8215
- return true;
8216
- var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
8217
- for (index = 0, length = object.length; index < length; index += 1) {
8218
- pair = object[index];
8219
- pairHasKey = false;
8220
- if (_toString$2.call(pair) !== "[object Object]")
8221
- return false;
8222
- for (pairKey in pair) {
8223
- if (_hasOwnProperty$3.call(pair, pairKey)) {
8224
- if (!pairHasKey)
8225
- pairHasKey = true;
8226
- else
8227
- return false;
8228
- }
8229
- }
8230
- if (!pairHasKey)
8231
- return false;
8232
- if (objectKeys.indexOf(pairKey) === -1)
8233
- objectKeys.push(pairKey);
8234
- else
8235
- return false;
8236
- }
8237
- return true;
8238
- }
8239
- function constructYamlOmap(data) {
8240
- return data !== null ? data : [];
8241
- }
8242
- function resolveYamlPairs(data) {
8243
- if (data === null)
8244
- return true;
8245
- var index, length, pair, keys, result, object = data;
8246
- result = new Array(object.length);
8247
- for (index = 0, length = object.length; index < length; index += 1) {
8248
- pair = object[index];
8249
- if (_toString$1.call(pair) !== "[object Object]")
8250
- return false;
8251
- keys = Object.keys(pair);
8252
- if (keys.length !== 1)
8253
- return false;
8254
- result[index] = [keys[0], pair[keys[0]]];
8255
- }
8256
- return true;
8257
- }
8258
- function constructYamlPairs(data) {
8259
- if (data === null)
8260
- return [];
8261
- var index, length, pair, keys, result, object = data;
8262
- result = new Array(object.length);
8263
- for (index = 0, length = object.length; index < length; index += 1) {
8264
- pair = object[index];
8265
- keys = Object.keys(pair);
8266
- result[index] = [keys[0], pair[keys[0]]];
8267
- }
8268
- return result;
8269
- }
8270
- function resolveYamlSet(data) {
8271
- if (data === null)
8272
- return true;
8273
- var key, object = data;
8274
- for (key in object) {
8275
- if (_hasOwnProperty$2.call(object, key)) {
8276
- if (object[key] !== null)
8277
- return false;
8278
- }
8279
- }
8280
- return true;
8281
- }
8282
- function constructYamlSet(data) {
8283
- return data !== null ? data : {};
8284
- }
8285
- function _class(obj) {
8286
- return Object.prototype.toString.call(obj);
8287
- }
8288
- function is_EOL(c) {
8289
- return c === 10 || c === 13;
8290
- }
8291
- function is_WHITE_SPACE(c) {
8292
- return c === 9 || c === 32;
8293
- }
8294
- function is_WS_OR_EOL(c) {
8295
- return c === 9 || c === 32 || c === 10 || c === 13;
8296
- }
8297
- function is_FLOW_INDICATOR(c) {
8298
- return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
8299
- }
8300
- function fromHexCode(c) {
8301
- var lc;
8302
- if (48 <= c && c <= 57) {
8303
- return c - 48;
8304
- }
8305
- lc = c | 32;
8306
- if (97 <= lc && lc <= 102) {
8307
- return lc - 97 + 10;
8308
- }
8309
- return -1;
8310
- }
8311
- function escapedHexLen(c) {
8312
- if (c === 120) {
8313
- return 2;
8314
- }
8315
- if (c === 117) {
8316
- return 4;
8317
- }
8318
- if (c === 85) {
8319
- return 8;
8320
- }
8321
- return 0;
8322
- }
8323
- function fromDecimalCode(c) {
8324
- if (48 <= c && c <= 57) {
8325
- return c - 48;
8326
- }
8327
- return -1;
8328
- }
8329
- function simpleEscapeSequence(c) {
8330
- return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? '"' : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "…" : c === 95 ? " " : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
8331
- }
8332
- function charFromCodepoint(c) {
8333
- if (c <= 65535) {
8334
- return String.fromCharCode(c);
8335
- }
8336
- return String.fromCharCode(
8337
- (c - 65536 >> 10) + 55296,
8338
- (c - 65536 & 1023) + 56320
8339
- );
8340
- }
8341
- function State$1(input, options) {
8342
- this.input = input;
8343
- this.filename = options["filename"] || null;
8344
- this.schema = options["schema"] || _default;
8345
- this.onWarning = options["onWarning"] || null;
8346
- this.legacy = options["legacy"] || false;
8347
- this.json = options["json"] || false;
8348
- this.listener = options["listener"] || null;
8349
- this.implicitTypes = this.schema.compiledImplicit;
8350
- this.typeMap = this.schema.compiledTypeMap;
8351
- this.length = input.length;
8352
- this.position = 0;
8353
- this.line = 0;
8354
- this.lineStart = 0;
8355
- this.lineIndent = 0;
8356
- this.firstTabInLine = -1;
8357
- this.documents = [];
8358
- }
8359
- function generateError(state, message) {
8360
- var mark = {
8361
- name: state.filename,
8362
- buffer: state.input.slice(0, -1),
8363
- // omit trailing \0
8364
- position: state.position,
8365
- line: state.line,
8366
- column: state.position - state.lineStart
8367
- };
8368
- mark.snippet = snippet(mark);
8369
- return new exception(message, mark);
8370
- }
8371
- function throwError(state, message) {
8372
- throw generateError(state, message);
8373
- }
8374
- function throwWarning(state, message) {
8375
- if (state.onWarning) {
8376
- state.onWarning.call(null, generateError(state, message));
8377
- }
8378
- }
8379
- function captureSegment(state, start, end, checkJson) {
8380
- var _position, _length, _character, _result;
8381
- if (start < end) {
8382
- _result = state.input.slice(start, end);
8383
- if (checkJson) {
8384
- for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
8385
- _character = _result.charCodeAt(_position);
8386
- if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
8387
- throwError(state, "expected valid JSON character");
8388
- }
8389
- }
8390
- } else if (PATTERN_NON_PRINTABLE.test(_result)) {
8391
- throwError(state, "the stream contains non-printable characters");
8392
- }
8393
- state.result += _result;
8394
- }
8395
- }
8396
- function mergeMappings(state, destination, source, overridableKeys) {
8397
- var sourceKeys, key, index, quantity;
8398
- if (!common.isObject(source)) {
8399
- throwError(state, "cannot merge mappings; the provided source object is unacceptable");
8400
- }
8401
- sourceKeys = Object.keys(source);
8402
- for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
8403
- key = sourceKeys[index];
8404
- if (!_hasOwnProperty$1.call(destination, key)) {
8405
- destination[key] = source[key];
8406
- overridableKeys[key] = true;
8407
- }
8408
- }
8409
- }
8410
- function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
8411
- var index, quantity;
8412
- if (Array.isArray(keyNode)) {
8413
- keyNode = Array.prototype.slice.call(keyNode);
8414
- for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
8415
- if (Array.isArray(keyNode[index])) {
8416
- throwError(state, "nested arrays are not supported inside keys");
8417
- }
8418
- if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") {
8419
- keyNode[index] = "[object Object]";
8420
- }
8421
- }
8422
- }
8423
- if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
8424
- keyNode = "[object Object]";
8425
- }
8426
- keyNode = String(keyNode);
8427
- if (_result === null) {
8428
- _result = {};
8429
- }
8430
- if (keyTag === "tag:yaml.org,2002:merge") {
8431
- if (Array.isArray(valueNode)) {
8432
- for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
8433
- mergeMappings(state, _result, valueNode[index], overridableKeys);
8434
- }
8435
- } else {
8436
- mergeMappings(state, _result, valueNode, overridableKeys);
8437
- }
8438
- } else {
8439
- if (!state.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) {
8440
- state.line = startLine || state.line;
8441
- state.lineStart = startLineStart || state.lineStart;
8442
- state.position = startPos || state.position;
8443
- throwError(state, "duplicated mapping key");
8444
- }
8445
- if (keyNode === "__proto__") {
8446
- Object.defineProperty(_result, keyNode, {
8447
- configurable: true,
8448
- enumerable: true,
8449
- writable: true,
8450
- value: valueNode
8451
- });
8452
- } else {
8453
- _result[keyNode] = valueNode;
8454
- }
8455
- delete overridableKeys[keyNode];
8456
- }
8457
- return _result;
8458
- }
8459
- function readLineBreak(state) {
8460
- var ch;
8461
- ch = state.input.charCodeAt(state.position);
8462
- if (ch === 10) {
8463
- state.position++;
8464
- } else if (ch === 13) {
8465
- state.position++;
8466
- if (state.input.charCodeAt(state.position) === 10) {
8467
- state.position++;
8468
- }
8469
- } else {
8470
- throwError(state, "a line break is expected");
8471
- }
8472
- state.line += 1;
8473
- state.lineStart = state.position;
8474
- state.firstTabInLine = -1;
8475
- }
8476
- function skipSeparationSpace(state, allowComments, checkIndent) {
8477
- var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
8478
- while (ch !== 0) {
8479
- while (is_WHITE_SPACE(ch)) {
8480
- if (ch === 9 && state.firstTabInLine === -1) {
8481
- state.firstTabInLine = state.position;
8482
- }
8483
- ch = state.input.charCodeAt(++state.position);
8484
- }
8485
- if (allowComments && ch === 35) {
8486
- do {
8487
- ch = state.input.charCodeAt(++state.position);
8488
- } while (ch !== 10 && ch !== 13 && ch !== 0);
8489
- }
8490
- if (is_EOL(ch)) {
8491
- readLineBreak(state);
8492
- ch = state.input.charCodeAt(state.position);
8493
- lineBreaks++;
8494
- state.lineIndent = 0;
8495
- while (ch === 32) {
8496
- state.lineIndent++;
8497
- ch = state.input.charCodeAt(++state.position);
8498
- }
8499
- } else {
8500
- break;
8501
- }
8502
- }
8503
- if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
8504
- throwWarning(state, "deficient indentation");
8505
- }
8506
- return lineBreaks;
8507
- }
8508
- function testDocumentSeparator(state) {
8509
- var _position = state.position, ch;
8510
- ch = state.input.charCodeAt(_position);
8511
- if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
8512
- _position += 3;
8513
- ch = state.input.charCodeAt(_position);
8514
- if (ch === 0 || is_WS_OR_EOL(ch)) {
8515
- return true;
8516
- }
8517
- }
8518
- return false;
8519
- }
8520
- function writeFoldedLines(state, count) {
8521
- if (count === 1) {
8522
- state.result += " ";
8523
- } else if (count > 1) {
8524
- state.result += common.repeat("\n", count - 1);
8525
- }
8526
- }
8527
- function readPlainScalar(state, nodeIndent, withinFlowCollection) {
8528
- var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
8529
- ch = state.input.charCodeAt(state.position);
8530
- if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
8531
- return false;
8532
- }
8533
- if (ch === 63 || ch === 45) {
8534
- following = state.input.charCodeAt(state.position + 1);
8535
- if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
8536
- return false;
8537
- }
8538
- }
8539
- state.kind = "scalar";
8540
- state.result = "";
8541
- captureStart = captureEnd = state.position;
8542
- hasPendingContent = false;
8543
- while (ch !== 0) {
8544
- if (ch === 58) {
8545
- following = state.input.charCodeAt(state.position + 1);
8546
- if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
8547
- break;
8548
- }
8549
- } else if (ch === 35) {
8550
- preceding = state.input.charCodeAt(state.position - 1);
8551
- if (is_WS_OR_EOL(preceding)) {
8552
- break;
8553
- }
8554
- } else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
8555
- break;
8556
- } else if (is_EOL(ch)) {
8557
- _line = state.line;
8558
- _lineStart = state.lineStart;
8559
- _lineIndent = state.lineIndent;
8560
- skipSeparationSpace(state, false, -1);
8561
- if (state.lineIndent >= nodeIndent) {
8562
- hasPendingContent = true;
8563
- ch = state.input.charCodeAt(state.position);
8564
- continue;
8565
- } else {
8566
- state.position = captureEnd;
8567
- state.line = _line;
8568
- state.lineStart = _lineStart;
8569
- state.lineIndent = _lineIndent;
8570
- break;
8571
- }
8572
- }
8573
- if (hasPendingContent) {
8574
- captureSegment(state, captureStart, captureEnd, false);
8575
- writeFoldedLines(state, state.line - _line);
8576
- captureStart = captureEnd = state.position;
8577
- hasPendingContent = false;
8578
- }
8579
- if (!is_WHITE_SPACE(ch)) {
8580
- captureEnd = state.position + 1;
8581
- }
8582
- ch = state.input.charCodeAt(++state.position);
8583
- }
8584
- captureSegment(state, captureStart, captureEnd, false);
8585
- if (state.result) {
8586
- return true;
8587
- }
8588
- state.kind = _kind;
8589
- state.result = _result;
8590
- return false;
8591
- }
8592
- function readSingleQuotedScalar(state, nodeIndent) {
8593
- var ch, captureStart, captureEnd;
8594
- ch = state.input.charCodeAt(state.position);
8595
- if (ch !== 39) {
8596
- return false;
8597
- }
8598
- state.kind = "scalar";
8599
- state.result = "";
8600
- state.position++;
8601
- captureStart = captureEnd = state.position;
8602
- while ((ch = state.input.charCodeAt(state.position)) !== 0) {
8603
- if (ch === 39) {
8604
- captureSegment(state, captureStart, state.position, true);
8605
- ch = state.input.charCodeAt(++state.position);
8606
- if (ch === 39) {
8607
- captureStart = state.position;
8608
- state.position++;
8609
- captureEnd = state.position;
8610
- } else {
8611
- return true;
8612
- }
8613
- } else if (is_EOL(ch)) {
8614
- captureSegment(state, captureStart, captureEnd, true);
8615
- writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
8616
- captureStart = captureEnd = state.position;
8617
- } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
8618
- throwError(state, "unexpected end of the document within a single quoted scalar");
8619
- } else {
8620
- state.position++;
8621
- captureEnd = state.position;
8622
- }
8623
- }
8624
- throwError(state, "unexpected end of the stream within a single quoted scalar");
8625
- }
8626
- function readDoubleQuotedScalar(state, nodeIndent) {
8627
- var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
8628
- ch = state.input.charCodeAt(state.position);
8629
- if (ch !== 34) {
8630
- return false;
8631
- }
8632
- state.kind = "scalar";
8633
- state.result = "";
8634
- state.position++;
8635
- captureStart = captureEnd = state.position;
8636
- while ((ch = state.input.charCodeAt(state.position)) !== 0) {
8637
- if (ch === 34) {
8638
- captureSegment(state, captureStart, state.position, true);
8639
- state.position++;
8640
- return true;
8641
- } else if (ch === 92) {
8642
- captureSegment(state, captureStart, state.position, true);
8643
- ch = state.input.charCodeAt(++state.position);
8644
- if (is_EOL(ch)) {
8645
- skipSeparationSpace(state, false, nodeIndent);
8646
- } else if (ch < 256 && simpleEscapeCheck[ch]) {
8647
- state.result += simpleEscapeMap[ch];
8648
- state.position++;
8649
- } else if ((tmp = escapedHexLen(ch)) > 0) {
8650
- hexLength = tmp;
8651
- hexResult = 0;
8652
- for (; hexLength > 0; hexLength--) {
8653
- ch = state.input.charCodeAt(++state.position);
8654
- if ((tmp = fromHexCode(ch)) >= 0) {
8655
- hexResult = (hexResult << 4) + tmp;
8656
- } else {
8657
- throwError(state, "expected hexadecimal character");
8658
- }
8659
- }
8660
- state.result += charFromCodepoint(hexResult);
8661
- state.position++;
8662
- } else {
8663
- throwError(state, "unknown escape sequence");
8664
- }
8665
- captureStart = captureEnd = state.position;
8666
- } else if (is_EOL(ch)) {
8667
- captureSegment(state, captureStart, captureEnd, true);
8668
- writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
8669
- captureStart = captureEnd = state.position;
8670
- } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
8671
- throwError(state, "unexpected end of the document within a double quoted scalar");
8672
- } else {
8673
- state.position++;
8674
- captureEnd = state.position;
8675
- }
8676
- }
8677
- throwError(state, "unexpected end of the stream within a double quoted scalar");
8678
- }
8679
- function readFlowCollection(state, nodeIndent) {
8680
- var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch;
8681
- ch = state.input.charCodeAt(state.position);
8682
- if (ch === 91) {
8683
- terminator = 93;
8684
- isMapping = false;
8685
- _result = [];
8686
- } else if (ch === 123) {
8687
- terminator = 125;
8688
- isMapping = true;
8689
- _result = {};
8690
- } else {
8691
- return false;
8692
- }
8693
- if (state.anchor !== null) {
8694
- state.anchorMap[state.anchor] = _result;
8695
- }
8696
- ch = state.input.charCodeAt(++state.position);
8697
- while (ch !== 0) {
8698
- skipSeparationSpace(state, true, nodeIndent);
8699
- ch = state.input.charCodeAt(state.position);
8700
- if (ch === terminator) {
8701
- state.position++;
8702
- state.tag = _tag;
8703
- state.anchor = _anchor;
8704
- state.kind = isMapping ? "mapping" : "sequence";
8705
- state.result = _result;
8706
- return true;
8707
- } else if (!readNext) {
8708
- throwError(state, "missed comma between flow collection entries");
8709
- } else if (ch === 44) {
8710
- throwError(state, "expected the node content, but found ','");
8711
- }
8712
- keyTag = keyNode = valueNode = null;
8713
- isPair = isExplicitPair = false;
8714
- if (ch === 63) {
8715
- following = state.input.charCodeAt(state.position + 1);
8716
- if (is_WS_OR_EOL(following)) {
8717
- isPair = isExplicitPair = true;
8718
- state.position++;
8719
- skipSeparationSpace(state, true, nodeIndent);
8720
- }
8721
- }
8722
- _line = state.line;
8723
- _lineStart = state.lineStart;
8724
- _pos = state.position;
8725
- composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
8726
- keyTag = state.tag;
8727
- keyNode = state.result;
8728
- skipSeparationSpace(state, true, nodeIndent);
8729
- ch = state.input.charCodeAt(state.position);
8730
- if ((isExplicitPair || state.line === _line) && ch === 58) {
8731
- isPair = true;
8732
- ch = state.input.charCodeAt(++state.position);
8733
- skipSeparationSpace(state, true, nodeIndent);
8734
- composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
8735
- valueNode = state.result;
8736
- }
8737
- if (isMapping) {
8738
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
8739
- } else if (isPair) {
8740
- _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
8741
- } else {
8742
- _result.push(keyNode);
8743
- }
8744
- skipSeparationSpace(state, true, nodeIndent);
8745
- ch = state.input.charCodeAt(state.position);
8746
- if (ch === 44) {
8747
- readNext = true;
8748
- ch = state.input.charCodeAt(++state.position);
8749
- } else {
8750
- readNext = false;
8751
- }
8752
- }
8753
- throwError(state, "unexpected end of the stream within a flow collection");
8754
- }
8755
- function readBlockScalar(state, nodeIndent) {
8756
- var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
8757
- ch = state.input.charCodeAt(state.position);
8758
- if (ch === 124) {
8759
- folding = false;
8760
- } else if (ch === 62) {
8761
- folding = true;
8762
- } else {
8763
- return false;
8764
- }
8765
- state.kind = "scalar";
8766
- state.result = "";
8767
- while (ch !== 0) {
8768
- ch = state.input.charCodeAt(++state.position);
8769
- if (ch === 43 || ch === 45) {
8770
- if (CHOMPING_CLIP === chomping) {
8771
- chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
8772
- } else {
8773
- throwError(state, "repeat of a chomping mode identifier");
8774
- }
8775
- } else if ((tmp = fromDecimalCode(ch)) >= 0) {
8776
- if (tmp === 0) {
8777
- throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
8778
- } else if (!detectedIndent) {
8779
- textIndent = nodeIndent + tmp - 1;
8780
- detectedIndent = true;
8781
- } else {
8782
- throwError(state, "repeat of an indentation width identifier");
8783
- }
8784
- } else {
8785
- break;
8786
- }
8787
- }
8788
- if (is_WHITE_SPACE(ch)) {
8789
- do {
8790
- ch = state.input.charCodeAt(++state.position);
8791
- } while (is_WHITE_SPACE(ch));
8792
- if (ch === 35) {
8793
- do {
8794
- ch = state.input.charCodeAt(++state.position);
8795
- } while (!is_EOL(ch) && ch !== 0);
8796
- }
8797
- }
8798
- while (ch !== 0) {
8799
- readLineBreak(state);
8800
- state.lineIndent = 0;
8801
- ch = state.input.charCodeAt(state.position);
8802
- while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
8803
- state.lineIndent++;
8804
- ch = state.input.charCodeAt(++state.position);
8805
- }
8806
- if (!detectedIndent && state.lineIndent > textIndent) {
8807
- textIndent = state.lineIndent;
8808
- }
8809
- if (is_EOL(ch)) {
8810
- emptyLines++;
8811
- continue;
8812
- }
8813
- if (state.lineIndent < textIndent) {
8814
- if (chomping === CHOMPING_KEEP) {
8815
- state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
8816
- } else if (chomping === CHOMPING_CLIP) {
8817
- if (didReadContent) {
8818
- state.result += "\n";
8819
- }
8820
- }
8821
- break;
8822
- }
8823
- if (folding) {
8824
- if (is_WHITE_SPACE(ch)) {
8825
- atMoreIndented = true;
8826
- state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
8827
- } else if (atMoreIndented) {
8828
- atMoreIndented = false;
8829
- state.result += common.repeat("\n", emptyLines + 1);
8830
- } else if (emptyLines === 0) {
8831
- if (didReadContent) {
8832
- state.result += " ";
8833
- }
8834
- } else {
8835
- state.result += common.repeat("\n", emptyLines);
8836
- }
8837
- } else {
8838
- state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
8839
- }
8840
- didReadContent = true;
8841
- detectedIndent = true;
8842
- emptyLines = 0;
8843
- captureStart = state.position;
8844
- while (!is_EOL(ch) && ch !== 0) {
8845
- ch = state.input.charCodeAt(++state.position);
8846
- }
8847
- captureSegment(state, captureStart, state.position, false);
8848
- }
8849
- return true;
8850
- }
8851
- function readBlockSequence(state, nodeIndent) {
8852
- var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
8853
- if (state.firstTabInLine !== -1)
8854
- return false;
8855
- if (state.anchor !== null) {
8856
- state.anchorMap[state.anchor] = _result;
8857
- }
8858
- ch = state.input.charCodeAt(state.position);
8859
- while (ch !== 0) {
8860
- if (state.firstTabInLine !== -1) {
8861
- state.position = state.firstTabInLine;
8862
- throwError(state, "tab characters must not be used in indentation");
8863
- }
8864
- if (ch !== 45) {
8865
- break;
8866
- }
8867
- following = state.input.charCodeAt(state.position + 1);
8868
- if (!is_WS_OR_EOL(following)) {
8869
- break;
8870
- }
8871
- detected = true;
8872
- state.position++;
8873
- if (skipSeparationSpace(state, true, -1)) {
8874
- if (state.lineIndent <= nodeIndent) {
8875
- _result.push(null);
8876
- ch = state.input.charCodeAt(state.position);
8877
- continue;
8878
- }
8879
- }
8880
- _line = state.line;
8881
- composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
8882
- _result.push(state.result);
8883
- skipSeparationSpace(state, true, -1);
8884
- ch = state.input.charCodeAt(state.position);
8885
- if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
8886
- throwError(state, "bad indentation of a sequence entry");
8887
- } else if (state.lineIndent < nodeIndent) {
8888
- break;
8889
- }
8890
- }
8891
- if (detected) {
8892
- state.tag = _tag;
8893
- state.anchor = _anchor;
8894
- state.kind = "sequence";
8895
- state.result = _result;
8896
- return true;
8897
- }
8898
- return false;
8899
- }
8900
- function readBlockMapping(state, nodeIndent, flowIndent) {
8901
- var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
8902
- if (state.firstTabInLine !== -1)
8903
- return false;
8904
- if (state.anchor !== null) {
8905
- state.anchorMap[state.anchor] = _result;
8906
- }
8907
- ch = state.input.charCodeAt(state.position);
8908
- while (ch !== 0) {
8909
- if (!atExplicitKey && state.firstTabInLine !== -1) {
8910
- state.position = state.firstTabInLine;
8911
- throwError(state, "tab characters must not be used in indentation");
8912
- }
8913
- following = state.input.charCodeAt(state.position + 1);
8914
- _line = state.line;
8915
- if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
8916
- if (ch === 63) {
8917
- if (atExplicitKey) {
8918
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
8919
- keyTag = keyNode = valueNode = null;
8920
- }
8921
- detected = true;
8922
- atExplicitKey = true;
8923
- allowCompact = true;
8924
- } else if (atExplicitKey) {
8925
- atExplicitKey = false;
8926
- allowCompact = true;
8927
- } else {
8928
- throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
8929
- }
8930
- state.position += 1;
8931
- ch = following;
8932
- } else {
8933
- _keyLine = state.line;
8934
- _keyLineStart = state.lineStart;
8935
- _keyPos = state.position;
8936
- if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
8937
- break;
8938
- }
8939
- if (state.line === _line) {
8940
- ch = state.input.charCodeAt(state.position);
8941
- while (is_WHITE_SPACE(ch)) {
8942
- ch = state.input.charCodeAt(++state.position);
8943
- }
8944
- if (ch === 58) {
8945
- ch = state.input.charCodeAt(++state.position);
8946
- if (!is_WS_OR_EOL(ch)) {
8947
- throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
8948
- }
8949
- if (atExplicitKey) {
8950
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
8951
- keyTag = keyNode = valueNode = null;
8952
- }
8953
- detected = true;
8954
- atExplicitKey = false;
8955
- allowCompact = false;
8956
- keyTag = state.tag;
8957
- keyNode = state.result;
8958
- } else if (detected) {
8959
- throwError(state, "can not read an implicit mapping pair; a colon is missed");
8960
- } else {
8961
- state.tag = _tag;
8962
- state.anchor = _anchor;
8963
- return true;
8964
- }
8965
- } else if (detected) {
8966
- throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
8967
- } else {
8968
- state.tag = _tag;
8969
- state.anchor = _anchor;
8970
- return true;
8971
- }
8972
- }
8973
- if (state.line === _line || state.lineIndent > nodeIndent) {
8974
- if (atExplicitKey) {
8975
- _keyLine = state.line;
8976
- _keyLineStart = state.lineStart;
8977
- _keyPos = state.position;
8978
- }
8979
- if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
8980
- if (atExplicitKey) {
8981
- keyNode = state.result;
8982
- } else {
8983
- valueNode = state.result;
8984
- }
8985
- }
8986
- if (!atExplicitKey) {
8987
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
8988
- keyTag = keyNode = valueNode = null;
8989
- }
8990
- skipSeparationSpace(state, true, -1);
8991
- ch = state.input.charCodeAt(state.position);
8992
- }
8993
- if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
8994
- throwError(state, "bad indentation of a mapping entry");
8995
- } else if (state.lineIndent < nodeIndent) {
8996
- break;
8997
- }
8998
- }
8999
- if (atExplicitKey) {
9000
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
9001
- }
9002
- if (detected) {
9003
- state.tag = _tag;
9004
- state.anchor = _anchor;
9005
- state.kind = "mapping";
9006
- state.result = _result;
9007
- }
9008
- return detected;
9009
- }
9010
- function readTagProperty(state) {
9011
- var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
9012
- ch = state.input.charCodeAt(state.position);
9013
- if (ch !== 33)
9014
- return false;
9015
- if (state.tag !== null) {
9016
- throwError(state, "duplication of a tag property");
9017
- }
9018
- ch = state.input.charCodeAt(++state.position);
9019
- if (ch === 60) {
9020
- isVerbatim = true;
9021
- ch = state.input.charCodeAt(++state.position);
9022
- } else if (ch === 33) {
9023
- isNamed = true;
9024
- tagHandle = "!!";
9025
- ch = state.input.charCodeAt(++state.position);
9026
- } else {
9027
- tagHandle = "!";
9028
- }
9029
- _position = state.position;
9030
- if (isVerbatim) {
9031
- do {
9032
- ch = state.input.charCodeAt(++state.position);
9033
- } while (ch !== 0 && ch !== 62);
9034
- if (state.position < state.length) {
9035
- tagName = state.input.slice(_position, state.position);
9036
- ch = state.input.charCodeAt(++state.position);
9037
- } else {
9038
- throwError(state, "unexpected end of the stream within a verbatim tag");
9039
- }
9040
- } else {
9041
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
9042
- if (ch === 33) {
9043
- if (!isNamed) {
9044
- tagHandle = state.input.slice(_position - 1, state.position + 1);
9045
- if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
9046
- throwError(state, "named tag handle cannot contain such characters");
9047
- }
9048
- isNamed = true;
9049
- _position = state.position + 1;
9050
- } else {
9051
- throwError(state, "tag suffix cannot contain exclamation marks");
9052
- }
9053
- }
9054
- ch = state.input.charCodeAt(++state.position);
9055
- }
9056
- tagName = state.input.slice(_position, state.position);
9057
- if (PATTERN_FLOW_INDICATORS.test(tagName)) {
9058
- throwError(state, "tag suffix cannot contain flow indicator characters");
9059
- }
9060
- }
9061
- if (tagName && !PATTERN_TAG_URI.test(tagName)) {
9062
- throwError(state, "tag name cannot contain such characters: " + tagName);
9063
- }
9064
- try {
9065
- tagName = decodeURIComponent(tagName);
9066
- } catch (err) {
9067
- throwError(state, "tag name is malformed: " + tagName);
9068
- }
9069
- if (isVerbatim) {
9070
- state.tag = tagName;
9071
- } else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) {
9072
- state.tag = state.tagMap[tagHandle] + tagName;
9073
- } else if (tagHandle === "!") {
9074
- state.tag = "!" + tagName;
9075
- } else if (tagHandle === "!!") {
9076
- state.tag = "tag:yaml.org,2002:" + tagName;
9077
- } else {
9078
- throwError(state, 'undeclared tag handle "' + tagHandle + '"');
9079
- }
9080
- return true;
9081
- }
9082
- function readAnchorProperty(state) {
9083
- var _position, ch;
9084
- ch = state.input.charCodeAt(state.position);
9085
- if (ch !== 38)
9086
- return false;
9087
- if (state.anchor !== null) {
9088
- throwError(state, "duplication of an anchor property");
9089
- }
9090
- ch = state.input.charCodeAt(++state.position);
9091
- _position = state.position;
9092
- while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
9093
- ch = state.input.charCodeAt(++state.position);
9094
- }
9095
- if (state.position === _position) {
9096
- throwError(state, "name of an anchor node must contain at least one character");
9097
- }
9098
- state.anchor = state.input.slice(_position, state.position);
9099
- return true;
9100
- }
9101
- function readAlias(state) {
9102
- var _position, alias, ch;
9103
- ch = state.input.charCodeAt(state.position);
9104
- if (ch !== 42)
9105
- return false;
9106
- ch = state.input.charCodeAt(++state.position);
9107
- _position = state.position;
9108
- while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
9109
- ch = state.input.charCodeAt(++state.position);
9110
- }
9111
- if (state.position === _position) {
9112
- throwError(state, "name of an alias node must contain at least one character");
9113
- }
9114
- alias = state.input.slice(_position, state.position);
9115
- if (!_hasOwnProperty$1.call(state.anchorMap, alias)) {
9116
- throwError(state, 'unidentified alias "' + alias + '"');
9117
- }
9118
- state.result = state.anchorMap[alias];
9119
- skipSeparationSpace(state, true, -1);
9120
- return true;
9121
- }
9122
- function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
9123
- var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type2, flowIndent, blockIndent;
9124
- if (state.listener !== null) {
9125
- state.listener("open", state);
9126
- }
9127
- state.tag = null;
9128
- state.anchor = null;
9129
- state.kind = null;
9130
- state.result = null;
9131
- allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
9132
- if (allowToSeek) {
9133
- if (skipSeparationSpace(state, true, -1)) {
9134
- atNewLine = true;
9135
- if (state.lineIndent > parentIndent) {
9136
- indentStatus = 1;
9137
- } else if (state.lineIndent === parentIndent) {
9138
- indentStatus = 0;
9139
- } else if (state.lineIndent < parentIndent) {
9140
- indentStatus = -1;
9141
- }
9142
- }
9143
- }
9144
- if (indentStatus === 1) {
9145
- while (readTagProperty(state) || readAnchorProperty(state)) {
9146
- if (skipSeparationSpace(state, true, -1)) {
9147
- atNewLine = true;
9148
- allowBlockCollections = allowBlockStyles;
9149
- if (state.lineIndent > parentIndent) {
9150
- indentStatus = 1;
9151
- } else if (state.lineIndent === parentIndent) {
9152
- indentStatus = 0;
9153
- } else if (state.lineIndent < parentIndent) {
9154
- indentStatus = -1;
9155
- }
9156
- } else {
9157
- allowBlockCollections = false;
9158
- }
9159
- }
9160
- }
9161
- if (allowBlockCollections) {
9162
- allowBlockCollections = atNewLine || allowCompact;
9163
- }
9164
- if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
9165
- if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
9166
- flowIndent = parentIndent;
9167
- } else {
9168
- flowIndent = parentIndent + 1;
9169
- }
9170
- blockIndent = state.position - state.lineStart;
9171
- if (indentStatus === 1) {
9172
- if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) {
9173
- hasContent = true;
9174
- } else {
9175
- if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) {
9176
- hasContent = true;
9177
- } else if (readAlias(state)) {
9178
- hasContent = true;
9179
- if (state.tag !== null || state.anchor !== null) {
9180
- throwError(state, "alias node should not have any properties");
9181
- }
9182
- } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
9183
- hasContent = true;
9184
- if (state.tag === null) {
9185
- state.tag = "?";
9186
- }
9187
- }
9188
- if (state.anchor !== null) {
9189
- state.anchorMap[state.anchor] = state.result;
9190
- }
9191
- }
9192
- } else if (indentStatus === 0) {
9193
- hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
9194
- }
9195
- }
9196
- if (state.tag === null) {
9197
- if (state.anchor !== null) {
9198
- state.anchorMap[state.anchor] = state.result;
9199
- }
9200
- } else if (state.tag === "?") {
9201
- if (state.result !== null && state.kind !== "scalar") {
9202
- throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
9203
- }
9204
- for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
9205
- type2 = state.implicitTypes[typeIndex];
9206
- if (type2.resolve(state.result)) {
9207
- state.result = type2.construct(state.result);
9208
- state.tag = type2.tag;
9209
- if (state.anchor !== null) {
9210
- state.anchorMap[state.anchor] = state.result;
9211
- }
9212
- break;
9213
- }
9214
- }
9215
- } else if (state.tag !== "!") {
9216
- if (_hasOwnProperty$1.call(state.typeMap[state.kind || "fallback"], state.tag)) {
9217
- type2 = state.typeMap[state.kind || "fallback"][state.tag];
9218
- } else {
9219
- type2 = null;
9220
- typeList = state.typeMap.multi[state.kind || "fallback"];
9221
- for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
9222
- if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
9223
- type2 = typeList[typeIndex];
9224
- break;
9225
- }
9226
- }
9227
- }
9228
- if (!type2) {
9229
- throwError(state, "unknown tag !<" + state.tag + ">");
9230
- }
9231
- if (state.result !== null && type2.kind !== state.kind) {
9232
- throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type2.kind + '", not "' + state.kind + '"');
9233
- }
9234
- if (!type2.resolve(state.result, state.tag)) {
9235
- throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
9236
- } else {
9237
- state.result = type2.construct(state.result, state.tag);
9238
- if (state.anchor !== null) {
9239
- state.anchorMap[state.anchor] = state.result;
9240
- }
9241
- }
9242
- }
9243
- if (state.listener !== null) {
9244
- state.listener("close", state);
9245
- }
9246
- return state.tag !== null || state.anchor !== null || hasContent;
9247
- }
9248
- function readDocument(state) {
9249
- var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
9250
- state.version = null;
9251
- state.checkLineBreaks = state.legacy;
9252
- state.tagMap = /* @__PURE__ */ Object.create(null);
9253
- state.anchorMap = /* @__PURE__ */ Object.create(null);
9254
- while ((ch = state.input.charCodeAt(state.position)) !== 0) {
9255
- skipSeparationSpace(state, true, -1);
9256
- ch = state.input.charCodeAt(state.position);
9257
- if (state.lineIndent > 0 || ch !== 37) {
9258
- break;
9259
- }
9260
- hasDirectives = true;
9261
- ch = state.input.charCodeAt(++state.position);
9262
- _position = state.position;
9263
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
9264
- ch = state.input.charCodeAt(++state.position);
9265
- }
9266
- directiveName = state.input.slice(_position, state.position);
9267
- directiveArgs = [];
9268
- if (directiveName.length < 1) {
9269
- throwError(state, "directive name must not be less than one character in length");
9270
- }
9271
- while (ch !== 0) {
9272
- while (is_WHITE_SPACE(ch)) {
9273
- ch = state.input.charCodeAt(++state.position);
9274
- }
9275
- if (ch === 35) {
9276
- do {
9277
- ch = state.input.charCodeAt(++state.position);
9278
- } while (ch !== 0 && !is_EOL(ch));
9279
- break;
9280
- }
9281
- if (is_EOL(ch))
9282
- break;
9283
- _position = state.position;
9284
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
9285
- ch = state.input.charCodeAt(++state.position);
9286
- }
9287
- directiveArgs.push(state.input.slice(_position, state.position));
9288
- }
9289
- if (ch !== 0)
9290
- readLineBreak(state);
9291
- if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
9292
- directiveHandlers[directiveName](state, directiveName, directiveArgs);
9293
- } else {
9294
- throwWarning(state, 'unknown document directive "' + directiveName + '"');
9295
- }
9296
- }
9297
- skipSeparationSpace(state, true, -1);
9298
- if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
9299
- state.position += 3;
9300
- skipSeparationSpace(state, true, -1);
9301
- } else if (hasDirectives) {
9302
- throwError(state, "directives end mark is expected");
9303
- }
9304
- composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
9305
- skipSeparationSpace(state, true, -1);
9306
- if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
9307
- throwWarning(state, "non-ASCII line breaks are interpreted as content");
9308
- }
9309
- state.documents.push(state.result);
9310
- if (state.position === state.lineStart && testDocumentSeparator(state)) {
9311
- if (state.input.charCodeAt(state.position) === 46) {
9312
- state.position += 3;
9313
- skipSeparationSpace(state, true, -1);
9314
- }
9315
- return;
9316
- }
9317
- if (state.position < state.length - 1) {
9318
- throwError(state, "end of the stream or a document separator is expected");
9319
- } else {
9320
- return;
9321
- }
9322
- }
9323
- function loadDocuments(input, options) {
9324
- input = String(input);
9325
- options = options || {};
9326
- if (input.length !== 0) {
9327
- if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
9328
- input += "\n";
9329
- }
9330
- if (input.charCodeAt(0) === 65279) {
9331
- input = input.slice(1);
9332
- }
9333
- }
9334
- var state = new State$1(input, options);
9335
- var nullpos = input.indexOf("\0");
9336
- if (nullpos !== -1) {
9337
- state.position = nullpos;
9338
- throwError(state, "null byte is not allowed in input");
9339
- }
9340
- state.input += "\0";
9341
- while (state.input.charCodeAt(state.position) === 32) {
9342
- state.lineIndent += 1;
9343
- state.position += 1;
9344
- }
9345
- while (state.position < state.length - 1) {
9346
- readDocument(state);
9347
- }
9348
- return state.documents;
9349
- }
9350
- function loadAll$1(input, iterator, options) {
9351
- if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") {
9352
- options = iterator;
9353
- iterator = null;
9354
- }
9355
- var documents = loadDocuments(input, options);
9356
- if (typeof iterator !== "function") {
9357
- return documents;
9358
- }
9359
- for (var index = 0, length = documents.length; index < length; index += 1) {
9360
- iterator(documents[index]);
9361
- }
9362
- }
9363
- function load$1(input, options) {
9364
- var documents = loadDocuments(input, options);
9365
- if (documents.length === 0) {
9366
- return void 0;
9367
- } else if (documents.length === 1) {
9368
- return documents[0];
9369
- }
9370
- throw new exception("expected a single document in the stream, but found more");
9371
- }
9372
- function compileStyleMap(schema2, map2) {
9373
- var result, keys, index, length, tag, style, type2;
9374
- if (map2 === null)
9375
- return {};
9376
- result = {};
9377
- keys = Object.keys(map2);
9378
- for (index = 0, length = keys.length; index < length; index += 1) {
9379
- tag = keys[index];
9380
- style = String(map2[tag]);
9381
- if (tag.slice(0, 2) === "!!") {
9382
- tag = "tag:yaml.org,2002:" + tag.slice(2);
9383
- }
9384
- type2 = schema2.compiledTypeMap["fallback"][tag];
9385
- if (type2 && _hasOwnProperty.call(type2.styleAliases, style)) {
9386
- style = type2.styleAliases[style];
9387
- }
9388
- result[tag] = style;
9389
- }
9390
- return result;
9391
- }
9392
- function encodeHex(character) {
9393
- var string, handle, length;
9394
- string = character.toString(16).toUpperCase();
9395
- if (character <= 255) {
9396
- handle = "x";
9397
- length = 2;
9398
- } else if (character <= 65535) {
9399
- handle = "u";
9400
- length = 4;
9401
- } else if (character <= 4294967295) {
9402
- handle = "U";
9403
- length = 8;
9404
- } else {
9405
- throw new exception("code point within a string may not be greater than 0xFFFFFFFF");
9406
- }
9407
- return "\\" + handle + common.repeat("0", length - string.length) + string;
9408
- }
9409
- function State(options) {
9410
- this.schema = options["schema"] || _default;
9411
- this.indent = Math.max(1, options["indent"] || 2);
9412
- this.noArrayIndent = options["noArrayIndent"] || false;
9413
- this.skipInvalid = options["skipInvalid"] || false;
9414
- this.flowLevel = common.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
9415
- this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
9416
- this.sortKeys = options["sortKeys"] || false;
9417
- this.lineWidth = options["lineWidth"] || 80;
9418
- this.noRefs = options["noRefs"] || false;
9419
- this.noCompatMode = options["noCompatMode"] || false;
9420
- this.condenseFlow = options["condenseFlow"] || false;
9421
- this.quotingType = options["quotingType"] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
9422
- this.forceQuotes = options["forceQuotes"] || false;
9423
- this.replacer = typeof options["replacer"] === "function" ? options["replacer"] : null;
9424
- this.implicitTypes = this.schema.compiledImplicit;
9425
- this.explicitTypes = this.schema.compiledExplicit;
9426
- this.tag = null;
9427
- this.result = "";
9428
- this.duplicates = [];
9429
- this.usedDuplicates = null;
9430
- }
9431
- function indentString(string, spaces) {
9432
- var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length;
9433
- while (position < length) {
9434
- next = string.indexOf("\n", position);
9435
- if (next === -1) {
9436
- line = string.slice(position);
9437
- position = length;
9438
- } else {
9439
- line = string.slice(position, next + 1);
9440
- position = next + 1;
9441
- }
9442
- if (line.length && line !== "\n")
9443
- result += ind;
9444
- result += line;
9445
- }
9446
- return result;
9447
- }
9448
- function generateNextLine(state, level) {
9449
- return "\n" + common.repeat(" ", state.indent * level);
9450
- }
9451
- function testImplicitResolving(state, str2) {
9452
- var index, length, type2;
9453
- for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
9454
- type2 = state.implicitTypes[index];
9455
- if (type2.resolve(str2)) {
9456
- return true;
9457
- }
9458
- }
9459
- return false;
9460
- }
9461
- function isWhitespace(c) {
9462
- return c === CHAR_SPACE || c === CHAR_TAB;
9463
- }
9464
- function isPrintable(c) {
9465
- return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== CHAR_BOM || 65536 <= c && c <= 1114111;
9466
- }
9467
- function isNsCharOrWhitespace(c) {
9468
- return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
9469
- }
9470
- function isPlainSafe(c, prev, inblock) {
9471
- var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
9472
- var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
9473
- return (
9474
- // ns-plain-safe
9475
- (inblock ? (
9476
- // c = flow-in
9477
- cIsNsCharOrWhitespace
9478
- ) : 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
9479
- );
9480
- }
9481
- function isPlainSafeFirst(c) {
9482
- 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;
9483
- }
9484
- function isPlainSafeLast(c) {
9485
- return !isWhitespace(c) && c !== CHAR_COLON;
9486
- }
9487
- function codePointAt(string, pos) {
9488
- var first = string.charCodeAt(pos), second;
9489
- if (first >= 55296 && first <= 56319 && pos + 1 < string.length) {
9490
- second = string.charCodeAt(pos + 1);
9491
- if (second >= 56320 && second <= 57343) {
9492
- return (first - 55296) * 1024 + second - 56320 + 65536;
9493
- }
9494
- }
9495
- return first;
9496
- }
9497
- function needIndentIndicator(string) {
9498
- var leadingSpaceRe = /^\n* /;
9499
- return leadingSpaceRe.test(string);
9500
- }
9501
- function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
9502
- var i;
9503
- var char = 0;
9504
- var prevChar = null;
9505
- var hasLineBreak = false;
9506
- var hasFoldableLine = false;
9507
- var shouldTrackWidth = lineWidth !== -1;
9508
- var previousLineBreak = -1;
9509
- var plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1));
9510
- if (singleLineOnly || forceQuotes) {
9511
- for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
9512
- char = codePointAt(string, i);
9513
- if (!isPrintable(char)) {
9514
- return STYLE_DOUBLE;
9515
- }
9516
- plain = plain && isPlainSafe(char, prevChar, inblock);
9517
- prevChar = char;
9518
- }
9519
- } else {
9520
- for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
9521
- char = codePointAt(string, i);
9522
- if (char === CHAR_LINE_FEED) {
9523
- hasLineBreak = true;
9524
- if (shouldTrackWidth) {
9525
- hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented.
9526
- i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
9527
- previousLineBreak = i;
9528
- }
9529
- } else if (!isPrintable(char)) {
9530
- return STYLE_DOUBLE;
9531
- }
9532
- plain = plain && isPlainSafe(char, prevChar, inblock);
9533
- prevChar = char;
9534
- }
9535
- hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ");
9536
- }
9537
- if (!hasLineBreak && !hasFoldableLine) {
9538
- if (plain && !forceQuotes && !testAmbiguousType(string)) {
9539
- return STYLE_PLAIN;
9540
- }
9541
- return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
9542
- }
9543
- if (indentPerLevel > 9 && needIndentIndicator(string)) {
9544
- return STYLE_DOUBLE;
9545
- }
9546
- if (!forceQuotes) {
9547
- return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
9548
- }
9549
- return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
9550
- }
9551
- function writeScalar(state, string, level, iskey, inblock) {
9552
- state.dump = function() {
9553
- if (string.length === 0) {
9554
- return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
9555
- }
9556
- if (!state.noCompatMode) {
9557
- if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
9558
- return state.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string + '"' : "'" + string + "'";
9559
- }
9560
- }
9561
- var indent2 = state.indent * Math.max(1, level);
9562
- var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent2);
9563
- var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
9564
- function testAmbiguity(string2) {
9565
- return testImplicitResolving(state, string2);
9566
- }
9567
- switch (chooseScalarStyle(
9568
- string,
9569
- singleLineOnly,
9570
- state.indent,
9571
- lineWidth,
9572
- testAmbiguity,
9573
- state.quotingType,
9574
- state.forceQuotes && !iskey,
9575
- inblock
9576
- )) {
9577
- case STYLE_PLAIN:
9578
- return string;
9579
- case STYLE_SINGLE:
9580
- return "'" + string.replace(/'/g, "''") + "'";
9581
- case STYLE_LITERAL:
9582
- return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent2));
9583
- case STYLE_FOLDED:
9584
- return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent2));
9585
- case STYLE_DOUBLE:
9586
- return '"' + escapeString(string) + '"';
9587
- default:
9588
- throw new exception("impossible error: invalid scalar style");
9589
- }
9590
- }();
9591
- }
9592
- function blockHeader(string, indentPerLevel) {
9593
- var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
9594
- var clip = string[string.length - 1] === "\n";
9595
- var keep = clip && (string[string.length - 2] === "\n" || string === "\n");
9596
- var chomp = keep ? "+" : clip ? "" : "-";
9597
- return indentIndicator + chomp + "\n";
9598
- }
9599
- function dropEndingNewline(string) {
9600
- return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
9601
- }
9602
- function foldString(string, width) {
9603
- var lineRe = /(\n+)([^\n]*)/g;
9604
- var result = function() {
9605
- var nextLF = string.indexOf("\n");
9606
- nextLF = nextLF !== -1 ? nextLF : string.length;
9607
- lineRe.lastIndex = nextLF;
9608
- return foldLine(string.slice(0, nextLF), width);
9609
- }();
9610
- var prevMoreIndented = string[0] === "\n" || string[0] === " ";
9611
- var moreIndented;
9612
- var match2;
9613
- while (match2 = lineRe.exec(string)) {
9614
- var prefix = match2[1], line = match2[2];
9615
- moreIndented = line[0] === " ";
9616
- result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
9617
- prevMoreIndented = moreIndented;
9618
- }
9619
- return result;
9620
- }
9621
- function foldLine(line, width) {
9622
- if (line === "" || line[0] === " ")
9623
- return line;
9624
- var breakRe = / [^ ]/g;
9625
- var match2;
9626
- var start = 0, end, curr = 0, next = 0;
9627
- var result = "";
9628
- while (match2 = breakRe.exec(line)) {
9629
- next = match2.index;
9630
- if (next - start > width) {
9631
- end = curr > start ? curr : next;
9632
- result += "\n" + line.slice(start, end);
9633
- start = end + 1;
9634
- }
9635
- curr = next;
9636
- }
9637
- result += "\n";
9638
- if (line.length - start > width && curr > start) {
9639
- result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
9640
- } else {
9641
- result += line.slice(start);
9642
- }
9643
- return result.slice(1);
9644
- }
9645
- function escapeString(string) {
9646
- var result = "";
9647
- var char = 0;
9648
- var escapeSeq;
9649
- for (var i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
9650
- char = codePointAt(string, i);
9651
- escapeSeq = ESCAPE_SEQUENCES[char];
9652
- if (!escapeSeq && isPrintable(char)) {
9653
- result += string[i];
9654
- if (char >= 65536)
9655
- result += string[i + 1];
9656
- } else {
9657
- result += escapeSeq || encodeHex(char);
9658
- }
9659
- }
9660
- return result;
9661
- }
9662
- function writeFlowSequence(state, level, object) {
9663
- var _result = "", _tag = state.tag, index, length, value;
9664
- for (index = 0, length = object.length; index < length; index += 1) {
9665
- value = object[index];
9666
- if (state.replacer) {
9667
- value = state.replacer.call(object, String(index), value);
9668
- }
9669
- if (writeNode(state, level, value, false, false) || typeof value === "undefined" && writeNode(state, level, null, false, false)) {
9670
- if (_result !== "")
9671
- _result += "," + (!state.condenseFlow ? " " : "");
9672
- _result += state.dump;
9673
- }
9674
- }
9675
- state.tag = _tag;
9676
- state.dump = "[" + _result + "]";
9677
- }
9678
- function writeBlockSequence(state, level, object, compact) {
9679
- var _result = "", _tag = state.tag, index, length, value;
9680
- for (index = 0, length = object.length; index < length; index += 1) {
9681
- value = object[index];
9682
- if (state.replacer) {
9683
- value = state.replacer.call(object, String(index), value);
9684
- }
9685
- if (writeNode(state, level + 1, value, true, true, false, true) || typeof value === "undefined" && writeNode(state, level + 1, null, true, true, false, true)) {
9686
- if (!compact || _result !== "") {
9687
- _result += generateNextLine(state, level);
9688
- }
9689
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
9690
- _result += "-";
9691
- } else {
9692
- _result += "- ";
9693
- }
9694
- _result += state.dump;
9695
- }
9696
- }
9697
- state.tag = _tag;
9698
- state.dump = _result || "[]";
9699
- }
9700
- function writeFlowMapping(state, level, object) {
9701
- var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, pairBuffer;
9702
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
9703
- pairBuffer = "";
9704
- if (_result !== "")
9705
- pairBuffer += ", ";
9706
- if (state.condenseFlow)
9707
- pairBuffer += '"';
9708
- objectKey = objectKeyList[index];
9709
- objectValue = object[objectKey];
9710
- if (state.replacer) {
9711
- objectValue = state.replacer.call(object, objectKey, objectValue);
9712
- }
9713
- if (!writeNode(state, level, objectKey, false, false)) {
9714
- continue;
9715
- }
9716
- if (state.dump.length > 1024)
9717
- pairBuffer += "? ";
9718
- pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
9719
- if (!writeNode(state, level, objectValue, false, false)) {
9720
- continue;
9721
- }
9722
- pairBuffer += state.dump;
9723
- _result += pairBuffer;
9724
- }
9725
- state.tag = _tag;
9726
- state.dump = "{" + _result + "}";
9727
- }
9728
- function writeBlockMapping(state, level, object, compact) {
9729
- var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index, length, objectKey, objectValue, explicitPair, pairBuffer;
9730
- if (state.sortKeys === true) {
9731
- objectKeyList.sort();
9732
- } else if (typeof state.sortKeys === "function") {
9733
- objectKeyList.sort(state.sortKeys);
9734
- } else if (state.sortKeys) {
9735
- throw new exception("sortKeys must be a boolean or a function");
9736
- }
9737
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
9738
- pairBuffer = "";
9739
- if (!compact || _result !== "") {
9740
- pairBuffer += generateNextLine(state, level);
9741
- }
9742
- objectKey = objectKeyList[index];
9743
- objectValue = object[objectKey];
9744
- if (state.replacer) {
9745
- objectValue = state.replacer.call(object, objectKey, objectValue);
9746
- }
9747
- if (!writeNode(state, level + 1, objectKey, true, true, true)) {
9748
- continue;
9749
- }
9750
- explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
9751
- if (explicitPair) {
9752
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
9753
- pairBuffer += "?";
9754
- } else {
9755
- pairBuffer += "? ";
9756
- }
9757
- }
9758
- pairBuffer += state.dump;
9759
- if (explicitPair) {
9760
- pairBuffer += generateNextLine(state, level);
9761
- }
9762
- if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
9763
- continue;
9764
- }
9765
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
9766
- pairBuffer += ":";
9767
- } else {
9768
- pairBuffer += ": ";
9769
- }
9770
- pairBuffer += state.dump;
9771
- _result += pairBuffer;
9772
- }
9773
- state.tag = _tag;
9774
- state.dump = _result || "{}";
9775
- }
9776
- function detectType(state, object, explicit) {
9777
- var _result, typeList, index, length, type2, style;
9778
- typeList = explicit ? state.explicitTypes : state.implicitTypes;
9779
- for (index = 0, length = typeList.length; index < length; index += 1) {
9780
- type2 = typeList[index];
9781
- if ((type2.instanceOf || type2.predicate) && (!type2.instanceOf || typeof object === "object" && object instanceof type2.instanceOf) && (!type2.predicate || type2.predicate(object))) {
9782
- if (explicit) {
9783
- if (type2.multi && type2.representName) {
9784
- state.tag = type2.representName(object);
9785
- } else {
9786
- state.tag = type2.tag;
9787
- }
9788
- } else {
9789
- state.tag = "?";
9790
- }
9791
- if (type2.represent) {
9792
- style = state.styleMap[type2.tag] || type2.defaultStyle;
9793
- if (_toString2.call(type2.represent) === "[object Function]") {
9794
- _result = type2.represent(object, style);
9795
- } else if (_hasOwnProperty.call(type2.represent, style)) {
9796
- _result = type2.represent[style](object, style);
9797
- } else {
9798
- throw new exception("!<" + type2.tag + '> tag resolver accepts not "' + style + '" style');
9799
- }
9800
- state.dump = _result;
9801
- }
9802
- return true;
9803
- }
9804
- }
9805
- return false;
9806
- }
9807
- function writeNode(state, level, object, block, compact, iskey, isblockseq) {
9808
- state.tag = null;
9809
- state.dump = object;
9810
- if (!detectType(state, object, false)) {
9811
- detectType(state, object, true);
9812
- }
9813
- var type2 = _toString2.call(state.dump);
9814
- var inblock = block;
9815
- var tagStr;
9816
- if (block) {
9817
- block = state.flowLevel < 0 || state.flowLevel > level;
9818
- }
9819
- var objectOrArray = type2 === "[object Object]" || type2 === "[object Array]", duplicateIndex, duplicate;
9820
- if (objectOrArray) {
9821
- duplicateIndex = state.duplicates.indexOf(object);
9822
- duplicate = duplicateIndex !== -1;
9823
- }
9824
- if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) {
9825
- compact = false;
9826
- }
9827
- if (duplicate && state.usedDuplicates[duplicateIndex]) {
9828
- state.dump = "*ref_" + duplicateIndex;
9829
- } else {
9830
- if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
9831
- state.usedDuplicates[duplicateIndex] = true;
9832
- }
9833
- if (type2 === "[object Object]") {
9834
- if (block && Object.keys(state.dump).length !== 0) {
9835
- writeBlockMapping(state, level, state.dump, compact);
9836
- if (duplicate) {
9837
- state.dump = "&ref_" + duplicateIndex + state.dump;
9838
- }
9839
- } else {
9840
- writeFlowMapping(state, level, state.dump);
9841
- if (duplicate) {
9842
- state.dump = "&ref_" + duplicateIndex + " " + state.dump;
9843
- }
9844
- }
9845
- } else if (type2 === "[object Array]") {
9846
- if (block && state.dump.length !== 0) {
9847
- if (state.noArrayIndent && !isblockseq && level > 0) {
9848
- writeBlockSequence(state, level - 1, state.dump, compact);
9849
- } else {
9850
- writeBlockSequence(state, level, state.dump, compact);
9851
- }
9852
- if (duplicate) {
9853
- state.dump = "&ref_" + duplicateIndex + state.dump;
9854
- }
9855
- } else {
9856
- writeFlowSequence(state, level, state.dump);
9857
- if (duplicate) {
9858
- state.dump = "&ref_" + duplicateIndex + " " + state.dump;
9859
- }
9860
- }
9861
- } else if (type2 === "[object String]") {
9862
- if (state.tag !== "?") {
9863
- writeScalar(state, state.dump, level, iskey, inblock);
9864
- }
9865
- } else if (type2 === "[object Undefined]") {
9866
- return false;
9867
- } else {
9868
- if (state.skipInvalid)
9869
- return false;
9870
- throw new exception("unacceptable kind of an object to dump " + type2);
9871
- }
9872
- if (state.tag !== null && state.tag !== "?") {
9873
- tagStr = encodeURI(
9874
- state.tag[0] === "!" ? state.tag.slice(1) : state.tag
9875
- ).replace(/!/g, "%21");
9876
- if (state.tag[0] === "!") {
9877
- tagStr = "!" + tagStr;
9878
- } else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") {
9879
- tagStr = "!!" + tagStr.slice(18);
9880
- } else {
9881
- tagStr = "!<" + tagStr + ">";
9882
- }
9883
- state.dump = tagStr + " " + state.dump;
9884
- }
9885
- }
9886
- return true;
9887
- }
9888
- function getDuplicateReferences(object, state) {
9889
- var objects = [], duplicatesIndexes = [], index, length;
9890
- inspectNode(object, objects, duplicatesIndexes);
9891
- for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
9892
- state.duplicates.push(objects[duplicatesIndexes[index]]);
9893
- }
9894
- state.usedDuplicates = new Array(length);
9895
- }
9896
- function inspectNode(object, objects, duplicatesIndexes) {
9897
- var objectKeyList, index, length;
9898
- if (object !== null && typeof object === "object") {
9899
- index = objects.indexOf(object);
9900
- if (index !== -1) {
9901
- if (duplicatesIndexes.indexOf(index) === -1) {
9902
- duplicatesIndexes.push(index);
9903
- }
9904
- } else {
9905
- objects.push(object);
9906
- if (Array.isArray(object)) {
9907
- for (index = 0, length = object.length; index < length; index += 1) {
9908
- inspectNode(object[index], objects, duplicatesIndexes);
9909
- }
9910
- } else {
9911
- objectKeyList = Object.keys(object);
9912
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
9913
- inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
9914
- }
9915
- }
9916
- }
9917
- }
9918
- }
9919
- function dump$1(input, options) {
9920
- options = options || {};
9921
- var state = new State(options);
9922
- if (!state.noRefs)
9923
- getDuplicateReferences(input, state);
9924
- var value = input;
9925
- if (state.replacer) {
9926
- value = state.replacer.call({ "": value }, "", value);
9927
- }
9928
- if (writeNode(state, 0, value, true, true))
9929
- return state.dump + "\n";
9930
- return "";
9931
- }
9932
- function renamed(from, to) {
9933
- return function() {
9934
- throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
9935
- };
9936
- }
9937
- var isNothing_1, isObject_1, toArray_1, repeat_1, isNegativeZero_1, extend_1, common, exception, snippet, TYPE_CONSTRUCTOR_OPTIONS, YAML_NODE_KINDS, type, schema, str, seq, map, failsafe, _null, bool, int, YAML_FLOAT_PATTERN, SCIENTIFIC_WITHOUT_DOT, float, json, core, YAML_DATE_REGEXP, YAML_TIMESTAMP_REGEXP, timestamp, merge, BASE64_MAP, binary, _hasOwnProperty$3, _toString$2, omap, _toString$1, pairs, _hasOwnProperty$2, set, _default, _hasOwnProperty$1, CONTEXT_FLOW_IN, CONTEXT_FLOW_OUT, CONTEXT_BLOCK_IN, CONTEXT_BLOCK_OUT, CHOMPING_CLIP, CHOMPING_STRIP, CHOMPING_KEEP, PATTERN_NON_PRINTABLE, PATTERN_NON_ASCII_LINE_BREAKS, PATTERN_FLOW_INDICATORS, PATTERN_TAG_HANDLE, PATTERN_TAG_URI, simpleEscapeCheck, simpleEscapeMap, i, directiveHandlers, loadAll_1, load_1, loader, _toString2, _hasOwnProperty, CHAR_BOM, CHAR_TAB, CHAR_LINE_FEED, CHAR_CARRIAGE_RETURN, CHAR_SPACE, CHAR_EXCLAMATION, CHAR_DOUBLE_QUOTE, CHAR_SHARP, CHAR_PERCENT, CHAR_AMPERSAND, CHAR_SINGLE_QUOTE, CHAR_ASTERISK, CHAR_COMMA, CHAR_MINUS, CHAR_COLON, CHAR_EQUALS, CHAR_GREATER_THAN, CHAR_QUESTION, CHAR_COMMERCIAL_AT, CHAR_LEFT_SQUARE_BRACKET, CHAR_RIGHT_SQUARE_BRACKET, CHAR_GRAVE_ACCENT, CHAR_LEFT_CURLY_BRACKET, CHAR_VERTICAL_LINE, CHAR_RIGHT_CURLY_BRACKET, ESCAPE_SEQUENCES, DEPRECATED_BOOLEANS_SYNTAX, DEPRECATED_BASE60_SYNTAX, QUOTING_TYPE_SINGLE, QUOTING_TYPE_DOUBLE, STYLE_PLAIN, STYLE_SINGLE, STYLE_LITERAL, STYLE_FOLDED, STYLE_DOUBLE, dump_1, dumper, load, loadAll, dump, safeLoad, safeLoadAll, safeDump;
9938
- var init_js_yaml = __esm({
9939
- "../../node_modules/.pnpm/js-yaml@4.1.0/node_modules/js-yaml/dist/js-yaml.mjs"() {
9940
- "use strict";
9941
- isNothing_1 = isNothing;
9942
- isObject_1 = isObject;
9943
- toArray_1 = toArray;
9944
- repeat_1 = repeat;
9945
- isNegativeZero_1 = isNegativeZero;
9946
- extend_1 = extend;
9947
- common = {
9948
- isNothing: isNothing_1,
9949
- isObject: isObject_1,
9950
- toArray: toArray_1,
9951
- repeat: repeat_1,
9952
- isNegativeZero: isNegativeZero_1,
9953
- extend: extend_1
9954
- };
9955
- YAMLException$1.prototype = Object.create(Error.prototype);
9956
- YAMLException$1.prototype.constructor = YAMLException$1;
9957
- YAMLException$1.prototype.toString = function toString(compact) {
9958
- return this.name + ": " + formatError(this, compact);
9959
- };
9960
- exception = YAMLException$1;
9961
- snippet = makeSnippet;
9962
- TYPE_CONSTRUCTOR_OPTIONS = [
9963
- "kind",
9964
- "multi",
9965
- "resolve",
9966
- "construct",
9967
- "instanceOf",
9968
- "predicate",
9969
- "represent",
9970
- "representName",
9971
- "defaultStyle",
9972
- "styleAliases"
9973
- ];
9974
- YAML_NODE_KINDS = [
9975
- "scalar",
9976
- "sequence",
9977
- "mapping"
9978
- ];
9979
- type = Type$1;
9980
- Schema$1.prototype.extend = function extend2(definition) {
9981
- var implicit = [];
9982
- var explicit = [];
9983
- if (definition instanceof type) {
9984
- explicit.push(definition);
9985
- } else if (Array.isArray(definition)) {
9986
- explicit = explicit.concat(definition);
9987
- } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
9988
- if (definition.implicit)
9989
- implicit = implicit.concat(definition.implicit);
9990
- if (definition.explicit)
9991
- explicit = explicit.concat(definition.explicit);
9992
- } else {
9993
- throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
9994
- }
9995
- implicit.forEach(function(type$1) {
9996
- if (!(type$1 instanceof type)) {
9997
- throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
9998
- }
9999
- if (type$1.loadKind && type$1.loadKind !== "scalar") {
10000
- throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
10001
- }
10002
- if (type$1.multi) {
10003
- throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
10004
- }
10005
- });
10006
- explicit.forEach(function(type$1) {
10007
- if (!(type$1 instanceof type)) {
10008
- throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
10009
- }
10010
- });
10011
- var result = Object.create(Schema$1.prototype);
10012
- result.implicit = (this.implicit || []).concat(implicit);
10013
- result.explicit = (this.explicit || []).concat(explicit);
10014
- result.compiledImplicit = compileList(result, "implicit");
10015
- result.compiledExplicit = compileList(result, "explicit");
10016
- result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
10017
- return result;
10018
- };
10019
- schema = Schema$1;
10020
- str = new type("tag:yaml.org,2002:str", {
10021
- kind: "scalar",
10022
- construct: function(data) {
10023
- return data !== null ? data : "";
10024
- }
10025
- });
10026
- seq = new type("tag:yaml.org,2002:seq", {
10027
- kind: "sequence",
10028
- construct: function(data) {
10029
- return data !== null ? data : [];
10030
- }
10031
- });
10032
- map = new type("tag:yaml.org,2002:map", {
10033
- kind: "mapping",
10034
- construct: function(data) {
10035
- return data !== null ? data : {};
10036
- }
10037
- });
10038
- failsafe = new schema({
10039
- explicit: [
10040
- str,
10041
- seq,
10042
- map
10043
- ]
10044
- });
10045
- _null = new type("tag:yaml.org,2002:null", {
10046
- kind: "scalar",
10047
- resolve: resolveYamlNull,
10048
- construct: constructYamlNull,
10049
- predicate: isNull,
10050
- represent: {
10051
- canonical: function() {
10052
- return "~";
10053
- },
10054
- lowercase: function() {
10055
- return "null";
10056
- },
10057
- uppercase: function() {
10058
- return "NULL";
10059
- },
10060
- camelcase: function() {
10061
- return "Null";
10062
- },
10063
- empty: function() {
10064
- return "";
10065
- }
10066
- },
10067
- defaultStyle: "lowercase"
10068
- });
10069
- bool = new type("tag:yaml.org,2002:bool", {
10070
- kind: "scalar",
10071
- resolve: resolveYamlBoolean,
10072
- construct: constructYamlBoolean,
10073
- predicate: isBoolean,
10074
- represent: {
10075
- lowercase: function(object) {
10076
- return object ? "true" : "false";
10077
- },
10078
- uppercase: function(object) {
10079
- return object ? "TRUE" : "FALSE";
10080
- },
10081
- camelcase: function(object) {
10082
- return object ? "True" : "False";
10083
- }
10084
- },
10085
- defaultStyle: "lowercase"
10086
- });
10087
- int = new type("tag:yaml.org,2002:int", {
10088
- kind: "scalar",
10089
- resolve: resolveYamlInteger,
10090
- construct: constructYamlInteger,
10091
- predicate: isInteger,
10092
- represent: {
10093
- binary: function(obj) {
10094
- return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
10095
- },
10096
- octal: function(obj) {
10097
- return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
10098
- },
10099
- decimal: function(obj) {
10100
- return obj.toString(10);
10101
- },
10102
- /* eslint-disable max-len */
10103
- hexadecimal: function(obj) {
10104
- return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
10105
- }
10106
- },
10107
- defaultStyle: "decimal",
10108
- styleAliases: {
10109
- binary: [2, "bin"],
10110
- octal: [8, "oct"],
10111
- decimal: [10, "dec"],
10112
- hexadecimal: [16, "hex"]
10113
- }
10114
- });
10115
- YAML_FLOAT_PATTERN = new RegExp(
10116
- // 2.5e4, 2.5 and integers
10117
- "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
10118
- );
10119
- SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
10120
- float = new type("tag:yaml.org,2002:float", {
10121
- kind: "scalar",
10122
- resolve: resolveYamlFloat,
10123
- construct: constructYamlFloat,
10124
- predicate: isFloat,
10125
- represent: representYamlFloat,
10126
- defaultStyle: "lowercase"
10127
- });
10128
- json = failsafe.extend({
10129
- implicit: [
10130
- _null,
10131
- bool,
10132
- int,
10133
- float
10134
- ]
10135
- });
10136
- core = json;
10137
- YAML_DATE_REGEXP = new RegExp(
10138
- "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
10139
- );
10140
- YAML_TIMESTAMP_REGEXP = new RegExp(
10141
- "^([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]))?))?$"
10142
- );
10143
- timestamp = new type("tag:yaml.org,2002:timestamp", {
10144
- kind: "scalar",
10145
- resolve: resolveYamlTimestamp,
10146
- construct: constructYamlTimestamp,
10147
- instanceOf: Date,
10148
- represent: representYamlTimestamp
10149
- });
10150
- merge = new type("tag:yaml.org,2002:merge", {
10151
- kind: "scalar",
10152
- resolve: resolveYamlMerge
10153
- });
10154
- BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
10155
- binary = new type("tag:yaml.org,2002:binary", {
10156
- kind: "scalar",
10157
- resolve: resolveYamlBinary,
10158
- construct: constructYamlBinary,
10159
- predicate: isBinary,
10160
- represent: representYamlBinary
10161
- });
10162
- _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
10163
- _toString$2 = Object.prototype.toString;
10164
- omap = new type("tag:yaml.org,2002:omap", {
10165
- kind: "sequence",
10166
- resolve: resolveYamlOmap,
10167
- construct: constructYamlOmap
10168
- });
10169
- _toString$1 = Object.prototype.toString;
10170
- pairs = new type("tag:yaml.org,2002:pairs", {
10171
- kind: "sequence",
10172
- resolve: resolveYamlPairs,
10173
- construct: constructYamlPairs
10174
- });
10175
- _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
10176
- set = new type("tag:yaml.org,2002:set", {
10177
- kind: "mapping",
10178
- resolve: resolveYamlSet,
10179
- construct: constructYamlSet
10180
- });
10181
- _default = core.extend({
10182
- implicit: [
10183
- timestamp,
10184
- merge
10185
- ],
10186
- explicit: [
10187
- binary,
10188
- omap,
10189
- pairs,
10190
- set
10191
- ]
10192
- });
10193
- _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
10194
- CONTEXT_FLOW_IN = 1;
10195
- CONTEXT_FLOW_OUT = 2;
10196
- CONTEXT_BLOCK_IN = 3;
10197
- CONTEXT_BLOCK_OUT = 4;
10198
- CHOMPING_CLIP = 1;
10199
- CHOMPING_STRIP = 2;
10200
- CHOMPING_KEEP = 3;
10201
- PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
10202
- PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
10203
- PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
10204
- PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
10205
- PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
10206
- simpleEscapeCheck = new Array(256);
10207
- simpleEscapeMap = new Array(256);
10208
- for (i = 0; i < 256; i++) {
10209
- simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
10210
- simpleEscapeMap[i] = simpleEscapeSequence(i);
10211
- }
10212
- directiveHandlers = {
10213
- YAML: function handleYamlDirective(state, name, args) {
10214
- var match2, major, minor;
10215
- if (state.version !== null) {
10216
- throwError(state, "duplication of %YAML directive");
10217
- }
10218
- if (args.length !== 1) {
10219
- throwError(state, "YAML directive accepts exactly one argument");
10220
- }
10221
- match2 = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
10222
- if (match2 === null) {
10223
- throwError(state, "ill-formed argument of the YAML directive");
10224
- }
10225
- major = parseInt(match2[1], 10);
10226
- minor = parseInt(match2[2], 10);
10227
- if (major !== 1) {
10228
- throwError(state, "unacceptable YAML version of the document");
10229
- }
10230
- state.version = args[0];
10231
- state.checkLineBreaks = minor < 2;
10232
- if (minor !== 1 && minor !== 2) {
10233
- throwWarning(state, "unsupported YAML version of the document");
10234
- }
10235
- },
10236
- TAG: function handleTagDirective(state, name, args) {
10237
- var handle, prefix;
10238
- if (args.length !== 2) {
10239
- throwError(state, "TAG directive accepts exactly two arguments");
10240
- }
10241
- handle = args[0];
10242
- prefix = args[1];
10243
- if (!PATTERN_TAG_HANDLE.test(handle)) {
10244
- throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
10245
- }
10246
- if (_hasOwnProperty$1.call(state.tagMap, handle)) {
10247
- throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
10248
- }
10249
- if (!PATTERN_TAG_URI.test(prefix)) {
10250
- throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
10251
- }
10252
- try {
10253
- prefix = decodeURIComponent(prefix);
10254
- } catch (err) {
10255
- throwError(state, "tag prefix is malformed: " + prefix);
10256
- }
10257
- state.tagMap[handle] = prefix;
10258
- }
10259
- };
10260
- loadAll_1 = loadAll$1;
10261
- load_1 = load$1;
10262
- loader = {
10263
- loadAll: loadAll_1,
10264
- load: load_1
10265
- };
10266
- _toString2 = Object.prototype.toString;
10267
- _hasOwnProperty = Object.prototype.hasOwnProperty;
10268
- CHAR_BOM = 65279;
10269
- CHAR_TAB = 9;
10270
- CHAR_LINE_FEED = 10;
10271
- CHAR_CARRIAGE_RETURN = 13;
10272
- CHAR_SPACE = 32;
10273
- CHAR_EXCLAMATION = 33;
10274
- CHAR_DOUBLE_QUOTE = 34;
10275
- CHAR_SHARP = 35;
10276
- CHAR_PERCENT = 37;
10277
- CHAR_AMPERSAND = 38;
10278
- CHAR_SINGLE_QUOTE = 39;
10279
- CHAR_ASTERISK = 42;
10280
- CHAR_COMMA = 44;
10281
- CHAR_MINUS = 45;
10282
- CHAR_COLON = 58;
10283
- CHAR_EQUALS = 61;
10284
- CHAR_GREATER_THAN = 62;
10285
- CHAR_QUESTION = 63;
10286
- CHAR_COMMERCIAL_AT = 64;
10287
- CHAR_LEFT_SQUARE_BRACKET = 91;
10288
- CHAR_RIGHT_SQUARE_BRACKET = 93;
10289
- CHAR_GRAVE_ACCENT = 96;
10290
- CHAR_LEFT_CURLY_BRACKET = 123;
10291
- CHAR_VERTICAL_LINE = 124;
10292
- CHAR_RIGHT_CURLY_BRACKET = 125;
10293
- ESCAPE_SEQUENCES = {};
10294
- ESCAPE_SEQUENCES[0] = "\\0";
10295
- ESCAPE_SEQUENCES[7] = "\\a";
10296
- ESCAPE_SEQUENCES[8] = "\\b";
10297
- ESCAPE_SEQUENCES[9] = "\\t";
10298
- ESCAPE_SEQUENCES[10] = "\\n";
10299
- ESCAPE_SEQUENCES[11] = "\\v";
10300
- ESCAPE_SEQUENCES[12] = "\\f";
10301
- ESCAPE_SEQUENCES[13] = "\\r";
10302
- ESCAPE_SEQUENCES[27] = "\\e";
10303
- ESCAPE_SEQUENCES[34] = '\\"';
10304
- ESCAPE_SEQUENCES[92] = "\\\\";
10305
- ESCAPE_SEQUENCES[133] = "\\N";
10306
- ESCAPE_SEQUENCES[160] = "\\_";
10307
- ESCAPE_SEQUENCES[8232] = "\\L";
10308
- ESCAPE_SEQUENCES[8233] = "\\P";
10309
- DEPRECATED_BOOLEANS_SYNTAX = [
10310
- "y",
10311
- "Y",
10312
- "yes",
10313
- "Yes",
10314
- "YES",
10315
- "on",
10316
- "On",
10317
- "ON",
10318
- "n",
10319
- "N",
10320
- "no",
10321
- "No",
10322
- "NO",
10323
- "off",
10324
- "Off",
10325
- "OFF"
10326
- ];
10327
- DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
10328
- QUOTING_TYPE_SINGLE = 1;
10329
- QUOTING_TYPE_DOUBLE = 2;
10330
- STYLE_PLAIN = 1;
10331
- STYLE_SINGLE = 2;
10332
- STYLE_LITERAL = 3;
10333
- STYLE_FOLDED = 4;
10334
- STYLE_DOUBLE = 5;
10335
- dump_1 = dump$1;
10336
- dumper = {
10337
- dump: dump_1
10338
- };
10339
- load = loader.load;
10340
- loadAll = loader.loadAll;
10341
- dump = dumper.dump;
10342
- safeLoad = renamed("safeLoad", "load");
10343
- safeLoadAll = renamed("safeLoadAll", "loadAll");
10344
- safeDump = renamed("safeDump", "dump");
10345
- }
10346
- });
10347
-
10348
7474
  // ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/index.cjs
10349
7475
  var require_build = __commonJS({
10350
7476
  "../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/index.cjs"(exports, module) {
@@ -10367,7 +7493,7 @@ var require_build = __commonJS({
10367
7493
  if (typeof arguments[0] !== "string") {
10368
7494
  return this._taggedLiteral(arguments[0], ...arguments);
10369
7495
  }
10370
- const str2 = args.shift();
7496
+ const str = args.shift();
10371
7497
  let cb = function() {
10372
7498
  };
10373
7499
  if (typeof args[args.length - 1] === "function")
@@ -10376,8 +7502,8 @@ var require_build = __commonJS({
10376
7502
  };
10377
7503
  if (!this.cache[this.locale])
10378
7504
  this._readLocaleFile();
10379
- if (!this.cache[this.locale][str2] && this.updateFiles) {
10380
- this.cache[this.locale][str2] = str2;
7505
+ if (!this.cache[this.locale][str] && this.updateFiles) {
7506
+ this.cache[this.locale][str] = str;
10381
7507
  this._enqueueWrite({
10382
7508
  directory: this.directory,
10383
7509
  locale: this.locale,
@@ -10386,7 +7512,7 @@ var require_build = __commonJS({
10386
7512
  } else {
10387
7513
  cb();
10388
7514
  }
10389
- return shim.format.apply(shim.format, [this.cache[this.locale][str2] || str2].concat(args));
7515
+ return shim.format.apply(shim.format, [this.cache[this.locale][str] || str].concat(args));
10390
7516
  }
10391
7517
  __n() {
10392
7518
  const args = Array.prototype.slice.call(arguments);
@@ -10399,10 +7525,10 @@ var require_build = __commonJS({
10399
7525
  cb = args.pop();
10400
7526
  if (!this.cache[this.locale])
10401
7527
  this._readLocaleFile();
10402
- let str2 = quantity === 1 ? singular : plural;
7528
+ let str = quantity === 1 ? singular : plural;
10403
7529
  if (this.cache[this.locale][singular]) {
10404
7530
  const entry = this.cache[this.locale][singular];
10405
- str2 = entry[quantity === 1 ? "one" : "other"];
7531
+ str = entry[quantity === 1 ? "one" : "other"];
10406
7532
  }
10407
7533
  if (!this.cache[this.locale][singular] && this.updateFiles) {
10408
7534
  this.cache[this.locale][singular] = {
@@ -10417,8 +7543,8 @@ var require_build = __commonJS({
10417
7543
  } else {
10418
7544
  cb();
10419
7545
  }
10420
- const values = [str2];
10421
- if (~str2.indexOf("%d"))
7546
+ const values = [str];
7547
+ if (~str.indexOf("%d"))
10422
7548
  values.push(quantity);
10423
7549
  return shim.format.apply(shim.format, values.concat(args));
10424
7550
  }
@@ -10438,15 +7564,15 @@ var require_build = __commonJS({
10438
7564
  }
10439
7565
  }
10440
7566
  _taggedLiteral(parts, ...args) {
10441
- let str2 = "";
7567
+ let str = "";
10442
7568
  parts.forEach(function(part, i) {
10443
7569
  const arg = args[i + 1];
10444
- str2 += part;
7570
+ str += part;
10445
7571
  if (typeof arg !== "undefined") {
10446
- str2 += "%s";
7572
+ str += "%s";
10447
7573
  }
10448
7574
  });
10449
- return this.__.apply(this, [str2].concat([].slice.call(args, 1)));
7575
+ return this.__.apply(this, [str].concat([].slice.call(args, 1)));
10450
7576
  }
10451
7577
  _enqueueWrite(work) {
10452
7578
  this.writeQueue.push(work);
@@ -10540,19 +7666,19 @@ var require_build2 = __commonJS({
10540
7666
  var util = __require("util");
10541
7667
  var path2 = __require("path");
10542
7668
  var fs = __require("fs");
10543
- function camelCase(str2) {
10544
- const isCamelCase = str2 !== str2.toLowerCase() && str2 !== str2.toUpperCase();
7669
+ function camelCase(str) {
7670
+ const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase();
10545
7671
  if (!isCamelCase) {
10546
- str2 = str2.toLowerCase();
7672
+ str = str.toLowerCase();
10547
7673
  }
10548
- if (str2.indexOf("-") === -1 && str2.indexOf("_") === -1) {
10549
- return str2;
7674
+ if (str.indexOf("-") === -1 && str.indexOf("_") === -1) {
7675
+ return str;
10550
7676
  } else {
10551
7677
  let camelcase = "";
10552
7678
  let nextChrUpper = false;
10553
- const leadingHyphens = str2.match(/^-+/);
10554
- for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str2.length; i++) {
10555
- let chr = str2.charAt(i);
7679
+ const leadingHyphens = str.match(/^-+/);
7680
+ for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) {
7681
+ let chr = str.charAt(i);
10556
7682
  if (nextChrUpper) {
10557
7683
  nextChrUpper = false;
10558
7684
  chr = chr.toUpperCase();
@@ -10566,13 +7692,13 @@ var require_build2 = __commonJS({
10566
7692
  return camelcase;
10567
7693
  }
10568
7694
  }
10569
- function decamelize(str2, joinString) {
10570
- const lowercase = str2.toLowerCase();
7695
+ function decamelize(str, joinString) {
7696
+ const lowercase = str.toLowerCase();
10571
7697
  joinString = joinString || "-";
10572
7698
  let notCamelcase = "";
10573
- for (let i = 0; i < str2.length; i++) {
7699
+ for (let i = 0; i < str.length; i++) {
10574
7700
  const chrLower = lowercase.charAt(i);
10575
- const chrString = str2.charAt(i);
7701
+ const chrString = str.charAt(i);
10576
7702
  if (chrLower !== chrString && i > 0) {
10577
7703
  notCamelcase += `${joinString}${lowercase.charAt(i)}`;
10578
7704
  } else {
@@ -11373,26 +8499,26 @@ var require_build2 = __commonJS({
11373
8499
  return defaultForType(guessType(key));
11374
8500
  }
11375
8501
  }
11376
- function defaultForType(type2) {
8502
+ function defaultForType(type) {
11377
8503
  const def = {
11378
8504
  [DefaultValuesForTypeKey.BOOLEAN]: true,
11379
8505
  [DefaultValuesForTypeKey.STRING]: "",
11380
8506
  [DefaultValuesForTypeKey.NUMBER]: void 0,
11381
8507
  [DefaultValuesForTypeKey.ARRAY]: []
11382
8508
  };
11383
- return def[type2];
8509
+ return def[type];
11384
8510
  }
11385
8511
  function guessType(key) {
11386
- let type2 = DefaultValuesForTypeKey.BOOLEAN;
8512
+ let type = DefaultValuesForTypeKey.BOOLEAN;
11387
8513
  if (checkAllAliases(key, flags.strings))
11388
- type2 = DefaultValuesForTypeKey.STRING;
8514
+ type = DefaultValuesForTypeKey.STRING;
11389
8515
  else if (checkAllAliases(key, flags.numbers))
11390
- type2 = DefaultValuesForTypeKey.NUMBER;
8516
+ type = DefaultValuesForTypeKey.NUMBER;
11391
8517
  else if (checkAllAliases(key, flags.bools))
11392
- type2 = DefaultValuesForTypeKey.BOOLEAN;
8518
+ type = DefaultValuesForTypeKey.BOOLEAN;
11393
8519
  else if (checkAllAliases(key, flags.arrays))
11394
- type2 = DefaultValuesForTypeKey.ARRAY;
11395
- return type2;
8520
+ type = DefaultValuesForTypeKey.ARRAY;
8521
+ return type;
11396
8522
  }
11397
8523
  function isUndefined(num) {
11398
8524
  return num === void 0;
@@ -12919,8 +10045,8 @@ var require_build3 = __commonJS({
12919
10045
  shouldApplyLayoutDSL(...args) {
12920
10046
  return args.length === 1 && typeof args[0] === "string" && /[\t\n]/.test(args[0]);
12921
10047
  }
12922
- applyLayoutDSL(str2) {
12923
- const rows = str2.split("\n").map((row) => row.split(" "));
10048
+ applyLayoutDSL(str) {
10049
+ const rows = str.split("\n").map((row) => row.split(" "));
12924
10050
  let leftColumnWidth = 0;
12925
10051
  rows.forEach((columns) => {
12926
10052
  if (columns.length > 1 && mixin.stringWidth(columns[0]) > leftColumnWidth) {
@@ -12944,8 +10070,8 @@ var require_build3 = __commonJS({
12944
10070
  padding: this.measurePadding(text)
12945
10071
  };
12946
10072
  }
12947
- measurePadding(str2) {
12948
- const noAnsi = mixin.stripAnsi(str2);
10073
+ measurePadding(str) {
10074
+ const noAnsi = mixin.stripAnsi(str);
12949
10075
  return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length];
12950
10076
  }
12951
10077
  toString() {
@@ -12957,7 +10083,7 @@ var require_build3 = __commonJS({
12957
10083
  }
12958
10084
  rowToString(row, lines) {
12959
10085
  this.rasterize(row).forEach((rrow, r) => {
12960
- let str2 = "";
10086
+ let str = "";
12961
10087
  rrow.forEach((col, c) => {
12962
10088
  const { width } = row[c];
12963
10089
  const wrapWidth = this.negatePadding(row[c]);
@@ -12974,20 +10100,20 @@ var require_build3 = __commonJS({
12974
10100
  }
12975
10101
  const padding = row[c].padding || [0, 0, 0, 0];
12976
10102
  if (padding[left]) {
12977
- str2 += " ".repeat(padding[left]);
10103
+ str += " ".repeat(padding[left]);
12978
10104
  }
12979
- str2 += addBorder(row[c], ts, "| ");
12980
- str2 += ts;
12981
- str2 += addBorder(row[c], ts, " |");
10105
+ str += addBorder(row[c], ts, "| ");
10106
+ str += ts;
10107
+ str += addBorder(row[c], ts, " |");
12982
10108
  if (padding[right]) {
12983
- str2 += " ".repeat(padding[right]);
10109
+ str += " ".repeat(padding[right]);
12984
10110
  }
12985
10111
  if (r === 0 && lines.length > 0) {
12986
- str2 = this.renderInline(str2, lines[lines.length - 1]);
10112
+ str = this.renderInline(str, lines[lines.length - 1]);
12987
10113
  }
12988
10114
  });
12989
10115
  lines.push({
12990
- text: str2.replace(/ +$/, ""),
10116
+ text: str.replace(/ +$/, ""),
12991
10117
  span: row.span
12992
10118
  });
12993
10119
  });
@@ -13032,7 +10158,7 @@ var require_build3 = __commonJS({
13032
10158
  wrapped.unshift(...new Array(col.padding[top] || 0).fill(""));
13033
10159
  wrapped.push(...new Array(col.padding[bottom] || 0).fill(""));
13034
10160
  }
13035
- wrapped.forEach((str2, r) => {
10161
+ wrapped.forEach((str, r) => {
13036
10162
  if (!rrows[r]) {
13037
10163
  rrows.push([]);
13038
10164
  }
@@ -13042,7 +10168,7 @@ var require_build3 = __commonJS({
13042
10168
  rrow.push("");
13043
10169
  }
13044
10170
  }
13045
- rrow.push(str2);
10171
+ rrow.push(str);
13046
10172
  });
13047
10173
  });
13048
10174
  return rrows;
@@ -13108,21 +10234,21 @@ var require_build3 = __commonJS({
13108
10234
  }
13109
10235
  return 80;
13110
10236
  }
13111
- function alignRight(str2, width) {
13112
- str2 = str2.trim();
13113
- const strWidth = mixin.stringWidth(str2);
10237
+ function alignRight(str, width) {
10238
+ str = str.trim();
10239
+ const strWidth = mixin.stringWidth(str);
13114
10240
  if (strWidth < width) {
13115
- return " ".repeat(width - strWidth) + str2;
10241
+ return " ".repeat(width - strWidth) + str;
13116
10242
  }
13117
- return str2;
10243
+ return str;
13118
10244
  }
13119
- function alignCenter(str2, width) {
13120
- str2 = str2.trim();
13121
- const strWidth = mixin.stringWidth(str2);
10245
+ function alignCenter(str, width) {
10246
+ str = str.trim();
10247
+ const strWidth = mixin.stringWidth(str);
13122
10248
  if (strWidth >= width) {
13123
- return str2;
10249
+ return str;
13124
10250
  }
13125
- return " ".repeat(width - strWidth >> 1) + str2;
10251
+ return " ".repeat(width - strWidth >> 1) + str;
13126
10252
  }
13127
10253
  var mixin;
13128
10254
  function cliui(opts, _mixin) {
@@ -15011,7 +12137,7 @@ var require_package2 = __commonJS({
15011
12137
  module.exports = {
15012
12138
  name: "@midscene/cli",
15013
12139
  description: "An AI-powered automation SDK can control the page, perform assertions, and extract data in JSON format using natural language. See https://midscenejs.com/ for details.",
15014
- version: "0.8.17",
12140
+ version: "0.8.18-beta-20250107062545.0",
15015
12141
  repository: "https://github.com/web-infra-dev/midscene",
15016
12142
  homepage: "https://midscenejs.com/",
15017
12143
  "jsnext:source": "./src/index.ts",
@@ -15086,7 +12212,6 @@ var require_helpers = __commonJS({
15086
12212
  });
15087
12213
 
15088
12214
  // src/cli-utils.ts
15089
- import assert from "assert";
15090
12215
  import { statSync } from "fs";
15091
12216
  import { existsSync } from "fs";
15092
12217
  import { join } from "path";
@@ -15096,20 +12221,18 @@ function matchYamlFiles(fileGlob) {
15096
12221
  fileGlob = join(fileGlob, "**/*.{yml,yaml}");
15097
12222
  }
15098
12223
  const files = yield glob(fileGlob, {
15099
- nodir: true
12224
+ nodir: true,
12225
+ windowsPathsNoEscape: true
15100
12226
  });
15101
12227
  return files.filter((file) => file.endsWith(".yml") || file.endsWith(".yaml")).sort();
15102
12228
  });
15103
12229
  }
15104
- var import_minimist, parseProcessArgs;
12230
+ var parseProcessArgs;
15105
12231
  var init_cli_utils = __esm({
15106
12232
  "src/cli-utils.ts"() {
15107
12233
  "use strict";
15108
12234
  init_esm5();
15109
- import_minimist = __toESM(require_minimist());
15110
- init_args();
15111
12235
  init_config();
15112
- init_js_yaml();
15113
12236
  init_yargs();
15114
12237
  parseProcessArgs = () => __async(void 0, null, function* () {
15115
12238
  const versionFromPkgJson = require_package2().version;
@@ -15621,12 +12744,16 @@ var init_printer = __esm({
15621
12744
  return spinnerFrames[Math.floor(Date.now() / spinnerInterval) % spinnerFrames.length];
15622
12745
  };
15623
12746
  contextInfo = (context) => {
12747
+ var _a4, _b2;
15624
12748
  const filePath = context.file;
15625
12749
  const fileName = basename(filePath);
15626
12750
  const fileDir = dirname(filePath);
15627
12751
  const fileNameToPrint = `${import_chalk.default.gray(`${fileDir}/`)}${fileName}`;
15628
12752
  const fileStatusText = indicatorForStatus(context.player.status);
15629
12753
  const contextActionText = typeof context.player.currentTaskIndex === "undefined" && context.player.status === "running" ? import_chalk.default.gray("(navigating)") : "";
12754
+ const errorText = context.player.errorInSetup ? `
12755
+ ${indent}${import_chalk.default.red("error:")} ${(_a4 = context.player.errorInSetup) == null ? void 0 : _a4.message}
12756
+ ${indent}${indent}${(_b2 = context.player.errorInSetup) == null ? void 0 : _b2.stack}` : "";
15630
12757
  const outputFile = context.player.output;
15631
12758
  const outputText = outputFile && Object.keys(context.player.result || {}).length > 0 ? `
15632
12759
  ${indent}${import_chalk.default.gray(`output: ${outputFile}`)}` : "";
@@ -15634,7 +12761,7 @@ ${indent}${import_chalk.default.gray(`output: ${outputFile}`)}` : "";
15634
12761
  const reportFileToShow = relative(process.cwd(), reportFile || "");
15635
12762
  const reportText = reportFile ? `
15636
12763
  ${indent}${import_chalk.default.gray(`report: ./${reportFileToShow}`)}` : "";
15637
- const mergedText = `${fileStatusText} ${fileNameToPrint} ${contextActionText}${outputText}${reportText}`.trim();
12764
+ const mergedText = `${fileStatusText} ${fileNameToPrint} ${contextActionText}${outputText}${reportText}${errorText}`.trim();
15638
12765
  return {
15639
12766
  fileNameToPrint,
15640
12767
  fileStatusText,
@@ -15681,16 +12808,18 @@ ${indent}${indent}${(_a4 = task.error) == null ? void 0 : _a4.message}` : "";
15681
12808
  const currentLine = [];
15682
12809
  const suffixText = [];
15683
12810
  const { mergedText: fileInfo } = contextInfo(context);
15684
- for (const task of taskStatusArray) {
15685
- const { mergedLine } = singleTaskInfo(task);
15686
- if (context.player.status === "init") {
15687
- suffixText.push(mergedLine);
15688
- } else if (context.player.status === "running") {
15689
- currentLine.push(mergedLine);
15690
- } else if (context.player.status === "done") {
15691
- prefixLines.push(mergedLine);
15692
- } else if (context.player.status === "error") {
15693
- prefixLines.push(mergedLine);
12811
+ if (!context.player.errorInSetup) {
12812
+ for (const task of taskStatusArray) {
12813
+ const { mergedLine } = singleTaskInfo(task);
12814
+ if (context.player.status === "init") {
12815
+ suffixText.push(mergedLine);
12816
+ } else if (context.player.status === "running") {
12817
+ currentLine.push(mergedLine);
12818
+ } else if (context.player.status === "done") {
12819
+ prefixLines.push(mergedLine);
12820
+ } else if (context.player.status === "error") {
12821
+ prefixLines.push(mergedLine);
12822
+ }
15694
12823
  }
15695
12824
  }
15696
12825
  const currentLineText = currentLine.length > 0 ? `
@@ -15825,7 +12954,7 @@ var init_signals = __esm({
15825
12954
  });
15826
12955
 
15827
12956
  // ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
15828
- var processOk, kExitEmitter, global, ObjectDefineProperty, Emitter, SignalExitBase, signalExitWrap, SignalExitFallback, _hupSig, _emitter, _process, _originalProcessEmit, _originalProcessReallyExit, _sigListeners, _loaded, _processReallyExit, processReallyExit_fn, _processEmit, processEmit_fn, SignalExit, process2, onExit, load2, unload;
12957
+ var processOk, kExitEmitter, global, ObjectDefineProperty, Emitter, SignalExitBase, signalExitWrap, SignalExitFallback, _hupSig, _emitter, _process, _originalProcessEmit, _originalProcessReallyExit, _sigListeners, _loaded, _processReallyExit, processReallyExit_fn, _processEmit, processEmit_fn, SignalExit, process2, onExit, load, unload;
15829
12958
  var init_mjs = __esm({
15830
12959
  "../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js"() {
15831
12960
  "use strict";
@@ -16059,7 +13188,7 @@ var init_mjs = __esm({
16059
13188
  *
16060
13189
  * @internal
16061
13190
  */
16062
- load2
13191
+ load
16063
13192
  ),
16064
13193
  unload: (
16065
13194
  /**
@@ -16188,10 +13317,10 @@ var init_tty_renderer = __esm({
16188
13317
  this.render(current == null ? void 0 : current.message, current == null ? void 0 : current.type);
16189
13318
  }
16190
13319
  }
16191
- render(message, type2 = "output") {
13320
+ render(message, type = "output") {
16192
13321
  if (this.finished) {
16193
13322
  this.clearWindow();
16194
- return this.write(message || "", type2);
13323
+ return this.write(message || "", type);
16195
13324
  }
16196
13325
  const windowContent = this.options.getWindow();
16197
13326
  const rowCount = getRenderedRowCount(
@@ -16205,7 +13334,7 @@ var init_tty_renderer = __esm({
16205
13334
  this.write(SYNC_START);
16206
13335
  this.clearWindow();
16207
13336
  if (message) {
16208
- this.write(message, type2);
13337
+ this.write(message, type);
16209
13338
  }
16210
13339
  if (padding > 0) {
16211
13340
  this.write("\n".repeat(padding));
@@ -16224,14 +13353,14 @@ var init_tty_renderer = __esm({
16224
13353
  }
16225
13354
  this.windowHeight = 0;
16226
13355
  }
16227
- interceptStream(stream2, type2) {
13356
+ interceptStream(stream2, type) {
16228
13357
  const original = stream2.write;
16229
13358
  stream2.write = (chunk, _, callback) => {
16230
13359
  if (chunk) {
16231
13360
  if (this.finished) {
16232
- this.write(chunk.toString(), type2);
13361
+ this.write(chunk.toString(), type);
16233
13362
  } else {
16234
- this.buffer.push({ type: type2, message: chunk.toString() });
13363
+ this.buffer.push({ type, message: chunk.toString() });
16235
13364
  }
16236
13365
  }
16237
13366
  callback == null ? void 0 : callback();
@@ -16240,8 +13369,8 @@ var init_tty_renderer = __esm({
16240
13369
  stream2.write = original;
16241
13370
  };
16242
13371
  }
16243
- write(message, type2 = "output") {
16244
- this.streams[type2](message);
13372
+ write(message, type = "output") {
13373
+ this.streams[type](message);
16245
13374
  }
16246
13375
  };
16247
13376
  }
@@ -16252,7 +13381,7 @@ import { readFileSync } from "fs";
16252
13381
  import { basename as basename2, extname } from "path";
16253
13382
  import { ScriptPlayer, parseYamlScript } from "@midscene/web/yaml";
16254
13383
  import { createServer } from "http-server";
16255
- import { assert as assert2 } from "console";
13384
+ import { assert } from "console";
16256
13385
  import { puppeteerAgentForTarget } from "@midscene/web/puppeteer";
16257
13386
  function playYamlFiles(files, options) {
16258
13387
  return __async(this, null, function* () {
@@ -16271,7 +13400,7 @@ function playYamlFiles(files, options) {
16271
13400
  const freeFn = [];
16272
13401
  let localServer;
16273
13402
  let urlToVisit;
16274
- assert2(typeof target.url === "string", "url is required");
13403
+ assert(typeof target.url === "string", "url is required");
16275
13404
  if (target.serve) {
16276
13405
  localServer = yield launchServer(target.serve);
16277
13406
  const serverAddress = localServer.server.address();
@@ -16390,13 +13519,11 @@ var require_src = __commonJS({
16390
13519
  process.exit(1);
16391
13520
  }
16392
13521
  process.exit(0);
16393
- }))()
13522
+ }))().catch((e) => {
13523
+ console.error(e);
13524
+ process.exit(1);
13525
+ })
16394
13526
  );
16395
13527
  }
16396
13528
  });
16397
13529
  export default require_src();
16398
- /*! Bundled license information:
16399
-
16400
- js-yaml/dist/js-yaml.mjs:
16401
- (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
16402
- */