@visulima/packem 2.0.0-alpha.95 → 2.0.0-alpha.96
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/CHANGELOG.md +10 -0
- package/dist/babel-runtime/packem_shared/transform-code-D_76zJ_u.js +1 -0
- package/dist/babel-runtime/plugins/babel/worker.js +1 -1
- package/dist/builder/typedoc/index.js +3 -3
- package/dist/cli/index.js +8 -8
- package/dist/index.js +1 -1
- package/dist/packem_shared/create-or-update-key-storage-DbvoG0IR.js +2 -0
- package/dist/packem_shared/default-LwDqaoc0.js +1 -0
- package/dist/packem_shared/{index-BhmvQAG0.js → index-CnKWFiuf.js} +165 -168
- package/dist/packem_shared/index-KXVG6Tyr.js +25 -0
- package/dist/packem_shared/oxcResolvePlugin-DERMXYPc-CqFUTcUY.js +1 -0
- package/dist/packem_shared/oxcTransformPlugin-B5ATuMoi-DwCO2qaH.js +151 -0
- package/dist/rollup/plugins/oxc/oxc-transformer.js +1 -1
- package/package.json +6 -6
- package/dist/babel-runtime/packem_shared/transform-code-DtqOY-lW.js +0 -1
- package/dist/packem_shared/create-or-update-key-storage-BFOAEuWX.js +0 -26
- package/dist/packem_shared/default-BSbw_3ev.js +0 -1
- package/dist/packem_shared/oxcTransformPlugin-Dwvbw2jE-CI_T_eTp.js +0 -168
- package/dist/packem_shared/utils-DqCpIxDx.js +0 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import yi,{createRequire as Ci}from"node:module";import{installPackage as Ai}from"@antfu/install-pkg";import{z as gs,N as Es,L as Sn,v as wn,P as Nn,H as ht,y as bi,F as Fi,a as vi,e as Si}from"./index-KXVG6Tyr.js";import wi from"node:url";import Ni from"util";import{createFilter as Li}from"@rollup/pluginutils";import{EXCLUDE_REGEXP as $i}from"@visulima/packem-share/constants";import{createRequire as Oi}from"module";async function Bi(s,e,t){const n=await gs(s,{buffer:!0,encoding:void 0});let r=new TextDecoder().decode(n);const{beforeParse:i,color:o}={};return typeof i=="function"&&(r=i(r)),Es(r,e,Sn(s),{color:o})}const ys=Symbol.for("yaml.alias"),us=Symbol.for("yaml.document"),ce=Symbol.for("yaml.map"),Ln=Symbol.for("yaml.pair"),Z=Symbol.for("yaml.scalar"),Le=Symbol.for("yaml.seq"),z=Symbol.for("yaml.node.type"),$e=s=>!!s&&typeof s=="object"&&s[z]===ys,Et=s=>!!s&&typeof s=="object"&&s[z]===us,We=s=>!!s&&typeof s=="object"&&s[z]===ce,j=s=>!!s&&typeof s=="object"&&s[z]===Ln,x=s=>!!s&&typeof s=="object"&&s[z]===Z,Ve=s=>!!s&&typeof s=="object"&&s[z]===Le;function T(s){if(s&&typeof s=="object")switch(s[z]){case ce:case Le:return!0}return!1}function _(s){if(s&&typeof s=="object")switch(s[z]){case ys:case ce:case Z:case Le:return!0}return!1}const $n=s=>(x(s)||T(s))&&!!s.anchor,pe=Symbol("break visit"),Ii=Symbol("skip children"),Ge=Symbol("remove node");function Oe(s,e){const t=xi(e);Et(s)?Ce(null,s.contents,t,Object.freeze([s]))===Ge&&(s.contents=null):Ce(null,s,t,Object.freeze([]))}Oe.BREAK=pe;Oe.SKIP=Ii;Oe.REMOVE=Ge;function Ce(s,e,t,n){const r=ki(s,e,t,n);if(_(r)||j(r))return Pi(s,n,r),Ce(s,r,t,n);if(typeof r!="symbol"){if(T(e)){n=Object.freeze(n.concat(e));for(let i=0;i<e.items.length;++i){const o=Ce(i,e.items[i],t,n);if(typeof o=="number")i=o-1;else{if(o===pe)return pe;o===Ge&&(e.items.splice(i,1),i-=1)}}}else if(j(e)){n=Object.freeze(n.concat(e));const i=Ce("key",e.key,t,n);if(i===pe)return pe;i===Ge&&(e.key=null);const o=Ce("value",e.value,t,n);if(o===pe)return pe;o===Ge&&(e.value=null)}}return r}function xi(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 ki(s,e,t,n){if(typeof t=="function")return t(s,e,n);if(We(e))return t.Map?.(s,e,n);if(Ve(e))return t.Seq?.(s,e,n);if(j(e))return t.Pair?.(s,e,n);if(x(e))return t.Scalar?.(s,e,n);if($e(e))return t.Alias?.(s,e,n)}function Pi(s,e,t){const n=e[e.length-1];if(T(n))n.items[s]=t;else if(j(n))s==="key"?n.key=t:n.value=t;else if(Et(n))n.contents=t;else{const r=$e(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const Ri={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ti=s=>s.replace(/[!,[\]{}]/g,e=>Ri[e]);let ve=class ee{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},ee.defaultYaml,e),this.tags=Object.assign({},ee.defaultTags,t)}clone(){const e=new ee(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new ee(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:ee.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},ee.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:ee.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},ee.defaultTags),this.atNextDocument=!1);const 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;const[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;const[i]=n;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const 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]==="<"){const 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)}const[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);const 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(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Ti(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let r;if(e&&n.length>0&&_(e.contents)){const i={};Oe(e.contents,(o,a)=>{_(a)&&a.tag&&(i[a.tag]=!0)}),r=Object.keys(i)}else r=[];for(const[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(`
|
|
2
|
+
`)}};ve.defaultYaml={explicit:!1,version:"1.2"};ve.defaultTags={"!!":"tag:yaml.org,2002:"};function On(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){const e=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(e)}return!0}function Bn(s){const e=new Set;return Oe(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function In(s,e){for(let t=1;;++t){const n=`${s}${t}`;if(!e.has(n))return n}}function _i(s,e){const t=[],n=new Map;let r=null;return{onAnchor:i=>{t.push(i),r??(r=Bn(s));const o=In(e,r);return r.add(o),o},setAnchors:()=>{for(const i of t){const o=n.get(i);if(typeof o=="object"&&o.anchor&&(x(o.node)||T(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:n}}function Ae(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let r=0,i=n.length;r<i;++r){const o=n[r],a=Ae(s,n,String(r),o);a===void 0?delete n[r]:a!==o&&(n[r]=a)}else if(n instanceof Map)for(const r of Array.from(n.keys())){const i=n.get(r),o=Ae(s,n,r,i);o===void 0?n.delete(r):o!==i&&n.set(r,o)}else if(n instanceof Set)for(const r of Array.from(n)){const i=Ae(s,n,r,r);i===void 0?n.delete(r):i!==r&&(n.delete(r),n.add(i))}else for(const[r,i]of Object.entries(n)){const o=Ae(s,n,r,i);o===void 0?delete n[r]:o!==i&&(n[r]=o)}return s.call(e,t,n)}function Y(s,e,t){if(Array.isArray(s))return s.map((n,r)=>Y(n,String(r),t));if(s&&typeof s.toJSON=="function"){if(!t||!$n(s))return s.toJSON(e,t);const n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=i=>{n.res=i,delete t.onCreate};const r=s.toJSON(e,t);return t.onCreate&&t.onCreate(r),r}return typeof s=="bigint"&&!t?.keep?Number(s):s}let Cs=class{constructor(e){Object.defineProperty(this,z,{value:e})}clone(){const 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(!Et(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=Y(this,"",o);if(typeof r=="function")for(const{count:u,res:c}of o.anchors.values())r(c,u);return typeof i=="function"?Ae(i,{"":a},"",a):a}},As=class extends Cs{constructor(e){super(ys),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Oe(e,{Node:(i,o)=>{($e(o)||$n(o))&&n.push(o)}}),t&&(t.aliasResolveCache=n));let r;for(const i of n){if(i===this)break;i.anchor===this.source&&(r=i)}return r}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:r,maxAliasCount:i}=t,o=this.resolve(r,t);if(!o){const u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(u)}let a=n.get(o);if(a||(Y(o,null,t),a=n.get(o)),a?.res===void 0){const u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=rt(r,o,n)),a.count*a.aliasCount>i)){const u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}return a.res}toString(e,t,n){const r=`*${this.source}`;if(e){if(On(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const 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 rt(s,e,t){if($e(e)){const n=e.resolve(s),r=t&&n&&t.get(n);return r?r.count*r.aliasCount:0}else if(T(e)){let n=0;for(const r of e.items){const i=rt(s,r,t);i>n&&(n=i)}return n}else if(j(e)){const n=rt(s,e.key,t),r=rt(s,e.value,t);return Math.max(n,r)}return 1}const xn=s=>!s||typeof s!="function"&&typeof s!="object";let $=class extends Cs{constructor(e){super(Z),this.value=e}toJSON(e,t){return t?.keep?this.value:Y(this.value,e,t)}toString(){return String(this.value)}};$.BLOCK_FOLDED="BLOCK_FOLDED";$.BLOCK_LITERAL="BLOCK_LITERAL";$.PLAIN="PLAIN";$.QUOTE_DOUBLE="QUOTE_DOUBLE";$.QUOTE_SINGLE="QUOTE_SINGLE";const ji="tag:yaml.org,2002:";function Gi(s,e,t){if(e){const 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 Ke(s,e,t){if(Et(s)&&(s=s.contents),_(s))return s;if(j(s)){const d=t.schema[ce].createNode?.(t.schema,null,t);return d.items.push(s),d}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());const{aliasDuplicateObjects:n,onAnchor:r,onTagObj:i,schema:o,sourceObjects:a}=t;let u;if(n&&s&&typeof s=="object"){if(u=a.get(s),u)return u.anchor??(u.anchor=r(s)),new As(u.anchor);u={anchor:null,node:null},a.set(s,u)}e?.startsWith("!!")&&(e=ji+e.slice(2));let c=Gi(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){const d=new $(s);return u&&(u.node=d),d}c=s instanceof Map?o[ce]:Symbol.iterator in Object(s)?o[Le]:o[ce]}i&&(i(c),delete t.onTagObj);const l=c?.createNode?c.createNode(t.schema,s,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,s,t):new $(s);return e?l.tag=e:c.default||(l.tag=c.tag),u&&(u.node=l),l}function ft(s,e,t){let n=t;for(let r=e.length-1;r>=0;--r){const i=e[r];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const o=[];o[i]=n,n=o}else n=new Map([[i,n]])}return Ke(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}const Re=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done;let kn=class extends Cs{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>_(n)||j(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Re(e))this.add(t);else{const[n,...r]=e,i=this.get(n,!0);if(T(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,ft(this.schema,r,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){const[t,...n]=e;if(n.length===0)return this.delete(t);const r=this.get(t,!0);if(T(r))return r.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){const[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&x(i)?i.value:i:T(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!j(t))return!1;const n=t.value;return n==null||e&&x(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){const[t,...n]=e;if(n.length===0)return this.has(t);const r=this.get(t,!0);return T(r)?r.hasIn(n):!1}setIn(e,t){const[n,...r]=e;if(r.length===0)this.set(n,t);else{const i=this.get(n,!0);if(T(i))i.setIn(r,t);else if(i===void 0&&this.schema)this.set(n,ft(this.schema,r,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}};const Mi=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function ne(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}const de=(s,e,t)=>s.endsWith(`
|
|
3
|
+
`)?ne(t,e):t.includes(`
|
|
4
|
+
`)?`
|
|
5
|
+
`+ne(t,e):(s.endsWith(" ")?"":" ")+t,Pn="flow",as="block",it="quoted";function yt(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);const u=Math.max(1+i,1+r-e.length);if(s.length<=u)return s;const c=[],l={};let d=r-e.length;typeof n=="number"&&(n>r-Math.max(2,i)?c.push(0):d=r-n);let m,g,y=!1,p=-1,D=-1,f=-1;t===as&&(p=Gs(s,p,e.length),p!==-1&&(d=p+u));for(let b;b=s[p+=1];){if(t===it&&b==="\\"){switch(D=p,s[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}f=p}if(b===`
|
|
6
|
+
`)t===as&&(p=Gs(s,p,e.length)),d=p+e.length+u,m=void 0;else{if(b===" "&&g&&g!==" "&&g!==`
|
|
7
|
+
`&&g!==" "){const h=s[p+1];h&&h!==" "&&h!==`
|
|
8
|
+
`&&h!==" "&&(m=p)}if(p>=d)if(m)c.push(m),d=m+u,m=void 0;else if(t===it){for(;g===" "||g===" ";)g=b,b=s[p+=1],y=!0;const h=p>f+1?p-2:D-1;if(l[h])return s;c.push(h),l[h]=!0,d=h+u,m=void 0}else y=!0}g=b}if(y&&a&&a(),c.length===0)return s;o&&o();let C=s.slice(0,c[0]);for(let b=0;b<c.length;++b){const h=c[b],E=c[b+1]||s.length;h===0?C=`
|
|
9
|
+
${e}${s.slice(0,E)}`:(t===it&&l[h]&&(C+=`${s[h]}\\`),C+=`
|
|
10
|
+
${e}${s.slice(h+1,E)}`)}return C}function Gs(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!==`
|
|
11
|
+
`);n=e,r=e+1,i=s[r]}return n}const Ct=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),At=s=>/^(%|---|\.\.\.)/m.test(s);function Ui(s,e,t){if(!e||e<0)return!1;const n=e-t,r=s.length;if(r<=n)return!1;for(let i=0,o=0;i<r;++i)if(s[i]===`
|
|
12
|
+
`){if(i-o>n)return!0;if(o=i+1,r-o<=n)return!1}return!0}function Me(s,e){const t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:n}=e,r=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(At(s)?" ":"");let o="",a=0;for(let u=0,c=t[u];c;c=t[++u])if(c===" "&&t[u+1]==="\\"&&t[u+2]==="n"&&(o+=t.slice(a,u)+"\\ ",u+=1,a=u,c="\\"),c==="\\")switch(t[u+1]){case"u":{o+=t.slice(a,u);const l=t.substr(u+2,4);switch(l){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:l.substr(0,2)==="00"?o+="\\x"+l.substr(2):o+=t.substr(u,6)}u+=5,a=u+1}break;case"n":if(n||t[u+2]==='"'||t.length<r)u+=1;else{for(o+=t.slice(a,u)+`
|
|
13
|
+
|
|
14
|
+
`;t[u+2]==="\\"&&t[u+3]==="n"&&t[u+4]!=='"';)o+=`
|
|
15
|
+
`,u+=2;o+=i,t[u+2]===" "&&(o+="\\"),u+=1,a=u+1}break;default:u+=1}return o=a?o+t.slice(a):t,n?o:yt(o,i,it,Ct(e,!1))}function cs(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
|
|
16
|
+
`)||/[ \t]\n|\n[ \t]/.test(s))return Me(s,e);const t=e.indent||(At(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
17
|
+
${t}`)+"'";return e.implicitKey?n:yt(n,t,Pn,Ct(e,!1))}function be(s,e){const{singleQuote:t}=e.options;let n;if(t===!1)n=Me;else{const r=s.includes('"'),i=s.includes("'");r&&!i?n=cs:i&&!r?n=Me:n=t?cs:Me}return n(s,e)}let ls;try{ls=new RegExp(`(^|(?<!
|
|
18
|
+
))
|
|
19
|
+
+(?!
|
|
20
|
+
|$)`,"g")}catch{ls=/\n+(?!\n|$)/g}function ot({comment:s,type:e,value:t},n,r,i){const{blockQuote:o,commentString:a,lineWidth:u}=n.options;if(!o||/\n[\t ]+$/.test(t))return be(t,n);const c=n.indent||(n.forceBlockIndent||At(t)?" ":""),l=o==="literal"?!0:o==="folded"||e===$.BLOCK_FOLDED?!1:e===$.BLOCK_LITERAL?!0:!Ui(t,u,c.length);if(!t)return l?`|
|
|
21
|
+
`:`>
|
|
22
|
+
`;let d,m;for(m=t.length;m>0;--m){const h=t[m-1];if(h!==`
|
|
23
|
+
`&&h!==" "&&h!==" ")break}let g=t.substring(m);const y=g.indexOf(`
|
|
24
|
+
`);y===-1?d="-":t===g||y!==g.length-1?(d="+",i&&i()):d="",g&&(t=t.slice(0,-g.length),g[g.length-1]===`
|
|
25
|
+
`&&(g=g.slice(0,-1)),g=g.replace(ls,`$&${c}`));let p=!1,D,f=-1;for(D=0;D<t.length;++D){const h=t[D];if(h===" ")p=!0;else if(h===`
|
|
26
|
+
`)f=D;else break}let C=t.substring(0,f<D?f+1:D);C&&(t=t.substring(C.length),C=C.replace(/\n+/g,`$&${c}`));let b=(p?c?"2":"1":"")+d;if(s&&(b+=" "+a(s.replace(/ ?[\r\n]+/g," ")),r&&r()),!l){const h=t.replace(/\n+/g,`
|
|
27
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let E=!1;const A=Ct(n,!0);o!=="folded"&&e!==$.BLOCK_FOLDED&&(A.onOverflow=()=>{E=!0});const w=yt(`${C}${h}${g}`,c,as,A);if(!E)return`>${b}
|
|
28
|
+
${c}${w}`}return t=t.replace(/\n+/g,`$&${c}`),`|${b}
|
|
29
|
+
${c}${C}${t}${g}`}function Ki(s,e,t,n){const{type:r,value:i}=s,{actualString:o,implicitKey:a,indent:u,indentStep:c,inFlow:l}=e;if(a&&i.includes(`
|
|
30
|
+
`)||l&&/[[\]{},]/.test(i))return be(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||l||!i.includes(`
|
|
31
|
+
`)?be(i,e):ot(s,e,t,n);if(!a&&!l&&r!==$.PLAIN&&i.includes(`
|
|
32
|
+
`))return ot(s,e,t,n);if(At(i)){if(u==="")return e.forceBlockIndent=!0,ot(s,e,t,n);if(a&&u===c)return be(i,e)}const d=i.replace(/\n+/g,`$&
|
|
33
|
+
${u}`);if(o){const m=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(d),{compat:g,tags:y}=e.doc.schema;if(y.some(m)||g?.some(m))return be(i,e)}return a?d:yt(d,u,Pn,Ct(e,!1))}function bs(s,e,t,n){const{implicitKey:r,inFlow:i}=e,o=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)});let{type:a}=s;a!==$.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=$.QUOTE_DOUBLE);const u=l=>{switch(l){case $.BLOCK_FOLDED:case $.BLOCK_LITERAL:return r||i?be(o.value,e):ot(o,e,t,n);case $.QUOTE_DOUBLE:return Me(o.value,e);case $.QUOTE_SINGLE:return cs(o.value,e);case $.PLAIN:return Ki(o,e,t,n);default:return null}};let c=u(a);if(c===null){const{defaultKeyType:l,defaultStringType:d}=e.options,m=r&&l||d;if(c=u(m),c===null)throw new Error(`Unsupported default string type ${m}`)}return c}function Rn(s,e){const t=Object.assign({blockQuote:!0,commentString:Mi,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},s.schema.toStringOptions,e);let 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 Hi(s,e){if(e.tag){const 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(x(e)){n=e.value;let r=s.filter(i=>i.identify?.(n));if(r.length>1){const 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){const r=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${r} value`)}return t}function qi(s,e,{anchors:t,doc:n}){if(!n.directives)return"";const r=[],i=(x(s)||T(s))&&s.anchor;i&&On(i)&&(t.add(i),r.push(`&${i}`));const o=s.tag??(e.default?null:e.tag);return o&&r.push(n.directives.tagString(o)),r.join(" ")}function we(s,e,t,n){if(j(s))return s.toString(e,t,n);if($e(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;const i=_(s)?s:e.doc.createNode(s,{onTagObj:u=>r=u});r??(r=Hi(e.doc.schema.tags,i));const o=qi(i,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const a=typeof r.stringify=="function"?r.stringify(i,e,t,n):x(i)?bs(i,e,t,n):i.toString(e,t,n);return o?x(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
34
|
+
${e.indent}${a}`:a}function Wi({key:s,value:e},t,n,r){const{allNullValues:i,doc:o,indent:a,indentStep:u,options:{commentString:c,indentSeq:l,simpleKeys:d}}=t;let m=_(s)&&s.comment||null;if(d){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(T(s)||!_(s)&&typeof s=="object"){const w="With simple keys, collection cannot be used as a key value";throw new Error(w)}}let g=!d&&(!s||m&&e==null&&!t.inFlow||T(s)||(x(s)?s.type===$.BLOCK_FOLDED||s.type===$.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!g&&(d||!i),indent:a+u});let y=!1,p=!1,D=we(s,t,()=>y=!0,()=>p=!0);if(!g&&!t.inFlow&&D.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(t.inFlow){if(i||e==null)return y&&n&&n(),D===""?"?":g?`? ${D}`:D}else if(i&&!d||e==null&&g)return D=`? ${D}`,m&&!y?D+=de(D,t.indent,c(m)):p&&r&&r(),D;y&&(m=null),g?(m&&(D+=de(D,t.indent,c(m))),D=`? ${D}
|
|
35
|
+
${a}:`):(D=`${D}:`,m&&(D+=de(D,t.indent,c(m))));let f,C,b;_(e)?(f=!!e.spaceBefore,C=e.commentBefore,b=e.comment):(f=!1,C=null,b=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!g&&!m&&x(e)&&(t.indentAtStart=D.length+1),p=!1,!l&&u.length>=2&&!t.inFlow&&!g&&Ve(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let h=!1;const E=we(e,t,()=>h=!0,()=>p=!0);let A=" ";if(m||f||C){if(A=f?`
|
|
36
|
+
`:"",C){const w=c(C);A+=`
|
|
37
|
+
${ne(w,t.indent)}`}E===""&&!t.inFlow?A===`
|
|
38
|
+
`&&b&&(A=`
|
|
39
|
+
|
|
40
|
+
`):A+=`
|
|
41
|
+
${t.indent}`}else if(!g&&T(e)){const w=E[0],v=E.indexOf(`
|
|
42
|
+
`),I=v!==-1,M=t.inFlow??e.flow??e.items.length===0;if(I||!M){let ge=!1;if(I&&(w==="&"||w==="!")){let G=E.indexOf(" ");w==="&"&&G!==-1&&G<v&&E[G+1]==="!"&&(G=E.indexOf(" ",G+1)),(G===-1||v<G)&&(ge=!0)}ge||(A=`
|
|
43
|
+
${t.indent}`)}}else(E===""||E[0]===`
|
|
44
|
+
`)&&(A="");return D+=A+E,t.inFlow?h&&n&&n():b&&!h?D+=de(D,t.indent,c(b)):p&&r&&r(),D}function Tn(s,e){(s==="debug"||s==="warn")&&console.warn(e)}const Xe="<<",ie={identify:s=>s===Xe||typeof s=="symbol"&&s.description===Xe,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new $(Symbol(Xe)),{addToJSMap:_n}),stringify:()=>Xe},Vi=(s,e)=>(ie.identify(e)||x(e)&&(!e.type||e.type===$.PLAIN)&&ie.identify(e.value))&&s?.doc.schema.tags.some(t=>t.tag===ie.tag&&t.default);function _n(s,e,t){const n=jn(s,t);if(Ve(n))for(const r of n.items)Nt(s,e,r);else if(Array.isArray(n))for(const r of n)Nt(s,e,r);else Nt(s,e,n)}function Nt(s,e,t){const n=jn(s,t);if(!We(n))throw new Error("Merge sources must be maps or map aliases");const r=n.toJSON(null,s,Map);for(const[i,o]of r)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function jn(s,e){return s&&$e(e)?e.resolve(s.doc,s):e}function Gn(s,e,{key:t,value:n}){if(_(t)&&t.addToJSMap)t.addToJSMap(s,e,n);else if(Vi(s,t))_n(s,e,n);else{const r=Y(t,"",s);if(e instanceof Map)e.set(r,Y(n,r,s));else if(e instanceof Set)e.add(r);else{const i=Yi(t,r,s),o=Y(n,i,s);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function Yi(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(_(s)&&t?.doc){const n=Rn(t.doc,{});n.anchors=new Set;for(const i of t.anchors.keys())n.anchors.add(i.anchor);n.inFlow=!0,n.inStringifyKey=!0;const r=s.toString(n);if(!t.mapKeyWarned){let i=JSON.stringify(r);i.length>40&&(i=i.substring(0,36)+'..."'),Tn(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)}function Fs(s,e,t){const n=Ke(s,void 0,t),r=Ke(e,void 0,t);return new q(n,r)}let q=class Mn{constructor(e,t=null){Object.defineProperty(this,z,{value:Ln}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return _(t)&&(t=t.clone(e)),_(n)&&(n=n.clone(e)),new Mn(t,n)}toJSON(e,t){const n=t?.mapAsMap?new Map:{};return Gn(t,n,this)}toString(e,t,n){return e?.doc?Wi(this,e,t,n):JSON.stringify(this)}};function Un(s,e,t){return(e.inFlow??s.flow?Xi:zi)(s,e,t)}function zi({comment:s,items:e},t,{blockItemPrefix:n,flowChars:r,itemIndent:i,onChompKeep:o,onComment:a}){const{indent:u,options:{commentString:c}}=t,l=Object.assign({},t,{indent:i,type:null});let d=!1;const m=[];for(let y=0;y<e.length;++y){const p=e[y];let D=null;if(_(p))!d&&p.spaceBefore&&m.push(""),pt(t,m,p.commentBefore,d),p.comment&&(D=p.comment);else if(j(p)){const C=_(p.key)?p.key:null;C&&(!d&&C.spaceBefore&&m.push(""),pt(t,m,C.commentBefore,d))}d=!1;let f=we(p,l,()=>D=null,()=>d=!0);D&&(f+=de(f,i,c(D))),d&&D&&(d=!1),m.push(n+f)}let g;if(m.length===0)g=r.start+r.end;else{g=m[0];for(let y=1;y<m.length;++y){const p=m[y];g+=p?`
|
|
45
|
+
${u}${p}`:`
|
|
46
|
+
`}}return s?(g+=`
|
|
47
|
+
`+ne(c(s),u),a&&a()):d&&o&&o(),g}function Xi({items:s},e,{flowChars:t,itemIndent:n}){const{indent:r,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;n+=i;const u=Object.assign({},e,{indent:n,inFlow:!0,type:null});let c=!1,l=0;const d=[];for(let y=0;y<s.length;++y){const p=s[y];let D=null;if(_(p))p.spaceBefore&&d.push(""),pt(e,d,p.commentBefore,!1),p.comment&&(D=p.comment);else if(j(p)){const C=_(p.key)?p.key:null;C&&(C.spaceBefore&&d.push(""),pt(e,d,C.commentBefore,!1),C.comment&&(c=!0));const b=_(p.value)?p.value:null;b?(b.comment&&(D=b.comment),b.commentBefore&&(c=!0)):p.value==null&&C?.comment&&(D=C.comment)}D&&(c=!0);let f=we(p,u,()=>D=null);c||(c=d.length>l||f.includes(`
|
|
48
|
+
`)),y<s.length-1?f+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=d.reduce((C,b)=>C+b.length+2,2)+(f.length+2)>e.options.lineWidth)),c&&(f+=",")),D&&(f+=de(f,n,a(D))),d.push(f),l=d.length}const{start:m,end:g}=t;if(d.length===0)return m+g;if(!c){const y=d.reduce((p,D)=>p+D.length+2,2);c=e.options.lineWidth>0&&y>e.options.lineWidth}if(c){let y=m;for(const p of d)y+=p?`
|
|
49
|
+
${i}${r}${p}`:`
|
|
50
|
+
`;return`${y}
|
|
51
|
+
${r}${g}`}else return`${m}${o}${d.join(" ")}${o}${g}`}function pt({indent:s,options:{commentString:e}},t,n,r){if(n&&r&&(n=n.replace(/^\n+/,"")),n){const i=ne(e(n),s);t.push(i.trimStart())}}function me(s,e){const t=x(e)?e.value:e;for(const n of s)if(j(n)&&(n.key===e||n.key===t||x(n.key)&&n.key.value===t))return n}let V=class extends kn{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ce,e),this.items=[]}static from(e,t,n){const{keepUndefined:r,replacer:i}=n,o=new this(e),a=(u,c)=>{if(typeof i=="function")c=i.call(t,u,c);else if(Array.isArray(i)&&!i.includes(u))return;(c!==void 0||r)&&o.items.push(Fs(u,c,n))};if(t instanceof Map)for(const[u,c]of t)a(u,c);else if(t&&typeof t=="object")for(const u of Object.keys(t))a(u,t[u]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;j(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new q(e,e?.value):n=new q(e.key,e.value);const r=me(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw new Error(`Key ${n.key} already set`);x(r.value)&&xn(n.value)?r.value.value=n.value:r.value=n.value}else if(i){const 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){const t=me(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const n=me(this.items,e)?.value;return(!t&&x(n)?n.value:n)??void 0}has(e){return!!me(this.items,e)}set(e,t){this.add(new q(e,t),!0)}toJSON(e,t,n){const r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(const i of this.items)Gn(t,r,i);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(const r of this.items)if(!j(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})),Un(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};const Be={collection:"map",default:!0,nodeClass:V,tag:"tag:yaml.org,2002:map",resolve(s,e){return We(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>V.from(s,e,t)};let De=class extends kn{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Le,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=Je(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const n=Je(e);if(typeof n!="number")return;const r=this.items[n];return!t&&x(r)?r.value:r}has(e){const t=Je(e);return typeof t=="number"&&t<this.items.length}set(e,t){const n=Je(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);const r=this.items[n];x(r)&&xn(t)?r.value=t:this.items[n]=t}toJSON(e,t){const n=[];t?.onCreate&&t.onCreate(n);let r=0;for(const i of this.items)n.push(Y(i,String(r++),t));return n}toString(e,t,n){return e?Un(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){const{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"){const u=t instanceof Set?a:String(o++);a=r.call(t,u,a)}i.items.push(Ke(a,void 0,n))}}return i}};function Je(s){let e=x(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const Ie={collection:"seq",default:!0,nodeClass:De,tag:"tag:yaml.org,2002:seq",resolve(s,e){return Ve(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>De.from(s,e,t)},bt={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),bs(s,e,t,n)}},Ft={identify:s=>s==null,createNode:()=>new $(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new $(null),stringify:({source:s},e)=>typeof s=="string"&&Ft.test.test(s)?s:e.options.nullStr},vs={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new $(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&vs.test.test(s)){const n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};function Q({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);const 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)&&!i.includes("e")){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}const Kn={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:Q},Hn={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){const e=Number(s.value);return isFinite(e)?e.toExponential():Q(s)}},qn={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){const e=new $(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:Q},vt=s=>typeof s=="bigint"||Number.isInteger(s),Ss=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function Wn(s,e,t){const{value:n}=s;return vt(n)&&n>=0?t+n.toString(e):Q(s)}const Vn={identify:s=>vt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>Ss(s,2,8,t),stringify:s=>Wn(s,8,"0o")},Yn={identify:vt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>Ss(s,0,10,t),stringify:Q},zn={identify:s=>vt(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>Ss(s,2,16,t),stringify:s=>Wn(s,16,"0x")},Ji=[Be,Ie,bt,Ft,vs,Vn,Yn,zn,Kn,Hn,qn];function Ms(s){return typeof s=="bigint"||Number.isInteger(s)}const Qe=({value:s})=>JSON.stringify(s),Qi=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:Qe},{identify:s=>s==null,createNode:()=>new $(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Qe},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:s=>s==="true",stringify:Qe},{identify:Ms,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})=>Ms(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:Qe}],Zi={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},eo=[Be,Ie].concat(Qi,Zi),ws={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof atob=="function"){const 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"";const o=t;let a;if(typeof btoa=="function"){let u="";for(let c=0;c<o.length;++c)u+=String.fromCharCode(o[c]);a=btoa(u)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=$.BLOCK_LITERAL),e!==$.QUOTE_DOUBLE){const u=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(a.length/u),l=new Array(c);for(let d=0,m=0;d<c;++d,m+=u)l[d]=a.substr(m,u);a=l.join(e===$.BLOCK_LITERAL?`
|
|
52
|
+
`:" ")}return bs({comment:s,type:e,value:a},n,r,i)}};function Xn(s,e){if(Ve(s))for(let t=0;t<s.items.length;++t){let n=s.items[t];if(!j(n)){if(We(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");const r=n.items[0]||new q(new $(null));if(n.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${n.commentBefore}
|
|
53
|
+
${r.key.commentBefore}`:n.commentBefore),n.comment){const i=r.value??r.key;i.comment=i.comment?`${n.comment}
|
|
54
|
+
${i.comment}`:n.comment}n=r}s.items[t]=j(n)?n:new q(n)}}else e("Expected a sequence for this tag");return s}function Jn(s,e,t){const{replacer:n}=t,r=new De(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,u;if(Array.isArray(o))if(o.length===2)a=o[0],u=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],u=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;r.items.push(Fs(a,u,t))}return r}const Ns={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Xn,createNode:Jn};let ut=class Qn extends De{constructor(){super(),this.add=V.prototype.add.bind(this),this.delete=V.prototype.delete.bind(this),this.get=V.prototype.get.bind(this),this.has=V.prototype.has.bind(this),this.set=V.prototype.set.bind(this),this.tag=Qn.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;t?.onCreate&&t.onCreate(n);for(const r of this.items){let i,o;if(j(r)?(i=Y(r.key,"",t),o=Y(r.value,i,t)):i=Y(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){const r=Jn(e,t,n),i=new this;return i.items=r.items,i}};ut.tag="tag:yaml.org,2002:omap";const Ls={collection:"seq",identify:s=>s instanceof Map,nodeClass:ut,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){const t=Xn(s,e),n=[];for(const{key:r}of t.items)x(r)&&(n.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):n.push(r.value));return Object.assign(new ut,t)},createNode:(s,e,t)=>ut.from(s,e,t)};function Zn({value:s,source:e},t){return e&&(s?er:tr).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}const er={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 $(!0),stringify:Zn},tr={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 $(!1),stringify:Zn},to={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:Q},so={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){const e=Number(s.value);return isFinite(e)?e.toExponential():Q(s)}},no={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){const e=new $(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){const n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Q},Ye=s=>typeof s=="bigint"||Number.isInteger(s);function St(s,e,t,{intAsBigInt:n}){const 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}const o=BigInt(s);return r==="-"?BigInt(-1)*o:o}const i=parseInt(s,t);return r==="-"?-1*i:i}function $s(s,e,t){const{value:n}=s;if(Ye(n)){const r=n.toString(e);return n<0?"-"+t+r.substr(1):t+r}return Q(s)}const ro={identify:Ye,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>St(s,2,2,t),stringify:s=>$s(s,2,"0b")},io={identify:Ye,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>St(s,1,8,t),stringify:s=>$s(s,8,"0")},oo={identify:Ye,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>St(s,0,10,t),stringify:Q},uo={identify:Ye,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>St(s,2,16,t),stringify:s=>$s(s,16,"0x")};let at=class sr extends V{constructor(e){super(e),this.tag=sr.tag}add(e){let t;j(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new q(e.key,null):t=new q(e,null),me(this.items,t.key)||this.items.push(t)}get(e,t){const n=me(this.items,e);return!t&&j(n)?x(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}`);const n=me(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new q(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){const{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(Fs(o,null,n));return i}};at.tag="tag:yaml.org,2002:set";const Os={collection:"map",identify:s=>s instanceof Set,nodeClass:at,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>at.from(s,e,t),resolve(s,e){if(We(s)){if(s.hasAllNullValues(!0))return Object.assign(new at,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};function Bs(s,e){const 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 nr(s){let{value:e}=s,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Q(s);let n="";e<0&&(n="-",e*=t(-1));const 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*$/,"")}const rr={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})=>Bs(s,t),stringify:nr},ir={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=>Bs(s,!1),stringify:nr},wt={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){const e=s.match(wt.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,n,r,i,o,a]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(t,n-1,r,i||0,o||0,a||0,u);const l=e[8];if(l&&l!=="Z"){let d=Bs(l,!1);Math.abs(d)<30&&(d*=60),c-=6e4*d}return new Date(c)},stringify:({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Us=[Be,Ie,bt,Ft,er,tr,ro,io,oo,uo,to,so,no,ws,ie,Ls,Ns,Os,rr,ir,wt],Ks=new Map([["core",Ji],["failsafe",[Be,Ie,bt]],["json",eo],["yaml11",Us],["yaml-1.1",Us]]),Hs={binary:ws,bool:vs,float:qn,floatExp:Hn,floatNaN:Kn,floatTime:ir,int:Yn,intHex:zn,intOct:Vn,intTime:rr,map:Be,merge:ie,null:Ft,omap:Ls,pairs:Ns,seq:Ie,set:Os,timestamp:wt},ao={"tag:yaml.org,2002:binary":ws,"tag:yaml.org,2002:merge":ie,"tag:yaml.org,2002:omap":Ls,"tag:yaml.org,2002:pairs":Ns,"tag:yaml.org,2002:set":Os,"tag:yaml.org,2002:timestamp":wt};function Lt(s,e,t){const n=Ks.get(e);if(n&&!s)return t&&!n.includes(ie)?n.concat(ie):n.slice();let r=n;if(!r)if(Array.isArray(s))r=[];else{const i=Array.from(Ks.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(const i of s)r=r.concat(i);else typeof s=="function"&&(r=s(r.slice()));return t&&(r=r.concat(ie)),r.reduce((i,o)=>{const a=typeof o=="string"?Hs[o]:o;if(!a){const u=JSON.stringify(o),c=Object.keys(Hs).map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${c}`)}return i.includes(a)||i.push(a),i},[])}const co=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0;let lo=class or{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Lt(e,"compat"):e?Lt(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=r?ao:{},this.tags=Lt(t,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,ce,{value:Be}),Object.defineProperty(this,Z,{value:bt}),Object.defineProperty(this,Le,{value:Ie}),this.sortMapEntries=typeof o=="function"?o:o===!0?co:null}clone(){const e=Object.create(or.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};function ho(s,e){const t=[];let n=e.directives===!0;if(e.directives!==!1&&s.directives){const u=s.directives.toString(s);u?(t.push(u),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");const r=Rn(s,e),{commentString:i}=r.options;if(s.commentBefore){t.length!==1&&t.unshift("");const u=i(s.commentBefore);t.unshift(ne(u,""))}let o=!1,a=null;if(s.contents){if(_(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){const l=i(s.contents.commentBefore);t.push(ne(l,""))}r.forceBlockIndent=!!s.comment,a=s.contents.comment}const u=a?void 0:()=>o=!0;let c=we(s.contents,r,()=>a=null,u);a&&(c+=de(c,"",i(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(we(s.contents,r));if(s.directives?.docEnd)if(s.comment){const u=i(s.comment);u.includes(`
|
|
55
|
+
`)?(t.push("..."),t.push(ne(u,""))):t.push(`... ${u}`)}else t.push("...");else{let u=s.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(ne(i(u),"")))}return t.join(`
|
|
56
|
+
`)+`
|
|
57
|
+
`}let ur=class ar{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,z,{value:us});let r=null;typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);const 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 ve({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){const e=Object.create(ar.prototype,{[z]:{value:us}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=_(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Ee(this.contents)&&this.contents.add(e)}addIn(e,t){Ee(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=Bn(this);e.anchor=!t||n.has(t)?In(t||"a",n):t}return new As(e.anchor)}createNode(e,t,n){let r;if(typeof t=="function")e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){const D=C=>typeof C=="number"||C instanceof String||C instanceof Number,f=t.filter(D).map(String);f.length>0&&(t=t.concat(f)),r=t}else n===void 0&&t&&(n=t,t=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:u,onTagObj:c,tag:l}=n??{},{onAnchor:d,setAnchors:m,sourceObjects:g}=_i(this,o||"a"),y={aliasDuplicateObjects:i??!0,keepUndefined:u??!1,onAnchor:d,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:g},p=Ke(e,l,y);return a&&T(p)&&(p.flow=!0),m(),p}createPair(e,t,n={}){const r=this.createNode(e,null,n),i=this.createNode(t,null,n);return new q(r,i)}delete(e){return Ee(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Re(e)?this.contents==null?!1:(this.contents=null,!0):Ee(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return T(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Re(e)?!t&&x(this.contents)?this.contents.value:this.contents:T(this.contents)?this.contents.getIn(e,t):void 0}has(e){return T(this.contents)?this.contents.has(e):!1}hasIn(e){return Re(e)?this.contents!==void 0:T(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=ft(this.schema,[e],t):Ee(this.contents)&&this.contents.set(e,t)}setIn(e,t){Re(e)?this.contents=t:this.contents==null?this.contents=ft(this.schema,Array.from(e),t):Ee(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 ve({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 ve({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const 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 lo(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}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},u=Y(this.contents,t??"",a);if(typeof i=="function")for(const{count:c,res:l}of a.anchors.values())i(l,c);return typeof o=="function"?Ae(o,{"":u},"",u):u}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)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return ho(this,e)}};function Ee(s){if(T(s))return!0;throw new Error("Expected a YAML collection as document contents")}let cr=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},Te=class extends cr{constructor(e,t,n){super("YAMLParseError",e,t,n)}},fo=class extends cr{constructor(e,t,n){super("YAMLWarning",e,t,n)}};const qs=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));const{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){const a=Math.min(i-39,o.length-79);o="…"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),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)+`…
|
|
58
|
+
`),o=a+o}if(/[^ ]/.test(o)){let a=1;const u=t.linePos[1];u?.line===n&&u.col>r&&(a=Math.max(1,Math.min(u.col-r,80-i)));const c=" ".repeat(i)+"^".repeat(a);t.message+=`:
|
|
59
|
+
|
|
60
|
+
${o}
|
|
61
|
+
${c}
|
|
62
|
+
`}};function Ne(s,{flow:e,indicator:t,next:n,offset:r,onError:i,parentIndent:o,startOnNewline:a}){let u=!1,c=a,l=a,d="",m="",g=!1,y=!1,p=null,D=null,f=null,C=null,b=null,h=null,E=null;for(const v of s)switch(y&&(v.type!=="space"&&v.type!=="newline"&&v.type!=="comma"&&i(v.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),p&&(c&&v.type!=="comment"&&v.type!=="newline"&&i(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),v.type){case"space":!e&&(t!=="doc-start"||n?.type!=="flow-collection")&&v.source.includes(" ")&&(p=v),l=!0;break;case"comment":{l||i(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const I=v.source.substring(1)||" ";d?d+=m+I:d=I,m="",c=!1;break}case"newline":c?d?d+=v.source:(!h||t!=="seq-item-ind")&&(u=!0):m+=v.source,c=!0,g=!0,(D||f)&&(C=v),l=!0;break;case"anchor":D&&i(v,"MULTIPLE_ANCHORS","A node can have at most one anchor"),v.source.endsWith(":")&&i(v.offset+v.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),D=v,E??(E=v.offset),c=!1,l=!1,y=!0;break;case"tag":{f&&i(v,"MULTIPLE_TAGS","A node can have at most one tag"),f=v,E??(E=v.offset),c=!1,l=!1,y=!0;break}case t:(D||f)&&i(v,"BAD_PROP_ORDER",`Anchors and tags must be after the ${v.source} indicator`),h&&i(v,"UNEXPECTED_TOKEN",`Unexpected ${v.source} in ${e??"collection"}`),h=v,c=t==="seq-item-ind"||t==="explicit-key-ind",l=!1;break;case"comma":if(e){b&&i(v,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=v,c=!1,l=!1;break}default:i(v,"UNEXPECTED_TOKEN",`Unexpected ${v.type} token`),c=!1,l=!1}const A=s[s.length-1],w=A?A.offset+A.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"),p&&(c&&p.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&i(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:h,spaceBefore:u,comment:d,hasNewline:g,anchor:D,tag:f,newlineAfterProp:C,end:w,start:E??w}}function He(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
|
|
63
|
+
`))return!0;if(s.end){for(const e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of s.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(He(e.key)||He(e.value))return!0}return!1;default:return!0}}function hs(s,e,t){if(e?.type==="flow-collection"){const n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&He(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function lr(s,e,t){const{uniqueKeys:n}=s.options;if(n===!1)return!1;const r=typeof n=="function"?n:(i,o)=>i===o||x(i)&&x(o)&&i.value===o.value;return e.some(i=>r(i.key,t))}const Ws="All mapping items must start at the same column";function po({composeNode:s,composeEmptyNode:e},t,n,r,i){const o=i?.nodeClass??V,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let u=n.offset,c=null;for(const l of n.items){const{start:d,key:m,sep:g,value:y}=l,p=Ne(d,{indicator:"explicit-key-ind",next:m??g?.[0],offset:u,onError:r,parentIndent:n.indent,startOnNewline:!0}),D=!p.found;if(D){if(m&&(m.type==="block-seq"?r(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==n.indent&&r(u,"BAD_INDENT",Ws)),!p.anchor&&!p.tag&&!g){c=p.end,p.comment&&(a.comment?a.comment+=`
|
|
64
|
+
`+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||He(m))&&r(m??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==n.indent&&r(u,"BAD_INDENT",Ws);t.atKey=!0;const f=p.end,C=m?s(t,m,p,r):e(t,f,d,null,p,r);t.schema.compat&&hs(n.indent,m,r),t.atKey=!1,lr(t,a.items,C)&&r(f,"DUPLICATE_KEY","Map keys must be unique");const b=Ne(g??[],{indicator:"map-value-ind",next:y,offset:C.range[2],onError:r,parentIndent:n.indent,startOnNewline:!m||m.type==="block-scalar"});if(u=b.end,b.found){D&&(y?.type==="block-map"&&!b.hasNewline&&r(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&p.start<b.found.offset-1024&&r(C.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const h=y?s(t,y,b,r):e(t,u,g,null,b,r);t.schema.compat&&hs(n.indent,y,r),u=h.range[2];const E=new q(C,h);t.options.keepSourceTokens&&(E.srcToken=l),a.items.push(E)}else{D&&r(C.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(C.comment?C.comment+=`
|
|
65
|
+
`+b.comment:C.comment=b.comment);const h=new q(C);t.options.keepSourceTokens&&(h.srcToken=l),a.items.push(h)}}return c&&c<u&&r(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,u,c??u],a}function mo({composeNode:s,composeEmptyNode:e},t,n,r,i){const o=i?.nodeClass??De,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let u=n.offset,c=null;for(const{start:l,value:d}of n.items){const m=Ne(l,{indicator:"seq-item-ind",next:d,offset:u,onError:r,parentIndent:n.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||d)d?.type==="block-seq"?r(m.end,"BAD_INDENT","All sequence items must start at the same column"):r(u,"MISSING_CHAR","Sequence item without - indicator");else{c=m.end,m.comment&&(a.comment=m.comment);continue}const g=d?s(t,d,m,r):e(t,m.end,l,null,m,r);t.schema.compat&&hs(n.indent,d,r),u=g.range[2],a.items.push(g)}return a.range=[n.offset,u,c??u],a}function ze(s,e,t,n){let r="";if(s){let i=!1,o="";for(const a of s){const{source:u,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");const l=u.substring(1)||" ";r?r+=o+l:r=l,o="";break}case"newline":r&&(o+=u),i=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=u.length}}return{comment:r,offset:e}}const $t="Block collections are not allowed within flow collections",Ot=s=>s&&(s.type==="block-map"||s.type==="block-seq");function Do({composeNode:s,composeEmptyNode:e},t,n,r,i){const o=n.start.source==="{",a=o?"flow map":"flow sequence",u=i?.nodeClass??(o?V:De),c=new u(t.schema);c.flow=!0;const l=t.atRoot;l&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let d=n.offset+n.start.source.length;for(let D=0;D<n.items.length;++D){const f=n.items[D],{start:C,key:b,sep:h,value:E}=f,A=Ne(C,{flow:a,indicator:"explicit-key-ind",next:b??h?.[0],offset:d,onError:r,parentIndent:n.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!h&&!E){D===0&&A.comma?r(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):D<n.items.length-1&&r(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),A.comment&&(c.comment?c.comment+=`
|
|
66
|
+
`+A.comment:c.comment=A.comment),d=A.end;continue}!o&&t.options.strict&&He(b)&&r(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(D===0)A.comma&&r(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(A.comma||r(A.start,"MISSING_CHAR",`Missing , between ${a} items`),A.comment){let w="";e:for(const v of C)switch(v.type){case"comma":case"space":break;case"comment":w=v.source.substring(1);break e;default:break e}if(w){let v=c.items[c.items.length-1];j(v)&&(v=v.value??v.key),v.comment?v.comment+=`
|
|
67
|
+
`+w:v.comment=w,A.comment=A.comment.substring(w.length+1)}}if(!o&&!h&&!A.found){const w=E?s(t,E,A,r):e(t,A.end,h,null,A,r);c.items.push(w),d=w.range[2],Ot(E)&&r(w.range,"BLOCK_IN_FLOW",$t)}else{t.atKey=!0;const w=A.end,v=b?s(t,b,A,r):e(t,w,C,null,A,r);Ot(b)&&r(v.range,"BLOCK_IN_FLOW",$t),t.atKey=!1;const I=Ne(h??[],{flow:a,indicator:"map-value-ind",next:E,offset:v.range[2],onError:r,parentIndent:n.indent,startOnNewline:!1});if(I.found){if(!o&&!A.found&&t.options.strict){if(h)for(const G of h){if(G===I.found)break;if(G.type==="newline"){r(G,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<I.found.offset-1024&&r(I.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else E&&("source"in E&&E.source?.[0]===":"?r(E,"MISSING_CHAR",`Missing space after : in ${a}`):r(I.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const M=E?s(t,E,I,r):I.found?e(t,I.end,h,null,I,r):null;M?Ot(E)&&r(M.range,"BLOCK_IN_FLOW",$t):I.comment&&(v.comment?v.comment+=`
|
|
68
|
+
`+I.comment:v.comment=I.comment);const ge=new q(v,M);if(t.options.keepSourceTokens&&(ge.srcToken=f),o){const G=c;lr(t,G.items,v)&&r(w,"DUPLICATE_KEY","Map keys must be unique"),G.items.push(ge)}else{const G=new V(t.schema);G.flow=!0,G.items.push(ge);const js=(M??v).range;G.range=[v.range[0],js[1],js[2]],c.items.push(G)}d=M?M.range[2]:I.end}}const m=o?"}":"]",[g,...y]=n.end;let p=d;if(g?.source===m)p=g.offset+g.source.length;else{const D=a[0].toUpperCase()+a.substring(1),f=l?`${D} must end with a ${m}`:`${D} in block collection must be sufficiently indented and end with a ${m}`;r(d,l?"MISSING_CHAR":"BAD_INDENT",f),g&&g.source.length!==1&&y.unshift(g)}if(y.length>0){const D=ze(y,p,t.options.strict,r);D.comment&&(c.comment?c.comment+=`
|
|
69
|
+
`+D.comment:c.comment=D.comment),c.range=[n.offset,p,D.offset]}else c.range=[n.offset,p,p];return c}function Bt(s,e,t,n,r,i){const o=t.type==="block-map"?po(s,e,t,n,i):t.type==="block-seq"?mo(s,e,t,n,i):Do(s,e,t,n,i),a=o.constructor;return r==="!"||r===a.tagName?(o.tag=a.tagName,o):(r&&(o.tag=r),o)}function go(s,e,t,n,r){const i=n.tag,o=i?e.directives.tagName(i.source,m=>r(i,"TAG_RESOLVE_FAILED",m)):null;if(t.type==="block-seq"){const{anchor:m,newlineAfterProp:g}=n,y=m&&i?m.offset>i.offset?m:i:m??i;y&&(!g||g.offset<y.offset)&&r(y,"MISSING_CHAR","Missing newline after block sequence props")}const a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===V.tagName&&a==="map"||o===De.tagName&&a==="seq")return Bt(s,e,t,r,o);let u=e.schema.tags.find(m=>m.tag===o&&m.collection===a);if(!u){const m=e.schema.knownTags[o];if(m?.collection===a)e.schema.tags.push(Object.assign({},m,{default:!1})),u=m;else return m?r(i,"BAD_COLLECTION_TYPE",`${m.tag} used for ${a} collection, but expects ${m.collection??"scalar"}`,!0):r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Bt(s,e,t,r,o)}const c=Bt(s,e,t,r,o,u),l=u.resolve?.(c,m=>r(i,"TAG_RESOLVE_FAILED",m),e.options)??c,d=_(l)?l:new $(l);return d.range=c.range,d.tag=o,u?.format&&(d.format=u.format),d}function Eo(s,e,t){const n=e.offset,r=yo(e,s.options.strict,t);if(!r)return{value:"",type:null,comment:"",range:[n,n,n]};const i=r.mode===">"?$.BLOCK_FOLDED:$.BLOCK_LITERAL,o=e.source?Co(e.source):[];let a=o.length;for(let p=o.length-1;p>=0;--p){const D=o[p][1];if(D===""||D==="\r")a=p;else break}if(a===0){const p=r.chomp==="+"&&o.length>0?`
|
|
70
|
+
`.repeat(Math.max(1,o.length-1)):"";let D=n+r.length;return e.source&&(D+=e.source.length),{value:p,type:i,comment:r.comment,range:[n,D,D]}}let u=e.indent+r.indent,c=e.offset+r.length,l=0;for(let p=0;p<a;++p){const[D,f]=o[p];if(f===""||f==="\r")r.indent===0&&D.length>u&&(u=D.length);else{D.length<u&&t(c+D.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(u=D.length),l=p,u===0&&!s.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=D.length+f.length+1}for(let p=o.length-1;p>=a;--p)o[p][0].length>u&&(a=p+1);let d="",m="",g=!1;for(let p=0;p<l;++p)d+=o[p][0].slice(u)+`
|
|
71
|
+
`;for(let p=l;p<a;++p){let[D,f]=o[p];c+=D.length+f.length+1;const C=f[f.length-1]==="\r";if(C&&(f=f.slice(0,-1)),f&&D.length<u){const b=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;t(c-f.length-(C?2:1),"BAD_INDENT",b),D=""}i===$.BLOCK_LITERAL?(d+=m+D.slice(u)+f,m=`
|
|
72
|
+
`):D.length>u||f[0]===" "?(m===" "?m=`
|
|
73
|
+
`:!g&&m===`
|
|
74
|
+
`&&(m=`
|
|
75
|
+
|
|
76
|
+
`),d+=m+D.slice(u)+f,m=`
|
|
77
|
+
`,g=!0):f===""?m===`
|
|
78
|
+
`?d+=`
|
|
79
|
+
`:m=`
|
|
80
|
+
`:(d+=m+f,m=" ",g=!1)}switch(r.chomp){case"-":break;case"+":for(let p=a;p<o.length;++p)d+=`
|
|
81
|
+
`+o[p][0].slice(u);d[d.length-1]!==`
|
|
82
|
+
`&&(d+=`
|
|
83
|
+
`);break;default:d+=`
|
|
84
|
+
`}const y=n+r.length+e.source.length;return{value:d,type:i,comment:r.comment,range:[n,y,y]}}function yo({offset:s,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=e[0],i=r[0];let o=0,a="",u=-1;for(let m=1;m<r.length;++m){const g=r[m];if(!a&&(g==="-"||g==="+"))a=g;else{const y=Number(g);!o&&y?o=y:u===-1&&(u=s+m)}}u!==-1&&n(u,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,l="",d=r.length;for(let m=1;m<e.length;++m){const g=e[m];switch(g.type){case"space":c=!0;case"newline":d+=g.source.length;break;case"comment":t&&!c&&n(g,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=g.source.length,l=g.source.substring(1);break;case"error":n(g,"UNEXPECTED_TOKEN",g.message),d+=g.source.length;break;default:{const y=`Unexpected token in block scalar header: ${g.type}`;n(g,"UNEXPECTED_TOKEN",y);const p=g.source;p&&typeof p=="string"&&(d+=p.length)}}}return{mode:i,indent:o,chomp:a,comment:l,length:d}}function Co(s){const e=s.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),r=[n?.[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let i=1;i<e.length;i+=2)r.push([e[i],e[i+1]]);return r}function Ao(s,e,t){const{offset:n,type:r,source:i,end:o}=s;let a,u;const c=(m,g,y)=>t(n+m,g,y);switch(r){case"scalar":a=$.PLAIN,u=bo(i,c);break;case"single-quoted-scalar":a=$.QUOTE_SINGLE,u=Fo(i,c);break;case"double-quoted-scalar":a=$.QUOTE_DOUBLE,u=vo(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]}}const l=n+i.length,d=ze(o,l,e,t);return{value:u,type:a,comment:d.comment,range:[n,l,d.offset]}}function bo(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}`),hr(s)}function Fo(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),hr(s.slice(1,-1)).replace(/''/g,"'")}function hr(s){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
85
|
+
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
86
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(s);if(!n)return s;let r=n[1],i=" ",o=e.lastIndex;for(t.lastIndex=o;n=t.exec(s);)n[1]===""?i===`
|
|
87
|
+
`?r+=i:i=`
|
|
88
|
+
`:(r+=i+n[1],i=" "),o=t.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(s),r+i+(n?.[1]??"")}function vo(s,e){let t="";for(let n=1;n<s.length-1;++n){const r=s[n];if(!(r==="\r"&&s[n+1]===`
|
|
89
|
+
`))if(r===`
|
|
90
|
+
`){const{fold:i,offset:o}=So(s,n);t+=i,n=o}else if(r==="\\"){let i=s[++n];const o=wo[i];if(o)t+=o;else if(i===`
|
|
91
|
+
`)for(i=s[n+1];i===" "||i===" ";)i=s[++n+1];else if(i==="\r"&&s[n+1]===`
|
|
92
|
+
`)for(i=s[++n+1];i===" "||i===" ";)i=s[++n+1];else if(i==="x"||i==="u"||i==="U"){const a=i==="x"?2:i==="u"?4:8;t+=No(s,n+1,a,e),n+=a}else{const a=s.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(r===" "||r===" "){const i=n;let o=s[n+1];for(;o===" "||o===" ";)o=s[++n+1];o!==`
|
|
93
|
+
`&&!(o==="\r"&&s[n+2]===`
|
|
94
|
+
`)&&(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 So(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`
|
|
95
|
+
`||n==="\r")&&!(n==="\r"&&s[e+2]!==`
|
|
96
|
+
`);)n===`
|
|
97
|
+
`&&(t+=`
|
|
98
|
+
`),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}const wo={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
99
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function No(s,e,t,n){const r=s.substr(e,t),i=r.length===t&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(i)}catch{const o=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}}function fr(s,e,t,n){const{value:r,type:i,comment:o,range:a}=e.type==="block-scalar"?Eo(s,e,n):Ao(e,s.options.strict,n),u=t?s.directives.tagName(t.source,d=>n(t,"TAG_RESOLVE_FAILED",d)):null;let c;s.options.stringKeys&&s.atKey?c=s.schema[Z]:u?c=Lo(s.schema,r,u,t,n):e.type==="scalar"?c=$o(s,r,e,n):c=s.schema[Z];let l;try{const d=c.resolve(r,m=>n(t??e,"TAG_RESOLVE_FAILED",m),s.options);l=x(d)?d:new $(d)}catch(d){const m=d instanceof Error?d.message:String(d);n(t??e,"TAG_RESOLVE_FAILED",m),l=new $(r)}return l.range=a,l.source=r,i&&(l.type=i),u&&(l.tag=u),c.format&&(l.format=c.format),o&&(l.comment=o),l}function Lo(s,e,t,n,r){if(t==="!")return s[Z];const i=[];for(const a of s.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)i.push(a);else return a;for(const a of i)if(a.test?.test(e))return a;const 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[Z])}function $o({atKey:s,directives:e,schema:t},n,r,i){const o=t.tags.find(a=>(a.default===!0||s&&a.default==="key")&&a.test?.test(n))||t[Z];if(t.compat){const a=t.compat.find(u=>u.default&&u.test?.test(n))??t[Z];if(o.tag!==a.tag){const u=e.tagString(o.tag),c=e.tagString(a.tag),l=`Value may be parsed as either ${u} or ${c}`;i(r,"TAG_RESOLVE_FAILED",l,!0)}}return o}function Oo(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}const Bo={composeNode:pr,composeEmptyNode:Is};function pr(s,e,t,n){const r=s.atKey,{spaceBefore:i,comment:o,anchor:a,tag:u}=t;let c,l=!0;switch(e.type){case"alias":c=Io(s,e,n),(a||u)&&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=fr(s,e,u,n),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=go(Bo,s,e,t,n),a&&(c.anchor=a.source.substring(1))}catch(d){const m=d instanceof Error?d.message:String(d);n(e,"RESOURCE_EXHAUSTION",m)}break;default:{const d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),l=!1}}return c??(c=Is(s,e.offset,void 0,null,t,n)),a&&c.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),r&&s.options.stringKeys&&(!x(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(u??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&&l&&(c.srcToken=e),c}function Is(s,e,t,n,{spaceBefore:r,comment:i,anchor:o,tag:a,end:u},c){const l={type:"scalar",offset:Oo(e,t,n),indent:-1,source:""},d=fr(s,l,a,c);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(d.spaceBefore=!0),i&&(d.comment=i,d.range[2]=u),d}function Io({options:s},{offset:e,source:t,end:n},r){const i=new As(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);const o=e+t.length,a=ze(n,o,s.strict,r);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}function xo(s,e,{offset:t,start:n,value:r,end:i},o){const a=Object.assign({_directives:e},s),u=new ur(void 0,a),c={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},l=Ne(n,{indicator:"doc-start",next:r??i?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(u.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!l.hasNewline&&o(l.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=r?pr(c,r,l,o):Is(c,l.end,n,null,l,o);const d=u.contents.range[2],m=ze(i,d,!1,o);return m.comment&&(u.comment=m.comment),u.range=[t,d,m.offset],u}function xe(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];const{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function Vs(s){let e="",t=!1,n=!1;for(let r=0;r<s.length;++r){const i=s[r];switch(i[0]){case"#":e+=(e===""?"":n?`
|
|
100
|
+
|
|
101
|
+
`:`
|
|
102
|
+
`)+(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}}let ko=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,r,i)=>{const o=xe(t);i?this.warnings.push(new fo(o,n,r)):this.errors.push(new Te(o,n,r))},this.directives=new ve({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:r}=Vs(this.prelude);if(n){const i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
103
|
+
${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(T(i)&&!i.flow&&i.items.length>0){let o=i.items[0];j(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${n}
|
|
104
|
+
${a}`:n}else{const o=i.commentBefore;i.commentBefore=o?`${n}
|
|
105
|
+
${o}`:n}}if(t){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Vs(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(const r of e)yield*this.next(r);yield*this.end(t,n)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,n,r)=>{const i=xe(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=xo(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":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Te(xe(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const n="Unexpected doc-end without preceding document";this.errors.push(new Te(xe(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;const t=ze(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const n=this.doc.comment;this.doc.comment=n?`${n}
|
|
106
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Te(xe(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){const n=Object.assign({_directives:this.directives},this.options),r=new ur(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}}};const dr="\uFEFF",mr="",Dr="",fs="";function Po(s){switch(s){case dr:return"byte-order-mark";case mr:return"doc-mode";case Dr:return"flow-error-end";case fs:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
107
|
+
`:case`\r
|
|
108
|
+
`: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}function X(s){switch(s){case void 0:case" ":case`
|
|
109
|
+
`:case"\r":case" ":return!0;default:return!1}}const Ys=new Set("0123456789ABCDEFabcdef"),Ro=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Ze=new Set(",[]{}"),To=new Set(` ,[]{}
|
|
110
|
+
\r `),It=s=>!s||To.has(s);let _o=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===`
|
|
111
|
+
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
112
|
+
`:!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"){const r=this.buffer[n+e+1];if(r===`
|
|
113
|
+
`||!r&&!this.atEnd)return e+n+1}return t===`
|
|
114
|
+
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){const n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&X(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(`
|
|
115
|
+
`,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]===dr&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){const i=e[n-1];if(i===" "||i===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){const i=e[t-1];if(i===" "||i===" ")t-=1;else break}const r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield mr,yield*this.parseLineStart()}*parseLineStart(){const 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");const t=this.peek(3);if((t==="---"||t==="...")&&X(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&&!X(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&X(t)){const n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const 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(It),"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);const r=this.getLine();if(r===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&r[0]!=="#"||n===0&&(r.startsWith("---")||r.startsWith("..."))&&X(r[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Dr,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(It),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||X(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let 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)}const n=this.buffer.substring(0,t);let r=n.indexOf(`
|
|
116
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){const i=this.continueScalar(r+1);if(i===-1)break;r=n.indexOf(`
|
|
117
|
+
`,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(;;){const 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=>X(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`
|
|
118
|
+
`:e=i,t=0;break;case"\r":{const o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
119
|
+
`)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{const i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
|
|
120
|
+
`,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===`
|
|
121
|
+
`;)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]);const a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
|
|
122
|
+
`&&i>=this.pos&&i+1+t>a)e=i;else break}while(!0);return yield fs,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===":"){const i=this.buffer[n+1];if(X(i)||e&&Ze.has(i))break;t=n}else if(X(r)){let i=this.buffer[n+1];if(r==="\r"&&(i===`
|
|
123
|
+
`?(n+=1,r=`
|
|
124
|
+
`,i=this.buffer[n+1]):t=n),i==="#"||e&&Ze.has(i))break;if(r===`
|
|
125
|
+
`){const o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&Ze.has(r))break;t=n}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield fs,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){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(It),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(X(n)||t&&Ze.has(n)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!X(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(Ro.has(t))t=this.buffer[++e];else if(t==="%"&&Ys.has(this.buffer[e+1])&&Ys.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
|
|
126
|
+
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
127
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");const 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)}},jo=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){const 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};const r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function ae(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}function zs(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 gr(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 et(s){switch(s.type){case"document":return s.start;case"block-map":{const 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 ye(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 dt(s,e){if(e.length<1e5)Array.prototype.push.apply(s,e);else for(let t=0;t<e.length;++t)s.push(e[t])}function Xs(s){if(s.start.type==="flow-seq-start")for(const e of s.items)e.sep&&!e.value&&!ae(e.start,"explicit-key-ind")&&!ae(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,gr(e.value)?e.value.end?dt(e.value.end,e.sep):e.value.end=e.sep:dt(e.start,e.sep),delete e.sep)}let Go=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 _o,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=Po(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{const 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(){const 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){const 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{const 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"&&Xs(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{const 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":{const r=n.items[n.items.length-1];r.value?n.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{const 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")){const r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&zs(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":{const 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":{zs(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}const 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"){const t=et(this.peek(2)),n=ye(t);let r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];const 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(`
|
|
128
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
129
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const 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)){const n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){dt(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let i=[];if(r&&t.sep&&!t.value){const o=[];for(let a=0;a<t.sep.length;++a){const u=t.sep[a];switch(u.type){case"newline":o.push(a);break;case"space":break;case"comment":u.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(ae(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(gr(t.key)&&!ae(t.sep,"newline")){const o=ye(t.start),a=t.key,u=t.sep;u.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:u}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(ae(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const o=ye(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]}):ae(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":{const 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:{const o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!ae(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){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const 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)){const n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){dt(n,t.start),n.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||ae(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const 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":{const 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}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const 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"){const r=et(n),i=ye(r);Xs(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const 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(`
|
|
130
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
131
|
+
`,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;const t=et(e),n=ye(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;const t=et(e),n=ye(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())}}};function Mo(s){const e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new jo||null,prettyErrors:e}}function Uo(s,e={}){const{lineCounter:t,prettyErrors:n}=Mo(e),r=new Go(t?.addNewLine),i=new ko(e);let o=null;for(const a of i.compose(r.parse(s),!0,s.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Te(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(qs(s,t)),o.warnings.forEach(qs(s,t))),o}function mt(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);const r=Uo(s,t);if(!r)return null;if(r.warnings.forEach(i=>Tn(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))}async function Er(s,e,t){const{buffer:n,compression:r,encoding:i="utf8",flag:o,...a}={},u=await gs(s,{buffer:n,compression:r,encoding:i,flag:o});return typeof e=="function"?mt(u,e,a):mt(u,a)}function yr(s,e,t){const{buffer:n,compression:r,encoding:i="utf8",flag:o,...a}={},u=wn(s,{buffer:n,compression:r,encoding:i,flag:o});return typeof e=="function"?mt(u,e,a):mt(u,a)}var Ko=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Ho=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,qo=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,xt={Space_Separator:Ko,ID_Start:Ho,ID_Continue:qo},R={isSpaceSeparator(s){return typeof s=="string"&&xt.Space_Separator.test(s)},isIdStartChar(s){return typeof s=="string"&&(s>="a"&&s<="z"||s>="A"&&s<="Z"||s==="$"||s==="_"||xt.ID_Start.test(s))},isIdContinueChar(s){return typeof s=="string"&&(s>="a"&&s<="z"||s>="A"&&s<="Z"||s>="0"&&s<="9"||s==="$"||s==="_"||s===""||s===""||xt.ID_Continue.test(s))},isDigit(s){return typeof s=="string"&&/[0-9]/.test(s)},isHexDigit(s){return typeof s=="string"&&/[0-9A-Fa-f]/.test(s)}};let ps,H,se,Dt,le,J,K,xs,Ue;var Wo=function(s,e){ps=String(s),H="start",se=[],Dt=0,le=1,J=0,K=void 0,xs=void 0,Ue=void 0;do K=Vo(),Xo[H]();while(K.type!=="eof");return typeof e=="function"?ds({"":Ue},"",e):Ue};function ds(s,e,t){const n=s[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let r=0;r<n.length;r++){const i=String(r),o=ds(n,i,t);o===void 0?delete n[i]:Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(const r in n){const i=ds(n,r,t);i===void 0?delete n[r]:Object.defineProperty(n,r,{value:i,writable:!0,enumerable:!0,configurable:!0})}return t.call(s,e,n)}let O,L,_e,te,B;function Vo(){for(O="default",L="",_e=!1,te=1;;){B=oe();const s=Cr[O]();if(s)return s}}function oe(){if(ps[Dt])return String.fromCodePoint(ps.codePointAt(Dt))}function F(){const s=oe();return s===`
|
|
132
|
+
`?(le++,J=0):s?J+=s.length:J++,s&&(Dt+=s.length),s}const Cr={default(){switch(B){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
|
|
133
|
+
`:case"\r":case"\u2028":case"\u2029":F();return;case"/":F(),O="comment";return;case void 0:return F(),k("eof")}if(R.isSpaceSeparator(B)){F();return}return Cr[H]()},comment(){switch(B){case"*":F(),O="multiLineComment";return;case"/":F(),O="singleLineComment";return}throw P(F())},multiLineComment(){switch(B){case"*":F(),O="multiLineCommentAsterisk";return;case void 0:throw P(F())}F()},multiLineCommentAsterisk(){switch(B){case"*":F();return;case"/":F(),O="default";return;case void 0:throw P(F())}F(),O="multiLineComment"},singleLineComment(){switch(B){case`
|
|
134
|
+
`:case"\r":case"\u2028":case"\u2029":F(),O="default";return;case void 0:return F(),k("eof")}F()},value(){switch(B){case"{":case"[":return k("punctuator",F());case"n":return F(),he("ull"),k("null",null);case"t":return F(),he("rue"),k("boolean",!0);case"f":return F(),he("alse"),k("boolean",!1);case"-":case"+":F()==="-"&&(te=-1),O="sign";return;case".":L=F(),O="decimalPointLeading";return;case"0":L=F(),O="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":L=F(),O="decimalInteger";return;case"I":return F(),he("nfinity"),k("numeric",1/0);case"N":return F(),he("aN"),k("numeric",NaN);case'"':case"'":_e=F()==='"',L="",O="string";return}throw P(F())},identifierNameStartEscape(){if(B!=="u")throw P(F());F();const s=ms();switch(s){case"$":case"_":break;default:if(!R.isIdStartChar(s))throw Js();break}L+=s,O="identifierName"},identifierName(){switch(B){case"$":case"_":case"":case"":L+=F();return;case"\\":F(),O="identifierNameEscape";return}if(R.isIdContinueChar(B)){L+=F();return}return k("identifier",L)},identifierNameEscape(){if(B!=="u")throw P(F());F();const s=ms();switch(s){case"$":case"_":case"":case"":break;default:if(!R.isIdContinueChar(s))throw Js();break}L+=s,O="identifierName"},sign(){switch(B){case".":L=F(),O="decimalPointLeading";return;case"0":L=F(),O="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":L=F(),O="decimalInteger";return;case"I":return F(),he("nfinity"),k("numeric",te*(1/0));case"N":return F(),he("aN"),k("numeric",NaN)}throw P(F())},zero(){switch(B){case".":L+=F(),O="decimalPoint";return;case"e":case"E":L+=F(),O="decimalExponent";return;case"x":case"X":L+=F(),O="hexadecimal";return}return k("numeric",te*0)},decimalInteger(){switch(B){case".":L+=F(),O="decimalPoint";return;case"e":case"E":L+=F(),O="decimalExponent";return}if(R.isDigit(B)){L+=F();return}return k("numeric",te*Number(L))},decimalPointLeading(){if(R.isDigit(B)){L+=F(),O="decimalFraction";return}throw P(F())},decimalPoint(){switch(B){case"e":case"E":L+=F(),O="decimalExponent";return}if(R.isDigit(B)){L+=F(),O="decimalFraction";return}return k("numeric",te*Number(L))},decimalFraction(){switch(B){case"e":case"E":L+=F(),O="decimalExponent";return}if(R.isDigit(B)){L+=F();return}return k("numeric",te*Number(L))},decimalExponent(){switch(B){case"+":case"-":L+=F(),O="decimalExponentSign";return}if(R.isDigit(B)){L+=F(),O="decimalExponentInteger";return}throw P(F())},decimalExponentSign(){if(R.isDigit(B)){L+=F(),O="decimalExponentInteger";return}throw P(F())},decimalExponentInteger(){if(R.isDigit(B)){L+=F();return}return k("numeric",te*Number(L))},hexadecimal(){if(R.isHexDigit(B)){L+=F(),O="hexadecimalInteger";return}throw P(F())},hexadecimalInteger(){if(R.isHexDigit(B)){L+=F();return}return k("numeric",te*Number(L))},string(){switch(B){case"\\":F(),L+=Yo();return;case'"':if(_e)return F(),k("string",L);L+=F();return;case"'":if(!_e)return F(),k("string",L);L+=F();return;case`
|
|
135
|
+
`:case"\r":throw P(F());case"\u2028":case"\u2029":Jo(B);break;case void 0:throw P(F())}L+=F()},start(){switch(B){case"{":case"[":return k("punctuator",F())}O="value"},beforePropertyName(){switch(B){case"$":case"_":L=F(),O="identifierName";return;case"\\":F(),O="identifierNameStartEscape";return;case"}":return k("punctuator",F());case'"':case"'":_e=F()==='"',O="string";return}if(R.isIdStartChar(B)){L+=F(),O="identifierName";return}throw P(F())},afterPropertyName(){if(B===":")return k("punctuator",F());throw P(F())},beforePropertyValue(){O="value"},afterPropertyValue(){switch(B){case",":case"}":return k("punctuator",F())}throw P(F())},beforeArrayValue(){if(B==="]")return k("punctuator",F());O="value"},afterArrayValue(){switch(B){case",":case"]":return k("punctuator",F())}throw P(F())},end(){throw P(F())}};function k(s,e){return{type:s,value:e,line:le,column:J}}function he(s){for(const e of s){if(oe()!==e)throw P(F());F()}}function Yo(){switch(oe()){case"b":return F(),"\b";case"f":return F(),"\f";case"n":return F(),`
|
|
136
|
+
`;case"r":return F(),"\r";case"t":return F()," ";case"v":return F(),"\v";case"0":if(F(),R.isDigit(oe()))throw P(F());return"\0";case"x":return F(),zo();case"u":return F(),ms();case`
|
|
137
|
+
`:case"\u2028":case"\u2029":return F(),"";case"\r":return F(),oe()===`
|
|
138
|
+
`&&F(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw P(F());case void 0:throw P(F())}return F()}function zo(){let s="",e=oe();if(!R.isHexDigit(e)||(s+=F(),e=oe(),!R.isHexDigit(e)))throw P(F());return s+=F(),String.fromCodePoint(parseInt(s,16))}function ms(){let s="",e=4;for(;e-- >0;){const t=oe();if(!R.isHexDigit(t))throw P(F());s+=F()}return String.fromCodePoint(parseInt(s,16))}const Xo={start(){if(K.type==="eof")throw fe();kt()},beforePropertyName(){switch(K.type){case"identifier":case"string":xs=K.value,H="afterPropertyName";return;case"punctuator":tt();return;case"eof":throw fe()}},afterPropertyName(){if(K.type==="eof")throw fe();H="beforePropertyValue"},beforePropertyValue(){if(K.type==="eof")throw fe();kt()},beforeArrayValue(){if(K.type==="eof")throw fe();if(K.type==="punctuator"&&K.value==="]"){tt();return}kt()},afterPropertyValue(){if(K.type==="eof")throw fe();switch(K.value){case",":H="beforePropertyName";return;case"}":tt()}},afterArrayValue(){if(K.type==="eof")throw fe();switch(K.value){case",":H="beforeArrayValue";return;case"]":tt()}},end(){}};function kt(){let s;switch(K.type){case"punctuator":switch(K.value){case"{":s={};break;case"[":s=[];break}break;case"null":case"boolean":case"numeric":case"string":s=K.value;break}if(Ue===void 0)Ue=s;else{const e=se[se.length-1];Array.isArray(e)?e.push(s):Object.defineProperty(e,xs,{value:s,writable:!0,enumerable:!0,configurable:!0})}if(s!==null&&typeof s=="object")se.push(s),Array.isArray(s)?H="beforeArrayValue":H="beforePropertyName";else{const e=se[se.length-1];e==null?H="end":Array.isArray(e)?H="afterArrayValue":H="afterPropertyValue"}}function tt(){se.pop();const s=se[se.length-1];s==null?H="end":Array.isArray(s)?H="afterArrayValue":H="afterPropertyValue"}function P(s){return ks(s===void 0?`JSON5: invalid end of input at ${le}:${J}`:`JSON5: invalid character '${Ar(s)}' at ${le}:${J}`)}function fe(){return ks(`JSON5: invalid end of input at ${le}:${J}`)}function Js(){return J-=5,ks(`JSON5: invalid identifier character at ${le}:${J}`)}function Jo(s){console.warn(`JSON5: '${Ar(s)}' in strings is not valid ECMAScript; consider escaping`)}function Ar(s){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[s])return e[s];if(s<" "){const t=s.charCodeAt(0).toString(16);return"\\x"+("00"+t).substring(t.length)}return s}function ks(s){const e=new SyntaxError(s);return e.lineNumber=le,e.columnNumber=J,e}var Qo=function(s,e,t){const n=[];let r="",i,o,a="",u;if(e!=null&&typeof e=="object"&&!Array.isArray(e)&&(t=e.space,u=e.quote,e=e.replacer),typeof e=="function")o=e;else if(Array.isArray(e)){i=[];for(const y of e){let p;typeof y=="string"?p=y:(typeof y=="number"||y instanceof String||y instanceof Number)&&(p=String(y)),p!==void 0&&i.indexOf(p)<0&&i.push(p)}}return t instanceof Number?t=Number(t):t instanceof String&&(t=String(t)),typeof t=="number"?t>0&&(t=Math.min(10,Math.floor(t)),a=" ".substr(0,t)):typeof t=="string"&&(a=t.substr(0,10)),c("",{"":s});function c(y,p){let D=p[y];switch(D!=null&&(typeof D.toJSON5=="function"?D=D.toJSON5(y):typeof D.toJSON=="function"&&(D=D.toJSON(y))),o&&(D=o.call(p,y,D)),D instanceof Number?D=Number(D):D instanceof String?D=String(D):D instanceof Boolean&&(D=D.valueOf()),D){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof D=="string")return l(D);if(typeof D=="number")return String(D);if(typeof D=="object")return Array.isArray(D)?g(D):d(D)}function l(y){const p={"'":.1,'"':.2},D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let f="";for(let b=0;b<y.length;b++){const h=y[b];switch(h){case"'":case'"':p[h]++,f+=h;continue;case"\0":if(R.isDigit(y[b+1])){f+="\\x00";continue}}if(D[h]){f+=D[h];continue}if(h<" "){let E=h.charCodeAt(0).toString(16);f+="\\x"+("00"+E).substring(E.length);continue}f+=h}const C=u||Object.keys(p).reduce((b,h)=>p[b]<p[h]?b:h);return f=f.replace(new RegExp(C,"g"),D[C]),C+f+C}function d(y){if(n.indexOf(y)>=0)throw TypeError("Converting circular structure to JSON5");n.push(y);let p=r;r=r+a;let D=i||Object.keys(y),f=[];for(const b of D){const h=c(b,y);if(h!==void 0){let E=m(b)+":";a!==""&&(E+=" "),E+=h,f.push(E)}}let C;if(f.length===0)C="{}";else{let b;if(a==="")b=f.join(","),C="{"+b+"}";else{let h=`,
|
|
139
|
+
`+r;b=f.join(h),C=`{
|
|
140
|
+
`+r+b+`,
|
|
141
|
+
`+p+"}"}}return n.pop(),r=p,C}function m(y){if(y.length===0)return l(y);const p=String.fromCodePoint(y.codePointAt(0));if(!R.isIdStartChar(p))return l(y);for(let D=p.length;D<y.length;D++)if(!R.isIdContinueChar(String.fromCodePoint(y.codePointAt(D))))return l(y);return y}function g(y){if(n.indexOf(y)>=0)throw TypeError("Converting circular structure to JSON5");n.push(y);let p=r;r=r+a;let D=[];for(let C=0;C<y.length;C++){const b=c(String(C),y);D.push(b!==void 0?b:"null")}let f;if(D.length===0)f="[]";else if(a==="")f="["+D.join(",")+"]";else{let C=`,
|
|
142
|
+
`+r,b=D.join(C);f=`[
|
|
143
|
+
`+r+b+`,
|
|
144
|
+
`+p+"]"}return n.pop(),r=p,f}};const Zo={parse:Wo,stringify:Qo};var br=Zo;function eu(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Ps(s){if(Object.prototype.hasOwnProperty.call(s,"__esModule"))return s;var e=s.default;if(typeof e=="function"){var t=function n(){var r=!1;try{r=this instanceof n}catch{}return r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(n){var r=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return s[n]}})}),t}var Pt,Qs;function Fr(){return Qs||(Qs=1,Pt=process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),Pt}var Rt,Zs;function vr(){return Zs||(Zs=1,Rt={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}),Rt}var st={exports:{}},en;function tu(){return en||(en=1,(function(s,e){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:r}=vr(),i=Fr();e=s.exports={};const o=e.re=[],a=e.safeRe=[],u=e.src=[],c=e.safeSrc=[],l=e.t={};let d=0;const m="[a-zA-Z0-9-]",g=[["\\s",1],["\\d",r],[m,n]],y=D=>{for(const[f,C]of g)D=D.split(`${f}*`).join(`${f}{0,${C}}`).split(`${f}+`).join(`${f}{1,${C}}`);return D},p=(D,f,C)=>{const b=y(f),h=d++;i(D,h,f),l[D]=h,u[h]=f,c[h]=b,o[h]=new RegExp(f,C?"g":void 0),a[h]=new RegExp(b,C?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`),p("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${u[l.NONNUMERICIDENTIFIER]}|${u[l.NUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NONNUMERICIDENTIFIER]}|${u[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${m}+`),p("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),p("FULL",`^${u[l.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),p("LOOSE",`^${u[l.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),p("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`),p("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",u[l.COERCE],!0),p("COERCERTLFULL",u[l.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",p("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",p("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(st,st.exports)),st.exports}var Tt,tn;function su(){if(tn)return Tt;tn=1;const s=Object.freeze({loose:!0}),e=Object.freeze({});return Tt=n=>n?typeof n!="object"?s:n:e,Tt}var _t,sn;function nu(){if(sn)return _t;sn=1;const s=/^[0-9]+$/,e=(n,r)=>{if(typeof n=="number"&&typeof r=="number")return n===r?0:n<r?-1:1;const i=s.test(n),o=s.test(r);return i&&o&&(n=+n,r=+r),n===r?0:i&&!o?-1:o&&!i?1:n<r?-1:1};return _t={compareIdentifiers:e,rcompareIdentifiers:(n,r)=>e(r,n)},_t}var jt,nn;function ru(){if(nn)return jt;nn=1;const s=Fr(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:t}=vr(),{safeRe:n,t:r}=tu(),i=su(),{compareIdentifiers:o}=nu(),a=(c,l)=>{const d=l.split(".");if(d.length>c.length)return!1;for(let m=0;m<d.length;m++)if(o(c[m],d[m])!==0)return!1;return!0};class u{constructor(l,d){if(d=i(d),l instanceof u){if(l.loose===!!d.loose&&l.includePrerelease===!!d.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>e)throw new TypeError(`version is longer than ${e} characters`);s("SemVer",l,d),this.options=d,this.loose=!!d.loose,this.includePrerelease=!!d.includePrerelease;const m=l.trim().match(d.loose?n[r.LOOSE]:n[r.FULL]);if(!m)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>t||this.major<0)throw new TypeError("Invalid major version");if(this.minor>t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>t||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(g=>{if(/^[0-9]+$/.test(g)){const y=+g;if(y>=0&&y<t)return y}return g}):this.prerelease=[],this.build=m[5]?m[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(l){if(s("SemVer.compare",this.version,this.options,l),!(l instanceof u)){if(typeof l=="string"&&l===this.version)return 0;l=new u(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof u||(l=new u(l,this.options)),this.major<l.major?-1:this.major>l.major?1:this.minor<l.minor?-1:this.minor>l.minor?1:this.patch<l.patch?-1:this.patch>l.patch?1:0}comparePre(l){if(l instanceof u||(l=new u(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let d=0;do{const m=this.prerelease[d],g=l.prerelease[d];if(s("prerelease compare",d,m,g),m===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(m===void 0)return-1;if(m!==g)return o(m,g)}while(++d)}compareBuild(l){l instanceof u||(l=new u(l,this.options));let d=0;do{const m=this.build[d],g=l.build[d];if(s("build compare",d,m,g),m===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(m===void 0)return-1;if(m!==g)return o(m,g)}while(++d)}inc(l,d,m){if(l.startsWith("pre")){if(!d&&m===!1)throw new Error("invalid increment argument: identifier is empty");if(d){const g=`-${d}`.match(this.options.loose?n[r.PRERELEASELOOSE]:n[r.PRERELEASE]);if(!g||g[1]!==d)throw new Error(`invalid identifier: ${d}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",d,m);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",d,m);break;case"prepatch":this.prerelease.length=0,this.inc("patch",d,m),this.inc("pre",d,m);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",d,m),this.inc("pre",d,m);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const g=Number(m)?1:0;if(this.prerelease.length===0)this.prerelease=[g];else{let y=this.prerelease.length;for(;--y>=0;)typeof this.prerelease[y]=="number"&&(this.prerelease[y]++,y=-2);if(y===-1){if(d===this.prerelease.join(".")&&m===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(g)}}if(d){let y=[d,g];if(m===!1&&(y=[d]),a(this.prerelease,d)){const p=this.prerelease[d.split(".").length];isNaN(p)&&(this.prerelease=y)}else this.prerelease=y}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return jt=u,jt}var Gt,rn;function Sr(){if(rn)return Gt;rn=1;const s=ru();return Gt=(t,n,r=!1)=>{if(t instanceof s)return t;try{return new s(t,n)}catch(i){if(!r)return null;throw i}},Gt}var Mt,on;function iu(){if(on)return Mt;on=1;const s=Sr();return Mt=(t,n)=>{const r=s(t,n);return r?r.version:null},Mt}var Ut,un;function ou(){if(un)return Ut;un=1;const s=Sr();return Ut=(t,n)=>{const r=s(t.trim().replace(/^[=v]+/,""),n);return r?r.version:null},Ut}var Kt,an;function wr(){return an||(an=1,Kt=["0BSD","3D-Slicer-1.0","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","ALGLIB-Documentation","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Advanced-Cryptics-Dictionary","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","Artistic-dist","Aspell-RU","BOLA-1.1","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-2-Clause-first-lines","BSD-2-Clause-pkgconf-disclaimer","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-Tso","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Mark-Modifications","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Boehm-GC-without-fee","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","Buddy","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CAPEC-tou","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC-PDM-1.0","CC-SA-1.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","Catharon","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CryptoSwift","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","DocBook-DTD","DocBook-Schema","DocBook-Stylesheet","DocBook-XML","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","ESA-PL-permissive-2.4","ESA-PL-strong-copyleft-2.4","ESA-PL-weak-copyleft-2.4","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRSD","FSFULLRWD","FSL-1.1-ALv2","FSL-1.1-MIT","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Game-Programming-Gems","Giftware","Glide","Glulxe","Graphics-Gems","Gutmann","HDF5","HIDAPI","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Netrek","HPND-Pbmplus","HPND-SMC","HPND-UC","HPND-UC-export-US","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-merchantability-variant","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HPND-sell-variant-critical-systems","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ISO-permission","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","InnoSetup","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIPS","MIT","MIT-0","MIT-CMU","MIT-Click","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-STK","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MMPL-1.0.1","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-TNT","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTIA-PD","NTP","NTP-0","Naumen","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSC-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OSSP","OpenMDW-1.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","ParaType-Free-Font-1.3","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGMLUG-PM","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMAIL-GPL","SMLNJ","SMPPL","SNIA","SOFA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SUL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","Sendmail-Open-Source-1.1","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TekHVC","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","UnRAR","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","Vixie-Cron","W3C","W3C-19980720","W3C-20150513","WTFNMFPL","WTFPL","Watcom-1.0","Widget-Workshop","WordNet","Wsuipa","X11","X11-distribute-modifications-variant","X11-no-permit-persons","X11-swapped","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","any-OSI","any-OSI-perl-modules","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","cve-tou","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","generic-xts","gnuplot","gtkbook","hdparm","hyphen-bulgarian","iMatix","jove","libpng-1.6.35","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","man2html","metamail","mpi-permissive","mpich2","mplus","ngrep","pkgconf","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","threeparttable","ulem","w3m","wwl","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","xzoom","zlib-acknowledgement"]),Kt}var Ht,cn;function uu(){return cn||(cn=1,Ht=["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.1","LGPL-3.0","Net-SNMP","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"]),Ht}var qt,ln;function au(){return ln||(ln=1,qt=["389-exception","Asterisk-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"]),qt}var Wt,hn;function cu(){if(hn)return Wt;hn=1;var s=[].concat(wr()).concat(uu()),e=au();return Wt=function(t){var n=0;function r(){return n<t.length}function i(D){if(D instanceof RegExp){var f=t.slice(n),C=f.match(D);if(C)return n+=C[0].length,C[0]}else if(t.indexOf(D,n)===n)return n+=D.length,D}function o(){i(/[ ]*/)}function a(){for(var D,f=["WITH","AND","OR","(",")",":","+"],C=0;C<f.length&&(D=i(f[C]),!D);C++);if(D==="+"&&n>1&&t[n-2]===" ")throw new Error("Space before `+`");return D&&{type:"OPERATOR",string:D}}function u(){return i(/[A-Za-z0-9-.]+/)}function c(){var D=u();if(!D)throw new Error("Expected idstring at offset "+n);return D}function l(){if(i("DocumentRef-")){var D=c();return{type:"DOCUMENTREF",string:D}}}function d(){if(i("LicenseRef-")){var D=c();return{type:"LICENSEREF",string:D}}}function m(){var D=n,f=u();if(s.indexOf(f)!==-1)return{type:"LICENSE",string:f};if(e.indexOf(f)!==-1)return{type:"EXCEPTION",string:f};n=D}function g(){return a()||l()||d()||m()}for(var y=[];r()&&(o(),!!r());){var p=g();if(!p)throw new Error("Unexpected `"+t[n]+"` at offset "+n);y.push(p)}return y},Wt}var Vt,fn;function lu(){return fn||(fn=1,Vt=function(s){var e=0;function t(){return e<s.length}function n(){return t()?s[e]:null}function r(){if(!t())throw new Error;e++}function i(p){var D=n();if(D&&D.type==="OPERATOR"&&p===D.string)return r(),D.string}function o(){if(i("WITH")){var p=n();if(p&&p.type==="EXCEPTION")return r(),p.string;throw new Error("Expected exception after `WITH`")}}function a(){var p=e,D="",f=n();if(f.type==="DOCUMENTREF"&&(r(),D+="DocumentRef-"+f.string+":",!i(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(f=n(),f.type==="LICENSEREF")return r(),D+="LicenseRef-"+f.string,{license:D};e=p}function u(){var p=n();if(p&&p.type==="LICENSE"){r();var D={license:p.string};i("+")&&(D.plus=!0);var f=o();return f&&(D.exception=f),D}}function c(){var p=i("(");if(p){var D=g();if(!i(")"))throw new Error("Expected `)`");return D}}function l(){return c()||a()||u()}function d(p,D){return function f(){var C=D();if(C){if(!i(p))return C;var b=f();if(!b)throw new Error("Expected expression");return{left:C,conjunction:p.toLowerCase(),right:b}}}}var m=d("AND",l),g=d("OR",m),y=g();if(!y||t())throw new Error("Syntax error");return y}),Vt}var Yt,pn;function Nr(){if(pn)return Yt;pn=1;var s=cu(),e=lu();return Yt=function(t){return e(s(t))},Yt}var zt,dn;function hu(){if(dn)return zt;dn=1;var s=Nr(),e=wr();function t(f){try{return s(f),!0}catch{return!1}}function n(f,C){var b=C[0].length-f[0].length;return b!==0?b:f[0].toUpperCase().localeCompare(C[0].toUpperCase())}var r=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(n),i=0,o=1,a=[function(f){return f.toUpperCase()},function(f){return f.trim()},function(f){return f.replace(/\./g,"")},function(f){return f.replace(/\s+/g,"")},function(f){return f.replace(/\s+/g,"-")},function(f){return f.replace("v","-")},function(f){return f.replace(/,?\s*(\d)/,"-$1")},function(f){return f.replace(/,?\s*(\d)/,"-$1.0")},function(f){return f.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(f){return f.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(f){return f[0].toUpperCase()+f.slice(1)},function(f){return f.replace("/","-")},function(f){return f.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(f){return f.indexOf("3.0")!==-1?f+"-or-later":f+"-only"},function(f){return f+"only"},function(f){return f.replace(/(\d)$/,"-$1.0")},function(f){return f.replace(/(-| )?(\d)$/,"-$2-Clause")},function(f){return f.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(f){return f.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(f){return f.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(f){return f.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(f){return f.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(f){return f.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(f){return"CC-"+f},function(f){return"CC-"+f+"-4.0"},function(f){return f.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(f){return"CC-"+f.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],u=e.map(function(f){var C=/^(.*)-\d+\.\d+$/.exec(f);return C?[C[0],C[1]]:[f,null]}).reduce(function(f,C){var b=C[1];return f[b]=f[b]||[],f[b].push(C[0]),f},{}),c=Object.keys(u).map(function(f){return[f,u[f]]}).filter(function(f){return f[1].length===1&&f[0]!==null&&f[0]!=="APL"}).map(function(f){return[f[0],f[1][0]]});u=void 0;var l=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(c).sort(n),d=0,m=1,g=function(f){for(var C=0;C<a.length;C++){var b=a[C](f).trim();if(b!==f&&t(b))return b}return null},y=function(f){for(var C=f.toUpperCase(),b=0;b<l.length;b++){var h=l[b];if(C.indexOf(h[d])>-1)return h[m]}return null},p=function(f,C){for(var b=0;b<r.length;b++){var h=r[b],E=h[i];if(f.indexOf(E)>-1){var A=f.replace(E,h[o]),w=C(A);if(w!==null)return w}}return null};zt=function(f,C){C=C||{};var b=C.upgrade===void 0?!0:!!C.upgrade;function h(v){return b?D(v):v}var E=typeof f=="string"&&f.trim().length!==0;if(!E)throw Error("Invalid argument. Expected non-empty string.");if(f=f.trim(),t(f))return h(f);var A=f.replace(/\+$/,"").trim();if(t(A))return h(A);var w=g(f);return w!==null||(w=p(f,function(v){return t(v)?v:g(v)}),w!==null)||(w=y(f),w!==null)||(w=p(f,y),w!==null)?h(w):null};function D(f){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(f)!==-1?f+"-only":["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(f)!==-1?f.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(f)!==-1?f+"-or-later":f}return zt}var Xt,mn;function fu(){if(mn)return Xt;mn=1;var s=Nr(),e=hu(),t='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',n=/^SEE LICEN[CS]E IN (.+)$/;function r(o,a){return a.slice(0,o.length)===o}function i(o){if(o.hasOwnProperty("license")){var a=o.license;return r("LicenseRef",a)||r("DocumentRef",a)}else return i(o.left)||i(o.right)}return Xt=function(o){var a;try{a=s(o)}catch{var u;if(o==="UNLICENSED"||o==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(u=n.exec(o))return{validForOldPackages:!0,validForNewPackages:!0,inFile:u[1]};var c={validForOldPackages:!1,validForNewPackages:!1,warnings:[t]};if(o.trim().length!==0){var l=e(o);l&&c.warnings.push('license is similar to the valid expression "'+l+'"')}return c}return i(a)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[t]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}},Xt}var Lr={hasSubscribers:!1},U=Lr,Fe=Lr;import("node:diagnostics_channel").then(s=>{U=s.channel("lru-cache:metrics"),Fe=s.tracingChannel("lru-cache")}).catch(()=>{});var pu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Jt=()=>U.hasSubscribers||Fe.hasSubscribers,$r=new Set,Dn=process||{},du=(s,e,t,n)=>{typeof Dn.emitWarning=="function"?Dn.emitWarning(s,e,t,n):console.error(`[${t}] ${e}: ${s}`)},mu=s=>!$r.has(s),ue=s=>!!s&&s===Math.floor(s)&&s>0&&isFinite(s),Or=s=>ue(s)?s<=Math.pow(2,8)?Uint8Array:s<=Math.pow(2,16)?Uint16Array:s<=Math.pow(2,32)?Uint32Array:s<=Number.MAX_SAFE_INTEGER?ct:null:null,ct=class extends Array{constructor(e){super(e),this.fill(0)}},Du=class je{heap;length;static#r=!1;static create(e){let t=Or(e);if(!t)return[];je.#r=!0;let n=new je(e,t);return je.#r=!1,n}constructor(e,t){if(!je.#r)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},gu=class Br{#r;#c;#t;#$;#g;#P;#R;#E;get perf(){return this.#E}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#y;#i;#n;#e;#h;#p;#l;#u;#C;#a;#A;#b;#d;#m;#F;#T;#f;#O;static unsafeExposeInternals(e){return{starts:e.#b,ttls:e.#d,autopurgeTimers:e.#m,sizes:e.#A,keyMap:e.#i,keyList:e.#n,valList:e.#e,next:e.#h,prev:e.#p,get head(){return e.#l},get tail(){return e.#u},free:e.#C,isBackgroundFetch:t=>e.#s(t),backgroundFetch:(t,n,r,i)=>e.#G(t,n,r,i),moveToTail:t=>e.#k(t),indexes:t=>e.#v(t),rindexes:t=>e.#S(t),isStale:t=>e.#D(t)}}get max(){return this.#r}get maxSize(){return this.#c}get calculatedSize(){return this.#y}get size(){return this.#o}get fetchMethod(){return this.#P}get memoMethod(){return this.#R}get dispose(){return this.#t}get onInsert(){return this.#$}get disposeAfter(){return this.#g}constructor(e){let{max:t=0,ttl:n,ttlResolution:r=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:c,onInsert:l,disposeAfter:d,noDisposeOnSet:m,noUpdateTTL:g,maxSize:y=0,maxEntrySize:p=0,sizeCalculation:D,fetchMethod:f,memoMethod:C,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:h,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:A,ignoreFetchAbort:w,perf:v}=e;if(v!==void 0&&typeof v?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#E=v??pu,t!==0&&!ue(t))throw new TypeError("max option must be a nonnegative integer");let I=t?Or(t):Array;if(!I)throw new Error("invalid max value: "+t);if(this.#r=t,this.#c=y,this.maxEntrySize=p||this.#c,this.sizeCalculation=D,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#R=C,f!==void 0&&typeof f!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#P=f,this.#T=!!f,this.#i=new Map,this.#n=Array.from({length:t}).fill(void 0),this.#e=Array.from({length:t}).fill(void 0),this.#h=new I(t),this.#p=new I(t),this.#l=0,this.#u=0,this.#C=Du.create(t),this.#o=0,this.#y=0,typeof c=="function"&&(this.#t=c),typeof l=="function"&&(this.#$=l),typeof d=="function"?(this.#g=d,this.#a=[]):(this.#g=void 0,this.#a=void 0),this.#F=!!this.#t,this.#O=!!this.#$,this.#f=!!this.#g,this.noDisposeOnSet=!!m,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!E,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!w,this.maxEntrySize!==0){if(this.#c!==0&&!ue(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!ue(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#Y()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!h,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ue(r)||r===0?r:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!ue(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#M()}if(this.#r===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#r&&!this.#c){let M="LRU_CACHE_UNBOUNDED";mu(M)&&($r.add(M),du("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",M,Br))}}getRemainingTTL(e){return this.#i.has(e)?1/0:0}#M(){let e=new ct(this.#r),t=new ct(this.#r);this.#d=e,this.#b=t;let n=this.ttlAutopurge?Array.from({length:this.#r}):void 0;this.#m=n,this.#U=(a,u,c=this.#E.now())=>{t[a]=u!==0?c:0,e[a]=u,r(a,u)},this.#B=a=>{t[a]=e[a]!==0?this.#E.now():0,r(a,e[a])};let r=this.ttlAutopurge?(a,u)=>{if(n?.[a]&&(clearTimeout(n[a]),n[a]=void 0),u&&u!==0&&n){let c=setTimeout(()=>{this.#D(a)&&this.#w(this.#n[a],"expire")},u+1);c.unref&&c.unref(),n[a]=c}}:()=>{};this.#N=(a,u)=>{if(e[u]){let c=e[u],l=t[u];if(!c||!l)return;a.ttl=c,a.start=l,a.now=i||o();let d=a.now-l;a.remainingTTL=c-d}};let i=0,o=()=>{let a=this.#E.now();if(this.ttlResolution>0){i=a;let u=setTimeout(()=>i=0,this.ttlResolution);u.unref&&u.unref()}return a};this.getRemainingTTL=a=>{let u=this.#i.get(a);if(u===void 0)return 0;let c=e[u],l=t[u];if(!c||!l)return 1/0;let d=(i||o())-l;return c-d},this.#D=a=>{let u=t[a],c=e[a];return!!c&&!!u&&(i||o())-u>c}}#B=()=>{};#N=()=>{};#U=()=>{};#D=()=>!1;#Y(){let e=new ct(this.#r);this.#y=0,this.#A=e,this.#I=t=>{this.#y-=e[t],e[t]=0},this.#K=(t,n,r,i)=>{if(this.#s(n))return 0;if(!ue(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,t),!ue(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.#_=(t,n,r)=>{if(e[t]=n,this.#c){let i=this.#c-e[t];for(;this.#y>i;)this.#j(!0)}this.#y+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#y)}}#I=e=>{};#_=(e,t,n)=>{};#K=(e,t,n,r)=>{if(n||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#v({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#u;this.#H(t)&&((e||!this.#D(t))&&(yield t),t!==this.#l);)t=this.#p[t]}*#S({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#l;this.#H(t)&&((e||!this.#D(t))&&(yield t),t!==this.#u);)t=this.#h[t]}#H(e){return e!==void 0&&this.#i.get(this.#n[e])===e}*entries(){for(let e of this.#v())this.#e[e]!==void 0&&this.#n[e]!==void 0&&!this.#s(this.#e[e])&&(yield[this.#n[e],this.#e[e]])}*rentries(){for(let e of this.#S())this.#e[e]!==void 0&&this.#n[e]!==void 0&&!this.#s(this.#e[e])&&(yield[this.#n[e],this.#e[e]])}*keys(){for(let e of this.#v()){let t=this.#n[e];t!==void 0&&!this.#s(this.#e[e])&&(yield t)}}*rkeys(){for(let e of this.#S()){let t=this.#n[e];t!==void 0&&!this.#s(this.#e[e])&&(yield t)}}*values(){for(let e of this.#v())this.#e[e]!==void 0&&!this.#s(this.#e[e])&&(yield this.#e[e])}*rvalues(){for(let e of this.#S())this.#e[e]!==void 0&&!this.#s(this.#e[e])&&(yield this.#e[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let n of this.#v()){let r=this.#e[n],i=this.#s(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#n[n],this))return this.#x(this.#n[n],t)}}forEach(e,t=this){for(let n of this.#v()){let r=this.#e[n],i=this.#s(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#n[n],this)}}rforEach(e,t=this){for(let n of this.#S()){let r=this.#e[n],i=this.#s(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#n[n],this)}}purgeStale(){let e=!1;for(let t of this.#S({allowStale:!0}))this.#D(t)&&(this.#w(this.#n[t],"expire"),e=!0);return e}info(e){let t=this.#i.get(e);if(t===void 0)return;let n=this.#e[t],r=this.#s(n)?n.__staleWhileFetching:n;if(r===void 0)return;let i={value:r};if(this.#d&&this.#b){let o=this.#d[t],a=this.#b[t];if(o&&a){let u=o-(this.#E.now()-a);i.ttl=u,i.start=Date.now()}}return this.#A&&(i.size=this.#A[t]),i}dump(){let e=[];for(let t of this.#v({allowStale:!0})){let n=this.#n[t],r=this.#e[t],i=this.#s(r)?r.__staleWhileFetching:r;if(i===void 0||n===void 0)continue;let o={value:i};if(this.#d&&this.#b){o.ttl=this.#d[t];let a=this.#E.now()-this.#b[t];o.start=Math.floor(Date.now()-a)}this.#A&&(o.size=this.#A[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let r=Date.now()-n.start;n.start=this.#E.now()-r}this.#L(t,n.value,n)}}set(e,t,n={}){let{status:r=U.hasSubscribers?{}:void 0}=n;n.status=r,r&&(r.op="set",r.key=e,t!==void 0&&(r.value=t),r.cache=this);let i=this.#L(e,t,n);return r&&U.hasSubscribers&&U.publish(r),i}#L(e,t,n,r){let{ttl:i=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:c}=n;if(t===void 0)return c&&(c.set="deleted"),this.delete(e),this;let{noUpdateTTL:l=this.noUpdateTTL}=n,d=this.#s(t);c&&!d&&(c.value=t);let m=this.#K(e,t,n.size||0,u,c);if(this.maxEntrySize&&m>this.maxEntrySize)return this.#w(e,"set"),c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this;let g=this.#o===0?void 0:this.#i.get(e);if(g===void 0)g=this.#o===0?this.#u:this.#C.length!==0?this.#C.pop():this.#o===this.#r?this.#j(!1):this.#o,this.#n[g]=e,this.#e[g]=t,this.#i.set(e,g),this.#h[this.#u]=g,this.#p[g]=this.#u,this.#u=g,this.#o++,this.#_(g,m,c),c&&(c.set="add"),l=!1,this.#O&&!d&&this.#$?.(t,e,"add");else{this.#k(g);let y=this.#e[g];if(t!==y){if(!a)if(this.#s(y)){y!==r&&y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=y;p!==void 0&&p!==t&&(this.#F&&this.#t?.(p,e,"set"),this.#f&&this.#a?.push([p,e,"set"]))}else this.#F&&this.#t?.(y,e,"set"),this.#f&&this.#a?.push([y,e,"set"]);if(this.#I(g),this.#_(g,m,c),this.#e[g]=t,!d){let p=y&&this.#s(y)?y.__staleWhileFetching:y,D=p===void 0?"add":t!==p?"replace":"update";c&&(c.set=D,p!==void 0&&(c.oldValue=p)),this.#O&&this.onInsert?.(t,e,D)}}else d||(c&&(c.set="update"),this.#O&&this.onInsert?.(t,e,"update"))}if(i!==0&&!this.#d&&this.#M(),this.#d&&(l||this.#U(g,i,o),c&&this.#N(c,g)),!a&&this.#f&&this.#a){let y=this.#a,p;for(;p=y?.shift();)this.#g?.(...p)}return this}pop(){try{for(;this.#o;){let e=this.#e[this.#l];if(this.#j(!0),this.#s(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#f&&this.#a){let e=this.#a,t;for(;t=e?.shift();)this.#g?.(...t)}}}#j(e){let t=this.#l,n=this.#n[t],r=this.#e[t],i=this.#s(r);i&&r.__abortController.abort(new Error("evicted"));let o=i?r.__staleWhileFetching:r;return(this.#F||this.#f)&&o!==void 0&&(this.#F&&this.#t?.(o,n,"evict"),this.#f&&this.#a?.push([o,n,"evict"])),this.#I(t),this.#m?.[t]&&(clearTimeout(this.#m[t]),this.#m[t]=void 0),e&&(this.#n[t]=void 0,this.#e[t]=void 0,this.#C.push(t)),this.#o===1?(this.#l=this.#u=0,this.#C.length=0):this.#l=this.#h[t],this.#i.delete(n),this.#o--,t}has(e,t={}){let{status:n=U.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="has",n.key=e,n.cache=this);let r=this.#z(e,t);return U.hasSubscribers&&U.publish(n),r}#z(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#i.get(e);if(i!==void 0){let o=this.#e[i];if(this.#s(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#D(i))r&&(r.has="stale",this.#N(r,i));else return n&&this.#B(i),r&&(r.has="hit",this.#N(r,i)),!0}else r&&(r.has="miss");return!1}peek(e,t={}){let{status:n=Jt()?{}:void 0}=t;n&&(n.op="peek",n.key=e,n.cache=this),t.status=n;let r=this.#X(e,t);return U.hasSubscribers&&U.publish(n),r}#X(e,t){let{status:n,allowStale:r=this.allowStale}=t,i=this.#i.get(e);if(i===void 0||!r&&this.#D(i)){n&&(n.peek=i===void 0?"miss":"stale");return}let o=this.#e[i],a=this.#s(o)?o.__staleWhileFetching:o;return n&&(a!==void 0?(n.peek="hit",n.value=a):n.peek="miss"),a}#G(e,t,n,r){let i=t===void 0?void 0:this.#e[t];if(this.#s(i))return i;let o=new AbortController,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:n,context:r},c=(p,D=!1)=>{let{aborted:f}=o.signal,C=n.ignoreFetchAbort&&p!==void 0,b=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&p!==void 0);if(n.status&&(f&&!D?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,C&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),f&&!C&&!D)return d(o.signal.reason,b);let h=g,E=this.#e[t];return(E===g||E===void 0&&C&&D)&&(p===void 0?h.__staleWhileFetching!==void 0?this.#e[t]=h.__staleWhileFetching:this.#w(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.#L(e,p,u.options,h))),p},l=p=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=p),d(p,!1)),d=(p,D)=>{let{aborted:f}=o.signal,C=f&&n.allowStaleOnFetchAbort,b=C||n.allowStaleOnFetchRejection,h=b||n.noDeleteOnFetchRejection,E=g;if(this.#e[t]===g&&(!h||!D&&E.__staleWhileFetching===void 0?this.#w(e,"fetch"):C||(this.#e[t]=E.__staleWhileFetching)),b)return n.status&&E.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),E.__staleWhileFetching;if(E.__returned===E)throw p},m=(p,D)=>{let f=this.#P?.(e,i,u);o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(p(void 0),n.allowStaleOnFetchAbort&&(p=C=>c(C,!0)))}),f&&f instanceof Promise?f.then(C=>p(C===void 0?void 0:C),D):f!==void 0&&p(f)};n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(c,l),y=Object.assign(g,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.#L(e,y,{...u.options,status:void 0}),t=this.#i.get(e)):this.#e[t]=y,y}#s(e){if(!this.#T)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let n=Fe.hasSubscribers,{status:r=Jt()?{}:void 0}=t;t.status=r,r&&t.context&&(r.context=t.context);let i=this.#q(e,t);return r&&n&&(r.trace=!0,Fe.tracePromise(()=>i,r).catch(()=>{})),i}async#q(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:p,forceRefresh:D=!1,status:f,signal:C}=t;if(f&&(f.op="fetch",f.key=e,D&&(f.forceRefresh=!0),f.cache=this),!this.#T)return f&&(f.fetch="get"),this.#x(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:f});let b={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:y,ignoreFetchAbort:g,status:f,signal:C},h=this.#i.get(e);if(h===void 0){f&&(f.fetch="miss");let E=this.#G(e,h,b,p);return E.__returned=E}else{let E=this.#e[h];if(this.#s(E)){let I=n&&E.__staleWhileFetching!==void 0;return f&&(f.fetch="inflight",I&&(f.returnedStale=!0)),I?E.__staleWhileFetching:E.__returned=E}let A=this.#D(h);if(!D&&!A)return f&&(f.fetch="hit"),this.#k(h),r&&this.#B(h),f&&this.#N(f,h),E;let w=this.#G(e,h,b,p),v=w.__staleWhileFetching!==void 0&&n;return f&&(f.fetch=A?"stale":"refresh",v&&A&&(f.returnedStale=!0)),v?w.__staleWhileFetching:w.__returned=w}}forceFetch(e,t={}){let n=Fe.hasSubscribers,{status:r=Jt()?{}:void 0}=t;t.status=r,r&&t.context&&(r.context=t.context);let i=this.#J(e,t);return r&&n&&(r.trace=!0,Fe.tracePromise(()=>i,r).catch(()=>{})),i}async#J(e,t={}){let n=await this.#q(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let{status:n=U.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="memo",n.key=e,t.context&&(n.context=t.context),n.cache=this);let r=this.#Q(e,t);return n&&(n.value=r),U.hasSubscribers&&U.publish(n),r}#Q(e,t={}){let n=this.#R;if(!n)throw new Error("no memoMethod provided to constructor");let{context:r,status:i,forceRefresh:o,...a}=t;i&&o&&(i.forceRefresh=!0);let u=this.#x(e,a),c=o||u===void 0;if(i&&(i.memo=c?"miss":"hit",c||(i.value=u)),!c)return u;let l=n(e,u,{options:a,context:r});return i&&(i.value=l),this.#L(e,l,a),l}get(e,t={}){let{status:n=U.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="get",n.key=e,n.cache=this);let r=this.#x(e,t);return n&&(r!==void 0&&(n.value=r),U.hasSubscribers&&U.publish(n)),r}#x(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=t,a=this.#i.get(e);if(a===void 0){o&&(o.get="miss");return}let u=this.#e[a],c=this.#s(u);return o&&this.#N(o,a),this.#D(a)?c?(o&&(o.get="stale-fetching"),n&&u.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),u.__staleWhileFetching):void 0):(i||this.#w(e,"expire"),o&&(o.get="stale"),n?(o&&(o.returnedStale=!0),u):void 0):(o&&(o.get=c?"fetching":"hit"),this.#k(a),r&&this.#B(a),c?u.__staleWhileFetching:u)}#W(e,t){this.#p[t]=e,this.#h[e]=t}#k(e){e!==this.#u&&(e===this.#l?this.#l=this.#h[e]:this.#W(this.#p[e],this.#h[e]),this.#W(this.#u,e),this.#u=e)}delete(e){return this.#w(e,"delete")}#w(e,t){U.hasSubscribers&&U.publish({op:"delete",delete:t,key:e,cache:this});let n=!1;if(this.#o!==0){let r=this.#i.get(e);if(r!==void 0)if(this.#m?.[r]&&(clearTimeout(this.#m?.[r]),this.#m[r]=void 0),n=!0,this.#o===1)this.#V(t);else{this.#I(r);let i=this.#e[r];if(this.#s(i)?i.__abortController.abort(new Error("deleted")):(this.#F||this.#f)&&(this.#F&&this.#t?.(i,e,t),this.#f&&this.#a?.push([i,e,t])),this.#i.delete(e),this.#n[r]=void 0,this.#e[r]=void 0,r===this.#u)this.#u=this.#p[r];else if(r===this.#l)this.#l=this.#h[r];else{let o=this.#p[r];this.#h[o]=this.#h[r];let a=this.#h[r];this.#p[a]=this.#p[r]}this.#o--,this.#C.push(r)}}if(this.#f&&this.#a?.length){let r=this.#a,i;for(;i=r?.shift();)this.#g?.(...i)}return n}clear(){return this.#V("delete")}#V(e){for(let t of this.#S({allowStale:!0})){let n=this.#e[t];if(this.#s(n))n.__abortController.abort(new Error("deleted"));else{let r=this.#n[t];this.#F&&this.#t?.(n,r,e),this.#f&&this.#a?.push([n,r,e])}}if(this.#i.clear(),this.#e.fill(void 0),this.#n.fill(void 0),this.#d&&this.#b){this.#d.fill(0),this.#b.fill(0);for(let t of this.#m??[])t!==void 0&&clearTimeout(t);this.#m?.fill(void 0)}if(this.#A&&this.#A.fill(0),this.#l=0,this.#u=0,this.#C.length=0,this.#y=0,this.#o=0,this.#f&&this.#a){let t=this.#a,n;for(;n=t?.shift();)this.#g?.(...n)}}};const Eu=Object.defineProperty({__proto__:null,LRUCache:gu},Symbol.toStringTag,{value:"Module"}),yu=Ps(Eu);var Qt,gn;function Cu(){if(gn)return Qt;gn=1;const s=(...i)=>i.every(o=>o)?i.join(""):"",e=i=>i?encodeURIComponent(i):"",t=i=>i.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),n={sshtemplate:({domain:i,user:o,project:a,committish:u})=>`git@${i}:${o}/${a}.git${s("#",u)}`,sshurltemplate:({domain:i,user:o,project:a,committish:u})=>`git+ssh://git@${i}/${o}/${a}.git${s("#",u)}`,edittemplate:({domain:i,user:o,project:a,committish:u,editpath:c,path:l})=>`https://${i}/${o}/${a}${s("/",c,"/",e(u||"HEAD"),"/",l)}`,browsetemplate:({domain:i,user:o,project:a,committish:u,treepath:c})=>`https://${i}/${o}/${a}${s("/",c,"/",e(u))}`,browsetreetemplate:({domain:i,user:o,project:a,committish:u,treepath:c,path:l,fragment:d,hashformat:m})=>`https://${i}/${o}/${a}/${c}/${e(u||"HEAD")}/${l}${s("#",m(d||""))}`,browseblobtemplate:({domain:i,user:o,project:a,committish:u,blobpath:c,path:l,fragment:d,hashformat:m})=>`https://${i}/${o}/${a}/${c}/${e(u||"HEAD")}/${l}${s("#",m(d||""))}`,docstemplate:({domain:i,user:o,project:a,treepath:u,committish:c})=>`https://${i}/${o}/${a}${s("/",u,"/",e(c))}#readme`,httpstemplate:({auth:i,domain:o,user:a,project:u,committish:c})=>`git+https://${s(i,"@")}${o}/${a}/${u}.git${s("#",c)}`,filetemplate:({domain:i,user:o,project:a,committish:u,path:c})=>`https://${i}/${o}/${a}/raw/${e(u||"HEAD")}/${c}`,shortcuttemplate:({type:i,user:o,project:a,committish:u})=>`${i}:${o}/${a}${s("#",u)}`,pathtemplate:({user:i,project:o,committish:a})=>`${i}/${o}${s("#",a)}`,bugstemplate:({domain:i,user:o,project:a})=>`https://${i}/${o}/${a}/issues`,hashformat:t},r={};r.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:i,user:o,project:a,committish:u,path:c})=>`https://${s(i,"@")}raw.githubusercontent.com/${o}/${a}/${e(u||"HEAD")}/${c}`,gittemplate:({auth:i,domain:o,user:a,project:u,committish:c})=>`git://${s(i,"@")}${o}/${a}/${u}.git${s("#",c)}`,tarballtemplate:({domain:i,user:o,project:a,committish:u})=>`https://codeload.${i}/${o}/${a}/tar.gz/${e(u||"HEAD")}`,extract:i=>{let[,o,a,u,c]=i.pathname.split("/",5);if(!(u&&u!=="tree")&&(u||(c=i.hash.slice(1)),a&&a.endsWith(".git")&&(a=a.slice(0,-4)),!(!o||!a)))return{user:o,project:a,committish:c}}},r.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:i,user:o,project:a,committish:u,treepath:c,path:l,editpath:d})=>`https://${i}/${o}/${a}${s("/",c,"/",e(u||"HEAD"),"/",l,d)}`,tarballtemplate:({domain:i,user:o,project:a,committish:u})=>`https://${i}/${o}/${a}/get/${e(u||"HEAD")}.tar.gz`,extract:i=>{let[,o,a,u]=i.pathname.split("/",4);if(!["get"].includes(u)&&(a&&a.endsWith(".git")&&(a=a.slice(0,-4)),!(!o||!a)))return{user:o,project:a,committish:i.hash.slice(1)}}},r.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",tarballtemplate:({domain:i,user:o,project:a,committish:u})=>`https://${i}/api/v4/projects/${e(o+"/"+a)}/repository/archive.tar.gz?sha=${e(u||"HEAD")}`,extract:i=>{const o=i.pathname.slice(1);if(o.includes("/-/")||o.includes("/archive.tar.gz"))return;const a=o.split("/");let u=a.pop();u.endsWith(".git")&&(u=u.slice(0,-4));const c=a.join("/");if(!(!c||!u))return{user:c,project:u,committish:i.hash.slice(1)}}},r.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:i,project:o,committish:a})=>`git@${i}:${o}.git${s("#",a)}`,sshurltemplate:({domain:i,project:o,committish:a})=>`git+ssh://git@${i}/${o}.git${s("#",a)}`,edittemplate:({domain:i,user:o,project:a,committish:u,editpath:c})=>`https://${i}/${o}/${a}${s("/",e(u))}/${c}`,browsetemplate:({domain:i,project:o,committish:a})=>`https://${i}/${o}${s("/",e(a))}`,browsetreetemplate:({domain:i,project:o,committish:a,path:u,hashformat:c})=>`https://${i}/${o}${s("/",e(a))}${s("#",c(u))}`,browseblobtemplate:({domain:i,project:o,committish:a,path:u,hashformat:c})=>`https://${i}/${o}${s("/",e(a))}${s("#",c(u))}`,docstemplate:({domain:i,project:o,committish:a})=>`https://${i}/${o}${s("/",e(a))}`,httpstemplate:({domain:i,project:o,committish:a})=>`git+https://${i}/${o}.git${s("#",a)}`,filetemplate:({user:i,project:o,committish:a,path:u})=>`https://gist.githubusercontent.com/${i}/${o}/raw${s("/",e(a))}/${u}`,shortcuttemplate:({type:i,project:o,committish:a})=>`${i}:${o}${s("#",a)}`,pathtemplate:({project:i,committish:o})=>`${i}${s("#",o)}`,bugstemplate:({domain:i,project:o})=>`https://${i}/${o}`,gittemplate:({domain:i,project:o,committish:a})=>`git://${i}/${o}.git${s("#",a)}`,tarballtemplate:({project:i,committish:o})=>`https://codeload.github.com/gist/${i}/tar.gz/${e(o||"HEAD")}`,extract:i=>{let[,o,a,u]=i.pathname.split("/",4);if(u!=="raw"){if(!a){if(!o)return;a=o,o=null}return a.endsWith(".git")&&(a=a.slice(0,-4)),{user:o,project:a,committish:i.hash.slice(1)}}},hashformat:function(i){return i&&"file-"+t(i)}},r.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:i,user:o,project:a,committish:u,path:c})=>`https://${i}/${o}/${a}/blob/${e(u)||"HEAD"}/${c}`,httpstemplate:({domain:i,user:o,project:a,committish:u})=>`https://${i}/${o}/${a}${s("#",u)}`,tarballtemplate:({domain:i,user:o,project:a,committish:u})=>`https://${i}/${o}/${a}/archive/${e(u)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:i=>{let[,o,a,u]=i.pathname.split("/",4);if(!["archive"].includes(u)&&(a&&a.endsWith(".git")&&(a=a.slice(0,-4)),!(!o||!a)))return{user:o,project:a,committish:i.hash.slice(1)}}};for(const[i,o]of Object.entries(r))r[i]=Object.assign({},n,o);return Qt=r,Qt}var Zt,En;function Ir(){if(En)return Zt;En=1;const s=(r,i,o)=>{const a=r.indexOf(o);return r.lastIndexOf(i,a>-1?a:1/0)},e=r=>{try{return new URL(r)}catch{}},t=(r,i)=>{const o=r.indexOf(":"),a=r.slice(0,o+1);if(Object.prototype.hasOwnProperty.call(i,a)||r.substr(o,3)==="://")return r;const u=r.indexOf("@");return u>-1?u>o?`git+ssh://${r}`:r:`${r.slice(0,o+1)}//${r.slice(o+1)}`},n=r=>{const i=s(r,"@","#"),o=s(r,":","#");return o>i&&(r=r.slice(0,o)+"/"+r.slice(o+1)),s(r,":","#")===-1&&r.indexOf("//")===-1&&(r=`git+ssh://${r}`),r};return Zt=(r,i)=>{const o=i?t(r,i):r;return e(o)||e(n(o))},Zt}var es,yn;function Au(){if(yn)return es;yn=1;const s=Ir(),e=t=>{const n=t.indexOf("#"),r=t.indexOf("/"),i=t.indexOf("/",r+1),o=t.indexOf(":"),a=/\s/.exec(t),u=t.indexOf("@"),c=!a||n>-1&&a.index>n,l=u===-1||n>-1&&u>n,d=o===-1||n>-1&&o>n,m=i===-1||n>-1&&i>n,g=r>0,y=n>-1?t[n-1]!=="/":!t.endsWith("/"),p=!t.startsWith(".");return c&&g&&y&&p&&l&&d&&m};return es=(t,n,{gitHosts:r,protocols:i})=>{if(!t)return;const o=e(t)?`github:${t}`:t,a=s(o,i);if(!a)return;const u=r.byShortcut[a.protocol],c=r.byDomain[a.hostname.startsWith("www.")?a.hostname.slice(4):a.hostname],l=u||c;if(!l)return;const d=r[u||c];let m=null;i[a.protocol]?.auth&&(a.username||a.password)&&(m=`${a.username}${a.password?":"+a.password:""}`);let g=null,y=null,p=null,D=null;try{if(u){let f=a.pathname.startsWith("/")?a.pathname.slice(1):a.pathname;const C=f.indexOf("@");C>-1&&(f=f.slice(C+1));const b=f.lastIndexOf("/");b>-1?(y=decodeURIComponent(f.slice(0,b)),y||(y=null),p=decodeURIComponent(f.slice(b+1))):p=decodeURIComponent(f),p.endsWith(".git")&&(p=p.slice(0,-4)),a.hash&&(g=decodeURIComponent(a.hash.slice(1))),D="shortcut"}else{if(!d.protocols.includes(a.protocol))return;const f=d.extract(a);if(!f)return;y=f.user&&decodeURIComponent(f.user),p=decodeURIComponent(f.project),g=decodeURIComponent(f.committish),D=i[a.protocol]?.name||a.protocol.slice(0,-1)}}catch(f){if(f instanceof URIError)return;throw f}return[l,y,m,p,g,D,n]},es}var ts,Cn;function bu(){if(Cn)return ts;Cn=1;const{LRUCache:s}=yu,e=Cu(),t=Au(),n=Ir(),r=new s({max:1e3});function i(a){try{const{protocol:u,hostname:c,pathname:l}=new URL(a);if(!c)return null;const d=/(?:git\+)http:$/.test(u)?"http:":"https:",m=l.replace(/\.git$/,"");return`${d}//${c}${m}`}catch{return null}}class o{constructor(u,c,l,d,m,g,y={}){Object.assign(this,o.#r[u],{type:u,user:c,auth:l,project:d,committish:m,default:g,opts:y})}static#r={byShortcut:{},byDomain:{}};static#c={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(u,c){o.#r[u]=c,o.#r.byDomain[c.domain]=u,o.#r.byShortcut[`${u}:`]=u,o.#c[`${u}:`]={name:u}}static fromUrl(u,c){if(typeof u!="string")return;const l=u+JSON.stringify(c||{});if(!r.has(l)){const d=t(u,c,{gitHosts:o.#r,protocols:o.#c});r.set(l,d?new o(...d):void 0)}return r.get(l)}static fromManifest(u,c={}){if(!u||typeof u!="object")return;const l=u.repository,d=l&&(typeof l=="string"?l:typeof l=="object"&&typeof l.url=="string"?l.url:null);if(!d)throw new Error("no repository");const m=d&&o.fromUrl(d.replace(/^git\+/,""),c)||null;if(m)return m;const g=i(d);return o.fromUrl(g,c)||g}static parseUrl(u){return n(u)}#t(u,c){if(typeof u!="function")return null;const l={...this,...this.opts,...c};l.path||(l.path=""),l.path.startsWith("/")&&(l.path=l.path.slice(1)),l.noCommittish&&(l.committish=null);const d=u(l);return l.noGitPlus&&d.startsWith("git+")?d.slice(4):d}hash(){return this.committish?`#${this.committish}`:""}ssh(u){return this.#t(this.sshtemplate,u)}sshurl(u){return this.#t(this.sshurltemplate,u)}browse(u,...c){return typeof u!="string"?this.#t(this.browsetemplate,u):typeof c[0]!="string"?this.#t(this.browsetreetemplate,{...c[0],path:u}):this.#t(this.browsetreetemplate,{...c[1],fragment:c[0],path:u})}browseFile(u,...c){return typeof c[0]!="string"?this.#t(this.browseblobtemplate,{...c[0],path:u}):this.#t(this.browseblobtemplate,{...c[1],fragment:c[0],path:u})}docs(u){return this.#t(this.docstemplate,u)}bugs(u){return this.#t(this.bugstemplate,u)}https(u){return this.#t(this.httpstemplate,u)}git(u){return this.#t(this.gittemplate,u)}shortcut(u){return this.#t(this.shortcuttemplate,u)}path(u){return this.#t(this.pathtemplate,u)}tarball(u){return this.#t(this.tarballtemplate,{...u,noCommittish:!1})}file(u,c){return this.#t(this.filetemplate,{...c,path:u})}edit(u,c){return this.#t(this.edittemplate,{...c,path:u})}getDefaultRepresentation(){return this.default}toString(u){return this.default&&typeof this[this.default]=="function"?this[this.default](u):this.sshurl(u)}}for(const[a,u]of Object.entries(e))o.addHost(a,u);return ts=o,ts}var ss,An;function Fu(){if(An)return ss;An=1,ss=s;function s(e){if(!e||e==="ERROR: No README data found!")return;e=e.trim().split(`
|
|
145
|
+
`);let t=0;for(;e[t]&&e[t].trim().match(/^(#|$)/);)t++;const n=e.length;let r=t+1;for(;r<n&&e[r].trim();)r++;return e.slice(t,r).join(" ").trim()}return ss}var xr={dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},kr={web:"url",name:"url"},Pr={server:"start",tests:"test"};const vu={topLevel:xr,bugs:kr,script:Pr},Su=Object.defineProperty({__proto__:null,bugs:kr,default:vu,script:Pr,topLevel:xr},Symbol.toStringTag,{value:"Module"}),wu=Ps(Su);var ns,bn;function Nu(){if(bn)return ns;bn=1;var{URL:s}=wi,e=iu(),t=ou(),n=fu(),r=bu(),{isBuiltin:i}=yi,o=["dependencies","devDependencies","optionalDependencies"],a=Fu(),u=wu,c=h=>h.includes("@")&&h.indexOf("@")<h.lastIndexOf(".");ns={warn:function(){},fixRepositoryField:function(h){if(h.repositories&&(this.warn("repositories"),h.repository=h.repositories[0]),!h.repository)return this.warn("missingRepository");typeof h.repository=="string"&&(h.repository={type:"git",url:h.repository});var E=h.repository.url||"";if(E){var A=r.fromUrl(E);A&&(E=h.repository.url=A.getDefaultRepresentation()==="shortcut"?A.https():A.toString())}E.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",E)},fixTypos:function(h){Object.keys(u.topLevel).forEach(function(E){Object.prototype.hasOwnProperty.call(h,E)&&this.warn("typo",E,u.topLevel[E])},this)},fixScriptsField:function(h){if(h.scripts){if(typeof h.scripts!="object"){this.warn("nonObjectScripts"),delete h.scripts;return}Object.keys(h.scripts).forEach(function(E){typeof h.scripts[E]!="string"?(this.warn("nonStringScript"),delete h.scripts[E]):u.script[E]&&!h.scripts[u.script[E]]&&this.warn("typo",E,u.script[E],"scripts")},this)}},fixFilesField:function(h){var E=h.files;E&&!Array.isArray(E)?(this.warn("nonArrayFiles"),delete h.files):h.files&&(h.files=h.files.filter(function(A){return!A||typeof A!="string"?(this.warn("invalidFilename",A),!1):!0},this))},fixBinField:function(h){if(h.bin&&typeof h.bin=="string"){var E={},A;(A=h.name.match(/^@[^/]+[/](.*)$/))?E[A[1]]=h.bin:E[h.name]=h.bin,h.bin=E}},fixManField:function(h){h.man&&typeof h.man=="string"&&(h.man=[h.man])},fixBundleDependenciesField:function(h){var E="bundledDependencies",A="bundleDependencies";h[E]&&!h[A]&&(h[A]=h[E],delete h[E]),h[A]&&!Array.isArray(h[A])?(this.warn("nonArrayBundleDependencies"),delete h[A]):h[A]&&(h[A]=h[A].filter(function(w){return!w||typeof w!="string"?(this.warn("nonStringBundleDependency",w),!1):(h.dependencies||(h.dependencies={}),Object.prototype.hasOwnProperty.call(h.dependencies,w)||(this.warn("nonDependencyBundleDependency",w),h.dependencies[w]="*"),!0)},this))},fixDependencies:function(h){C(h,this.warn),D(h),this.fixBundleDependenciesField(h),["dependencies","devDependencies"].forEach(function(E){if(E in h){if(!h[E]||typeof h[E]!="object"){this.warn("nonObjectDependencies",E),delete h[E];return}Object.keys(h[E]).forEach(function(A){var w=h[E][A];typeof w!="string"&&(this.warn("nonStringDependency",A,JSON.stringify(w)),delete h[E][A]);var v=r.fromUrl(h[E][A]);v&&(h[E][A]=v.toString())},this)}},this)},fixModulesField:function(h){h.modules&&(this.warn("deprecatedModules"),delete h.modules)},fixKeywordsField:function(h){typeof h.keywords=="string"&&(h.keywords=h.keywords.split(/,\s+/)),h.keywords&&!Array.isArray(h.keywords)?(delete h.keywords,this.warn("nonArrayKeywords")):h.keywords&&(h.keywords=h.keywords.filter(function(E){return typeof E!="string"||!E?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(h,E){var A=!E;if(!h.version)return h.version="",!0;if(!e(h.version,A))throw new Error('Invalid version: "'+h.version+'"');return h.version=t(h.version,A),!0},fixPeople:function(h){g(h,y),g(h,p)},fixNameField:function(h,E){typeof E=="boolean"?E={strict:E}:typeof E>"u"&&(E={});var A=E.strict;if(!h.name&&!A){h.name="";return}if(typeof h.name!="string")throw new Error("name field must be a string.");A||(h.name=h.name.trim()),m(h.name,A,E.allowLegacyCase),i(h.name)&&this.warn("conflictingName",h.name)},fixDescriptionField:function(h){h.description&&typeof h.description!="string"&&(this.warn("nonStringDescription"),delete h.description),h.readme&&!h.description&&(h.description=a(h.readme)),h.description===void 0&&delete h.description,h.description||this.warn("missingDescription")},fixReadmeField:function(h){h.readme||(this.warn("missingReadme"),h.readme="ERROR: No README data found!")},fixBugsField:function(h){if(!h.bugs&&h.repository&&h.repository.url){var E=r.fromUrl(h.repository.url);E&&E.bugs()&&(h.bugs={url:E.bugs()})}else if(h.bugs){if(typeof h.bugs=="string")c(h.bugs)?h.bugs={email:h.bugs}:s.canParse(h.bugs)?h.bugs={url:h.bugs}:this.warn("nonEmailUrlBugsString");else{b(h.bugs,this.warn);var A=h.bugs;h.bugs={},A.url&&(s.canParse(A.url)?h.bugs.url=A.url:this.warn("nonUrlBugsUrlField")),A.email&&(typeof A.email=="string"&&c(A.email)?h.bugs.email=A.email:this.warn("nonEmailBugsEmailField"))}!h.bugs.email&&!h.bugs.url&&(delete h.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(h){if(!h.homepage&&h.repository&&h.repository.url){var E=r.fromUrl(h.repository.url);E&&E.docs()&&(h.homepage=E.docs())}if(h.homepage){if(typeof h.homepage!="string")return this.warn("nonUrlHomepage"),delete h.homepage;s.canParse(h.homepage)||(h.homepage="http://"+h.homepage)}},fixLicenseField:function(h){const E=h.license||h.licence;if(!E)return this.warn("missingLicense");if(typeof E!="string"||E.length<1||E.trim()==="")return this.warn("invalidLicense");if(!n(E).validForNewPackages)return this.warn("invalidLicense")}};function l(h){if(h.charAt(0)!=="@")return!1;var E=h.slice(1).split("/");return E.length!==2?!1:E[0]&&E[1]&&E[0]===encodeURIComponent(E[0])&&E[1]===encodeURIComponent(E[1])}function d(h){return!h.match(/[/@\s+%:]/)&&h===encodeURIComponent(h)}function m(h,E,A){if(h.charAt(0)==="."||!(l(h)||d(h))||E&&!A&&h!==h.toLowerCase()||h.toLowerCase()==="node_modules"||h.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(h))}function g(h,E){return h.author&&(h.author=E(h.author)),["maintainers","contributors"].forEach(function(A){Array.isArray(h[A])&&(h[A]=h[A].map(E))}),h}function y(h){if(typeof h=="string")return h;var E=h.name||"",A=h.url||h.web,w=A?" ("+A+")":"",v=h.email||h.mail,I=v?" <"+v+">":"";return E+I+w}function p(h){if(typeof h!="string")return h;var E=h.match(/^([^(<]+)/),A=h.match(/\(([^()]+)\)/),w=h.match(/<([^<>]+)>/),v={};return E&&E[0].trim()&&(v.name=E[0].trim()),w&&(v.email=w[1]),A&&(v.url=A[1]),v}function D(h){var E=h.optionalDependencies;if(E){var A=h.dependencies||{};Object.keys(E).forEach(function(w){A[w]=E[w]}),h.dependencies=A}}function f(h,E,A){if(!h)return{};if(typeof h=="string"&&(h=h.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(h))return h;A("deprecatedArrayDependencies",E);var w={};return h.filter(function(v){return typeof v=="string"}).forEach(function(v){v=v.trim().split(/(:?[@\s><=])/);var I=v.shift(),M=v.join("");M=M.trim(),M=M.replace(/^@/,""),w[I]=M}),w}function C(h,E){o.forEach(function(A){h[A]&&(h[A]=f(h[A],A,E))})}function b(h,E){h&&Object.keys(h).forEach(function(A){u.bugs[A]&&(E("typo",A,u.bugs[A],"bugs"),h[u.bugs[A]]=h[A],delete h[A])})}return ns}var Rr="'repositories' (plural) Not supported. Please pick one as the 'repository' field",Tr="No repository field.",_r="Probably broken git url: %s",jr="scripts must be an object",Gr="script values must be string commands",Mr="Invalid 'files' member",Ur="Invalid filename in 'files' list: %s",Kr="Invalid 'bundleDependencies' list. Must be array of package names",Hr="Invalid bundleDependencies member: %s",qr="Non-dependency in bundleDependencies: %s",Wr="%s field must be an object",Vr="Invalid dependency: %s %s",Yr="specifying %s as array is deprecated",zr="modules field is deprecated",Xr="keywords should be an array of strings",Jr="keywords should be an array of strings",Qr="%s is also the name of a node core module.",Zr="'description' field should be a string",ei="No description",ti="No README data",si="No license field.",ni="Bug string field must be url, email, or {email,url}",ri="bugs.url field must be a string url. Deleted.",ii="bugs.email field must be a string email. Deleted.",oi="Normalized value of bugs field is an empty object. Deleted.",ui="homepage field must be a string url. Deleted.",ai="license should be a valid SPDX license expression",ci="%s should probably be %s.";const Lu={repositories:Rr,missingRepository:Tr,brokenGitUrl:_r,nonObjectScripts:jr,nonStringScript:Gr,nonArrayFiles:Mr,invalidFilename:Ur,nonArrayBundleDependencies:Kr,nonStringBundleDependency:Hr,nonDependencyBundleDependency:qr,nonObjectDependencies:Wr,nonStringDependency:Vr,deprecatedArrayDependencies:Yr,deprecatedModules:zr,nonArrayKeywords:Xr,nonStringKeyword:Jr,conflictingName:Qr,nonStringDescription:Zr,missingDescription:ei,missingReadme:ti,missingLicense:si,nonEmailUrlBugsString:ni,nonUrlBugsUrlField:ri,nonEmailBugsEmailField:ii,emptyNormalizedBugs:oi,nonUrlHomepage:ui,invalidLicense:ai,typo:ci},$u=Object.defineProperty({__proto__:null,brokenGitUrl:_r,conflictingName:Qr,default:Lu,deprecatedArrayDependencies:Yr,deprecatedModules:zr,emptyNormalizedBugs:oi,invalidFilename:Ur,invalidLicense:ai,missingDescription:ei,missingLicense:si,missingReadme:ti,missingRepository:Tr,nonArrayBundleDependencies:Kr,nonArrayFiles:Mr,nonArrayKeywords:Xr,nonDependencyBundleDependency:qr,nonEmailBugsEmailField:ii,nonEmailUrlBugsString:ni,nonObjectDependencies:Wr,nonObjectScripts:jr,nonStringBundleDependency:Hr,nonStringDependency:Vr,nonStringDescription:Zr,nonStringKeyword:Jr,nonStringScript:Gr,nonUrlBugsUrlField:ri,nonUrlHomepage:ui,repositories:Rr,typo:ci},Symbol.toStringTag,{value:"Module"}),Ou=Ps($u);var rs,Fn;function Bu(){if(Fn)return rs;Fn=1;var s=Ni,e=Ou;rs=function(){var n=Array.prototype.slice.call(arguments,0),r=n.shift();if(r==="typo")return t.apply(null,n);var i=e[r]?e[r]:r+": '%s'";return n.unshift(i),s.format.apply(null,n)};function t(n,r,i){return i&&(n=i+"['"+n+"']",r=i+"['"+r+"']"),s.format(e.typo,n,r)}return rs}var is,vn;function Iu(){if(vn)return is;vn=1,is=i;var s=Nu();i.fixer=s;var e=Bu(),t=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],n=["dependencies","people","typos"],r=t.map(function(a){return o(a)+"Field"});r=r.concat(n);function i(a,u,c){u===!0&&(u=null,c=!0),c||(c=!1),(!u||a.private)&&(u=function(){}),a.scripts&&a.scripts.install==="node-gyp rebuild"&&!a.scripts.preinstall&&(a.gypfile=!0),s.warn=function(){u(e.apply(null,arguments))},r.forEach(function(l){s["fix"+o(l)](a,c)}),a._id=a.name+"@"+a.version}function o(a){return a.charAt(0).toUpperCase()+a.slice(1)}return is}var xu=Iu();const ku=eu(xu),li=(s,e,t)=>{const n=ht(s),r=ht(e),i=r===n?".":bi(n,r);return t.some(o=>{const a=o.startsWith("./")?o.slice(2):o,u=i.startsWith("./")?i.slice(2):i;if(a==="."&&u===".")return!0;if(a.endsWith("/**")){const c=a.slice(0,-3);return u===c||u.startsWith(`${c}/`)}if(a.endsWith("/*")){const c=a.slice(0,-2);return c===""?u!=="."&&!u.includes("/"):u.startsWith(`${c}/`)||u===c}return u===a||u.startsWith(`${a}/`)})},hi=async s=>{const e=await Nn("pnpm-workspace.yaml",{cwd:ht(s),type:"file"});if(!e)return;const t=await Er(e),n=Array.isArray(t.packages)?t.packages:[];if(!li(e,s,n))return;const r={};return t.catalog&&typeof t.catalog=="object"&&(r.catalog=t.catalog),t.catalogs&&typeof t.catalogs=="object"&&(r.catalogs=t.catalogs),Object.keys(r).length>0?r:void 0},Pu=s=>{const e=Fi("pnpm-workspace.yaml",{cwd:ht(s),type:"file"});if(!e)return;const t=yr(e),n=Array.isArray(t.packages)?t.packages:[];if(!li(e,s,n))return;const r={};return t.catalog&&typeof t.catalog=="object"&&(r.catalog=t.catalog),t.catalogs&&typeof t.catalogs=="object"&&(r.catalogs=t.catalogs),Object.keys(r).length>0?r:void 0},Ru=(s,e,t)=>{if(e==="catalog:")return t.catalog?.[s];if(e.startsWith("catalog:")){const n=e.slice(8);return t.catalogs?.[n]?.[s]}},Tu=(s,e)=>{for(const[t,n]of Object.entries(s)){if(typeof n!="string")continue;const r=Ru(t,n,e);r&&(s[t]=r)}},Rs=(s,e)=>{const t=["dependencies","devDependencies","peerDependencies","optionalDependencies"];for(const n of t){if(!s[n]||typeof s[n]!="object")continue;const r=s[n];Tu(r,e)}},_u=Ci(import.meta.url),ke=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ts=s=>{if(typeof ke<"u"&&ke.versions&&ke.versions.node){const[e,t]=ke.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return ke.getBuiltinModule(s)}return _u(s)},{existsSync:fi}=Ts("node:fs"),{createInterface:ju}=Ts("node:readline"),{styleText:W}=Ts("node:util"),Ds=s=>{const e=typeof s;return s!==null&&(e==="object"||e==="function")},pi=new Set(["__proto__","prototype","constructor"]),di=1e6,Gu=s=>s>="0"&&s<="9";function mi(s){if(s==="0")return!0;if(/^[1-9]\d*$/.test(s)){const e=Number.parseInt(s,10);return e<=Number.MAX_SAFE_INTEGER&&e<=di}return!1}function os(s,e){return pi.has(s)?!1:(s&&mi(s)?e.push(Number.parseInt(s,10)):e.push(s),!0)}function Mu(s){if(typeof s!="string")throw new TypeError(`Expected a string, got ${typeof s}`);const e=[];let t="",n="start",r=!1,i=0;for(const o of s){if(i++,r){t+=o,r=!1;continue}if(o==="\\"){if(n==="index")throw new Error(`Invalid character '${o}' in an index at position ${i}`);if(n==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${i}`);r=!0,n=n==="start"?"property":n;continue}switch(o){case".":{if(n==="index")throw new Error(`Invalid character '${o}' in an index at position ${i}`);if(n==="indexEnd"){n="property";break}if(!os(t,e))return[];t="",n="property";break}case"[":{if(n==="index")throw new Error(`Invalid character '${o}' in an index at position ${i}`);if(n==="indexEnd"){n="index";break}if(n==="property"||n==="start"){if((t||n==="property")&&!os(t,e))return[];t=""}n="index";break}case"]":{if(n==="index"){if(t==="")t=(e.pop()||"")+"[]",n="property";else{const a=Number.parseInt(t,10);!Number.isNaN(a)&&Number.isFinite(a)&&a>=0&&a<=Number.MAX_SAFE_INTEGER&&a<=di&&t===String(a)?e.push(a):e.push(t),t="",n="indexEnd"}break}if(n==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${i}`);t+=o;break}default:{if(n==="index"&&!Gu(o))throw new Error(`Invalid character '${o}' in an index at position ${i}`);if(n==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${i}`);n==="start"&&(n="property"),t+=o}}}switch(r&&(t+="\\"),n){case"property":{if(!os(t,e))return[];break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Di(s){if(typeof s=="string")return Mu(s);if(Array.isArray(s)){const e=[];for(const[t,n]of s.entries()){if(typeof n!="string"&&typeof n!="number")throw new TypeError(`Expected a string or number for path segment at index ${t}, got ${typeof n}`);if(typeof n=="number"&&!Number.isFinite(n))throw new TypeError(`Path segment at index ${t} must be a finite number, got ${n}`);if(pi.has(n))return[];typeof n=="string"&&mi(n)?e.push(Number.parseInt(n,10)):e.push(n)}return e}return[]}function Se(s,e,t){if(!Ds(s)||typeof e!="string"&&!Array.isArray(e))return t===void 0?s:t;const n=Di(e);if(n.length===0)return t;for(let r=0;r<n.length;r++){const i=n[r];if(s=s[i],s==null){if(r!==n.length-1)return t;break}}return s===void 0?t:s}function lt(s,e){if(!Ds(s)||typeof e!="string"&&!Array.isArray(e))return!1;const t=Di(e);if(t.length===0)return!1;for(const n of t){if(!Ds(s)||!(n in s))return!1;s=s[n]}return!0}const Uu=async s=>{const{default:e=!1,message:t,transformer:n}=s,r=o=>{const a=W(["cyan","bold"],"?"),u=W(["bold"],o),c=e?`${W(["greenBright"],"Y")}${W(["gray"],"/n")}`:`y/${W(["yellowBright"],"N")}`;return`${a} ${u} ${W(["gray"],`(${c})`)}`},i=o=>n?n(o):o?W(["greenBright"],"Yes"):W(["yellowBright"],"No");return new Promise(o=>{const a=ju({input:process.stdin,output:process.stdout}),u=r(t);a.question(u,c=>{a.close();const l=c.trim().toLowerCase();if(l===""){o(e);return}if(l==="y"||l==="yes"){console.log(`${W(["greenBright"],"✓")} ${i(!0)}`),o(!0);return}if(l==="n"||l==="no"){console.log(`${W(["yellowBright"],"✗")} ${i(!1)}`),o(!1);return}console.log(`${W(["gray"],"→")} ${i(e)}`),o(e)}),a.on("SIGINT",()=>{a.close(),console.log(`
|
|
146
|
+
${W(["gray"],"→")} ${i(e)}`),o(e)})})},Ku=typeof process.stdout<"u"&&!process.versions.deno&&!globalThis.window,Hu=/, ([^,]*)$/,gt=new Map,qu=new Map,qe=(s,e={})=>`${s}|s${String(e.strict?1:0)}|c${String(e.resolveCatalogs?1:0)}|j${String(e.json5===!1?0:1)}|y${String(e.yaml===!1?0:1)}|w${String(e.ignoreWarnings?1:0)}`,gi=s=>s.trimStart().startsWith("{");class Wu extends Error{constructor(e){super(`The following warnings were encountered while normalizing package data:
|
|
147
|
+
- ${e.join(`
|
|
148
|
+
- `)}`),this.name="PackageJsonValidationError"}}const _s=(s,e,t=[])=>{const n=[];if(ku(s,r=>{n.push(r)},e),e&&n.length>0){const r=n.filter(i=>!t.some(o=>o instanceof RegExp?o.test(i):o===i));if(r.length>0)throw new Wu(r)}return s},Vu=async s=>await Er(s),Yu=s=>yr(s),zu=async s=>{const e=await gs(s);return br.parse(e)},Xu=s=>{const e=wn(s);return br.parse(e)},Ei=async(s,e)=>e?.yaml!==!1&&(s.endsWith(".yaml")||s.endsWith(".yml"))?Vu(s):e?.json5!==!1&&s.endsWith(".json5")?zu(s):Bi(s),Ju=(s,e)=>e?.yaml!==!1&&(s.endsWith(".yaml")||s.endsWith(".yml"))?Yu(s):e?.json5!==!1&&s.endsWith(".json5")?Xu(s):vi(s),La=async(s,e={})=>{const t={type:"file"};s&&(t.cwd=s);const n=["package.json"];e.yaml!==!1&&n.push("package.yaml","package.yml"),e.json5!==!1&&n.push("package.json5");const r=await Nn(n,t);if(!r)throw new Si(`No such file or directory, for ${n.join(", ").replace(Hu," or $1")} found.`);const i=e.cache&&typeof e.cache!="boolean"?e.cache:qu,o=qe(r,e);if(e.cache&&i.has(o))return i.get(o);const a=await Ei(r,e);if(e.resolveCatalogs){const c=await hi(r);c&&Rs(a,c)}_s(a,e.strict??!1,e.ignoreWarnings);const u={packageJson:a,path:r};return e.cache&&i.set(o,u),u},$a=(s,e)=>{const t=typeof s=="object"&&!Array.isArray(s);if(!t&&typeof s!="string")throw new TypeError("`packageFile` should be either an `object` or a `string`.");let n,r=!1,i;if(t)n=structuredClone(s);else if(!gi(s)&&fi(s)){i=s;const a=e?.cache&&typeof e.cache!="boolean"?e.cache:gt,u=qe(i,e);if(e?.cache&&a.has(u))return a.get(u);n=Ju(i,e),r=!0}else n=Es(s);if(e?.resolveCatalogs)if(r){const a=Pu(s);a&&Rs(n,a)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");_s(n,e?.strict??!1,e?.ignoreWarnings);const o=n;return r&&e?.cache&&(typeof e.cache=="boolean"?gt:e.cache).set(qe(i,e),o),o},Oa=async(s,e)=>{const t=typeof s=="object"&&!Array.isArray(s);if(!t&&typeof s!="string")throw new TypeError("`packageFile` should be either an `object` or a `string`.");let n,r=!1,i;if(t)n=structuredClone(s);else if(!gi(s)&&fi(s)){i=s;const a=e?.cache&&typeof e.cache!="boolean"?e.cache:gt,u=qe(i,e);if(e?.cache&&a.has(u))return a.get(u);n=await Ei(i,e),r=!0}else n=Es(s);if(e?.resolveCatalogs)if(r){const a=await hi(s);a&&Rs(n,a)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");_s(n,e?.strict??!1,e?.ignoreWarnings);const o=n;return r&&e?.cache&&(typeof e.cache=="boolean"?gt:e.cache).set(qe(i,e),o),o},Ba=(s,e,t)=>{const n=Se(s,"dependencies",{}),r=Se(s,"devDependencies",{}),i=Se(s,"peerDependencies",{}),o={...n,...r,...i};for(const a of e)if(lt(o,a))return!0;return!1},Ia=async(s,e,t="dependencies",n={})=>{const r=Se(s,"dependencies",{}),i=Se(s,"devDependencies",{}),o=Se(s,"peerDependencies",{}),a=[],u={deps:!0,devDeps:!0,peerDeps:!1,...n,...n.confirm?{confirm:{...n.confirm}}:{}};for(const c of e)u.deps&<(r,c)||u.devDeps&<(i,c)||u.peerDeps&<(o,c)||a.push(c);if(a.length!==0){if(process.env.CI||Ku&&!process.stdout.isTTY){const c=`Skipping package installation for [${e.join(", ")}] because the process is not interactive.`;if(n.throwOnWarn)throw new Error(c);n.logger?.warn?n.logger.warn(c):console.warn(c);return}if(typeof u.confirm?.message=="function"&&(u.confirm.message=u.confirm.message(a)),u.confirm?.message===void 0){const c=`${a.length===1?"Package is":"Packages are"} required for this config: ${a.join(", ")}. Do you want to install them?`;u.confirm===void 0?u.confirm={message:c}:u.confirm.message=c}await Uu(u.confirm)&&await Ai(a,{...u.installPackage,cwd:u.cwd?Sn(u.cwd):void 0,dev:t==="devDependencies"})}},S=Oi(import.meta.url);new URL(".",import.meta.url).pathname;const{readFileSync:Qu}=S("fs");let re=null;const N=[],Pe=()=>{let s=!1;return process.platform==="linux"&&(s=ea(),s===null&&(s=ta()),s===null&&(s=sa())),s},Zu=s=>s.includes("libc.musl-")||s.includes("ld-musl-"),ea=()=>{try{return Qu("/usr/bin/ldd","utf-8").includes("musl")}catch{return null}},ta=()=>{let s=null;return process.report&&typeof process.report.getReport=="function"&&(process.report.excludeNetwork=!0,s=process.report.getReport()),s?s.header&&s.header.glibcVersionRuntime?!1:!!(Array.isArray(s.sharedObjects)&&s.sharedObjects.some(Zu)):null},sa=()=>{try{return S("child_process").execSync("ldd --version",{encoding:"utf8"}).includes("musl")}catch{return!1}};function na(){if(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)try{return S(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)}catch(s){N.push(s)}else if(process.platform==="android")if(process.arch==="arm64"){try{return S("./transform.android-arm64.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-android-arm64"),e=S("@oxc-transform/binding-android-arm64/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else if(process.arch==="arm"){try{return S("./transform.android-arm-eabi.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-android-arm-eabi"),e=S("@oxc-transform/binding-android-arm-eabi/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else N.push(new Error(`Unsupported architecture on Android ${process.arch}`));else if(process.platform==="win32")if(process.arch==="x64")if(process.config&&process.config.variables&&process.config.variables.shlib_suffix==="dll.a"||process.config&&process.config.variables&&process.config.variables.node_target_type==="shared_library"){try{return S("./transform.win32-x64-gnu.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-win32-x64-gnu"),e=S("@oxc-transform/binding-win32-x64-gnu/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else{try{return S("./transform.win32-x64-msvc.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-win32-x64-msvc"),e=S("@oxc-transform/binding-win32-x64-msvc/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else if(process.arch==="ia32"){try{return S("./transform.win32-ia32-msvc.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-win32-ia32-msvc"),e=S("@oxc-transform/binding-win32-ia32-msvc/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else if(process.arch==="arm64"){try{return S("./transform.win32-arm64-msvc.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-win32-arm64-msvc"),e=S("@oxc-transform/binding-win32-arm64-msvc/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else N.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));else if(process.platform==="darwin"){try{return S("./transform.darwin-universal.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-darwin-universal"),e=S("@oxc-transform/binding-darwin-universal/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}if(process.arch==="x64"){try{return S("./transform.darwin-x64.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-darwin-x64"),e=S("@oxc-transform/binding-darwin-x64/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else if(process.arch==="arm64"){try{return S("./transform.darwin-arm64.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-darwin-arm64"),e=S("@oxc-transform/binding-darwin-arm64/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else N.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))}else if(process.platform==="freebsd")if(process.arch==="x64"){try{return S("./transform.freebsd-x64.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-freebsd-x64"),e=S("@oxc-transform/binding-freebsd-x64/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else if(process.arch==="arm64"){try{return S("./transform.freebsd-arm64.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-freebsd-arm64"),e=S("@oxc-transform/binding-freebsd-arm64/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else N.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));else if(process.platform==="linux")if(process.arch==="x64")if(Pe()){try{return S("./transform.linux-x64-musl.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-linux-x64-musl"),e=S("@oxc-transform/binding-linux-x64-musl/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else{try{return S("./transform.linux-x64-gnu.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-linux-x64-gnu"),e=S("@oxc-transform/binding-linux-x64-gnu/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else if(process.arch==="arm64")if(Pe()){try{return S("./transform.linux-arm64-musl.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-linux-arm64-musl"),e=S("@oxc-transform/binding-linux-arm64-musl/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else{try{return S("./transform.linux-arm64-gnu.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-linux-arm64-gnu"),e=S("@oxc-transform/binding-linux-arm64-gnu/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else if(process.arch==="arm")if(Pe()){try{return S("./transform.linux-arm-musleabihf.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-linux-arm-musleabihf"),e=S("@oxc-transform/binding-linux-arm-musleabihf/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else{try{return S("./transform.linux-arm-gnueabihf.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-linux-arm-gnueabihf"),e=S("@oxc-transform/binding-linux-arm-gnueabihf/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else if(process.arch==="loong64")if(Pe()){try{return S("./transform.linux-loong64-musl.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-linux-loong64-musl"),e=S("@oxc-transform/binding-linux-loong64-musl/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else{try{return S("./transform.linux-loong64-gnu.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-linux-loong64-gnu"),e=S("@oxc-transform/binding-linux-loong64-gnu/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else if(process.arch==="riscv64")if(Pe()){try{return S("./transform.linux-riscv64-musl.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-linux-riscv64-musl"),e=S("@oxc-transform/binding-linux-riscv64-musl/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else{try{return S("./transform.linux-riscv64-gnu.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-linux-riscv64-gnu"),e=S("@oxc-transform/binding-linux-riscv64-gnu/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else if(process.arch==="ppc64"){try{return S("./transform.linux-ppc64-gnu.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-linux-ppc64-gnu"),e=S("@oxc-transform/binding-linux-ppc64-gnu/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else if(process.arch==="s390x"){try{return S("./transform.linux-s390x-gnu.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-linux-s390x-gnu"),e=S("@oxc-transform/binding-linux-s390x-gnu/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else N.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));else if(process.platform==="openharmony")if(process.arch==="arm64"){try{return S("./transform.openharmony-arm64.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-openharmony-arm64"),e=S("@oxc-transform/binding-openharmony-arm64/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else if(process.arch==="x64"){try{return S("./transform.openharmony-x64.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-openharmony-x64"),e=S("@oxc-transform/binding-openharmony-x64/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else if(process.arch==="arm"){try{return S("./transform.openharmony-arm.node")}catch(s){N.push(s)}try{const s=S("@oxc-transform/binding-openharmony-arm"),e=S("@oxc-transform/binding-openharmony-arm/package.json").version;if(e!=="0.140.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.140.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return s}catch(s){N.push(s)}}else N.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));else N.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))}re=na();const nt=process.env.NAPI_RS_FORCE_WASI==="true"||process.env.NAPI_RS_FORCE_WASI==="error";if(!re||nt){let s=null,e=null;try{s=S("./transform.wasi.cjs"),re=s}catch(t){nt&&(e=t)}if(!re||nt)try{s=S("@oxc-transform/binding-wasm32-wasi"),re=s}catch(t){nt&&(e?e.cause=t:e=t,N.push(t))}if(process.env.NAPI_RS_FORCE_WASI==="error"&&!s){const t=new Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");throw t.cause=e,t}}if(!re&&globalThis.process?.versions?.webcontainer)try{re=S("./webcontainer-fallback.cjs")}catch(s){N.push(s)}if(!re){if(N.length>0){const s=new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.");throw s.cause=N.reduce((e,t)=>(t.cause=e,t)),s}throw new Error("Failed to load native binding")}const{transform:ra}=re,ia=({exclude:s,include:e,...t})=>{const n=Li(e,s??$i);return{name:"packem:oxc-transform",async transform(r,i){if(!n(i))return;const o=await ra(i,r,{...t,sourcemap:!0}),{code:a,errors:u,map:c}=o;if(u.length>0){const l=u.map(d=>typeof d=="string"?d:d.message??JSON.stringify(d));return this.error({message:[`
|
|
149
|
+
transform errors:`,...l].join(`
|
|
150
|
+
|
|
151
|
+
`),pluginCode:"ERR_TRANSFORM"})}return{code:a,map:c}}}};ia.NAME="oxc";export{Ba as $,Sr as a,tu as b,vr as c,su as d,Fr as e,La as f,nu as g,iu as h,ou as i,eu as j,Ia as k,Bi as m,ru as r,ia as t,$a as u,Oa as y};
|