UNPKG

@codesandbox/sandpack-client

Version:

<img style="width:100%" src="https://user-images.githubusercontent.com/4838076/143581035-ebee5ba2-9cb1-4fe8-a05b-2f44bd69bb4b.gif" alt="Component toolkit for live running code editing experiences" />

16 lines (14 loc) 155 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(((e=e||self).prettierPlugins=e.prettierPlugins||{},e.prettierPlugins.yaml={}))}(this,(function(e){"use strict";var t=function(e,t){const n=new SyntaxError(e+" ("+t.start.line+":"+t.start.column+")");return n.loc=t,n};var n={isPragma:function(e){return/^\s*@(prettier|format)\s*$/.test(e)},hasPragma:function(e){return/^\s*#[^\n\S]*@(prettier|format)\s*?(\n|$)/.test(e)},insertPragma:function(e){return"# @format\n\n".concat(e)}},r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a(e,t){return e(t={exports:{}},t.exports),t.exports} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ var s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function c(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return s}function l(e){return this instanceof l?(this.v=e,this):new l(e)}var f=Object.freeze({__proto__:null,__extends:function(e,t){function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},get __assign(){return i},__rest:function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},__decorate:function(e,t,n,r){var o,a=arguments.length,s=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var i=e.length-1;i>=0;i--)(o=e[i])&&(s=(a<3?o(s):a>3?o(t,n,s):o(t,n))||s);return a>3&&s&&Object.defineProperty(t,n,s),s},__param:function(e,t){return function(n,r){t(n,r,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function s(e){try{c(r.next(e))}catch(e){a(e)}}function i(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?o(e.value):new n((function(t){t(e.value)})).then(s,i)}c((r=r.apply(e,t||[])).next())}))},__generator:function(e,t){var n,r,o,a,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}},__exportStar:function(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])},__values:c,__read:u,__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(u(arguments[t]));return e},__spreadArrays:function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var a=arguments[t],s=0,i=a.length;s<i;s++,o++)r[o]=a[s];return r},__await:l,__asyncGenerator:function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),a=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||i(e,t)}))})}function i(e,t){try{(n=o[e](t)).value instanceof l?Promise.resolve(n.value.v).then(c,u):f(a[0][2],n)}catch(e){f(a[0][3],e)}var n}function c(e){i("next",e)}function u(e){i("throw",e)}function f(e,t){e(t),a.shift(),a.length&&i(a[0][0],a[0][1])}},__asyncDelegator:function(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:l(e[r](t)),done:"return"===r}:o?o(t):t}:o}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=c(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}}}),d=a((function(e,t){var n=function(){function e(e){this.string=e;for(var t=[0],n=0;n<e.length;)switch(e[n]){case"\n":n+="\n".length,t.push(n);break;case"\r":"\n"===e[n+="\r".length]&&(n+="\n".length),t.push(n);break;default:n++}this.offsets=t}return e.prototype.locationForIndex=function(e){if(e<0||e>this.string.length)return null;for(var t=0,n=this.offsets;n[t+1]<=e;)t++;return{line:t,column:e-n[t]}},e.prototype.indexForLocation=function(e){var t=e.line,n=e.column;return t<0||t>=this.offsets.length?null:n<0||n>this.lengthOfLine(t)?null:this.offsets[t]+n},e.prototype.lengthOfLine=function(e){var t=this.offsets[e];return(e===this.offsets.length-1?this.string.length:this.offsets[e+1])-t},e}();t.__esModule=!0,t.default=n}));o(d);var h=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Type=t.Char=void 0;t.Char={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."};t.Type={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"}}));o(h);h.Type,h.Char;var p=a((function(e,t){function n(e){const t=[0];let n=e.indexOf("\n");for(;-1!==n;)n+=1,t.push(n),n=e.indexOf("\n",n);return t}function r(e){let t,r;return"string"==typeof e?(t=n(e),r=e):(Array.isArray(e)&&(e=e[0]),e&&e.context&&(e.lineStarts||(e.lineStarts=n(e.context.src)),t=e.lineStarts,r=e.context.src)),{lineStarts:t,src:r}}function o(e,t){const{lineStarts:n,src:o}=r(t);if(!n||!(e>=1)||e>n.length)return null;const a=n[e-1];let s=n[e];for(;s&&s>a&&"\n"===o[s-1];)--s;return o.slice(a,s)}Object.defineProperty(t,"__esModule",{value:!0}),t.getLinePos=function(e,t){if("number"!=typeof e||e<0)return null;const{lineStarts:n,src:o}=r(t);if(!n||!o||e>o.length)return null;for(let t=0;t<n.length;++t){const r=n[t];if(e<r)return{line:t,col:e-n[t-1]+1};if(e===r)return{line:t+1,col:1}}const a=n.length;return{line:a,col:e-n[a-1]+1}},t.getLine=o,t.getPrettyContext=function({start:e,end:t},n,r=80){let a=o(e.line,n);if(!a)return null;let{col:s}=e;if(a.length>r)if(s<=r-10)a=a.substr(0,r-1)+"…";else{const e=Math.round(r/2);a.length>s+e&&(a=a.substr(0,s+e-1)+"…"),s-=a.length-r,a="…"+a.substr(1-r)}let i=1,c="";t&&(t.line===e.line&&s+(t.col-e.col)<=r+1?i=t.col-e.col:(i=Math.min(a.length+1,r)-s,c="…"));const u=s>1?" ".repeat(s-1):"",l="^".repeat(i);return"".concat(a,"\n").concat(u).concat(l).concat(c)}}));o(p);p.getLinePos,p.getLine,p.getPrettyContext;var g=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;class n{static copy(e){return new n(e.start,e.end)}constructor(e,t){this.start=e,this.end=t||e}isEmpty(){return"number"!=typeof this.start||!this.end||this.end<=this.start}setOrigRange(e,t){const{start:n,end:r}=this;if(0===e.length||r<=e[0])return this.origStart=n,this.origEnd=r,t;let o=t;for(;o<e.length&&!(e[o]>n);)++o;this.origStart=n+o;const a=o;for(;o<e.length&&!(e[o]>=r);)++o;return this.origEnd=r+o,a}}t.default=n}));o(g);var m=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,r=(n=g)&&n.__esModule?n:{default:n};class o{static addStringTerminator(e,t,n){if("\n"===n[n.length-1])return n;const r=o.endOfWhiteSpace(e,t);return r>=e.length||"\n"===e[r]?n+"\n":n}static atDocumentBoundary(e,t,n){const r=e[t];if(!r)return!0;const o=e[t-1];if(o&&"\n"!==o)return!1;if(n){if(r!==n)return!1}else if(r!==h.Char.DIRECTIVES_END&&r!==h.Char.DOCUMENT_END)return!1;const a=e[t+1],s=e[t+2];if(a!==r||s!==r)return!1;const i=e[t+3];return!i||"\n"===i||"\t"===i||" "===i}static endOfIdentifier(e,t){let n=e[t];const r="<"===n,o=r?["\n","\t"," ",">"]:["\n","\t"," ","[","]","{","}",","];for(;n&&-1===o.indexOf(n);)n=e[t+=1];return r&&">"===n&&(t+=1),t}static endOfIndent(e,t){let n=e[t];for(;" "===n;)n=e[t+=1];return t}static endOfLine(e,t){let n=e[t];for(;n&&"\n"!==n;)n=e[t+=1];return t}static endOfWhiteSpace(e,t){let n=e[t];for(;"\t"===n||" "===n;)n=e[t+=1];return t}static startOfLine(e,t){let n=e[t-1];if("\n"===n)return t;for(;n&&"\n"!==n;)n=e[t-=1];return t+1}static endOfBlockIndent(e,t,n){const r=o.endOfIndent(e,n);if(r>n+t)return r;{const t=o.endOfWhiteSpace(e,r),n=e[t];if(!n||"\n"===n)return t}return null}static atBlank(e,t,n){const r=e[t];return"\n"===r||"\t"===r||" "===r||n&&!r}static nextNodeIsIndented(e,t,n){return!(!e||t<0)&&(t>0||n&&"-"===e)}static normalizeOffset(e,t){const n=e[t];return n?"\n"!==n&&"\n"===e[t-1]?t-1:o.endOfWhiteSpace(e,t):t}static foldNewline(e,t,n){let r=0,a=!1,s="",i=e[t+1];for(;" "===i||"\t"===i||"\n"===i;){switch(i){case"\n":r=0,t+=1,s+="\n";break;case"\t":r<=n&&(a=!0),t=o.endOfWhiteSpace(e,t+2)-1;break;case" ":r+=1,t+=1}i=e[t+1]}return s||(s=" "),i&&r<=n&&(a=!0),{fold:s,offset:t,error:a}}constructor(e,t,n){Object.defineProperty(this,"context",{value:n||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=t||[],this.type=e,this.value=null}getPropValue(e,t,n){if(!this.context)return null;const{src:r}=this.context,o=this.props[e];return o&&r[o.start]===t?r.slice(o.start+(n?1:0),o.end):null}get anchor(){for(let e=0;e<this.props.length;++e){const t=this.getPropValue(e,h.Char.ANCHOR,!0);if(null!=t)return t}return null}get comment(){const e=[];for(let t=0;t<this.props.length;++t){const n=this.getPropValue(t,h.Char.COMMENT,!0);null!=n&&e.push(n)}return e.length>0?e.join("\n"):null}commentHasRequiredWhitespace(e){const{src:t}=this.context;if(this.header&&e===this.header.end)return!1;if(!this.valueRange)return!1;const{end:n}=this.valueRange;return e!==n||o.atBlank(t,n-1)}get hasComment(){if(this.context){const{src:e}=this.context;for(let t=0;t<this.props.length;++t)if(e[this.props[t].start]===h.Char.COMMENT)return!0}return!1}get hasProps(){if(this.context){const{src:e}=this.context;for(let t=0;t<this.props.length;++t)if(e[this.props[t].start]!==h.Char.COMMENT)return!0}return!1}get includesTrailingLines(){return!1}get jsonLike(){return-1!==[h.Type.FLOW_MAP,h.Type.FLOW_SEQ,h.Type.QUOTE_DOUBLE,h.Type.QUOTE_SINGLE].indexOf(this.type)}get rangeAsLinePos(){if(!this.range||!this.context)return;const e=(0,p.getLinePos)(this.range.start,this.context.root);return e?{start:e,end:(0,p.getLinePos)(this.range.end,this.context.root)}:void 0}get rawValue(){if(!this.valueRange||!this.context)return null;const{start:e,end:t}=this.valueRange;return this.context.src.slice(e,t)}get tag(){for(let e=0;e<this.props.length;++e){const t=this.getPropValue(e,h.Char.TAG,!1);if(null!=t){if("<"===t[1])return{verbatim:t.slice(2,-1)};{const[e,n,r]=t.match(/^(.*!)([^!]*)$/);return{handle:n,suffix:r}}}}return null}get valueRangeContainsNewline(){if(!this.valueRange||!this.context)return!1;const{start:e,end:t}=this.valueRange,{src:n}=this.context;for(let r=e;r<t;++r)if("\n"===n[r])return!0;return!1}parseComment(e){const{src:t}=this.context;if(t[e]===h.Char.COMMENT){const n=o.endOfLine(t,e+1),a=new r.default(e,n);return this.props.push(a),n}return e}setOrigRanges(e,t){return this.range&&(t=this.range.setOrigRange(e,t)),this.valueRange&&this.valueRange.setOrigRange(e,t),this.props.forEach(n=>n.setOrigRange(e,t)),t}toString(){const{context:{src:e},range:t,value:n}=this;if(null!=n)return n;const r=e.slice(t.start,t.end);return o.addStringTerminator(e,t.end,r)}}t.default=o}));o(m);var y=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.YAMLWarning=t.YAMLSyntaxError=t.YAMLSemanticError=t.YAMLReferenceError=t.YAMLError=void 0;var n=o(m),r=o(g);function o(e){return e&&e.__esModule?e:{default:e}}class a extends Error{constructor(e,t,r){if(!(r&&t instanceof n.default))throw new Error("Invalid arguments for new ".concat(e));super(),this.name=e,this.message=r,this.source=t}makePretty(){if(!this.source)return;this.nodeType=this.source.type;const e=this.source.context&&this.source.context.root;if("number"==typeof this.offset){this.range=new r.default(this.offset,this.offset+1);const t=e&&(0,p.getLinePos)(this.offset,e);if(t){const e={line:t.line,col:t.col+1};this.linePos={start:t,end:e}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){const{line:t,col:n}=this.linePos.start;this.message+=" at line ".concat(t,", column ").concat(n);const r=e&&(0,p.getPrettyContext)(this.linePos,e);r&&(this.message+=":\n\n".concat(r,"\n"))}delete this.source}}t.YAMLError=a;t.YAMLReferenceError=class extends a{constructor(e,t){super("YAMLReferenceError",e,t)}};t.YAMLSemanticError=class extends a{constructor(e,t){super("YAMLSemanticError",e,t)}};t.YAMLSyntaxError=class extends a{constructor(e,t){super("YAMLSyntaxError",e,t)}};t.YAMLWarning=class extends a{constructor(e,t){super("YAMLWarning",e,t)}}}));o(y);y.YAMLWarning,y.YAMLSyntaxError,y.YAMLSemanticError,y.YAMLReferenceError,y.YAMLError;var v=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(m),r=o(g);function o(e){return e&&e.__esModule?e:{default:e}}class a extends n.default{constructor(){super(h.Type.BLANK_LINE)}get includesTrailingLines(){return!0}parse(e,t){this.context=e;const{src:o}=e;let a=t+1;for(;n.default.atBlank(o,a);){const e=n.default.endOfWhiteSpace(o,a);if("\n"!==e)break;a=e+1}return this.range=new r.default(t,a),a}}t.default=a}));o(v);var _=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(v),r=a(m),o=a(g);function a(e){return e&&e.__esModule?e:{default:e}}class s extends r.default{constructor(e,t){super(e,t),this.node=null}get includesTrailingLines(){return!!this.node&&this.node.includesTrailingLines}parse(e,t){this.context=e;const{parseNode:a,src:s}=e;let{atLineStart:i,lineStart:c}=e;i||this.type!==h.Type.SEQ_ITEM||(this.error=new y.YAMLSemanticError(this,"Sequence items must not have preceding content on the same line"));const u=i?t-c:e.indent;let l=r.default.endOfWhiteSpace(s,t+1),f=s[l];const d="#"===f,p=[];let g=null;for(;"\n"===f||"#"===f;){if("#"===f){const e=r.default.endOfLine(s,l+1);p.push(new o.default(l,e)),l=e}else{i=!0,c=l+1,"\n"===s[r.default.endOfWhiteSpace(s,c)]&&0===p.length&&(g=new n.default,c=g.parse({src:s},c)),l=r.default.endOfIndent(s,c)}f=s[l]}if(r.default.nextNodeIsIndented(f,l-(c+u),this.type!==h.Type.SEQ_ITEM)?this.node=a({atLineStart:i,inCollection:!1,indent:u,lineStart:c,parent:this},l):f&&c>t+1&&(l=c-1),this.node){if(g){const t=e.parent.items||e.parent.contents;t&&t.push(g)}p.length&&Array.prototype.push.apply(this.props,p),l=this.node.range.end}else if(d){const e=p[0];this.props.push(e),l=e.end}else l=r.default.endOfLine(s,t+1);const m=this.node?this.node.valueRange.end:l;return this.valueRange=new o.default(t,m),l}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.node?this.node.setOrigRanges(e,t):t}toString(){const{context:{src:e},node:t,range:n,value:o}=this;if(null!=o)return o;const a=t?e.slice(n.start,t.range.start)+String(t):e.slice(n.start,n.end);return r.default.addStringTerminator(e,n.end,a)}}t.default=s}));o(_);var b=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(m),r=o(g);function o(e){return e&&e.__esModule?e:{default:e}}class a extends n.default{constructor(){super(h.Type.COMMENT)}parse(e,t){this.context=e;const n=this.parseComment(t);return this.range=new r.default(t,n),n}}t.default=a}));o(b);var w=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.grabCollectionEndComments=c,t.default=void 0;var n=i(v),r=i(_),o=i(b),a=i(m),s=i(g);function i(e){return e&&e.__esModule?e:{default:e}}function c(e){let t=e;for(;t instanceof r.default;)t=t.node;if(!(t instanceof u))return null;const n=t.items.length;let o=-1;for(let e=n-1;e>=0;--e){const n=t.items[e];if(n.type===h.Type.COMMENT){const{indent:t,lineStart:r}=n.context;if(t>0&&n.range.start>=r+t)break;o=e}else{if(n.type!==h.Type.BLANK_LINE)break;o=e}}if(-1===o)return null;const a=t.items.splice(o,n-o),s=a[0].range.start;for(;t.range.end=s,t.valueRange&&t.valueRange.end>s&&(t.valueRange.end=s),t!==e;)t=t.context.parent;return a}class u extends a.default{static nextContentHasIndent(e,t,n){const r=a.default.endOfLine(e,t)+1,o=e[t=a.default.endOfWhiteSpace(e,r)];return!!o&&(t>=r+n||("#"===o||"\n"===o)&&u.nextContentHasIndent(e,t,n))}constructor(e){super(e.type===h.Type.SEQ_ITEM?h.Type.SEQ:h.Type.MAP);for(let t=e.props.length-1;t>=0;--t)if(e.props[t].start<e.context.lineStart){this.props=e.props.slice(0,t+1),e.props=e.props.slice(t+1);const n=e.props[0]||e.valueRange;e.range.start=n.start;break}this.items=[e];const t=c(e);t&&Array.prototype.push.apply(this.items,t)}get includesTrailingLines(){return this.items.length>0}parse(e,t){this.context=e;const{parseNode:r,src:i}=e;let l=a.default.startOfLine(i,t);const f=this.items[0];f.context.parent=this,this.valueRange=s.default.copy(f.valueRange);const d=f.range.start-f.context.lineStart;let p=t;p=a.default.normalizeOffset(i,p);let g=i[p],m=a.default.endOfWhiteSpace(i,l)===p,y=!1;for(;g;){for(;"\n"===g||"#"===g;){if(m&&"\n"===g&&!y){const e=new n.default;if(p=e.parse({src:i},p),this.valueRange.end=p,p>=i.length){g=null;break}this.items.push(e),p-=1}else if("#"===g){if(p<l+d&&!u.nextContentHasIndent(i,p,d))return p;const e=new o.default;if(p=e.parse({indent:d,lineStart:l,src:i},p),this.items.push(e),this.valueRange.end=p,p>=i.length){g=null;break}}if(l=p+1,p=a.default.endOfIndent(i,l),a.default.atBlank(i,p)){const e=a.default.endOfWhiteSpace(i,p),t=i[e];t&&"\n"!==t&&"#"!==t||(p=e)}g=i[p],m=!0}if(!g)break;if(p!==l+d&&(m||":"!==g)){l>t&&(p=l);break}if(f.type===h.Type.SEQ_ITEM!=("-"===g)){let e=!0;if("-"===g){const t=i[p+1];e=!t||"\n"===t||"\t"===t||" "===t}if(e){l>t&&(p=l);break}}const e=r({atLineStart:m,inCollection:!0,indent:d,lineStart:l,parent:this},p);if(!e)return p;if(this.items.push(e),this.valueRange.end=e.valueRange.end,p=a.default.normalizeOffset(i,e.range.end),g=i[p],m=!1,y=e.includesTrailingLines,g){let e=p-1,t=i[e];for(;" "===t||"\t"===t;)t=i[--e];"\n"===t&&(l=e+1,m=!0)}const s=c(e);s&&Array.prototype.push.apply(this.items,s)}return p}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.items.forEach(n=>{t=n.setOrigRanges(e,t)}),t}toString(){const{context:{src:e},items:t,range:n,value:r}=this;if(null!=r)return r;let o=e.slice(n.start,t[0].range.start)+String(t[0]);for(let e=1;e<t.length;++e){const n=t[e],{atLineStart:r,indent:a}=n.context;if(r)for(let e=0;e<a;++e)o+=" ";o+=String(n)}return a.default.addStringTerminator(e,n.end,o)}}t.default=u}));o(w);w.grabCollectionEndComments;var E=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(m),r=o(g);function o(e){return e&&e.__esModule?e:{default:e}}class a extends n.default{constructor(){super(h.Type.DIRECTIVE),this.name=null}get parameters(){const e=this.rawValue;return e?e.trim().split(/[ \t]+/):[]}parseName(e){const{src:t}=this.context;let n=e,r=t[n];for(;r&&"\n"!==r&&"\t"!==r&&" "!==r;)r=t[n+=1];return this.name=t.slice(e,n),n}parseParameters(e){const{src:t}=this.context;let n=e,o=t[n];for(;o&&"\n"!==o&&"#"!==o;)o=t[n+=1];return this.valueRange=new r.default(e,n),n}parse(e,t){this.context=e;let n=this.parseName(t+1);return n=this.parseParameters(n),n=this.parseComment(n),this.range=new r.default(t,n),n}}t.default=a}));o(E);var O=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(v),r=i(b),o=i(E),a=i(m),s=i(g);function i(e){return e&&e.__esModule?e:{default:e}}class c extends a.default{static startCommentOrEndBlankLine(e,t){const n=a.default.endOfWhiteSpace(e,t),r=e[n];return"#"===r||"\n"===r?n:t}constructor(){super(h.Type.DOCUMENT),this.directives=null,this.contents=null,this.directivesEndMarker=null,this.documentEndMarker=null}parseDirectives(e){const{src:t}=this.context;this.directives=[];let i=!0,u=!1,l=e;for(;!a.default.atDocumentBoundary(t,l,h.Char.DIRECTIVES_END);)switch(l=c.startCommentOrEndBlankLine(t,l),t[l]){case"\n":if(i){const e=new n.default;l=e.parse({src:t},l),l<t.length&&this.directives.push(e)}else l+=1,i=!0;break;case"#":{const e=new r.default;l=e.parse({src:t},l),this.directives.push(e),i=!1}break;case"%":{const e=new o.default;l=e.parse({parent:this,src:t},l),this.directives.push(e),u=!0,i=!1}break;default:return u?this.error=new y.YAMLSemanticError(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),l}return t[l]?(this.directivesEndMarker=new s.default(l,l+3),l+3):(u?this.error=new y.YAMLSemanticError(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),l)}parseContents(e){const{parseNode:t,src:o}=this.context;this.contents||(this.contents=[]);let i=e;for(;"-"===o[i-1];)i-=1;let u=a.default.endOfWhiteSpace(o,e),l=i===e;for(this.valueRange=new s.default(u);!a.default.atDocumentBoundary(o,u,h.Char.DOCUMENT_END);){switch(o[u]){case"\n":if(l){const e=new n.default;u=e.parse({src:o},u),u<o.length&&this.contents.push(e)}else u+=1,l=!0;i=u;break;case"#":{const e=new r.default;u=e.parse({src:o},u),this.contents.push(e),l=!1}break;default:{const e=a.default.endOfIndent(o,u),n=t({atLineStart:l,indent:-1,inFlow:!1,inCollection:!1,lineStart:i,parent:this},e);if(!n)return this.valueRange.end=e;this.contents.push(n),u=n.range.end,l=!1;const r=(0,w.grabCollectionEndComments)(n);r&&Array.prototype.push.apply(this.contents,r)}}u=c.startCommentOrEndBlankLine(o,u)}if(this.valueRange.end=u,o[u]&&(this.documentEndMarker=new s.default(u,u+3),u+=3,o[u])){if(u=a.default.endOfWhiteSpace(o,u),"#"===o[u]){const e=new r.default;u=e.parse({src:o},u),this.contents.push(e)}switch(o[u]){case"\n":u+=1;break;case void 0:break;default:this.error=new y.YAMLSyntaxError(this,"Document end marker line cannot have a non-comment suffix")}}return u}parse(e,t){e.root=this,this.context=e;const{src:n}=e;let r=65279===n.charCodeAt(t)?t+1:t;return r=this.parseDirectives(r),r=this.parseContents(r),r}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.directives.forEach(n=>{t=n.setOrigRanges(e,t)}),this.directivesEndMarker&&(t=this.directivesEndMarker.setOrigRange(e,t)),this.contents.forEach(n=>{t=n.setOrigRanges(e,t)}),this.documentEndMarker&&(t=this.documentEndMarker.setOrigRange(e,t)),t}toString(){const{contents:e,directives:t,value:n}=this;if(null!=n)return n;let r=t.join("");return e.length>0&&((t.length>0||e[0].type===h.Type.COMMENT)&&(r+="---\n"),r+=e.join("")),"\n"!==r[r.length-1]&&(r+="\n"),r}}t.default=c}));o(O);var M=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(m),r=o(g);function o(e){return e&&e.__esModule?e:{default:e}}class a extends n.default{parse(e,t){this.context=e;const{src:o}=e;let a=n.default.endOfIdentifier(o,t+1);return this.valueRange=new r.default(t+1,a),a=n.default.endOfWhiteSpace(o,a),a=this.parseComment(a),a}}t.default=a}));o(M);var S=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Chomp=void 0;var n=o(m),r=o(g);function o(e){return e&&e.__esModule?e:{default:e}}const a={CLIP:"CLIP",KEEP:"KEEP",STRIP:"STRIP"};t.Chomp=a;class s extends n.default{constructor(e,t){super(e,t),this.blockIndent=null,this.chomping=a.CLIP,this.header=null}get includesTrailingLines(){return this.chomping===a.KEEP}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:t}=this.valueRange;const{indent:r,src:o}=this.context;if(this.valueRange.isEmpty())return"";let s=null,i=o[t-1];for(;"\n"===i||"\t"===i||" "===i;){if(t-=1,t<=e){if(this.chomping===a.KEEP)break;return""}"\n"===i&&(s=t),i=o[t-1]}let c=t+1;s&&(this.chomping===a.KEEP?(c=s,t=this.valueRange.end):t=s);const u=r+this.blockIndent,l=this.type===h.Type.BLOCK_FOLDED;let f=!0,d="",p="",g=!1;for(let r=e;r<t;++r){for(let e=0;e<u&&" "===o[r];++e)r+=1;const e=o[r];if("\n"===e)"\n"===p?d+="\n":p="\n";else{const a=n.default.endOfLine(o,r),s=o.slice(r,a);r=a,l&&(" "===e||"\t"===e)&&r<c?(" "===p?p="\n":g||f||"\n"!==p||(p="\n\n"),d+=p+s,p=a<t&&o[a]||"",g=!0):(d+=p+s,p=l&&r<c?" ":"\n",g=!1),f&&""!==s&&(f=!1)}}return this.chomping===a.STRIP?d:d+"\n"}parseBlockHeader(e){const{src:t}=this.context;let n=e+1,o="";for(;;){const s=t[n];switch(s){case"-":this.chomping=a.STRIP;break;case"+":this.chomping=a.KEEP;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":o+=s;break;default:return this.blockIndent=Number(o)||null,this.header=new r.default(e,n),n}n+=1}}parseBlockValue(e){const{indent:t,src:o}=this.context;let s=e,i=e,c=this.blockIndent?t+this.blockIndent-1:t,u=1;for(let e=o[s];"\n"===e&&(s+=1,!n.default.atDocumentBoundary(o,s));e=o[s]){const e=n.default.endOfBlockIndent(o,c,s);if(null===e)break;if(!this.blockIndent){const n=e-(s+t);if("\n"!==o[e]){if(n<u){s-=1;break}this.blockIndent=n,c=t+this.blockIndent-1}else n>u&&(u=n)}s="\n"===o[e]?e:i=n.default.endOfLine(o,e)}return this.chomping!==a.KEEP&&(s=o[i]?i+1:i),this.valueRange=new r.default(e+1,s),s}parse(e,t){this.context=e;const{src:r}=e;let o=this.parseBlockHeader(t);return o=n.default.endOfWhiteSpace(r,o),o=this.parseComment(o),o=this.parseBlockValue(o),o}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.header?this.header.setOrigRange(e,t):t}}t.default=s}));o(S);S.Chomp;var A=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=s(v),r=s(b),o=s(m),a=s(g);function s(e){return e&&e.__esModule?e:{default:e}}class i extends o.default{constructor(e,t){super(e,t),this.items=null}prevNodeIsJsonLike(e=this.items.length){const t=this.items[e-1];return!!t&&(t.jsonLike||t.type===h.Type.COMMENT&&this.nodeIsJsonLike(e-1))}parse(e,t){this.context=e;const{parseNode:s,src:i}=e;let{indent:c,lineStart:u}=e,l=i[t];this.items=[{char:l,offset:t}];let f=o.default.endOfWhiteSpace(i,t+1);for(l=i[f];l&&"]"!==l&&"}"!==l;){switch(l){case"\n":if(u=f+1,"\n"===i[o.default.endOfWhiteSpace(i,u)]){const e=new n.default;u=e.parse({src:i},u),this.items.push(e)}if(f=o.default.endOfIndent(i,u),f<=u+c&&(l=i[f],f<u+c||"]"!==l&&"}"!==l)){const e="Insufficient indentation in flow collection";this.error=new y.YAMLSemanticError(this,e)}break;case",":this.items.push({char:l,offset:f}),f+=1;break;case"#":{const e=new r.default;f=e.parse({src:i},f),this.items.push(e)}break;case"?":case":":{const e=i[f+1];if("\n"===e||"\t"===e||" "===e||","===e||":"===l&&this.prevNodeIsJsonLike()){this.items.push({char:l,offset:f}),f+=1;break}}default:{const e=s({atLineStart:!1,inCollection:!1,inFlow:!0,indent:-1,lineStart:u,parent:this},f);if(!e)return this.valueRange=new a.default(t,f),f;this.items.push(e),f=o.default.normalizeOffset(i,e.range.end)}}f=o.default.endOfWhiteSpace(i,f),l=i[f]}return this.valueRange=new a.default(t,f+1),l&&(this.items.push({char:l,offset:f}),f=o.default.endOfWhiteSpace(i,f+1),f=this.parseComment(f)),f}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.items.forEach(n=>{if(n instanceof o.default)t=n.setOrigRanges(e,t);else if(0===e.length)n.origOffset=n.offset;else{let r=t;for(;r<e.length&&!(e[r]>n.offset);)++r;n.origOffset=n.offset+r,t=r}}),t}toString(){const{context:{src:e},items:t,range:n,value:r}=this;if(null!=r)return r;const a=t.filter(e=>e instanceof o.default);let s="",i=n.start;return a.forEach(t=>{const n=e.slice(i,t.range.start);i=t.range.end,s+=n+String(t),"\n"===s[s.length-1]&&"\n"!==e[i-1]&&"\n"===e[i]&&(i+=1)}),s+=e.slice(i,n.end),o.default.addStringTerminator(e,n.end,s)}}t.default=i}));o(A);var L=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(m),r=o(g);function o(e){return e&&e.__esModule?e:{default:e}}class a extends n.default{static endOfLine(e,t,n){let r=e[t],o=t;for(;r&&"\n"!==r&&(!n||"["!==r&&"]"!==r&&"{"!==r&&"}"!==r&&","!==r);){const t=e[o+1];if(":"===r&&(!t||"\n"===t||"\t"===t||" "===t||n&&","===t))break;if((" "===r||"\t"===r)&&"#"===t)break;o+=1,r=t}return o}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:t}=this.valueRange;const{src:r}=this.context;let o=r[t-1];for(;e<t&&("\n"===o||"\t"===o||" "===o);)o=r[--t-1];for(o=r[e];e<t&&("\n"===o||"\t"===o||" "===o);)o=r[++e];let a="";for(let o=e;o<t;++o){const e=r[o];if("\n"===e){const{fold:e,offset:t}=n.default.foldNewline(r,o,-1);a+=e,o=t}else if(" "===e||"\t"===e){const n=o;let s=r[o+1];for(;o<t&&(" "===s||"\t"===s);)o+=1,s=r[o+1];"\n"!==s&&(a+=o>n?r.slice(n,o+1):e)}else a+=e}return a}parseBlockValue(e){const{indent:t,inFlow:r,src:o}=this.context;let s=e,i=e;for(let e=o[s];"\n"===e&&!n.default.atDocumentBoundary(o,s+1);e=o[s]){const e=n.default.endOfBlockIndent(o,t,s+1);if(null===e||"#"===o[e])break;"\n"===o[e]?s=e:(i=a.endOfLine(o,e,r),s=i)}return this.valueRange.isEmpty()&&(this.valueRange.start=e),this.valueRange.end=i,i}parse(e,t){this.context=e;const{inFlow:o,src:s}=e;let i=t;const c=s[i];return c&&"#"!==c&&"\n"!==c&&(i=a.endOfLine(s,t,o)),this.valueRange=new r.default(t,i),i=n.default.endOfWhiteSpace(s,i),i=this.parseComment(i),this.hasComment&&!this.valueRange.isEmpty()||(i=this.parseBlockValue(i)),i}}t.default=a}));o(L);var T=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(m),r=o(g);function o(e){return e&&e.__esModule?e:{default:e}}class a extends n.default{static endOfQuote(e,t){let n=e[t];for(;n&&'"'!==n;)n=e[t+="\\"===n?2:1];return t+1}get strValue(){if(!this.valueRange||!this.context)return null;const e=[],{start:t,end:r}=this.valueRange,{indent:o,src:a}=this.context;'"'!==a[r-1]&&e.push(new y.YAMLSyntaxError(this,'Missing closing "quote'));let s="";for(let i=t+1;i<r-1;++i){const t=a[i];if("\n"===t){n.default.atDocumentBoundary(a,i+1)&&e.push(new y.YAMLSemanticError(this,"Document boundary indicators are not allowed within string values"));const{fold:t,offset:r,error:c}=n.default.foldNewline(a,i,o);s+=t,i=r,c&&e.push(new y.YAMLSemanticError(this,"Multi-line double-quoted string needs to be sufficiently indented"))}else if("\\"===t)switch(i+=1,a[i]){case"0":s+="\0";break;case"a":s+="";break;case"b":s+="\b";break;case"e":s+="";break;case"f":s+="\f";break;case"n":s+="\n";break;case"r":s+="\r";break;case"t":s+="\t";break;case"v":s+="\v";break;case"N":s+="…";break;case"_":s+=" ";break;case"L":s+="\u2028";break;case"P":s+="\u2029";break;case" ":s+=" ";break;case'"':s+='"';break;case"/":s+="/";break;case"\\":s+="\\";break;case"\t":s+="\t";break;case"x":s+=this.parseCharCode(i+1,2,e),i+=2;break;case"u":s+=this.parseCharCode(i+1,4,e),i+=4;break;case"U":s+=this.parseCharCode(i+1,8,e),i+=8;break;case"\n":for(;" "===a[i+1]||"\t"===a[i+1];)i+=1;break;default:e.push(new y.YAMLSyntaxError(this,"Invalid escape sequence ".concat(a.substr(i-1,2)))),s+="\\"+a[i]}else if(" "===t||"\t"===t){const e=i;let n=a[i+1];for(;" "===n||"\t"===n;)i+=1,n=a[i+1];"\n"!==n&&(s+=i>e?a.slice(e,i+1):t)}else s+=t}return e.length>0?{errors:e,str:s}:s}parseCharCode(e,t,n){const{src:r}=this.context,o=r.substr(e,t),a=o.length===t&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,16):NaN;return isNaN(a)?(n.push(new y.YAMLSyntaxError(this,"Invalid escape sequence ".concat(r.substr(e-2,t+2)))),r.substr(e-2,t+2)):String.fromCodePoint(a)}parse(e,t){this.context=e;const{src:o}=e;let s=a.endOfQuote(o,t+1);return this.valueRange=new r.default(t,s),s=n.default.endOfWhiteSpace(o,s),s=this.parseComment(s),s}}t.default=a}));o(T);var P=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(m),r=o(g);function o(e){return e&&e.__esModule?e:{default:e}}class a extends n.default{static endOfQuote(e,t){let n=e[t];for(;n;)if("'"===n){if("'"!==e[t+1])break;n=e[t+=2]}else n=e[t+=1];return t+1}get strValue(){if(!this.valueRange||!this.context)return null;const e=[],{start:t,end:r}=this.valueRange,{indent:o,src:a}=this.context;"'"!==a[r-1]&&e.push(new y.YAMLSyntaxError(this,"Missing closing 'quote"));let s="";for(let i=t+1;i<r-1;++i){const t=a[i];if("\n"===t){n.default.atDocumentBoundary(a,i+1)&&e.push(new y.YAMLSemanticError(this,"Document boundary indicators are not allowed within string values"));const{fold:t,offset:r,error:c}=n.default.foldNewline(a,i,o);s+=t,i=r,c&&e.push(new y.YAMLSemanticError(this,"Multi-line single-quoted string needs to be sufficiently indented"))}else if("'"===t)s+=t,i+=1,"'"!==a[i]&&e.push(new y.YAMLSyntaxError(this,"Unescaped single quote? This should not happen."));else if(" "===t||"\t"===t){const e=i;let n=a[i+1];for(;" "===n||"\t"===n;)i+=1,n=a[i+1];"\n"!==n&&(s+=i>e?a.slice(e,i+1):t)}else s+=t}return e.length>0?{errors:e,str:s}:s}parse(e,t){this.context=e;const{src:o}=e;let s=a.endOfQuote(o,t+1);return this.valueRange=new r.default(t,s),s=n.default.endOfWhiteSpace(o,s),s=this.parseComment(s),s}}t.default=a}));o(P);var C=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=d(M),r=d(S),o=d(w),a=d(_),s=d(A),i=d(m),c=d(L),u=d(T),l=d(P),f=d(g);function d(e){return e&&e.__esModule?e:{default:e}}class p{static parseType(e,t,n){switch(e[t]){case"*":return h.Type.ALIAS;case">":return h.Type.BLOCK_FOLDED;case"|":return h.Type.BLOCK_LITERAL;case"{":return h.Type.FLOW_MAP;case"[":return h.Type.FLOW_SEQ;case"?":return!n&&i.default.atBlank(e,t+1,!0)?h.Type.MAP_KEY:h.Type.PLAIN;case":":return!n&&i.default.atBlank(e,t+1,!0)?h.Type.MAP_VALUE:h.Type.PLAIN;case"-":return!n&&i.default.atBlank(e,t+1,!0)?h.Type.SEQ_ITEM:h.Type.PLAIN;case'"':return h.Type.QUOTE_DOUBLE;case"'":return h.Type.QUOTE_SINGLE;default:return h.Type.PLAIN}}constructor(e={},{atLineStart:t,inCollection:d,inFlow:g,indent:m,lineStart:v,parent:_}={}){var b,w,E;E=(e,t)=>{if(i.default.atDocumentBoundary(this.src,t))return null;const d=new p(this,e),{props:g,type:m,valueStart:v}=d.parseProps(t),_=function(e,t){switch(e){case h.Type.ALIAS:return new n.default(e,t);case h.Type.BLOCK_FOLDED:case h.Type.BLOCK_LITERAL:return new r.default(e,t);case h.Type.FLOW_MAP:case h.Type.FLOW_SEQ:return new s.default(e,t);case h.Type.MAP_KEY:case h.Type.MAP_VALUE:case h.Type.SEQ_ITEM:return new a.default(e,t);case h.Type.COMMENT:case h.Type.PLAIN:return new c.default(e,t);case h.Type.QUOTE_DOUBLE:return new u.default(e,t);case h.Type.QUOTE_SINGLE:return new l.default(e,t);default:return null}}(m,g);let b=_.parse(d,v);if(_.range=new f.default(t,b),b<=t&&(_.error=new Error("Node#parse consumed no characters"),_.error.parseEnd=b,_.error.source=_,_.range.end=t+1),d.nodeStartsCollection(_)){_.error||d.atLineStart||d.parent.type!==h.Type.DOCUMENT||(_.error=new y.YAMLSyntaxError(_,"Block collection must not have preceding content here (e.g. directives-end indicator)"));const e=new o.default(_);return b=e.parse(new p(d),b),e.range=new f.default(t,b),e}return _},(w="parseNode")in(b=this)?Object.defineProperty(b,w,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[w]=E,this.atLineStart=null!=t?t:e.atLineStart||!1,this.inCollection=null!=d?d:e.inCollection||!1,this.inFlow=null!=g?g:e.inFlow||!1,this.indent=null!=m?m:e.indent,this.lineStart=null!=v?v:e.lineStart,this.parent=null!=_?_:e.parent||{},this.root=e.root,this.src=e.src}nodeStartsCollection(e){const{inCollection:t,inFlow:n,src:r}=this;if(t||n)return!1;if(e instanceof a.default)return!0;let o=e.range.end;return"\n"!==r[o]&&"\n"!==r[o-1]&&(o=i.default.endOfWhiteSpace(r,o),":"===r[o])}parseProps(e){const{inFlow:t,parent:n,src:r}=this,o=[];let a=!1,s=r[e=i.default.endOfWhiteSpace(r,e)];for(;s===h.Char.ANCHOR||s===h.Char.COMMENT||s===h.Char.TAG||"\n"===s;){if("\n"===s){const t=e+1,o=i.default.endOfIndent(r,t),s=o-(t+this.indent),c=n.type===h.Type.SEQ_ITEM&&n.context.atLineStart;if(!i.default.nextNodeIsIndented(r[o],s,!c))break;this.atLineStart=!0,this.lineStart=t,a=!1,e=o}else if(s===h.Char.COMMENT){const t=i.default.endOfLine(r,e+1);o.push(new f.default(e,t)),e=t}else{let t=i.default.endOfIdentifier(r,e+1);s===h.Char.TAG&&","===r[t]&&/^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(r.slice(e+1,t+13))&&(t=i.default.endOfIdentifier(r,t+5)),o.push(new f.default(e,t)),a=!0,e=i.default.endOfWhiteSpace(r,t)}s=r[e]}return a&&":"===s&&i.default.atBlank(r,e+1,!0)&&(e-=1),{props:o,type:p.parseType(r,e,t),valueStart:e}}}t.default=p}));o(C);var N=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=[];-1!==e.indexOf("\r")&&(e=e.replace(/\r\n?/g,(e,n)=>(e.length>1&&t.push(n),"\n")));const o=[];let a=0;do{const t=new n.default,s=new r.default({src:e});a=t.parse(s,a),o.push(t)}while(a<e.length);return o.setOrigRanges=()=>{if(0===t.length)return!1;for(let e=1;e<t.length;++e)t[e]-=e;let e=0;for(let n=0;n<o.length;++n)e=o[n].setOrigRanges(t,e);return t.splice(0,t.length),!0},o.toString=()=>o.join("...\n"),o};var n=o(O),r=o(C);function o(e){return e&&e.__esModule?e:{default:e}}}));o(N);var x=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.addCommentBefore=function(e,t,n){if(!n)return e;const r=n.replace(/[\s\S]^/gm,"$&".concat(t,"#"));return"#".concat(r,"\n").concat(t).concat(e)},t.default=function(e,t,n){return n?-1===n.indexOf("\n")?"".concat(e," #").concat(n):"".concat(e,"\n")+n.replace(/^/gm,"".concat(t||"","#")):e}}));o(x);x.addCommentBefore;var k=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n,r){if(Array.isArray(t))return t.map((t,n)=>e(t,String(n),r));if(t&&"function"==typeof t.toJSON){const e=r&&r.anchors&&r.anchors.find(e=>e.node===t);e&&(r.onCreate=t=>{e.res=t,delete r.onCreate});const o=t.toJSON(n,r);return e&&r.onCreate&&r.onCreate(o),o}return t}}));o(k);var I=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=class{}}));o(I);var R=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(k),r=o(I);function o(e){return e&&e.__esModule?e:{default:e}}class a extends r.default{constructor(e){super(),this.value=e}toJSON(e,t){return t&&t.keep?this.value:(0,n.default)(this.value,e,t)}toString(){return String(this.value)}}t.default=a}));o(R);var j=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(x),r=i(k),o=i(B),a=i(I),s=i(R);function i(e){return e&&e.__esModule?e:{default:e}}class c extends a.default{constructor(e,t=null){super(),this.key=e,this.value=t,this.type="PAIR"}get commentBefore(){return this.key&&this.key.commentBefore}set commentBefore(e){null==this.key&&(this.key=new s.default(null)),this.key.commentBefore=e}addToJSMap(e,t){const n=(0,r.default)(this.key,"",e);if(t instanceof Map){const o=(0,r.default)(this.value,n,e);t.set(n,o)}else if(t instanceof Set)t.add(n);else{const o=((e,t,n)=>null===t?"":"object"!=typeof t?String(t):e instanceof a.default&&n&&n.doc?e.toString({anchors:{},doc:n.doc,indent:"",inFlow:!0,inStringifyKey:!0}):JSON.stringify(t))(this.key,n,e);t[o]=(0,r.default)(this.value,o,e)}return t}toJSON(e,t){const n=t&&t.mapAsMap?new Map:{};return this.addToJSMap(t,n)}toString(e,t,r){if(!e||!e.doc)return JSON.stringify(this);const{simpleKeys:i}=e.doc.options;let{key:c,value:u}=this,l=c instanceof a.default&&c.comment;if(i){if(l)throw new Error("With simple keys, key nodes cannot have comments");if(c instanceof o.default){throw new Error("With simple keys, collection cannot be used as a key value")}}const f=!i&&(!c||l||c instanceof o.default||c.type===h.Type.BLOCK_FOLDED||c.type===h.Type.BLOCK_LITERAL),{doc:d,indent:p}=e;e=Object.assign({},e,{implicitKey:!f,indent:p+" "});let g=!1,m=d.schema.stringify(c,e,()=>l=null,()=>g=!0);if(m=(0,n.default)(m,e.indent,l),e.allNullValues&&!i)return this.comment?(m=(0,n.default)(m,e.indent,this.comment),t&&t()):g&&!l&&r&&r(),e.inFlow?m:"? ".concat(m);m=f?"? ".concat(m,"\n").concat(p,":"):"".concat(m,":"),this.comment&&(m=(0,n.default)(m,e.indent,this.comment),t&&t());let y="",v=null;if(u instanceof a.default){if(u.spaceBefore&&(y="\n"),u.commentBefore){const t=u.commentBefore.replace(/^/gm,"".concat(e.indent,"#"));y+="\n".concat(t)}v=u.comment}else u&&"object"==typeof u&&(u=d.schema.createNode(u,!0));e.implicitKey=!1,!f&&!this.comment&&u instanceof s.default&&(e.indentAtStart=m.length+1),g=!1;const _=d.schema.stringify(u,e,()=>v=null,()=>g=!0);let b=" ";if(y||this.comment)b="".concat(y,"\n").concat(e.indent);else if(!f&&u instanceof o.default){("["===_[0]||"{"===_[0])&&!_.includes("\n")||(b="\n".concat(e.indent))}return g&&!v&&r&&r(),(0,n.default)(m+b+_,e.indent,v)}}t.default=c}));o(j);var B=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.isEmptyPath=void 0;var n=s(x),r=s(I),o=s(j),a=s(R);function s(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){const n=t[e],o=Number.isInteger(n)&&n>=0?[]:{};o[n]=r,r=o}return e.createNode(r,!1)}const u=e=>null==e||"object"==typeof e&&e[Symbol.iterator]().next().done;t.isEmptyPath=u;class l extends r.default{constructor(e){super(),i(this,"items",[]),this.schema=e}addIn(e,t){if(u(e))this.add(t);else{const[n,...r]=e,o=this.get(n,!0);if(o instanceof l)o.addIn(r,t);else{if(void 0!==o||!this.schema)throw new Error("Expected YAML collection at ".concat(n,". Remaining path: ").concat(r));this.set(n,c(this.schema,r,t))}}}deleteIn([e,...t]){if(0===t.length)return this.delete(e);const n=this.get(e,!0);if(n instanceof l)return n.deleteIn(t);throw new Error("Expected YAML collection at ".concat(e,". Remaining path: ").concat(t))}getIn([e,...t],n){const r=this.get(e,!0);return 0===t.length?!n&&r instanceof a.default?r.value:r:r instanceof l?r.getIn(t,n):void 0}hasAllNullValues(){return this.items.every(e=>{if(!(e instanceof o.default))return!1;const t=e.value;return null==t||t instanceof a.default&&null==t.value&&!t.commentBefore&&!t.comment&&!t.tag})}hasIn([e,...t]){if(0===t.length)return this.has(e);const n=this.get(e,!0);return n instanceof l&&n.hasIn(t)}setIn([e,...t],n){if(0===t.length)this.set(e,n);else{const r=this.get(e,!0);if(r instanceof l)r.setIn(t,n);else{if(void 0!==r||!this.schema)throw new Error("Expected YAML collection at ".concat(e,". Remaining path: ").concat(t));this.set(e,c(this.schema,t,n))}}}toJSON(){return null}toString(e,{blockItem:t,flowChars:r,isMap:o,itemIndent:a},s,i){const{doc:c,indent:u}=e,f=this.type&&"FLOW"===this.type.substr(0,4)||e.inFlow;f&&(a+=" ");const d=o&&this.hasAllNullValues();e=Object.assign({},e,{allNullValues:d,indent:a,inFlow:f,type:null});let h=!1,p=!1;const g=this.items.reduce((t,r,o)=>{let s;r&&(!h&&r.spaceBefore&&t.push({type:"comment",str:""}),r.commentBefore&&r.commentBefore.match(/^.*$/gm).forEach(e=>{t.push({type:"comment",str:"#".concat(e)})}),r.comment&&(s=r.comment),f&&(!h&&r.spaceBefore||r.commentBefore||r.comment||r.key&&(r.key.commentBefore||r.key.comment)||r.value&&(r.value.commentBefore||r.value.comment))&&(p=!0)),h=!1;let i=c.schema.stringify(r,e,()=>s=null,()=>h=!0);return f&&!p&&i.includes("\n")&&(p=!0),f&&o<this.items.length-1&&(i+=","),i=(0,n.default)(i,a,s),h&&(s||f)&&(h=!1),t.push({type:"item",str:i}),t},[]);let m;if(0===g.length)m=r.start+r.end;else if(f){const{start:e,end:t}=r,n=g.map(e=>e.str);if(p||n.reduce((e,t)=>e+t.length+2,2)>l.maxFlowStringSingleLineLength){m=e;for(const e of n)m+=e?"\n ".concat(u).concat(e):"\n";m+="\n".concat(u).concat(t)}else m="".concat(e," ").concat(n.join(" ")," ").concat(t)}else{const e=g.map(t);m=e.shift();for(const t of e)m+=t?"\n".concat(u).concat(t):"\n"}return this.comment?(m+="\n"+this.comment.replace(/^/gm,"".concat(u,"#")),s&&s()):h&&i&&i(),m}}t.default=l,i(l,"maxFlowStringSingleLineLength",60)}));o(B);B.isEmptyPath;var D=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=s(k),r=s(B),o=s(I),a=s(j);function s(e){return e&&e.__esModule?e:{default:e}}const i=(e,t)=>{if(e instanceof c){const n=t.find(t=>t.node===e.source);return n.count*n.aliasCount}if(e instanceof r.default){let n=0;for(const r of e.items){const e=i(r,t);e>n&&(n=e)}return n}if(e instanceof a.default){const n=i(e.key,t),r=i(e.value,t);return Math.max(n,r)}return 1};class c extends o.default{static stringify({range:e,source:t},{anchors:n,doc:r,implicitKey:o,inStringifyKey:a}){let s=Object.keys(n).find(e=>n[e]===t);if(!s&&a&&(s=r.anchors.getName(t)||r.anchors.newName()),s)return"*".concat(s).concat(o?" ":"");const i=r.anchors.getName(t)?"Alias node must be after source node":"Source node not found for alias node";throw new Error("".concat(i," [").concat(e,"]"))}constructor(e){super(),this.source=e,this.type=h.Type.ALIAS}set tag(e){throw new Error("Alias nodes cannot have tags")}toJSON(e,t){if(!t)return(0,n.default)(this.source,e,t);const{anchors:r,maxAliasCount:o}=t,a=r.find(e=>e.node===this.source);if(!a||void 0===a.res){const e="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new y.YAMLReferenceError(this.cstNode,e):new ReferenceError(e)}if(o>=0&&(a.count+=1,0===a.aliasCount&&(a.aliasCount=i(this.source,r)),a.count*a.aliasCount>o)){const e="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new y.YAMLReferenceError(this.cstNode,e):new ReferenceError(e)}return a.res}toString(e){return c.stringify(this,e)}}var u,l,f;t.default=c,f=!0,(l="default")in(u=c)?Object.defineProperty(u,l,{value:f,enumerable:!0,configurable:!0,writable:!0}):u[l]=f}));o(D);var Y=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.findPair=s,t.default=void 0;var n=a(B),r=a(j),o=a(R);function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){const n=t instanceof o.default?t.value:t;for(const o of e)if(o instanceof r.default){if(o.key===t||o.key===n)return o;if(o.key&&o.key.value===n)return o}}class i extends n.default{add(e,t){e?e instanceof r.default||(e=new r.default(e.key||e,e.value)):e=new r.default(e);const n=s(this.items,e.key),o=this.schema&&this.schema.sortMapEntries;if(n){if(!t)throw new Error("Key ".concat(e.key," already set"));n.value=e.value}else if(o){const t=this.items.findIndex(t=>o(e,t)<0);-1===t?this.items.push(e):this.items.splice(t,0,e)}else this.items.push(e)}delete(e){const t=s(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=s(this.items,e),r=n&&n.value;return!t&&r instanceof o.default?r.value:r}has(e){return!!s(this.items,e)}set(e,t){this.add(new r.default(e,t),!0)}toJSON(e,t,n){const r=n?new n:t&&t.mapAsMap?new Map:{};t&&t.onCreate&&t.onCreate(r);for(const e of this.items)e.addToJSMap(t,r);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(const e of this.items)if(!(e instanceof r.default))throw new Error("Map items must all be pairs; found ".concat(JSON.stringify(e)," instead"));return super.toString(e,{blockItem:e=>e.str,flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:e.indent||""},t,n)}}t.default=i}));o(Y);Y.findPair;var F=a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(k),r=a(B),o=a(R);function a(e){return e&&e.__esModule?e:{default:e}}function s(e){let t=e instanceof o.default?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),Number.isInteger(t)&&t>=0?t:null