diff --git a/web/ui/react-app/src/components/header/index.tsx b/web/ui/react-app/src/components/header/index.tsx
index 53a998df..45fdf417 100644
--- a/web/ui/react-app/src/components/header/index.tsx
+++ b/web/ui/react-app/src/components/header/index.tsx
@@ -28,13 +28,29 @@ const Header = () => {
Configuration
-
a||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n","module.exports = require('./dist').YAML\n","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _construct(Parent, args, Class) {\n if (_isNativeReflectConstruct()) {\n _construct = Reflect.construct;\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) _setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nfunction _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\n\nfunction _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !_isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return _construct(Class, arguments, _getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return _setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = _getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}\n\nfunction _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n _get = Reflect.get;\n } else {\n _get = function _get(target, property, receiver) {\n var base = _superPropBase(target, property);\n\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get(target, property, receiver || target);\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\n\nfunction _toArray(arr) {\n return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) {\n var it;\n\n if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) {\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n\n var F = function () {};\n\n return {\n s: F,\n n: function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n },\n e: function (e) {\n throw e;\n },\n f: F\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n var normalCompletion = true,\n didErr = false,\n err;\n return {\n s: function () {\n it = o[Symbol.iterator]();\n },\n n: function () {\n var step = it.next();\n normalCompletion = step.done;\n return step;\n },\n e: function (e) {\n didErr = true;\n err = e;\n },\n f: function () {\n try {\n if (!normalCompletion && it.return != null) it.return();\n } finally {\n if (didErr) throw err;\n }\n }\n };\n}\n\nvar Char = {\n ANCHOR: '&',\n COMMENT: '#',\n TAG: '!',\n DIRECTIVES_END: '-',\n DOCUMENT_END: '.'\n};\nvar Type = {\n ALIAS: 'ALIAS',\n BLANK_LINE: 'BLANK_LINE',\n BLOCK_FOLDED: 'BLOCK_FOLDED',\n BLOCK_LITERAL: 'BLOCK_LITERAL',\n COMMENT: 'COMMENT',\n DIRECTIVE: 'DIRECTIVE',\n DOCUMENT: 'DOCUMENT',\n FLOW_MAP: 'FLOW_MAP',\n FLOW_SEQ: 'FLOW_SEQ',\n MAP: 'MAP',\n MAP_KEY: 'MAP_KEY',\n MAP_VALUE: 'MAP_VALUE',\n PLAIN: 'PLAIN',\n QUOTE_DOUBLE: 'QUOTE_DOUBLE',\n QUOTE_SINGLE: 'QUOTE_SINGLE',\n SEQ: 'SEQ',\n SEQ_ITEM: 'SEQ_ITEM'\n};\nvar defaultTagPrefix = 'tag:yaml.org,2002:';\nvar defaultTags = {\n MAP: 'tag:yaml.org,2002:map',\n SEQ: 'tag:yaml.org,2002:seq',\n STR: 'tag:yaml.org,2002:str'\n};\n\nfunction findLineStarts(src) {\n var ls = [0];\n var offset = src.indexOf('\\n');\n\n while (offset !== -1) {\n offset += 1;\n ls.push(offset);\n offset = src.indexOf('\\n', offset);\n }\n\n return ls;\n}\n\nfunction getSrcInfo(cst) {\n var lineStarts, src;\n\n if (typeof cst === 'string') {\n lineStarts = findLineStarts(cst);\n src = cst;\n } else {\n if (Array.isArray(cst)) cst = cst[0];\n\n if (cst && cst.context) {\n if (!cst.lineStarts) cst.lineStarts = findLineStarts(cst.context.src);\n lineStarts = cst.lineStarts;\n src = cst.context.src;\n }\n }\n\n return {\n lineStarts: lineStarts,\n src: src\n };\n}\n/**\n * @typedef {Object} LinePos - One-indexed position in the source\n * @property {number} line\n * @property {number} col\n */\n\n/**\n * Determine the line/col position matching a character offset.\n *\n * Accepts a source string or a CST document as the second parameter. With\n * the latter, starting indices for lines are cached in the document as\n * `lineStarts: number[]`.\n *\n * Returns a one-indexed `{ line, col }` location if found, or\n * `undefined` otherwise.\n *\n * @param {number} offset\n * @param {string|Document|Document[]} cst\n * @returns {?LinePos}\n */\n\n\nfunction getLinePos(offset, cst) {\n if (typeof offset !== 'number' || offset < 0) return null;\n\n var _getSrcInfo = getSrcInfo(cst),\n lineStarts = _getSrcInfo.lineStarts,\n src = _getSrcInfo.src;\n\n if (!lineStarts || !src || offset > src.length) return null;\n\n for (var i = 0; i < lineStarts.length; ++i) {\n var start = lineStarts[i];\n\n if (offset < start) {\n return {\n line: i,\n col: offset - lineStarts[i - 1] + 1\n };\n }\n\n if (offset === start) return {\n line: i + 1,\n col: 1\n };\n }\n\n var line = lineStarts.length;\n return {\n line: line,\n col: offset - lineStarts[line - 1] + 1\n };\n}\n/**\n * Get a specified line from the source.\n *\n * Accepts a source string or a CST document as the second parameter. With\n * the latter, starting indices for lines are cached in the document as\n * `lineStarts: number[]`.\n *\n * Returns the line as a string if found, or `null` otherwise.\n *\n * @param {number} line One-indexed line number\n * @param {string|Document|Document[]} cst\n * @returns {?string}\n */\n\nfunction getLine(line, cst) {\n var _getSrcInfo2 = getSrcInfo(cst),\n lineStarts = _getSrcInfo2.lineStarts,\n src = _getSrcInfo2.src;\n\n if (!lineStarts || !(line >= 1) || line > lineStarts.length) return null;\n var start = lineStarts[line - 1];\n var end = lineStarts[line]; // undefined for last line; that's ok for slice()\n\n while (end && end > start && src[end - 1] === '\\n') {\n --end;\n }\n\n return src.slice(start, end);\n}\n/**\n * Pretty-print the starting line from the source indicated by the range `pos`\n *\n * Trims output to `maxWidth` chars while keeping the starting column visible,\n * using `…` at either end to indicate dropped characters.\n *\n * Returns a two-line string (or `null`) with `\\n` as separator; the second line\n * will hold appropriately indented `^` marks indicating the column range.\n *\n * @param {Object} pos\n * @param {LinePos} pos.start\n * @param {LinePos} [pos.end]\n * @param {string|Document|Document[]*} cst\n * @param {number} [maxWidth=80]\n * @returns {?string}\n */\n\nfunction getPrettyContext(_ref, cst) {\n var start = _ref.start,\n end = _ref.end;\n var maxWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 80;\n var src = getLine(start.line, cst);\n if (!src) return null;\n var col = start.col;\n\n if (src.length > maxWidth) {\n if (col <= maxWidth - 10) {\n src = src.substr(0, maxWidth - 1) + '…';\n } else {\n var halfWidth = Math.round(maxWidth / 2);\n if (src.length > col + halfWidth) src = src.substr(0, col + halfWidth - 1) + '…';\n col -= src.length - maxWidth;\n src = '…' + src.substr(1 - maxWidth);\n }\n }\n\n var errLen = 1;\n var errEnd = '';\n\n if (end) {\n if (end.line === start.line && col + (end.col - start.col) <= maxWidth + 1) {\n errLen = end.col - start.col;\n } else {\n errLen = Math.min(src.length + 1, maxWidth) - col;\n errEnd = '…';\n }\n }\n\n var offset = col > 1 ? ' '.repeat(col - 1) : '';\n var err = '^'.repeat(errLen);\n return \"\".concat(src, \"\\n\").concat(offset).concat(err).concat(errEnd);\n}\n\nvar Range = /*#__PURE__*/function () {\n function Range(start, end) {\n _classCallCheck(this, Range);\n\n this.start = start;\n this.end = end || start;\n }\n\n _createClass(Range, [{\n key: \"isEmpty\",\n value: function isEmpty() {\n return typeof this.start !== 'number' || !this.end || this.end <= this.start;\n }\n /**\n * Set `origStart` and `origEnd` to point to the original source range for\n * this node, which may differ due to dropped CR characters.\n *\n * @param {number[]} cr - Positions of dropped CR characters\n * @param {number} offset - Starting index of `cr` from the last call\n * @returns {number} - The next offset, matching the one found for `origStart`\n */\n\n }, {\n key: \"setOrigRange\",\n value: function setOrigRange(cr, offset) {\n var start = this.start,\n end = this.end;\n\n if (cr.length === 0 || end <= cr[0]) {\n this.origStart = start;\n this.origEnd = end;\n return offset;\n }\n\n var i = offset;\n\n while (i < cr.length) {\n if (cr[i] > start) break;else ++i;\n }\n\n this.origStart = start + i;\n var nextOffset = i;\n\n while (i < cr.length) {\n // if end was at \\n, it should now be at \\r\n if (cr[i] >= end) break;else ++i;\n }\n\n this.origEnd = end + i;\n return nextOffset;\n }\n }], [{\n key: \"copy\",\n value: function copy(orig) {\n return new Range(orig.start, orig.end);\n }\n }]);\n\n return Range;\n}();\n\n/** Root class of all nodes */\n\nvar Node = /*#__PURE__*/function () {\n function Node(type, props, context) {\n _classCallCheck(this, Node);\n\n Object.defineProperty(this, 'context', {\n value: context || null,\n writable: true\n });\n this.error = null;\n this.range = null;\n this.valueRange = null;\n this.props = props || [];\n this.type = type;\n this.value = null;\n }\n\n _createClass(Node, [{\n key: \"getPropValue\",\n value: function getPropValue(idx, key, skipKey) {\n if (!this.context) return null;\n var src = this.context.src;\n var prop = this.props[idx];\n return prop && src[prop.start] === key ? src.slice(prop.start + (skipKey ? 1 : 0), prop.end) : null;\n }\n }, {\n key: \"anchor\",\n get: function get() {\n for (var i = 0; i < this.props.length; ++i) {\n var anchor = this.getPropValue(i, Char.ANCHOR, true);\n if (anchor != null) return anchor;\n }\n\n return null;\n }\n }, {\n key: \"comment\",\n get: function get() {\n var comments = [];\n\n for (var i = 0; i < this.props.length; ++i) {\n var comment = this.getPropValue(i, Char.COMMENT, true);\n if (comment != null) comments.push(comment);\n }\n\n return comments.length > 0 ? comments.join('\\n') : null;\n }\n }, {\n key: \"commentHasRequiredWhitespace\",\n value: function commentHasRequiredWhitespace(start) {\n var src = this.context.src;\n if (this.header && start === this.header.end) return false;\n if (!this.valueRange) return false;\n var end = this.valueRange.end;\n return start !== end || Node.atBlank(src, end - 1);\n }\n }, {\n key: \"hasComment\",\n get: function get() {\n if (this.context) {\n var src = this.context.src;\n\n for (var i = 0; i < this.props.length; ++i) {\n if (src[this.props[i].start] === Char.COMMENT) return true;\n }\n }\n\n return false;\n }\n }, {\n key: \"hasProps\",\n get: function get() {\n if (this.context) {\n var src = this.context.src;\n\n for (var i = 0; i < this.props.length; ++i) {\n if (src[this.props[i].start] !== Char.COMMENT) return true;\n }\n }\n\n return false;\n }\n }, {\n key: \"includesTrailingLines\",\n get: function get() {\n return false;\n }\n }, {\n key: \"jsonLike\",\n get: function get() {\n var jsonLikeTypes = [Type.FLOW_MAP, Type.FLOW_SEQ, Type.QUOTE_DOUBLE, Type.QUOTE_SINGLE];\n return jsonLikeTypes.indexOf(this.type) !== -1;\n }\n }, {\n key: \"rangeAsLinePos\",\n get: function get() {\n if (!this.range || !this.context) return undefined;\n var start = getLinePos(this.range.start, this.context.root);\n if (!start) return undefined;\n var end = getLinePos(this.range.end, this.context.root);\n return {\n start: start,\n end: end\n };\n }\n }, {\n key: \"rawValue\",\n get: function get() {\n if (!this.valueRange || !this.context) return null;\n var _this$valueRange = this.valueRange,\n start = _this$valueRange.start,\n end = _this$valueRange.end;\n return this.context.src.slice(start, end);\n }\n }, {\n key: \"tag\",\n get: function get() {\n for (var i = 0; i < this.props.length; ++i) {\n var tag = this.getPropValue(i, Char.TAG, false);\n\n if (tag != null) {\n if (tag[1] === '<') {\n return {\n verbatim: tag.slice(2, -1)\n };\n } else {\n // eslint-disable-next-line no-unused-vars\n var _tag$match = tag.match(/^(.*!)([^!]*)$/),\n _tag$match2 = _slicedToArray(_tag$match, 3);\n _tag$match2[0];\n var handle = _tag$match2[1],\n suffix = _tag$match2[2];\n\n return {\n handle: handle,\n suffix: suffix\n };\n }\n }\n }\n\n return null;\n }\n }, {\n key: \"valueRangeContainsNewline\",\n get: function get() {\n if (!this.valueRange || !this.context) return false;\n var _this$valueRange2 = this.valueRange,\n start = _this$valueRange2.start,\n end = _this$valueRange2.end;\n var src = this.context.src;\n\n for (var i = start; i < end; ++i) {\n if (src[i] === '\\n') return true;\n }\n\n return false;\n }\n }, {\n key: \"parseComment\",\n value: function parseComment(start) {\n var src = this.context.src;\n\n if (src[start] === Char.COMMENT) {\n var end = Node.endOfLine(src, start + 1);\n var commentRange = new Range(start, end);\n this.props.push(commentRange);\n return end;\n }\n\n return start;\n }\n /**\n * Populates the `origStart` and `origEnd` values of all ranges for this\n * node. Extended by child classes to handle descendant nodes.\n *\n * @param {number[]} cr - Positions of dropped CR characters\n * @param {number} offset - Starting index of `cr` from the last call\n * @returns {number} - The next offset, matching the one found for `origStart`\n */\n\n }, {\n key: \"setOrigRanges\",\n value: function setOrigRanges(cr, offset) {\n if (this.range) offset = this.range.setOrigRange(cr, offset);\n if (this.valueRange) this.valueRange.setOrigRange(cr, offset);\n this.props.forEach(function (prop) {\n return prop.setOrigRange(cr, offset);\n });\n return offset;\n }\n }, {\n key: \"toString\",\n value: function toString() {\n var src = this.context.src,\n range = this.range,\n value = this.value;\n if (value != null) return value;\n var str = src.slice(range.start, range.end);\n return Node.addStringTerminator(src, range.end, str);\n }\n }], [{\n key: \"addStringTerminator\",\n value: function addStringTerminator(src, offset, str) {\n if (str[str.length - 1] === '\\n') return str;\n var next = Node.endOfWhiteSpace(src, offset);\n return next >= src.length || src[next] === '\\n' ? str + '\\n' : str;\n } // ^(---|...)\n\n }, {\n key: \"atDocumentBoundary\",\n value: function atDocumentBoundary(src, offset, sep) {\n var ch0 = src[offset];\n if (!ch0) return true;\n var prev = src[offset - 1];\n if (prev && prev !== '\\n') return false;\n\n if (sep) {\n if (ch0 !== sep) return false;\n } else {\n if (ch0 !== Char.DIRECTIVES_END && ch0 !== Char.DOCUMENT_END) return false;\n }\n\n var ch1 = src[offset + 1];\n var ch2 = src[offset + 2];\n if (ch1 !== ch0 || ch2 !== ch0) return false;\n var ch3 = src[offset + 3];\n return !ch3 || ch3 === '\\n' || ch3 === '\\t' || ch3 === ' ';\n }\n }, {\n key: \"endOfIdentifier\",\n value: function endOfIdentifier(src, offset) {\n var ch = src[offset];\n var isVerbatim = ch === '<';\n var notOk = isVerbatim ? ['\\n', '\\t', ' ', '>'] : ['\\n', '\\t', ' ', '[', ']', '{', '}', ','];\n\n while (ch && notOk.indexOf(ch) === -1) {\n ch = src[offset += 1];\n }\n\n if (isVerbatim && ch === '>') offset += 1;\n return offset;\n }\n }, {\n key: \"endOfIndent\",\n value: function endOfIndent(src, offset) {\n var ch = src[offset];\n\n while (ch === ' ') {\n ch = src[offset += 1];\n }\n\n return offset;\n }\n }, {\n key: \"endOfLine\",\n value: function endOfLine(src, offset) {\n var ch = src[offset];\n\n while (ch && ch !== '\\n') {\n ch = src[offset += 1];\n }\n\n return offset;\n }\n }, {\n key: \"endOfWhiteSpace\",\n value: function endOfWhiteSpace(src, offset) {\n var ch = src[offset];\n\n while (ch === '\\t' || ch === ' ') {\n ch = src[offset += 1];\n }\n\n return offset;\n }\n }, {\n key: \"startOfLine\",\n value: function startOfLine(src, offset) {\n var ch = src[offset - 1];\n if (ch === '\\n') return offset;\n\n while (ch && ch !== '\\n') {\n ch = src[offset -= 1];\n }\n\n return offset + 1;\n }\n /**\n * End of indentation, or null if the line's indent level is not more\n * than `indent`\n *\n * @param {string} src\n * @param {number} indent\n * @param {number} lineStart\n * @returns {?number}\n */\n\n }, {\n key: \"endOfBlockIndent\",\n value: function endOfBlockIndent(src, indent, lineStart) {\n var inEnd = Node.endOfIndent(src, lineStart);\n\n if (inEnd > lineStart + indent) {\n return inEnd;\n } else {\n var wsEnd = Node.endOfWhiteSpace(src, inEnd);\n var ch = src[wsEnd];\n if (!ch || ch === '\\n') return wsEnd;\n }\n\n return null;\n }\n }, {\n key: \"atBlank\",\n value: function atBlank(src, offset, endAsBlank) {\n var ch = src[offset];\n return ch === '\\n' || ch === '\\t' || ch === ' ' || endAsBlank && !ch;\n }\n }, {\n key: \"nextNodeIsIndented\",\n value: function nextNodeIsIndented(ch, indentDiff, indicatorAsIndent) {\n if (!ch || indentDiff < 0) return false;\n if (indentDiff > 0) return true;\n return indicatorAsIndent && ch === '-';\n } // should be at line or string end, or at next non-whitespace char\n\n }, {\n key: \"normalizeOffset\",\n value: function normalizeOffset(src, offset) {\n var ch = src[offset];\n return !ch ? offset : ch !== '\\n' && src[offset - 1] === '\\n' ? offset - 1 : Node.endOfWhiteSpace(src, offset);\n } // fold single newline into space, multiple newlines to N - 1 newlines\n // presumes src[offset] === '\\n'\n\n }, {\n key: \"foldNewline\",\n value: function foldNewline(src, offset, indent) {\n var inCount = 0;\n var error = false;\n var fold = '';\n var ch = src[offset + 1];\n\n while (ch === ' ' || ch === '\\t' || ch === '\\n') {\n switch (ch) {\n case '\\n':\n inCount = 0;\n offset += 1;\n fold += '\\n';\n break;\n\n case '\\t':\n if (inCount <= indent) error = true;\n offset = Node.endOfWhiteSpace(src, offset + 2) - 1;\n break;\n\n case ' ':\n inCount += 1;\n offset += 1;\n break;\n }\n\n ch = src[offset + 1];\n }\n\n if (!fold) fold = ' ';\n if (ch && inCount <= indent) error = true;\n return {\n fold: fold,\n offset: offset,\n error: error\n };\n }\n }]);\n\n return Node;\n}();\n\nvar YAMLError = /*#__PURE__*/function (_Error) {\n _inherits(YAMLError, _Error);\n\n var _super = _createSuper(YAMLError);\n\n function YAMLError(name, source, message) {\n var _this;\n\n _classCallCheck(this, YAMLError);\n\n if (!message || !(source instanceof Node)) throw new Error(\"Invalid arguments for new \".concat(name));\n _this = _super.call(this);\n _this.name = name;\n _this.message = message;\n _this.source = source;\n return _this;\n }\n\n _createClass(YAMLError, [{\n key: \"makePretty\",\n value: function makePretty() {\n if (!this.source) return;\n this.nodeType = this.source.type;\n var cst = this.source.context && this.source.context.root;\n\n if (typeof this.offset === 'number') {\n this.range = new Range(this.offset, this.offset + 1);\n var start = cst && getLinePos(this.offset, cst);\n\n if (start) {\n var end = {\n line: start.line,\n col: start.col + 1\n };\n this.linePos = {\n start: start,\n end: end\n };\n }\n\n delete this.offset;\n } else {\n this.range = this.source.range;\n this.linePos = this.source.rangeAsLinePos;\n }\n\n if (this.linePos) {\n var _this$linePos$start = this.linePos.start,\n line = _this$linePos$start.line,\n col = _this$linePos$start.col;\n this.message += \" at line \".concat(line, \", column \").concat(col);\n var ctx = cst && getPrettyContext(this.linePos, cst);\n if (ctx) this.message += \":\\n\\n\".concat(ctx, \"\\n\");\n }\n\n delete this.source;\n }\n }]);\n\n return YAMLError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\nvar YAMLReferenceError = /*#__PURE__*/function (_YAMLError) {\n _inherits(YAMLReferenceError, _YAMLError);\n\n var _super2 = _createSuper(YAMLReferenceError);\n\n function YAMLReferenceError(source, message) {\n _classCallCheck(this, YAMLReferenceError);\n\n return _super2.call(this, 'YAMLReferenceError', source, message);\n }\n\n return YAMLReferenceError;\n}(YAMLError);\nvar YAMLSemanticError = /*#__PURE__*/function (_YAMLError2) {\n _inherits(YAMLSemanticError, _YAMLError2);\n\n var _super3 = _createSuper(YAMLSemanticError);\n\n function YAMLSemanticError(source, message) {\n _classCallCheck(this, YAMLSemanticError);\n\n return _super3.call(this, 'YAMLSemanticError', source, message);\n }\n\n return YAMLSemanticError;\n}(YAMLError);\nvar YAMLSyntaxError = /*#__PURE__*/function (_YAMLError3) {\n _inherits(YAMLSyntaxError, _YAMLError3);\n\n var _super4 = _createSuper(YAMLSyntaxError);\n\n function YAMLSyntaxError(source, message) {\n _classCallCheck(this, YAMLSyntaxError);\n\n return _super4.call(this, 'YAMLSyntaxError', source, message);\n }\n\n return YAMLSyntaxError;\n}(YAMLError);\nvar YAMLWarning = /*#__PURE__*/function (_YAMLError4) {\n _inherits(YAMLWarning, _YAMLError4);\n\n var _super5 = _createSuper(YAMLWarning);\n\n function YAMLWarning(source, message) {\n _classCallCheck(this, YAMLWarning);\n\n return _super5.call(this, 'YAMLWarning', source, message);\n }\n\n return YAMLWarning;\n}(YAMLError);\n\nvar PlainValue = /*#__PURE__*/function (_Node) {\n _inherits(PlainValue, _Node);\n\n var _super = _createSuper(PlainValue);\n\n function PlainValue() {\n _classCallCheck(this, PlainValue);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(PlainValue, [{\n key: \"strValue\",\n get: function get() {\n if (!this.valueRange || !this.context) return null;\n var _this$valueRange = this.valueRange,\n start = _this$valueRange.start,\n end = _this$valueRange.end;\n var src = this.context.src;\n var ch = src[end - 1];\n\n while (start < end && (ch === '\\n' || ch === '\\t' || ch === ' ')) {\n ch = src[--end - 1];\n }\n\n var str = '';\n\n for (var i = start; i < end; ++i) {\n var _ch = src[i];\n\n if (_ch === '\\n') {\n var _Node$foldNewline = Node.foldNewline(src, i, -1),\n fold = _Node$foldNewline.fold,\n offset = _Node$foldNewline.offset;\n\n str += fold;\n i = offset;\n } else if (_ch === ' ' || _ch === '\\t') {\n // trim trailing whitespace\n var wsStart = i;\n var next = src[i + 1];\n\n while (i < end && (next === ' ' || next === '\\t')) {\n i += 1;\n next = src[i + 1];\n }\n\n if (next !== '\\n') str += i > wsStart ? src.slice(wsStart, i + 1) : _ch;\n } else {\n str += _ch;\n }\n }\n\n var ch0 = src[start];\n\n switch (ch0) {\n case '\\t':\n {\n var msg = 'Plain value cannot start with a tab character';\n var errors = [new YAMLSemanticError(this, msg)];\n return {\n errors: errors,\n str: str\n };\n }\n\n case '@':\n case '`':\n {\n var _msg = \"Plain value cannot start with reserved character \".concat(ch0);\n\n var _errors = [new YAMLSemanticError(this, _msg)];\n return {\n errors: _errors,\n str: str\n };\n }\n\n default:\n return str;\n }\n }\n }, {\n key: \"parseBlockValue\",\n value: function parseBlockValue(start) {\n var _this$context = this.context,\n indent = _this$context.indent,\n inFlow = _this$context.inFlow,\n src = _this$context.src;\n var offset = start;\n var valueEnd = start;\n\n for (var ch = src[offset]; ch === '\\n'; ch = src[offset]) {\n if (Node.atDocumentBoundary(src, offset + 1)) break;\n var end = Node.endOfBlockIndent(src, indent, offset + 1);\n if (end === null || src[end] === '#') break;\n\n if (src[end] === '\\n') {\n offset = end;\n } else {\n valueEnd = PlainValue.endOfLine(src, end, inFlow);\n offset = valueEnd;\n }\n }\n\n if (this.valueRange.isEmpty()) this.valueRange.start = start;\n this.valueRange.end = valueEnd;\n return valueEnd;\n }\n /**\n * Parses a plain value from the source\n *\n * Accepted forms are:\n * ```\n * #comment\n *\n * first line\n *\n * first line #comment\n *\n * first line\n * block\n * lines\n *\n * #comment\n * block\n * lines\n * ```\n * where block lines are empty or have an indent level greater than `indent`.\n *\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this scalar, may be `\\n`\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var inFlow = context.inFlow,\n src = context.src;\n var offset = start;\n var ch = src[offset];\n\n if (ch && ch !== '#' && ch !== '\\n') {\n offset = PlainValue.endOfLine(src, start, inFlow);\n }\n\n this.valueRange = new Range(start, offset);\n offset = Node.endOfWhiteSpace(src, offset);\n offset = this.parseComment(offset);\n\n if (!this.hasComment || this.valueRange.isEmpty()) {\n offset = this.parseBlockValue(offset);\n }\n\n return offset;\n }\n }], [{\n key: \"endOfLine\",\n value: function endOfLine(src, start, inFlow) {\n var ch = src[start];\n var offset = start;\n\n while (ch && ch !== '\\n') {\n if (inFlow && (ch === '[' || ch === ']' || ch === '{' || ch === '}' || ch === ',')) break;\n var next = src[offset + 1];\n if (ch === ':' && (!next || next === '\\n' || next === '\\t' || next === ' ' || inFlow && next === ',')) break;\n if ((ch === ' ' || ch === '\\t') && next === '#') break;\n offset += 1;\n ch = next;\n }\n\n return offset;\n }\n }]);\n\n return PlainValue;\n}(Node);\n\nexport { Char as C, Node as N, PlainValue as P, Range as R, Type as T, YAMLSyntaxError as Y, _createForOfIteratorHelper as _, _typeof as a, _createClass as b, _classCallCheck as c, defaultTagPrefix as d, _defineProperty as e, YAMLWarning as f, YAMLSemanticError as g, _slicedToArray as h, YAMLError as i, _inherits as j, _createSuper as k, _get as l, _getPrototypeOf as m, defaultTags as n, YAMLReferenceError as o, _assertThisInitialized as p, _toArray as q, _possibleConstructorReturn as r };\n","import { j as _inherits, k as _createSuper, c as _classCallCheck, T as Type, b as _createClass, R as Range, N as Node, g as YAMLSemanticError, l as _get, m as _getPrototypeOf, Y as YAMLSyntaxError, C as Char, e as _defineProperty, P as PlainValue } from './PlainValue-b8036b75.js';\n\nvar BlankLine = /*#__PURE__*/function (_Node) {\n _inherits(BlankLine, _Node);\n\n var _super = _createSuper(BlankLine);\n\n function BlankLine() {\n _classCallCheck(this, BlankLine);\n\n return _super.call(this, Type.BLANK_LINE);\n }\n /* istanbul ignore next */\n\n\n _createClass(BlankLine, [{\n key: \"includesTrailingLines\",\n get: function get() {\n // This is never called from anywhere, but if it were,\n // this is the value it should return.\n return true;\n }\n /**\n * Parses a blank line from the source\n *\n * @param {ParseContext} context\n * @param {number} start - Index of first \\n character\n * @returns {number} - Index of the character after this\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n this.range = new Range(start, start + 1);\n return start + 1;\n }\n }]);\n\n return BlankLine;\n}(Node);\n\nvar CollectionItem = /*#__PURE__*/function (_Node) {\n _inherits(CollectionItem, _Node);\n\n var _super = _createSuper(CollectionItem);\n\n function CollectionItem(type, props) {\n var _this;\n\n _classCallCheck(this, CollectionItem);\n\n _this = _super.call(this, type, props);\n _this.node = null;\n return _this;\n }\n\n _createClass(CollectionItem, [{\n key: \"includesTrailingLines\",\n get: function get() {\n return !!this.node && this.node.includesTrailingLines;\n }\n /**\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var parseNode = context.parseNode,\n src = context.src;\n var atLineStart = context.atLineStart,\n lineStart = context.lineStart;\n if (!atLineStart && this.type === Type.SEQ_ITEM) this.error = new YAMLSemanticError(this, 'Sequence items must not have preceding content on the same line');\n var indent = atLineStart ? start - lineStart : context.indent;\n var offset = Node.endOfWhiteSpace(src, start + 1);\n var ch = src[offset];\n var inlineComment = ch === '#';\n var comments = [];\n var blankLine = null;\n\n while (ch === '\\n' || ch === '#') {\n if (ch === '#') {\n var _end = Node.endOfLine(src, offset + 1);\n\n comments.push(new Range(offset, _end));\n offset = _end;\n } else {\n atLineStart = true;\n lineStart = offset + 1;\n var wsEnd = Node.endOfWhiteSpace(src, lineStart);\n\n if (src[wsEnd] === '\\n' && comments.length === 0) {\n blankLine = new BlankLine();\n lineStart = blankLine.parse({\n src: src\n }, lineStart);\n }\n\n offset = Node.endOfIndent(src, lineStart);\n }\n\n ch = src[offset];\n }\n\n if (Node.nextNodeIsIndented(ch, offset - (lineStart + indent), this.type !== Type.SEQ_ITEM)) {\n this.node = parseNode({\n atLineStart: atLineStart,\n inCollection: false,\n indent: indent,\n lineStart: lineStart,\n parent: this\n }, offset);\n } else if (ch && lineStart > start + 1) {\n offset = lineStart - 1;\n }\n\n if (this.node) {\n if (blankLine) {\n // Only blank lines preceding non-empty nodes are captured. Note that\n // this means that collection item range start indices do not always\n // increase monotonically. -- eemeli/yaml#126\n var items = context.parent.items || context.parent.contents;\n if (items) items.push(blankLine);\n }\n\n if (comments.length) Array.prototype.push.apply(this.props, comments);\n offset = this.node.range.end;\n } else {\n if (inlineComment) {\n var c = comments[0];\n this.props.push(c);\n offset = c.end;\n } else {\n offset = Node.endOfLine(src, start + 1);\n }\n }\n\n var end = this.node ? this.node.valueRange.end : offset;\n this.valueRange = new Range(start, end);\n return offset;\n }\n }, {\n key: \"setOrigRanges\",\n value: function setOrigRanges(cr, offset) {\n offset = _get(_getPrototypeOf(CollectionItem.prototype), \"setOrigRanges\", this).call(this, cr, offset);\n return this.node ? this.node.setOrigRanges(cr, offset) : offset;\n }\n }, {\n key: \"toString\",\n value: function toString() {\n var src = this.context.src,\n node = this.node,\n range = this.range,\n value = this.value;\n if (value != null) return value;\n var str = node ? src.slice(range.start, node.range.start) + String(node) : src.slice(range.start, range.end);\n return Node.addStringTerminator(src, range.end, str);\n }\n }]);\n\n return CollectionItem;\n}(Node);\n\nvar Comment = /*#__PURE__*/function (_Node) {\n _inherits(Comment, _Node);\n\n var _super = _createSuper(Comment);\n\n function Comment() {\n _classCallCheck(this, Comment);\n\n return _super.call(this, Type.COMMENT);\n }\n /**\n * Parses a comment line from the source\n *\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this scalar\n */\n\n\n _createClass(Comment, [{\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var offset = this.parseComment(start);\n this.range = new Range(start, offset);\n return offset;\n }\n }]);\n\n return Comment;\n}(Node);\n\nfunction grabCollectionEndComments(node) {\n var cnode = node;\n\n while (cnode instanceof CollectionItem) {\n cnode = cnode.node;\n }\n\n if (!(cnode instanceof Collection)) return null;\n var len = cnode.items.length;\n var ci = -1;\n\n for (var i = len - 1; i >= 0; --i) {\n var n = cnode.items[i];\n\n if (n.type === Type.COMMENT) {\n // Keep sufficiently indented comments with preceding node\n var _n$context = n.context,\n indent = _n$context.indent,\n lineStart = _n$context.lineStart;\n if (indent > 0 && n.range.start >= lineStart + indent) break;\n ci = i;\n } else if (n.type === Type.BLANK_LINE) ci = i;else break;\n }\n\n if (ci === -1) return null;\n var ca = cnode.items.splice(ci, len - ci);\n var prevEnd = ca[0].range.start;\n\n while (true) {\n cnode.range.end = prevEnd;\n if (cnode.valueRange && cnode.valueRange.end > prevEnd) cnode.valueRange.end = prevEnd;\n if (cnode === node) break;\n cnode = cnode.context.parent;\n }\n\n return ca;\n}\nvar Collection = /*#__PURE__*/function (_Node) {\n _inherits(Collection, _Node);\n\n var _super = _createSuper(Collection);\n\n function Collection(firstItem) {\n var _this;\n\n _classCallCheck(this, Collection);\n\n _this = _super.call(this, firstItem.type === Type.SEQ_ITEM ? Type.SEQ : Type.MAP);\n\n for (var i = firstItem.props.length - 1; i >= 0; --i) {\n if (firstItem.props[i].start < firstItem.context.lineStart) {\n // props on previous line are assumed by the collection\n _this.props = firstItem.props.slice(0, i + 1);\n firstItem.props = firstItem.props.slice(i + 1);\n var itemRange = firstItem.props[0] || firstItem.valueRange;\n firstItem.range.start = itemRange.start;\n break;\n }\n }\n\n _this.items = [firstItem];\n var ec = grabCollectionEndComments(firstItem);\n if (ec) Array.prototype.push.apply(_this.items, ec);\n return _this;\n }\n\n _createClass(Collection, [{\n key: \"includesTrailingLines\",\n get: function get() {\n return this.items.length > 0;\n }\n /**\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var parseNode = context.parseNode,\n src = context.src; // It's easier to recalculate lineStart here rather than tracking down the\n // last context from which to read it -- eemeli/yaml#2\n\n var lineStart = Node.startOfLine(src, start);\n var firstItem = this.items[0]; // First-item context needs to be correct for later comment handling\n // -- eemeli/yaml#17\n\n firstItem.context.parent = this;\n this.valueRange = Range.copy(firstItem.valueRange);\n var indent = firstItem.range.start - firstItem.context.lineStart;\n var offset = start;\n offset = Node.normalizeOffset(src, offset);\n var ch = src[offset];\n var atLineStart = Node.endOfWhiteSpace(src, lineStart) === offset;\n var prevIncludesTrailingLines = false;\n\n while (ch) {\n while (ch === '\\n' || ch === '#') {\n if (atLineStart && ch === '\\n' && !prevIncludesTrailingLines) {\n var blankLine = new BlankLine();\n offset = blankLine.parse({\n src: src\n }, offset);\n this.valueRange.end = offset;\n\n if (offset >= src.length) {\n ch = null;\n break;\n }\n\n this.items.push(blankLine);\n offset -= 1; // blankLine.parse() consumes terminal newline\n } else if (ch === '#') {\n if (offset < lineStart + indent && !Collection.nextContentHasIndent(src, offset, indent)) {\n return offset;\n }\n\n var comment = new Comment();\n offset = comment.parse({\n indent: indent,\n lineStart: lineStart,\n src: src\n }, offset);\n this.items.push(comment);\n this.valueRange.end = offset;\n\n if (offset >= src.length) {\n ch = null;\n break;\n }\n }\n\n lineStart = offset + 1;\n offset = Node.endOfIndent(src, lineStart);\n\n if (Node.atBlank(src, offset)) {\n var wsEnd = Node.endOfWhiteSpace(src, offset);\n var next = src[wsEnd];\n\n if (!next || next === '\\n' || next === '#') {\n offset = wsEnd;\n }\n }\n\n ch = src[offset];\n atLineStart = true;\n }\n\n if (!ch) {\n break;\n }\n\n if (offset !== lineStart + indent && (atLineStart || ch !== ':')) {\n if (offset < lineStart + indent) {\n if (lineStart > start) offset = lineStart;\n break;\n } else if (!this.error) {\n var msg = 'All collection items must start at the same column';\n this.error = new YAMLSyntaxError(this, msg);\n }\n }\n\n if (firstItem.type === Type.SEQ_ITEM) {\n if (ch !== '-') {\n if (lineStart > start) offset = lineStart;\n break;\n }\n } else if (ch === '-' && !this.error) {\n // map key may start with -, as long as it's followed by a non-whitespace char\n var _next = src[offset + 1];\n\n if (!_next || _next === '\\n' || _next === '\\t' || _next === ' ') {\n var _msg = 'A collection cannot be both a mapping and a sequence';\n this.error = new YAMLSyntaxError(this, _msg);\n }\n }\n\n var node = parseNode({\n atLineStart: atLineStart,\n inCollection: true,\n indent: indent,\n lineStart: lineStart,\n parent: this\n }, offset);\n if (!node) return offset; // at next document start\n\n this.items.push(node);\n this.valueRange.end = node.valueRange.end;\n offset = Node.normalizeOffset(src, node.range.end);\n ch = src[offset];\n atLineStart = false;\n prevIncludesTrailingLines = node.includesTrailingLines; // Need to reset lineStart and atLineStart here if preceding node's range\n // has advanced to check the current line's indentation level\n // -- eemeli/yaml#10 & eemeli/yaml#38\n\n if (ch) {\n var ls = offset - 1;\n var prev = src[ls];\n\n while (prev === ' ' || prev === '\\t') {\n prev = src[--ls];\n }\n\n if (prev === '\\n') {\n lineStart = ls + 1;\n atLineStart = true;\n }\n }\n\n var ec = grabCollectionEndComments(node);\n if (ec) Array.prototype.push.apply(this.items, ec);\n }\n\n return offset;\n }\n }, {\n key: \"setOrigRanges\",\n value: function setOrigRanges(cr, offset) {\n offset = _get(_getPrototypeOf(Collection.prototype), \"setOrigRanges\", this).call(this, cr, offset);\n this.items.forEach(function (node) {\n offset = node.setOrigRanges(cr, offset);\n });\n return offset;\n }\n }, {\n key: \"toString\",\n value: function toString() {\n var src = this.context.src,\n items = this.items,\n range = this.range,\n value = this.value;\n if (value != null) return value;\n var str = src.slice(range.start, items[0].range.start) + String(items[0]);\n\n for (var i = 1; i < items.length; ++i) {\n var item = items[i];\n var _item$context = item.context,\n atLineStart = _item$context.atLineStart,\n indent = _item$context.indent;\n if (atLineStart) for (var _i = 0; _i < indent; ++_i) {\n str += ' ';\n }\n str += String(item);\n }\n\n return Node.addStringTerminator(src, range.end, str);\n }\n }], [{\n key: \"nextContentHasIndent\",\n value: function nextContentHasIndent(src, offset, indent) {\n var lineStart = Node.endOfLine(src, offset) + 1;\n offset = Node.endOfWhiteSpace(src, lineStart);\n var ch = src[offset];\n if (!ch) return false;\n if (offset >= lineStart + indent) return true;\n if (ch !== '#' && ch !== '\\n') return false;\n return Collection.nextContentHasIndent(src, offset, indent);\n }\n }]);\n\n return Collection;\n}(Node);\n\nvar Directive = /*#__PURE__*/function (_Node) {\n _inherits(Directive, _Node);\n\n var _super = _createSuper(Directive);\n\n function Directive() {\n var _this;\n\n _classCallCheck(this, Directive);\n\n _this = _super.call(this, Type.DIRECTIVE);\n _this.name = null;\n return _this;\n }\n\n _createClass(Directive, [{\n key: \"parameters\",\n get: function get() {\n var raw = this.rawValue;\n return raw ? raw.trim().split(/[ \\t]+/) : [];\n }\n }, {\n key: \"parseName\",\n value: function parseName(start) {\n var src = this.context.src;\n var offset = start;\n var ch = src[offset];\n\n while (ch && ch !== '\\n' && ch !== '\\t' && ch !== ' ') {\n ch = src[offset += 1];\n }\n\n this.name = src.slice(start, offset);\n return offset;\n }\n }, {\n key: \"parseParameters\",\n value: function parseParameters(start) {\n var src = this.context.src;\n var offset = start;\n var ch = src[offset];\n\n while (ch && ch !== '\\n' && ch !== '#') {\n ch = src[offset += 1];\n }\n\n this.valueRange = new Range(start, offset);\n return offset;\n }\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var offset = this.parseName(start + 1);\n offset = this.parseParameters(offset);\n offset = this.parseComment(offset);\n this.range = new Range(start, offset);\n return offset;\n }\n }]);\n\n return Directive;\n}(Node);\n\nvar Document = /*#__PURE__*/function (_Node) {\n _inherits(Document, _Node);\n\n var _super = _createSuper(Document);\n\n function Document() {\n var _this;\n\n _classCallCheck(this, Document);\n\n _this = _super.call(this, Type.DOCUMENT);\n _this.directives = null;\n _this.contents = null;\n _this.directivesEndMarker = null;\n _this.documentEndMarker = null;\n return _this;\n }\n\n _createClass(Document, [{\n key: \"parseDirectives\",\n value: function parseDirectives(start) {\n var src = this.context.src;\n this.directives = [];\n var atLineStart = true;\n var hasDirectives = false;\n var offset = start;\n\n while (!Node.atDocumentBoundary(src, offset, Char.DIRECTIVES_END)) {\n offset = Document.startCommentOrEndBlankLine(src, offset);\n\n switch (src[offset]) {\n case '\\n':\n if (atLineStart) {\n var blankLine = new BlankLine();\n offset = blankLine.parse({\n src: src\n }, offset);\n\n if (offset < src.length) {\n this.directives.push(blankLine);\n }\n } else {\n offset += 1;\n atLineStart = true;\n }\n\n break;\n\n case '#':\n {\n var comment = new Comment();\n offset = comment.parse({\n src: src\n }, offset);\n this.directives.push(comment);\n atLineStart = false;\n }\n break;\n\n case '%':\n {\n var directive = new Directive();\n offset = directive.parse({\n parent: this,\n src: src\n }, offset);\n this.directives.push(directive);\n hasDirectives = true;\n atLineStart = false;\n }\n break;\n\n default:\n if (hasDirectives) {\n this.error = new YAMLSemanticError(this, 'Missing directives-end indicator line');\n } else if (this.directives.length > 0) {\n this.contents = this.directives;\n this.directives = [];\n }\n\n return offset;\n }\n }\n\n if (src[offset]) {\n this.directivesEndMarker = new Range(offset, offset + 3);\n return offset + 3;\n }\n\n if (hasDirectives) {\n this.error = new YAMLSemanticError(this, 'Missing directives-end indicator line');\n } else if (this.directives.length > 0) {\n this.contents = this.directives;\n this.directives = [];\n }\n\n return offset;\n }\n }, {\n key: \"parseContents\",\n value: function parseContents(start) {\n var _this$context = this.context,\n parseNode = _this$context.parseNode,\n src = _this$context.src;\n if (!this.contents) this.contents = [];\n var lineStart = start;\n\n while (src[lineStart - 1] === '-') {\n lineStart -= 1;\n }\n\n var offset = Node.endOfWhiteSpace(src, start);\n var atLineStart = lineStart === start;\n this.valueRange = new Range(offset);\n\n while (!Node.atDocumentBoundary(src, offset, Char.DOCUMENT_END)) {\n switch (src[offset]) {\n case '\\n':\n if (atLineStart) {\n var blankLine = new BlankLine();\n offset = blankLine.parse({\n src: src\n }, offset);\n\n if (offset < src.length) {\n this.contents.push(blankLine);\n }\n } else {\n offset += 1;\n atLineStart = true;\n }\n\n lineStart = offset;\n break;\n\n case '#':\n {\n var comment = new Comment();\n offset = comment.parse({\n src: src\n }, offset);\n this.contents.push(comment);\n atLineStart = false;\n }\n break;\n\n default:\n {\n var iEnd = Node.endOfIndent(src, offset);\n var context = {\n atLineStart: atLineStart,\n indent: -1,\n inFlow: false,\n inCollection: false,\n lineStart: lineStart,\n parent: this\n };\n var node = parseNode(context, iEnd);\n if (!node) return this.valueRange.end = iEnd; // at next document start\n\n this.contents.push(node);\n offset = node.range.end;\n atLineStart = false;\n var ec = grabCollectionEndComments(node);\n if (ec) Array.prototype.push.apply(this.contents, ec);\n }\n }\n\n offset = Document.startCommentOrEndBlankLine(src, offset);\n }\n\n this.valueRange.end = offset;\n\n if (src[offset]) {\n this.documentEndMarker = new Range(offset, offset + 3);\n offset += 3;\n\n if (src[offset]) {\n offset = Node.endOfWhiteSpace(src, offset);\n\n if (src[offset] === '#') {\n var _comment = new Comment();\n\n offset = _comment.parse({\n src: src\n }, offset);\n this.contents.push(_comment);\n }\n\n switch (src[offset]) {\n case '\\n':\n offset += 1;\n break;\n\n case undefined:\n break;\n\n default:\n this.error = new YAMLSyntaxError(this, 'Document end marker line cannot have a non-comment suffix');\n }\n }\n }\n\n return offset;\n }\n /**\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n context.root = this;\n this.context = context;\n var src = context.src;\n var offset = src.charCodeAt(start) === 0xfeff ? start + 1 : start; // skip BOM\n\n offset = this.parseDirectives(offset);\n offset = this.parseContents(offset);\n return offset;\n }\n }, {\n key: \"setOrigRanges\",\n value: function setOrigRanges(cr, offset) {\n offset = _get(_getPrototypeOf(Document.prototype), \"setOrigRanges\", this).call(this, cr, offset);\n this.directives.forEach(function (node) {\n offset = node.setOrigRanges(cr, offset);\n });\n if (this.directivesEndMarker) offset = this.directivesEndMarker.setOrigRange(cr, offset);\n this.contents.forEach(function (node) {\n offset = node.setOrigRanges(cr, offset);\n });\n if (this.documentEndMarker) offset = this.documentEndMarker.setOrigRange(cr, offset);\n return offset;\n }\n }, {\n key: \"toString\",\n value: function toString() {\n var contents = this.contents,\n directives = this.directives,\n value = this.value;\n if (value != null) return value;\n var str = directives.join('');\n\n if (contents.length > 0) {\n if (directives.length > 0 || contents[0].type === Type.COMMENT) str += '---\\n';\n str += contents.join('');\n }\n\n if (str[str.length - 1] !== '\\n') str += '\\n';\n return str;\n }\n }], [{\n key: \"startCommentOrEndBlankLine\",\n value: function startCommentOrEndBlankLine(src, start) {\n var offset = Node.endOfWhiteSpace(src, start);\n var ch = src[offset];\n return ch === '#' || ch === '\\n' ? offset : start;\n }\n }]);\n\n return Document;\n}(Node);\n\nvar Alias = /*#__PURE__*/function (_Node) {\n _inherits(Alias, _Node);\n\n var _super = _createSuper(Alias);\n\n function Alias() {\n _classCallCheck(this, Alias);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(Alias, [{\n key: \"parse\",\n value:\n /**\n * Parses an *alias from the source\n *\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this scalar\n */\n function parse(context, start) {\n this.context = context;\n var src = context.src;\n var offset = Node.endOfIdentifier(src, start + 1);\n this.valueRange = new Range(start + 1, offset);\n offset = Node.endOfWhiteSpace(src, offset);\n offset = this.parseComment(offset);\n return offset;\n }\n }]);\n\n return Alias;\n}(Node);\n\nvar Chomp = {\n CLIP: 'CLIP',\n KEEP: 'KEEP',\n STRIP: 'STRIP'\n};\nvar BlockValue = /*#__PURE__*/function (_Node) {\n _inherits(BlockValue, _Node);\n\n var _super = _createSuper(BlockValue);\n\n function BlockValue(type, props) {\n var _this;\n\n _classCallCheck(this, BlockValue);\n\n _this = _super.call(this, type, props);\n _this.blockIndent = null;\n _this.chomping = Chomp.CLIP;\n _this.header = null;\n return _this;\n }\n\n _createClass(BlockValue, [{\n key: \"includesTrailingLines\",\n get: function get() {\n return this.chomping === Chomp.KEEP;\n }\n }, {\n key: \"strValue\",\n get: function get() {\n if (!this.valueRange || !this.context) return null;\n var _this$valueRange = this.valueRange,\n start = _this$valueRange.start,\n end = _this$valueRange.end;\n var _this$context = this.context,\n indent = _this$context.indent,\n src = _this$context.src;\n if (this.valueRange.isEmpty()) return '';\n var lastNewLine = null;\n var ch = src[end - 1];\n\n while (ch === '\\n' || ch === '\\t' || ch === ' ') {\n end -= 1;\n\n if (end <= start) {\n if (this.chomping === Chomp.KEEP) break;else return ''; // probably never happens\n }\n\n if (ch === '\\n') lastNewLine = end;\n ch = src[end - 1];\n }\n\n var keepStart = end + 1;\n\n if (lastNewLine) {\n if (this.chomping === Chomp.KEEP) {\n keepStart = lastNewLine;\n end = this.valueRange.end;\n } else {\n end = lastNewLine;\n }\n }\n\n var bi = indent + this.blockIndent;\n var folded = this.type === Type.BLOCK_FOLDED;\n var atStart = true;\n var str = '';\n var sep = '';\n var prevMoreIndented = false;\n\n for (var i = start; i < end; ++i) {\n for (var j = 0; j < bi; ++j) {\n if (src[i] !== ' ') break;\n i += 1;\n }\n\n var _ch = src[i];\n\n if (_ch === '\\n') {\n if (sep === '\\n') str += '\\n';else sep = '\\n';\n } else {\n var lineEnd = Node.endOfLine(src, i);\n var line = src.slice(i, lineEnd);\n i = lineEnd;\n\n if (folded && (_ch === ' ' || _ch === '\\t') && i < keepStart) {\n if (sep === ' ') sep = '\\n';else if (!prevMoreIndented && !atStart && sep === '\\n') sep = '\\n\\n';\n str += sep + line; //+ ((lineEnd < end && src[lineEnd]) || '')\n\n sep = lineEnd < end && src[lineEnd] || '';\n prevMoreIndented = true;\n } else {\n str += sep + line;\n sep = folded && i < keepStart ? ' ' : '\\n';\n prevMoreIndented = false;\n }\n\n if (atStart && line !== '') atStart = false;\n }\n }\n\n return this.chomping === Chomp.STRIP ? str : str + '\\n';\n }\n }, {\n key: \"parseBlockHeader\",\n value: function parseBlockHeader(start) {\n var src = this.context.src;\n var offset = start + 1;\n var bi = '';\n\n while (true) {\n var ch = src[offset];\n\n switch (ch) {\n case '-':\n this.chomping = Chomp.STRIP;\n break;\n\n case '+':\n this.chomping = Chomp.KEEP;\n break;\n\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n bi += ch;\n break;\n\n default:\n this.blockIndent = Number(bi) || null;\n this.header = new Range(start, offset);\n return offset;\n }\n\n offset += 1;\n }\n }\n }, {\n key: \"parseBlockValue\",\n value: function parseBlockValue(start) {\n var _this$context2 = this.context,\n indent = _this$context2.indent,\n src = _this$context2.src;\n var explicit = !!this.blockIndent;\n var offset = start;\n var valueEnd = start;\n var minBlockIndent = 1;\n\n for (var ch = src[offset]; ch === '\\n'; ch = src[offset]) {\n offset += 1;\n if (Node.atDocumentBoundary(src, offset)) break;\n var end = Node.endOfBlockIndent(src, indent, offset); // should not include tab?\n\n if (end === null) break;\n var _ch2 = src[end];\n var lineIndent = end - (offset + indent);\n\n if (!this.blockIndent) {\n // no explicit block indent, none yet detected\n if (src[end] !== '\\n') {\n // first line with non-whitespace content\n if (lineIndent < minBlockIndent) {\n var msg = 'Block scalars with more-indented leading empty lines must use an explicit indentation indicator';\n this.error = new YAMLSemanticError(this, msg);\n }\n\n this.blockIndent = lineIndent;\n } else if (lineIndent > minBlockIndent) {\n // empty line with more whitespace\n minBlockIndent = lineIndent;\n }\n } else if (_ch2 && _ch2 !== '\\n' && lineIndent < this.blockIndent) {\n if (src[end] === '#') break;\n\n if (!this.error) {\n var _src = explicit ? 'explicit indentation indicator' : 'first line';\n\n var _msg = \"Block scalars must not be less indented than their \".concat(_src);\n\n this.error = new YAMLSemanticError(this, _msg);\n }\n }\n\n if (src[end] === '\\n') {\n offset = end;\n } else {\n offset = valueEnd = Node.endOfLine(src, end);\n }\n }\n\n if (this.chomping !== Chomp.KEEP) {\n offset = src[valueEnd] ? valueEnd + 1 : valueEnd;\n }\n\n this.valueRange = new Range(start + 1, offset);\n return offset;\n }\n /**\n * Parses a block value from the source\n *\n * Accepted forms are:\n * ```\n * BS\n * block\n * lines\n *\n * BS #comment\n * block\n * lines\n * ```\n * where the block style BS matches the regexp `[|>][-+1-9]*` and block lines\n * are empty or have an indent level greater than `indent`.\n *\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this block\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var src = context.src;\n var offset = this.parseBlockHeader(start);\n offset = Node.endOfWhiteSpace(src, offset);\n offset = this.parseComment(offset);\n offset = this.parseBlockValue(offset);\n return offset;\n }\n }, {\n key: \"setOrigRanges\",\n value: function setOrigRanges(cr, offset) {\n offset = _get(_getPrototypeOf(BlockValue.prototype), \"setOrigRanges\", this).call(this, cr, offset);\n return this.header ? this.header.setOrigRange(cr, offset) : offset;\n }\n }]);\n\n return BlockValue;\n}(Node);\n\nvar FlowCollection = /*#__PURE__*/function (_Node) {\n _inherits(FlowCollection, _Node);\n\n var _super = _createSuper(FlowCollection);\n\n function FlowCollection(type, props) {\n var _this;\n\n _classCallCheck(this, FlowCollection);\n\n _this = _super.call(this, type, props);\n _this.items = null;\n return _this;\n }\n\n _createClass(FlowCollection, [{\n key: \"prevNodeIsJsonLike\",\n value: function prevNodeIsJsonLike() {\n var idx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.items.length;\n var node = this.items[idx - 1];\n return !!node && (node.jsonLike || node.type === Type.COMMENT && this.prevNodeIsJsonLike(idx - 1));\n }\n /**\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var parseNode = context.parseNode,\n src = context.src;\n var indent = context.indent,\n lineStart = context.lineStart;\n var char = src[start]; // { or [\n\n this.items = [{\n char: char,\n offset: start\n }];\n var offset = Node.endOfWhiteSpace(src, start + 1);\n char = src[offset];\n\n while (char && char !== ']' && char !== '}') {\n switch (char) {\n case '\\n':\n {\n lineStart = offset + 1;\n var wsEnd = Node.endOfWhiteSpace(src, lineStart);\n\n if (src[wsEnd] === '\\n') {\n var blankLine = new BlankLine();\n lineStart = blankLine.parse({\n src: src\n }, lineStart);\n this.items.push(blankLine);\n }\n\n offset = Node.endOfIndent(src, lineStart);\n\n if (offset <= lineStart + indent) {\n char = src[offset];\n\n if (offset < lineStart + indent || char !== ']' && char !== '}') {\n var msg = 'Insufficient indentation in flow collection';\n this.error = new YAMLSemanticError(this, msg);\n }\n }\n }\n break;\n\n case ',':\n {\n this.items.push({\n char: char,\n offset: offset\n });\n offset += 1;\n }\n break;\n\n case '#':\n {\n var comment = new Comment();\n offset = comment.parse({\n src: src\n }, offset);\n this.items.push(comment);\n }\n break;\n\n case '?':\n case ':':\n {\n var next = src[offset + 1];\n\n if (next === '\\n' || next === '\\t' || next === ' ' || next === ',' || // in-flow : after JSON-like key does not need to be followed by whitespace\n char === ':' && this.prevNodeIsJsonLike()) {\n this.items.push({\n char: char,\n offset: offset\n });\n offset += 1;\n break;\n }\n }\n // fallthrough\n\n default:\n {\n var node = parseNode({\n atLineStart: false,\n inCollection: false,\n inFlow: true,\n indent: -1,\n lineStart: lineStart,\n parent: this\n }, offset);\n\n if (!node) {\n // at next document start\n this.valueRange = new Range(start, offset);\n return offset;\n }\n\n this.items.push(node);\n offset = Node.normalizeOffset(src, node.range.end);\n }\n }\n\n offset = Node.endOfWhiteSpace(src, offset);\n char = src[offset];\n }\n\n this.valueRange = new Range(start, offset + 1);\n\n if (char) {\n this.items.push({\n char: char,\n offset: offset\n });\n offset = Node.endOfWhiteSpace(src, offset + 1);\n offset = this.parseComment(offset);\n }\n\n return offset;\n }\n }, {\n key: \"setOrigRanges\",\n value: function setOrigRanges(cr, offset) {\n offset = _get(_getPrototypeOf(FlowCollection.prototype), \"setOrigRanges\", this).call(this, cr, offset);\n this.items.forEach(function (node) {\n if (node instanceof Node) {\n offset = node.setOrigRanges(cr, offset);\n } else if (cr.length === 0) {\n node.origOffset = node.offset;\n } else {\n var i = offset;\n\n while (i < cr.length) {\n if (cr[i] > node.offset) break;else ++i;\n }\n\n node.origOffset = node.offset + i;\n offset = i;\n }\n });\n return offset;\n }\n }, {\n key: \"toString\",\n value: function toString() {\n var src = this.context.src,\n items = this.items,\n range = this.range,\n value = this.value;\n if (value != null) return value;\n var nodes = items.filter(function (item) {\n return item instanceof Node;\n });\n var str = '';\n var prevEnd = range.start;\n nodes.forEach(function (node) {\n var prefix = src.slice(prevEnd, node.range.start);\n prevEnd = node.range.end;\n str += prefix + String(node);\n\n if (str[str.length - 1] === '\\n' && src[prevEnd - 1] !== '\\n' && src[prevEnd] === '\\n') {\n // Comment range does not include the terminal newline, but its\n // stringified value does. Without this fix, newlines at comment ends\n // get duplicated.\n prevEnd += 1;\n }\n });\n str += src.slice(prevEnd, range.end);\n return Node.addStringTerminator(src, range.end, str);\n }\n }]);\n\n return FlowCollection;\n}(Node);\n\nvar QuoteDouble = /*#__PURE__*/function (_Node) {\n _inherits(QuoteDouble, _Node);\n\n var _super = _createSuper(QuoteDouble);\n\n function QuoteDouble() {\n _classCallCheck(this, QuoteDouble);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(QuoteDouble, [{\n key: \"strValue\",\n get:\n /**\n * @returns {string | { str: string, errors: YAMLSyntaxError[] }}\n */\n function get() {\n if (!this.valueRange || !this.context) return null;\n var errors = [];\n var _this$valueRange = this.valueRange,\n start = _this$valueRange.start,\n end = _this$valueRange.end;\n var _this$context = this.context,\n indent = _this$context.indent,\n src = _this$context.src;\n if (src[end - 1] !== '\"') errors.push(new YAMLSyntaxError(this, 'Missing closing \"quote')); // Using String#replace is too painful with escaped newlines preceded by\n // escaped backslashes; also, this should be faster.\n\n var str = '';\n\n for (var i = start + 1; i < end - 1; ++i) {\n var ch = src[i];\n\n if (ch === '\\n') {\n if (Node.atDocumentBoundary(src, i + 1)) errors.push(new YAMLSemanticError(this, 'Document boundary indicators are not allowed within string values'));\n\n var _Node$foldNewline = Node.foldNewline(src, i, indent),\n fold = _Node$foldNewline.fold,\n offset = _Node$foldNewline.offset,\n error = _Node$foldNewline.error;\n\n str += fold;\n i = offset;\n if (error) errors.push(new YAMLSemanticError(this, 'Multi-line double-quoted string needs to be sufficiently indented'));\n } else if (ch === '\\\\') {\n i += 1;\n\n switch (src[i]) {\n case '0':\n str += '\\0';\n break;\n // null character\n\n case 'a':\n str += '\\x07';\n break;\n // bell character\n\n case 'b':\n str += '\\b';\n break;\n // backspace\n\n case 'e':\n str += '\\x1b';\n break;\n // escape character\n\n case 'f':\n str += '\\f';\n break;\n // form feed\n\n case 'n':\n str += '\\n';\n break;\n // line feed\n\n case 'r':\n str += '\\r';\n break;\n // carriage return\n\n case 't':\n str += '\\t';\n break;\n // horizontal tab\n\n case 'v':\n str += '\\v';\n break;\n // vertical tab\n\n case 'N':\n str += \"\\x85\";\n break;\n // Unicode next line\n\n case '_':\n str += \"\\xA0\";\n break;\n // Unicode non-breaking space\n\n case 'L':\n str += \"\\u2028\";\n break;\n // Unicode line separator\n\n case 'P':\n str += \"\\u2029\";\n break;\n // Unicode paragraph separator\n\n case ' ':\n str += ' ';\n break;\n\n case '\"':\n str += '\"';\n break;\n\n case '/':\n str += '/';\n break;\n\n case '\\\\':\n str += '\\\\';\n break;\n\n case '\\t':\n str += '\\t';\n break;\n\n case 'x':\n str += this.parseCharCode(i + 1, 2, errors);\n i += 2;\n break;\n\n case 'u':\n str += this.parseCharCode(i + 1, 4, errors);\n i += 4;\n break;\n\n case 'U':\n str += this.parseCharCode(i + 1, 8, errors);\n i += 8;\n break;\n\n case '\\n':\n // skip escaped newlines, but still trim the following line\n while (src[i + 1] === ' ' || src[i + 1] === '\\t') {\n i += 1;\n }\n\n break;\n\n default:\n errors.push(new YAMLSyntaxError(this, \"Invalid escape sequence \".concat(src.substr(i - 1, 2))));\n str += '\\\\' + src[i];\n }\n } else if (ch === ' ' || ch === '\\t') {\n // trim trailing whitespace\n var wsStart = i;\n var next = src[i + 1];\n\n while (next === ' ' || next === '\\t') {\n i += 1;\n next = src[i + 1];\n }\n\n if (next !== '\\n') str += i > wsStart ? src.slice(wsStart, i + 1) : ch;\n } else {\n str += ch;\n }\n }\n\n return errors.length > 0 ? {\n errors: errors,\n str: str\n } : str;\n }\n }, {\n key: \"parseCharCode\",\n value: function parseCharCode(offset, length, errors) {\n var src = this.context.src;\n var cc = src.substr(offset, length);\n var ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);\n var code = ok ? parseInt(cc, 16) : NaN;\n\n if (isNaN(code)) {\n errors.push(new YAMLSyntaxError(this, \"Invalid escape sequence \".concat(src.substr(offset - 2, length + 2))));\n return src.substr(offset - 2, length + 2);\n }\n\n return String.fromCodePoint(code);\n }\n /**\n * Parses a \"double quoted\" value from the source\n *\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this scalar\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var src = context.src;\n var offset = QuoteDouble.endOfQuote(src, start + 1);\n this.valueRange = new Range(start, offset);\n offset = Node.endOfWhiteSpace(src, offset);\n offset = this.parseComment(offset);\n return offset;\n }\n }], [{\n key: \"endOfQuote\",\n value: function endOfQuote(src, offset) {\n var ch = src[offset];\n\n while (ch && ch !== '\"') {\n offset += ch === '\\\\' ? 2 : 1;\n ch = src[offset];\n }\n\n return offset + 1;\n }\n }]);\n\n return QuoteDouble;\n}(Node);\n\nvar QuoteSingle = /*#__PURE__*/function (_Node) {\n _inherits(QuoteSingle, _Node);\n\n var _super = _createSuper(QuoteSingle);\n\n function QuoteSingle() {\n _classCallCheck(this, QuoteSingle);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(QuoteSingle, [{\n key: \"strValue\",\n get:\n /**\n * @returns {string | { str: string, errors: YAMLSyntaxError[] }}\n */\n function get() {\n if (!this.valueRange || !this.context) return null;\n var errors = [];\n var _this$valueRange = this.valueRange,\n start = _this$valueRange.start,\n end = _this$valueRange.end;\n var _this$context = this.context,\n indent = _this$context.indent,\n src = _this$context.src;\n if (src[end - 1] !== \"'\") errors.push(new YAMLSyntaxError(this, \"Missing closing 'quote\"));\n var str = '';\n\n for (var i = start + 1; i < end - 1; ++i) {\n var ch = src[i];\n\n if (ch === '\\n') {\n if (Node.atDocumentBoundary(src, i + 1)) errors.push(new YAMLSemanticError(this, 'Document boundary indicators are not allowed within string values'));\n\n var _Node$foldNewline = Node.foldNewline(src, i, indent),\n fold = _Node$foldNewline.fold,\n offset = _Node$foldNewline.offset,\n error = _Node$foldNewline.error;\n\n str += fold;\n i = offset;\n if (error) errors.push(new YAMLSemanticError(this, 'Multi-line single-quoted string needs to be sufficiently indented'));\n } else if (ch === \"'\") {\n str += ch;\n i += 1;\n if (src[i] !== \"'\") errors.push(new YAMLSyntaxError(this, 'Unescaped single quote? This should not happen.'));\n } else if (ch === ' ' || ch === '\\t') {\n // trim trailing whitespace\n var wsStart = i;\n var next = src[i + 1];\n\n while (next === ' ' || next === '\\t') {\n i += 1;\n next = src[i + 1];\n }\n\n if (next !== '\\n') str += i > wsStart ? src.slice(wsStart, i + 1) : ch;\n } else {\n str += ch;\n }\n }\n\n return errors.length > 0 ? {\n errors: errors,\n str: str\n } : str;\n }\n /**\n * Parses a 'single quoted' value from the source\n *\n * @param {ParseContext} context\n * @param {number} start - Index of first character\n * @returns {number} - Index of the character after this scalar\n */\n\n }, {\n key: \"parse\",\n value: function parse(context, start) {\n this.context = context;\n var src = context.src;\n var offset = QuoteSingle.endOfQuote(src, start + 1);\n this.valueRange = new Range(start, offset);\n offset = Node.endOfWhiteSpace(src, offset);\n offset = this.parseComment(offset);\n return offset;\n }\n }], [{\n key: \"endOfQuote\",\n value: function endOfQuote(src, offset) {\n var ch = src[offset];\n\n while (ch) {\n if (ch === \"'\") {\n if (src[offset + 1] !== \"'\") break;\n ch = src[offset += 2];\n } else {\n ch = src[offset += 1];\n }\n }\n\n return offset + 1;\n }\n }]);\n\n return QuoteSingle;\n}(Node);\n\nfunction createNewNode(type, props) {\n switch (type) {\n case Type.ALIAS:\n return new Alias(type, props);\n\n case Type.BLOCK_FOLDED:\n case Type.BLOCK_LITERAL:\n return new BlockValue(type, props);\n\n case Type.FLOW_MAP:\n case Type.FLOW_SEQ:\n return new FlowCollection(type, props);\n\n case Type.MAP_KEY:\n case Type.MAP_VALUE:\n case Type.SEQ_ITEM:\n return new CollectionItem(type, props);\n\n case Type.COMMENT:\n case Type.PLAIN:\n return new PlainValue(type, props);\n\n case Type.QUOTE_DOUBLE:\n return new QuoteDouble(type, props);\n\n case Type.QUOTE_SINGLE:\n return new QuoteSingle(type, props);\n\n /* istanbul ignore next */\n\n default:\n return null;\n // should never happen\n }\n}\n/**\n * @param {boolean} atLineStart - Node starts at beginning of line\n * @param {boolean} inFlow - true if currently in a flow context\n * @param {boolean} inCollection - true if currently in a collection context\n * @param {number} indent - Current level of indentation\n * @param {number} lineStart - Start of the current line\n * @param {Node} parent - The parent of the node\n * @param {string} src - Source of the YAML document\n */\n\n\nvar ParseContext = /*#__PURE__*/function () {\n function ParseContext() {\n var _this = this;\n\n var orig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n atLineStart = _ref.atLineStart,\n inCollection = _ref.inCollection,\n inFlow = _ref.inFlow,\n indent = _ref.indent,\n lineStart = _ref.lineStart,\n parent = _ref.parent;\n\n _classCallCheck(this, ParseContext);\n\n _defineProperty(this, \"parseNode\", function (overlay, start) {\n if (Node.atDocumentBoundary(_this.src, start)) return null;\n var context = new ParseContext(_this, overlay);\n\n var _context$parseProps = context.parseProps(start),\n props = _context$parseProps.props,\n type = _context$parseProps.type,\n valueStart = _context$parseProps.valueStart;\n\n var node = createNewNode(type, props);\n var offset = node.parse(context, valueStart);\n node.range = new Range(start, offset);\n /* istanbul ignore if */\n\n if (offset <= start) {\n // This should never happen, but if it does, let's make sure to at least\n // step one character forward to avoid a busy loop.\n node.error = new Error(\"Node#parse consumed no characters\");\n node.error.parseEnd = offset;\n node.error.source = node;\n node.range.end = start + 1;\n }\n\n if (context.nodeStartsCollection(node)) {\n if (!node.error && !context.atLineStart && context.parent.type === Type.DOCUMENT) {\n node.error = new YAMLSyntaxError(node, 'Block collection must not have preceding content here (e.g. directives-end indicator)');\n }\n\n var collection = new Collection(node);\n offset = collection.parse(new ParseContext(context), offset);\n collection.range = new Range(start, offset);\n return collection;\n }\n\n return node;\n });\n\n this.atLineStart = atLineStart != null ? atLineStart : orig.atLineStart || false;\n this.inCollection = inCollection != null ? inCollection : orig.inCollection || false;\n this.inFlow = inFlow != null ? inFlow : orig.inFlow || false;\n this.indent = indent != null ? indent : orig.indent;\n this.lineStart = lineStart != null ? lineStart : orig.lineStart;\n this.parent = parent != null ? parent : orig.parent || {};\n this.root = orig.root;\n this.src = orig.src;\n }\n\n _createClass(ParseContext, [{\n key: \"nodeStartsCollection\",\n value: function nodeStartsCollection(node) {\n var inCollection = this.inCollection,\n inFlow = this.inFlow,\n src = this.src;\n if (inCollection || inFlow) return false;\n if (node instanceof CollectionItem) return true; // check for implicit key\n\n var offset = node.range.end;\n if (src[offset] === '\\n' || src[offset - 1] === '\\n') return false;\n offset = Node.endOfWhiteSpace(src, offset);\n return src[offset] === ':';\n } // Anchor and tag are before type, which determines the node implementation\n // class; hence this intermediate step.\n\n }, {\n key: \"parseProps\",\n value: function parseProps(offset) {\n var inFlow = this.inFlow,\n parent = this.parent,\n src = this.src;\n var props = [];\n var lineHasProps = false;\n offset = this.atLineStart ? Node.endOfIndent(src, offset) : Node.endOfWhiteSpace(src, offset);\n var ch = src[offset];\n\n while (ch === Char.ANCHOR || ch === Char.COMMENT || ch === Char.TAG || ch === '\\n') {\n if (ch === '\\n') {\n var inEnd = offset;\n var lineStart = void 0;\n\n do {\n lineStart = inEnd + 1;\n inEnd = Node.endOfIndent(src, lineStart);\n } while (src[inEnd] === '\\n');\n\n var indentDiff = inEnd - (lineStart + this.indent);\n var noIndicatorAsIndent = parent.type === Type.SEQ_ITEM && parent.context.atLineStart;\n if (src[inEnd] !== '#' && !Node.nextNodeIsIndented(src[inEnd], indentDiff, !noIndicatorAsIndent)) break;\n this.atLineStart = true;\n this.lineStart = lineStart;\n lineHasProps = false;\n offset = inEnd;\n } else if (ch === Char.COMMENT) {\n var end = Node.endOfLine(src, offset + 1);\n props.push(new Range(offset, end));\n offset = end;\n } else {\n var _end = Node.endOfIdentifier(src, offset + 1);\n\n if (ch === Char.TAG && src[_end] === ',' && /^[a-zA-Z0-9-]+\\.[a-zA-Z0-9-]+,\\d\\d\\d\\d(-\\d\\d){0,2}\\/\\S/.test(src.slice(offset + 1, _end + 13))) {\n // Let's presume we're dealing with a YAML 1.0 domain tag here, rather\n // than an empty but 'foo.bar' private-tagged node in a flow collection\n // followed without whitespace by a plain string starting with a year\n // or date divided by something.\n _end = Node.endOfIdentifier(src, _end + 5);\n }\n\n props.push(new Range(offset, _end));\n lineHasProps = true;\n offset = Node.endOfWhiteSpace(src, _end);\n }\n\n ch = src[offset];\n } // '- &a : b' has an anchor on an empty node\n\n\n if (lineHasProps && ch === ':' && Node.atBlank(src, offset + 1, true)) offset -= 1;\n var type = ParseContext.parseType(src, offset, inFlow);\n return {\n props: props,\n type: type,\n valueStart: offset\n };\n }\n /**\n * Parses a node from the source\n * @param {ParseContext} overlay\n * @param {number} start - Index of first non-whitespace character for the node\n * @returns {?Node} - null if at a document boundary\n */\n\n }], [{\n key: \"parseType\",\n value: function parseType(src, offset, inFlow) {\n switch (src[offset]) {\n case '*':\n return Type.ALIAS;\n\n case '>':\n return Type.BLOCK_FOLDED;\n\n case '|':\n return Type.BLOCK_LITERAL;\n\n case '{':\n return Type.FLOW_MAP;\n\n case '[':\n return Type.FLOW_SEQ;\n\n case '?':\n return !inFlow && Node.atBlank(src, offset + 1, true) ? Type.MAP_KEY : Type.PLAIN;\n\n case ':':\n return !inFlow && Node.atBlank(src, offset + 1, true) ? Type.MAP_VALUE : Type.PLAIN;\n\n case '-':\n return !inFlow && Node.atBlank(src, offset + 1, true) ? Type.SEQ_ITEM : Type.PLAIN;\n\n case '\"':\n return Type.QUOTE_DOUBLE;\n\n case \"'\":\n return Type.QUOTE_SINGLE;\n\n default:\n return Type.PLAIN;\n }\n }\n }]);\n\n return ParseContext;\n}();\n\n// Published as 'yaml/parse-cst'\nfunction parse(src) {\n var cr = [];\n\n if (src.indexOf('\\r') !== -1) {\n src = src.replace(/\\r\\n?/g, function (match, offset) {\n if (match.length > 1) cr.push(offset);\n return '\\n';\n });\n }\n\n var documents = [];\n var offset = 0;\n\n do {\n var doc = new Document();\n var context = new ParseContext({\n src: src\n });\n offset = doc.parse(context, offset);\n documents.push(doc);\n } while (offset < src.length);\n\n documents.setOrigRanges = function () {\n if (cr.length === 0) return false;\n\n for (var i = 1; i < cr.length; ++i) {\n cr[i] -= i;\n }\n\n var crOffset = 0;\n\n for (var _i = 0; _i < documents.length; ++_i) {\n crOffset = documents[_i].setOrigRanges(cr, crOffset);\n }\n\n cr.splice(0, cr.length);\n return true;\n };\n\n documents.toString = function () {\n return documents.join('...\\n');\n };\n\n return documents;\n}\n\nexport { parse };\n","import { c as _classCallCheck, j as _inherits, k as _createSuper, b as _createClass, e as _defineProperty, p as _assertThisInitialized, a as _typeof, q as _toArray, T as Type, _ as _createForOfIteratorHelper, l as _get, m as _getPrototypeOf, o as YAMLReferenceError, r as _possibleConstructorReturn, h as _slicedToArray, g as YAMLSemanticError, n as defaultTags, f as YAMLWarning, C as Char, Y as YAMLSyntaxError, P as PlainValue } from './PlainValue-b8036b75.js';\n\nfunction addCommentBefore(str, indent, comment) {\n if (!comment) return str;\n var cc = comment.replace(/[\\s\\S]^/gm, \"$&\".concat(indent, \"#\"));\n return \"#\".concat(cc, \"\\n\").concat(indent).concat(str);\n}\nfunction addComment(str, indent, comment) {\n return !comment ? str : comment.indexOf('\\n') === -1 ? \"\".concat(str, \" #\").concat(comment) : \"\".concat(str, \"\\n\") + comment.replace(/^/gm, \"\".concat(indent || '', \"#\"));\n}\n\nvar Node = function Node() {\n _classCallCheck(this, Node);\n};\n\nfunction toJSON(value, arg, ctx) {\n if (Array.isArray(value)) return value.map(function (v, i) {\n return toJSON(v, String(i), ctx);\n });\n\n if (value && typeof value.toJSON === 'function') {\n var anchor = ctx && ctx.anchors && ctx.anchors.get(value);\n if (anchor) ctx.onCreate = function (res) {\n anchor.res = res;\n delete ctx.onCreate;\n };\n var res = value.toJSON(arg, ctx);\n if (anchor && ctx.onCreate) ctx.onCreate(res);\n return res;\n }\n\n if ((!ctx || !ctx.keep) && typeof value === 'bigint') return Number(value);\n return value;\n}\n\nvar Scalar = /*#__PURE__*/function (_Node) {\n _inherits(Scalar, _Node);\n\n var _super = _createSuper(Scalar);\n\n function Scalar(value) {\n var _this;\n\n _classCallCheck(this, Scalar);\n\n _this = _super.call(this);\n _this.value = value;\n return _this;\n }\n\n _createClass(Scalar, [{\n key: \"toJSON\",\n value: function toJSON$1(arg, ctx) {\n return ctx && ctx.keep ? this.value : toJSON(this.value, arg, ctx);\n }\n }, {\n key: \"toString\",\n value: function toString() {\n return String(this.value);\n }\n }]);\n\n return Scalar;\n}(Node);\n\nfunction collectionFromPath(schema, path, value) {\n var v = value;\n\n for (var i = path.length - 1; i >= 0; --i) {\n var k = path[i];\n\n if (Number.isInteger(k) && k >= 0) {\n var a = [];\n a[k] = v;\n v = a;\n } else {\n var o = {};\n Object.defineProperty(o, k, {\n value: v,\n writable: true,\n enumerable: true,\n configurable: true\n });\n v = o;\n }\n }\n\n return schema.createNode(v, false);\n} // null, undefined, or an empty non-string iterable (e.g. [])\n\n\nvar isEmptyPath = function isEmptyPath(path) {\n return path == null || _typeof(path) === 'object' && path[Symbol.iterator]().next().done;\n};\nvar Collection = /*#__PURE__*/function (_Node) {\n _inherits(Collection, _Node);\n\n var _super = _createSuper(Collection);\n\n function Collection(schema) {\n var _this;\n\n _classCallCheck(this, Collection);\n\n _this = _super.call(this);\n\n _defineProperty(_assertThisInitialized(_this), \"items\", []);\n\n _this.schema = schema;\n return _this;\n }\n\n _createClass(Collection, [{\n key: \"addIn\",\n value: function addIn(path, value) {\n if (isEmptyPath(path)) this.add(value);else {\n var _path = _toArray(path),\n key = _path[0],\n rest = _path.slice(1);\n\n var node = this.get(key, true);\n if (node instanceof Collection) node.addIn(rest, value);else if (node === undefined && this.schema) this.set(key, collectionFromPath(this.schema, rest, value));else throw new Error(\"Expected YAML collection at \".concat(key, \". Remaining path: \").concat(rest));\n }\n }\n }, {\n key: \"deleteIn\",\n value: function deleteIn(_ref) {\n var _ref2 = _toArray(_ref),\n key = _ref2[0],\n rest = _ref2.slice(1);\n\n if (rest.length === 0) return this.delete(key);\n var node = this.get(key, true);\n if (node instanceof Collection) return node.deleteIn(rest);else throw new Error(\"Expected YAML collection at \".concat(key, \". Remaining path: \").concat(rest));\n }\n }, {\n key: \"getIn\",\n value: function getIn(_ref3, keepScalar) {\n var _ref4 = _toArray(_ref3),\n key = _ref4[0],\n rest = _ref4.slice(1);\n\n var node = this.get(key, true);\n if (rest.length === 0) return !keepScalar && node instanceof Scalar ? node.value : node;else return node instanceof Collection ? node.getIn(rest, keepScalar) : undefined;\n }\n }, {\n key: \"hasAllNullValues\",\n value: function hasAllNullValues() {\n return this.items.every(function (node) {\n if (!node || node.type !== 'PAIR') return false;\n var n = node.value;\n return n == null || n instanceof Scalar && n.value == null && !n.commentBefore && !n.comment && !n.tag;\n });\n }\n }, {\n key: \"hasIn\",\n value: function hasIn(_ref5) {\n var _ref6 = _toArray(_ref5),\n key = _ref6[0],\n rest = _ref6.slice(1);\n\n if (rest.length === 0) return this.has(key);\n var node = this.get(key, true);\n return node instanceof Collection ? node.hasIn(rest) : false;\n }\n }, {\n key: \"setIn\",\n value: function setIn(_ref7, value) {\n var _ref8 = _toArray(_ref7),\n key = _ref8[0],\n rest = _ref8.slice(1);\n\n if (rest.length === 0) {\n this.set(key, value);\n } else {\n var node = this.get(key, true);\n if (node instanceof Collection) node.setIn(rest, value);else if (node === undefined && this.schema) this.set(key, collectionFromPath(this.schema, rest, value));else throw new Error(\"Expected YAML collection at \".concat(key, \". Remaining path: \").concat(rest));\n }\n } // overridden in implementations\n\n /* istanbul ignore next */\n\n }, {\n key: \"toJSON\",\n value: function toJSON() {\n return null;\n }\n }, {\n key: \"toString\",\n value: function toString(ctx, _ref9, onComment, onChompKeep) {\n var _this2 = this;\n\n var blockItem = _ref9.blockItem,\n flowChars = _ref9.flowChars,\n isMap = _ref9.isMap,\n itemIndent = _ref9.itemIndent;\n var _ctx = ctx,\n indent = _ctx.indent,\n indentStep = _ctx.indentStep,\n stringify = _ctx.stringify;\n var inFlow = this.type === Type.FLOW_MAP || this.type === Type.FLOW_SEQ || ctx.inFlow;\n if (inFlow) itemIndent += indentStep;\n var allNullValues = isMap && this.hasAllNullValues();\n ctx = Object.assign({}, ctx, {\n allNullValues: allNullValues,\n indent: itemIndent,\n inFlow: inFlow,\n type: null\n });\n var chompKeep = false;\n var hasItemWithNewLine = false;\n var nodes = this.items.reduce(function (nodes, item, i) {\n var comment;\n\n if (item) {\n if (!chompKeep && item.spaceBefore) nodes.push({\n type: 'comment',\n str: ''\n });\n if (item.commentBefore) item.commentBefore.match(/^.*$/gm).forEach(function (line) {\n nodes.push({\n type: 'comment',\n str: \"#\".concat(line)\n });\n });\n if (item.comment) comment = item.comment;\n if (inFlow && (!chompKeep && item.spaceBefore || item.commentBefore || item.comment || item.key && (item.key.commentBefore || item.key.comment) || item.value && (item.value.commentBefore || item.value.comment))) hasItemWithNewLine = true;\n }\n\n chompKeep = false;\n var str = stringify(item, ctx, function () {\n return comment = null;\n }, function () {\n return chompKeep = true;\n });\n if (inFlow && !hasItemWithNewLine && str.includes('\\n')) hasItemWithNewLine = true;\n if (inFlow && i < _this2.items.length - 1) str += ',';\n str = addComment(str, itemIndent, comment);\n if (chompKeep && (comment || inFlow)) chompKeep = false;\n nodes.push({\n type: 'item',\n str: str\n });\n return nodes;\n }, []);\n var str;\n\n if (nodes.length === 0) {\n str = flowChars.start + flowChars.end;\n } else if (inFlow) {\n var start = flowChars.start,\n end = flowChars.end;\n var strings = nodes.map(function (n) {\n return n.str;\n });\n\n if (hasItemWithNewLine || strings.reduce(function (sum, str) {\n return sum + str.length + 2;\n }, 2) > Collection.maxFlowStringSingleLineLength) {\n str = start;\n\n var _iterator = _createForOfIteratorHelper(strings),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var s = _step.value;\n str += s ? \"\\n\".concat(indentStep).concat(indent).concat(s) : '\\n';\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n str += \"\\n\".concat(indent).concat(end);\n } else {\n str = \"\".concat(start, \" \").concat(strings.join(' '), \" \").concat(end);\n }\n } else {\n var _strings = nodes.map(blockItem);\n\n str = _strings.shift();\n\n var _iterator2 = _createForOfIteratorHelper(_strings),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _s = _step2.value;\n str += _s ? \"\\n\".concat(indent).concat(_s) : '\\n';\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n\n if (this.comment) {\n str += '\\n' + this.comment.replace(/^/gm, \"\".concat(indent, \"#\"));\n if (onComment) onComment();\n } else if (chompKeep && onChompKeep) onChompKeep();\n\n return str;\n }\n }]);\n\n return Collection;\n}(Node);\n\n_defineProperty(Collection, \"maxFlowStringSingleLineLength\", 60);\n\nfunction asItemIndex(key) {\n var idx = key instanceof Scalar ? key.value : key;\n if (idx && typeof idx === 'string') idx = Number(idx);\n return Number.isInteger(idx) && idx >= 0 ? idx : null;\n}\n\nvar YAMLSeq = /*#__PURE__*/function (_Collection) {\n _inherits(YAMLSeq, _Collection);\n\n var _super = _createSuper(YAMLSeq);\n\n function YAMLSeq() {\n _classCallCheck(this, YAMLSeq);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(YAMLSeq, [{\n key: \"add\",\n value: function add(value) {\n this.items.push(value);\n }\n }, {\n key: \"delete\",\n value: function _delete(key) {\n var idx = asItemIndex(key);\n if (typeof idx !== 'number') return false;\n var del = this.items.splice(idx, 1);\n return del.length > 0;\n }\n }, {\n key: \"get\",\n value: function get(key, keepScalar) {\n var idx = asItemIndex(key);\n if (typeof idx !== 'number') return undefined;\n var it = this.items[idx];\n return !keepScalar && it instanceof Scalar ? it.value : it;\n }\n }, {\n key: \"has\",\n value: function has(key) {\n var idx = asItemIndex(key);\n return typeof idx === 'number' && idx < this.items.length;\n }\n }, {\n key: \"set\",\n value: function set(key, value) {\n var idx = asItemIndex(key);\n if (typeof idx !== 'number') throw new Error(\"Expected a valid index, not \".concat(key, \".\"));\n this.items[idx] = value;\n }\n }, {\n key: \"toJSON\",\n value: function toJSON$1(_, ctx) {\n var seq = [];\n if (ctx && ctx.onCreate) ctx.onCreate(seq);\n var i = 0;\n\n var _iterator = _createForOfIteratorHelper(this.items),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var item = _step.value;\n seq.push(toJSON(item, String(i++), ctx));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return seq;\n }\n }, {\n key: \"toString\",\n value: function toString(ctx, onComment, onChompKeep) {\n if (!ctx) return JSON.stringify(this);\n return _get(_getPrototypeOf(YAMLSeq.prototype), \"toString\", this).call(this, ctx, {\n blockItem: function blockItem(n) {\n return n.type === 'comment' ? n.str : \"- \".concat(n.str);\n },\n flowChars: {\n start: '[',\n end: ']'\n },\n isMap: false,\n itemIndent: (ctx.indent || '') + ' '\n }, onComment, onChompKeep);\n }\n }]);\n\n return YAMLSeq;\n}(Collection);\n\nvar stringifyKey = function stringifyKey(key, jsKey, ctx) {\n if (jsKey === null) return '';\n if (_typeof(jsKey) !== 'object') return String(jsKey);\n if (key instanceof Node && ctx && ctx.doc) return key.toString({\n anchors: Object.create(null),\n doc: ctx.doc,\n indent: '',\n indentStep: ctx.indentStep,\n inFlow: true,\n inStringifyKey: true,\n stringify: ctx.stringify\n });\n return JSON.stringify(jsKey);\n};\n\nvar Pair = /*#__PURE__*/function (_Node) {\n _inherits(Pair, _Node);\n\n var _super = _createSuper(Pair);\n\n function Pair(key) {\n var _this;\n\n var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n _classCallCheck(this, Pair);\n\n _this = _super.call(this);\n _this.key = key;\n _this.value = value;\n _this.type = Pair.Type.PAIR;\n return _this;\n }\n\n _createClass(Pair, [{\n key: \"commentBefore\",\n get: function get() {\n return this.key instanceof Node ? this.key.commentBefore : undefined;\n },\n set: function set(cb) {\n if (this.key == null) this.key = new Scalar(null);\n if (this.key instanceof Node) this.key.commentBefore = cb;else {\n var msg = 'Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.';\n throw new Error(msg);\n }\n }\n }, {\n key: \"addToJSMap\",\n value: function addToJSMap(ctx, map) {\n var key = toJSON(this.key, '', ctx);\n\n if (map instanceof Map) {\n var value = toJSON(this.value, key, ctx);\n map.set(key, value);\n } else if (map instanceof Set) {\n map.add(key);\n } else {\n var stringKey = stringifyKey(this.key, key, ctx);\n\n var _value = toJSON(this.value, stringKey, ctx);\n\n if (stringKey in map) Object.defineProperty(map, stringKey, {\n value: _value,\n writable: true,\n enumerable: true,\n configurable: true\n });else map[stringKey] = _value;\n }\n\n return map;\n }\n }, {\n key: \"toJSON\",\n value: function toJSON(_, ctx) {\n var pair = ctx && ctx.mapAsMap ? new Map() : {};\n return this.addToJSMap(ctx, pair);\n }\n }, {\n key: \"toString\",\n value: function toString(ctx, onComment, onChompKeep) {\n if (!ctx || !ctx.doc) return JSON.stringify(this);\n var _ctx$doc$options = ctx.doc.options,\n indentSize = _ctx$doc$options.indent,\n indentSeq = _ctx$doc$options.indentSeq,\n simpleKeys = _ctx$doc$options.simpleKeys;\n var key = this.key,\n value = this.value;\n var keyComment = key instanceof Node && key.comment;\n\n if (simpleKeys) {\n if (keyComment) {\n throw new Error('With simple keys, key nodes cannot have comments');\n }\n\n if (key instanceof Collection) {\n var msg = 'With simple keys, collection cannot be used as a key value';\n throw new Error(msg);\n }\n }\n\n var explicitKey = !simpleKeys && (!key || keyComment || (key instanceof Node ? key instanceof Collection || key.type === Type.BLOCK_FOLDED || key.type === Type.BLOCK_LITERAL : _typeof(key) === 'object'));\n var _ctx = ctx,\n doc = _ctx.doc,\n indent = _ctx.indent,\n indentStep = _ctx.indentStep,\n stringify = _ctx.stringify;\n ctx = Object.assign({}, ctx, {\n implicitKey: !explicitKey,\n indent: indent + indentStep\n });\n var chompKeep = false;\n var str = stringify(key, ctx, function () {\n return keyComment = null;\n }, function () {\n return chompKeep = true;\n });\n str = addComment(str, ctx.indent, keyComment);\n\n if (!explicitKey && str.length > 1024) {\n if (simpleKeys) throw new Error('With simple keys, single line scalar must not span more than 1024 characters');\n explicitKey = true;\n }\n\n if (ctx.allNullValues && !simpleKeys) {\n if (this.comment) {\n str = addComment(str, ctx.indent, this.comment);\n if (onComment) onComment();\n } else if (chompKeep && !keyComment && onChompKeep) onChompKeep();\n\n return ctx.inFlow && !explicitKey ? str : \"? \".concat(str);\n }\n\n str = explicitKey ? \"? \".concat(str, \"\\n\").concat(indent, \":\") : \"\".concat(str, \":\");\n\n if (this.comment) {\n // expected (but not strictly required) to be a single-line comment\n str = addComment(str, ctx.indent, this.comment);\n if (onComment) onComment();\n }\n\n var vcb = '';\n var valueComment = null;\n\n if (value instanceof Node) {\n if (value.spaceBefore) vcb = '\\n';\n\n if (value.commentBefore) {\n var cs = value.commentBefore.replace(/^/gm, \"\".concat(ctx.indent, \"#\"));\n vcb += \"\\n\".concat(cs);\n }\n\n valueComment = value.comment;\n } else if (value && _typeof(value) === 'object') {\n value = doc.schema.createNode(value, true);\n }\n\n ctx.implicitKey = false;\n if (!explicitKey && !this.comment && value instanceof Scalar) ctx.indentAtStart = str.length + 1;\n chompKeep = false;\n\n if (!indentSeq && indentSize >= 2 && !ctx.inFlow && !explicitKey && value instanceof YAMLSeq && value.type !== Type.FLOW_SEQ && !value.tag && !doc.anchors.getName(value)) {\n // If indentSeq === false, consider '- ' as part of indentation where possible\n ctx.indent = ctx.indent.substr(2);\n }\n\n var valueStr = stringify(value, ctx, function () {\n return valueComment = null;\n }, function () {\n return chompKeep = true;\n });\n var ws = ' ';\n\n if (vcb || this.comment) {\n ws = \"\".concat(vcb, \"\\n\").concat(ctx.indent);\n } else if (!explicitKey && value instanceof Collection) {\n var flow = valueStr[0] === '[' || valueStr[0] === '{';\n if (!flow || valueStr.includes('\\n')) ws = \"\\n\".concat(ctx.indent);\n } else if (valueStr[0] === '\\n') ws = '';\n\n if (chompKeep && !valueComment && onChompKeep) onChompKeep();\n return addComment(str + ws + valueStr, ctx.indent, valueComment);\n }\n }]);\n\n return Pair;\n}(Node);\n\n_defineProperty(Pair, \"Type\", {\n PAIR: 'PAIR',\n MERGE_PAIR: 'MERGE_PAIR'\n});\n\nvar getAliasCount = function getAliasCount(node, anchors) {\n if (node instanceof Alias) {\n var anchor = anchors.get(node.source);\n return anchor.count * anchor.aliasCount;\n } else if (node instanceof Collection) {\n var count = 0;\n\n var _iterator = _createForOfIteratorHelper(node.items),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var item = _step.value;\n var c = getAliasCount(item, anchors);\n if (c > count) count = c;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return count;\n } else if (node instanceof Pair) {\n var kc = getAliasCount(node.key, anchors);\n var vc = getAliasCount(node.value, anchors);\n return Math.max(kc, vc);\n }\n\n return 1;\n};\n\nvar Alias = /*#__PURE__*/function (_Node) {\n _inherits(Alias, _Node);\n\n var _super = _createSuper(Alias);\n\n function Alias(source) {\n var _this;\n\n _classCallCheck(this, Alias);\n\n _this = _super.call(this);\n _this.source = source;\n _this.type = Type.ALIAS;\n return _this;\n }\n\n _createClass(Alias, [{\n key: \"tag\",\n set: function set(t) {\n throw new Error('Alias nodes cannot have tags');\n }\n }, {\n key: \"toJSON\",\n value: function toJSON$1(arg, ctx) {\n if (!ctx) return toJSON(this.source, arg, ctx);\n var anchors = ctx.anchors,\n maxAliasCount = ctx.maxAliasCount;\n var anchor = anchors.get(this.source);\n /* istanbul ignore if */\n\n if (!anchor || anchor.res === undefined) {\n var msg = 'This should not happen: Alias anchor was not resolved?';\n if (this.cstNode) throw new YAMLReferenceError(this.cstNode, msg);else throw new ReferenceError(msg);\n }\n\n if (maxAliasCount >= 0) {\n anchor.count += 1;\n if (anchor.aliasCount === 0) anchor.aliasCount = getAliasCount(this.source, anchors);\n\n if (anchor.count * anchor.aliasCount > maxAliasCount) {\n var _msg = 'Excessive alias count indicates a resource exhaustion attack';\n if (this.cstNode) throw new YAMLReferenceError(this.cstNode, _msg);else throw new ReferenceError(_msg);\n }\n }\n\n return anchor.res;\n } // Only called when stringifying an alias mapping key while constructing\n // Object output.\n\n }, {\n key: \"toString\",\n value: function toString(ctx) {\n return Alias.stringify(this, ctx);\n }\n }], [{\n key: \"stringify\",\n value: function stringify(_ref, _ref2) {\n var range = _ref.range,\n source = _ref.source;\n var anchors = _ref2.anchors,\n doc = _ref2.doc,\n implicitKey = _ref2.implicitKey,\n inStringifyKey = _ref2.inStringifyKey;\n var anchor = Object.keys(anchors).find(function (a) {\n return anchors[a] === source;\n });\n if (!anchor && inStringifyKey) anchor = doc.anchors.getName(source) || doc.anchors.newName();\n if (anchor) return \"*\".concat(anchor).concat(implicitKey ? ' ' : '');\n var msg = doc.anchors.getName(source) ? 'Alias node must be after source node' : 'Source node not found for alias node';\n throw new Error(\"\".concat(msg, \" [\").concat(range, \"]\"));\n }\n }]);\n\n return Alias;\n}(Node);\n\n_defineProperty(Alias, \"default\", true);\n\nfunction findPair(items, key) {\n var k = key instanceof Scalar ? key.value : key;\n\n var _iterator = _createForOfIteratorHelper(items),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var it = _step.value;\n\n if (it instanceof Pair) {\n if (it.key === key || it.key === k) return it;\n if (it.key && it.key.value === k) return it;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return undefined;\n}\nvar YAMLMap = /*#__PURE__*/function (_Collection) {\n _inherits(YAMLMap, _Collection);\n\n var _super = _createSuper(YAMLMap);\n\n function YAMLMap() {\n _classCallCheck(this, YAMLMap);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(YAMLMap, [{\n key: \"add\",\n value: function add(pair, overwrite) {\n if (!pair) pair = new Pair(pair);else if (!(pair instanceof Pair)) pair = new Pair(pair.key || pair, pair.value);\n var prev = findPair(this.items, pair.key);\n var sortEntries = this.schema && this.schema.sortMapEntries;\n\n if (prev) {\n if (overwrite) prev.value = pair.value;else throw new Error(\"Key \".concat(pair.key, \" already set\"));\n } else if (sortEntries) {\n var i = this.items.findIndex(function (item) {\n return sortEntries(pair, item) < 0;\n });\n if (i === -1) this.items.push(pair);else this.items.splice(i, 0, pair);\n } else {\n this.items.push(pair);\n }\n }\n }, {\n key: \"delete\",\n value: function _delete(key) {\n var it = findPair(this.items, key);\n if (!it) return false;\n var del = this.items.splice(this.items.indexOf(it), 1);\n return del.length > 0;\n }\n }, {\n key: \"get\",\n value: function get(key, keepScalar) {\n var it = findPair(this.items, key);\n var node = it && it.value;\n return !keepScalar && node instanceof Scalar ? node.value : node;\n }\n }, {\n key: \"has\",\n value: function has(key) {\n return !!findPair(this.items, key);\n }\n }, {\n key: \"set\",\n value: function set(key, value) {\n this.add(new Pair(key, value), true);\n }\n /**\n * @param {*} arg ignored\n * @param {*} ctx Conversion context, originally set in Document#toJSON()\n * @param {Class} Type If set, forces the returned collection type\n * @returns {*} Instance of Type, Map, or Object\n */\n\n }, {\n key: \"toJSON\",\n value: function toJSON(_, ctx, Type) {\n var map = Type ? new Type() : ctx && ctx.mapAsMap ? new Map() : {};\n if (ctx && ctx.onCreate) ctx.onCreate(map);\n\n var _iterator2 = _createForOfIteratorHelper(this.items),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var item = _step2.value;\n item.addToJSMap(ctx, map);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n return map;\n }\n }, {\n key: \"toString\",\n value: function toString(ctx, onComment, onChompKeep) {\n if (!ctx) return JSON.stringify(this);\n\n var _iterator3 = _createForOfIteratorHelper(this.items),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var item = _step3.value;\n if (!(item instanceof Pair)) throw new Error(\"Map items must all be pairs; found \".concat(JSON.stringify(item), \" instead\"));\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n return _get(_getPrototypeOf(YAMLMap.prototype), \"toString\", this).call(this, ctx, {\n blockItem: function blockItem(n) {\n return n.str;\n },\n flowChars: {\n start: '{',\n end: '}'\n },\n isMap: true,\n itemIndent: ctx.indent || ''\n }, onComment, onChompKeep);\n }\n }]);\n\n return YAMLMap;\n}(Collection);\n\nvar MERGE_KEY = '<<';\nvar Merge = /*#__PURE__*/function (_Pair) {\n _inherits(Merge, _Pair);\n\n var _super = _createSuper(Merge);\n\n function Merge(pair) {\n var _this;\n\n _classCallCheck(this, Merge);\n\n if (pair instanceof Pair) {\n var seq = pair.value;\n\n if (!(seq instanceof YAMLSeq)) {\n seq = new YAMLSeq();\n seq.items.push(pair.value);\n seq.range = pair.value.range;\n }\n\n _this = _super.call(this, pair.key, seq);\n _this.range = pair.range;\n } else {\n _this = _super.call(this, new Scalar(MERGE_KEY), new YAMLSeq());\n }\n\n _this.type = Pair.Type.MERGE_PAIR;\n return _possibleConstructorReturn(_this);\n } // If the value associated with a merge key is a single mapping node, each of\n // its key/value pairs is inserted into the current mapping, unless the key\n // already exists in it. If the value associated with the merge key is a\n // sequence, then this sequence is expected to contain mapping nodes and each\n // of these nodes is merged in turn according to its order in the sequence.\n // Keys in mapping nodes earlier in the sequence override keys specified in\n // later mapping nodes. -- http://yaml.org/type/merge.html\n\n\n _createClass(Merge, [{\n key: \"addToJSMap\",\n value: function addToJSMap(ctx, map) {\n var _iterator = _createForOfIteratorHelper(this.value.items),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var source = _step.value.source;\n if (!(source instanceof YAMLMap)) throw new Error('Merge sources must be maps');\n var srcMap = source.toJSON(null, ctx, Map);\n\n var _iterator2 = _createForOfIteratorHelper(srcMap),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _step2$value = _slicedToArray(_step2.value, 2),\n key = _step2$value[0],\n value = _step2$value[1];\n\n if (map instanceof Map) {\n if (!map.has(key)) map.set(key, value);\n } else if (map instanceof Set) {\n map.add(key);\n } else if (!Object.prototype.hasOwnProperty.call(map, key)) {\n Object.defineProperty(map, key, {\n value: value,\n writable: true,\n enumerable: true,\n configurable: true\n });\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return map;\n }\n }, {\n key: \"toString\",\n value: function toString(ctx, onComment) {\n var seq = this.value;\n if (seq.items.length > 1) return _get(_getPrototypeOf(Merge.prototype), \"toString\", this).call(this, ctx, onComment);\n this.value = seq.items[0];\n\n var str = _get(_getPrototypeOf(Merge.prototype), \"toString\", this).call(this, ctx, onComment);\n\n this.value = seq;\n return str;\n }\n }]);\n\n return Merge;\n}(Pair);\n\nvar binaryOptions = {\n defaultType: Type.BLOCK_LITERAL,\n lineWidth: 76\n};\nvar boolOptions = {\n trueStr: 'true',\n falseStr: 'false'\n};\nvar intOptions = {\n asBigInt: false\n};\nvar nullOptions = {\n nullStr: 'null'\n};\nvar strOptions = {\n defaultType: Type.PLAIN,\n doubleQuoted: {\n jsonEncoding: false,\n minMultiLineLength: 40\n },\n fold: {\n lineWidth: 80,\n minContentWidth: 20\n }\n};\n\nfunction resolveScalar(str, tags, scalarFallback) {\n var _iterator = _createForOfIteratorHelper(tags),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _step$value = _step.value,\n format = _step$value.format,\n test = _step$value.test,\n resolve = _step$value.resolve;\n\n if (test) {\n var match = str.match(test);\n\n if (match) {\n var res = resolve.apply(null, match);\n if (!(res instanceof Scalar)) res = new Scalar(res);\n if (format) res.format = format;\n return res;\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n if (scalarFallback) str = scalarFallback(str);\n return new Scalar(str);\n}\n\nvar FOLD_FLOW = 'flow';\nvar FOLD_BLOCK = 'block';\nvar FOLD_QUOTED = 'quoted'; // presumes i+1 is at the start of a line\n// returns index of last newline in more-indented block\n\nvar consumeMoreIndentedLines = function consumeMoreIndentedLines(text, i) {\n var ch = text[i + 1];\n\n while (ch === ' ' || ch === '\\t') {\n do {\n ch = text[i += 1];\n } while (ch && ch !== '\\n');\n\n ch = text[i + 1];\n }\n\n return i;\n};\n/**\n * Tries to keep input at up to `lineWidth` characters, splitting only on spaces\n * not followed by newlines or spaces unless `mode` is `'quoted'`. Lines are\n * terminated with `\\n` and started with `indent`.\n *\n * @param {string} text\n * @param {string} indent\n * @param {string} [mode='flow'] `'block'` prevents more-indented lines\n * from being folded; `'quoted'` allows for `\\` escapes, including escaped\n * newlines\n * @param {Object} options\n * @param {number} [options.indentAtStart] Accounts for leading contents on\n * the first line, defaulting to `indent.length`\n * @param {number} [options.lineWidth=80]\n * @param {number} [options.minContentWidth=20] Allow highly indented lines to\n * stretch the line width or indent content from the start\n * @param {function} options.onFold Called once if the text is folded\n * @param {function} options.onFold Called once if any line of text exceeds\n * lineWidth characters\n */\n\n\nfunction foldFlowLines(text, indent, mode, _ref) {\n var indentAtStart = _ref.indentAtStart,\n _ref$lineWidth = _ref.lineWidth,\n lineWidth = _ref$lineWidth === void 0 ? 80 : _ref$lineWidth,\n _ref$minContentWidth = _ref.minContentWidth,\n minContentWidth = _ref$minContentWidth === void 0 ? 20 : _ref$minContentWidth,\n onFold = _ref.onFold,\n onOverflow = _ref.onOverflow;\n if (!lineWidth || lineWidth < 0) return text;\n var endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);\n if (text.length <= endStep) return text;\n var folds = [];\n var escapedFolds = {};\n var end = lineWidth - indent.length;\n\n if (typeof indentAtStart === 'number') {\n if (indentAtStart > lineWidth - Math.max(2, minContentWidth)) folds.push(0);else end = lineWidth - indentAtStart;\n }\n\n var split = undefined;\n var prev = undefined;\n var overflow = false;\n var i = -1;\n var escStart = -1;\n var escEnd = -1;\n\n if (mode === FOLD_BLOCK) {\n i = consumeMoreIndentedLines(text, i);\n if (i !== -1) end = i + endStep;\n }\n\n for (var ch; ch = text[i += 1];) {\n if (mode === FOLD_QUOTED && ch === '\\\\') {\n escStart = i;\n\n switch (text[i + 1]) {\n case 'x':\n i += 3;\n break;\n\n case 'u':\n i += 5;\n break;\n\n case 'U':\n i += 9;\n break;\n\n default:\n i += 1;\n }\n\n escEnd = i;\n }\n\n if (ch === '\\n') {\n if (mode === FOLD_BLOCK) i = consumeMoreIndentedLines(text, i);\n end = i + endStep;\n split = undefined;\n } else {\n if (ch === ' ' && prev && prev !== ' ' && prev !== '\\n' && prev !== '\\t') {\n // space surrounded by non-space can be replaced with newline + indent\n var next = text[i + 1];\n if (next && next !== ' ' && next !== '\\n' && next !== '\\t') split = i;\n }\n\n if (i >= end) {\n if (split) {\n folds.push(split);\n end = split + endStep;\n split = undefined;\n } else if (mode === FOLD_QUOTED) {\n // white-space collected at end may stretch past lineWidth\n while (prev === ' ' || prev === '\\t') {\n prev = ch;\n ch = text[i += 1];\n overflow = true;\n } // Account for newline escape, but don't break preceding escape\n\n\n var j = i > escEnd + 1 ? i - 2 : escStart - 1; // Bail out if lineWidth & minContentWidth are shorter than an escape string\n\n if (escapedFolds[j]) return text;\n folds.push(j);\n escapedFolds[j] = true;\n end = j + endStep;\n split = undefined;\n } else {\n overflow = true;\n }\n }\n }\n\n prev = ch;\n }\n\n if (overflow && onOverflow) onOverflow();\n if (folds.length === 0) return text;\n if (onFold) onFold();\n var res = text.slice(0, folds[0]);\n\n for (var _i = 0; _i < folds.length; ++_i) {\n var fold = folds[_i];\n\n var _end = folds[_i + 1] || text.length;\n\n if (fold === 0) res = \"\\n\".concat(indent).concat(text.slice(0, _end));else {\n if (mode === FOLD_QUOTED && escapedFolds[fold]) res += \"\".concat(text[fold], \"\\\\\");\n res += \"\\n\".concat(indent).concat(text.slice(fold + 1, _end));\n }\n }\n\n return res;\n}\n\nvar getFoldOptions = function getFoldOptions(_ref) {\n var indentAtStart = _ref.indentAtStart;\n return indentAtStart ? Object.assign({\n indentAtStart: indentAtStart\n }, strOptions.fold) : strOptions.fold;\n}; // Also checks for lines starting with %, as parsing the output as YAML 1.1 will\n// presume that's starting a new document.\n\n\nvar containsDocumentMarker = function containsDocumentMarker(str) {\n return /^(%|---|\\.\\.\\.)/m.test(str);\n};\n\nfunction lineLengthOverLimit(str, lineWidth, indentLength) {\n if (!lineWidth || lineWidth < 0) return false;\n var limit = lineWidth - indentLength;\n var strLen = str.length;\n if (strLen <= limit) return false;\n\n for (var i = 0, start = 0; i < strLen; ++i) {\n if (str[i] === '\\n') {\n if (i - start > limit) return true;\n start = i + 1;\n if (strLen - start <= limit) return false;\n }\n }\n\n return true;\n}\n\nfunction doubleQuotedString(value, ctx) {\n var implicitKey = ctx.implicitKey;\n var _strOptions$doubleQuo = strOptions.doubleQuoted,\n jsonEncoding = _strOptions$doubleQuo.jsonEncoding,\n minMultiLineLength = _strOptions$doubleQuo.minMultiLineLength;\n var json = JSON.stringify(value);\n if (jsonEncoding) return json;\n var indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : '');\n var str = '';\n var start = 0;\n\n for (var i = 0, ch = json[i]; ch; ch = json[++i]) {\n if (ch === ' ' && json[i + 1] === '\\\\' && json[i + 2] === 'n') {\n // space before newline needs to be escaped to not be folded\n str += json.slice(start, i) + '\\\\ ';\n i += 1;\n start = i;\n ch = '\\\\';\n }\n\n if (ch === '\\\\') switch (json[i + 1]) {\n case 'u':\n {\n str += json.slice(start, i);\n var code = json.substr(i + 2, 4);\n\n switch (code) {\n case '0000':\n str += '\\\\0';\n break;\n\n case '0007':\n str += '\\\\a';\n break;\n\n case '000b':\n str += '\\\\v';\n break;\n\n case '001b':\n str += '\\\\e';\n break;\n\n case '0085':\n str += '\\\\N';\n break;\n\n case '00a0':\n str += '\\\\_';\n break;\n\n case '2028':\n str += '\\\\L';\n break;\n\n case '2029':\n str += '\\\\P';\n break;\n\n default:\n if (code.substr(0, 2) === '00') str += '\\\\x' + code.substr(2);else str += json.substr(i, 6);\n }\n\n i += 5;\n start = i + 1;\n }\n break;\n\n case 'n':\n if (implicitKey || json[i + 2] === '\"' || json.length < minMultiLineLength) {\n i += 1;\n } else {\n // folding will eat first newline\n str += json.slice(start, i) + '\\n\\n';\n\n while (json[i + 2] === '\\\\' && json[i + 3] === 'n' && json[i + 4] !== '\"') {\n str += '\\n';\n i += 2;\n }\n\n str += indent; // space after newline needs to be escaped to not be folded\n\n if (json[i + 2] === ' ') str += '\\\\';\n i += 1;\n start = i + 1;\n }\n\n break;\n\n default:\n i += 1;\n }\n }\n\n str = start ? str + json.slice(start) : json;\n return implicitKey ? str : foldFlowLines(str, indent, FOLD_QUOTED, getFoldOptions(ctx));\n}\n\nfunction singleQuotedString(value, ctx) {\n if (ctx.implicitKey) {\n if (/\\n/.test(value)) return doubleQuotedString(value, ctx);\n } else {\n // single quoted string can't have leading or trailing whitespace around newline\n if (/[ \\t]\\n|\\n[ \\t]/.test(value)) return doubleQuotedString(value, ctx);\n }\n\n var indent = ctx.indent || (containsDocumentMarker(value) ? ' ' : '');\n var res = \"'\" + value.replace(/'/g, \"''\").replace(/\\n+/g, \"$&\\n\".concat(indent)) + \"'\";\n return ctx.implicitKey ? res : foldFlowLines(res, indent, FOLD_FLOW, getFoldOptions(ctx));\n}\n\nfunction blockString(_ref2, ctx, onComment, onChompKeep) {\n var comment = _ref2.comment,\n type = _ref2.type,\n value = _ref2.value;\n\n // 1. Block can't end in whitespace unless the last line is non-empty.\n // 2. Strings consisting of only whitespace are best rendered explicitly.\n if (/\\n[\\t ]+$/.test(value) || /^\\s*$/.test(value)) {\n return doubleQuotedString(value, ctx);\n }\n\n var indent = ctx.indent || (ctx.forceBlockIndent || containsDocumentMarker(value) ? ' ' : '');\n var indentSize = indent ? '2' : '1'; // root is at -1\n\n var literal = type === Type.BLOCK_FOLDED ? false : type === Type.BLOCK_LITERAL ? true : !lineLengthOverLimit(value, strOptions.fold.lineWidth, indent.length);\n var header = literal ? '|' : '>';\n if (!value) return header + '\\n';\n var wsStart = '';\n var wsEnd = '';\n value = value.replace(/[\\n\\t ]*$/, function (ws) {\n var n = ws.indexOf('\\n');\n\n if (n === -1) {\n header += '-'; // strip\n } else if (value === ws || n !== ws.length - 1) {\n header += '+'; // keep\n\n if (onChompKeep) onChompKeep();\n }\n\n wsEnd = ws.replace(/\\n$/, '');\n return '';\n }).replace(/^[\\n ]*/, function (ws) {\n if (ws.indexOf(' ') !== -1) header += indentSize;\n var m = ws.match(/ +$/);\n\n if (m) {\n wsStart = ws.slice(0, -m[0].length);\n return m[0];\n } else {\n wsStart = ws;\n return '';\n }\n });\n if (wsEnd) wsEnd = wsEnd.replace(/\\n+(?!\\n|$)/g, \"$&\".concat(indent));\n if (wsStart) wsStart = wsStart.replace(/\\n+/g, \"$&\".concat(indent));\n\n if (comment) {\n header += ' #' + comment.replace(/ ?[\\r\\n]+/g, ' ');\n if (onComment) onComment();\n }\n\n if (!value) return \"\".concat(header).concat(indentSize, \"\\n\").concat(indent).concat(wsEnd);\n\n if (literal) {\n value = value.replace(/\\n+/g, \"$&\".concat(indent));\n return \"\".concat(header, \"\\n\").concat(indent).concat(wsStart).concat(value).concat(wsEnd);\n }\n\n value = value.replace(/\\n+/g, '\\n$&').replace(/(?:^|\\n)([\\t ].*)(?:([\\n\\t ]*)\\n(?![\\n\\t ]))?/g, '$1$2') // more-indented lines aren't folded\n // ^ ind.line ^ empty ^ capture next empty lines only at end of indent\n .replace(/\\n+/g, \"$&\".concat(indent));\n var body = foldFlowLines(\"\".concat(wsStart).concat(value).concat(wsEnd), indent, FOLD_BLOCK, strOptions.fold);\n return \"\".concat(header, \"\\n\").concat(indent).concat(body);\n}\n\nfunction plainString(item, ctx, onComment, onChompKeep) {\n var comment = item.comment,\n type = item.type,\n value = item.value;\n var actualString = ctx.actualString,\n implicitKey = ctx.implicitKey,\n indent = ctx.indent,\n inFlow = ctx.inFlow;\n\n if (implicitKey && /[\\n[\\]{},]/.test(value) || inFlow && /[[\\]{},]/.test(value)) {\n return doubleQuotedString(value, ctx);\n }\n\n if (!value || /^[\\n\\t ,[\\]{}#&*!|>'\"%@`]|^[?-]$|^[?-][ \\t]|[\\n:][ \\t]|[ \\t]\\n|[\\n\\t ]#|[\\n\\t :]$/.test(value)) {\n // not allowed:\n // - empty string, '-' or '?'\n // - start with an indicator character (except [?:-]) or /[?-] /\n // - '\\n ', ': ' or ' \\n' anywhere\n // - '#' not preceded by a non-space char\n // - end with ' ' or ':'\n return implicitKey || inFlow || value.indexOf('\\n') === -1 ? value.indexOf('\"') !== -1 && value.indexOf(\"'\") === -1 ? singleQuotedString(value, ctx) : doubleQuotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep);\n }\n\n if (!implicitKey && !inFlow && type !== Type.PLAIN && value.indexOf('\\n') !== -1) {\n // Where allowed & type not set explicitly, prefer block style for multiline strings\n return blockString(item, ctx, onComment, onChompKeep);\n }\n\n if (indent === '' && containsDocumentMarker(value)) {\n ctx.forceBlockIndent = true;\n return blockString(item, ctx, onComment, onChompKeep);\n }\n\n var str = value.replace(/\\n+/g, \"$&\\n\".concat(indent)); // Verify that output will be parsed as a string, as e.g. plain numbers and\n // booleans get parsed with those types in v1.2 (e.g. '42', 'true' & '0.9e-3'),\n // and others in v1.1.\n\n if (actualString) {\n var tags = ctx.doc.schema.tags;\n var resolved = resolveScalar(str, tags, tags.scalarFallback).value;\n if (typeof resolved !== 'string') return doubleQuotedString(value, ctx);\n }\n\n var body = implicitKey ? str : foldFlowLines(str, indent, FOLD_FLOW, getFoldOptions(ctx));\n\n if (comment && !inFlow && (body.indexOf('\\n') !== -1 || comment.indexOf('\\n') !== -1)) {\n if (onComment) onComment();\n return addCommentBefore(body, indent, comment);\n }\n\n return body;\n}\n\nfunction stringifyString(item, ctx, onComment, onChompKeep) {\n var defaultType = strOptions.defaultType;\n var implicitKey = ctx.implicitKey,\n inFlow = ctx.inFlow;\n var _item = item,\n type = _item.type,\n value = _item.value;\n\n if (typeof value !== 'string') {\n value = String(value);\n item = Object.assign({}, item, {\n value: value\n });\n }\n\n var _stringify = function _stringify(_type) {\n switch (_type) {\n case Type.BLOCK_FOLDED:\n case Type.BLOCK_LITERAL:\n return blockString(item, ctx, onComment, onChompKeep);\n\n case Type.QUOTE_DOUBLE:\n return doubleQuotedString(value, ctx);\n\n case Type.QUOTE_SINGLE:\n return singleQuotedString(value, ctx);\n\n case Type.PLAIN:\n return plainString(item, ctx, onComment, onChompKeep);\n\n default:\n return null;\n }\n };\n\n if (type !== Type.QUOTE_DOUBLE && /[\\x00-\\x08\\x0b-\\x1f\\x7f-\\x9f]/.test(value)) {\n // force double quotes on control characters\n type = Type.QUOTE_DOUBLE;\n } else if ((implicitKey || inFlow) && (type === Type.BLOCK_FOLDED || type === Type.BLOCK_LITERAL)) {\n // should not happen; blocks are not valid inside flow containers\n type = Type.QUOTE_DOUBLE;\n }\n\n var res = _stringify(type);\n\n if (res === null) {\n res = _stringify(defaultType);\n if (res === null) throw new Error(\"Unsupported default string type \".concat(defaultType));\n }\n\n return res;\n}\n\nfunction stringifyNumber(_ref) {\n var format = _ref.format,\n minFractionDigits = _ref.minFractionDigits,\n tag = _ref.tag,\n value = _ref.value;\n if (typeof value === 'bigint') return String(value);\n if (!isFinite(value)) return isNaN(value) ? '.nan' : value < 0 ? '-.inf' : '.inf';\n var n = JSON.stringify(value);\n\n if (!format && minFractionDigits && (!tag || tag === 'tag:yaml.org,2002:float') && /^\\d/.test(n)) {\n var i = n.indexOf('.');\n\n if (i < 0) {\n i = n.length;\n n += '.';\n }\n\n var d = minFractionDigits - (n.length - i - 1);\n\n while (d-- > 0) {\n n += '0';\n }\n }\n\n return n;\n}\n\nfunction checkFlowCollectionEnd(errors, cst) {\n var char, name;\n\n switch (cst.type) {\n case Type.FLOW_MAP:\n char = '}';\n name = 'flow map';\n break;\n\n case Type.FLOW_SEQ:\n char = ']';\n name = 'flow sequence';\n break;\n\n default:\n errors.push(new YAMLSemanticError(cst, 'Not a flow collection!?'));\n return;\n }\n\n var lastItem;\n\n for (var i = cst.items.length - 1; i >= 0; --i) {\n var item = cst.items[i];\n\n if (!item || item.type !== Type.COMMENT) {\n lastItem = item;\n break;\n }\n }\n\n if (lastItem && lastItem.char !== char) {\n var msg = \"Expected \".concat(name, \" to end with \").concat(char);\n var err;\n\n if (typeof lastItem.offset === 'number') {\n err = new YAMLSemanticError(cst, msg);\n err.offset = lastItem.offset + 1;\n } else {\n err = new YAMLSemanticError(lastItem, msg);\n if (lastItem.range && lastItem.range.end) err.offset = lastItem.range.end - lastItem.range.start;\n }\n\n errors.push(err);\n }\n}\nfunction checkFlowCommentSpace(errors, comment) {\n var prev = comment.context.src[comment.range.start - 1];\n\n if (prev !== '\\n' && prev !== '\\t' && prev !== ' ') {\n var msg = 'Comments must be separated from other tokens by white space characters';\n errors.push(new YAMLSemanticError(comment, msg));\n }\n}\nfunction getLongKeyError(source, key) {\n var sk = String(key);\n var k = sk.substr(0, 8) + '...' + sk.substr(-8);\n return new YAMLSemanticError(source, \"The \\\"\".concat(k, \"\\\" key is too long\"));\n}\nfunction resolveComments(collection, comments) {\n var _iterator = _createForOfIteratorHelper(comments),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _step$value = _step.value,\n afterKey = _step$value.afterKey,\n before = _step$value.before,\n comment = _step$value.comment;\n var item = collection.items[before];\n\n if (!item) {\n if (comment !== undefined) {\n if (collection.comment) collection.comment += '\\n' + comment;else collection.comment = comment;\n }\n } else {\n if (afterKey && item.value) item = item.value;\n\n if (comment === undefined) {\n if (afterKey || !item.commentBefore) item.spaceBefore = true;\n } else {\n if (item.commentBefore) item.commentBefore += '\\n' + comment;else item.commentBefore = comment;\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n}\n\n// on error, will return { str: string, errors: Error[] }\nfunction resolveString(doc, node) {\n var res = node.strValue;\n if (!res) return '';\n if (typeof res === 'string') return res;\n res.errors.forEach(function (error) {\n if (!error.source) error.source = node;\n doc.errors.push(error);\n });\n return res.str;\n}\n\nfunction resolveTagHandle(doc, node) {\n var _node$tag = node.tag,\n handle = _node$tag.handle,\n suffix = _node$tag.suffix;\n var prefix = doc.tagPrefixes.find(function (p) {\n return p.handle === handle;\n });\n\n if (!prefix) {\n var dtp = doc.getDefaults().tagPrefixes;\n if (dtp) prefix = dtp.find(function (p) {\n return p.handle === handle;\n });\n if (!prefix) throw new YAMLSemanticError(node, \"The \".concat(handle, \" tag handle is non-default and was not declared.\"));\n }\n\n if (!suffix) throw new YAMLSemanticError(node, \"The \".concat(handle, \" tag has no suffix.\"));\n\n if (handle === '!' && (doc.version || doc.options.version) === '1.0') {\n if (suffix[0] === '^') {\n doc.warnings.push(new YAMLWarning(node, 'YAML 1.0 ^ tag expansion is not supported'));\n return suffix;\n }\n\n if (/[:/]/.test(suffix)) {\n // word/foo -> tag:word.yaml.org,2002:foo\n var vocab = suffix.match(/^([a-z0-9-]+)\\/(.*)/i);\n return vocab ? \"tag:\".concat(vocab[1], \".yaml.org,2002:\").concat(vocab[2]) : \"tag:\".concat(suffix);\n }\n }\n\n return prefix.prefix + decodeURIComponent(suffix);\n}\n\nfunction resolveTagName(doc, node) {\n var tag = node.tag,\n type = node.type;\n var nonSpecific = false;\n\n if (tag) {\n var handle = tag.handle,\n suffix = tag.suffix,\n verbatim = tag.verbatim;\n\n if (verbatim) {\n if (verbatim !== '!' && verbatim !== '!!') return verbatim;\n var msg = \"Verbatim tags aren't resolved, so \".concat(verbatim, \" is invalid.\");\n doc.errors.push(new YAMLSemanticError(node, msg));\n } else if (handle === '!' && !suffix) {\n nonSpecific = true;\n } else {\n try {\n return resolveTagHandle(doc, node);\n } catch (error) {\n doc.errors.push(error);\n }\n }\n }\n\n switch (type) {\n case Type.BLOCK_FOLDED:\n case Type.BLOCK_LITERAL:\n case Type.QUOTE_DOUBLE:\n case Type.QUOTE_SINGLE:\n return defaultTags.STR;\n\n case Type.FLOW_MAP:\n case Type.MAP:\n return defaultTags.MAP;\n\n case Type.FLOW_SEQ:\n case Type.SEQ:\n return defaultTags.SEQ;\n\n case Type.PLAIN:\n return nonSpecific ? defaultTags.STR : null;\n\n default:\n return null;\n }\n}\n\nfunction resolveByTagName(doc, node, tagName) {\n var tags = doc.schema.tags;\n var matchWithTest = [];\n\n var _iterator = _createForOfIteratorHelper(tags),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var tag = _step.value;\n\n if (tag.tag === tagName) {\n if (tag.test) matchWithTest.push(tag);else {\n var res = tag.resolve(doc, node);\n return res instanceof Collection ? res : new Scalar(res);\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n var str = resolveString(doc, node);\n if (typeof str === 'string' && matchWithTest.length > 0) return resolveScalar(str, matchWithTest, tags.scalarFallback);\n return null;\n}\n\nfunction getFallbackTagName(_ref) {\n var type = _ref.type;\n\n switch (type) {\n case Type.FLOW_MAP:\n case Type.MAP:\n return defaultTags.MAP;\n\n case Type.FLOW_SEQ:\n case Type.SEQ:\n return defaultTags.SEQ;\n\n default:\n return defaultTags.STR;\n }\n}\n\nfunction resolveTag(doc, node, tagName) {\n try {\n var res = resolveByTagName(doc, node, tagName);\n\n if (res) {\n if (tagName && node.tag) res.tag = tagName;\n return res;\n }\n } catch (error) {\n /* istanbul ignore if */\n if (!error.source) error.source = node;\n doc.errors.push(error);\n return null;\n }\n\n try {\n var fallback = getFallbackTagName(node);\n if (!fallback) throw new Error(\"The tag \".concat(tagName, \" is unavailable\"));\n var msg = \"The tag \".concat(tagName, \" is unavailable, falling back to \").concat(fallback);\n doc.warnings.push(new YAMLWarning(node, msg));\n\n var _res = resolveByTagName(doc, node, fallback);\n\n _res.tag = tagName;\n return _res;\n } catch (error) {\n var refError = new YAMLReferenceError(node, error.message);\n refError.stack = error.stack;\n doc.errors.push(refError);\n return null;\n }\n}\n\nvar isCollectionItem = function isCollectionItem(node) {\n if (!node) return false;\n var type = node.type;\n return type === Type.MAP_KEY || type === Type.MAP_VALUE || type === Type.SEQ_ITEM;\n};\n\nfunction resolveNodeProps(errors, node) {\n var comments = {\n before: [],\n after: []\n };\n var hasAnchor = false;\n var hasTag = false;\n var props = isCollectionItem(node.context.parent) ? node.context.parent.props.concat(node.props) : node.props;\n\n var _iterator = _createForOfIteratorHelper(props),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _step$value = _step.value,\n start = _step$value.start,\n end = _step$value.end;\n\n switch (node.context.src[start]) {\n case Char.COMMENT:\n {\n if (!node.commentHasRequiredWhitespace(start)) {\n var msg = 'Comments must be separated from other tokens by white space characters';\n errors.push(new YAMLSemanticError(node, msg));\n }\n\n var header = node.header,\n valueRange = node.valueRange;\n var cc = valueRange && (start > valueRange.start || header && start > header.start) ? comments.after : comments.before;\n cc.push(node.context.src.slice(start + 1, end));\n break;\n }\n // Actual anchor & tag resolution is handled by schema, here we just complain\n\n case Char.ANCHOR:\n if (hasAnchor) {\n var _msg = 'A node can have at most one anchor';\n errors.push(new YAMLSemanticError(node, _msg));\n }\n\n hasAnchor = true;\n break;\n\n case Char.TAG:\n if (hasTag) {\n var _msg2 = 'A node can have at most one tag';\n errors.push(new YAMLSemanticError(node, _msg2));\n }\n\n hasTag = true;\n break;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return {\n comments: comments,\n hasAnchor: hasAnchor,\n hasTag: hasTag\n };\n}\n\nfunction resolveNodeValue(doc, node) {\n var anchors = doc.anchors,\n errors = doc.errors,\n schema = doc.schema;\n\n if (node.type === Type.ALIAS) {\n var name = node.rawValue;\n var src = anchors.getNode(name);\n\n if (!src) {\n var msg = \"Aliased anchor not found: \".concat(name);\n errors.push(new YAMLReferenceError(node, msg));\n return null;\n } // Lazy resolution for circular references\n\n\n var res = new Alias(src);\n\n anchors._cstAliases.push(res);\n\n return res;\n }\n\n var tagName = resolveTagName(doc, node);\n if (tagName) return resolveTag(doc, node, tagName);\n\n if (node.type !== Type.PLAIN) {\n var _msg3 = \"Failed to resolve \".concat(node.type, \" node here\");\n\n errors.push(new YAMLSyntaxError(node, _msg3));\n return null;\n }\n\n try {\n var str = resolveString(doc, node);\n return resolveScalar(str, schema.tags, schema.tags.scalarFallback);\n } catch (error) {\n if (!error.source) error.source = node;\n errors.push(error);\n return null;\n }\n} // sets node.resolved on success\n\n\nfunction resolveNode(doc, node) {\n if (!node) return null;\n if (node.error) doc.errors.push(node.error);\n\n var _resolveNodeProps = resolveNodeProps(doc.errors, node),\n comments = _resolveNodeProps.comments,\n hasAnchor = _resolveNodeProps.hasAnchor,\n hasTag = _resolveNodeProps.hasTag;\n\n if (hasAnchor) {\n var anchors = doc.anchors;\n var name = node.anchor;\n var prev = anchors.getNode(name); // At this point, aliases for any preceding node with the same anchor\n // name have already been resolved, so it may safely be renamed.\n\n if (prev) anchors.map[anchors.newName(name)] = prev; // During parsing, we need to store the CST node in anchors.map as\n // anchors need to be available during resolution to allow for\n // circular references.\n\n anchors.map[name] = node;\n }\n\n if (node.type === Type.ALIAS && (hasAnchor || hasTag)) {\n var msg = 'An alias node must not specify any properties';\n doc.errors.push(new YAMLSemanticError(node, msg));\n }\n\n var res = resolveNodeValue(doc, node);\n\n if (res) {\n res.range = [node.range.start, node.range.end];\n if (doc.options.keepCstNodes) res.cstNode = node;\n if (doc.options.keepNodeTypes) res.type = node.type;\n var cb = comments.before.join('\\n');\n\n if (cb) {\n res.commentBefore = res.commentBefore ? \"\".concat(res.commentBefore, \"\\n\").concat(cb) : cb;\n }\n\n var ca = comments.after.join('\\n');\n if (ca) res.comment = res.comment ? \"\".concat(res.comment, \"\\n\").concat(ca) : ca;\n }\n\n return node.resolved = res;\n}\n\nfunction resolveMap(doc, cst) {\n if (cst.type !== Type.MAP && cst.type !== Type.FLOW_MAP) {\n var msg = \"A \".concat(cst.type, \" node cannot be resolved as a mapping\");\n doc.errors.push(new YAMLSyntaxError(cst, msg));\n return null;\n }\n\n var _ref = cst.type === Type.FLOW_MAP ? resolveFlowMapItems(doc, cst) : resolveBlockMapItems(doc, cst),\n comments = _ref.comments,\n items = _ref.items;\n\n var map = new YAMLMap();\n map.items = items;\n resolveComments(map, comments);\n var hasCollectionKey = false;\n\n for (var i = 0; i < items.length; ++i) {\n var iKey = items[i].key;\n if (iKey instanceof Collection) hasCollectionKey = true;\n\n if (doc.schema.merge && iKey && iKey.value === MERGE_KEY) {\n items[i] = new Merge(items[i]);\n var sources = items[i].value.items;\n var error = null;\n sources.some(function (node) {\n if (node instanceof Alias) {\n // During parsing, alias sources are CST nodes; to account for\n // circular references their resolved values can't be used here.\n var type = node.source.type;\n if (type === Type.MAP || type === Type.FLOW_MAP) return false;\n return error = 'Merge nodes aliases can only point to maps';\n }\n\n return error = 'Merge nodes can only have Alias nodes as values';\n });\n if (error) doc.errors.push(new YAMLSemanticError(cst, error));\n } else {\n for (var j = i + 1; j < items.length; ++j) {\n var jKey = items[j].key;\n\n if (iKey === jKey || iKey && jKey && Object.prototype.hasOwnProperty.call(iKey, 'value') && iKey.value === jKey.value) {\n var _msg = \"Map keys must be unique; \\\"\".concat(iKey, \"\\\" is repeated\");\n\n doc.errors.push(new YAMLSemanticError(cst, _msg));\n break;\n }\n }\n }\n }\n\n if (hasCollectionKey && !doc.options.mapAsMap) {\n var warn = 'Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.';\n doc.warnings.push(new YAMLWarning(cst, warn));\n }\n\n cst.resolved = map;\n return map;\n}\n\nvar valueHasPairComment = function valueHasPairComment(_ref2) {\n var _ref2$context = _ref2.context,\n lineStart = _ref2$context.lineStart,\n node = _ref2$context.node,\n src = _ref2$context.src,\n props = _ref2.props;\n if (props.length === 0) return false;\n var start = props[0].start;\n if (node && start > node.valueRange.start) return false;\n if (src[start] !== Char.COMMENT) return false;\n\n for (var i = lineStart; i < start; ++i) {\n if (src[i] === '\\n') return false;\n }\n\n return true;\n};\n\nfunction resolvePairComment(item, pair) {\n if (!valueHasPairComment(item)) return;\n var comment = item.getPropValue(0, Char.COMMENT, true);\n var found = false;\n var cb = pair.value.commentBefore;\n\n if (cb && cb.startsWith(comment)) {\n pair.value.commentBefore = cb.substr(comment.length + 1);\n found = true;\n } else {\n var cc = pair.value.comment;\n\n if (!item.node && cc && cc.startsWith(comment)) {\n pair.value.comment = cc.substr(comment.length + 1);\n found = true;\n }\n }\n\n if (found) pair.comment = comment;\n}\n\nfunction resolveBlockMapItems(doc, cst) {\n var comments = [];\n var items = [];\n var key = undefined;\n var keyStart = null;\n\n for (var i = 0; i < cst.items.length; ++i) {\n var item = cst.items[i];\n\n switch (item.type) {\n case Type.BLANK_LINE:\n comments.push({\n afterKey: !!key,\n before: items.length\n });\n break;\n\n case Type.COMMENT:\n comments.push({\n afterKey: !!key,\n before: items.length,\n comment: item.comment\n });\n break;\n\n case Type.MAP_KEY:\n if (key !== undefined) items.push(new Pair(key));\n if (item.error) doc.errors.push(item.error);\n key = resolveNode(doc, item.node);\n keyStart = null;\n break;\n\n case Type.MAP_VALUE:\n {\n if (key === undefined) key = null;\n if (item.error) doc.errors.push(item.error);\n\n if (!item.context.atLineStart && item.node && item.node.type === Type.MAP && !item.node.context.atLineStart) {\n var msg = 'Nested mappings are not allowed in compact mappings';\n doc.errors.push(new YAMLSemanticError(item.node, msg));\n }\n\n var valueNode = item.node;\n\n if (!valueNode && item.props.length > 0) {\n // Comments on an empty mapping value need to be preserved, so we\n // need to construct a minimal empty node here to use instead of the\n // missing `item.node`. -- eemeli/yaml#19\n valueNode = new PlainValue(Type.PLAIN, []);\n valueNode.context = {\n parent: item,\n src: item.context.src\n };\n var pos = item.range.start + 1;\n valueNode.range = {\n start: pos,\n end: pos\n };\n valueNode.valueRange = {\n start: pos,\n end: pos\n };\n\n if (typeof item.range.origStart === 'number') {\n var origPos = item.range.origStart + 1;\n valueNode.range.origStart = valueNode.range.origEnd = origPos;\n valueNode.valueRange.origStart = valueNode.valueRange.origEnd = origPos;\n }\n }\n\n var pair = new Pair(key, resolveNode(doc, valueNode));\n resolvePairComment(item, pair);\n items.push(pair);\n\n if (key && typeof keyStart === 'number') {\n if (item.range.start > keyStart + 1024) doc.errors.push(getLongKeyError(cst, key));\n }\n\n key = undefined;\n keyStart = null;\n }\n break;\n\n default:\n if (key !== undefined) items.push(new Pair(key));\n key = resolveNode(doc, item);\n keyStart = item.range.start;\n if (item.error) doc.errors.push(item.error);\n\n next: for (var j = i + 1;; ++j) {\n var nextItem = cst.items[j];\n\n switch (nextItem && nextItem.type) {\n case Type.BLANK_LINE:\n case Type.COMMENT:\n continue next;\n\n case Type.MAP_VALUE:\n break next;\n\n default:\n {\n var _msg2 = 'Implicit map keys need to be followed by map values';\n doc.errors.push(new YAMLSemanticError(item, _msg2));\n break next;\n }\n }\n }\n\n if (item.valueRangeContainsNewline) {\n var _msg3 = 'Implicit map keys need to be on a single line';\n doc.errors.push(new YAMLSemanticError(item, _msg3));\n }\n\n }\n }\n\n if (key !== undefined) items.push(new Pair(key));\n return {\n comments: comments,\n items: items\n };\n}\n\nfunction resolveFlowMapItems(doc, cst) {\n var comments = [];\n var items = [];\n var key = undefined;\n var explicitKey = false;\n var next = '{';\n\n for (var i = 0; i < cst.items.length; ++i) {\n var item = cst.items[i];\n\n if (typeof item.char === 'string') {\n var char = item.char,\n offset = item.offset;\n\n if (char === '?' && key === undefined && !explicitKey) {\n explicitKey = true;\n next = ':';\n continue;\n }\n\n if (char === ':') {\n if (key === undefined) key = null;\n\n if (next === ':') {\n next = ',';\n continue;\n }\n } else {\n if (explicitKey) {\n if (key === undefined && char !== ',') key = null;\n explicitKey = false;\n }\n\n if (key !== undefined) {\n items.push(new Pair(key));\n key = undefined;\n\n if (char === ',') {\n next = ':';\n continue;\n }\n }\n }\n\n if (char === '}') {\n if (i === cst.items.length - 1) continue;\n } else if (char === next) {\n next = ':';\n continue;\n }\n\n var msg = \"Flow map contains an unexpected \".concat(char);\n var err = new YAMLSyntaxError(cst, msg);\n err.offset = offset;\n doc.errors.push(err);\n } else if (item.type === Type.BLANK_LINE) {\n comments.push({\n afterKey: !!key,\n before: items.length\n });\n } else if (item.type === Type.COMMENT) {\n checkFlowCommentSpace(doc.errors, item);\n comments.push({\n afterKey: !!key,\n before: items.length,\n comment: item.comment\n });\n } else if (key === undefined) {\n if (next === ',') doc.errors.push(new YAMLSemanticError(item, 'Separator , missing in flow map'));\n key = resolveNode(doc, item);\n } else {\n if (next !== ',') doc.errors.push(new YAMLSemanticError(item, 'Indicator : missing in flow map entry'));\n items.push(new Pair(key, resolveNode(doc, item)));\n key = undefined;\n explicitKey = false;\n }\n }\n\n checkFlowCollectionEnd(doc.errors, cst);\n if (key !== undefined) items.push(new Pair(key));\n return {\n comments: comments,\n items: items\n };\n}\n\nfunction resolveSeq(doc, cst) {\n if (cst.type !== Type.SEQ && cst.type !== Type.FLOW_SEQ) {\n var msg = \"A \".concat(cst.type, \" node cannot be resolved as a sequence\");\n doc.errors.push(new YAMLSyntaxError(cst, msg));\n return null;\n }\n\n var _ref = cst.type === Type.FLOW_SEQ ? resolveFlowSeqItems(doc, cst) : resolveBlockSeqItems(doc, cst),\n comments = _ref.comments,\n items = _ref.items;\n\n var seq = new YAMLSeq();\n seq.items = items;\n resolveComments(seq, comments);\n\n if (!doc.options.mapAsMap && items.some(function (it) {\n return it instanceof Pair && it.key instanceof Collection;\n })) {\n var warn = 'Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.';\n doc.warnings.push(new YAMLWarning(cst, warn));\n }\n\n cst.resolved = seq;\n return seq;\n}\n\nfunction resolveBlockSeqItems(doc, cst) {\n var comments = [];\n var items = [];\n\n for (var i = 0; i < cst.items.length; ++i) {\n var item = cst.items[i];\n\n switch (item.type) {\n case Type.BLANK_LINE:\n comments.push({\n before: items.length\n });\n break;\n\n case Type.COMMENT:\n comments.push({\n comment: item.comment,\n before: items.length\n });\n break;\n\n case Type.SEQ_ITEM:\n if (item.error) doc.errors.push(item.error);\n items.push(resolveNode(doc, item.node));\n\n if (item.hasProps) {\n var msg = 'Sequence items cannot have tags or anchors before the - indicator';\n doc.errors.push(new YAMLSemanticError(item, msg));\n }\n\n break;\n\n default:\n if (item.error) doc.errors.push(item.error);\n doc.errors.push(new YAMLSyntaxError(item, \"Unexpected \".concat(item.type, \" node in sequence\")));\n }\n }\n\n return {\n comments: comments,\n items: items\n };\n}\n\nfunction resolveFlowSeqItems(doc, cst) {\n var comments = [];\n var items = [];\n var explicitKey = false;\n var key = undefined;\n var keyStart = null;\n var next = '[';\n var prevItem = null;\n\n for (var i = 0; i < cst.items.length; ++i) {\n var item = cst.items[i];\n\n if (typeof item.char === 'string') {\n var char = item.char,\n offset = item.offset;\n\n if (char !== ':' && (explicitKey || key !== undefined)) {\n if (explicitKey && key === undefined) key = next ? items.pop() : null;\n items.push(new Pair(key));\n explicitKey = false;\n key = undefined;\n keyStart = null;\n }\n\n if (char === next) {\n next = null;\n } else if (!next && char === '?') {\n explicitKey = true;\n } else if (next !== '[' && char === ':' && key === undefined) {\n if (next === ',') {\n key = items.pop();\n\n if (key instanceof Pair) {\n var msg = 'Chaining flow sequence pairs is invalid';\n var err = new YAMLSemanticError(cst, msg);\n err.offset = offset;\n doc.errors.push(err);\n }\n\n if (!explicitKey && typeof keyStart === 'number') {\n var keyEnd = item.range ? item.range.start : item.offset;\n if (keyEnd > keyStart + 1024) doc.errors.push(getLongKeyError(cst, key));\n var src = prevItem.context.src;\n\n for (var _i = keyStart; _i < keyEnd; ++_i) {\n if (src[_i] === '\\n') {\n var _msg = 'Implicit keys of flow sequence pairs need to be on a single line';\n doc.errors.push(new YAMLSemanticError(prevItem, _msg));\n break;\n }\n }\n }\n } else {\n key = null;\n }\n\n keyStart = null;\n explicitKey = false;\n next = null;\n } else if (next === '[' || char !== ']' || i < cst.items.length - 1) {\n var _msg2 = \"Flow sequence contains an unexpected \".concat(char);\n\n var _err = new YAMLSyntaxError(cst, _msg2);\n\n _err.offset = offset;\n doc.errors.push(_err);\n }\n } else if (item.type === Type.BLANK_LINE) {\n comments.push({\n before: items.length\n });\n } else if (item.type === Type.COMMENT) {\n checkFlowCommentSpace(doc.errors, item);\n comments.push({\n comment: item.comment,\n before: items.length\n });\n } else {\n if (next) {\n var _msg3 = \"Expected a \".concat(next, \" in flow sequence\");\n\n doc.errors.push(new YAMLSemanticError(item, _msg3));\n }\n\n var value = resolveNode(doc, item);\n\n if (key === undefined) {\n items.push(value);\n prevItem = item;\n } else {\n items.push(new Pair(key, value));\n key = undefined;\n }\n\n keyStart = item.range.start;\n next = ',';\n }\n }\n\n checkFlowCollectionEnd(doc.errors, cst);\n if (key !== undefined) items.push(new Pair(key));\n return {\n comments: comments,\n items: items\n };\n}\n\nexport { Alias as A, Collection as C, Merge as M, Node as N, Pair as P, Scalar as S, YAMLSeq as Y, boolOptions as a, binaryOptions as b, stringifyString as c, YAMLMap as d, isEmptyPath as e, addComment as f, resolveMap as g, resolveSeq as h, intOptions as i, resolveString as j, stringifyNumber as k, findPair as l, nullOptions as n, resolveNode as r, strOptions as s, toJSON as t };\n","import { o as YAMLReferenceError, T as Type, g as YAMLSemanticError, _ as _createForOfIteratorHelper, e as _defineProperty, j as _inherits, k as _createSuper, c as _classCallCheck, p as _assertThisInitialized, b as _createClass, a as _typeof, l as _get, m as _getPrototypeOf } from './PlainValue-b8036b75.js';\nimport { j as resolveString, b as binaryOptions, c as stringifyString, h as resolveSeq, P as Pair, d as YAMLMap, Y as YAMLSeq, t as toJSON, S as Scalar, l as findPair, g as resolveMap, k as stringifyNumber } from './resolveSeq-492ab440.js';\n\n/* global atob, btoa, Buffer */\nvar binary = {\n identify: function identify(value) {\n return value instanceof Uint8Array;\n },\n // Buffer inherits from Uint8Array\n default: false,\n tag: 'tag:yaml.org,2002:binary',\n\n /**\n * Returns a Buffer in node and an Uint8Array in browsers\n *\n * To use the resulting buffer as an image, you'll want to do something like:\n *\n * const blob = new Blob([buffer], { type: 'image/jpeg' })\n * document.querySelector('#photo').src = URL.createObjectURL(blob)\n */\n resolve: function resolve(doc, node) {\n var src = resolveString(doc, node);\n\n if (typeof Buffer === 'function') {\n return Buffer.from(src, 'base64');\n } else if (typeof atob === 'function') {\n // On IE 11, atob() can't handle newlines\n var str = atob(src.replace(/[\\n\\r]/g, ''));\n var buffer = new Uint8Array(str.length);\n\n for (var i = 0; i < str.length; ++i) {\n buffer[i] = str.charCodeAt(i);\n }\n\n return buffer;\n } else {\n var msg = 'This environment does not support reading binary tags; either Buffer or atob is required';\n doc.errors.push(new YAMLReferenceError(node, msg));\n return null;\n }\n },\n options: binaryOptions,\n stringify: function stringify(_ref, ctx, onComment, onChompKeep) {\n var comment = _ref.comment,\n type = _ref.type,\n value = _ref.value;\n var src;\n\n if (typeof Buffer === 'function') {\n src = value instanceof Buffer ? value.toString('base64') : Buffer.from(value.buffer).toString('base64');\n } else if (typeof btoa === 'function') {\n var s = '';\n\n for (var i = 0; i < value.length; ++i) {\n s += String.fromCharCode(value[i]);\n }\n\n src = btoa(s);\n } else {\n throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');\n }\n\n if (!type) type = binaryOptions.defaultType;\n\n if (type === Type.QUOTE_DOUBLE) {\n value = src;\n } else {\n var lineWidth = binaryOptions.lineWidth;\n var n = Math.ceil(src.length / lineWidth);\n var lines = new Array(n);\n\n for (var _i = 0, o = 0; _i < n; ++_i, o += lineWidth) {\n lines[_i] = src.substr(o, lineWidth);\n }\n\n value = lines.join(type === Type.BLOCK_LITERAL ? '\\n' : ' ');\n }\n\n return stringifyString({\n comment: comment,\n type: type,\n value: value\n }, ctx, onComment, onChompKeep);\n }\n};\n\nfunction parsePairs(doc, cst) {\n var seq = resolveSeq(doc, cst);\n\n for (var i = 0; i < seq.items.length; ++i) {\n var item = seq.items[i];\n if (item instanceof Pair) continue;else if (item instanceof YAMLMap) {\n if (item.items.length > 1) {\n var msg = 'Each pair must have its own sequence indicator';\n throw new YAMLSemanticError(cst, msg);\n }\n\n var pair = item.items[0] || new Pair();\n if (item.commentBefore) pair.commentBefore = pair.commentBefore ? \"\".concat(item.commentBefore, \"\\n\").concat(pair.commentBefore) : item.commentBefore;\n if (item.comment) pair.comment = pair.comment ? \"\".concat(item.comment, \"\\n\").concat(pair.comment) : item.comment;\n item = pair;\n }\n seq.items[i] = item instanceof Pair ? item : new Pair(item);\n }\n\n return seq;\n}\nfunction createPairs(schema, iterable, ctx) {\n var pairs = new YAMLSeq(schema);\n pairs.tag = 'tag:yaml.org,2002:pairs';\n\n var _iterator = _createForOfIteratorHelper(iterable),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var it = _step.value;\n var key = void 0,\n value = void 0;\n\n if (Array.isArray(it)) {\n if (it.length === 2) {\n key = it[0];\n value = it[1];\n } else throw new TypeError(\"Expected [key, value] tuple: \".concat(it));\n } else if (it && it instanceof Object) {\n var keys = Object.keys(it);\n\n if (keys.length === 1) {\n key = keys[0];\n value = it[key];\n } else throw new TypeError(\"Expected { key: value } tuple: \".concat(it));\n } else {\n key = it;\n }\n\n var pair = schema.createPair(key, value, ctx);\n pairs.items.push(pair);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return pairs;\n}\nvar pairs = {\n default: false,\n tag: 'tag:yaml.org,2002:pairs',\n resolve: parsePairs,\n createNode: createPairs\n};\n\nvar YAMLOMap = /*#__PURE__*/function (_YAMLSeq) {\n _inherits(YAMLOMap, _YAMLSeq);\n\n var _super = _createSuper(YAMLOMap);\n\n function YAMLOMap() {\n var _this;\n\n _classCallCheck(this, YAMLOMap);\n\n _this = _super.call(this);\n\n _defineProperty(_assertThisInitialized(_this), \"add\", YAMLMap.prototype.add.bind(_assertThisInitialized(_this)));\n\n _defineProperty(_assertThisInitialized(_this), \"delete\", YAMLMap.prototype.delete.bind(_assertThisInitialized(_this)));\n\n _defineProperty(_assertThisInitialized(_this), \"get\", YAMLMap.prototype.get.bind(_assertThisInitialized(_this)));\n\n _defineProperty(_assertThisInitialized(_this), \"has\", YAMLMap.prototype.has.bind(_assertThisInitialized(_this)));\n\n _defineProperty(_assertThisInitialized(_this), \"set\", YAMLMap.prototype.set.bind(_assertThisInitialized(_this)));\n\n _this.tag = YAMLOMap.tag;\n return _this;\n }\n\n _createClass(YAMLOMap, [{\n key: \"toJSON\",\n value: function toJSON$1(_, ctx) {\n var map = new Map();\n if (ctx && ctx.onCreate) ctx.onCreate(map);\n\n var _iterator = _createForOfIteratorHelper(this.items),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var pair = _step.value;\n var key = void 0,\n value = void 0;\n\n if (pair instanceof Pair) {\n key = toJSON(pair.key, '', ctx);\n value = toJSON(pair.value, key, ctx);\n } else {\n key = toJSON(pair, '', ctx);\n }\n\n if (map.has(key)) throw new Error('Ordered maps must not include duplicate keys');\n map.set(key, value);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return map;\n }\n }]);\n\n return YAMLOMap;\n}(YAMLSeq);\n\n_defineProperty(YAMLOMap, \"tag\", 'tag:yaml.org,2002:omap');\n\nfunction parseOMap(doc, cst) {\n var pairs = parsePairs(doc, cst);\n var seenKeys = [];\n\n var _iterator2 = _createForOfIteratorHelper(pairs.items),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var key = _step2.value.key;\n\n if (key instanceof Scalar) {\n if (seenKeys.includes(key.value)) {\n var msg = 'Ordered maps must not include duplicate keys';\n throw new YAMLSemanticError(cst, msg);\n } else {\n seenKeys.push(key.value);\n }\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n return Object.assign(new YAMLOMap(), pairs);\n}\n\nfunction createOMap(schema, iterable, ctx) {\n var pairs = createPairs(schema, iterable, ctx);\n var omap = new YAMLOMap();\n omap.items = pairs.items;\n return omap;\n}\n\nvar omap = {\n identify: function identify(value) {\n return value instanceof Map;\n },\n nodeClass: YAMLOMap,\n default: false,\n tag: 'tag:yaml.org,2002:omap',\n resolve: parseOMap,\n createNode: createOMap\n};\n\nvar YAMLSet = /*#__PURE__*/function (_YAMLMap) {\n _inherits(YAMLSet, _YAMLMap);\n\n var _super = _createSuper(YAMLSet);\n\n function YAMLSet() {\n var _this;\n\n _classCallCheck(this, YAMLSet);\n\n _this = _super.call(this);\n _this.tag = YAMLSet.tag;\n return _this;\n }\n\n _createClass(YAMLSet, [{\n key: \"add\",\n value: function add(key) {\n var pair = key instanceof Pair ? key : new Pair(key);\n var prev = findPair(this.items, pair.key);\n if (!prev) this.items.push(pair);\n }\n }, {\n key: \"get\",\n value: function get(key, keepPair) {\n var pair = findPair(this.items, key);\n return !keepPair && pair instanceof Pair ? pair.key instanceof Scalar ? pair.key.value : pair.key : pair;\n }\n }, {\n key: \"set\",\n value: function set(key, value) {\n if (typeof value !== 'boolean') throw new Error(\"Expected boolean value for set(key, value) in a YAML set, not \".concat(_typeof(value)));\n var prev = findPair(this.items, key);\n\n if (prev && !value) {\n this.items.splice(this.items.indexOf(prev), 1);\n } else if (!prev && value) {\n this.items.push(new Pair(key));\n }\n }\n }, {\n key: \"toJSON\",\n value: function toJSON(_, ctx) {\n return _get(_getPrototypeOf(YAMLSet.prototype), \"toJSON\", this).call(this, _, ctx, Set);\n }\n }, {\n key: \"toString\",\n value: function toString(ctx, onComment, onChompKeep) {\n if (!ctx) return JSON.stringify(this);\n if (this.hasAllNullValues()) return _get(_getPrototypeOf(YAMLSet.prototype), \"toString\", this).call(this, ctx, onComment, onChompKeep);else throw new Error('Set items must all have null values');\n }\n }]);\n\n return YAMLSet;\n}(YAMLMap);\n\n_defineProperty(YAMLSet, \"tag\", 'tag:yaml.org,2002:set');\n\nfunction parseSet(doc, cst) {\n var map = resolveMap(doc, cst);\n if (!map.hasAllNullValues()) throw new YAMLSemanticError(cst, 'Set items must all have null values');\n return Object.assign(new YAMLSet(), map);\n}\n\nfunction createSet(schema, iterable, ctx) {\n var set = new YAMLSet();\n\n var _iterator = _createForOfIteratorHelper(iterable),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var value = _step.value;\n set.items.push(schema.createPair(value, null, ctx));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return set;\n}\n\nvar set = {\n identify: function identify(value) {\n return value instanceof Set;\n },\n nodeClass: YAMLSet,\n default: false,\n tag: 'tag:yaml.org,2002:set',\n resolve: parseSet,\n createNode: createSet\n};\n\nvar parseSexagesimal = function parseSexagesimal(sign, parts) {\n var n = parts.split(':').reduce(function (n, p) {\n return n * 60 + Number(p);\n }, 0);\n return sign === '-' ? -n : n;\n}; // hhhh:mm:ss.sss\n\n\nvar stringifySexagesimal = function stringifySexagesimal(_ref) {\n var value = _ref.value;\n if (isNaN(value) || !isFinite(value)) return stringifyNumber(value);\n var sign = '';\n\n if (value < 0) {\n sign = '-';\n value = Math.abs(value);\n }\n\n var parts = [value % 60]; // seconds, including ms\n\n if (value < 60) {\n parts.unshift(0); // at least one : is required\n } else {\n value = Math.round((value - parts[0]) / 60);\n parts.unshift(value % 60); // minutes\n\n if (value >= 60) {\n value = Math.round((value - parts[0]) / 60);\n parts.unshift(value); // hours\n }\n }\n\n return sign + parts.map(function (n) {\n return n < 10 ? '0' + String(n) : String(n);\n }).join(':').replace(/000000\\d*$/, '') // % 60 may introduce error\n ;\n};\n\nvar intTime = {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'TIME',\n test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,\n resolve: function resolve(str, sign, parts) {\n return parseSexagesimal(sign, parts.replace(/_/g, ''));\n },\n stringify: stringifySexagesimal\n};\nvar floatTime = {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:float',\n format: 'TIME',\n test: /^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*)$/,\n resolve: function resolve(str, sign, parts) {\n return parseSexagesimal(sign, parts.replace(/_/g, ''));\n },\n stringify: stringifySexagesimal\n};\nvar timestamp = {\n identify: function identify(value) {\n return value instanceof Date;\n },\n default: true,\n tag: 'tag:yaml.org,2002:timestamp',\n // If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part\n // may be omitted altogether, resulting in a date format. In such a case, the time part is\n // assumed to be 00:00:00Z (start of day, UTC).\n test: RegExp('^(?:' + '([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})' + // YYYY-Mm-Dd\n '(?:(?:t|T|[ \\\\t]+)' + // t | T | whitespace\n '([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\\\.[0-9]+)?)' + // Hh:Mm:Ss(.ss)?\n '(?:[ \\\\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?' + // Z | +5 | -03:30\n ')?' + ')$'),\n resolve: function resolve(str, year, month, day, hour, minute, second, millisec, tz) {\n if (millisec) millisec = (millisec + '00').substr(1, 3);\n var date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec || 0);\n\n if (tz && tz !== 'Z') {\n var d = parseSexagesimal(tz[0], tz.slice(1));\n if (Math.abs(d) < 30) d *= 60;\n date -= 60000 * d;\n }\n\n return new Date(date);\n },\n stringify: function stringify(_ref2) {\n var value = _ref2.value;\n return value.toISOString().replace(/((T00:00)?:00)?\\.000Z$/, '');\n }\n};\n\n/* global console, process, YAML_SILENCE_DEPRECATION_WARNINGS, YAML_SILENCE_WARNINGS */\nfunction shouldWarn(deprecation) {\n var env = typeof process !== 'undefined' && process.env || {};\n\n if (deprecation) {\n if (typeof YAML_SILENCE_DEPRECATION_WARNINGS !== 'undefined') return !YAML_SILENCE_DEPRECATION_WARNINGS;\n return !env.YAML_SILENCE_DEPRECATION_WARNINGS;\n }\n\n if (typeof YAML_SILENCE_WARNINGS !== 'undefined') return !YAML_SILENCE_WARNINGS;\n return !env.YAML_SILENCE_WARNINGS;\n}\n\nfunction warn(warning, type) {\n if (shouldWarn(false)) {\n var emit = typeof process !== 'undefined' && process.emitWarning; // This will throw in Jest if `warning` is an Error instance due to\n // https://github.com/facebook/jest/issues/2549\n\n if (emit) emit(warning, type);else {\n // eslint-disable-next-line no-console\n console.warn(type ? \"\".concat(type, \": \").concat(warning) : warning);\n }\n }\n}\nfunction warnFileDeprecation(filename) {\n if (shouldWarn(true)) {\n var path = filename.replace(/.*yaml[/\\\\]/i, '').replace(/\\.js$/, '').replace(/\\\\/g, '/');\n warn(\"The endpoint 'yaml/\".concat(path, \"' will be removed in a future release.\"), 'DeprecationWarning');\n }\n}\nvar warned = {};\nfunction warnOptionDeprecation(name, alternative) {\n if (!warned[name] && shouldWarn(true)) {\n warned[name] = true;\n var msg = \"The option '\".concat(name, \"' will be removed in a future release\");\n msg += alternative ? \", use '\".concat(alternative, \"' instead.\") : '.';\n warn(msg, 'DeprecationWarning');\n }\n}\n\nexport { warnOptionDeprecation as a, binary as b, warnFileDeprecation as c, floatTime as f, intTime as i, omap as o, pairs as p, set as s, timestamp as t, warn as w };\n","import { _ as _createForOfIteratorHelper, h as _slicedToArray, a as _typeof, b as _createClass, e as _defineProperty, c as _classCallCheck, d as defaultTagPrefix, n as defaultTags } from './PlainValue-b8036b75.js';\nimport { d as YAMLMap, g as resolveMap, Y as YAMLSeq, h as resolveSeq, j as resolveString, c as stringifyString, s as strOptions, S as Scalar, n as nullOptions, a as boolOptions, i as intOptions, k as stringifyNumber, N as Node, A as Alias, P as Pair } from './resolveSeq-492ab440.js';\nimport { b as binary, o as omap, p as pairs, s as set, i as intTime, f as floatTime, t as timestamp, a as warnOptionDeprecation } from './warnings-df54cb69.js';\n\nfunction createMap(schema, obj, ctx) {\n var map = new YAMLMap(schema);\n\n if (obj instanceof Map) {\n var _iterator = _createForOfIteratorHelper(obj),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _step$value = _slicedToArray(_step.value, 2),\n key = _step$value[0],\n value = _step$value[1];\n\n map.items.push(schema.createPair(key, value, ctx));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n } else if (obj && _typeof(obj) === 'object') {\n for (var _i = 0, _Object$keys = Object.keys(obj); _i < _Object$keys.length; _i++) {\n var _key = _Object$keys[_i];\n map.items.push(schema.createPair(_key, obj[_key], ctx));\n }\n }\n\n if (typeof schema.sortMapEntries === 'function') {\n map.items.sort(schema.sortMapEntries);\n }\n\n return map;\n}\n\nvar map = {\n createNode: createMap,\n default: true,\n nodeClass: YAMLMap,\n tag: 'tag:yaml.org,2002:map',\n resolve: resolveMap\n};\n\nfunction createSeq(schema, obj, ctx) {\n var seq = new YAMLSeq(schema);\n\n if (obj && obj[Symbol.iterator]) {\n var _iterator = _createForOfIteratorHelper(obj),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var it = _step.value;\n var v = schema.createNode(it, ctx.wrapScalars, null, ctx);\n seq.items.push(v);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n\n return seq;\n}\n\nvar seq = {\n createNode: createSeq,\n default: true,\n nodeClass: YAMLSeq,\n tag: 'tag:yaml.org,2002:seq',\n resolve: resolveSeq\n};\n\nvar string = {\n identify: function identify(value) {\n return typeof value === 'string';\n },\n default: true,\n tag: 'tag:yaml.org,2002:str',\n resolve: resolveString,\n stringify: function stringify(item, ctx, onComment, onChompKeep) {\n ctx = Object.assign({\n actualString: true\n }, ctx);\n return stringifyString(item, ctx, onComment, onChompKeep);\n },\n options: strOptions\n};\n\nvar failsafe = [map, seq, string];\n\n/* global BigInt */\n\nvar intIdentify$2 = function intIdentify(value) {\n return typeof value === 'bigint' || Number.isInteger(value);\n};\n\nvar intResolve$1 = function intResolve(src, part, radix) {\n return intOptions.asBigInt ? BigInt(src) : parseInt(part, radix);\n};\n\nfunction intStringify$1(node, radix, prefix) {\n var value = node.value;\n if (intIdentify$2(value) && value >= 0) return prefix + value.toString(radix);\n return stringifyNumber(node);\n}\n\nvar nullObj = {\n identify: function identify(value) {\n return value == null;\n },\n createNode: function createNode(schema, value, ctx) {\n return ctx.wrapScalars ? new Scalar(null) : null;\n },\n default: true,\n tag: 'tag:yaml.org,2002:null',\n test: /^(?:~|[Nn]ull|NULL)?$/,\n resolve: function resolve() {\n return null;\n },\n options: nullOptions,\n stringify: function stringify() {\n return nullOptions.nullStr;\n }\n};\nvar boolObj = {\n identify: function identify(value) {\n return typeof value === 'boolean';\n },\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,\n resolve: function resolve(str) {\n return str[0] === 't' || str[0] === 'T';\n },\n options: boolOptions,\n stringify: function stringify(_ref) {\n var value = _ref.value;\n return value ? boolOptions.trueStr : boolOptions.falseStr;\n }\n};\nvar octObj = {\n identify: function identify(value) {\n return intIdentify$2(value) && value >= 0;\n },\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'OCT',\n test: /^0o([0-7]+)$/,\n resolve: function resolve(str, oct) {\n return intResolve$1(str, oct, 8);\n },\n options: intOptions,\n stringify: function stringify(node) {\n return intStringify$1(node, 8, '0o');\n }\n};\nvar intObj = {\n identify: intIdentify$2,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n test: /^[-+]?[0-9]+$/,\n resolve: function resolve(str) {\n return intResolve$1(str, str, 10);\n },\n options: intOptions,\n stringify: stringifyNumber\n};\nvar hexObj = {\n identify: function identify(value) {\n return intIdentify$2(value) && value >= 0;\n },\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'HEX',\n test: /^0x([0-9a-fA-F]+)$/,\n resolve: function resolve(str, hex) {\n return intResolve$1(str, hex, 16);\n },\n options: intOptions,\n stringify: function stringify(node) {\n return intStringify$1(node, 16, '0x');\n }\n};\nvar nanObj = {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^(?:[-+]?\\.inf|(\\.nan))$/i,\n resolve: function resolve(str, nan) {\n return nan ? NaN : str[0] === '-' ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY;\n },\n stringify: stringifyNumber\n};\nvar expObj = {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:float',\n format: 'EXP',\n test: /^[-+]?(?:\\.[0-9]+|[0-9]+(?:\\.[0-9]*)?)[eE][-+]?[0-9]+$/,\n resolve: function resolve(str) {\n return parseFloat(str);\n },\n stringify: function stringify(_ref2) {\n var value = _ref2.value;\n return Number(value).toExponential();\n }\n};\nvar floatObj = {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^[-+]?(?:\\.([0-9]+)|[0-9]+\\.([0-9]*))$/,\n resolve: function resolve(str, frac1, frac2) {\n var frac = frac1 || frac2;\n var node = new Scalar(parseFloat(str));\n if (frac && frac[frac.length - 1] === '0') node.minFractionDigits = frac.length;\n return node;\n },\n stringify: stringifyNumber\n};\nvar core = failsafe.concat([nullObj, boolObj, octObj, intObj, hexObj, nanObj, expObj, floatObj]);\n\n/* global BigInt */\n\nvar intIdentify$1 = function intIdentify(value) {\n return typeof value === 'bigint' || Number.isInteger(value);\n};\n\nvar stringifyJSON = function stringifyJSON(_ref) {\n var value = _ref.value;\n return JSON.stringify(value);\n};\n\nvar json = [map, seq, {\n identify: function identify(value) {\n return typeof value === 'string';\n },\n default: true,\n tag: 'tag:yaml.org,2002:str',\n resolve: resolveString,\n stringify: stringifyJSON\n}, {\n identify: function identify(value) {\n return value == null;\n },\n createNode: function createNode(schema, value, ctx) {\n return ctx.wrapScalars ? new Scalar(null) : null;\n },\n default: true,\n tag: 'tag:yaml.org,2002:null',\n test: /^null$/,\n resolve: function resolve() {\n return null;\n },\n stringify: stringifyJSON\n}, {\n identify: function identify(value) {\n return typeof value === 'boolean';\n },\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^true|false$/,\n resolve: function resolve(str) {\n return str === 'true';\n },\n stringify: stringifyJSON\n}, {\n identify: intIdentify$1,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n test: /^-?(?:0|[1-9][0-9]*)$/,\n resolve: function resolve(str) {\n return intOptions.asBigInt ? BigInt(str) : parseInt(str, 10);\n },\n stringify: function stringify(_ref2) {\n var value = _ref2.value;\n return intIdentify$1(value) ? value.toString() : JSON.stringify(value);\n }\n}, {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,\n resolve: function resolve(str) {\n return parseFloat(str);\n },\n stringify: stringifyJSON\n}];\n\njson.scalarFallback = function (str) {\n throw new SyntaxError(\"Unresolved plain scalar \".concat(JSON.stringify(str)));\n};\n\n/* global BigInt */\n\nvar boolStringify = function boolStringify(_ref) {\n var value = _ref.value;\n return value ? boolOptions.trueStr : boolOptions.falseStr;\n};\n\nvar intIdentify = function intIdentify(value) {\n return typeof value === 'bigint' || Number.isInteger(value);\n};\n\nfunction intResolve(sign, src, radix) {\n var str = src.replace(/_/g, '');\n\n if (intOptions.asBigInt) {\n switch (radix) {\n case 2:\n str = \"0b\".concat(str);\n break;\n\n case 8:\n str = \"0o\".concat(str);\n break;\n\n case 16:\n str = \"0x\".concat(str);\n break;\n }\n\n var _n = BigInt(str);\n\n return sign === '-' ? BigInt(-1) * _n : _n;\n }\n\n var n = parseInt(str, radix);\n return sign === '-' ? -1 * n : n;\n}\n\nfunction intStringify(node, radix, prefix) {\n var value = node.value;\n\n if (intIdentify(value)) {\n var str = value.toString(radix);\n return value < 0 ? '-' + prefix + str.substr(1) : prefix + str;\n }\n\n return stringifyNumber(node);\n}\n\nvar yaml11 = failsafe.concat([{\n identify: function identify(value) {\n return value == null;\n },\n createNode: function createNode(schema, value, ctx) {\n return ctx.wrapScalars ? new Scalar(null) : null;\n },\n default: true,\n tag: 'tag:yaml.org,2002:null',\n test: /^(?:~|[Nn]ull|NULL)?$/,\n resolve: function resolve() {\n return null;\n },\n options: nullOptions,\n stringify: function stringify() {\n return nullOptions.nullStr;\n }\n}, {\n identify: function identify(value) {\n return typeof value === 'boolean';\n },\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,\n resolve: function resolve() {\n return true;\n },\n options: boolOptions,\n stringify: boolStringify\n}, {\n identify: function identify(value) {\n return typeof value === 'boolean';\n },\n default: true,\n tag: 'tag:yaml.org,2002:bool',\n test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,\n resolve: function resolve() {\n return false;\n },\n options: boolOptions,\n stringify: boolStringify\n}, {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'BIN',\n test: /^([-+]?)0b([0-1_]+)$/,\n resolve: function resolve(str, sign, bin) {\n return intResolve(sign, bin, 2);\n },\n stringify: function stringify(node) {\n return intStringify(node, 2, '0b');\n }\n}, {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'OCT',\n test: /^([-+]?)0([0-7_]+)$/,\n resolve: function resolve(str, sign, oct) {\n return intResolve(sign, oct, 8);\n },\n stringify: function stringify(node) {\n return intStringify(node, 8, '0');\n }\n}, {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n test: /^([-+]?)([0-9][0-9_]*)$/,\n resolve: function resolve(str, sign, abs) {\n return intResolve(sign, abs, 10);\n },\n stringify: stringifyNumber\n}, {\n identify: intIdentify,\n default: true,\n tag: 'tag:yaml.org,2002:int',\n format: 'HEX',\n test: /^([-+]?)0x([0-9a-fA-F_]+)$/,\n resolve: function resolve(str, sign, hex) {\n return intResolve(sign, hex, 16);\n },\n stringify: function stringify(node) {\n return intStringify(node, 16, '0x');\n }\n}, {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^(?:[-+]?\\.inf|(\\.nan))$/i,\n resolve: function resolve(str, nan) {\n return nan ? NaN : str[0] === '-' ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY;\n },\n stringify: stringifyNumber\n}, {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:float',\n format: 'EXP',\n test: /^[-+]?([0-9][0-9_]*)?(\\.[0-9_]*)?[eE][-+]?[0-9]+$/,\n resolve: function resolve(str) {\n return parseFloat(str.replace(/_/g, ''));\n },\n stringify: function stringify(_ref2) {\n var value = _ref2.value;\n return Number(value).toExponential();\n }\n}, {\n identify: function identify(value) {\n return typeof value === 'number';\n },\n default: true,\n tag: 'tag:yaml.org,2002:float',\n test: /^[-+]?(?:[0-9][0-9_]*)?\\.([0-9_]*)$/,\n resolve: function resolve(str, frac) {\n var node = new Scalar(parseFloat(str.replace(/_/g, '')));\n\n if (frac) {\n var f = frac.replace(/_/g, '');\n if (f[f.length - 1] === '0') node.minFractionDigits = f.length;\n }\n\n return node;\n },\n stringify: stringifyNumber\n}], binary, omap, pairs, set, intTime, floatTime, timestamp);\n\nvar schemas = {\n core: core,\n failsafe: failsafe,\n json: json,\n yaml11: yaml11\n};\nvar tags = {\n binary: binary,\n bool: boolObj,\n float: floatObj,\n floatExp: expObj,\n floatNaN: nanObj,\n floatTime: floatTime,\n int: intObj,\n intHex: hexObj,\n intOct: octObj,\n intTime: intTime,\n map: map,\n null: nullObj,\n omap: omap,\n pairs: pairs,\n seq: seq,\n set: set,\n timestamp: timestamp\n};\n\nfunction findTagObject(value, tagName, tags) {\n if (tagName) {\n var match = tags.filter(function (t) {\n return t.tag === tagName;\n });\n var tagObj = match.find(function (t) {\n return !t.format;\n }) || match[0];\n if (!tagObj) throw new Error(\"Tag \".concat(tagName, \" not found\"));\n return tagObj;\n } // TODO: deprecate/remove class check\n\n\n return tags.find(function (t) {\n return (t.identify && t.identify(value) || t.class && value instanceof t.class) && !t.format;\n });\n}\n\nfunction createNode(value, tagName, ctx) {\n if (value instanceof Node) return value;\n var defaultPrefix = ctx.defaultPrefix,\n onTagObj = ctx.onTagObj,\n prevObjects = ctx.prevObjects,\n schema = ctx.schema,\n wrapScalars = ctx.wrapScalars;\n if (tagName && tagName.startsWith('!!')) tagName = defaultPrefix + tagName.slice(2);\n var tagObj = findTagObject(value, tagName, schema.tags);\n\n if (!tagObj) {\n if (typeof value.toJSON === 'function') value = value.toJSON();\n if (!value || _typeof(value) !== 'object') return wrapScalars ? new Scalar(value) : value;\n tagObj = value instanceof Map ? map : value[Symbol.iterator] ? seq : map;\n }\n\n if (onTagObj) {\n onTagObj(tagObj);\n delete ctx.onTagObj;\n } // Detect duplicate references to the same object & use Alias nodes for all\n // after first. The `obj` wrapper allows for circular references to resolve.\n\n\n var obj = {\n value: undefined,\n node: undefined\n };\n\n if (value && _typeof(value) === 'object' && prevObjects) {\n var prev = prevObjects.get(value);\n\n if (prev) {\n var alias = new Alias(prev); // leaves source dirty; must be cleaned by caller\n\n ctx.aliasNodes.push(alias); // defined along with prevObjects\n\n return alias;\n }\n\n obj.value = value;\n prevObjects.set(value, obj);\n }\n\n obj.node = tagObj.createNode ? tagObj.createNode(ctx.schema, value, ctx) : wrapScalars ? new Scalar(value) : value;\n if (tagName && obj.node instanceof Node) obj.node.tag = tagName;\n return obj.node;\n}\n\nfunction getSchemaTags(schemas, knownTags, customTags, schemaId) {\n var tags = schemas[schemaId.replace(/\\W/g, '')]; // 'yaml-1.1' -> 'yaml11'\n\n if (!tags) {\n var keys = Object.keys(schemas).map(function (key) {\n return JSON.stringify(key);\n }).join(', ');\n throw new Error(\"Unknown schema \\\"\".concat(schemaId, \"\\\"; use one of \").concat(keys));\n }\n\n if (Array.isArray(customTags)) {\n var _iterator = _createForOfIteratorHelper(customTags),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var tag = _step.value;\n tags = tags.concat(tag);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n } else if (typeof customTags === 'function') {\n tags = customTags(tags.slice());\n }\n\n for (var i = 0; i < tags.length; ++i) {\n var _tag = tags[i];\n\n if (typeof _tag === 'string') {\n var tagObj = knownTags[_tag];\n\n if (!tagObj) {\n var _keys = Object.keys(knownTags).map(function (key) {\n return JSON.stringify(key);\n }).join(', ');\n\n throw new Error(\"Unknown custom tag \\\"\".concat(_tag, \"\\\"; use one of \").concat(_keys));\n }\n\n tags[i] = tagObj;\n }\n }\n\n return tags;\n}\n\nvar sortMapEntriesByKey = function sortMapEntriesByKey(a, b) {\n return a.key < b.key ? -1 : a.key > b.key ? 1 : 0;\n};\n\nvar Schema = /*#__PURE__*/function () {\n // TODO: remove in v2\n // TODO: remove in v2\n function Schema(_ref) {\n var customTags = _ref.customTags,\n merge = _ref.merge,\n schema = _ref.schema,\n sortMapEntries = _ref.sortMapEntries,\n deprecatedCustomTags = _ref.tags;\n\n _classCallCheck(this, Schema);\n\n this.merge = !!merge;\n this.name = schema;\n this.sortMapEntries = sortMapEntries === true ? sortMapEntriesByKey : sortMapEntries || null;\n if (!customTags && deprecatedCustomTags) warnOptionDeprecation('tags', 'customTags');\n this.tags = getSchemaTags(schemas, tags, customTags || deprecatedCustomTags, schema);\n }\n\n _createClass(Schema, [{\n key: \"createNode\",\n value: function createNode$1(value, wrapScalars, tagName, ctx) {\n var baseCtx = {\n defaultPrefix: Schema.defaultPrefix,\n schema: this,\n wrapScalars: wrapScalars\n };\n var createCtx = ctx ? Object.assign(ctx, baseCtx) : baseCtx;\n return createNode(value, tagName, createCtx);\n }\n }, {\n key: \"createPair\",\n value: function createPair(key, value, ctx) {\n if (!ctx) ctx = {\n wrapScalars: true\n };\n var k = this.createNode(key, ctx.wrapScalars, null, ctx);\n var v = this.createNode(value, ctx.wrapScalars, null, ctx);\n return new Pair(k, v);\n }\n }]);\n\n return Schema;\n}();\n\n_defineProperty(Schema, \"defaultPrefix\", defaultTagPrefix);\n\n_defineProperty(Schema, \"defaultTags\", defaultTags);\n\nexport { Schema as S };\n","import { d as defaultTagPrefix, _ as _createForOfIteratorHelper, a as _typeof, b as _createClass, c as _classCallCheck, e as _defineProperty, Y as YAMLSyntaxError, T as Type, f as YAMLWarning, g as YAMLSemanticError, h as _slicedToArray, i as YAMLError, j as _inherits, k as _createSuper } from './PlainValue-b8036b75.js';\nimport { parse as parse$1 } from './parse-cst.js';\nimport { b as binaryOptions, a as boolOptions, i as intOptions, n as nullOptions, s as strOptions, N as Node, P as Pair, S as Scalar, c as stringifyString, A as Alias, Y as YAMLSeq, d as YAMLMap, M as Merge, C as Collection, r as resolveNode, e as isEmptyPath, t as toJSON, f as addComment } from './resolveSeq-492ab440.js';\nimport { S as Schema } from './Schema-e94716c8.js';\nimport { w as warn } from './warnings-df54cb69.js';\n\nvar defaultOptions = {\n anchorPrefix: 'a',\n customTags: null,\n indent: 2,\n indentSeq: true,\n keepCstNodes: false,\n keepNodeTypes: true,\n keepBlobsInJSON: true,\n mapAsMap: false,\n maxAliasCount: 100,\n prettyErrors: false,\n // TODO Set true in v2\n simpleKeys: false,\n version: '1.2'\n};\nvar scalarOptions = {\n get binary() {\n return binaryOptions;\n },\n\n set binary(opt) {\n Object.assign(binaryOptions, opt);\n },\n\n get bool() {\n return boolOptions;\n },\n\n set bool(opt) {\n Object.assign(boolOptions, opt);\n },\n\n get int() {\n return intOptions;\n },\n\n set int(opt) {\n Object.assign(intOptions, opt);\n },\n\n get null() {\n return nullOptions;\n },\n\n set null(opt) {\n Object.assign(nullOptions, opt);\n },\n\n get str() {\n return strOptions;\n },\n\n set str(opt) {\n Object.assign(strOptions, opt);\n }\n\n};\nvar documentOptions = {\n '1.0': {\n schema: 'yaml-1.1',\n merge: true,\n tagPrefixes: [{\n handle: '!',\n prefix: defaultTagPrefix\n }, {\n handle: '!!',\n prefix: 'tag:private.yaml.org,2002:'\n }]\n },\n 1.1: {\n schema: 'yaml-1.1',\n merge: true,\n tagPrefixes: [{\n handle: '!',\n prefix: '!'\n }, {\n handle: '!!',\n prefix: defaultTagPrefix\n }]\n },\n 1.2: {\n schema: 'core',\n merge: false,\n tagPrefixes: [{\n handle: '!',\n prefix: '!'\n }, {\n handle: '!!',\n prefix: defaultTagPrefix\n }]\n }\n};\n\nfunction stringifyTag(doc, tag) {\n if ((doc.version || doc.options.version) === '1.0') {\n var priv = tag.match(/^tag:private\\.yaml\\.org,2002:([^:/]+)$/);\n if (priv) return '!' + priv[1];\n var vocab = tag.match(/^tag:([a-zA-Z0-9-]+)\\.yaml\\.org,2002:(.*)/);\n return vocab ? \"!\".concat(vocab[1], \"/\").concat(vocab[2]) : \"!\".concat(tag.replace(/^tag:/, ''));\n }\n\n var p = doc.tagPrefixes.find(function (p) {\n return tag.indexOf(p.prefix) === 0;\n });\n\n if (!p) {\n var dtp = doc.getDefaults().tagPrefixes;\n p = dtp && dtp.find(function (p) {\n return tag.indexOf(p.prefix) === 0;\n });\n }\n\n if (!p) return tag[0] === '!' ? tag : \"!<\".concat(tag, \">\");\n var suffix = tag.substr(p.prefix.length).replace(/[!,[\\]{}]/g, function (ch) {\n return {\n '!': '%21',\n ',': '%2C',\n '[': '%5B',\n ']': '%5D',\n '{': '%7B',\n '}': '%7D'\n }[ch];\n });\n return p.handle + suffix;\n}\n\nfunction getTagObject(tags, item) {\n if (item instanceof Alias) return Alias;\n\n if (item.tag) {\n var match = tags.filter(function (t) {\n return t.tag === item.tag;\n });\n if (match.length > 0) return match.find(function (t) {\n return t.format === item.format;\n }) || match[0];\n }\n\n var tagObj, obj;\n\n if (item instanceof Scalar) {\n obj = item.value; // TODO: deprecate/remove class check\n\n var _match = tags.filter(function (t) {\n return t.identify && t.identify(obj) || t.class && obj instanceof t.class;\n });\n\n tagObj = _match.find(function (t) {\n return t.format === item.format;\n }) || _match.find(function (t) {\n return !t.format;\n });\n } else {\n obj = item;\n tagObj = tags.find(function (t) {\n return t.nodeClass && obj instanceof t.nodeClass;\n });\n }\n\n if (!tagObj) {\n var name = obj && obj.constructor ? obj.constructor.name : _typeof(obj);\n throw new Error(\"Tag not resolved for \".concat(name, \" value\"));\n }\n\n return tagObj;\n} // needs to be called before value stringifier to allow for circular anchor refs\n\n\nfunction stringifyProps(node, tagObj, _ref) {\n var anchors = _ref.anchors,\n doc = _ref.doc;\n var props = [];\n var anchor = doc.anchors.getName(node);\n\n if (anchor) {\n anchors[anchor] = node;\n props.push(\"&\".concat(anchor));\n }\n\n if (node.tag) {\n props.push(stringifyTag(doc, node.tag));\n } else if (!tagObj.default) {\n props.push(stringifyTag(doc, tagObj.tag));\n }\n\n return props.join(' ');\n}\n\nfunction stringify$1(item, ctx, onComment, onChompKeep) {\n var _ctx$doc = ctx.doc,\n anchors = _ctx$doc.anchors,\n schema = _ctx$doc.schema;\n var tagObj;\n\n if (!(item instanceof Node)) {\n var createCtx = {\n aliasNodes: [],\n onTagObj: function onTagObj(o) {\n return tagObj = o;\n },\n prevObjects: new Map()\n };\n item = schema.createNode(item, true, null, createCtx);\n\n var _iterator = _createForOfIteratorHelper(createCtx.aliasNodes),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var alias = _step.value;\n alias.source = alias.source.node;\n var name = anchors.getName(alias.source);\n\n if (!name) {\n name = anchors.newName();\n anchors.map[name] = alias.source;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n\n if (item instanceof Pair) return item.toString(ctx, onComment, onChompKeep);\n if (!tagObj) tagObj = getTagObject(schema.tags, item);\n var props = stringifyProps(item, tagObj, ctx);\n if (props.length > 0) ctx.indentAtStart = (ctx.indentAtStart || 0) + props.length + 1;\n var str = typeof tagObj.stringify === 'function' ? tagObj.stringify(item, ctx, onComment, onChompKeep) : item instanceof Scalar ? stringifyString(item, ctx, onComment, onChompKeep) : item.toString(ctx, onComment, onChompKeep);\n if (!props) return str;\n return item instanceof Scalar || str[0] === '{' || str[0] === '[' ? \"\".concat(props, \" \").concat(str) : \"\".concat(props, \"\\n\").concat(ctx.indent).concat(str);\n}\n\nvar Anchors = /*#__PURE__*/function () {\n function Anchors(prefix) {\n _classCallCheck(this, Anchors);\n\n _defineProperty(this, \"map\", Object.create(null));\n\n this.prefix = prefix;\n }\n\n _createClass(Anchors, [{\n key: \"createAlias\",\n value: function createAlias(node, name) {\n this.setAnchor(node, name);\n return new Alias(node);\n }\n }, {\n key: \"createMergePair\",\n value: function createMergePair() {\n var _this = this;\n\n var merge = new Merge();\n\n for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n\n merge.value.items = sources.map(function (s) {\n if (s instanceof Alias) {\n if (s.source instanceof YAMLMap) return s;\n } else if (s instanceof YAMLMap) {\n return _this.createAlias(s);\n }\n\n throw new Error('Merge sources must be Map nodes or their Aliases');\n });\n return merge;\n }\n }, {\n key: \"getName\",\n value: function getName(node) {\n var map = this.map;\n return Object.keys(map).find(function (a) {\n return map[a] === node;\n });\n }\n }, {\n key: \"getNames\",\n value: function getNames() {\n return Object.keys(this.map);\n }\n }, {\n key: \"getNode\",\n value: function getNode(name) {\n return this.map[name];\n }\n }, {\n key: \"newName\",\n value: function newName(prefix) {\n if (!prefix) prefix = this.prefix;\n var names = Object.keys(this.map);\n\n for (var i = 1; true; ++i) {\n var name = \"\".concat(prefix).concat(i);\n if (!names.includes(name)) return name;\n }\n } // During parsing, map & aliases contain CST nodes\n\n }, {\n key: \"resolveNodes\",\n value: function resolveNodes() {\n var map = this.map,\n _cstAliases = this._cstAliases;\n Object.keys(map).forEach(function (a) {\n map[a] = map[a].resolved;\n });\n\n _cstAliases.forEach(function (a) {\n a.source = a.source.resolved;\n });\n\n delete this._cstAliases;\n }\n }, {\n key: \"setAnchor\",\n value: function setAnchor(node, name) {\n if (node != null && !Anchors.validAnchorNode(node)) {\n throw new Error('Anchors may only be set for Scalar, Seq and Map nodes');\n }\n\n if (name && /[\\x00-\\x19\\s,[\\]{}]/.test(name)) {\n throw new Error('Anchor names must not contain whitespace or control characters');\n }\n\n var map = this.map;\n var prev = node && Object.keys(map).find(function (a) {\n return map[a] === node;\n });\n\n if (prev) {\n if (!name) {\n return prev;\n } else if (prev !== name) {\n delete map[prev];\n map[name] = node;\n }\n } else {\n if (!name) {\n if (!node) return null;\n name = this.newName();\n }\n\n map[name] = node;\n }\n\n return name;\n }\n }], [{\n key: \"validAnchorNode\",\n value: function validAnchorNode(node) {\n return node instanceof Scalar || node instanceof YAMLSeq || node instanceof YAMLMap;\n }\n }]);\n\n return Anchors;\n}();\n\nvar visit = function visit(node, tags) {\n if (node && _typeof(node) === 'object') {\n var tag = node.tag;\n\n if (node instanceof Collection) {\n if (tag) tags[tag] = true;\n node.items.forEach(function (n) {\n return visit(n, tags);\n });\n } else if (node instanceof Pair) {\n visit(node.key, tags);\n visit(node.value, tags);\n } else if (node instanceof Scalar) {\n if (tag) tags[tag] = true;\n }\n }\n\n return tags;\n};\n\nvar listTagNames = function listTagNames(node) {\n return Object.keys(visit(node, {}));\n};\n\nfunction parseContents(doc, contents) {\n var comments = {\n before: [],\n after: []\n };\n var body = undefined;\n var spaceBefore = false;\n\n var _iterator = _createForOfIteratorHelper(contents),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var node = _step.value;\n\n if (node.valueRange) {\n if (body !== undefined) {\n var msg = 'Document contains trailing content not separated by a ... or --- line';\n doc.errors.push(new YAMLSyntaxError(node, msg));\n break;\n }\n\n var res = resolveNode(doc, node);\n\n if (spaceBefore) {\n res.spaceBefore = true;\n spaceBefore = false;\n }\n\n body = res;\n } else if (node.comment !== null) {\n var cc = body === undefined ? comments.before : comments.after;\n cc.push(node.comment);\n } else if (node.type === Type.BLANK_LINE) {\n spaceBefore = true;\n\n if (body === undefined && comments.before.length > 0 && !doc.commentBefore) {\n // space-separated comments at start are parsed as document comments\n doc.commentBefore = comments.before.join('\\n');\n comments.before = [];\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n doc.contents = body || null;\n\n if (!body) {\n doc.comment = comments.before.concat(comments.after).join('\\n') || null;\n } else {\n var cb = comments.before.join('\\n');\n\n if (cb) {\n var cbNode = body instanceof Collection && body.items[0] ? body.items[0] : body;\n cbNode.commentBefore = cbNode.commentBefore ? \"\".concat(cb, \"\\n\").concat(cbNode.commentBefore) : cb;\n }\n\n doc.comment = comments.after.join('\\n') || null;\n }\n}\n\nfunction resolveTagDirective(_ref, directive) {\n var tagPrefixes = _ref.tagPrefixes;\n\n var _directive$parameters = _slicedToArray(directive.parameters, 2),\n handle = _directive$parameters[0],\n prefix = _directive$parameters[1];\n\n if (!handle || !prefix) {\n var msg = 'Insufficient parameters given for %TAG directive';\n throw new YAMLSemanticError(directive, msg);\n }\n\n if (tagPrefixes.some(function (p) {\n return p.handle === handle;\n })) {\n var _msg = 'The %TAG directive must only be given at most once per handle in the same document.';\n throw new YAMLSemanticError(directive, _msg);\n }\n\n return {\n handle: handle,\n prefix: prefix\n };\n}\n\nfunction resolveYamlDirective(doc, directive) {\n var _directive$parameters2 = _slicedToArray(directive.parameters, 1),\n version = _directive$parameters2[0];\n\n if (directive.name === 'YAML:1.0') version = '1.0';\n\n if (!version) {\n var msg = 'Insufficient parameters given for %YAML directive';\n throw new YAMLSemanticError(directive, msg);\n }\n\n if (!documentOptions[version]) {\n var v0 = doc.version || doc.options.version;\n\n var _msg2 = \"Document will be parsed as YAML \".concat(v0, \" rather than YAML \").concat(version);\n\n doc.warnings.push(new YAMLWarning(directive, _msg2));\n }\n\n return version;\n}\n\nfunction parseDirectives(doc, directives, prevDoc) {\n var directiveComments = [];\n var hasDirectives = false;\n\n var _iterator = _createForOfIteratorHelper(directives),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var directive = _step.value;\n var comment = directive.comment,\n name = directive.name;\n\n switch (name) {\n case 'TAG':\n try {\n doc.tagPrefixes.push(resolveTagDirective(doc, directive));\n } catch (error) {\n doc.errors.push(error);\n }\n\n hasDirectives = true;\n break;\n\n case 'YAML':\n case 'YAML:1.0':\n if (doc.version) {\n var msg = 'The %YAML directive must only be given at most once per document.';\n doc.errors.push(new YAMLSemanticError(directive, msg));\n }\n\n try {\n doc.version = resolveYamlDirective(doc, directive);\n } catch (error) {\n doc.errors.push(error);\n }\n\n hasDirectives = true;\n break;\n\n default:\n if (name) {\n var _msg3 = \"YAML only supports %TAG and %YAML directives, and not %\".concat(name);\n\n doc.warnings.push(new YAMLWarning(directive, _msg3));\n }\n\n }\n\n if (comment) directiveComments.push(comment);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n if (prevDoc && !hasDirectives && '1.1' === (doc.version || prevDoc.version || doc.options.version)) {\n var copyTagPrefix = function copyTagPrefix(_ref2) {\n var handle = _ref2.handle,\n prefix = _ref2.prefix;\n return {\n handle: handle,\n prefix: prefix\n };\n };\n\n doc.tagPrefixes = prevDoc.tagPrefixes.map(copyTagPrefix);\n doc.version = prevDoc.version;\n }\n\n doc.commentBefore = directiveComments.join('\\n') || null;\n}\n\nfunction assertCollection(contents) {\n if (contents instanceof Collection) return true;\n throw new Error('Expected a YAML collection as document contents');\n}\n\nvar Document$1 = /*#__PURE__*/function () {\n function Document(options) {\n _classCallCheck(this, Document);\n\n this.anchors = new Anchors(options.anchorPrefix);\n this.commentBefore = null;\n this.comment = null;\n this.contents = null;\n this.directivesEndMarker = null;\n this.errors = [];\n this.options = options;\n this.schema = null;\n this.tagPrefixes = [];\n this.version = null;\n this.warnings = [];\n }\n\n _createClass(Document, [{\n key: \"add\",\n value: function add(value) {\n assertCollection(this.contents);\n return this.contents.add(value);\n }\n }, {\n key: \"addIn\",\n value: function addIn(path, value) {\n assertCollection(this.contents);\n this.contents.addIn(path, value);\n }\n }, {\n key: \"delete\",\n value: function _delete(key) {\n assertCollection(this.contents);\n return this.contents.delete(key);\n }\n }, {\n key: \"deleteIn\",\n value: function deleteIn(path) {\n if (isEmptyPath(path)) {\n if (this.contents == null) return false;\n this.contents = null;\n return true;\n }\n\n assertCollection(this.contents);\n return this.contents.deleteIn(path);\n }\n }, {\n key: \"getDefaults\",\n value: function getDefaults() {\n return Document.defaults[this.version] || Document.defaults[this.options.version] || {};\n }\n }, {\n key: \"get\",\n value: function get(key, keepScalar) {\n return this.contents instanceof Collection ? this.contents.get(key, keepScalar) : undefined;\n }\n }, {\n key: \"getIn\",\n value: function getIn(path, keepScalar) {\n if (isEmptyPath(path)) return !keepScalar && this.contents instanceof Scalar ? this.contents.value : this.contents;\n return this.contents instanceof Collection ? this.contents.getIn(path, keepScalar) : undefined;\n }\n }, {\n key: \"has\",\n value: function has(key) {\n return this.contents instanceof Collection ? this.contents.has(key) : false;\n }\n }, {\n key: \"hasIn\",\n value: function hasIn(path) {\n if (isEmptyPath(path)) return this.contents !== undefined;\n return this.contents instanceof Collection ? this.contents.hasIn(path) : false;\n }\n }, {\n key: \"set\",\n value: function set(key, value) {\n assertCollection(this.contents);\n this.contents.set(key, value);\n }\n }, {\n key: \"setIn\",\n value: function setIn(path, value) {\n if (isEmptyPath(path)) this.contents = value;else {\n assertCollection(this.contents);\n this.contents.setIn(path, value);\n }\n }\n }, {\n key: \"setSchema\",\n value: function setSchema(id, customTags) {\n if (!id && !customTags && this.schema) return;\n if (typeof id === 'number') id = id.toFixed(1);\n\n if (id === '1.0' || id === '1.1' || id === '1.2') {\n if (this.version) this.version = id;else this.options.version = id;\n delete this.options.schema;\n } else if (id && typeof id === 'string') {\n this.options.schema = id;\n }\n\n if (Array.isArray(customTags)) this.options.customTags = customTags;\n var opt = Object.assign({}, this.getDefaults(), this.options);\n this.schema = new Schema(opt);\n }\n }, {\n key: \"parse\",\n value: function parse(node, prevDoc) {\n if (this.options.keepCstNodes) this.cstNode = node;\n if (this.options.keepNodeTypes) this.type = 'DOCUMENT';\n var _node$directives = node.directives,\n directives = _node$directives === void 0 ? [] : _node$directives,\n _node$contents = node.contents,\n contents = _node$contents === void 0 ? [] : _node$contents,\n directivesEndMarker = node.directivesEndMarker,\n error = node.error,\n valueRange = node.valueRange;\n\n if (error) {\n if (!error.source) error.source = this;\n this.errors.push(error);\n }\n\n parseDirectives(this, directives, prevDoc);\n if (directivesEndMarker) this.directivesEndMarker = true;\n this.range = valueRange ? [valueRange.start, valueRange.end] : null;\n this.setSchema();\n this.anchors._cstAliases = [];\n parseContents(this, contents);\n this.anchors.resolveNodes();\n\n if (this.options.prettyErrors) {\n var _iterator = _createForOfIteratorHelper(this.errors),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _error = _step.value;\n if (_error instanceof YAMLError) _error.makePretty();\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n var _iterator2 = _createForOfIteratorHelper(this.warnings),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var warn = _step2.value;\n if (warn instanceof YAMLError) warn.makePretty();\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n\n return this;\n }\n }, {\n key: \"listNonDefaultTags\",\n value: function listNonDefaultTags() {\n return listTagNames(this.contents).filter(function (t) {\n return t.indexOf(Schema.defaultPrefix) !== 0;\n });\n }\n }, {\n key: \"setTagPrefix\",\n value: function setTagPrefix(handle, prefix) {\n if (handle[0] !== '!' || handle[handle.length - 1] !== '!') throw new Error('Handle must start and end with !');\n\n if (prefix) {\n var prev = this.tagPrefixes.find(function (p) {\n return p.handle === handle;\n });\n if (prev) prev.prefix = prefix;else this.tagPrefixes.push({\n handle: handle,\n prefix: prefix\n });\n } else {\n this.tagPrefixes = this.tagPrefixes.filter(function (p) {\n return p.handle !== handle;\n });\n }\n }\n }, {\n key: \"toJSON\",\n value: function toJSON$1(arg, onAnchor) {\n var _this = this;\n\n var _this$options = this.options,\n keepBlobsInJSON = _this$options.keepBlobsInJSON,\n mapAsMap = _this$options.mapAsMap,\n maxAliasCount = _this$options.maxAliasCount;\n var keep = keepBlobsInJSON && (typeof arg !== 'string' || !(this.contents instanceof Scalar));\n var ctx = {\n doc: this,\n indentStep: ' ',\n keep: keep,\n mapAsMap: keep && !!mapAsMap,\n maxAliasCount: maxAliasCount,\n stringify: stringify$1 // Requiring directly in Pair would create circular dependencies\n\n };\n var anchorNames = Object.keys(this.anchors.map);\n if (anchorNames.length > 0) ctx.anchors = new Map(anchorNames.map(function (name) {\n return [_this.anchors.map[name], {\n alias: [],\n aliasCount: 0,\n count: 1\n }];\n }));\n\n var res = toJSON(this.contents, arg, ctx);\n\n if (typeof onAnchor === 'function' && ctx.anchors) {\n var _iterator3 = _createForOfIteratorHelper(ctx.anchors.values()),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var _step3$value = _step3.value,\n count = _step3$value.count,\n _res = _step3$value.res;\n onAnchor(_res, count);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n\n return res;\n }\n }, {\n key: \"toString\",\n value: function toString() {\n if (this.errors.length > 0) throw new Error('Document with errors cannot be stringified');\n var indentSize = this.options.indent;\n\n if (!Number.isInteger(indentSize) || indentSize <= 0) {\n var s = JSON.stringify(indentSize);\n throw new Error(\"\\\"indent\\\" option must be a positive integer, not \".concat(s));\n }\n\n this.setSchema();\n var lines = [];\n var hasDirectives = false;\n\n if (this.version) {\n var vd = '%YAML 1.2';\n\n if (this.schema.name === 'yaml-1.1') {\n if (this.version === '1.0') vd = '%YAML:1.0';else if (this.version === '1.1') vd = '%YAML 1.1';\n }\n\n lines.push(vd);\n hasDirectives = true;\n }\n\n var tagNames = this.listNonDefaultTags();\n this.tagPrefixes.forEach(function (_ref) {\n var handle = _ref.handle,\n prefix = _ref.prefix;\n\n if (tagNames.some(function (t) {\n return t.indexOf(prefix) === 0;\n })) {\n lines.push(\"%TAG \".concat(handle, \" \").concat(prefix));\n hasDirectives = true;\n }\n });\n if (hasDirectives || this.directivesEndMarker) lines.push('---');\n\n if (this.commentBefore) {\n if (hasDirectives || !this.directivesEndMarker) lines.unshift('');\n lines.unshift(this.commentBefore.replace(/^/gm, '#'));\n }\n\n var ctx = {\n anchors: Object.create(null),\n doc: this,\n indent: '',\n indentStep: ' '.repeat(indentSize),\n stringify: stringify$1 // Requiring directly in nodes would create circular dependencies\n\n };\n var chompKeep = false;\n var contentComment = null;\n\n if (this.contents) {\n if (this.contents instanceof Node) {\n if (this.contents.spaceBefore && (hasDirectives || this.directivesEndMarker)) lines.push('');\n if (this.contents.commentBefore) lines.push(this.contents.commentBefore.replace(/^/gm, '#')); // top-level block scalars need to be indented if followed by a comment\n\n ctx.forceBlockIndent = !!this.comment;\n contentComment = this.contents.comment;\n }\n\n var onChompKeep = contentComment ? null : function () {\n return chompKeep = true;\n };\n var body = stringify$1(this.contents, ctx, function () {\n return contentComment = null;\n }, onChompKeep);\n lines.push(addComment(body, '', contentComment));\n } else if (this.contents !== undefined) {\n lines.push(stringify$1(this.contents, ctx));\n }\n\n if (this.comment) {\n if ((!chompKeep || contentComment) && lines[lines.length - 1] !== '') lines.push('');\n lines.push(this.comment.replace(/^/gm, '#'));\n }\n\n return lines.join('\\n') + '\\n';\n }\n }]);\n\n return Document;\n}();\n\n_defineProperty(Document$1, \"defaults\", documentOptions);\n\nfunction createNode(value) {\n var wrapScalars = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var tag = arguments.length > 2 ? arguments[2] : undefined;\n\n if (tag === undefined && typeof wrapScalars === 'string') {\n tag = wrapScalars;\n wrapScalars = true;\n }\n\n var options = Object.assign({}, Document$1.defaults[defaultOptions.version], defaultOptions);\n var schema = new Schema(options);\n return schema.createNode(value, wrapScalars, tag);\n}\n\nvar Document = /*#__PURE__*/function (_YAMLDocument) {\n _inherits(Document, _YAMLDocument);\n\n var _super = _createSuper(Document);\n\n function Document(options) {\n _classCallCheck(this, Document);\n\n return _super.call(this, Object.assign({}, defaultOptions, options));\n }\n\n return Document;\n}(Document$1);\n\nfunction parseAllDocuments(src, options) {\n var stream = [];\n var prev;\n\n var _iterator = _createForOfIteratorHelper(parse$1(src)),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var cstDoc = _step.value;\n var doc = new Document(options);\n doc.parse(cstDoc, prev);\n stream.push(doc);\n prev = doc;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return stream;\n}\n\nfunction parseDocument(src, options) {\n var cst = parse$1(src);\n var doc = new Document(options).parse(cst[0]);\n\n if (cst.length > 1) {\n var errMsg = 'Source contains multiple documents; please use YAML.parseAllDocuments()';\n doc.errors.unshift(new YAMLSemanticError(cst[1], errMsg));\n }\n\n return doc;\n}\n\nfunction parse(src, options) {\n var doc = parseDocument(src, options);\n doc.warnings.forEach(function (warning) {\n return warn(warning);\n });\n if (doc.errors.length > 0) throw doc.errors[0];\n return doc.toJSON();\n}\n\nfunction stringify(value, options) {\n var doc = new Document(options);\n doc.contents = value;\n return String(doc);\n}\n\nvar YAML = {\n createNode: createNode,\n defaultOptions: defaultOptions,\n Document: Document,\n parse: parse,\n parseAllDocuments: parseAllDocuments,\n parseCST: parse$1,\n parseDocument: parseDocument,\n scalarOptions: scalarOptions,\n stringify: stringify\n};\n\nexport { YAML };\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import defineProperty from \"./defineProperty.js\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nexport default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n\n return target;\n}","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nfunction __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nfunction __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\n\nvar Event = /** @class */ (function () {\r\n function Event(type, target) {\r\n this.target = target;\r\n this.type = type;\r\n }\r\n return Event;\r\n}());\r\nvar ErrorEvent = /** @class */ (function (_super) {\r\n __extends(ErrorEvent, _super);\r\n function ErrorEvent(error, target) {\r\n var _this = _super.call(this, 'error', target) || this;\r\n _this.message = error.message;\r\n _this.error = error;\r\n return _this;\r\n }\r\n return ErrorEvent;\r\n}(Event));\r\nvar CloseEvent = /** @class */ (function (_super) {\r\n __extends(CloseEvent, _super);\r\n function CloseEvent(code, reason, target) {\r\n if (code === void 0) { code = 1000; }\r\n if (reason === void 0) { reason = ''; }\r\n var _this = _super.call(this, 'close', target) || this;\r\n _this.wasClean = true;\r\n _this.code = code;\r\n _this.reason = reason;\r\n return _this;\r\n }\r\n return CloseEvent;\r\n}(Event));\n\n/*!\r\n * Reconnecting WebSocket\r\n * by Pedro Ladaria