UNPKG

prettier

Version:

Prettier is an opinionated code formatter

137 lines • 137 kB
(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.yaml=e()}})(function(){"use strict";var Zn=Object.defineProperty;var ho=Object.getOwnPropertyDescriptor;var go=Object.getOwnPropertyNames;var yo=Object.prototype.hasOwnProperty;var Hs=(t,e)=>{for(var n in e)Zn(t,n,{get:e[n],enumerable:!0})},bo=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of go(e))!yo.call(t,r)&&r!==n&&Zn(t,r,{get:()=>e[r],enumerable:!(s=ho(e,r))||s.enumerable});return t};var wo=t=>bo(Zn({},"__esModule",{value:!0}),t);var el={};Hs(el,{languages:()=>Lr,options:()=>Pr,parsers:()=>Qs,printers:()=>Za});var Vt=(t,e)=>(n,s,...r)=>n|1&&s==null?void 0:(e.call(s)??s[t]).apply(s,r);function ko(t){return this[t<0?this.length+t:t]}var So=Vt("at",function(){if(Array.isArray(this)||typeof this=="string")return ko}),V=So;var Eo=String.prototype.replaceAll??function(t,e){return t.global?this.replace(t,e):this.split(t).join(e)},Co=Vt("replaceAll",function(){if(typeof this=="string")return Eo}),Gt=Co;var No=()=>{},dt=No;var gt="string",yt="array",Qt="cursor",Wt="indent",Ue="align",je="trim",Ve="group",Ge="fill",Qe="if-break",Ht="indent-if-break",We="line-suffix",Jt="line-suffix-boundary",be="line",Xt="label",He="break-parent",zt=new Set([Qt,Wt,Ue,je,Ve,Ge,Qe,Ht,We,Jt,be,Xt,He]);function Zt(t,e,n){if(!t.has(e)){let s=n(e);t.set(e,s)}return t.get(e)}function Ao(t){if(typeof t=="string")return gt;if(Array.isArray(t))return yt;if(!t)return;let{type:e}=t;if(zt.has(e))return e}var en=Ao;var To=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function Oo(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}', 
Expected it to be 'string' or 'object'.`;if(en(t))throw new Error("doc is valid.");let n=Object.prototype.toString.call(t);if(n!=="[object Object]")return`Unexpected doc '${n}'.`;let s=To([...zt].map(r=>`'${r}'`));return`Unexpected doc.type '${t.type}'.
Expected it to be ${s}.`}var es=class extends Error{name="InvalidDocError";constructor(e){super(Oo(e)),this.doc=e}},Js=es;function _o(t,e){if(typeof t=="string")return e(t);let n=new Map;return s(t);function s(i){return Zt(n,i,r)}function r(i){switch(en(i)){case yt:return e(i.map(s));case Ge:return e({...i,parts:i.parts.map(s)});case Qe:return e({...i,breakContents:s(i.breakContents),flatContents:s(i.flatContents)});case Ve:{let{expandedStates:o,contents:a}=i;return o?(o=o.map(s),a=o[0]):a=s(a),e({...i,contents:a,expandedStates:o})}case Ue:case Wt:case Ht:case Xt:case We:return e({...i,contents:s(i.contents)});case gt:case Qt:case je:case Jt:case be:case He:return e(i);default:throw new Js(i)}}}function Xs(t,e=we){return _o(t,n=>typeof n=="string"?q(e,n.split(`
`)):n)}var ne=dt,tn=dt,zs=dt,Zs=dt;function bt(t,e){return Zs(t),ne(e),{type:Ue,contents:e,n:t}}function ts(t){return bt(Number.NEGATIVE_INFINITY,t)}function wt(t){return bt({type:"root"},t)}function er(t){return bt(-1,t)}var kt={type:He};function nn(t){return zs(t),{type:Ge,parts:t}}function Je(t,e={}){return ne(t),tn(e.expandedStates,!0),{type:Ve,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function ns(t,e){return Je(t[0],{...e,expandedStates:t})}function St(t,e="",n={}){return ne(t),e!==""&&ne(e),{type:Qe,breakContents:t,flatContents:e,groupId:n.groupId}}function q(t,e){ne(t),tn(e);let n=[];for(let s=0;s<e.length;s++)s!==0&&n.push(t),n.push(e[s]);return n}var ke={type:be},sn={type:be,soft:!0},Io={type:be,hard:!0},O=[Io,kt],Lo={type:be,hard:!0,literal:!0},we=[Lo,kt];function tr(t){return ne(t),{type:We,contents:t}}var nr={type:je};function rn(t){return(e,n,s)=>{if(n===!1)return!1;let r=!!s?.backwards,{length:i}=e,o=n;for(;o>=0&&o<i;){let a=e.charAt(o);if(t instanceof RegExp){if(!t.test(a))return o}else if(!t.includes(a))return o;r?o--:o++}return o===-1||o===i?o:!1}}var uc=rn(/\s/),ss=rn(" 	"),pc=rn(",; 	"),mc=rn(/[^\n\r]/);var sr=t=>t===`
`||t==="\r"||t==="\u2028"||t==="\u2029";function Po(t,e,n){if(e===!1)return!1;let s=!!n?.backwards,r=t.charAt(e);if(s){if(t.charAt(e-1)==="\r"&&r===`
`)return e-2;if(sr(r))return e-1}else{if(r==="\r"&&t.charAt(e+1)===`
`)return e+2;if(sr(r))return e+1}return e}var rs=Po;function vo(t,e){let n=e-1;n=ss(t,n,{backwards:!0}),n=rs(t,n,{backwards:!0}),n=ss(t,n,{backwards:!0});let s=rs(t,n,{backwards:!0});return n!==s}var is=vo;var os=class extends Error{name="UnexpectedNodeError";constructor(e,n,s="type"){super(`Unexpected ${n} node ${s}: ${JSON.stringify(e[s])}.`),this.node=e}},rr=os;function ir(t,e){let{node:n}=t;if(n.type==="root"&&e.filepath&&/(?:[/\\]|^)\.(?:prettier|stylelint|lintstaged)rc$/.test(e.filepath))return async s=>{let r=await s(e.originalText,{parser:"json"});return r?[r,O]:void 0}}ir.getVisitorKeys=()=>[];var or=ir;var Et=null;function Ct(t){if(Et!==null&&typeof Et.property){let e=Et;return Et=Ct.prototype=null,e}return Et=Ct.prototype=t??Object.create(null),new Ct}var Do=10;for(let t=0;t<=Do;t++)Ct();function as(t){return Ct(t)}function xo(t,e="type"){as(t);function n(s){let r=s[e],i=t[r];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${r}'.`),{node:s});return i}return n}var ar=xo;var P=[["children","anchor","tag","indicatorComment","leadingComments","middleComments","trailingComment","endComments"],["anchor","tag","indicatorComment","leadingComments","middleComments","trailingComment","endComments"],["key","value","children","anchor","tag","indicatorComment","leadingComments","middleComments","trailingComment","endComments"],["content","children","anchor","tag","indicatorComment","leadingComments","middleComments","trailingComment","endComments"],["indicatorComment","leadingComments","middleComments","trailingComment","endComments"]],lr={root:P[0],document:["head","body","children","anchor","tag","indicatorComment","leadingComments","middleComments","trailingComment","endComments"],documentHead:P[0],documentBody:P[0],directive:P[1],alias:P[1],blockLiteral:P[1],blockFolded:P[0],plain:P[0],quoteSingle:P[1],quoteDouble:P[1],mapping:P[0],mappingItem:P[2],mappingKey:P[3],mappingValue:P[3],sequence:P[0],sequenceItem:P[3],flowMapping:P[0],flowMappingItem:P[2],flowSequence:P[0],flowSequenceItem:P[3],comment:P[1],tag:P[4],anchor:P[4]};var Mo=ar(lr),cr=Mo;var Be=t=>t.position.start.offset,fr=t=>t.position.end.offset;var ur="format";var pr=/^\s*#[^\S\n]*@(?:noformat|noprettier)\s*?(?:\n|$)/,mr=/^\s*#[^\S\n]*@(?:format|prettier)\s*?(?:\n|$)/,hr=/^\s*@(?:format|prettier)\s*$/;var dr=t=>hr.test(t),gr=t=>mr.test(t),yr=t=>pr.test(t),br=t=>`# @${ur}

