typebulb 0.20.4 → 0.21.1
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 +5 -3
- package/dist/agents/claude/client.js +179 -178
- package/dist/agents/claude/styles.css +184 -7
- package/dist/agents/pi/client.js +295 -292
- package/dist/agents/pi/matchu-patchu.ts +2332 -0
- package/dist/agents/pi/styles.css +184 -7
- package/dist/index.js +271 -225
- package/dist/servers.js +119 -110
- package/package.json +4 -2
package/dist/servers.js
CHANGED
|
@@ -1,148 +1,157 @@
|
|
|
1
1
|
import { createRequire as __cr } from 'module'; const require = __cr(import.meta.url);
|
|
2
|
-
var
|
|
3
|
-
`)}};
|
|
4
|
-
`)?
|
|
2
|
+
var ga=Object.create;var ir=Object.defineProperty;var ya=Object.getOwnPropertyDescriptor;var ba=Object.getOwnPropertyNames;var Sa=Object.getPrototypeOf,wa=Object.prototype.hasOwnProperty;var ot=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var g=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports);var va=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ba(e))!wa.call(s,r)&&r!==t&&ir(s,r,{get:()=>e[r],enumerable:!(n=ya(e,r))||n.enumerable});return s};var Aa=(s,e,t)=>(t=s!=null?ga(Sa(s)):{},va(e||!s||!s.__esModule?ir(t,"default",{value:s,enumerable:!0}):t,s));var O=g(q=>{"use strict";var Ss=Symbol.for("yaml.alias"),br=Symbol.for("yaml.document"),lt=Symbol.for("yaml.map"),Sr=Symbol.for("yaml.pair"),ws=Symbol.for("yaml.scalar"),ct=Symbol.for("yaml.seq"),K=Symbol.for("yaml.node.type"),Ga=s=>!!s&&typeof s=="object"&&s[K]===Ss,Ha=s=>!!s&&typeof s=="object"&&s[K]===br,Qa=s=>!!s&&typeof s=="object"&&s[K]===lt,za=s=>!!s&&typeof s=="object"&&s[K]===Sr,wr=s=>!!s&&typeof s=="object"&&s[K]===ws,Xa=s=>!!s&&typeof s=="object"&&s[K]===ct;function vr(s){if(s&&typeof s=="object")switch(s[K]){case lt:case ct:return!0}return!1}function Za(s){if(s&&typeof s=="object")switch(s[K]){case Ss:case lt:case ws:case ct:return!0}return!1}var el=s=>(wr(s)||vr(s))&&!!s.anchor;q.ALIAS=Ss;q.DOC=br;q.MAP=lt;q.NODE_TYPE=K;q.PAIR=Sr;q.SCALAR=ws;q.SEQ=ct;q.hasAnchor=el;q.isAlias=Ga;q.isCollection=vr;q.isDocument=Ha;q.isMap=Qa;q.isNode=Za;q.isPair=za;q.isScalar=wr;q.isSeq=Xa});var Le=g(vs=>{"use strict";var I=O(),M=Symbol("break visit"),Ar=Symbol("skip children"),F=Symbol("remove node");function ut(s,e){let t=kr(e);I.isDocument(s)?me(null,s.contents,t,Object.freeze([s]))===F&&(s.contents=null):me(null,s,t,Object.freeze([]))}ut.BREAK=M;ut.SKIP=Ar;ut.REMOVE=F;function me(s,e,t,n){let r=Nr(s,e,t,n);if(I.isNode(r)||I.isPair(r))return Or(s,n,r),me(s,r,t,n);if(typeof r!="symbol"){if(I.isCollection(e)){n=Object.freeze(n.concat(e));for(let i=0;i<e.items.length;++i){let o=me(i,e.items[i],t,n);if(typeof o=="number")i=o-1;else{if(o===M)return M;o===F&&(e.items.splice(i,1),i-=1)}}}else if(I.isPair(e)){n=Object.freeze(n.concat(e));let i=me("key",e.key,t,n);if(i===M)return M;i===F&&(e.key=null);let o=me("value",e.value,t,n);if(o===M)return M;o===F&&(e.value=null)}}return r}async function ft(s,e){let t=kr(e);I.isDocument(s)?await ge(null,s.contents,t,Object.freeze([s]))===F&&(s.contents=null):await ge(null,s,t,Object.freeze([]))}ft.BREAK=M;ft.SKIP=Ar;ft.REMOVE=F;async function ge(s,e,t,n){let r=await Nr(s,e,t,n);if(I.isNode(r)||I.isPair(r))return Or(s,n,r),ge(s,r,t,n);if(typeof r!="symbol"){if(I.isCollection(e)){n=Object.freeze(n.concat(e));for(let i=0;i<e.items.length;++i){let o=await ge(i,e.items[i],t,n);if(typeof o=="number")i=o-1;else{if(o===M)return M;o===F&&(e.items.splice(i,1),i-=1)}}}else if(I.isPair(e)){n=Object.freeze(n.concat(e));let i=await ge("key",e.key,t,n);if(i===M)return M;i===F&&(e.key=null);let o=await ge("value",e.value,t,n);if(o===M)return M;o===F&&(e.value=null)}}return r}function kr(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 Nr(s,e,t,n){if(typeof t=="function")return t(s,e,n);if(I.isMap(e))return t.Map?.(s,e,n);if(I.isSeq(e))return t.Seq?.(s,e,n);if(I.isPair(e))return t.Pair?.(s,e,n);if(I.isScalar(e))return t.Scalar?.(s,e,n);if(I.isAlias(e))return t.Alias?.(s,e,n)}function Or(s,e,t){let n=e[e.length-1];if(I.isCollection(n))n.items[s]=t;else if(I.isPair(n))s==="key"?n.key=t:n.value=t;else if(I.isDocument(n))n.contents=t;else{let r=I.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}vs.visit=ut;vs.visitAsync=ft});var As=g(Tr=>{"use strict";var Er=O(),tl=Le(),sl={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},nl=s=>s.replace(/[!,[\]{}]/g,e=>sl[e]),Ce=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]+/),r=n.shift();switch(r){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[i,o]=n;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=n;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,o),!1}}default:return t(0,`Unknown directive ${r}`,!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,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}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+nl(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),r;if(e&&n.length>0&&Er.isNode(e.contents)){let i={};tl.visit(e.contents,(o,a)=>{Er.isNode(a)&&a.tag&&(i[a.tag]=!0)}),r=Object.keys(i)}else r=[];for(let[i,o]of n)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(a=>a.startsWith(o)))&&t.push(`%TAG ${i} ${o}`);return t.join(`
|
|
3
|
+
`)}};Ce.defaultYaml={explicit:!1,version:"1.2"};Ce.defaultTags={"!!":"tag:yaml.org,2002:"};Tr.Directives=Ce});var dt=g(Pe=>{"use strict";var Lr=O(),rl=Le();function il(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 Cr(s){let e=new Set;return rl.visit(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function Pr(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}function ol(s,e){let t=[],n=new Map,r=null;return{onAnchor:i=>{t.push(i),r??(r=Cr(s));let o=Pr(e,r);return r.add(o),o},setAnchors:()=>{for(let i of t){let o=n.get(i);if(typeof o=="object"&&o.anchor&&(Lr.isScalar(o.node)||Lr.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=i,a}}},sourceObjects:n}}Pe.anchorIsValid=il;Pe.anchorNames=Cr;Pe.createNodeAnchors=ol;Pe.findNewAnchor=Pr});var ks=g(Ir=>{"use strict";function Ie(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let r=0,i=n.length;r<i;++r){let o=n[r],a=Ie(s,n,String(r),o);a===void 0?delete n[r]:a!==o&&(n[r]=a)}else if(n instanceof Map)for(let r of Array.from(n.keys())){let i=n.get(r),o=Ie(s,n,r,i);o===void 0?n.delete(r):o!==i&&n.set(r,o)}else if(n instanceof Set)for(let r of Array.from(n)){let i=Ie(s,n,r,r);i===void 0?n.delete(r):i!==r&&(n.delete(r),n.add(i))}else for(let[r,i]of Object.entries(n)){let o=Ie(s,n,r,i);o===void 0?delete n[r]:o!==i&&(n[r]=o)}return s.call(e,t,n)}Ir.applyReviver=Ie});var W=g(Mr=>{"use strict";var al=O();function qr(s,e,t){if(Array.isArray(s))return s.map((n,r)=>qr(n,String(r),t));if(s&&typeof s.toJSON=="function"){if(!t||!al.hasAnchor(s))return s.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=i=>{n.res=i,delete t.onCreate};let r=s.toJSON(e,t);return t.onCreate&&t.onCreate(r),r}return typeof s=="bigint"&&!t?.keep?Number(s):s}Mr.toJS=qr});var pt=g(xr=>{"use strict";var ll=ks(),_r=O(),cl=W(),Ns=class{constructor(e){Object.defineProperty(this,_r.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:r,reviver:i}={}){if(!_r.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=cl.toJS(this,"",o);if(typeof r=="function")for(let{count:l,res:c}of o.anchors.values())r(c,l);return typeof i=="function"?ll.applyReviver(i,{"":a},"",a):a}};xr.NodeBase=Ns});var qe=g(Br=>{"use strict";var ul=dt(),fl=Le(),ye=O(),dl=pt(),pl=W(),Os=class extends dl.NodeBase{constructor(e){super(ye.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],fl.visit(e,{Node:(i,o)=>{(ye.isAlias(o)||ye.hasAnchor(o))&&n.push(o)}}),t&&(t.aliasResolveCache=n));let r;for(let i of n){if(i===this)break;i.anchor===this.source&&(r=i)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,o=this.resolve(r,t);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||(pl.toJS(o,null,t),a=n.get(o)),a?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=ht(r,o,n)),a.count*a.aliasCount>i)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(ul.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${r} `}return r}};function ht(s,e,t){if(ye.isAlias(e)){let n=e.resolve(s),r=t&&n&&t.get(n);return r?r.count*r.aliasCount:0}else if(ye.isCollection(e)){let n=0;for(let r of e.items){let i=ht(s,r,t);i>n&&(n=i)}return n}else if(ye.isPair(e)){let n=ht(s,e.key,t),r=ht(s,e.value,t);return Math.max(n,r)}return 1}Br.Alias=Os});var L=g(Es=>{"use strict";var hl=O(),ml=pt(),gl=W(),yl=s=>!s||typeof s!="function"&&typeof s!="object",G=class extends ml.NodeBase{constructor(e){super(hl.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:gl.toJS(this.value,e,t)}toString(){return String(this.value)}};G.BLOCK_FOLDED="BLOCK_FOLDED";G.BLOCK_LITERAL="BLOCK_LITERAL";G.PLAIN="PLAIN";G.QUOTE_DOUBLE="QUOTE_DOUBLE";G.QUOTE_SINGLE="QUOTE_SINGLE";Es.Scalar=G;Es.isScalarValue=yl});var Me=g($r=>{"use strict";var bl=qe(),ne=O(),Rr=L(),Sl="tag:yaml.org,2002:";function wl(s,e,t){if(e){let n=t.filter(i=>i.tag===e),r=n.find(i=>!i.format)??n[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return t.find(n=>n.identify?.(s)&&!n.format)}function vl(s,e,t){if(ne.isDocument(s)&&(s=s.contents),ne.isNode(s))return s;if(ne.isPair(s)){let u=t.schema[ne.MAP].createNode?.(t.schema,null,t);return u.items.push(s),u}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:n,onAnchor:r,onTagObj:i,schema:o,sourceObjects:a}=t,l;if(n&&s&&typeof s=="object"){if(l=a.get(s),l)return l.anchor??(l.anchor=r(s)),new bl.Alias(l.anchor);l={anchor:null,node:null},a.set(s,l)}e?.startsWith("!!")&&(e=Sl+e.slice(2));let c=wl(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let u=new Rr.Scalar(s);return l&&(l.node=u),u}c=s instanceof Map?o[ne.MAP]:Symbol.iterator in Object(s)?o[ne.SEQ]:o[ne.MAP]}i&&(i(c),delete t.onTagObj);let p=c?.createNode?c.createNode(t.schema,s,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,s,t):new Rr.Scalar(s);return e?p.tag=e:c.default||(p.tag=c.tag),l&&(l.node=p),p}$r.createNode=vl});var gt=g(mt=>{"use strict";var Al=Me(),j=O(),kl=pt();function Ts(s,e,t){let n=t;for(let r=e.length-1;r>=0;--r){let i=e[r];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let o=[];o[i]=n,n=o}else n=new Map([[i,n]])}return Al.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 Dr=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,Ls=class extends kl.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=>j.isNode(n)||j.isPair(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Dr(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(j.isCollection(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Ts(this.schema,r,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(j.isCollection(r))return r.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&j.isScalar(i)?i.value:i:j.isCollection(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!j.isPair(t))return!1;let n=t.value;return n==null||e&&j.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 r=this.get(t,!0);return j.isCollection(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let i=this.get(n,!0);if(j.isCollection(i))i.setIn(r,t);else if(i===void 0&&this.schema)this.set(n,Ts(this.schema,r,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}};mt.Collection=Ls;mt.collectionFromPath=Ts;mt.isEmptyPath=Dr});var _e=g(yt=>{"use strict";var Nl=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function Cs(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var Ol=(s,e,t)=>s.endsWith(`
|
|
4
|
+
`)?Cs(t,e):t.includes(`
|
|
5
5
|
`)?`
|
|
6
|
-
`+
|
|
7
|
-
`)t===
|
|
8
|
-
`&&m!==" "){let
|
|
9
|
-
`&&
|
|
10
|
-
${e}${s.slice(0,
|
|
11
|
-
${e}${s.slice(
|
|
12
|
-
`);n=e,
|
|
13
|
-
`){if(
|
|
6
|
+
`+Cs(t,e):(s.endsWith(" ")?"":" ")+t;yt.indentComment=Cs;yt.lineComment=Ol;yt.stringifyComment=Nl});var jr=g(xe=>{"use strict";var El="flow",Ps="block",bt="quoted";function Tl(s,e,t="flow",{indentAtStart:n,lineWidth:r=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!r||r<0)return s;r<i&&(i=0);let l=Math.max(1+i,1+r-e.length);if(s.length<=l)return s;let c=[],p={},u=r-e.length;typeof n=="number"&&(n>r-Math.max(2,i)?c.push(0):u=r-n);let f,m,y=!1,d=-1,h=-1,S=-1;t===Ps&&(d=Fr(s,d,e.length),d!==-1&&(u=d+l));for(let v;v=s[d+=1];){if(t===bt&&v==="\\"){switch(h=d,s[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}S=d}if(v===`
|
|
7
|
+
`)t===Ps&&(d=Fr(s,d,e.length)),u=d+e.length+l,f=void 0;else{if(v===" "&&m&&m!==" "&&m!==`
|
|
8
|
+
`&&m!==" "){let A=s[d+1];A&&A!==" "&&A!==`
|
|
9
|
+
`&&A!==" "&&(f=d)}if(d>=u)if(f)c.push(f),u=f+l,f=void 0;else if(t===bt){for(;m===" "||m===" ";)m=v,v=s[d+=1],y=!0;let A=d>S+1?d-2:h-1;if(p[A])return s;c.push(A),p[A]=!0,u=A+l,f=void 0}else y=!0}m=v}if(y&&a&&a(),c.length===0)return s;o&&o();let w=s.slice(0,c[0]);for(let v=0;v<c.length;++v){let A=c[v],k=c[v+1]||s.length;A===0?w=`
|
|
10
|
+
${e}${s.slice(0,k)}`:(t===bt&&p[A]&&(w+=`${s[A]}\\`),w+=`
|
|
11
|
+
${e}${s.slice(A+1,k)}`)}return w}function Fr(s,e,t){let n=e,r=e+1,i=s[r];for(;i===" "||i===" ";)if(e<r+t)i=s[++e];else{do i=s[++e];while(i&&i!==`
|
|
12
|
+
`);n=e,r=e+1,i=s[r]}return n}xe.FOLD_BLOCK=Ps;xe.FOLD_FLOW=El;xe.FOLD_QUOTED=bt;xe.foldFlowLines=Tl});var Re=g(Kr=>{"use strict";var R=L(),H=jr(),wt=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),vt=s=>/^(%|---|\.\.\.)/m.test(s);function Ll(s,e,t){if(!e||e<0)return!1;let n=e-t,r=s.length;if(r<=n)return!1;for(let i=0,o=0;i<r;++i)if(s[i]===`
|
|
13
|
+
`){if(i-o>n)return!0;if(o=i+1,r-o<=n)return!1}return!0}function Be(s,e){let t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:n}=e,r=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(vt(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 p=t.substr(l+2,4);switch(p){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:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(n||t[l+2]==='"'||t.length<r)l+=1;else{for(o+=t.slice(a,l)+`
|
|
14
14
|
|
|
15
15
|
`;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)o+=`
|
|
16
|
-
`,l+=2;o+=
|
|
17
|
-
`)||/[ \t]\n|\n[ \t]/.test(s))return
|
|
18
|
-
${t}`)+"'";return e.implicitKey?n:
|
|
16
|
+
`,l+=2;o+=i,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,n?o:H.foldFlowLines(o,i,H.FOLD_QUOTED,wt(e,!1))}function Is(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
|
|
17
|
+
`)||/[ \t]\n|\n[ \t]/.test(s))return Be(s,e);let t=e.indent||(vt(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
18
|
+
${t}`)+"'";return e.implicitKey?n:H.foldFlowLines(n,t,H.FOLD_FLOW,wt(e,!1))}function be(s,e){let{singleQuote:t}=e.options,n;if(t===!1)n=Be;else{let r=s.includes('"'),i=s.includes("'");r&&!i?n=Is:i&&!r?n=Be:n=t?Is:Be}return n(s,e)}var qs;try{qs=new RegExp(`(^|(?<!
|
|
19
19
|
))
|
|
20
20
|
+(?!
|
|
21
|
-
|$)`,"g")}catch{
|
|
21
|
+
|$)`,"g")}catch{qs=/\n+(?!\n|$)/g}function St({comment:s,type:e,value:t},n,r,i){let{blockQuote:o,commentString:a,lineWidth:l}=n.options;if(!o||/\n[\t ]+$/.test(t))return be(t,n);let c=n.indent||(n.forceBlockIndent||vt(t)?" ":""),p=o==="literal"?!0:o==="folded"||e===R.Scalar.BLOCK_FOLDED?!1:e===R.Scalar.BLOCK_LITERAL?!0:!Ll(t,l,c.length);if(!t)return p?`|
|
|
22
22
|
`:`>
|
|
23
|
-
`;let u,f;for(f=t.length;f>0;--f){let
|
|
24
|
-
`&&
|
|
25
|
-
`);y===-1?u="-":t===m||y!==m.length-1?(u="+",
|
|
26
|
-
`&&(m=m.slice(0,-1)),m=m.replace(
|
|
27
|
-
`)S=
|
|
28
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),
|
|
29
|
-
${c}${b}`}return t=t.replace(/\n+/g,`$&${c}`),`|${
|
|
30
|
-
${c}${w}${t}${m}`}function
|
|
31
|
-
`)||
|
|
32
|
-
`)?
|
|
33
|
-
`))return
|
|
34
|
-
${l}`);if(o){let f=d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(u),{compat:m,tags:y}=e.doc.schema;if(y.some(f)||m?.some(f))return
|
|
35
|
-
${e.indent}${a}`:a}
|
|
36
|
-
${a}:`):(
|
|
37
|
-
`:"",w){let T=c(w);
|
|
38
|
-
${
|
|
39
|
-
`&&v&&(
|
|
23
|
+
`;let u,f;for(f=t.length;f>0;--f){let k=t[f-1];if(k!==`
|
|
24
|
+
`&&k!==" "&&k!==" ")break}let m=t.substring(f),y=m.indexOf(`
|
|
25
|
+
`);y===-1?u="-":t===m||y!==m.length-1?(u="+",i&&i()):u="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
|
|
26
|
+
`&&(m=m.slice(0,-1)),m=m.replace(qs,`$&${c}`));let d=!1,h,S=-1;for(h=0;h<t.length;++h){let k=t[h];if(k===" ")d=!0;else if(k===`
|
|
27
|
+
`)S=h;else break}let w=t.substring(0,S<h?S+1:h);w&&(t=t.substring(w.length),w=w.replace(/\n+/g,`$&${c}`));let A=(d?c?"2":"1":"")+u;if(s&&(A+=" "+a(s.replace(/ ?[\r\n]+/g," ")),r&&r()),!p){let k=t.replace(/\n+/g,`
|
|
28
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),N=!1,T=wt(n,!0);o!=="folded"&&e!==R.Scalar.BLOCK_FOLDED&&(T.onOverflow=()=>{N=!0});let b=H.foldFlowLines(`${w}${k}${m}`,c,H.FOLD_BLOCK,T);if(!N)return`>${A}
|
|
29
|
+
${c}${b}`}return t=t.replace(/\n+/g,`$&${c}`),`|${A}
|
|
30
|
+
${c}${w}${t}${m}`}function Cl(s,e,t,n){let{type:r,value:i}=s,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:p}=e;if(a&&i.includes(`
|
|
31
|
+
`)||p&&/[[\]{},]/.test(i))return be(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||p||!i.includes(`
|
|
32
|
+
`)?be(i,e):St(s,e,t,n);if(!a&&!p&&r!==R.Scalar.PLAIN&&i.includes(`
|
|
33
|
+
`))return St(s,e,t,n);if(vt(i)){if(l==="")return e.forceBlockIndent=!0,St(s,e,t,n);if(a&&l===c)return be(i,e)}let u=i.replace(/\n+/g,`$&
|
|
34
|
+
${l}`);if(o){let f=d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(u),{compat:m,tags:y}=e.doc.schema;if(y.some(f)||m?.some(f))return be(i,e)}return a?u:H.foldFlowLines(u,l,H.FOLD_FLOW,wt(e,!1))}function Pl(s,e,t,n){let{implicitKey:r,inFlow:i}=e,o=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)}),{type:a}=s;a!==R.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=R.Scalar.QUOTE_DOUBLE);let l=p=>{switch(p){case R.Scalar.BLOCK_FOLDED:case R.Scalar.BLOCK_LITERAL:return r||i?be(o.value,e):St(o,e,t,n);case R.Scalar.QUOTE_DOUBLE:return Be(o.value,e);case R.Scalar.QUOTE_SINGLE:return Is(o.value,e);case R.Scalar.PLAIN:return Cl(o,e,t,n);default:return null}},c=l(a);if(c===null){let{defaultKeyType:p,defaultStringType:u}=e.options,f=r&&p||u;if(c=l(f),c===null)throw new Error(`Unsupported default string type ${f}`)}return c}Kr.stringifyString=Pl});var $e=g(Ms=>{"use strict";var Il=dt(),Q=O(),ql=_e(),Ml=Re();function _l(s,e){let t=Object.assign({blockQuote:!0,commentString:ql.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 xl(s,e){if(e.tag){let r=s.filter(i=>i.tag===e.tag);if(r.length>0)return r.find(i=>i.format===e.format)??r[0]}let t,n;if(Q.isScalar(e)){n=e.value;let r=s.filter(i=>i.identify?.(n));if(r.length>1){let i=r.filter(o=>o.test);i.length>0&&(r=i)}t=r.find(i=>i.format===e.format)??r.find(i=>!i.format)}else n=e,t=s.find(r=>r.nodeClass&&n instanceof r.nodeClass);if(!t){let r=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${r} value`)}return t}function Bl(s,e,{anchors:t,doc:n}){if(!n.directives)return"";let r=[],i=(Q.isScalar(s)||Q.isCollection(s))&&s.anchor;i&&Il.anchorIsValid(i)&&(t.add(i),r.push(`&${i}`));let o=s.tag??(e.default?null:e.tag);return o&&r.push(n.directives.tagString(o)),r.join(" ")}function Rl(s,e,t,n){if(Q.isPair(s))return s.toString(e,t,n);if(Q.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 r,i=Q.isNode(s)?s:e.doc.createNode(s,{onTagObj:l=>r=l});r??(r=xl(e.doc.schema.tags,i));let o=Bl(i,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof r.stringify=="function"?r.stringify(i,e,t,n):Q.isScalar(i)?Ml.stringifyString(i,e,t,n):i.toString(e,t,n);return o?Q.isScalar(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
35
|
+
${e.indent}${a}`:a}Ms.createStringifyContext=_l;Ms.stringify=Rl});var Vr=g(Jr=>{"use strict";var U=O(),Ur=L(),Yr=$e(),De=_e();function $l({key:s,value:e},t,n,r){let{allNullValues:i,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:p,simpleKeys:u}}=t,f=U.isNode(s)&&s.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(U.isCollection(s)||!U.isNode(s)&&typeof s=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let m=!u&&(!s||f&&e==null&&!t.inFlow||U.isCollection(s)||(U.isScalar(s)?s.type===Ur.Scalar.BLOCK_FOLDED||s.type===Ur.Scalar.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(u||!i),indent:a+l});let y=!1,d=!1,h=Yr.stringify(s,t,()=>y=!0,()=>d=!0);if(!m&&!t.inFlow&&h.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(i||e==null)return y&&n&&n(),h===""?"?":m?`? ${h}`:h}else if(i&&!u||e==null&&m)return h=`? ${h}`,f&&!y?h+=De.lineComment(h,t.indent,c(f)):d&&r&&r(),h;y&&(f=null),m?(f&&(h+=De.lineComment(h,t.indent,c(f))),h=`? ${h}
|
|
36
|
+
${a}:`):(h=`${h}:`,f&&(h+=De.lineComment(h,t.indent,c(f))));let S,w,v;U.isNode(e)?(S=!!e.spaceBefore,w=e.commentBefore,v=e.comment):(S=!1,w=null,v=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!m&&!f&&U.isScalar(e)&&(t.indentAtStart=h.length+1),d=!1,!p&&l.length>=2&&!t.inFlow&&!m&&U.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let A=!1,k=Yr.stringify(e,t,()=>A=!0,()=>d=!0),N=" ";if(f||S||w){if(N=S?`
|
|
37
|
+
`:"",w){let T=c(w);N+=`
|
|
38
|
+
${De.indentComment(T,t.indent)}`}k===""&&!t.inFlow?N===`
|
|
39
|
+
`&&v&&(N=`
|
|
40
40
|
|
|
41
|
-
`):
|
|
42
|
-
${t.indent}`}else if(!m&&
|
|
43
|
-
`),C=b!==-1,
|
|
44
|
-
${t.indent}`)}}else(
|
|
45
|
-
`)&&(
|
|
41
|
+
`):N+=`
|
|
42
|
+
${t.indent}`}else if(!m&&U.isCollection(e)){let T=k[0],b=k.indexOf(`
|
|
43
|
+
`),C=b!==-1,J=t.inFlow??e.flow??e.items.length===0;if(C||!J){let ue=!1;if(C&&(T==="&"||T==="!")){let P=k.indexOf(" ");T==="&"&&P!==-1&&P<b&&k[P+1]==="!"&&(P=k.indexOf(" ",P+1)),(P===-1||b<P)&&(ue=!0)}ue||(N=`
|
|
44
|
+
${t.indent}`)}}else(k===""||k[0]===`
|
|
45
|
+
`)&&(N="");return h+=N+k,t.inFlow?A&&n&&n():v&&!A?h+=De.lineComment(h,t.indent,c(v)):d&&r&&r(),h}Jr.stringifyPair=$l});var xs=g(_s=>{"use strict";var Wr=ot("process");function Dl(s,...e){s==="debug"&&console.log(...e)}function Fl(s,e){(s==="debug"||s==="warn")&&(typeof Wr.emitWarning=="function"?Wr.emitWarning(e):console.warn(e))}_s.debug=Dl;_s.warn=Fl});var Ot=g(Nt=>{"use strict";var Fe=O(),Gr=L(),At="<<",kt={identify:s=>s===At||typeof s=="symbol"&&s.description===At,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Gr.Scalar(Symbol(At)),{addToJSMap:Hr}),stringify:()=>At},jl=(s,e)=>(kt.identify(e)||Fe.isScalar(e)&&(!e.type||e.type===Gr.Scalar.PLAIN)&&kt.identify(e.value))&&s?.doc.schema.tags.some(t=>t.tag===kt.tag&&t.default);function Hr(s,e,t){if(t=s&&Fe.isAlias(t)?t.resolve(s.doc):t,Fe.isSeq(t))for(let n of t.items)Bs(s,e,n);else if(Array.isArray(t))for(let n of t)Bs(s,e,n);else Bs(s,e,t)}function Bs(s,e,t){let n=s&&Fe.isAlias(t)?t.resolve(s.doc):t;if(!Fe.isMap(n))throw new Error("Merge sources must be maps or map aliases");let r=n.toJSON(null,s,Map);for(let[i,o]of r)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}Nt.addMergeToJSMap=Hr;Nt.isMergeKey=jl;Nt.merge=kt});var $s=g(Xr=>{"use strict";var Kl=xs(),Qr=Ot(),Ul=$e(),zr=O(),Rs=W();function Yl(s,e,{key:t,value:n}){if(zr.isNode(t)&&t.addToJSMap)t.addToJSMap(s,e,n);else if(Qr.isMergeKey(s,t))Qr.addMergeToJSMap(s,e,n);else{let r=Rs.toJS(t,"",s);if(e instanceof Map)e.set(r,Rs.toJS(n,r,s));else if(e instanceof Set)e.add(r);else{let i=Jl(t,r,s),o=Rs.toJS(n,i,s);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function Jl(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(zr.isNode(s)&&t?.doc){let n=Ul.createStringifyContext(t.doc,{});n.anchors=new Set;for(let i of t.anchors.keys())n.anchors.add(i.anchor);n.inFlow=!0,n.inStringifyKey=!0;let r=s.toString(n);if(!t.mapKeyWarned){let i=JSON.stringify(r);i.length>40&&(i=i.substring(0,36)+'..."'),Kl.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return r}return JSON.stringify(e)}Xr.addPairToJSMap=Yl});var z=g(Ds=>{"use strict";var Zr=Me(),Vl=Vr(),Wl=$s(),Et=O();function Gl(s,e,t){let n=Zr.createNode(s,void 0,t),r=Zr.createNode(e,void 0,t);return new Tt(n,r)}var Tt=class s{constructor(e,t=null){Object.defineProperty(this,Et.NODE_TYPE,{value:Et.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return Et.isNode(t)&&(t=t.clone(e)),Et.isNode(n)&&(n=n.clone(e)),new s(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return Wl.addPairToJSMap(t,n,this)}toString(e,t,n){return e?.doc?Vl.stringifyPair(this,e,t,n):JSON.stringify(this)}};Ds.Pair=Tt;Ds.createPair=Gl});var Fs=g(ti=>{"use strict";var re=O(),ei=$e(),Lt=_e();function Hl(s,e,t){return(e.inFlow??s.flow?zl:Ql)(s,e,t)}function Ql({comment:s,items:e},t,{blockItemPrefix:n,flowChars:r,itemIndent:i,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=t,p=Object.assign({},t,{indent:i,type:null}),u=!1,f=[];for(let y=0;y<e.length;++y){let d=e[y],h=null;if(re.isNode(d))!u&&d.spaceBefore&&f.push(""),Ct(t,f,d.commentBefore,u),d.comment&&(h=d.comment);else if(re.isPair(d)){let w=re.isNode(d.key)?d.key:null;w&&(!u&&w.spaceBefore&&f.push(""),Ct(t,f,w.commentBefore,u))}u=!1;let S=ei.stringify(d,p,()=>h=null,()=>u=!0);h&&(S+=Lt.lineComment(S,i,c(h))),u&&h&&(u=!1),f.push(n+S)}let m;if(f.length===0)m=r.start+r.end;else{m=f[0];for(let y=1;y<f.length;++y){let d=f[y];m+=d?`
|
|
46
46
|
${l}${d}`:`
|
|
47
47
|
`}}return s?(m+=`
|
|
48
|
-
`+
|
|
49
|
-
`))&&(c=!0),u.push(S),
|
|
50
|
-
${
|
|
48
|
+
`+Lt.indentComment(c(s),l),a&&a()):u&&o&&o(),m}function zl({items:s},e,{flowChars:t,itemIndent:n}){let{indent:r,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;n+=i;let l=Object.assign({},e,{indent:n,inFlow:!0,type:null}),c=!1,p=0,u=[];for(let y=0;y<s.length;++y){let d=s[y],h=null;if(re.isNode(d))d.spaceBefore&&u.push(""),Ct(e,u,d.commentBefore,!1),d.comment&&(h=d.comment);else if(re.isPair(d)){let w=re.isNode(d.key)?d.key:null;w&&(w.spaceBefore&&u.push(""),Ct(e,u,w.commentBefore,!1),w.comment&&(c=!0));let v=re.isNode(d.value)?d.value:null;v?(v.comment&&(h=v.comment),v.commentBefore&&(c=!0)):d.value==null&&w?.comment&&(h=w.comment)}h&&(c=!0);let S=ei.stringify(d,l,()=>h=null);y<s.length-1&&(S+=","),h&&(S+=Lt.lineComment(S,n,a(h))),!c&&(u.length>p||S.includes(`
|
|
49
|
+
`))&&(c=!0),u.push(S),p=u.length}let{start:f,end:m}=t;if(u.length===0)return f+m;if(!c){let y=u.reduce((d,h)=>d+h.length+2,2);c=e.options.lineWidth>0&&y>e.options.lineWidth}if(c){let y=f;for(let d of u)y+=d?`
|
|
50
|
+
${i}${r}${d}`:`
|
|
51
51
|
`;return`${y}
|
|
52
|
-
${
|
|
53
|
-
`:" ")}return
|
|
54
|
-
${
|
|
55
|
-
${r.comment}`:n.comment}n=i}s.items[t]=Mt.isPair(n)?n:new Us.Pair(n)}}else e("Expected a sequence for this tag");return s}function ur(s,e,t){let{replacer:n}=t,i=new Nc.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(Us.createPair(a,l,t))}return i}var Ac={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:cr,createNode:ur};_t.createPairs=ur;_t.pairs=Ac;_t.resolvePairs=cr});var Vs=g(Js=>{"use strict";var fr=O(),Ys=J(),Fe=X(),kc=z(),dr=Bt(),ne=class s extends kc.YAMLSeq{constructor(){super(),this.add=Fe.YAMLMap.prototype.add.bind(this),this.delete=Fe.YAMLMap.prototype.delete.bind(this),this.get=Fe.YAMLMap.prototype.get.bind(this),this.has=Fe.YAMLMap.prototype.has.bind(this),this.set=Fe.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=Ys.toJS(i.key,"",t),o=Ys.toJS(i.value,r,t)):r=Ys.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=dr.createPairs(e,t,n),r=new this;return r.items=i.items,r}};ne.tag="tag:yaml.org,2002:omap";var Oc={collection:"seq",identify:s=>s instanceof Map,nodeClass:ne,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=dr.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 ne,t)},createNode:(s,e,t)=>ne.from(s,e,t)};Js.YAMLOMap=ne;Js.omap=Oc});var yr=g(Ws=>{"use strict";var hr=L();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 hr.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 hr.Scalar(!1),stringify:pr};Ws.falseTag=gr;Ws.trueTag=mr});var br=g($t=>{"use strict";var Ec=L(),Gs=be(),Tc={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:Gs.stringifyNumber},Lc={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():Gs.stringifyNumber(s)}},Cc={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 Ec.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:Gs.stringifyNumber};$t.float=Cc;$t.floatExp=Lc;$t.floatNaN=Tc});var wr=g(Ke=>{"use strict";var Sr=be(),je=s=>typeof s=="bigint"||Number.isInteger(s);function Dt(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 Qs(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 Sr.stringifyNumber(s)}var qc={identify:je,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>Dt(s,2,2,t),stringify:s=>Qs(s,2,"0b")},Ic={identify:je,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>Dt(s,1,8,t),stringify:s=>Qs(s,8,"0")},Pc={identify:je,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>Dt(s,0,10,t),stringify:Sr.stringifyNumber},Mc={identify:je,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>Dt(s,2,16,t),stringify:s=>Qs(s,16,"0x")};Ke.int=Pc;Ke.intBin=qc;Ke.intHex=Mc;Ke.intOct=Ic});var Xs=g(Hs=>{"use strict";var Ft=O(),Rt=Q(),xt=X(),ie=class s extends xt.YAMLMap{constructor(e){super(e),this.tag=s.tag}add(e){let t;Ft.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Rt.Pair(e.key,null):t=new Rt.Pair(e,null),xt.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=xt.findPair(this.items,e);return!t&&Ft.isPair(n)?Ft.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=xt.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Rt.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(Rt.createPair(o,null,n));return r}};ie.tag="tag:yaml.org,2002:set";var _c={collection:"map",identify:s=>s instanceof Set,nodeClass:ie,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>ie.from(s,e,t),resolve(s,e){if(Ft.isMap(s)){if(s.hasAllNullValues(!0))return Object.assign(new ie,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};Hs.YAMLSet=ie;Hs.set=_c});var Zs=g(jt=>{"use strict";var Bc=be();function zs(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 vr(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Bc.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 $c={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})=>zs(s,t),stringify:vr},Dc={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=>zs(s,!1),stringify:vr},Nr={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(Nr.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),h=e[8];if(h&&h!=="Z"){let u=zs(h,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};jt.floatTime=Dc;jt.intTime=$c;jt.timestamp=Nr});var Or=g(kr=>{"use strict";var Rc=ge(),xc=Lt(),Fc=ye(),jc=Re(),Kc=Ks(),Ar=yr(),en=br(),Kt=wr(),Uc=wt(),Yc=Vs(),Jc=Bt(),Vc=Xs(),tn=Zs(),Wc=[Rc.map,Fc.seq,jc.string,xc.nullTag,Ar.trueTag,Ar.falseTag,Kt.intBin,Kt.intOct,Kt.int,Kt.intHex,en.floatNaN,en.floatExp,en.float,Kc.binary,Uc.merge,Yc.omap,Jc.pairs,Vc.set,tn.intTime,tn.floatTime,tn.timestamp];kr.schema=Wc});var Br=g(rn=>{"use strict";var Cr=ge(),Gc=Lt(),qr=ye(),Qc=Re(),Hc=_s(),sn=$s(),nn=Rs(),Xc=ir(),zc=ar(),Ir=Ks(),Ue=wt(),Pr=Vs(),Mr=Bt(),Er=Or(),_r=Xs(),Ut=Zs(),Tr=new Map([["core",Xc.schema],["failsafe",[Cr.map,qr.seq,Qc.string]],["json",zc.schema],["yaml11",Er.schema],["yaml-1.1",Er.schema]]),Lr={binary:Ir.binary,bool:Hc.boolTag,float:sn.float,floatExp:sn.floatExp,floatNaN:sn.floatNaN,floatTime:Ut.floatTime,int:nn.int,intHex:nn.intHex,intOct:nn.intOct,intTime:Ut.intTime,map:Cr.map,merge:Ue.merge,null:Gc.nullTag,omap:Pr.omap,pairs:Mr.pairs,seq:qr.seq,set:_r.set,timestamp:Ut.timestamp},Zc={"tag:yaml.org,2002:binary":Ir.binary,"tag:yaml.org,2002:merge":Ue.merge,"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":Ut.timestamp};function eu(s,e,t){let n=Tr.get(e);if(n&&!s)return t&&!n.includes(Ue.merge)?n.concat(Ue.merge):n.slice();let i=n;if(!i)if(Array.isArray(s))i=[];else{let r=Array.from(Tr.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(s))for(let r of s)i=i.concat(r);else typeof s=="function"&&(i=s(i.slice()));return t&&(i=i.concat(Ue.merge)),i.reduce((r,o)=>{let a=typeof o=="string"?Lr[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(Lr).map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}rn.coreKnownTags=Zc;rn.getTags=eu});var ln=g($r=>{"use strict";var on=O(),tu=ge(),su=ye(),nu=Re(),Yt=Br(),iu=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0,an=class s{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Yt.getTags(e,"compat"):e?Yt.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Yt.coreKnownTags:{},this.tags=Yt.getTags(t,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,on.MAP,{value:tu.map}),Object.defineProperty(this,on.SCALAR,{value:nu.string}),Object.defineProperty(this,on.SEQ,{value:su.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?iu:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};$r.Schema=an});var Rr=g(Dr=>{"use strict";var ru=O(),cn=_e(),Ye=qe();function ou(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=cn.createStringifyContext(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");let l=r(s.commentBefore);t.unshift(Ye.indentComment(l,""))}let o=!1,a=null;if(s.contents){if(ru.isNode(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let h=r(s.contents.commentBefore);t.push(Ye.indentComment(h,""))}i.forceBlockIndent=!!s.comment,a=s.contents.comment}let l=a?void 0:()=>o=!0,c=cn.stringify(s.contents,i,()=>a=null,l);a&&(c+=Ye.lineComment(c,"",r(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(cn.stringify(s.contents,i));if(s.directives?.docEnd)if(s.comment){let l=r(s.comment);l.includes(`
|
|
56
|
-
`)?(t.push("..."),t.push(
|
|
52
|
+
${r}${m}`}else return`${f}${o}${u.join(" ")}${o}${m}`}function Ct({indent:s,options:{commentString:e}},t,n,r){if(n&&r&&(n=n.replace(/^\n+/,"")),n){let i=Lt.indentComment(e(n),s);t.push(i.trimStart())}}ti.stringifyCollection=Hl});var Z=g(Ks=>{"use strict";var Xl=Fs(),Zl=$s(),ec=gt(),X=O(),Pt=z(),tc=L();function je(s,e){let t=X.isScalar(e)?e.value:e;for(let n of s)if(X.isPair(n)&&(n.key===e||n.key===t||X.isScalar(n.key)&&n.key.value===t))return n}var js=class extends ec.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(X.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,o=new this(e),a=(l,c)=>{if(typeof i=="function")c=i.call(t,l,c);else if(Array.isArray(i)&&!i.includes(l))return;(c!==void 0||r)&&o.items.push(Pt.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;X.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Pt.Pair(e,e?.value):n=new Pt.Pair(e.key,e.value);let r=je(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw new Error(`Key ${n.key} already set`);X.isScalar(r.value)&&tc.isScalarValue(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let o=this.items.findIndex(a=>i(n,a)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let t=je(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let r=je(this.items,e)?.value;return(!t&&X.isScalar(r)?r.value:r)??void 0}has(e){return!!je(this.items,e)}set(e,t){this.add(new Pt.Pair(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let i of this.items)Zl.addPairToJSMap(t,r,i);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let r of this.items)if(!X.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Xl.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};Ks.YAMLMap=js;Ks.findPair=je});var Se=g(ni=>{"use strict";var sc=O(),si=Z(),nc={collection:"map",default:!0,nodeClass:si.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(s,e){return sc.isMap(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>si.YAMLMap.from(s,e,t)};ni.map=nc});var ee=g(ri=>{"use strict";var rc=Me(),ic=Fs(),oc=gt(),qt=O(),ac=L(),lc=W(),Us=class extends oc.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(qt.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 r=this.items[n];return!t&&qt.isScalar(r)?r.value:r}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 r=this.items[n];qt.isScalar(r)&&ac.isScalarValue(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let i of this.items)n.push(lc.toJS(i,String(r++),t));return n}toString(e,t,n){return e?ic.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof r=="function"){let l=t instanceof Set?a:String(o++);a=r.call(t,l,a)}i.items.push(rc.createNode(a,void 0,n))}}return i}};function It(s){let e=qt.isScalar(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}ri.YAMLSeq=Us});var we=g(oi=>{"use strict";var cc=O(),ii=ee(),uc={collection:"seq",default:!0,nodeClass:ii.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(s,e){return cc.isSeq(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>ii.YAMLSeq.from(s,e,t)};oi.seq=uc});var Ke=g(ai=>{"use strict";var fc=Re(),dc={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),fc.stringifyString(s,e,t,n)}};ai.string=dc});var Mt=g(ui=>{"use strict";var li=L(),ci={identify:s=>s==null,createNode:()=>new li.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new li.Scalar(null),stringify:({source:s},e)=>typeof s=="string"&&ci.test.test(s)?s:e.options.nullStr};ui.nullTag=ci});var Ys=g(di=>{"use strict";var pc=L(),fi={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new pc.Scalar(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&fi.test.test(s)){let n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};di.boolTag=fi});var ve=g(pi=>{"use strict";function hc({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);let r=typeof n=="number"?n:Number(n);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=Object.is(n,-0)?"-0":JSON.stringify(n);if(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}pi.stringifyNumber=hc});var Vs=g(_t=>{"use strict";var mc=L(),Js=ve(),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:Js.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),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():Js.stringifyNumber(s)}},bc={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)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:Js.stringifyNumber};_t.float=bc;_t.floatExp=yc;_t.floatNaN=gc});var Gs=g(Bt=>{"use strict";var hi=ve(),xt=s=>typeof s=="bigint"||Number.isInteger(s),Ws=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function mi(s,e,t){let{value:n}=s;return xt(n)&&n>=0?t+n.toString(e):hi.stringifyNumber(s)}var Sc={identify:s=>xt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>Ws(s,2,8,t),stringify:s=>mi(s,8,"0o")},wc={identify:xt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>Ws(s,0,10,t),stringify:hi.stringifyNumber},vc={identify:s=>xt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>Ws(s,2,16,t),stringify:s=>mi(s,16,"0x")};Bt.int=wc;Bt.intHex=vc;Bt.intOct=Sc});var yi=g(gi=>{"use strict";var Ac=Se(),kc=Mt(),Nc=we(),Oc=Ke(),Ec=Ys(),Hs=Vs(),Qs=Gs(),Tc=[Ac.map,Nc.seq,Oc.string,kc.nullTag,Ec.boolTag,Qs.intOct,Qs.int,Qs.intHex,Hs.floatNaN,Hs.floatExp,Hs.float];gi.schema=Tc});var wi=g(Si=>{"use strict";var Lc=L(),Cc=Se(),Pc=we();function bi(s){return typeof s=="bigint"||Number.isInteger(s)}var Rt=({value:s})=>JSON.stringify(s),Ic=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:Rt},{identify:s=>s==null,createNode:()=>new Lc.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Rt},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:s=>s==="true",stringify:Rt},{identify:bi,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})=>bi(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:Rt}],qc={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},Mc=[Cc.map,Pc.seq].concat(Ic,qc);Si.schema=Mc});var Xs=g(vi=>{"use strict";var Ue=ot("buffer"),zs=L(),_c=Re(),xc={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof Ue.Buffer=="function")return Ue.Buffer.from(s,"base64");if(typeof atob=="function"){let t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let r=0;r<t.length;++r)n[r]=t.charCodeAt(r);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,r,i){if(!t)return"";let o=t,a;if(typeof Ue.Buffer=="function")a=o instanceof Ue.Buffer?o.toString("base64"):Ue.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=zs.Scalar.BLOCK_LITERAL),e!==zs.Scalar.QUOTE_DOUBLE){let l=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/l),p=new Array(c);for(let u=0,f=0;u<c;++u,f+=l)p[u]=a.substr(f,l);a=p.join(e===zs.Scalar.BLOCK_LITERAL?`
|
|
53
|
+
`:" ")}return _c.stringifyString({comment:s,type:e,value:a},n,r,i)}};vi.binary=xc});var Ft=g(Dt=>{"use strict";var $t=O(),Zs=z(),Bc=L(),Rc=ee();function Ai(s,e){if($t.isSeq(s))for(let t=0;t<s.items.length;++t){let n=s.items[t];if(!$t.isPair(n)){if($t.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let r=n.items[0]||new Zs.Pair(new Bc.Scalar(null));if(n.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${n.commentBefore}
|
|
54
|
+
${r.key.commentBefore}`:n.commentBefore),n.comment){let i=r.value??r.key;i.comment=i.comment?`${n.comment}
|
|
55
|
+
${i.comment}`:n.comment}n=r}s.items[t]=$t.isPair(n)?n:new Zs.Pair(n)}}else e("Expected a sequence for this tag");return s}function ki(s,e,t){let{replacer:n}=t,r=new Rc.YAMLSeq(s);r.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(i++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;r.items.push(Zs.createPair(a,l,t))}return r}var $c={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ai,createNode:ki};Dt.createPairs=ki;Dt.pairs=$c;Dt.resolvePairs=Ai});var sn=g(tn=>{"use strict";var Ni=O(),en=W(),Ye=Z(),Dc=ee(),Oi=Ft(),ie=class s extends Dc.YAMLSeq{constructor(){super(),this.add=Ye.YAMLMap.prototype.add.bind(this),this.delete=Ye.YAMLMap.prototype.delete.bind(this),this.get=Ye.YAMLMap.prototype.get.bind(this),this.has=Ye.YAMLMap.prototype.has.bind(this),this.set=Ye.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 r of this.items){let i,o;if(Ni.isPair(r)?(i=en.toJS(r.key,"",t),o=en.toJS(r.value,i,t)):i=en.toJS(r,"",t),n.has(i))throw new Error("Ordered maps must not include duplicate keys");n.set(i,o)}return n}static from(e,t,n){let r=Oi.createPairs(e,t,n),i=new this;return i.items=r.items,i}};ie.tag="tag:yaml.org,2002:omap";var Fc={collection:"seq",identify:s=>s instanceof Map,nodeClass:ie,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=Oi.resolvePairs(s,e),n=[];for(let{key:r}of t.items)Ni.isScalar(r)&&(n.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):n.push(r.value));return Object.assign(new ie,t)},createNode:(s,e,t)=>ie.from(s,e,t)};tn.YAMLOMap=ie;tn.omap=Fc});var Pi=g(nn=>{"use strict";var Ei=L();function Ti({value:s,source:e},t){return e&&(s?Li:Ci).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}var Li={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 Ei.Scalar(!0),stringify:Ti},Ci={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 Ei.Scalar(!1),stringify:Ti};nn.falseTag=Ci;nn.trueTag=Li});var Ii=g(jt=>{"use strict";var jc=L(),rn=ve(),Kc={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:rn.stringifyNumber},Uc={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():rn.stringifyNumber(s)}},Yc={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 jc.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:rn.stringifyNumber};jt.float=Yc;jt.floatExp=Uc;jt.floatNaN=Kc});var Mi=g(Ve=>{"use strict";var qi=ve(),Je=s=>typeof s=="bigint"||Number.isInteger(s);function Kt(s,e,t,{intAsBigInt:n}){let r=s[0];if((r==="-"||r==="+")&&(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 r==="-"?BigInt(-1)*o:o}let i=parseInt(s,t);return r==="-"?-1*i:i}function on(s,e,t){let{value:n}=s;if(Je(n)){let r=n.toString(e);return n<0?"-"+t+r.substr(1):t+r}return qi.stringifyNumber(s)}var Jc={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=>on(s,2,"0b")},Vc={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=>on(s,8,"0")},Wc={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:qi.stringifyNumber},Gc={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=>on(s,16,"0x")};Ve.int=Wc;Ve.intBin=Jc;Ve.intHex=Gc;Ve.intOct=Vc});var ln=g(an=>{"use strict";var Jt=O(),Ut=z(),Yt=Z(),oe=class s extends Yt.YAMLMap{constructor(e){super(e),this.tag=s.tag}add(e){let t;Jt.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&&Jt.isPair(n)?Jt.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:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof r=="function"&&(o=r.call(t,o,o)),i.items.push(Ut.createPair(o,null,n));return i}};oe.tag="tag:yaml.org,2002:set";var Hc={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(Jt.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}};an.YAMLSet=oe;an.set=Hc});var un=g(Vt=>{"use strict";var Qc=ve();function cn(s,e){let t=s[0],n=t==="-"||t==="+"?s.substring(1):s,r=o=>e?BigInt(o):Number(o),i=n.replace(/_/g,"").split(":").reduce((o,a)=>o*r(60)+r(a),r(0));return t==="-"?r(-1)*i:i}function _i(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Qc.stringifyNumber(s);let n="";e<0&&(n="-",e*=t(-1));let r=t(60),i=[e%r];return e<60?i.unshift(0):(e=(e-i[0])/r,i.unshift(e%r),e>=60&&(e=(e-i[0])/r,i.unshift(e))),n+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var zc={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})=>cn(s,t),stringify:_i},Xc={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=>cn(s,!1),stringify:_i},xi={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(xi.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,r,i,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(t,n-1,r,i||0,o||0,a||0,l),p=e[8];if(p&&p!=="Z"){let u=cn(p,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Vt.floatTime=Xc;Vt.intTime=zc;Vt.timestamp=xi});var $i=g(Ri=>{"use strict";var Zc=Se(),eu=Mt(),tu=we(),su=Ke(),nu=Xs(),Bi=Pi(),fn=Ii(),Wt=Mi(),ru=Ot(),iu=sn(),ou=Ft(),au=ln(),dn=un(),lu=[Zc.map,tu.seq,su.string,eu.nullTag,Bi.trueTag,Bi.falseTag,Wt.intBin,Wt.intOct,Wt.int,Wt.intHex,fn.floatNaN,fn.floatExp,fn.float,nu.binary,ru.merge,iu.omap,ou.pairs,au.set,dn.intTime,dn.floatTime,dn.timestamp];Ri.schema=lu});var Gi=g(mn=>{"use strict";var Ki=Se(),cu=Mt(),Ui=we(),uu=Ke(),fu=Ys(),pn=Vs(),hn=Gs(),du=yi(),pu=wi(),Yi=Xs(),We=Ot(),Ji=sn(),Vi=Ft(),Di=$i(),Wi=ln(),Gt=un(),Fi=new Map([["core",du.schema],["failsafe",[Ki.map,Ui.seq,uu.string]],["json",pu.schema],["yaml11",Di.schema],["yaml-1.1",Di.schema]]),ji={binary:Yi.binary,bool:fu.boolTag,float:pn.float,floatExp:pn.floatExp,floatNaN:pn.floatNaN,floatTime:Gt.floatTime,int:hn.int,intHex:hn.intHex,intOct:hn.intOct,intTime:Gt.intTime,map:Ki.map,merge:We.merge,null:cu.nullTag,omap:Ji.omap,pairs:Vi.pairs,seq:Ui.seq,set:Wi.set,timestamp:Gt.timestamp},hu={"tag:yaml.org,2002:binary":Yi.binary,"tag:yaml.org,2002:merge":We.merge,"tag:yaml.org,2002:omap":Ji.omap,"tag:yaml.org,2002:pairs":Vi.pairs,"tag:yaml.org,2002:set":Wi.set,"tag:yaml.org,2002:timestamp":Gt.timestamp};function mu(s,e,t){let n=Fi.get(e);if(n&&!s)return t&&!n.includes(We.merge)?n.concat(We.merge):n.slice();let r=n;if(!r)if(Array.isArray(s))r=[];else{let i=Array.from(Fi.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(s))for(let i of s)r=r.concat(i);else typeof s=="function"&&(r=s(r.slice()));return t&&(r=r.concat(We.merge)),r.reduce((i,o)=>{let a=typeof o=="string"?ji[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(ji).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return i.includes(a)||i.push(a),i},[])}mn.coreKnownTags=hu;mn.getTags=mu});var bn=g(Hi=>{"use strict";var gn=O(),gu=Se(),yu=we(),bu=Ke(),Ht=Gi(),Su=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0,yn=class s{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Ht.getTags(e,"compat"):e?Ht.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=r?Ht.coreKnownTags:{},this.tags=Ht.getTags(t,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,gn.MAP,{value:gu.map}),Object.defineProperty(this,gn.SCALAR,{value:bu.string}),Object.defineProperty(this,gn.SEQ,{value:yu.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Su:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Hi.Schema=yn});var zi=g(Qi=>{"use strict";var wu=O(),Sn=$e(),Ge=_e();function vu(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 r=Sn.createStringifyContext(s,e),{commentString:i}=r.options;if(s.commentBefore){t.length!==1&&t.unshift("");let l=i(s.commentBefore);t.unshift(Ge.indentComment(l,""))}let o=!1,a=null;if(s.contents){if(wu.isNode(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let p=i(s.contents.commentBefore);t.push(Ge.indentComment(p,""))}r.forceBlockIndent=!!s.comment,a=s.contents.comment}let l=a?void 0:()=>o=!0,c=Sn.stringify(s.contents,r,()=>a=null,l);a&&(c+=Ge.lineComment(c,"",i(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(Sn.stringify(s.contents,r));if(s.directives?.docEnd)if(s.comment){let l=i(s.comment);l.includes(`
|
|
56
|
+
`)?(t.push("..."),t.push(Ge.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(Ge.indentComment(i(l),"")))}return t.join(`
|
|
57
57
|
`)+`
|
|
58
|
-
`}
|
|
59
|
-
`),o=a+o}if(/[^ ]/.test(o)){let a=1,l=t.linePos[1];l?.line===n&&l.col>
|
|
58
|
+
`}Qi.stringifyDocument=vu});var He=g(Xi=>{"use strict";var Au=qe(),Ae=gt(),B=O(),ku=z(),Nu=W(),Ou=bn(),Eu=zi(),wn=dt(),Tu=ks(),Lu=Me(),vn=As(),An=class s{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,B.NODE_TYPE,{value:B.DOC});let r=null;typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=i;let{version:o}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new vn.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let e=Object.create(s.prototype,{[B.NODE_TYPE]:{value:B.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=B.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ke(this.contents)&&this.contents.add(e)}addIn(e,t){ke(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=wn.anchorNames(this);e.anchor=!t||n.has(t)?wn.findNewAnchor(t||"a",n):t}return new Au.Alias(e.anchor)}createNode(e,t,n){let r;if(typeof t=="function")e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){let h=w=>typeof w=="number"||w instanceof String||w instanceof Number,S=t.filter(h).map(String);S.length>0&&(t=t.concat(S)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:p}=n??{},{onAnchor:u,setAnchors:f,sourceObjects:m}=wn.createNodeAnchors(this,o||"a"),y={aliasDuplicateObjects:i??!0,keepUndefined:l??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:m},d=Lu.createNode(e,p,y);return a&&B.isCollection(d)&&(d.flow=!0),f(),d}createPair(e,t,n={}){let r=this.createNode(e,null,n),i=this.createNode(t,null,n);return new ku.Pair(r,i)}delete(e){return ke(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ae.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):ke(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return B.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ae.isEmptyPath(e)?!t&&B.isScalar(this.contents)?this.contents.value:this.contents:B.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return B.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Ae.isEmptyPath(e)?this.contents!==void 0:B.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ae.collectionFromPath(this.schema,[e],t):ke(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):ke(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 vn.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new vn.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Ou.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:r,onAnchor:i,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},l=Nu.toJS(this.contents,t??"",a);if(typeof i=="function")for(let{count:c,res:p}of a.anchors.values())i(p,c);return typeof o=="function"?Tu.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 Eu.stringifyDocument(this,e)}};function ke(s){if(B.isCollection(s))return!0;throw new Error("Expected a YAML collection as document contents")}Xi.Document=An});var Xe=g(ze=>{"use strict";var Qe=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},kn=class extends Qe{constructor(e,t,n){super("YAMLParseError",e,t,n)}},Nn=class extends Qe{constructor(e,t,n){super("YAMLWarning",e,t,n)}},Cu=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:n,col:r}=t.linePos[0];t.message+=` at line ${n}, column ${r}`;let i=r-1,o=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){let a=Math.min(i-39,o.length-79);o="\u2026"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(o.substring(0,i))){let a=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
59
|
+
`),o=a+o}if(/[^ ]/.test(o)){let a=1,l=t.linePos[1];l?.line===n&&l.col>r&&(a=Math.max(1,Math.min(l.col-r,80-i)));let c=" ".repeat(i)+"^".repeat(a);t.message+=`:
|
|
60
60
|
|
|
61
61
|
${o}
|
|
62
62
|
${c}
|
|
63
|
-
`}};
|
|
64
|
-
`))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(
|
|
65
|
-
`+d.comment:a.comment=d.comment);continue}(d.newlineAfterProp||
|
|
66
|
-
`+v.comment:w.comment=v.comment);let
|
|
67
|
-
`+
|
|
68
|
-
`+T:b.comment=T,
|
|
69
|
-
`+C.comment:b.comment=C.comment);let
|
|
70
|
-
`+
|
|
71
|
-
`.repeat(Math.max(1,o.length-1)):"",
|
|
72
|
-
`;for(let d=
|
|
73
|
-
`):
|
|
63
|
+
`}};ze.YAMLError=Qe;ze.YAMLParseError=kn;ze.YAMLWarning=Nn;ze.prettifyError=Cu});var Ze=g(Zi=>{"use strict";function Pu(s,{flow:e,indicator:t,next:n,offset:r,onError:i,parentIndent:o,startOnNewline:a}){let l=!1,c=a,p=a,u="",f="",m=!1,y=!1,d=null,h=null,S=null,w=null,v=null,A=null,k=null;for(let b of s)switch(y&&(b.type!=="space"&&b.type!=="newline"&&b.type!=="comma"&&i(b.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),d&&(c&&b.type!=="comment"&&b.type!=="newline"&&i(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),b.type){case"space":!e&&(t!=="doc-start"||n?.type!=="flow-collection")&&b.source.includes(" ")&&(d=b),p=!0;break;case"comment":{p||i(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=b.source.substring(1)||" ";u?u+=f+C:u=C,f="",c=!1;break}case"newline":c?u?u+=b.source:(!A||t!=="seq-item-ind")&&(l=!0):f+=b.source,c=!0,m=!0,(h||S)&&(w=b),p=!0;break;case"anchor":h&&i(b,"MULTIPLE_ANCHORS","A node can have at most one anchor"),b.source.endsWith(":")&&i(b.offset+b.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=b,k??(k=b.offset),c=!1,p=!1,y=!0;break;case"tag":{S&&i(b,"MULTIPLE_TAGS","A node can have at most one tag"),S=b,k??(k=b.offset),c=!1,p=!1,y=!0;break}case t:(h||S)&&i(b,"BAD_PROP_ORDER",`Anchors and tags must be after the ${b.source} indicator`),A&&i(b,"UNEXPECTED_TOKEN",`Unexpected ${b.source} in ${e??"collection"}`),A=b,c=t==="seq-item-ind"||t==="explicit-key-ind",p=!1;break;case"comma":if(e){v&&i(b,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=b,c=!1,p=!1;break}default:i(b,"UNEXPECTED_TOKEN",`Unexpected ${b.type} token`),c=!1,p=!1}let N=s[s.length-1],T=N?N.offset+N.source.length:r;return y&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&i(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d&&(c&&d.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&i(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:A,spaceBefore:l,comment:u,hasNewline:m,anchor:h,tag:S,newlineAfterProp:w,end:T,start:k??T}}Zi.resolveProps=Pu});var Qt=g(eo=>{"use strict";function On(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
|
|
64
|
+
`))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(On(e.key)||On(e.value))return!0}return!1;default:return!0}}eo.containsNewline=On});var En=g(to=>{"use strict";var Iu=Qt();function qu(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)}}to.flowIndentCheck=qu});var Tn=g(no=>{"use strict";var so=O();function Mu(s,e,t){let{uniqueKeys:n}=s.options;if(n===!1)return!1;let r=typeof n=="function"?n:(i,o)=>i===o||so.isScalar(i)&&so.isScalar(o)&&i.value===o.value;return e.some(i=>r(i.key,t))}no.mapIncludes=Mu});var co=g(lo=>{"use strict";var ro=z(),_u=Z(),io=Ze(),xu=Qt(),oo=En(),Bu=Tn(),ao="All mapping items must start at the same column";function Ru({composeNode:s,composeEmptyNode:e},t,n,r,i){let o=i?.nodeClass??_u.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=n.offset,c=null;for(let p of n.items){let{start:u,key:f,sep:m,value:y}=p,d=io.resolveProps(u,{indicator:"explicit-key-ind",next:f??m?.[0],offset:l,onError:r,parentIndent:n.indent,startOnNewline:!0}),h=!d.found;if(h){if(f&&(f.type==="block-seq"?r(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&r(l,"BAD_INDENT",ao)),!d.anchor&&!d.tag&&!m){c=d.end,d.comment&&(a.comment?a.comment+=`
|
|
65
|
+
`+d.comment:a.comment=d.comment);continue}(d.newlineAfterProp||xu.containsNewline(f))&&r(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==n.indent&&r(l,"BAD_INDENT",ao);t.atKey=!0;let S=d.end,w=f?s(t,f,d,r):e(t,S,u,null,d,r);t.schema.compat&&oo.flowIndentCheck(n.indent,f,r),t.atKey=!1,Bu.mapIncludes(t,a.items,w)&&r(S,"DUPLICATE_KEY","Map keys must be unique");let v=io.resolveProps(m??[],{indicator:"map-value-ind",next:y,offset:w.range[2],onError:r,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(l=v.end,v.found){h&&(y?.type==="block-map"&&!v.hasNewline&&r(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&d.start<v.found.offset-1024&&r(w.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let A=y?s(t,y,v,r):e(t,l,m,null,v,r);t.schema.compat&&oo.flowIndentCheck(n.indent,y,r),l=A.range[2];let k=new ro.Pair(w,A);t.options.keepSourceTokens&&(k.srcToken=p),a.items.push(k)}else{h&&r(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(w.comment?w.comment+=`
|
|
66
|
+
`+v.comment:w.comment=v.comment);let A=new ro.Pair(w);t.options.keepSourceTokens&&(A.srcToken=p),a.items.push(A)}}return c&&c<l&&r(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,l,c??l],a}lo.resolveBlockMap=Ru});var fo=g(uo=>{"use strict";var $u=ee(),Du=Ze(),Fu=En();function ju({composeNode:s,composeEmptyNode:e},t,n,r,i){let o=i?.nodeClass??$u.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=n.offset,c=null;for(let{start:p,value:u}of n.items){let f=Du.resolveProps(p,{indicator:"seq-item-ind",next:u,offset:l,onError:r,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?r(f.end,"BAD_INDENT","All sequence items must start at the same column"):r(l,"MISSING_CHAR","Sequence item without - indicator");else{c=f.end,f.comment&&(a.comment=f.comment);continue}let m=u?s(t,u,f,r):e(t,f.end,p,null,f,r);t.schema.compat&&Fu.flowIndentCheck(n.indent,u,r),l=m.range[2],a.items.push(m)}return a.range=[n.offset,l,c??l],a}uo.resolveBlockSeq=ju});var Ne=g(po=>{"use strict";function Ku(s,e,t,n){let r="";if(s){let i=!1,o="";for(let a of s){let{source:l,type:c}=a;switch(c){case"space":i=!0;break;case"comment":{t&&!i&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=l.substring(1)||" ";r?r+=o+p:r=p,o="";break}case"newline":r&&(o+=l),i=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:r,offset:e}}po.resolveEnd=Ku});var yo=g(go=>{"use strict";var Uu=O(),Yu=z(),ho=Z(),Ju=ee(),Vu=Ne(),mo=Ze(),Wu=Qt(),Gu=Tn(),Ln="Block collections are not allowed within flow collections",Cn=s=>s&&(s.type==="block-map"||s.type==="block-seq");function Hu({composeNode:s,composeEmptyNode:e},t,n,r,i){let o=n.start.source==="{",a=o?"flow map":"flow sequence",l=i?.nodeClass??(o?ho.YAMLMap:Ju.YAMLSeq),c=new l(t.schema);c.flow=!0;let p=t.atRoot;p&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let u=n.offset+n.start.source.length;for(let h=0;h<n.items.length;++h){let S=n.items[h],{start:w,key:v,sep:A,value:k}=S,N=mo.resolveProps(w,{flow:a,indicator:"explicit-key-ind",next:v??A?.[0],offset:u,onError:r,parentIndent:n.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!A&&!k){h===0&&N.comma?r(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):h<n.items.length-1&&r(N.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),N.comment&&(c.comment?c.comment+=`
|
|
67
|
+
`+N.comment:c.comment=N.comment),u=N.end;continue}!o&&t.options.strict&&Wu.containsNewline(v)&&r(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0)N.comma&&r(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(N.comma||r(N.start,"MISSING_CHAR",`Missing , between ${a} items`),N.comment){let T="";e:for(let b of w)switch(b.type){case"comma":case"space":break;case"comment":T=b.source.substring(1);break e;default:break e}if(T){let b=c.items[c.items.length-1];Uu.isPair(b)&&(b=b.value??b.key),b.comment?b.comment+=`
|
|
68
|
+
`+T:b.comment=T,N.comment=N.comment.substring(T.length+1)}}if(!o&&!A&&!N.found){let T=k?s(t,k,N,r):e(t,N.end,A,null,N,r);c.items.push(T),u=T.range[2],Cn(k)&&r(T.range,"BLOCK_IN_FLOW",Ln)}else{t.atKey=!0;let T=N.end,b=v?s(t,v,N,r):e(t,T,w,null,N,r);Cn(v)&&r(b.range,"BLOCK_IN_FLOW",Ln),t.atKey=!1;let C=mo.resolveProps(A??[],{flow:a,indicator:"map-value-ind",next:k,offset:b.range[2],onError:r,parentIndent:n.indent,startOnNewline:!1});if(C.found){if(!o&&!N.found&&t.options.strict){if(A)for(let P of A){if(P===C.found)break;if(P.type==="newline"){r(P,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}N.start<C.found.offset-1024&&r(C.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else k&&("source"in k&&k.source?.[0]===":"?r(k,"MISSING_CHAR",`Missing space after : in ${a}`):r(C.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let J=k?s(t,k,C,r):C.found?e(t,C.end,A,null,C,r):null;J?Cn(k)&&r(J.range,"BLOCK_IN_FLOW",Ln):C.comment&&(b.comment?b.comment+=`
|
|
69
|
+
`+C.comment:b.comment=C.comment);let ue=new Yu.Pair(b,J);if(t.options.keepSourceTokens&&(ue.srcToken=S),o){let P=c;Gu.mapIncludes(t,P.items,b)&&r(T,"DUPLICATE_KEY","Map keys must be unique"),P.items.push(ue)}else{let P=new ho.YAMLMap(t.schema);P.flow=!0,P.items.push(ue);let rr=(J??b).range;P.range=[b.range[0],rr[1],rr[2]],c.items.push(P)}u=J?J.range[2]:C.end}}let f=o?"}":"]",[m,...y]=n.end,d=u;if(m?.source===f)d=m.offset+m.source.length;else{let h=a[0].toUpperCase()+a.substring(1),S=p?`${h} must end with a ${f}`:`${h} in block collection must be sufficiently indented and end with a ${f}`;r(u,p?"MISSING_CHAR":"BAD_INDENT",S),m&&m.source.length!==1&&y.unshift(m)}if(y.length>0){let h=Vu.resolveEnd(y,d,t.options.strict,r);h.comment&&(c.comment?c.comment+=`
|
|
70
|
+
`+h.comment:c.comment=h.comment),c.range=[n.offset,d,h.offset]}else c.range=[n.offset,d,d];return c}go.resolveFlowCollection=Hu});var So=g(bo=>{"use strict";var Qu=O(),zu=L(),Xu=Z(),Zu=ee(),ef=co(),tf=fo(),sf=yo();function Pn(s,e,t,n,r,i){let o=t.type==="block-map"?ef.resolveBlockMap(s,e,t,n,i):t.type==="block-seq"?tf.resolveBlockSeq(s,e,t,n,i):sf.resolveFlowCollection(s,e,t,n,i),a=o.constructor;return r==="!"||r===a.tagName?(o.tag=a.tagName,o):(r&&(o.tag=r),o)}function nf(s,e,t,n,r){let i=n.tag,o=i?e.directives.tagName(i.source,f=>r(i,"TAG_RESOLVE_FAILED",f)):null;if(t.type==="block-seq"){let{anchor:f,newlineAfterProp:m}=n,y=f&&i?f.offset>i.offset?f:i:f??i;y&&(!m||m.offset<y.offset)&&r(y,"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(!i||!o||o==="!"||o===Xu.YAMLMap.tagName&&a==="map"||o===Zu.YAMLSeq.tagName&&a==="seq")return Pn(s,e,t,r,o);let l=e.schema.tags.find(f=>f.tag===o&&f.collection===a);if(!l){let f=e.schema.knownTags[o];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),l=f;else return f?r(i,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Pn(s,e,t,r,o)}let c=Pn(s,e,t,r,o,l),p=l.resolve?.(c,f=>r(i,"TAG_RESOLVE_FAILED",f),e.options)??c,u=Qu.isNode(p)?p:new zu.Scalar(p);return u.range=c.range,u.tag=o,l?.format&&(u.format=l.format),u}bo.composeCollection=nf});var qn=g(wo=>{"use strict";var In=L();function rf(s,e,t){let n=e.offset,r=of(e,s.options.strict,t);if(!r)return{value:"",type:null,comment:"",range:[n,n,n]};let i=r.mode===">"?In.Scalar.BLOCK_FOLDED:In.Scalar.BLOCK_LITERAL,o=e.source?af(e.source):[],a=o.length;for(let d=o.length-1;d>=0;--d){let h=o[d][1];if(h===""||h==="\r")a=d;else break}if(a===0){let d=r.chomp==="+"&&o.length>0?`
|
|
71
|
+
`.repeat(Math.max(1,o.length-1)):"",h=n+r.length;return e.source&&(h+=e.source.length),{value:d,type:i,comment:r.comment,range:[n,h,h]}}let l=e.indent+r.indent,c=e.offset+r.length,p=0;for(let d=0;d<a;++d){let[h,S]=o[d];if(S===""||S==="\r")r.indent===0&&h.length>l&&(l=h.length);else{h.length<l&&t(c+h.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(l=h.length),p=d,l===0&&!s.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=h.length+S.length+1}for(let d=o.length-1;d>=a;--d)o[d][0].length>l&&(a=d+1);let u="",f="",m=!1;for(let d=0;d<p;++d)u+=o[d][0].slice(l)+`
|
|
72
|
+
`;for(let d=p;d<a;++d){let[h,S]=o[d];c+=h.length+S.length+1;let w=S[S.length-1]==="\r";if(w&&(S=S.slice(0,-1)),S&&h.length<l){let A=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;t(c-S.length-(w?2:1),"BAD_INDENT",A),h=""}i===In.Scalar.BLOCK_LITERAL?(u+=f+h.slice(l)+S,f=`
|
|
73
|
+
`):h.length>l||S[0]===" "?(f===" "?f=`
|
|
74
74
|
`:!m&&f===`
|
|
75
75
|
`&&(f=`
|
|
76
76
|
|
|
77
|
-
`),u+=f+
|
|
77
|
+
`),u+=f+h.slice(l)+S,f=`
|
|
78
78
|
`,m=!0):S===""?f===`
|
|
79
79
|
`?u+=`
|
|
80
80
|
`:f=`
|
|
81
|
-
`:(u+=f+S,f=" ",m=!1)}switch(
|
|
81
|
+
`:(u+=f+S,f=" ",m=!1)}switch(r.chomp){case"-":break;case"+":for(let d=a;d<o.length;++d)u+=`
|
|
82
82
|
`+o[d][0].slice(l);u[u.length-1]!==`
|
|
83
83
|
`&&(u+=`
|
|
84
84
|
`);break;default:u+=`
|
|
85
|
-
`}let y=n+
|
|
85
|
+
`}let y=n+r.length+e.source.length;return{value:u,type:i,comment:r.comment,range:[n,y,y]}}function of({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:r}=e[0],i=r[0],o=0,a="",l=-1;for(let f=1;f<r.length;++f){let m=r[f];if(!a&&(m==="-"||m==="+"))a=m;else{let y=Number(m);!o&&y?o=y:l===-1&&(l=s+f)}}l!==-1&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,p="",u=r.length;for(let f=1;f<e.length;++f){let m=e[f];switch(m.type){case"space":c=!0;case"newline":u+=m.source.length;break;case"comment":t&&!c&&n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=m.source.length,p=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{let y=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",y);let d=m.source;d&&typeof d=="string"&&(u+=d.length)}}}return{mode:i,indent:o,chomp:a,comment:p,length:u}}function af(s){let e=s.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),i=[n?.[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)i.push([e[o],e[o+1]]);return i}wo.resolveBlockScalar=rf});var _n=g(Ao=>{"use strict";var Mn=L(),lf=Ne();function cf(s,e,t){let{offset:n,type:r,source:i,end:o}=s,a,l,c=(f,m,y)=>t(n+f,m,y);switch(r){case"scalar":a=Mn.Scalar.PLAIN,l=uf(i,c);break;case"single-quoted-scalar":a=Mn.Scalar.QUOTE_SINGLE,l=ff(i,c);break;case"double-quoted-scalar":a=Mn.Scalar.QUOTE_DOUBLE,l=df(i,c);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[n,n+i.length,n+i.length]}}let p=n+i.length,u=lf.resolveEnd(o,p,e,t);return{value:l,type:a,comment:u.comment,range:[n,p,u.offset]}}function uf(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}`),vo(s)}function ff(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),vo(s.slice(1,-1)).replace(/''/g,"'")}function vo(s){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
86
86
|
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
87
|
-
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(s);if(!n)return s;let
|
|
88
|
-
`?i
|
|
89
|
-
`:(i
|
|
90
|
-
`))if(
|
|
91
|
-
`){let{fold:
|
|
92
|
-
`)for(
|
|
93
|
-
`)for(
|
|
87
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(s);if(!n)return s;let r=n[1],i=" ",o=e.lastIndex;for(t.lastIndex=o;n=t.exec(s);)n[1]===""?i===`
|
|
88
|
+
`?r+=i:i=`
|
|
89
|
+
`:(r+=i+n[1],i=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(s),r+i+(n?.[1]??"")}function df(s,e){let t="";for(let n=1;n<s.length-1;++n){let r=s[n];if(!(r==="\r"&&s[n+1]===`
|
|
90
|
+
`))if(r===`
|
|
91
|
+
`){let{fold:i,offset:o}=pf(s,n);t+=i,n=o}else if(r==="\\"){let i=s[++n],o=hf[i];if(o)t+=o;else if(i===`
|
|
92
|
+
`)for(i=s[n+1];i===" "||i===" ";)i=s[++n+1];else if(i==="\r"&&s[n+1]===`
|
|
93
|
+
`)for(i=s[++n+1];i===" "||i===" ";)i=s[++n+1];else if(i==="x"||i==="u"||i==="U"){let a={x:2,u:4,U:8}[i];t+=mf(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(r===" "||r===" "){let i=n,o=s[n+1];for(;o===" "||o===" ";)o=s[++n+1];o!==`
|
|
94
94
|
`&&!(o==="\r"&&s[n+2]===`
|
|
95
|
-
`)&&(t+=n>
|
|
95
|
+
`)&&(t+=n>i?s.slice(i,n+1):r)}else t+=r}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function pf(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`
|
|
96
96
|
`||n==="\r")&&!(n==="\r"&&s[e+2]!==`
|
|
97
97
|
`);)n===`
|
|
98
98
|
`&&(t+=`
|
|
99
|
-
`),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}var
|
|
100
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
99
|
+
`),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}var hf={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
100
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function mf(s,e,t,n){let r=s.substr(e,t),o=r.length===t&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,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)}Ao.resolveFlowScalar=cf});var Oo=g(No=>{"use strict";var ae=O(),ko=L(),gf=qn(),yf=_n();function bf(s,e,t,n){let{value:r,type:i,comment:o,range:a}=e.type==="block-scalar"?gf.resolveBlockScalar(s,e,n):yf.resolveFlowScalar(e,s.options.strict,n),l=t?s.directives.tagName(t.source,u=>n(t,"TAG_RESOLVE_FAILED",u)):null,c;s.options.stringKeys&&s.atKey?c=s.schema[ae.SCALAR]:l?c=Sf(s.schema,r,l,t,n):e.type==="scalar"?c=wf(s,r,e,n):c=s.schema[ae.SCALAR];let p;try{let u=c.resolve(r,f=>n(t??e,"TAG_RESOLVE_FAILED",f),s.options);p=ae.isScalar(u)?u:new ko.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);n(t??e,"TAG_RESOLVE_FAILED",f),p=new ko.Scalar(r)}return p.range=a,p.source=r,i&&(p.type=i),l&&(p.tag=l),c.format&&(p.format=c.format),o&&(p.comment=o),p}function Sf(s,e,t,n,r){if(t==="!")return s[ae.SCALAR];let i=[];for(let a of s.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)i.push(a);else return a;for(let a of i)if(a.test?.test(e))return a;let o=s.knownTags[t];return o&&!o.collection?(s.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[ae.SCALAR])}function wf({atKey:s,directives:e,schema:t},n,r,i){let o=t.tags.find(a=>(a.default===!0||s&&a.default==="key")&&a.test?.test(n))||t[ae.SCALAR];if(t.compat){let a=t.compat.find(l=>l.default&&l.test?.test(n))??t[ae.SCALAR];if(o.tag!==a.tag){let l=e.tagString(o.tag),c=e.tagString(a.tag),p=`Value may be parsed as either ${l} or ${c}`;i(r,"TAG_RESOLVE_FAILED",p,!0)}}return o}No.composeScalar=bf});var To=g(Eo=>{"use strict";function vf(s,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let r=e[n];switch(r.type){case"space":case"comment":case"newline":s-=r.source.length;continue}for(r=e[++n];r?.type==="space";)s+=r.source.length,r=e[++n];break}}return s}Eo.emptyScalarPosition=vf});var Po=g(Bn=>{"use strict";var Af=qe(),kf=O(),Nf=So(),Lo=Oo(),Of=Ne(),Ef=To(),Tf={composeNode:Co,composeEmptyNode:xn};function Co(s,e,t,n){let r=s.atKey,{spaceBefore:i,comment:o,anchor:a,tag:l}=t,c,p=!0;switch(e.type){case"alias":c=Lf(s,e,n),(a||l)&&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":c=Lo.composeScalar(s,e,l,n),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=Nf.composeCollection(Tf,s,e,t,n),a&&(c.anchor=a.source.substring(1));break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",u),c=xn(s,e.offset,void 0,null,t,n),p=!1}}return a&&c.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&s.options.stringKeys&&(!kf.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),s.options.keepSourceTokens&&p&&(c.srcToken=e),c}function xn(s,e,t,n,{spaceBefore:r,comment:i,anchor:o,tag:a,end:l},c){let p={type:"scalar",offset:Ef.emptyScalarPosition(e,t,n),indent:-1,source:""},u=Lo.composeScalar(s,p,a,c);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(u.spaceBefore=!0),i&&(u.comment=i,u.range[2]=l),u}function Lf({options:s},{offset:e,source:t,end:n},r){let i=new Af.Alias(t.substring(1));i.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&r(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=Of.resolveEnd(n,o,s.strict,r);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}Bn.composeEmptyNode=xn;Bn.composeNode=Co});var Mo=g(qo=>{"use strict";var Cf=He(),Io=Po(),Pf=Ne(),If=Ze();function qf(s,e,{offset:t,start:n,value:r,end:i},o){let a=Object.assign({_directives:e},s),l=new Cf.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},p=If.resolveProps(n,{indicator:"doc-start",next:r??i?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(l.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=r?Io.composeNode(c,r,p,o):Io.composeEmptyNode(c,p.end,n,null,p,o);let u=l.contents.range[2],f=Pf.resolveEnd(i,u,!1,o);return f.comment&&(l.comment=f.comment),l.range=[t,u,f.offset],l}qo.composeDoc=qf});var $n=g(Bo=>{"use strict";var Mf=ot("process"),_f=As(),xf=He(),et=Xe(),_o=O(),Bf=Mo(),Rf=Ne();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 xo(s){let e="",t=!1,n=!1;for(let r=0;r<s.length;++r){let i=s[r];switch(i[0]){case"#":e+=(e===""?"":n?`
|
|
101
101
|
|
|
102
102
|
`:`
|
|
103
|
-
`)+(
|
|
104
|
-
${n}`:n;else if(
|
|
105
|
-
${a}`:n}else{let o=
|
|
106
|
-
${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:
|
|
107
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new
|
|
103
|
+
`)+(i.substring(1)||" "),t=!0,n=!1;break;case"%":s[r+1]?.[0]!=="#"&&(r+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var Rn=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,r,i)=>{let o=tt(t);i?this.warnings.push(new et.YAMLWarning(o,n,r)):this.errors.push(new et.YAMLParseError(o,n,r))},this.directives=new _f.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=xo(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
104
|
+
${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(_o.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];_o.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${n}
|
|
105
|
+
${a}`:n}else{let o=i.commentBefore;i.commentBefore=o?`${n}
|
|
106
|
+
${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:xo(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let r of e)yield*this.next(r);yield*this.end(t,n)}*next(e){switch(Mf.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,n,r)=>{let i=tt(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=Bf.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=Rf.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}
|
|
107
|
+
${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),r=new xf.Document(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,t,t],this.decorate(r,!1),yield r}}};Bo.Composer=Rn});var Do=g(zt=>{"use strict";var $f=qn(),Df=_n(),Ff=Xe(),Ro=Re();function jf(s,e=!0,t){if(s){let n=(r,i,o)=>{let a=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(t)t(a,i,o);else throw new Ff.YAMLParseError([a,a+1],i,o)};switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Df.resolveFlowScalar(s,e,n);case"block-scalar":return $f.resolveBlockScalar({options:{strict:e}},s,n)}}return null}function Kf(s,e){let{implicitKey:t=!1,indent:n,inFlow:r=!1,offset:i=-1,type:o="PLAIN"}=e,a=Ro.stringifyString({type:o,value:s},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
108
108
|
`}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
|
|
109
|
-
`),
|
|
110
|
-
`,f=[{type:"block-scalar-header",offset:
|
|
111
|
-
`}),{type:"block-scalar",offset:
|
|
112
|
-
`),n=e.substring(0,t),
|
|
113
|
-
`;if(s.type==="block-scalar"){let
|
|
114
|
-
`});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:
|
|
115
|
-
`};delete s.items,Object.assign(s,{type:t,source:e,end:[
|
|
109
|
+
`),p=a.substring(0,c),u=a.substring(c+1)+`
|
|
110
|
+
`,f=[{type:"block-scalar-header",offset:i,indent:n,source:p}];return $o(f,l)||f.push({type:"newline",offset:-1,indent:n,source:`
|
|
111
|
+
`}),{type:"block-scalar",offset:i,indent:n,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:i,indent:n,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:i,indent:n,source:a,end:l};default:return{type:"scalar",offset:i,indent:n,source:a,end:l}}}function Uf(s,e,t={}){let{afterKey:n=!1,implicitKey:r=!1,inFlow:i=!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=Ro.stringifyString({type:o,value:e},{implicitKey:r||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":Yf(s,l);break;case'"':Dn(s,l,"double-quoted-scalar");break;case"'":Dn(s,l,"single-quoted-scalar");break;default:Dn(s,l,"scalar")}}function Yf(s,e){let t=e.indexOf(`
|
|
112
|
+
`),n=e.substring(0,t),r=e.substring(t+1)+`
|
|
113
|
+
`;if(s.type==="block-scalar"){let i=s.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=n,s.source=r}else{let{offset:i}=s,o="indent"in s?s.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:o,source:n}];$o(a,"end"in s?s.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
114
|
+
`});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:r})}}function $o(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 Dn(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),r=e.length;s.props[0].type==="block-scalar-header"&&(r-=s.props[0].source.length);for(let i of n)i.offset+=r;delete s.props,Object.assign(s,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{let r={type:"newline",offset:s.offset+e.length,indent:s.indent,source:`
|
|
115
|
+
`};delete s.items,Object.assign(s,{type:t,source:e,end:[r]});break}default:{let n="indent"in s?s.indent:-1,r="end"in s&&Array.isArray(s.end)?s.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(s))i!=="type"&&i!=="offset"&&delete s[i];Object.assign(s,{type:t,indent:n,source:e,end:r})}}}zt.createScalarToken=Kf;zt.resolveAsScalar=jf;zt.setScalarValue=Uf});var jo=g(Fo=>{"use strict";var Jf=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 r="";for(let i of s)r+=i.source;if(e&&(r+=Zt(e)),t)for(let i of t)r+=i.source;return n&&(r+=Zt(n)),r}Fo.stringify=Jf});var Jo=g(Yo=>{"use strict";var Fn=Symbol("break visit"),Vf=Symbol("skip children"),Ko=Symbol("remove item");function le(s,e){"type"in s&&s.type==="document"&&(s={start:s.start,value:s.value}),Uo(Object.freeze([]),s,e)}le.BREAK=Fn;le.SKIP=Vf;le.REMOVE=Ko;le.itemAtPath=(s,e)=>{let t=s;for(let[n,r]of e){let i=t?.[n];if(i&&"items"in i)t=i.items[r];else return}return t};le.parentCollection=(s,e)=>{let t=le.itemAtPath(s,e.slice(0,-1)),n=e[e.length-1][0],r=t?.[n];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function Uo(s,e,t){let n=t(e,s);if(typeof n=="symbol")return n;for(let r of["key","value"]){let i=e[r];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){let a=Uo(Object.freeze(s.concat([[r,o]])),i.items[o],t);if(typeof a=="number")o=a-1;else{if(a===Fn)return Fn;a===Ko&&(i.items.splice(o,1),o-=1)}}typeof n=="function"&&r==="key"&&(n=n(e,s))}}return typeof n=="function"?n(e,s):n}Yo.visit=le});var es=g(_=>{"use strict";var jn=Do(),Wf=jo(),Gf=Jo(),Kn="\uFEFF",Un="",Yn="",Jn="",Hf=s=>!!s&&"items"in s,Qf=s=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar");function zf(s){switch(s){case Kn:return"<BOM>";case Un:return"<DOC>";case Yn:return"<FLOW_END>";case Jn:return"<SCALAR>";default:return JSON.stringify(s)}}function Xf(s){switch(s){case Kn:return"byte-order-mark";case Un:return"doc-mode";case Yn:return"flow-error-end";case Jn:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
116
116
|
`:case`\r
|
|
117
|
-
`: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}_.createScalarToken=
|
|
118
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
119
|
-
\r `)
|
|
117
|
+
`: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}_.createScalarToken=jn.createScalarToken;_.resolveAsScalar=jn.resolveAsScalar;_.setScalarValue=jn.setScalarValue;_.stringify=Wf.stringify;_.visit=Gf.visit;_.BOM=Kn;_.DOCUMENT=Un;_.FLOW_END=Yn;_.SCALAR=Jn;_.isCollection=Hf;_.isScalar=Qf;_.prettyToken=zf;_.tokenType=Xf});var Gn=g(Wo=>{"use strict";var st=es();function $(s){switch(s){case void 0:case" ":case`
|
|
118
|
+
`:case"\r":case" ":return!0;default:return!1}}var Vo=new Set("0123456789ABCDEFabcdef"),Zf=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ts=new Set(",[]{}"),ed=new Set(` ,[]{}
|
|
119
|
+
\r `),Vn=s=>!s||ed.has(s),Wn=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===`
|
|
120
120
|
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
121
|
-
`:!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
|
|
122
|
-
`||!
|
|
123
|
-
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")
|
|
124
|
-
`,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]===
|
|
125
|
-
`,this.pos);if(
|
|
126
|
-
`,
|
|
127
|
-
`:e=
|
|
128
|
-
`)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
|
|
129
|
-
`,
|
|
130
|
-
`;)n=this.buffer[++
|
|
131
|
-
`&&
|
|
132
|
-
`?(n+=1,
|
|
133
|
-
`,
|
|
134
|
-
`){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&
|
|
121
|
+
`:!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 r=this.buffer[n+e+1];if(r===`
|
|
122
|
+
`||!r&&!this.atEnd)return e+n+1}return t===`
|
|
123
|
+
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&$(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(`
|
|
124
|
+
`,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 i=e[n-1];if(i===" "||i===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let i=e[t-1];if(i===" "||i===" ")t-=1;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),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==="...")&&$(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&&!$(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===":")&&$(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(Vn),"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 r=this.getLine();if(r===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&r[0]!=="#"||n===0&&(r.startsWith("---")||r.startsWith("..."))&&$(r[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield st.FLOW_END,yield*this.parseLineStart();let i=0;for(;r[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Vn),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||$(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 i=0;for(;this.buffer[t-1-i]==="\\";)i+=1;if(i%2===0)break;t=this.buffer.indexOf('"',t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
|
|
125
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){let i=this.continueScalar(r+1);if(i===-1)break;r=n.indexOf(`
|
|
126
|
+
`,i)}r!==-1&&(t=r-(n[r-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=>$(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let i=this.pos;n=this.buffer[i];++i)switch(n){case" ":t+=1;break;case`
|
|
127
|
+
`:e=i,t=0;break;case"\r":{let o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
128
|
+
`)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 i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
|
|
129
|
+
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===" ";)n=this.buffer[++r];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
130
|
+
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);let a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
|
|
131
|
+
`&&i>=this.pos&&i+1+t>a)e=i;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,r;for(;r=this.buffer[++n];)if(r===":"){let i=this.buffer[n+1];if($(i)||e&&ts.has(i))break;t=n}else if($(r)){let i=this.buffer[n+1];if(r==="\r"&&(i===`
|
|
132
|
+
`?(n+=1,r=`
|
|
133
|
+
`,i=this.buffer[n+1]):t=n),i==="#"||e&&ts.has(i))break;if(r===`
|
|
134
|
+
`){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&ts.has(r))break;t=n}return!r&&!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(Vn))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,t=this.charAt(1);if($(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(;!$(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(Zf.has(t))t=this.buffer[++e];else if(t==="%"&&Vo.has(this.buffer[e+1])&&Vo.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===`
|
|
135
135
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
136
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let
|
|
136
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};Wo.Lexer=Wn});var Qn=g(Go=>{"use strict";var Hn=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 i=t+n>>1;this.lineStarts[i]<e?t=i+1:n=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};Go.LineCounter=Hn});var Xn=g(Zo=>{"use strict";var td=ot("process"),Ho=es(),sd=Gn();function te(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}function Qo(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 Xo(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 Oe(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 zo(s){if(s.start.type==="flow-seq-start")for(let e of s.items)e.sep&&!e.value&&!te(e.start,"explicit-key-ind")&&!te(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Xo(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 zn=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 sd.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,td.env.LOG_TOKENS&&console.log("|",Ho.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Ho.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?.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"&&zo(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let r=n.items[n.items.length-1];if(r.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=t;else{Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=n.items[n.items.length-1];r.value?n.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{let r=n.items[n.items.length-1];!r||r.value?n.items.push({start:[],key:t,sep:[]}):r.sep?r.value=t:Object.assign(r,{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 r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Qo(r.start)===-1&&(t.indent===0||r.start.every(i=>i.type!=="comment"||i.indent<t.indent))&&(n.type==="document"?n.end=r.start:n.items.push({start:r.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":{Qo(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=Oe(t),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
137
137
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
138
|
-
`,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
|
|
138
|
+
`,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 r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(r&&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&&(i=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),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):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(te(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Xo(t.key)&&!te(t.sep,"newline")){let o=Oe(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 i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(te(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Oe(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||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):te(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);r||t.value?(e.items.push({start:i,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){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!te(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:i});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 r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||te(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?.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 r=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,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 r=ss(n),i=Oe(r);zo(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
139
139
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
140
|
-
`,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=
|
|
141
|
-
`),t=0;if(e[t]?.trim()!=="---")return null;t++;let n=[];for(;t<e.length&&e[t]?.trim()!=="---";)n.push(e[t]),t++;if(e[t]?.trim()!=="---")return null;t++;let
|
|
142
|
-
`)),a=t}else t++}return{frontmatter:
|
|
140
|
+
`,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=Oe(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=Oe(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())}}};Zo.Parser=zn});var ra=g(rt=>{"use strict";var ea=$n(),nd=He(),nt=Xe(),rd=xs(),id=O(),od=Qn(),ta=Xn();function sa(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new od.LineCounter||null,prettyErrors:e}}function ad(s,e={}){let{lineCounter:t,prettyErrors:n}=sa(e),r=new ta.Parser(t?.addNewLine),i=new ea.Composer(e),o=Array.from(i.compose(r.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},i.streamInfo())}function na(s,e={}){let{lineCounter:t,prettyErrors:n}=sa(e),r=new ta.Parser(t?.addNewLine),i=new ea.Composer(e),o=null;for(let a of i.compose(r.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 ld(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let r=na(s,t);if(!r)return null;if(r.warnings.forEach(i=>rd.warn(r.options.logLevel,i)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:n},t))}function cd(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 r=Math.round(t);t=r<1?void 0:r>8?{indent:8}:{indent:r}}if(s===void 0){let{keepUndefined:r}=t??e??{};if(!r)return}return id.isDocument(s)&&!n?s.toString(t):new nd.Document(s,n,t).toString(t)}rt.parse=ld;rt.parseAllDocuments=ad;rt.parseDocument=na;rt.stringify=cd});var oa=g(E=>{"use strict";var ud=$n(),fd=He(),dd=bn(),Zn=Xe(),pd=qe(),se=O(),hd=z(),md=L(),gd=Z(),yd=ee(),bd=es(),Sd=Gn(),wd=Qn(),vd=Xn(),ns=ra(),ia=Le();E.Composer=ud.Composer;E.Document=fd.Document;E.Schema=dd.Schema;E.YAMLError=Zn.YAMLError;E.YAMLParseError=Zn.YAMLParseError;E.YAMLWarning=Zn.YAMLWarning;E.Alias=pd.Alias;E.isAlias=se.isAlias;E.isCollection=se.isCollection;E.isDocument=se.isDocument;E.isMap=se.isMap;E.isNode=se.isNode;E.isPair=se.isPair;E.isScalar=se.isScalar;E.isSeq=se.isSeq;E.Pair=hd.Pair;E.Scalar=md.Scalar;E.YAMLMap=gd.YAMLMap;E.YAMLSeq=yd.YAMLSeq;E.CST=bd;E.Lexer=Sd.Lexer;E.LineCounter=wd.LineCounter;E.Parser=vd.Parser;E.parse=ns.parse;E.parseAllDocuments=ns.parseAllDocuments;E.parseDocument=ns.parseDocument;E.stringify=ns.stringify;E.visit=ia.visit;E.visitAsync=ia.visitAsync});import{spawn as ar}from"child_process";import{readdir as Ea,readFile as Ta,writeFile as bp,unlink as ps,mkdir as Sp}from"fs/promises";import{mkdirSync as vp,writeFileSync as Ap,appendFileSync as kp,readFileSync as La}from"fs";import*as x from"path";import{fileURLToPath as Ca}from"url";import{realpathSync as ka}from"fs";import{join as ds,resolve as Na}from"path";import{homedir as Oa}from"os";function at(){let s=process.env.TYPEBULB_SERVERS_DIR;return s?ds(s,".."):ds(Oa(),".typebulb")}function fe(){return process.env.TYPEBULB_SERVERS_DIR||ds(at(),"servers")}function V(s){let e=Na(s),t=e;try{t=ka.native(e)}catch{}return(process.platform==="win32"?t.toLowerCase():t).replace(/\\/g,"/")}function or(s,e){let t=V(s),n=V(e);return t.startsWith(n.endsWith("/")?n:n+"/")?!t.includes("/node_modules/"):!1}function Pa(s){return x.join(fe(),`${s}.json`)}function ms(s){return x.join(fe(),`${s}.log`)}function Ia(s){return x.join(fe(),`${s}.wait.json`)}function qa(s,e=0){try{let t=La(ms(s)),n=e>=0&&e<=t.length?e:0;return{text:t.subarray(n).toString("utf8"),offset:t.length}}catch{return{text:"",offset:0}}}function Ma(s){try{return process.kill(s,0),!0}catch(e){return e.code==="EPERM"}}async function hs(s){await ps(Pa(s)).catch(()=>{}),await ps(ms(s)).catch(()=>{}),await ps(Ia(s)).catch(()=>{})}async function gs(s){let e;try{e=await Ea(fe())}catch{return[]}let t=[];return await Promise.all(e.map(async r=>{if(!/^\d+\.json$/.test(r))return;let i=parseInt(r,10),o;try{o=JSON.parse(await Ta(x.join(fe(),r),"utf8"))}catch{await hs(i);return}o&&typeof o.pid=="number"&&Ma(o.pid)?t.push(o):await hs(i)})),(s?t.filter(r=>r.agent==null&&or(r.file,s)):t).sort((r,i)=>r.startedAt-i.startedAt)}async function lr(s){try{process.kill(s,"SIGTERM")}catch{}await hs(s)}function cr(s,e){let t=V(e);return s.filter(n=>n.agent==null&&n.pid!==process.pid&&V(n.file)===t)}async function _a(s){let e=cr(await gs(),s);for(let t of e)await lr(t.pid);return e}var xa=s=>new Promise(e=>setTimeout(e,s));function Ba(s,e,t){(process.platform==="win32"?ar("cmd",["/c","start","","/b",s,...e],{cwd:t,stdio:"ignore",windowsHide:!0}):ar(s,e,{cwd:t,detached:!0,stdio:"ignore"})).unref()}function Ra(){return x.join(x.dirname(Ca(import.meta.url)),"index.js")}function $a(s,e={}){return{command:process.execPath,args:[Ra(),...e.trust?["--trust"]:[],s,...e.open===!1?["--no-open"]:[]]}}async function Da(s,e,t,n){let r=await s();if(r)return r;Ba(e.command,e.args,t);let i=Date.now()+2e4;for(;Date.now()<i;){await xa(150);let o=await s();if(o)return o}throw new Error(`Launched ${n} but it did not register within 20s.`)}async function Fa(s,e={}){let t=e.cwd??process.cwd(),n=x.resolve(t,s);return await _a(n),Da(async()=>cr(await gs(),n)[0],$a(s,e),t,x.basename(s))}import{readdirSync as Od,readFileSync as Ed,statSync as Td}from"fs";import{join as la,basename as Ld}from"path";var de={code:{path:"code.tsx",language:"typescript"},css:{path:"styles.css",language:"css"},html:{path:"index.html",language:"html"},config:{path:"config.json",language:"json"},notes:{path:"notes.md",language:"markdown"},data:{path:"data.txt",language:"text"},infer:{path:"infer.md",language:"markdown"},insight:{path:"insight.json",language:"json"}},pe=["code","css","html","data","infer","insight","config","notes"];function ur(s){return pe.find(e=>de[e].path===s)}var fr="typebulb/v1";function dr(s){return!!s?.startsWith("typebulb")}function ys(s){return/[:\n"']/.test(s)||s.startsWith(" ")||s.endsWith(" ")?`"${s.replace(/"/g,'\\"')}"`:s}function bs(s){return s.startsWith('"')&&s.endsWith('"')?s.slice(1,-1).replace(/\\"/g,'"'):s.startsWith("'")&&s.endsWith("'")?s.slice(1,-1):s}var pr=/^\*\*(.+)\*\*$/,hr=/^(`{3,})(\w*)\s*$/,ja=new Set(pe.map(s=>de[s].path));function he(s){try{let e=s.split(`
|
|
141
|
+
`),t=0;if(e[t]?.trim()!=="---")return null;t++;let n=[];for(;t<e.length&&e[t]?.trim()!=="---";)n.push(e[t]),t++;if(e[t]?.trim()!=="---")return null;t++;let r=Ya(n);if(!r)return null;let i=new Map,o=[],a=t;for(;t<e.length;){let c=e[t]?.trim()?.match(pr);if(c){let p=c[1].trim();for(t++;t<e.length&&e[t]?.trim()==="";)t++;let u=e[t]?.match(hr);if(!u){t++;continue}let f=u[1];t++;let m=[];for(;t<e.length&&!e[t]?.match(new RegExp(`^${f}\\s*$`));)m.push(e[t]),t++;let y=t<e.length;t++,o.push(...Ka(p,m,y)),i.set(p,m.join(`
|
|
142
|
+
`)),a=t}else t++}return{frontmatter:r,files:i,warnings:o,bodyEndLine:a}}catch{return null}}function Ka(s,e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r]?.trim().match(pr);i&&ja.has(i[1].trim())&&Ua(e,r)&&n.push(i[1].trim())}return n.length?n.map(r=>`**${s}** block has an unterminated code fence \u2014 it swallowed the **${r}** block.`):t?[]:[`**${s}** block has an unterminated code fence (it runs to the end of the file).`]}function Ua(s,e){let t=e+1;for(;t<s.length&&s[t]?.trim()==="";)t++;return!!s[t]?.match(hr)}function Ya(s){let e={};for(let t of s){let n=t.indexOf(":");if(n===-1)continue;let r=t.slice(0,n).trim(),i=t.slice(n+1).trim();switch(r){case"format":e.format=i;break;case"name":e.name=bs(i);break}}return!dr(e.format)||!e.name?null:e}function mr(s){let e=Object.fromEntries(pe.map(t=>[t,s.files.get(de[t].path)||""]));return{name:s.frontmatter.name,...e}}function Ja(s){let e=s.match(/^`{3,}/gm),t=e?Math.max(...e.map(n=>n.length)):0;return"`".repeat(Math.max(3,t+1))}function gr(s){let e=pe.filter(t=>s[t]).map(t=>{let{path:n}=de[t],r=s[t],i=n.split(".").pop(),o=Ja(r);return`**${n}**
|
|
143
143
|
|
|
144
|
-
${o}${
|
|
145
|
-
${
|
|
146
|
-
${o}`});return["---",`format: ${
|
|
147
|
-
`)}var
|
|
148
|
-
`)).map(e=>e.root)}function
|
|
144
|
+
${o}${i}
|
|
145
|
+
${r}
|
|
146
|
+
${o}`});return["---",`format: ${fr}`,`name: ${ys(s.name)}`,"---","",...e].join(`
|
|
147
|
+
`)}var Ad=Aa(oa(),1);function rs(s){return{...mr(s),server:s.files.get("server.ts")??""}}function aa(s){return!!s.server&&!s.code}function is(s){let e=/^---[^\n]*\n([\s\S]*?)\n---/.exec(s),t=e?/^\s*name:\s*(.+?)\s*$/m.exec(e[1]):null;return t?t[1].replace(/^["']|["']$/g,""):void 0}function kd(s){return(is(s)??"bulb").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"bulb"}function Nd(s){return s.replace(/^---[^\n]*\r?\n[\s\S]*?\r?\n---[^\n]*\r?\n?/,"").replace(/^\r?\n+/,"")}function ca(s,e,t){if(e>8)return t;let n;try{n=Od(s,{withFileTypes:!0})}catch{return t}for(let r of n)if(r.isDirectory()){if(r.name.startsWith(".")||r.name==="node_modules")continue;ca(la(s,r.name),e+1,t)}else r.isFile()&&r.name.endsWith(".bulb.md")&&t.push(la(s,r.name));return t}function Cd(s){return ca(s,0,[]).map(e=>{let t=0;try{t=Td(e).mtimeMs}catch{}let n,r=!1;try{let i=Ed(e,"utf8");n=is(i.slice(0,1024));let o=he(i);r=!!o&&aa(rs(o))}catch{}return{path:e,name:n??Ld(e).replace(/\.bulb\.md$/,""),mtime:t,serverOnly:r}})}import{readFile as Pd}from"fs/promises";function ua(s){if(s.server.trim())return"server-side code (server.ts)";let e=s.code;if(/\btb\s*\.\s*fs\b/.test(e)||e.includes("/__fs"))return"the filesystem";if(/\btb\s*\.\s*ai\b/.test(e)||e.includes("/__ai"))return"AI (your API keys)";if(/\btb\s*\.\s*server\s*\.\s*(?!log\b)\w/.test(e)||e.includes("/__api"))return"server-side code (server.ts)"}async function Id(s){try{let e=he(await Pd(s,"utf-8"));return e?ua(rs(e)):void 0}catch{return}}var qd=[/\bimport\s+(?:[^'";]*?from\s*)?['"]([^'"]+)['"]/g,/\bexport\s+[^'";]*?from\s*['"]([^'"]+)['"]/g];function Md(s){if(/^[./]/.test(s)||/^[a-z][a-z0-9+.-]*:/i.test(s))return null;let e=s.split("/");return s.startsWith("@")?e.slice(0,2).join("/"):e[0]}function _d(s){let e=[],t=new Set;for(let n=0;n<s.length;n++)for(let r of qd)for(let i of s[n].matchAll(r)){let o=Md(i[1]);o&&!t.has(o)&&(t.add(o),e.push({root:o,lineIndex:n}))}return e}function fa(s){return _d(s.split(`
|
|
148
|
+
`)).map(e=>e.root)}function xd(s){let e=he(s);if(!e)return s;let t=e.files.get("code.tsx");if(!t)return s;let n=fa(t);if(!n.length)return s;let r=e.files.get("config.json"),i={};if(r)try{let c=JSON.parse(r);c&&typeof c=="object"&&(i=c)}catch{}let o=i.dependencies&&typeof i.dependencies=="object"?{...i.dependencies}:{},a=n.filter(c=>!(c in o));if(!a.length)return s;for(let c of a)o[c]="latest";i.dependencies=o;let l={name:e.frontmatter.name};for(let[c,p]of e.files){let u=ur(c);u&&(l[u]=p)}return l.config=JSON.stringify(i,null,2),gr(l)}import{spawn as da}from"child_process";import{basename as Bd}from"path";function Rd(){return process.env.TYPEBULB_EDITOR||"code"}var $d=/^(code|code-insiders|codium|vscodium|cursor|windsurf)(\.cmd|\.exe)?$/i;function Dd(s,e,t){return t==null?[e]:$d.test(Bd(s))?["-g",`${e}:${t}`]:[`+${t}`,e]}function Fd(s,e){let t=Rd();return{command:t,args:Dd(t,s,e)}}function jd(s,e){let{command:t,args:n}=Fd(s,e),r=process.platform==="win32"?da("cmd.exe",["/d","/s","/c",t,...n],{detached:!0,stdio:"ignore",windowsHide:!0}):da(t,n,{detached:!0,stdio:"ignore"});r.on("error",i=>console.error("[typebulb] editor launch failed:",i?.message??i)),r.unref()}import{readFileSync as Kd,writeFileSync as Ud,mkdirSync as Yd}from"fs";import{join as Jd}from"path";function pa(){return Jd(at(),"trust.json")}function er(){try{let s=JSON.parse(Kd(pa(),"utf8"));return new Set(Array.isArray(s)?s:[])}catch{return new Set}}function Vd(s){Yd(at(),{recursive:!0}),Ud(pa(),JSON.stringify([...s]))}function Wd(s){return er().has(V(s))}function Gd(s,e){let t=er(),n=V(s);(e?t.has(n):!t.has(n))||(e?t.add(n):t.delete(n),Vd(t))}function Hd(){return[...er()]}var tr={anthropic:"ANTHROPIC_API_KEY",openai:"OPENAI_API_KEY",gemini:"GOOGLE_API_KEY",openrouter:"OPENROUTER_API_KEY"};function sr(s){return(s.includes("://")?s:`http://${s}`).replace(/\/+$/,"")}var Qd="https://api.typebulb.com/api/models",zd=1440*60*1e3,Xd=60*1e3,Ee=null,os=null;async function Zd(){let[s,e]=await Promise.all([tp(),ep()]);return[...sp(e),...s]}async function ep(){if(Ee&&Date.now()-Ee.fetchedAt<=zd)return Ee.models;let s=await fetch(Qd).catch(()=>null);return!s||!s.ok?Ee?.models??[]:(Ee={models:await s.json(),fetchedAt:Date.now()},Ee.models)}async function tp(){if(os&&Date.now()-os.fetchedAt<=Xd)return os.models;let s=sr(process.env.OLLAMA_HOST??"http://localhost:11434"),e=[];try{let t=await fetch(new URL("/api/tags",s).toString());t.ok&&(e=((await t.json()).models??[]).map(r=>r.name).filter(r=>!!r).map(r=>({provider:"ollama",name:r,friendlyName:r,providerName:"Ollama"})))}catch{}return os={models:e,fetchedAt:Date.now()},e}function sp(s){let e=new Set(Object.entries(tr).filter(([,t])=>!!process.env[t]).map(([t])=>t));return s.filter(t=>e.has(t.provider))}var Y=class extends Error{constructor(e,t="unknown",n=!1){super(e),this.code=t,this.retryable=n}},D=class{getPath(e,t){return this.path}parseError(e,t){return this.parseJsonError(e,t)}parseStreamChunk(e){return this.checkAndThrowError(e),this.parseProviderStreamChunk(e)}extractSystemMessages(e,t=`
|
|
149
|
+
|
|
150
|
+
`){let n=e.filter(r=>r.role==="system").map(r=>r.content);return{system:n.length?n.join(t):void 0,conversationMessages:e.filter(r=>r.role!=="system")}}parseJsonError(e,t){if(!e)return{message:`HTTP ${t}`};try{let n=JSON.parse(e);return n.error&&typeof n.error=="object"?{message:n.error.message||`HTTP ${t}`,type:n.error.type}:n.message?{message:n.message}:{message:e}}catch{return{message:e}}}checkAndThrowError(e){if(typeof e!="object"||e===null)return;let t=e;if(t.type==="error"&&"message"in t){let n=t.code||"unknown";throw new Y(t.message,n,!!t.retryable)}if(t.error)throw new Y(this.extractErrorMessage(t.error))}extractErrorMessage(e){if(typeof e=="string")try{let t=JSON.parse(e);return t.error?.message||t.message||e}catch{return e}return typeof e=="object"&&e!==null?e.message||JSON.stringify(e):`${this.providerName} returned an error`}};var as=class extends D{constructor(){super(...arguments),this.providerName="OpenAI",this.defaultBaseUrl="https://api.openai.com",this.path="/v1/responses",this.effortMap={0:"none",1:"low",2:"medium",3:"high"}}buildHeaders(e){return{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"}}buildPayload(e,t,n,r){let i=this.convertMessagesToInput(e),o={model:t,input:i,stream:r};if(n?.webSearch!==!1&&(o.tools=[{type:"web_search"}]),n?.effort!==void 0){let a=this.effortMap[n.effort];o.reasoning=a==="none"?{effort:a}:{effort:a,summary:"auto"}}return o}parseNonStreamingResponse(e){if(!this.isResponsesApiResponse(e))return{text:""};let t=e.output_text||"",n;if(e.output&&Array.isArray(e.output))for(let r of e.output)r.type==="reasoning"&&r.summary&&(n=r.summary.map(i=>i.text).join(`
|
|
151
|
+
`)),!t&&r.type==="message"&&r.content&&(t=r.content.filter(i=>i.type==="output_text").map(i=>i.text).join(""));return{text:t,reasoning:n}}parseProviderStreamChunk(e){if(!this.isResponsesApiEvent(e))return null;switch(e.type){case"response.failed":{let n=e.response?.error,r=n?.message||"Response failed",i=n?.code==="insufficient_quota"||n?.code==="rate_limit_exceeded";throw new Y(r,i?"rate_limit":"unknown",i)}case"response.output_text.delta":return{text:e.delta};case"response.reasoning_summary_text.delta":return{reasoning:e.delta};default:return null}}convertMessagesToInput(e){return e.map(t=>t.role==="system"?`System: ${t.content}`:t.role==="user"?`User: ${t.content}`:t.role==="assistant"?`Assistant: ${t.content}`:t.content).join(`
|
|
152
|
+
|
|
153
|
+
`)}isResponsesApiEvent(e){return typeof e=="object"&&e!==null&&"type"in e&&typeof e.type=="string"}isResponsesApiResponse(e){return typeof e=="object"&&e!==null&&e.object==="response"}};var Te=class extends D{parseNonStreamingResponse(e){if(!this.hasChoices(e))return{text:""};let t=e,n=t.choices[0],r=n?.message,i=r?.content??n?.text??"",o=r?.reasoning??r?.reasoning_content??t.reasoning;return{text:i,reasoning:o}}parseProviderStreamChunk(e){if(!this.hasChoices(e))return null;let t=e.choices[0];if(!t)return null;let n=t.delta||t.message;if(!n)return null;let r=n.content||void 0,i=n.reasoning||n.reasoning_content||void 0;return!r&&!i?null:{text:r,reasoning:i}}hasChoices(e){return typeof e=="object"&&e!==null&&"choices"in e&&Array.isArray(e.choices)}};var ls=class extends Te{constructor(){super(...arguments),this.providerName="OpenRouter",this.defaultBaseUrl="https://openrouter.ai",this.path="/api/v1/chat/completions",this.effortMap={0:"none",1:"low",2:"medium",3:"high"}}buildHeaders(e,t){let n={Authorization:`Bearer ${e}`,"x-api-key":e,"Content-Type":"application/json",Accept:"application/json","X-Title":"Typebulb"};return t&&(n["HTTP-Referer"]=t,n.Referer=t,n.Origin=t),n}buildPayload(e,t,n,r){let i={model:t,messages:e,stream:r};n?.webSearch===!0&&(i.plugins=[{id:"web"}]);let o=n?.effort;return o!==void 0&&(i.reasoning={effort:this.effortMap[o]}),i}};var cs=class extends D{constructor(){super(...arguments),this.providerName="Anthropic",this.defaultBaseUrl="https://api.anthropic.com",this.path="/v1/messages"}buildHeaders(e){return{"x-api-key":e,"anthropic-version":"2023-06-01","Content-Type":"application/json",Accept:"application/json"}}buildPayload(e,t,n,r){let{system:i,conversationMessages:o}=this.extractSystemMessages(e),a={model:t,max_tokens:this.getMaxTokens(t),messages:this.withLastMessageCached(o),stream:r};n?.webSearch!==!1&&(a.tools=[{type:"web_search_20250305",name:"web_search"}]),i&&(a.system=[{type:"text",text:i,cache_control:{type:"ephemeral"}}]);let l=n?.effort;if(l!==void 0){if(this.isModernModel(t))if(l===0)a.output_config={effort:"low"};else{let c={1:"low",2:"medium",3:"high"};a.thinking={type:"adaptive",display:"summarized"},a.output_config={effort:c[l]}}else if(l!==0){let c={1:2048,2:4096,3:8192};a.thinking={type:"enabled",budget_tokens:c[l]}}}return a}parseNonStreamingResponse(e){if(!this.isAnthropicResponse(e))return{text:""};let t=e.content.filter(r=>r.type==="text").map(r=>r.text).join(""),n=e.content.filter(r=>r.type==="thinking").map(r=>r.thinking).join(`
|
|
154
|
+
|
|
155
|
+
`);return{text:t,reasoning:n||void 0}}parseProviderStreamChunk(e){return this.isAnthropicEvent(e)&&e.type==="content_block_delta"?e.delta.type==="text_delta"?{text:e.delta.text||""}:e.delta.type==="thinking_delta"?{reasoning:e.delta.thinking||""}:null:null}withLastMessageCached(e){let t=e.length-1;return e.map((n,r)=>r===t?{role:n.role,content:[{type:"text",text:n.content,cache_control:{type:"ephemeral"}}]}:n)}isAnthropicResponse(e){return typeof e=="object"&&e!==null&&e.type==="message"&&Array.isArray(e.content)}isAnthropicEvent(e){return typeof e=="object"&&e!==null&&"type"in e}isModernModel(e){let t=e.match(/^claude-[a-z]+-(\d+)(?:-(\d+))?/i);if(!t)return!1;let n=+t[1],r=t[2]?+t[2]:0;return n>4||n===4&&r>=6}getMaxTokens(e){return this.isModernModel(e)?64e3:32e3}};var us=class extends D{constructor(){super(...arguments),this.providerName="Gemini",this.defaultBaseUrl="https://generativelanguage.googleapis.com",this.path="/v1beta/models"}getPath(e,t){return`/v1beta/models/${e}:${t?"streamGenerateContent":"generateContent"}${t?"?alt=sse":""}`}buildHeaders(e){return{"Content-Type":"application/json","x-goog-api-key":e}}buildPayload(e,t,n,r){let{system:i,conversationMessages:o}=this.extractSystemMessages(e,`
|
|
156
|
+
`),l={contents:o.map(p=>({role:p.role==="assistant"?"model":"user",parts:[{text:p.content}]}))};n?.webSearch!==!1&&(l.tools=[{google_search:{}}]),i&&(l.systemInstruction={role:"system",parts:[{text:i}]});let c=n?.effort;if(c!==void 0){let u={0:0,1:1024,2:8192,3:-1}[c];l.generationConfig={thinkingConfig:u===0?{thinkingBudget:0}:{includeThoughts:!0,thinkingBudget:u}}}return l}parseError(e,t){if(!e)return{message:`HTTP ${t}`};try{let n=JSON.parse(e),r=Array.isArray(n)?n[0]?.error:n?.error;return r&&typeof r=="object"?{message:(r.message||`HTTP ${t}`).split(`
|
|
157
|
+
`)[0],type:r.status,code:r.code?.toString()}:n.message?{message:n.message}:{message:e}}catch{return{message:e}}}parseNonStreamingResponse(e){if(this.checkAndThrowError(e),this.checkGeminiError(e),!this.isGeminiResponse(e))return{text:"",status:"failed",error:"Invalid response format"};let t=this.extractParts(e).text||"",n=e.candidates?.[0]?.finishReason,r="complete";return n==="MAX_TOKENS"?r="interrupted":(n==="SAFETY"||n==="RECITATION")&&(r="failed"),{text:t,status:r}}parseProviderStreamChunk(e){if(this.checkGeminiError(e),!this.isGeminiResponse(e))return null;let t=this.extractParts(e);return t.text||t.reasoning?t:null}isGeminiResponse(e){return typeof e=="object"&&e!==null&&"candidates"in e&&Array.isArray(e.candidates)}extractParts(e){let t=e.candidates?.[0]?.content?.parts;if(!t)return{};let n="",r="";for(let i of t)i.text&&(i.thought?r+=i.text:n+=i.text);return{text:n||void 0,reasoning:r||void 0}}checkGeminiError(e){if(this.isGeminiResponse(e)&&e.promptFeedback?.blockReason){let t=e.promptFeedback.blockReason;throw new Y(`Prompt blocked: ${t}`)}}};var fs=class extends Te{constructor(){super(...arguments),this.providerName="Ollama",this.defaultBaseUrl="http://localhost:11434",this.path="/chat/completions"}buildHeaders(e){let t={"Content-Type":"application/json",Accept:"application/json"};return e&&(t.Authorization=`Bearer ${e}`),t}buildPayload(e,t,n,r){return{model:t,messages:e,stream:r}}};var ha=new fs,np=new Map([["openai",new as],["openrouter",new ls],["anthropic",new cs],["gemini",new us],["ollama",ha],["openai-compat",ha]]);function it(s){let e=np.get(s);if(!e)throw new Error(`Unsupported protocol: ${s}`);return e}function rp(s,e){return s.replace(/\/+$/,"")+(e.startsWith("/")?e:`/${e}`)}async function nr(s,e){let t=it(s.protocol),n=t.getPath(s.model,e.stream),r=rp(s.baseUrl,n),i=t.buildHeaders(s.apiKey,e.origin),o=t.buildPayload(e.messages,s.model,{effort:e.effort,webSearch:e.webSearch},e.stream);return e.modifyPayload?.(o),fetch(r,{method:"POST",headers:i,body:JSON.stringify(o),signal:e.signal})}function ip(s,e){let t=s??process.env.TB_AI_PROVIDER,n=e??process.env.TB_AI_MODEL;if(!t)return"No provider specified. Set TB_AI_PROVIDER in your .env file or pass provider in the tb.ai() call.";if(!n)return"No model specified. Set TB_AI_MODEL in your .env file or pass model in the tb.ai() call.";let r;try{r=it(t)}catch{return`Unknown provider '${t}'.`}if(t==="ollama")return{apiKey:"",baseUrl:`${sr(process.env.OLLAMA_HOST??r.defaultBaseUrl)}/v1`,protocol:t,model:n,isFreeModel:!1};if(t==="openai-compat"){let a=process.env.TB_AI_BASE_URL;return a?{apiKey:process.env.TB_AI_API_KEY??"",baseUrl:a,protocol:t,model:n,isFreeModel:!1}:"No base URL for openai-compat. Set TB_AI_BASE_URL (the OpenAI-style base ending in /v1, e.g. http://localhost:1234/v1) in your .env file."}let i=tr[t];if(!i)return`Unknown provider '${t}'.`;let o=process.env[i];return o?{apiKey:o,baseUrl:r.defaultBaseUrl,protocol:t,model:n,isFreeModel:!1}:`No API key for '${t}'. Set ${i} in your .env file.`}function op(s,e){let t=[...e.system?[{role:"system",content:e.system}]:[],...e.messages.map(r=>({role:r.role,content:r.content}))],n=e.effort;return nr(s,{messages:t,stream:!0,effort:n!=null&&n>=0&&n<=3?n:void 0,webSearch:e.webSearch??!0,signal:e.signal})}import{readFileSync as sy,existsSync as ap}from"fs";import*as ce from"path";import{fileURLToPath as lp}from"url";function ma(){let s=ce.dirname(lp(import.meta.url));for(;!ap(ce.join(s,"package.json"));){let e=ce.dirname(s);if(e===s)break;s=e}return s}function cp(){return ce.join(ma(),"README.md")}function up(){return ce.join(ma(),"description.md")}export{is as bulbName,up as bundledDescriptionPath,cp as bundledReadmePath,xd as ensureDeclaredDependencies,Zd as getFilteredModels,Wd as isBulbTrusted,Fa as launchBulbServer,Cd as listBulbFiles,gs as listBulbServers,Hd as listTrustedBulbs,jd as openInEditor,Id as predictBulbTrust,qa as readServerLog,ip as resolveLocalProvider,op as sendTbAi,ms as serverLogPath,Gd as setBulbTrusted,kd as slugifyBulbName,lr as stopBulbServer,Nd as stripFrontmatter};
|