textlint-plugin-typst 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/lib/index.js +131 -124
- package/package.json +4 -3
package/lib/index.js
CHANGED
|
@@ -1,158 +1,165 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`)}};
|
|
3
|
-
`)?
|
|
1
|
+
"use strict";var aa=Object.create;var ot=Object.defineProperty;var la=Object.getOwnPropertyDescriptor;var ca=Object.getOwnPropertyNames;var ua=Object.getPrototypeOf,fa=Object.prototype.hasOwnProperty;var C=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),ha=(s,e)=>{for(var t in e)ot(s,t,{get:e[t],enumerable:!0})},Zn=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ca(e))!fa.call(s,i)&&i!==t&&ot(s,i,{get:()=>e[i],enumerable:!(n=la(e,i))||n.enumerable});return s};var as=(s,e,t)=>(t=s!=null?aa(ua(s)):{},Zn(e||!s||!s.__esModule?ot(t,"default",{value:s,enumerable:!0}):t,s)),da=s=>Zn(ot({},"__esModule",{value:!0}),s);var oi=C(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.ASTNodeTypes=void 0;var ri;(function(s){s.Document="Document",s.DocumentExit="Document:exit",s.Paragraph="Paragraph",s.ParagraphExit="Paragraph:exit",s.BlockQuote="BlockQuote",s.BlockQuoteExit="BlockQuote:exit",s.ListItem="ListItem",s.ListItemExit="ListItem:exit",s.List="List",s.ListExit="List:exit",s.Header="Header",s.HeaderExit="Header:exit",s.CodeBlock="CodeBlock",s.CodeBlockExit="CodeBlock:exit",s.HtmlBlock="HtmlBlock",s.HtmlBlockExit="HtmlBlock:exit",s.HorizontalRule="HorizontalRule",s.HorizontalRuleExit="HorizontalRule:exit",s.Comment="Comment",s.CommentExit="Comment:exit",s.ReferenceDef="ReferenceDef",s.ReferenceDefExit="ReferenceDef:exit",s.Str="Str",s.StrExit="Str:exit",s.Break="Break",s.BreakExit="Break:exit",s.Emphasis="Emphasis",s.EmphasisExit="Emphasis:exit",s.Strong="Strong",s.StrongExit="Strong:exit",s.Html="Html",s.HtmlExit="Html:exit",s.Link="Link",s.LinkExit="Link:exit",s.Image="Image",s.ImageExit="Image:exit",s.Code="Code",s.CodeExit="Code:exit",s.Delete="Delete",s.DeleteExit="Delete:exit",s.Table="Table",s.TableExit="Table:exit",s.TableRow="TableRow",s.TableRowExit="TableRow:exit",s.TableCell="TableCell",s.TableCellExit="TableCell:exit"})(ri||(ct.ASTNodeTypes=ri={}))});var ai=C(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.ASTNodeTypes=void 0;var ka=oi();Object.defineProperty(ut,"ASTNodeTypes",{enumerable:!0,get:function(){return ka.ASTNodeTypes}})});var M=C(j=>{"use strict";var ds=Symbol.for("yaml.alias"),li=Symbol.for("yaml.document"),ft=Symbol.for("yaml.map"),ci=Symbol.for("yaml.pair"),ps=Symbol.for("yaml.scalar"),ht=Symbol.for("yaml.seq"),z=Symbol.for("yaml.node.type"),va=s=>!!s&&typeof s=="object"&&s[z]===ds,Na=s=>!!s&&typeof s=="object"&&s[z]===li,Ca=s=>!!s&&typeof s=="object"&&s[z]===ft,Aa=s=>!!s&&typeof s=="object"&&s[z]===ci,ui=s=>!!s&&typeof s=="object"&&s[z]===ps,La=s=>!!s&&typeof s=="object"&&s[z]===ht;function fi(s){if(s&&typeof s=="object")switch(s[z]){case ft:case ht:return!0}return!1}function Oa(s){if(s&&typeof s=="object")switch(s[z]){case ds:case ft:case ps:case ht:return!0}return!1}var Ea=s=>(ui(s)||fi(s))&&!!s.anchor;j.ALIAS=ds;j.DOC=li;j.MAP=ft;j.NODE_TYPE=z;j.PAIR=ci;j.SCALAR=ps;j.SEQ=ht;j.hasAnchor=Ea;j.isAlias=va;j.isCollection=fi;j.isDocument=Na;j.isMap=Ca;j.isNode=Oa;j.isPair=Aa;j.isScalar=ui;j.isSeq=La});var Ie=C(ms=>{"use strict";var D=M(),K=Symbol("break visit"),hi=Symbol("skip children"),W=Symbol("remove node");function dt(s,e){let t=di(e);D.isDocument(s)?we(null,s.contents,t,Object.freeze([s]))===W&&(s.contents=null):we(null,s,t,Object.freeze([]))}dt.BREAK=K;dt.SKIP=hi;dt.REMOVE=W;function we(s,e,t,n){let i=pi(s,e,t,n);if(D.isNode(i)||D.isPair(i))return mi(s,n,i),we(s,i,t,n);if(typeof i!="symbol"){if(D.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=we(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===K)return K;o===W&&(e.items.splice(r,1),r-=1)}}}else if(D.isPair(e)){n=Object.freeze(n.concat(e));let r=we("key",e.key,t,n);if(r===K)return K;r===W&&(e.key=null);let o=we("value",e.value,t,n);if(o===K)return K;o===W&&(e.value=null)}}return i}async function pt(s,e){let t=di(e);D.isDocument(s)?await be(null,s.contents,t,Object.freeze([s]))===W&&(s.contents=null):await be(null,s,t,Object.freeze([]))}pt.BREAK=K;pt.SKIP=hi;pt.REMOVE=W;async function be(s,e,t,n){let i=await pi(s,e,t,n);if(D.isNode(i)||D.isPair(i))return mi(s,n,i),be(s,i,t,n);if(typeof i!="symbol"){if(D.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=await be(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===K)return K;o===W&&(e.items.splice(r,1),r-=1)}}}else if(D.isPair(e)){n=Object.freeze(n.concat(e));let r=await be("key",e.key,t,n);if(r===K)return K;r===W&&(e.key=null);let o=await be("value",e.value,t,n);if(o===K)return K;o===W&&(e.value=null)}}return i}function di(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function pi(s,e,t,n){if(typeof t=="function")return t(s,e,n);if(D.isMap(e))return t.Map?.(s,e,n);if(D.isSeq(e))return t.Seq?.(s,e,n);if(D.isPair(e))return t.Pair?.(s,e,n);if(D.isScalar(e))return t.Scalar?.(s,e,n);if(D.isAlias(e))return t.Alias?.(s,e,n)}function mi(s,e,t){let n=e[e.length-1];if(D.isCollection(n))n.items[s]=t;else if(D.isPair(n))s==="key"?n.key=t:n.value=t;else if(D.isDocument(n))n.contents=t;else{let i=D.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}ms.visit=dt;ms.visitAsync=pt});var gs=C(yi=>{"use strict";var gi=M(),qa=Ie(),Ta={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ia=s=>s.replace(/[!,[\]{}]/g,e=>Ta[e]),Pe=class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Ia(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&gi.isNode(e.contents)){let r={};qa.visit(e.contents,(o,a)=>{gi.isNode(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
|
|
2
|
+
`)}};Pe.defaultYaml={explicit:!1,version:"1.2"};Pe.defaultTags={"!!":"tag:yaml.org,2002:"};yi.Directives=Pe});var mt=C(Me=>{"use strict";var wi=M(),Pa=Ie();function Ma(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function bi(s){let e=new Set;return Pa.visit(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function Si(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}function _a(s,e){let t=[],n=new Map,i=null;return{onAnchor:r=>{t.push(r),i||(i=bi(s));let o=Si(e,i);return i.add(o),o},setAnchors:()=>{for(let r of t){let o=n.get(r);if(typeof o=="object"&&o.anchor&&(wi.isScalar(o.node)||wi.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:n}}Me.anchorIsValid=Ma;Me.anchorNames=bi;Me.createNodeAnchors=_a;Me.findNewAnchor=Si});var ys=C(ki=>{"use strict";function _e(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){let o=n[i],a=_e(s,n,String(i),o);a===void 0?delete n[i]:a!==o&&(n[i]=a)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),o=_e(s,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let r=_e(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(let[i,r]of Object.entries(n)){let o=_e(s,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return s.call(e,t,n)}ki.applyReviver=_e});var te=C(Ni=>{"use strict";var Ba=M();function vi(s,e,t){if(Array.isArray(s))return s.map((n,i)=>vi(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!Ba.hasAnchor(s))return s.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};let i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!t?.keep?Number(s):s}Ni.toJS=vi});var gt=C(Ai=>{"use strict";var $a=ys(),Ci=M(),xa=te(),ws=class{constructor(e){Object.defineProperty(this,Ci.NODE_TYPE,{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:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!Ci.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=xa.toJS(this,"",o);if(typeof i=="function")for(let{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?$a.applyReviver(r,{"":a},"",a):a}};Ai.NodeBase=ws});var Be=C(Oi=>{"use strict";var Da=mt(),Li=Ie(),yt=M(),ja=gt(),Ra=te(),bs=class extends ja.NodeBase{constructor(e){super(yt.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return Li.visit(e,{Node:(n,i)=>{if(i===this)return Li.visit.BREAK;i.anchor===this.source&&(t=i)}}),t}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:r}=t,o=this.resolve(i);if(!o){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=n.get(o);if(a||(Ra.toJS(o,null,t),a=n.get(o)),!a||a.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=wt(i,o,n)),a.count*a.aliasCount>r)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,t,n){let i=`*${this.source}`;if(e){if(Da.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function wt(s,e,t){if(yt.isAlias(e)){let n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(yt.isCollection(e)){let n=0;for(let i of e.items){let r=wt(s,i,t);r>n&&(n=r)}return n}else if(yt.isPair(e)){let n=wt(s,e.key,t),i=wt(s,e.value,t);return Math.max(n,i)}return 1}Oi.Alias=bs});var x=C(Ss=>{"use strict";var Fa=M(),Ka=gt(),Ua=te(),Ya=s=>!s||typeof s!="function"&&typeof s!="object",se=class extends Ka.NodeBase{constructor(e){super(Fa.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:Ua.toJS(this.value,e,t)}toString(){return String(this.value)}};se.BLOCK_FOLDED="BLOCK_FOLDED";se.BLOCK_LITERAL="BLOCK_LITERAL";se.PLAIN="PLAIN";se.QUOTE_DOUBLE="QUOTE_DOUBLE";se.QUOTE_SINGLE="QUOTE_SINGLE";Ss.Scalar=se;Ss.isScalarValue=Ya});var $e=C(qi=>{"use strict";var Va=Be(),ue=M(),Ei=x(),Ja="tag:yaml.org,2002:";function Ha(s,e,t){if(e){let n=t.filter(r=>r.tag===e),i=n.find(r=>!r.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(n=>n.identify?.(s)&&!n.format)}function Wa(s,e,t){if(ue.isDocument(s)&&(s=s.contents),ue.isNode(s))return s;if(ue.isPair(s)){let d=t.schema[ue.MAP].createNode?.(t.schema,null,t);return d.items.push(s),d}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=t,l;if(n&&s&&typeof s=="object"){if(l=a.get(s),l)return l.anchor||(l.anchor=i(s)),new Va.Alias(l.anchor);l={anchor:null,node:null},a.set(s,l)}e?.startsWith("!!")&&(e=Ja+e.slice(2));let c=Ha(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let d=new Ei.Scalar(s);return l&&(l.node=d),d}c=s instanceof Map?o[ue.MAP]:Symbol.iterator in Object(s)?o[ue.SEQ]:o[ue.MAP]}r&&(r(c),delete t.onTagObj);let m=c?.createNode?c.createNode(t.schema,s,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,s,t):new Ei.Scalar(s);return e?m.tag=e:c.default||(m.tag=c.tag),l&&(l.node=m),m}qi.createNode=Wa});var St=C(bt=>{"use strict";var Qa=$e(),Q=M(),Ga=gt();function ks(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return Qa.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var Ti=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,vs=class extends Ga.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>Q.isNode(n)||Q.isPair(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ti(e))this.add(t);else{let[n,...i]=e,r=this.get(n,!0);if(Q.isCollection(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,ks(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let i=this.get(t,!0);if(Q.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&Q.isScalar(r)?r.value:r:Q.isCollection(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Q.isPair(t))return!1;let n=t.value;return n==null||e&&Q.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let i=this.get(t,!0);return Q.isCollection(i)?i.hasIn(n):!1}setIn(e,t){let[n,...i]=e;if(i.length===0)this.set(n,t);else{let r=this.get(n,!0);if(Q.isCollection(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,ks(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};bt.Collection=vs;bt.collectionFromPath=ks;bt.isEmptyPath=Ti});var xe=C(kt=>{"use strict";var za=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function Ns(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var Xa=(s,e,t)=>s.endsWith(`
|
|
3
|
+
`)?Ns(t,e):t.includes(`
|
|
4
4
|
`)?`
|
|
5
|
-
`+
|
|
6
|
-
`)t===
|
|
7
|
-
`&&
|
|
8
|
-
`&&
|
|
9
|
-
${e}${s.slice(0,
|
|
10
|
-
${e}${s.slice(
|
|
11
|
-
`);n=e,i=e+1,r=s[i]}return n}
|
|
12
|
-
`){if(r-
|
|
5
|
+
`+Ns(t,e):(s.endsWith(" ")?"":" ")+t;kt.indentComment=Ns;kt.lineComment=Xa;kt.stringifyComment=za});var Pi=C(De=>{"use strict";var Za="flow",Cs="block",vt="quoted";function el(s,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return s;i<r&&(r=0);let l=Math.max(1+r,1+i-e.length);if(s.length<=l)return s;let c=[],m={},d=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?c.push(0):d=i-n);let h,y,k=!1,f=-1,p=-1,O=-1;t===Cs&&(f=Ii(s,f,e.length),f!==-1&&(d=f+l));for(let q;q=s[f+=1];){if(t===vt&&q==="\\"){switch(p=f,s[f+1]){case"x":f+=3;break;case"u":f+=5;break;case"U":f+=9;break;default:f+=1}O=f}if(q===`
|
|
6
|
+
`)t===Cs&&(f=Ii(s,f,e.length)),d=f+e.length+l,h=void 0;else{if(q===" "&&y&&y!==" "&&y!==`
|
|
7
|
+
`&&y!==" "){let T=s[f+1];T&&T!==" "&&T!==`
|
|
8
|
+
`&&T!==" "&&(h=f)}if(f>=d)if(h)c.push(h),d=h+l,h=void 0;else if(t===vt){for(;y===" "||y===" ";)y=q,q=s[f+=1],k=!0;let T=f>O+1?f-2:p-1;if(m[T])return s;c.push(T),m[T]=!0,d=T+l,h=void 0}else k=!0}y=q}if(k&&a&&a(),c.length===0)return s;o&&o();let N=s.slice(0,c[0]);for(let q=0;q<c.length;++q){let T=c[q],E=c[q+1]||s.length;T===0?N=`
|
|
9
|
+
${e}${s.slice(0,E)}`:(t===vt&&m[T]&&(N+=`${s[T]}\\`),N+=`
|
|
10
|
+
${e}${s.slice(T+1,E)}`)}return N}function Ii(s,e,t){let n=e,i=e+1,r=s[i];for(;r===" "||r===" ";)if(e<i+t)r=s[++e];else{do r=s[++e];while(r&&r!==`
|
|
11
|
+
`);n=e,i=e+1,r=s[i]}return n}De.FOLD_BLOCK=Cs;De.FOLD_FLOW=Za;De.FOLD_QUOTED=vt;De.foldFlowLines=el});var Re=C(Mi=>{"use strict";var G=x(),ne=Pi(),Ct=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),At=s=>/^(%|---|\.\.\.)/m.test(s);function tl(s,e,t){if(!e||e<0)return!1;let n=e-t,i=s.length;if(i<=n)return!1;for(let r=0,o=0;r<i;++r)if(s[r]===`
|
|
12
|
+
`){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}function je(s,e){let t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(At(s)?" ":""),o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);let m=t.substr(l+2,4);switch(m){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:m.substr(0,2)==="00"?o+="\\x"+m.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(n||t[l+2]==='"'||t.length<i)l+=1;else{for(o+=t.slice(a,l)+`
|
|
13
13
|
|
|
14
|
-
`;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)
|
|
15
|
-
`,l+=2;
|
|
16
|
-
`)||/[ \t]\n|\n[ \t]/.test(s))return
|
|
17
|
-
${t}`)+"'";return e.implicitKey?n:
|
|
14
|
+
`;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)o+=`
|
|
15
|
+
`,l+=2;o+=r,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,n?o:ne.foldFlowLines(o,r,ne.FOLD_QUOTED,Ct(e,!1))}function As(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
|
|
16
|
+
`)||/[ \t]\n|\n[ \t]/.test(s))return je(s,e);let t=e.indent||(At(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
17
|
+
${t}`)+"'";return e.implicitKey?n:ne.foldFlowLines(n,t,ne.FOLD_FLOW,Ct(e,!1))}function Se(s,e){let{singleQuote:t}=e.options,n;if(t===!1)n=je;else{let i=s.includes('"'),r=s.includes("'");i&&!r?n=As:r&&!i?n=je:n=t?As:je}return n(s,e)}var Ls;try{Ls=new RegExp(`(^|(?<!
|
|
18
18
|
))
|
|
19
19
|
+(?!
|
|
20
|
-
|$)`,"g")}catch{
|
|
20
|
+
|$)`,"g")}catch{Ls=/\n+(?!\n|$)/g}function Nt({comment:s,type:e,value:t},n,i,r){let{blockQuote:o,commentString:a,lineWidth:l}=n.options;if(!o||/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return Se(t,n);let c=n.indent||(n.forceBlockIndent||At(t)?" ":""),m=o==="literal"?!0:o==="folded"||e===G.Scalar.BLOCK_FOLDED?!1:e===G.Scalar.BLOCK_LITERAL?!0:!tl(t,l,c.length);if(!t)return m?`|
|
|
21
21
|
`:`>
|
|
22
|
-
`;let h
|
|
23
|
-
`&&
|
|
24
|
-
`);
|
|
25
|
-
`&&(
|
|
26
|
-
`)
|
|
27
|
-
${c}${
|
|
28
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let
|
|
29
|
-
${c}${
|
|
30
|
-
`)||m&&/[[\]{},]/.test(r))return
|
|
31
|
-
`)?
|
|
32
|
-
`))return
|
|
33
|
-
${l}`);if(
|
|
34
|
-
${e.indent}${
|
|
35
|
-
${
|
|
36
|
-
`:"",
|
|
37
|
-
${
|
|
38
|
-
`&&(
|
|
22
|
+
`;let d,h;for(h=t.length;h>0;--h){let v=t[h-1];if(v!==`
|
|
23
|
+
`&&v!==" "&&v!==" ")break}let y=t.substring(h),k=y.indexOf(`
|
|
24
|
+
`);k===-1?d="-":t===y||k!==y.length-1?(d="+",r&&r()):d="",y&&(t=t.slice(0,-y.length),y[y.length-1]===`
|
|
25
|
+
`&&(y=y.slice(0,-1)),y=y.replace(Ls,`$&${c}`));let f=!1,p,O=-1;for(p=0;p<t.length;++p){let v=t[p];if(v===" ")f=!0;else if(v===`
|
|
26
|
+
`)O=p;else break}let N=t.substring(0,O<p?O+1:p);N&&(t=t.substring(N.length),N=N.replace(/\n+/g,`$&${c}`));let T=(m?"|":">")+(f?c?"2":"1":"")+d;if(s&&(T+=" "+a(s.replace(/ ?[\r\n]+/g," ")),i&&i()),m)return t=t.replace(/\n+/g,`$&${c}`),`${T}
|
|
27
|
+
${c}${N}${t}${y}`;t=t.replace(/\n+/g,`
|
|
28
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let E=ne.foldFlowLines(`${N}${t}${y}`,c,ne.FOLD_BLOCK,Ct(n,!0));return`${T}
|
|
29
|
+
${c}${E}`}function sl(s,e,t,n){let{type:i,value:r}=s,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:m}=e;if(a&&r.includes(`
|
|
30
|
+
`)||m&&/[[\]{},]/.test(r))return Se(r,e);if(!r||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||m||!r.includes(`
|
|
31
|
+
`)?Se(r,e):Nt(s,e,t,n);if(!a&&!m&&i!==G.Scalar.PLAIN&&r.includes(`
|
|
32
|
+
`))return Nt(s,e,t,n);if(At(r)){if(l==="")return e.forceBlockIndent=!0,Nt(s,e,t,n);if(a&&l===c)return Se(r,e)}let d=r.replace(/\n+/g,`$&
|
|
33
|
+
${l}`);if(o){let h=f=>f.default&&f.tag!=="tag:yaml.org,2002:str"&&f.test?.test(d),{compat:y,tags:k}=e.doc.schema;if(k.some(h)||y?.some(h))return Se(r,e)}return a?d:ne.foldFlowLines(d,l,ne.FOLD_FLOW,Ct(e,!1))}function nl(s,e,t,n){let{implicitKey:i,inFlow:r}=e,o=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)}),{type:a}=s;a!==G.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=G.Scalar.QUOTE_DOUBLE);let l=m=>{switch(m){case G.Scalar.BLOCK_FOLDED:case G.Scalar.BLOCK_LITERAL:return i||r?Se(o.value,e):Nt(o,e,t,n);case G.Scalar.QUOTE_DOUBLE:return je(o.value,e);case G.Scalar.QUOTE_SINGLE:return As(o.value,e);case G.Scalar.PLAIN:return sl(o,e,t,n);default:return null}},c=l(a);if(c===null){let{defaultKeyType:m,defaultStringType:d}=e.options,h=i&&m||d;if(c=l(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}Mi.stringifyString=nl});var Fe=C(Os=>{"use strict";var il=mt(),ie=M(),rl=xe(),ol=Re();function al(s,e){let t=Object.assign({blockQuote:!0,commentString:rl.stringifyComment,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,trueStr:"true",verifyAliasOrder:!0},s.schema.toStringOptions,e),n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:s,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function ll(s,e){if(e.tag){let i=s.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,n;if(ie.isScalar(e)){n=e.value;let i=s.filter(r=>r.identify?.(n));t=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else n=e,t=s.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!t){let i=n?.constructor?.name??typeof n;throw new Error(`Tag not resolved for ${i} value`)}return t}function cl(s,e,{anchors:t,doc:n}){if(!n.directives)return"";let i=[],r=(ie.isScalar(s)||ie.isCollection(s))&&s.anchor;r&&il.anchorIsValid(r)&&(t.add(r),i.push(`&${r}`));let o=s.tag?s.tag:e.default?null:e.tag;return o&&i.push(n.directives.tagString(o)),i.join(" ")}function ul(s,e,t,n){if(ie.isPair(s))return s.toString(e,t,n);if(ie.isAlias(s)){if(e.doc.directives)return s.toString(e);if(e.resolvedAliases?.has(s))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(s):e.resolvedAliases=new Set([s]),s=s.resolve(e.doc)}let i,r=ie.isNode(s)?s:e.doc.createNode(s,{onTagObj:l=>i=l});i||(i=ll(e.doc.schema.tags,r));let o=cl(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof i.stringify=="function"?i.stringify(r,e,t,n):ie.isScalar(r)?ol.stringifyString(r,e,t,n):r.toString(e,t,n);return o?ie.isScalar(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
34
|
+
${e.indent}${a}`:a}Os.createStringifyContext=al;Os.stringify=ul});var xi=C($i=>{"use strict";var X=M(),_i=x(),Bi=Fe(),Ke=xe();function fl({key:s,value:e},t,n,i){let{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:m,simpleKeys:d}}=t,h=X.isNode(s)&&s.comment||null;if(d){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(X.isCollection(s)||!X.isNode(s)&&typeof s=="object"){let w="With simple keys, collection cannot be used as a key value";throw new Error(w)}}let y=!d&&(!s||h&&e==null&&!t.inFlow||X.isCollection(s)||(X.isScalar(s)?s.type===_i.Scalar.BLOCK_FOLDED||s.type===_i.Scalar.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!y&&(d||!r),indent:a+l});let k=!1,f=!1,p=Bi.stringify(s,t,()=>k=!0,()=>f=!0);if(!y&&!t.inFlow&&p.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");y=!0}if(t.inFlow){if(r||e==null)return k&&n&&n(),p===""?"?":y?`? ${p}`:p}else if(r&&!d||e==null&&y)return p=`? ${p}`,h&&!k?p+=Ke.lineComment(p,t.indent,c(h)):f&&i&&i(),p;k&&(h=null),y?(h&&(p+=Ke.lineComment(p,t.indent,c(h))),p=`? ${p}
|
|
35
|
+
${a}:`):(p=`${p}:`,h&&(p+=Ke.lineComment(p,t.indent,c(h))));let O,N,q;X.isNode(e)?(O=!!e.spaceBefore,N=e.commentBefore,q=e.comment):(O=!1,N=null,q=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!y&&!h&&X.isScalar(e)&&(t.indentAtStart=p.length+1),f=!1,!m&&l.length>=2&&!t.inFlow&&!y&&X.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let T=!1,E=Bi.stringify(e,t,()=>T=!0,()=>f=!0),v=" ";if(h||O||N){if(v=O?`
|
|
36
|
+
`:"",N){let w=c(N);v+=`
|
|
37
|
+
${Ke.indentComment(w,t.indent)}`}E===""&&!t.inFlow?v===`
|
|
38
|
+
`&&(v=`
|
|
39
39
|
|
|
40
|
-
`):
|
|
41
|
-
${t.indent}`}else if(!
|
|
42
|
-
`),
|
|
43
|
-
${t.indent}`)}}else(
|
|
44
|
-
`)&&(
|
|
45
|
-
${l}${
|
|
46
|
-
`}}return s?(
|
|
47
|
-
`+
|
|
48
|
-
`))&&(c=!0),
|
|
49
|
-
${r}${i}${
|
|
50
|
-
`;return`${
|
|
51
|
-
${i}${
|
|
52
|
-
`:" ")}return
|
|
40
|
+
`):v+=`
|
|
41
|
+
${t.indent}`}else if(!y&&X.isCollection(e)){let w=E[0],u=E.indexOf(`
|
|
42
|
+
`),g=u!==-1,b=t.inFlow??e.flow??e.items.length===0;if(g||!b){let A=!1;if(g&&(w==="&"||w==="!")){let L=E.indexOf(" ");w==="&"&&L!==-1&&L<u&&E[L+1]==="!"&&(L=E.indexOf(" ",L+1)),(L===-1||u<L)&&(A=!0)}A||(v=`
|
|
43
|
+
${t.indent}`)}}else(E===""||E[0]===`
|
|
44
|
+
`)&&(v="");return p+=v+E,t.inFlow?T&&n&&n():q&&!T?p+=Ke.lineComment(p,t.indent,c(q)):f&&i&&i(),p}$i.stringifyPair=fl});var qs=C(Es=>{"use strict";function hl(s,...e){s==="debug"&&console.log(...e)}function dl(s,e){(s==="debug"||s==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}Es.debug=hl;Es.warn=dl});var Ps=C(ji=>{"use strict";var pl=qs(),ml=Fe(),ke=M(),gl=x(),Ts=te(),Di="<<";function yl(s,e,{key:t,value:n}){if(s?.doc.schema.merge&&wl(t))if(n=ke.isAlias(n)?n.resolve(s.doc):n,ke.isSeq(n))for(let i of n.items)Is(s,e,i);else if(Array.isArray(n))for(let i of n)Is(s,e,i);else Is(s,e,n);else{let i=Ts.toJS(t,"",s);if(e instanceof Map)e.set(i,Ts.toJS(n,i,s));else if(e instanceof Set)e.add(i);else{let r=bl(t,i,s),o=Ts.toJS(n,r,s);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}var wl=s=>s===Di||ke.isScalar(s)&&s.value===Di&&(!s.type||s.type===gl.Scalar.PLAIN);function Is(s,e,t){let n=s&&ke.isAlias(t)?t.resolve(s.doc):t;if(!ke.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,s,Map);for(let[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function bl(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(ke.isNode(s)&&t?.doc){let n=ml.createStringifyContext(t.doc,{});n.anchors=new Set;for(let r of t.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=s.toString(n);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),pl.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}ji.addPairToJSMap=yl});var re=C(Ms=>{"use strict";var Ri=$e(),Sl=xi(),kl=Ps(),Lt=M();function vl(s,e,t){let n=Ri.createNode(s,void 0,t),i=Ri.createNode(e,void 0,t);return new Ot(n,i)}var Ot=class s{constructor(e,t=null){Object.defineProperty(this,Lt.NODE_TYPE,{value:Lt.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return Lt.isNode(t)&&(t=t.clone(e)),Lt.isNode(n)&&(n=n.clone(e)),new s(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return kl.addPairToJSMap(t,n,this)}toString(e,t,n){return e?.doc?Sl.stringifyPair(this,e,t,n):JSON.stringify(this)}};Ms.Pair=Ot;Ms.createPair=vl});var _s=C(Ki=>{"use strict";var fe=M(),Fi=Fe(),Et=xe();function Nl(s,e,t){return(e.inFlow??s.flow?Al:Cl)(s,e,t)}function Cl({comment:s,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=t,m=Object.assign({},t,{indent:r,type:null}),d=!1,h=[];for(let k=0;k<e.length;++k){let f=e[k],p=null;if(fe.isNode(f))!d&&f.spaceBefore&&h.push(""),qt(t,h,f.commentBefore,d),f.comment&&(p=f.comment);else if(fe.isPair(f)){let N=fe.isNode(f.key)?f.key:null;N&&(!d&&N.spaceBefore&&h.push(""),qt(t,h,N.commentBefore,d))}d=!1;let O=Fi.stringify(f,m,()=>p=null,()=>d=!0);p&&(O+=Et.lineComment(O,r,c(p))),d&&p&&(d=!1),h.push(n+O)}let y;if(h.length===0)y=i.start+i.end;else{y=h[0];for(let k=1;k<h.length;++k){let f=h[k];y+=f?`
|
|
45
|
+
${l}${f}`:`
|
|
46
|
+
`}}return s?(y+=`
|
|
47
|
+
`+Et.indentComment(c(s),l),a&&a()):d&&o&&o(),y}function Al({items:s},e,{flowChars:t,itemIndent:n}){let{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=e;n+=r;let l=Object.assign({},e,{indent:n,inFlow:!0,type:null}),c=!1,m=0,d=[];for(let k=0;k<s.length;++k){let f=s[k],p=null;if(fe.isNode(f))f.spaceBefore&&d.push(""),qt(e,d,f.commentBefore,!1),f.comment&&(p=f.comment);else if(fe.isPair(f)){let N=fe.isNode(f.key)?f.key:null;N&&(N.spaceBefore&&d.push(""),qt(e,d,N.commentBefore,!1),N.comment&&(c=!0));let q=fe.isNode(f.value)?f.value:null;q?(q.comment&&(p=q.comment),q.commentBefore&&(c=!0)):f.value==null&&N?.comment&&(p=N.comment)}p&&(c=!0);let O=Fi.stringify(f,l,()=>p=null);k<s.length-1&&(O+=","),p&&(O+=Et.lineComment(O,n,a(p))),!c&&(d.length>m||O.includes(`
|
|
48
|
+
`))&&(c=!0),d.push(O),m=d.length}let{start:h,end:y}=t;if(d.length===0)return h+y;if(!c){let k=d.reduce((f,p)=>f+p.length+2,2);c=e.options.lineWidth>0&&k>e.options.lineWidth}if(c){let k=h;for(let f of d)k+=f?`
|
|
49
|
+
${r}${i}${f}`:`
|
|
50
|
+
`;return`${k}
|
|
51
|
+
${i}${y}`}else return`${h}${o}${d.join(" ")}${o}${y}`}function qt({indent:s,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let r=Et.indentComment(e(n),s);t.push(r.trimStart())}}Ki.stringifyCollection=Nl});var ae=C($s=>{"use strict";var Ll=_s(),Ol=Ps(),El=St(),oe=M(),Tt=re(),ql=x();function Ue(s,e){let t=oe.isScalar(e)?e.value:e;for(let n of s)if(oe.isPair(n)&&(n.key===e||n.key===t||oe.isScalar(n.key)&&n.key.value===t))return n}var Bs=class extends El.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(oe.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:i,replacer:r}=n,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(t,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(Tt.createPair(l,c,n))};if(t instanceof Map)for(let[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(let l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;oe.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Tt.Pair(e,e?.value):n=new Tt.Pair(e.key,e.value);let i=Ue(this.items,n.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);oe.isScalar(i.value)&&ql.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(r){let o=this.items.findIndex(a=>r(n,a)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let t=Ue(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let i=Ue(this.items,e)?.value;return(!t&&oe.isScalar(i)?i.value:i)??void 0}has(e){return!!Ue(this.items,e)}set(e,t){this.add(new Tt.Pair(e,t),!0)}toJSON(e,t,n){let i=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let r of this.items)Ol.addPairToJSMap(t,i,r);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!oe.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Ll.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};$s.YAMLMap=Bs;$s.findPair=Ue});var ve=C(Yi=>{"use strict";var Tl=M(),Ui=ae(),Il={collection:"map",default:!0,nodeClass:Ui.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(s,e){return Tl.isMap(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>Ui.YAMLMap.from(s,e,t)};Yi.map=Il});var le=C(Vi=>{"use strict";var Pl=$e(),Ml=_s(),_l=St(),Pt=M(),Bl=x(),$l=te(),xs=class extends _l.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Pt.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=It(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=It(e);if(typeof n!="number")return;let i=this.items[n];return!t&&Pt.isScalar(i)?i.value:i}has(e){let t=It(e);return typeof t=="number"&&t<this.items.length}set(e,t){let n=It(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];Pt.isScalar(i)&&Bl.isScalarValue(t)?i.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let i=0;for(let r of this.items)n.push($l.toJS(r,String(i++),t));return n}toString(e,t,n){return e?Ml.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof i=="function"){let l=t instanceof Set?a:String(o++);a=i.call(t,l,a)}r.items.push(Pl.createNode(a,void 0,n))}}return r}};function It(s){let e=Pt.isScalar(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Vi.YAMLSeq=xs});var Ne=C(Hi=>{"use strict";var xl=M(),Ji=le(),Dl={collection:"seq",default:!0,nodeClass:Ji.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(s,e){return xl.isSeq(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>Ji.YAMLSeq.from(s,e,t)};Hi.seq=Dl});var Ye=C(Wi=>{"use strict";var jl=Re(),Rl={identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),jl.stringifyString(s,e,t,n)}};Wi.string=Rl});var Mt=C(zi=>{"use strict";var Qi=x(),Gi={identify:s=>s==null,createNode:()=>new Qi.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Qi.Scalar(null),stringify:({source:s},e)=>typeof s=="string"&&Gi.test.test(s)?s:e.options.nullStr};zi.nullTag=Gi});var Ds=C(Zi=>{"use strict";var Fl=x(),Xi={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new Fl.Scalar(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&Xi.test.test(s)){let n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};Zi.boolTag=Xi});var Ce=C(er=>{"use strict";function Kl({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=JSON.stringify(n);if(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}er.stringifyNumber=Kl});var Rs=C(_t=>{"use strict";var Ul=x(),js=Ce(),Yl={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:js.stringifyNumber},Vl={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():js.stringifyNumber(s)}},Jl={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){let e=new Ul.Scalar(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:js.stringifyNumber};_t.float=Jl;_t.floatExp=Vl;_t.floatNaN=Yl});var Ks=C($t=>{"use strict";var tr=Ce(),Bt=s=>typeof s=="bigint"||Number.isInteger(s),Fs=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function sr(s,e,t){let{value:n}=s;return Bt(n)&&n>=0?t+n.toString(e):tr.stringifyNumber(s)}var Hl={identify:s=>Bt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>Fs(s,2,8,t),stringify:s=>sr(s,8,"0o")},Wl={identify:Bt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>Fs(s,0,10,t),stringify:tr.stringifyNumber},Ql={identify:s=>Bt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>Fs(s,2,16,t),stringify:s=>sr(s,16,"0x")};$t.int=Wl;$t.intHex=Ql;$t.intOct=Hl});var ir=C(nr=>{"use strict";var Gl=ve(),zl=Mt(),Xl=Ne(),Zl=Ye(),ec=Ds(),Us=Rs(),Ys=Ks(),tc=[Gl.map,Xl.seq,Zl.string,zl.nullTag,ec.boolTag,Ys.intOct,Ys.int,Ys.intHex,Us.floatNaN,Us.floatExp,Us.float];nr.schema=tc});var ar=C(or=>{"use strict";var sc=x(),nc=ve(),ic=Ne();function rr(s){return typeof s=="bigint"||Number.isInteger(s)}var xt=({value:s})=>JSON.stringify(s),rc=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:xt},{identify:s=>s==null,createNode:()=>new sc.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:xt},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:s=>s==="true",stringify:xt},{identify:rr,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),stringify:({value:s})=>rr(s)?s.toString():JSON.stringify(s)},{identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:s=>parseFloat(s),stringify:xt}],oc={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},ac=[nc.map,ic.seq].concat(rc,oc);or.schema=ac});var Js=C(lr=>{"use strict";var Vs=x(),lc=Re(),cc={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof Buffer=="function")return Buffer.from(s,"base64");if(typeof atob=="function"){let t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:e,value:t},n,i,r){let o=t,a;if(typeof Buffer=="function")a=o instanceof Buffer?o.toString("base64"):Buffer.from(o.buffer).toString("base64");else 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=Vs.Scalar.BLOCK_LITERAL),e!==Vs.Scalar.QUOTE_DOUBLE){let l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/l),m=new Array(c);for(let d=0,h=0;d<c;++d,h+=l)m[d]=a.substr(h,l);a=m.join(e===Vs.Scalar.BLOCK_LITERAL?`
|
|
52
|
+
`:" ")}return lc.stringifyString({comment:s,type:e,value:a},n,i,r)}};lr.binary=cc});var Rt=C(jt=>{"use strict";var Dt=M(),Hs=re(),uc=x(),fc=le();function cr(s,e){if(Dt.isSeq(s))for(let t=0;t<s.items.length;++t){let n=s.items[t];if(!Dt.isPair(n)){if(Dt.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new Hs.Pair(new uc.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
53
53
|
${i.key.commentBefore}`:n.commentBefore),n.comment){let r=i.value??i.key;r.comment=r.comment?`${n.comment}
|
|
54
|
-
${r.comment}`:n.comment}n=i}s.items[t]=It.isPair(n)?n:new Rs.Pair(n)}}else e("Expected a sequence for this tag");return s}function Zi(s,e,t){let{replacer:n}=t,i=new Hl.YAMLSeq(s);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(r++),a));let o,l;if(Array.isArray(a))if(a.length===2)o=a[0],l=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let c=Object.keys(a);if(c.length===1)o=c[0],l=a[o];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else o=a;i.items.push(Rs.createPair(o,l,t))}return i}var Wl={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Xi,createNode:Zi};Tt.createPairs=Zi;Tt.pairs=Wl;Tt.resolvePairs=Xi});var Us=v(Ks=>{"use strict";var er=E(),Fs=W(),xe=ee(),Ql=te(),tr=Pt(),ae=class s extends Ql.YAMLSeq{constructor(){super(),this.add=xe.YAMLMap.prototype.add.bind(this),this.delete=xe.YAMLMap.prototype.delete.bind(this),this.get=xe.YAMLMap.prototype.get.bind(this),this.has=xe.YAMLMap.prototype.has.bind(this),this.set=xe.YAMLMap.prototype.set.bind(this),this.tag=s.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let i of this.items){let r,a;if(er.isPair(i)?(r=Fs.toJS(i.key,"",t),a=Fs.toJS(i.value,r,t)):r=Fs.toJS(i,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,a)}return n}static from(e,t,n){let i=tr.createPairs(e,t,n),r=new this;return r.items=i.items,r}};ae.tag="tag:yaml.org,2002:omap";var Gl={collection:"seq",identify:s=>s instanceof Map,nodeClass:ae,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=tr.resolvePairs(s,e),n=[];for(let{key:i}of t.items)er.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new ae,t)},createNode:(s,e,t)=>ae.from(s,e,t)};Ks.YAMLOMap=ae;Ks.omap=Gl});var ar=v(Ys=>{"use strict";var sr=P();function nr({value:s,source:e},t){return e&&(s?ir:rr).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}var ir={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new sr.Scalar(!0),stringify:nr},rr={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new sr.Scalar(!1),stringify:nr};Ys.falseTag=rr;Ys.trueTag=ir});var or=v(Mt=>{"use strict";var zl=P(),Js=we(),Xl={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Js.stringifyNumber},Zl={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():Js.stringifyNumber(s)}},ec={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){let e=new zl.Scalar(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){let n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Js.stringifyNumber};Mt.float=ec;Mt.floatExp=Zl;Mt.floatNaN=Xl});var cr=v(Re=>{"use strict";var lr=we(),je=s=>typeof s=="bigint"||Number.isInteger(s);function _t(s,e,t,{intAsBigInt:n}){let i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let a=BigInt(s);return i==="-"?BigInt(-1)*a:a}let r=parseInt(s,t);return i==="-"?-1*r:r}function Vs(s,e,t){let{value:n}=s;if(je(n)){let i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return lr.stringifyNumber(s)}var tc={identify:je,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>_t(s,2,2,t),stringify:s=>Vs(s,2,"0b")},sc={identify:je,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>_t(s,1,8,t),stringify:s=>Vs(s,8,"0")},nc={identify:je,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>_t(s,0,10,t),stringify:lr.stringifyNumber},ic={identify:je,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>_t(s,2,16,t),stringify:s=>Vs(s,16,"0x")};Re.int=nc;Re.intBin=tc;Re.intHex=ic;Re.intOct=sc});var Ws=v(Hs=>{"use strict";var Dt=E(),Bt=X(),$t=ee(),oe=class s extends $t.YAMLMap{constructor(e){super(e),this.tag=s.tag}add(e){let t;Dt.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Bt.Pair(e.key,null):t=new Bt.Pair(e,null),$t.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=$t.findPair(this.items,e);return!t&&Dt.isPair(n)?Dt.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=$t.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Bt.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let a of t)typeof i=="function"&&(a=i.call(t,a,a)),r.items.push(Bt.createPair(a,null,n));return r}};oe.tag="tag:yaml.org,2002:set";var rc={collection:"map",identify:s=>s instanceof Set,nodeClass:oe,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>oe.from(s,e,t),resolve(s,e){if(Dt.isMap(s)){if(s.hasAllNullValues(!0))return Object.assign(new oe,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};Hs.YAMLSet=oe;Hs.set=rc});var Gs=v(xt=>{"use strict";var ac=we();function Qs(s,e){let t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=a=>e?BigInt(a):Number(a),r=n.replace(/_/g,"").split(":").reduce((a,o)=>a*i(60)+i(o),i(0));return t==="-"?i(-1)*r:r}function ur(s){let{value:e}=s,t=a=>a;if(typeof e=="bigint")t=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return ac.stringifyNumber(s);let n="";e<0&&(n="-",e*=t(-1));let i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var oc={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:t})=>Qs(s,t),stringify:ur},lc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:s=>Qs(s,!1),stringify:ur},fr={identify:s=>s 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(s){let e=s.match(fr.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,i,r,a,o]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,n-1,i,r||0,a||0,o||0,l),m=e[8];if(m&&m!=="Z"){let h=Qs(m,!1);Math.abs(h)<30&&(h*=60),c-=6e4*h}return new Date(c)},stringify:({value:s})=>s.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};xt.floatTime=lc;xt.intTime=oc;xt.timestamp=fr});var pr=v(dr=>{"use strict";var cc=ge(),uc=Ct(),fc=ye(),hc=De(),dc=js(),hr=ar(),zs=or(),jt=cr(),pc=Us(),mc=Pt(),gc=Ws(),Xs=Gs(),yc=[cc.map,fc.seq,hc.string,uc.nullTag,hr.trueTag,hr.falseTag,jt.intBin,jt.intOct,jt.int,jt.intHex,zs.floatNaN,zs.floatExp,zs.float,dc.binary,pc.omap,mc.pairs,gc.set,Xs.intTime,Xs.floatTime,Xs.timestamp];dr.schema=yc});var Ar=v(tn=>{"use strict";var wr=ge(),wc=Ct(),br=ye(),bc=De(),Sc=Ts(),Zs=Ms(),en=Bs(),vc=Hi(),kc=Gi(),Sr=js(),vr=Us(),kr=Pt(),mr=pr(),Nr=Ws(),Rt=Gs(),gr=new Map([["core",vc.schema],["failsafe",[wr.map,br.seq,bc.string]],["json",kc.schema],["yaml11",mr.schema],["yaml-1.1",mr.schema]]),yr={binary:Sr.binary,bool:Sc.boolTag,float:Zs.float,floatExp:Zs.floatExp,floatNaN:Zs.floatNaN,floatTime:Rt.floatTime,int:en.int,intHex:en.intHex,intOct:en.intOct,intTime:Rt.intTime,map:wr.map,null:wc.nullTag,omap:vr.omap,pairs:kr.pairs,seq:br.seq,set:Nr.set,timestamp:Rt.timestamp},Nc={"tag:yaml.org,2002:binary":Sr.binary,"tag:yaml.org,2002:omap":vr.omap,"tag:yaml.org,2002:pairs":kr.pairs,"tag:yaml.org,2002:set":Nr.set,"tag:yaml.org,2002:timestamp":Rt.timestamp};function Ac(s,e){let t=gr.get(e);if(!t)if(Array.isArray(s))t=[];else{let n=Array.from(gr.keys()).filter(i=>i!=="yaml11").map(i=>JSON.stringify(i)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${n} or define customTags array`)}if(Array.isArray(s))for(let n of s)t=t.concat(n);else typeof s=="function"&&(t=s(t.slice()));return t.map(n=>{if(typeof n!="string")return n;let i=yr[n];if(i)return i;let r=Object.keys(yr).map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown custom tag "${n}"; use one of ${r}`)})}tn.coreKnownTags=Nc;tn.getTags=Ac});var rn=v(Cr=>{"use strict";var sn=E(),Cc=ge(),Lc=ye(),Oc=De(),Ft=Ar(),qc=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0,nn=class s{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?Ft.getTags(e,"compat"):e?Ft.getTags(null,e):null,this.merge=!!n,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Ft.coreKnownTags:{},this.tags=Ft.getTags(t,this.name),this.toStringOptions=o??null,Object.defineProperty(this,sn.MAP,{value:Cc.map}),Object.defineProperty(this,sn.SCALAR,{value:Oc.string}),Object.defineProperty(this,sn.SEQ,{value:Lc.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?qc:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Cr.Schema=nn});var Or=v(Lr=>{"use strict";var Ec=E(),an=_e(),Fe=Ie();function Ic(s,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&s.directives){let l=s.directives.toString(s);l?(t.push(l),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");let i=an.createStringifyContext(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");let l=r(s.commentBefore);t.unshift(Fe.indentComment(l,""))}let a=!1,o=null;if(s.contents){if(Ec.isNode(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let m=r(s.contents.commentBefore);t.push(Fe.indentComment(m,""))}i.forceBlockIndent=!!s.comment,o=s.contents.comment}let l=o?void 0:()=>a=!0,c=an.stringify(s.contents,i,()=>o=null,l);o&&(c+=Fe.lineComment(c,"",r(o))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(an.stringify(s.contents,i));if(s.directives?.docEnd)if(s.comment){let l=r(s.comment);l.includes(`
|
|
55
|
-
`)?(t.push("..."),t.push(
|
|
54
|
+
${r.comment}`:n.comment}n=i}s.items[t]=Dt.isPair(n)?n:new Hs.Pair(n)}}else e("Expected a sequence for this tag");return s}function ur(s,e,t){let{replacer:n}=t,i=new fc.YAMLSeq(s);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(r++),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;i.items.push(Hs.createPair(a,l,t))}return i}var hc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:cr,createNode:ur};jt.createPairs=ur;jt.pairs=hc;jt.resolvePairs=cr});var Gs=C(Qs=>{"use strict";var fr=M(),Ws=te(),Ve=ae(),dc=le(),hr=Rt(),he=class s extends dc.YAMLSeq{constructor(){super(),this.add=Ve.YAMLMap.prototype.add.bind(this),this.delete=Ve.YAMLMap.prototype.delete.bind(this),this.get=Ve.YAMLMap.prototype.get.bind(this),this.has=Ve.YAMLMap.prototype.has.bind(this),this.set=Ve.YAMLMap.prototype.set.bind(this),this.tag=s.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let i of this.items){let r,o;if(fr.isPair(i)?(r=Ws.toJS(i.key,"",t),o=Ws.toJS(i.value,r,t)):r=Ws.toJS(i,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}static from(e,t,n){let i=hr.createPairs(e,t,n),r=new this;return r.items=i.items,r}};he.tag="tag:yaml.org,2002:omap";var pc={collection:"seq",identify:s=>s instanceof Map,nodeClass:he,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=hr.resolvePairs(s,e),n=[];for(let{key:i}of t.items)fr.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new he,t)},createNode:(s,e,t)=>he.from(s,e,t)};Qs.YAMLOMap=he;Qs.omap=pc});var yr=C(zs=>{"use strict";var dr=x();function pr({value:s,source:e},t){return e&&(s?mr:gr).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}var mr={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new dr.Scalar(!0),stringify:pr},gr={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new dr.Scalar(!1),stringify:pr};zs.falseTag=gr;zs.trueTag=mr});var wr=C(Ft=>{"use strict";var mc=x(),Xs=Ce(),gc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Xs.stringifyNumber},yc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():Xs.stringifyNumber(s)}},wc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){let e=new mc.Scalar(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){let n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Xs.stringifyNumber};Ft.float=wc;Ft.floatExp=yc;Ft.floatNaN=gc});var Sr=C(He=>{"use strict";var br=Ce(),Je=s=>typeof s=="bigint"||Number.isInteger(s);function Kt(s,e,t,{intAsBigInt:n}){let i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let o=BigInt(s);return i==="-"?BigInt(-1)*o:o}let r=parseInt(s,t);return i==="-"?-1*r:r}function Zs(s,e,t){let{value:n}=s;if(Je(n)){let i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return br.stringifyNumber(s)}var bc={identify:Je,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>Kt(s,2,2,t),stringify:s=>Zs(s,2,"0b")},Sc={identify:Je,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>Kt(s,1,8,t),stringify:s=>Zs(s,8,"0")},kc={identify:Je,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>Kt(s,0,10,t),stringify:br.stringifyNumber},vc={identify:Je,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>Kt(s,2,16,t),stringify:s=>Zs(s,16,"0x")};He.int=kc;He.intBin=bc;He.intHex=vc;He.intOct=Sc});var tn=C(en=>{"use strict";var Vt=M(),Ut=re(),Yt=ae(),de=class s extends Yt.YAMLMap{constructor(e){super(e),this.tag=s.tag}add(e){let t;Vt.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Ut.Pair(e.key,null):t=new Ut.Pair(e,null),Yt.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=Yt.findPair(this.items,e);return!t&&Vt.isPair(n)?Vt.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Yt.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Ut.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(Ut.createPair(o,null,n));return r}};de.tag="tag:yaml.org,2002:set";var Nc={collection:"map",identify:s=>s instanceof Set,nodeClass:de,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>de.from(s,e,t),resolve(s,e){if(Vt.isMap(s)){if(s.hasAllNullValues(!0))return Object.assign(new de,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};en.YAMLSet=de;en.set=Nc});var nn=C(Jt=>{"use strict";var Cc=Ce();function sn(s,e){let t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=o=>e?BigInt(o):Number(o),r=n.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*r:r}function kr(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Cc.stringifyNumber(s);let n="";e<0&&(n="-",e*=t(-1));let i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),n+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Ac={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:t})=>sn(s,t),stringify:kr},Lc={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:s=>sn(s,!1),stringify:kr},vr={identify:s=>s 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(s){let e=s.match(vr.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,n-1,i,r||0,o||0,a||0,l),m=e[8];if(m&&m!=="Z"){let d=sn(m,!1);Math.abs(d)<30&&(d*=60),c-=6e4*d}return new Date(c)},stringify:({value:s})=>s.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};Jt.floatTime=Lc;Jt.intTime=Ac;Jt.timestamp=vr});var Ar=C(Cr=>{"use strict";var Oc=ve(),Ec=Mt(),qc=Ne(),Tc=Ye(),Ic=Js(),Nr=yr(),rn=wr(),Ht=Sr(),Pc=Gs(),Mc=Rt(),_c=tn(),on=nn(),Bc=[Oc.map,qc.seq,Tc.string,Ec.nullTag,Nr.trueTag,Nr.falseTag,Ht.intBin,Ht.intOct,Ht.int,Ht.intHex,rn.floatNaN,rn.floatExp,rn.float,Ic.binary,Pc.omap,Mc.pairs,_c.set,on.intTime,on.floatTime,on.timestamp];Cr.schema=Bc});var Br=C(cn=>{"use strict";var qr=ve(),$c=Mt(),Tr=Ne(),xc=Ye(),Dc=Ds(),an=Rs(),ln=Ks(),jc=ir(),Rc=ar(),Ir=Js(),Pr=Gs(),Mr=Rt(),Lr=Ar(),_r=tn(),Wt=nn(),Or=new Map([["core",jc.schema],["failsafe",[qr.map,Tr.seq,xc.string]],["json",Rc.schema],["yaml11",Lr.schema],["yaml-1.1",Lr.schema]]),Er={binary:Ir.binary,bool:Dc.boolTag,float:an.float,floatExp:an.floatExp,floatNaN:an.floatNaN,floatTime:Wt.floatTime,int:ln.int,intHex:ln.intHex,intOct:ln.intOct,intTime:Wt.intTime,map:qr.map,null:$c.nullTag,omap:Pr.omap,pairs:Mr.pairs,seq:Tr.seq,set:_r.set,timestamp:Wt.timestamp},Fc={"tag:yaml.org,2002:binary":Ir.binary,"tag:yaml.org,2002:omap":Pr.omap,"tag:yaml.org,2002:pairs":Mr.pairs,"tag:yaml.org,2002:set":_r.set,"tag:yaml.org,2002:timestamp":Wt.timestamp};function Kc(s,e){let t=Or.get(e);if(!t)if(Array.isArray(s))t=[];else{let n=Array.from(Or.keys()).filter(i=>i!=="yaml11").map(i=>JSON.stringify(i)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${n} or define customTags array`)}if(Array.isArray(s))for(let n of s)t=t.concat(n);else typeof s=="function"&&(t=s(t.slice()));return t.map(n=>{if(typeof n!="string")return n;let i=Er[n];if(i)return i;let r=Object.keys(Er).map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown custom tag "${n}"; use one of ${r}`)})}cn.coreKnownTags=Fc;cn.getTags=Kc});var hn=C($r=>{"use strict";var un=M(),Uc=ve(),Yc=Ne(),Vc=Ye(),Qt=Br(),Jc=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0,fn=class s{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Qt.getTags(e,"compat"):e?Qt.getTags(null,e):null,this.merge=!!n,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Qt.coreKnownTags:{},this.tags=Qt.getTags(t,this.name),this.toStringOptions=a??null,Object.defineProperty(this,un.MAP,{value:Uc.map}),Object.defineProperty(this,un.SCALAR,{value:Vc.string}),Object.defineProperty(this,un.SEQ,{value:Yc.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Jc:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};$r.Schema=fn});var Dr=C(xr=>{"use strict";var Hc=M(),dn=Fe(),We=xe();function Wc(s,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&s.directives){let l=s.directives.toString(s);l?(t.push(l),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");let i=dn.createStringifyContext(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");let l=r(s.commentBefore);t.unshift(We.indentComment(l,""))}let o=!1,a=null;if(s.contents){if(Hc.isNode(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let m=r(s.contents.commentBefore);t.push(We.indentComment(m,""))}i.forceBlockIndent=!!s.comment,a=s.contents.comment}let l=a?void 0:()=>o=!0,c=dn.stringify(s.contents,i,()=>a=null,l);a&&(c+=We.lineComment(c,"",r(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(dn.stringify(s.contents,i));if(s.directives?.docEnd)if(s.comment){let l=r(s.comment);l.includes(`
|
|
55
|
+
`)?(t.push("..."),t.push(We.indentComment(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=s.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(We.indentComment(r(l),"")))}return t.join(`
|
|
56
56
|
`)+`
|
|
57
|
-
`}
|
|
58
|
-
`),a
|
|
57
|
+
`}xr.stringifyDocument=Wc});var Qe=C(jr=>{"use strict";var Qc=Be(),Ae=St(),V=M(),Gc=re(),zc=te(),Xc=hn(),Zc=Dr(),pn=mt(),eu=ys(),tu=$e(),mn=gs(),gn=class s{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,V.NODE_TYPE,{value:V.DOC});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:o}=r;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new mn.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(s.prototype,{[V.NODE_TYPE]:{value:V.DOC}});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=V.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Le(this.contents)&&this.contents.add(e)}addIn(e,t){Le(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=pn.anchorNames(this);e.anchor=!t||n.has(t)?pn.findNewAnchor(t||"a",n):t}return new Qc.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let p=N=>typeof N=="number"||N instanceof String||N instanceof Number,O=t.filter(p).map(String);O.length>0&&(t=t.concat(O)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:m}=n??{},{onAnchor:d,setAnchors:h,sourceObjects:y}=pn.createNodeAnchors(this,o||"a"),k={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:d,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:y},f=tu.createNode(e,m,k);return a&&V.isCollection(f)&&(f.flow=!0),h(),f}createPair(e,t,n={}){let i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new Gc.Pair(i,r)}delete(e){return Le(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ae.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Le(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return V.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ae.isEmptyPath(e)?!t&&V.isScalar(this.contents)?this.contents.value:this.contents:V.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return V.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Ae.isEmptyPath(e)?this.contents!==void 0:V.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ae.collectionFromPath(this.schema,[e],t):Le(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ae.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=Ae.collectionFromPath(this.schema,Array.from(e),t):Le(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new mn.Directives({version:"1.1"}),n={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new mn.Directives({version:e}),n={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Xc.Schema(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=zc.toJS(this.contents,t??"",a);if(typeof r=="function")for(let{count:c,res:m}of a.anchors.values())r(m,c);return typeof o=="function"?eu.applyReviver(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}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 t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Zc.stringifyDocument(this,e)}};function Le(s){if(V.isCollection(s))return!0;throw new Error("Expected a YAML collection as document contents")}jr.Document=gn});var Xe=C(ze=>{"use strict";var Ge=class extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}},yn=class extends Ge{constructor(e,t,n){super("YAMLParseError",e,t,n)}},wn=class extends Ge{constructor(e,t,n){super("YAMLWarning",e,t,n)}},su=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let r=i-1,o=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){let a=Math.min(r-39,o.length-79);o="\u2026"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(o.substring(0,r))){let a=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
58
|
+
`),o=a+o}if(/[^ ]/.test(o)){let a=1,l=t.linePos[1];l&&l.line===n&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));let c=" ".repeat(r)+"^".repeat(a);t.message+=`:
|
|
59
59
|
|
|
60
|
-
${
|
|
60
|
+
${o}
|
|
61
61
|
${c}
|
|
62
|
-
`}};
|
|
63
|
-
`))return!0;if(s.end){for(let e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of s.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(
|
|
64
|
-
`+
|
|
65
|
-
`+
|
|
66
|
-
`+
|
|
67
|
-
`+
|
|
68
|
-
`+
|
|
69
|
-
`+
|
|
70
|
-
`.repeat(Math.max(1,
|
|
71
|
-
`;for(let
|
|
72
|
-
`):
|
|
73
|
-
`:!
|
|
74
|
-
`&&(
|
|
62
|
+
`}};ze.YAMLError=Ge;ze.YAMLParseError=yn;ze.YAMLWarning=wn;ze.prettifyError=su});var Ze=C(Rr=>{"use strict";function nu(s,{flow:e,indicator:t,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,m=a,d="",h="",y=!1,k=!1,f=null,p=null,O=null,N=null,q=null,T=null,E=null;for(let u of s)switch(k&&(u.type!=="space"&&u.type!=="newline"&&u.type!=="comma"&&r(u.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),k=!1),f&&(c&&u.type!=="comment"&&u.type!=="newline"&&r(f,"TAB_AS_INDENT","Tabs are not allowed as indentation"),f=null),u.type){case"space":!e&&(t!=="doc-start"||n?.type!=="flow-collection")&&u.source.includes(" ")&&(f=u),m=!0;break;case"comment":{m||r(u,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let g=u.source.substring(1)||" ";d?d+=h+g:d=g,h="",c=!1;break}case"newline":c?d?d+=u.source:l=!0:h+=u.source,c=!0,y=!0,(p||O)&&(N=u),m=!0;break;case"anchor":p&&r(u,"MULTIPLE_ANCHORS","A node can have at most one anchor"),u.source.endsWith(":")&&r(u.offset+u.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),p=u,E===null&&(E=u.offset),c=!1,m=!1,k=!0;break;case"tag":{O&&r(u,"MULTIPLE_TAGS","A node can have at most one tag"),O=u,E===null&&(E=u.offset),c=!1,m=!1,k=!0;break}case t:(p||O)&&r(u,"BAD_PROP_ORDER",`Anchors and tags must be after the ${u.source} indicator`),T&&r(u,"UNEXPECTED_TOKEN",`Unexpected ${u.source} in ${e??"collection"}`),T=u,c=t==="seq-item-ind"||t==="explicit-key-ind",m=!1;break;case"comma":if(e){q&&r(u,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),q=u,c=!1,m=!1;break}default:r(u,"UNEXPECTED_TOKEN",`Unexpected ${u.type} token`),c=!1,m=!1}let v=s[s.length-1],w=v?v.offset+v.source.length:i;return k&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f&&(c&&f.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&r(f,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:q,found:T,spaceBefore:l,comment:d,hasNewline:y,anchor:p,tag:O,newlineAfterProp:N,end:w,start:E??w}}Rr.resolveProps=nu});var Gt=C(Fr=>{"use strict";function bn(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
|
|
63
|
+
`))return!0;if(s.end){for(let e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of s.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(bn(e.key)||bn(e.value))return!0}return!1;default:return!0}}Fr.containsNewline=bn});var Sn=C(Kr=>{"use strict";var iu=Gt();function ru(s,e,t){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&iu.containsNewline(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Kr.flowIndentCheck=ru});var kn=C(Yr=>{"use strict";var Ur=M();function ou(s,e,t){let{uniqueKeys:n}=s.options;if(n===!1)return!1;let i=typeof n=="function"?n:(r,o)=>r===o||Ur.isScalar(r)&&Ur.isScalar(o)&&r.value===o.value&&!(r.value==="<<"&&s.schema.merge);return e.some(r=>i(r.key,t))}Yr.mapIncludes=ou});var Gr=C(Qr=>{"use strict";var Vr=re(),au=ae(),Jr=Ze(),lu=Gt(),Hr=Sn(),cu=kn(),Wr="All mapping items must start at the same column";function uu({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=r?.nodeClass??au.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(let m of n.items){let{start:d,key:h,sep:y,value:k}=m,f=Jr.resolveProps(d,{indicator:"explicit-key-ind",next:h??y?.[0],offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0}),p=!f.found;if(p){if(h&&(h.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==n.indent&&i(l,"BAD_INDENT",Wr)),!f.anchor&&!f.tag&&!y){c=f.end,f.comment&&(a.comment?a.comment+=`
|
|
64
|
+
`+f.comment:a.comment=f.comment);continue}(f.newlineAfterProp||lu.containsNewline(h))&&i(h??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else f.found?.indent!==n.indent&&i(l,"BAD_INDENT",Wr);let O=f.end,N=h?s(t,h,f,i):e(t,O,d,null,f,i);t.schema.compat&&Hr.flowIndentCheck(n.indent,h,i),cu.mapIncludes(t,a.items,N)&&i(O,"DUPLICATE_KEY","Map keys must be unique");let q=Jr.resolveProps(y??[],{indicator:"map-value-ind",next:k,offset:N.range[2],onError:i,parentIndent:n.indent,startOnNewline:!h||h.type==="block-scalar"});if(l=q.end,q.found){p&&(k?.type==="block-map"&&!q.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&f.start<q.found.offset-1024&&i(N.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let T=k?s(t,k,q,i):e(t,l,y,null,q,i);t.schema.compat&&Hr.flowIndentCheck(n.indent,k,i),l=T.range[2];let E=new Vr.Pair(N,T);t.options.keepSourceTokens&&(E.srcToken=m),a.items.push(E)}else{p&&i(N.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),q.comment&&(N.comment?N.comment+=`
|
|
65
|
+
`+q.comment:N.comment=q.comment);let T=new Vr.Pair(N);t.options.keepSourceTokens&&(T.srcToken=m),a.items.push(T)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,l,c??l],a}Qr.resolveBlockMap=uu});var Xr=C(zr=>{"use strict";var fu=le(),hu=Ze(),du=Sn();function pu({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=r?.nodeClass??fu.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(let{start:m,value:d}of n.items){let h=hu.resolveProps(m,{indicator:"seq-item-ind",next:d,offset:l,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||d)d&&d.type==="block-seq"?i(h.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=h.end,h.comment&&(a.comment=h.comment);continue}let y=d?s(t,d,h,i):e(t,h.end,m,null,h,i);t.schema.compat&&du.flowIndentCheck(n.indent,d,i),l=y.range[2],a.items.push(y)}return a.range=[n.offset,l,c??l],a}zr.resolveBlockSeq=pu});var Oe=C(Zr=>{"use strict";function mu(s,e,t,n){let i="";if(s){let r=!1,o="";for(let a of s){let{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{t&&!r&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let m=l.substring(1)||" ";i?i+=o+m:i=m,o="";break}case"newline":i&&(o+=l),r=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}Zr.resolveEnd=mu});var no=C(so=>{"use strict";var gu=M(),yu=re(),eo=ae(),wu=le(),bu=Oe(),to=Ze(),Su=Gt(),ku=kn(),vn="Block collections are not allowed within flow collections",Nn=s=>s&&(s.type==="block-map"||s.type==="block-seq");function vu({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=n.start.source==="{",a=o?"flow map":"flow sequence",l=r?.nodeClass??(o?eo.YAMLMap:wu.YAMLSeq),c=new l(t.schema);c.flow=!0;let m=t.atRoot;m&&(t.atRoot=!1);let d=n.offset+n.start.source.length;for(let p=0;p<n.items.length;++p){let O=n.items[p],{start:N,key:q,sep:T,value:E}=O,v=to.resolveProps(N,{flow:a,indicator:"explicit-key-ind",next:q??T?.[0],offset:d,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!v.found){if(!v.anchor&&!v.tag&&!T&&!E){p===0&&v.comma?i(v.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):p<n.items.length-1&&i(v.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),v.comment&&(c.comment?c.comment+=`
|
|
66
|
+
`+v.comment:c.comment=v.comment),d=v.end;continue}!o&&t.options.strict&&Su.containsNewline(q)&&i(q,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)v.comma&&i(v.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(v.comma||i(v.start,"MISSING_CHAR",`Missing , between ${a} items`),v.comment){let w="";e:for(let u of N)switch(u.type){case"comma":case"space":break;case"comment":w=u.source.substring(1);break e;default:break e}if(w){let u=c.items[c.items.length-1];gu.isPair(u)&&(u=u.value??u.key),u.comment?u.comment+=`
|
|
67
|
+
`+w:u.comment=w,v.comment=v.comment.substring(w.length+1)}}if(!o&&!T&&!v.found){let w=E?s(t,E,v,i):e(t,v.end,T,null,v,i);c.items.push(w),d=w.range[2],Nn(E)&&i(w.range,"BLOCK_IN_FLOW",vn)}else{let w=v.end,u=q?s(t,q,v,i):e(t,w,N,null,v,i);Nn(q)&&i(u.range,"BLOCK_IN_FLOW",vn);let g=to.resolveProps(T??[],{flow:a,indicator:"map-value-ind",next:E,offset:u.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(g.found){if(!o&&!v.found&&t.options.strict){if(T)for(let L of T){if(L===g.found)break;if(L.type==="newline"){i(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}v.start<g.found.offset-1024&&i(g.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else E&&("source"in E&&E.source&&E.source[0]===":"?i(E,"MISSING_CHAR",`Missing space after : in ${a}`):i(g.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let b=E?s(t,E,g,i):g.found?e(t,g.end,T,null,g,i):null;b?Nn(E)&&i(b.range,"BLOCK_IN_FLOW",vn):g.comment&&(u.comment?u.comment+=`
|
|
68
|
+
`+g.comment:u.comment=g.comment);let A=new yu.Pair(u,b);if(t.options.keepSourceTokens&&(A.srcToken=O),o){let L=c;ku.mapIncludes(t,L.items,u)&&i(w,"DUPLICATE_KEY","Map keys must be unique"),L.items.push(A)}else{let L=new eo.YAMLMap(t.schema);L.flow=!0,L.items.push(A);let I=(b??u).range;L.range=[u.range[0],I[1],I[2]],c.items.push(L)}d=b?b.range[2]:g.end}}let h=o?"}":"]",[y,...k]=n.end,f=d;if(y&&y.source===h)f=y.offset+y.source.length;else{let p=a[0].toUpperCase()+a.substring(1),O=m?`${p} must end with a ${h}`:`${p} in block collection must be sufficiently indented and end with a ${h}`;i(d,m?"MISSING_CHAR":"BAD_INDENT",O),y&&y.source.length!==1&&k.unshift(y)}if(k.length>0){let p=bu.resolveEnd(k,f,t.options.strict,i);p.comment&&(c.comment?c.comment+=`
|
|
69
|
+
`+p.comment:c.comment=p.comment),c.range=[n.offset,f,p.offset]}else c.range=[n.offset,f,f];return c}so.resolveFlowCollection=vu});var ro=C(io=>{"use strict";var Nu=M(),Cu=x(),Au=ae(),Lu=le(),Ou=Gr(),Eu=Xr(),qu=no();function Cn(s,e,t,n,i,r){let o=t.type==="block-map"?Ou.resolveBlockMap(s,e,t,n,r):t.type==="block-seq"?Eu.resolveBlockSeq(s,e,t,n,r):qu.resolveFlowCollection(s,e,t,n,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function Tu(s,e,t,n,i){let r=n.tag,o=r?e.directives.tagName(r.source,h=>i(r,"TAG_RESOLVE_FAILED",h)):null;if(t.type==="block-seq"){let{anchor:h,newlineAfterProp:y}=n,k=h&&r?h.offset>r.offset?h:r:h??r;k&&(!y||y.offset<k.offset)&&i(k,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===Au.YAMLMap.tagName&&a==="map"||o===Lu.YAMLSeq.tagName&&a==="seq")return Cn(s,e,t,i,o);let l=e.schema.tags.find(h=>h.tag===o&&h.collection===a);if(!l){let h=e.schema.knownTags[o];if(h&&h.collection===a)e.schema.tags.push(Object.assign({},h,{default:!1})),l=h;else return h?.collection?i(r,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Cn(s,e,t,i,o)}let c=Cn(s,e,t,i,o,l),m=l.resolve?.(c,h=>i(r,"TAG_RESOLVE_FAILED",h),e.options)??c,d=Nu.isNode(m)?m:new Cu.Scalar(m);return d.range=c.range,d.tag=o,l?.format&&(d.format=l.format),d}io.composeCollection=Tu});var Ln=C(oo=>{"use strict";var An=x();function Iu(s,e,t){let n=e.offset,i=Pu(e,s.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let r=i.mode===">"?An.Scalar.BLOCK_FOLDED:An.Scalar.BLOCK_LITERAL,o=e.source?Mu(e.source):[],a=o.length;for(let f=o.length-1;f>=0;--f){let p=o[f][1];if(p===""||p==="\r")a=f;else break}if(a===0){let f=i.chomp==="+"&&o.length>0?`
|
|
70
|
+
`.repeat(Math.max(1,o.length-1)):"",p=n+i.length;return e.source&&(p+=e.source.length),{value:f,type:r,comment:i.comment,range:[n,p,p]}}let l=e.indent+i.indent,c=e.offset+i.length,m=0;for(let f=0;f<a;++f){let[p,O]=o[f];if(O===""||O==="\r")i.indent===0&&p.length>l&&(l=p.length);else{p.length<l&&t(c+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=p.length),m=f,l===0&&!s.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=p.length+O.length+1}for(let f=o.length-1;f>=a;--f)o[f][0].length>l&&(a=f+1);let d="",h="",y=!1;for(let f=0;f<m;++f)d+=o[f][0].slice(l)+`
|
|
71
|
+
`;for(let f=m;f<a;++f){let[p,O]=o[f];c+=p.length+O.length+1;let N=O[O.length-1]==="\r";if(N&&(O=O.slice(0,-1)),O&&p.length<l){let T=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-O.length-(N?2:1),"BAD_INDENT",T),p=""}r===An.Scalar.BLOCK_LITERAL?(d+=h+p.slice(l)+O,h=`
|
|
72
|
+
`):p.length>l||O[0]===" "?(h===" "?h=`
|
|
73
|
+
`:!y&&h===`
|
|
74
|
+
`&&(h=`
|
|
75
75
|
|
|
76
|
-
`),h
|
|
77
|
-
`,
|
|
78
|
-
`?
|
|
79
|
-
`:
|
|
80
|
-
`:(h
|
|
81
|
-
`+
|
|
82
|
-
`&&(
|
|
83
|
-
`);break;default:
|
|
84
|
-
`}let
|
|
76
|
+
`),d+=h+p.slice(l)+O,h=`
|
|
77
|
+
`,y=!0):O===""?h===`
|
|
78
|
+
`?d+=`
|
|
79
|
+
`:h=`
|
|
80
|
+
`:(d+=h+O,h=" ",y=!1)}switch(i.chomp){case"-":break;case"+":for(let f=a;f<o.length;++f)d+=`
|
|
81
|
+
`+o[f][0].slice(l);d[d.length-1]!==`
|
|
82
|
+
`&&(d+=`
|
|
83
|
+
`);break;default:d+=`
|
|
84
|
+
`}let k=n+i.length+e.source.length;return{value:d,type:r,comment:i.comment,range:[n,k,k]}}function Pu({offset:s,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],r=i[0],o=0,a="",l=-1;for(let h=1;h<i.length;++h){let y=i[h];if(!a&&(y==="-"||y==="+"))a=y;else{let k=Number(y);!o&&k?o=k:l===-1&&(l=s+h)}}l!==-1&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,m="",d=i.length;for(let h=1;h<e.length;++h){let y=e[h];switch(y.type){case"space":c=!0;case"newline":d+=y.source.length;break;case"comment":t&&!c&&n(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=y.source.length,m=y.source.substring(1);break;case"error":n(y,"UNEXPECTED_TOKEN",y.message),d+=y.source.length;break;default:{let k=`Unexpected token in block scalar header: ${y.type}`;n(y,"UNEXPECTED_TOKEN",k);let f=y.source;f&&typeof f=="string"&&(d+=f.length)}}}return{mode:r,indent:o,chomp:a,comment:m,length:d}}function Mu(s){let e=s.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),r=[n?.[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}oo.resolveBlockScalar=Iu});var En=C(lo=>{"use strict";var On=x(),_u=Oe();function Bu(s,e,t){let{offset:n,type:i,source:r,end:o}=s,a,l,c=(h,y,k)=>t(n+h,y,k);switch(i){case"scalar":a=On.Scalar.PLAIN,l=$u(r,c);break;case"single-quoted-scalar":a=On.Scalar.QUOTE_SINGLE,l=xu(r,c);break;case"double-quoted-scalar":a=On.Scalar.QUOTE_DOUBLE,l=Du(r,c);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}let m=n+r.length,d=_u.resolveEnd(o,m,e,t);return{value:l,type:a,comment:d.comment,range:[n,m,d.offset]}}function $u(s,e){let t="";switch(s[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${s[0]}`;break}case"@":case"`":{t=`reserved character ${s[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),ao(s)}function xu(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),ao(s.slice(1,-1)).replace(/''/g,"'")}function ao(s){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
85
85
|
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
86
|
-
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(s);if(!n)return s;let i=n[1],r=" ",
|
|
86
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(s);if(!n)return s;let i=n[1],r=" ",o=e.lastIndex;for(t.lastIndex=o;n=t.exec(s);)n[1]===""?r===`
|
|
87
87
|
`?i+=r:r=`
|
|
88
|
-
`:(i+=r+n[1],r=" "),
|
|
88
|
+
`:(i+=r+n[1],r=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(s),i+r+(n?.[1]??"")}function Du(s,e){let t="";for(let n=1;n<s.length-1;++n){let i=s[n];if(!(i==="\r"&&s[n+1]===`
|
|
89
89
|
`))if(i===`
|
|
90
|
-
`){let{fold:r,offset:
|
|
90
|
+
`){let{fold:r,offset:o}=ju(s,n);t+=r,n=o}else if(i==="\\"){let r=s[++n],o=Ru[r];if(o)t+=o;else if(r===`
|
|
91
91
|
`)for(r=s[n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="\r"&&s[n+1]===`
|
|
92
|
-
`)for(r=s[++n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="x"||r==="u"||r==="U"){let
|
|
93
|
-
`&&!(
|
|
94
|
-
`)&&(t+=n>r?s.slice(r,n+1):i)}else t+=i}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function
|
|
92
|
+
`)for(r=s[++n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="x"||r==="u"||r==="U"){let a={x:2,u:4,U:8}[r];t+=Fu(s,n+1,a,e),n+=a}else{let a=s.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(i===" "||i===" "){let r=n,o=s[n+1];for(;o===" "||o===" ";)o=s[++n+1];o!==`
|
|
93
|
+
`&&!(o==="\r"&&s[n+2]===`
|
|
94
|
+
`)&&(t+=n>r?s.slice(r,n+1):i)}else t+=i}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function ju(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`
|
|
95
95
|
`||n==="\r")&&!(n==="\r"&&s[e+2]!==`
|
|
96
96
|
`);)n===`
|
|
97
97
|
`&&(t+=`
|
|
98
|
-
`),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}var
|
|
99
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
98
|
+
`),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}var Ru={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
99
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Fu(s,e,t,n){let i=s.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){let a=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}lo.resolveFlowScalar=Bu});var fo=C(uo=>{"use strict";var Ee=M(),co=x(),Ku=Ln(),Uu=En();function Yu(s,e,t,n){let{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?Ku.resolveBlockScalar(s,e,n):Uu.resolveFlowScalar(e,s.options.strict,n),l=t?s.directives.tagName(t.source,d=>n(t,"TAG_RESOLVE_FAILED",d)):null,c=t&&l?Vu(s.schema,i,l,t,n):e.type==="scalar"?Ju(s,i,e,n):s.schema[Ee.SCALAR],m;try{let d=c.resolve(i,h=>n(t??e,"TAG_RESOLVE_FAILED",h),s.options);m=Ee.isScalar(d)?d:new co.Scalar(d)}catch(d){let h=d instanceof Error?d.message:String(d);n(t??e,"TAG_RESOLVE_FAILED",h),m=new co.Scalar(i)}return m.range=a,m.source=i,r&&(m.type=r),l&&(m.tag=l),c.format&&(m.format=c.format),o&&(m.comment=o),m}function Vu(s,e,t,n,i){if(t==="!")return s[Ee.SCALAR];let r=[];for(let a of s.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)r.push(a);else return a;for(let a of r)if(a.test?.test(e))return a;let o=s.knownTags[t];return o&&!o.collection?(s.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[Ee.SCALAR])}function Ju({directives:s,schema:e},t,n,i){let r=e.tags.find(o=>o.default&&o.test?.test(t))||e[Ee.SCALAR];if(e.compat){let o=e.compat.find(a=>a.default&&a.test?.test(t))??e[Ee.SCALAR];if(r.tag!==o.tag){let a=s.tagString(r.tag),l=s.tagString(o.tag),c=`Value may be parsed as either ${a} or ${l}`;i(n,"TAG_RESOLVE_FAILED",c,!0)}}return r}uo.composeScalar=Yu});var po=C(ho=>{"use strict";function Hu(s,e,t){if(e){t===null&&(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];i?.type==="space";)s+=i.source.length,i=e[++n];break}}return s}ho.emptyScalarPosition=Hu});var yo=C(Tn=>{"use strict";var Wu=Be(),Qu=ro(),mo=fo(),Gu=Oe(),zu=po(),Xu={composeNode:go,composeEmptyNode:qn};function go(s,e,t,n){let{spaceBefore:i,comment:r,anchor:o,tag:a}=t,l,c=!0;switch(e.type){case"alias":l=Zu(s,e,n),(o||a)&&n(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":l=mo.composeScalar(s,e,a,n),o&&(l.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=Qu.composeCollection(Xu,s,e,t,n),o&&(l.anchor=o.source.substring(1));break;default:{let m=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",m),l=qn(s,e.offset,void 0,null,t,n),c=!1}}return o&&l.anchor===""&&n(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&(l.spaceBefore=!0),r&&(e.type==="scalar"&&e.source===""?l.comment=r:l.commentBefore=r),s.options.keepSourceTokens&&c&&(l.srcToken=e),l}function qn(s,e,t,n,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){let m={type:"scalar",offset:zu.emptyScalarPosition(e,t,n),indent:-1,source:""},d=mo.composeScalar(s,m,a,c);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),r&&(d.comment=r,d.range[2]=l),d}function Zu({options:s},{offset:e,source:t,end:n},i){let r=new Wu.Alias(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=Gu.resolveEnd(n,o,s.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}Tn.composeEmptyNode=qn;Tn.composeNode=go});var So=C(bo=>{"use strict";var ef=Qe(),wo=yo(),tf=Oe(),sf=Ze();function nf(s,e,{offset:t,start:n,value:i,end:r},o){let a=Object.assign({_directives:e},s),l=new ef.Document(void 0,a),c={atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},m=sf.resolveProps(n,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});m.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!m.hasNewline&&o(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?wo.composeNode(c,i,m,o):wo.composeEmptyNode(c,m.end,n,null,m,o);let d=l.contents.range[2],h=tf.resolveEnd(r,d,!1,o);return h.comment&&(l.comment=h.comment),l.range=[t,d,h.offset],l}bo.composeDoc=nf});var Pn=C(No=>{"use strict";var rf=gs(),of=Qe(),et=Xe(),ko=M(),af=So(),lf=Oe();function tt(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];let{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function vo(s){let e="",t=!1,n=!1;for(let i=0;i<s.length;++i){let r=s[i];switch(r[0]){case"#":e+=(e===""?"":n?`
|
|
100
100
|
|
|
101
101
|
`:`
|
|
102
|
-
`)+(r.substring(1)||" "),t=!0,n=!1;break;case"%":s[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var
|
|
103
|
-
${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(
|
|
104
|
-
${
|
|
105
|
-
${
|
|
106
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new
|
|
107
|
-
`}];switch(
|
|
108
|
-
`),m=
|
|
109
|
-
`,
|
|
110
|
-
`}),{type:"block-scalar",offset:r,indent:n,props:
|
|
102
|
+
`)+(r.substring(1)||" "),t=!0,n=!1;break;case"%":s[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var In=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,r)=>{let o=tt(t);r?this.warnings.push(new et.YAMLWarning(o,n,i)):this.errors.push(new et.YAMLParseError(o,n,i))},this.directives=new rf.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:i}=vo(this.prelude);if(n){let r=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
103
|
+
${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(ko.isCollection(r)&&!r.flow&&r.items.length>0){let o=r.items[0];ko.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${n}
|
|
104
|
+
${a}`:n}else{let o=r.commentBefore;r.commentBefore=o?`${n}
|
|
105
|
+
${o}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:vo(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(t,n)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{let r=tt(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=af.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new et.YAMLParseError(tt(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new et.YAMLParseError(tt(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=lf.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
|
|
106
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new et.YAMLParseError(tt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new of.Document(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}};No.Composer=In});var Lo=C(zt=>{"use strict";var cf=Ln(),uf=En(),ff=Xe(),Co=Re();function hf(s,e=!0,t){if(s){let n=(i,r,o)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(a,r,o);else throw new ff.YAMLParseError([a,a+1],r,o)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return uf.resolveFlowScalar(s,e,n);case"block-scalar":return cf.resolveBlockScalar({options:{strict:e}},s,n)}}return null}function df(s,e){let{implicitKey:t=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=Co.stringifyString({type:o,value:s},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
107
|
+
`}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
|
|
108
|
+
`),m=a.substring(0,c),d=a.substring(c+1)+`
|
|
109
|
+
`,h=[{type:"block-scalar-header",offset:r,indent:n,source:m}];return Ao(h,l)||h.push({type:"newline",offset:-1,indent:n,source:`
|
|
110
|
+
`}),{type:"block-scalar",offset:r,indent:n,props:h,source:d}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:a,end:l};default:return{type:"scalar",offset:r,indent:n,source:a,end:l}}}function pf(s,e,t={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=t,a="indent"in s?s.indent:null;if(n&&typeof a=="number"&&(a+=2),!o)switch(s.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=s.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=Co.stringifyString({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":mf(s,l);break;case'"':Mn(s,l,"double-quoted-scalar");break;case"'":Mn(s,l,"single-quoted-scalar");break;default:Mn(s,l,"scalar")}}function mf(s,e){let t=e.indexOf(`
|
|
111
111
|
`),n=e.substring(0,t),i=e.substring(t+1)+`
|
|
112
|
-
`;if(s.type==="block-scalar"){let r=s.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,s.source=i}else{let{offset:r}=s,
|
|
113
|
-
`});for(let l of Object.keys(s))l!=="type"&&l!=="offset"&&delete s[l];Object.assign(s,{type:"block-scalar",indent:
|
|
114
|
-
`};delete s.items,Object.assign(s,{type:t,source:e,end:[i]});break}default:{let n="indent"in s?s.indent:-1,i="end"in s&&Array.isArray(s.end)?s.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(s))r!=="type"&&r!=="offset"&&delete s[r];Object.assign(s,{type:t,indent:n,source:e,end:i})}}}
|
|
112
|
+
`;if(s.type==="block-scalar"){let r=s.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,s.source=i}else{let{offset:r}=s,o="indent"in s?s.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:n}];Ao(a,"end"in s?s.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
113
|
+
`});for(let l of Object.keys(s))l!=="type"&&l!=="offset"&&delete s[l];Object.assign(s,{type:"block-scalar",indent:o,props:a,source:i})}}function Ao(s,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":s.push(t);break;case"newline":return s.push(t),!0}return!1}function Mn(s,e,t){switch(s.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":s.type=t,s.source=e;break;case"block-scalar":{let n=s.props.slice(1),i=e.length;s.props[0].type==="block-scalar-header"&&(i-=s.props[0].source.length);for(let r of n)r.offset+=i;delete s.props,Object.assign(s,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:s.offset+e.length,indent:s.indent,source:`
|
|
114
|
+
`};delete s.items,Object.assign(s,{type:t,source:e,end:[i]});break}default:{let n="indent"in s?s.indent:-1,i="end"in s&&Array.isArray(s.end)?s.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(s))r!=="type"&&r!=="offset"&&delete s[r];Object.assign(s,{type:t,indent:n,source:e,end:i})}}}zt.createScalarToken=df;zt.resolveAsScalar=hf;zt.setScalarValue=pf});var Eo=C(Oo=>{"use strict";var gf=s=>"type"in s?Zt(s):Xt(s);function Zt(s){switch(s.type){case"block-scalar":{let e="";for(let t of s.props)e+=Zt(t);return e+s.source}case"block-map":case"block-seq":{let e="";for(let t of s.items)e+=Xt(t);return e}case"flow-collection":{let e=s.start.source;for(let t of s.items)e+=Xt(t);for(let t of s.end)e+=t.source;return e}case"document":{let e=Xt(s);if(s.end)for(let t of s.end)e+=t.source;return e}default:{let e=s.source;if("end"in s&&s.end)for(let t of s.end)e+=t.source;return e}}}function Xt({start:s,key:e,sep:t,value:n}){let i="";for(let r of s)i+=r.source;if(e&&(i+=Zt(e)),t)for(let r of t)i+=r.source;return n&&(i+=Zt(n)),i}Oo.stringify=gf});var Po=C(Io=>{"use strict";var _n=Symbol("break visit"),yf=Symbol("skip children"),qo=Symbol("remove item");function pe(s,e){"type"in s&&s.type==="document"&&(s={start:s.start,value:s.value}),To(Object.freeze([]),s,e)}pe.BREAK=_n;pe.SKIP=yf;pe.REMOVE=qo;pe.itemAtPath=(s,e)=>{let t=s;for(let[n,i]of e){let r=t?.[n];if(r&&"items"in r)t=r.items[i];else return}return t};pe.parentCollection=(s,e)=>{let t=pe.itemAtPath(s,e.slice(0,-1)),n=e[e.length-1][0],i=t?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function To(s,e,t){let n=t(e,s);if(typeof n=="symbol")return n;for(let i of["key","value"]){let r=e[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){let a=To(Object.freeze(s.concat([[i,o]])),r.items[o],t);if(typeof a=="number")o=a-1;else{if(a===_n)return _n;a===qo&&(r.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,s))}}return typeof n=="function"?n(e,s):n}Io.visit=pe});var es=C(U=>{"use strict";var Bn=Lo(),wf=Eo(),bf=Po(),$n="\uFEFF",xn="",Dn="",jn="",Sf=s=>!!s&&"items"in s,kf=s=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar");function vf(s){switch(s){case $n:return"<BOM>";case xn:return"<DOC>";case Dn:return"<FLOW_END>";case jn:return"<SCALAR>";default:return JSON.stringify(s)}}function Nf(s){switch(s){case $n:return"byte-order-mark";case xn:return"doc-mode";case Dn:return"flow-error-end";case jn:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
115
115
|
`:case`\r
|
|
116
|
-
`: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(s[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}
|
|
117
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
118
|
-
\r `),
|
|
116
|
+
`: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(s[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}U.createScalarToken=Bn.createScalarToken;U.resolveAsScalar=Bn.resolveAsScalar;U.setScalarValue=Bn.setScalarValue;U.stringify=wf.stringify;U.visit=bf.visit;U.BOM=$n;U.DOCUMENT=xn;U.FLOW_END=Dn;U.SCALAR=jn;U.isCollection=Sf;U.isScalar=kf;U.prettyToken=vf;U.tokenType=Nf});var Kn=C(_o=>{"use strict";var st=es();function J(s){switch(s){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case" ":return!0;default:return!1}}var Mo=new Set("0123456789ABCDEFabcdef"),Cf=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ts=new Set(",[]{}"),Af=new Set(` ,[]{}
|
|
118
|
+
\r `),Rn=s=>!s||Af.has(s),Fn=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
119
119
|
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
120
120
|
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){let i=this.buffer[n+e+1];if(i===`
|
|
121
121
|
`||!i&&!this.atEnd)return e+n+1}return t===`
|
|
122
|
-
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&
|
|
123
|
-
`,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]===
|
|
122
|
+
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&J(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(`
|
|
123
|
+
`,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]===st.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){let r=e[n-1];if(r===" "||r===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let r=e[t-1];if(r===" "||r===" ")t-=1;else break}let i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield st.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&J(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!J(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&J(t)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Rn),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&J(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield st.FLOW_END,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"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(Rn),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||J(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),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}let n=this.buffer.substring(0,t),i=n.indexOf(`
|
|
124
124
|
`,this.pos);if(i!==-1){for(;i!==-1;){let r=this.continueScalar(i+1);if(r===-1)break;i=n.indexOf(`
|
|
125
|
-
`,r)}i!==-1&&(t=i-(n[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>
|
|
126
|
-
`:e=r,t=0;break;case"\r":{let
|
|
125
|
+
`,r)}i!==-1&&(t=i-(n[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>J(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case" ":t+=1;break;case`
|
|
126
|
+
`:e=r,t=0;break;case"\r":{let o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
127
127
|
`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
|
|
128
128
|
`,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
129
|
-
`;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,
|
|
130
|
-
`&&r>=this.pos&&r+1+t>
|
|
129
|
+
`;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);let a=r;for(;o===" ";)o=this.buffer[--r];if(o===`
|
|
130
|
+
`&&r>=this.pos&&r+1+t>a)e=r;else break}while(!0);return yield st.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let r=this.buffer[n+1];if(J(r)||e&&ts.has(r))break;t=n}else if(J(i)){let r=this.buffer[n+1];if(i==="\r"&&(r===`
|
|
131
131
|
`?(n+=1,i=`
|
|
132
|
-
`,r=this.buffer[n+1]):t=n),r==="#"||e&&
|
|
133
|
-
`){let
|
|
132
|
+
`,r=this.buffer[n+1]):t=n),r==="#"||e&&ts.has(r))break;if(i===`
|
|
133
|
+
`){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&ts.has(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield st.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Rn))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if(J(t)||e&&ts.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!J(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Cf.has(t))t=this.buffer[++e];else if(t==="%"&&Mo.has(this.buffer[e+1])&&Mo.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
134
134
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
135
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};
|
|
135
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};_o.Lexer=Fn});var Yn=C(Bo=>{"use strict";var Un=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}};Bo.LineCounter=Un});var Jn=C(Ro=>{"use strict";var $o=es(),Lf=Kn();function me(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}function xo(s){for(let e=0;e<s.length;++e)switch(s[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function jo(s){switch(s?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function ss(s){switch(s.type){case"document":return s.start;case"block-map":{let e=s.items[s.items.length-1];return e.sep??e.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}function qe(s){if(s.length===0)return[];let e=s.length;e:for(;--e>=0;)switch(s[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;s[++e]?.type==="space";);return s.splice(e,s.length)}function Do(s){if(s.start.type==="flow-seq-start")for(let e of s.items)e.sep&&!e.value&&!me(e.start,"explicit-key-ind")&&!me(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,jo(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}var Vn=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 Lf.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",$o.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=$o.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){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 n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,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||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Do(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&xo(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),t.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":{xo(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 t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=ss(this.peek(2)),n=qe(t),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
136
136
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
137
|
-
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",r=[];if(i&&t.sep&&!t.value){let
|
|
137
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",r=[];if(i&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let l=t.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&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(r.push(this.sourceToken),e.items.push({start:r,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(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(me(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(jo(t.key)&&!me(t.sep,"newline")){let o=qe(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(me(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=qe(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):me(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){n&&o.type!=="block-seq"&&e.items.push({start:r}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||me(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n&&n.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=ss(n),r=qe(i);Do(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:r,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 t=this.source.indexOf(`
|
|
138
138
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
139
|
-
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Wt(e),n=Ne(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Wt(e),n=Ne(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.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;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};qa.Parser=xn});var Ma=v(ze=>{"use strict";var Ea=Cn(),cf=Ke(),Ge=Je(),uf=ks(),ff=Dn(),Ia=jn();function Ta(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new ff.LineCounter||null,prettyErrors:e}}function hf(s,e={}){let{lineCounter:t,prettyErrors:n}=Ta(e),i=new Ia.Parser(t?.addNewLine),r=new Ea.Composer(e),a=Array.from(r.compose(i.parse(s)));if(n&&t)for(let o of a)o.errors.forEach(Ge.prettifyError(s,t)),o.warnings.forEach(Ge.prettifyError(s,t));return a.length>0?a:Object.assign([],{empty:!0},r.streamInfo())}function Pa(s,e={}){let{lineCounter:t,prettyErrors:n}=Ta(e),i=new Ia.Parser(t?.addNewLine),r=new Ea.Composer(e),a=null;for(let o of r.compose(i.parse(s),!0,s.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new Ge.YAMLParseError(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(a.errors.forEach(Ge.prettifyError(s,t)),a.warnings.forEach(Ge.prettifyError(s,t))),a}function df(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=Pa(s,t);if(!i)return null;if(i.warnings.forEach(r=>uf.warn(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function pf(s,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(s===void 0){let{keepUndefined:i}=t??e??{};if(!i)return}return new cf.Document(s,n,t).toString(t)}ze.parse=df;ze.parseAllDocuments=hf;ze.parseDocument=Pa;ze.stringify=pf});var Ba=v(I=>{"use strict";var mf=Cn(),gf=Ke(),yf=rn(),Rn=Je(),wf=qe(),se=E(),bf=X(),Sf=P(),vf=ee(),kf=te(),Nf=Vt(),Af=Bn(),Cf=Dn(),Lf=jn(),Qt=Ma(),_a=Ae();I.Composer=mf.Composer;I.Document=gf.Document;I.Schema=yf.Schema;I.YAMLError=Rn.YAMLError;I.YAMLParseError=Rn.YAMLParseError;I.YAMLWarning=Rn.YAMLWarning;I.Alias=wf.Alias;I.isAlias=se.isAlias;I.isCollection=se.isCollection;I.isDocument=se.isDocument;I.isMap=se.isMap;I.isNode=se.isNode;I.isPair=se.isPair;I.isScalar=se.isScalar;I.isSeq=se.isSeq;I.Pair=bf.Pair;I.Scalar=Sf.Scalar;I.YAMLMap=vf.YAMLMap;I.YAMLSeq=kf.YAMLSeq;I.CST=Nf;I.Lexer=Af.Lexer;I.LineCounter=Cf.LineCounter;I.Parser=Lf.Parser;I.parse=Qt.parse;I.parseAllDocuments=Qt.parseAllDocuments;I.parseDocument=Qt.parseDocument;I.stringify=Qt.stringify;I.visit=_a.visit;I.visitAsync=_a.visitAsync});var Bf={};Ha(Bf,{default:()=>_f});module.exports=Wa(Bf);var ts=class{loadedFonts=new Set;fetcher=fetch;setFetcher(e){this.fetcher=e}async loadFonts(e,t){let n=new Function("m","return import(m)"),i=this.fetcher||=await async function(){let{fetchBuilder:o,FileSystemCache:l}=await n("node-fetch-cache"),c=new l({cacheDirectory:".cache/typst/fonts"}),m=o.withCache(c);return function(h,f){let p=setTimeout(()=>{console.warn("font fetching is stucking:",h)},15e3);return m(h,f).finally(()=>{clearTimeout(p)})}}(),r=t.filter(o=>o instanceof Uint8Array||typeof o=="object"&&"info"in o?!0:this.loadedFonts.has(o)?!1:(this.loadedFonts.add(o),!0)),a=await Promise.all(r.map(async o=>{if(o instanceof Uint8Array){await e.add_raw_font(o);return}if(typeof o=="object"&&"info"in o){await e.add_lazy_font(o,"blob"in o?o.blob:Qa(o));return}return new Uint8Array(await(await i(o)).arrayBuffer())}));for(let o of a)o&&await e.add_raw_font(o)}async build(e,t,n){let i={ref:this,builder:t,hooks:n};for(let r of e?.beforeBuild??[])await r(void 0,i);return n.latelyBuild&&n.latelyBuild(i),await t.build()}};async function Un(s,e,t,n){return await e.init(s?.getModule?.()),await new ts().build(s,new t,n)}function Qa(s){return()=>{let e=new XMLHttpRequest;return e.overrideMimeType("text/plain; charset=x-user-defined"),e.open("GET",s.url,!1),e.send(null),e.status===200&&(e.response instanceof String||typeof e.response=="string")?Uint8Array.from(e.response,t=>t.charCodeAt(0)):new Uint8Array}}var $=Symbol.for("reflexo-obj");var Yn;(function(s){s[s.PIXEL_PER_PT=3]="PIXEL_PER_PT"})(Yn||(Yn={}));var jf=Symbol("beforeBuild"),Ga=["DejaVuSansMono-Bold.ttf","DejaVuSansMono-BoldOblique.ttf","DejaVuSansMono-Oblique.ttf","DejaVuSansMono.ttf","LibertinusSerif-Bold.otf","LibertinusSerif-BoldItalic.otf","LibertinusSerif-Italic.otf","LibertinusSerif-Regular.otf","LibertinusSerif-Semibold.otf","LibertinusSerif-SemiboldItalic.otf","NewCM10-Bold.otf","NewCM10-BoldItalic.otf","NewCM10-Italic.otf","NewCM10-Regular.otf","NewCMMath-Bold.otf","NewCMMath-Book.otf","NewCMMath-Regular.otf"],za=["InriaSerif-Bold.ttf","InriaSerif-BoldItalic.ttf","InriaSerif-Italic.ttf","InriaSerif-Regular.ttf","Roboto-Regular.ttf","NotoSerifCJKsc-Regular.otf"],Xa=["TwitterColorEmoji.ttf","NotoColorEmoji-Regular-COLR.subset.ttf"];function Za(s){let e=[];if(s&&s?.assets!==!1&&s?.assets?.length&&s?.assets?.length>0){let t={text:"https://cdn.jsdelivr.net/gh/typst/typst-assets@v0.13.1/files/fonts/",_:"https://cdn.jsdelivr.net/gh/typst/typst-dev-assets@v0.13.1/files/fonts/"},n=s.assetUrlPrefix??t;typeof n=="string"?n={_:n}:n={...t,...n};for(let r of Object.keys(n)){let a=n[r];a[a.length-1]!=="/"&&(n[r]=a+"/")}let i=(r,a)=>a.map(o=>(n[r]||n._)+o);for(let r of s.assets)switch(r){case"text":e.push(...i(r,Ga));break;case"cjk":e.push(...i(r,za));break;case"emoji":e.push(...i(r,Xa));break}}return e}function Jn(s,e){let t=Za(e),n=async(i,{ref:r,builder:a})=>{e?.fetcher&&r.setFetcher(e.fetcher),await r.loadFonts(a,[...s,...t])};return n._preloadRemoteFontOptions=e,n._kind="fontLoader",n}var eo=s=>{let e=!1,t;return()=>e?t:(e=!0,t=s())},Ze=class{wasmBin;initOnce;constructor(e){if(typeof e!="function")throw new Error("initFn is not a function");this.initOnce=eo(async()=>{await e(this.wasmBin)})}async init(e){this.wasmBin=e,await this.initOnce()}};var ss;(function(s){s[s.vector=0]="vector",s[s.pdf=1]="pdf",s[s._dummy=2]="_dummy"})(ss||(ss={}));var ns=class{[$];constructor(e){this[$]=e}reset(){this[$].reset()}current(){return this[$].current()}setAttachDebugInfo(e){this[$].set_attach_debug_info(e)}},Vn;Vn||(Vn={});var is=class{[$];constructor(e){this[$]=e}compile(e){return this[$].compile(0,fe(e?.diagnostics))}compileHtml(e){return this[$].compile(1,fe(e?.diagnostics))}async query(e){return JSON.parse(this[$].query(0,e.selector,e.field))}title(){return this[$].title(0)}vector(e){return this[$].get_artifact(0,fe(e?.diagnostics))||{}}pdf(e){return this[$].get_artifact(1,fe(e?.diagnostics))||{}}},to=s=>new Ze(async e=>await s.default(e));function rs(){return new et}var et=class s{compiler;compilerJs;static defaultAssets=["text"];constructor(){}async init(e){this.compilerJs=await(e?.getWrapper?.()||import("@myriaddreamin/typst-ts-web-compiler"));let t=this.compilerJs.TypstCompilerBuilder,n={...e||{}},i=n.beforeBuild??=[],r=i.some(c=>c._preloadRemoteFontOptions!==void 0),a=i.some(c=>c._preloadRemoteFontOptions?.assets!==void 0),o=i.some(c=>c._preloadRemoteFontOptions?.assets===!1);if((!r||!a&&!o)&&i.push(Jn([],{assets:s.defaultAssets})),!i.some(c=>c._kind==="fontLoader"))throw new Error("TypstCompiler: no font loader found, please use font loaders, e.g. loadFonts or preloadSystemFonts");this.compiler=await Un(e,to(this.compilerJs),t,{})}setFonts(e){this.compiler.set_fonts(e)}compile(e){return new Promise(t=>{let n=this.compiler.snapshot(e.root,e.mainFilePath,Hn(e.inputs));if("incrementalServer"in e){t(n.incr_compile(e.incrementalServer[$],fe(e.diagnostics)));return}t(n.get_artifact(e.format||ss.vector,fe(e.diagnostics)))})}async runWithWorld(e,t){let n=this.compiler.snapshot(e.root,e.mainFilePath,Hn(e.inputs)),i=await t(new is(n));return n.free(),i}query(e){return this.runWithWorld(e,async t=>JSON.parse(await t.query(e)))}getSemanticTokenLegend(){return new Promise(e=>{e(this.compiler.get_semantic_token_legend())})}getSemanticTokens(e){return new Promise(t=>{this.compiler.reset(),t(this.compiler.get_semantic_tokens(e.offsetEncoding||"utf-16",e.mainFilePath,e.resultId))})}async withIncrementalServer(e){let t=new ns(this.compiler.create_incr_server());try{return await e(t)}finally{t[$].free()}}async getAst(e){return this.compiler.get_ast(e)}async reset(){await new Promise(e=>{this.compiler.reset(),e(void 0)})}addSource(e,t){if(arguments.length>2)throw new Error("use of addSource(path, source, isMain) is deprecated, please use addSource(path, source) instead");this.compiler.add_source(e,t)}mapShadow(e,t){this.compiler.map_shadow(e,t)}unmapShadow(e){this.compiler.unmap_shadow(e)}resetShadow(){this.compiler.reset_shadow()}renderPageToCanvas(){throw new Error("Please use the api TypstRenderer.renderToCanvas in v0.4.0")}};rs._impl=et;function Hn(s){return s?Object.entries(s):void 0}function fe(s){switch(s){case"none":return 1;case"unix":return 2;case"full":default:return 3}}var L=es(Gn()),Da=es(Ba()),Of=async s=>{let e=rs();return await e.init(),e.addSource("/main.typ",s),await e.getAst("/main.typ")},qf=s=>{let n=(r=>r.split(`
|
|
140
|
-
`).reduce((a
|
|
141
|
-
`))((r=>{let
|
|
142
|
-
`);return
|
|
143
|
-
`)})(s)),i=(0,
|
|
144
|
-
`)
|
|
145
|
-
|
|
139
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=ss(e),n=qe(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=ss(e),n=qe(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.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())}}};Ro.Parser=Vn});var Vo=C(it=>{"use strict";var Fo=Pn(),Of=Qe(),nt=Xe(),Ef=qs(),qf=Yn(),Ko=Jn();function Uo(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new qf.LineCounter||null,prettyErrors:e}}function Tf(s,e={}){let{lineCounter:t,prettyErrors:n}=Uo(e),i=new Ko.Parser(t?.addNewLine),r=new Fo.Composer(e),o=Array.from(r.compose(i.parse(s)));if(n&&t)for(let a of o)a.errors.forEach(nt.prettifyError(s,t)),a.warnings.forEach(nt.prettifyError(s,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function Yo(s,e={}){let{lineCounter:t,prettyErrors:n}=Uo(e),i=new Ko.Parser(t?.addNewLine),r=new Fo.Composer(e),o=null;for(let a of r.compose(i.parse(s),!0,s.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new nt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(nt.prettifyError(s,t)),o.warnings.forEach(nt.prettifyError(s,t))),o}function If(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=Yo(s,t);if(!i)return null;if(i.warnings.forEach(r=>Ef.warn(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function Pf(s,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(s===void 0){let{keepUndefined:i}=t??e??{};if(!i)return}return new Of.Document(s,n,t).toString(t)}it.parse=If;it.parseAllDocuments=Tf;it.parseDocument=Yo;it.stringify=Pf});var Ho=C(_=>{"use strict";var Mf=Pn(),_f=Qe(),Bf=hn(),Hn=Xe(),$f=Be(),ce=M(),xf=re(),Df=x(),jf=ae(),Rf=le(),Ff=es(),Kf=Kn(),Uf=Yn(),Yf=Jn(),ns=Vo(),Jo=Ie();_.Composer=Mf.Composer;_.Document=_f.Document;_.Schema=Bf.Schema;_.YAMLError=Hn.YAMLError;_.YAMLParseError=Hn.YAMLParseError;_.YAMLWarning=Hn.YAMLWarning;_.Alias=$f.Alias;_.isAlias=ce.isAlias;_.isCollection=ce.isCollection;_.isDocument=ce.isDocument;_.isMap=ce.isMap;_.isNode=ce.isNode;_.isPair=ce.isPair;_.isScalar=ce.isScalar;_.isSeq=ce.isSeq;_.Pair=xf.Pair;_.Scalar=Df.Scalar;_.YAMLMap=jf.YAMLMap;_.YAMLSeq=Rf.YAMLSeq;_.CST=Ff;_.Lexer=Kf.Lexer;_.LineCounter=Uf.LineCounter;_.Parser=Yf.Parser;_.parse=ns.parse;_.parseAllDocuments=ns.parseAllDocuments;_.parseDocument=ns.parseDocument;_.stringify=ns.stringify;_.visit=Jo.visit;_.visitAsync=Jo.visitAsync});var nh={};ha(nh,{default:()=>sh});module.exports=da(nh);var ls=class{loadedFonts=new Set;fetcher=fetch;setFetcher(e){this.fetcher=e}async loadFonts(e,t){let n=new Function("m","return import(m)"),i=this.fetcher||=await(async function(){let{fetchBuilder:a,FileSystemCache:l}=await n("node-fetch-cache"),c=new l({cacheDirectory:".cache/typst/fonts"}),m=a.withCache(c);return function(d,h){let y=setTimeout(()=>{console.warn("font fetching is stucking:",d)},15e3);return m(d,h).finally(()=>{clearTimeout(y)})}})(),r=t.filter(a=>a instanceof Uint8Array||typeof a=="object"&&"info"in a?!0:this.loadedFonts.has(a)?!1:(this.loadedFonts.add(a),!0)),o=await Promise.all(r.map(async a=>{if(a instanceof Uint8Array){await e.add_raw_font(a);return}if(typeof a=="object"&&"info"in a){await e.add_lazy_font(a,"blob"in a?a.blob:pa(a));return}return new Uint8Array(await(await i(a)).arrayBuffer())}));for(let a of o)a&&await e.add_raw_font(a)}async build(e,t,n){let i={ref:this,builder:t,hooks:n};for(let r of e?.beforeBuild??[])await r(void 0,i);return n.latelyBuild&&n.latelyBuild(i),await t.build()}};async function ei(s,e,t,n){return await e.init(s?.getModule?.()),await new ls().build(s,new t,n)}function pa(s){return()=>{let e=new XMLHttpRequest;return e.overrideMimeType("text/plain; charset=x-user-defined"),e.open("GET",s.url,!1),e.send(null),e.status===200&&(e.response instanceof String||typeof e.response=="string")?Uint8Array.from(e.response,t=>t.charCodeAt(0)):new Uint8Array}}var F=Symbol.for("reflexo-obj");var ti;(function(s){s[s.PIXEL_PER_PT=3]="PIXEL_PER_PT"})(ti||(ti={}));var ma=["DejaVuSansMono-Bold.ttf","DejaVuSansMono-BoldOblique.ttf","DejaVuSansMono-Oblique.ttf","DejaVuSansMono.ttf","LibertinusSerif-Bold.otf","LibertinusSerif-BoldItalic.otf","LibertinusSerif-Italic.otf","LibertinusSerif-Regular.otf","LibertinusSerif-Semibold.otf","LibertinusSerif-SemiboldItalic.otf","NewCM10-Bold.otf","NewCM10-BoldItalic.otf","NewCM10-Italic.otf","NewCM10-Regular.otf","NewCMMath-Bold.otf","NewCMMath-Book.otf","NewCMMath-Regular.otf"],ga=["InriaSerif-Bold.ttf","InriaSerif-BoldItalic.ttf","InriaSerif-Italic.ttf","InriaSerif-Regular.ttf","Roboto-Regular.ttf","NotoSerifCJKsc-Regular.otf"],ya=["TwitterColorEmoji.ttf","NotoColorEmoji-Regular-COLR.subset.ttf"];function wa(s){let e=[];if(s&&s?.assets!==!1&&s?.assets?.length&&s?.assets?.length>0){let t={text:"https://cdn.jsdelivr.net/gh/typst/typst-assets@v0.13.1/files/fonts/",_:"https://cdn.jsdelivr.net/gh/typst/typst-dev-assets@v0.13.1/files/fonts/"},n=s.assetUrlPrefix??t;typeof n=="string"?n={_:n}:n={...t,...n};for(let r of Object.keys(n)){let o=n[r];o[o.length-1]!=="/"&&(n[r]=o+"/")}let i=(r,o)=>o.map(a=>(n[r]||n._)+a);for(let r of s.assets)switch(r){case"text":e.push(...i(r,ma));break;case"cjk":e.push(...i(r,ga));break;case"emoji":e.push(...i(r,ya));break}}return e}function si(s,e){let t=wa(e),n=async(i,{ref:r,builder:o})=>{e?.fetcher&&r.setFetcher(e.fetcher),await r.loadFonts(o,[...s,...t])};return n._preloadRemoteFontOptions=e,n._kind="fontLoader",n}var ba=s=>{let e=!1,t;return()=>e?t:(e=!0,t=s())},at=class{wasmBin;initOnce;constructor(e){if(typeof e!="function")throw new Error("initFn is not a function");this.initOnce=ba(async()=>{await e(this.wasmBin)})}async init(e){this.wasmBin=e,await this.initOnce()}};var cs;(function(s){s[s.vector=0]="vector",s[s.pdf=1]="pdf",s[s._dummy=2]="_dummy"})(cs||(cs={}));var us=class{[F];constructor(e){this[F]=e}reset(){this[F].reset()}current(){return this[F].current()}setAttachDebugInfo(e){this[F].set_attach_debug_info(e)}},ni;ni||(ni={});var fs=class{[F];constructor(e){this[F]=e}compile(e){return this[F].compile(0,ye(e?.diagnostics))}compileHtml(e){return this[F].compile(1,ye(e?.diagnostics))}async query(e){return JSON.parse(this[F].query(0,e.selector,e.field))}title(){return this[F].title(0)}vector(e){return this[F].get_artifact(0,ye(e?.diagnostics))||{}}pdf(e){return this[F].get_artifact(1,ye(e?.diagnostics))||{}}},Sa=s=>new at(async e=>await s.default(e));function hs(){return new lt}var lt=class s{compiler;compilerJs;static defaultAssets=["text"];constructor(){}async init(e){this.compilerJs=await(e?.getWrapper?.()||import("@myriaddreamin/typst-ts-web-compiler"));let t=this.compilerJs.TypstCompilerBuilder,n={...e||{}},i=n.beforeBuild??=[],r=i.some(c=>c._preloadRemoteFontOptions!==void 0),o=i.some(c=>c._preloadRemoteFontOptions?.assets!==void 0),a=i.some(c=>c._preloadRemoteFontOptions?.assets===!1);if((!r||!o&&!a)&&i.push(si([],{assets:s.defaultAssets})),!i.some(c=>c._kind==="fontLoader"))throw new Error("TypstCompiler: no font loader found, please use font loaders, e.g. loadFonts or preloadSystemFonts");this.compiler=await ei(e,Sa(this.compilerJs),t,{})}setFonts(e){this.compiler.set_fonts(e)}compile(e){return new Promise(t=>{let n=this.compiler.snapshot(e.root,e.mainFilePath,ii(e.inputs));if("incrementalServer"in e){t(n.incr_compile(e.incrementalServer[F],ye(e.diagnostics)));return}t(n.get_artifact(e.format||cs.vector,ye(e.diagnostics)))})}async runWithWorld(e,t){let n=this.compiler.snapshot(e.root,e.mainFilePath,ii(e.inputs)),i=await t(new fs(n));return n.free(),i}query(e){return this.runWithWorld(e,async t=>JSON.parse(await t.query(e)))}getSemanticTokenLegend(){return new Promise(e=>{e(this.compiler.get_semantic_token_legend())})}getSemanticTokens(e){return new Promise(t=>{this.compiler.reset(),t(this.compiler.get_semantic_tokens(e.offsetEncoding||"utf-16",e.mainFilePath,e.resultId))})}async withIncrementalServer(e){let t=new us(this.compiler.create_incr_server());try{return await e(t)}finally{t[F].free()}}async getAst(e){return this.compiler.get_ast(e)}async reset(){await new Promise(e=>{this.compiler.reset(),e(void 0)})}addSource(e,t){if(arguments.length>2)throw new Error("use of addSource(path, source, isMain) is deprecated, please use addSource(path, source) instead");this.compiler.add_source(e,t)}mapShadow(e,t){this.compiler.map_shadow(e,t)}unmapShadow(e){this.compiler.unmap_shadow(e)}resetShadow(){this.compiler.reset_shadow()}renderPageToCanvas(){throw new Error("Please use the api TypstRenderer.renderToCanvas in v0.4.0")}};hs._impl=lt;function ii(s){return s?Object.entries(s):void 0}function ye(s){switch(s){case"none":return 1;case"unix":return 2;default:return 3}}var S=as(ai()),Qo=as(Ho()),Vf=async s=>{let e=hs();return await e.init(),e.addSource("/main.typ",s),await e.getAst("/main.typ")},Jf=s=>{let n=(r=>r.split(`
|
|
140
|
+
`).reduce((o,a)=>{if(!/^\s*(path:|ast:|- s: |s: |c:)/.test(a))return o.length>0&&(o[o.length-1]=`${o[o.length-1].slice(0,-1)}\\n${a}"`),o;let[l,...c]=a.split(":");if(c[0]==="")return o.push(a),o;let m=c.join(":").trim();return o.push(`${l}: "${m}"`),o},[]).join(`
|
|
141
|
+
`))((r=>{let o=r.split(`
|
|
142
|
+
`);return o.shift(),o.join(`
|
|
143
|
+
`)})(s)),i=(0,Qo.parse)(n);return i.ast.c===null&&(i.ast.c=[]),i.ast},B=s=>s.children!==void 0&&Array.isArray(s.children),Go=s=>s.value!==void 0&&typeof s.value=="string",ge=s=>s.s!==void 0&&typeof s.s=="string",Hf=s=>s.c!==void 0&&Array.isArray(s.c),P=s=>{if(typeof s!="object"||s===null)return!1;let e=s;return typeof e.type=="string"&&typeof e.raw=="string"&&Array.isArray(e.range)&&e.range.length===2&&typeof e.loc=="object"&&e.loc!==null},Qn=s=>{if(Go(s))return s.value;if(B(s)){for(let e of s.children)if(P(e)){let t=Qn(e);if(t!==void 0)return t}}},Wo=(s,e)=>{if(!B(s))return;let t=s.children[e];if(P(t))return t},Z=(s,e)=>e.test(s),Wf=s=>typeof s.type!="string"?!1:Z(s.type,/^Marked::(Markup|ContentBlock)$/),zo=s=>{if(!P(s))return!1;let e=s.type;return e==="Punc::Hash"||e==="Punc::LeftBracket"||e==="Punc::RightBracket"},Te=s=>!P(s)||!B(s)?[s]:Wf(s)?s.children.filter(e=>!zo(e)).flatMap(Te):[s],Qf=new Set([S.ASTNodeTypes.Str,S.ASTNodeTypes.Code,S.ASTNodeTypes.Link,S.ASTNodeTypes.Strong,S.ASTNodeTypes.Emphasis,S.ASTNodeTypes.Comment]),rt=s=>s.type===S.ASTNodeTypes.Str&&s.raw?.trim()==="",Wn=s=>s.type===S.ASTNodeTypes.Break&&s.raw.includes(`
|
|
144
|
+
`),Xo=s=>s.type===S.ASTNodeTypes.Break&&!s.raw.includes(`
|
|
145
|
+
`),Zo=s=>{let e=0,t=s.length-1;for(;e<=t&&rt(s[e]);)e++;for(;t>=e&&rt(s[t]);)t--;return s.slice(e,t+1)},Gf=s=>Qf.has(s.type)||Xo(s)?!0:s.type.startsWith("Var::"),zf=s=>s.type.startsWith("Escape::"),Xf=s=>["Marked::Ref"].includes(s.type),ea=s=>Gf(s)||zf(s)||Xf(s),ta=s=>{let e=s;return!(!P(e)||e.type!=="Marked::Markup"||e.raw!==""||B(e)&&e.children.length>0)},sa=s=>{let e=Zo(s);if(e.length===0)throw new Error("Unexpected empty nodes array");let t=e[0],n=e[e.length-1];return{type:S.ASTNodeTypes.Paragraph,children:e,loc:{start:t.loc.start,end:n.loc.end},range:[t.range[0],n.range[1]],raw:e.map(i=>i.raw).join("")}},na=s=>{let e=[],t=[],n=()=>{if(t.length!==0){if(t.every(rt)){t.length=0;return}e.push(sa([...t])),t.length=0}};for(let i of s)if(!ta(i)){if(i.type===S.ASTNodeTypes.Paragraph&&P(i)&&B(i)){for(let r of i.children)t.length===0&&rt(r)||t.push(r);continue}if(ea(i)){if(t.length===0&&rt(i))continue;t.push(i);continue}n(),e.push(i)}return n(),e},Zf=(s,e,t)=>{let n=[],i=r=>{let a=e.slice(0,r-t).split(`
|
|
146
|
+
`);return{line:a.length,column:a[a.length-1].length}};for(let r of s){let o=n[n.length-1];if(o&&r.type===S.ASTNodeTypes.Paragraph&&o.type===S.ASTNodeTypes.Paragraph&&P(o)&&B(o)&&P(r)&&B(r)){let a=o.children[o.children.length-1],l=r.children[0],c=a.range[1],m=l.range[0],h=e.slice(c-t,m-t).match(/(\s+)$/),y=o.children.length>0&&r.children.length>0&&h?(()=>{let k=h[1],f=m-k.length;return[{type:S.ASTNodeTypes.Str,raw:k,value:k,loc:{start:i(f),end:l.loc.start},range:[f,m]}]})():[];n[n.length-1]=sa([...o.children,...y,...r.children]);continue}n.push(r)}return n},ia=s=>{if(B(s)){let t=[];for(let n of s.children){if(P(n)){t.push(...ia(n));continue}t.push(n)}s.children=t}if(s.type!=="Marked::ContentBlock")return[s];let e=(B(s)?s.children:[]).filter(t=>!zo(t)).flatMap(Te).filter(P);return na(e)},is=(s,e)=>{let{start:t,end:n}=e,r=s.split(`
|
|
147
|
+
`).slice(t.line-1,n.line),o=r[0].slice(t.column),a=r.slice(1,-1),l=r[r.length-1].slice(0,n.column),c;return t.line===n.line?c=o.slice(0,n.column-t.column):(c=o,a.length>0&&(c+=`
|
|
148
|
+
${a.join(`
|
|
146
149
|
`)}`),c+=`
|
|
147
|
-
${l}`),c},
|
|
148
|
-
`),
|
|
150
|
+
${l}`),c},eh=(s,e)=>{let t=JSON.parse(JSON.stringify(s)),n=a=>{let[l,c]=a.split(":").map(Number);return{line:l,column:c}},i=a=>{let l=a.match(/(?:<span style='color:[^']+'>([^<]+)<\/span>|([^<]+))/);if(!l)throw new Error("Invalid format");return l[1]||l[2]},r=(a,l)=>{let c=a.match(/<(\d+:\d+)~(\d+:\d+)>/);if(!c){if(l!==void 0){if(l.length===0)return{start:{line:1,column:0},end:{line:1,column:0}};let h=l[0],y=l[l.length-1];if(!ge(h)||!ge(y))throw new Error("Cannot extract location: AST node is missing position information");let k=r(h.s,h.c),f=r(y.s,y.c);return{start:k.start,end:f.end}}throw new Error("Invalid format")}let m=n(c[1]),d=n(c[2]);return{start:m,end:d}},o=(a,l=0)=>{let c=f=>{let p=e.split(`
|
|
151
|
+
`),O=0;for(let N=0;N<f.start.line-1;N++)O+=p[N].length+1;return O+=f.start.column,O};if(!ge(a))throw new Error("Cannot calculate offsets: AST node is missing position information");let m=r(a.s,a.c),h=is(e,m).length,y=c(m);if(a.c){let f=y,p=[],O=[];for(let N=0;N<a.c.length;N++){let q=a.c[N];if(f=o(q,f),N<a.c.length-1){let T=a.c[N+1];if(!ge(T))throw new Error("Cannot calculate child positions: AST node is missing position information");let E=q.loc.end.line,v=q.loc.end.column,w=r(T.s,T.c).start.line,u=r(T.s,T.c).start.column;if(E===w&&v!==u){let g={type:"Str",raw:" ".repeat(u-v),value:" ".repeat(u-v),range:[f,f+1],loc:{start:{line:E,column:v},end:{line:w,column:u}}};p.push(g),f+=1}if(E!==w&&!(q.type===S.ASTNodeTypes.Break&&q.raw?.includes(`
|
|
152
|
+
`))&&T.type!==S.ASTNodeTypes.Break){let g={type:"Str",raw:`
|
|
149
153
|
`,value:`
|
|
150
|
-
`,range:[
|
|
151
|
-
`)})}for(let
|
|
152
|
-
`)[
|
|
153
|
-
`):!1,
|
|
154
|
-
|
|
155
|
-
`&&
|
|
156
|
-
`)})}
|
|
157
|
-
|
|
158
|
-
|
|
154
|
+
`,range:[f,f+1],loc:{start:{line:E,column:v},end:{line:w,column:u}}};O.push(g),f+=1}}}a.c=[...a.c,...O,...p].sort((N,q)=>N.range[0]-q.range[0]),a.children=a.c}else a.value=is(e,m);let k=y+h;if(a.raw=is(e,m),a.range=[y,k],a.loc=m,!ge(a))throw new Error("Cannot determine node type: AST node is missing type information");if(a.type=i(a.s),/^Marked::Heading$/.test(a.type)&&(a.type=S.ASTNodeTypes.Header),/^Marked::Text/.test(a.type)&&(a.type=S.ASTNodeTypes.Str),/^Marked::SmartQuote$/.test(a.type)&&(a.type=S.ASTNodeTypes.Str,a.value=a.raw),/^Marked::Parbreak/.test(a.type)&&(a.type=S.ASTNodeTypes.Break),/^Escape::Linebreak/.test(a.type)&&(a.type=S.ASTNodeTypes.Break),/^Escape::/.test(a.type)&&(a.type=S.ASTNodeTypes.Code,a.value=a.raw,B(a)&&Reflect.deleteProperty(a,"children")),/^Marked::(ListItem|EnumItem)$/.test(a.type)&&(a.type=S.ASTNodeTypes.ListItem,a.spread=!1,a.checked=null,B(a))){let f=a.range,p=a.loc,O=a.raw,N=a.children.filter(w=>!["Marked::ListMarker","Marked::EnumMarker"].includes(w.type)),q=[];for(let w of N)q.push(...Te(w));let T=[],E=[];for(let w of q)w.type===S.ASTNodeTypes.ListItem?E.push(w):T.push(w);let v=[];if(T.length>0){let w=T.filter(u=>!(u.type===S.ASTNodeTypes.Str&&u.raw?.trim()===""));if(w.length>0){let u=w[0],g=w[w.length-1];v.push({type:S.ASTNodeTypes.Paragraph,children:w,loc:{start:u.loc.start,end:g.loc.end},range:[u.range[0],g.range[1]],raw:w.map(b=>b.raw).join("")})}}if(E.length>0){let w=E.some(b=>/^\d+\./.test(b.raw?.trim()||"")),u=E[0],g=E[E.length-1];v.push({type:S.ASTNodeTypes.List,ordered:w,start:w?1:null,spread:!1,children:E,loc:{start:u.loc.start,end:g.loc.end},range:[u.range[0],g.range[1]],raw:E.map(b=>b.raw).join(`
|
|
155
|
+
`)})}for(let w of v)if(w.type===S.ASTNodeTypes.Paragraph&&P(w)&&B(w)&&w.children.length>0){let u=w.children[0],g=w.children[w.children.length-1],b=c(u.loc),A=c({start:g.loc.end,end:g.loc.end});w.range=[b,A];for(let L of w.children)if(L.type===S.ASTNodeTypes.Str){let I=c(L.loc),$=c({start:L.loc.end,end:L.loc.end});L.range=[I,$]}}else if(w.type===S.ASTNodeTypes.List&&P(w)&&B(w)&&w.children.length>0){let u=w.children[0],g=w.children[w.children.length-1];u&&g&&(w.range=[u.range[0],g.range[1]])}if(a.children=v,v.length>0){let w=v[0],u=v[v.length-1],g=c(p),b=u.range[1];a.range=[g,b],a.loc={start:p.start,end:u.loc.end},a.raw=is(e,a.loc)}else{let w=c(p),u=w+O.length;a.range=[w,u],a.loc=p,a.raw=O}return Reflect.deleteProperty(a,"s"),Reflect.deleteProperty(a,"c"),a.range[1]}if(a.type==="Marked::Raw"){if(a.loc.start.line===a.loc.end.line)if(a.type=S.ASTNodeTypes.Code,/^```([\s\S]*?)```$/.test(a.raw)){let f=/^```(\w+)?\s([\s\S]*?)\s*```$/,p=a.raw.match(f);a.value=p?p[2].trim():""}else a.value=a.raw.replace(/`([\s\S]*?)`/,"$1");else if(a.type=S.ASTNodeTypes.CodeBlock,a.value=a.raw.replace(/```(?:\w*)\n([\s\S]*?)\n```/,"$1"),B(a)&&a.children.length>1){let f=a.children[1];P(f)&&Z(f.type,/^Marked::RawLang$/)&&Go(f)?a.lang=f.value??null:a.lang=null}else a.lang=null;delete a.children}if(a.type==="Marked::Equation"){let f=a.raw.replace(/^[\s\n]*\$[\s\n]*/,"").replace(/[\s\n]*\$[\s\n]*$/,""),p=e.split(`
|
|
156
|
+
`)[a.loc.start.line-1];p.trim().startsWith("$")&&p.trim().endsWith("$")&&p.trim().length>2&&p.trim().replace(/^\$|\$$/g,"").trim().length>0&&p.trim().replace(/^\$|\$$/g,"").trim().length===f.length?(a.type=S.ASTNodeTypes.CodeBlock,a.value=f):a.loc.start.line===a.loc.end.line?(a.type=S.ASTNodeTypes.Code,a.value=f):(a.type=S.ASTNodeTypes.CodeBlock,a.value=f),delete a.children}if(a.type==="Marked::Link"){a.type=S.ASTNodeTypes.Link,a.title=null,a.url=a.value??"";let f={type:S.ASTNodeTypes.Str,value:a.raw,loc:a.loc,range:a.range,raw:a.raw};a.children=[f],delete a.value}if(a.type==="Marked::Label"&&(a.type=S.ASTNodeTypes.Code,a.value=a.raw,B(a)&&Reflect.deleteProperty(a,"children")),a.type==="Marked::RefMarker"&&(a.type=S.ASTNodeTypes.Code,a.value=a.raw,B(a)&&Reflect.deleteProperty(a,"children")),a.type==="Marked::Ref"&&(a.type=S.ASTNodeTypes.Code,a.value=a.raw,B(a)&&Reflect.deleteProperty(a,"children")),a.type==="Marked::Strong"){a.type=S.ASTNodeTypes.Strong;let f=Wo(a,1);if(f){f.type=S.ASTNodeTypes.Str;let p=Qn(f);f.value=p??"",B(f)&&Reflect.deleteProperty(f,"children")}}if(a.type==="Marked::Emph"){a.type=S.ASTNodeTypes.Emphasis;let f=Wo(a,1);if(f){f.type=S.ASTNodeTypes.Str;let p=Qn(f);f.value=p??"",B(f)&&Reflect.deleteProperty(f,"children")}}return a.type==="Ct::LineComment"&&(a.type=S.ASTNodeTypes.Comment,a.value=a.raw.replace(/^\/\/\s*/,"")),a.type==="Ct::BlockComment"&&(a.type=S.ASTNodeTypes.Comment,a.value=a.raw.replace(/^\/\*\s*/,"").replace(/\s*\*\/$/,"")),Reflect.deleteProperty(a,"s"),Reflect.deleteProperty(a,"c"),k};if(Hf(t)&&t.c.length>0){let a=t.c[0];if(ge(a)&&r(a.s,a.c).start.line===2){let c={s:"<span style='color:#7dcfff'>Marked::Parbreak</span> <1:0~2:0>",type:"Marked::Parbreak",raw:"",range:[0,0],loc:{start:{line:1,column:0},end:{line:1,column:0}}};t.c.unshift(c)}}return ge(t)&&o(t),ia(t),t.type=S.ASTNodeTypes.Document,t},th=s=>{let e=new Set,t=u=>P(u)&&["Kw::Hash","Fn::(Hash: "#")"].includes(u.type),n=u=>P(u)&&u.type==="Punc::Hash",i=u=>n(u)||ta(u),r=u=>u.type===S.ASTNodeTypes.Str||u.type===S.ASTNodeTypes.Break?u.raw.includes(`
|
|
157
|
+
`):!1,o=(u,g)=>g===0?!0:r(u[g-1]),a=u=>{if(!P(u))return;let g=u;if(typeof g.type=="string"){if(g.type.startsWith("Kw::")&&g.type!=="Kw::Hash")return g.type.slice(4).toLowerCase();if(g.type.includes("Ident:")&&typeof g.value=="string")return g.value}if(B(g))for(let b of g.children){let A=a(b);if(A)return A}},l=(u,g)=>{for(let b=g+1;b<u.length;b++){let A=u[b];if(!(A.type===S.ASTNodeTypes.Str&&A.raw.trim()===""))return a(A)}},c=(u,g)=>{if(!t(u[g])||!o(u,g))return!1;let b=l(u,g);return!(b&&e.has(b))},m=u=>{if(!P(u))return 0;let g=u.type;if(typeof g!="string")return 0;switch(g){case"Punc::LeftParen":case"Punc::LeftBracket":case"Punc::LeftBrace":return 1;case"Punc::RightParen":case"Punc::RightBracket":case"Punc::RightBrace":return-1;default:return 0}},d=(u,g)=>{let b=[],A=0,L=g;for(;L<u.length;){let I=u[L];if(b.push(I),L!==g&&(A+=m(I),A<0&&(A=0),A===0&&r(I))){L++;break}L++}return{nodes:b,nextIndex:L}},h=u=>{if(!B(u))return[u];let g=[],b=[],A=()=>{b.length!==0&&(g.push(N([...b])),b.length=0)};for(let L=0;L<u.children.length;L++){let I=u.children[L];if(Wn(I)){A();continue}if(Xo(I)){b.push(I);continue}if(I.type===S.ASTNodeTypes.CodeBlock||I.type===S.ASTNodeTypes.Header){A(),g.push(I);continue}if(c(u.children,L)){A();let{nodes:$,nextIndex:R}=d(u.children,L);g.push(...$),L=R-1;continue}b.push(I)}return A(),g},y=u=>{if(!P(u)||u.type!==S.ASTNodeTypes.ListItem||!B(u))return u;let g=[];for(let b of u.children){if(P(b)&&b.type===S.ASTNodeTypes.Paragraph&&B(b)){g.push(...h(b));continue}g.push(b)}return{...u,children:g}},k=u=>{if(!P(u)||!Z(u.type,/^Marked::TermItem$/)||!B(u))return u;let g=u.children.findIndex(R=>P(R)&&R.type==="Punc::Colon");if(g===-1)return u;let b=u.children.slice(0,g+1),A=g+1;A<u.children.length&&u.children[A].type===S.ASTNodeTypes.Str&&u.children[A].raw?.trim()===""&&(b.push(u.children[A]),A+=1);let L=u.children.slice(A).filter(R=>!(R.type===S.ASTNodeTypes.Str&&R.raw?.trim()==="")).flatMap(Te);if(L.length===0)return u;let I=L.map(R=>structuredClone(R)),$=N(I);return{...u,type:S.ASTNodeTypes.ListItem,spread:!1,checked:null,children:[...b,$]}},f=u=>u.type===S.ASTNodeTypes.Str&&u.raw?.trim()==="",p=u=>P(u)&&Z(u.type,/^Marked::TermItem$/),O=u=>ea(u)||u.type===S.ASTNodeTypes.Paragraph,N=u=>{if(!u||u.length===0)throw new Error("Unexpected empty nodes array");let g=Zo(u);if(g.length===0)throw new Error("Unexpected empty nodes array");let b=g[0],A=g[g.length-1];return{type:S.ASTNodeTypes.Paragraph,children:g,loc:{start:b.loc.start,end:A.loc.end},range:[b.range[0],A.range[1]],raw:g.map(L=>L.raw).join("")}},q=u=>{if(!B(u))return[];let g=[],b=null;for(let L of u.children){if(f(L))continue;let I=p(L);!b||b.isTerm!==I?(b&&g.push(b),b={isTerm:I,nodes:[L]}):b.nodes.push(L)}b&&g.push(b);let A=[];for(let L of g){if(L.isTerm){let $=L.nodes.map(k),R=$[0],Y=$[$.length-1];A.push({type:S.ASTNodeTypes.List,ordered:!1,start:null,spread:!1,children:$,loc:{start:R.loc.start,end:Y.loc.end},range:[R.range[0],Y.range[1]],raw:$.map(os=>os.raw).join(`
|
|
158
|
+
`)});continue}let I=L.nodes.flatMap(Te);I.length!==0&&A.push(N(I))}return A},T=(u,g)=>{let b=[],A=g;for(;A<u.length;){let L=u[A];if(P(L)&&Z(L.type,/^Marked::TermItem$/)){b.push(L),A++;continue}if(L.type===S.ASTNodeTypes.Str&&L.raw===`
|
|
159
|
+
`&&A+1<u.length&&P(u[A+1])&&Z(u[A+1].type,/^Marked::TermItem$/)){A++;continue}break}return{nodes:b,nextIndex:A}},E=s.children,v=[],w=0;for(;w<E.length;){if(c(E,w)){let{nodes:g,nextIndex:b}=d(E,w);v.push(...g),w=b;continue}let u=E[w];if(i(u)){w++;continue}if(P(u)&&Z(u.type,/^Marked::TermItem$/)){let{nodes:g,nextIndex:b}=T(E,w),A=g.map(k),L=A[0],I=A[A.length-1];v.push({type:S.ASTNodeTypes.List,ordered:!1,start:null,spread:!1,children:A,loc:{start:L.loc.start,end:I.loc.end},range:[L.range[0],I.range[1]],raw:A.map($=>$.raw).join(`
|
|
160
|
+
`)}),w=b;continue}if(u.type===S.ASTNodeTypes.ListItem){let g=[y(u)];w++;let b=/^\d+\./.test(u.raw?.trim()||"");for(;w<E.length;){let I=E[w];if(I.type===S.ASTNodeTypes.ListItem){if(/^\d+\./.test(I.raw?.trim()||"")===b){g.push(y(I)),w++;continue}break}if(I.type===S.ASTNodeTypes.Str&&I.raw===`
|
|
161
|
+
`&&w+1<E.length&&E[w+1].type===S.ASTNodeTypes.ListItem&&/^\d+\./.test(E[w+1].raw?.trim()||"")===b){w++;continue}if(I.type===S.ASTNodeTypes.Paragraph&&I.children.length===1&&I.children[0].type===S.ASTNodeTypes.Str&&I.children[0].raw===`
|
|
162
|
+
`&&w+1<E.length&&E[w+1].type===S.ASTNodeTypes.ListItem&&/^\d+\./.test(E[w+1].raw?.trim()||"")===b){w++;continue}break}let A=g[0],L=g[g.length-1];v.push({type:S.ASTNodeTypes.List,ordered:b,start:b?1:null,spread:!1,children:[...g],loc:{start:A.loc.start,end:L.loc.end},range:[A.range[0],L.range[1]],raw:g.map(I=>I.raw).join(`
|
|
163
|
+
`)})}else if(u.type===S.ASTNodeTypes.Paragraph&&u.children.length===1&&u.children[0].type===S.ASTNodeTypes.Str&&u.children[0].raw===`
|
|
164
|
+
`)w++;else{let g=[];if(u.type===S.ASTNodeTypes.Header||u.type===S.ASTNodeTypes.CodeBlock||Wn(u))v.push(u),w++;else{if(u.type===S.ASTNodeTypes.Paragraph&&P(u)&&B(u)){let b=u.children.filter(A=>P(A)&&Z(A.type,/^Marked::EnumItem$/));if(b.length>0){let A=b.map(R=>{let Y=R,os=B(Y)?Y.children.filter(H=>P(H)?!Z(H.type,/^Marked::EnumMarker$/)&&!(H.type===S.ASTNodeTypes.Str&&H.raw?.trim()===""):!1):[],ee=[];for(let H of os){let Xn=Te(H).filter(P);Xn.length>0?ee.push(...Xn):P(H)&&ee.push(H)}let Gn=ee[0],zn=ee[ee.length-1],oa={type:S.ASTNodeTypes.Paragraph,children:ee,loc:{start:Gn?.loc?.start||Y.loc.start,end:zn?.loc?.end||Y.loc.end},range:[Gn?.range?.[0]||Y.range[0],zn?.range?.[1]||Y.range[1]],raw:ee.map(H=>H.raw).join("")};return{type:S.ASTNodeTypes.ListItem,spread:!1,checked:null,children:ee.length>0?[oa]:[],loc:Y.loc,range:Y.range,raw:Y.raw}}),L=A[0],I=A[A.length-1],$={type:S.ASTNodeTypes.List,ordered:!0,start:1,spread:!1,children:A,loc:{start:L.loc.start,end:I.loc.end},range:[L.range[0],I.range[1]],raw:A.map(R=>R.raw).join(`
|
|
165
|
+
`)};v.push($),w++;continue}}if(u.type===S.ASTNodeTypes.Paragraph&&B(u)){v.push(...na(u.children)),w++;continue}if(!O(u)){v.push(u),w++;continue}if(f(u)){w++;continue}for(g.push(u),w++;w<E.length;){let b=E[w];if(i(b)){w++;continue}if(b.type===S.ASTNodeTypes.Header||b.type===S.ASTNodeTypes.CodeBlock||Wn(b)||b.type===S.ASTNodeTypes.ListItem||c(E,w)||!O(b))break;if(g.length===0&&f(b)){w++;continue}if(b.type===S.ASTNodeTypes.Paragraph&&P(b)&&B(b)){for(let A of b.children)g.length===0&&f(A)||g.push(A);w++;continue}g.push(b),w++}if(g.length>0){let b=g[0],A=g[g.length-1];if(["Kw::Hash","Fn::(Hash: "#")"].includes(b.type))v.push(...g);else{let L=(()=>{if(g.length!==1)return;let I=g[0];if(I.type===S.ASTNodeTypes.Paragraph&&!(!P(I)||!B(I))&&I.children.some(p))return I})();if(L){v.push(...q(L));continue}if(g.some(p)){let I={type:S.ASTNodeTypes.Paragraph,children:g,loc:{start:b.loc.start,end:A.loc.end},range:[b.range[0],A.range[1]],raw:g.map($=>$.raw).join("")};v.push(...q(I));continue}v.push(N(g))}}}}}return{...s,children:Zf(v,s.raw,s.range[0])}},ra=async s=>{let e=await Vf(s),t=Jf(e),n=eh(t,s);return th(n)};var rs=class{config;extensions;constructor(e={}){this.config=e,this.extensions=this.config.extensions?this.config.extensions:[]}availableExtensions(){return[".typ"].concat(this.extensions)}processor(e){return{async preProcess(t,n){return await ra(t)},postProcess(t,n){return{messages:t,filePath:n||"<typst>"}}}}};var sh={Processor:rs};
|