@eslint-sukka/yaml 8.10.1 → 8.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -24,7 +24,7 @@ ${t}`:n}else{let e=s.commentBefore;s.commentBefore=e?`${n}
|
|
|
24
24
|
${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:l(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(eZ.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,n,r)=>{let i=o(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=i.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new n.YAMLParseError(o(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){this.errors.push(new n.YAMLParseError(o(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=s.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}
|
|
25
25
|
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new n.YAMLParseError(o(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=Object.assign({_directives:this.directives},this.options),r=new t.Document(void 0,e);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}},eH}var nB={},n$={},nq={},nY={};function nj(){if(ep)return nB;ep=1;var e=function(){if(ec)return n$;ec=1;var e=nM(),t=nI(),n=nu(),r=tv();function i(e,t){if(t)for(let n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function s(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{let r=e.props.slice(1),i=t.length;for(let t of("block-scalar-header"===e.props[0].type&&(i-=e.props[0].source.length),r))t.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case"block-map":case"block-seq":{let r={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let r="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter(e=>"space"===e.type||"comment"===e.type||"newline"===e.type):[];for(let t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}return n$.createScalarToken=function(e,t){let{implicitKey:n=!1,indent:s,inFlow:o=!1,offset:l=-1,type:a="PLAIN"}=t,c=r.stringifyString({type:a,value:e},{implicitKey:n,indent:s>0?" ".repeat(s):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}}),u=t.end??[{type:"newline",offset:-1,indent:s,source:"\n"}];switch(c[0]){case"|":case">":{let e=c.indexOf("\n"),t=c.substring(0,e),n=c.substring(e+1)+"\n",r=[{type:"block-scalar-header",offset:l,indent:s,source:t}];return i(r,u)||r.push({type:"newline",offset:-1,indent:s,source:"\n"}),{type:"block-scalar",offset:l,indent:s,props:r,source:n}}case'"':return{type:"double-quoted-scalar",offset:l,indent:s,source:c,end:u};case"'":return{type:"single-quoted-scalar",offset:l,indent:s,source:c,end:u};default:return{type:"scalar",offset:l,indent:s,source:c,end:u}}},n$.resolveAsScalar=function(r,i=!0,s){if(r){let o=(e,t,r)=>{let i="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(s)s(i,t,r);else throw new n.YAMLParseError([i,i+1],t,r)};switch(r.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return t.resolveFlowScalar(r,i,o);case"block-scalar":return e.resolveBlockScalar({options:{strict:i}},r,o)}}return null},n$.setScalarValue=function(e,t,n={}){let{afterKey:o=!1,implicitKey:l=!1,inFlow:a=!1,type:c}=n,u="indent"in e?e.indent:null;if(o&&"number"==typeof u&&(u+=2),!c)switch(e.type){case"single-quoted-scalar":c="QUOTE_SINGLE";break;case"double-quoted-scalar":c="QUOTE_DOUBLE";break;case"block-scalar":{let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");c=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:c="PLAIN"}let f=r.stringifyString({type:c,value:t},{implicitKey:l||null===u,indent:null!==u&&u>0?" ".repeat(u):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}});switch(f[0]){case"|":case">":!function(e,t){let n=t.indexOf("\n"),r=t.substring(0,n),s=t.substring(n+1)+"\n";if("block-scalar"===e.type){let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");t.source=r,e.source=s}else{let{offset:t}=e,n="indent"in e?e.indent:-1,o=[{type:"block-scalar-header",offset:t,indent:n,source:r}];for(let t of(i(o,"end"in e?e.end:void 0)||o.push({type:"newline",offset:-1,indent:n,source:"\n"}),Object.keys(e)))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:"block-scalar",indent:n,props:o,source:s})}}(e,f);break;case'"':s(e,f,"double-quoted-scalar");break;case"'":s(e,f,"single-quoted-scalar");break;default:s(e,f,"scalar")}},n$}(),t=function(){if(eu)return nq;function e(n){switch(n.type){case"block-scalar":{let t="";for(let r of n.props)t+=e(r);return t+n.source}case"block-map":case"block-seq":{let e="";for(let r of n.items)e+=t(r);return e}case"flow-collection":{let e=n.start.source;for(let r of n.items)e+=t(r);for(let t of n.end)e+=t.source;return e}case"document":{let e=t(n);if(n.end)for(let t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(let t of n.end)e+=t.source;return e}}}function t({start:n,key:r,sep:i,value:s}){let o="";for(let e of n)o+=e.source;if(r&&(o+=e(r)),i)for(let e of i)o+=e.source;return s&&(o+=e(s)),o}return eu=1,nq.stringify=n=>"type"in n?e(n):t(n),nq}(),n=function(){if(ef)return nY;ef=1;let e=Symbol("break visit"),t=Symbol("skip children"),n=Symbol("remove item");function r(t,r){"type"in t&&"document"===t.type&&(t={start:t.start,value:t.value}),function t(r,i,s){let o=s(i,r);if("symbol"==typeof o)return o;for(let l of["key","value"]){let a=i[l];if(a&&"items"in a){for(let i=0;i<a.items.length;++i){let o=t(Object.freeze(r.concat([[l,i]])),a.items[i],s);if("number"==typeof o)i=o-1;else{if(o===e)return e;o===n&&(a.items.splice(i,1),i-=1)}}"function"==typeof o&&"key"===l&&(o=o(i,r))}}return"function"==typeof o?o(i,r):o}(Object.freeze([]),t,r)}return r.BREAK=e,r.SKIP=t,r.REMOVE=n,r.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(!t||!("items"in t))return;n=t.items[r]}return n},r.parentCollection=(e,t)=>{let n=r.itemAtPath(e,t.slice(0,-1)),i=t[t.length-1][0],s=n?.[i];if(s&&"items"in s)return s;throw Error("Parent collection not found")},nY.visit=r,nY}();return nB.createScalarToken=e.createScalarToken,nB.resolveAsScalar=e.resolveAsScalar,nB.setScalarValue=e.setScalarValue,nB.stringify=t.stringify,nB.visit=n.visit,nB.BOM="\uFEFF",nB.DOCUMENT="\x02",nB.FLOW_END="\x18",nB.SCALAR="\x1f",nB.isCollection=e=>!!e&&"items"in e,nB.isScalar=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),nB.prettyToken=function(e){switch(e){case"\uFEFF":return"<BOM>";case"\x02":return"<DOC>";case"\x18":return"<FLOW_END>";case"\x1f":return"<SCALAR>";default:return JSON.stringify(e)}},nB.tokenType=function(e){switch(e){case"\uFEFF":return"byte-order-mark";case"\x02":return"doc-mode";case"\x18":return"flow-error-end";case"\x1f":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null},nB}var nF={};function nD(){if(ed)return nF;ed=1;var e=nj();function t(e){switch(e){case void 0:case" ":case"\n":case"\r":case" ":return!0;default:return!1}}let n=new Set("0123456789ABCDEFabcdef"),r=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),i=new Set(",[]{}"),s=new Set(" ,[]{}\n\r "),o=e=>!e||s.has(e);return nF.Lexer=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||" "===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let t=0;for(;" "===n;)n=this.buffer[++t+e];if("\r"===n){let n=this.buffer[t+e+1];if("\n"===n||!n&&!this.atEnd)return e+t+1}return"\n"!==n&&!(t>=this.indentNext)&&(n||this.atEnd)?-1:e+t}if("-"===n||"."===n){let n=this.buffer.substr(e,3);if(("---"===n||"..."===n)&&t(this.buffer[e+3]))return -1}return e}getLine(){let e=this.lineEndPos;return(("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e)?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(null===t)return this.setNext("stream");if(t[0]===e.BOM&&(yield*this.pushCount(1),t=t.substring(1)),"%"===t[0]){let e=t.length,n=t.indexOf("#");for(;-1!==n;){let r=t[n-1];if(" "===r||" "===r){e=n-1;break}n=t.indexOf("#",n+1)}for(;;){let n=t[e-1];if(" "===n||" "===n)e-=1;else break}let r=(yield*this.pushCount(e))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let e=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-e),yield*this.pushNewline(),"stream"}return yield e.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let e=this.peek(3);if(("---"===e||"..."===e)&&t(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"---"===e?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!t(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&t(n)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(o),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let n,r,i=-1;do(n=yield*this.pushNewline())>0?(r=yield*this.pushSpaces(!1),this.indentValue=i=r):r=0,r+=yield*this.pushSpaces(!0);while(n+r>0);let s=this.getLine();if(null===s)return this.setNext("flow");if((-1!==i&&i<this.indentNext&&"#"!==s[0]||0===i&&(s.startsWith("---")||s.startsWith("..."))&&t(s[3]))&&(i!==this.indentNext-1||1!==this.flowLevel||"]"!==s[0]&&"}"!==s[0]))return this.flowLevel=0,yield e.FLOW_END,yield*this.parseLineStart();let l=0;for(;","===s[l];)l+=yield*this.pushCount(1),l+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s[l+=yield*this.pushIndicators()]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-l),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(o),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let e=this.charAt(1);if(this.flowKey||t(e)||","===e)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if("'"===e)for(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1)}let n=this.buffer.substring(0,t),r=n.indexOf("\n",this.pos);if(-1!==r){for(;-1!==r;){let e=this.continueScalar(r+1);if(-1===e)break;r=n.indexOf("\n",e)}-1!==r&&(t=r-("\r"===n[r-1]?2:1))}if(-1===t){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if("+"===t)this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil(e=>t(e)||"#"===e)}*parseBlockScalar(){let t,n=this.pos-1,r=0;e:for(let e=this.pos;t=this.buffer[e];++e)switch(t){case" ":r+=1;break;case"\n":n=e,r=0;break;case"\r":{let t=this.buffer[e+1];if(!t&&!this.atEnd)return this.setNext("block-scalar");if("\n"===t)break}default:break e}if(!t&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=r:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{let e=this.continueScalar(n+1);if(-1===e)break;n=this.buffer.indexOf("\n",e)}while(-1!==n);if(-1===n){if(!this.atEnd)return this.setNext("block-scalar");n=this.buffer.length}}let i=n+1;for(t=this.buffer[i];" "===t;)t=this.buffer[++i];if(" "===t){for(;" "===t||" "===t||"\r"===t||"\n"===t;)t=this.buffer[++i];n=i-1}else if(!this.blockScalarKeep)for(;;){let e=n-1,t=this.buffer[e];"\r"===t&&(t=this.buffer[--e]);let i=e;for(;" "===t;)t=this.buffer[--e];if("\n"===t&&e>=this.pos&&e+1+r>i)n=e;else break}return yield e.SCALAR,yield*this.pushToIndex(n+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let n,r=this.flowLevel>0,s=this.pos-1,o=this.pos-1;for(;n=this.buffer[++o];)if(":"===n){let e=this.buffer[o+1];if(t(e)||r&&i.has(e))break;s=o}else if(t(n)){let e=this.buffer[o+1];if("\r"===n&&("\n"===e?(o+=1,n="\n",e=this.buffer[o+1]):s=o),"#"===e||r&&i.has(e))break;if("\n"===n){let e=this.continueScalar(o+1);if(-1===e)break;o=Math.max(o,e-2)}}else{if(r&&i.has(n))break;s=o}return n||this.atEnd?(yield e.SCALAR,yield*this.pushToIndex(s+1,!0),r?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(o))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,n=this.charAt(1);if(t(n)||e&&i.has(n))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,n=this.buffer[e];for(;!t(n)&&">"!==n;)n=this.buffer[++e];return yield*this.pushToIndex(">"===n?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(r.has(t))t=this.buffer[++e];else if("%"===t&&n.has(this.buffer[e+1])&&n.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,n=this.pos-1;do t=this.buffer[++n];while(" "===t||e&&" "===t);let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},nF}var n_={};function nR(){return eh||(eh=1,n_.LineCounter=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(0===t)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}}),n_}var nK={};function nU(){if(eg)return nK;eg=1;var e=nj(),t=nD();function n(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function r(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return -1}function i(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function s(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function o(e){if(0===e.length)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function l(e){if("flow-seq-start"===e.start.type)for(let t of e.items)!t.sep||t.value||n(t.start,"explicit-key-ind")||n(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,i(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}return nK.Parser=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new t.Lexer,this.onNewLine=e}*parse(e,t=!1){for(let n of(this.onNewLine&&0===this.offset&&this.onNewLine(0),this.lexer.lex(e,t)))yield*this.next(n);t||(yield*this.end())}*next(t){if(this.source=t,eZ.env.LOG_TOKENS&&console.log("|",e.prettyToken(t)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}let n=e.tokenType(t);if(n)if("scalar"===n)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&" "===t[0]&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{let e=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:e,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if("doc-end"===this.type&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else{let e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&l(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case"flow-collection":{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if(("document"===e.type||"block-map"===e.type||"block-seq"===e.type)&&("block-map"===t.type||"block-seq"===t.type)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===r(n.start)&&(0===t.indent||n.start.every(e=>"comment"!==e.type||e.indent<t.indent))&&("document"===e.type?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}else yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};"doc-start"===this.type&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":-1!==r(e.start)?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return;case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if("map-value-ind"===this.type){let t,n=o(s(this.peek(2)));e.end?((t=e.end).push(this.sourceToken),delete e.end):t=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:t}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;r?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2],r=n?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,s=r&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type,l=[];if(s&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case"newline":n.push(r);break;case"space":break;case"comment":i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(l=t.sep.splice(n[1]))}switch(this.type){case"anchor":case"tag":s||t.value?(l.push(this.sourceToken),e.items.push({start:l}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":t.sep||t.explicitKey?s||t.value?(l.push(this.sourceToken),e.items.push({start:l,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(n(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]});else if(i(t.key)&&!n(t.sep,"newline")){let e=o(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else l.length>0?t.sep=t.sep.concat(l,this.sourceToken):t.sep.push(this.sourceToken);else if(n(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=o(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||s?e.items.push({start:l,key:null,sep:[this.sourceToken]}):n(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);s||t.value?(e.items.push({start:l,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let i=this.startBlockValue(e);if(i){if("block-seq"===i.type){if(!t.explicitKey&&t.sep&&!n(t.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else r&&e.items.push({start:l});this.stack.push(i);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;r?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2],r=n?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||n(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do yield*this.pop(),e=this.peek(1);while(e?.type==="flow-collection")}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if("block-map"!==t.type||("map-value-ind"!==this.type||t.indent!==e.indent)&&("newline"!==this.type||t.items[t.items.length-1].sep))if("map-value-ind"===this.type&&"flow-collection"!==t.type){let n=o(s(t));l(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e);else yield*this.pop(),yield*this.step()}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=o(s(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=o(s(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&!(this.indent<=t)&&e.every(e=>"newline"===e.type||"space"===e.type)}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}},nK}var nV={},nW=function(){if(ey)return eX;ey=1;var e=nP(),t=na(),n=no(),r=nu(),i=to(),s=e2(),o=tC(),l=tu(),a=tB(),c=tj(),u=nj(),f=nD(),p=nR(),d=nU(),h=function(){if(em)return nV;em=1;var e=nP(),t=na(),n=nu(),r=tA(),i=e2(),s=nR(),o=nU();function l(e){let t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new s.LineCounter||null,prettyErrors:t}}function a(t,r={}){let{lineCounter:i,prettyErrors:s}=l(r),c=new o.Parser(i?.addNewLine),u=new e.Composer(r),f=null;for(let e of u.compose(c.parse(t),!0,t.length))if(f){if("silent"!==f.options.logLevel){f.errors.push(new n.YAMLParseError(e.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else f=e;return s&&i&&(f.errors.forEach(n.prettifyError(t,i)),f.warnings.forEach(n.prettifyError(t,i))),f}return nV.parse=function(e,t,n){let i;"function"==typeof t?i=t:void 0===n&&t&&"object"==typeof t&&(n=t);let s=a(e,n);if(!s)return null;if(s.warnings.forEach(e=>r.warn(s.options.logLevel,e)),s.errors.length>0)if("silent"!==s.options.logLevel)throw s.errors[0];else s.errors=[];return s.toJS(Object.assign({reviver:i},n))},nV.parseAllDocuments=function(t,r={}){let{lineCounter:i,prettyErrors:s}=l(r),a=new o.Parser(i?.addNewLine),c=new e.Composer(r),u=Array.from(c.compose(a.parse(t)));if(s&&i)for(let e of u)e.errors.forEach(n.prettifyError(t,i)),e.warnings.forEach(n.prettifyError(t,i));return u.length>0?u:Object.assign([],{empty:!0},c.streamInfo())},nV.parseDocument=a,nV.stringify=function(e,n,r){let s=null;if("function"==typeof n||Array.isArray(n)?s=n:void 0===r&&n&&(r=n),"string"==typeof r&&(r=r.length),"number"==typeof r){let e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){let{keepUndefined:e}=r??n??{};if(!e)return}return i.isDocument(e)&&!s?e.toString(r):new t.Document(e,s,r).toString(r)},nV}(),g=e8();return eX.Composer=e.Composer,eX.Document=t.Document,eX.Schema=n.Schema,eX.YAMLError=r.YAMLError,eX.YAMLParseError=r.YAMLParseError,eX.YAMLWarning=r.YAMLWarning,eX.Alias=i.Alias,eX.isAlias=s.isAlias,eX.isCollection=s.isCollection,eX.isDocument=s.isDocument,eX.isMap=s.isMap,eX.isNode=s.isNode,eX.isPair=s.isPair,eX.isScalar=s.isScalar,eX.isSeq=s.isSeq,eX.Pair=o.Pair,eX.Scalar=l.Scalar,eX.YAMLMap=a.YAMLMap,eX.YAMLSeq=c.YAMLSeq,eX.CST=u,eX.Lexer=f.Lexer,eX.LineCounter=p.LineCounter,eX.Parser=d.Parser,eX.parse=h.parse,eX.parseAllDocuments=h.parseAllDocuments,eX.parseDocument=h.parseDocument,eX.stringify=h.stringify,eX.visit=g.visit,eX.visitAsync=g.visitAsync,eX}();let nJ={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ExportAllDeclaration:["exported","source","attributes"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ExpressionStatement:["expression"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportAttribute:["key","value"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportExpression:["source","options"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXClosingFragment:[],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXFragment:["openingFragment","children","closingFragment"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXOpeningFragment:[],JSXSpreadAttribute:["argument"],JSXSpreadChild:["expression"],JSXText:[],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],StaticBlock:["body"],Super:[],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]};for(let e of Object.keys(nJ))Object.freeze(nJ[e]);function nz(e){return nG(e,null)}function nG(e,t){return nQ[e.type](e,t)}Object.freeze(nJ);let nQ={Program:e=>0===e.body.length?null:1===e.body.length?nQ.YAMLDocument(e.body[0]):e.body.map(e=>nQ.YAMLDocument(e)),YAMLDocument:e=>e.content?nG(e.content,e.version):null,YAMLMapping(e,t){let n={};for(let r of e.pairs)Object.assign(n,nG(r,t));return n},YAMLPair(e,t){let n={},r=e.key?nG(e.key,t):null;return"string"!=typeof r&&"number"!=typeof r&&(r=String(r)),n[r]=e.value?nG(e.value,t):null,n},YAMLSequence(e,t){let n=[];for(let r of e.entries)n.push(r?nG(r,t):null);return n},YAMLScalar:e=>e.value,YAMLAlias(e,t){let n=function(e){let t=e.parent,n=null;for(;t;){if("YAMLDocument"===t.type){n=t;break}t=t.parent}let r=n.anchors[e.name];if(!r)return null;let i={anchor:null,distance:1/0};for(let t of r)if(t.range[0]<e.range[0]){let n=e.range[0]-t.range[0];i.distance>=n&&(i={anchor:t,distance:n})}return i.anchor}(e);return n?nG(n.parent,t):null},YAMLWithMeta(e,t){if(e.tag){let n=e.value;if(null==n)return nX(e.tag,"","",t);if("YAMLScalar"===n.type){if("plain"===n.style)return nX(e.tag,n.strValue,n.strValue,t);if("double-quoted"===n.style||"single-quoted"===n.style)return nX(e.tag,n.raw,n.strValue,t)}for(let r of n7[t||"1.2"])if(r.tag===e.tag.tag&&r.testNode(n))return r.resolveNode(n)}return null==e.value?null:nG(e.value,t)}};function nX(e,t,n,r){for(let t of n5[r||"1.2"])if(t.tag===e.tag&&t.testString(n))return t.resolveString(n);let i=e.tag.startsWith("!")?e.tag:`!<${e.tag}>`;return nW.parseDocument(`${r?`%YAML ${r}`:""}
|
|
26
26
|
---
|
|
27
|
-
${i} ${t}`).toJSON()}let nH={tag:"tag:yaml.org,2002:omap",testNode:e=>"YAMLSequence"===e.type&&e.entries.every(e=>e?.type==="YAMLMapping"&&1===e.pairs.length),resolveNode(e){let t={};for(let n of e.entries)for(let e of n.pairs)t[e.key?nz(e.key):e.key]=e.value?nz(e.value):e.value;return t}},nZ={tag:"tag:yaml.org,2002:set",testNode:e=>"YAMLMapping"===e.type&&e.pairs.every(e=>null!=e.key&&null==e.value),resolveNode(e){let t=[];for(let n of e.pairs)t.push(nz(n.key));return t}},n0={tag:"tag:yaml.org,2002:null",testString:e=>!e||"null"===e||"Null"===e||"NULL"===e||"~"===e,resolveString:()=>null},n1={tag:"tag:yaml.org,2002:float",testString:e=>/^[+-]?(?:\.inf|\.Inf|\.INF)$/u.test(e),resolveString:e=>e.startsWith("-")?-1/0:1/0},n2={tag:"tag:yaml.org,2002:float",testString:e=>".NaN"===e||".nan"===e||".NAN"===e,resolveString:()=>NaN},n9={tag:"tag:yaml.org,2002:str",testString:()=>!0,resolveString:e=>e},n8=[n0,{tag:"tag:yaml.org,2002:bool",testString:e=>"true"===e||"True"===e||"TRUE"===e,resolveString:()=>!0},{tag:"tag:yaml.org,2002:bool",testString:e=>"false"===e||"False"===e||"FALSE"===e,resolveString:()=>!1},{tag:"tag:yaml.org,2002:int",testString:e=>/^[+-]?\d+$/u.test(e),resolveString:e=>parseInt(e,10)},{tag:"tag:yaml.org,2002:int",testString:e=>/^0o[0-7]+$/u.test(e),resolveString:e=>parseInt(e.slice(2),8)},{tag:"tag:yaml.org,2002:int",testString:e=>/^0x[\dA-Fa-f]+$/u.test(e),resolveString:e=>parseInt(e.slice(2),16)},{tag:"tag:yaml.org,2002:float",testString:e=>/^[+-]?(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?$/iu.test(e),resolveString:e=>parseFloat(e)},n1,n2,n9],n6=[nH,nZ];function n3(e,t,n){return e.startsWith("-")||e.startsWith("+")?parseInt(e[0]+e.slice(t+1).replace(/_/gu,""),n):parseInt(e.slice(t).replace(/_/gu,""),n)}function n4(e,t){let n=e.shift().replace(/_/gu,""),r=e.pop().replace(/_/gu,""),i=!1;(n.startsWith("-")||n.startsWith("+"))&&(i=n.startsWith("-"),n=n.slice(1));let s=parseInt(n,10);for(;e.length;)s*=60,s+=parseInt(e.shift().replace(/_/gu,""),10);return s*=60,s+=t?parseInt(r,10):parseFloat(r),i?-s:s}let n5={next:n8,"1.2":n8,"1.1":[n0,{tag:"tag:yaml.org,2002:bool",testString:e=>/^(?:y|Y|yes|Yes|YES|true|True|TRUE|on|On|ON)$/u.test(e),resolveString:()=>!0},{tag:"tag:yaml.org,2002:bool",testString:e=>/^(?:n|N|no|No|NO|false|False|FALSE|off|Off|OFF)$/u.test(e),resolveString:()=>!1},{tag:"tag:yaml.org,2002:int",testString:e=>/^[+-]?0[0-7_]+$/u.test(e),resolveString:e=>n3(e,1,8)},{tag:"tag:yaml.org,2002:int",testString:e=>/^[+-]?(?:0|[1-9][\d_]*)$/u.test(e),resolveString:e=>n3(e,0,10)},{tag:"tag:yaml.org,2002:int",testString:e=>/^[+-]?0b[01_]+$/u.test(e),resolveString:e=>n3(e,2,2)},{tag:"tag:yaml.org,2002:int",testString:e=>/^[+-]?0x[\dA-F_a-f]+$/u.test(e),resolveString:e=>n3(e,2,16)},{tag:"tag:yaml.org,2002:int",testString:e=>/^[+-]?[1-9][\d_]*(?::[0-5]?\d)+$/u.test(e),resolveString:e=>n4(e.split(/:/u),!0)},{tag:"tag:yaml.org,2002:float",testString:e=>/^[+-]?(?:\d[\d_]*)?\.[\d_]*(?:e[+-]?\d+)?$/iu.test(e)||/^[+-]?(?:\d[\d_]*)?(?:e[+-]?\d+)?$/iu.test(e),resolveString:e=>parseFloat(e.replace(/_/gu,""))},{tag:"tag:yaml.org,2002:float",testString:e=>/^[+-]?\d[\d_]*(?::[0-5]?\d)+\.[\d_]*$/u.test(e),resolveString:e=>n4(e.split(/:/u),!1)},n1,n2,n9]},n7={next:n6,"1.2":n6,"1.1":[nH,nZ]},re=nW.isPair;var rt=class{constructor(e,t){this.index=0,this.array=e,this.ctx=t}first(){let e;for(;e=this.array[this.index];){if(rf(e,this.ctx)){this.index++;continue}return e}return null}consume(){let e=this.first();return e&&this.index++,e}back(){this.index--}each(e){let t;for(;t=this.consume();)e(t)}};function rn(e){return nW.isMap(e)?"MAP":nW.isSeq(e)?"SEQ":nW.isScalar(e)?"SCALAR":nW.isAlias(e)?"ALIAS":re(e)?"PAIR":nW.isDocument(e)?"DOCUMENT":"unknown"}function*rr(e,t,n,r){for(let i of t)yield function(e,t,n,r){let i,s=n.getConvertLocation(...rm(t)),o=n.code.slice(...s.range),l=t.source.trim().split(/[\t ]+/),a=l.shift();if("%YAML"===a)i={type:"YAMLDirective",value:o,kind:"YAML",version:e?e.yaml.version:t.source.slice(6).trim(),parent:r,...s};else if("%TAG"===a){let[e,t]=l;i={type:"YAMLDirective",value:o,kind:"TAG",handle:e,prefix:t,parent:r,...s}}else i={type:"YAMLDirective",value:o,kind:null,parent:r,...s};return n.addToken("Directive",s.range),i}(e,i,n,r)}function ri(e,t,n,r,i,s){var o,l,a,c,u,f,p,d,h,g,m,y;if(!n)throw r.throwError(`unknown error: AST is null. Unable to process content CST (${t.type}).`,t);if(n.srcToken!==t)throw r.throwError(`unknown error: CST is mismatched. Unable to process content CST (${t.type}: ${n.srcToken?.type}).`,t);if("block-scalar"===t.type){if(!nW.isScalar(n))throw r.throwError(`unknown error: AST is not Scalar (${rn(n)}). Unable to process Scalar CST.`,t);return function(e,t,n,r,i,s){var o,l;let a,c,u,f=t.offset;for(let e of t.props){if(rf(e,r)){f=e.offset+e.source.length;continue}if("block-scalar-header"===e.type){f=(c=r.addToken("Punctuator",rm(e))).range[1];continue}throw r.throwUnexpectedTokenError(e)}let p=c.value,d=n.source?(o=f+t.source.length,l=r,a=o,"\n"===l.code[a-1]&&a>1&&(a--,"\r"===l.code[a-1]&&a>1&&a--),a):r.lastSkipSpaces(t.offset,c.range[1]),h=r.getConvertLocation(c.range[0],d);if(p.startsWith(">")){u={type:"YAMLScalar",style:"folded",...g(p),value:n.source,parent:i,...h};let e=r.code.slice(f,d),t=[f+/^[^\S\n\r]*/.exec(e)[0].length,d];t[0]<t[1]&&r.addToken("BlockFolded",t)}else{u={type:"YAMLScalar",style:"literal",...g(p),value:n.source,parent:i,...h};let e=r.code.slice(f,d),t=[f+/^[^\S\n\r]*/.exec(e)[0].length,d];t[0]<t[1]&&r.addToken("BlockLiteral",t)}return ra(e,n,r,i,u,s,u);function g(e){let t=/([+-]?)(\d*)([+-]?)$/u.exec(e),n=null,r="clip";if(t){n=t[2]?Number(t[2]):null;let e=t[3]||t[1];r="+"===e?"keep":"-"===e?"strip":"clip"}return{chomping:r,indent:n}}}(e,t,n,r,i,s)}if("block-seq"===t.type){if(!nW.isSeq(n))throw r.throwError(`unknown error: AST is not Seq (${rn(n)}). Unable to process Seq CST.`,t);return function(e,t,n,r,i,s){let o,l={type:"YAMLSequence",style:"block",entries:[],parent:i,...r.getConvertLocation(t.offset,t.offset)},a=[...n.items];for(let e of t.items){let t,n,i=new rt(e.start,r);for(;n=i.consume();){if("seq-item-ind"===n.type){if(t)throw r.throwUnexpectedTokenError(n);o=t=r.addToken("Punctuator",rm(n));continue}i.back();break}if(0===a.length){let t=i.first()||e.key||e.sep?.[0]||e.value;if(!t)break;throw r.throwUnexpectedTokenError(t)}l.entries.push(function(e,t,n,r,i,s,o){if(t.key)throw r.throwUnexpectedTokenError(t.key);if(t.sep)throw r.throwUnexpectedTokenError(t.sep);if(t.value){if(re(n)){if("block-map"===t.value.type)return rs(e,t.value,n,r,i,s);if("flow-collection"===t.value.type)return ro(e,t.value,n,r,i,s);throw r.throwError(`unknown error: CST is not block-map and flow-collection (${t.value.type}). Unable to process Pair AST.`,t.value)}return ri(e,t.value,n,r,i,s)}if(!rc(n))throw r.throwError(`unknown error: AST is not Scalar and null (${rn(n)}). Unable to process empty seq item CST.`,e.first()??o);return ra(e,n,r,i,null,s,null)}(i,e,a.shift()||null,r,l,s,(l.entries[l.entries.length-1]||l).range[1]))}return rb(l,l.entries[l.entries.length-1]||o),ra(e,n,r,i,l,s,l)}(e,t,n,r,i,s)}if("block-map"===t.type){if(!nW.isMap(n))throw r.throwError(`unknown error: AST is not Map and Pair (${rn(n)}). Unable to process Map CST.`,t);return rs(e,t,n,r,i,s)}if("flow-collection"===t.type)return ro(e,t,n,r,i,s);if("scalar"===t.type){if(!nW.isScalar(n))throw r.throwError(`unknown error: AST is not Scalar (${rn(n)}). Unable to process Scalar CST.`,t);return function(e,t,n,r,i,s){let o,l=r.getConvertLocation(...rm(t));if(l.range[0]<l.range[1]){let a=n.source||t.source,c=function(e,t){for(let n of n5[t])if(n.testString(e))return n.resolveString(e);return e}(a,s.version||"1.2");o={type:"YAMLScalar",style:"plain",strValue:a,value:c,raw:r.code.slice(...l.range),parent:i,...l};let u=typeof c;"boolean"===u?r.addToken("Boolean",l.range):"number"===u&&isFinite(Number(c))?r.addToken("Numeric",l.range):null===c?r.addToken("Null",l.range):r.addToken("Identifier",l.range),o=ra(e,n,r,i,o,s,l)}else o=ra(e,n,r,i,null,s,l);return t.end?.forEach(e=>rp(e,r)),o}(e,t,n,r,i,s)}if("double-quoted-scalar"===t.type){let p,d,h;if(!nW.isScalar(n))throw r.throwError(`unknown error: AST is not Scalar (${rn(n)}). Unable to process Scalar CST.`,t);return o=e,l=t,a=n,c=r,u=i,f=s,p=c.getConvertLocation(...rm(l)),h={type:"YAMLScalar",style:"double-quoted",strValue:d=a.source,value:d,raw:c.code.slice(...p.range),parent:u,...p},c.addToken("String",p.range),l.end?.forEach(e=>rp(e,c)),ra(o,a,c,u,h,f,h)}if("single-quoted-scalar"===t.type){let o,l,a;if(!nW.isScalar(n))throw r.throwError(`unknown error: AST is not Scalar (${rn(n)}). Unable to process Scalar CST.`,t);return p=e,d=t,h=n,g=r,m=i,y=s,o=g.getConvertLocation(...rm(d)),a={type:"YAMLScalar",style:"single-quoted",strValue:l=h.source,value:l,raw:g.code.slice(...o.range),parent:m,...o},g.addToken("String",o.range),d.end?.forEach(e=>rp(e,g)),ra(p,h,g,m,a,y,a)}if("alias"===t.type){if(!nW.isAlias(n))throw r.throwError(`unknown error: AST is not Alias (${rn(n)}). Unable to process Alias CST.`,t);return function(e,t,n,r){let[i,s]=rm(t),o=n.getConvertLocation(i,n.lastSkipSpaces(i,s)),l={type:"YAMLAlias",name:t.source.slice(1),parent:r,...o};n.addToken("Punctuator",[o.range[0],o.range[0]+1]);let a=[o.range[0]+1,o.range[1]];a[0]<a[1]&&n.addToken("Identifier",a);let c=e.first();if(c)throw n.throwUnexpectedTokenError(c);return t.end?.forEach(e=>rp(e,n)),l}(e,t,r,i)}throw Error(`Unsupported node: ${t.type}`)}function rs(e,t,n,r,i,s){let o,l;if(re(n)){if(n.srcToken!==t.items[0])throw r.throwError(`unknown error: CST is mismatched. Unable to process mapping CST (${t.type}: "CollectionItem").`,t)}else if(n.srcToken!==t)throw r.throwError(`unknown error: CST is mismatched. Unable to process mapping CST (${t.type}: ${n.srcToken?.type}).`,t);let a={type:"YAMLMapping",style:"block",pairs:[],parent:i,...r.getConvertLocation(t.offset,t.offset)},c=ru(n);for(let e of t.items){let t,n=new rt(e.start,r),i=null;for(;t=n.consume();){if("explicit-key-ind"===t.type){if(i)throw r.throwUnexpectedTokenError(t);l=i=r.addToken("Punctuator",rm(t)),o??=i;continue}n.back();break}let u=c.shift();if(!u){let t=n.first()||i||e.key||e.sep?.[0]||e.value;if(!t)break;throw r.throwUnexpectedTokenError(t)}a.pairs.push(rl(i,n,e,u,r,a,s))}return(ry(a,o),ry(a,a.pairs[0]),rb(a,a.pairs[a.pairs.length-1]||l),nW.isMap(n))?ra(e,n,r,i,a,s,a):a}function ro(e,t,n,r,i,s){if("flow-map-start"===t.start.type){let o=r.addToken("Punctuator",rm(t.start));if(!nW.isMap(n)&&!re(n))throw r.throwError(`unknown error: AST is not Map and Pair (${rn(n)}). Unable to process flow map CST.`,t);return function(e,t,n,r,i,s,o){let l,a,c={type:"YAMLMapping",style:"flow",pairs:[],parent:s,...i.getConvertLocation(t.range[0],n.offset)},u=ru(r);for(let e of n.items){let t,n=new rt(e.start,i),r=null;for(;t=n.consume();){if("comma"===t.type){l=i.addToken("Punctuator",rm(t));continue}if("explicit-key-ind"===t.type){if(r)throw i.throwUnexpectedTokenError(t);l=r=i.addToken("Punctuator",rm(t));continue}n.back();break}let s=u.shift();if(!s){let t=n.first()||r||e.key||e.sep?.[0]||e.value;if(!t)break;throw i.throwUnexpectedTokenError(t)}c.pairs.push(rl(r,n,e,s,i,c,o))}for(let e of n.end)if(!rf(e,i)){if("flow-map-end"===e.type){a=i.addToken("Punctuator",rm(e));continue}throw i.throwUnexpectedTokenError(e)}return(rb(c,a||c.pairs[c.pairs.length-1]||l),nW.isMap(r))?ra(e,r,i,s,c,o,c):c}(e,o,t,n,r,i,s)}if("flow-seq-start"===t.start.type){let o=r.addToken("Punctuator",rm(t.start));if(!nW.isSeq(n)||!n.flow)throw r.throwError(`unknown error: AST is not flow Seq (${rn(n)}). Unable to process flow seq CST.`,t);return function(e,t,n,r,i,s,o){let l,a,c={type:"YAMLSequence",style:"flow",entries:[],parent:s,...i.getConvertLocation(t.range[0],n.offset)},u=[...r.items];for(let e of n.items){let n,r=new rt(e.start,i);for(;n=r.consume();){if("comma"===n.type){l=i.addToken("Punctuator",rm(n));continue}r.back();break}if(0===u.length){let t=r.first()||e.key||e.sep?.[0]||e.value;if(!t)break;throw i.throwUnexpectedTokenError(t)}let s=u.shift();re(s)||(e.key||e.sep)&&nW.isMap(s)?c.entries.push(function(e,t,n){let r,s=null;for(;r=e.consume();){if("comma"===r.type){i.addToken("Punctuator",rm(r));continue}if("explicit-key-ind"===r.type){if(s)throw i.throwUnexpectedTokenError(r);s=i.addToken("Punctuator",rm(r));continue}e.back();break}let l=t.key??t.sep[0],a={type:"YAMLMapping",style:"block",pairs:[],parent:c,...i.getConvertLocation(s?.range[0]??l.offset,s?.range[1]??l.offset)},u=rl(s,e,t,ru(n)[0],i,a,o);return a.pairs.push(u),ry(a,s||u),rb(a,u||s),a}(r,e,s)):c.entries.push(function(e,t,n,r,i,s,o){if(t)return ri(e,t,n,r,i,s);if(!rc(n))throw r.throwError(`unknown error: AST is not Scalar and null (${rn(n)}). Unable to process empty seq item CST.`,e.first()??o);return ra(e,n,r,i,null,s,null)}(r,e.value||null,s||null,i,c,o,(c.entries[c.entries.length-1]||l||t).range[1]))}for(let e of n.end)if(!rf(e,i)){if("flow-seq-end"===e.type){a=i.addToken("Punctuator",rm(e));continue}throw i.throwUnexpectedTokenError(e)}return rb(c,a||c.entries[c.entries.length-1]||l),ra(e,r,i,s,c,o,c)}(e,o,t,n,r,i,s)}throw r.throwUnexpectedTokenError(t.start)}function rl(e,t,n,r,i,s,o){let l,a,c=e?.range[0]??t.first()?.offset??n.key?.offset??n.sep?.[0]?.offset??n.value?.offset??-1,u={type:"YAMLPair",key:null,value:null,parent:s,...i.getConvertLocation(c,c)};u.key=function(e,t,n,r,i,s,o){if(t)return ri(e,t,n,r,i,s);if(!rc(n))throw r.throwError(`unknown error: AST is not Scalar and null (${rn(n)}). Unable to process empty map key CST.`,e.first()??o);return ra(e,n,r,i,null,s,null)}(t,n.key||null,r.key,i,u,o,c);let f=new rt(n.sep||[],i);for(;a=f.consume();){if("map-value-ind"===a.type){if(l)throw i.throwUnexpectedTokenError(a);l=i.addToken("Punctuator",rm(a));continue}f.back();break}return u.value=function(e,t,n,r,i,s,o){if(t)return ri(e,t,n,r,i,s);if(!rc(n))throw r.throwError(`unknown error: AST is not Scalar and null (${rn(n)}). Unable to process empty map value CST.`,e.first()??o);return ra(e,n,r,i,null,s,null)}(f,n.value||null,r.value,i,u,o,c),rb(u,u.value||l||u.key||e),u}function ra(e,t,n,r,i,s,o){let l=null;function a(e){var t;return l||(l={type:"YAMLWithMeta",anchor:null,tag:null,value:i,parent:r,...o?{range:[...o.range],loc:{start:rh((t=o.loc).start),end:rh(t.end)}}:n.getConvertLocation(...rm(e))},i&&(i.parent=l)),l}return e.each(e=>{var r,i,o,l,c,u,f,p;if("anchor"===e.type){let t,c,u,f,p,d=a(e),h=(r=e,i=n,o=d,l=s,t=r.source.slice(1),u={type:"YAMLAnchor",name:t,parent:o,...c=i.getConvertLocation(...rm(r))},(l.anchors[t]||(l.anchors[t]=[])).push(u),f=[c.range[0],c.range[0]+1],i.addToken("Punctuator",f),(p=[f[1],c.range[1]])[0]<p[1]&&i.addToken("Identifier",p),u);d.anchor=h,ry(d,h),rb(d,h)}else if("tag"===e.type){let r,i,s,o,l,d,h=a(e),g=(c=e,u=t?.tag??null,f=n,p=h,r=c.source.startsWith("!!")?2:1,"!"===(i=u??c.source.slice(r))&&(i="tag:yaml.org,2002:str"),s=f.getConvertLocation(...rm(c)),o={type:"YAMLTag",tag:i,raw:c.source,parent:p,...s},l=[s.range[0],s.range[0]+r],f.addToken("Punctuator",l),(d=[l[1],s.range[1]])[0]<d[1]&&f.addToken("Identifier",d),o);h.tag=g,ry(h,g),rb(h,g)}else throw n.throwUnexpectedTokenError(e)}),l||i}function rc(e){return nW.isScalar(e)||null==e}function ru(e){return nW.isMap(e)?[...e.items]:[e]}function rf(e,t){if("space"===e.type||"newline"===e.type)return!0;if("flow-error-end"===e.type||"error"===e.type)throw t.throwUnexpectedTokenError(e);if("comment"===e.type){let n={type:"Block",value:e.source.slice(1),...t.getConvertLocation(...rm(e))};return t.addComment(n),!0}return!1}function rp(e,t){if(!rf(e,t))throw t.throwUnexpectedTokenError(e)}function rd(e){return e.sort((e,t)=>e.range[0]>t.range[0]?1:e.range[0]<t.range[0]?-1:e.range[1]>t.range[1]?1:e.range[1]<t.range[1]?-1:0)}function rh(e){return{line:e.line,column:e.column}}function rg(e,t){let n=e.length;for(let r=t;r<n;r++)if(e[r].trim())return r;return n}function rm(e){return[e.offset,e.offset+e.source.length]}function ry(e,t){t&&t.range[0]<e.range[0]&&(e.range[0]=t.range[0],e.loc.start=rh(t.loc.start))}function rb(e,t){t&&e.range[1]<t.range[1]&&(e.range[1]=t.range[1],e.loc.end=rh(t.loc.end))}var rk=class{constructor(e,t){this.tokens=[],this.comments=[],this.locsMap=new Map,this.options=function(e){if(!e)return{};let t={},n=e.defaultYAMLVersion;if("string"==typeof n||"number"==typeof n){let e=String(n);"1.2"===e||"1.1"===e?t.version=e:t.version="next"}return t}(t),this.code=e,this.lineCounter=new nW.LineCounter}getLocFromIndex(e){let t=this.locsMap.get(e);if(!t){let{line:n,col:r}=this.lineCounter.linePos(e);t={line:n,column:r-1},this.locsMap.set(e,t)}return{line:t.line,column:t.column}}getConvertLocation(e,t){return{range:[e,t],loc:{start:this.getLocFromIndex(e),end:this.getLocFromIndex(t)}}}addComment(e){this.comments.push(e)}addToken(e,t){let n={type:e,value:this.code.slice(...t),...this.getConvertLocation(...t)};return this.tokens.push(n),n}throwUnexpectedTokenError(e){let t="source"in e?`'${e.source}'`:e.type;throw this.throwError(`Unexpected token: ${t}`,e)}throwError(e,t){let n="number"==typeof t?t:"offset"in t?t.offset:t.range[0],r=this.getLocFromIndex(n);throw new rL(e,n,r.line,r.column)}lastSkipSpaces(e,t){let n=this.code;for(let r=t-1;r>=e;r--)if(n[r].trim())return r+1;return e}};function rv(e,t){let n=new rk(e,t);return function(e,t){let{cstNodes:n}=e,r={type:"Program",body:[],comments:t.comments,sourceType:"module",tokens:t.tokens,parent:null,...t.getConvertLocation(0,t.code.length)},i=[],s=null,o=[];for(let r of n)if(!rf(r,t)){if("doc-end"===r.type){if(!s)throw t.throwUnexpectedTokenError(r);s.docEnd=r,o.push(s),s=null,r.end?.forEach(e=>rp(e,t));continue}if(s&&(o.push(s),s=null),"directive"===r.type){i.push(r);continue}if("document"===r.type){s={doc:r,node:e.nodes[o.length],directives:i},i=[];continue}throw t.throwUnexpectedTokenError(r)}if(s&&(o.push(s),s=null),i.length>0&&o.push({doc:null,node:null,directives:i}),o.length>0){let n=0;r.body=o.map(i=>{let s=function(e,{directives:t,doc:n,node:r,docEnd:i},s,o,l){let a;if(!n||!r){let n=rg(s.code,l),r=s.getConvertLocation(n,n),a={type:"YAMLDocument",directives:[],content:null,parent:o,anchors:{},version:e.streamInfo.directives.yaml.version,...r};a.directives.push(...rr(null,t,s,a));let c=a.directives[a.directives.length-1];return i&&(c=s.addToken("Marker",rm(i))),rb(a,c),a}let c=s.getConvertLocation(rg(s.code,l),r.range[1]),u={type:"YAMLDocument",directives:[],content:null,parent:o,anchors:{},version:r.directives.yaml.version,...c};u.directives.push(...rr(r.directives,t,s,u));let f=u.directives[u.directives.length-1],p=new rt(n.start,s);for(;a=p.consume();){if("doc-start"===a.type){f=s.addToken("Marker",rm(a));continue}p.back();break}return u.content=function(e,t,n,r,i){if(t)return ri(e,t,n,r,i,i);let s=e.first();if(s){if(nW.isScalar(n)&&""===n.source)return ra(e,n,r,i,null,i,r.getConvertLocation(n.range[0],n.range[1]));throw r.throwUnexpectedTokenError(s)}return null}(p,n.value||null,r.contents,s,u),f=u.content||f,n.end&&n.end.forEach(e=>rp(e,s)),i&&(f=s.addToken("Marker",rm(i))),rb(u,f),u}(e,i,t,r,n);return n=s.range[1],s})}else{let n=rg(t.code,0);r.body.push({type:"YAMLDocument",directives:[],content:null,parent:r,anchors:{},version:e.streamInfo.directives.yaml.version,...t.getConvertLocation(n,n)})}rd(t.comments),rd(t.tokens);let l=r.body[r.body.length-1];return l&&rb(l,t.comments[t.comments.length-1]),r}(function(e){let{lineCounter:t}=e,n=new nW.Parser(t.addNewLine),r=new nW.Composer({...e.options,keepSourceTokens:!0,lineCounter:t}),i=[...n.parse(e.code)],s=[];for(let t of r.compose(i)){for(let n of t.errors)throw e.throwError(n.message,n.pos[0]);s.push(t)}return{nodes:s,cstNodes:i,streamInfo:r.streamInfo()}}(n),n)}let rS=function(e){let t=Object.assign({},nJ);for(let n of Object.keys(e))if(Object.hasOwn(t,n)){let r=new Set(e[n]);for(let e of t[n])r.add(e);t[n]=Object.freeze(Array.from(r))}else t[n]=Object.freeze(Array.from(e[n]));return Object.freeze(t)}({Program:["body"],YAMLDocument:["directives","content"],YAMLDirective:[],YAMLMapping:["pairs"],YAMLPair:["key","value"],YAMLSequence:["entries"],YAMLWithMeta:["anchor","tag","value"],YAMLScalar:[],YAMLAlias:[],YAMLAnchor:[],YAMLTag:[]});function rw(e){let t=null;return"comments"!==e&&"leadingComments"!==e&&"loc"!==e&&"parent"!==e&&"range"!==e&&"tokens"!==e&&"trailingComments"!==e&&null!==(t=this[e])&&"object"==typeof t&&("string"==typeof t.type||Array.isArray(t))}function*rx(e,t){let n=e[t];if(Array.isArray(n))for(let e of n)rA(e)&&(yield e);else rA(n)&&(yield n)}function rA(e){return null!==e&&"object"==typeof e&&"string"==typeof e.type}function rT(e,t){!function e(t,n,r){for(let i of(r.enterNode(t,n),((r.visitorKeys||rS)[t.type]||Object.keys(t).filter(rw,t)).filter(e=>!rx(t,e).next().done)))for(let n of rx(t,i))e(n,t,r);r.leaveNode(t,n)}(e,null,t)}var rL=class extends SyntaxError{constructor(e,t,n,r){super(e),this.index=t,this.lineNumber=n,this.column=r}},rE=((e,t)=>{let n={};for(var r in e)ez(n,r,{get:e[r],enumerable:!0});return n})({name:()=>rC,version:()=>rM});let rC="yaml-eslint-parser",rM="2.0.0";function rN(e,t){return{ast:rv(e,t),visitorKeys:rS,services:{isYAML:!0}}}var rI=Object.freeze({__proto__:null,ParseError:rL,VisitorKeys:rS,getStaticYAMLValue:nz,meta:rE,name:rC,parseForESLint:rN,parseYAML:rv,traverseNodes:rT}),rO={exports:{}},rP=eG(function(){if(eb)return rO.exports;eb=1;var e=function(e,t){var n,r,i=1,s=0,o=0,l=String.alphabet;function a(e,t,r){if(r){for(n=t;(r=a(e,n))<76&&r>65;)++n;return+e.slice(t-1,n)}return(r=l&&l.indexOf(e.charAt(t)))>-1?r+76:(r=e.charCodeAt(t)||0)<45||r>127?r:r<46?65:r<48?r-1:r<58?r+18:r<65?r-11:r<91?r+11:r<97?r-37:r<123?r+5:r-63}if((e+="")!=(t+="")){for(;i;)if(r=a(e,s++),i=a(t,o++),r<76&&i<76&&r>66&&i>66&&(r=a(e,s,s),i=a(t,o,s=n),o=n),r!=i)return r<i?-1:1}return 0};try{rO.exports=e}catch(t){String.naturalCompare=e}return rO.exports}()),rB={},r$=eG(function(){if(ek)return rB;ek=1,Object.defineProperty(rB,"__esModule",{value:!0}),rB.default=function(e,r,i,s){a("aLength",e),a("bLength",r),c("isCommon",i),c("foundSubsequence",s);let o=t(0,e,0,r,i);if(0!==o&&s(o,0,0),e!==o||r!==o){let t=n(o,e-1,o,r-1,i),a=e-t,c=r-t,u=o+t;e!==u&&r!==u&&l(0,o,a,o,c,!1,[{foundSubsequence:s,isCommon:i}],[0],[0],{aCommonFollowing:0,aCommonPreceding:0,aEndPreceding:0,aStartFollowing:0,bCommonFollowing:0,bCommonPreceding:0,bEndPreceding:0,bStartFollowing:0,nChangeFollowing:0,nChangePreceding:0,nCommonFollowing:0,nCommonPreceding:0}),0!==t&&s(t,a,c)}};let e="diff-sequences",t=(e,t,n,r,i)=>{let s=0;for(;e<t&&n<r&&i(e,n);)e+=1,n+=1,s+=1;return s},n=(e,t,n,r,i)=>{let s=0;for(;e<=t&&n<=r&&i(t,r);)t-=1,r-=1,s+=1;return s},r=(e,n,r,i,s,o,l)=>{let a=0,c=-e,u=o[0],f=u;o[a]+=t(u+1,n,i+u-c+1,r,s);let p=e<l?e:l;for(a+=1,c+=2;a<=p;a+=1,c+=2){if(a!==e&&f<o[a])u=o[a];else if(n<=(u=f+1))return a-1;f=o[a],o[a]=u+t(u+1,n,i+u-c+1,r,s)}return l},i=(e,t,r,i,s,o,l)=>{let a=0,c=e,u=o[0],f=u;o[a]-=n(t,u-1,r,i+u-c-1,s);let p=e<l?e:l;for(a+=1,c-=2;a<=p;a+=1,c-=2){if(a!==e&&o[a]<f)u=o[a];else if((u=f-1)<t)return a-1;f=o[a],o[a]=u-n(t,u-1,r,i+u-c-1,s)}return l},s=(e,r,i,s,o,l,a,c,u,f,p)=>{let d=s-r,h=o-s-(i-r),g=-h-(e-1),m=-h+(e-1),y=0,b=e<c?e:c;for(let c=0,k=-e;c<=b;c+=1,k+=2){let b=0===c||c!==e&&y<a[c],v=b?a[c]:y,S=b?v:v+1,w=d+S-k,x=t(S+1,i,w+1,o,l),A=S+x;if(y=a[c],a[c]=A,g<=k&&k<=m){let t=(e-1-(k+h))/2;if(t<=f&&u[t]-1<=A){let t=d+v-(b?k+1:k-1),a=n(r,v,s,t,l),c=v-a+1,u=t-a+1;p.nChangePreceding=e-1,e-1==c+u-r-s?(p.aEndPreceding=r,p.bEndPreceding=s):(p.aEndPreceding=c,p.bEndPreceding=u),p.nCommonPreceding=a,0!==a&&(p.aCommonPreceding=c,p.bCommonPreceding=u),p.nCommonFollowing=x,0!==x&&(p.aCommonFollowing=S+1,p.bCommonFollowing=w+1);let f=A+1,h=w+x+1;return p.nChangeFollowing=e-1,e-1==i+o-f-h?(p.aStartFollowing=i,p.bStartFollowing=o):(p.aStartFollowing=f,p.bStartFollowing=h),!0}}}return!1},o=(e,r,i,s,o,l,a,c,u,f,p)=>{let d=o-i,h=o-s-(i-r),g=h-e,m=h+e,y=0,b=e<f?e:f;for(let f=0,k=e;f<=b;f+=1,k-=2){let b=0===f||f!==e&&u[f]<y,v=b?u[f]:y,S=b?v:v-1,w=d+S-k,x=n(r,S-1,s,w-1,l),A=S-x;if(y=u[f],u[f]=A,g<=k&&k<=m){let n=(e+(k-h))/2;if(n<=c&&A-1<=a[n]){let n=w-x;if(p.nChangePreceding=e,e===A+n-r-s?(p.aEndPreceding=r,p.bEndPreceding=s):(p.aEndPreceding=A,p.bEndPreceding=n),p.nCommonPreceding=x,0!==x&&(p.aCommonPreceding=A,p.bCommonPreceding=n),p.nChangeFollowing=e-1,1===e)p.nCommonFollowing=0,p.aStartFollowing=i,p.bStartFollowing=o;else{let n=d+v-(b?k-1:k+1),r=t(v,i,n,o,l);p.nCommonFollowing=r,0!==r&&(p.aCommonFollowing=v,p.bCommonFollowing=n);let s=v+r,a=n+r;e-1==i+o-s-a?(p.aStartFollowing=i,p.bStartFollowing=o):(p.aStartFollowing=s,p.bStartFollowing=a)}return!0}}}return!1},l=(t,n,a,c,u,f,p,d,h,g)=>{if(u-c<a-n){if((f=!f)&&1===p.length){let{foundSubsequence:e,isCommon:t}=p[0];p[1]={foundSubsequence:(t,n,r)=>{e(t,r,n)},isCommon:(e,n)=>t(n,e)}}let e=n,t=a;n=c,a=u,c=e,u=t}let{foundSubsequence:m,isCommon:y}=p[+!!f];((t,n,l,a,c,u,f,p,d)=>{let h=a-n,g=c-l,m=l-n,y=c-a,b=y-m,k=m,v=m;if(f[0]=n-1,p[0]=l,b%2==0){let e=(t||b)/2,s=(m+y)/2;for(let t=1;t<=s;t+=1)if(k=r(t,l,c,h,u,f,k),t<e)v=i(t,n,a,g,u,p,v);else if(o(t,n,l,a,c,u,f,k,p,v,d))return}else{let e=((t||b)+1)/2,o=(m+y+1)/2,S=1;for(k=r(1,l,c,h,u,f,k),S+=1;S<=o;S+=1)if(v=i(S-1,n,a,g,u,p,v),S<e)k=r(S,l,c,h,u,f,k);else if(s(S,n,l,a,c,u,f,k,p,v,d))return}throw Error(`${e}: no overlap aStart=${n} aEnd=${l} bStart=${a} bEnd=${c}`)})(t,n,a,c,u,y,d,h,g);let{nChangePreceding:b,aEndPreceding:k,bEndPreceding:v,nCommonPreceding:S,aCommonPreceding:w,bCommonPreceding:x,nCommonFollowing:A,aCommonFollowing:T,bCommonFollowing:L,nChangeFollowing:E,aStartFollowing:C,bStartFollowing:M}=g;n<k&&c<v&&l(b,n,k,c,v,f,p,d,h,g),0!==S&&m(S,w,x),0!==A&&m(A,T,L),C<a&&M<u&&l(E,C,a,M,u,f,p,d,h,g)},a=(t,n)=>{if("number"!=typeof n)throw TypeError(`${e}: ${t} typeof ${typeof n} is not a number`);if(!Number.isSafeInteger(n))throw RangeError(`${e}: ${t} value ${n} is not a safe integer`);if(n<0)throw RangeError(`${e}: ${t} value ${n} is a negative integer`)},c=(t,n)=>{let r=typeof n;if("function"!==r)throw TypeError(`${e}: ${t} typeof ${r} is not a function`)};return rB}()),rq={},rY={exports:{}},rj={exports:{}};function rF(){if(eI)return eN;eI=1;var e,t,n,r,i,s,o,l,a={}.toString;function c(e,t){var n,r=function(t){return e.length>1?function(){var i=t?t.concat():[];return n=this,i.push.apply(i,arguments)<e.length&&arguments.length?r.call(n,i):e.apply(n,i)}:e};return r()}return e=function(){if(eS)return ev;eS=1;var e,t,n={}.toString;function r(e,t){var n,r=function(t){return e.length>1?function(){var i=t?t.concat():[];return n=this,i.push.apply(i,arguments)<e.length&&arguments.length?r.call(n,i):e.apply(n,i)}:e};return r()}return e=r(function(e,t){return e.apply(null,t)}),t=r(function(e,t,n){return e(n,t)}),ev={curry:function(e){return r(e)},flip:t,fix:function(e){var t;return t=function(t){return function(){return e(t(t)).apply(null,arguments)}},function(){return e(t(t)).apply(null,arguments)}},apply:e,over:r(function(e,t,n,r){return e(t(n),t(r))}),memoize:function(e){var t;return t={},function(){var r,i,s,o,l;for(i=0,r=[],s=arguments.length;i<s;++i)r.push(arguments[i]);return t[o=(function(){var e,t,i=[];for(e=0,t=r.length;e<t;++e)i.push((l=r[e])+n.call(l).slice(8,-1));return i})().join("")]=o in t?t[o]:e.apply(null,r)}}}}(),t=function(){if(ex)return ew;ex=1;var e,t,n,r,i,s,o,l,a,c,u,f,p,d,h,g,m,y,b,k,v,S,w,x,A,T,L,E,C,M,N,I,O,P,B,$,q,Y,j,F,D,_,R,K,U,V,W,J,z,G,Q={}.toString;function X(e,t){var n,r=function(t){return e.length>1?function(){var i=t?t.concat():[];return n=this,i.push.apply(i,arguments)<e.length&&arguments.length?r.call(n,i):e.apply(n,i)}:e};return r()}function H(e,t){for(var n=-1,r=t.length>>>0;++n<r;)if(e===t[n])return!0;return!1}function Z(e){return!e}return e=X(function(e,t){var n,r;for(n=0,r=t.length;n<r;++n)e(t[n]);return t}),t=X(function(e,t){var n,r,i=[];for(n=0,r=t.length;n<r;++n)i.push(e(t[n]));return i}),n=X(function(e,t){var n,r,i,s=[];for(n=0,r=t.length;n<r;++n)e(i=t[n])&&s.push(i);return s}),r=X(function(e,t){var n,r,i,s=[];for(n=0,r=t.length;n<r;++n)e(i=t[n])||s.push(i);return s}),i=X(function(e,t){var n,r;return n=W(e,t),r=t.slice(),null!=n&&r.splice(n,1),r}),s=X(function(e,t){var n,r,i,s,o;for(i=0,n=[],r=[],s=t.length;i<s;++i)(e(o=t[i])?n:r).push(o);return[n,r]}),o=X(function(e,t){var n,r,i;for(n=0,r=t.length;n<r;++n)if(e(i=t[n]))return i}),l=a=function(e){return e[0]},c=X(function(e,t){var n,r,i,s,o,l=[];for(r=0,n=[],i=t.length;r<i;++r)H(o=e(s=t[r]),n)||(n.push(o),l.push(s));return l}),u=f=X(function(e,t,n){var r,i;for(r=0,i=n.length;r<i;++r)t=e(t,n[r]);return t}),p=d=X(function(e,t){return u(e,t[0],t.slice(1))}),h=X(function(e,t,n){var r;for(r=n.length-1;r>=0;--r)t=e(n[r],t);return t}),g=X(function(e,t){return h(e,t[t.length-1],t.slice(0,-1))}),m=X(function(e,t){var n,r,i;for(n=[],r=t;null!=(i=e(r));)n.push(i[0]),r=i[1];return n}),y=X(function(e,t){return[].concat.apply([],function(){var n,r,i=[];for(n=0,r=t.length;n<r;++n)i.push(e(t[n]));return i}())}),b=function(e){var t;return[].concat.apply([],function(){var n,r,i=[];for(n=0,r=e.length;n<r;++n)t=e[n],"Array"===Q.call(t).slice(8,-1)?i.push(b(t)):i.push(t);return i}())},k=X(function(e,t){var n,r,i,s;for(r=0,n={},i=t.length;r<i;++r)(s=e(t[r]))in n?n[s]+=1:n[s]=1;return n}),v=X(function(e,t){var n,r,i,s,o;for(r=0,n={},i=t.length;r<i;++r)(o=e(s=t[r]))in n?n[o].push(s):n[o]=[s];return n}),S=X(function(e,t){var n,r;for(n=0,r=t.length;n<r;++n)if(e(t[n]))return!0;return!1}),w=X(function(e,t){var n,r;for(n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}),x=X(function(e,t){return t.concat().sort(e)}),A=X(function(e,t){return t.concat().sort(function(t,n){return e(t)>e(n)?1:e(t)<e(n)?-1:0})}),T=L=function(e){var t,n,r;for(n=0,t=0,r=e.length;n<r;++n)t+=e[n];return t/e.length},E=X(function(e,t){var n,r,i,s,o;for(r=0,n=t[0],s=(i=t.slice(1)).length;r<s;++r)e(o=i[r])>e(n)&&(n=o);return n}),C=X(function(e,t){var n,r,i,s,o;for(r=0,n=t[0],s=(i=t.slice(1)).length;r<s;++r)e(o=i[r])<e(n)&&(n=o);return n}),M=N=X(function(e,t,n){var r,i;return r=t,[t].concat(function(){var t,s,o=[];for(t=0,s=n.length;t<s;++t)i=n[t],o.push(r=e(r,i));return o}())}),I=O=X(function(e,t){if(t.length)return M(e,t[0],t.slice(1))}),P=X(function(e,t,n){return M(e,t,n=n.concat().reverse()).reverse()}),B=X(function(e,t){if(t.length)return M(e,(t=t.concat().reverse())[0],t.slice(1)).reverse()}),$=X(function(e,t,n){return n.slice(e,t)}),q=X(function(e,t){return e<=0?t.slice(0,0):t.slice(0,e)}),Y=X(function(e,t){return e<=0?t:t.slice(e)}),j=X(function(e,t){return[q(e,t),Y(e,t)]}),F=X(function(e,t){var n,r;if(!(n=t.length))return t;for(r=0;r<n&&e(t[r]);)r+=1;return t.slice(0,r)}),D=X(function(e,t){var n,r;if(!(n=t.length))return t;for(r=0;r<n&&e(t[r]);)r+=1;return t.slice(r)}),_=X(function(e,t){return[F(e,t),D(e,t)]}),R=X(function(e,t){return _(function(){var e=arguments;return function(){var t,n;for(t=1,n=e[0].apply(this,arguments);t<e.length;++t)n=e[t](n);return n}}(e,Z),t)}),K=X(function(e,t){var n,r,i,s,o,l;for(i=0,n=[],r=t.length,s=e.length;i<s&&(o=i,l=e[i],o!==r);++i)n.push([l,t[o]]);return n}),U=X(function(e,t,n){var r,i,s,o,l,a;for(s=0,r=[],i=n.length,o=t.length;s<o&&(l=s,a=t[s],l!==i);++s)r.push(e(a,n[l]));return r}),V=X(function(e,t){return e<0?t[t.length+e]:t[e]}),W=X(function(e,t){var n,r,i;for(n=0,r=t.length;n<r;++n)if(i=n,t[n]===e)return i}),J=X(function(e,t){var n,r,i,s=[];for(n=0,r=t.length;n<r;++n)i=n,t[n]===e&&s.push(i);return s}),z=X(function(e,t){var n,r,i;for(n=0,r=t.length;n<r;++n)if(i=n,e(t[n]))return i}),G=X(function(e,t){var n,r,i,s=[];for(n=0,r=t.length;n<r;++n)i=n,e(t[n])&&s.push(i);return s}),ew={each:e,map:t,filter:n,compact:function(e){var t,n,r,i=[];for(t=0,n=e.length;t<n;++t)(r=e[t])&&i.push(r);return i},reject:r,remove:i,partition:s,find:o,head:l,first:a,tail:function(e){if(e.length)return e.slice(1)},last:function(e){return e[e.length-1]},initial:function(e){if(e.length)return e.slice(0,-1)},empty:function(e){return!e.length},reverse:function(e){return e.concat().reverse()},difference:function(e){var t,n,r,i,s,o,l,a;for(n=1,t=[],r=arguments.length;n<r;++n)t.push(arguments[n]);i=[];t:for(n=0,s=e.length;n<s;++n){for(l=0,o=e[n],a=t.length;l<a;++l)if(H(o,t[l]))continue t;i.push(o)}return i},intersection:function(e){var t,n,r,i,s,o,l,a;for(n=1,t=[],r=arguments.length;n<r;++n)t.push(arguments[n]);i=[];t:for(n=0,s=e.length;n<s;++n){for(l=0,o=e[n],a=t.length;l<a;++l)if(!H(o,t[l]))continue t;i.push(o)}return i},union:function(){var e,t,n,r,i,s,o,l,a;for(t=0,e=[],n=arguments.length;t<n;++t)e.push(arguments[t]);for(t=0,r=[],i=e.length;t<i;++t)for(o=0,l=(s=e[t]).length;o<l;++o)H(a=s[o],r)||r.push(a);return r},countBy:k,groupBy:v,fold:u,fold1:p,foldl:f,foldl1:d,foldr:h,foldr1:g,unfoldr:m,andList:function(e){var t,n;for(t=0,n=e.length;t<n;++t)if(!e[t])return!1;return!0},orList:function(e){var t,n;for(t=0,n=e.length;t<n;++t)if(e[t])return!0;return!1},any:S,all:w,unique:function(e){var t,n,r,i;for(n=0,t=[],r=e.length;n<r;++n)H(i=e[n],t)||t.push(i);return t},uniqueBy:c,sort:function(e){return e.concat().sort(function(e,t){return e>t?1:e<t?-1:0})},sortWith:x,sortBy:A,sum:function(e){var t,n,r;for(n=0,t=0,r=e.length;n<r;++n)t+=e[n];return t},product:function(e){var t,n,r;for(n=0,t=1,r=e.length;n<r;++n)t*=e[n];return t},mean:T,average:L,concat:function(e){return[].concat.apply([],e)},concatMap:y,flatten:b,maximum:function(e){var t,n,r,i,s;for(n=0,t=e[0],i=(r=e.slice(1)).length;n<i;++n)(s=r[n])>t&&(t=s);return t},minimum:function(e){var t,n,r,i,s;for(n=0,t=e[0],i=(r=e.slice(1)).length;n<i;++n)(s=r[n])<t&&(t=s);return t},maximumBy:E,minimumBy:C,scan:M,scan1:I,scanl:N,scanl1:O,scanr:P,scanr1:B,slice:$,take:q,drop:Y,splitAt:j,takeWhile:F,dropWhile:D,span:_,breakList:R,zip:K,zipWith:U,zipAll:function(){var e,t,n,r,i,s,o,l,a,c,u=[];for(t=0,e=[],n=arguments.length;t<n;++t)e.push(arguments[t]);for(t=0,r=void 0,i=e.length;t<i;++t)r<=(o=(s=e[t]).length)||(r=o);for(t=0;t<r;++t){for(c=0,l=t,a=[],i=e.length;c<i;++c)s=e[c],a.push(s[l]);u.push(a)}return u},zipAllWith:function(e){var t,n,r,i,s,o,l,a,c=[];for(n=1,t=[],r=arguments.length;n<r;++n)t.push(arguments[n]);for(n=0,i=void 0,s=t.length;n<s;++n)i<=(l=(o=t[n]).length)||(i=l);for(n=0;n<i;++n)a=n,c.push(e.apply(null,function(){var e,n,r=[];for(e=0,n=t.length;e<n;++e)r.push((o=t[e])[a]);return r}()));return c},at:V,elemIndex:W,elemIndices:J,findIndex:z,findIndices:G}}(),n=function(){var e,t,n,r,i;if(eT)return eA;function s(e,t){var n,r=function(t){return e.length>1?function(){var i=t?t.concat():[];return n=this,i.push.apply(i,arguments)<e.length&&arguments.length?r.call(n,i):e.apply(n,i)}:e};return r()}return eT=1,e=s(function(e,t){var n,r,i,s={};for(n=0,r=e.length;n<r;++n)i=n,s[e[n]]=t[i];return s}),t=s(function(e,t){var n;for(n in t)e(t[n]);return t}),n=s(function(e,t){var n,r,i={};for(n in t)r=t[n],i[n]=e(r);return i}),r=s(function(e,t){var n,r,i={};for(n in t)e(r=t[n])&&(i[n]=r);return i}),i=s(function(e,t){var n,r,i={};for(n in t)e(r=t[n])||(i[n]=r);return i}),eA={values:function(e){var t,n,r=[];for(t in e)n=e[t],r.push(n);return r},keys:function(e){var t,n=[];for(t in e)n.push(t);return n},pairsToObj:function(e){var t,n,r,i={};for(t=0,n=e.length;t<n;++t)i[(r=e[t])[0]]=r[1];return i},objToPairs:function(e){var t,n,r=[];for(t in e)n=e[t],r.push([t,n]);return r},listsToObj:e,objToLists:function(e){var t,n,r,i;for(r in t=[],n=[],e)i=e[r],t.push(r),n.push(i);return[t,n]},empty:function(e){var t;for(t in e)return!1;return!0},each:t,map:n,filter:r,compact:function(e){var t,n,r={};for(t in e)(n=e[t])&&(r[t]=n);return r},reject:i,partition:s(function(e,t){var n,r,i,s;for(i in n={},r={},t)(e(s=t[i])?n:r)[i]=s;return[n,r]}),find:s(function(e,t){var n,r;for(n in t)if(e(r=t[n]))return r})}}(),r=function(){var e;if(eE)return eL;function t(e,t){var n,r=function(t){return e.length>1?function(){var i=t?t.concat():[];return n=this,i.push.apply(i,arguments)<e.length&&arguments.length?r.call(n,i):e.apply(n,i)}:e};return r()}return eE=1,e=t(function(e,t){return t.split(e)}),eL={split:e,join:t(function(e,t){return t.join(e)}),lines:function(e){return e.length?e.split("\n"):[]},unlines:function(e){return e.join("\n")},words:function(e){return e.length?e.split(/[ ]+/):[]},unwords:function(e){return e.join(" ")},chars:function(e){return e.split("")},unchars:function(e){return e.join("")},reverse:function(e){return e.split("").reverse().join("")},repeat:t(function(e,t){var n,r;for(r=0,n="";r<e;++r)n+=t;return n}),capitalize:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},camelize:function(e){return e.replace(/[-_]+(.)?/g,function(e,t){return(null!=t?t:"").toUpperCase()})},dasherize:function(e){return e.replace(/([^-A-Z])([A-Z]+)/g,function(e,t,n){return t+"-"+(n.length>1?n:n.toLowerCase())}).replace(/^([A-Z]+)/,function(e,t){return t.length>1?t+"-":t.toLowerCase()})}}}(),i=function(){var e,t,n,r,i,s,o,l,a,c,u,f,p,d,h,g,m,y,b,k,v,S,w,x;if(eM)return eC;function A(e,t){var n,r=function(t){return e.length>1?function(){var i=t?t.concat():[];return n=this,i.push.apply(i,arguments)<e.length&&arguments.length?r.call(n,i):e.apply(n,i)}:e};return r()}return eM=1,e=A(function(e,t){return e>t?e:t}),t=A(function(e,t){return e<t?e:t}),n=Math.abs,r=A(function(e,t){return~~(e/t)}),i=A(function(e,t){return e%t}),s=A(function(e,t){return Math.floor(e/t)}),o=A(function(e,t){return(e%t+t)%t}),l=Math.PI,a=Math.exp,c=Math.sqrt,u=Math.log,f=A(function(e,t){return Math.pow(e,t)}),p=Math.sin,d=Math.tan,h=Math.cos,g=Math.asin,m=Math.acos,y=Math.atan,b=A(function(e,t){return Math.atan2(e,t)}),k=Math.round,v=Math.ceil,S=Math.floor,w=A(function(e,t){var n;for(e=Math.abs(e),t=Math.abs(t);0!==t;)n=e%t,e=t,t=n;return e}),x=A(function(e,t){return Math.abs(Math.floor(e/w(e,t)*t))}),eC={max:e,min:t,negate:function(e){return-e},abs:n,signum:function(e){return e<0?-1:+(e>0)},quot:r,rem:i,div:s,mod:o,recip:function(e){return 1/e},pi:l,tau:2*l,exp:a,sqrt:c,ln:u,pow:f,sin:p,tan:d,cos:h,acos:m,asin:g,atan:y,atan2:b,truncate:function(e){return~~e},round:k,ceiling:v,floor:S,isItNaN:function(e){return e!=e},even:function(e){return e%2==0},odd:function(e){return e%2!=0},gcd:w,lcm:x}}(),s=c(function(e,t){return a.call(t).slice(8,-1)===e}),o=c(function(e,t){var n,r=[];for(n=0;n<e;++n)r.push(t);return r}),r.empty=t.empty,r.slice=t.slice,r.take=t.take,r.drop=t.drop,r.splitAt=t.splitAt,r.takeWhile=t.takeWhile,r.dropWhile=t.dropWhile,r.span=t.span,r.breakStr=t.breakList,(l={Func:e,List:t,Obj:n,Str:r,Num:i,id:function(e){return e},isType:s,replicate:o}).each=t.each,l.map=t.map,l.filter=t.filter,l.compact=t.compact,l.reject=t.reject,l.partition=t.partition,l.find=t.find,l.head=t.head,l.first=t.first,l.tail=t.tail,l.last=t.last,l.initial=t.initial,l.empty=t.empty,l.reverse=t.reverse,l.difference=t.difference,l.intersection=t.intersection,l.union=t.union,l.countBy=t.countBy,l.groupBy=t.groupBy,l.fold=t.fold,l.foldl=t.foldl,l.fold1=t.fold1,l.foldl1=t.foldl1,l.foldr=t.foldr,l.foldr1=t.foldr1,l.unfoldr=t.unfoldr,l.andList=t.andList,l.orList=t.orList,l.any=t.any,l.all=t.all,l.unique=t.unique,l.uniqueBy=t.uniqueBy,l.sort=t.sort,l.sortWith=t.sortWith,l.sortBy=t.sortBy,l.sum=t.sum,l.product=t.product,l.mean=t.mean,l.average=t.average,l.concat=t.concat,l.concatMap=t.concatMap,l.flatten=t.flatten,l.maximum=t.maximum,l.minimum=t.minimum,l.maximumBy=t.maximumBy,l.minimumBy=t.minimumBy,l.scan=t.scan,l.scanl=t.scanl,l.scan1=t.scan1,l.scanl1=t.scanl1,l.scanr=t.scanr,l.scanr1=t.scanr1,l.slice=t.slice,l.take=t.take,l.drop=t.drop,l.splitAt=t.splitAt,l.takeWhile=t.takeWhile,l.dropWhile=t.dropWhile,l.span=t.span,l.breakList=t.breakList,l.zip=t.zip,l.zipWith=t.zipWith,l.zipAll=t.zipAll,l.zipAllWith=t.zipAllWith,l.at=t.at,l.elemIndex=t.elemIndex,l.elemIndices=t.elemIndices,l.findIndex=t.findIndex,l.findIndices=t.findIndices,l.apply=e.apply,l.curry=e.curry,l.flip=e.flip,l.fix=e.fix,l.over=e.over,l.split=r.split,l.join=r.join,l.lines=r.lines,l.unlines=r.unlines,l.words=r.words,l.unwords=r.unwords,l.chars=r.chars,l.unchars=r.unchars,l.repeat=r.repeat,l.capitalize=r.capitalize,l.camelize=r.camelize,l.dasherize=r.dasherize,l.values=n.values,l.keys=n.keys,l.pairsToObj=n.pairsToObj,l.objToPairs=n.objToPairs,l.listsToObj=n.listsToObj,l.objToLists=n.objToLists,l.max=i.max,l.min=i.min,l.negate=i.negate,l.abs=i.abs,l.signum=i.signum,l.quot=i.quot,l.rem=i.rem,l.div=i.div,l.mod=i.mod,l.recip=i.recip,l.pi=i.pi,l.tau=i.tau,l.exp=i.exp,l.sqrt=i.sqrt,l.ln=i.ln,l.pow=i.pow,l.sin=i.sin,l.tan=i.tan,l.cos=i.cos,l.acos=i.acos,l.asin=i.asin,l.atan=i.atan,l.atan2=i.atan2,l.truncate=i.truncate,l.round=i.round,l.ceiling=i.ceiling,l.floor=i.floor,l.isItNaN=i.isItNaN,l.even=i.even,l.odd=i.odd,l.gcd=i.gcd,l.lcm=i.lcm,l.VERSION="1.2.1",eN=l}var rD=rj.exports,r_={exports:{}},rR={exports:{}},rK={exports:{}},rU=rK.exports,rV={exports:{}},rW=rV.exports,rJ=rR.exports;function rz(){return e$||(e$=1,(function(){var e,t;eP||(eP=1,(function(){var e,t;function n(e){var t;if(null==(t=e[0]))throw Error("Unexpected end of input.");return t}function r(t){var r;if(r=n(t),!e.test(r))throw Error("Expected text, got '"+r+"' instead.");return t.shift()}function i(e,t){var r;if((r=n(e))!==t)throw Error("Expected '"+t+"', got '"+r+"' instead.");return e.shift()}function s(e,t){return e[0]===t?e.shift():null}function o(e){var t,o;switch(e[0]){case"[":if(i(e,"["),"]"===n(e))throw Error("Must specify type of Array - eg. [Type], got [] instead.");return t=l(e),i(e,"]"),{structure:"array",of:t};case"(":if(o=[],i(e,"("),")"===n(e))throw Error("Tuple must be of at least length 1 - eg. (Type), got () instead.");for(;o.push(l(e)),s(e,","),")"!==n(e););return i(e,")"),{structure:"tuple",of:o};case"{":return function(e){var t,o,a,c,u;for(t={},i(e,"{"),o=!1;;){if(s(e,"...")){o=!0;break}if(c=(a=function(e){var t;return t=r(e),i(e,":"),[t,l(e)]}(e))[0],u=a[1],t[c]=u,s(e,","),"}"===n(e))break}return i(e,"}"),{structure:"fields",of:t,subset:o}}(e)}}function l(t){var l,a,c,u,f,p;if("::"===n(t))throw Error("No comment before comment separator '::' found.");for(null!=(l=t[1])&&"::"===l&&(t.shift(),t.shift()),a=[],c={},"Maybe"===n(t)&&(t.shift(),a=[{type:"Undefined"},{type:"Null"}],c={Undefined:!0,Null:!0});f=(u=function(t){var s,l,a,c;if((l="*"===(s=n(t)))||e.test(s))return(a=l?i(t,"*"):r(t),c=o(t))?(c.type=a,c):{type:a};if(!(c=o(t)))throw Error("Unexpected character: "+s);return c}(t)).type,p=u.structure,c[f]||a.push(u),null==p&&(c[f]=!0),s(t,"|"););return a}t=RegExp("\\.\\.\\.|::|->|"+(e=/[\$\w]+/).source+"|\\S","g"),rK.exports=function(e){var n;if(!e.length)throw Error("No type specified.");if(function(e){for(var t=-1,n=e.length>>>0;++t<n;)if("->"===e[t])return!0;return!1}(n=e.match(t)||[]))throw Error("Function types are not supported. To validate that something is a function, you may use 'Function'.");try{return l(n)}catch(t){throw Error(t.message+" - Remaining tokens: "+JSON.stringify(n)+" - Initial input: '"+e+"'")}}}).call(rU)),e=rK.exports,eB||(eB=1,(function(){var e,t,n,r,i,s,o={}.toString;function l(e,t,r){if(!(e instanceof Object))return!1;switch(t.structure){case"fields":return function(e,t,n){var r,i,s,o,l,c,u;for(s in r={},i=0,e)r[s]=!0,i++;for(l in o=0,c=t.of){if(u=c[l],!a(e[l],u,n))return!1;r[l]&&o++}return t.subset||i===o}(e,t,r);case"array":return n(function(e){return a(e,t.of,r)},e);case"tuple":return function(e,t,n){var r,i,s,o,l;for(i=0,r=0,o=(s=t.of).length;i<o;++i){if(l=s[i],!a(e[r],l,n))return!1;r++}return e.length<=r}(e,t,r)}}function a(e,n,r){if("Array"!==o.call(n).slice(8,-1))throw Error("Types must be in an array. Input: "+e+".");return t(function(t){var n,a,c,u;if(n=t.type,a=t.structure,n)return"*"===n||((c=r.customTypes[n]||i[n])?(void 0===c.typeOf||c.typeOf===o.call(e).slice(8,-1))&&c.validate(e):n===o.call(e).slice(8,-1)&&(!a||l(e,t,r)));if(a)return(!(u=s[a])||u===o.call(e).slice(8,-1))&&l(e,t,r);throw Error("No type defined. Input: "+e+".")},n)}t=(e=rF()).any,n=e.all,i={Number:{typeOf:"Number",validate:function(e){return!r(e)}},NaN:{typeOf:"Number",validate:r=e.isItNaN},Int:{typeOf:"Number",validate:function(e){return!r(e)&&e%1==0}},Float:{typeOf:"Number",validate:function(e){return!r(e)}},Date:{typeOf:"Date",validate:function(e){return!r(e.getTime())}}},s={array:"Array",tuple:"Array"},rV.exports=function(e,t,n){return null==n&&(n={}),null==n.customTypes&&(n.customTypes={}),a(t,e,n)}}).call(rW)),rR.exports={VERSION:"0.4.0",typeCheck:function(n,r,i){return t(e(n),r,i)},parsedTypeCheck:t=rV.exports,parseType:e}}).call(rJ)),rR.exports}var rG=r_.exports,rQ=rY.exports,rX=function(){if(ej)return rq;ej=1;var e=(eY||(eY=1,(function(){var e,t,n,r;eO||(eO=1,(function(){var e,t,n;function r(e,t){if(e[0]===t)return e.shift();throw Error("Expected '"+t+"', but got '"+e[0]+"' instead in "+JSON.stringify(e)+".")}function i(e,t){if(e[0]===t)return e.shift()}function s(e,t,n){var s,o,l,a;for(s=t[0],o=t[1],n&&r(e,s),l=[],a=","+(n?o:"");e.length&&n&&e[0]!==o;)l.push(u(e,a)),i(e,",");return n&&r(e,o),l}function o(e,t){return s(e,["[","]"],t)}function l(e,t){return s(e,["(",")"],t)}function a(e,t){var n,s,o;for(t&&r(e,"{"),n={},s=","+(t?"}":"");e.length&&(!t||"}"!==e[0]);)o=c(e,":"),r(e,":"),n[o]=u(e,s),i(e,",");return t&&r(e,"}"),n}function c(e,t){var n;for(null==t&&(t=""),n="";e.length&&-1===t.indexOf(e[0]);)n+=e.shift();return n}function u(e,t){switch(e[0]){case"[":return o(e,!0);case"(":return l(e,!0);case"{":return a(e,!0);default:return c(e,t)}}function f(e){return!e}e=rF().reject,n=RegExp("(\"(?:\\\\\"|[^\"])*\")|('(?:\\\\'|[^'])*')|(/(?:\\\\/|[^/])*/[a-zA-Z]*)|(#.*#)|(["+(t=/\[\]\(\)}{:,/.source)+"])|([^\\s"+t+"](?:\\s*[^\\s"+t+"]+)*)|\\s*"),rj.exports=function(t,r,i){var s,c,p,d,h,g,m,y,b;if(null==i&&(i={}),!i.explicit&&1===t.length&&"String"===t[0].type)return r;if(c=e(f,r.split(n)),p=i,h=(d=t[0]).type,g=d.structure,m=c.concat(),p.explicit||1!==t.length||(h||!g)&&"Array"!==h&&"Object"!==h?b=u(c):(y="array"===g||"Array"===h?o(c,"["===c[0]):"tuple"===g?l(c,"("===c[0]):a(c,"{"===c[0]),b=c.length?u(("array"===g||"Array"===h?(m.unshift("["),m.push("]")):(m.unshift("("),m.push(")")),m)):y),!(s=b))throw Error("Error parsing '"+r+"'.");return s}}).call(rD)),e=rj.exports,eq||(eq=1,(function(){var e,t,n={}.toString;function r(e,t,r){var i;return"Array"!==n.call(e).slice(8,-1)?{type:"Nothing"}:(i=t.of,{type:"Just",value:function(){var t,n,s=[];for(t=0,n=e.length;t<n;++t)s.push(o(e[t],i,r));return s}()})}function i(e,t,r){var i,s,l;return"Object"!==n.call(e).slice(8,-1)?{type:"Nothing"}:(i=t.of,{type:"Just",value:function(){var t,n={};for(s in t=e)l=t[s],n[o(s,[{type:"String"}],r)]=o(l,i[s]||[{type:"*"}],r);return n}()})}function s(e,s,l){var a,c,u,f;if(a=s.type,c=s.structure,a){if(!(u=(null!=(f=l.customTypes[a])?f.cast:void 0)||t[a]))throw Error("Type not defined: "+a+".");return u(e,l,o)}switch(c){case"array":return r(e,s,l);case"tuple":return function(e,t,r){var i,s,l,a,c,u,f;if("Array"!==n.call(e).slice(8,-1))return{type:"Nothing"};for(l=0,i=[],s=0,c=(a=t.of).length;l<c;++l)u=a[l],f=o(e[s],u,r),"Undefined"!==n.call(f).slice(8,-1)&&i.push(f),s++;return e.length<=s?{type:"Just",value:i}:{type:"Nothing"}}(e,s,l);case"fields":return i(e,s,l)}}function o(t,n,r){var i,o,l,a,c,u;for(i=0,o=n.length;i<o;++i)if(c=(a=s(t,l=n[i],r)).type,u=a.value,"Nothing"!==c&&e([l],u,{customTypes:r.customTypes}))return u;throw Error("Value "+JSON.stringify(t)+" does not type check against "+JSON.stringify(n)+".")}e=rz().parsedTypeCheck,t={"*":function(e,t){switch(n.call(e).slice(8,-1)){case"Array":return s(e,{type:"Array"},t);case"Object":return s(e,{type:"Object"},t);default:return{type:"Just",value:o(e,[{type:"Undefined"},{type:"Null"},{type:"NaN"},{type:"Boolean"},{type:"Number"},{type:"Date"},{type:"RegExp"},{type:"Array"},{type:"Object"},{type:"String"}],(t.explicit=!0,t))}}},Undefined:function(e){return"undefined"===e||void 0===e?{type:"Just",value:void 0}:{type:"Nothing"}},Null:function(e){return"null"===e?{type:"Just",value:null}:{type:"Nothing"}},NaN:function(e){return"NaN"===e?{type:"Just",value:NaN}:{type:"Nothing"}},Boolean:function(e){return"true"===e?{type:"Just",value:!0}:"false"===e?{type:"Just",value:!1}:{type:"Nothing"}},Number:function(e){return{type:"Just",value:+e}},Int:function(e){return{type:"Just",value:+e}},Float:function(e){return{type:"Just",value:+e}},Date:function(e,t){var n;return(n=/^\#([\s\S]*)\#$/.exec(e))?{type:"Just",value:new Date(+n[1]||n[1])}:t.explicit?{type:"Nothing"}:{type:"Just",value:new Date(+e||e)}},RegExp:function(e,t){var n;return(n=/^\/([\s\S]*)\/([gimy]*)$/.exec(e))?{type:"Just",value:new RegExp(n[1],n[2])}:t.explicit?{type:"Nothing"}:{type:"Just",value:new RegExp(e)}},Array:function(e,t){return r(e,{of:[{type:"*"}]},t)},Object:function(e,t){return i(e,{of:{}},t)},String:function(e){var t,r;return"String"!==n.call(e).slice(8,-1)?{type:"Nothing"}:(t=function(e,t){return e.replace(/\\([^u]|u[0-9a-fA-F]{4})/g,function(e,n){switch(n[0]){case t:return t;case"\\":return"\\";case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return" ";case"u":return JSON.parse('"'+e+'"');default:return n}})},r=e.match(/^'([\s\S]*)'$/))?{type:"Just",value:t(r[1],"'")}:(r=e.match(/^"([\s\S]*)"$/))?{type:"Just",value:t(r[1],'"')}:{type:"Just",value:e}}},r_.exports=function(e,t,n){return n.explicit||1!==t.length||"String"!==t[0].type?o(e,t,n):e}}).call(rG)),t=r_.exports,n=rz().parseType,rY.exports={VERSION:"0.4.1",parse:function(e,t,i){return r(n(e),t,i)},parsedTypeParse:r=function(n,r,i){return null==i&&(i={}),null==i.explicit&&(i.explicit=!1),null==i.customTypes&&(i.customTypes={}),t(e(n,r,i),n,i)}}}).call(rQ)),rY.exports);let t=/^([a-z]+(?:-[a-z]+)*)(?:\s|$)/u,n=new Set([0,1,2,"off","warn","error"]);function r(e){let t=Array.isArray(e)?e[0]:e;return n.has(t)}class i{label="";value="";justification="";constructor(e,t,n){this.label=e,this.value=t,this.justification=n}}return rq.CallMethodStep=class{type="call";kind=2;target;args;constructor({target:e,args:t}){this.target=e,this.args=t}},rq.ConfigCommentParser=class{parseStringConfig(e){let t={};return e.trim().replace(/(?<!\s)\s*([:,])\s*/gu,"$1").split(/\s|,+/u).forEach(e=>{if(!e)return;let[n,r=null]=e.split(":");t[n]=r}),t}parseJSONLikeConfig(t){try{let n=e.parse("Object",t)||{};if(Object.values(n).every(r))return{ok:!0,config:n}}catch{}let n=t.replace(/(?<![-a-zA-Z0-9/])([-a-zA-Z0-9/]+):/gu,'"$1":').replace(/([\]0-9])\s+(?=")/u,"$1,");try{let e=JSON.parse(`{${n}}`);return{ok:!0,config:e}}catch(t){let e=t instanceof Error?t.message:String(t);return{ok:!1,error:{message:`Failed to parse JSON from '${n}': ${e}`}}}}parseListConfig(e){let t={};return e.split(",").forEach(e=>{let n=e.trim().replace(/^(?<quote>['"]?)(?<ruleId>.*)\k<quote>$/su,"$<ruleId>");n&&(t[n]=!0)}),t}#e(e){let t=/\s-{2,}\s/u.exec(e);return t?{directivePart:e.slice(0,t.index).trim(),justificationPart:e.slice(t.index+t[0].length).trim()}:{directivePart:e.trim(),justificationPart:""}}parseDirective(e){let{directivePart:n,justificationPart:r}=this.#e(e),s=t.exec(n);if(!s)return;let o=s[1],l=n.slice(s.index+o.length);return new i(o,l.trim(),r)}},rq.Directive=class{type;node;value;justification;constructor({type:e,node:t,value:n,justification:r}){this.type=e,this.node=t,this.value=n,this.justification=r}},rq.TextSourceCodeBase=class{#t=[];#n=[0];#r;ast;text;constructor({text:e,ast:t,lineEndingPattern:n=/\r?\n/u}){this.ast=t,this.text=e,this.#r=new RegExp(n.source,n.flags.replace(/[gy]/gu,""))}#i(e){let t=this.#r.exec(e);return!!t&&(this.#t.push(e.slice(0,t.index)),this.#n.push((this.#n.at(-1)??0)+t.index+t[0].length),!0)}#s(){if(this.#t.length!==this.#n.length){for(;this.#i(this.text.slice(this.#n.at(-1))););this.#t.push(this.text.slice(this.#n.at(-1))),Object.freeze(this.#t)}}#o(e){if(!(e<=(this.#n.at(-1)??0)))for(;e>(this.#n.at(-1)??0)&&this.#i(this.text.slice(this.#n.at(-1))););}#l(e,t){let n=e.line-t+1-(this.#n.length-1);if(!(n<=0))for(;n>0&&this.#i(this.text.slice(this.#n.at(-1)));)n-=1}getLoc(e){if("loc"in e)return e.loc;if("position"in e)return e.position;throw Error("Custom getLoc() method must be implemented in the subclass.")}getLocFromIndex(e){if("number"!=typeof e)throw TypeError("Expected `index` to be a number.");if(e<0||e>this.text.length)throw RangeError(`Index out of range (requested index ${e}, but source text has length ${this.text.length}).`);let{start:{line:t,column:n},end:{line:r,column:i}}=this.getLoc(this.ast);if(0===e)return{line:t,column:n};if(e===this.text.length)return{line:r,column:i};this.#o(e);let s=(e>=(this.#n.at(-1)??0)?this.#n.length:function(e,t){let n=0,r=e.length-1;for(;n<r;){let i=(n+r)/2|0;t<e[i]?r=i:n=i+1}return n}(this.#n,e))-1+t;return{line:s,column:e-this.#n[s-t]+n}}getIndexFromLoc(e){if(null===e||"object"!=typeof e||"number"!=typeof e.line||"number"!=typeof e.column)throw TypeError("Expected `loc` to be an object with numeric `line` and `column` properties.");let{start:{line:t,column:n},end:{line:r,column:i}}=this.getLoc(this.ast);if(e.line<t||r<e.line)throw RangeError(`Line number out of range (line ${e.line} requested). Valid range: ${t}-${r}`);if(e.line===t&&e.column===n)return 0;if(e.line===r&&e.column===i)return this.text.length;this.#l(e,t);let s=e.line===r,o=this.#n[e.line-t],l=s?this.text.length:this.#n[e.line-t+1],a=o+e.column-n;if(e.column<n||s&&a>l||!s&&a>=l)throw RangeError(`Column number out of range (column ${e.column} requested). Valid range for line ${e.line}: ${n}-${l-o+n+(s?0:-1)}`);return a}getRange(e){if("range"in e)return e.range;if("position"in e)return[e.position.start.offset,e.position.end.offset];throw Error("Custom getRange() method must be implemented in the subclass.")}getParent(e){throw Error("Not implemented.")}getAncestors(e){if(!e)throw TypeError("Missing required argument: node.");let t=[];for(let n=this.getParent(e);n;n=this.getParent(n))t.push(n);return t.reverse()}getText(e,t,n){if(e){let r=this.getRange(e);return this.text.slice(Math.max(r[0]-(t||0),0),r[1]+(n||0))}return this.text}get lines(){return this.#s(),this.#t}traverse(){throw Error("Not implemented.")}},rq.VisitNodeStep=class{type="visit";kind=1;target;phase;args;constructor({target:e,phase:t,args:n}){this.target=e,this.phase=t,this.args=n}},rq}(),rH=Object.defineProperty;function rZ(e,t){let n=0,r=e.length-1;for(;n<=r;){let i=Math.floor((n+r)/2),s=e[i].range[0];if(s<t)n=i+1;else{if(!(s>t))return i;r=i-1}}return n}function r0(e,t,n){let r=t.get(n);for(null==r&&(r=rZ(e,n));r<e.length&&e[r].range[1]<=e[r].range[0];)r++;return r}function r1(e,t,n){let r=t.get(n);for(null!=r?r--:r=rZ(e,n)-1;r>=0&&e[r].range[1]<=e[r].range[0];)r--;return r}function r2(e,t){let n;if("number"==typeof e)return{filter:t.isNotComment,skip:e};if("function"==typeof e)return{filter:n=>!t.isComment(n)&&e(n),skip:0};if(e?.includeComments)n=e?.filter??(()=>!0);else if(e?.filter){let r=e?.filter;n=e=>!t.isComment(e)&&r(e)}else n=t.isNotComment;return{filter:n,skip:e?.skip??0}}function r9(e,t){let n;if("number"==typeof e)return{filter:t.isNotComment,count:e};if("function"==typeof e)return{filter:n=>!t.isComment(n)&&e(n),count:0};if(e?.includeComments)n=e?.filter??(()=>!0);else if(e?.filter){let r=e?.filter;n=e=>!t.isComment(e)&&r(e)}else n=t.isNotComment;return{filter:n,count:e?.count??0}}let r8=Symbol("private");var r6=class{[r8];constructor(e){let t=[...e.tokens].sort((e,t)=>e.range[0]-t.range[0]),n=new Map;for(let e=0;e<t.length;e++){let r=t[e];r.range[0]<r.range[1]&&n.set(r.range[0],e)}this[r8]={allTokens:t,tokenStartToIndex:n,ctx:{isComment:e.isComment,isNotComment:t=>!e.isComment(t)},cacheAllComments:null}}getAllTokens(){return this[r8].allTokens}getAllComments(){let{ctx:e,allTokens:t,cacheAllComments:n}=this[r8];if(n)return n;let r=[];for(let n of t)e.isComment(n)&&r.push(n);return this[r8].cacheAllComments=r,r}getFirstToken(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,skip:o}=r2(t,n),l=r0(r,i,e.range[0]),a=r1(r,i,e.range[1]),c=0;for(let e=l;e<=a&&e<r.length;e++){let t=r[e];if(!s||s(t)){if(c<o){c++;continue}return t}}return null}getFirstTokens(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,count:o}=r9(t,n),l=r0(r,i,e.range[0]),a=r1(r,i,e.range[1]),c=[];for(let e=l;e<=a&&e<r.length;e++){let t=r[e];if((!s||s(t))&&(c.push(t),o>0&&c.length>=o))break}return c}getLastToken(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,skip:o}=r2(t,n),l=r0(r,i,e.range[0]),a=r1(r,i,e.range[1]),c=0;for(let e=a;e>=l&&e>=0;e--){let t=r[e];if(!s||s(t)){if(c<o){c++;continue}return t}}return null}getLastTokens(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,count:o}=r9(t,n),l=r0(r,i,e.range[0]),a=r1(r,i,e.range[1]),c=[];for(let e=a;e>=l&&e>=0;e--){let t=r[e];if((!s||s(t))&&(c.unshift(t),o>0&&c.length>=o))break}return c}getTokenAfter(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,skip:o}=r2(t,n),l=r0(r,i,e.range[1]),a=0;for(let e=l;e<r.length;e++){let t=r[e];if(!s||s(t)){if(a<o){a++;continue}return t}}return null}getTokensAfter(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,count:o}=r9(t,n),l=r0(r,i,e.range[1]),a=[];for(let e=l;e<r.length;e++){let t=r[e];if((!s||s(t))&&(a.push(t),o>0&&a.length>=o))break}return a}getTokenBefore(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,skip:o}=r2(t,n),l=r1(r,i,e.range[0]),a=0;for(let e=l;e>=0;e--){let t=r[e];if(!s||s(t)){if(a<o){a++;continue}return t}}return null}getTokensBefore(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,count:o}=r9(t,n),l=r1(r,i,e.range[0]),a=[];for(let e=l;e>=0;e--){let t=r[e];if((!s||s(t))&&(a.unshift(t),o>0&&a.length>=o))break}return a}getFirstTokenBetween(e,t,n){let{ctx:r,allTokens:i,tokenStartToIndex:s}=this[r8],{filter:o,skip:l}=r2(n,r),a=r0(i,s,e.range[1]),c=r1(i,s,t.range[0]),u=0;for(let e=a;e<=c&&e<i.length;e++){let t=i[e];if(!o||o(t)){if(u<l){u++;continue}return t}}return null}getFirstTokensBetween(e,t,n){let{ctx:r,allTokens:i,tokenStartToIndex:s}=this[r8],{filter:o,count:l}=r9(n,r),a=r0(i,s,e.range[1]),c=r1(i,s,t.range[0]),u=[];for(let e=a;e<=c&&e<i.length;e++){let t=i[e];if((!o||o(t))&&(u.push(t),l>0&&u.length>=l))break}return u}getLastTokenBetween(e,t,n){let{ctx:r,allTokens:i,tokenStartToIndex:s}=this[r8],{filter:o,skip:l}=r2(n,r),a=r0(i,s,e.range[1]),c=r1(i,s,t.range[0]),u=0;for(let e=c;e>=a;e--){let t=i[e];if(!o||o(t)){if(u<l){u++;continue}return t}}return null}getLastTokensBetween(e,t,n){let{ctx:r,allTokens:i,tokenStartToIndex:s}=this[r8],{filter:o,count:l}=r9(n,r),a=r0(i,s,e.range[1]),c=r1(i,s,t.range[0]),u=[];for(let e=c;e>=a;e--){let t=i[e];if((!o||o(t))&&(u.unshift(t),l>0&&u.length>=l))break}return u}getTokens(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,count:o}=r9(t,n),l=r0(r,i,e.range[0]),a=r1(r,i,e.range[1]),c=[];for(let e=l;e<=a&&e<r.length;e++){let t=r[e];if((!s||s(t))&&(c.push(t),o>0&&c.length>=o))break}return c}getTokensBetween(e,t,n){let{ctx:r,allTokens:i,tokenStartToIndex:s}=this[r8],{filter:o,count:l}=r9(n,r),a=r0(i,s,e.range[1]),c=r1(i,s,t.range[0]),u=[];for(let e=a;e<=c&&e<i.length;e++){let t=i[e];if((!o||o(t))&&(u.push(t),l>0&&u.length>=l))break}return u}getCommentsInside(e){let{ctx:t,allTokens:n,tokenStartToIndex:r}=this[r8],i=r0(n,r,e.range[0]),s=r1(n,r,e.range[1]),o=[];for(let e=i;e<=s&&e<n.length;e++){let r=n[e];t.isComment(r)&&o.push(r)}return o}getCommentsBefore(e){let{ctx:t,allTokens:n,tokenStartToIndex:r}=this[r8],i=r1(n,r,e.range[0]),s=[];for(let e=i;e>=0;e--){let r=n[e];if(t.isComment(r))s.unshift(r);else break}return s}getCommentsAfter(e){let{ctx:t,allTokens:n,tokenStartToIndex:r}=this[r8],i=r0(n,r,e.range[1]),s=[];for(let e=i;e<n.length;e++){let r=n[e];if(t.isComment(r))s.push(r);else break}return s}commentsExistBetween(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],s=r0(r,i,e.range[1]),o=r1(r,i,t.range[0]);for(let e=s;e<=o&&e<r.length;e++){let t=r[e];if(n.isComment(t))return!0}return!1}isSpaceBetween(e,t){if(e.range[1]>=t.range[0])return!1;let{allTokens:n,tokenStartToIndex:r}=this[r8],i=r0(n,r,e.range[1]),s=r1(n,r,t.range[0]),o=e;for(let e=i;e<=s&&e<n.length;e++){let t=n[e];if(o.range[1]<t.range[0])return!0;o=t}return o.range[1]<t.range[0]}},r3=((e,t)=>{let n={};for(var r in e)rH(n,r,{get:e[r],enumerable:!0});return n})({name:()=>r4,version:()=>r5});let r4="@ota-meshi/ast-token-store",r5="0.3.0";function r7(e,t){return{meta:{...t.meta,docs:{...t.meta.docs,url:`https://ota-meshi.github.io/eslint-plugin-yml/rules/${e}.html`,ruleId:`yml/${e}`,ruleName:e}},create(e){let n=e.sourceCode;return"function"==typeof n.parserServices?.defineCustomBlocksVisitor&&".vue"===eR.extname(e.filename)?n.parserServices.defineCustomBlocksVisitor(e,rI,{target:["yaml","yml"],create:e=>t.create(e,{customBlock:!0})}):t.create(e,{customBlock:!1})}}}function ie(e){return!!(e&&("Block"===e.type||"Line"===e.type))}function it(e,t){return e.loc.end.line===t.loc.start.line}function ir(e){return null!=e&&"Punctuator"===e.type&&"?"===e.value}function ii(e){return null!=e&&"Punctuator"===e.type&&"-"===e.value}function is(e){return null!=e&&"Punctuator"===e.type&&":"===e.value}function io(e){return null!=e&&"Punctuator"===e.type&&","===e.value}function il(e){return null!=e&&"}"===e.value&&"Punctuator"===e.type}({...r3});var ia=r7("block-mapping-colon-indicator-newline",{meta:{docs:{description:"enforce consistent line breaks after `:` indicator",categories:["standard"],extensionRule:!1,layout:!0},fixable:"whitespace",schema:[{enum:["always","never"]}],messages:{unexpectedLinebreakAfterIndicator:"Unexpected line break after this `:` indicator.",expectedLinebreakAfterIndicator:"Expected a line break after this `:` indicator."},type:"layout"},create(e){let t=e.sourceCode;if(!t.parserServices?.isYAML)return{};let n=e.options[0]||"never";return{YAMLMapping(r){if("block"===r.style)for(let i of r.pairs){let r=i.value;if(!r)continue;let s=function(e){let n=e.key?e.key.range[1]:e.range[0],r=t.getTokenBefore(e.value);for(;r&&!is(r);)if((r=t.getTokenBefore(r))&&r.range[1]<=n)return null;return r&&is(r)?r:null}(i);if(!s)return;if(s.loc.end.line<r.loc.start.line){if("never"===n){if(!function(e){let t="YAMLWithMeta"===e.type?e.value:e;return!t||"YAMLSequence"!==t.type&&"YAMLMapping"!==t.type||"block"!==t.style}(r))return;e.report({loc:s.loc,messageId:"unexpectedLinebreakAfterIndicator",fix(e){let t=r.loc.start.column-s.loc.end.column;if(t<1&&r.loc.start.line<r.loc.end.line)return null;let n=" ".repeat(Math.max(t,1));return e.replaceTextRange([s.range[1],r.range[0]],n)}})}}else"always"===n&&e.report({loc:s.loc,messageId:"expectedLinebreakAfterIndicator",fix(e){let t=`
|
|
27
|
+
${i} ${t}`).toJSON()}let nH={tag:"tag:yaml.org,2002:omap",testNode:e=>"YAMLSequence"===e.type&&e.entries.every(e=>e?.type==="YAMLMapping"&&1===e.pairs.length),resolveNode(e){let t={};for(let n of e.entries)for(let e of n.pairs)t[e.key?nz(e.key):e.key]=e.value?nz(e.value):e.value;return t}},nZ={tag:"tag:yaml.org,2002:set",testNode:e=>"YAMLMapping"===e.type&&e.pairs.every(e=>null!=e.key&&null==e.value),resolveNode(e){let t=[];for(let n of e.pairs)t.push(nz(n.key));return t}},n0={tag:"tag:yaml.org,2002:null",testString:e=>!e||"null"===e||"Null"===e||"NULL"===e||"~"===e,resolveString:()=>null},n1={tag:"tag:yaml.org,2002:float",testString:e=>/^[+-]?(?:\.inf|\.Inf|\.INF)$/u.test(e),resolveString:e=>e.startsWith("-")?-1/0:1/0},n2={tag:"tag:yaml.org,2002:float",testString:e=>".NaN"===e||".nan"===e||".NAN"===e,resolveString:()=>NaN},n9={tag:"tag:yaml.org,2002:str",testString:()=>!0,resolveString:e=>e},n8=[n0,{tag:"tag:yaml.org,2002:bool",testString:e=>"true"===e||"True"===e||"TRUE"===e,resolveString:()=>!0},{tag:"tag:yaml.org,2002:bool",testString:e=>"false"===e||"False"===e||"FALSE"===e,resolveString:()=>!1},{tag:"tag:yaml.org,2002:int",testString:e=>/^[+-]?\d+$/u.test(e),resolveString:e=>parseInt(e,10)},{tag:"tag:yaml.org,2002:int",testString:e=>/^0o[0-7]+$/u.test(e),resolveString:e=>parseInt(e.slice(2),8)},{tag:"tag:yaml.org,2002:int",testString:e=>/^0x[\dA-Fa-f]+$/u.test(e),resolveString:e=>parseInt(e.slice(2),16)},{tag:"tag:yaml.org,2002:float",testString:e=>/^[+-]?(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?$/iu.test(e),resolveString:e=>parseFloat(e)},n1,n2,n9],n6=[nH,nZ];function n3(e,t,n){return e.startsWith("-")||e.startsWith("+")?parseInt(e[0]+e.slice(t+1).replace(/_/gu,""),n):parseInt(e.slice(t).replace(/_/gu,""),n)}function n4(e,t){let n=e.shift().replace(/_/gu,""),r=e.pop().replace(/_/gu,""),i=!1;(n.startsWith("-")||n.startsWith("+"))&&(i=n.startsWith("-"),n=n.slice(1));let s=parseInt(n,10);for(;e.length;)s*=60,s+=parseInt(e.shift().replace(/_/gu,""),10);return s*=60,s+=t?parseInt(r,10):parseFloat(r),i?-s:s}let n5={next:n8,"1.2":n8,"1.1":[n0,{tag:"tag:yaml.org,2002:bool",testString:e=>/^(?:y|Y|yes|Yes|YES|true|True|TRUE|on|On|ON)$/u.test(e),resolveString:()=>!0},{tag:"tag:yaml.org,2002:bool",testString:e=>/^(?:n|N|no|No|NO|false|False|FALSE|off|Off|OFF)$/u.test(e),resolveString:()=>!1},{tag:"tag:yaml.org,2002:int",testString:e=>/^[+-]?0[0-7_]+$/u.test(e),resolveString:e=>n3(e,1,8)},{tag:"tag:yaml.org,2002:int",testString:e=>/^[+-]?(?:0|[1-9][\d_]*)$/u.test(e),resolveString:e=>n3(e,0,10)},{tag:"tag:yaml.org,2002:int",testString:e=>/^[+-]?0b[01_]+$/u.test(e),resolveString:e=>n3(e,2,2)},{tag:"tag:yaml.org,2002:int",testString:e=>/^[+-]?0x[\dA-F_a-f]+$/u.test(e),resolveString:e=>n3(e,2,16)},{tag:"tag:yaml.org,2002:int",testString:e=>/^[+-]?[1-9][\d_]*(?::[0-5]?\d)+$/u.test(e),resolveString:e=>n4(e.split(/:/u),!0)},{tag:"tag:yaml.org,2002:float",testString:e=>/^[+-]?(?:\d[\d_]*)?\.[\d_]*(?:e[+-]?\d+)?$/iu.test(e)||/^[+-]?(?:\d[\d_]*)?(?:e[+-]?\d+)?$/iu.test(e),resolveString:e=>parseFloat(e.replace(/_/gu,""))},{tag:"tag:yaml.org,2002:float",testString:e=>/^[+-]?\d[\d_]*(?::[0-5]?\d)+\.[\d_]*$/u.test(e),resolveString:e=>n4(e.split(/:/u),!1)},n1,n2,n9]},n7={next:n6,"1.2":n6,"1.1":[nH,nZ]},re=nW.isPair;var rt=class{constructor(e,t){this.index=0,this.array=e,this.ctx=t}first(){let e;for(;e=this.array[this.index];){if(rf(e,this.ctx)){this.index++;continue}return e}return null}consume(){let e=this.first();return e&&this.index++,e}back(){this.index--}each(e){let t;for(;t=this.consume();)e(t)}};function rn(e){return nW.isMap(e)?"MAP":nW.isSeq(e)?"SEQ":nW.isScalar(e)?"SCALAR":nW.isAlias(e)?"ALIAS":re(e)?"PAIR":nW.isDocument(e)?"DOCUMENT":"unknown"}function*rr(e,t,n,r){for(let i of t)yield function(e,t,n,r){let i,s=n.getConvertLocation(...rm(t)),o=n.code.slice(...s.range),l=t.source.trim().split(/[\t ]+/),a=l.shift();if("%YAML"===a)i={type:"YAMLDirective",value:o,kind:"YAML",version:e?e.yaml.version:t.source.slice(6).trim(),parent:r,...s};else if("%TAG"===a){let[e,t]=l;i={type:"YAMLDirective",value:o,kind:"TAG",handle:e,prefix:t,parent:r,...s}}else i={type:"YAMLDirective",value:o,kind:null,parent:r,...s};return n.addToken("Directive",s.range),i}(e,i,n,r)}function ri(e,t,n,r,i,s){var o,l,a,c,u,f,p,d,h,g,m,y;if(!n)throw r.throwError(`unknown error: AST is null. Unable to process content CST (${t.type}).`,t);if(n.srcToken!==t)throw r.throwError(`unknown error: CST is mismatched. Unable to process content CST (${t.type}: ${n.srcToken?.type}).`,t);if("block-scalar"===t.type){if(!nW.isScalar(n))throw r.throwError(`unknown error: AST is not Scalar (${rn(n)}). Unable to process Scalar CST.`,t);return function(e,t,n,r,i,s){var o,l;let a,c,u,f=t.offset;for(let e of t.props){if(rf(e,r)){f=e.offset+e.source.length;continue}if("block-scalar-header"===e.type){f=(c=r.addToken("Punctuator",rm(e))).range[1];continue}throw r.throwUnexpectedTokenError(e)}let p=c.value,d=n.source?(o=f+t.source.length,l=r,a=o,"\n"===l.code[a-1]&&a>1&&(a--,"\r"===l.code[a-1]&&a>1&&a--),a):r.lastSkipSpaces(t.offset,c.range[1]),h=r.getConvertLocation(c.range[0],d);if(p.startsWith(">")){u={type:"YAMLScalar",style:"folded",...g(p),value:n.source,parent:i,...h};let e=r.code.slice(f,d),t=[f+/^[^\S\n\r]*/.exec(e)[0].length,d];t[0]<t[1]&&r.addToken("BlockFolded",t)}else{u={type:"YAMLScalar",style:"literal",...g(p),value:n.source,parent:i,...h};let e=r.code.slice(f,d),t=[f+/^[^\S\n\r]*/.exec(e)[0].length,d];t[0]<t[1]&&r.addToken("BlockLiteral",t)}return ra(e,n,r,i,u,s,u);function g(e){let t=/([+-]?)(\d*)([+-]?)$/u.exec(e),n=null,r="clip";if(t){n=t[2]?Number(t[2]):null;let e=t[3]||t[1];r="+"===e?"keep":"-"===e?"strip":"clip"}return{chomping:r,indent:n}}}(e,t,n,r,i,s)}if("block-seq"===t.type){if(!nW.isSeq(n))throw r.throwError(`unknown error: AST is not Seq (${rn(n)}). Unable to process Seq CST.`,t);return function(e,t,n,r,i,s){let o,l={type:"YAMLSequence",style:"block",entries:[],parent:i,...r.getConvertLocation(t.offset,t.offset)},a=[...n.items];for(let e of t.items){let t,n,i=new rt(e.start,r);for(;n=i.consume();){if("seq-item-ind"===n.type){if(t)throw r.throwUnexpectedTokenError(n);o=t=r.addToken("Punctuator",rm(n));continue}i.back();break}if(0===a.length){let t=i.first()||e.key||e.sep?.[0]||e.value;if(!t)break;throw r.throwUnexpectedTokenError(t)}l.entries.push(function(e,t,n,r,i,s,o){if(t.key)throw r.throwUnexpectedTokenError(t.key);if(t.sep)throw r.throwUnexpectedTokenError(t.sep);if(t.value){if(re(n)){if("block-map"===t.value.type)return rs(e,t.value,n,r,i,s);if("flow-collection"===t.value.type)return ro(e,t.value,n,r,i,s);throw r.throwError(`unknown error: CST is not block-map and flow-collection (${t.value.type}). Unable to process Pair AST.`,t.value)}return ri(e,t.value,n,r,i,s)}if(!rc(n))throw r.throwError(`unknown error: AST is not Scalar and null (${rn(n)}). Unable to process empty seq item CST.`,e.first()??o);return ra(e,n,r,i,null,s,null)}(i,e,a.shift()||null,r,l,s,(l.entries[l.entries.length-1]||l).range[1]))}return rb(l,l.entries[l.entries.length-1]||o),ra(e,n,r,i,l,s,l)}(e,t,n,r,i,s)}if("block-map"===t.type){if(!nW.isMap(n))throw r.throwError(`unknown error: AST is not Map and Pair (${rn(n)}). Unable to process Map CST.`,t);return rs(e,t,n,r,i,s)}if("flow-collection"===t.type)return ro(e,t,n,r,i,s);if("scalar"===t.type){if(!nW.isScalar(n))throw r.throwError(`unknown error: AST is not Scalar (${rn(n)}). Unable to process Scalar CST.`,t);return function(e,t,n,r,i,s){let o,l=r.getConvertLocation(...rm(t));if(l.range[0]<l.range[1]){let a=n.source||t.source,c=function(e,t){for(let n of n5[t])if(n.testString(e))return n.resolveString(e);return e}(a,s.version||"1.2");o={type:"YAMLScalar",style:"plain",strValue:a,value:c,raw:r.code.slice(...l.range),parent:i,...l};let u=typeof c;"boolean"===u?r.addToken("Boolean",l.range):"number"===u&&isFinite(Number(c))?r.addToken("Numeric",l.range):null===c?r.addToken("Null",l.range):r.addToken("Identifier",l.range),o=ra(e,n,r,i,o,s,l)}else o=ra(e,n,r,i,null,s,l);return t.end?.forEach(e=>rp(e,r)),o}(e,t,n,r,i,s)}if("double-quoted-scalar"===t.type){let p,d,h;if(!nW.isScalar(n))throw r.throwError(`unknown error: AST is not Scalar (${rn(n)}). Unable to process Scalar CST.`,t);return o=e,l=t,a=n,c=r,u=i,f=s,p=c.getConvertLocation(...rm(l)),h={type:"YAMLScalar",style:"double-quoted",strValue:d=a.source,value:d,raw:c.code.slice(...p.range),parent:u,...p},c.addToken("String",p.range),l.end?.forEach(e=>rp(e,c)),ra(o,a,c,u,h,f,h)}if("single-quoted-scalar"===t.type){let o,l,a;if(!nW.isScalar(n))throw r.throwError(`unknown error: AST is not Scalar (${rn(n)}). Unable to process Scalar CST.`,t);return p=e,d=t,h=n,g=r,m=i,y=s,o=g.getConvertLocation(...rm(d)),a={type:"YAMLScalar",style:"single-quoted",strValue:l=h.source,value:l,raw:g.code.slice(...o.range),parent:m,...o},g.addToken("String",o.range),d.end?.forEach(e=>rp(e,g)),ra(p,h,g,m,a,y,a)}if("alias"===t.type){if(!nW.isAlias(n))throw r.throwError(`unknown error: AST is not Alias (${rn(n)}). Unable to process Alias CST.`,t);return function(e,t,n,r){let[i,s]=rm(t),o=n.getConvertLocation(i,n.lastSkipSpaces(i,s)),l={type:"YAMLAlias",name:t.source.slice(1),parent:r,...o};n.addToken("Punctuator",[o.range[0],o.range[0]+1]);let a=[o.range[0]+1,o.range[1]];a[0]<a[1]&&n.addToken("Identifier",a);let c=e.first();if(c)throw n.throwUnexpectedTokenError(c);return t.end?.forEach(e=>rp(e,n)),l}(e,t,r,i)}throw Error(`Unsupported node: ${t.type}`)}function rs(e,t,n,r,i,s){let o,l;if(re(n)){if(n.srcToken!==t.items[0])throw r.throwError(`unknown error: CST is mismatched. Unable to process mapping CST (${t.type}: "CollectionItem").`,t)}else if(n.srcToken!==t)throw r.throwError(`unknown error: CST is mismatched. Unable to process mapping CST (${t.type}: ${n.srcToken?.type}).`,t);let a={type:"YAMLMapping",style:"block",pairs:[],parent:i,...r.getConvertLocation(t.offset,t.offset)},c=ru(n);for(let e of t.items){let t,n=new rt(e.start,r),i=null;for(;t=n.consume();){if("explicit-key-ind"===t.type){if(i)throw r.throwUnexpectedTokenError(t);l=i=r.addToken("Punctuator",rm(t)),o??=i;continue}n.back();break}let u=c.shift();if(!u){let t=n.first()||i||e.key||e.sep?.[0]||e.value;if(!t)break;throw r.throwUnexpectedTokenError(t)}a.pairs.push(rl(i,n,e,u,r,a,s))}return(ry(a,o),ry(a,a.pairs[0]),rb(a,a.pairs[a.pairs.length-1]||l),nW.isMap(n))?ra(e,n,r,i,a,s,a):a}function ro(e,t,n,r,i,s){if("flow-map-start"===t.start.type){let o=r.addToken("Punctuator",rm(t.start));if(!nW.isMap(n)&&!re(n))throw r.throwError(`unknown error: AST is not Map and Pair (${rn(n)}). Unable to process flow map CST.`,t);return function(e,t,n,r,i,s,o){let l,a,c={type:"YAMLMapping",style:"flow",pairs:[],parent:s,...i.getConvertLocation(t.range[0],n.offset)},u=ru(r);for(let e of n.items){let t,n=new rt(e.start,i),r=null;for(;t=n.consume();){if("comma"===t.type){l=i.addToken("Punctuator",rm(t));continue}if("explicit-key-ind"===t.type){if(r)throw i.throwUnexpectedTokenError(t);l=r=i.addToken("Punctuator",rm(t));continue}n.back();break}let s=u.shift();if(!s){let t=n.first()||r||e.key||e.sep?.[0]||e.value;if(!t)break;throw i.throwUnexpectedTokenError(t)}c.pairs.push(rl(r,n,e,s,i,c,o))}for(let e of n.end)if(!rf(e,i)){if("flow-map-end"===e.type){a=i.addToken("Punctuator",rm(e));continue}throw i.throwUnexpectedTokenError(e)}return(rb(c,a||c.pairs[c.pairs.length-1]||l),nW.isMap(r))?ra(e,r,i,s,c,o,c):c}(e,o,t,n,r,i,s)}if("flow-seq-start"===t.start.type){let o=r.addToken("Punctuator",rm(t.start));if(!nW.isSeq(n)||!n.flow)throw r.throwError(`unknown error: AST is not flow Seq (${rn(n)}). Unable to process flow seq CST.`,t);return function(e,t,n,r,i,s,o){let l,a,c={type:"YAMLSequence",style:"flow",entries:[],parent:s,...i.getConvertLocation(t.range[0],n.offset)},u=[...r.items];for(let e of n.items){let n,r=new rt(e.start,i);for(;n=r.consume();){if("comma"===n.type){l=i.addToken("Punctuator",rm(n));continue}r.back();break}if(0===u.length){let t=r.first()||e.key||e.sep?.[0]||e.value;if(!t)break;throw i.throwUnexpectedTokenError(t)}let s=u.shift();re(s)||(e.key||e.sep)&&nW.isMap(s)?c.entries.push(function(e,t,n){let r,s=null;for(;r=e.consume();){if("comma"===r.type){i.addToken("Punctuator",rm(r));continue}if("explicit-key-ind"===r.type){if(s)throw i.throwUnexpectedTokenError(r);s=i.addToken("Punctuator",rm(r));continue}e.back();break}let l=t.key??t.sep[0],a={type:"YAMLMapping",style:"block",pairs:[],parent:c,...i.getConvertLocation(s?.range[0]??l.offset,s?.range[1]??l.offset)},u=rl(s,e,t,ru(n)[0],i,a,o);return a.pairs.push(u),ry(a,s||u),rb(a,u||s),a}(r,e,s)):c.entries.push(function(e,t,n,r,i,s,o){if(t)return ri(e,t,n,r,i,s);if(!rc(n))throw r.throwError(`unknown error: AST is not Scalar and null (${rn(n)}). Unable to process empty seq item CST.`,e.first()??o);return ra(e,n,r,i,null,s,null)}(r,e.value||null,s||null,i,c,o,(c.entries[c.entries.length-1]||l||t).range[1]))}for(let e of n.end)if(!rf(e,i)){if("flow-seq-end"===e.type){a=i.addToken("Punctuator",rm(e));continue}throw i.throwUnexpectedTokenError(e)}return rb(c,a||c.entries[c.entries.length-1]||l),ra(e,r,i,s,c,o,c)}(e,o,t,n,r,i,s)}throw r.throwUnexpectedTokenError(t.start)}function rl(e,t,n,r,i,s,o){let l,a,c=e?.range[0]??t.first()?.offset??n.key?.offset??n.sep?.[0]?.offset??n.value?.offset??-1,u={type:"YAMLPair",key:null,value:null,parent:s,...i.getConvertLocation(c,c)};u.key=function(e,t,n,r,i,s,o){if(t)return ri(e,t,n,r,i,s);if(!rc(n))throw r.throwError(`unknown error: AST is not Scalar and null (${rn(n)}). Unable to process empty map key CST.`,e.first()??o);return ra(e,n,r,i,null,s,null)}(t,n.key||null,r.key,i,u,o,c);let f=new rt(n.sep||[],i);for(;a=f.consume();){if("map-value-ind"===a.type){if(l)throw i.throwUnexpectedTokenError(a);l=i.addToken("Punctuator",rm(a));continue}f.back();break}return u.value=function(e,t,n,r,i,s,o){if(t)return ri(e,t,n,r,i,s);if(!rc(n))throw r.throwError(`unknown error: AST is not Scalar and null (${rn(n)}). Unable to process empty map value CST.`,e.first()??o);return ra(e,n,r,i,null,s,null)}(f,n.value||null,r.value,i,u,o,c),rb(u,u.value||l||u.key||e),u}function ra(e,t,n,r,i,s,o){let l=null;function a(e){var t;return l||(l={type:"YAMLWithMeta",anchor:null,tag:null,value:i,parent:r,...o?{range:[...o.range],loc:{start:rh((t=o.loc).start),end:rh(t.end)}}:n.getConvertLocation(...rm(e))},i&&(i.parent=l)),l}return e.each(e=>{var r,i,o,l,c,u,f,p;if("anchor"===e.type){let t,c,u,f,p,d=a(e),h=(r=e,i=n,o=d,l=s,t=r.source.slice(1),u={type:"YAMLAnchor",name:t,parent:o,...c=i.getConvertLocation(...rm(r))},(l.anchors[t]||(l.anchors[t]=[])).push(u),f=[c.range[0],c.range[0]+1],i.addToken("Punctuator",f),(p=[f[1],c.range[1]])[0]<p[1]&&i.addToken("Identifier",p),u);d.anchor=h,ry(d,h),rb(d,h)}else if("tag"===e.type){let r,i,s,o,l,d,h=a(e),g=(c=e,u=t?.tag??null,f=n,p=h,r=c.source.startsWith("!!")?2:1,"!"===(i=u??c.source.slice(r))&&(i="tag:yaml.org,2002:str"),s=f.getConvertLocation(...rm(c)),o={type:"YAMLTag",tag:i,raw:c.source,parent:p,...s},l=[s.range[0],s.range[0]+r],f.addToken("Punctuator",l),(d=[l[1],s.range[1]])[0]<d[1]&&f.addToken("Identifier",d),o);h.tag=g,ry(h,g),rb(h,g)}else throw n.throwUnexpectedTokenError(e)}),l||i}function rc(e){return nW.isScalar(e)||null==e}function ru(e){return nW.isMap(e)?[...e.items]:[e]}function rf(e,t){if("space"===e.type||"newline"===e.type)return!0;if("flow-error-end"===e.type||"error"===e.type)throw t.throwUnexpectedTokenError(e);if("comment"===e.type){let n={type:"Block",value:e.source.slice(1),...t.getConvertLocation(...rm(e))};return t.addComment(n),!0}return!1}function rp(e,t){if(!rf(e,t))throw t.throwUnexpectedTokenError(e)}function rd(e){return e.sort((e,t)=>e.range[0]>t.range[0]?1:e.range[0]<t.range[0]?-1:e.range[1]>t.range[1]?1:e.range[1]<t.range[1]?-1:0)}function rh(e){return{line:e.line,column:e.column}}function rg(e,t){let n=e.length;for(let r=t;r<n;r++)if(e[r].trim())return r;return n}function rm(e){return[e.offset,e.offset+e.source.length]}function ry(e,t){t&&t.range[0]<e.range[0]&&(e.range[0]=t.range[0],e.loc.start=rh(t.loc.start))}function rb(e,t){t&&e.range[1]<t.range[1]&&(e.range[1]=t.range[1],e.loc.end=rh(t.loc.end))}var rk=class{constructor(e,t){this.tokens=[],this.comments=[],this.locsMap=new Map,this.options=function(e){if(!e)return{};let t={},n=e.defaultYAMLVersion;if("string"==typeof n||"number"==typeof n){let e=String(n);"1.2"===e||"1.1"===e?t.version=e:t.version="next"}return t}(t),this.code=e,this.lineCounter=new nW.LineCounter}getLocFromIndex(e){let t=this.locsMap.get(e);if(!t){let{line:n,col:r}=this.lineCounter.linePos(e);t={line:n,column:r-1},this.locsMap.set(e,t)}return{line:t.line,column:t.column}}getConvertLocation(e,t){return{range:[e,t],loc:{start:this.getLocFromIndex(e),end:this.getLocFromIndex(t)}}}addComment(e){this.comments.push(e)}addToken(e,t){let n={type:e,value:this.code.slice(...t),...this.getConvertLocation(...t)};return this.tokens.push(n),n}throwUnexpectedTokenError(e){let t="source"in e?`'${e.source}'`:e.type;throw this.throwError(`Unexpected token: ${t}`,e)}throwError(e,t){let n="number"==typeof t?t:"offset"in t?t.offset:t.range[0],r=this.getLocFromIndex(n);throw new rL(e,n,r.line,r.column)}lastSkipSpaces(e,t){let n=this.code;for(let r=t-1;r>=e;r--)if(n[r].trim())return r+1;return e}};function rv(e,t){let n=new rk(e,t);return function(e,t){let{cstNodes:n}=e,r={type:"Program",body:[],comments:t.comments,sourceType:"module",tokens:t.tokens,parent:null,...t.getConvertLocation(0,t.code.length)},i=[],s=null,o=[];for(let r of n)if(!rf(r,t)){if("doc-end"===r.type){if(!s)throw t.throwUnexpectedTokenError(r);s.docEnd=r,o.push(s),s=null,r.end?.forEach(e=>rp(e,t));continue}if(s&&(o.push(s),s=null),"directive"===r.type){i.push(r);continue}if("document"===r.type){s={doc:r,node:e.nodes[o.length],directives:i},i=[];continue}throw t.throwUnexpectedTokenError(r)}if(s&&(o.push(s),s=null),i.length>0&&o.push({doc:null,node:null,directives:i}),o.length>0){let n=0;r.body=o.map(i=>{let s=function(e,{directives:t,doc:n,node:r,docEnd:i},s,o,l){let a;if(!n||!r){let n=rg(s.code,l),r=s.getConvertLocation(n,n),a={type:"YAMLDocument",directives:[],content:null,parent:o,anchors:{},version:e.streamInfo.directives.yaml.version,...r};a.directives.push(...rr(null,t,s,a));let c=a.directives[a.directives.length-1];return i&&(c=s.addToken("Marker",rm(i))),rb(a,c),a}let c=s.getConvertLocation(rg(s.code,l),r.range[1]),u={type:"YAMLDocument",directives:[],content:null,parent:o,anchors:{},version:r.directives.yaml.version,...c};u.directives.push(...rr(r.directives,t,s,u));let f=u.directives[u.directives.length-1],p=new rt(n.start,s);for(;a=p.consume();){if("doc-start"===a.type){f=s.addToken("Marker",rm(a));continue}p.back();break}return u.content=function(e,t,n,r,i){if(t)return ri(e,t,n,r,i,i);let s=e.first();if(s){if(nW.isScalar(n)&&""===n.source)return ra(e,n,r,i,null,i,r.getConvertLocation(n.range[0],n.range[1]));throw r.throwUnexpectedTokenError(s)}return null}(p,n.value||null,r.contents,s,u),f=u.content||f,n.end&&n.end.forEach(e=>rp(e,s)),i&&(f=s.addToken("Marker",rm(i))),rb(u,f),u}(e,i,t,r,n);return n=s.range[1],s})}else{let n=rg(t.code,0);r.body.push({type:"YAMLDocument",directives:[],content:null,parent:r,anchors:{},version:e.streamInfo.directives.yaml.version,...t.getConvertLocation(n,n)})}rd(t.comments),rd(t.tokens);let l=r.body[r.body.length-1];return l&&rb(l,t.comments[t.comments.length-1]),r}(function(e){let{lineCounter:t}=e,n=new nW.Parser(t.addNewLine),r=new nW.Composer({...e.options,keepSourceTokens:!0,lineCounter:t}),i=[...n.parse(e.code)],s=[];for(let t of r.compose(i)){for(let n of t.errors)throw e.throwError(n.message,n.pos[0]);s.push(t)}return{nodes:s,cstNodes:i,streamInfo:r.streamInfo()}}(n),n)}let rS=function(e){let t=Object.assign({},nJ);for(let n of Object.keys(e))if(Object.hasOwn(t,n)){let r=new Set(e[n]);for(let e of t[n])r.add(e);t[n]=Object.freeze(Array.from(r))}else t[n]=Object.freeze(Array.from(e[n]));return Object.freeze(t)}({Program:["body"],YAMLDocument:["directives","content"],YAMLDirective:[],YAMLMapping:["pairs"],YAMLPair:["key","value"],YAMLSequence:["entries"],YAMLWithMeta:["anchor","tag","value"],YAMLScalar:[],YAMLAlias:[],YAMLAnchor:[],YAMLTag:[]});function rw(e){let t=null;return"comments"!==e&&"leadingComments"!==e&&"loc"!==e&&"parent"!==e&&"range"!==e&&"tokens"!==e&&"trailingComments"!==e&&null!==(t=this[e])&&"object"==typeof t&&("string"==typeof t.type||Array.isArray(t))}function*rx(e,t){let n=e[t];if(Array.isArray(n))for(let e of n)rA(e)&&(yield e);else rA(n)&&(yield n)}function rA(e){return null!==e&&"object"==typeof e&&"string"==typeof e.type}function rT(e,t){!function e(t,n,r){for(let i of(r.enterNode(t,n),((r.visitorKeys||rS)[t.type]||Object.keys(t).filter(rw,t)).filter(e=>!rx(t,e).next().done)))for(let n of rx(t,i))e(n,t,r);r.leaveNode(t,n)}(e,null,t)}var rL=class extends SyntaxError{constructor(e,t,n,r){super(e),this.index=t,this.lineNumber=n,this.column=r}},rE=((e,t)=>{let n={};for(var r in e)ez(n,r,{get:e[r],enumerable:!0});return n})({name:()=>rC,version:()=>rM});let rC="yaml-eslint-parser",rM="2.0.0";function rN(e,t){return{ast:rv(e,t),visitorKeys:rS,services:{isYAML:!0}}}var rI=Object.freeze({__proto__:null,ParseError:rL,VisitorKeys:rS,getStaticYAMLValue:nz,meta:rE,name:rC,parseForESLint:rN,parseYAML:rv,traverseNodes:rT}),rO={exports:{}},rP=eG(function(){if(eb)return rO.exports;eb=1;var e=function(e,t){var n,r,i=1,s=0,o=0,l=String.alphabet;function a(e,t,r){if(r){for(n=t;(r=a(e,n))<76&&r>65;)++n;return+e.slice(t-1,n)}return(r=l&&l.indexOf(e.charAt(t)))>-1?r+76:(r=e.charCodeAt(t)||0)<45||r>127?r:r<46?65:r<48?r-1:r<58?r+18:r<65?r-11:r<91?r+11:r<97?r-37:r<123?r+5:r-63}if((e+="")!=(t+="")){for(;i;)if(r=a(e,s++),i=a(t,o++),r<76&&i<76&&r>66&&i>66&&(r=a(e,s,s),i=a(t,o,s=n),o=n),r!=i)return r<i?-1:1}return 0};try{rO.exports=e}catch(t){String.naturalCompare=e}return rO.exports}()),rB={},r$=eG(function(){if(ek)return rB;ek=1,Object.defineProperty(rB,"__esModule",{value:!0}),rB.default=function(e,r,i,s){a("aLength",e),a("bLength",r),c("isCommon",i),c("foundSubsequence",s);let o=t(0,e,0,r,i);if(0!==o&&s(o,0,0),e!==o||r!==o){let t=n(o,e-1,o,r-1,i),a=e-t,c=r-t,u=o+t;e!==u&&r!==u&&l(0,o,a,o,c,!1,[{foundSubsequence:s,isCommon:i}],[0],[0],{aCommonFollowing:0,aCommonPreceding:0,aEndPreceding:0,aStartFollowing:0,bCommonFollowing:0,bCommonPreceding:0,bEndPreceding:0,bStartFollowing:0,nChangeFollowing:0,nChangePreceding:0,nCommonFollowing:0,nCommonPreceding:0}),0!==t&&s(t,a,c)}};let e="diff-sequences",t=(e,t,n,r,i)=>{let s=0;for(;e<t&&n<r&&i(e,n);)e+=1,n+=1,s+=1;return s},n=(e,t,n,r,i)=>{let s=0;for(;e<=t&&n<=r&&i(t,r);)t-=1,r-=1,s+=1;return s},r=(e,n,r,i,s,o,l)=>{let a=0,c=-e,u=o[0],f=u;o[a]+=t(u+1,n,i+u-c+1,r,s);let p=e<l?e:l;for(a+=1,c+=2;a<=p;a+=1,c+=2){if(a!==e&&f<o[a])u=o[a];else if(n<=(u=f+1))return a-1;f=o[a],o[a]=u+t(u+1,n,i+u-c+1,r,s)}return l},i=(e,t,r,i,s,o,l)=>{let a=0,c=e,u=o[0],f=u;o[a]-=n(t,u-1,r,i+u-c-1,s);let p=e<l?e:l;for(a+=1,c-=2;a<=p;a+=1,c-=2){if(a!==e&&o[a]<f)u=o[a];else if((u=f-1)<t)return a-1;f=o[a],o[a]=u-n(t,u-1,r,i+u-c-1,s)}return l},s=(e,r,i,s,o,l,a,c,u,f,p)=>{let d=s-r,h=o-s-(i-r),g=-h-(e-1),m=-h+(e-1),y=0,b=e<c?e:c;for(let c=0,k=-e;c<=b;c+=1,k+=2){let b=0===c||c!==e&&y<a[c],v=b?a[c]:y,S=b?v:v+1,w=d+S-k,x=t(S+1,i,w+1,o,l),A=S+x;if(y=a[c],a[c]=A,g<=k&&k<=m){let t=(e-1-(k+h))/2;if(t<=f&&u[t]-1<=A){let t=d+v-(b?k+1:k-1),a=n(r,v,s,t,l),c=v-a+1,u=t-a+1;p.nChangePreceding=e-1,e-1==c+u-r-s?(p.aEndPreceding=r,p.bEndPreceding=s):(p.aEndPreceding=c,p.bEndPreceding=u),p.nCommonPreceding=a,0!==a&&(p.aCommonPreceding=c,p.bCommonPreceding=u),p.nCommonFollowing=x,0!==x&&(p.aCommonFollowing=S+1,p.bCommonFollowing=w+1);let f=A+1,h=w+x+1;return p.nChangeFollowing=e-1,e-1==i+o-f-h?(p.aStartFollowing=i,p.bStartFollowing=o):(p.aStartFollowing=f,p.bStartFollowing=h),!0}}}return!1},o=(e,r,i,s,o,l,a,c,u,f,p)=>{let d=o-i,h=o-s-(i-r),g=h-e,m=h+e,y=0,b=e<f?e:f;for(let f=0,k=e;f<=b;f+=1,k-=2){let b=0===f||f!==e&&u[f]<y,v=b?u[f]:y,S=b?v:v-1,w=d+S-k,x=n(r,S-1,s,w-1,l),A=S-x;if(y=u[f],u[f]=A,g<=k&&k<=m){let n=(e+(k-h))/2;if(n<=c&&A-1<=a[n]){let n=w-x;if(p.nChangePreceding=e,e===A+n-r-s?(p.aEndPreceding=r,p.bEndPreceding=s):(p.aEndPreceding=A,p.bEndPreceding=n),p.nCommonPreceding=x,0!==x&&(p.aCommonPreceding=A,p.bCommonPreceding=n),p.nChangeFollowing=e-1,1===e)p.nCommonFollowing=0,p.aStartFollowing=i,p.bStartFollowing=o;else{let n=d+v-(b?k-1:k+1),r=t(v,i,n,o,l);p.nCommonFollowing=r,0!==r&&(p.aCommonFollowing=v,p.bCommonFollowing=n);let s=v+r,a=n+r;e-1==i+o-s-a?(p.aStartFollowing=i,p.bStartFollowing=o):(p.aStartFollowing=s,p.bStartFollowing=a)}return!0}}}return!1},l=(t,n,a,c,u,f,p,d,h,g)=>{if(u-c<a-n){if((f=!f)&&1===p.length){let{foundSubsequence:e,isCommon:t}=p[0];p[1]={foundSubsequence:(t,n,r)=>{e(t,r,n)},isCommon:(e,n)=>t(n,e)}}let e=n,t=a;n=c,a=u,c=e,u=t}let{foundSubsequence:m,isCommon:y}=p[+!!f];((t,n,l,a,c,u,f,p,d)=>{let h=a-n,g=c-l,m=l-n,y=c-a,b=y-m,k=m,v=m;if(f[0]=n-1,p[0]=l,b%2==0){let e=(t||b)/2,s=(m+y)/2;for(let t=1;t<=s;t+=1)if(k=r(t,l,c,h,u,f,k),t<e)v=i(t,n,a,g,u,p,v);else if(o(t,n,l,a,c,u,f,k,p,v,d))return}else{let e=((t||b)+1)/2,o=(m+y+1)/2,S=1;for(k=r(1,l,c,h,u,f,k),S+=1;S<=o;S+=1)if(v=i(S-1,n,a,g,u,p,v),S<e)k=r(S,l,c,h,u,f,k);else if(s(S,n,l,a,c,u,f,k,p,v,d))return}throw Error(`${e}: no overlap aStart=${n} aEnd=${l} bStart=${a} bEnd=${c}`)})(t,n,a,c,u,y,d,h,g);let{nChangePreceding:b,aEndPreceding:k,bEndPreceding:v,nCommonPreceding:S,aCommonPreceding:w,bCommonPreceding:x,nCommonFollowing:A,aCommonFollowing:T,bCommonFollowing:L,nChangeFollowing:E,aStartFollowing:C,bStartFollowing:M}=g;n<k&&c<v&&l(b,n,k,c,v,f,p,d,h,g),0!==S&&m(S,w,x),0!==A&&m(A,T,L),C<a&&M<u&&l(E,C,a,M,u,f,p,d,h,g)},a=(t,n)=>{if("number"!=typeof n)throw TypeError(`${e}: ${t} typeof ${typeof n} is not a number`);if(!Number.isSafeInteger(n))throw RangeError(`${e}: ${t} value ${n} is not a safe integer`);if(n<0)throw RangeError(`${e}: ${t} value ${n} is a negative integer`)},c=(t,n)=>{let r=typeof n;if("function"!==r)throw TypeError(`${e}: ${t} typeof ${r} is not a function`)};return rB}()),rq={},rY={exports:{}},rj={exports:{}};function rF(){if(eI)return eN;eI=1;var e,t,n,r,i,s,o,l,a={}.toString;function c(e,t){var n,r=function(t){return e.length>1?function(){var i=t?t.concat():[];return n=this,i.push.apply(i,arguments)<e.length&&arguments.length?r.call(n,i):e.apply(n,i)}:e};return r()}return e=function(){if(eS)return ev;eS=1;var e,t,n={}.toString;function r(e,t){var n,r=function(t){return e.length>1?function(){var i=t?t.concat():[];return n=this,i.push.apply(i,arguments)<e.length&&arguments.length?r.call(n,i):e.apply(n,i)}:e};return r()}return e=r(function(e,t){return e.apply(null,t)}),t=r(function(e,t,n){return e(n,t)}),ev={curry:function(e){return r(e)},flip:t,fix:function(e){var t;return t=function(t){return function(){return e(t(t)).apply(null,arguments)}},function(){return e(t(t)).apply(null,arguments)}},apply:e,over:r(function(e,t,n,r){return e(t(n),t(r))}),memoize:function(e){var t;return t={},function(){var r,i,s,o,l;for(i=0,r=[],s=arguments.length;i<s;++i)r.push(arguments[i]);return t[o=(function(){var e,t,i=[];for(e=0,t=r.length;e<t;++e)i.push((l=r[e])+n.call(l).slice(8,-1));return i})().join("")]=o in t?t[o]:e.apply(null,r)}}}}(),t=function(){if(ex)return ew;ex=1;var e,t,n,r,i,s,o,l,a,c,u,f,p,d,h,g,m,y,b,k,v,S,w,x,A,T,L,E,C,M,N,I,O,P,B,$,q,Y,j,F,D,_,R,K,U,V,W,J,z,G,Q={}.toString;function X(e,t){var n,r=function(t){return e.length>1?function(){var i=t?t.concat():[];return n=this,i.push.apply(i,arguments)<e.length&&arguments.length?r.call(n,i):e.apply(n,i)}:e};return r()}function H(e,t){for(var n=-1,r=t.length>>>0;++n<r;)if(e===t[n])return!0;return!1}function Z(e){return!e}return e=X(function(e,t){var n,r;for(n=0,r=t.length;n<r;++n)e(t[n]);return t}),t=X(function(e,t){var n,r,i=[];for(n=0,r=t.length;n<r;++n)i.push(e(t[n]));return i}),n=X(function(e,t){var n,r,i,s=[];for(n=0,r=t.length;n<r;++n)e(i=t[n])&&s.push(i);return s}),r=X(function(e,t){var n,r,i,s=[];for(n=0,r=t.length;n<r;++n)e(i=t[n])||s.push(i);return s}),i=X(function(e,t){var n,r;return n=W(e,t),r=t.slice(),null!=n&&r.splice(n,1),r}),s=X(function(e,t){var n,r,i,s,o;for(i=0,n=[],r=[],s=t.length;i<s;++i)(e(o=t[i])?n:r).push(o);return[n,r]}),o=X(function(e,t){var n,r,i;for(n=0,r=t.length;n<r;++n)if(e(i=t[n]))return i}),l=a=function(e){return e[0]},c=X(function(e,t){var n,r,i,s,o,l=[];for(r=0,n=[],i=t.length;r<i;++r)H(o=e(s=t[r]),n)||(n.push(o),l.push(s));return l}),u=f=X(function(e,t,n){var r,i;for(r=0,i=n.length;r<i;++r)t=e(t,n[r]);return t}),p=d=X(function(e,t){return u(e,t[0],t.slice(1))}),h=X(function(e,t,n){var r;for(r=n.length-1;r>=0;--r)t=e(n[r],t);return t}),g=X(function(e,t){return h(e,t[t.length-1],t.slice(0,-1))}),m=X(function(e,t){var n,r,i;for(n=[],r=t;null!=(i=e(r));)n.push(i[0]),r=i[1];return n}),y=X(function(e,t){return[].concat.apply([],function(){var n,r,i=[];for(n=0,r=t.length;n<r;++n)i.push(e(t[n]));return i}())}),b=function(e){var t;return[].concat.apply([],function(){var n,r,i=[];for(n=0,r=e.length;n<r;++n)t=e[n],"Array"===Q.call(t).slice(8,-1)?i.push(b(t)):i.push(t);return i}())},k=X(function(e,t){var n,r,i,s;for(r=0,n={},i=t.length;r<i;++r)(s=e(t[r]))in n?n[s]+=1:n[s]=1;return n}),v=X(function(e,t){var n,r,i,s,o;for(r=0,n={},i=t.length;r<i;++r)(o=e(s=t[r]))in n?n[o].push(s):n[o]=[s];return n}),S=X(function(e,t){var n,r;for(n=0,r=t.length;n<r;++n)if(e(t[n]))return!0;return!1}),w=X(function(e,t){var n,r;for(n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}),x=X(function(e,t){return t.concat().sort(e)}),A=X(function(e,t){return t.concat().sort(function(t,n){return e(t)>e(n)?1:e(t)<e(n)?-1:0})}),T=L=function(e){var t,n,r;for(n=0,t=0,r=e.length;n<r;++n)t+=e[n];return t/e.length},E=X(function(e,t){var n,r,i,s,o;for(n=t[0],r=0,s=(i=t.slice(1)).length;r<s;++r)e(o=i[r])>e(n)&&(n=o);return n}),C=X(function(e,t){var n,r,i,s,o;for(n=t[0],r=0,s=(i=t.slice(1)).length;r<s;++r)e(o=i[r])<e(n)&&(n=o);return n}),M=N=X(function(e,t,n){var r,i;return r=t,[t].concat(function(){var t,s,o=[];for(t=0,s=n.length;t<s;++t)i=n[t],o.push(r=e(r,i));return o}())}),I=O=X(function(e,t){if(t.length)return M(e,t[0],t.slice(1))}),P=X(function(e,t,n){return M(e,t,n=n.concat().reverse()).reverse()}),B=X(function(e,t){if(t.length)return M(e,(t=t.concat().reverse())[0],t.slice(1)).reverse()}),$=X(function(e,t,n){return n.slice(e,t)}),q=X(function(e,t){return e<=0?t.slice(0,0):t.slice(0,e)}),Y=X(function(e,t){return e<=0?t:t.slice(e)}),j=X(function(e,t){return[q(e,t),Y(e,t)]}),F=X(function(e,t){var n,r;if(!(n=t.length))return t;for(r=0;r<n&&e(t[r]);)r+=1;return t.slice(0,r)}),D=X(function(e,t){var n,r;if(!(n=t.length))return t;for(r=0;r<n&&e(t[r]);)r+=1;return t.slice(r)}),_=X(function(e,t){return[F(e,t),D(e,t)]}),R=X(function(e,t){return _(function(){var e=arguments;return function(){var t,n;for(n=e[0].apply(this,arguments),t=1;t<e.length;++t)n=e[t](n);return n}}(e,Z),t)}),K=X(function(e,t){var n,r,i,s,o,l;for(n=[],r=t.length,i=0,s=e.length;i<s&&(o=i,l=e[i],o!==r);++i)n.push([l,t[o]]);return n}),U=X(function(e,t,n){var r,i,s,o,l,a;for(r=[],i=n.length,s=0,o=t.length;s<o&&(l=s,a=t[s],l!==i);++s)r.push(e(a,n[l]));return r}),V=X(function(e,t){return e<0?t[t.length+e]:t[e]}),W=X(function(e,t){var n,r,i;for(n=0,r=t.length;n<r;++n)if(i=n,t[n]===e)return i}),J=X(function(e,t){var n,r,i,s=[];for(n=0,r=t.length;n<r;++n)i=n,t[n]===e&&s.push(i);return s}),z=X(function(e,t){var n,r,i;for(n=0,r=t.length;n<r;++n)if(i=n,e(t[n]))return i}),G=X(function(e,t){var n,r,i,s=[];for(n=0,r=t.length;n<r;++n)i=n,e(t[n])&&s.push(i);return s}),ew={each:e,map:t,filter:n,compact:function(e){var t,n,r,i=[];for(t=0,n=e.length;t<n;++t)(r=e[t])&&i.push(r);return i},reject:r,remove:i,partition:s,find:o,head:l,first:a,tail:function(e){if(e.length)return e.slice(1)},last:function(e){return e[e.length-1]},initial:function(e){if(e.length)return e.slice(0,-1)},empty:function(e){return!e.length},reverse:function(e){return e.concat().reverse()},difference:function(e){var t,n,r,i,s,o,l,a;for(n=1,t=[],r=arguments.length;n<r;++n)t.push(arguments[n]);i=[];t:for(n=0,s=e.length;n<s;++n){for(o=e[n],l=0,a=t.length;l<a;++l)if(H(o,t[l]))continue t;i.push(o)}return i},intersection:function(e){var t,n,r,i,s,o,l,a;for(n=1,t=[],r=arguments.length;n<r;++n)t.push(arguments[n]);i=[];t:for(n=0,s=e.length;n<s;++n){for(o=e[n],l=0,a=t.length;l<a;++l)if(!H(o,t[l]))continue t;i.push(o)}return i},union:function(){var e,t,n,r,i,s,o,l,a;for(t=0,e=[],n=arguments.length;t<n;++t)e.push(arguments[t]);for(t=0,r=[],i=e.length;t<i;++t)for(o=0,l=(s=e[t]).length;o<l;++o)H(a=s[o],r)||r.push(a);return r},countBy:k,groupBy:v,fold:u,fold1:p,foldl:f,foldl1:d,foldr:h,foldr1:g,unfoldr:m,andList:function(e){var t,n;for(t=0,n=e.length;t<n;++t)if(!e[t])return!1;return!0},orList:function(e){var t,n;for(t=0,n=e.length;t<n;++t)if(e[t])return!0;return!1},any:S,all:w,unique:function(e){var t,n,r,i;for(n=0,t=[],r=e.length;n<r;++n)H(i=e[n],t)||t.push(i);return t},uniqueBy:c,sort:function(e){return e.concat().sort(function(e,t){return e>t?1:e<t?-1:0})},sortWith:x,sortBy:A,sum:function(e){var t,n,r;for(n=0,t=0,r=e.length;n<r;++n)t+=e[n];return t},product:function(e){var t,n,r;for(n=0,t=1,r=e.length;n<r;++n)t*=e[n];return t},mean:T,average:L,concat:function(e){return[].concat.apply([],e)},concatMap:y,flatten:b,maximum:function(e){var t,n,r,i,s;for(t=e[0],n=0,i=(r=e.slice(1)).length;n<i;++n)(s=r[n])>t&&(t=s);return t},minimum:function(e){var t,n,r,i,s;for(t=e[0],n=0,i=(r=e.slice(1)).length;n<i;++n)(s=r[n])<t&&(t=s);return t},maximumBy:E,minimumBy:C,scan:M,scan1:I,scanl:N,scanl1:O,scanr:P,scanr1:B,slice:$,take:q,drop:Y,splitAt:j,takeWhile:F,dropWhile:D,span:_,breakList:R,zip:K,zipWith:U,zipAll:function(){var e,t,n,r,i,s,o,l,a,c,u=[];for(t=0,e=[],n=arguments.length;t<n;++t)e.push(arguments[t]);for(t=0,r=void 0,i=e.length;t<i;++t)r<=(o=(s=e[t]).length)||(r=o);for(t=0;t<r;++t){for(l=t,a=[],c=0,i=e.length;c<i;++c)s=e[c],a.push(s[l]);u.push(a)}return u},zipAllWith:function(e){var t,n,r,i,s,o,l,a,c=[];for(n=1,t=[],r=arguments.length;n<r;++n)t.push(arguments[n]);for(n=0,i=void 0,s=t.length;n<s;++n)i<=(l=(o=t[n]).length)||(i=l);for(n=0;n<i;++n)a=n,c.push(e.apply(null,function(){var e,n,r=[];for(e=0,n=t.length;e<n;++e)r.push((o=t[e])[a]);return r}()));return c},at:V,elemIndex:W,elemIndices:J,findIndex:z,findIndices:G}}(),n=function(){var e,t,n,r,i;if(eT)return eA;function s(e,t){var n,r=function(t){return e.length>1?function(){var i=t?t.concat():[];return n=this,i.push.apply(i,arguments)<e.length&&arguments.length?r.call(n,i):e.apply(n,i)}:e};return r()}return eT=1,e=s(function(e,t){var n,r,i,s={};for(n=0,r=e.length;n<r;++n)i=n,s[e[n]]=t[i];return s}),t=s(function(e,t){var n;for(n in t)e(t[n]);return t}),n=s(function(e,t){var n,r,i={};for(n in t)r=t[n],i[n]=e(r);return i}),r=s(function(e,t){var n,r,i={};for(n in t)e(r=t[n])&&(i[n]=r);return i}),i=s(function(e,t){var n,r,i={};for(n in t)e(r=t[n])||(i[n]=r);return i}),eA={values:function(e){var t,n,r=[];for(t in e)n=e[t],r.push(n);return r},keys:function(e){var t,n=[];for(t in e)n.push(t);return n},pairsToObj:function(e){var t,n,r,i={};for(t=0,n=e.length;t<n;++t)i[(r=e[t])[0]]=r[1];return i},objToPairs:function(e){var t,n,r=[];for(t in e)n=e[t],r.push([t,n]);return r},listsToObj:e,objToLists:function(e){var t,n,r,i;for(r in t=[],n=[],e)i=e[r],t.push(r),n.push(i);return[t,n]},empty:function(e){var t;for(t in e)return!1;return!0},each:t,map:n,filter:r,compact:function(e){var t,n,r={};for(t in e)(n=e[t])&&(r[t]=n);return r},reject:i,partition:s(function(e,t){var n,r,i,s;for(i in n={},r={},t)(e(s=t[i])?n:r)[i]=s;return[n,r]}),find:s(function(e,t){var n,r;for(n in t)if(e(r=t[n]))return r})}}(),r=function(){var e;if(eE)return eL;function t(e,t){var n,r=function(t){return e.length>1?function(){var i=t?t.concat():[];return n=this,i.push.apply(i,arguments)<e.length&&arguments.length?r.call(n,i):e.apply(n,i)}:e};return r()}return eE=1,e=t(function(e,t){return t.split(e)}),eL={split:e,join:t(function(e,t){return t.join(e)}),lines:function(e){return e.length?e.split("\n"):[]},unlines:function(e){return e.join("\n")},words:function(e){return e.length?e.split(/[ ]+/):[]},unwords:function(e){return e.join(" ")},chars:function(e){return e.split("")},unchars:function(e){return e.join("")},reverse:function(e){return e.split("").reverse().join("")},repeat:t(function(e,t){var n,r;for(r=0,n="";r<e;++r)n+=t;return n}),capitalize:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},camelize:function(e){return e.replace(/[-_]+(.)?/g,function(e,t){return(null!=t?t:"").toUpperCase()})},dasherize:function(e){return e.replace(/([^-A-Z])([A-Z]+)/g,function(e,t,n){return t+"-"+(n.length>1?n:n.toLowerCase())}).replace(/^([A-Z]+)/,function(e,t){return t.length>1?t+"-":t.toLowerCase()})}}}(),i=function(){var e,t,n,r,i,s,o,l,a,c,u,f,p,d,h,g,m,y,b,k,v,S,w,x;if(eM)return eC;function A(e,t){var n,r=function(t){return e.length>1?function(){var i=t?t.concat():[];return n=this,i.push.apply(i,arguments)<e.length&&arguments.length?r.call(n,i):e.apply(n,i)}:e};return r()}return eM=1,e=A(function(e,t){return e>t?e:t}),t=A(function(e,t){return e<t?e:t}),n=Math.abs,r=A(function(e,t){return~~(e/t)}),i=A(function(e,t){return e%t}),s=A(function(e,t){return Math.floor(e/t)}),o=A(function(e,t){return(e%t+t)%t}),l=Math.PI,a=Math.exp,c=Math.sqrt,u=Math.log,f=A(function(e,t){return Math.pow(e,t)}),p=Math.sin,d=Math.tan,h=Math.cos,g=Math.asin,m=Math.acos,y=Math.atan,b=A(function(e,t){return Math.atan2(e,t)}),k=Math.round,v=Math.ceil,S=Math.floor,w=A(function(e,t){var n;for(e=Math.abs(e),t=Math.abs(t);0!==t;)n=e%t,e=t,t=n;return e}),x=A(function(e,t){return Math.abs(Math.floor(e/w(e,t)*t))}),eC={max:e,min:t,negate:function(e){return-e},abs:n,signum:function(e){return e<0?-1:+(e>0)},quot:r,rem:i,div:s,mod:o,recip:function(e){return 1/e},pi:l,tau:2*l,exp:a,sqrt:c,ln:u,pow:f,sin:p,tan:d,cos:h,acos:m,asin:g,atan:y,atan2:b,truncate:function(e){return~~e},round:k,ceiling:v,floor:S,isItNaN:function(e){return e!=e},even:function(e){return e%2==0},odd:function(e){return e%2!=0},gcd:w,lcm:x}}(),s=c(function(e,t){return a.call(t).slice(8,-1)===e}),o=c(function(e,t){var n,r=[];for(n=0;n<e;++n)r.push(t);return r}),r.empty=t.empty,r.slice=t.slice,r.take=t.take,r.drop=t.drop,r.splitAt=t.splitAt,r.takeWhile=t.takeWhile,r.dropWhile=t.dropWhile,r.span=t.span,r.breakStr=t.breakList,(l={Func:e,List:t,Obj:n,Str:r,Num:i,id:function(e){return e},isType:s,replicate:o}).each=t.each,l.map=t.map,l.filter=t.filter,l.compact=t.compact,l.reject=t.reject,l.partition=t.partition,l.find=t.find,l.head=t.head,l.first=t.first,l.tail=t.tail,l.last=t.last,l.initial=t.initial,l.empty=t.empty,l.reverse=t.reverse,l.difference=t.difference,l.intersection=t.intersection,l.union=t.union,l.countBy=t.countBy,l.groupBy=t.groupBy,l.fold=t.fold,l.foldl=t.foldl,l.fold1=t.fold1,l.foldl1=t.foldl1,l.foldr=t.foldr,l.foldr1=t.foldr1,l.unfoldr=t.unfoldr,l.andList=t.andList,l.orList=t.orList,l.any=t.any,l.all=t.all,l.unique=t.unique,l.uniqueBy=t.uniqueBy,l.sort=t.sort,l.sortWith=t.sortWith,l.sortBy=t.sortBy,l.sum=t.sum,l.product=t.product,l.mean=t.mean,l.average=t.average,l.concat=t.concat,l.concatMap=t.concatMap,l.flatten=t.flatten,l.maximum=t.maximum,l.minimum=t.minimum,l.maximumBy=t.maximumBy,l.minimumBy=t.minimumBy,l.scan=t.scan,l.scanl=t.scanl,l.scan1=t.scan1,l.scanl1=t.scanl1,l.scanr=t.scanr,l.scanr1=t.scanr1,l.slice=t.slice,l.take=t.take,l.drop=t.drop,l.splitAt=t.splitAt,l.takeWhile=t.takeWhile,l.dropWhile=t.dropWhile,l.span=t.span,l.breakList=t.breakList,l.zip=t.zip,l.zipWith=t.zipWith,l.zipAll=t.zipAll,l.zipAllWith=t.zipAllWith,l.at=t.at,l.elemIndex=t.elemIndex,l.elemIndices=t.elemIndices,l.findIndex=t.findIndex,l.findIndices=t.findIndices,l.apply=e.apply,l.curry=e.curry,l.flip=e.flip,l.fix=e.fix,l.over=e.over,l.split=r.split,l.join=r.join,l.lines=r.lines,l.unlines=r.unlines,l.words=r.words,l.unwords=r.unwords,l.chars=r.chars,l.unchars=r.unchars,l.repeat=r.repeat,l.capitalize=r.capitalize,l.camelize=r.camelize,l.dasherize=r.dasherize,l.values=n.values,l.keys=n.keys,l.pairsToObj=n.pairsToObj,l.objToPairs=n.objToPairs,l.listsToObj=n.listsToObj,l.objToLists=n.objToLists,l.max=i.max,l.min=i.min,l.negate=i.negate,l.abs=i.abs,l.signum=i.signum,l.quot=i.quot,l.rem=i.rem,l.div=i.div,l.mod=i.mod,l.recip=i.recip,l.pi=i.pi,l.tau=i.tau,l.exp=i.exp,l.sqrt=i.sqrt,l.ln=i.ln,l.pow=i.pow,l.sin=i.sin,l.tan=i.tan,l.cos=i.cos,l.acos=i.acos,l.asin=i.asin,l.atan=i.atan,l.atan2=i.atan2,l.truncate=i.truncate,l.round=i.round,l.ceiling=i.ceiling,l.floor=i.floor,l.isItNaN=i.isItNaN,l.even=i.even,l.odd=i.odd,l.gcd=i.gcd,l.lcm=i.lcm,l.VERSION="1.2.1",eN=l}var rD=rj.exports,r_={exports:{}},rR={exports:{}},rK={exports:{}},rU=rK.exports,rV={exports:{}},rW=rV.exports,rJ=rR.exports;function rz(){return e$||(e$=1,(function(){var e,t;eP||(eP=1,(function(){var e,t;function n(e){var t;if(null==(t=e[0]))throw Error("Unexpected end of input.");return t}function r(t){var r;if(r=n(t),!e.test(r))throw Error("Expected text, got '"+r+"' instead.");return t.shift()}function i(e,t){var r;if((r=n(e))!==t)throw Error("Expected '"+t+"', got '"+r+"' instead.");return e.shift()}function s(e,t){return e[0]===t?e.shift():null}function o(e){var t,o;switch(e[0]){case"[":if(i(e,"["),"]"===n(e))throw Error("Must specify type of Array - eg. [Type], got [] instead.");return t=l(e),i(e,"]"),{structure:"array",of:t};case"(":if(o=[],i(e,"("),")"===n(e))throw Error("Tuple must be of at least length 1 - eg. (Type), got () instead.");for(;o.push(l(e)),s(e,","),")"!==n(e););return i(e,")"),{structure:"tuple",of:o};case"{":return function(e){var t,o,a,c,u;for(t={},i(e,"{"),o=!1;;){if(s(e,"...")){o=!0;break}if(c=(a=function(e){var t;return t=r(e),i(e,":"),[t,l(e)]}(e))[0],u=a[1],t[c]=u,s(e,","),"}"===n(e))break}return i(e,"}"),{structure:"fields",of:t,subset:o}}(e)}}function l(t){var l,a,c,u,f,p;if("::"===n(t))throw Error("No comment before comment separator '::' found.");for(null!=(l=t[1])&&"::"===l&&(t.shift(),t.shift()),a=[],c={},"Maybe"===n(t)&&(t.shift(),a=[{type:"Undefined"},{type:"Null"}],c={Undefined:!0,Null:!0});f=(u=function(t){var s,l,a,c;if((l="*"===(s=n(t)))||e.test(s))return(a=l?i(t,"*"):r(t),c=o(t))?(c.type=a,c):{type:a};if(!(c=o(t)))throw Error("Unexpected character: "+s);return c}(t)).type,p=u.structure,c[f]||a.push(u),null==p&&(c[f]=!0),s(t,"|"););return a}t=RegExp("\\.\\.\\.|::|->|"+(e=/[\$\w]+/).source+"|\\S","g"),rK.exports=function(e){var n;if(!e.length)throw Error("No type specified.");if(function(e){for(var t=-1,n=e.length>>>0;++t<n;)if("->"===e[t])return!0;return!1}(n=e.match(t)||[]))throw Error("Function types are not supported. To validate that something is a function, you may use 'Function'.");try{return l(n)}catch(t){throw Error(t.message+" - Remaining tokens: "+JSON.stringify(n)+" - Initial input: '"+e+"'")}}}).call(rU)),e=rK.exports,eB||(eB=1,(function(){var e,t,n,r,i,s,o={}.toString;function l(e,t,r){if(!(e instanceof Object))return!1;switch(t.structure){case"fields":return function(e,t,n){var r,i,s,o,l,c,u;for(s in r={},i=0,e)r[s]=!0,i++;for(l in o=0,c=t.of){if(u=c[l],!a(e[l],u,n))return!1;r[l]&&o++}return t.subset||i===o}(e,t,r);case"array":return n(function(e){return a(e,t.of,r)},e);case"tuple":return function(e,t,n){var r,i,s,o,l;for(i=0,r=0,o=(s=t.of).length;i<o;++i){if(l=s[i],!a(e[r],l,n))return!1;r++}return e.length<=r}(e,t,r)}}function a(e,n,r){if("Array"!==o.call(n).slice(8,-1))throw Error("Types must be in an array. Input: "+e+".");return t(function(t){var n,a,c,u;if(n=t.type,a=t.structure,n)return"*"===n||((c=r.customTypes[n]||i[n])?(void 0===c.typeOf||c.typeOf===o.call(e).slice(8,-1))&&c.validate(e):n===o.call(e).slice(8,-1)&&(!a||l(e,t,r)));if(a)return(!(u=s[a])||u===o.call(e).slice(8,-1))&&l(e,t,r);throw Error("No type defined. Input: "+e+".")},n)}t=(e=rF()).any,n=e.all,i={Number:{typeOf:"Number",validate:function(e){return!r(e)}},NaN:{typeOf:"Number",validate:r=e.isItNaN},Int:{typeOf:"Number",validate:function(e){return!r(e)&&e%1==0}},Float:{typeOf:"Number",validate:function(e){return!r(e)}},Date:{typeOf:"Date",validate:function(e){return!r(e.getTime())}}},s={array:"Array",tuple:"Array"},rV.exports=function(e,t,n){return null==n&&(n={}),null==n.customTypes&&(n.customTypes={}),a(t,e,n)}}).call(rW)),rR.exports={VERSION:"0.4.0",typeCheck:function(n,r,i){return t(e(n),r,i)},parsedTypeCheck:t=rV.exports,parseType:e}}).call(rJ)),rR.exports}var rG=r_.exports,rQ=rY.exports,rX=function(){if(ej)return rq;ej=1;var e=(eY||(eY=1,(function(){var e,t,n,r;eO||(eO=1,(function(){var e,t,n;function r(e,t){if(e[0]===t)return e.shift();throw Error("Expected '"+t+"', but got '"+e[0]+"' instead in "+JSON.stringify(e)+".")}function i(e,t){if(e[0]===t)return e.shift()}function s(e,t,n){var s,o,l,a;for(s=t[0],o=t[1],n&&r(e,s),l=[],a=","+(n?o:"");e.length&&n&&e[0]!==o;)l.push(u(e,a)),i(e,",");return n&&r(e,o),l}function o(e,t){return s(e,["[","]"],t)}function l(e,t){return s(e,["(",")"],t)}function a(e,t){var n,s,o;for(t&&r(e,"{"),n={},s=","+(t?"}":"");e.length&&(!t||"}"!==e[0]);)o=c(e,":"),r(e,":"),n[o]=u(e,s),i(e,",");return t&&r(e,"}"),n}function c(e,t){var n;for(null==t&&(t=""),n="";e.length&&-1===t.indexOf(e[0]);)n+=e.shift();return n}function u(e,t){switch(e[0]){case"[":return o(e,!0);case"(":return l(e,!0);case"{":return a(e,!0);default:return c(e,t)}}function f(e){return!e}e=rF().reject,n=RegExp("(\"(?:\\\\\"|[^\"])*\")|('(?:\\\\'|[^'])*')|(/(?:\\\\/|[^/])*/[a-zA-Z]*)|(#.*#)|(["+(t=/\[\]\(\)}{:,/.source)+"])|([^\\s"+t+"](?:\\s*[^\\s"+t+"]+)*)|\\s*"),rj.exports=function(t,r,i){var s,c,p,d,h,g,m,y,b;if(null==i&&(i={}),!i.explicit&&1===t.length&&"String"===t[0].type)return r;if(c=e(f,r.split(n)),p=i,h=(d=t[0]).type,g=d.structure,m=c.concat(),p.explicit||1!==t.length||(h||!g)&&"Array"!==h&&"Object"!==h?b=u(c):(y="array"===g||"Array"===h?o(c,"["===c[0]):"tuple"===g?l(c,"("===c[0]):a(c,"{"===c[0]),b=c.length?u(("array"===g||"Array"===h?(m.unshift("["),m.push("]")):(m.unshift("("),m.push(")")),m)):y),!(s=b))throw Error("Error parsing '"+r+"'.");return s}}).call(rD)),e=rj.exports,eq||(eq=1,(function(){var e,t,n={}.toString;function r(e,t,r){var i;return"Array"!==n.call(e).slice(8,-1)?{type:"Nothing"}:(i=t.of,{type:"Just",value:function(){var t,n,s=[];for(t=0,n=e.length;t<n;++t)s.push(o(e[t],i,r));return s}()})}function i(e,t,r){var i,s,l;return"Object"!==n.call(e).slice(8,-1)?{type:"Nothing"}:(i=t.of,{type:"Just",value:function(){var t,n={};for(s in t=e)l=t[s],n[o(s,[{type:"String"}],r)]=o(l,i[s]||[{type:"*"}],r);return n}()})}function s(e,s,l){var a,c,u,f;if(a=s.type,c=s.structure,a){if(!(u=(null!=(f=l.customTypes[a])?f.cast:void 0)||t[a]))throw Error("Type not defined: "+a+".");return u(e,l,o)}switch(c){case"array":return r(e,s,l);case"tuple":return function(e,t,r){var i,s,l,a,c,u,f;if("Array"!==n.call(e).slice(8,-1))return{type:"Nothing"};for(l=0,i=[],s=0,c=(a=t.of).length;l<c;++l)u=a[l],f=o(e[s],u,r),"Undefined"!==n.call(f).slice(8,-1)&&i.push(f),s++;return e.length<=s?{type:"Just",value:i}:{type:"Nothing"}}(e,s,l);case"fields":return i(e,s,l)}}function o(t,n,r){var i,o,l,a,c,u;for(i=0,o=n.length;i<o;++i)if(c=(a=s(t,l=n[i],r)).type,u=a.value,"Nothing"!==c&&e([l],u,{customTypes:r.customTypes}))return u;throw Error("Value "+JSON.stringify(t)+" does not type check against "+JSON.stringify(n)+".")}e=rz().parsedTypeCheck,t={"*":function(e,t){switch(n.call(e).slice(8,-1)){case"Array":return s(e,{type:"Array"},t);case"Object":return s(e,{type:"Object"},t);default:return{type:"Just",value:o(e,[{type:"Undefined"},{type:"Null"},{type:"NaN"},{type:"Boolean"},{type:"Number"},{type:"Date"},{type:"RegExp"},{type:"Array"},{type:"Object"},{type:"String"}],(t.explicit=!0,t))}}},Undefined:function(e){return"undefined"===e||void 0===e?{type:"Just",value:void 0}:{type:"Nothing"}},Null:function(e){return"null"===e?{type:"Just",value:null}:{type:"Nothing"}},NaN:function(e){return"NaN"===e?{type:"Just",value:NaN}:{type:"Nothing"}},Boolean:function(e){return"true"===e?{type:"Just",value:!0}:"false"===e?{type:"Just",value:!1}:{type:"Nothing"}},Number:function(e){return{type:"Just",value:+e}},Int:function(e){return{type:"Just",value:+e}},Float:function(e){return{type:"Just",value:+e}},Date:function(e,t){var n;return(n=/^\#([\s\S]*)\#$/.exec(e))?{type:"Just",value:new Date(+n[1]||n[1])}:t.explicit?{type:"Nothing"}:{type:"Just",value:new Date(+e||e)}},RegExp:function(e,t){var n;return(n=/^\/([\s\S]*)\/([gimy]*)$/.exec(e))?{type:"Just",value:new RegExp(n[1],n[2])}:t.explicit?{type:"Nothing"}:{type:"Just",value:new RegExp(e)}},Array:function(e,t){return r(e,{of:[{type:"*"}]},t)},Object:function(e,t){return i(e,{of:{}},t)},String:function(e){var t,r;return"String"!==n.call(e).slice(8,-1)?{type:"Nothing"}:(t=function(e,t){return e.replace(/\\([^u]|u[0-9a-fA-F]{4})/g,function(e,n){switch(n[0]){case t:return t;case"\\":return"\\";case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return" ";case"u":return JSON.parse('"'+e+'"');default:return n}})},r=e.match(/^'([\s\S]*)'$/))?{type:"Just",value:t(r[1],"'")}:(r=e.match(/^"([\s\S]*)"$/))?{type:"Just",value:t(r[1],'"')}:{type:"Just",value:e}}},r_.exports=function(e,t,n){return n.explicit||1!==t.length||"String"!==t[0].type?o(e,t,n):e}}).call(rG)),t=r_.exports,n=rz().parseType,rY.exports={VERSION:"0.4.1",parse:function(e,t,i){return r(n(e),t,i)},parsedTypeParse:r=function(n,r,i){return null==i&&(i={}),null==i.explicit&&(i.explicit=!1),null==i.customTypes&&(i.customTypes={}),t(e(n,r,i),n,i)}}}).call(rQ)),rY.exports);let t=/^([a-z]+(?:-[a-z]+)*)(?:\s|$)/u,n=new Set([0,1,2,"off","warn","error"]);function r(e){let t=Array.isArray(e)?e[0]:e;return n.has(t)}class i{label="";value="";justification="";constructor(e,t,n){this.label=e,this.value=t,this.justification=n}}return rq.CallMethodStep=class{type="call";kind=2;target;args;constructor({target:e,args:t}){this.target=e,this.args=t}},rq.ConfigCommentParser=class{parseStringConfig(e){let t={};return e.trim().replace(/(?<!\s)\s*([:,])\s*/gu,"$1").split(/\s|,+/u).forEach(e=>{if(!e)return;let[n,r=null]=e.split(":");t[n]=r}),t}parseJSONLikeConfig(t){try{let n=e.parse("Object",t)||{};if(Object.values(n).every(r))return{ok:!0,config:n}}catch{}let n=t.replace(/(?<![-a-zA-Z0-9/])([-a-zA-Z0-9/]+):/gu,'"$1":').replace(/([\]0-9])\s+(?=")/u,"$1,");try{let e=JSON.parse(`{${n}}`);return{ok:!0,config:e}}catch(t){let e=t instanceof Error?t.message:String(t);return{ok:!1,error:{message:`Failed to parse JSON from '${n}': ${e}`}}}}parseListConfig(e){let t={};return e.split(",").forEach(e=>{let n=e.trim().replace(/^(?<quote>['"]?)(?<ruleId>.*)\k<quote>$/su,"$<ruleId>");n&&(t[n]=!0)}),t}#e(e){let t=/\s-{2,}\s/u.exec(e);return t?{directivePart:e.slice(0,t.index).trim(),justificationPart:e.slice(t.index+t[0].length).trim()}:{directivePart:e.trim(),justificationPart:""}}parseDirective(e){let{directivePart:n,justificationPart:r}=this.#e(e),s=t.exec(n);if(!s)return;let o=s[1],l=n.slice(s.index+o.length);return new i(o,l.trim(),r)}},rq.Directive=class{type;node;value;justification;constructor({type:e,node:t,value:n,justification:r}){this.type=e,this.node=t,this.value=n,this.justification=r}},rq.TextSourceCodeBase=class{#t=[];#n=[0];#r;ast;text;constructor({text:e,ast:t,lineEndingPattern:n=/\r?\n/u}){this.ast=t,this.text=e,this.#r=new RegExp(n.source,n.flags.replace(/[gy]/gu,""))}#i(e){let t=this.#r.exec(e);return!!t&&(this.#t.push(e.slice(0,t.index)),this.#n.push((this.#n.at(-1)??0)+t.index+t[0].length),!0)}#s(){if(this.#t.length!==this.#n.length){for(;this.#i(this.text.slice(this.#n.at(-1))););this.#t.push(this.text.slice(this.#n.at(-1))),Object.freeze(this.#t)}}#o(e){if(!(e<=(this.#n.at(-1)??0)))for(;e>(this.#n.at(-1)??0)&&this.#i(this.text.slice(this.#n.at(-1))););}#l(e,t){let n=e.line-t+1-(this.#n.length-1);if(!(n<=0))for(;n>0&&this.#i(this.text.slice(this.#n.at(-1)));)n-=1}getLoc(e){if("loc"in e)return e.loc;if("position"in e)return e.position;throw Error("Custom getLoc() method must be implemented in the subclass.")}getLocFromIndex(e){if("number"!=typeof e)throw TypeError("Expected `index` to be a number.");if(e<0||e>this.text.length)throw RangeError(`Index out of range (requested index ${e}, but source text has length ${this.text.length}).`);let{start:{line:t,column:n},end:{line:r,column:i}}=this.getLoc(this.ast);if(0===e)return{line:t,column:n};if(e===this.text.length)return{line:r,column:i};this.#o(e);let s=(e>=(this.#n.at(-1)??0)?this.#n.length:function(e,t){let n=0,r=e.length-1;for(;n<r;){let i=(n+r)/2|0;t<e[i]?r=i:n=i+1}return n}(this.#n,e))-1+t;return{line:s,column:e-this.#n[s-t]+n}}getIndexFromLoc(e){if(null===e||"object"!=typeof e||"number"!=typeof e.line||"number"!=typeof e.column)throw TypeError("Expected `loc` to be an object with numeric `line` and `column` properties.");let{start:{line:t,column:n},end:{line:r,column:i}}=this.getLoc(this.ast);if(e.line<t||r<e.line)throw RangeError(`Line number out of range (line ${e.line} requested). Valid range: ${t}-${r}`);if(e.line===t&&e.column===n)return 0;if(e.line===r&&e.column===i)return this.text.length;this.#l(e,t);let s=e.line===r,o=this.#n[e.line-t],l=s?this.text.length:this.#n[e.line-t+1],a=o+e.column-n;if(e.column<n||s&&a>l||!s&&a>=l)throw RangeError(`Column number out of range (column ${e.column} requested). Valid range for line ${e.line}: ${n}-${l-o+n+(s?0:-1)}`);return a}getRange(e){if("range"in e)return e.range;if("position"in e)return[e.position.start.offset,e.position.end.offset];throw Error("Custom getRange() method must be implemented in the subclass.")}getParent(e){throw Error("Not implemented.")}getAncestors(e){if(!e)throw TypeError("Missing required argument: node.");let t=[];for(let n=this.getParent(e);n;n=this.getParent(n))t.push(n);return t.reverse()}getText(e,t,n){if(e){let r=this.getRange(e);return this.text.slice(Math.max(r[0]-(t||0),0),r[1]+(n||0))}return this.text}get lines(){return this.#s(),this.#t}traverse(){throw Error("Not implemented.")}},rq.VisitNodeStep=class{type="visit";kind=1;target;phase;args;constructor({target:e,phase:t,args:n}){this.target=e,this.phase=t,this.args=n}},rq}(),rH=Object.defineProperty;function rZ(e,t){let n=0,r=e.length-1;for(;n<=r;){let i=Math.floor((n+r)/2),s=e[i].range[0];if(s<t)n=i+1;else{if(!(s>t))return i;r=i-1}}return n}function r0(e,t,n){let r=t.get(n);for(null==r&&(r=rZ(e,n));r<e.length&&e[r].range[1]<=e[r].range[0];)r++;return r}function r1(e,t,n){let r=t.get(n);for(null!=r?r--:r=rZ(e,n)-1;r>=0&&e[r].range[1]<=e[r].range[0];)r--;return r}function r2(e,t){let n;if("number"==typeof e)return{filter:t.isNotComment,skip:e};if("function"==typeof e)return{filter:n=>!t.isComment(n)&&e(n),skip:0};if(e?.includeComments)n=e?.filter??(()=>!0);else if(e?.filter){let r=e?.filter;n=e=>!t.isComment(e)&&r(e)}else n=t.isNotComment;return{filter:n,skip:e?.skip??0}}function r9(e,t){let n;if("number"==typeof e)return{filter:t.isNotComment,count:e};if("function"==typeof e)return{filter:n=>!t.isComment(n)&&e(n),count:0};if(e?.includeComments)n=e?.filter??(()=>!0);else if(e?.filter){let r=e?.filter;n=e=>!t.isComment(e)&&r(e)}else n=t.isNotComment;return{filter:n,count:e?.count??0}}let r8=Symbol("private");var r6=class{[r8];constructor(e){let t=[...e.tokens].sort((e,t)=>e.range[0]-t.range[0]),n=new Map;for(let e=0;e<t.length;e++){let r=t[e];r.range[0]<r.range[1]&&n.set(r.range[0],e)}this[r8]={allTokens:t,tokenStartToIndex:n,ctx:{isComment:e.isComment,isNotComment:t=>!e.isComment(t)},cacheAllComments:null}}getAllTokens(){return this[r8].allTokens}getAllComments(){let{ctx:e,allTokens:t,cacheAllComments:n}=this[r8];if(n)return n;let r=[];for(let n of t)e.isComment(n)&&r.push(n);return this[r8].cacheAllComments=r,r}getFirstToken(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,skip:o}=r2(t,n),l=r0(r,i,e.range[0]),a=r1(r,i,e.range[1]),c=0;for(let e=l;e<=a&&e<r.length;e++){let t=r[e];if(!s||s(t)){if(c<o){c++;continue}return t}}return null}getFirstTokens(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,count:o}=r9(t,n),l=r0(r,i,e.range[0]),a=r1(r,i,e.range[1]),c=[];for(let e=l;e<=a&&e<r.length;e++){let t=r[e];if((!s||s(t))&&(c.push(t),o>0&&c.length>=o))break}return c}getLastToken(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,skip:o}=r2(t,n),l=r0(r,i,e.range[0]),a=r1(r,i,e.range[1]),c=0;for(let e=a;e>=l&&e>=0;e--){let t=r[e];if(!s||s(t)){if(c<o){c++;continue}return t}}return null}getLastTokens(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,count:o}=r9(t,n),l=r0(r,i,e.range[0]),a=r1(r,i,e.range[1]),c=[];for(let e=a;e>=l&&e>=0;e--){let t=r[e];if((!s||s(t))&&(c.unshift(t),o>0&&c.length>=o))break}return c}getTokenAfter(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,skip:o}=r2(t,n),l=r0(r,i,e.range[1]),a=0;for(let e=l;e<r.length;e++){let t=r[e];if(!s||s(t)){if(a<o){a++;continue}return t}}return null}getTokensAfter(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,count:o}=r9(t,n),l=r0(r,i,e.range[1]),a=[];for(let e=l;e<r.length;e++){let t=r[e];if((!s||s(t))&&(a.push(t),o>0&&a.length>=o))break}return a}getTokenBefore(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,skip:o}=r2(t,n),l=r1(r,i,e.range[0]),a=0;for(let e=l;e>=0;e--){let t=r[e];if(!s||s(t)){if(a<o){a++;continue}return t}}return null}getTokensBefore(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,count:o}=r9(t,n),l=r1(r,i,e.range[0]),a=[];for(let e=l;e>=0;e--){let t=r[e];if((!s||s(t))&&(a.unshift(t),o>0&&a.length>=o))break}return a}getFirstTokenBetween(e,t,n){let{ctx:r,allTokens:i,tokenStartToIndex:s}=this[r8],{filter:o,skip:l}=r2(n,r),a=r0(i,s,e.range[1]),c=r1(i,s,t.range[0]),u=0;for(let e=a;e<=c&&e<i.length;e++){let t=i[e];if(!o||o(t)){if(u<l){u++;continue}return t}}return null}getFirstTokensBetween(e,t,n){let{ctx:r,allTokens:i,tokenStartToIndex:s}=this[r8],{filter:o,count:l}=r9(n,r),a=r0(i,s,e.range[1]),c=r1(i,s,t.range[0]),u=[];for(let e=a;e<=c&&e<i.length;e++){let t=i[e];if((!o||o(t))&&(u.push(t),l>0&&u.length>=l))break}return u}getLastTokenBetween(e,t,n){let{ctx:r,allTokens:i,tokenStartToIndex:s}=this[r8],{filter:o,skip:l}=r2(n,r),a=r0(i,s,e.range[1]),c=r1(i,s,t.range[0]),u=0;for(let e=c;e>=a;e--){let t=i[e];if(!o||o(t)){if(u<l){u++;continue}return t}}return null}getLastTokensBetween(e,t,n){let{ctx:r,allTokens:i,tokenStartToIndex:s}=this[r8],{filter:o,count:l}=r9(n,r),a=r0(i,s,e.range[1]),c=r1(i,s,t.range[0]),u=[];for(let e=c;e>=a;e--){let t=i[e];if((!o||o(t))&&(u.unshift(t),l>0&&u.length>=l))break}return u}getTokens(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],{filter:s,count:o}=r9(t,n),l=r0(r,i,e.range[0]),a=r1(r,i,e.range[1]),c=[];for(let e=l;e<=a&&e<r.length;e++){let t=r[e];if((!s||s(t))&&(c.push(t),o>0&&c.length>=o))break}return c}getTokensBetween(e,t,n){let{ctx:r,allTokens:i,tokenStartToIndex:s}=this[r8],{filter:o,count:l}=r9(n,r),a=r0(i,s,e.range[1]),c=r1(i,s,t.range[0]),u=[];for(let e=a;e<=c&&e<i.length;e++){let t=i[e];if((!o||o(t))&&(u.push(t),l>0&&u.length>=l))break}return u}getCommentsInside(e){let{ctx:t,allTokens:n,tokenStartToIndex:r}=this[r8],i=r0(n,r,e.range[0]),s=r1(n,r,e.range[1]),o=[];for(let e=i;e<=s&&e<n.length;e++){let r=n[e];t.isComment(r)&&o.push(r)}return o}getCommentsBefore(e){let{ctx:t,allTokens:n,tokenStartToIndex:r}=this[r8],i=r1(n,r,e.range[0]),s=[];for(let e=i;e>=0;e--){let r=n[e];if(t.isComment(r))s.unshift(r);else break}return s}getCommentsAfter(e){let{ctx:t,allTokens:n,tokenStartToIndex:r}=this[r8],i=r0(n,r,e.range[1]),s=[];for(let e=i;e<n.length;e++){let r=n[e];if(t.isComment(r))s.push(r);else break}return s}commentsExistBetween(e,t){let{ctx:n,allTokens:r,tokenStartToIndex:i}=this[r8],s=r0(r,i,e.range[1]),o=r1(r,i,t.range[0]);for(let e=s;e<=o&&e<r.length;e++){let t=r[e];if(n.isComment(t))return!0}return!1}isSpaceBetween(e,t){if(e.range[1]>=t.range[0])return!1;let{allTokens:n,tokenStartToIndex:r}=this[r8],i=r0(n,r,e.range[1]),s=r1(n,r,t.range[0]),o=e;for(let e=i;e<=s&&e<n.length;e++){let t=n[e];if(o.range[1]<t.range[0])return!0;o=t}return o.range[1]<t.range[0]}},r3=((e,t)=>{let n={};for(var r in e)rH(n,r,{get:e[r],enumerable:!0});return n})({name:()=>r4,version:()=>r5});let r4="@ota-meshi/ast-token-store",r5="0.3.0";function r7(e,t){return{meta:{...t.meta,docs:{...t.meta.docs,url:`https://ota-meshi.github.io/eslint-plugin-yml/rules/${e}.html`,ruleId:`yml/${e}`,ruleName:e}},create(e){let n=e.sourceCode;return"function"==typeof n.parserServices?.defineCustomBlocksVisitor&&".vue"===eR.extname(e.filename)?n.parserServices.defineCustomBlocksVisitor(e,rI,{target:["yaml","yml"],create:e=>t.create(e,{customBlock:!0})}):t.create(e,{customBlock:!1})}}}function ie(e){return!!(e&&("Block"===e.type||"Line"===e.type))}function it(e,t){return e.loc.end.line===t.loc.start.line}function ir(e){return null!=e&&"Punctuator"===e.type&&"?"===e.value}function ii(e){return null!=e&&"Punctuator"===e.type&&"-"===e.value}function is(e){return null!=e&&"Punctuator"===e.type&&":"===e.value}function io(e){return null!=e&&"Punctuator"===e.type&&","===e.value}function il(e){return null!=e&&"}"===e.value&&"Punctuator"===e.type}({...r3});var ia=r7("block-mapping-colon-indicator-newline",{meta:{docs:{description:"enforce consistent line breaks after `:` indicator",categories:["standard"],extensionRule:!1,layout:!0},fixable:"whitespace",schema:[{enum:["always","never"]}],messages:{unexpectedLinebreakAfterIndicator:"Unexpected line break after this `:` indicator.",expectedLinebreakAfterIndicator:"Expected a line break after this `:` indicator."},type:"layout"},create(e){let t=e.sourceCode;if(!t.parserServices?.isYAML)return{};let n=e.options[0]||"never";return{YAMLMapping(r){if("block"===r.style)for(let i of r.pairs){let r=i.value;if(!r)continue;let s=function(e){let n=e.key?e.key.range[1]:e.range[0],r=t.getTokenBefore(e.value);for(;r&&!is(r);)if((r=t.getTokenBefore(r))&&r.range[1]<=n)return null;return r&&is(r)?r:null}(i);if(!s)return;if(s.loc.end.line<r.loc.start.line){if("never"===n){if(!function(e){let t="YAMLWithMeta"===e.type?e.value:e;return!t||"YAMLSequence"!==t.type&&"YAMLMapping"!==t.type||"block"!==t.style}(r))return;e.report({loc:s.loc,messageId:"unexpectedLinebreakAfterIndicator",fix(e){let t=r.loc.start.column-s.loc.end.column;if(t<1&&r.loc.start.line<r.loc.end.line)return null;let n=" ".repeat(Math.max(t,1));return e.replaceTextRange([s.range[1],r.range[0]],n)}})}}else"always"===n&&e.report({loc:s.loc,messageId:"expectedLinebreakAfterIndicator",fix(e){let t=`
|
|
28
28
|
${" ".repeat(r.loc.start.column)}`;return e.replaceTextRange([s.range[1],r.range[0]],t)}})}}}}}),ic=r7("block-mapping-question-indicator-newline",{meta:{docs:{description:"enforce consistent line breaks after `?` indicator",categories:["standard"],extensionRule:!1,layout:!0},fixable:"whitespace",schema:[{enum:["always","never"]}],messages:{unexpectedLinebreakAfterIndicator:"Unexpected line break after this `?` indicator.",expectedLinebreakAfterIndicator:"Expected a line break after this `?` indicator."},type:"layout"},create(e){let t=e.sourceCode;if(!t.parserServices?.isYAML)return{};let n=e.options[0]||"never";return{YAMLMapping(r){if("block"===r.style)for(let i of r.pairs){let r=i.key;if(!r)continue;let s=t.getFirstToken(i);s&&ir(s)&&(s.loc.end.line<r.loc.start.line?"never"===n&&e.report({loc:s.loc,messageId:"unexpectedLinebreakAfterIndicator",fix(e){let t=r.loc.start.column-s.loc.end.column;if(t<1&&r.loc.start.line<r.loc.end.line)return null;let n=" ".repeat(Math.max(t,1));return e.replaceTextRange([s.range[1],r.range[0]],n)}}):"always"===n&&e.report({loc:s.loc,messageId:"expectedLinebreakAfterIndicator",fix(e){let t=`
|
|
29
29
|
${" ".repeat(r.loc.start.column)}`;return e.replaceTextRange([s.range[1],r.range[0]],t)}}))}}}}});function iu(e){for(let t of e.sourceCode.getLines())if(/^\s*\t/u.test(t)||/^\s*-\s*\t/u.test(t))return!0;return!1}function ip(e,t,n){let r=id(e,n);if(null==r)return null;let i=id(t,n);return null!=i&&0>iy(r,i)?i:ig(r,n)}function id(e,t){let n=t.sourceCode.getTokenBefore(e,{includeComments:!0});return!n||n.loc.end.line<e.loc.start.line?ih(e.loc.start.line,t):null}function ih(e,t){let n=t.sourceCode.getLines()[e-1];return/^[^\S\n\r\u2028\u2029]*/u.exec(n)[0]}function ig(e,t){let n=im(t);return`${e}${2===n?" ":4===n?" ":" ".repeat(n)}`}function im(e,t){let n=t??e.settings?.yml?.indent;return null==n||n<2?2:n}function iy(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return NaN;return e.length>t.length?1:e.length<t.length?-1:0}function ib(e){return"YAMLWithMeta"===e.parent.type?ib(e.parent):"YAMLPair"===e.parent.type&&e.parent.key===e}function ik(e){return e&&"YAMLWithMeta"===e.type?e.value:e}function*iv(e,t,n,r){let i=r.sourceCode;"YAMLWithMeta"===n.type?yield*function*(n){let s=t,o=id(n,r);if(null!=o)if(0>iy(t,o))s=o;else{let o=ig(t,r);yield iS(e,i,o,n),s=o}n.value&&(yield*iv(e,s,n.value,r))}(n):"YAMLPair"===n.type?yield*function*(n){let s=t,o=id(n,r);if(null!=o)if(0>iy(t,o))s=o;else{let o=ig(t,r);yield iS(e,i,o,n),s=o}n.value&&(yield*iv(e,s,n.value,r))}(n):yield*function*(n){let s=id(n,r);if(null!=s&&0>iy(t,s))return;let o=t,l=ig(t,r);if(null!=s&&(yield iS(e,i,l,n),o=l),"YAMLMapping"===n.type){for(let t of n.pairs)yield*iv(e,o,t,r);if("flow"===n.style){let t=i.getLastToken(n);if("}"===t.value){let n=id(t,r);null!=n&&0>iy(n,o)&&(yield iS(e,i,o,t))}}}else if("YAMLSequence"===n.type)for(let t of n.entries)t&&(yield*iv(e,o,t,r))}(n)}function iS(e,t,n,r){let i=t.getTokenBefore(r,{includeComments:!0});return e.replaceTextRange([i.range[1],r.range[0]],`
|
|
30
30
|
${n}`)}let iw=["always","never","ignore"];var ix=r7("block-mapping",{meta:{docs:{description:"require or disallow block style mappings.",categories:["standard"],extensionRule:!1,layout:!1},fixable:"code",schema:[{anyOf:[{enum:["always","never"]},{type:"object",properties:{singleline:{enum:iw},multiline:{enum:iw}},additionalProperties:!1}]}],messages:{required:"Must use block style mappings.",disallow:"Must use flow style mappings."},type:"layout"},create(e){var t;let n;if(!e.sourceCode.parserServices?.isYAML)return{};let r=(t=e.options[0],n={singleline:"ignore",multiline:"always"},t&&("string"==typeof t?(n.singleline=t,n.multiline=t):("string"==typeof t.singleline&&(n.singleline=t.singleline),"string"==typeof t.multiline&&(n.multiline=t.multiline))),n),i=null;function s(e){i&&("flow"===e.style?i.hasFlowStyle=!0:"block"===e.style&&(i.hasBlockStyle=!0)),i={upper:i,node:e,flowStyle:"flow"===e.style,blockStyle:"block"===e.style,withinFlowStyle:i&&(i.withinFlowStyle||i.flowStyle)||!1,withinBlockStyle:i&&(i.withinBlockStyle||i.blockStyle)||!1}}function o(){i&&i.upper&&(i.upper.hasNullPair=i.upper.hasNullPair||i.hasNullPair,i.upper.hasBlockLiteralOrFolded=i.upper.hasBlockLiteralOrFolded||i.hasBlockLiteralOrFolded,i.upper.hasBlockStyle=i.upper.hasBlockStyle||i.hasBlockStyle,i.upper.hasFlowStyle=i.upper.hasFlowStyle||i.hasFlowStyle),i=i&&i.upper}return{YAMLSequence:s,YAMLMapping:s,YAMLPair(e){(null==e.key||null==e.value)&&(i.hasNullPair=!0)},YAMLScalar(e){i&&("folded"===e.style||"literal"===e.style)&&(i.hasBlockLiteralOrFolded=!0)},"YAMLSequence:exit":o,"YAMLMapping:exit"(t){var n,s,l;let a=i;if(o(),0===t.pairs.length)return;let c=t.loc.start.line<t.loc.end.line?r.multiline:r.singleline;if("ignore"!==c){if("flow"===t.style){if("never"===c||ib(t))return;let r=function(e,t){if(e.hasNullPair||e.hasBlockLiteralOrFolded||e.withinFlowStyle)return!1;for(let e of t.pairs){let t=e.key;if(t.loc.start.line<t.loc.end.line)return!1}return!0}(a,t)&&!iu(e);e.report({loc:t.loc,messageId:"required",fix:r&&(n=t,s=e,function*(e){let t=s.sourceCode,r=t.getFirstToken(n),i=t.getLastToken(n);if(r?.value!=="{"||i?.value!=="}")return;let o=function(e,t){let n=t.sourceCode,r=e.parent;if("YAMLWithMeta"===r.type){let i=n.getTokenBefore(r);if(null==i||i.loc.end.line<r.loc.start.line)return ip(r,e.pairs[0],t);r=r.parent}if("YAMLDocument"===r.type){let n=id(e,t),r=id(e.pairs[0],t);return null==n||null!=r&&0>iy(n,r)?r:n}if("YAMLSequence"===r.type){let r=n.getTokenBefore(e);if(!ii(r))return null;if(r.loc.start.line===e.loc.start.line){let i=id(r,t);return null==i?null:`${i} ${n.text.slice(r.range[1],e.range[0])}`}return id(e,t)}return"YAMLPair"!==r.type?null:ip(r,e.pairs[0],t)}(n,s);if(null==o)return;let l=t.getTokenBefore(r,{includeComments:!0});l?l.loc.end.line<r.loc.start.line?yield e.removeRange([l.range[1],r.range[1]]):yield e.remove(r):yield e.removeRange([t.ast.range[0],r.range[1]]);let a=r;for(let r of n.pairs){let n=t.getTokenBefore(r,{includeComments:!0,filter:e=>!io(e)});yield*c(a,n),yield e.replaceTextRange([n.range[1],r.range[0]],`
|
|
@@ -36,4 +36,4 @@ ${n}`)}});else{let n=o.consistent,r=!it(l,c),i=!it(u,a);if((!n&&r||n&&r&&!i)&&e.
|
|
|
36
36
|
${n}`)}}),it(h,u)&&e.report({node:n,loc:u.loc,messageId:"missingClosingLinebreak",fix(t){if(iu(e))return null;let n=ih(u.loc.start.line,e);return t.insertTextBefore(u,`
|
|
37
37
|
${n}`)}})):(it(c,d)||e.report({node:n,loc:c.loc,messageId:"unexpectedOpeningLinebreak",fix(n){if(iu(e))return null;let r=t.getTokenAfter(c,{includeComments:!0});return ie(r)?null:n.removeRange([c.range[1],r.range[0]])}}),it(h,u)||e.report({node:n,loc:u.loc,messageId:"unexpectedClosingLinebreak",fix(n){if(iu(e))return null;let r=t.getTokenBefore(u,{includeComments:!0});return ie(r)?null:n.removeRange([r.range[1],u.range[0]])}}))}(n)}}:{}}}),iI=r7("flow-sequence-bracket-spacing",{meta:{docs:{description:"enforce consistent spacing inside flow sequence brackets",categories:["standard"],extensionRule:"array-bracket-spacing",layout:!0},type:"layout",fixable:"whitespace",schema:[{type:"string",enum:["always","never"]},{type:"object",properties:{singleValue:{type:"boolean"},objectsInArrays:{type:"boolean"},arraysInArrays:{type:"boolean"}},additionalProperties:!1}],messages:{unexpectedSpaceAfter:"There should be no space after '{{tokenValue}}'.",unexpectedSpaceBefore:"There should be no space before '{{tokenValue}}'.",missingSpaceAfter:"A space is required after '{{tokenValue}}'.",missingSpaceBefore:"A space is required before '{{tokenValue}}'."}},create(e){let t=e.sourceCode;if(!t.parserServices?.isYAML)return{};let n="always"===e.options[0];function r(t){return!!e.options[1]&&!n===e.options[1][t]}let i={spaced:n,singleElementException:r("singleValue"),objectsInArraysException:r("objectsInArrays"),arraysInArraysException:r("arraysInArrays"),isOpeningBracketMustBeSpaced(e){if(i.singleElementException&&1===e.entries.length)return!i.spaced;let t=e.entries[0];return t&&(i.objectsInArraysException&&s(t)||i.arraysInArraysException&&o(t))?!i.spaced:i.spaced},isClosingBracketMustBeSpaced(e){if(i.singleElementException&&1===e.entries.length)return!i.spaced;let t=e.entries[e.entries.length-1];return t&&(i.objectsInArraysException&&s(t)||i.arraysInArraysException&&o(t))?!i.spaced:i.spaced}};function s(e){return e&&"YAMLMapping"===e.type}function o(e){return e&&"YAMLSequence"===e.type}return{YAMLSequence(n){"flow"===n.style&&function(n){if(i.spaced&&0===n.entries.length)return;let r=t.getFirstToken(n),s=t.getLastToken(n),o=t.getTokenAfter(r,{includeComments:!0}),l=t.getTokenBefore(s,{includeComments:!0});if(it(r,o))if(i.isOpeningBracketMustBeSpaced(n))t.isSpaceBetween(r,o)||e.report({node:n,loc:r.loc,messageId:"missingSpaceAfter",data:{tokenValue:r.value},fix:e=>e.insertTextAfter(r," ")});else{let i;t.isSpaceBetween(r,o)&&(i=t.getTokenAfter(r),e.report({node:n,loc:{start:r.loc.end,end:i.loc.start},messageId:"unexpectedSpaceAfter",data:{tokenValue:r.value},fix:e=>e.removeRange([r.range[1],i.range[0]])}))}if(r!==l&&it(l,s))if(i.isClosingBracketMustBeSpaced(n))t.isSpaceBetween(l,s)||e.report({node:n,loc:s.loc,messageId:"missingSpaceBefore",data:{tokenValue:s.value},fix:e=>e.insertTextBefore(s," ")});else{let r;t.isSpaceBetween(l,s)&&(r=t.getTokenBefore(s),e.report({node:n,loc:{start:r.loc.end,end:s.loc.start},messageId:"unexpectedSpaceBefore",data:{tokenValue:s.value},fix:e=>e.removeRange([r.range[1],s.range[0]])}))}}(n)}}}});let iO=Object.freeze({includeComments:!0});var iP=r7("indent",{meta:{docs:{description:"enforce consistent indentation",categories:["standard"],extensionRule:!1,layout:!0},fixable:"whitespace",schema:[{type:"integer",minimum:2},{type:"object",properties:{indentBlockSequences:{type:"boolean"},indicatorValueIndent:{type:"integer",minimum:2},alignMultilineFlowScalars:{type:"boolean"}},additionalProperties:!1}],messages:{wrongIndentation:"Expected indentation of {{expected}} spaces but found {{actual}} spaces."},type:"layout"},create(e){let t=e.sourceCode;if(!t.parserServices?.isYAML||iu(e))return{};let{numOfIndent:n,indentBlockSequences:r,indicatorValueIndent:i,alignMultilineFlowScalars:s}=function(e){let[t,n]=e.options,r=im(e,t),i=!0,s=r,o=!1;return n&&(!1===n.indentBlockSequences&&(i=!1),null!=n.indicatorValueIndent&&(s=n.indicatorValueIndent),null!=n.alignMultilineFlowScalars&&(o=n.alignMultilineFlowScalars)),{numOfIndent:r,indentBlockSequences:i,indicatorValueIndent:s,alignMultilineFlowScalars:o}}(e),o=new Map,l=new Set,a=new Set,c=new Map;function u(e,t,r,i){f(e,t*n,r,i&&{indentWhenBaseIsNotFirst:i.offsetWhenBaseIsNotFirst&&i.offsetWhenBaseIsNotFirst*n})}function f(e,t,n,r){if(null!=e)if(Array.isArray(e))for(let i of e)f(i,t,n,r);else o.set(e,{baseToken:n,indent:t,indentWhenBaseIsNotFirst:r?.indentWhenBaseIsNotFirst??null})}function p(e,n,r,i){let s=n,o=new Set;for(let n of e){if(null==n)continue;let e={firstToken:t.getFirstToken(n),lastToken:t.getLastToken(n)},r=s;for(;null!=(r=t.getTokenAfter(r,iO))&&r.range[1]<=e.firstToken.range[0];)o.add(r);o.add(e.firstToken),s=e.lastToken}if(null!=r){let e=s;for(;null!=(e=t.getTokenAfter(e,iO))&&e.range[1]<=r.range[0];)o.add(e)}o.delete(n),u([...o],i,n),null!=r&&u(r,0,n)}function d(e,t){return r?t:"YAMLSequence"===e.type&&"block"===e.style?0:t}function h(e){let n=t.getTokenBefore(e,e=>!l.has(e));return!n||n.loc.end.line<e.loc.start.line}let g=[];return{YAMLDocument(e){g.push(e);let n=t.getFirstToken(e,iO);n&&(o.set(n,{baseToken:null,indentWhenBaseIsNotFirst:null,indent:0,expectedIndent:0}),p([...e.directives,e.content],n,null,0))},YAMLMapping(e){if("flow"===e.style){let n=t.getFirstToken(e),r=t.getLastToken(e);p(e.pairs,n,r,1)}else if("block"===e.style){let n=t.getFirstToken(e);p(e.pairs,n,null,0)}},YAMLSequence(e){if("flow"===e.style){let n=t.getFirstToken(e),r=t.getLastToken(e);p(e.entries,n,r,1)}else if("block"===e.style){let r=t.getFirstToken(e);for(let s of(p(e.entries,r,null,0),e.entries)){if(!s)continue;let e=t.getTokenBefore(s,ii);l.add(e),f(t.getFirstToken(s),h(e)?i:n,e)}}},YAMLPair(e){let r=t.getFirstToken(e),s=e.key&&t.getFirstToken(e.key),o=function(){if(e.value)return t.getTokenBefore(e.value,is);if(e.key){let n=t.getTokenAfter(e.key,is);if(n&&n.range[0]<e.range[1])return n}let n=t.getTokens(e,is);return n.length?n[0]:null}(),a=ir(r)?r:null;if(a&&(l.add(a),e.key&&f(s,d(e.key,h(a)?i:n),a)),o&&(l.add(o),a?u(o,0,a,{offsetWhenBaseIsNotFirst:1}):s&&u(o,1,s)),e.value){let r=t.getFirstToken(e.value);o?f(r,d(e.value,h(o)?i:n),o):s&&u(r,1,s)}},YAMLWithMeta(e){let n,r=e.anchor&&t.getFirstToken(e.anchor),i=e.tag&&t.getFirstToken(e.tag);r&&i?r.range[0]<i.range[0]?(u(i,0,r,{offsetWhenBaseIsNotFirst:1}),n=r):(u(r,0,i,{offsetWhenBaseIsNotFirst:1}),n=i):n=r||i,e.value&&u(t.getFirstToken(e.value),1,n)},YAMLScalar(e){if("folded"===e.style||"literal"===e.style){if(!e.value.trim())return;let n=t.getFirstToken(e),r=t.getLastToken(e);u(r,1,n),c.set(r,e),a.add(n)}else c.set(t.getFirstToken(e),e)},"Program:exit"(t){let r=[],i=[];for(let e of[...t.comments,...t.tokens].sort((e,t)=>e.range[0]-t.range[0]))if(0===i.length||i[0].loc.start.line===e.loc.start.line)i.push(e);else{let t=m(i);r[t.line]=t,i=[e]}if(i.length>=1){let e=m(i);r[e.line]=e}var o=function(e){let t=[],r=[];for(let n of e){if(!n)continue;let e=n.line;if("Block"===n.firstToken.type){let t=r[r.length-1];t&&t.range[1]===e-1?(t.range[1]=e,t.commentLineIndents.push(n)):r.push({range:[e,e],commentLineIndents:[n]})}else if(null!=n.expectedIndent){let r={line:e,expectedIndent:n.expectedIndent,actualIndent:n.actualIndent,indicatorData:n.indicatorData};if(t[e]||(t[e]=r),n.lastScalar){let e=n.lastScalar.node;if("literal"===e.style||"folded"===e.style)!function(e,n,r){if(null!=n.indent){if(e.expectedIndent<e.actualIndent){e.expectedIndent=e.actualIndent;return}e.indentBlockScalar={node:n}}let i=e.actualIndent;for(let s=e.line+1;s<=n.loc.end.line;s++){let e=k(s);null!=e&&(t[s]={line:s,expectedIndent:r,actualIndent:Math.min(i,e),indicatorData:[]})}}(r,e,n.lastScalar.expectedIndent);else{let i=n.lastScalar.expectedIndent;s&&!h(n.lastScalar.token)&&(i=n.lastScalar.node.loc.start.column),function(e,n,r){for(let i=e.line+1;i<=n.loc.end.line;i++){let e=k(i);null!=e&&(t[i]={line:i,expectedIndent:r,actualIndent:e,indicatorData:[]})}}(r,e,i)}}}}return function(e,r){for(let{range:i,commentLineIndents:s}of e){let e,o=t.slice(0,i[0]).filter(e=>e).pop(),l=t.slice(i[1]+1).filter(e=>e).shift();(function(e){if(!e)return!1;for(let t=e.line;t>=0;t--){let t=r[e.line];if(t){if(t.lastScalar){let n=t.lastScalar.node;if(("literal"===n.style||"folded"===n.style)&&n.loc.start.line<=e.line&&e.line<=n.loc.end.line)return!0}break}}return!1})(o)&&(o=void 0);let a=[];if(o&&l){if(a.unshift(l.expectedIndent),l.expectedIndent<o.expectedIndent){let e=l.expectedIndent+n;for(;e<=o.expectedIndent;)a.unshift(e),e+=n}}else if((e=o||l)&&(a.unshift(e.expectedIndent),!l)){let t=e.expectedIndent-n;for(;t>=0;)a.push(t),t-=n}if(!a.length)continue;let c=a[0];for(let e of s)t[e.line]||(c=Math.min(a.find((t,n)=>t<=e.actualIndent||(a[n+1]??-1)<e.actualIndent&&e.actualIndent<t)??c,c),t[e.line]={line:e.line,expectedIndent:c,actualIndent:e.actualIndent,indicatorData:e.indicatorData})}}(r,e),t}(r);for(let t of o)if(t){if(t.actualIndent!==t.expectedIndent)e.report({loc:{start:{line:t.line,column:0},end:{line:t.line,column:t.actualIndent}},messageId:"wrongIndentation",data:{expected:String(t.expectedIndent),actual:String(t.actualIndent)},fix:b(t,o)});else if(t.indicatorData.length){for(let n of t.indicatorData)if(n.actualOffset!==n.expectedOffset){let r=n.indicator.loc.end,i=n.next.loc.start;e.report({loc:{start:r,end:i},messageId:"wrongIndentation",data:{expected:String(n.expectedOffset),actual:String(n.actualOffset)},fix:b(t,o)})}}}}};function m(e){let t=e[e.length-1],n=null,r=null,i=[],s=e.shift(),u=s,f=y(u);for(null!=f&&(n=f,r=f);u&&l.has(u)&&null!=f;){let t=e.shift();if(!t)break;let n=y(t);if(null==n||f>=n||(i.push({indicator:u,next:t,expectedOffset:n-f-1,actualOffset:t.range[0]-u.range[1]}),a.has(t))){e.unshift(t);break}u=t,r=f=n}if(null==n)for(;null!=(u=e.shift())&&null==(n=y(u)););let p=c.get(t);if(p&&e.pop(),null!=r)for(;null!=(u=e.shift());){let e=o.get(u);e&&(e.expectedIndent=r)}let d=null;if(p){let e=y(t);null!=e&&(d={expectedIndent:e,token:t,node:p})}let{line:h,column:g}=s.loc.start;return{expectedIndent:n,actualIndent:g,firstToken:s,line:h,indicatorData:i,lastScalar:d}}function y(e){if("Marker"===e.type)return 0;let n=o.get(e);if(!n)return null;if(null!=n.expectedIndent)return n.expectedIndent;if(null==n.baseToken)return null;let r=y(n.baseToken);if(null==r)return null;let i=n.indent;if(0===i&&null!=n.indentWhenBaseIsNotFirst){let e=n.baseToken;for(;null!=(e=t.getTokenBefore(e,iO))&&l.has(e););e?.loc.end.line===n.baseToken.loc.start.line&&(i=n.indentWhenBaseIsNotFirst)}return n.expectedIndent=r+i}function b(e,n){let{line:r,expectedIndent:i}=e,s=g.find(e=>e.loc.start.line<=r&&r<=e.loc.end.line)||t.ast,o=s.loc.start.line,l=s.loc.end.line;for(let e=r-1;e>=s.loc.start.line;e--){let t=n[e];if(t&&t.expectedIndent<i){if(i<=t.actualIndent)return null;for(let e of t.indicatorData)if(e.actualOffset!==e.expectedOffset)return null;o=e+1;break}}for(let e=r+1;e<=s.loc.end.line;e++){let t=n[e];if(t&&t&&t.expectedIndent<i){if(i<=t.actualIndent)return null;l=e-1;break}}for(let e=o;e<=l;e++){let r=n[e];if(r?.indentBlockScalar){let e=r.indentBlockScalar.node,n=r.expectedIndent-r.actualIndent,i=t.getFirstToken(e),s=/\d+/u.exec(i.value)?.[0];if(null!=s&&Number(s)+n>=10)return null}}return function*(e){for(let r=o;r<=l;r++){let i=n[r];if(i&&(i.expectedIndent,i.expectedIndent!==i.actualIndent&&(yield*function*(e,n){if(n.indentBlockScalar){let r=n.indentBlockScalar.node,i=n.expectedIndent-n.actualIndent,s=t.getFirstToken(r);yield e.replaceText(s,s.value.replace(/\d+/u,e=>`${Number(e)+i}`))}let r=n.expectedIndent;yield e.replaceTextRange([t.getIndexFromLoc({line:n.line,column:0}),t.getIndexFromLoc({line:n.line,column:n.actualIndent})]," ".repeat(r))}(e,i)),i.indicatorData))for(let t of i.indicatorData)yield e.replaceTextRange([t.indicator.range[1],t.next.range[0]]," ".repeat(t.expectedOffset))}}}function k(e){let n=t.lines[e-1];return n.length?/^\s*/u.exec(n)[0].length:null}}});let iB=["camelCase","kebab-case","PascalCase","snake_case","SCREAMING_SNAKE_CASE"];function i$(e){return/[\u0021-\u0023\u0025-\u002c./\u003a-\u0040\u005b-\u005e`\u007b-\u007d]/u.test(e)}function iq(e){return/[A-Z]/u.test(e)}function iY(e){return!(i$(e)||/^[a-z]/u.test(e)||/[\s\-_]/u.test(e))}let ij={"kebab-case":function(e){return!(iq(e)||i$(e)||e.startsWith("-")||/_|--|\s/u.test(e))},snake_case:function(e){return!(iq(e)||i$(e)||/-|__|\s/u.test(e))},SCREAMING_SNAKE_CASE:function(e){return!(/[a-z]/u.test(e)||i$(e)||/-|__|\s/u.test(e))},camelCase:function(e){return!(i$(e)||/^[A-Z]/u.test(e)||/[\s\-_]/u.test(e))},PascalCase:iY};function iF(e){return ij[e]||iY}var iD=r7("key-name-casing",{meta:{docs:{description:"enforce naming convention to key names",categories:null,extensionRule:!1,layout:!1},schema:[{type:"object",properties:{camelCase:{type:"boolean",default:!0},PascalCase:{type:"boolean",default:!1},SCREAMING_SNAKE_CASE:{type:"boolean",default:!1},"kebab-case":{type:"boolean",default:!1},snake_case:{type:"boolean",default:!1},ignores:{type:"array",items:{type:"string"},uniqueItems:!0,additionalItems:!1}},additionalProperties:!1}],messages:{doesNotMatchFormat:"Key name `{{name}}` must match one of the following formats: {{formats}}"},type:"suggestion"},create(e){if(!e.sourceCode.parserServices?.isYAML)return{};let t={...e.options[0]};!1!==t.camelCase&&(t.camelCase=!0);let n=t.ignores?t.ignores.map(e=>new RegExp(e)):[],r=Object.keys(t).filter(e=>iB.includes(e)).filter(e=>t[e]),i=r.map(iF);return{YAMLPair(t){if(!t.key)return;let s=String(nz(t.key));n.some(e=>e.test(s))||!i.length||i.some(e=>e(s))||e.report({loc:t.key.loc,messageId:"doesNotMatchFormat",data:{name:s,formats:r.join(", ")}})}}}});function i_(e){return/[\n\r\u2028\u2029]/u.test(e)}function iR(e){return e[e.length-1]}function iK(e){return e.loc.end.line===e.loc.start.line}function iU(e){let t,n,r,i=e.mode||"strict";return t=void 0!==e.beforeColon&&e.beforeColon,n=void 0===e.afterColon||e.afterColon,void 0!==e.align&&(r="object"==typeof e.align?e.align:{on:e.align,mode:i,beforeColon:t,afterColon:n}),{mode:i,beforeColon:t,afterColon:n,align:r}}let iV={enum:["colon","value"]},iW={type:"object",properties:{mode:{enum:["strict","minimum"]},beforeColon:{type:"boolean"},afterColon:{type:"boolean"}},additionalProperties:!1},iJ={type:"object",properties:{on:iV,...iW.properties},additionalProperties:!1};var iz=r7("key-spacing",{meta:{docs:{description:"enforce consistent spacing between keys and values in mapping pairs",categories:["standard"],extensionRule:"key-spacing",layout:!0},fixable:"whitespace",schema:[{anyOf:[{type:"object",properties:{align:{anyOf:[iV,iJ]},...iW.properties},additionalProperties:!1},{type:"object",properties:{singleLine:iW,multiLine:{type:"object",properties:{align:{anyOf:[iV,iJ]},...iW.properties},additionalProperties:!1}},additionalProperties:!1},{type:"object",properties:{singleLine:iW,multiLine:iW,align:iJ},additionalProperties:!1}]}],messages:{extraKey:"Extra space after key '{{key}}'.",extraValue:"Extra space before value for key '{{key}}'.",missingKey:"Missing space after key '{{key}}'.",missingValue:"Missing space before value for key '{{key}}'."},type:"layout"},create:function(e){var t,n;let r,i,s,o=e.sourceCode;if(!o.parserServices?.isYAML)return{};let{multiLine:l,singleLine:a,align:c}=("object"==typeof(t=e.options[0]||{}).align?(r={...iU(t.align),on:t.align.on||"colon",mode:t.align.mode||"strict"},i=iU(t.multiLine||t),s=iU(t.singleLine||t)):(i=iU(t.multiLine||t),s=iU(t.singleLine||t),i.align&&(r={on:i.align.on,mode:i.align.mode||i.mode,beforeColon:i.align.beforeColon,afterColon:i.align.afterColon})),{align:r,multiLine:i,singleLine:s});function u(e){return null!=e.key&&null!=e.value}function f(t,n,r,i,s){var l,a;let c,u=r.length-i,f=(l=t.key,o.getTokenAfter(l,is)),p=o.getTokenBefore(f,{includeComments:!0}),d=o.getTokenAfter(f,{includeComments:!0});if(!(("strict"===s?0!==u:u<0||u>0&&0===i)&&!(i&&i_(r))))return;if("value"===n&&ir(o.getTokenBefore(t.key))&&t.key.loc.end.line<t.value.loc.start.line||0===i&&!function(e,t,n){if("key"===t){if("YAMLAlias"===e.key.type||"YAMLWithMeta"===e.key.type&&null==e.key.value||"block"===e.parent.style&&i_(n)&&ir(o.getTokenBefore(e.key)))return!1}else{if("block"===e.parent.style&&("YAMLSequence"!==e.parent.parent.type||"flow"!==e.parent.parent.style))return!1;let t="YAMLWithMeta"===e.key.type?e.key.value:e.key;if(!t||"YAMLScalar"===t.type&&"plain"===t.style||"YAMLAlias"===t.type||"YAMLSequence"===e.value.type&&"block"===e.value.style||i_(n)&&"YAMLMapping"===e.value.type&&"block"===e.value.style)return!1}return!0}(t,n,r)||0===r.length&&(a=t,"key"===n&&"YAMLScalar"===a.key.type&&("plain"===a.key.style&&"string"==typeof a.key.value&&a.key.value.endsWith(":")||"folded"===a.key.style||"literal"===a.key.style)||0))return;let{locStart:h,locEnd:g,missingLoc:m}="key"===n?{locStart:p.loc.end,locEnd:f.loc.start,missingLoc:p.loc}:{locStart:f.loc.start,locEnd:d.loc.start,missingLoc:d.loc},{loc:y,messageId:b}=u>0?{loc:{start:h,end:g},messageId:"key"===n?"extraKey":"extraValue"}:{loc:m,messageId:"key"===n?"missingKey":"missingValue"};e.report({node:t[n],loc:y,messageId:b,data:{key:"YAMLScalar"!==(c=t.key).type?o.getText().slice(c.range[0],c.range[1]):String(c.value)},fix(e){if(u>0)return"key"===n?e.removeRange([p.range[1],p.range[1]+u]):e.removeRange([d.range[0]-u,d.range[0]]);let t=" ".repeat(-u);return"key"===n?e.insertTextAfter(p,t):e.insertTextBefore(d,t)}})}function p(e){var t;let n,r=o.getFirstToken(e);return(t=e.key,n=o.getTokenAfter(t,is),o.getTokenBefore(n)).range[1]-r.range[0]}function d(e){let t=/(\s*):(\s*)/u.exec(o.getText().slice(e.key.range[1],e.value.range[0]));return t?{beforeColon:t[1],afterColon:t[2]}:null}function h(e,t){let n=d(e);n&&(f(e,"key",n.beforeColon,+!!t.beforeColon,t.mode),f(e,"value",n.afterColon,+!!t.afterColon,t.mode))}function g(e,t){let n=e.length;for(let r=0;r<n;r++)h(e[r],t)}return c?(n=c,{YAMLMapping(e){iK(e)?g(e.pairs.filter(u),a):function(e){(1===e.pairs.length?[e.pairs]:e.pairs.reduce((e,t)=>{let n=iR(e),r=iR(n);return!r||function(e,t){let n=e.loc.start.line,r=t.loc.start.line;if(r-n<=1)return!0;let i=o.getCommentsBefore(t);if(i.length&&i[0].loc.start.line-n<=1&&r-iR(i).loc.end.line<=1){for(let e=1;e<i.length;e++)if(i[e].loc.start.line-i[e-1].loc.end.line>1)return!1;return!0}return!1}(r,t)?n.push(t):e.push([t]),e},[[]])).forEach(e=>{let t=e.filter(u);t.length>0&&function(e){let[t]=e,n=iR(e);return t.loc.start.line===n.loc.end.line}(t)?g(t,l):function(e){let t,r,i,s=e.length,o=e.map(p),a=n.on,c=Math.max(...o);n&&s>1?(t=+!!n.beforeColon,r=+!!n.afterColon):(t=+!!l.beforeColon,r=+!!l.afterColon),i=n.mode,c+="colon"===a?t:r;for(let n=0;n<s;n++){let s=e[n],l=d(s);if(l){let e=o[n];"value"===a?(f(s,"key",l.beforeColon,t,i),f(s,"value",l.afterColon,c-e,i)):(f(s,"key",l.beforeColon,c-e,i),f(s,"value",l.afterColon,r,i))}}}(t)})}(e)}}):{YAMLPair(e){u(e)&&h(e,iK(e.parent)?a:l)}}}}),iG=r7("no-empty-document",{meta:{docs:{description:"disallow empty document",categories:["recommended","standard"],extensionRule:!1,layout:!1},schema:[],messages:{unexpectedEmpty:"Empty documents are forbidden."},type:"suggestion"},create:e=>e.sourceCode.parserServices?.isYAML?{YAMLDocument(t){(function e(t){return!t||"YAMLWithMeta"===t.type&&e(t.value)})(t.content)&&e.report({node:t,messageId:"unexpectedEmpty"})}}:{}}),iQ=r7("no-empty-key",{meta:{docs:{description:"disallow empty mapping keys",categories:["recommended","standard"],extensionRule:!1,layout:!1},schema:[],messages:{unexpectedEmpty:"Empty mapping keys are forbidden."},type:"suggestion"},create:e=>e.sourceCode.parserServices?.isYAML?{YAMLPair(t){(function e(t){return!t||"YAMLWithMeta"===t.type&&e(t.value)})(t.key)&&e.report({node:t,messageId:"unexpectedEmpty"})}}:{}}),iX=r7("no-empty-mapping-value",{meta:{docs:{description:"disallow empty mapping values",categories:["recommended","standard"],extensionRule:!1,layout:!1},schema:[],messages:{unexpectedEmpty:"Empty mapping values are forbidden."},type:"suggestion"},create:e=>e.sourceCode.parserServices?.isYAML?{YAMLPair(t){(function e(t){return!t||"YAMLWithMeta"===t.type&&e(t.value)})(t.value)&&e.report({node:t,messageId:"unexpectedEmpty"})}}:{}}),iH=r7("no-empty-sequence-entry",{meta:{docs:{description:"disallow empty sequence entries",categories:["recommended","standard"],extensionRule:!1,layout:!1},schema:[],messages:{unexpectedEmpty:"Empty sequence entries are forbidden."},type:"suggestion"},create(e){let t=e.sourceCode;return t.parserServices?.isYAML?{YAMLSequence(n){"block"===n.style&&n.entries.forEach((r,i)=>{(function e(t){return!t||"YAMLWithMeta"===t.type&&e(t.value)})(r)&&e.report({node:function e(n,r){if(0===r){let e=t.getFirstToken(n);return ii(e)?e:null}let i=n.entries[r-1];if(i){let e=t.getTokenAfter(i);return ii(e)?e:null}let s=e(n,r-1);if(s){let e=t.getTokenAfter(s);return ii(e)?e:null}return null}(n,i)||n,messageId:"unexpectedEmpty"})})}}:{}}});let iZ=/[\v\f\u0085\u00a0\u1680\u180e\u2000-\u200b\u2028\u2029\u202f\u205f\u3000\ufeff]/u,i0=/[\v\f\u0085\u00a0\u1680\u180e\u2000-\u200b\u202f\u205f\u3000\ufeff]+/gu,i1=/[\u2028\u2029]/gu;var i2=r7("no-irregular-whitespace",{meta:{docs:{description:"disallow irregular whitespace",categories:["recommended","standard"],extensionRule:"no-irregular-whitespace",layout:!1},schema:[{type:"object",properties:{skipComments:{type:"boolean",default:!1},skipQuotedScalars:{type:"boolean",default:!0}},additionalProperties:!1}],messages:{disallow:"Irregular whitespace not allowed."},type:"problem"},create(e){let t,n=e.sourceCode;if(!n.parserServices?.isYAML)return{};let r=[],i=e.options[0]||{},s=!!i.skipComments,o=!1!==i.skipQuotedScalars;function l(e){let[t,n]=e.range;r=r.filter(e=>e<t||n<=e)}function a(e){iZ.test(e.value)&&l(e)}let c=n.getText();for(;null!==(t=i0.exec(c));)r.push(t.index);for(;null!==(t=i1.exec(c));)r.push(t.index);return r.length?{YAMLScalar:function(e){o&&("double-quoted"===e.style||"single-quoted"===e.style)&&iZ.test(n.getText(e))&&l(e)},"Program:exit"(){for(let t of(s&&n.getAllComments().forEach(a),r))e.report({loc:n.getLocFromIndex(t),messageId:"disallow"})}}:{}}}),i9=r7("no-multiple-empty-lines",{meta:{docs:{description:"disallow multiple empty lines",categories:["standard"],extensionRule:"no-multiple-empty-lines",layout:!0},fixable:"whitespace",schema:[{type:"object",properties:{max:{type:"integer",minimum:0},maxEOF:{type:"integer",minimum:0},maxBOF:{type:"integer",minimum:0}},required:["max"],additionalProperties:!1}],messages:{blankBeginningOfFile:"Too many blank lines at the beginning of file. Max of {{max}} allowed.",blankEndOfFile:"Too many blank lines at the end of file. Max of {{max}} allowed.",consecutiveBlank:"More than {{max}} blank {{pluralizedLines}} not allowed."},type:"layout"},create(e){let t=e.sourceCode;if(!t.parserServices?.isYAML)return{};let n=e.options[0]?.max??2,r={max:n,maxEOF:e.options[0]?.maxEOF??n,maxBOF:e.options[0]?.maxBOF??n},i=[...t.lines];""===i[i.length-1]&&i.pop();let s=new Set;function o(n,s){let o,l;0===n?(o="blankBeginningOfFile",l=r.maxBOF):s===i.length?(o="blankEndOfFile",l=r.maxEOF):(o="consecutiveBlank",l=r.max),s-n>l&&e.report({loc:{start:{line:n+l+1,column:0},end:{line:s+1,column:0}},messageId:o,data:{max:String(l),pluralizedLines:1===l?"line":"lines"},fix(e){let r=t.getIndexFromLoc({line:n+l+1,column:0}),o=s<i.length?t.getIndexFromLoc({line:s+1,column:0}):t.text.length;return e.removeRange([r,o])}})}return{YAMLScalar(e){for(let t=e.loc.start.line-1;t<e.loc.end.line;t++)s.add(t)},"Program:exit"(){let e=null;for(let t=0;t<i.length;t++)i[t].trim()||s.has(t)?(null!=e&&o(e,t),e=null):e??=t;null!=e&&o(e,i.length)}}}}),i8=r7("no-tab-indent",{meta:{docs:{description:"disallow tabs for indentation.",categories:["recommended","standard"],extensionRule:!1,layout:!1},schema:[],messages:{disallow:"Unexpected tabs."},type:"problem"},create(e){let t=e.sourceCode;return t.parserServices?.isYAML?{Program(){let n=t.lines;for(let t=0;t<n.length;t++){let r=n[t],i=/^([^\S\t]*(?:-[^\S\t]+)?)\t+/u.exec(r);i&&e.report({loc:{start:{line:t+1,column:i[1].length},end:{line:t+1,column:i[0].length}},messageId:"disallow"})}}}:{}}}),i6=r7("no-trailing-zeros",{meta:{docs:{description:"disallow trailing zeros for floats",categories:["standard"],extensionRule:!1,layout:!0},fixable:"code",schema:[],messages:{wrongZeros:"Trailing zeros are not allowed, fix to `{{fixed}}`."},type:"layout"},create:e=>e.sourceCode.parserServices?.isYAML?{YAMLScalar(t){if("plain"!==t.style||"number"!=typeof t.value)return;let n=function(e){let t,n,r,i,s=e.split(".");if(2!==s.length)return null;let o=s[1].search(/e/iu);return o>=0?(t=s[1].slice(0,o),n=s[1].slice(o)):(t=s[1],n=""),s[0].startsWith("-")||s[0].startsWith("+")?(i=s[0][0],r=s[0].slice(1)):(i="",r=s[0]),{sign:i,intPart:r,decimalPart:t,expPart:n}}(t.strValue);if(!n)return;let{decimalPart:r}=n;for(;r.endsWith("_");)r=r.slice(0,-1);if(!r.endsWith("0"))return;for(;r.endsWith("0");)for(r=r.slice(0,-1);r.endsWith("_");)r=r.slice(0,-1);let i=r?`${n.sign}${n.intPart}.${r}${n.expPart}`:`${n.sign}${n.intPart||"0"}${n.expPart}`;e.report({node:t,messageId:"wrongZeros",data:{fixed:i},fix:e=>e.replaceText(t,i)})}}:{}});let i3=new Set([":","{","}","[","]",",","&","*","#","|","+","%",'"',"'","\\"]);function i4(e){return e.map(e=>RegExp(e,"u"))}var i5=r7("plain-scalar",{meta:{docs:{description:"require or disallow plain style scalar.",categories:["standard"],extensionRule:!1,layout:!1},fixable:"code",schema:[{enum:["always","never"]},{type:"object",properties:{ignorePatterns:{type:"array",items:{type:"string"}},overrides:{type:"object",properties:{mappingKey:{enum:["always","never",null]}},additionalProperties:!1}},additionalProperties:!1}],messages:{required:"Must use plain style scalar.",disallow:"Must use quoted style scalar."},type:"layout"},create(e){let t,n=e.sourceCode;if(!n.parserServices?.isYAML)return{};let r={prefer:e.options[0]||"always",ignorePatterns:[]},i=e.options[1]?.overrides?.mappingKey,s=i?{prefer:i,ignorePatterns:[]}:r;return e.options[1]?.ignorePatterns?r.ignorePatterns=i4(e.options[1]?.ignorePatterns):("always"===r.prefer&&(r.ignorePatterns=i4([String.raw`[\v\f\u0085\u00a0\u1680\u180e\u2000-\u200b\u2028\u2029\u202f\u205f\u3000\ufeff]`])),i&&"always"===s.prefer&&(s.ignorePatterns=i4([String.raw`[\v\f\u0085\u00a0\u1680\u180e\u2000-\u200b\u2028\u2029\u202f\u205f\u3000\ufeff]`]))),{YAMLDocument(e){t=e},YAMLScalar(i){if("string"!=typeof i.value)return;let o=!function e(t){let n=t.parent;if("YAMLPair"===n.type&&n.key===t)return!0;let r=n.parent;return"YAMLWithMeta"===r.type&&e(r)}(i)?r:s;o.ignorePatterns.some(e=>e.test(i.value))||("always"===o.prefer?function(r){if(("double-quoted"===r.style||"single-quoted"===r.style)&&function(e){if(e.value!==e.value.trim())return!1;for(let t=0;t<e.value.length;t++){let n=e.value[t];if(i3.has(n))return!1;if(0===t){if("-"===n||"?"===n){let n=e.value[t+1];if(n&&!n.trim())return!1}else if("!"===n){let n=e.value[t+1];if(n&&(!n.trim()||"!"===n||"<"===n))return!1}}}let t="YAMLWithMeta"===e.parent.type?e.parent.parent:e.parent;if("YAMLPair"===t.type&&t.key===e){let t=n.getTokenAfter(e);if(t&&":"===t.value){let e=n.getTokenAfter(t);if(t.range[1]===e?.range[0])return!1}}return!0}(r)){try{if(nz(rN(r.value,{defaultYAMLVersion:t?.version}).ast)!==r.value)return}catch{return}e.report({node:r,messageId:"required",fix:e=>e.replaceText(r,r.value)})}}(i):function(t){if("plain"!==t.style)return;let n=t.value;e.report({node:t,messageId:"disallow",fix:e=>e.replaceText(t,`"${n.replace(/(["\\])/gu,"\\$1").replace(/\r?\n|[\u2028\u2029]/gu,"\\n")}"`)})}(i))}}}}),i7=r7("quotes",{meta:{docs:{description:"enforce the consistent use of either double, or single quotes",categories:["standard"],extensionRule:!1,layout:!0},fixable:"code",schema:[{type:"object",properties:{prefer:{enum:["double","single"]},avoidEscape:{type:"boolean"}},additionalProperties:!1}],messages:{wrongQuotes:"Strings must use {{description}}."},type:"layout"},create(e){if(!e.sourceCode.parserServices?.isYAML)return{};let t=e.options[0]||{},n=t.prefer||"double",r=!1!==t.avoidEscape;return{YAMLScalar(t){let i;if("double-quoted"===t.style&&"single"===n){if(r&&t.strValue.includes("'"))return;let e="";for(let n of t.raw){if("\\"===e){if("\\"===n||'"'===n){e="";continue}return}e=n}i="singlequote"}else{if("single-quoted"!==t.style||"double"!==n||r&&(t.strValue.includes('"')||t.strValue.includes("\\")))return;i="doublequote"}e.report({node:t,messageId:"wrongQuotes",data:{description:i},fix(e){let r=t.raw.slice(1,-1);return"double"===n?e.replaceText(t,`"${r.replace(/''/gu,"'").replace(/(["\\])/gu,"\\$1")}"`):e.replaceText(t,`'${r.replace(/\\(["\\])/gu,"$1").replace(/'/gu,"''")}'`)}})}}}}),se=r7("require-string-key",{meta:{docs:{description:"disallow mapping keys other than strings",categories:null,extensionRule:!1,layout:!1},schema:[],messages:{expectedString:"The key must be a string."},type:"suggestion"},create(e){if(!e.sourceCode.parserServices?.isYAML)return{};let t={};return{YAMLDocument(){t={}},YAMLAnchor(e){(t[e.name]||(t[e.name]=[])).push(e)},YAMLPair(n){!function e(n){if(!n)return!1;if("YAMLWithMeta"===n.type)return!!n.tag&&"tag:yaml.org,2002:str"===n.tag.tag||e(n.value);if("YAMLAlias"===n.type){let r=function(e){let n={anchor:null,distance:1/0};for(let r of t[e.name]||[])if(r.range[0]<e.range[0]){let t=e.range[0]-r.range[0];n.distance>=t&&(n.anchor=r,n.distance=t)}return n.anchor}(n);return!!r&&e(r.parent)}return"YAMLScalar"===n.type&&"string"==typeof n.value}(n.key)&&e.report({node:n.key||n,messageId:"expectedString"})}}}});let st="function"==typeof r$?r$:r$.default;function sn(e,t){let n=0,r=0,i=[];return st(e.length,t.length,(n,r)=>e[n]===t[r],(o,l,a)=>{if(s(n,l,r,a),n=l+o,r=a+o,o>0)for(let n=0;n<o;n++){let r=e[l+n],s=t[a+n];i.push({type:"common",a:r,b:s})}}),s(n,e.length,r,t.length),i;function s(n,r,s,o){for(let t of e.slice(n,r))i.push({type:"delete",a:t});for(let e of t.slice(s,o))i.push({type:"insert",b:e})}}function sr(e){return"\n"===e||"\r"===e||"\u2028"===e||"\u2029"===e}function si(e,t){let n=e.key;if(null==n)return"";let r="YAMLWithMeta"===n.type?n.value:n;return null==r?"":"YAMLScalar"===r.type&&"string"==typeof r.value?r.value:t.text.slice(...r.range)}var ss=class{mapping;node;index;anchorAlias;cachedName=null;get reportLoc(){return this.node.key?.loc??this.node.loc}constructor(e,t,n,r){this.mapping=e,this.node=t,this.index=n,this.anchorAlias=r}get name(){return this.cachedName??=si(this.node,this.mapping.sourceCode)}getPrev(){let e=this.index-1;return e>=0?this.mapping.pairs[e]:null}},so=class{node;sourceCode;anchorAliasMap;cachedProperties=null;constructor(e,t,n){this.node=e,this.sourceCode=t,this.anchorAliasMap=n}get pairs(){return this.cachedProperties??=this.node.pairs.map((e,t)=>new ss(this,e,t,this.anchorAliasMap.get(e)))}getPath(e){let t="",n=this.node,r=n.parent;for(;r;){if("YAMLPair"===r.type){let n=si(r,e);t=/^[$a-z_][\w$]*$/iu.test(n)?`.${n}${t}`:`[${JSON.stringify(n)}]${t}`}else"YAMLSequence"===r.type&&(t=`[${r.entries.indexOf(n)}]${t}`);r=(n=r).parent}return t.startsWith(".")&&(t=t.slice(1)),t}};function sl(e,t,n){let r=n?([e,t])=>0>=rP(e,t):([e,t])=>e<=t;if(t){let e=r;r=([t,n])=>e([t.toLowerCase(),n.toLowerCase()])}if("desc"===e){let e=r;r=t=>e(t.reverse())}return(e,t)=>r([e.name,t.name])}let sa=["asc","desc"],sc={type:"object",properties:{type:{enum:sa},caseSensitive:{type:"boolean"},natural:{type:"boolean"}},additionalProperties:!1};var su=r7("sort-keys",{meta:{docs:{description:"require mapping keys to be sorted",categories:null,extensionRule:!1,layout:!1},fixable:"code",schema:{oneOf:[{type:"array",items:{type:"object",properties:{pathPattern:{type:"string"},hasProperties:{type:"array",items:{type:"string"}},order:{oneOf:[{type:"array",items:{anyOf:[{type:"string"},{type:"object",properties:{keyPattern:{type:"string"},order:sc},additionalProperties:!1}]},uniqueItems:!0},sc]},minKeys:{type:"integer",minimum:2},allowLineSeparatedGroups:{type:"boolean"}},required:["pathPattern","order"],additionalProperties:!1},minItems:1},{type:"array",items:[{enum:sa},{type:"object",properties:{caseSensitive:{type:"boolean"},natural:{type:"boolean"},minKeys:{type:"integer",minimum:2},allowLineSeparatedGroups:{type:"boolean"}},additionalProperties:!1}],additionalItems:!1}]},messages:{shouldBeBefore:"Expected mapping keys to be in {{orderText}} order. '{{thisName}}' should be before '{{targetName}}'.",shouldBeAfter:"Expected mapping keys to be in {{orderText}} order. '{{thisName}}' should be after '{{targetName}}'."},type:"suggestion"},create(e){let t=e.sourceCode;if(!t.parserServices?.isYAML)return{};let n=function(e,t){if(0===e.length||"string"==typeof e[0]||null==e[0]){let t=e[0]??"asc",n=e[1]??{},r=!1===n.caseSensitive,i=!!n.natural,s=n.minKeys??2,o=n.allowLineSeparatedGroups||!1;return[{isTargetMapping:e=>e.node.pairs.length>=s,ignore:()=>!1,isValidOrder:sl(t,r,i),orderText:`${i?"natural ":""}${r?"insensitive ":""}${t}ending`,allowLineSeparatedGroups:o}]}return e.map(e=>{let n=e.order,r=new RegExp(e.pathPattern),i=e.hasProperties??[],s=e.minKeys??2,o=e.allowLineSeparatedGroups||!1;if(!Array.isArray(n)){let e=n.type??"asc",t=!1===n.caseSensitive,r=!!n.natural;return{isTargetMapping:a,ignore:()=>!1,isValidOrder:sl(e,t,r),orderText:`${r?"natural ":""}${t?"insensitive ":""}${e}ending`,allowLineSeparatedGroups:o}}let l=[];for(let e of n)if("string"==typeof e)l.push({test:t=>t.name===e,isValidNestOrder:()=>!0});else{let t=e.keyPattern?new RegExp(e.keyPattern):null,n=e.order??{},r=n.type??"asc",i=!1===n.caseSensitive,s=!!n.natural;l.push({test:e=>!t||t.test(e.name),isValidNestOrder:sl(r,i,s)})}return{isTargetMapping:a,ignore:e=>l.every(t=>!t.test(e)),isValidOrder(e,t){for(let n of l){let r=n.test(e),i=n.test(t);if(!r||!i){if(r)return!0;if(i)return!1;continue}return n.isValidNestOrder(e,t)}return!1},orderText:"specified",allowLineSeparatedGroups:o};function a(e){if(e.node.pairs.length<s)return!1;if(i.length>0){let t=new Set(e.pairs.map(e=>e.name));if(!i.every(e=>t.has(e)))return!1}return r.test(e.getPath(t))}})}(e.options,t);function r(e,t){if(0===e.anchorAlias.aliases.size&&0===e.anchorAlias.anchors.size||0===t.anchorAlias.aliases.size&&0===t.anchorAlias.anchors.size)return!1;for(let n of t.anchorAlias.aliases)if(e.anchorAlias.anchors.has(n))return!0;for(let n of t.anchorAlias.anchors)if(e.anchorAlias.aliases.has(n))return!0;return!1}let i={upper:null,anchors:new Set,aliases:new Set},s=new Map;return{YAMLPair(){i={upper:i,anchors:new Set,aliases:new Set}},YAMLAnchor(e){i&&i.anchors.add(e.name)},YAMLAlias(e){i&&i.aliases.add(e.name)},"YAMLPair:exit"(e){s.set(e,i);let{anchors:t,aliases:n}=i;(i=i.upper).anchors=new Set([...i.anchors,...t]),i.aliases=new Set([...i.aliases,...n])},"YAMLMapping:exit"(i){let a=new so(i,t,s),c=n.find(e=>e.isTargetMapping(a));if(c)for(let n of function(e,n){let r=[],i=[],s=null;for(let o of e){if(!o.node.key&&!o.node.value||n.ignore(o)){s=o;continue}s&&n.allowLineSeparatedGroups&&function(e,n){let r=[...t.getTokensBetween(e.node,n.node,{includeComments:!0}),n.node],i=e.node.loc;for(let e of r){let t=e.loc;if(t.start.line-i.end.line>1)return!0;i=t}return!1}(s,o)&&i.length>0&&(r.push(i),i=[]),i.push(o),s=o}return i.length>0&&r.push(i),r}(a.pairs,c))!function(n,i){let s=sn(n,function(e,t){let n,i=e.length,s=[...e];do{n=!1;for(let e=1;e<i;e++){let i=e-1;t.isValidOrder(s[i],s[e])||r(s[i],s[e])||([s[i],s[e]]=[s[e],s[i]],n=!0)}}while(n);return s}(n,i));for(let a=0;a<s.length;a++){let c=s[a];if("delete"!==c.type)continue;let u=s.findIndex(e=>"insert"===e.type&&e.b===c.a);if(-1!==u)if(a<u){let a=function(e,t){let o=null;for(let n=t-1;n>=0;n--){let t=s[n];if("delete"===t.type&&t.a===e)break;if("common"===t.type){o=t.a;break}}let l=n.indexOf(e);if(o)for(let t=l+1;t<n.length;t++){let i=n[t];if(i===o)return o;if(r(e,i))break}let a=null;for(let t=l+1;t<n.length;t++){let s=n[t];if(i.isValidOrder(s,e)&&!r(e,s)){a=s;continue}break}return a}(c.a,u);if(!a)continue;e.report({loc:c.a.reportLoc,messageId:"shouldBeAfter",data:{thisName:c.a.name,targetName:a.name,orderText:i.orderText},*fix(e){"flow"===c.a.mapping.node.style?yield*function*(e,n,r){let i,s,o,l=t.getTokenBefore(n.node),a=t.getTokenAfter(n.node);if(io(a)){s=[l.range[1],a.range[1]];let e=t.getTokenAfter(r.node);io(e)?(o=e,i=t.text.slice(...s)):(o=t.getLastToken(r.node),i=t.text.slice(l.range[1],a.range[0]),i=`,${i}`)}else io(l)?(s=[l.range[0],n.node.range[1]],i=t.text.slice(...s)):(s=[l.range[1],n.node.range[1]],i=`,${t.text.slice(...s)}`),o=t.getLastToken(r.node);yield e.removeRange(s),yield e.insertTextAfterRange(o.range,i)}(e,c.a,a):yield*function*(e,n,r){let i=l(n.node),s=l(r.node);if(0===i.loc.start.column){let n=[o(i.range[0]),i.range[1]],r=[o(s.range[0]),s.range[1]],l=t.text.slice(...n),a=1===i.loc.start.line;if(a){let e=i.range[1],r=t.text.length;if(e<r){let i=t.text[e];sr(i)&&("\r"===i&&e+1<r&&"\n"===t.text[e+1]?n[1]+=2:n[1]+=1)}}yield e.removeRange(n),yield e.insertTextAfterRange(r,`${a?"\n":""}${l}`)}else{let r=t.getTokenAfter(n.node,{includeComments:!0}),o=[n.node.range[0],r.range[0]];yield e.removeRange(o);let l=`
|
|
38
38
|
${t.text.slice(t.getIndexFromLoc({line:i.loc.start.line,column:0}),n.node.range[0]).replace(/\S/g," ")}${t.text.slice(n.node.range[0],i.range[1])}`;yield e.insertTextAfterRange(s.range,l)}}(e,c.a,a)}})}else{let a=function(e,t){let o=null;for(let n=t+1;n<s.length;n++){let t=s[n];if("delete"===t.type&&t.a===e)break;if("common"===t.type){o=t.a;break}}let l=n.indexOf(e);if(o)for(let t=l-1;t>=0;t--){let i=n[t];if(i===o)return o;if(r(i,e))break}let a=null;for(let t=l-1;t>=0;t--){let s=n[t];if(i.isValidOrder(e,s)&&!r(s,e)){a=s;continue}break}return a}(c.a,u);if(!a)continue;e.report({loc:c.a.reportLoc,messageId:"shouldBeBefore",data:{thisName:c.a.name,targetName:a.name,orderText:i.orderText},*fix(e){"flow"===c.a.mapping.node.style?yield*function*(e,n,r){let i,s,o,l=t.getTokenBefore(n.node),a=t.getTokenAfter(n.node),c=t.getTokenBefore(r.node);io(a)?(s=[l.range[1],a.range[1]],i=t.text.slice(...s),o=c):(s=[l.range[0],n.node.range[1]],io(c)?(i=t.text.slice(...s),o=t.getTokenBefore(c)):(i=`${t.text.slice(l.range[1],n.node.range[1])},`,o=c)),yield e.insertTextAfterRange(o.range,i),yield e.removeRange(s)}(e,c.a,a):yield*function*(e,n,r){let i=l(n.node),s=l(r.node);if(0===s.loc.start.column){let n=[o(i.range[0]),i.range[1]],r=[o(s.range[0]),s.range[1]],l=t.text.slice(...n);yield e.insertTextBeforeRange(r,`${l}${1===s.loc.start.line?"\n":""}`),yield e.removeRange(n)}else{let n=i.indentColumn-s.indentColumn,r=`${t.text.slice(i.range[0]+n,i.range[1])}
|
|
39
|
-
${t.text.slice(i.range[0],i.range[0]+n)}`;yield e.insertTextBeforeRange(s.range,r);let l=[o(i.range[0]),i.range[1]];yield e.removeRange(l)}}(e,c.a,a)}})}}}(n,c)}};function o(e){for(let n=e;n>=0;n--){let e=t.text[n];if(sr(t.text[n])){if("\r"===t.text[n-1]&&"\n"===e)return n-1;return n}}return 0}function l(e){let n,r=t.getTokenAfter(e,{includeComments:!0,filter:t=>!ie(t)||e.loc.end.line<t.loc.start.line});if(!r||e.loc.end.line<r.loc.start.line){let i=r?r.loc.start.line-1:e.loc.end.line;n={loc:{line:i,column:t.lines[i-1].length},get index(){return t.getIndexFromLoc(this.loc)}}}else n={index:e.range[1],loc:e.loc.end};let i=t.getTokenBefore(e);if(i){let r=t.getTokenAfter(i,{includeComments:!0});if(i.loc.end.line<r.loc.start.line||i.loc.end.line<e.loc.start.line){let s={line:i.loc.end.line<r.loc.start.line?r.loc.start.line:e.loc.start.line,column:0};return{range:[t.getIndexFromLoc(s),n.index],loc:{start:s,end:n.loc},indentColumn:r.loc.start.column}}return{range:[i.range[1],n.index],loc:{start:i.loc.end,end:n.loc},indentColumn:e.range[0]-i.range[1]}}let s=e;for(let r of t.getTokensBefore(e,{includeComments:!0}).reverse()){if(r.loc.end.line+1<s.loc.start.line){let e={line:s.loc.start.line,column:0};return{range:[t.getIndexFromLoc(e),n.index],loc:{start:e,end:n.loc},indentColumn:s.loc.start.column}}s=r}let o={line:e.loc.start.line,column:0};return{range:[t.getIndexFromLoc(o),n.index],loc:{start:o,end:n.loc},indentColumn:e.loc.start.column}}}}),sf=class{sequence;node;index;anchorAlias;cached=null;cachedRange=null;cachedAroundTokens=null;get reportLoc(){if(this.node)return this.node.loc;let e=this.aroundTokens;return{start:e.before.loc.end,end:e.after.loc.start}}get range(){if(this.node)return this.node.range;if(this.cachedRange)return this.cachedRange;let e=this.aroundTokens;return this.cachedRange=[e.before.range[1],e.after.range[0]]}get aroundTokens(){if(this.cachedAroundTokens)return this.cachedAroundTokens;let e=this.sequence.sourceCode;if(this.node)return this.cachedAroundTokens={before:e.getTokenBefore(this.node),after:e.getTokenAfter(this.node)};let t=this.index>0?this.sequence.entries[this.index-1].aroundTokens.after:e.getFirstToken(this.sequence.node);return this.cachedAroundTokens={before:t,after:e.getTokenAfter(t)}}constructor(e,t,n,r){this.sequence=e,this.node=t,this.index=n,this.anchorAlias=r}get value(){return(this.cached??(this.cached={value:null==this.node?null:nz(this.node)})).value}},sp=class{node;sourceCode;anchorAliasMap;cachedEntries=null;constructor(e,t,n){this.node=e,this.sourceCode=t,this.anchorAliasMap=n}get entries(){return this.cachedEntries??=this.node.entries.map((e,t)=>new sf(this,e,t,this.anchorAliasMap.get(e)))}};function sd(e,t,n){let r=([e,t])=>e<=t,i=r;if(n&&(i=([e,t])=>0>=rP(e,t)),t){let e=i;i=([t,n])=>e([t.toLowerCase(),n.toLowerCase()])}if("desc"===e){let e=i;i=t=>e(t.reverse());let t=r;r=e=>t(e.reverse())}return(e,t)=>{if("string"==typeof e.value&&"string"==typeof t.value)return i([e.value,t.value]);let n=sh(e.value);return!n||n!==sh(t.value)||r([e.value,t.value])}}function sh(e){let t=typeof e;return"string"===t||"number"===t||"boolean"===t||"bigint"===t?t:null===e?"null":void 0===e?"undefined":e instanceof RegExp?"regexp":null}let sg={type:"object",properties:{type:{enum:["asc","desc"]},caseSensitive:{type:"boolean"},natural:{type:"boolean"}},additionalProperties:!1};var sm=r7("sort-sequence-values",{meta:{docs:{description:"require sequence values to be sorted",categories:null,extensionRule:!1,layout:!1},fixable:"code",schema:{type:"array",items:{type:"object",properties:{pathPattern:{type:"string"},order:{oneOf:[{type:"array",items:{anyOf:[{type:"string"},{type:"object",properties:{valuePattern:{type:"string"},order:sg},additionalProperties:!1}]},uniqueItems:!0},sg]},minValues:{type:"integer",minimum:2}},required:["pathPattern","order"],additionalProperties:!1},minItems:1},messages:{shouldBeBefore:"Expected sequence values to be in {{orderText}} order. '{{thisValue}}' should be before '{{targetValue}}'.",shouldBeAfter:"Expected sequence values to be in {{orderText}} order. '{{thisValue}}' should be after '{{targetValue}}'."},type:"suggestion"},create(e){var t;let n=e.sourceCode;if(!n.parserServices?.isYAML)return{};let r=(t=e.options,t.map(e=>{let t=e.order,r=new RegExp(e.pathPattern),i=e.minValues??2;if(!Array.isArray(t)){let e=t.type??"asc",n=!1===t.caseSensitive,r=!!t.natural;return{isTargetArray:o,ignore:()=>!1,isValidOrder:sd(e,n,r),orderText:t=>"string"==typeof t.value?`${r?"natural ":""}${n?"insensitive ":""}${e}ending`:`${e}ending`}}let s=[];for(let e of t)if("string"==typeof e)s.push({test:t=>t.value===e,isValidNestOrder:()=>!0});else{let t=e.valuePattern?new RegExp(e.valuePattern):null,n=e.order??{},r=n.type??"asc",i=!1===n.caseSensitive,o=!!n.natural;s.push({test:e=>!t||!!sh(e.value)&&t.test(String(e.value)),isValidNestOrder:sd(r,i,o)})}return{isTargetArray:o,ignore:e=>s.every(t=>!t.test(e)),isValidOrder(e,t){for(let n of s){let r=n.test(e),i=n.test(t);if(!r||!i){if(r)return!0;if(i)return!1;continue}return n.isValidNestOrder(e,t)}return!1},orderText:()=>"specified"};function o(e){if(e.node.entries.length<i)return!1;let t="",s=e.node,o=s.parent;for(;o;){if("YAMLPair"===o.type){let e=function(e){let t=e.key;if(null==t)return"";let r="YAMLWithMeta"===t.type?t.value:t;return null==r?"":"YAMLScalar"===r.type&&"string"==typeof r.value?r.value:n.text.slice(...r.range)}(o);t=/^[$a-z_][\w$]*$/iu.test(e)?`.${e}${t}`:`[${JSON.stringify(e)}]${t}`}else"YAMLSequence"===o.type&&(t=`[${o.entries.indexOf(s)}]${t}`);o=(s=o).parent}return t.startsWith(".")&&(t=t.slice(1)),r.test(t)}}));function i(e,t){if(0===e.anchorAlias.aliases.size&&0===e.anchorAlias.anchors.size||0===t.anchorAlias.aliases.size&&0===t.anchorAlias.anchors.size)return!1;for(let n of t.anchorAlias.aliases)if(e.anchorAlias.anchors.has(n))return!0;for(let n of t.anchorAlias.anchors)if(e.anchorAlias.aliases.has(n))return!0;return!1}function s(e){return sh(e.value)?String(e.value):n.getText(e.node)}let o={upper:null,anchors:new Set,aliases:new Set},l=new Map;return{"YAMLSequence > *"(e){e.parent.entries.includes(e)&&(o={upper:o,anchors:new Set,aliases:new Set},"YAMLAlias"===e.type&&o.aliases.add(e.name))},YAMLAnchor(e){o&&o.anchors.add(e.name)},YAMLAlias(e){o&&o.aliases.add(e.name)},"YAMLSequence > *:exit"(e){if(!e.parent.entries.includes(e))return;l.set(e,o);let{anchors:t,aliases:n}=o;(o=o.upper).anchors=new Set([...o.anchors,...t]),o.aliases=new Set([...o.aliases,...n])},"YAMLSequence:exit"(t){let o=new sp(t,n,l),c=r.find(e=>e.isTargetArray(o));c&&function(t,r){let o=sn(t,function(e,t){let n,r=e.length,s=[...e];do{n=!1;for(let e=1;e<r;e++){let r=e-1;t.isValidOrder(s[r],s[e])||i(s[r],s[e])||([s[r],s[e]]=[s[e],s[r]],n=!0)}}while(n);return s}(t,r));for(let l=0;l<o.length;l++){let c=o[l];if("delete"!==c.type)continue;let u=o.findIndex(e=>"insert"===e.type&&e.b===c.a);if(-1!==u)if(l<u){let l=function(e,n){let s=null;for(let t=n-1;t>=0;t--){let n=o[t];if("delete"===n.type&&n.a===e)break;if("common"===n.type){s=n.a;break}}let l=t.indexOf(e);if(s)for(let n=l+1;n<t.length;n++){let r=t[n];if(r===s)return s;if(i(e,r))break}let a=null;for(let n=l+1;n<t.length;n++){let s=t[n];if(r.isValidOrder(s,e)&&!i(e,s)){a=s;continue}break}return a}(c.a,u);if(!l)continue;e.report({loc:c.a.reportLoc,messageId:"shouldBeAfter",data:{thisValue:s(c.a),targetValue:s(l),orderText:r.orderText(c.a)},*fix(e){"flow"===c.a.sequence.node.style?yield*function*(e,t,r){let i,s,o,l=t.aroundTokens.before,a=t.aroundTokens.after;if(io(a)){s=[l.range[1],a.range[1]];let e=r.aroundTokens.after;io(e)?(o=e,i=n.text.slice(...s)):(o=r.node?n.getLastToken(r.node):r.aroundTokens.before,i=n.text.slice(l.range[1],a.range[0]),i=`,${i}`)}else io(l)?(s=[l.range[0],t.range[1]],i=n.text.slice(...s)):(s=[l.range[1],t.range[1]],i=`,${n.text.slice(...s)}`),o=r.node?n.getLastToken(r.node):r.aroundTokens.before;yield e.removeRange(s),yield e.insertTextAfterRange(o.range,i)}(e,c.a,l):yield*function*(e,t,r){let i=t.sequence.entries.slice(t.index,r.index+1),s=a(t);for(let t of i.reverse()){let r=a(t);yield e.replaceTextRange(r,n.text.slice(...s)),s=r}}(e,c.a,l)}})}else{let l=function(e,n){let s=null;for(let t=n+1;t<o.length;t++){let n=o[t];if("delete"===n.type&&n.a===e)break;if("common"===n.type){s=n.a;break}}let l=t.indexOf(e);if(s)for(let n=l-1;n>=0;n--){let r=t[n];if(r===s)return s;if(i(r,e))break}let a=null;for(let n=l-1;n>=0;n--){let s=t[n];if(r.isValidOrder(e,s)&&!i(s,e)){a=s;continue}break}return a}(c.a,u);if(!l)continue;e.report({loc:c.a.reportLoc,messageId:"shouldBeBefore",data:{thisValue:s(c.a),targetValue:s(l),orderText:r.orderText(c.a)},*fix(e){"flow"===c.a.sequence.node.style?yield*function*(e,t,r){let i,s,o,l=t.aroundTokens.before,a=t.aroundTokens.after;io(a)?(s=[l.range[1],a.range[1]],i=n.text.slice(...s),o=r.aroundTokens.before):(s=[l.range[0],t.range[1]],io(r.aroundTokens.before)?(i=n.text.slice(...s),o=n.getTokenBefore(r.aroundTokens.before)):(i=`${n.text.slice(l.range[1],t.range[1])},`,o=r.aroundTokens.before)),yield e.insertTextAfterRange(o.range,i),yield e.removeRange(s)}(e,c.a,l):yield*function*(e,t,r){let i=t.sequence.entries.slice(r.index,t.index+1),s=a(t);for(let t of i){let r=a(t);yield e.replaceTextRange(r,n.text.slice(...s)),s=r}}(e,c.a,l)}})}}}(o.entries.filter(e=>!c.ignore(e)),c)}};function a(e){return[function(e){let t=n.getTokenBefore(e.aroundTokens.before);if(!t){let t=n.getTokenBefore(e.aroundTokens.before,{includeComments:!0});return t&&e.aroundTokens.before.loc.start.column<=t.loc.start.column?t.range[0]:e.aroundTokens.before.range[0]}let r=n.getTokenAfter(t,{includeComments:!0});for(;t.loc.end.line===r.loc.start.line&&r.range[1]<e.aroundTokens.before.range[0];)r=n.getTokenAfter(r,{includeComments:!0});return r.range[0]}(e),function(e){let t=e.node??e.aroundTokens.before,r=t,i=n.getTokenAfter(r,{includeComments:!0});for(;i&&t.loc.end.line===i.loc.start.line;)r=i,i=n.getTokenAfter(r,{includeComments:!0});return r.range[1]}(e)]}}});function sy(e){return`(?:${function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e)})`}function sb(e){return`${sy(e)}+`}var sk=r7("spaced-comment",{meta:{docs:{description:"enforce consistent spacing after the `#` in a comment",categories:["standard"],extensionRule:"spaced-comment",layout:!1},fixable:"whitespace",schema:[{enum:["always","never"]},{type:"object",properties:{exceptions:{type:"array",items:{type:"string"}},markers:{type:"array",items:{type:"string"}}},additionalProperties:!1}],messages:{unexpectedSpaceAfterMarker:"Unexpected space after marker ({{refChar}}) in comment.",expectedExceptionAfter:"Expected exception block, space after '{{refChar}}' in comment.",unexpectedSpaceAfter:"Unexpected space after '{{refChar}}' in comment.",expectedSpaceAfter:"Expected space after '{{refChar}}' in comment."},type:"suggestion"},create(e){let t,n,r=e.sourceCode;if(!r.parserServices?.isYAML)return{};let i="never"!==e.options[0],s=e.options[1]||{},o=s.markers||[],l=s.exceptions||[],a={beginRegex:i?(t="^",1===o.length?t+=sy(o[0]):(t+="(?:",t+=o.map(sy).join("|"),t+=")"),t+="?",RegExp(t+=(n="",0===l.length?n+="\\s":(n+="(?:\\s|",1===l.length?n+=sb(l[0]):(n+="(?:",n+=l.map(sb).join("|"),n+=")"),n+="$)"),n),"u")):RegExp(`^(${o.map(sy).join("|")})?[ ]+`,"u"),hasExceptions:l.length>0,captureMarker:RegExp(`^(${o.map(sy).join("|")})`,"u"),markers:new Set(o)};function c(t,n,r,s){e.report({node:t,fix(e){let n=t.range[0],s=n+1;return i?(r&&(s+=r[0].length),e.insertTextAfterRange([n,s]," ")):(s+=r[0].length,e.replaceTextRange([n,s],`#${r?.[1]?r[1]:""}`))},messageId:n,data:{refChar:s}})}function u(e){if(0===e.value.length||a.markers.has(e.value))return;let t=a.beginRegex.exec(e.value);if(i){if(!t){let t=a.captureMarker.exec(e.value),n=t?`#${t[0]}`:"#";a.hasExceptions?c(e,"expectedExceptionAfter",t,n):c(e,"expectedSpaceAfter",t,n)}}else t&&(t[1]?c(e,"unexpectedSpaceAfterMarker",t,t[1]):c(e,"unexpectedSpaceAfter",t,"#"))}return{Program(){r.getAllComments().forEach(u)}}}}),sv=r7("vue-custom-block/no-parsing-error",{meta:{docs:{description:"disallow parsing errors in Vue custom blocks",categories:["recommended","standard"],extensionRule:!1,layout:!1},schema:[],messages:{},type:"problem"},create(e,{customBlock:t}){if(!t)return{};let n=e.sourceCode.parserServices.parseError;if(n&&"object"==typeof n){let t;return"column"in n&&"lineNumber"in n&&(t={line:n.lineNumber,column:n.column}),{Program(r){e.report({node:r,loc:t,message:n.message})}}}return{}}}),sS=[{plugins:{get yml(){return sB}}},{files:["*.yaml","**/*.yaml","*.yml","**/*.yml"],language:"yml/yaml",rules:{"no-irregular-whitespace":"off","no-unused-vars":"off","spaced-comment":"off"}}],sw=[...sS,{rules:{"yml/no-empty-document":"error","yml/no-empty-key":"error","yml/no-empty-mapping-value":"error","yml/no-empty-sequence-entry":"error","yml/no-irregular-whitespace":"error","yml/no-tab-indent":"error","yml/vue-custom-block/no-parsing-error":"error"}}],sx=[...sS,{rules:{"yml/block-mapping-colon-indicator-newline":"error","yml/block-mapping-question-indicator-newline":"error","yml/block-mapping":"error","yml/block-sequence-hyphen-indicator-newline":"error","yml/block-sequence":"error","yml/flow-mapping-curly-newline":"error","yml/flow-mapping-curly-spacing":"error","yml/flow-sequence-bracket-newline":"error","yml/flow-sequence-bracket-spacing":"error","yml/indent":"error","yml/key-spacing":"error","yml/no-empty-document":"error","yml/no-empty-key":"error","yml/no-empty-mapping-value":"error","yml/no-empty-sequence-entry":"error","yml/no-irregular-whitespace":"error","yml/no-multiple-empty-lines":"error","yml/no-tab-indent":"error","yml/no-trailing-zeros":"error","yml/plain-scalar":"error","yml/quotes":"error","yml/spaced-comment":"error","yml/vue-custom-block/no-parsing-error":"error"}}],sA=[...sS,{rules:{"yml/block-mapping-colon-indicator-newline":"off","yml/block-mapping-question-indicator-newline":"off","yml/block-sequence-hyphen-indicator-newline":"off","yml/flow-mapping-curly-newline":"off","yml/flow-mapping-curly-spacing":"off","yml/flow-sequence-bracket-newline":"off","yml/flow-sequence-bracket-spacing":"off","yml/indent":"off","yml/key-spacing":"off","yml/no-multiple-empty-lines":"off","yml/no-trailing-zeros":"off","yml/quotes":"off"}}],sT=((e,t)=>{let n={};for(var r in e)eJ(n,r,{get:e[r],enumerable:!0});return eJ(n,Symbol.toStringTag,{value:"Module"}),n})({name:()=>sL,version:()=>sE});let sL="eslint-plugin-yml",sE="3.3.1",sC=new rX.ConfigCommentParser,sM=/^\s*eslint(?:-enable|-disable(?:(?:-next)?-line)?)?(?:\s|$)/u;var sN=class extends rX.TextSourceCodeBase{hasBOM;parserServices;visitorKeys;tokenStore;#a=null;#c=null;#u=null;constructor(e){super({ast:e.ast,text:e.text}),this.hasBOM=!!e.hasBOM,this.parserServices=e.parserServices,this.visitorKeys=e.visitorKeys||{},this.tokenStore=new r6({tokens:[...e.ast.tokens,...e.ast.comments],isComment:e=>"Block"===e.type})}traverse(){if(null!=this.#a)return this.#a;let e=[];this.#a=e;let t=this.ast;return e.push(new rX.CallMethodStep({target:"onCodePathStart",args:[{},t]})),rT(t,{enterNode(t){e.push(new rX.VisitNodeStep({target:t,phase:1,args:[t]}))},leaveNode(t){e.push(new rX.VisitNodeStep({target:t,phase:2,args:[t]}))}}),e.push(new rX.CallMethodStep({target:"onCodePathEnd",args:[{},t]})),e}get tokensAndComments(){return this.#c??=[...this.ast.tokens,...this.ast.comments].sort((e,t)=>e.range[0]-t.range[0])}getLines(){return this.lines}getAllComments(){return this.tokenStore.getAllComments()}getInlineConfigNodes(){return this.#u||(this.#u=this.ast.comments.filter(e=>sM.test(e.value))),this.#u}getDisableDirectives(){let e=[],t=[];return this.getInlineConfigNodes().forEach(n=>{let r=sC.parseDirective(n.value);if(!r)return;let{label:i,value:s,justification:o}=r;if("eslint-disable-line"===i&&n.loc.start.line!==n.loc.end.line){let t=`${i} comment should not span multiple lines.`;e.push({ruleId:null,message:t,loc:n.loc});return}switch(i){case"eslint-disable":case"eslint-enable":case"eslint-disable-next-line":case"eslint-disable-line":{let e=i.slice(7);t.push(new rX.Directive({type:e,node:n,value:s,justification:o}))}}}),{problems:e,directives:t}}applyInlineConfig(){let e=[],t=[];return this.getInlineConfigNodes().forEach(n=>{let r=sC.parseDirective(n.value);if(!r)return;let{label:i,value:s}=r;if("eslint"===i){let r=sC.parseJSONLikeConfig(s);r.ok?t.push({config:{rules:r.config},loc:n.loc}):e.push({ruleId:null,message:r.error.message,loc:n.loc})}}),{configs:t,problems:e}}getNodeByRangeIndex(e){let t=n([this.ast]);if(!t)return null;for(;;){let e=n(this._getChildren(t));if(!e)return t;t=e}function n(t){for(let n of t)if(n.range[0]<=e&&e<n.range[1])return n;return null}}getFirstToken(e,t){return this.tokenStore.getFirstToken(e,t)}getFirstTokens(e,t){return this.tokenStore.getFirstTokens(e,t)}getLastToken(e,t){return this.tokenStore.getLastToken(e,t)}getLastTokens(e,t){return this.tokenStore.getLastTokens(e,t)}getTokenBefore(e,t){return this.tokenStore.getTokenBefore(e,t)}getTokensBefore(e,t){return this.tokenStore.getTokensBefore(e,t)}getTokenAfter(e,t){return this.tokenStore.getTokenAfter(e,t)}getTokensAfter(e,t){return this.tokenStore.getTokensAfter(e,t)}getFirstTokenBetween(e,t,n){return this.tokenStore.getFirstTokenBetween(e,t,n)}getFirstTokensBetween(e,t,n){return this.tokenStore.getFirstTokensBetween(e,t,n)}getLastTokenBetween(e,t,n){return this.tokenStore.getLastTokenBetween(e,t,n)}getLastTokensBetween(e,t,n){return this.tokenStore.getLastTokensBetween(e,t,n)}getTokens(e,t){return this.tokenStore.getTokens(e,t)}getTokensBetween(e,t,n){return this.tokenStore.getTokensBetween(e,t,n)}getCommentsInside(e){return this.tokenStore.getCommentsInside(e)}getCommentsBefore(e){return this.tokenStore.getCommentsBefore(e)}getCommentsAfter(e){return this.tokenStore.getCommentsAfter(e)}commentsExistBetween(e,t){return this.tokenStore.commentsExistBetween(e,t)}isSpaceBetween(e,t){let[n,r]=e.range[1]<=t.range[0]?[e,t]:[t,e];return this.tokenStore.isSpaceBetween(n,r)}getScope(e){return e?.type!=="Program"?null:sO(this.ast)}get scopeManager(){return{scopes:[],globalScope:sO(this.ast),acquire:e=>"Program"===e.type?sO(this.ast):null,getDeclaredVariables:()=>[],addGlobals:()=>{}}}isSpaceBetweenTokens(e,t){return this.isSpaceBetween(e,t)}_getChildren(e){let t=this.visitorKeys[e.type]||[],n=[];for(let r of t){let t=e[r];if(Array.isArray(t))for(let e of t)sI(e)&&n.push(e);else sI(t)&&n.push(t)}return n}};function sI(e){return"object"==typeof e&&null!==e&&"string"==typeof e.type&&Array.isArray(e.range)&&!!e.loc&&"object"==typeof e.loc}function sO(e){let t={type:"global",block:e,set:new Map,through:[],childScopes:[],variableScope:null,variables:[],references:[],functionExpressionScope:!1,isStrict:!1,upper:null,implicit:{variables:[],set:new Map}};return t.variableScope=t,t}var sP=class{fileType="text";lineStart=1;columnStart=0;nodeTypeKey="type";validateLanguageOptions(e){}normalizeLanguageOptions(e){return{ecmaVersion:"latest",...e,parserOptions:{...e.parserOptions}}}parse(e,t){let n=e.body;try{return{ok:!0,ast:rv(n,{filePath:e.path,defaultYAMLVersion:t.languageOptions?.parserOptions?.defaultYAMLVersion})}}catch(e){return{ok:!1,errors:[{message:e instanceof Error?e.message:String(e),line:e.lineNumber??1,column:e.column??1}]}}}createSourceCode(e,t){return new sN({text:e.body,ast:t.ast,hasBOM:e.bom,parserServices:{isYAML:!0},visitorKeys:rS})}},sB={meta:sT,configs:{base:sS,recommended:sw,standard:sx,prettier:sA,"flat/base":sS,"flat/recommended":sw,"flat/standard":sx,"flat/prettier":sA},rules:Object.fromEntries([ia,ic,ix,iA,iL,iE,iC,iM,iN,iI,iP,iD,iz,iG,iQ,iX,iH,i2,i9,i8,i6,i5,i7,se,su,sm,sk,sv].map(e=>[e.meta.docs.ruleName,e])),languages:{yaml:new sP}};exports.yaml=function(){let e=[{name:"sukka/yaml disable spaced-comment",files:eF.constants.GLOB_YML,rules:{"@stylistic/spaced-comment":"off"}},{files:["pnpm-workspace.yaml"],name:"sukka/yaml/pnpm-workspace",rules:{"yml/sort-keys":["error",{order:["packages","overrides","patchedDependencies","hoistPattern","catalog","catalogs","allowedDeprecatedVersions","allowNonAppliedPatches","configDependencies","ignoredBuiltDependencies","ignoredOptionalDependencies","neverBuiltDependencies","onlyBuiltDependencies","onlyBuiltDependenciesFile","packageExtensions","peerDependencyRules","supportedArchitectures"],pathPattern:"^$"}]}}];return eK.appendArrayInPlace(e,sB.configs["flat/recommended"])};
|
|
39
|
+
${t.text.slice(i.range[0],i.range[0]+n)}`;yield e.insertTextBeforeRange(s.range,r);let l=[o(i.range[0]),i.range[1]];yield e.removeRange(l)}}(e,c.a,a)}})}}}(n,c)}};function o(e){for(let n=e;n>=0;n--){let e=t.text[n];if(sr(t.text[n])){if("\r"===t.text[n-1]&&"\n"===e)return n-1;return n}}return 0}function l(e){let n,r=t.getTokenAfter(e,{includeComments:!0,filter:t=>!ie(t)||e.loc.end.line<t.loc.start.line});if(!r||e.loc.end.line<r.loc.start.line){let i=r?r.loc.start.line-1:e.loc.end.line;n={loc:{line:i,column:t.lines[i-1].length},get index(){return t.getIndexFromLoc(this.loc)}}}else n={index:e.range[1],loc:e.loc.end};let i=t.getTokenBefore(e);if(i){let r=t.getTokenAfter(i,{includeComments:!0});if(i.loc.end.line<r.loc.start.line||i.loc.end.line<e.loc.start.line){let s={line:i.loc.end.line<r.loc.start.line?r.loc.start.line:e.loc.start.line,column:0};return{range:[t.getIndexFromLoc(s),n.index],loc:{start:s,end:n.loc},indentColumn:r.loc.start.column}}return{range:[i.range[1],n.index],loc:{start:i.loc.end,end:n.loc},indentColumn:e.range[0]-i.range[1]}}let s=e;for(let r of t.getTokensBefore(e,{includeComments:!0}).reverse()){if(r.loc.end.line+1<s.loc.start.line){let e={line:s.loc.start.line,column:0};return{range:[t.getIndexFromLoc(e),n.index],loc:{start:e,end:n.loc},indentColumn:s.loc.start.column}}s=r}let o={line:e.loc.start.line,column:0};return{range:[t.getIndexFromLoc(o),n.index],loc:{start:o,end:n.loc},indentColumn:e.loc.start.column}}}}),sf=class{sequence;node;index;anchorAlias;cached=null;cachedRange=null;cachedAroundTokens=null;get reportLoc(){if(this.node)return this.node.loc;let e=this.aroundTokens;return{start:e.before.loc.end,end:e.after.loc.start}}get range(){if(this.node)return this.node.range;if(this.cachedRange)return this.cachedRange;let e=this.aroundTokens;return this.cachedRange=[e.before.range[1],e.after.range[0]]}get aroundTokens(){if(this.cachedAroundTokens)return this.cachedAroundTokens;let e=this.sequence.sourceCode;if(this.node)return this.cachedAroundTokens={before:e.getTokenBefore(this.node),after:e.getTokenAfter(this.node)};let t=this.index>0?this.sequence.entries[this.index-1].aroundTokens.after:e.getFirstToken(this.sequence.node),n=e.getTokenAfter(t);return this.cachedAroundTokens={before:t,after:n}}constructor(e,t,n,r){this.sequence=e,this.node=t,this.index=n,this.anchorAlias=r}get value(){return(this.cached??(this.cached={value:null==this.node?null:nz(this.node)})).value}},sp=class{node;sourceCode;anchorAliasMap;cachedEntries=null;constructor(e,t,n){this.node=e,this.sourceCode=t,this.anchorAliasMap=n}get entries(){return this.cachedEntries??=this.node.entries.map((e,t)=>new sf(this,e,t,this.anchorAliasMap.get(e)))}};function sd(e,t,n){let r=([e,t])=>e<=t,i=r;if(n&&(i=([e,t])=>0>=rP(e,t)),t){let e=i;i=([t,n])=>e([t.toLowerCase(),n.toLowerCase()])}if("desc"===e){let e=i;i=t=>e(t.reverse());let t=r;r=e=>t(e.reverse())}return(e,t)=>{if("string"==typeof e.value&&"string"==typeof t.value)return i([e.value,t.value]);let n=sh(e.value);return!n||n!==sh(t.value)||r([e.value,t.value])}}function sh(e){let t=typeof e;return"string"===t||"number"===t||"boolean"===t||"bigint"===t?t:null===e?"null":void 0===e?"undefined":e instanceof RegExp?"regexp":null}let sg={type:"object",properties:{type:{enum:["asc","desc"]},caseSensitive:{type:"boolean"},natural:{type:"boolean"}},additionalProperties:!1};function sm(e){return`(?:${function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e)})`}function sy(e){return`${sm(e)}+`}let sb=[ia,ic,ix,iA,iL,iE,iC,iM,iN,iI,iP,iD,iz,iG,iQ,iX,iH,i2,i9,i8,i6,i5,i7,se,su,r7("sort-sequence-values",{meta:{docs:{description:"require sequence values to be sorted",categories:null,extensionRule:!1,layout:!1},fixable:"code",schema:{type:"array",items:{type:"object",properties:{pathPattern:{type:"string"},order:{oneOf:[{type:"array",items:{anyOf:[{type:"string"},{type:"object",properties:{valuePattern:{type:"string"},order:sg},additionalProperties:!1}]},uniqueItems:!0},sg]},minValues:{type:"integer",minimum:2}},required:["pathPattern","order"],additionalProperties:!1},minItems:1},messages:{shouldBeBefore:"Expected sequence values to be in {{orderText}} order. '{{thisValue}}' should be before '{{targetValue}}'.",shouldBeAfter:"Expected sequence values to be in {{orderText}} order. '{{thisValue}}' should be after '{{targetValue}}'."},type:"suggestion"},create(e){var t;let n=e.sourceCode;if(!n.parserServices?.isYAML)return{};let r=(t=e.options,t.map(e=>{let t=e.order,r=new RegExp(e.pathPattern),i=e.minValues??2;if(!Array.isArray(t)){let e=t.type??"asc",n=!1===t.caseSensitive,r=!!t.natural;return{isTargetArray:o,ignore:()=>!1,isValidOrder:sd(e,n,r),orderText:t=>"string"==typeof t.value?`${r?"natural ":""}${n?"insensitive ":""}${e}ending`:`${e}ending`}}let s=[];for(let e of t)if("string"==typeof e)s.push({test:t=>t.value===e,isValidNestOrder:()=>!0});else{let t=e.valuePattern?new RegExp(e.valuePattern):null,n=e.order??{},r=n.type??"asc",i=!1===n.caseSensitive,o=!!n.natural;s.push({test:e=>!t||!!sh(e.value)&&t.test(String(e.value)),isValidNestOrder:sd(r,i,o)})}return{isTargetArray:o,ignore:e=>s.every(t=>!t.test(e)),isValidOrder(e,t){for(let n of s){let r=n.test(e),i=n.test(t);if(!r||!i){if(r)return!0;if(i)return!1;continue}return n.isValidNestOrder(e,t)}return!1},orderText:()=>"specified"};function o(e){if(e.node.entries.length<i)return!1;let t="",s=e.node,o=s.parent;for(;o;){if("YAMLPair"===o.type){let e=function(e){let t=e.key;if(null==t)return"";let r="YAMLWithMeta"===t.type?t.value:t;return null==r?"":"YAMLScalar"===r.type&&"string"==typeof r.value?r.value:n.text.slice(...r.range)}(o);t=/^[$a-z_][\w$]*$/iu.test(e)?`.${e}${t}`:`[${JSON.stringify(e)}]${t}`}else"YAMLSequence"===o.type&&(t=`[${o.entries.indexOf(s)}]${t}`);o=(s=o).parent}return t.startsWith(".")&&(t=t.slice(1)),r.test(t)}}));function i(e,t){if(0===e.anchorAlias.aliases.size&&0===e.anchorAlias.anchors.size||0===t.anchorAlias.aliases.size&&0===t.anchorAlias.anchors.size)return!1;for(let n of t.anchorAlias.aliases)if(e.anchorAlias.anchors.has(n))return!0;for(let n of t.anchorAlias.anchors)if(e.anchorAlias.aliases.has(n))return!0;return!1}function s(e){return sh(e.value)?String(e.value):n.getText(e.node)}let o={upper:null,anchors:new Set,aliases:new Set},l=new Map;return{"YAMLSequence > *"(e){e.parent.entries.includes(e)&&(o={upper:o,anchors:new Set,aliases:new Set},"YAMLAlias"===e.type&&o.aliases.add(e.name))},YAMLAnchor(e){o&&o.anchors.add(e.name)},YAMLAlias(e){o&&o.aliases.add(e.name)},"YAMLSequence > *:exit"(e){if(!e.parent.entries.includes(e))return;l.set(e,o);let{anchors:t,aliases:n}=o;(o=o.upper).anchors=new Set([...o.anchors,...t]),o.aliases=new Set([...o.aliases,...n])},"YAMLSequence:exit"(t){let o=new sp(t,n,l),c=r.find(e=>e.isTargetArray(o));c&&function(t,r){let o=sn(t,function(e,t){let n,r=e.length,s=[...e];do{n=!1;for(let e=1;e<r;e++){let r=e-1;t.isValidOrder(s[r],s[e])||i(s[r],s[e])||([s[r],s[e]]=[s[e],s[r]],n=!0)}}while(n);return s}(t,r));for(let l=0;l<o.length;l++){let c=o[l];if("delete"!==c.type)continue;let u=o.findIndex(e=>"insert"===e.type&&e.b===c.a);if(-1!==u)if(l<u){let l=function(e,n){let s=null;for(let t=n-1;t>=0;t--){let n=o[t];if("delete"===n.type&&n.a===e)break;if("common"===n.type){s=n.a;break}}let l=t.indexOf(e);if(s)for(let n=l+1;n<t.length;n++){let r=t[n];if(r===s)return s;if(i(e,r))break}let a=null;for(let n=l+1;n<t.length;n++){let s=t[n];if(r.isValidOrder(s,e)&&!i(e,s)){a=s;continue}break}return a}(c.a,u);if(!l)continue;e.report({loc:c.a.reportLoc,messageId:"shouldBeAfter",data:{thisValue:s(c.a),targetValue:s(l),orderText:r.orderText(c.a)},*fix(e){"flow"===c.a.sequence.node.style?yield*function*(e,t,r){let i,s,o,l=t.aroundTokens.before,a=t.aroundTokens.after;if(io(a)){s=[l.range[1],a.range[1]];let e=r.aroundTokens.after;io(e)?(o=e,i=n.text.slice(...s)):(o=r.node?n.getLastToken(r.node):r.aroundTokens.before,i=n.text.slice(l.range[1],a.range[0]),i=`,${i}`)}else io(l)?(s=[l.range[0],t.range[1]],i=n.text.slice(...s)):(s=[l.range[1],t.range[1]],i=`,${n.text.slice(...s)}`),o=r.node?n.getLastToken(r.node):r.aroundTokens.before;yield e.removeRange(s),yield e.insertTextAfterRange(o.range,i)}(e,c.a,l):yield*function*(e,t,r){let i=t.sequence.entries.slice(t.index,r.index+1),s=a(t);for(let t of i.reverse()){let r=a(t);yield e.replaceTextRange(r,n.text.slice(...s)),s=r}}(e,c.a,l)}})}else{let l=function(e,n){let s=null;for(let t=n+1;t<o.length;t++){let n=o[t];if("delete"===n.type&&n.a===e)break;if("common"===n.type){s=n.a;break}}let l=t.indexOf(e);if(s)for(let n=l-1;n>=0;n--){let r=t[n];if(r===s)return s;if(i(r,e))break}let a=null;for(let n=l-1;n>=0;n--){let s=t[n];if(r.isValidOrder(e,s)&&!i(s,e)){a=s;continue}break}return a}(c.a,u);if(!l)continue;e.report({loc:c.a.reportLoc,messageId:"shouldBeBefore",data:{thisValue:s(c.a),targetValue:s(l),orderText:r.orderText(c.a)},*fix(e){"flow"===c.a.sequence.node.style?yield*function*(e,t,r){let i,s,o,l=t.aroundTokens.before,a=t.aroundTokens.after;io(a)?(s=[l.range[1],a.range[1]],i=n.text.slice(...s),o=r.aroundTokens.before):(s=[l.range[0],t.range[1]],io(r.aroundTokens.before)?(i=n.text.slice(...s),o=n.getTokenBefore(r.aroundTokens.before)):(i=`${n.text.slice(l.range[1],t.range[1])},`,o=r.aroundTokens.before)),yield e.insertTextAfterRange(o.range,i),yield e.removeRange(s)}(e,c.a,l):yield*function*(e,t,r){let i=t.sequence.entries.slice(r.index,t.index+1),s=a(t);for(let t of i){let r=a(t);yield e.replaceTextRange(r,n.text.slice(...s)),s=r}}(e,c.a,l)}})}}}(o.entries.filter(e=>!c.ignore(e)),c)}};function a(e){return[function(e){let t=n.getTokenBefore(e.aroundTokens.before);if(!t){let t=n.getTokenBefore(e.aroundTokens.before,{includeComments:!0});return t&&e.aroundTokens.before.loc.start.column<=t.loc.start.column?t.range[0]:e.aroundTokens.before.range[0]}let r=n.getTokenAfter(t,{includeComments:!0});for(;t.loc.end.line===r.loc.start.line&&r.range[1]<e.aroundTokens.before.range[0];)r=n.getTokenAfter(r,{includeComments:!0});return r.range[0]}(e),function(e){let t=e.node??e.aroundTokens.before,r=t,i=n.getTokenAfter(r,{includeComments:!0});for(;i&&t.loc.end.line===i.loc.start.line;)r=i,i=n.getTokenAfter(r,{includeComments:!0});return r.range[1]}(e)]}}}),r7("spaced-comment",{meta:{docs:{description:"enforce consistent spacing after the `#` in a comment",categories:["standard"],extensionRule:"spaced-comment",layout:!1},fixable:"whitespace",schema:[{enum:["always","never"]},{type:"object",properties:{exceptions:{type:"array",items:{type:"string"}},markers:{type:"array",items:{type:"string"}}},additionalProperties:!1}],messages:{unexpectedSpaceAfterMarker:"Unexpected space after marker ({{refChar}}) in comment.",expectedExceptionAfter:"Expected exception block, space after '{{refChar}}' in comment.",unexpectedSpaceAfter:"Unexpected space after '{{refChar}}' in comment.",expectedSpaceAfter:"Expected space after '{{refChar}}' in comment."},type:"suggestion"},create(e){let t,n,r=e.sourceCode;if(!r.parserServices?.isYAML)return{};let i="never"!==e.options[0],s=e.options[1]||{},o=s.markers||[],l=s.exceptions||[],a={beginRegex:i?(t="^",1===o.length?t+=sm(o[0]):(t+="(?:",t+=o.map(sm).join("|"),t+=")"),t+="?",RegExp(t+=(n="",0===l.length?n+="\\s":(n+="(?:\\s|",1===l.length?n+=sy(l[0]):(n+="(?:",n+=l.map(sy).join("|"),n+=")"),n+="$)"),n),"u")):RegExp(`^(${o.map(sm).join("|")})?[ ]+`,"u"),hasExceptions:l.length>0,captureMarker:RegExp(`^(${o.map(sm).join("|")})`,"u"),markers:new Set(o)};function c(t,n,r,s){e.report({node:t,fix(e){let n=t.range[0],s=n+1;return i?(r&&(s+=r[0].length),e.insertTextAfterRange([n,s]," ")):(s+=r[0].length,e.replaceTextRange([n,s],`#${r?.[1]?r[1]:""}`))},messageId:n,data:{refChar:s}})}function u(e){if(0===e.value.length||a.markers.has(e.value))return;let t=a.beginRegex.exec(e.value);if(i){if(!t){let t=a.captureMarker.exec(e.value),n=t?`#${t[0]}`:"#";a.hasExceptions?c(e,"expectedExceptionAfter",t,n):c(e,"expectedSpaceAfter",t,n)}}else t&&(t[1]?c(e,"unexpectedSpaceAfterMarker",t,t[1]):c(e,"unexpectedSpaceAfter",t,"#"))}return{Program(){r.getAllComments().forEach(u)}}}}),r7("vue-custom-block/no-parsing-error",{meta:{docs:{description:"disallow parsing errors in Vue custom blocks",categories:["recommended","standard"],extensionRule:!1,layout:!1},schema:[],messages:{},type:"problem"},create(e,{customBlock:t}){if(!t)return{};let n=e.sourceCode.parserServices.parseError;if(n&&"object"==typeof n){let t;return"column"in n&&"lineNumber"in n&&(t={line:n.lineNumber,column:n.column}),{Program(r){e.report({node:r,loc:t,message:n.message})}}}return{}}})];var sk=[{plugins:{get yml(){return sO}}},{files:["*.yaml","**/*.yaml","*.yml","**/*.yml"],language:"yml/yaml",rules:{"no-irregular-whitespace":"off","no-unused-vars":"off","spaced-comment":"off"}}],sv=[...sk,{rules:{"yml/no-empty-document":"error","yml/no-empty-key":"error","yml/no-empty-mapping-value":"error","yml/no-empty-sequence-entry":"error","yml/no-irregular-whitespace":"error","yml/no-tab-indent":"error","yml/vue-custom-block/no-parsing-error":"error"}}],sS=[...sk,{rules:{"yml/block-mapping-colon-indicator-newline":"error","yml/block-mapping-question-indicator-newline":"error","yml/block-mapping":"error","yml/block-sequence-hyphen-indicator-newline":"error","yml/block-sequence":"error","yml/flow-mapping-curly-newline":"error","yml/flow-mapping-curly-spacing":"error","yml/flow-sequence-bracket-newline":"error","yml/flow-sequence-bracket-spacing":"error","yml/indent":"error","yml/key-spacing":"error","yml/no-empty-document":"error","yml/no-empty-key":"error","yml/no-empty-mapping-value":"error","yml/no-empty-sequence-entry":"error","yml/no-irregular-whitespace":"error","yml/no-multiple-empty-lines":"error","yml/no-tab-indent":"error","yml/no-trailing-zeros":"error","yml/plain-scalar":"error","yml/quotes":"error","yml/spaced-comment":"error","yml/vue-custom-block/no-parsing-error":"error"}}],sw=[...sk,{rules:{"yml/block-mapping-colon-indicator-newline":"off","yml/block-mapping-question-indicator-newline":"off","yml/block-sequence-hyphen-indicator-newline":"off","yml/flow-mapping-curly-newline":"off","yml/flow-mapping-curly-spacing":"off","yml/flow-sequence-bracket-newline":"off","yml/flow-sequence-bracket-spacing":"off","yml/indent":"off","yml/key-spacing":"off","yml/no-multiple-empty-lines":"off","yml/no-trailing-zeros":"off","yml/quotes":"off"}}],sx=((e,t)=>{let n={};for(var r in e)eJ(n,r,{get:e[r],enumerable:!0});return eJ(n,Symbol.toStringTag,{value:"Module"}),n})({name:()=>sA,version:()=>sT});let sA="eslint-plugin-yml",sT="3.3.2",sL=new rX.ConfigCommentParser,sE=/^\s*eslint(?:-enable|-disable(?:(?:-next)?-line)?)?(?:\s|$)/u;var sC=class extends rX.TextSourceCodeBase{hasBOM;parserServices;visitorKeys;tokenStore;#a=null;#c=null;#u=null;constructor(e){super({ast:e.ast,text:e.text}),this.hasBOM=!!e.hasBOM,this.parserServices=e.parserServices,this.visitorKeys=e.visitorKeys||{},this.tokenStore=new r6({tokens:[...e.ast.tokens,...e.ast.comments],isComment:e=>"Block"===e.type})}traverse(){if(null!=this.#a)return this.#a;let e=[];this.#a=e;let t=this.ast;return e.push(new rX.CallMethodStep({target:"onCodePathStart",args:[{},t]})),rT(t,{enterNode(t){e.push(new rX.VisitNodeStep({target:t,phase:1,args:[t]}))},leaveNode(t){e.push(new rX.VisitNodeStep({target:t,phase:2,args:[t]}))}}),e.push(new rX.CallMethodStep({target:"onCodePathEnd",args:[{},t]})),e}get tokensAndComments(){return this.#c??=[...this.ast.tokens,...this.ast.comments].sort((e,t)=>e.range[0]-t.range[0])}getLines(){return this.lines}getAllComments(){return this.tokenStore.getAllComments()}getInlineConfigNodes(){return this.#u||(this.#u=this.ast.comments.filter(e=>sE.test(e.value))),this.#u}getDisableDirectives(){let e=[],t=[];return this.getInlineConfigNodes().forEach(n=>{let r=sL.parseDirective(n.value);if(!r)return;let{label:i,value:s,justification:o}=r;if("eslint-disable-line"===i&&n.loc.start.line!==n.loc.end.line){let t=`${i} comment should not span multiple lines.`;e.push({ruleId:null,message:t,loc:n.loc});return}switch(i){case"eslint-disable":case"eslint-enable":case"eslint-disable-next-line":case"eslint-disable-line":{let e=i.slice(7);t.push(new rX.Directive({type:e,node:n,value:s,justification:o}))}}}),{problems:e,directives:t}}applyInlineConfig(){let e=[],t=[];return this.getInlineConfigNodes().forEach(n=>{let r=sL.parseDirective(n.value);if(!r)return;let{label:i,value:s}=r;if("eslint"===i){let r=sL.parseJSONLikeConfig(s);r.ok?t.push({config:{rules:r.config},loc:n.loc}):e.push({ruleId:null,message:r.error.message,loc:n.loc})}}),{configs:t,problems:e}}getNodeByRangeIndex(e){let t=n([this.ast]);if(!t)return null;for(;;){let e=n(this._getChildren(t));if(!e)return t;t=e}function n(t){for(let n of t)if(n.range[0]<=e&&e<n.range[1])return n;return null}}getFirstToken(e,t){return this.tokenStore.getFirstToken(e,t)}getFirstTokens(e,t){return this.tokenStore.getFirstTokens(e,t)}getLastToken(e,t){return this.tokenStore.getLastToken(e,t)}getLastTokens(e,t){return this.tokenStore.getLastTokens(e,t)}getTokenBefore(e,t){return this.tokenStore.getTokenBefore(e,t)}getTokensBefore(e,t){return this.tokenStore.getTokensBefore(e,t)}getTokenAfter(e,t){return this.tokenStore.getTokenAfter(e,t)}getTokensAfter(e,t){return this.tokenStore.getTokensAfter(e,t)}getFirstTokenBetween(e,t,n){return this.tokenStore.getFirstTokenBetween(e,t,n)}getFirstTokensBetween(e,t,n){return this.tokenStore.getFirstTokensBetween(e,t,n)}getLastTokenBetween(e,t,n){return this.tokenStore.getLastTokenBetween(e,t,n)}getLastTokensBetween(e,t,n){return this.tokenStore.getLastTokensBetween(e,t,n)}getTokens(e,t){return this.tokenStore.getTokens(e,t)}getTokensBetween(e,t,n){return this.tokenStore.getTokensBetween(e,t,n)}getCommentsInside(e){return this.tokenStore.getCommentsInside(e)}getCommentsBefore(e){return this.tokenStore.getCommentsBefore(e)}getCommentsAfter(e){return this.tokenStore.getCommentsAfter(e)}commentsExistBetween(e,t){return this.tokenStore.commentsExistBetween(e,t)}isSpaceBetween(e,t){let[n,r]=e.range[1]<=t.range[0]?[e,t]:[t,e];return this.tokenStore.isSpaceBetween(n,r)}getScope(e){return e?.type!=="Program"?null:sN(this.ast)}get scopeManager(){return{scopes:[],globalScope:sN(this.ast),acquire:e=>"Program"===e.type?sN(this.ast):null,getDeclaredVariables:()=>[],addGlobals:()=>{}}}isSpaceBetweenTokens(e,t){return this.isSpaceBetween(e,t)}_getChildren(e){let t=this.visitorKeys[e.type]||[],n=[];for(let r of t){let t=e[r];if(Array.isArray(t))for(let e of t)sM(e)&&n.push(e);else sM(t)&&n.push(t)}return n}};function sM(e){return"object"==typeof e&&null!==e&&"string"==typeof e.type&&Array.isArray(e.range)&&!!e.loc&&"object"==typeof e.loc}function sN(e){let t={type:"global",block:e,set:new Map,through:[],childScopes:[],variableScope:null,variables:[],references:[],functionExpressionScope:!1,isStrict:!1,upper:null,implicit:{variables:[],set:new Map}};return t.variableScope=t,t}var sI=class{fileType="text";lineStart=1;columnStart=0;nodeTypeKey="type";validateLanguageOptions(e){}normalizeLanguageOptions(e){return{ecmaVersion:"latest",...e,parserOptions:{...e.parserOptions}}}parse(e,t){let n=e.body;try{return{ok:!0,ast:rv(n,{filePath:e.path,defaultYAMLVersion:t.languageOptions?.parserOptions?.defaultYAMLVersion})}}catch(e){return{ok:!1,errors:[{message:e instanceof Error?e.message:String(e),line:e.lineNumber??1,column:e.column??1}]}}}createSourceCode(e,t){return new sC({text:e.body,ast:t.ast,hasBOM:e.bom,parserServices:{isYAML:!0},visitorKeys:rS})}},sO={meta:sx,configs:{base:sk,recommended:sv,standard:sS,prettier:sw,"flat/base":sk,"flat/recommended":sv,"flat/standard":sS,"flat/prettier":sw},rules:Object.fromEntries(sb.map(e=>[e.meta.docs.ruleName,e])),languages:{yaml:new sI}};exports.yaml=function(){let e=[{name:"sukka/yaml disable spaced-comment",files:eF.constants.GLOB_YML,rules:{"@stylistic/spaced-comment":"off"}},{files:["pnpm-workspace.yaml"],name:"sukka/yaml/pnpm-workspace",rules:{"yml/sort-keys":["error",{order:["packages","overrides","patchedDependencies","hoistPattern","catalog","catalogs","allowedDeprecatedVersions","allowNonAppliedPatches","configDependencies","ignoredBuiltDependencies","ignoredOptionalDependencies","neverBuiltDependencies","onlyBuiltDependencies","onlyBuiltDependenciesFile","packageExtensions","peerDependencyRules","supportedArchitectures"],pathPattern:"^$"}]}}];return eK.appendArrayInPlace(e,sO.configs["flat/recommended"])};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-sukka/yaml",
|
|
3
|
-
"version": "8.10.
|
|
3
|
+
"version": "8.10.3",
|
|
4
4
|
"description": "Sukka's ESLint config",
|
|
5
5
|
"homepage": "https://github.com/SukkaW/eslint-config-sukka",
|
|
6
6
|
"repository": {
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"author": "Sukka <https://skk.moe>",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"foxts": "^5.4.
|
|
30
|
-
"@eslint-sukka/shared": "8.10.
|
|
29
|
+
"foxts": "^5.4.2",
|
|
30
|
+
"@eslint-sukka/shared": "8.10.3"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"eslint-plugin-yml": "^3.3.
|
|
33
|
+
"eslint-plugin-yml": "^3.3.2",
|
|
34
34
|
"yaml-eslint-parser": "^2.0.0",
|
|
35
|
-
"@eslint-sukka/rollup-config": "8.10.
|
|
35
|
+
"@eslint-sukka/rollup-config": "8.10.3"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "rollup -c rollup.config.ts --configPlugin swc3"
|