oapiex 0.3.8 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/acorn-e8W_D2c_.mjs +16 -0
- package/bin/angular-hFYH82G-.mjs +4 -0
- package/bin/babel-fr_lL9to.mjs +15 -0
- package/bin/cli.mjs +111 -13
- package/bin/estree-B-Lhm4Hd.mjs +44 -0
- package/bin/flow-BRS1FfP1.mjs +20 -0
- package/bin/glimmer-BtFpvZhb.mjs +37 -0
- package/bin/graphql-kQVq9UYo.mjs +28 -0
- package/bin/html-CIcRoqWL.mjs +25 -0
- package/bin/markdown-uvG4mxr8.mjs +62 -0
- package/bin/meriyah-DyP35pNK.mjs +5 -0
- package/bin/postcss-CbFXTw98.mjs +61 -0
- package/bin/typescript-BDVDge_O.mjs +21 -0
- package/bin/yaml-BNfwk1xa.mjs +159 -0
- package/dist/acorn-21ABnSdB.cjs +4971 -0
- package/dist/acorn-C_1S2EAj.mjs +4969 -0
- package/dist/angular-BV6jfWdp.cjs +4084 -0
- package/dist/angular-C66eBqoS.mjs +4082 -0
- package/dist/babel-Bz8pZo4b.cjs +9879 -0
- package/dist/babel-CsQd21KZ.mjs +9877 -0
- package/dist/estree-CzMW7i2J.mjs +7266 -0
- package/dist/estree-JnZk-Onr.cjs +7270 -0
- package/dist/flow-BiaXaApn.mjs +52913 -0
- package/dist/flow-nfncfm-z.cjs +52915 -0
- package/dist/glimmer-B6CdKQ-2.mjs +7532 -0
- package/dist/glimmer-CiwR9Elq.cjs +7536 -0
- package/dist/graphql-BHWygr4C.cjs +1950 -0
- package/dist/graphql-C2x1gvQd.mjs +1945 -0
- package/dist/html-2W-fjNa6.cjs +7143 -0
- package/dist/html-kerd4hOT.mjs +7138 -0
- package/dist/index.cjs +15635 -22
- package/dist/index.mjs +15622 -8
- package/dist/markdown-CbyydoYw.mjs +6877 -0
- package/dist/markdown-Ccw9NnJ_.cjs +6882 -0
- package/dist/meriyah-C4Gx_ouZ.mjs +7591 -0
- package/dist/meriyah-CUKcThLv.cjs +7593 -0
- package/dist/postcss-DtZ8UtYr.cjs +6782 -0
- package/dist/postcss-DuVmYBUE.mjs +6777 -0
- package/dist/typescript-DoEQusFy.mjs +22902 -0
- package/dist/typescript-I6QkuLBo.cjs +22904 -0
- package/dist/yaml-TADhykGS.mjs +5279 -0
- package/dist/yaml-jVlKqQbk.cjs +5285 -0
- package/package.json +16 -13
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(let c of r(i))!a.call(e,c)&&c!==o&&t(e,c,{get:()=>i[c],enumerable:!(s=n(i,c))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),u=o(e=>{var t={ANCHOR:`&`,COMMENT:`#`,TAG:`!`,DIRECTIVES_END:`-`,DOCUMENT_END:`.`},n={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`},r=`tag:yaml.org,2002:`,i={MAP:`tag:yaml.org,2002:map`,SEQ:`tag:yaml.org,2002:seq`,STR:`tag:yaml.org,2002:str`};function a(e){let t=[0],n=e.indexOf(`
|
|
2
|
+
`);for(;n!==-1;)n+=1,t.push(n),n=e.indexOf(`
|
|
3
|
+
`,n);return t}function o(e){let t,n;return typeof e==`string`?(t=a(e),n=e):(Array.isArray(e)&&(e=e[0]),e&&e.context&&(e.lineStarts||=a(e.context.src),t=e.lineStarts,n=e.context.src)),{lineStarts:t,src:n}}function s(e,t){if(typeof e!=`number`||e<0)return null;let{lineStarts:n,src:r}=o(t);if(!n||!r||e>r.length)return null;for(let t=0;t<n.length;++t){let r=n[t];if(e<r)return{line:t,col:e-n[t-1]+1};if(e===r)return{line:t+1,col:1}}let i=n.length;return{line:i,col:e-n[i-1]+1}}function c(e,t){let{lineStarts:n,src:r}=o(t);if(!n||!(e>=1)||e>n.length)return null;let i=n[e-1],a=n[e];for(;a&&a>i&&r[a-1]===`
|
|
4
|
+
`;)--a;return r.slice(i,a)}function l({start:e,end:t},n,r=80){let i=c(e.line,n);if(!i)return null;let{col:a}=e;if(i.length>r)if(a<=r-10)i=i.substr(0,r-1)+`…`;else{let e=Math.round(r/2);i.length>a+e&&(i=i.substr(0,a+e-1)+`…`),a-=i.length-r,i=`…`+i.substr(1-r)}let o=1,s=``;t&&(t.line===e.line&&a+(t.col-e.col)<=r+1?o=t.col-e.col:(o=Math.min(i.length+1,r)-a,s=`…`));let l=a>1?` `.repeat(a-1):``,u=`^`.repeat(o);return`${i}
|
|
5
|
+
${l}${u}${s}`}var u=class e{static copy(t){return new e(t.start,t.end)}constructor(e,t){this.start=e,this.end=t||e}isEmpty(){return typeof this.start!=`number`||!this.end||this.end<=this.start}setOrigRange(e,t){let{start:n,end:r}=this;if(e.length===0||r<=e[0])return this.origStart=n,this.origEnd=r,t;let i=t;for(;i<e.length&&!(e[i]>n);)++i;this.origStart=n+i;let a=i;for(;i<e.length&&!(e[i]>=r);)++i;return this.origEnd=r+i,a}},d=class e{static addStringTerminator(t,n,r){if(r[r.length-1]===`
|
|
6
|
+
`)return r;let i=e.endOfWhiteSpace(t,n);return i>=t.length||t[i]===`
|
|
7
|
+
`?r+`
|
|
8
|
+
`:r}static atDocumentBoundary(e,n,r){let i=e[n];if(!i)return!0;let a=e[n-1];if(a&&a!==`
|
|
9
|
+
`)return!1;if(r){if(i!==r)return!1}else if(i!==t.DIRECTIVES_END&&i!==t.DOCUMENT_END)return!1;let o=e[n+1],s=e[n+2];if(o!==i||s!==i)return!1;let c=e[n+3];return!c||c===`
|
|
10
|
+
`||c===` `||c===` `}static endOfIdentifier(e,t){let n=e[t],r=n===`<`,i=r?[`
|
|
11
|
+
`,` `,` `,`>`]:[`
|
|
12
|
+
`,` `,` `,`[`,`]`,`{`,`}`,`,`];for(;n&&i.indexOf(n)===-1;)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!==`
|
|
13
|
+
`;)n=e[t+=1];return t}static endOfWhiteSpace(e,t){let n=e[t];for(;n===` `||n===` `;)n=e[t+=1];return t}static startOfLine(e,t){let n=e[t-1];if(n===`
|
|
14
|
+
`)return t;for(;n&&n!==`
|
|
15
|
+
`;)n=e[--t];return t+1}static endOfBlockIndent(t,n,r){let i=e.endOfIndent(t,r);if(i>r+n)return i;{let n=e.endOfWhiteSpace(t,i),r=t[n];if(!r||r===`
|
|
16
|
+
`)return n}return null}static atBlank(e,t,n){let r=e[t];return r===`
|
|
17
|
+
`||r===` `||r===` `||n&&!r}static nextNodeIsIndented(e,t,n){return!e||t<0?!1:t>0?!0:n&&e===`-`}static normalizeOffset(t,n){let r=t[n];return r?r!==`
|
|
18
|
+
`&&t[n-1]===`
|
|
19
|
+
`?n-1:e.endOfWhiteSpace(t,n):n}static foldNewline(t,n,r){let i=0,a=!1,o=``,s=t[n+1];for(;s===` `||s===` `||s===`
|
|
20
|
+
`;){switch(s){case`
|
|
21
|
+
`:i=0,n+=1,o+=`
|
|
22
|
+
`;break;case` `:i<=r&&(a=!0),n=e.endOfWhiteSpace(t,n+2)-1;break;case` `:i+=1,n+=1;break}s=t[n+1]}return o||=` `,s&&i<=r&&(a=!0),{fold:o,offset:n,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;let{src:r}=this.context,i=this.props[e];return i&&r[i.start]===t?r.slice(i.start+ +!!n,i.end):null}get anchor(){for(let e=0;e<this.props.length;++e){let n=this.getPropValue(e,t.ANCHOR,!0);if(n!=null)return n}return null}get comment(){let e=[];for(let n=0;n<this.props.length;++n){let r=this.getPropValue(n,t.COMMENT,!0);r!=null&&e.push(r)}return e.length>0?e.join(`
|
|
23
|
+
`):null}commentHasRequiredWhitespace(t){let{src:n}=this.context;if(this.header&&t===this.header.end||!this.valueRange)return!1;let{end:r}=this.valueRange;return t!==r||e.atBlank(n,r-1)}get hasComment(){if(this.context){let{src:e}=this.context;for(let n=0;n<this.props.length;++n)if(e[this.props[n].start]===t.COMMENT)return!0}return!1}get hasProps(){if(this.context){let{src:e}=this.context;for(let n=0;n<this.props.length;++n)if(e[this.props[n].start]!==t.COMMENT)return!0}return!1}get includesTrailingLines(){return!1}get jsonLike(){return[n.FLOW_MAP,n.FLOW_SEQ,n.QUOTE_DOUBLE,n.QUOTE_SINGLE].indexOf(this.type)!==-1}get rangeAsLinePos(){if(!this.range||!this.context)return;let e=s(this.range.start,this.context.root);if(e)return{start:e,end:s(this.range.end,this.context.root)}}get rawValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:t}=this.valueRange;return this.context.src.slice(e,t)}get tag(){for(let e=0;e<this.props.length;++e){let n=this.getPropValue(e,t.TAG,!1);if(n!=null){if(n[1]===`<`)return{verbatim:n.slice(2,-1)};{let[e,t,r]=n.match(/^(.*!)([^!]*)$/);return{handle:t,suffix:r}}}}return null}get valueRangeContainsNewline(){if(!this.valueRange||!this.context)return!1;let{start:e,end:t}=this.valueRange,{src:n}=this.context;for(let r=e;r<t;++r)if(n[r]===`
|
|
24
|
+
`)return!0;return!1}parseComment(n){let{src:r}=this.context;if(r[n]===t.COMMENT){let t=e.endOfLine(r,n+1),i=new u(n,t);return this.props.push(i),t}return n}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(){let{context:{src:t},range:n,value:r}=this;if(r!=null)return r;let i=t.slice(n.start,n.end);return e.addStringTerminator(t,n.end,i)}},f=class extends Error{constructor(e,t,n){if(!n||!(t instanceof d))throw Error(`Invalid arguments for new ${e}`);super(),this.name=e,this.message=n,this.source=t}makePretty(){if(!this.source)return;this.nodeType=this.source.type;let e=this.source.context&&this.source.context.root;if(typeof this.offset==`number`){this.range=new u(this.offset,this.offset+1);let t=e&&s(this.offset,e);if(t){let 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){let{line:t,col:n}=this.linePos.start;this.message+=` at line ${t}, column ${n}`;let r=e&&l(this.linePos,e);r&&(this.message+=`:
|
|
25
|
+
|
|
26
|
+
${r}
|
|
27
|
+
`)}delete this.source}},p=class extends f{constructor(e,t){super(`YAMLReferenceError`,e,t)}},m=class extends f{constructor(e,t){super(`YAMLSemanticError`,e,t)}},h=class extends f{constructor(e,t){super(`YAMLSyntaxError`,e,t)}},g=class extends f{constructor(e,t){super(`YAMLWarning`,e,t)}};function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=class e extends d{static endOfLine(e,t,n){let r=e[t],i=t;for(;r&&r!==`
|
|
28
|
+
`&&!(n&&(r===`[`||r===`]`||r===`{`||r===`}`||r===`,`));){let t=e[i+1];if(r===`:`&&(!t||t===`
|
|
29
|
+
`||t===` `||t===` `||n&&t===`,`)||(r===` `||r===` `)&&t===`#`)break;i+=1,r=t}return i}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:t}=this.valueRange,{src:n}=this.context,r=n[t-1];for(;e<t&&(r===`
|
|
30
|
+
`||r===` `||r===` `);)r=n[--t-1];let i=``;for(let r=e;r<t;++r){let e=n[r];if(e===`
|
|
31
|
+
`){let{fold:e,offset:t}=d.foldNewline(n,r,-1);i+=e,r=t}else if(e===` `||e===` `){let a=r,o=n[r+1];for(;r<t&&(o===` `||o===` `);)r+=1,o=n[r+1];o!==`
|
|
32
|
+
`&&(i+=r>a?n.slice(a,r+1):e)}else i+=e}let a=n[e];switch(a){case` `:return{errors:[new m(this,`Plain value cannot start with a tab character`)],str:i};case`@`:case"`":{let e=`Plain value cannot start with reserved character ${a}`;return{errors:[new m(this,e)],str:i}}default:return i}}parseBlockValue(t){let{indent:n,inFlow:r,src:i}=this.context,a=t,o=t;for(let t=i[a];t===`
|
|
33
|
+
`&&!d.atDocumentBoundary(i,a+1);t=i[a]){let t=d.endOfBlockIndent(i,n,a+1);if(t===null||i[t]===`#`)break;i[t]===`
|
|
34
|
+
`?a=t:(o=e.endOfLine(i,t,r),a=o)}return this.valueRange.isEmpty()&&(this.valueRange.start=t),this.valueRange.end=o,o}parse(t,n){this.context=t;let{inFlow:r,src:i}=t,a=n,o=i[a];return o&&o!==`#`&&o!==`
|
|
35
|
+
`&&(a=e.endOfLine(i,n,r)),this.valueRange=new u(n,a),a=d.endOfWhiteSpace(i,a),a=this.parseComment(a),(!this.hasComment||this.valueRange.isEmpty())&&(a=this.parseBlockValue(a)),a}};e.Char=t,e.Node=d,e.PlainValue=v,e.Range=u,e.Type=n,e.YAMLError=f,e.YAMLReferenceError=p,e.YAMLSemanticError=m,e.YAMLSyntaxError=h,e.YAMLWarning=g,e._defineProperty=_,e.defaultTagPrefix=r,e.defaultTags=i}),d=o(e=>{var t=u(),n=class extends t.Node{constructor(){super(t.Type.BLANK_LINE)}get includesTrailingLines(){return!0}parse(e,n){return this.context=e,this.range=new t.Range(n,n+1),n+1}},r=class extends t.Node{constructor(e,t){super(e,t),this.node=null}get includesTrailingLines(){return!!this.node&&this.node.includesTrailingLines}parse(e,r){this.context=e;let{parseNode:i,src:a}=e,{atLineStart:o,lineStart:s}=e;!o&&this.type===t.Type.SEQ_ITEM&&(this.error=new t.YAMLSemanticError(this,`Sequence items must not have preceding content on the same line`));let c=o?r-s:e.indent,l=t.Node.endOfWhiteSpace(a,r+1),u=a[l],d=u===`#`,f=[],p=null;for(;u===`
|
|
36
|
+
`||u===`#`;){if(u===`#`){let e=t.Node.endOfLine(a,l+1);f.push(new t.Range(l,e)),l=e}else o=!0,s=l+1,a[t.Node.endOfWhiteSpace(a,s)]===`
|
|
37
|
+
`&&f.length===0&&(p=new n,s=p.parse({src:a},s)),l=t.Node.endOfIndent(a,s);u=a[l]}if(t.Node.nextNodeIsIndented(u,l-(s+c),this.type!==t.Type.SEQ_ITEM)?this.node=i({atLineStart:o,inCollection:!1,indent:c,lineStart:s,parent:this},l):u&&s>r+1&&(l=s-1),this.node){if(p){let t=e.parent.items||e.parent.contents;t&&t.push(p)}f.length&&Array.prototype.push.apply(this.props,f),l=this.node.range.end}else if(d){let e=f[0];this.props.push(e),l=e.end}else l=t.Node.endOfLine(a,r+1);let m=this.node?this.node.valueRange.end:l;return this.valueRange=new t.Range(r,m),l}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.node?this.node.setOrigRanges(e,t):t}toString(){let{context:{src:e},node:n,range:r,value:i}=this;if(i!=null)return i;let a=n?e.slice(r.start,n.range.start)+String(n):e.slice(r.start,r.end);return t.Node.addStringTerminator(e,r.end,a)}},i=class extends t.Node{constructor(){super(t.Type.COMMENT)}parse(e,n){this.context=e;let r=this.parseComment(n);return this.range=new t.Range(n,r),r}};function a(e){let n=e;for(;n instanceof r;)n=n.node;if(!(n instanceof o))return null;let i=n.items.length,a=-1;for(let e=i-1;e>=0;--e){let r=n.items[e];if(r.type===t.Type.COMMENT){let{indent:t,lineStart:n}=r.context;if(t>0&&r.range.start>=n+t)break;a=e}else if(r.type===t.Type.BLANK_LINE)a=e;else break}if(a===-1)return null;let s=n.items.splice(a,i-a),c=s[0].range.start;for(;n.range.end=c,n.valueRange&&n.valueRange.end>c&&(n.valueRange.end=c),n!==e;)n=n.context.parent;return s}var o=class e extends t.Node{static nextContentHasIndent(n,r,i){let a=t.Node.endOfLine(n,r)+1;r=t.Node.endOfWhiteSpace(n,a);let o=n[r];return o?r>=a+i?!0:o!==`#`&&o!==`
|
|
38
|
+
`?!1:e.nextContentHasIndent(n,r,i):!1}constructor(e){super(e.type===t.Type.SEQ_ITEM?t.Type.SEQ:t.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);let n=e.props[0]||e.valueRange;e.range.start=n.start;break}this.items=[e];let n=a(e);n&&Array.prototype.push.apply(this.items,n)}get includesTrailingLines(){return this.items.length>0}parse(r,o){this.context=r;let{parseNode:s,src:c}=r,l=t.Node.startOfLine(c,o),u=this.items[0];u.context.parent=this,this.valueRange=t.Range.copy(u.valueRange);let d=u.range.start-u.context.lineStart,f=o;f=t.Node.normalizeOffset(c,f);let p=c[f],m=t.Node.endOfWhiteSpace(c,l)===f,h=!1;for(;p;){for(;p===`
|
|
39
|
+
`||p===`#`;){if(m&&p===`
|
|
40
|
+
`&&!h){let e=new n;if(f=e.parse({src:c},f),this.valueRange.end=f,f>=c.length){p=null;break}this.items.push(e),--f}else if(p===`#`){if(f<l+d&&!e.nextContentHasIndent(c,f,d))return f;let t=new i;if(f=t.parse({indent:d,lineStart:l,src:c},f),this.items.push(t),this.valueRange.end=f,f>=c.length){p=null;break}}if(l=f+1,f=t.Node.endOfIndent(c,l),t.Node.atBlank(c,f)){let e=t.Node.endOfWhiteSpace(c,f),n=c[e];(!n||n===`
|
|
41
|
+
`||n===`#`)&&(f=e)}p=c[f],m=!0}if(!p)break;if(f!==l+d&&(m||p!==`:`))if(f<l+d){l>o&&(f=l);break}else this.error||=new t.YAMLSyntaxError(this,`All collection items must start at the same column`);if(u.type===t.Type.SEQ_ITEM){if(p!==`-`){l>o&&(f=l);break}}else if(p===`-`&&!this.error){let e=c[f+1];(!e||e===`
|
|
42
|
+
`||e===` `||e===` `)&&(this.error=new t.YAMLSyntaxError(this,`A collection cannot be both a mapping and a sequence`))}let r=s({atLineStart:m,inCollection:!0,indent:d,lineStart:l,parent:this},f);if(!r)return f;if(this.items.push(r),this.valueRange.end=r.valueRange.end,f=t.Node.normalizeOffset(c,r.range.end),p=c[f],m=!1,h=r.includesTrailingLines,p){let e=f-1,t=c[e];for(;t===` `||t===` `;)t=c[--e];t===`
|
|
43
|
+
`&&(l=e+1,m=!0)}let g=a(r);g&&Array.prototype.push.apply(this.items,g)}return f}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.items.forEach(n=>{t=n.setOrigRanges(e,t)}),t}toString(){let{context:{src:e},items:n,range:r,value:i}=this;if(i!=null)return i;let a=e.slice(r.start,n[0].range.start)+String(n[0]);for(let e=1;e<n.length;++e){let t=n[e],{atLineStart:r,indent:i}=t.context;if(r)for(let e=0;e<i;++e)a+=` `;a+=String(t)}return t.Node.addStringTerminator(e,r.end,a)}},s=class extends t.Node{constructor(){super(t.Type.DIRECTIVE),this.name=null}get parameters(){let e=this.rawValue;return e?e.trim().split(/[ \t]+/):[]}parseName(e){let{src:t}=this.context,n=e,r=t[n];for(;r&&r!==`
|
|
44
|
+
`&&r!==` `&&r!==` `;)r=t[n+=1];return this.name=t.slice(e,n),n}parseParameters(e){let{src:n}=this.context,r=e,i=n[r];for(;i&&i!==`
|
|
45
|
+
`&&i!==`#`;)i=n[r+=1];return this.valueRange=new t.Range(e,r),r}parse(e,n){this.context=e;let r=this.parseName(n+1);return r=this.parseParameters(r),r=this.parseComment(r),this.range=new t.Range(n,r),r}},c=class e extends t.Node{static startCommentOrEndBlankLine(e,n){let r=t.Node.endOfWhiteSpace(e,n),i=e[r];return i===`#`||i===`
|
|
46
|
+
`?r:n}constructor(){super(t.Type.DOCUMENT),this.directives=null,this.contents=null,this.directivesEndMarker=null,this.documentEndMarker=null}parseDirectives(r){let{src:a}=this.context;this.directives=[];let o=!0,c=!1,l=r;for(;!t.Node.atDocumentBoundary(a,l,t.Char.DIRECTIVES_END);)switch(l=e.startCommentOrEndBlankLine(a,l),a[l]){case`
|
|
47
|
+
`:if(o){let e=new n;l=e.parse({src:a},l),l<a.length&&this.directives.push(e)}else l+=1,o=!0;break;case`#`:{let e=new i;l=e.parse({src:a},l),this.directives.push(e),o=!1}break;case`%`:{let e=new s;l=e.parse({parent:this,src:a},l),this.directives.push(e),c=!0,o=!1}break;default:return c?this.error=new t.YAMLSemanticError(this,`Missing directives-end indicator line`):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),l}return a[l]?(this.directivesEndMarker=new t.Range(l,l+3),l+3):(c?this.error=new t.YAMLSemanticError(this,`Missing directives-end indicator line`):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),l)}parseContents(r){let{parseNode:o,src:s}=this.context;this.contents||=[];let c=r;for(;s[c-1]===`-`;)--c;let l=t.Node.endOfWhiteSpace(s,r),u=c===r;for(this.valueRange=new t.Range(l);!t.Node.atDocumentBoundary(s,l,t.Char.DOCUMENT_END);){switch(s[l]){case`
|
|
48
|
+
`:if(u){let e=new n;l=e.parse({src:s},l),l<s.length&&this.contents.push(e)}else l+=1,u=!0;c=l;break;case`#`:{let e=new i;l=e.parse({src:s},l),this.contents.push(e),u=!1}break;default:{let e=t.Node.endOfIndent(s,l),n=o({atLineStart:u,indent:-1,inFlow:!1,inCollection:!1,lineStart:c,parent:this},e);if(!n)return this.valueRange.end=e;this.contents.push(n),l=n.range.end,u=!1;let r=a(n);r&&Array.prototype.push.apply(this.contents,r)}}l=e.startCommentOrEndBlankLine(s,l)}if(this.valueRange.end=l,s[l]&&(this.documentEndMarker=new t.Range(l,l+3),l+=3,s[l])){if(l=t.Node.endOfWhiteSpace(s,l),s[l]===`#`){let e=new i;l=e.parse({src:s},l),this.contents.push(e)}switch(s[l]){case`
|
|
49
|
+
`:l+=1;break;case void 0:break;default:this.error=new t.YAMLSyntaxError(this,`Document end marker line cannot have a non-comment suffix`)}}return l}parse(e,t){e.root=this,this.context=e;let{src:n}=e,r=n.charCodeAt(t)===65279?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(){let{contents:e,directives:n,value:r}=this;if(r!=null)return r;let i=n.join(``);return e.length>0&&((n.length>0||e[0].type===t.Type.COMMENT)&&(i+=`---
|
|
50
|
+
`),i+=e.join(``)),i[i.length-1]!==`
|
|
51
|
+
`&&(i+=`
|
|
52
|
+
`),i}},l=class extends t.Node{parse(e,n){this.context=e;let{src:r}=e,i=t.Node.endOfIdentifier(r,n+1);return this.valueRange=new t.Range(n+1,i),i=t.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i}},d={CLIP:`CLIP`,KEEP:`KEEP`,STRIP:`STRIP`},f=class extends t.Node{constructor(e,t){super(e,t),this.blockIndent=null,this.chomping=d.CLIP,this.header=null}get includesTrailingLines(){return this.chomping===d.KEEP}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:n}=this.valueRange,{indent:r,src:i}=this.context;if(this.valueRange.isEmpty())return``;let a=null,o=i[n-1];for(;o===`
|
|
53
|
+
`||o===` `||o===` `;){if(--n,n<=e){if(this.chomping===d.KEEP)break;return``}o===`
|
|
54
|
+
`&&(a=n),o=i[n-1]}let s=n+1;a&&(this.chomping===d.KEEP?(s=a,n=this.valueRange.end):n=a);let c=r+this.blockIndent,l=this.type===t.Type.BLOCK_FOLDED,u=!0,f=``,p=``,m=!1;for(let r=e;r<n;++r){for(let e=0;e<c&&i[r]===` `;++e)r+=1;let e=i[r];if(e===`
|
|
55
|
+
`)p===`
|
|
56
|
+
`?f+=`
|
|
57
|
+
`:p=`
|
|
58
|
+
`;else{let a=t.Node.endOfLine(i,r),o=i.slice(r,a);r=a,l&&(e===` `||e===` `)&&r<s?(p===` `?p=`
|
|
59
|
+
`:!m&&!u&&p===`
|
|
60
|
+
`&&(p=`
|
|
61
|
+
|
|
62
|
+
`),f+=p+o,p=a<n&&i[a]||``,m=!0):(f+=p+o,p=l&&r<s?` `:`
|
|
63
|
+
`,m=!1),u&&o!==``&&(u=!1)}}return this.chomping===d.STRIP?f:f+`
|
|
64
|
+
`}parseBlockHeader(e){let{src:n}=this.context,r=e+1,i=``;for(;;){let a=n[r];switch(a){case`-`:this.chomping=d.STRIP;break;case`+`:this.chomping=d.KEEP;break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:i+=a;break;default:return this.blockIndent=Number(i)||null,this.header=new t.Range(e,r),r}r+=1}}parseBlockValue(e){let{indent:n,src:r}=this.context,i=!!this.blockIndent,a=e,o=e,s=1;for(let e=r[a];e===`
|
|
65
|
+
`&&(a+=1,!t.Node.atDocumentBoundary(r,a));e=r[a]){let e=t.Node.endOfBlockIndent(r,n,a);if(e===null)break;let c=r[e],l=e-(a+n);if(this.blockIndent){if(c&&c!==`
|
|
66
|
+
`&&l<this.blockIndent){if(r[e]===`#`)break;if(!this.error){let e=`Block scalars must not be less indented than their ${i?`explicit indentation indicator`:`first line`}`;this.error=new t.YAMLSemanticError(this,e)}}}else r[e]===`
|
|
67
|
+
`?l>s&&(s=l):(l<s&&(this.error=new t.YAMLSemanticError(this,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`)),this.blockIndent=l);a=r[e]===`
|
|
68
|
+
`?e:o=t.Node.endOfLine(r,e)}return this.chomping!==d.KEEP&&(a=r[o]?o+1:o),this.valueRange=new t.Range(e+1,a),a}parse(e,n){this.context=e;let{src:r}=e,i=this.parseBlockHeader(n);return i=t.Node.endOfWhiteSpace(r,i),i=this.parseComment(i),i=this.parseBlockValue(i),i}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.header?this.header.setOrigRange(e,t):t}},p=class extends t.Node{constructor(e,t){super(e,t),this.items=null}prevNodeIsJsonLike(e=this.items.length){let n=this.items[e-1];return!!n&&(n.jsonLike||n.type===t.Type.COMMENT&&this.prevNodeIsJsonLike(e-1))}parse(e,r){this.context=e;let{parseNode:a,src:o}=e,{indent:s,lineStart:c}=e,l=o[r];this.items=[{char:l,offset:r}];let u=t.Node.endOfWhiteSpace(o,r+1);for(l=o[u];l&&l!==`]`&&l!==`}`;){switch(l){case`
|
|
69
|
+
`:if(c=u+1,o[t.Node.endOfWhiteSpace(o,c)]===`
|
|
70
|
+
`){let e=new n;c=e.parse({src:o},c),this.items.push(e)}u=t.Node.endOfIndent(o,c),u<=c+s&&(l=o[u],u<c+s||l!==`]`&&l!==`}`)&&(this.error=new t.YAMLSemanticError(this,`Insufficient indentation in flow collection`));break;case`,`:this.items.push({char:l,offset:u}),u+=1;break;case`#`:{let e=new i;u=e.parse({src:o},u),this.items.push(e)}break;case`?`:case`:`:{let e=o[u+1];if(e===`
|
|
71
|
+
`||e===` `||e===` `||e===`,`||l===`:`&&this.prevNodeIsJsonLike()){this.items.push({char:l,offset:u}),u+=1;break}}default:{let e=a({atLineStart:!1,inCollection:!1,inFlow:!0,indent:-1,lineStart:c,parent:this},u);if(!e)return this.valueRange=new t.Range(r,u),u;this.items.push(e),u=t.Node.normalizeOffset(o,e.range.end)}}u=t.Node.endOfWhiteSpace(o,u),l=o[u]}return this.valueRange=new t.Range(r,u+1),l&&(this.items.push({char:l,offset:u}),u=t.Node.endOfWhiteSpace(o,u+1),u=this.parseComment(u)),u}setOrigRanges(e,n){return n=super.setOrigRanges(e,n),this.items.forEach(r=>{if(r instanceof t.Node)n=r.setOrigRanges(e,n);else if(e.length===0)r.origOffset=r.offset;else{let t=n;for(;t<e.length&&!(e[t]>r.offset);)++t;r.origOffset=r.offset+t,n=t}}),n}toString(){let{context:{src:e},items:n,range:r,value:i}=this;if(i!=null)return i;let a=n.filter(e=>e instanceof t.Node),o=``,s=r.start;return a.forEach(t=>{let n=e.slice(s,t.range.start);s=t.range.end,o+=n+String(t),o[o.length-1]===`
|
|
72
|
+
`&&e[s-1]!==`
|
|
73
|
+
`&&e[s]===`
|
|
74
|
+
`&&(s+=1)}),o+=e.slice(s,r.end),t.Node.addStringTerminator(e,r.end,o)}},m=class e extends t.Node{static endOfQuote(e,t){let n=e[t];for(;n&&n!==`"`;)t+=n===`\\`?2:1,n=e[t];return t+1}get strValue(){if(!this.valueRange||!this.context)return null;let e=[],{start:n,end:r}=this.valueRange,{indent:i,src:a}=this.context;a[r-1]!==`"`&&e.push(new t.YAMLSyntaxError(this,`Missing closing "quote`));let o=``;for(let s=n+1;s<r-1;++s){let n=a[s];if(n===`
|
|
75
|
+
`){t.Node.atDocumentBoundary(a,s+1)&&e.push(new t.YAMLSemanticError(this,`Document boundary indicators are not allowed within string values`));let{fold:n,offset:r,error:c}=t.Node.foldNewline(a,s,i);o+=n,s=r,c&&e.push(new t.YAMLSemanticError(this,`Multi-line double-quoted string needs to be sufficiently indented`))}else if(n===`\\`)switch(s+=1,a[s]){case`0`:o+=`\0`;break;case`a`:o+=`\x07`;break;case`b`:o+=`\b`;break;case`e`:o+=`\x1B`;break;case`f`:o+=`\f`;break;case`n`:o+=`
|
|
76
|
+
`;break;case`r`:o+=`\r`;break;case`t`:o+=` `;break;case`v`:o+=`\v`;break;case`N`:o+=`
`;break;case`_`:o+=`\xA0`;break;case`L`:o+=`\u2028`;break;case`P`:o+=`\u2029`;break;case` `:o+=` `;break;case`"`:o+=`"`;break;case`/`:o+=`/`;break;case`\\`:o+=`\\`;break;case` `:o+=` `;break;case`x`:o+=this.parseCharCode(s+1,2,e),s+=2;break;case`u`:o+=this.parseCharCode(s+1,4,e),s+=4;break;case`U`:o+=this.parseCharCode(s+1,8,e),s+=8;break;case`
|
|
77
|
+
`:for(;a[s+1]===` `||a[s+1]===` `;)s+=1;break;default:e.push(new t.YAMLSyntaxError(this,`Invalid escape sequence ${a.substr(s-1,2)}`)),o+=`\\`+a[s]}else if(n===` `||n===` `){let e=s,t=a[s+1];for(;t===` `||t===` `;)s+=1,t=a[s+1];t!==`
|
|
78
|
+
`&&(o+=s>e?a.slice(e,s+1):n)}else o+=n}return e.length>0?{errors:e,str:o}:o}parseCharCode(e,n,r){let{src:i}=this.context,a=i.substr(e,n),o=a.length===n&&/^[0-9a-fA-F]+$/.test(a)?parseInt(a,16):NaN;return isNaN(o)?(r.push(new t.YAMLSyntaxError(this,`Invalid escape sequence ${i.substr(e-2,n+2)}`)),i.substr(e-2,n+2)):String.fromCodePoint(o)}parse(n,r){this.context=n;let{src:i}=n,a=e.endOfQuote(i,r+1);return this.valueRange=new t.Range(r,a),a=t.Node.endOfWhiteSpace(i,a),a=this.parseComment(a),a}},h=class e extends t.Node{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;let e=[],{start:n,end:r}=this.valueRange,{indent:i,src:a}=this.context;a[r-1]!==`'`&&e.push(new t.YAMLSyntaxError(this,`Missing closing 'quote`));let o=``;for(let s=n+1;s<r-1;++s){let n=a[s];if(n===`
|
|
79
|
+
`){t.Node.atDocumentBoundary(a,s+1)&&e.push(new t.YAMLSemanticError(this,`Document boundary indicators are not allowed within string values`));let{fold:n,offset:r,error:c}=t.Node.foldNewline(a,s,i);o+=n,s=r,c&&e.push(new t.YAMLSemanticError(this,`Multi-line single-quoted string needs to be sufficiently indented`))}else if(n===`'`)o+=n,s+=1,a[s]!==`'`&&e.push(new t.YAMLSyntaxError(this,`Unescaped single quote? This should not happen.`));else if(n===` `||n===` `){let e=s,t=a[s+1];for(;t===` `||t===` `;)s+=1,t=a[s+1];t!==`
|
|
80
|
+
`&&(o+=s>e?a.slice(e,s+1):n)}else o+=n}return e.length>0?{errors:e,str:o}:o}parse(n,r){this.context=n;let{src:i}=n,a=e.endOfQuote(i,r+1);return this.valueRange=new t.Range(r,a),a=t.Node.endOfWhiteSpace(i,a),a=this.parseComment(a),a}};function g(e,n){switch(e){case t.Type.ALIAS:return new l(e,n);case t.Type.BLOCK_FOLDED:case t.Type.BLOCK_LITERAL:return new f(e,n);case t.Type.FLOW_MAP:case t.Type.FLOW_SEQ:return new p(e,n);case t.Type.MAP_KEY:case t.Type.MAP_VALUE:case t.Type.SEQ_ITEM:return new r(e,n);case t.Type.COMMENT:case t.Type.PLAIN:return new t.PlainValue(e,n);case t.Type.QUOTE_DOUBLE:return new m(e,n);case t.Type.QUOTE_SINGLE:return new h(e,n);default:return null}}var _=class e{static parseType(e,n,r){switch(e[n]){case`*`:return t.Type.ALIAS;case`>`:return t.Type.BLOCK_FOLDED;case`|`:return t.Type.BLOCK_LITERAL;case`{`:return t.Type.FLOW_MAP;case`[`:return t.Type.FLOW_SEQ;case`?`:return!r&&t.Node.atBlank(e,n+1,!0)?t.Type.MAP_KEY:t.Type.PLAIN;case`:`:return!r&&t.Node.atBlank(e,n+1,!0)?t.Type.MAP_VALUE:t.Type.PLAIN;case`-`:return!r&&t.Node.atBlank(e,n+1,!0)?t.Type.SEQ_ITEM:t.Type.PLAIN;case`"`:return t.Type.QUOTE_DOUBLE;case`'`:return t.Type.QUOTE_SINGLE;default:return t.Type.PLAIN}}constructor(n={},{atLineStart:r,inCollection:i,inFlow:a,indent:s,lineStart:c,parent:l}={}){t._defineProperty(this,`parseNode`,(n,r)=>{if(t.Node.atDocumentBoundary(this.src,r))return null;let i=new e(this,n),{props:a,type:s,valueStart:c}=i.parseProps(r),l=g(s,a),u=l.parse(i,c);if(l.range=new t.Range(r,u),u<=r&&(l.error=Error(`Node#parse consumed no characters`),l.error.parseEnd=u,l.error.source=l,l.range.end=r+1),i.nodeStartsCollection(l)){!l.error&&!i.atLineStart&&i.parent.type===t.Type.DOCUMENT&&(l.error=new t.YAMLSyntaxError(l,`Block collection must not have preceding content here (e.g. directives-end indicator)`));let n=new o(l);return u=n.parse(new e(i),u),n.range=new t.Range(r,u),n}return l}),this.atLineStart=r??(n.atLineStart||!1),this.inCollection=i??(n.inCollection||!1),this.inFlow=a??(n.inFlow||!1),this.indent=s??n.indent,this.lineStart=c??n.lineStart,this.parent=l??(n.parent||{}),this.root=n.root,this.src=n.src}nodeStartsCollection(e){let{inCollection:n,inFlow:i,src:a}=this;if(n||i)return!1;if(e instanceof r)return!0;let o=e.range.end;return a[o]===`
|
|
81
|
+
`||a[o-1]===`
|
|
82
|
+
`?!1:(o=t.Node.endOfWhiteSpace(a,o),a[o]===`:`)}parseProps(n){let{inFlow:r,parent:i,src:a}=this,o=[],s=!1;n=this.atLineStart?t.Node.endOfIndent(a,n):t.Node.endOfWhiteSpace(a,n);let c=a[n];for(;c===t.Char.ANCHOR||c===t.Char.COMMENT||c===t.Char.TAG||c===`
|
|
83
|
+
`;){if(c===`
|
|
84
|
+
`){let e=n,r;do r=e+1,e=t.Node.endOfIndent(a,r);while(a[e]===`
|
|
85
|
+
`);let o=e-(r+this.indent),c=i.type===t.Type.SEQ_ITEM&&i.context.atLineStart;if(a[e]!==`#`&&!t.Node.nextNodeIsIndented(a[e],o,!c))break;this.atLineStart=!0,this.lineStart=r,s=!1,n=e}else if(c===t.Char.COMMENT){let e=t.Node.endOfLine(a,n+1);o.push(new t.Range(n,e)),n=e}else{let e=t.Node.endOfIdentifier(a,n+1);c===t.Char.TAG&&a[e]===`,`&&/^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(a.slice(n+1,e+13))&&(e=t.Node.endOfIdentifier(a,e+5)),o.push(new t.Range(n,e)),s=!0,n=t.Node.endOfWhiteSpace(a,e)}c=a[n]}return s&&c===`:`&&t.Node.atBlank(a,n+1,!0)&&--n,{props:o,type:e.parseType(a,n,r),valueStart:n}}};function v(e){let t=[];e.indexOf(`\r`)!==-1&&(e=e.replace(/\r\n?/g,(e,n)=>(e.length>1&&t.push(n),`
|
|
86
|
+
`)));let n=[],r=0;do{let t=new c,i=new _({src:e});r=t.parse(i,r),n.push(t)}while(r<e.length);return n.setOrigRanges=()=>{if(t.length===0)return!1;for(let e=1;e<t.length;++e)t[e]-=e;let e=0;for(let r=0;r<n.length;++r)e=n[r].setOrigRanges(t,e);return t.splice(0,t.length),!0},n.toString=()=>n.join(`...
|
|
87
|
+
`),n}e.parse=v}),f=o(e=>{var t=u();function n(e,t,n){return n?`#${n.replace(/[\s\S]^/gm,`$&${t}#`)}
|
|
88
|
+
${t}${e}`:e}function r(e,t,n){return n?n.indexOf(`
|
|
89
|
+
`)===-1?`${e} #${n}`:`${e}
|
|
90
|
+
`+n.replace(/^/gm,`${t||``}#`):e}var i=class{};function a(e,t,n){if(Array.isArray(e))return e.map((e,t)=>a(e,String(t),n));if(e&&typeof e.toJSON==`function`){let r=n&&n.anchors&&n.anchors.get(e);r&&(n.onCreate=e=>{r.res=e,delete n.onCreate});let i=e.toJSON(t,n);return r&&n.onCreate&&n.onCreate(i),i}return(!n||!n.keep)&&typeof e==`bigint`?Number(e):e}var o=class extends i{constructor(e){super(),this.value=e}toJSON(e,t){return t&&t.keep?this.value:a(this.value,e,t)}toString(){return String(this.value)}};function s(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else{let e={};Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0}),r=e}}return e.createNode(r,!1)}var c=e=>e==null||typeof e==`object`&&e[Symbol.iterator]().next().done,l=class e extends i{constructor(e){super(),t._defineProperty(this,`items`,[]),this.schema=e}addIn(t,n){if(c(t))this.add(n);else{let[r,...i]=t,a=this.get(r,!0);if(a instanceof e)a.addIn(i,n);else if(a===void 0&&this.schema)this.set(r,s(this.schema,i,n));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn([t,...n]){if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(r instanceof e)return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn([t,...n],r){let i=this.get(t,!0);return n.length===0?!r&&i instanceof o?i.value:i:i instanceof e?i.getIn(n,r):void 0}hasAllNullValues(){return this.items.every(e=>{if(!e||e.type!==`PAIR`)return!1;let t=e.value;return t==null||t instanceof o&&t.value==null&&!t.commentBefore&&!t.comment&&!t.tag})}hasIn([t,...n]){if(n.length===0)return this.has(t);let r=this.get(t,!0);return r instanceof e?r.hasIn(n):!1}setIn([t,...n],r){if(n.length===0)this.set(t,r);else{let i=this.get(t,!0);if(i instanceof e)i.setIn(n,r);else if(i===void 0&&this.schema)this.set(t,s(this.schema,n,r));else throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}}toJSON(){return null}toString(n,{blockItem:i,flowChars:a,isMap:o,itemIndent:s},c,l){let{indent:u,indentStep:d,stringify:f}=n,p=this.type===t.Type.FLOW_MAP||this.type===t.Type.FLOW_SEQ||n.inFlow;p&&(s+=d);let m=o&&this.hasAllNullValues();n=Object.assign({},n,{allNullValues:m,indent:s,inFlow:p,type:null});let h=!1,g=!1,_=this.items.reduce((e,t,i)=>{let a;t&&(!h&&t.spaceBefore&&e.push({type:`comment`,str:``}),t.commentBefore&&t.commentBefore.match(/^.*$/gm).forEach(t=>{e.push({type:`comment`,str:`#${t}`})}),t.comment&&(a=t.comment),p&&(!h&&t.spaceBefore||t.commentBefore||t.comment||t.key&&(t.key.commentBefore||t.key.comment)||t.value&&(t.value.commentBefore||t.value.comment))&&(g=!0)),h=!1;let o=f(t,n,()=>a=null,()=>h=!0);return p&&!g&&o.includes(`
|
|
91
|
+
`)&&(g=!0),p&&i<this.items.length-1&&(o+=`,`),o=r(o,s,a),h&&(a||p)&&(h=!1),e.push({type:`item`,str:o}),e},[]),v;if(_.length===0)v=a.start+a.end;else if(p){let{start:t,end:n}=a,r=_.map(e=>e.str);if(g||r.reduce((e,t)=>e+t.length+2,2)>e.maxFlowStringSingleLineLength){v=t;for(let e of r)v+=e?`
|
|
92
|
+
${d}${u}${e}`:`
|
|
93
|
+
`;v+=`
|
|
94
|
+
${u}${n}`}else v=`${t} ${r.join(` `)} ${n}`}else{let e=_.map(i);v=e.shift();for(let t of e)v+=t?`
|
|
95
|
+
${u}${t}`:`
|
|
96
|
+
`}return this.comment?(v+=`
|
|
97
|
+
`+this.comment.replace(/^/gm,`${u}#`),c&&c()):h&&l&&l(),v}};t._defineProperty(l,`maxFlowStringSingleLineLength`,60);function d(e){let t=e instanceof o?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),Number.isInteger(t)&&t>=0?t:null}var f=class extends l{add(e){this.items.push(e)}delete(e){let t=d(e);return typeof t==`number`?this.items.splice(t,1).length>0:!1}get(e,t){let n=d(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&r instanceof o?r.value:r}has(e){let t=d(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=d(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);this.items[n]=t}toJSON(e,t){let n=[];t&&t.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(a(e,String(r++),t));return n}toString(e,t,n){return e?super.toString(e,{blockItem:e=>e.type===`comment`?e.str:`- ${e.str}`,flowChars:{start:`[`,end:`]`},isMap:!1,itemIndent:(e.indent||``)+` `},t,n):JSON.stringify(this)}},p=(e,t,n)=>t===null?``:typeof t==`object`?e instanceof i&&n&&n.doc?e.toString({anchors:Object.create(null),doc:n.doc,indent:``,indentStep:n.indentStep,inFlow:!0,inStringifyKey:!0,stringify:n.stringify}):JSON.stringify(t):String(t),m=class e extends i{constructor(t,n=null){super(),this.key=t,this.value=n,this.type=e.Type.PAIR}get commentBefore(){return this.key instanceof i?this.key.commentBefore:void 0}set commentBefore(e){if(this.key??=new o(null),this.key instanceof i)this.key.commentBefore=e;else throw Error(`Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.`)}addToJSMap(e,t){let n=a(this.key,``,e);if(t instanceof Map){let r=a(this.value,n,e);t.set(n,r)}else if(t instanceof Set)t.add(n);else{let r=p(this.key,n,e),i=a(this.value,r,e);r in t?Object.defineProperty(t,r,{value:i,writable:!0,enumerable:!0,configurable:!0}):t[r]=i}return t}toJSON(e,t){let n=t&&t.mapAsMap?new Map:{};return this.addToJSMap(t,n)}toString(e,n,a){if(!e||!e.doc)return JSON.stringify(this);let{indent:s,indentSeq:c,simpleKeys:u}=e.doc.options,{key:d,value:p}=this,m=d instanceof i&&d.comment;if(u){if(m)throw Error(`With simple keys, key nodes cannot have comments`);if(d instanceof l)throw Error(`With simple keys, collection cannot be used as a key value`)}let h=!u&&(!d||m||(d instanceof i?d instanceof l||d.type===t.Type.BLOCK_FOLDED||d.type===t.Type.BLOCK_LITERAL:typeof d==`object`)),{doc:g,indent:_,indentStep:v,stringify:y}=e;e=Object.assign({},e,{implicitKey:!h,indent:_+v});let b=!1,x=y(d,e,()=>m=null,()=>b=!0);if(x=r(x,e.indent,m),!h&&x.length>1024){if(u)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);h=!0}if(e.allNullValues&&!u)return this.comment?(x=r(x,e.indent,this.comment),n&&n()):b&&!m&&a&&a(),e.inFlow&&!h?x:`? ${x}`;x=h?`? ${x}
|
|
98
|
+
${_}:`:`${x}:`,this.comment&&(x=r(x,e.indent,this.comment),n&&n());let S=``,C=null;if(p instanceof i){if(p.spaceBefore&&(S=`
|
|
99
|
+
`),p.commentBefore){let t=p.commentBefore.replace(/^/gm,`${e.indent}#`);S+=`
|
|
100
|
+
${t}`}C=p.comment}else p&&typeof p==`object`&&(p=g.schema.createNode(p,!0));e.implicitKey=!1,!h&&!this.comment&&p instanceof o&&(e.indentAtStart=x.length+1),b=!1,!c&&s>=2&&!e.inFlow&&!h&&p instanceof f&&p.type!==t.Type.FLOW_SEQ&&!p.tag&&!g.anchors.getName(p)&&(e.indent=e.indent.substr(2));let w=y(p,e,()=>C=null,()=>b=!0),T=` `;return S||this.comment?T=`${S}
|
|
101
|
+
${e.indent}`:!h&&p instanceof l?(!(w[0]===`[`||w[0]===`{`)||w.includes(`
|
|
102
|
+
`))&&(T=`
|
|
103
|
+
${e.indent}`):w[0]===`
|
|
104
|
+
`&&(T=``),b&&!C&&a&&a(),r(x+T+w,e.indent,C)}};t._defineProperty(m,`Type`,{PAIR:`PAIR`,MERGE_PAIR:`MERGE_PAIR`});var h=(e,t)=>{if(e instanceof g){let n=t.get(e.source);return n.count*n.aliasCount}else if(e instanceof l){let n=0;for(let r of e.items){let e=h(r,t);e>n&&(n=e)}return n}else if(e instanceof m){let n=h(e.key,t),r=h(e.value,t);return Math.max(n,r)}return 1},g=class e extends i{static stringify({range:e,source:t},{anchors:n,doc:r,implicitKey:i,inStringifyKey:a}){let o=Object.keys(n).find(e=>n[e]===t);if(!o&&a&&(o=r.anchors.getName(t)||r.anchors.newName()),o)return`*${o}${i?` `:``}`;let s=r.anchors.getName(t)?`Alias node must be after source node`:`Source node not found for alias node`;throw Error(`${s} [${e}]`)}constructor(e){super(),this.source=e,this.type=t.Type.ALIAS}set tag(e){throw Error(`Alias nodes cannot have tags`)}toJSON(e,n){if(!n)return a(this.source,e,n);let{anchors:r,maxAliasCount:i}=n,o=r.get(this.source);if(!o||o.res===void 0){let e=`This should not happen: Alias anchor was not resolved?`;throw this.cstNode?new t.YAMLReferenceError(this.cstNode,e):ReferenceError(e)}if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=h(this.source,r)),o.count*o.aliasCount>i)){let e=`Excessive alias count indicates a resource exhaustion attack`;throw this.cstNode?new t.YAMLReferenceError(this.cstNode,e):ReferenceError(e)}return o.res}toString(t){return e.stringify(this,t)}};t._defineProperty(g,`default`,!0);function _(e,t){let n=t instanceof o?t.value:t;for(let r of e)if(r instanceof m&&(r.key===t||r.key===n||r.key&&r.key.value===n))return r}var v=class extends l{add(e,t){e?e instanceof m||(e=new m(e.key||e,e.value)):e=new m(e);let n=_(this.items,e.key),r=this.schema&&this.schema.sortMapEntries;if(n)if(t)n.value=e.value;else throw Error(`Key ${e.key} already set`);else if(r){let t=this.items.findIndex(t=>r(e,t)<0);t===-1?this.items.push(e):this.items.splice(t,0,e)}else this.items.push(e)}delete(e){let t=_(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=_(this.items,e),r=n&&n.value;return!t&&r instanceof o?r.value:r}has(e){return!!_(this.items,e)}set(e,t){this.add(new m(e,t),!0)}toJSON(e,t,n){let r=n?new n:t&&t.mapAsMap?new Map:{};t&&t.onCreate&&t.onCreate(r);for(let e of this.items)e.addToJSMap(t,r);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!(e instanceof m))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return super.toString(e,{blockItem:e=>e.str,flowChars:{start:`{`,end:`}`},isMap:!0,itemIndent:e.indent||``},t,n)}},y=`<<`,b=class extends m{constructor(e){if(e instanceof m){let t=e.value;t instanceof f||(t=new f,t.items.push(e.value),t.range=e.value.range),super(e.key,t),this.range=e.range}else super(new o(y),new f);this.type=m.Type.MERGE_PAIR}addToJSMap(e,t){for(let{source:n}of this.value.items){if(!(n instanceof v))throw Error(`Merge sources must be maps`);let r=n.toJSON(null,e,Map);for(let[e,n]of r)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}return t}toString(e,t){let n=this.value;if(n.items.length>1)return super.toString(e,t);this.value=n.items[0];let r=super.toString(e,t);return this.value=n,r}},x={defaultType:t.Type.BLOCK_LITERAL,lineWidth:76},S={trueStr:`true`,falseStr:`false`},C={asBigInt:!1},w={nullStr:`null`},T={defaultType:t.Type.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function E(e,t,n){for(let{format:n,test:r,resolve:i}of t)if(r){let t=e.match(r);if(t){let e=i.apply(null,t);return e instanceof o||(e=new o(e)),n&&(e.format=n),e}}return n&&(e=n(e)),new o(e)}var D=`flow`,O=`block`,k=`quoted`,A=(e,t)=>{let n=e[t+1];for(;n===` `||n===` `;){do n=e[t+=1];while(n&&n!==`
|
|
105
|
+
`);n=e[t+1]}return t};function j(e,t,n,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}){if(!i||i<0)return e;let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===O&&(h=A(e,h),h!==-1&&(d=h+c));for(let t;t=e[h+=1];){if(n===k&&t===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(t===`
|
|
106
|
+
`)n===O&&(h=A(e,h)),d=h+c,f=void 0;else{if(t===` `&&p&&p!==` `&&p!==`
|
|
107
|
+
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
|
|
108
|
+
`&&t!==` `&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(n===k){for(;p===` `||p===` `;)p=t,t=e[h+=1],m=!0;let n=h>_+1?h-2:g-1;if(u[n])return e;l.push(n),u[n]=!0,d=n+c,f=void 0}else m=!0}p=t}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`
|
|
109
|
+
${t}${e.slice(0,a)}`:(n===k&&u[i]&&(v+=`${e[i]}\\`),v+=`
|
|
110
|
+
${t}${e.slice(i+1,a)}`)}return v}var M=({indentAtStart:e})=>e?Object.assign({indentAtStart:e},T.fold):T.fold,N=e=>/^(%|---|\.\.\.)/m.test(e);function ee(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
|
|
111
|
+
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function P(e,t){let{implicitKey:n}=t,{jsonEncoding:r,minMultiLineLength:i}=T.doubleQuoted,a=JSON.stringify(e);if(r)return a;let o=t.indent||(N(e)?` `:``),s=``,c=0;for(let e=0,t=a[e];t;t=a[++e])if(t===` `&&a[e+1]===`\\`&&a[e+2]===`n`&&(s+=a.slice(c,e)+`\\ `,e+=1,c=e,t=`\\`),t===`\\`)switch(a[e+1]){case`u`:{s+=a.slice(c,e);let t=a.substr(e+2,4);switch(t){case`0000`:s+=`\\0`;break;case`0007`:s+=`\\a`;break;case`000b`:s+=`\\v`;break;case`001b`:s+=`\\e`;break;case`0085`:s+=`\\N`;break;case`00a0`:s+=`\\_`;break;case`2028`:s+=`\\L`;break;case`2029`:s+=`\\P`;break;default:t.substr(0,2)===`00`?s+=`\\x`+t.substr(2):s+=a.substr(e,6)}e+=5,c=e+1}break;case`n`:if(n||a[e+2]===`"`||a.length<i)e+=1;else{for(s+=a.slice(c,e)+`
|
|
112
|
+
|
|
113
|
+
`;a[e+2]===`\\`&&a[e+3]===`n`&&a[e+4]!==`"`;)s+=`
|
|
114
|
+
`,e+=2;s+=o,a[e+2]===` `&&(s+=`\\`),e+=1,c=e+1}break;default:e+=1}return s=c?s+a.slice(c):a,n?s:j(s,o,k,M(t))}function te(e,t){if(t.implicitKey){if(/\n/.test(e))return P(e,t)}else if(/[ \t]\n|\n[ \t]/.test(e))return P(e,t);let n=t.indent||(N(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&
|
|
115
|
+
${n}`)+`'`;return t.implicitKey?r:j(r,n,D,M(t))}function F({comment:e,type:n,value:r},i,a,o){if(/\n[\t ]+$/.test(r)||/^\s*$/.test(r))return P(r,i);let s=i.indent||(i.forceBlockIndent||N(r)?` `:``),c=s?`2`:`1`,l=n===t.Type.BLOCK_FOLDED?!1:n===t.Type.BLOCK_LITERAL?!0:!ee(r,T.fold.lineWidth,s.length),u=l?`|`:`>`;if(!r)return u+`
|
|
116
|
+
`;let d=``,f=``;if(r=r.replace(/[\n\t ]*$/,e=>{let t=e.indexOf(`
|
|
117
|
+
`);return t===-1?u+=`-`:(r===e||t!==e.length-1)&&(u+=`+`,o&&o()),f=e.replace(/\n$/,``),``}).replace(/^[\n ]*/,e=>{e.indexOf(` `)!==-1&&(u+=c);let t=e.match(/ +$/);return t?(d=e.slice(0,-t[0].length),t[0]):(d=e,``)}),f&&=f.replace(/\n+(?!\n|$)/g,`$&${s}`),d&&=d.replace(/\n+/g,`$&${s}`),e&&(u+=` #`+e.replace(/ ?[\r\n]+/g,` `),a&&a()),!r)return`${u}${c}
|
|
118
|
+
${s}${f}`;if(l)return r=r.replace(/\n+/g,`$&${s}`),`${u}
|
|
119
|
+
${s}${d}${r}${f}`;r=r.replace(/\n+/g,`
|
|
120
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${s}`);let p=j(`${d}${r}${f}`,s,O,T.fold);return`${u}
|
|
121
|
+
${s}${p}`}function I(e,r,i,a){let{comment:o,type:s,value:c}=e,{actualString:l,implicitKey:u,indent:d,inFlow:f}=r;if(u&&/[\n[\]{},]/.test(c)||f&&/[[\]{},]/.test(c))return P(c,r);if(!c||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return u||f||c.indexOf(`
|
|
122
|
+
`)===-1?c.indexOf(`"`)!==-1&&c.indexOf(`'`)===-1?te(c,r):P(c,r):F(e,r,i,a);if(!u&&!f&&s!==t.Type.PLAIN&&c.indexOf(`
|
|
123
|
+
`)!==-1)return F(e,r,i,a);if(d===``&&N(c))return r.forceBlockIndent=!0,F(e,r,i,a);let p=c.replace(/\n+/g,`$&
|
|
124
|
+
${d}`);if(l){let{tags:e}=r.doc.schema;if(typeof E(p,e,e.scalarFallback).value!=`string`)return P(c,r)}let m=u?p:j(p,d,D,M(r));return o&&!f&&(m.indexOf(`
|
|
125
|
+
`)!==-1||o.indexOf(`
|
|
126
|
+
`)!==-1)?(i&&i(),n(m,d,o)):m}function ne(e,n,r,i){let{defaultType:a}=T,{implicitKey:o,inFlow:s}=n,{type:c,value:l}=e;typeof l!=`string`&&(l=String(l),e=Object.assign({},e,{value:l}));let u=a=>{switch(a){case t.Type.BLOCK_FOLDED:case t.Type.BLOCK_LITERAL:return F(e,n,r,i);case t.Type.QUOTE_DOUBLE:return P(l,n);case t.Type.QUOTE_SINGLE:return te(l,n);case t.Type.PLAIN:return I(e,n,r,i);default:return null}};(c!==t.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(l)||(o||s)&&(c===t.Type.BLOCK_FOLDED||c===t.Type.BLOCK_LITERAL))&&(c=t.Type.QUOTE_DOUBLE);let d=u(c);if(d===null&&(d=u(a),d===null))throw Error(`Unsupported default string type ${a}`);return d}function re({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);if(!isFinite(r))return isNaN(r)?`.nan`:r<0?`-.inf`:`.inf`;let i=JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^\d/.test(i)){let e=i.indexOf(`.`);e<0&&(e=i.length,i+=`.`);let n=t-(i.length-e-1);for(;n-- >0;)i+=`0`}return i}function ie(e,n){let r,i;switch(n.type){case t.Type.FLOW_MAP:r=`}`,i=`flow map`;break;case t.Type.FLOW_SEQ:r=`]`,i=`flow sequence`;break;default:e.push(new t.YAMLSemanticError(n,`Not a flow collection!?`));return}let a;for(let e=n.items.length-1;e>=0;--e){let r=n.items[e];if(!r||r.type!==t.Type.COMMENT){a=r;break}}if(a&&a.char!==r){let o=`Expected ${i} to end with ${r}`,s;typeof a.offset==`number`?(s=new t.YAMLSemanticError(n,o),s.offset=a.offset+1):(s=new t.YAMLSemanticError(a,o),a.range&&a.range.end&&(s.offset=a.range.end-a.range.start)),e.push(s)}}function ae(e,n){let r=n.context.src[n.range.start-1];r!==`
|
|
127
|
+
`&&r!==` `&&r!==` `&&e.push(new t.YAMLSemanticError(n,`Comments must be separated from other tokens by white space characters`))}function oe(e,n){let r=String(n),i=r.substr(0,8)+`...`+r.substr(-8);return new t.YAMLSemanticError(e,`The "${i}" key is too long`)}function se(e,t){for(let{afterKey:n,before:r,comment:i}of t){let t=e.items[r];t?(n&&t.value&&(t=t.value),i===void 0?(n||!t.commentBefore)&&(t.spaceBefore=!0):t.commentBefore?t.commentBefore+=`
|
|
128
|
+
`+i:t.commentBefore=i):i!==void 0&&(e.comment?e.comment+=`
|
|
129
|
+
`+i:e.comment=i)}}function ce(e,t){let n=t.strValue;return n?typeof n==`string`?n:(n.errors.forEach(n=>{n.source||=t,e.errors.push(n)}),n.str):``}function le(e,n){let{handle:r,suffix:i}=n.tag,a=e.tagPrefixes.find(e=>e.handle===r);if(!a){let i=e.getDefaults().tagPrefixes;if(i&&(a=i.find(e=>e.handle===r)),!a)throw new t.YAMLSemanticError(n,`The ${r} tag handle is non-default and was not declared.`)}if(!i)throw new t.YAMLSemanticError(n,`The ${r} tag has no suffix.`);if(r===`!`&&(e.version||e.options.version)===`1.0`){if(i[0]===`^`)return e.warnings.push(new t.YAMLWarning(n,`YAML 1.0 ^ tag expansion is not supported`)),i;if(/[:/]/.test(i)){let e=i.match(/^([a-z0-9-]+)\/(.*)/i);return e?`tag:${e[1]}.yaml.org,2002:${e[2]}`:`tag:${i}`}}return a.prefix+decodeURIComponent(i)}function ue(e,n){let{tag:r,type:i}=n,a=!1;if(r){let{handle:i,suffix:o,verbatim:s}=r;if(s){if(s!==`!`&&s!==`!!`)return s;let r=`Verbatim tags aren't resolved, so ${s} is invalid.`;e.errors.push(new t.YAMLSemanticError(n,r))}else if(i===`!`&&!o)a=!0;else try{return le(e,n)}catch(t){e.errors.push(t)}}switch(i){case t.Type.BLOCK_FOLDED:case t.Type.BLOCK_LITERAL:case t.Type.QUOTE_DOUBLE:case t.Type.QUOTE_SINGLE:return t.defaultTags.STR;case t.Type.FLOW_MAP:case t.Type.MAP:return t.defaultTags.MAP;case t.Type.FLOW_SEQ:case t.Type.SEQ:return t.defaultTags.SEQ;case t.Type.PLAIN:return a?t.defaultTags.STR:null;default:return null}}function de(e,t,n){let{tags:r}=e.schema,i=[];for(let a of r)if(a.tag===n)if(a.test)i.push(a);else{let n=a.resolve(e,t);return n instanceof l?n:new o(n)}let a=ce(e,t);return typeof a==`string`&&i.length>0?E(a,i,r.scalarFallback):null}function L({type:e}){switch(e){case t.Type.FLOW_MAP:case t.Type.MAP:return t.defaultTags.MAP;case t.Type.FLOW_SEQ:case t.Type.SEQ:return t.defaultTags.SEQ;default:return t.defaultTags.STR}}function fe(e,n,r){try{let t=de(e,n,r);if(t)return r&&n.tag&&(t.tag=r),t}catch(t){return t.source||=n,e.errors.push(t),null}try{let i=L(n);if(!i)throw Error(`The tag ${r} is unavailable`);let a=`The tag ${r} is unavailable, falling back to ${i}`;e.warnings.push(new t.YAMLWarning(n,a));let o=de(e,n,i);return o.tag=r,o}catch(r){let i=new t.YAMLReferenceError(n,r.message);return i.stack=r.stack,e.errors.push(i),null}}var pe=e=>{if(!e)return!1;let{type:n}=e;return n===t.Type.MAP_KEY||n===t.Type.MAP_VALUE||n===t.Type.SEQ_ITEM};function me(e,n){let r={before:[],after:[]},i=!1,a=!1,o=pe(n.context.parent)?n.context.parent.props.concat(n.props):n.props;for(let{start:s,end:c}of o)switch(n.context.src[s]){case t.Char.COMMENT:{n.commentHasRequiredWhitespace(s)||e.push(new t.YAMLSemanticError(n,`Comments must be separated from other tokens by white space characters`));let{header:i,valueRange:a}=n;(a&&(s>a.start||i&&s>i.start)?r.after:r.before).push(n.context.src.slice(s+1,c));break}case t.Char.ANCHOR:i&&e.push(new t.YAMLSemanticError(n,`A node can have at most one anchor`)),i=!0;break;case t.Char.TAG:a&&e.push(new t.YAMLSemanticError(n,`A node can have at most one tag`)),a=!0;break}return{comments:r,hasAnchor:i,hasTag:a}}function he(e,n){let{anchors:r,errors:i,schema:a}=e;if(n.type===t.Type.ALIAS){let e=n.rawValue,a=r.getNode(e);if(!a){let r=`Aliased anchor not found: ${e}`;return i.push(new t.YAMLReferenceError(n,r)),null}let o=new g(a);return r._cstAliases.push(o),o}let o=ue(e,n);if(o)return fe(e,n,o);if(n.type!==t.Type.PLAIN){let e=`Failed to resolve ${n.type} node here`;return i.push(new t.YAMLSyntaxError(n,e)),null}try{return E(ce(e,n),a.tags,a.tags.scalarFallback)}catch(e){return e.source||=n,i.push(e),null}}function R(e,n){if(!n)return null;n.error&&e.errors.push(n.error);let{comments:r,hasAnchor:i,hasTag:a}=me(e.errors,n);if(i){let{anchors:t}=e,r=n.anchor,i=t.getNode(r);i&&(t.map[t.newName(r)]=i),t.map[r]=n}n.type===t.Type.ALIAS&&(i||a)&&e.errors.push(new t.YAMLSemanticError(n,`An alias node must not specify any properties`));let o=he(e,n);if(o){o.range=[n.range.start,n.range.end],e.options.keepCstNodes&&(o.cstNode=n),e.options.keepNodeTypes&&(o.type=n.type);let t=r.before.join(`
|
|
130
|
+
`);t&&(o.commentBefore=o.commentBefore?`${o.commentBefore}
|
|
131
|
+
${t}`:t);let i=r.after.join(`
|
|
132
|
+
`);i&&(o.comment=o.comment?`${o.comment}
|
|
133
|
+
${i}`:i)}return n.resolved=o}function ge(e,n){if(n.type!==t.Type.MAP&&n.type!==t.Type.FLOW_MAP){let r=`A ${n.type} node cannot be resolved as a mapping`;return e.errors.push(new t.YAMLSyntaxError(n,r)),null}let{comments:r,items:i}=n.type===t.Type.FLOW_MAP?be(e,n):ye(e,n),a=new v;a.items=i,se(a,r);let o=!1;for(let r=0;r<i.length;++r){let{key:a}=i[r];if(a instanceof l&&(o=!0),e.schema.merge&&a&&a.value===y){i[r]=new b(i[r]);let a=i[r].value.items,o=null;a.some(e=>{if(e instanceof g){let{type:n}=e.source;return n===t.Type.MAP||n===t.Type.FLOW_MAP?!1:o=`Merge nodes aliases can only point to maps`}return o=`Merge nodes can only have Alias nodes as values`}),o&&e.errors.push(new t.YAMLSemanticError(n,o))}else for(let o=r+1;o<i.length;++o){let{key:r}=i[o];if(a===r||a&&r&&Object.prototype.hasOwnProperty.call(a,`value`)&&a.value===r.value){let r=`Map keys must be unique; "${a}" is repeated`;e.errors.push(new t.YAMLSemanticError(n,r));break}}}return o&&!e.options.mapAsMap&&e.warnings.push(new t.YAMLWarning(n,`Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.`)),n.resolved=a,a}var _e=({context:{lineStart:e,node:n,src:r},props:i})=>{if(i.length===0)return!1;let{start:a}=i[0];if(n&&a>n.valueRange.start||r[a]!==t.Char.COMMENT)return!1;for(let t=e;t<a;++t)if(r[t]===`
|
|
134
|
+
`)return!1;return!0};function ve(e,n){if(!_e(e))return;let r=e.getPropValue(0,t.Char.COMMENT,!0),i=!1,a=n.value.commentBefore;if(a&&a.startsWith(r))n.value.commentBefore=a.substr(r.length+1),i=!0;else{let t=n.value.comment;!e.node&&t&&t.startsWith(r)&&(n.value.comment=t.substr(r.length+1),i=!0)}i&&(n.comment=r)}function ye(e,n){let r=[],i=[],a,o=null;for(let s=0;s<n.items.length;++s){let c=n.items[s];switch(c.type){case t.Type.BLANK_LINE:r.push({afterKey:!!a,before:i.length});break;case t.Type.COMMENT:r.push({afterKey:!!a,before:i.length,comment:c.comment});break;case t.Type.MAP_KEY:a!==void 0&&i.push(new m(a)),c.error&&e.errors.push(c.error),a=R(e,c.node),o=null;break;case t.Type.MAP_VALUE:{a===void 0&&(a=null),c.error&&e.errors.push(c.error),!c.context.atLineStart&&c.node&&c.node.type===t.Type.MAP&&!c.node.context.atLineStart&&e.errors.push(new t.YAMLSemanticError(c.node,`Nested mappings are not allowed in compact mappings`));let r=c.node;if(!r&&c.props.length>0){r=new t.PlainValue(t.Type.PLAIN,[]),r.context={parent:c,src:c.context.src};let e=c.range.start+1;if(r.range={start:e,end:e},r.valueRange={start:e,end:e},typeof c.range.origStart==`number`){let e=c.range.origStart+1;r.range.origStart=r.range.origEnd=e,r.valueRange.origStart=r.valueRange.origEnd=e}}let s=new m(a,R(e,r));ve(c,s),i.push(s),a&&typeof o==`number`&&c.range.start>o+1024&&e.errors.push(oe(n,a)),a=void 0,o=null}break;default:a!==void 0&&i.push(new m(a)),a=R(e,c),o=c.range.start,c.error&&e.errors.push(c.error);e:for(let r=s+1;;++r){let i=n.items[r];switch(i&&i.type){case t.Type.BLANK_LINE:case t.Type.COMMENT:continue e;case t.Type.MAP_VALUE:break e;default:e.errors.push(new t.YAMLSemanticError(c,`Implicit map keys need to be followed by map values`));break e}}c.valueRangeContainsNewline&&e.errors.push(new t.YAMLSemanticError(c,`Implicit map keys need to be on a single line`))}}return a!==void 0&&i.push(new m(a)),{comments:r,items:i}}function be(e,n){let r=[],i=[],a,o=!1,s=`{`;for(let c=0;c<n.items.length;++c){let l=n.items[c];if(typeof l.char==`string`){let{char:r,offset:u}=l;if(r===`?`&&a===void 0&&!o){o=!0,s=`:`;continue}if(r===`:`){if(a===void 0&&(a=null),s===`:`){s=`,`;continue}}else if(o&&=(a===void 0&&r!==`,`&&(a=null),!1),a!==void 0&&(i.push(new m(a)),a=void 0,r===`,`)){s=`:`;continue}if(r===`}`){if(c===n.items.length-1)continue}else if(r===s){s=`:`;continue}let d=`Flow map contains an unexpected ${r}`,f=new t.YAMLSyntaxError(n,d);f.offset=u,e.errors.push(f)}else l.type===t.Type.BLANK_LINE?r.push({afterKey:!!a,before:i.length}):l.type===t.Type.COMMENT?(ae(e.errors,l),r.push({afterKey:!!a,before:i.length,comment:l.comment})):a===void 0?(s===`,`&&e.errors.push(new t.YAMLSemanticError(l,`Separator , missing in flow map`)),a=R(e,l)):(s!==`,`&&e.errors.push(new t.YAMLSemanticError(l,`Indicator : missing in flow map entry`)),i.push(new m(a,R(e,l))),a=void 0,o=!1)}return ie(e.errors,n),a!==void 0&&i.push(new m(a)),{comments:r,items:i}}function xe(e,n){if(n.type!==t.Type.SEQ&&n.type!==t.Type.FLOW_SEQ){let r=`A ${n.type} node cannot be resolved as a sequence`;return e.errors.push(new t.YAMLSyntaxError(n,r)),null}let{comments:r,items:i}=n.type===t.Type.FLOW_SEQ?z(e,n):Se(e,n),a=new f;return a.items=i,se(a,r),!e.options.mapAsMap&&i.some(e=>e instanceof m&&e.key instanceof l)&&e.warnings.push(new t.YAMLWarning(n,`Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.`)),n.resolved=a,a}function Se(e,n){let r=[],i=[];for(let a=0;a<n.items.length;++a){let o=n.items[a];switch(o.type){case t.Type.BLANK_LINE:r.push({before:i.length});break;case t.Type.COMMENT:r.push({comment:o.comment,before:i.length});break;case t.Type.SEQ_ITEM:o.error&&e.errors.push(o.error),i.push(R(e,o.node)),o.hasProps&&e.errors.push(new t.YAMLSemanticError(o,`Sequence items cannot have tags or anchors before the - indicator`));break;default:o.error&&e.errors.push(o.error),e.errors.push(new t.YAMLSyntaxError(o,`Unexpected ${o.type} node in sequence`))}}return{comments:r,items:i}}function z(e,n){let r=[],i=[],a=!1,o,s=null,c=`[`,l=null;for(let u=0;u<n.items.length;++u){let d=n.items[u];if(typeof d.char==`string`){let{char:r,offset:f}=d;if(r!==`:`&&(a||o!==void 0)&&(a&&o===void 0&&(o=c?i.pop():null),i.push(new m(o)),a=!1,o=void 0,s=null),r===c)c=null;else if(!c&&r===`?`)a=!0;else if(c!==`[`&&r===`:`&&o===void 0){if(c===`,`){if(o=i.pop(),o instanceof m){let r=new t.YAMLSemanticError(n,`Chaining flow sequence pairs is invalid`);r.offset=f,e.errors.push(r)}if(!a&&typeof s==`number`){let r=d.range?d.range.start:d.offset;r>s+1024&&e.errors.push(oe(n,o));let{src:i}=l.context;for(let n=s;n<r;++n)if(i[n]===`
|
|
135
|
+
`){e.errors.push(new t.YAMLSemanticError(l,`Implicit keys of flow sequence pairs need to be on a single line`));break}}}else o=null;s=null,a=!1,c=null}else if(c===`[`||r!==`]`||u<n.items.length-1){let i=`Flow sequence contains an unexpected ${r}`,a=new t.YAMLSyntaxError(n,i);a.offset=f,e.errors.push(a)}}else if(d.type===t.Type.BLANK_LINE)r.push({before:i.length});else if(d.type===t.Type.COMMENT)ae(e.errors,d),r.push({comment:d.comment,before:i.length});else{if(c){let n=`Expected a ${c} in flow sequence`;e.errors.push(new t.YAMLSemanticError(d,n))}let n=R(e,d);o===void 0?(i.push(n),l=d):(i.push(new m(o,n)),o=void 0),s=d.range.start,c=`,`}}return ie(e.errors,n),o!==void 0&&i.push(new m(o)),{comments:r,items:i}}e.Alias=g,e.Collection=l,e.Merge=b,e.Node=i,e.Pair=m,e.Scalar=o,e.YAMLMap=v,e.YAMLSeq=f,e.addComment=r,e.binaryOptions=x,e.boolOptions=S,e.findPair=_,e.intOptions=C,e.isEmptyPath=c,e.nullOptions=w,e.resolveMap=ge,e.resolveNode=R,e.resolveSeq=xe,e.resolveString=ce,e.strOptions=T,e.stringifyNumber=re,e.stringifyString=ne,e.toJSON=a}),p=o(e=>{var t=u(),n=f(),r={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve:(e,r)=>{let i=n.resolveString(e,r);if(typeof Buffer==`function`)return Buffer.from(i,`base64`);if(typeof atob==`function`){let e=atob(i.replace(/[\n\r]/g,``)),t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}else return e.errors.push(new t.YAMLReferenceError(r,`This environment does not support reading binary tags; either Buffer or atob is required`)),null},options:n.binaryOptions,stringify:({comment:e,type:r,value:i},a,o,s)=>{let c;if(typeof Buffer==`function`)c=i instanceof Buffer?i.toString(`base64`):Buffer.from(i.buffer).toString(`base64`);else if(typeof btoa==`function`){let e=``;for(let t=0;t<i.length;++t)e+=String.fromCharCode(i[t]);c=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(r||=n.binaryOptions.defaultType,r===t.Type.QUOTE_DOUBLE)i=c;else{let{lineWidth:e}=n.binaryOptions,a=Math.ceil(c.length/e),o=Array(a);for(let t=0,n=0;t<a;++t,n+=e)o[t]=c.substr(n,e);i=o.join(r===t.Type.BLOCK_LITERAL?`
|
|
136
|
+
`:` `)}return n.stringifyString({comment:e,type:r,value:i},a,o,s)}};function i(e,r){let i=n.resolveSeq(e,r);for(let e=0;e<i.items.length;++e){let a=i.items[e];if(!(a instanceof n.Pair)){if(a instanceof n.YAMLMap){if(a.items.length>1)throw new t.YAMLSemanticError(r,`Each pair must have its own sequence indicator`);let e=a.items[0]||new n.Pair;a.commentBefore&&(e.commentBefore=e.commentBefore?`${a.commentBefore}
|
|
137
|
+
${e.commentBefore}`:a.commentBefore),a.comment&&(e.comment=e.comment?`${a.comment}
|
|
138
|
+
${e.comment}`:a.comment),a=e}i.items[e]=a instanceof n.Pair?a:new n.Pair(a)}}return i}function a(e,t,r){let i=new n.YAMLSeq(e);i.tag=`tag:yaml.org,2002:pairs`;for(let n of t){let t,a;if(Array.isArray(n))if(n.length===2)t=n[0],a=n[1];else throw TypeError(`Expected [key, value] tuple: ${n}`);else if(n&&n instanceof Object){let e=Object.keys(n);if(e.length===1)t=e[0],a=n[t];else throw TypeError(`Expected { key: value } tuple: ${n}`)}else t=n;let o=e.createPair(t,a,r);i.items.push(o)}return i}var o={default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:i,createNode:a},s=class e extends n.YAMLSeq{constructor(){super(),t._defineProperty(this,`add`,n.YAMLMap.prototype.add.bind(this)),t._defineProperty(this,`delete`,n.YAMLMap.prototype.delete.bind(this)),t._defineProperty(this,`get`,n.YAMLMap.prototype.get.bind(this)),t._defineProperty(this,`has`,n.YAMLMap.prototype.has.bind(this)),t._defineProperty(this,`set`,n.YAMLMap.prototype.set.bind(this)),this.tag=e.tag}toJSON(e,t){let r=new Map;t&&t.onCreate&&t.onCreate(r);for(let e of this.items){let i,a;if(e instanceof n.Pair?(i=n.toJSON(e.key,``,t),a=n.toJSON(e.value,i,t)):i=n.toJSON(e,``,t),r.has(i))throw Error(`Ordered maps must not include duplicate keys`);r.set(i,a)}return r}};t._defineProperty(s,`tag`,`tag:yaml.org,2002:omap`);function c(e,r){let a=i(e,r),o=[];for(let{key:e}of a.items)if(e instanceof n.Scalar){if(o.includes(e.value))throw new t.YAMLSemanticError(r,`Ordered maps must not include duplicate keys`);o.push(e.value)}return Object.assign(new s,a)}function l(e,t,n){let r=a(e,t,n),i=new s;return i.items=r.items,i}var d={identify:e=>e instanceof Map,nodeClass:s,default:!1,tag:`tag:yaml.org,2002:omap`,resolve:c,createNode:l},p=class e extends n.YAMLMap{constructor(){super(),this.tag=e.tag}add(e){let t=e instanceof n.Pair?e:new n.Pair(e);n.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let r=n.findPair(this.items,e);return!t&&r instanceof n.Pair?r.key instanceof n.Scalar?r.key.value:r.key:r}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=n.findPair(this.items,e);r&&!t?this.items.splice(this.items.indexOf(r),1):!r&&t&&this.items.push(new n.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(e,t,n);throw Error(`Set items must all have null values`)}};t._defineProperty(p,`tag`,`tag:yaml.org,2002:set`);function m(e,r){let i=n.resolveMap(e,r);if(!i.hasAllNullValues())throw new t.YAMLSemanticError(r,`Set items must all have null values`);return Object.assign(new p,i)}function h(e,t,n){let r=new p;for(let i of t)r.items.push(e.createPair(i,null,n));return r}var g={identify:e=>e instanceof Set,nodeClass:p,default:!1,tag:`tag:yaml.org,2002:set`,resolve:m,createNode:h},_=(e,t)=>{let n=t.split(`:`).reduce((e,t)=>e*60+Number(t),0);return e===`-`?-n:n},v=({value:e})=>{if(isNaN(e)||!isFinite(e))return n.stringifyNumber(e);let t=``;e<0&&(t=`-`,e=Math.abs(e));let r=[e%60];return e<60?r.unshift(0):(e=Math.round((e-r[0])/60),r.unshift(e%60),e>=60&&(e=Math.round((e-r[0])/60),r.unshift(e))),t+r.map(e=>e<10?`0`+String(e):String(e)).join(`:`).replace(/000000\d*$/,``)},y={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(e,t,n)=>_(t,n.replace(/_/g,``)),stringify:v},b={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(e,t,n)=>_(t,n.replace(/_/g,``)),stringify:v},x={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$`),resolve:(e,t,n,r,i,a,o,s,c)=>{s&&=(s+`00`).substr(1,3);let l=Date.UTC(t,n-1,r,i||0,a||0,o||0,s||0);if(c&&c!==`Z`){let e=_(c[0],c.slice(1));Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e.toISOString().replace(/((T00:00)?:00)?\.000Z$/,``)};function S(e){let t={};return e?typeof YAML_SILENCE_DEPRECATION_WARNINGS<`u`?!YAML_SILENCE_DEPRECATION_WARNINGS:!t.YAML_SILENCE_DEPRECATION_WARNINGS:typeof YAML_SILENCE_WARNINGS<`u`?!YAML_SILENCE_WARNINGS:!t.YAML_SILENCE_WARNINGS}function C(e,t){S(!1)&&console.warn(t?`${t}: ${e}`:e)}function w(e){S(!0)&&C(`The endpoint 'yaml/${e.replace(/.*yaml[/\\]/i,``).replace(/\.js$/,``).replace(/\\/g,`/`)}' will be removed in a future release.`,`DeprecationWarning`)}var T={};function E(e,t){if(!T[e]&&S(!0)){T[e]=!0;let n=`The option '${e}' will be removed in a future release`;n+=t?`, use '${t}' instead.`:`.`,C(n,`DeprecationWarning`)}}e.binary=r,e.floatTime=b,e.intTime=y,e.omap=d,e.pairs=o,e.set=g,e.timestamp=x,e.warn=C,e.warnFileDeprecation=w,e.warnOptionDeprecation=E}),m=o(e=>{var t=u(),n=f(),r=p();function i(e,t,r){let i=new n.YAMLMap(e);if(t instanceof Map)for(let[n,a]of t)i.items.push(e.createPair(n,a,r));else if(t&&typeof t==`object`)for(let n of Object.keys(t))i.items.push(e.createPair(n,t[n],r));return typeof e.sortMapEntries==`function`&&i.items.sort(e.sortMapEntries),i}var a={createNode:i,default:!0,nodeClass:n.YAMLMap,tag:`tag:yaml.org,2002:map`,resolve:n.resolveMap};function o(e,t,r){let i=new n.YAMLSeq(e);if(t&&t[Symbol.iterator])for(let n of t){let t=e.createNode(n,r.wrapScalars,null,r);i.items.push(t)}return i}var s={createNode:o,default:!0,nodeClass:n.YAMLSeq,tag:`tag:yaml.org,2002:seq`,resolve:n.resolveSeq},c=[a,s,{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:n.resolveString,stringify(e,t,r,i){return t=Object.assign({actualString:!0},t),n.stringifyString(e,t,r,i)},options:n.strOptions}],l=e=>typeof e==`bigint`||Number.isInteger(e),d=(e,t,r)=>n.intOptions.asBigInt?BigInt(e):parseInt(t,r);function m(e,t,r){let{value:i}=e;return l(i)&&i>=0?r+i.toString(t):n.stringifyNumber(e)}var h={identify:e=>e==null,createNode:(e,t,r)=>r.wrapScalars?new n.Scalar(null):null,default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:n.nullOptions,stringify:()=>n.nullOptions.nullStr},g={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>e[0]===`t`||e[0]===`T`,options:n.boolOptions,stringify:({value:e})=>e?n.boolOptions.trueStr:n.boolOptions.falseStr},_={identify:e=>l(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o([0-7]+)$/,resolve:(e,t)=>d(e,t,8),options:n.intOptions,stringify:e=>m(e,8,`0o`)},v={identify:l,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:e=>d(e,e,10),options:n.intOptions,stringify:n.stringifyNumber},y={identify:e=>l(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x([0-9a-fA-F]+)$/,resolve:(e,t)=>d(e,t,16),options:n.intOptions,stringify:e=>m(e,16,`0x`)},b={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(e,t)=>t?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber},x={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify:({value:e})=>Number(e).toExponential()},S={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(e,t,r){let i=t||r,a=new n.Scalar(parseFloat(e));return i&&i[i.length-1]===`0`&&(a.minFractionDigits=i.length),a},stringify:n.stringifyNumber},C=c.concat([h,g,_,v,y,b,x,S]),w=e=>typeof e==`bigint`||Number.isInteger(e),T=({value:e})=>JSON.stringify(e),E=[a,s,{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:n.resolveString,stringify:T},{identify:e=>e==null,createNode:(e,t,r)=>r.wrapScalars?new n.Scalar(null):null,default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:T},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true|false$/,resolve:e=>e===`true`,stringify:T},{identify:w,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:e=>n.intOptions.asBigInt?BigInt(e):parseInt(e,10),stringify:({value:e})=>w(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:T}];E.scalarFallback=e=>{throw SyntaxError(`Unresolved plain scalar ${JSON.stringify(e)}`)};var D=({value:e})=>e?n.boolOptions.trueStr:n.boolOptions.falseStr,O=e=>typeof e==`bigint`||Number.isInteger(e);function k(e,t,r){let i=t.replace(/_/g,``);if(n.intOptions.asBigInt){switch(r){case 2:i=`0b${i}`;break;case 8:i=`0o${i}`;break;case 16:i=`0x${i}`;break}let t=BigInt(i);return e===`-`?BigInt(-1)*t:t}let a=parseInt(i,r);return e===`-`?-1*a:a}function A(e,t,r){let{value:i}=e;if(O(i)){let e=i.toString(t);return i<0?`-`+r+e.substr(1):r+e}return n.stringifyNumber(e)}var j={core:C,failsafe:c,json:E,yaml11:c.concat([{identify:e=>e==null,createNode:(e,t,r)=>r.wrapScalars?new n.Scalar(null):null,default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:n.nullOptions,stringify:()=>n.nullOptions.nullStr},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>!0,options:n.boolOptions,stringify:D},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>!1,options:n.boolOptions,stringify:D},{identify:O,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^([-+]?)0b([0-1_]+)$/,resolve:(e,t,n)=>k(t,n,2),stringify:e=>A(e,2,`0b`)},{identify:O,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^([-+]?)0([0-7_]+)$/,resolve:(e,t,n)=>k(t,n,8),stringify:e=>A(e,8,`0`)},{identify:O,default:!0,tag:`tag:yaml.org,2002:int`,test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(e,t,n)=>k(t,n,10),stringify:n.stringifyNumber},{identify:O,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(e,t,n)=>k(t,n,16),stringify:e=>A(e,16,`0x`)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(e,t)=>t?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify:({value:e})=>Number(e).toExponential()},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(e,t){let r=new n.Scalar(parseFloat(e.replace(/_/g,``)));if(t){let e=t.replace(/_/g,``);e[e.length-1]===`0`&&(r.minFractionDigits=e.length)}return r},stringify:n.stringifyNumber}],r.binary,r.omap,r.pairs,r.set,r.intTime,r.floatTime,r.timestamp)},M={binary:r.binary,bool:g,float:S,floatExp:x,floatNaN:b,floatTime:r.floatTime,int:v,intHex:y,intOct:_,intTime:r.intTime,map:a,null:h,omap:r.omap,pairs:r.pairs,seq:s,set:r.set,timestamp:r.timestamp};function N(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)||e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>(t.identify&&t.identify(e)||t.class&&e instanceof t.class)&&!t.format)}function ee(e,t,r){if(e instanceof n.Node)return e;let{defaultPrefix:i,onTagObj:o,prevObjects:c,schema:l,wrapScalars:u}=r;t&&t.startsWith(`!!`)&&(t=i+t.slice(2));let d=N(e,t,l.tags);if(!d){if(typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`)return u?new n.Scalar(e):e;d=e instanceof Map?a:e[Symbol.iterator]?s:a}o&&(o(d),delete r.onTagObj);let f={value:void 0,node:void 0};if(e&&typeof e==`object`&&c){let t=c.get(e);if(t){let e=new n.Alias(t);return r.aliasNodes.push(e),e}f.value=e,c.set(e,f)}return f.node=d.createNode?d.createNode(r.schema,e,r):u?new n.Scalar(e):e,t&&f.node instanceof n.Node&&(f.node.tag=t),f.node}function P(e,t,n,r){let i=e[r.replace(/\W/g,``)];if(!i){let t=Object.keys(e).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${r}"; use one of ${t}`)}if(Array.isArray(n))for(let e of n)i=i.concat(e);else typeof n==`function`&&(i=n(i.slice()));for(let e=0;e<i.length;++e){let n=i[e];if(typeof n==`string`){let r=t[n];if(!r){let e=Object.keys(t).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag "${n}"; use one of ${e}`)}i[e]=r}}return i}var te=(e,t)=>e.key<t.key?-1:+(e.key>t.key),F=class e{constructor({customTags:e,merge:t,schema:n,sortMapEntries:i,tags:a}){this.merge=!!t,this.name=n,this.sortMapEntries=i===!0?te:i||null,!e&&a&&r.warnOptionDeprecation(`tags`,`customTags`),this.tags=P(j,M,e||a,n)}createNode(t,n,r,i){let a={defaultPrefix:e.defaultPrefix,schema:this,wrapScalars:n};return ee(t,r,i?Object.assign(i,a):a)}createPair(e,t,r){r||={wrapScalars:!0};let i=this.createNode(e,r.wrapScalars,null,r),a=this.createNode(t,r.wrapScalars,null,r);return new n.Pair(i,a)}};t._defineProperty(F,`defaultPrefix`,t.defaultTagPrefix),t._defineProperty(F,`defaultTags`,t.defaultTags),e.Schema=F}),h=o(e=>{var t=u(),n=f(),r=m(),i={anchorPrefix:`a`,customTags:null,indent:2,indentSeq:!0,keepCstNodes:!1,keepNodeTypes:!0,keepBlobsInJSON:!0,mapAsMap:!1,maxAliasCount:100,prettyErrors:!1,simpleKeys:!1,version:`1.2`},a={get binary(){return n.binaryOptions},set binary(e){Object.assign(n.binaryOptions,e)},get bool(){return n.boolOptions},set bool(e){Object.assign(n.boolOptions,e)},get int(){return n.intOptions},set int(e){Object.assign(n.intOptions,e)},get null(){return n.nullOptions},set null(e){Object.assign(n.nullOptions,e)},get str(){return n.strOptions},set str(e){Object.assign(n.strOptions,e)}},o={"1.0":{schema:`yaml-1.1`,merge:!0,tagPrefixes:[{handle:`!`,prefix:t.defaultTagPrefix},{handle:`!!`,prefix:`tag:private.yaml.org,2002:`}]},1.1:{schema:`yaml-1.1`,merge:!0,tagPrefixes:[{handle:`!`,prefix:`!`},{handle:`!!`,prefix:t.defaultTagPrefix}]},1.2:{schema:`core`,merge:!1,tagPrefixes:[{handle:`!`,prefix:`!`},{handle:`!!`,prefix:t.defaultTagPrefix}]}};function s(e,t){if((e.version||e.options.version)===`1.0`){let e=t.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);if(e)return`!`+e[1];let n=t.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);return n?`!${n[1]}/${n[2]}`:`!${t.replace(/^tag:/,``)}`}let n=e.tagPrefixes.find(e=>t.indexOf(e.prefix)===0);if(!n){let r=e.getDefaults().tagPrefixes;n=r&&r.find(e=>t.indexOf(e.prefix)===0)}if(!n)return t[0]===`!`?t:`!<${t}>`;let r=t.substr(n.prefix.length).replace(/[!,[\]{}]/g,e=>({"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`})[e]);return n.handle+r}function c(e,t){if(t instanceof n.Alias)return n.Alias;if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)||n[0]}let r,i;if(t instanceof n.Scalar){i=t.value;let n=e.filter(e=>e.identify&&e.identify(i)||e.class&&i instanceof e.class);r=n.find(e=>e.format===t.format)||n.find(e=>!e.format)}else i=t,r=e.find(e=>e.nodeClass&&i instanceof e.nodeClass);if(!r){let e=i&&i.constructor?i.constructor.name:typeof i;throw Error(`Tag not resolved for ${e} value`)}return r}function l(e,t,{anchors:n,doc:r}){let i=[],a=r.anchors.getName(e);return a&&(n[a]=e,i.push(`&${a}`)),e.tag?i.push(s(r,e.tag)):t.default||i.push(s(r,t.tag)),i.join(` `)}function d(e,t,r,i){let{anchors:a,schema:o}=t.doc,s;if(!(e instanceof n.Node)){let t={aliasNodes:[],onTagObj:e=>s=e,prevObjects:new Map};e=o.createNode(e,!0,null,t);for(let e of t.aliasNodes){e.source=e.source.node;let t=a.getName(e.source);t||(t=a.newName(),a.map[t]=e.source)}}if(e instanceof n.Pair)return e.toString(t,r,i);s||=c(o.tags,e);let u=l(e,s,t);u.length>0&&(t.indentAtStart=(t.indentAtStart||0)+u.length+1);let d=typeof s.stringify==`function`?s.stringify(e,t,r,i):e instanceof n.Scalar?n.stringifyString(e,t,r,i):e.toString(t,r,i);return u?e instanceof n.Scalar||d[0]===`{`||d[0]===`[`?`${u} ${d}`:`${u}
|
|
139
|
+
${t.indent}${d}`:d}var p=class e{static validAnchorNode(e){return e instanceof n.Scalar||e instanceof n.YAMLSeq||e instanceof n.YAMLMap}constructor(e){t._defineProperty(this,`map`,Object.create(null)),this.prefix=e}createAlias(e,t){return this.setAnchor(e,t),new n.Alias(e)}createMergePair(...e){let t=new n.Merge;return t.value.items=e.map(e=>{if(e instanceof n.Alias){if(e.source instanceof n.YAMLMap)return e}else if(e instanceof n.YAMLMap)return this.createAlias(e);throw Error(`Merge sources must be Map nodes or their Aliases`)}),t}getName(e){let{map:t}=this;return Object.keys(t).find(n=>t[n]===e)}getNames(){return Object.keys(this.map)}getNode(e){return this.map[e]}newName(e){e||=this.prefix;let t=Object.keys(this.map);for(let n=1;;++n){let r=`${e}${n}`;if(!t.includes(r))return r}}resolveNodes(){let{map:e,_cstAliases:t}=this;Object.keys(e).forEach(t=>{e[t]=e[t].resolved}),t.forEach(e=>{e.source=e.source.resolved}),delete this._cstAliases}setAnchor(t,n){if(t!=null&&!e.validAnchorNode(t))throw Error(`Anchors may only be set for Scalar, Seq and Map nodes`);if(n&&/[\x00-\x19\s,[\]{}]/.test(n))throw Error(`Anchor names must not contain whitespace or control characters`);let{map:r}=this,i=t&&Object.keys(r).find(e=>r[e]===t);if(i)if(n)i!==n&&(delete r[i],r[n]=t);else return i;else{if(!n){if(!t)return null;n=this.newName()}r[n]=t}return n}},h=(e,t)=>{if(e&&typeof e==`object`){let{tag:r}=e;e instanceof n.Collection?(r&&(t[r]=!0),e.items.forEach(e=>h(e,t))):e instanceof n.Pair?(h(e.key,t),h(e.value,t)):e instanceof n.Scalar&&r&&(t[r]=!0)}return t},g=e=>Object.keys(h(e,{}));function _(e,r){let i={before:[],after:[]},a,o=!1;for(let s of r)if(s.valueRange){if(a!==void 0){e.errors.push(new t.YAMLSyntaxError(s,`Document contains trailing content not separated by a ... or --- line`));break}let r=n.resolveNode(e,s);o&&=(r.spaceBefore=!0,!1),a=r}else s.comment===null?s.type===t.Type.BLANK_LINE&&(o=!0,a===void 0&&i.before.length>0&&!e.commentBefore&&(e.commentBefore=i.before.join(`
|
|
140
|
+
`),i.before=[])):(a===void 0?i.before:i.after).push(s.comment);if(e.contents=a||null,!a)e.comment=i.before.concat(i.after).join(`
|
|
141
|
+
`)||null;else{let t=i.before.join(`
|
|
142
|
+
`);if(t){let e=a instanceof n.Collection&&a.items[0]?a.items[0]:a;e.commentBefore=e.commentBefore?`${t}
|
|
143
|
+
${e.commentBefore}`:t}e.comment=i.after.join(`
|
|
144
|
+
`)||null}}function v({tagPrefixes:e},n){let[r,i]=n.parameters;if(!r||!i)throw new t.YAMLSemanticError(n,`Insufficient parameters given for %TAG directive`);if(e.some(e=>e.handle===r))throw new t.YAMLSemanticError(n,`The %TAG directive must only be given at most once per handle in the same document.`);return{handle:r,prefix:i}}function y(e,n){let[r]=n.parameters;if(n.name===`YAML:1.0`&&(r=`1.0`),!r)throw new t.YAMLSemanticError(n,`Insufficient parameters given for %YAML directive`);if(!o[r]){let i=`Document will be parsed as YAML ${e.version||e.options.version} rather than YAML ${r}`;e.warnings.push(new t.YAMLWarning(n,i))}return r}function b(e,n,r){let i=[],a=!1;for(let r of n){let{comment:n,name:o}=r;switch(o){case`TAG`:try{e.tagPrefixes.push(v(e,r))}catch(t){e.errors.push(t)}a=!0;break;case`YAML`:case`YAML:1.0`:e.version&&e.errors.push(new t.YAMLSemanticError(r,`The %YAML directive must only be given at most once per document.`));try{e.version=y(e,r)}catch(t){e.errors.push(t)}a=!0;break;default:if(o){let n=`YAML only supports %TAG and %YAML directives, and not %${o}`;e.warnings.push(new t.YAMLWarning(r,n))}}n&&i.push(n)}r&&!a&&(e.version||r.version||e.options.version)===`1.1`&&(e.tagPrefixes=r.tagPrefixes.map(({handle:e,prefix:t})=>({handle:e,prefix:t})),e.version=r.version),e.commentBefore=i.join(`
|
|
145
|
+
`)||null}function x(e){if(e instanceof n.Collection)return!0;throw Error(`Expected a YAML collection as document contents`)}var S=class e{constructor(e){this.anchors=new p(e.anchorPrefix),this.commentBefore=null,this.comment=null,this.contents=null,this.directivesEndMarker=null,this.errors=[],this.options=e,this.schema=null,this.tagPrefixes=[],this.version=null,this.warnings=[]}add(e){return x(this.contents),this.contents.add(e)}addIn(e,t){x(this.contents),this.contents.addIn(e,t)}delete(e){return x(this.contents),this.contents.delete(e)}deleteIn(e){return n.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):(x(this.contents),this.contents.deleteIn(e))}getDefaults(){return e.defaults[this.version]||e.defaults[this.options.version]||{}}get(e,t){return this.contents instanceof n.Collection?this.contents.get(e,t):void 0}getIn(e,t){return n.isEmptyPath(e)?!t&&this.contents instanceof n.Scalar?this.contents.value:this.contents:this.contents instanceof n.Collection?this.contents.getIn(e,t):void 0}has(e){return this.contents instanceof n.Collection?this.contents.has(e):!1}hasIn(e){return n.isEmptyPath(e)?this.contents!==void 0:this.contents instanceof n.Collection?this.contents.hasIn(e):!1}set(e,t){x(this.contents),this.contents.set(e,t)}setIn(e,t){n.isEmptyPath(e)?this.contents=t:(x(this.contents),this.contents.setIn(e,t))}setSchema(e,t){if(!e&&!t&&this.schema)return;typeof e==`number`&&(e=e.toFixed(1)),e===`1.0`||e===`1.1`||e===`1.2`?(this.version?this.version=e:this.options.version=e,delete this.options.schema):e&&typeof e==`string`&&(this.options.schema=e),Array.isArray(t)&&(this.options.customTags=t);let n=Object.assign({},this.getDefaults(),this.options);this.schema=new r.Schema(n)}parse(e,n){this.options.keepCstNodes&&(this.cstNode=e),this.options.keepNodeTypes&&(this.type=`DOCUMENT`);let{directives:r=[],contents:i=[],directivesEndMarker:a,error:o,valueRange:s}=e;if(o&&(o.source||=this,this.errors.push(o)),b(this,r,n),a&&(this.directivesEndMarker=!0),this.range=s?[s.start,s.end]:null,this.setSchema(),this.anchors._cstAliases=[],_(this,i),this.anchors.resolveNodes(),this.options.prettyErrors){for(let e of this.errors)e instanceof t.YAMLError&&e.makePretty();for(let e of this.warnings)e instanceof t.YAMLError&&e.makePretty()}return this}listNonDefaultTags(){return g(this.contents).filter(e=>e.indexOf(r.Schema.defaultPrefix)!==0)}setTagPrefix(e,t){if(e[0]!==`!`||e[e.length-1]!==`!`)throw Error(`Handle must start and end with !`);if(t){let n=this.tagPrefixes.find(t=>t.handle===e);n?n.prefix=t:this.tagPrefixes.push({handle:e,prefix:t})}else this.tagPrefixes=this.tagPrefixes.filter(t=>t.handle!==e)}toJSON(e,t){let{keepBlobsInJSON:r,mapAsMap:i,maxAliasCount:a}=this.options,o=r&&(typeof e!=`string`||!(this.contents instanceof n.Scalar)),s={doc:this,indentStep:` `,keep:o,mapAsMap:o&&!!i,maxAliasCount:a,stringify:d},c=Object.keys(this.anchors.map);c.length>0&&(s.anchors=new Map(c.map(e=>[this.anchors.map[e],{alias:[],aliasCount:0,count:1}])));let l=n.toJSON(this.contents,e,s);if(typeof t==`function`&&s.anchors)for(let{count:e,res:n}of s.anchors.values())t(n,e);return l}toString(){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);let e=this.options.indent;if(!Number.isInteger(e)||e<=0){let t=JSON.stringify(e);throw Error(`"indent" option must be a positive integer, not ${t}`)}this.setSchema();let t=[],r=!1;if(this.version){let e=`%YAML 1.2`;this.schema.name===`yaml-1.1`&&(this.version===`1.0`?e=`%YAML:1.0`:this.version===`1.1`&&(e=`%YAML 1.1`)),t.push(e),r=!0}let i=this.listNonDefaultTags();this.tagPrefixes.forEach(({handle:e,prefix:n})=>{i.some(e=>e.indexOf(n)===0)&&(t.push(`%TAG ${e} ${n}`),r=!0)}),(r||this.directivesEndMarker)&&t.push(`---`),this.commentBefore&&((r||!this.directivesEndMarker)&&t.unshift(``),t.unshift(this.commentBefore.replace(/^/gm,`#`)));let a={anchors:Object.create(null),doc:this,indent:``,indentStep:` `.repeat(e),stringify:d},o=!1,s=null;if(this.contents){this.contents instanceof n.Node&&(this.contents.spaceBefore&&(r||this.directivesEndMarker)&&t.push(``),this.contents.commentBefore&&t.push(this.contents.commentBefore.replace(/^/gm,`#`)),a.forceBlockIndent=!!this.comment,s=this.contents.comment);let e=s?null:()=>o=!0,i=d(this.contents,a,()=>s=null,e);t.push(n.addComment(i,``,s))}else this.contents!==void 0&&t.push(d(this.contents,a));return this.comment&&((!o||s)&&t[t.length-1]!==``&&t.push(``),t.push(this.comment.replace(/^/gm,`#`))),t.join(`
|
|
146
|
+
`)+`
|
|
147
|
+
`}};t._defineProperty(S,`defaults`,o),e.Document=S,e.defaultOptions=i,e.scalarOptions=a}),g=o(e=>{var t=d(),n=h(),r=m(),i=u(),a=p();f();function o(e,t=!0,i){i===void 0&&typeof t==`string`&&(i=t,t=!0);let a=Object.assign({},n.Document.defaults[n.defaultOptions.version],n.defaultOptions);return new r.Schema(a).createNode(e,t,i)}var s=class extends n.Document{constructor(e){super(Object.assign({},n.defaultOptions,e))}};function c(e,n){let r=[],i;for(let a of t.parse(e)){let e=new s(n);e.parse(a,i),r.push(e),i=e}return r}function l(e,n){let r=t.parse(e),a=new s(n).parse(r[0]);return r.length>1&&a.errors.unshift(new i.YAMLSemanticError(r[1],`Source contains multiple documents; please use YAML.parseAllDocuments()`)),a}function g(e,t){let n=l(e,t);if(n.warnings.forEach(e=>a.warn(e)),n.errors.length>0)throw n.errors[0];return n.toJSON()}function _(e,t){let n=new s(t);return n.contents=e,String(n)}e.YAML={createNode:o,defaultOptions:n.defaultOptions,Document:s,parse:g,parseAllDocuments:c,parseCST:t.parse,parseDocument:l,scalarOptions:n.scalarOptions,stringify:_}}),_=o((e,t)=>{t.exports=g().YAML}),v=o(e=>{var t=f(),n=u();e.findPair=t.findPair,e.parseMap=t.resolveMap,e.parseSeq=t.resolveSeq,e.stringifyNumber=t.stringifyNumber,e.stringifyString=t.stringifyString,e.toJSON=t.toJSON,e.Type=n.Type,e.YAMLError=n.YAMLError,e.YAMLReferenceError=n.YAMLReferenceError,e.YAMLSemanticError=n.YAMLSemanticError,e.YAMLSyntaxError=n.YAMLSyntaxError,e.YAMLWarning=n.YAMLWarning}),y={};s(y,{__parsePrettierYamlConfig:()=>Mr,languages:()=>Vt,options:()=>Ut,parsers:()=>Wt,printers:()=>jr});var b=(e,t)=>(n,r,...i)=>n|1&&r==null?void 0:(t.call(r)??r[e]).apply(r,i);function x(e){return this[e<0?this.length+e:e]}var S=b(`at`,function(){if(Array.isArray(this)||typeof this==`string`)return x}),C=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},w=b(`replaceAll`,function(){if(typeof this==`string`)return C}),T=()=>{},E=`string`,D=`array`,O=`cursor`,k=`indent`,A=`align`,j=`trim`,M=`group`,N=`fill`,ee=`if-break`,P=`indent-if-break`,te=`line-suffix`,F=`line-suffix-boundary`,I=`line`,ne=`label`,re=`break-parent`,ie=new Set([O,k,A,j,M,N,ee,P,te,F,I,ne,re]);function ae(e){if(typeof e==`string`)return E;if(Array.isArray(e))return D;if(!e)return;let{type:t}=e;if(ie.has(t))return t}var oe=ae,se=e=>new Intl.ListFormat(`en-US`,{type:`disjunction`}).format(e);function ce(e){let t=e===null?`null`:typeof e;if(t!==`string`&&t!==`object`)return`Unexpected doc '${t}',
|
|
148
|
+
Expected it to be 'string' or 'object'.`;if(oe(e))throw Error(`doc is valid.`);let n=Object.prototype.toString.call(e);if(n!==`[object Object]`)return`Unexpected doc '${n}'.`;let r=se([...ie].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.
|
|
149
|
+
Expected it to be ${r}.`}var le=class extends Error{name=`InvalidDocError`;constructor(e){super(ce(e)),this.doc=e}};function ue(e,t){if(typeof e==`string`)return t(e);let n=new Map;return r(e);function r(e){if(n.has(e))return n.get(e);let t=i(e);return n.set(e,t),t}function i(e){switch(oe(e)){case D:return t(e.map(r));case N:return t({...e,parts:e.parts.map(r)});case ee:return t({...e,breakContents:r(e.breakContents),flatContents:r(e.flatContents)});case M:{let{expandedStates:n,contents:i}=e;return n?(n=n.map(r),i=n[0]):i=r(i),t({...e,contents:i,expandedStates:n})}case A:case k:case P:case ne:case te:return t({...e,contents:r(e.contents)});case E:case O:case j:case F:case I:case re:return t(e);default:throw new le(e)}}}function de(e,t=Te){return ue(e,e=>typeof e==`string`?z(t,e.split(`
|
|
150
|
+
`)):e)}var L=T,fe=T,pe=T,me=T;function he(e,t){return me(e),L(t),{type:A,contents:t,n:e}}function R(e){return he(-1/0,e)}function ge(e){return he({type:`root`},e)}function _e(e){return he(-1,e)}var ve={type:re};function ye(e){return pe(e),{type:N,parts:e}}function be(e,t={}){return L(e),fe(t.expandedStates,!0),{type:M,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function xe(e,t){return be(e[0],{...t,expandedStates:e})}function Se(e,t=``,n={}){return L(e),t!==``&&L(t),{type:ee,breakContents:e,flatContents:t,groupId:n.groupId}}function z(e,t){L(e),fe(t);let n=[];for(let r=0;r<t.length;r++)r!==0&&n.push(e),n.push(t[r]);return n}var Ce={type:I},we={type:I,soft:!0},B=[{type:I,hard:!0},ve],Te=[{type:I,hard:!0,literal:!0},ve];function Ee(e){return L(e),{type:te,contents:e}}function De(e){return(t,n,r)=>{let i=!!r?.backwards;if(n===!1)return!1;let{length:a}=t,o=n;for(;o>=0&&o<a;){let n=t.charAt(o);if(e instanceof RegExp){if(!e.test(n))return o}else if(!e.includes(n))return o;i?o--:o++}return o===-1||o===a?o:!1}}var Oe=De(` `),ke=e=>e===`
|
|
151
|
+
`||e===`\r`||e===`\u2028`||e===`\u2029`;function Ae(e,t,n){let r=!!n?.backwards;if(t===!1)return!1;let i=e.charAt(t);if(r){if(e.charAt(t-1)===`\r`&&i===`
|
|
152
|
+
`)return t-2;if(ke(i))return t-1}else{if(i===`\r`&&e.charAt(t+1)===`
|
|
153
|
+
`)return t+2;if(ke(i))return t+1}return t}var je=Ae;function Me(e,t){let n=t-1;n=Oe(e,n,{backwards:!0}),n=je(e,n,{backwards:!0}),n=Oe(e,n,{backwards:!0});let r=je(e,n,{backwards:!0});return n!==r}var Ne=Me,Pe=class extends Error{name=`UnexpectedNodeError`;constructor(e,t,n=`type`){super(`Unexpected ${t} node ${n}: ${JSON.stringify(e[n])}.`),this.node=e}},Fe=`format`,Ie=/^\s*#[^\S\n]*@(?:noformat|noprettier)\s*?(?:\n|$)/u,Le=/^\s*#[^\S\n]*@(?:format|prettier)\s*?(?:\n|$)/u,Re=/^\s*@(?:format|prettier)\s*$/u,ze=e=>Re.test(e),Be=e=>Le.test(e),Ve=e=>Ie.test(e),He=e=>`# @${Fe}
|
|
154
|
+
|
|
155
|
+
${e}`;function Ue(e,t){switch(e.type){case`comment`:if(ze(e.value))return null;break;case`quoteDouble`:case`quoteSingle`:t.type=`quote`;break;case`document`:t.directivesEndMarker||delete t.directivesEndMarker,t.documentEndMarker||delete t.documentEndMarker;break}}Ue.ignoredProperties=new Set([`position`]);var We=Ue;function Ge(e,t){let{node:n}=e;if(n.type===`root`&&t.filepath&&/(?:[/\\]|^)\.(?:prettier|stylelint|lintstaged)rc$/u.test(t.filepath))return async e=>{let n=await e(t.originalText,{parser:`json`});return n?[n,B]:void 0}}Ge.getVisitorKeys=()=>[];var Ke=Ge,qe=null;function Je(e){if(qe!==null&&typeof qe.property){let e=qe;return qe=Je.prototype=null,e}return qe=Je.prototype=e??Object.create(null),new Je}var Ye=10;for(let e=0;e<=Ye;e++)Je();function Xe(e){return Je(e)}function Ze(e,t=`type`){Xe(e);function n(n){let r=n[t],i=e[r];if(!Array.isArray(i))throw Object.assign(Error(`Missing visitor keys for '${r}'.`),{node:n});return i}return n}var Qe=Ze,V=[[`children`,`anchor`,`tag`,`indicatorComment`,`leadingComments`,`middleComments`,`trailingComment`,`endComments`],[`anchor`,`tag`,`indicatorComment`,`leadingComments`,`middleComments`,`trailingComment`,`endComments`],[`key`,`value`,`children`,`anchor`,`tag`,`indicatorComment`,`leadingComments`,`middleComments`,`trailingComment`,`endComments`],[`content`,`children`,`anchor`,`tag`,`indicatorComment`,`leadingComments`,`middleComments`,`trailingComment`,`endComments`],[`indicatorComment`,`leadingComments`,`middleComments`,`trailingComment`,`endComments`]],$e=Qe({root:V[0],document:[`head`,`body`,`children`,`anchor`,`tag`,`indicatorComment`,`leadingComments`,`middleComments`,`trailingComment`,`endComments`],documentHead:V[0],documentBody:V[0],directive:V[1],alias:V[1],blockLiteral:V[1],blockFolded:V[0],plain:V[0],quoteSingle:V[1],quoteDouble:V[1],mapping:V[0],mappingItem:V[2],mappingKey:V[3],mappingValue:V[3],sequence:V[0],sequenceItem:V[3],flowMapping:V[0],flowMappingItem:V[2],flowSequence:V[0],flowSequenceItem:V[3],comment:V[1],tag:V[4],anchor:V[4]}),et=e=>e.position.start.offset,tt=e=>e.position.end.offset;function nt(e){return Array.isArray(e)&&e.length>0}var rt=nt;function H(e,t){return typeof e?.type==`string`&&t.includes(e.type)}function it(e,t,n){return t(`children`in e?{...e,children:e.children.map(n=>it(n,t,e))}:e,n)}function at(e,t,n){Object.defineProperty(e,t,{get:n,enumerable:!1})}function ot(e,t){let n=0,r=t.length;for(let i=e.position.end.offset-1;i<r;i++){let e=t[i];if(e===`
|
|
156
|
+
`&&n++,n===1&&/\S/u.test(e))return!1;if(n===2)return!0}return!1}function st(e){let{node:t}=e;switch(t.type){case`tag`:case`anchor`:case`comment`:return!1}let n=e.stack.length;for(let t=1;t<n;t++){let n=e.stack[t],r=e.stack[t-1];if(Array.isArray(r)&&typeof n==`number`&&n!==r.length-1)return!1}return!0}function ct(e){return rt(e.children)?ct(S(0,e.children,-1)):e}function lt(e){return e.value.trim()===`prettier-ignore`}function ut(e){let{node:t}=e;if(t.type===`documentBody`){let t=e.parent.head;return G(t)&<(S(0,t.endComments,-1))}return U(t)&<(S(0,t.leadingComments,-1))}function dt(e){return!rt(e.children)&&!ft(e)}function ft(e){return U(e)||pt(e)||mt(e)||W(e)||G(e)}function U(e){return rt(e?.leadingComments)}function pt(e){return rt(e?.middleComments)}function mt(e){return e?.indicatorComment}function W(e){return e?.trailingComment}function G(e){return rt(e?.endComments)}function ht(e){return e?e.split(/(?<!^| ) (?! |$)/u):[]}function gt(e,t,n){let r=t.split(`
|
|
157
|
+
`).map((e,t,n)=>t===0&&t===n.length-1?e:t!==0&&t!==n.length-1?e.trim():t===0?e.trimEnd():e.trimStart());if(n.proseWrap===`preserve`)return r.map(e=>e?[e]:[]);let i=[];for(let[t,n]of r.entries()){let a=ht(n);t>0&&r[t-1].length>0&&a.length>0&&!(e===`quoteDouble`&&S(0,S(0,i,-1),-1).endsWith(`\\`))?i[i.length-1]=[...S(0,i,-1),...a]:i.push(a)}return n.proseWrap===`never`?i.map(e=>[e.join(` `)]):i}function _t(e,{parentIndent:t,isLastDescendant:n,options:r}){let i=e.position.start.line===e.position.end.line?``:r.originalText.slice(e.position.start.offset,e.position.end.offset).match(/^[^\n]*\n(.*)$/su)[1],a;if(e.indent===null){let e=i.match(/^(?<leadingSpace> *)[^\n\r ]/mu);a=e?e.groups.leadingSpace.length:1/0}else a=e.indent-1+t;let o=i.split(`
|
|
158
|
+
`).map(e=>e.slice(a));if(r.proseWrap===`preserve`||e.type===`blockLiteral`)return c(o.map(e=>e?[e]:[]));let s=[];for(let[e,t]of o.entries()){let n=ht(t);e>0&&n.length>0&&o[e-1].length>0&&!/^\s/u.test(n[0])&&!/^\s|\s$/u.test(S(0,s,-1))?s[s.length-1]=[...S(0,s,-1),...n]:s.push(n)}return s=s.map(e=>{let t=[];for(let n of e)t.length>0&&/\s$/u.test(S(0,t,-1))?t[t.length-1]+=` `+n:t.push(n);return t}),r.proseWrap===`never`&&(s=s.map(e=>[e.join(` `)])),c(s);function c(t){if(e.chomping===`keep`)return S(0,t,-1).length===0?t.slice(0,-1):t;let r=0;for(let e=t.length-1;e>=0&&t[e].length===0;e--)r++;return r===0?t:r>=2&&!n?t.slice(0,-(r-1)):t.slice(0,-r)}}function vt(e){if(!e)return!0;switch(e.type){case`plain`:case`quoteDouble`:case`quoteSingle`:case`alias`:case`flowMapping`:case`flowSequence`:return!0;default:return!1}}var yt=new WeakMap;function bt(e,t){let{node:n,root:r}=e,i;return yt.has(r)?i=yt.get(r):(i=new Set,yt.set(r,i)),!i.has(n.position.end.line)&&(i.add(n.position.end.line),ot(n,t)&&!xt(e.parent))?we:``}function xt(e){return G(e)&&!H(e,[`documentHead`,`documentBody`,`flowMapping`,`flowSequence`])}function K(e,t){return he(` `.repeat(e),t)}function St(e,t,n){let{node:r}=e,i=e.ancestors.filter(e=>e.type===`sequence`||e.type===`mapping`).length,a=st(e),o=[r.type===`blockFolded`?`>`:`|`];r.indent!==null&&o.push(r.indent.toString()),r.chomping!==`clip`&&o.push(r.chomping===`keep`?`+`:`-`),mt(r)&&o.push(` `,n(`indicatorComment`));let s=_t(r,{parentIndent:i,isLastDescendant:a,options:t}),c=[];for(let[e,t]of s.entries())e===0&&c.push(B),c.push(ye(z(Ce,t))),e===s.length-1?r.chomping===`keep`&&a&&c.push(R(t.length===0?B:Te)):c.push(t.length===0?B:ge(Te));return r.indent===null?o.push(_e(K(t.tabWidth,c))):o.push(R(K(r.indent-1+i,c))),o}var Ct=St;function wt(e,t,n){let{node:r}=e,i=r.type===`flowMapping`,a=i?`{`:`[`,o=i?`}`:`]`,s=we;i&&r.children.length>0&&t.bracketSpacing&&(s=Ce);let c=S(0,r.children,-1),l=c?.type===`flowMappingItem`&&dt(c.key)&&dt(c.value);return[a,K(t.tabWidth,[s,Tt(e,t,n),t.trailingComma===`none`?``:Se(`,`),G(r)?[B,z(B,e.map(n,`endComments`))]:``]),l?``:s,o]}function Tt(e,t,n){return e.map(({isLast:r,node:i,next:a})=>[n(),r?``:[`,`,Ce,i.position.start.line===a.position.start.line?``:bt(e,t.originalText)]],`children`)}function Et(e,t,n){let{node:r,parent:i}=e,{key:a,value:o}=r,s=dt(a),c=dt(o);if(s&&c)return`: `;let l=n(`key`),u=Ot(r)?` `:``;if(c)return r.type===`flowMappingItem`&&i.type===`flowMapping`?l:r.type===`mappingItem`&&Dt(a.content,t)&&!W(a.content)&&i.tag?.value!==`tag:yaml.org,2002:set`?[l,u,`:`]:[`? `,K(2,l)];let d=n(`value`);if(s)return[`: `,K(2,d)];if(U(o)||!vt(a.content))return[`? `,K(2,l),B,...e.map(()=>[n(),B],`value`,`leadingComments`),`: `,K(2,d)];if(kt(a.content)&&!U(a.content)&&!pt(a.content)&&!W(a.content)&&!G(a)&&!U(o.content)&&!pt(o.content)&&!G(o)&&Dt(o.content,t))return[l,u,`: `,d];let f=Symbol(`mappingKey`),p=be([Se(`? `),be(K(2,l),{id:f})]),m=[B,`: `,K(2,d)],h=[u,`:`];G(o)&&o.content&&H(o.content,[`flowMapping`,`flowSequence`])&&o.content.children.length===0?h.push(` `):U(o.content)||G(o)&&o.content&&!H(o.content,[`mapping`,`sequence`])||i.type===`mapping`&&W(a.content)&&vt(o.content)||H(o.content,[`mapping`,`sequence`])&&o.content.tag===null&&o.content.anchor===null?h.push(B):o.content?h.push(Ce):W(o)&&h.push(` `),h.push(d);let g=K(t.tabWidth,h);return Dt(a.content,t)&&!U(a.content)&&!pt(a.content)&&!W(a.content)&&!G(a)?xe([[l,g]]):xe([[p,Se(m,g,{groupId:f})]])}function Dt(e,t){if(!e)return!0;switch(e.type){case`plain`:case`quoteSingle`:case`quoteDouble`:break;case`alias`:return!0;default:return!1}if(t.proseWrap===`preserve`)return e.position.start.line===e.position.end.line;if(/\\$/mu.test(t.originalText.slice(e.position.start.offset,e.position.end.offset)))return!1;switch(t.proseWrap){case`never`:return!e.value.includes(`
|
|
159
|
+
`);case`always`:return!/[\n ]/u.test(e.value);default:return!1}}function Ot(e){return e.key.content?.type===`alias`}function kt(e){if(!e)return!0;switch(e.type){case`plain`:case`quoteDouble`:case`quoteSingle`:return e.position.start.line===e.position.end.line;case`alias`:return!0;default:return!1}}var At=Et;function jt(e){return it(e,Mt)}function Mt(e){switch(e.type){case`document`:at(e,`head`,()=>e.children[0]),at(e,`body`,()=>e.children[1]);break;case`documentBody`:case`sequenceItem`:case`flowSequenceItem`:case`mappingKey`:case`mappingValue`:at(e,`content`,()=>e.children[0]);break;case`mappingItem`:case`flowMappingItem`:at(e,`key`,()=>e.children[0]),at(e,`value`,()=>e.children[1]);break}return e}var Nt=jt;function Pt(e,t,n){let{node:r}=e,i=[];r.type!==`mappingValue`&&U(r)&&i.push([z(B,e.map(n,`leadingComments`)),B]);let{tag:a,anchor:o}=r;a&&i.push(n(`tag`)),a&&o&&i.push(` `),o&&i.push(n(`anchor`));let s=``;return H(r,[`mapping`,`sequence`,`comment`,`directive`,`mappingItem`,`sequenceItem`])&&!st(e)&&(s=bt(e,t.originalText)),(a||o)&&(H(r,[`sequence`,`mapping`])&&!pt(r)?i.push(B):i.push(` `)),pt(r)&&i.push([r.middleComments.length===1?``:B,z(B,e.map(n,`middleComments`)),B]),ut(e)?i.push(de(t.originalText.slice(r.position.start.offset,r.position.end.offset).trimEnd())):i.push(be(Ft(e,t,n))),W(r)&&!H(r,[`document`,`documentHead`])&&i.push(Ee([r.type===`mappingValue`&&!r.content?``:` `,e.parent.type===`mappingKey`&&e.getParentNode(2).type===`mapping`&&vt(r)?``:ve,n(`trailingComment`)])),xt(r)&&i.push(K(r.type===`sequenceItem`?2:0,[B,z(B,e.map(({node:e})=>[Ne(t.originalText,et(e))?B:``,n()],`endComments`))])),i.push(s),i}function Ft(e,t,n){let{node:r}=e;switch(r.type){case`root`:{let t=ct(r),i=!(H(t,[`blockLiteral`,`blockFolded`])&&t.chomping===`keep`),a=[];return e.each(({node:t,isFirst:r})=>{r||a.push(B),a.push(n()),Lt(e)&&(i&&a.push(B),a.push(`...`),W(t)&&a.push(` `,n(`trailingComment`)))},`children`),i&&a.push(B),a}case`document`:{let t=[];return Rt(e)&&((r.head.children.length>0||r.head.endComments.length>0)&&t.push(n(`head`)),W(r.head)?t.push([`---`,` `,n([`head`,`trailingComment`])]):t.push(`---`)),It(r)&&t.push(n(`body`)),z(B,t)}case`documentHead`:return z(B,[...e.map(n,`children`),...e.map(n,`endComments`)]);case`documentBody`:{let{children:i,endComments:a}=r,o=``;if(i.length>0&&a.length>0){let e=ct(r);H(e,[`blockFolded`,`blockLiteral`])?e.chomping!==`keep`&&(o=[B,B]):o=H(S(0,i,-1),[`mapping`])&&Ne(t.originalText,et(a[0]))?[B,B]:B}return[z(B,e.map(n,`children`)),o,z(B,e.map(n,`endComments`))]}case`directive`:return[`%`,z(` `,[r.name,...r.parameters])];case`comment`:return[`#`,r.value];case`alias`:return[`*`,r.value];case`tag`:return t.originalText.slice(r.position.start.offset,r.position.end.offset);case`anchor`:return[`&`,r.value];case`plain`:return zt(r.type,t.originalText.slice(r.position.start.offset,r.position.end.offset),t);case`quoteDouble`:case`quoteSingle`:{let e=t.originalText.slice(r.position.start.offset+1,r.position.end.offset-1);if(r.type===`quoteSingle`&&e.includes(`\\`)||r.type===`quoteDouble`&&/\\[^"]/u.test(e)){let n=r.type===`quoteDouble`?`"`:`'`;return[n,zt(r.type,e,t),n]}if(e.includes(`"`))return[`'`,zt(r.type,r.type===`quoteDouble`?w(0,w(0,e,`\\"`,`"`),`'`,`'`.repeat(2)):e,t),`'`];if(e.includes(`'`))return[`"`,zt(r.type,r.type===`quoteSingle`?w(0,e,`''`,`'`):e,t),`"`];let n=t.singleQuote?`'`:`"`;return[n,zt(r.type,e,t),n]}case`blockFolded`:case`blockLiteral`:return Ct(e,t,n);case`mapping`:case`sequence`:return z(B,e.map(n,`children`));case`sequenceItem`:return[`- `,K(2,r.content?n(`content`):``)];case`mappingKey`:case`mappingValue`:return r.content?n(`content`):``;case`mappingItem`:case`flowMappingItem`:return At(e,t,n);case`flowMapping`:return wt(e,t,n);case`flowSequence`:return wt(e,t,n);case`flowSequenceItem`:return n(`content`);default:throw new Pe(r,`YAML`)}}function It(e){return e.body.children.length>0||G(e.body)}function Lt(e){let t=e.node;if(t.documentEndMarker||W(t))return!0;if(e.isLast)return!1;let n=e.next;return n.head.children.length>0||G(n.head)}function Rt(e){let t=e.node;return t.directivesEndMarker||t.head.children.length>0||G(t.head)||W(t.head)}function zt(e,t,n){return z(B,gt(e,t,n).map(e=>ye(z(Ce,e))))}var Bt={preprocess:Nt,embed:Ke,print:Pt,massageAstNode:We,insertPragma:He,getVisitorKeys:$e},Vt=[{name:`YAML`,type:`data`,aceMode:`yaml`,extensions:[`.yml`,`.mir`,`.reek`,`.rviz`,`.sublime-syntax`,`.syntax`,`.yaml`,`.yaml-tmlanguage`,`.yaml.sed`,`.yml.mysql`],filenames:[`.clang-format`,`.clang-tidy`,`.clangd`,`.gemrc`,`CITATION.cff`,`glide.lock`,`pixi.lock`,`.prettierrc`,`.stylelintrc`,`.lintstagedrc`],tmScope:`source.yaml`,aliases:[`yml`],codemirrorMode:`yaml`,codemirrorMimeType:`text/x-yaml`,parsers:[`yaml`],vscodeLanguageIds:[`yaml`,`ansible`,`dockercompose`,`github-actions-workflow`,`home-assistant`],linguistLanguageId:407}],Ht={bracketSpacing:{category:`Common`,type:`boolean`,default:!0,description:`Print spaces between brackets.`,oppositeDescription:`Do not print spaces between brackets.`},objectWrap:{category:`Common`,type:`choice`,default:`preserve`,description:`How to wrap object literals.`,choices:[{value:`preserve`,description:`Keep as multi-line, if there is a newline between the opening brace and first property.`},{value:`collapse`,description:`Fit to a single line when possible.`}]},singleQuote:{category:`Common`,type:`boolean`,default:!1,description:`Use single quotes instead of double quotes.`},proseWrap:{category:`Common`,type:`choice`,default:`preserve`,description:`How to wrap prose.`,choices:[{value:`always`,description:`Wrap prose if it exceeds the print width.`},{value:`never`,description:`Do not wrap prose.`},{value:`preserve`,description:`Wrap prose as-is.`}]},bracketSameLine:{category:`Common`,type:`boolean`,default:!1,description:`Put > of opening tags on the last line instead of on a new line.`},singleAttributePerLine:{category:`Common`,type:`boolean`,default:!1,description:`Enforce single attribute per line in HTML, Vue and JSX.`}},Ut={bracketSpacing:Ht.bracketSpacing,singleQuote:Ht.singleQuote,proseWrap:Ht.proseWrap},Wt={};s(Wt,{yaml:()=>Ar});var Gt=l(_(),1),q=l(v(),1);q.default.findPair,q.default.toJSON,q.default.parseMap,q.default.parseSeq,q.default.stringifyNumber,q.default.stringifyString,q.default.Type,q.default.YAMLError,q.default.YAMLReferenceError;var Kt=q.default.YAMLSemanticError;q.default.YAMLSyntaxError,q.default.YAMLWarning;function J(e,t=null){`children`in e&&e.children.forEach(t=>J(t,e)),`anchor`in e&&e.anchor&&J(e.anchor,e),`tag`in e&&e.tag&&J(e.tag,e),`leadingComments`in e&&e.leadingComments.forEach(t=>J(t,e)),`middleComments`in e&&e.middleComments.forEach(t=>J(t,e)),`indicatorComment`in e&&e.indicatorComment&&J(e.indicatorComment,e),`trailingComment`in e&&e.trailingComment&&J(e.trailingComment,e),`endComments`in e&&e.endComments.forEach(t=>J(t,e)),Object.defineProperty(e,`_parent`,{value:t,enumerable:!1})}function qt(e){return`${e.line}:${e.column}`}function Jt(e){J(e);let t=Yt(e),n=e.children.slice();e.comments.sort((e,t)=>e.position.start.offset-t.position.end.offset).filter(e=>!e._parent).forEach(e=>{for(;n.length>1&&e.position.start.line>n[0].position.end.line;)n.shift();Zt(e,t,n[0])})}function Yt(e){let t=Array.from(Array(e.position.end.line),()=>({}));for(let n of e.comments)t[n.position.start.line-1].comment=n;return Xt(t,e),t}function Xt(e,t){if(t.position.start.offset!==t.position.end.offset){if(`leadingComments`in t){let{start:n}=t.position,{leadingAttachableNode:r}=e[n.line-1];(!r||n.column<r.position.start.column)&&(e[n.line-1].leadingAttachableNode=t)}if(`trailingComment`in t&&t.position.end.column>1&&t.type!==`document`&&t.type!==`documentHead`){let{end:n}=t.position,{trailingAttachableNode:r}=e[n.line-1];(!r||n.column>=r.position.end.column)&&(e[n.line-1].trailingAttachableNode=t)}if(t.type!==`root`&&t.type!==`document`&&t.type!==`documentHead`&&t.type!==`documentBody`){let{start:n,end:r}=t.position,i=[r.line].concat(n.line===r.line?[]:n.line);for(let n of i){let i=e[n-1].trailingNode;(!i||r.column>=i.position.end.column)&&(e[n-1].trailingNode=t)}}`children`in t&&t.children.forEach(t=>{Xt(e,t)})}}function Zt(e,t,n){let r=e.position.start.line,{trailingAttachableNode:i}=t[r-1];if(i){if(i.trailingComment)throw Error(`Unexpected multiple trailing comment at ${qt(e.position.start)}`);J(e,i),i.trailingComment=e;return}for(let i=r;i>=n.position.start.line;i--){let{trailingNode:n}=t[i-1],a;if(n)a=n;else if(i!==r&&t[i-1].comment)a=t[i-1].comment._parent;else continue;if((a.type===`sequence`||a.type===`mapping`)&&(a=a.children[0]),a.type===`mappingItem`){let[e,t]=a.children;a=$t(e)?e:t}for(;;){if(Qt(a,e)){J(e,a),a.endComments.push(e);return}if(!a._parent)break;a=a._parent}break}for(let i=r+1;i<=n.position.end.line;i++){let{leadingAttachableNode:n}=t[i-1];if(n){J(e,n),n.leadingComments.push(e);return}}let a=n.children[1];J(e,a),a.endComments.push(e)}function Qt(e,t){if(e.position.start.offset<t.position.start.offset&&e.position.end.offset>t.position.end.offset)switch(e.type){case`flowMapping`:case`flowSequence`:return e.children.length===0||t.position.start.line>e.children[e.children.length-1].position.end.line}if(t.position.end.offset<e.position.end.offset)return!1;switch(e.type){case`sequenceItem`:return t.position.start.column>e.position.start.column;case`mappingKey`:case`mappingValue`:return t.position.start.column>e._parent.position.start.column&&(e.children.length===0||e.children.length===1&&e.children[0].type!==`blockFolded`&&e.children[0].type!==`blockLiteral`)&&(e.type===`mappingValue`||$t(e));default:return!1}}function $t(e){return e.position.start!==e.position.end&&(e.children.length===0||e.position.start.offset!==e.children[0].position.start.offset)}function Y(e,t){return{type:e,position:t}}function en(e,t,n){return{...Y(`root`,e),children:t,comments:n}}function tn(e){switch(e.type){case`DOCUMENT`:for(let t=e.contents.length-1;t>=0;t--)e.contents[t].type===`BLANK_LINE`?e.contents.splice(t,1):tn(e.contents[t]);for(let t=e.directives.length-1;t>=0;t--)e.directives[t].type===`BLANK_LINE`&&e.directives.splice(t,1);break;case`FLOW_MAP`:case`FLOW_SEQ`:case`MAP`:case`SEQ`:for(let t=e.items.length-1;t>=0;t--){let n=e.items[t];`char`in n||(n.type===`BLANK_LINE`?e.items.splice(t,1):tn(n))}break;case`MAP_KEY`:case`MAP_VALUE`:case`SEQ_ITEM`:e.node&&tn(e.node);break;case`ALIAS`:case`BLANK_LINE`:case`BLOCK_FOLDED`:case`BLOCK_LITERAL`:case`COMMENT`:case`DIRECTIVE`:case`PLAIN`:case`QUOTE_DOUBLE`:case`QUOTE_SINGLE`:break;default:throw Error(`Unexpected node type ${JSON.stringify(e.type)}`)}}function X(e,t){return{start:e,end:t}}function nn(e){return{start:e,end:e}}var rn;(function(e){e.Tag=`!`,e.Anchor=`&`,e.Comment=`#`})(rn||={});function an(e,t){return{...Y(`anchor`,e),value:t}}function on(e,t){return{...Y(`comment`,e),value:t}}function sn(e,t,n){return{anchor:t,tag:e,middleComments:n}}function cn(e,t){return{...Y(`tag`,e),value:t}}function ln(e,t,n=()=>!1){let r=e.cstNode,i=[],a=null,o=null,s=null;for(let c of r.props){let l=t.text[c.origStart];switch(l){case rn.Tag:a||=c,o=cn(t.transformRange(c),e.tag);break;case rn.Anchor:a||=c,s=an(t.transformRange(c),r.anchor);break;case rn.Comment:{let e=on(t.transformRange(c),t.text.slice(c.origStart+1,c.origEnd));t.comments.push(e),!n(e)&&a&&a.origEnd<=c.origStart&&c.origEnd<=r.valueRange.origStart&&i.push(e);break}default:throw Error(`Unexpected leading character ${JSON.stringify(l)}`)}}return sn(o,s,i)}function un(){return{leadingComments:[]}}function dn(e=null){return{trailingComment:e}}function Z(){return{...un(),...dn()}}function fn(e,t,n){return{...Y(`alias`,e),...Z(),...t,value:n}}function pn(e,t){let n=e.cstNode;return fn(t.transformRange({origStart:n.valueRange.origStart-1,origEnd:n.valueRange.origEnd}),t.transformContent(e),n.rawValue)}function mn(e){return{...e,type:`blockFolded`}}function hn(e,t,n,r,i,a){return{...Y(`blockValue`,e),...un(),...t,chomping:n,indent:r,value:i,indicatorComment:a}}var gn;(function(e){e.CLIP=`clip`,e.STRIP=`strip`,e.KEEP=`keep`})(gn||={});function _n(e,t){let n=e.cstNode,r=n.chomping===`CLIP`?0:1,i=n.header.origEnd-n.header.origStart-1-r!=0,a=t.transformRange({origStart:n.header.origStart,origEnd:n.valueRange.origEnd}),o=null;return hn(a,ln(e,t,e=>{if(!(a.start.offset<e.position.start.offset&&e.position.end.offset<a.end.offset))return!1;if(o)throw Error(`Unexpected multiple indicator comments at ${qt(e.position.start)}`);return o=e,!0}),gn[n.chomping],i?n.blockIndent:null,n.strValue,o)}function vn(e,t){return mn(_n(e,t))}function yn(e){return{...e,type:`blockLiteral`}}function bn(e,t){return yn(_n(e,t))}function xn(e,t){return on(t.transformRange(e.range),e.comment)}function Sn(e,t,n){return{...Y(`directive`,e),...Z(),name:t,parameters:n}}function Cn(e,t){for(let n of e.props){let e=t.text[n.origStart];switch(e){case rn.Comment:t.comments.push(on(t.transformRange(n),t.text.slice(n.origStart+1,n.origEnd)));break;default:throw Error(`Unexpected leading character ${JSON.stringify(e)}`)}}}function wn(e,t){return Cn(e,t),Sn(t.transformRange(e.range),e.name,e.parameters)}function Tn(e,t,n,r,i,a){return{...Y(`document`,e),...dn(a),directivesEndMarker:t,documentEndMarker:n,children:[r,i]}}function Q(e=[]){return{endComments:e}}function En(e,t,n){return{...Y(`documentBody`,e),...Q(n),children:t?[t]:[]}}function $(e){return e[e.length-1]}function Dn(e,t){let n=e.match(t);return n?n.index:-1}function On(e,t,n){let r=e.cstNode,{comments:i,endComments:a,documentTrailingComment:o,documentHeadTrailingComment:s}=kn(r,t,n),c=t.transformNode(e.contents),{position:l,documentEndPoint:u}=An(r,c,t);return t.comments.push(...i,...a),{documentBody:En(l,c,a),documentEndPoint:u,documentTrailingComment:o,documentHeadTrailingComment:s}}function kn(e,t,n){let r=[],i=[],a=[],o=[],s=!1;for(let i=e.contents.length-1;i>=0;i--){let c=e.contents[i];if(c.type===`COMMENT`){let i=t.transformNode(c);n&&n.line===i.position.start.line?o.unshift(i):s?r.unshift(i):i.position.start.offset>=e.valueRange.origEnd?a.unshift(i):r.unshift(i)}else s=!0}if(a.length>1)throw Error(`Unexpected multiple document trailing comments at ${qt(a[1].position.start)}`);if(o.length>1)throw Error(`Unexpected multiple documentHead trailing comments at ${qt(o[1].position.start)}`);return{comments:r,endComments:i,documentTrailingComment:$(a)||null,documentHeadTrailingComment:$(o)||null}}function An(e,t,n){let r=Dn(n.text.slice(e.valueRange.origEnd),/^\.\.\./),i=r===-1?e.valueRange.origEnd:Math.max(0,e.valueRange.origEnd-1);n.text[i-1]===`\r`&&i--;let a=n.transformRange({origStart:t===null?i:t.position.start.offset,origEnd:i});return{position:a,documentEndPoint:r===-1?a.end:n.transformOffset(e.valueRange.origEnd+3)}}function jn(e,t,n,r){return{...Y(`documentHead`,e),...Q(n),...dn(r),children:t}}function Mn(e,t){let n=e.cstNode,{directives:r,comments:i,endComments:a}=Nn(n,t),{position:o,documentEndMarkererPoint:s}=Pn(n,r,t);return t.comments.push(...i,...a),{createDocumentHeadWithTrailingComment:e=>(e&&t.comments.push(e),jn(o,r,a,e)),documentHeadEndMarkerPoint:s}}function Nn(e,t){let n=[],r=[],i=[],a=!1;for(let o=e.directives.length-1;o>=0;o--){let s=t.transformNode(e.directives[o]);s.type===`comment`?a?r.unshift(s):i.unshift(s):(a=!0,n.unshift(s))}return{directives:n,comments:r,endComments:i}}function Pn(e,t,n){let r=Dn(n.text.slice(0,e.valueRange.origStart),/---\s*$/);r>0&&!/[\r\n]/.test(n.text[r-1])&&(r=-1);let i=r===-1?{origStart:e.valueRange.origStart,origEnd:e.valueRange.origStart}:{origStart:r,origEnd:r+3};return t.length!==0&&(i.origStart=t[0].position.start.offset),{position:n.transformRange(i),documentEndMarkererPoint:r===-1?null:n.transformOffset(r)}}function Fn(e,t){let{createDocumentHeadWithTrailingComment:n,documentHeadEndMarkerPoint:r}=Mn(e,t),{documentBody:i,documentEndPoint:a,documentTrailingComment:o,documentHeadTrailingComment:s}=On(e,t,r),c=n(s);o&&t.comments.push(o);let l=e.cstNode;return Tn(X(c.position.start,a),!!l.directivesEndMarker,!!l.documentEndMarker,c,i,o)}function In(e,t,n){return{...Y(`flowCollection`,e),...Z(),...Q(),...t,children:n}}function Ln(e,t,n){return{...In(e,t,n),type:`flowMapping`}}function Rn(e,t,n){return{...Y(`flowMappingItem`,e),...un(),children:[t,n]}}function zn(e,t){let n=[];for(let r of e)r&&`type`in r&&r.type===`COMMENT`?t.comments.push(t.transformNode(r)):n.push(r);return n}function Bn(e){let[t,n]=[`?`,`:`].map(t=>{let n=e.find(e=>`char`in e&&e.char===t);return n?{origStart:n.origOffset,origEnd:n.origOffset+1}:null});return{additionalKeyRange:t,additionalValueRange:n}}function Vn(e,t){let n=t;return t=>e.slice(n,n=t)}function Hn(e){let t=[],n=Vn(e,1),r=!1;for(let i=1;i<e.length-1;i++){let a=e[i];if(`char`in a&&a.char===`,`){t.push(n(i)),n(i+1),r=!1;continue}r=!0}return r&&t.push(n(e.length-1)),t}function Un(e,t){return{...Y(`mappingKey`,e),...dn(),...Q(),children:t?[t]:[]}}function Wn(e,t){return{...Y(`mappingValue`,e),...Z(),...Q(),children:t?[t]:[]}}function Gn(e,t,n,r,i){let a=t.transformNode(e.key),o=t.transformNode(e.value),s=a||r?Un(t.transformRange({origStart:r?r.origStart:a.position.start.offset,origEnd:a?a.position.end.offset:r.origStart+1}),a):null,c=o||i?Wn(t.transformRange({origStart:i?i.origStart:o.position.start.offset,origEnd:o?o.position.end.offset:i.origStart+1}),o):null;return n(X(s?s.position.start:c.position.start,c?c.position.end:s.position.end),s||Un(nn(c.position.start),null),c||Wn(nn(s.position.end),null))}function Kn(e,t){let n=zn(e.cstNode.items,t),r=Hn(n),i=e.items.map((e,n)=>{let i=r[n],{additionalKeyRange:a,additionalValueRange:o}=Bn(i);return Gn(e,t,Rn,a,o)}),a=n[0],o=$(n);return Ln(t.transformRange({origStart:a.origOffset,origEnd:o.origOffset+1}),t.transformContent(e),i)}function qn(e,t,n){return{...In(e,t,n),type:`flowSequence`}}function Jn(e,t){return{...Y(`flowSequenceItem`,e),children:[t]}}function Yn(e,t){let n=zn(e.cstNode.items,t),r=Hn(n),i=e.items.map((e,n)=>{if(e.type!==`PAIR`){let n=t.transformNode(e);return Jn(X(n.position.start,n.position.end),n)}else{let i=r[n],{additionalKeyRange:a,additionalValueRange:o}=Bn(i);return Gn(e,t,Rn,a,o)}}),a=n[0],o=$(n);return qn(t.transformRange({origStart:a.origOffset,origEnd:o.origOffset+1}),t.transformContent(e),i)}function Xn(e,t,n){return{...Y(`mapping`,e),...un(),...t,children:n}}function Zn(e,t,n){return{...Y(`mappingItem`,e),...un(),children:[t,n]}}function Qn(e,t){let n=e.cstNode;n.items.filter(e=>e.type===`MAP_KEY`||e.type===`MAP_VALUE`).forEach(e=>Cn(e,t));let r=$n(zn(n.items,t)),i=e.items.map((e,n)=>{let i=r[n],[a,o]=i[0].type===`MAP_VALUE`?[null,i[0].range]:[i[0].range,i.length===1?null:i[1].range];return Gn(e,t,Zn,a,o)});return Xn(X(i[0].position.start,$(i).position.end),t.transformContent(e),i)}function $n(e){let t=[],n=Vn(e,0),r=!1;for(let i=0;i<e.length;i++){if(e[i].type===`MAP_VALUE`){t.push(n(i+1)),r=!1;continue}r&&t.push(n(i)),r=!0}return r&&t.push(n(1/0)),t}function er(e,t,n){return{...Y(`plain`,e),...Z(),...t,value:n}}function tr(e,t,n){for(let r=t;r>=0;r--)if(n.test(e[r]))return r;return-1}function nr(e,t){let n=e.cstNode;return er(t.transformRange({origStart:n.valueRange.origStart,origEnd:tr(t.text,n.valueRange.origEnd-1,/\S/)+1}),t.transformContent(e),n.strValue)}function rr(e){return{...e,type:`quoteDouble`}}function ir(e,t,n){return{...Y(`quoteValue`,e),...t,...Z(),value:n}}function ar(e,t){let n=e.cstNode;return ir(t.transformRange(n.valueRange),t.transformContent(e),n.strValue)}function or(e,t){return rr(ar(e,t))}function sr(e){return{...e,type:`quoteSingle`}}function cr(e,t){return sr(ar(e,t))}function lr(e,t,n){return{...Y(`sequence`,e),...un(),...Q(),...t,children:n}}function ur(e,t){return{...Y(`sequenceItem`,e),...Z(),...Q(),children:t?[t]:[]}}function dr(e,t){let n=zn(e.cstNode.items,t).map((n,r)=>{Cn(n,t);let i=t.transformNode(e.items[r]);return ur(X(t.transformOffset(n.valueRange.origStart),i===null?t.transformOffset(n.valueRange.origStart+1):i.position.end),i)});return lr(X(n[0].position.start,$(n).position.end),t.transformContent(e),n)}function fr(e,t){if(e===null||e.type===void 0&&e.value===null)return null;switch(e.type){case`ALIAS`:return pn(e,t);case`BLOCK_FOLDED`:return vn(e,t);case`BLOCK_LITERAL`:return bn(e,t);case`COMMENT`:return xn(e,t);case`DIRECTIVE`:return wn(e,t);case`DOCUMENT`:return Fn(e,t);case`FLOW_MAP`:return Kn(e,t);case`FLOW_SEQ`:return Yn(e,t);case`MAP`:return Qn(e,t);case`PLAIN`:return nr(e,t);case`QUOTE_DOUBLE`:return or(e,t);case`QUOTE_SINGLE`:return cr(e,t);case`SEQ`:return dr(e,t);default:throw Error(`Unexpected node type ${e.type}`)}}var pr,mr=class{text;comments=[];#e;#t;constructor(e,t){this.text=t,this.#e=e}setOrigRanges(){if(!this.#e.setOrigRanges())for(let e of this.#e)e.setOrigRanges([],0)}#n(e){if(!pr){let[e]=this.#e;pr=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(e)),`rangeAsLinePos`).get}if(this.#t??={root:{context:{src:this.text}}},this.text===``&&e.origStart===0&&e.origEnd===0)return{start:{offset:0,line:1,column:1},end:{offset:0,line:1,column:1}};let{start:{line:t,col:n},end:{line:r,col:i}}=pr.call({range:{start:this.#r(e.origStart),end:this.#r(e.origEnd)},context:this.#t});return{start:{offset:e.origStart,line:t,column:n},end:{offset:e.origEnd,line:r,column:i}}}#r(e){return e<0?0:e>this.text.length?this.text.length:e}transformOffset(e){return this.#n({origStart:e,origEnd:e}).start}transformRange(e){let{start:t,end:n}=this.#n(e);return X(t,n)}transformNode(e){return fr(e,this)}transformContent(e){return ln(e,this)}};function hr(e,t,n){let r=SyntaxError(e);return r.name=`YAMLSyntaxError`,r.source=t,r.position=n,r}function gr(e,t){let n=e.source.range||e.source.valueRange;return hr(e.message,t.text,t.transformRange(n))}function _r(e){if(`children`in e){if(e.children.length===1){let t=e.children[0];if(t.type===`plain`&&t.tag===null&&t.anchor===null&&t.value===``)return e.children.splice(0,1),e}e.children.forEach(_r)}return e}function vr(e,t,n,r){let i=t(e);return t=>{r(i,t)&&n(e,i=t)}}function yr(e){if(e===null||!(`children`in e))return;let t=e.children;if(t.forEach(yr),e.type===`document`){let[t,n]=e.children;t.position.start.offset===t.position.end.offset?t.position.start=t.position.end=n.position.start:n.position.start.offset===n.position.end.offset&&(n.position.start=n.position.end=t.position.end)}let n=vr(e.position,br,xr,wr),r=vr(e.position,Sr,Cr,Tr);`endComments`in e&&e.endComments.length!==0&&(n(e.endComments[0].position.start),r($(e.endComments).position.end));let i=t.filter(e=>e!==null);if(i.length!==0){let e=i[0],t=$(i);n(e.position.start),r(t.position.end),`leadingComments`in e&&e.leadingComments.length!==0&&n(e.leadingComments[0].position.start),`tag`in e&&e.tag&&n(e.tag.position.start),`anchor`in e&&e.anchor&&n(e.anchor.position.start),`trailingComment`in t&&t.trailingComment&&r(t.trailingComment.position.end)}}function br(e){return e.start}function xr(e,t){e.start=t}function Sr(e){return e.end}function Cr(e,t){e.end=t}function wr(e,t){return t.offset<e.offset}function Tr(e,t){return t.offset>e.offset}function Er(e){let t=Gt.default.parseCST(e),n=new mr(t,e);n.setOrigRanges();let r=t.map(e=>new Gt.default.Document({merge:!1,keepCstNodes:!0}).parse(e));for(let e of r)for(let t of e.errors)if(!(t instanceof Kt&&t.message===`Map keys must be unique; "<<" is repeated`))throw gr(t,n);r.forEach(e=>tn(e.cstNode));let i=en(n.transformRange({origStart:0,origEnd:e.length}),r.map(e=>n.transformNode(e)),n.comments);return Jt(i),yr(i),_r(i),i}function Dr(e,t){let n=SyntaxError(e+` (`+t.loc.start.line+`:`+t.loc.start.column+`)`);return Object.assign(n,t)}var Or=Dr;function kr(e){try{let t=Er(e);return delete t.comments,t}catch(e){throw e?.position?Or(e.message,{loc:e.position,cause:e}):e}}var Ar={astFormat:`yaml`,parse:kr,hasPragma:Be,hasIgnorePragma:Ve,locStart:et,locEnd:tt},jr={yaml:Bt},Mr=l(_(),1).default.parse;export{Mr as __parsePrettierYamlConfig,y as default,Vt as languages,Ut as options,Wt as parsers,jr as printers};
|