${t}`;function ls(t,e){switch(t.type){case"comment":if(dr(t.value))return null;break;case"quoteDouble":case"quoteSingle":e.type="quote";break;case"document":e.directivesEndMarker||delete e.directivesEndMarker,e.documentEndMarker||delete e.documentEndMarker;break}}ls.ignoredProperties=new Set(["position"]);function $o(t){return Array.isArray(t)&&t.length>0}var Xe=$o;function F(t,e){return typeof t?.type=="string"&&e.includes(t.type)}function cs(t,e,n){return e("children"in t?{...t,children:t.children.map(s=>cs(s,e,t))}:t,n)}function ze(t,e,n){Object.defineProperty(t,e,{get:n,enumerable:!1})}function kr(t,e){let n=0,s=e.length;for(let r=t.position.end.offset-1;r<s;r++){let i=e[r];if(i===`
`&&n++,n===1&&/\S/.test(i))return!1;if(n===2)return!0}return!1}function on(t){let{node:e}=t;switch(e.type){case"tag":case"anchor":case"comment":return!1}let n=t.stack.length;for(let s=1;s<n;s++){let r=t.stack[s],i=t.stack[s-1];if(Array.isArray(i)&&typeof r=="number"&&r!==i.length-1)return!1}return!0}function Ze(t){return Xe(t.children)?Ze(V(0,t.children,-1)):t}function wr(t){return t.value.trim()==="prettier-ignore"}function Sr(t){let{node:e}=t;if(e.type==="documentBody"){let n=t.parent.head;return K(n)&&wr(V(0,n.endComments,-1))}return ce(e)&&wr(V(0,e.leadingComments,-1))}function et(t){return!Xe(t.children)&&!Bo(t)}function Bo(t){return ce(t)||_e(t)||fs(t)||J(t)||K(t)}function ce(t){return Xe(t?.leadingComments)}function _e(t){return Xe(t?.middleComments)}function fs(t){return t?.indicatorComment}function J(t){return t?.trailingComment}function K(t){return Xe(t?.endComments)}function Er(t){return t?t.split(/(?<!^| ) (?! |$)/):[]}function Cr(t,e,n){let s=e.split(`
`).map((i,o,a)=>o===0&&o===a.length-1?i:o!==0&&o!==a.length-1?i.trim():o===0?i.trimEnd():i.trimStart());if(n.proseWrap==="preserve")return s.map(i=>i?[i]:[]);let r=[];for(let[i,o]of s.entries()){let a=Er(o);i>0&&s[i-1].length>0&&a.length>0&&!(t==="quoteDouble"&&V(0,V(0,r,-1),-1).endsWith("\\"))?r[r.length-1]=[...V(0,r,-1),...a]:r.push(a)}return n.proseWrap==="never"?r.map(i=>[i.join(" ")]):r}function Nr(t,{parentIndent:e,isLastDescendant:n,options:s}){let r=t.position.start.line===t.position.end.line?"":s.originalText.slice(t.position.start.offset,t.position.end.offset).match(/^[^\n]*\n(.*)$/s)[1];if(r==="")return[];let i;if(t.indent===null){let c=r.match(/^(?<leadingSpace> *)[^\n\r ]/m);i=c?c.groups.leadingSpace.length:Number.POSITIVE_INFINITY}else i=t.indent-1+e;let o=r.split(`
`).map(c=>c.slice(i));if(s.proseWrap==="preserve"||t.type==="blockLiteral")return l(o.map(c=>c?[c]:[]));let a=[];for(let[c,u]of o.entries()){let f=Er(u);c>0&&f.length>0&&o[c-1].length>0&&!/^\s/.test(f[0])&&!/^\s|\s$/.test(V(0,a,-1))?a[a.length-1]=[...V(0,a,-1),...f]:a.push(f)}return a=a.map(c=>{let u=[];for(let f of c)u.length>0&&/\s$/.test(V(0,u,-1))?u[u.length-1]+=" "+f:u.push(f);return u}),s.proseWrap==="never"&&(a=a.map(c=>c.length===0?c:[c.join(" ")])),l(a);function l(c){if(t.chomping==="keep")return r.endsWith(`
`)&&V(0,c,-1).length===0?c.slice(0,-1):c;let u=0;for(let f=c.length-1;f>=0&&c[f].length===0;f--)u++;return u===0?c:u>=2&&!n?c.slice(0,-(u-1)):c.slice(0,-u)}}function Re(t){return/[ \t]+\n*$/.test(t.value)}function an(t){let e=Ze(t);return F(e,["blockLiteral","blockFolded"])&&Re(e)}function Nt(t){if(!t)return!0;switch(t.type){case"plain":case"quoteDouble":case"quoteSingle":case"alias":case"flowMapping":case"flowSequence":return!0;default:return!1}}var Ro=new WeakMap,Ar=t=>Zt(Ro,t.root,()=>new Set),us=(t,e=t.node)=>{Ar(t).add(e.position.end.offset)},qo=(t,e=t.node)=>Ar(t).has(e.position.end.offset);function ln(t,e){if(!qo(t)){us(t);let{node:n}=t;if(kr(n,e)&&!ps(t.parent))return sn}return""}function ps(t){return K(t)&&!F(t,["documentHead","documentBody","flowMapping","flowSequence"])}function Y(t,e){return bt(" ".repeat(t),e)}function Fo(t,e,n){let{node:s}=t,r=t.ancestors.filter(c=>c.type==="sequence"||c.type==="mapping").length,i=on(t),o=[s.type==="blockFolded"?">":"|"];s.indent!==null&&o.push(s.indent.toString()),s.chomping!=="clip"&&o.push(s.chomping==="keep"?"+":"-"),fs(s)&&o.push(" ",n("indicatorComment"));let a=Nr(s,{parentIndent:r,isLastDescendant:i,options:e}),l=[];for(let[c,u]of a.entries())c===0&&l.push(O),l.push(nn(q(ke,u))),c!==a.length-1?l.push(u.length===0?O:wt(we)):i&&(s.chomping==="keep"||Re(s))?l.push(ts(u.length===0?O:we)):u.length===0&&Re(s)&&l.push(nr);return s.indent===null?o.push(er(Y(e.tabWidth,l))):o.push(ts(Y(s.indent-1+r,l))),o}var Tr=Fo;function cn(t,e,n){let{node:s}=t,r=s.type==="flowMapping",i=r?"{":"[",o=r?"}":"]",a=sn;r&&s.children.length>0&&e.bracketSpacing&&(a=ke);let l=V(0,s.children,-1),c=l?.type==="flowMappingItem"&&et(l.key)&&et(l.value);return[i,Y(e.tabWidth,[a,Ko(t,e,n),e.trailingComma==="none"?"":St(","),K(s)?[O,q(O,t.map(n,"endComments"))]:""]),c?"":a,o]}function Ko(t,e,n){return t.map(({isLast:s,node:r,next:i})=>[n(),s?"":[",",ke,r.position.start.line!==i.position.start.line?ln(t,e.originalText):""]],"children")}function Yo(t,e,n){let{node:s,parent:r}=t,{key:i,value:o}=s,a=et(i),l=et(o);if(a&&l)return": ";let c=n("key"),u=Uo(s)?" ":"";if(l)return s.type==="flowMappingItem"&&r.type==="flowMapping"?c:s.type==="mappingItem"&&fn(i.content,e)&&!J(i.content)&&r.tag?.value!=="tag:yaml.org,2002:set"?[c,u,":"]:["? ",Y(2,c)];let f=n("value");if(a)return[": ",Y(2,f)];if(ce(o)||!Nt(i.content))return["? ",Y(2,c),O,...t.map(()=>[n(),O],"value","leadingComments"),": ",Y(2,f)];if(jo(i.content)&&!ce(i.content)&&!_e(i.content)&&!J(i.content)&&!K(i)&&!ce(o.content)&&!_e(o.content)&&!K(o)&&fn(o.content,e)&&fn(i.content,e))return[c,u,": ",f];let p=Symbol("mappingKey"),h=Je([St("? "),Je(Y(2,c),{id:p})]),g=[O,": ",Y(2,f)],m=[u,":"];K(o)&&o.content&&F(o.content,["flowMapping","flowSequence"])&&o.content.children.length===0?m.push(" "):ce(o.content)||K(o)&&o.content&&!F(o.content,["mapping","sequence"])||r.type==="mapping"&&J(i.content)&&Nt(o.content)||F(o.content,["mapping","sequence"])&&o.content.tag===null&&o.content.anchor===null?m.push(O):o.content?m.push(ke):J(o)&&m.push(" "),m.push(f);let d=Y(e.tabWidth,m);return fn(i.content,e)&&!ce(i.content)&&!_e(i.content)&&!J(i.content)&&!K(i)?ns([[c,d]]):ns([[h,St(g,d,{groupId:p})]])}function fn(t,e){if(!t)return!0;switch(t.type){case"plain":case"quoteSingle":case"quoteDouble":break;case"alias":return!0;default:return!1}if(e.proseWrap==="preserve")return t.position.start.line===t.position.end.line;if(/\\$/m.test(e.originalText.slice(t.position.start.offset,t.position.end.offset)))return!1;switch(e.proseWrap){case"never":return!t.value.includes(`
`);case"always":return!/[\n ]/.test(t.value);default:return!1}}function Uo(t){return t.key.content?.type==="alias"}function jo(t){if(!t)return!0;switch(t.type){case"plain":case"quoteDouble":case"quoteSingle":return t.position.start.line===t.position.end.line;case"alias":return!0;default:return!1}}var Or=Yo;function Vo(t){return cs(t,Go)}function Go(t){switch(t.type){case"document":ze(t,"head",()=>t.children[0]),ze(t,"body",()=>t.children[1]);break;case"documentBody":case"sequenceItem":case"flowSequenceItem":case"mappingKey":case"mappingValue":ze(t,"content",()=>t.children[0]);break;case"mappingItem":case"flowMappingItem":ze(t,"key",()=>t.children[0]),ze(t,"value",()=>t.children[1]);break}return t}var _r=Vo;function Qo(t,e,n){let{node:s}=t,r=[];s.type!=="mappingValue"&&ce(s)&&r.push([q(O,t.map(n,"leadingComments")),O]);let i=["tag","anchor"].filter(a=>s[a]);i.length>1&&i.sort((a,l)=>Be(s[a])-Be(s[l]));for(let[a,l]of i.entries())a>0&&r.push(" "),r.push(n(l));let o="";return F(s,["mapping","sequence","comment","directive","mappingItem","sequenceItem"])&&!on(t)&&(o=ln(t,e.originalText)),i.length>0&&(F(s,["sequence","mapping"])&&!_e(s)?r.push(O):r.push(" ")),_e(s)&&r.push([s.middleComments.length===1?"":O,q(O,t.map(n,"middleComments")),O]),Sr(t)?r.push(Xs(e.originalText.slice(s.position.start.offset,s.position.end.offset).trimEnd())):r.push(Je(Wo(t,e,n))),J(s)&&!F(s,["document","documentHead"])&&r.push(tr([s.type==="mappingValue"&&!s.content?"":" ",t.parent.type==="mappingKey"&&t.getParentNode(2).type==="mapping"&&Nt(s)?"":kt,n("trailingComment")])),ps(s)&&r.push(Y(s.type==="sequenceItem"?2:0,[an(s)?wt(we):O,q(O,t.map(({node:a})=>[is(e.originalText,Be(a))?O:"",n()],"endComments"))])),F(s,["mappingItem","sequenceItem"])&&!t.isLast&&an(s)&&r.push(wt(we)),r.push(o),r}function Wo(t,e,n){let{node:s}=t;switch(s.type){case"root":{let r=Ze(s),i=F(r,["blockLiteral","blockFolded"])&&r.chomping==="keep",a=!(i||F(r,["blockLiteral","blockFolded"])&&Re(r)),l=[],c=!1,u=!1;return t.each(({node:f,isFirst:p,isLast:h})=>{!p&&!u&&l.push(O),l.push(n());let g=Ze(f),m=F(g,["blockLiteral","blockFolded"])&&(Re(g)||h&&g.chomping==="keep");m&&!h&&l.push(we);let d=Jo(t);c=d,d&&(m||l.push(O),l.push("..."),J(f)&&l.push(" ",n("trailingComment"))),u=m&&!d},"children"),(a||c&&!i)&&l.push(O),l}case"document":{let r=[];return Xo(t)&&((s.head.children.length>0||s.head.endComments.length>0)&&r.push(n("head")),J(s.head)?r.push(["---"," ",n(["head","trailingComment"])]):r.push("---")),Ho(s)&&r.push(n("body")),q(O,r)}case"documentHead":return q(O,[...t.map(n,"children"),...t.map(n,"endComments")]);case"documentBody":{let{children:r,endComments:i}=s,o="";if(r.length>0&&i.length>0){let a=Ze(s);if(F(a,["blockFolded","blockLiteral"]))a.chomping!=="keep"&&(o=[O,O]);else{let l=V(0,r,-1),c=F(l,["mapping"])&&is(e.originalText,Be(i[0]));c&&us(t,l),o=c?[O,O]:O}}return[q(O,t.map(n,"children")),o,q(O,t.map(n,"endComments"))]}case"directive":return["%",q(" ",[s.name,...s.parameters])];case"comment":return["#",s.value];case"alias":return["*",s.value];case"tag":return e.originalText.slice(s.position.start.offset,s.position.end.offset);case"anchor":return["&",s.value];case"plain":return At(s.type,e.originalText.slice(s.position.start.offset,s.position.end.offset),e);case"quoteDouble":case"quoteSingle":{let o=e.originalText.slice(s.position.start.offset+1,s.position.end.offset-1);if(s.type==="quoteSingle"&&o.includes("\\")||s.type==="quoteDouble"&&/\\[^"]/.test(o)){let l=s.type==="quoteDouble"?'"':"'";return[l,At(s.type,o,e),l]}if(o.includes('"'))return["'",At(s.type,s.type==="quoteDouble"?Gt(0,Gt(0,o,'\\"','"'),"'","'".repeat(2)):o,e),"'"];if(o.includes("'"))return['"',At(s.type,s.type==="quoteSingle"?Gt(0,o,"''","'"):o,e),'"'];let a=e.singleQuote?"'":'"';return[a,At(s.type,o,e),a]}case"blockFolded":case"blockLiteral":return Tr(t,e,n);case"mapping":case"sequence":return t.map(({node:r,isLast:i})=>[n(),!i&&!an(r)?O:""],"children");case"sequenceItem":return["- ",Y(2,s.content?n("content"):"")];case"mappingKey":case"mappingValue":return s.content?n("content"):"";case"mappingItem":case"flowMappingItem":return Or(t,e,n);case"flowMapping":return cn(t,e,n);case"flowSequence":return cn(t,e,n);case"flowSequenceItem":return n("content");default:throw new rr(s,"YAML")}}function Ho(t){return t.body.children.length>0||K(t.body)}function Jo(t){let e=t.node;if(e.documentEndMarker||J(e))return!0;if(t.isLast)return!1;let n=t.next;return n.head.children.length>0||K(n.head)}function Xo(t){let e=t.node;return e.directivesEndMarker||e.head.children.length>0||K(e.head)||J(e.head)}function At(t,e,n){let s=Cr(t,e,n);return q(O,s.map(r=>nn(q(ke,r))))}var zo={preprocess:_r,embed:or,print:Qo,massageAstNode:ls,insertPragma:br,getVisitorKeys:cr},Ir=zo;var Lr=[{name:"YAML",type:"data",aceMode:"yaml",extensions:[".yml",".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".clangd",".eslintrc",".gemrc",".releaserc","CITATION.cff","glide.lock","pixi.lock",".prettierrc",".stylelintrc",".lintstagedrc"],tmScope:"source.yaml",aliases:["yml"],codemirrorMode:"yaml",codemirrorMimeType:"text/x-yaml",parsers:["yaml"],vscodeLanguageIds:["yaml","ansible","dockercompose","github-actions-workflow","home-assistant"],linguistLanguageId:407}];var un={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var Zo={bracketSpacing:un.bracketSpacing,singleQuote:un.singleQuote,proseWrap:un.proseWrap},Pr=Zo;var Qs={};Hs(Qs,{yaml:()=>za});var Tt=class extends SyntaxError{name="YAMLSyntaxError";code;source;position;constructor(t,e){super(e.message,{cause:e}),this.cause??(this.cause=e),this.code=e.code,this.source=t.text,this.position=t.transformRange(e.pos)}};function W(t,e=null){"children"in t&&t.children.forEach(n=>W(n,t)),"anchor"in t&&t.anchor&&W(t.anchor,t),"tag"in t&&t.tag&&W(t.tag,t);"leadingComments"in t&&t.leadingComments.forEach(n=>W(n,t)),"middleComments"in t&&t.middleComments.forEach(n=>W(n,t)),"indicatorComment"in t&&t.indicatorComment&&W(t.indicatorComment,t),"trailingComment"in t&&t.trailingComment&&W(t.trailingComment,t),"endComments"in t&&t.endComments.forEach(n=>W(n,t)),Object.defineProperty(t,"_parent",{value:e,enumerable:!1})}function Ie(t){return`${t.line}:${t.column}`}function vr(t){W(t);let e=ea(t),n=t.children.slice();t.comments.filter(s=>!s._parent).forEach(s=>{for(;n.length>1&&s.position.start.line>n[0].position.end.line;)n.shift();ta(s,e,n[0])})}function ea(t){let e=Array.from(new Array(t.position.end.line),()=>({}));for(let n of t.comments)e[n.position.start.line-1].comment=n;return Dr(e,t),e}function Dr(t,e){if(e.position.start.offset!==e.position.end.offset){if("leadingComments"in e){let{start:n}=e.position,{leadingAttachableNode:s}=t[n.line-1];(!s||n.column<s.position.start.column)&&(t[n.line-1].leadingAttachableNode=e)}if("trailingComment"in e&&e.position.end.column>1&&e.type!=="document"&&e.type!=="documentHead"){let{end:n}=e.position,{trailingAttachableNode:s}=t[n.line-1];(!s||n.column>=s.position.end.column)&&(t[n.line-1].trailingAttachableNode=e)}if(e.type!=="root"&&e.type!=="document"&&e.type!=="documentHead"&&e.type!=="documentBody"){let{start:n,end:s}=e.position,r=[s.line].concat(n.line===s.line?[]:n.line);for(let i of r){let o=t[i-1].trailingNode;(!o||s.column>=o.position.end.column)&&(t[i-1].trailingNode=e)}}"children"in e&&e.children.forEach(n=>{Dr(t,n)})}}function ta(t,e,n){let s=t.position.start.line,{trailingAttachableNode:r}=e[s-1];if(r){if(r.trailingComment)throw new Error(`Unexpected multiple trailing comment at ${Ie(t.position.start)}`);W(t,r),r.trailingComment=t;return}for(let o=s;o>=n.position.start.line;o--){let{trailingNode:a}=e[o-1],l;if(a)l=a;else if(o!==s&&e[o-1].comment)l=e[o-1].comment._parent;else continue;if((l.type==="sequence"||l.type==="mapping")&&(l=l.children[0]),l.type==="mappingItem"){let[c,u]=l.children;l=xr(c)?c:u}for(;;){if(na(l,t)){W(t,l),l.endComments.push(t);return}if(!l._parent)break;l=l._parent}break}for(let o=s+1;o<=n.position.end.line;o++){let{leadingAttachableNode:a}=e[o-1];if(a){W(t,a),a.leadingComments.push(t);return}}let i=n.children[1];W(t,i),i.endComments.push(t)}function na(t,e){if(t.position.start.offset<e.position.start.offset&&t.position.end.offset>e.position.end.offset)switch(t.type){case"flowMapping":case"flowSequence":return t.children.length===0||e.position.start.line>t.children[t.children.length-1].position.end.line}if(e.position.end.offset<t.position.end.offset)return!1;switch(t.type){case"sequenceItem":return e.position.start.column>t.position.start.column;case"mappingKey":case"mappingValue":return e.position.start.column>t._parent.position.start.column&&(t.children.length===0||t.children.length===1&&t.children[0].type!=="blockFolded"&&t.children[0].type!=="blockLiteral")&&(t.type==="mappingValue"||xr(t));default:return!1}}function xr(t){return t.position.start!==t.position.end&&(t.children.length===0||t.position.start.offset!==t.children[0].position.start.offset)}function Mr(t,e,n){return{type:"root",position:t,children:e,comments:n}}function X(t,e){return{start:t,end:e}}function $r(t){return{start:t,end:t}}function Br(t,e){return{type:"comment",position:e.transformRange([t.offset,t.offset+t.source.length]),value:t.source.slice(1)}}function Rr(t,e){return{type:"anchor",position:t,value:e}}function qr(t,e,n){return{anchor:e,tag:t,middleComments:n}}function Fr(t,e){return{type:"tag",position:t,value:e}}function Kr(t,e,n){let s=[],r=null,i=null,o=null;for(let a of e){let l=[a.offset,a.offset+a.source.length];switch(a.type){case"tag":{r??(r=l);let c=t.tag??a.source.slice(a.source.startsWith("!!")?2:1);c==="!"&&(c="tag:yaml.org,2002:str"),i=Fr(n.transformRange(l),c)}break;case"anchor":r??(r=l),o=Rr(n.transformRange(l),t.anchor);break;case"comment":{let c=n.transformComment(a);r&&r[0]<=l[0]&&l[1]<=t.range[0]&&s.push(c);break}default:throw new Error(`Unexpected content property token type: ${a.type}`)}}return qr(i,o,s)}function Yr(t,e,n){return{type:"alias",position:t,leadingComments:[],trailingComment:null,...e,value:n}}function*R(...t){for(let e of t)if(e)for(let n of e)sa(n)||(yield n)}function sa(t){return t.type==="space"||t.type==="newline"}function Se(t){return t.type==="comment"||t.type==="tag"||t.type==="anchor"}function v(t,e){let n=[];for(let s of R(t))s.type==="comment"?e.transformComment(s):n.push(s);return n}function Ur(t,e,n){let s=t.srcToken;for(let r of v(s.end,e))throw new Error(`Unexpected token type in alias end: ${r.type}`);return Yr(e.transformRange(t.range),e.transformContentProperties(t,n.tokens),t.source)}function jr(t){return{...t,type:"blockFolded"}}function Vr(t,e,n,s,r,i){return{type:"blockValue",position:t,leadingComments:[],...e,chomping:n,indent:s,value:r,indicatorComment:i}}function pn(t,e,n,s){let r=null,i=null;for(let l of R(e.props))if(l.type==="comment")i=n.transformComment(l);else if(l.type==="block-scalar-header")r=l;else throw new Error(`Unexpected token type in block value end: ${l.type}`);if(!r)throw new Error("Expected block scalar header token");let o=ra(r.source),a=n.transformRange(t.range);return Vr(a,n.transformContentProperties(t,s.tokens),o.chomping,o.indent,t.source,i)}function ra(t){let e=/([+-]?)(\d*)([+-]?)$/u.exec(t),n=null,s="clip";if(e){n=e[2]?Number(e[2]):null;let r=e[3]||e[1];s=r==="+"?"keep":r==="-"?"strip":"clip"}return{chomping:s,indent:n}}function Gr(t,e,n){let s=t.srcToken;if(!s||s.type!=="block-scalar")throw new Error("Expected block scalar srcToken");return jr(pn(t,s,e,n))}function Qr(t){return{...t,type:"blockLiteral"}}function Wr(t,e,n){let s=t.srcToken;if(!s||s.type!=="block-scalar")throw new Error("Expected block scalar srcToken");return Qr(pn(t,s,e,n))}function mn(t,e,n){return{type:"flowCollection",position:t,leadingComments:[],trailingComment:null,endComments:[],...e,children:n}}function Hr(t,e,n){return{...mn(t,e,n),type:"flowMapping"}}function Ot(t,e,n){return{type:"flowMappingItem",position:t,leadingComments:[],children:[e,n]}}function Jr(t,e){return{type:"mappingKey",position:t,trailingComment:null,endComments:[],children:e?[e]:[]}}function ms(t,e){return{type:"mappingValue",position:t,leadingComments:[],trailingComment:null,endComments:[],children:e?[e]:[]}}function Ee(t,e,n,s){var r;let i=[],o=null;for(let h of R(e.start)){if(Se(h)){i.push(h);continue}if(h.type==="explicit-key-ind"){o=h;continue}if(h.type==="comma")continue;throw new Error(`Unexpected token type in collection item start: ${h.type}`)}let a=[],l=null;for(let h of R(e.sep)){if(Se(h)){a.push(h);continue}if(h.type==="map-value-ind"){l=h;continue}throw new Error(`Unexpected token type in collection item sep: ${h.type}`)}let c=o?.offset??((r=e.key)===null||r===void 0?void 0:r.offset)??l?.offset??e.value.offset,u=[c,e.key?t.key.range[1]:o?o.offset+o.source.length:c],f=null;if(t.value){var p;let h=l?.offset??((p=e.value)===null||p===void 0?void 0:p.offset)??t.value.range[0];f=[h,e.value?t.value.range[1]:l?l.offset+l.source.length:h]}return ia(t,n,s,{range:u,props:{tokens:i}},{range:f,props:{tokens:a}})}function ia(t,e,n,s,r){let i=null;_t(t.key,s.props)?v(s.props.tokens,e):i=e.transformNode(t.key,s.props);let o=null;_t(t.value,r.props)?v(r.props.tokens,e):o=e.transformNode(t.value,r.props);let a=Jr(e.transformRange([s.range?s.range[0]:i.position.start.offset,i?i.position.end.offset:s.range[1]]),i),l=o||r.range?ms(e.transformRange([r.range?r.range[0]:o.position.start.offset,o?o.position.end.offset:r.range[0]+1]),o):null;return n(X(a.position.start,l?l.position.end:a.position.end),a,l||ms($r(a.position.end),null))}function Xr(t,e,n){let s=t.srcToken;if(!s||s.type!=="flow-collection")throw new Error("Expected flow-collection CST node for flow map");let r=t.items.map((o,a)=>{let l=s.items[a];return Ee(o,l,e,Ot)});if(t.items.length<s.items.length)for(let o=t.items.length;o<s.items.length;o++){let a=s.items[o];for(let l of v(a.start,e)){if(l.type==="comma")continue;throw new Error(`Unexpected token type in collection item start: ${l.type}`)}}let i=null;for(let o of v(s.end,e)){if(o.type==="flow-map-end"){i=o;continue}throw new Error(`Unexpected token type in flow map end: ${o.type}`)}if(!i)throw new Error("Expected flow-map-end token");return Hr(e.transformRange([s.start.offset,i.offset+i.source.length]),e.transformContentProperties(t,n.tokens),r)}function zr(t,e,n){return{...mn(t,e,n),type:"flowSequence"}}function Zr(t,e){return{type:"flowSequenceItem",position:t,children:[e]}}function se(t){return t[t.length-1]}var hn=Symbol.for("yaml.alias"),dn=Symbol.for("yaml.document"),re=Symbol.for("yaml.map"),hs=Symbol.for("yaml.pair"),z=Symbol.for("yaml.scalar"),Ce=Symbol.for("yaml.seq"),G=Symbol.for("yaml.node.type"),Z=t=>!!t&&typeof t=="object"&&t[G]===hn,fe=t=>!!t&&typeof t=="object"&&t[G]===dn,Q=t=>!!t&&typeof t=="object"&&t[G]===re,T=t=>!!t&&typeof t=="object"&&t[G]===hs,N=t=>!!t&&typeof t=="object"&&t[G]===z,ee=t=>!!t&&typeof t=="object"&&t[G]===Ce;function I(t){if(t&&typeof t=="object")switch(t[G]){case re:case Ce:return!0}return!1}function _(t){if(t&&typeof t=="object")switch(t[G]){case hn:case re:case z:case Ce:return!0}return!1}var gn=t=>(N(t)||I(t))&&!!t.anchor;var H=Symbol("break visit"),ei=Symbol("skip children"),ue=Symbol("remove node");function pe(t,e){let n=ti(e);fe(t)?tt(null,t.contents,n,Object.freeze([t]))===ue&&(t.contents=null):tt(null,t,n,Object.freeze([]))}pe.BREAK=H;pe.SKIP=ei;pe.REMOVE=ue;function tt(t,e,n,s){let r=ni(t,e,n,s);if(_(r)||T(r))return si(t,s,r),tt(t,r,n,s);if(typeof r!="symbol"){if(I(e)){s=Object.freeze(s.concat(e));for(let i=0;i<e.items.length;++i){let o=tt(i,e.items[i],n,s);if(typeof o=="number")i=o-1;else{if(o===H)return H;o===ue&&(e.items.splice(i,1),i-=1)}}}else if(T(e)){s=Object.freeze(s.concat(e));let i=tt("key",e.key,n,s);if(i===H)return H;i===ue&&(e.key=null);let o=tt("value",e.value,n,s);if(o===H)return H;o===ue&&(e.value=null)}}return r}async function yn(t,e){let n=ti(e);fe(t)?await nt(null,t.contents,n,Object.freeze([t]))===ue&&(t.contents=null):await nt(null,t,n,Object.freeze([]))}yn.BREAK=H;yn.SKIP=ei;yn.REMOVE=ue;async function nt(t,e,n,s){let r=await ni(t,e,n,s);if(_(r)||T(r))return si(t,s,r),nt(t,r,n,s);if(typeof r!="symbol"){if(I(e)){s=Object.freeze(s.concat(e));for(let i=0;i<e.items.length;++i){let o=await nt(i,e.items[i],n,s);if(typeof o=="number")i=o-1;else{if(o===H)return H;o===ue&&(e.items.splice(i,1),i-=1)}}}else if(T(e)){s=Object.freeze(s.concat(e));let i=await nt("key",e.key,n,s);if(i===H)return H;i===ue&&(e.key=null);let o=await nt("value",e.value,n,s);if(o===H)return H;o===ue&&(e.value=null)}}return r}function ti(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function ni(t,e,n,s){if(typeof n=="function")return n(t,e,s);if(Q(e))return n.Map?.(t,e,s);if(ee(e))return n.Seq?.(t,e,s);if(T(e))return n.Pair?.(t,e,s);if(N(e))return n.Scalar?.(t,e,s);if(Z(e))return n.Alias?.(t,e,s)}function si(t,e,n){let s=e[e.length-1];if(I(s))s.items[t]=n;else if(T(s))t==="key"?s.key=n:s.value=n;else if(fe(s))s.contents=n;else{let r=Z(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}var oa={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},aa=t=>t.replace(/[!,[\]{}]/g,e=>oa[e]),me=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let s=e.trim().split(/[ \t]+/),r=s.shift();switch(r){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[i,o]=s;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[i]=s;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,s,r]=e.match(/^(.*!)([^!]*)$/s);r||n(`The ${e} tag has no suffix`);let i=this.tags[s];if(i)try{return i+decodeURIComponent(r)}catch(o){return n(String(o)),null}return s==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,s]of Object.entries(this.tags))if(e.startsWith(s))return n+aa(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),r;if(e&&s.length>0&&_(e.contents)){let i={};pe(e.contents,(o,a)=>{_(a)&&a.tag&&(i[a.tag]=!0)}),r=Object.keys(i)}else r=[];for(let[i,o]of s)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(a=>a.startsWith(o)))&&n.push(`%TAG ${i} ${o}`);return n.join(`
`)}};me.defaultYaml={explicit:!1,version:"1.2"};me.defaultTags={"!!":"tag:yaml.org,2002:"};function bn(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function ds(t){let e=new Set;return pe(t,{Value(n,s){s.anchor&&e.add(s.anchor)}}),e}function gs(t,e){for(let n=1;;++n){let s=`${t}${n}`;if(!e.has(s))return s}}function ri(t,e){let n=[],s=new Map,r=null;return{onAnchor:i=>{n.push(i),r??(r=ds(t));let o=gs(e,r);return r.add(o),o},setAnchors:()=>{for(let i of n){let o=s.get(i);if(typeof o=="object"&&o.anchor&&(N(o.node)||I(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:s}}function Le(t,e,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let r=0,i=s.length;r<i;++r){let o=s[r],a=Le(t,s,String(r),o);a===void 0?delete s[r]:a!==o&&(s[r]=a)}else if(s instanceof Map)for(let r of Array.from(s.keys())){let i=s.get(r),o=Le(t,s,r,i);o===void 0?s.delete(r):o!==i&&s.set(r,o)}else if(s instanceof Set)for(let r of Array.from(s)){let i=Le(t,s,r,r);i===void 0?s.delete(r):i!==r&&(s.delete(r),s.add(i))}else for(let[r,i]of Object.entries(s)){let o=Le(t,s,r,i);o===void 0?delete s[r]:o!==i&&(s[r]=o)}return t.call(e,n,s)}function B(t,e,n){if(Array.isArray(t))return t.map((s,r)=>B(s,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!gn(t))return t.toJSON(e,n);let s={aliasCount:0,count:1,res:void 0};n.anchors.set(t,s),n.onCreate=i=>{s.res=i,delete n.onCreate};let r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}var Pe=class{constructor(e){Object.defineProperty(this,G,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:s,onAnchor:r,reviver:i}={}){if(!fe(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=B(this,"",o);if(typeof r=="function")for(let{count:l,res:c}of o.anchors.values())r(c,l);return typeof i=="function"?Le(i,{"":a},"",a):a}};var Ne=class extends Pe{constructor(e){super(hn),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let s;n?.aliasResolveCache?s=n.aliasResolveCache:(s=[],pe(e,{Node:(i,o)=>{(Z(o)||gn(o))&&s.push(o)}}),n&&(n.aliasResolveCache=s));let r;for(let i of s){if(i===this)break;i.anchor===this.source&&(r=i)}if(r&&n){let{anchors:i,doc:o,maxAliasCount:a}=n,l=i.get(r);if(l||(B(r,null,n),l=i.get(r)),l?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=wn(o,r,i)),l.count*l.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}}return r}toJSON(e,n){if(!n)return{source:this.source};let s=this.resolve(n.doc,n);if(!s){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(r)}return n.anchors.get(s).res}toString(e,n,s){let r=`*${this.source}`;if(e){if(bn(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${r} `}return r}};function wn(t,e,n){if(Z(e)){let s=e.resolve(t),r=n&&s&&n.get(s);return r?r.count*r.aliasCount:0}else if(I(e)){let s=0;for(let r of e.items){let i=wn(t,r,n);i>s&&(s=i)}return s}else if(T(e)){let s=wn(t,e.key,n),r=wn(t,e.value,n);return Math.max(s,r)}return 1}var kn=t=>!t||typeof t!="function"&&typeof t!="object",y=class extends Pe{constructor(e){super(z),this.value=e}toJSON(e,n){return n?.keep?this.value:B(this.value,e,n)}toString(){return String(this.value)}};y.BLOCK_FOLDED="BLOCK_FOLDED";y.BLOCK_LITERAL="BLOCK_LITERAL";y.PLAIN="PLAIN";y.QUOTE_DOUBLE="QUOTE_DOUBLE";y.QUOTE_SINGLE="QUOTE_SINGLE";var la="tag:yaml.org,2002:";function ca(t,e,n){if(e){let s=n.filter(i=>i.tag===e),r=s.find(i=>!i.format)??s[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find(s=>s.identify?.(t)&&!s.format)}function Ae(t,e,n){if(fe(t)&&(t=t.contents),_(t))return t;if(T(t)){let f=n.schema[re].createNode?.(n.schema,null,n);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:s,onAnchor:r,onTagObj:i,schema:o,sourceObjects:a}=n,l;if(s&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor??(l.anchor=r(t)),new Ne(l.anchor);l={anchor:null,node:null},a.set(t,l)}e?.startsWith("!!")&&(e=la+e.slice(2));let c=ca(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new y(t);return l&&(l.node=f),f}c=t instanceof Map?o[re]:Symbol.iterator in Object(t)?o[Ce]:o[re]}i&&(i(c),delete n.onTagObj);let u=c?.createNode?c.createNode(n.schema,t,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,t,n):new y(t);return e?u.tag=e:c.default||(u.tag=c.tag),l&&(l.node=u),u}function It(t,e,n){let s=n;for(let r=e.length-1;r>=0;--r){let i=e[r];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let o=[];o[i]=s,s=o}else s=new Map([[i,s]])}return Ae(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var rt=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,st=class extends Pe{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(s=>_(s)||T(s)?s.clone(e):s),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(rt(e))this.add(n);else{let[s,...r]=e,i=this.get(s,!0);if(I(i))i.addIn(r,n);else if(i===void 0&&this.schema)this.set(s,It(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}deleteIn(e){let[n,...s]=e;if(s.length===0)return this.delete(n);let r=this.get(n,!0);if(I(r))return r.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(e,n){let[s,...r]=e,i=this.get(s,!0);return r.length===0?!n&&N(i)?i.value:i:I(i)?i.getIn(r,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!T(n))return!1;let s=n.value;return s==null||e&&N(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[n,...s]=e;if(s.length===0)return this.has(n);let r=this.get(n,!0);return I(r)?r.hasIn(s):!1}setIn(e,n){let[s,...r]=e;if(r.length===0)this.set(s,n);else{let i=this.get(s,!0);if(I(i))i.setIn(r,n);else if(i===void 0&&this.schema)this.set(s,It(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}};var ii=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function te(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var he=(t,e,n)=>t.endsWith(`
`)?te(n,e):n.includes(`
`)?`
`+te(n,e):(t.endsWith(" ")?"":" ")+n;var ys="flow",Sn="block",Lt="quoted";function Pt(t,e,n="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!r||r<0)return t;r<i&&(i=0);let l=Math.max(1+i,1+r-e.length);if(t.length<=l)return t;let c=[],u={},f=r-e.length;typeof s=="number"&&(s>r-Math.max(2,i)?c.push(0):f=r-s);let p,h,g=!1,m=-1,d=-1,w=-1;n===Sn&&(m=oi(t,m,e.length),m!==-1&&(f=m+l));for(let S;S=t[m+=1];){if(n===Lt&&S==="\\"){switch(d=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}w=m}if(S===`
`)n===Sn&&(m=oi(t,m,e.length)),f=m+e.length+l,p=void 0;else{if(S===" "&&h&&h!==" "&&h!==`
`&&h!=="	"){let E=t[m+1];E&&E!==" "&&E!==`
`&&E!=="	"&&(p=m)}if(m>=f)if(p)c.push(p),f=p+l,p=void 0;else if(n===Lt){for(;h===" "||h==="	";)h=S,S=t[m+=1],g=!0;let E=m>w+1?m-2:d-1;if(u[E])return t;c.push(E),u[E]=!0,f=E+l,p=void 0}else g=!0}h=S}if(g&&a&&a(),c.length===0)return t;o&&o();let k=t.slice(0,c[0]);for(let S=0;S<c.length;++S){let E=c[S],C=c[S+1]||t.length;E===0?k=`
${e}${t.slice(0,C)}`:(n===Lt&&u[E]&&(k+=`${t[E]}\\`),k+=`
${e}${t.slice(E+1,C)}`)}return k}function oi(t,e,n){let s=e,r=e+1,i=t[r];for(;i===" "||i==="	";)if(e<r+n)i=t[++e];else{do i=t[++e];while(i&&i!==`
`);s=e,r=e+1,i=t[r]}return s}var Cn=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Nn=t=>/^(%|---|\.\.\.)/m.test(t);function fa(t,e,n){if(!e||e<0)return!1;let s=e-n,r=t.length;if(r<=s)return!1;for(let i=0,o=0;i<r;++i)if(t[i]===`
`){if(i-o>s)return!0;if(o=i+1,r-o<=s)return!1}return!0}function vt(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:s}=e,r=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(Nn(t)?"  ":""),o="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{o+=n.slice(a,l);let u=n.substr(l+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(s||n[l+2]==='"'||n.length<r)l+=1;else{for(o+=n.slice(a,l)+`

`;n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"';)o+=`
`,l+=2;o+=i,n[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+n.slice(a):n,s?o:Pt(o,i,Lt,Cn(e,!1))}function bs(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
`)||/[ \t]\n|\n[ \t]/.test(t))return vt(t,e);let n=e.indent||(Nn(t)?"  ":""),s="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
${n}`)+"'";return e.implicitKey?s:Pt(s,n,ys,Cn(e,!1))}function it(t,e){let{singleQuote:n}=e.options,s;if(n===!1)s=vt;else{let r=t.includes('"'),i=t.includes("'");r&&!i?s=bs:i&&!r?s=vt:s=n?bs:vt}return s(t,e)}var ws;try{ws=new RegExp(`(^|(?<!
))
+(?!
|$)`,"g")}catch{ws=/\n+(?!\n|$)/g}function En({comment:t,type:e,value:n},s,r,i){let{blockQuote:o,commentString:a,lineWidth:l}=s.options;if(!o||/\n[\t ]+$/.test(n))return it(n,s);let c=s.indent||(s.forceBlockIndent||Nn(n)?"  ":""),u=o==="literal"?!0:o==="folded"||e===y.BLOCK_FOLDED?!1:e===y.BLOCK_LITERAL?!0:!fa(n,l,c.length);if(!n)return u?`|
`:`>
`;let f,p;for(p=n.length;p>0;--p){let C=n[p-1];if(C!==`
`&&C!=="	"&&C!==" ")break}let h=n.substring(p),g=h.indexOf(`
`);g===-1?f="-":n===h||g!==h.length-1?(f="+",i&&i()):f="",h&&(n=n.slice(0,-h.length),h[h.length-1]===`
`&&(h=h.slice(0,-1)),h=h.replace(ws,`$&${c}`));let m=!1,d,w=-1;for(d=0;d<n.length;++d){let C=n[d];if(C===" ")m=!0;else if(C===`
`)w=d;else break}let k=n.substring(0,w<d?w+1:d);k&&(n=n.substring(k.length),k=k.replace(/\n+/g,`$&${c}`));let E=(m?c?"2":"1":"")+f;if(t&&(E+=" "+a(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!u){let C=n.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),A=!1,L=Cn(s,!0);o!=="folded"&&e!==y.BLOCK_FOLDED&&(L.onOverflow=()=>{A=!0});let b=Pt(`${k}${C}${h}`,c,Sn,L);if(!A)return`>${E}
${c}${b}`}return n=n.replace(/\n+/g,`$&${c}`),`|${E}
${c}${k}${n}${h}`}function ua(t,e,n,s){let{type:r,value:i}=t,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:u}=e;if(a&&i.includes(`
`)||u&&/[[\]{},]/.test(i))return it(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes(`
`)?it(i,e):En(t,e,n,s);if(!a&&!u&&r!==y.PLAIN&&i.includes(`
`))return En(t,e,n,s);if(Nn(i)){if(l==="")return e.forceBlockIndent=!0,En(t,e,n,s);if(a&&l===c)return it(i,e)}let f=i.replace(/\n+/g,`$&
${l}`);if(o){let p=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(f),{compat:h,tags:g}=e.doc.schema;if(g.some(p)||h?.some(p))return it(i,e)}return a?f:Pt(f,l,ys,Cn(e,!1))}function qe(t,e,n,s){let{implicitKey:r,inFlow:i}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==y.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=y.QUOTE_DOUBLE);let l=u=>{switch(u){case y.BLOCK_FOLDED:case y.BLOCK_LITERAL:return r||i?it(o.value,e):En(o,e,n,s);case y.QUOTE_DOUBLE:return vt(o.value,e);case y.QUOTE_SINGLE:return bs(o.value,e);case y.PLAIN:return ua(o,e,n,s);default:return null}},c=l(a);if(c===null){let{defaultKeyType:u,defaultStringType:f}=e.options,p=r&&u||f;if(c=l(p),c===null)throw new Error(`Unsupported default string type ${p}`)}return c}function An(t,e){let n=Object.assign({blockQuote:!0,commentString:ii,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):"  ",inFlow:s,options:n}}function pa(t,e){if(e.tag){let r=t.filter(i=>i.tag===e.tag);if(r.length>0)return r.find(i=>i.format===e.format)??r[0]}let n,s;if(N(e)){s=e.value;let r=t.filter(i=>i.identify?.(s));if(r.length>1){let i=r.filter(o=>o.test);i.length>0&&(r=i)}n=r.find(i=>i.format===e.format)??r.find(i=>!i.format)}else s=e,n=t.find(r=>r.nodeClass&&s instanceof r.nodeClass);if(!n){let r=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${r} value`)}return n}function ma(t,e,{anchors:n,doc:s}){if(!s.directives)return"";let r=[],i=(N(t)||I(t))&&t.anchor;i&&bn(i)&&(n.add(i),r.push(`&${i}`));let o=t.tag??(e.default?null:e.tag);return o&&r.push(s.directives.tagString(o)),r.join(" ")}function Te(t,e,n,s){if(T(t))return t.toString(e,n,s);if(Z(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let r,i=_(t)?t:e.doc.createNode(t,{onTagObj:l=>r=l});r??(r=pa(e.doc.schema.tags,i));let o=ma(i,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof r.stringify=="function"?r.stringify(i,e,n,s):N(i)?qe(i,e,n,s):i.toString(e,n,s);return o?N(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
${e.indent}${a}`:a}function ai({key:t,value:e},n,s,r){let{allNullValues:i,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:f}}=n,p=_(t)&&t.comment||null;if(f){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(I(t)||!_(t)&&typeof t=="object"){let L="With simple keys, collection cannot be used as a key value";throw new Error(L)}}let h=!f&&(!t||p&&e==null&&!n.inFlow||I(t)||(N(t)?t.type===y.BLOCK_FOLDED||t.type===y.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(f||!i),indent:a+l});let g=!1,m=!1,d=Te(t,n,()=>g=!0,()=>m=!0);if(!h&&!n.inFlow&&d.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(i||e==null)return g&&s&&s(),d===""?"?":h?`? ${d}`:d}else if(i&&!f||e==null&&h)return d=`? ${d}`,p&&!g?d+=he(d,n.indent,c(p)):m&&r&&r(),d;g&&(p=null),h?(p&&(d+=he(d,n.indent,c(p))),d=`? ${d}
${a}:`):(d=`${d}:`,p&&(d+=he(d,n.indent,c(p))));let w,k,S;_(e)?(w=!!e.spaceBefore,k=e.commentBefore,S=e.comment):(w=!1,k=null,S=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!h&&!p&&N(e)&&(n.indentAtStart=d.length+1),m=!1,!u&&l.length>=2&&!n.inFlow&&!h&&ee(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let E=!1,C=Te(e,n,()=>E=!0,()=>m=!0),A=" ";if(p||w||k){if(A=w?`
`:"",k){let L=c(k);A+=`
${te(L,n.indent)}`}C===""&&!n.inFlow?A===`
`&&S&&(A=`

`):A+=`
${n.indent}`}else if(!h&&I(e)){let L=C[0],b=C.indexOf(`
`),M=b!==-1,Oe=n.inFlow??e.flow??e.items.length===0;if(M||!Oe){let Ye=!1;if(M&&(L==="&"||L==="!")){let $=C.indexOf(" ");L==="&"&&$!==-1&&$<b&&C[$+1]==="!"&&($=C.indexOf(" ",$+1)),($===-1||b<$)&&(Ye=!0)}Ye||(A=`
${n.indent}`)}}else(C===""||C[0]===`
`)&&(A="");return d+=A+C,n.inFlow?E&&s&&s():S&&!E?d+=he(d,n.indent,c(S)):m&&r&&r(),d}function ks(t,e){(t==="debug"||t==="warn")&&console.warn(e)}var Tn="<<",ie={identify:t=>t===Tn||typeof t=="symbol"&&t.description===Tn,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new y(Symbol(Tn)),{addToJSMap:Es}),stringify:()=>Tn},li=(t,e)=>(ie.identify(e)||N(e)&&(!e.type||e.type===y.PLAIN)&&ie.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===ie.tag&&n.default);function Es(t,e,n){let s=ci(t,n);if(ee(s))for(let r of s.items)Ss(t,e,r);else if(Array.isArray(s))for(let r of s)Ss(t,e,r);else Ss(t,e,s)}function Ss(t,e,n){let s=ci(t,n);if(!Q(s))throw new Error("Merge sources must be maps or map aliases");let r=s.toJSON(null,t,Map);for(let[i,o]of r)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function ci(t,e){return t&&Z(e)?e.resolve(t.doc,t):e}function On(t,e,{key:n,value:s}){if(_(n)&&n.addToJSMap)n.addToJSMap(t,e,s);else if(li(t,n))Es(t,e,s);else{let r=B(n,"",t);if(e instanceof Map)e.set(r,B(s,r,t));else if(e instanceof Set)e.add(r);else{let i=ha(n,r,t),o=B(s,i,t);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function ha(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(_(t)&&n?.doc){let s=An(n.doc,{});s.anchors=new Set;for(let i of n.anchors.keys())s.anchors.add(i.anchor);s.inFlow=!0,s.inStringifyKey=!0;let r=t.toString(s);if(!n.mapKeyWarned){let i=JSON.stringify(r);i.length>40&&(i=i.substring(0,36)+'..."'),ks(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}function ot(t,e,n){let s=Ae(t,void 0,n),r=Ae(e,void 0,n);return new D(s,r)}var D=class t{constructor(e,n=null){Object.defineProperty(this,G,{value:hs}),this.key=e,this.value=n}clone(e){let{key:n,value:s}=this;return _(n)&&(n=n.clone(e)),_(s)&&(s=s.clone(e)),new t(n,s)}toJSON(e,n){let s=n?.mapAsMap?new Map:{};return On(n,s,this)}toString(e,n,s){return e?.doc?ai(this,e,n,s):JSON.stringify(this)}};function In(t,e,n){return(e.inFlow??t.flow?ga:da)(t,e,n)}function da({comment:t,items:e},n,{blockItemPrefix:s,flowChars:r,itemIndent:i,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=n,u=Object.assign({},n,{indent:i,type:null}),f=!1,p=[];for(let g=0;g<e.length;++g){let m=e[g],d=null;if(_(m))!f&&m.spaceBefore&&p.push(""),_n(n,p,m.commentBefore,f),m.comment&&(d=m.comment);else if(T(m)){let k=_(m.key)?m.key:null;k&&(!f&&k.spaceBefore&&p.push(""),_n(n,p,k.commentBefore,f))}f=!1;let w=Te(m,u,()=>d=null,()=>f=!0);d&&(w+=he(w,i,c(d))),f&&d&&(f=!1),p.push(s+w)}let h;if(p.length===0)h=r.start+r.end;else{h=p[0];for(let g=1;g<p.length;++g){let m=p[g];h+=m?`
${l}${m}`:`
`}}return t?(h+=`
`+te(c(t),l),a&&a()):f&&o&&o(),h}function ga({items:t},e,{flowChars:n,itemIndent:s}){let{indent:r,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;s+=i;let l=Object.assign({},e,{indent:s,inFlow:!0,type:null}),c=!1,u=0,f=[];for(let g=0;g<t.length;++g){let m=t[g],d=null;if(_(m))m.spaceBefore&&f.push(""),_n(e,f,m.commentBefore,!1),m.comment&&(d=m.comment);else if(T(m)){let k=_(m.key)?m.key:null;k&&(k.spaceBefore&&f.push(""),_n(e,f,k.commentBefore,!1),k.comment&&(c=!0));let S=_(m.value)?m.value:null;S?(S.comment&&(d=S.comment),S.commentBefore&&(c=!0)):m.value==null&&k?.comment&&(d=k.comment)}d&&(c=!0);let w=Te(m,l,()=>d=null);c||(c=f.length>u||w.includes(`
`)),g<t.length-1?w+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=f.reduce((k,S)=>k+S.length+2,2)+(w.length+2)>e.options.lineWidth)),c&&(w+=",")),d&&(w+=he(w,s,a(d))),f.push(w),u=f.length}let{start:p,end:h}=n;if(f.length===0)return p+h;if(!c){let g=f.reduce((m,d)=>m+d.length+2,2);c=e.options.lineWidth>0&&g>e.options.lineWidth}if(c){let g=p;for(let m of f)g+=m?`
${i}${r}${m}`:`
`;return`${g}
${r}${h}`}else return`${p}${o}${f.join(" ")}${o}${h}`}function _n({indent:t,options:{commentString:e}},n,s,r){if(s&&r&&(s=s.replace(/^\n+/,"")),s){let i=te(e(s),t);n.push(i.trimStart())}}function ve(t,e){let n=N(e)?e.value:e;for(let s of t)if(T(s)&&(s.key===e||s.key===n||N(s.key)&&s.key.value===n))return s}var x=class extends st{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(re,e),this.items=[]}static from(e,n,s){let{keepUndefined:r,replacer:i}=s,o=new this(e),a=(l,c)=>{if(typeof i=="function")c=i.call(n,l,c);else if(Array.isArray(i)&&!i.includes(l))return;(c!==void 0||r)&&o.items.push(ot(l,c,s))};if(n instanceof Map)for(let[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(let l of Object.keys(n))a(l,n[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let s;T(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new D(e,e?.value):s=new D(e.key,e.value);let r=ve(this.items,s.key),i=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${s.key} already set`);N(r.value)&&kn(s.value)?r.value.value=s.value:r.value=s.value}else if(i){let o=this.items.findIndex(a=>i(s,a)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(e){let n=ve(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=ve(this.items,e)?.value;return(!n&&N(r)?r.value:r)??void 0}has(e){return!!ve(this.items,e)}set(e,n){this.add(new D(e,n),!0)}toJSON(e,n,s){let r=s?new s:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let i of this.items)On(n,r,i);return r}toString(e,n,s){if(!e)return JSON.stringify(this);for(let r of this.items)if(!T(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),In(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:n})}};var oe={collection:"map",default:!0,nodeClass:x,tag:"tag:yaml.org,2002:map",resolve(t,e){return Q(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>x.from(t,e,n)};var U=class extends st{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Ce,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=Ln(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let s=Ln(e);if(typeof s!="number")return;let r=this.items[s];return!n&&N(r)?r.value:r}has(e){let n=Ln(e);return typeof n=="number"&&n<this.items.length}set(e,n){let s=Ln(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[s];N(r)&&kn(n)?r.value=n:this.items[s]=n}toJSON(e,n){let s=[];n?.onCreate&&n.onCreate(s);let r=0;for(let i of this.items)s.push(B(i,String(r++),n));return s}toString(e,n,s){return e?In(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+"  ",onChompKeep:s,onComment:n}):JSON.stringify(this)}static from(e,n,s){let{replacer:r}=s,i=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof r=="function"){let l=n instanceof Set?a:String(o++);a=r.call(n,l,a)}i.items.push(Ae(a,void 0,s))}}return i}};function Ln(t){let e=N(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}var ae={collection:"seq",default:!0,nodeClass:U,tag:"tag:yaml.org,2002:seq",resolve(t,e){return ee(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>U.from(t,e,n)};var De={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,s){return e=Object.assign({actualString:!0},e),qe(t,e,n,s)}};var Fe={identify:t=>t==null,createNode:()=>new y(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new y(null),stringify:({source:t},e)=>typeof t=="string"&&Fe.test.test(t)?t:e.options.nullStr};var Dt={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new y(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&Dt.test.test(t)){let s=t[0]==="t"||t[0]==="T";if(e===s)return t}return e?n.options.trueStr:n.options.falseStr}};function j({format:t,minFractionDigits:e,tag:n,value:s}){if(typeof s=="bigint")return String(s);let r=typeof s=="number"?s:Number(s);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=Object.is(s,-0)?"-0":JSON.stringify(s);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}var Pn={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:j},vn={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():j(t)}},Dn={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new y(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:j};var xn=t=>typeof t=="bigint"||Number.isInteger(t),Cs=(t,e,n,{intAsBigInt:s})=>s?BigInt(t):parseInt(t.substring(e),n);function fi(t,e,n){let{value:s}=t;return xn(s)&&s>=0?n+s.toString(e):j(t)}var Mn={identify:t=>xn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Cs(t,2,8,n),stringify:t=>fi(t,8,"0o")},$n={identify:xn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Cs(t,0,10,n),stringify:j},Bn={identify:t=>xn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Cs(t,2,16,n),stringify:t=>fi(t,16,"0x")};var ui=[oe,ae,De,Fe,Dt,Mn,$n,Bn,Pn,vn,Dn];function pi(t){return typeof t=="bigint"||Number.isInteger(t)}var Rn=({value:t})=>JSON.stringify(t),ya=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Rn},{identify:t=>t==null,createNode:()=>new y(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Rn},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Rn},{identify:pi,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>pi(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Rn}],ba={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},mi=[oe,ae].concat(ya,ba);var xt={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let r=0;r<n.length;++r)s[r]=n.charCodeAt(r);return s}else return t},stringify({comment:t,type:e,value:n},s,r,i){if(!n)return"";let o=n,a;if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=y.BLOCK_LITERAL),e!==y.QUOTE_DOUBLE){let l=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),c=Math.ceil(a.length/l),u=new Array(c);for(let f=0,p=0;f<c;++f,p+=l)u[f]=a.substr(p,l);a=u.join(e===y.BLOCK_LITERAL?`
`:" ")}return qe({comment:t,type:e,value:a},s,r,i)}};function Ns(t,e){if(ee(t))for(let n=0;n<t.items.length;++n){let s=t.items[n];if(!T(s)){if(Q(s)){s.items.length>1&&e("Each pair must have its own sequence indicator");let r=s.items[0]||new D(new y(null));if(s.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${s.commentBefore}
${r.key.commentBefore}`:s.commentBefore),s.comment){let i=r.value??r.key;i.comment=i.comment?`${s.comment}
${i.comment}`:s.comment}s=r}t.items[n]=T(s)?s:new D(s)}}else e("Expected a sequence for this tag");return t}function As(t,e,n){let{replacer:s}=n,r=new U(t);r.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(i++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;r.items.push(ot(a,l,n))}return r}var Mt={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ns,createNode:As};var at=class t extends U{constructor(){super(),this.add=x.prototype.add.bind(this),this.delete=x.prototype.delete.bind(this),this.get=x.prototype.get.bind(this),this.has=x.prototype.has.bind(this),this.set=x.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let s=new Map;n?.onCreate&&n.onCreate(s);for(let r of this.items){let i,o;if(T(r)?(i=B(r.key,"",n),o=B(r.value,i,n)):i=B(r,"",n),s.has(i))throw new Error("Ordered maps must not include duplicate keys");s.set(i,o)}return s}static from(e,n,s){let r=As(e,n,s),i=new this;return i.items=r.items,i}};at.tag="tag:yaml.org,2002:omap";var $t={collection:"seq",identify:t=>t instanceof Map,nodeClass:at,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=Ns(t,e),s=[];for(let{key:r}of n.items)N(r)&&(s.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):s.push(r.value));return Object.assign(new at,n)},createNode:(t,e,n)=>at.from(t,e,n)};function hi({value:t,source:e},n){return e&&(t?Ts:Os).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var Ts={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new y(!0),stringify:hi},Os={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new y(!1),stringify:hi};var di={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:j},gi={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():j(t)}},yi={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new y(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let s=t.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:j};var Bt=t=>typeof t=="bigint"||Number.isInteger(t);function qn(t,e,n,{intAsBigInt:s}){let r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),s){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return r==="-"?BigInt(-1)*o:o}let i=parseInt(t,n);return r==="-"?-1*i:i}function _s(t,e,n){let{value:s}=t;if(Bt(s)){let r=s.toString(e);return s<0?"-"+n+r.substr(1):n+r}return j(t)}var bi={identify:Bt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>qn(t,2,2,n),stringify:t=>_s(t,2,"0b")},wi={identify:Bt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>qn(t,1,8,n),stringify:t=>_s(t,8,"0")},ki={identify:Bt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>qn(t,0,10,n),stringify:j},Si={identify:Bt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>qn(t,2,16,n),stringify:t=>_s(t,16,"0x")};var lt=class t extends x{constructor(e){super(e),this.tag=t.tag}add(e){let n;T(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new D(e.key,null):n=new D(e,null),ve(this.items,n.key)||this.items.push(n)}get(e,n){let s=ve(this.items,e);return!n&&T(s)?N(s.key)?s.key.value:s.key:s}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let s=ve(this.items,e);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new D(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(e,n,s){let{replacer:r}=s,i=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),i.items.push(ot(o,null,s));return i}};lt.tag="tag:yaml.org,2002:set";var Rt={collection:"map",identify:t=>t instanceof Set,nodeClass:lt,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>lt.from(t,e,n),resolve(t,e){if(Q(t)){if(t.hasAllNullValues(!0))return Object.assign(new lt,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function Is(t,e){let n=t[0],s=n==="-"||n==="+"?t.substring(1):t,r=o=>e?BigInt(o):Number(o),i=s.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return n==="-"?r(-1)*i:i}function Ei(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return j(t);let s="";e<0&&(s="-",e*=n(-1));let r=n(60),i=[e%r];return e<60?i.unshift(0):(e=(e-i[0])/r,i.unshift(e%r),e>=60&&(e=(e-i[0])/r,i.unshift(e))),s+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Fn={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>Is(t,n),stringify:Ei},Kn={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Is(t,!1),stringify:Ei},ct={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(ct.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,s,r,i,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(n,s-1,r,i||0,o||0,a||0,l),u=e[8];if(u&&u!=="Z"){let f=Is(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};var Ls=[oe,ae,De,Fe,Ts,Os,bi,wi,ki,Si,di,gi,yi,xt,ie,$t,Mt,Rt,Fn,Kn,ct];var Ci=new Map([["core",ui],["failsafe",[oe,ae,De]],["json",mi],["yaml11",Ls],["yaml-1.1",Ls]]),Ni={binary:xt,bool:Dt,float:Dn,floatExp:vn,floatNaN:Pn,floatTime:Kn,int:$n,intHex:Bn,intOct:Mn,intTime:Fn,map:oe,merge:ie,null:Fe,omap:$t,pairs:Mt,seq:ae,set:Rt,timestamp:ct},Ai={"tag:yaml.org,2002:binary":xt,"tag:yaml.org,2002:merge":ie,"tag:yaml.org,2002:omap":$t,"tag:yaml.org,2002:pairs":Mt,"tag:yaml.org,2002:set":Rt,"tag:yaml.org,2002:timestamp":ct};function Yn(t,e,n){let s=Ci.get(e);if(s&&!t)return n&&!s.includes(ie)?s.concat(ie):s.slice();let r=s;if(!r)if(Array.isArray(t))r=[];else{let i=Array.from(Ci.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(t))for(let i of t)r=r.concat(i);else typeof t=="function"&&(r=t(r.slice()));return n&&(r=r.concat(ie)),r.reduce((i,o)=>{let a=typeof o=="string"?Ni[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(Ni).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return i.includes(a)||i.push(a),i},[])}var wa=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,qt=class t{constructor({compat:e,customTags:n,merge:s,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Yn(e,"compat"):e?Yn(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=r?Ai:{},this.tags=Yn(n,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,re,{value:oe}),Object.defineProperty(this,z,{value:De}),Object.defineProperty(this,Ce,{value:ae}),this.sortMapEntries=typeof o=="function"?o:o===!0?wa:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};function Ti(t,e){let n=[],s=e.directives===!0;if(e.directives!==!1&&t.directives){let l=t.directives.toString(t);l?(n.push(l),s=!0):t.directives.docStart&&(s=!0)}s&&n.push("---");let r=An(t,e),{commentString:i}=r.options;if(t.commentBefore){n.length!==1&&n.unshift("");let l=i(t.commentBefore);n.unshift(te(l,""))}let o=!1,a=null;if(t.contents){if(_(t.contents)){if(t.contents.spaceBefore&&s&&n.push(""),t.contents.commentBefore){let u=i(t.contents.commentBefore);n.push(te(u,""))}r.forceBlockIndent=!!t.comment,a=t.contents.comment}let l=a?void 0:()=>o=!0,c=Te(t.contents,r,()=>a=null,l);a&&(c+=he(c,"",i(a))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(Te(t.contents,r));if(t.directives?.docEnd)if(t.comment){let l=i(t.comment);l.includes(`
`)?(n.push("..."),n.push(te(l,""))):n.push(`... ${l}`)}else n.push("...");else{let l=t.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(te(i(l),"")))}return n.join(`
`)+`
`}var xe=class t{constructor(e,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,G,{value:dn});let r=null;typeof n=="function"||Array.isArray(n)?r=n:s===void 0&&n&&(s=n,n=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=i;let{version:o}=i;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new me({version:o}),this.setSchema(o,s),this.contents=e===void 0?null:this.createNode(e,r,s)}clone(){let e=Object.create(t.prototype,{[G]:{value:dn}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=_(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ft(this.contents)&&this.contents.add(e)}addIn(e,n){ft(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let s=ds(this);e.anchor=!n||s.has(n)?gs(n||"a",s):n}return new Ne(e.anchor)}createNode(e,n,s){let r;if(typeof n=="function")e=n.call({"":e},"",e),r=n;else if(Array.isArray(n)){let d=k=>typeof k=="number"||k instanceof String||k instanceof Number,w=n.filter(d).map(String);w.length>0&&(n=n.concat(w)),r=n}else s===void 0&&n&&(s=n,n=void 0);let{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:u}=s??{},{onAnchor:f,setAnchors:p,sourceObjects:h}=ri(this,o||"a"),g={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:h},m=Ae(e,u,g);return a&&I(m)&&(m.flow=!0),p(),m}createPair(e,n,s={}){let r=this.createNode(e,null,s),i=this.createNode(n,null,s);return new D(r,i)}delete(e){return ft(this.contents)?this.contents.delete(e):!1}deleteIn(e){return rt(e)?this.contents==null?!1:(this.contents=null,!0):ft(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return I(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return rt(e)?!n&&N(this.contents)?this.contents.value:this.contents:I(this.contents)?this.contents.getIn(e,n):void 0}has(e){return I(this.contents)?this.contents.has(e):!1}hasIn(e){return rt(e)?this.contents!==void 0:I(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=It(this.schema,[e],n):ft(this.contents)&&this.contents.set(e,n)}setIn(e,n){rt(e)?this.contents=n:this.contents==null?this.contents=It(this.schema,Array.from(e),n):ft(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new me({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new me({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new qt(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:s,maxAliasCount:r,onAnchor:i,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},l=B(this.contents,n??"",a);if(typeof i=="function")for(let{count:c,res:u}of a.anchors.values())i(u,c);return typeof o=="function"?Le(o,{"":l},"",l):l}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Ti(this,e)}};function ft(t){if(I(t))return!0;throw new Error("Expected a YAML collection as document contents")}var Ft=class extends Error{constructor(e,n,s,r){super(),this.name=e,this.code=s,this.message=r,this.pos=n}},de=class extends Ft{constructor(e,n,s){super("YAMLParseError",e,n,s)}},Kt=class extends Ft{constructor(e,n,s){super("YAMLWarning",e,n,s)}};function ge(t,{flow:e,indicator:n,next:s,offset:r,onError:i,parentIndent:o,startOnNewline:a}){let l=!1,c=a,u=a,f="",p="",h=!1,g=!1,m=null,d=null,w=null,k=null,S=null,E=null,C=null;for(let b of t)switch(g&&(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma"&&i(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),m&&(c&&b.type!=="comment"&&b.type!=="newline"&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),b.type){case"space":!e&&(n!=="doc-start"||s?.type!=="flow-collection")&&b.source.includes("	")&&(m=b),u=!0;break;case"comment":{u||i(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let M=b.source.substring(1)||" ";f?f+=p+M:f=M,p="",c=!1;break}case"newline":c?f?f+=b.source:(!E||n!=="seq-item-ind")&&(l=!0):p+=b.source,c=!0,h=!0,(d||w)&&(k=b),u=!0;break;case"anchor":d&&i(b,"MULTIPLE_ANCHORS","A node can have at most one anchor"),b.source.endsWith(":")&&i(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),d=b,C??(C=b.offset),c=!1,u=!1,g=!0;break;case"tag":{w&&i(b,"MULTIPLE_TAGS","A node can have at most one tag"),w=b,C??(C=b.offset),c=!1,u=!1,g=!0;break}case n:(d||w)&&i(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`),E&&i(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${e??"collection"}`),E=b,c=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(e){S&&i(b,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=b,c=!1,u=!1;break}default:i(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),c=!1,u=!1}let A=t[t.length-1],L=A?A.offset+A.source.length:r;return g&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(c&&m.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:E,spaceBefore:l,comment:f,hasNewline:h,anchor:d,tag:w,newlineAfterProp:k,end:L,start:C??L}}function Me(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(Me(e.key)||Me(e.value))return!0}return!1;default:return!0}}function Yt(t,e,n){if(e?.type==="flow-collection"){let s=e.end[0];s.indent===t&&(s.source==="]"||s.source==="}")&&Me(e)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Un(t,e,n){let{uniqueKeys:s}=t.options;if(s===!1)return!1;let r=typeof s=="function"?s:(i,o)=>i===o||N(i)&&N(o)&&i.value===o.value;return e.some(i=>r(i.key,n))}var Oi="All mapping items must start at the same column";function _i({composeNode:t,composeEmptyNode:e},n,s,r,i){let o=i?.nodeClass??x,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let l=s.offset,c=null;for(let u of s.items){let{start:f,key:p,sep:h,value:g}=u,m=ge(f,{indicator:"explicit-key-ind",next:p??h?.[0],offset:l,onError:r,parentIndent:s.indent,startOnNewline:!0}),d=!m.found;if(d){if(p&&(p.type==="block-seq"?r(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==s.indent&&r(l,"BAD_INDENT",Oi)),!m.anchor&&!m.tag&&!h){c=m.end,m.comment&&(a.comment?a.comment+=`
`+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||Me(p))&&r(p??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==s.indent&&r(l,"BAD_INDENT",Oi);n.atKey=!0;let w=m.end,k=p?t(n,p,m,r):e(n,w,f,null,m,r);n.schema.compat&&Yt(s.indent,p,r),n.atKey=!1,Un(n,a.items,k)&&r(w,"DUPLICATE_KEY","Map keys must be unique");let S=ge(h??[],{indicator:"map-value-ind",next:g,offset:k.range[2],onError:r,parentIndent:s.indent,startOnNewline:!p||p.type==="block-scalar"});if(l=S.end,S.found){d&&(g?.type==="block-map"&&!S.hasNewline&&r(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<S.found.offset-1024&&r(k.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let E=g?t(n,g,S,r):e(n,l,h,null,S,r);n.schema.compat&&Yt(s.indent,g,r),l=E.range[2];let C=new D(k,E);n.options.keepSourceTokens&&(C.srcToken=u),a.items.push(C)}else{d&&r(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),S.comment&&(k.comment?k.comment+=`
`+S.comment:k.comment=S.comment);let E=new D(k);n.options.keepSourceTokens&&(E.srcToken=u),a.items.push(E)}}return c&&c<l&&r(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[s.offset,l,c??l],a}function Ii({composeNode:t,composeEmptyNode:e},n,s,r,i){let o=i?.nodeClass??U,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=s.offset,c=null;for(let{start:u,value:f}of s.items){let p=ge(u,{indicator:"seq-item-ind",next:f,offset:l,onError:r,parentIndent:s.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||f)f?.type==="block-seq"?r(p.end,"BAD_INDENT","All sequence items must start at the same column"):r(l,"MISSING_CHAR","Sequence item without - indicator");else{c=p.end,p.comment&&(a.comment=p.comment);continue}let h=f?t(n,f,p,r):e(n,p.end,u,null,p,r);n.schema.compat&&Yt(s.indent,f,r),l=h.range[2],a.items.push(h)}return a.range=[s.offset,l,c??l],a}function ye(t,e,n,s){let r="";if(t){let i=!1,o="";for(let a of t){let{source:l,type:c}=a;switch(c){case"space":i=!0;break;case"comment":{n&&!i&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=l.substring(1)||" ";r?r+=o+u:r=u,o="";break}case"newline":r&&(o+=l),i=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:r,offset:e}}var Ps="Block collections are not allowed within flow collections",vs=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Li({composeNode:t,composeEmptyNode:e},n,s,r,i){let o=s.start.source==="{",a=o?"flow map":"flow sequence",l=i?.nodeClass??(o?x:U),c=new l(n.schema);c.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=s.offset+s.start.source.length;for(let d=0;d<s.items.length;++d){let w=s.items[d],{start:k,key:S,sep:E,value:C}=w,A=ge(k,{flow:a,indicator:"explicit-key-ind",next:S??E?.[0],offset:f,onError:r,parentIndent:s.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!E&&!C){d===0&&A.comma?r(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):d<s.items.length-1&&r(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),A.comment&&(c.comment?c.comment+=`
`+A.comment:c.comment=A.comment),f=A.end;continue}!o&&n.options.strict&&Me(S)&&r(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(d===0)A.comma&&r(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(A.comma||r(A.start,"MISSING_CHAR",`Missing , between ${a} items`),A.comment){let L="";e:for(let b of k)switch(b.type){case"comma":case"space":break;case"comment":L=b.source.substring(1);break e;default:break e}if(L){let b=c.items[c.items.length-1];T(b)&&(b=b.value??b.key),b.comment?b.comment+=`
`+L:b.comment=L,A.comment=A.comment.substring(L.length+1)}}if(!o&&!E&&!A.found){let L=C?t(n,C,A,r):e(n,A.end,E,null,A,r);c.items.push(L),f=L.range[2],vs(C)&&r(L.range,"BLOCK_IN_FLOW",Ps)}else{n.atKey=!0;let L=A.end,b=S?t(n,S,A,r):e(n,L,k,null,A,r);vs(S)&&r(b.range,"BLOCK_IN_FLOW",Ps),n.atKey=!1;let M=ge(E??[],{flow:a,indicator:"map-value-ind",next:C,offset:b.range[2],onError:r,parentIndent:s.indent,startOnNewline:!1});if(M.found){if(!o&&!A.found&&n.options.strict){if(E)for(let $ of E){if($===M.found)break;if($.type==="newline"){r($,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<M.found.offset-1024&&r(M.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&C.source?.[0]===":"?r(C,"MISSING_CHAR",`Missing space after : in ${a}`):r(M.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Oe=C?t(n,C,M,r):M.found?e(n,M.end,E,null,M,r):null;Oe?vs(C)&&r(Oe.range,"BLOCK_IN_FLOW",Ps):M.comment&&(b.comment?b.comment+=`
`+M.comment:b.comment=M.comment);let Ye=new D(b,Oe);if(n.options.keepSourceTokens&&(Ye.srcToken=w),o){let $=c;Un(n,$.items,b)&&r(L,"DUPLICATE_KEY","Map keys must be unique"),$.items.push(Ye)}else{let $=new x(n.schema);$.flow=!0,$.items.push(Ye);let Ws=(Oe??b).range;$.range=[b.range[0],Ws[1],Ws[2]],c.items.push($)}f=Oe?Oe.range[2]:M.end}}let p=o?"}":"]",[h,...g]=s.end,m=f;if(h?.source===p)m=h.offset+h.source.length;else{let d=a[0].toUpperCase()+a.substring(1),w=u?`${d} must end with a ${p}`:`${d} in block collection must be sufficiently indented and end with a ${p}`;r(f,u?"MISSING_CHAR":"BAD_INDENT",w),h&&h.source.length!==1&&g.unshift(h)}if(g.length>0){let d=ye(g,m,n.options.strict,r);d.comment&&(c.comment?c.comment+=`
`+d.comment:c.comment=d.comment),c.range=[s.offset,m,d.offset]}else c.range=[s.offset,m,m];return c}function Ds(t,e,n,s,r,i){let o=n.type==="block-map"?_i(t,e,n,s,i):n.type==="block-seq"?Ii(t,e,n,s,i):Li(t,e,n,s,i),a=o.constructor;return r==="!"||r===a.tagName?(o.tag=a.tagName,o):(r&&(o.tag=r),o)}function Pi(t,e,n,s,r){let i=s.tag,o=i?e.directives.tagName(i.source,p=>r(i,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){let{anchor:p,newlineAfterProp:h}=s,g=p&&i?p.offset>i.offset?p:i:p??i;g&&(!h||h.offset<g.offset)&&r(g,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===x.tagName&&a==="map"||o===U.tagName&&a==="seq")return Ds(t,e,n,r,o);let l=e.schema.tags.find(p=>p.tag===o&&p.collection===a);if(!l){let p=e.schema.knownTags[o];if(p?.collection===a)e.schema.tags.push(Object.assign({},p,{default:!1})),l=p;else return p?r(i,"BAD_COLLECTION_TYPE",`${p.tag} used for ${a} collection, but expects ${p.collection??"scalar"}`,!0):r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ds(t,e,n,r,o)}let c=Ds(t,e,n,r,o,l),u=l.resolve?.(c,p=>r(i,"TAG_RESOLVE_FAILED",p),e.options)??c,f=_(u)?u:new y(u);return f.range=c.range,f.tag=o,l?.format&&(f.format=l.format),f}function xs(t,e,n){let s=e.offset,r=ka(e,t.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[s,s,s]};let i=r.mode===">"?y.BLOCK_FOLDED:y.BLOCK_LITERAL,o=e.source?Sa(e.source):[],a=o.length;for(let m=o.length-1;m>=0;--m){let d=o[m][1];if(d===""||d==="\r")a=m;else break}if(a===0){let m=r.chomp==="+"&&o.length>0?`
`.repeat(Math.max(1,o.length-1)):"",d=s+r.length;return e.source&&(d+=e.source.length),{value:m,type:i,comment:r.comment,range:[s,d,d]}}let l=e.indent+r.indent,c=e.offset+r.length,u=0;for(let m=0;m<a;++m){let[d,w]=o[m];if(w===""||w==="\r")r.indent===0&&d.length>l&&(l=d.length);else{d.length<l&&n(c+d.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(l=d.length),u=m,l===0&&!t.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=d.length+w.length+1}for(let m=o.length-1;m>=a;--m)o[m][0].length>l&&(a=m+1);let f="",p="",h=!1;for(let m=0;m<u;++m)f+=o[m][0].slice(l)+`
`;for(let m=u;m<a;++m){let[d,w]=o[m];c+=d.length+w.length+1;let k=w[w.length-1]==="\r";if(k&&(w=w.slice(0,-1)),w&&d.length<l){let E=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(c-w.length-(k?2:1),"BAD_INDENT",E),d=""}i===y.BLOCK_LITERAL?(f+=p+d.slice(l)+w,p=`
`):d.length>l||w[0]==="	"?(p===" "?p=`
`:!h&&p===`
`&&(p=`

`),f+=p+d.slice(l)+w,p=`
`,h=!0):w===""?p===`
`?f+=`
`:p=`
`:(f+=p+w,p=" ",h=!1)}switch(r.chomp){case"-":break;case"+":for(let m=a;m<o.length;++m)f+=`
`+o[m][0].slice(l);f[f.length-1]!==`
`&&(f+=`
`);break;default:f+=`
`}let g=s+r.length+e.source.length;return{value:f,type:i,comment:r.comment,range:[s,g,g]}}function ka({offset:t,props:e},n,s){if(e[0].type!=="block-scalar-header")return s(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],i=r[0],o=0,a="",l=-1;for(let p=1;p<r.length;++p){let h=r[p];if(!a&&(h==="-"||h==="+"))a=h;else{let g=Number(h);!o&&g?o=g:l===-1&&(l=t+p)}}l!==-1&&s(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,u="",f=r.length;for(let p=1;p<e.length;++p){let h=e[p];switch(h.type){case"space":c=!0;case"newline":f+=h.source.length;break;case"comment":n&&!c&&s(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=h.source.length,u=h.source.substring(1);break;case"error":s(h,"UNEXPECTED_TOKEN",h.message),f+=h.source.length;break;default:{let g=`Unexpected token in block scalar header: ${h.type}`;s(h,"UNEXPECTED_TOKEN",g);let m=h.source;m&&typeof m=="string"&&(f+=m.length)}}}return{mode:i,indent:o,chomp:a,comment:u,length:f}}function Sa(t){let e=t.split(/\n( *)/),n=e[0],s=n.match(/^( *)/),i=[s?.[1]?[s[1],n.slice(s[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)i.push([e[o],e[o+1]]);return i}function Ms(t,e,n){let{offset:s,type:r,source:i,end:o}=t,a,l,c=(p,h,g)=>n(s+p,h,g);switch(r){case"scalar":a=y.PLAIN,l=Ea(i,c);break;case"single-quoted-scalar":a=y.QUOTE_SINGLE,l=Ca(i,c);break;case"double-quoted-scalar":a=y.QUOTE_DOUBLE,l=Na(i,c);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[s,s+i.length,s+i.length]}}let u=s+i.length,f=ye(o,u,e,n);return{value:l,type:a,comment:f.comment,range:[s,u,f.offset]}}function Ea(t,e){let n="";switch(t[0]){case"	":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),vi(t)}function Ca(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),vi(t.slice(1,-1)).replace(/''/g,"'")}function vi(t){let e=/(.*?)\r?\n/sy,n=e.exec(t);if(!n)return t;let s,r;try{s=new RegExp("(?<![ 	])[ 	]+$"),r=new RegExp("^[ 	]+|(?<![ 	])[ 	]+$","g")}catch{s=/[ \t]+$/,r=/^[ \t]+|[ \t]+$/g}let i=n[1].replace(s,""),o=" ",a=e.lastIndex;for(;n=e.exec(t);){let c=n[1].replace(r,"");c===""?o===`
`?i+=o:o=`
`:(i+=o+c,o=" "),a=e.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=a,n=l.exec(t),i+o+(n?.[1]??"")}function Na(t,e){let n="";for(let s=1;s<t.length-1;++s){let r=t[s];if(!(r==="\r"&&t[s+1]===`
`))if(r===`
`){let{fold:i,offset:o}=Aa(t,s);n+=i,s=o}else if(r==="\\"){let i=t[++s],o=Ta[i];if(o)n+=o;else if(i===`
`)for(i=t[s+1];i===" "||i==="	";)i=t[++s+1];else if(i==="\r"&&t[s+1]===`
`)for(i=t[++s+1];i===" "||i==="	";)i=t[++s+1];else if(i==="x"||i==="u"||i==="U"){let a=i==="x"?2:i==="u"?4:8;n+=Oa(t,s+1,a,e),s+=a}else{let a=t.substr(s-1,2);e(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(r===" "||r==="	"){let i=s,o=t[s+1];for(;o===" "||o==="	";)o=t[++s+1];o!==`
`&&!(o==="\r"&&t[s+2]===`
`)&&(n+=s>i?t.slice(i,s+1):r)}else n+=r}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function Aa(t,e){let n="",s=t[e+1];for(;(s===" "||s==="	"||s===`
`||s==="\r")&&!(s==="\r"&&t[e+2]!==`
`);)s===`
`&&(n+=`
`),e+=1,s=t[e+1];return n||(n=" "),{fold:n,offset:e}}var Ta={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
`,r:"\r",t:"	",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","	":"	"};function Oa(t,e,n,s){let r=t.substr(e,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{let a=t.substr(e-2,n+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}function $s(t,e,n,s){let{value:r,type:i,comment:o,range:a}=e.type==="block-scalar"?xs(t,e,s):Ms(e,t.options.strict,s),l=n?t.directives.tagName(n.source,f=>s(n,"TAG_RESOLVE_FAILED",f)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[z]:l?c=_a(t.schema,r,l,n,s):e.type==="scalar"?c=Ia(t,r,e,s):c=t.schema[z];let u;try{let f=c.resolve(r,p=>s(n??e,"TAG_RESOLVE_FAILED",p),t.options);u=N(f)?f:new y(f)}catch(f){let p=f instanceof Error?f.message:String(f);s(n??e,"TAG_RESOLVE_FAILED",p),u=new y(r)}return u.range=a,u.source=r,i&&(u.type=i),l&&(u.tag=l),c.format&&(u.format=c.format),o&&(u.comment=o),u}function _a(t,e,n,s,r){if(n==="!")return t[z];let i=[];for(let a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)i.push(a);else return a;for(let a of i)if(a.test?.test(e))return a;let o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[z])}function Ia({atKey:t,directives:e,schema:n},s,r,i){let o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(s))||n[z];if(n.compat){let a=n.compat.find(l=>l.default&&l.test?.test(s))??n[z];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),u=`Value may be parsed as either ${l} or ${c}`;i(r,"TAG_RESOLVE_FAILED",u,!0)}}return o}function Di(t,e,n){if(e){n??(n=e.length);for(let s=n-1;s>=0;--s){let r=e[s];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=e[++s];r?.type==="space";)t+=r.source.length,r=e[++s];break}}return t}var La={composeNode:Bs,composeEmptyNode:jn};function Bs(t,e,n,s){let r=t.atKey,{spaceBefore:i,comment:o,anchor:a,tag:l}=n,c,u=!0;switch(e.type){case"alias":c=Pa(t,e,s),(a||l)&&s(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=$s(t,e,l,s),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=Pi(La,t,e,n,s),a&&(c.anchor=a.source.substring(1))}catch(f){let p=f instanceof Error?f.message:String(f);s(e,"RESOURCE_EXHAUSTION",p)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",f),u=!1}}return c??(c=jn(t,e.offset,void 0,null,n,s)),a&&c.anchor===""&&s(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!N(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&s(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&u&&(c.srcToken=e),c}function jn(t,e,n,s,{spaceBefore:r,comment:i,anchor:o,tag:a,end:l},c){let u={type:"scalar",offset:Di(e,n,s),indent:-1,source:""},f=$s(t,u,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),i&&(f.comment=i,f.range[2]=l),f}function Pa({options:t},{offset:e,source:n,end:s},r){let i=new Ne(n.substring(1));i.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&r(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,a=ye(s,o,t.strict,r);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}function xi(t,e,{offset:n,start:s,value:r,end:i},o){let a=Object.assign({_directives:e},t),l=new xe(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=ge(s,{indicator:"doc-start",next:r??i?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=r?Bs(c,r,u,o):jn(c,u.end,s,null,u,o);let f=l.contents.range[2],p=ye(i,f,!1,o);return p.comment&&(l.comment=p.comment),l.range=[n,f,p.offset],l}function Ut(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function Mi(t){let e="",n=!1,s=!1;for(let r=0;r<t.length;++r){let i=t[r];switch(i[0]){case"#":e+=(e===""?"":s?`

`:`
`)+(i.substring(1)||" "),n=!0,s=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(s=!0),n=!1}}return{comment:e,afterEmptyLine:s}}var ut=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,s,r,i)=>{let o=Ut(n);i?this.warnings.push(new Kt(o,s,r)):this.errors.push(new de(o,s,r))},this.directives=new me({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:s,afterEmptyLine:r}=Mi(this.prelude);if(s){let i=e.contents;if(n)e.comment=e.comment?`${e.comment}
${s}`:s;else if(r||e.directives.docStart||!i)e.commentBefore=s;else if(I(i)&&!i.flow&&i.items.length>0){let o=i.items[0];T(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${s}
${a}`:s}else{let o=i.commentBefore;i.commentBefore=o?`${s}
${o}`:s}}if(n){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Mi(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,s=-1){for(let r of e)yield*this.next(r);yield*this.end(n,s)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(n,s,r)=>{let i=Ut(e);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",s,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=xi(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new de(Ut(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){let s="Unexpected doc-end without preceding document";this.errors.push(new de(Ut(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;let n=ye(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let s=this.doc.comment;this.doc.comment=s?`${s}
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new de(Ut(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 s=Object.assign({_directives:this.directives},this.options),r=new xe(void 0,s);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};var Rs=Symbol("break visit"),va=Symbol("skip children"),$i=Symbol("remove item");function Ke(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Bi(Object.freeze([]),t,e)}Ke.BREAK=Rs;Ke.SKIP=va;Ke.REMOVE=$i;Ke.itemAtPath=(t,e)=>{let n=t;for(let[s,r]of e){let i=n?.[s];if(i&&"items"in i)n=i.items[r];else return}return n};Ke.parentCollection=(t,e)=>{let n=Ke.itemAtPath(t,e.slice(0,-1)),s=e[e.length-1][0],r=n?.[s];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function Bi(t,e,n){let s=n(e,t);if(typeof s=="symbol")return s;for(let r of["key","value"]){let i=e[r];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){let a=Bi(Object.freeze(t.concat([[r,o]])),i.items[o],n);if(typeof a=="number")o=a-1;else{if(a===Rs)return Rs;a===$i&&(i.items.splice(o,1),o-=1)}}typeof s=="function"&&r==="key"&&(s=s(e,t))}}return typeof s=="function"?s(e,t):s}var qs="\uFEFF",Fs="",Ks="",Vn="";function Ri(t){switch(t){case qs:return"byte-order-mark";case Fs:return"doc-mode";case Ks:return"flow-error-end";case Vn:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
`:case`\r
`: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(t[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}function le(t){switch(t){case void 0:case" ":case`
`:case"\r":case"	":return!0;default:return!1}}var qi=new Set("0123456789ABCDEFabcdef"),xa=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Gn=new Set(",[]{}"),Ma=new Set(` ,[]{}
\r	`),Ys=t=>!t||Ma.has(t),jt=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,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let s=this.next??"stream";for(;s&&(n||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n==="	";)n=this.buffer[++e];return!n||n==="#"||n===`
`?!0:n==="\r"?this.buffer[e+1]===`
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let s=0;for(;n===" ";)n=this.buffer[++s+e];if(n==="\r"){let r=this.buffer[s+e+1];if(r===`
`||!r&&!this.atEnd)return e+s+1}return n===`
`||s>=this.indentNext||!n&&!this.atEnd?e+s:-1}if(n==="-"||n==="."){let s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&le(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(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 e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===qs&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,s=e.indexOf("#");for(;s!==-1;){let i=e[s-1];if(i===" "||i==="	"){n=s-1;break}else s=e.indexOf("#",s+1)}for(;;){let i=e[n-1];if(i===" "||i==="	")n-=1;else break}let r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield Fs,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 n=this.peek(3);if((n==="---"||n==="...")&&le(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!le(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===":")&&le(n)){let s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);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(Ys),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,s=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=s=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&r[0]!=="#"||s===0&&(r.startsWith("---")||r.startsWith("..."))&&le(r[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Ks,yield*this.parseLineStart();let i=0;for(;r[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-i),"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(Ys),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||le(o)||o===",")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),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let i=0;for(;this.buffer[n-1-i]==="\\";)i+=1;if(i%2===0)break;n=this.buffer.indexOf('"',n+1)}let s=this.buffer.substring(0,n),r=s.indexOf(`
`,this.pos);if(r!==-1){for(;r!==-1;){let i=this.continueScalar(r+1);if(i===-1)break;r=s.indexOf(`
`,i)}r!==-1&&(n=r-(s[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>le(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,s;e:for(let i=this.pos;s=this.buffer[i];++i)switch(s){case" ":n+=1;break;case`
`:e=i,n=0;break;case"\r":{let o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
`)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(s=this.buffer[r];s===" ";)s=this.buffer[++r];if(s==="	"){for(;s==="	"||s===" "||s==="\r"||s===`
`;)s=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);let a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
`&&i>=this.pos&&i+1+n>a)e=i;else break}while(!0);return yield Vn,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,s=this.pos-1,r;for(;r=this.buffer[++s];)if(r===":"){let i=this.buffer[s+1];if(le(i)||e&&Gn.has(i))break;n=s}else if(le(r)){let i=this.buffer[s+1];if(r==="\r"&&(i===`
`?(s+=1,r=`
`,i=this.buffer[s+1]):n=s),i==="#"||e&&Gn.has(i))break;if(r===`
`){let o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(e&&Gn.has(r))break;n=s}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Vn,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(n&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Ys),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,s=this.charAt(1);if(le(s)||n&&Gn.has(s)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!le(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(xa.has(n))n=this.buffer[++e];else if(n==="%"&&qi.has(this.buffer[e+1])&&qi.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,s;do s=this.buffer[++n];while(s===" "||e&&s==="	");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let n=this.pos,s=this.buffer[n];for(;!e(s);)s=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};var pt=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,s=this.lineStarts.length;for(;n<s;){let i=n+s>>1;this.lineStarts[i]<e?n=i+1:s=i}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let r=this.lineStarts[n-1];return{line:n,col:e-r+1}}}};function $e(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function Fi(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Yi(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Qn(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function mt(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Wn(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function Ki(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!$e(e.start,"explicit-key-ind")&&!$e(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Yi(e.value)?e.value.end?Wn(e.value.end,e.sep):e.value.end=e.sep:Wn(e.start,e.sep),delete e.sep)}var ht=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 jt,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let s of this.lexer.lex(e,n))yield*this.next(s);n||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=Ri(e);if(n)if(n==="scalar")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+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.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(this.type==="doc-end"&&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 n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let s=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in s?s.indent:0:n.type==="flow-collection"&&s.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Ki(n),s.type){case"document":s.value=n;break;case"block-scalar":s.props.push(n);break;case"block-map":{let r=s.items[s.items.length-1];if(r.value){s.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=s.items[s.items.length-1];r.value?s.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=s.items[s.items.length-1];!r||r.value?s.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Fi(r.start)===-1&&(n.indent===0||r.start.every(i=>i.type!=="comment"||i.indent<n.indent))&&(s.type==="document"?s.end=r.start:s.items.push({start:r.start}),n.items.splice(-1,1))}}}*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:[]};this.type==="doc-start"&&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":{Fi(e.start)!==-1?(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 n=this.startBlockValue(e);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let n=Qn(this.peek(2)),s=mt(n),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}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 n=this.source.indexOf(`
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let s="end"in n.value?n.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Wn(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let s=!this.onKeyLine&&this.indent===e.indent,r=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",i=[];if(r&&n.sep&&!n.value){let o=[];for(let a=0;a<n.sep.length;++a){let l=n.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if($e(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Yi(n.key)&&!$e(n.sep,"newline")){let o=mt(n.start),a=n.key,l=n.sep;l.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else i.length>0?n.sep=n.sep.concat(i,this.sourceToken):n.sep.push(this.sourceToken);else if($e(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=mt(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):$e(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);r||n.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!$e(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&e.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let s="end"in n.value?n.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Wn(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||$e(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let s=this.startBlockValue(e);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{let s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){let r=Qn(s),i=mt(r);Ki(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
`,n)+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 n=Qn(e),s=mt(n);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Qn(e),s=mt(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(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],this.type==="newline"&&(yield*this.pop())}}};function Ui(t,e,n){let s=t.srcToken;if(!s||s.type!=="flow-collection")throw new Error("Expected flow-collection CST node for flow sequence");let r=t.items.map((o,a)=>{let l=s.items[a];if(Ba(o,l)){let c=se(o.items);return Ee(c,l,e,Ot)}if(T(o))return Ee(o,l,e,Ot);{let c=[];for(let f of R(l.start)){if(Se(f)){c.push(f);continue}if(f.type==="comma")continue;throw new Error(`Unexpected token type in sequence item start: ${f.type}`)}let u=e.transformNode(o,{tokens:c});return Zr(X(u.position.start,u.position.end),u)}});if(t.items.length<s.items.length)for(let o=t.items.length;o<s.items.length;o++){let a=s.items[o];for(let l of v(a.start,e)){if(l.type==="comma")continue;throw new Error(`Unexpected token type in collection item start: ${l.type}`)}}let i=null;for(let o of R(s.end)){if(o.type==="comment"){e.transformComment(o);continue}if(o.type==="flow-seq-end"){i=o;continue}throw new Error(`Unexpected token type in flow seq end: ${o.type}`)}if(!i)throw new Error("Expected flow-seq-end token");return zr(e.transformRange([s.start.offset,i.offset+i.source.length]),e.transformContentProperties(t,n.tokens),r)}function Ba(t,e){if(t.srcToken)return!1;if(!Q(t))return!1;return t.items.length!==1?!1:t.items[0].srcToken===e}function Jn(t,e,n){return{type:"mapping",position:t,leadingComments:[],...e,children:n}}function Xn(t,e,n){return{type:"mappingItem",position:t,leadingComments:[],children:[e,n]}}function ji(t,e,n){let s=t.srcToken;if(!s||s.type!=="block-map")throw new Error("Expected block mapping srcToken");let r=t.items.map((i,o)=>{let a=s.items[o];return Ee(i,a,e,Xn)});if(t.items.length<s.items.length)for(let i=t.items.length;i<s.items.length;i++){let o=s.items[i];for(let a of v(o.start,e))throw new Error(`Unexpected token type in collection item start: ${a.type}`)}return Jn(X(r[0].position.start,se(r).position.end),e.transformContentProperties(t,n.tokens),r)}function Us(t,e,n){return{type:"plain",position:t,leadingComments:[],trailingComment:null,...e,value:n}}function Vi(t,e,n){for(let s=e;s>=0;s--)if(n.test(t[s]))return s;return-1}function Gi(t,e,n){if(t.range[0]===t.range[1]){let r=Vi(e.text,t.range[0]-1,/\S/u)+1;return Us(e.transformRange([r,r]),e.transformContentProperties(t,n.tokens),"")}let s=t.srcToken;if(!s||s.type!=="scalar")throw new Error("Expected plain scalar srcToken");for(let r of v(s.end,e))throw new Error(`Unexpected token type in plain scalar end: ${r.type}`);return Us(e.transformRange(t.range),e.transformContentProperties(t,n.tokens),t.source)}function Qi(t){return{...t,type:"quoteDouble"}}function Wi(t,e,n){return{type:"quoteValue",position:t,...e,leadingComments:[],trailingComment:null,value:n}}function zn(t,e,n,s){for(let r of v(e.end,n))throw new Error(`Unexpected token type in quote value end: ${r.type}`);return Wi(n.transformRange(t.range),n.transformContentProperties(t,s.tokens),t.source)}function Hi(t,e,n){let s=t.srcToken;if(!s||s.type!=="double-quoted-scalar")throw new Error("Expected double-quoted scalar srcToken");return Qi(zn(t,s,e,n))}function Ji(t){return{...t,type:"quoteSingle"}}function Xi(t,e,n){let s=t.srcToken;if(!s||s.type!=="single-quoted-scalar")throw new Error("Expected single-quoted scalar srcToken");return Ji(zn(t,s,e,n))}function zi(t,e,n){return{type:"sequence",position:t,leadingComments:[],endComments:[],...e,children:n}}function Zi(t,e){return{type:"sequenceItem",position:t,leadingComments:[],trailingComment:null,endComments:[],children:e?[e]:[]}}function eo(t,e,n){let s=t.srcToken;if(!s||s.type!=="block-seq")throw new Error("Expected block sequence srcToken");let r=t.items.map((i,o)=>{let a=s.items[o],l=[],c=null;for(let f of R(a.start)){if(Se(f)){l.push(f);continue}if(f.type==="seq-item-ind"){c=f;continue}throw new Error(`Unexpected token type in sequence item start: ${f.type}`)}let u=Ra(i,e,{tokens:l});return Zi(X(c?e.transformOffset(c.offset):u.position.start,u?.position.end??e.transformOffset(c.offset+c.source.length)),u)});if(t.items.length<s.items.length)for(let i=t.items.length;i<s.items.length;i++){let o=s.items[i];for(let a of v(o.start,e))throw new Error(`Unexpected token type in collection item start: ${a.type}`)}return zi(X(r[0].position.start,se(r).position.end),e.transformContentProperties(t,n.tokens),r)}function Ra(t,e,n){if(!T(t))return _t(t,n)?(v(n.tokens,e),null):e.transformNode(t,n);let s=t.srcToken,r=Ee(t,s,e,Xn);return Jn(r.position,e.transformContentProperties(t.key,n.tokens),[r])}function to(t,e,n){if(t==null)return null;if(Z(t))return Ur(t,e,n);if(Q(t))return t.flow?Xr(t,e,n):ji(t,e,n);if(ee(t))return t.flow?Ui(t,e,n):eo(t,e,n);if(N(t)){switch(t.type){case"BLOCK_FOLDED":return Gr(t,e,n);case"BLOCK_LITERAL":return Wr(t,e,n);case"PLAIN":return Gi(t,e,n);case"QUOTE_DOUBLE":return Hi(t,e,n);case"QUOTE_SINGLE":return Xi(t,e,n)}throw new Error(`Unexpected scalar type: ${t.type}`)}throw new Error("Unexpected unknown node type")}function _t(t,e){return!t||t.range[0]===t.range[1]&&e.tokens.every(n=>n.type==="comment")}var no=class{text;comments=[];#e;constructor(t,e){this.text=t,this.#e=e}transformOffset(t){let{line:e,col:n}=this.#e.linePos(t);return{line:e,column:n,offset:t}}transformRange(t){let[e,n]=t.map(s=>this.transformOffset(s));return X(e,n)}transformNode(t,e){return to(t,this,e)}transformComment(t){let e=Br(t,this);return this.comments.push(e),e}transformContentProperties(t,e){return Kr(t,e,this)}};function so(t,e,n,s,r,i){return{type:"document",position:t,trailingComment:i,directivesEndMarker:e,documentEndMarker:n,children:[s,r]}}function ro(t,e,n){return{type:"documentBody",position:t,endComments:n,children:e?[e]:[]}}function io(t,e,n){for(let s=e;s<t.length;s++)if(n.test(t[s]))return s;return null}function oo(t,e,n,s,r,i,o){let{documentTrailingComment:a,endComments:l,propTokens:c}=qa(e,n,r,i,o),u=s.contents&&(s.contents.range[0]<s.contents.range[1]||c.some(g=>g.type==="tag"||g.type==="anchor")),f=u?o.transformNode(s.contents,{tokens:c}):null;if(!u)for(let g of v(c,o))throw new Error(`Unexpected token type in empty document body: ${g.type}`);let{position:p,documentEndPoint:h}=Fa(t,s,f,i,o);return{documentBody:ro(p,f,l),documentEndPoint:h,documentTrailingComment:a}}function qa(t,e,n,s,r){let i=[],o=[],a=[];for(let c of t){if(Se(c)){a.push(c);continue}throw new Error(`Unexpected token type: ${c.type}`)}for(let c of v(n,r))throw new Error(`Unexpected token type: ${c.type}`);let l=s?r.transformOffset(s.offset):null;if(e)for(let c of R(e.end,s?.end)){if(c.type==="comment"){let u=r.transformComment(c);l?l.line===u.position.start.line?o.push(u):u.position.start.line<l.line&&i.push(u):i.push(u);continue}throw new Error(`Unexpected token type: ${c.type}`)}if(o.length>1)throw new Error(`Unexpected multiple document trailing comments at ${Ie(o[1].position.start)}`);return{propTokens:a,endComments:i,documentTrailingComment:se(o)||null}}function Fa(t,e,n,s,r){let i=s?Math.max(0,s.offset-1):io(r.text,e.range[2],/\S/u)??r.text.length;r.text[i-1]==="\r"&&i--;let o=n!==null?n.position.start.offset:i;if(t){let l=t.offset+t.source.length+1;o<l&&l<=i&&(o=l)}let a=r.transformRange([o,i]);return{position:a,documentEndPoint:s?r.transformOffset(s.offset+s.source.length):a.end}}function ao(t,e,n,s){return{type:"documentHead",position:t,endComments:n,trailingComment:s,children:e}}function lo(t,e,n){return{type:"directive",position:t,leadingComments:[],trailingComment:null,name:e,parameters:n}}function co(t,e){let n=t.source.trim().split(/[\t ]+/),s=n.shift().replace(/^%/,"");return lo(e.transformRange([t.offset,t.offset+t.source.length]),s,n)}function fo(t,e,n,s){let{directives:r,endCommentCandidates:i}=Ka(t,s),o=[],a=null;if(e){for(let u of R(e.start))if(o.push(u),!a&&u.type==="doc-start"){for(let f of o)if(f.type==="comment"){let p=s.transformComment(f);i.push(p)}o=[],a=u}}let l=Ya(r,n,a,s),c=null;if(a&&o.length>0){let u=o[0];u.type==="comment"&&s.transformOffset(u.offset).line===l.end.line&&(c=s.transformComment(u),o.shift())}return{documentHead:ao(l,r,a?i:[],c),docStart:a,tokensBeforeBody:o}}function Ka(t,e){let n=[],s=[],r=null;for(let i of t)if(i.type==="comment"){let o=e.transformComment(i);r&&r.position.end.line===o.position.start.line&&!r.trailingComment?(r.trailingComment=o,r.position.end=o.position.end):s.push(o)}else{let o=co(i,e);n.push(o),r=o,s=[]}return{directives:n,endCommentCandidates:s}}function Ya(t,e,n,s){let r=n?[n.offset,n.offset+n.source.length]:e.contents?[e.contents.range[0],e.contents.range[0]]:[e.range[0],e.range[0]];return t.length!==0&&(r[0]=t[0].position.start.offset),s.transformRange(r)}function uo(t,e){let{documentHead:n,tokensBeforeBody:s,docStart:r}=fo(t.tokensBeforeBody,t.cstNode,t.node,e),{documentBody:i,documentEndPoint:o,documentTrailingComment:a}=oo(r,s,t.cstNode,t.node,t.tokensAfterBody,t.documentEnd,e);return so(X(n.position.start,o),!!r,!!t.documentEnd,n,i,a)}function po(t,e,n){if(t.length===0)return[];let s=[],r=[],i=[],o=null,a=l=>{let c={tokensBeforeBody:[...i,...r],cstNode:l,node:t[s.length],tokensAfterBody:[],documentEnd:null};return s.push(c),i.length=0,r.length=0,c};for(let l of R(e)){if(l.type==="document"){if(s.length>=t.length)throw new Error(`Unexpected 'document' token at ${Ie(n.transformOffset(l.offset))}`);o=a(l);continue}if(l.type==="comment"){r.push(l);continue}if(l.type==="directive"){i.push(...r,l),r.length=0;continue}if(l.type==="doc-end"){if(!o||o.documentEnd)throw new Error(`Unexpected 'doc-end' token at ${Ie(n.transformOffset(l.offset))}`);o.tokensAfterBody=[...r],r.length=0,o.documentEnd=l;continue}}if(i.length>0){let[l]=i;throw new Error(`Unexpected '${l.type}' token at ${Ie(n.transformOffset(l.offset))}`)}return r.length>0&&(o||(o=a(null)),r.length>0&&(o.tokensAfterBody.push(...r),r.length=0)),s.map(l=>uo(l,n))}function js(t,e,n,s){let r=e(t);return i=>{s(r,i)&&n(t,r=i)}}function Vs(t){if(t===null||!("children"in t))return;let e=t.children;if(e.forEach(Vs),t.type==="document"){let[i,o]=t.children;i.position.start.offset===i.position.end.offset?i.position.start=i.position.end=o.position.start:o.position.start.offset===o.position.end.offset&&(o.position.start=o.position.end=i.position.end)}let n=js(t.position,Ua,ja,Qa),s=js(t.position,Va,Ga,Wa);"endComments"in t&&t.endComments.length!==0&&(n(t.endComments[0].position.start),s(se(t.endComments).position.end));let r=e.filter(i=>i!==null);if(r.length!==0){let i=r[0],o=se(r);n(i.position.start),s(o.position.end),"leadingComments"in i&&i.leadingComments.length!==0&&n(i.leadingComments[0].position.start),"tag"in i&&i.tag&&n(i.tag.position.start),"anchor"in i&&i.anchor&&n(i.anchor.position.start),"trailingComment"in o&&o.trailingComment&&s(o.trailingComment.position.end)}}function Ua(t){return t.start}function ja(t,e){t.start=e}function Va(t){return t.end}function Ga(t,e){t.end=e}function Qa(t,e){return e.offset<t.offset}function Wa(t,e){return e.offset>t.offset}function Gs(t,e){let n=new pt,s=new no(t,n),r=new ht(n.addNewLine),i=new ut({keepSourceTokens:!0,uniqueKeys:e?.uniqueKeys,lineCounter:n,merge:!0}),o=[],a=[...r.parse(t)];for(let f of i.compose(a,!0,t.length)){let{errors:p}=f;if(p.length>0)throw new Tt(s,p[0]);o.push(f)}let l=po(o,a,s),c=s.comments.sort((f,p)=>f.position.start.offset-p.position.end.offset),u=Mr(s.transformRange([0,t.length]),l,c);return vr(u),Vs(u),u}function Ha(t,e){let n=new SyntaxError(t+" ("+e.loc.start.line+":"+e.loc.start.column+")");return Object.assign(n,e)}var mo=Ha;var Ja={uniqueKeys:!1};function Xa(t){let e;try{e=Gs(t,Ja)}catch(n){throw n instanceof Tt?mo(n.message,{loc:n.position,cause:n}):n}return delete e.comments,e}var za={astFormat:"yaml",parse:Xa,hasPragma:gr,hasIgnorePragma:yr,locStart:Be,locEnd:fr};var Za={yaml:Ir};return wo(el);});