tap-reader
Version:
A smol, streaming TAP parser.
27 lines (25 loc) • 138 kB
JavaScript
/* esm.sh - esbuild bundle(yaml@2.3.2) es2021 production */
(()=>{var R=Object.defineProperty;var C=(n,e,t)=>e in n?R(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var f=(n,e,t)=>(C(n,typeof e!="symbol"?e+"":e,t),t);var l=typeof Reflect=="object"?Reflect:null,y=l&&typeof l.apply=="function"?l.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)},d;l&&typeof l.ownKeys=="function"?d=l.ownKeys:Object.getOwnPropertySymbols?d=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:d=function(e){return Object.getOwnPropertyNames(e)};function N(n){console&&console.warn&&console.warn(n)}var L=Number.isNaN||function(e){return e!==e};function s(){b.call(this)}s.EventEmitter=s;s.prototype._events=void 0;s.prototype._eventsCount=0;s.prototype._maxListeners=void 0;var w=10;function v(n){if(typeof n!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return w},set:function(n){if(typeof n!="number"||n<0||L(n))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+n+".");w=n}});function b(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}s.init=b;s.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||L(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function _(n){return n._maxListeners===void 0?s.defaultMaxListeners:n._maxListeners}s.prototype.getMaxListeners=function(){return _(this)};s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i=e==="error",u=this._events;if(u!==void 0)i=i&&u.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var p=u[e];if(p===void 0)return!1;if(typeof p=="function")y(p,this,t);else for(var g=p.length,D=j(p,g),r=0;r<g;++r)y(D[r],this,t);return!0};function E(n,e,t,r){var i,u,o;if(v(t),u=n._events,u===void 0?(u=n._events=Object.create(null),n._eventsCount=0):(u.newListener!==void 0&&(n.emit("newListener",e,t.listener?t.listener:t),u=n._events),o=u[e]),o===void 0)o=u[e]=t,++n._eventsCount;else if(typeof o=="function"?o=u[e]=r?[t,o]:[o,t]:r?o.unshift(t):o.push(t),i=_(n),i>0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=n,a.type=e,a.count=o.length,N(a)}return n}s.prototype.addListener=function(e,t){return E(this,e,t,!1)};s.prototype.on=s.prototype.addListener;s.prototype.prependListener=function(e,t){return E(this,e,t,!0)};function P(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function O(n,e,t){var r={fired:!1,wrapFn:void 0,target:n,type:e,listener:t},i=P.bind(r);return i.listener=t,r.wrapFn=i,i}s.prototype.once=function(e,t){return v(t),this.on(e,O(this,e,t)),this};s.prototype.prependOnceListener=function(e,t){return v(t),this.prependListener(e,O(this,e,t)),this};s.prototype.removeListener=function(e,t){var r,i,u,o,a;if(v(t),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===t||r.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if(typeof r!="function"){for(u=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,u=o;break}if(u<0)return this;u===0?r.shift():T(r,u),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||t)}return this};s.prototype.off=s.prototype.removeListener;s.prototype.removeAllListeners=function(e){var t,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var u=Object.keys(r),o;for(i=0;i<u.length;++i)o=u[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=r[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this};function x(n,e,t){var r=n._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?I(i):j(i,i.length)}s.prototype.listeners=function(e){return x(this,e,!0)};s.prototype.rawListeners=function(e){return x(this,e,!1)};function A(n,e){return typeof n.listenerCount=="function"?n.listenerCount(e):s.prototype.listenerCount.call(n,e)}s.listenerCount=A;s.prototype.listenerCount=function(n){var e=this._events;if(e!==void 0){var t=e[n];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0};s.prototype.eventNames=function(){return this._eventsCount>0?d(this._events):[]};function j(n,e){for(var t=new Array(e),r=0;r<e;++r)t[r]=n[r];return t}function T(n,e){for(;e+1<n.length;e++)n[e]=n[e+1];n.pop()}function I(n){for(var e=new Array(n.length),t=0;t<e.length;++t)e[t]=n[t].listener||n[t];return e}function h(n){let e=performance.now(),t=Math.floor(e/1e3),r=Math.floor(e*1e6-t*1e9);if(!n)return[t,r];let[i,u]=n;return[t-i,r-u]}h.bigint=function(){let[n,e]=h();return BigInt(n)*1000000000n+BigInt(e)};var m=class extends s{constructor(){super();f(this,"title","browser");f(this,"browser",!0);f(this,"env",{});f(this,"argv",[]);f(this,"pid",0);f(this,"arch","unknown");f(this,"platform","browser");f(this,"version","");f(this,"versions",{});f(this,"emitWarning",()=>{throw new Error("process.emitWarning is not supported")});f(this,"binding",()=>{throw new Error("process.binding is not supported")});f(this,"cwd",()=>{throw new Error("process.cwd is not supported")});f(this,"chdir",t=>{throw new Error("process.chdir is not supported")});f(this,"umask",()=>18);f(this,"nextTick",(t,...r)=>queueMicrotask(()=>t(...r)));f(this,"hrtime",h)}},c=new m;if(typeof Deno<"u"){c.name="deno",c.browser=!1,c.pid=Deno.pid,c.cwd=()=>Deno.cwd(),c.chdir=e=>Deno.chdir(e),c.arch=Deno.build.arch,c.platform=Deno.build.os,c.version="v18.12.1",c.versions={node:"18.12.1",uv:"1.43.0",zlib:"1.2.11",brotli:"1.0.9",ares:"1.18.1",modules:"108",nghttp2:"1.47.0",napi:"8",llhttp:"6.0.10",openssl:"3.0.7+quic",cldr:"41.0",icu:"71.1",tz:"2022b",unicode:"14.0",ngtcp2:"0.8.1",nghttp3:"0.7.0",...Deno.version},c.env=new Proxy({},{get(e,t){return Deno.env.get(String(t))},ownKeys:()=>Reflect.ownKeys(Deno.env.toObject()),getOwnPropertyDescriptor:(e,t)=>{let r=Deno.env.toObject();if(t in Deno.env.toObject()){let i={enumerable:!0,configurable:!0};return typeof t=="string"&&(i.value=r[t]),i}},set(e,t,r){return Deno.env.set(String(t),String(r)),r}});let n=["","",...Deno.args];Object.defineProperty(n,"0",{get:Deno.execPath}),Object.defineProperty(n,"1",{get:()=>Deno.mainModule.startsWith("file:")?new URL(Deno.mainModule).pathname:join(Deno.cwd(),"$deno$node.js")}),c.argv=n}else{let n="/";c.cwd=()=>n,c.chdir=e=>n=e}var M=c;globalThis.__Process$=M;})();
(()=>{var Lt=Object.create,q=Object.defineProperty,_t=Object.getOwnPropertyDescriptor,xt=Object.getOwnPropertyNames,Ct=Object.getPrototypeOf,Mt=Object.prototype.hasOwnProperty,W=(p,a)=>()=>(a||p((a={exports:{}}).exports,a),a.exports),Pt=(p,a)=>{for(var s in a)q(p,s,{get:a[s],enumerable:!0})},V=(p,a,s,S)=>{if(a&&typeof a=="object"||typeof a=="function")for(let b of xt(a))!Mt.call(p,b)&&b!==s&&q(p,b,{get:()=>a[b],enumerable:!(S=_t(a,b))||S.enumerable});return p},$t=(p,a,s)=>(V(p,a,"default"),s&&V(s,a,"default")),st=(p,a,s)=>(s=p!=null?Lt(Ct(p)):{},V(a||!p||!p.__esModule?q(s,"default",{value:p,enumerable:!0}):s,p)),Nt=W(p=>{"use strict";p.byteLength=T,p.toByteArray=$,p.fromByteArray=P;var a=[],s=[],S=typeof Uint8Array<"u"?Uint8Array:Array,b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(B=0,c=b.length;B<c;++B)a[B]=b[B],s[b.charCodeAt(B)]=B;var B,c;s[45]=62,s[95]=63;function f(h){var l=h.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var w=h.indexOf("=");w===-1&&(w=l);var A=w===l?0:4-w%4;return[w,A]}function T(h){var l=f(h),w=l[0],A=l[1];return(w+A)*3/4-A}function L(h,l,w){return(l+w)*3/4-w}function $(h){var l,w=f(h),A=w[0],_=w[1],E=new S(L(h,A,_)),x=0,M=_>0?A-4:A,O;for(O=0;O<M;O+=4)l=s[h.charCodeAt(O)]<<18|s[h.charCodeAt(O+1)]<<12|s[h.charCodeAt(O+2)]<<6|s[h.charCodeAt(O+3)],E[x++]=l>>16&255,E[x++]=l>>8&255,E[x++]=l&255;return _===2&&(l=s[h.charCodeAt(O)]<<2|s[h.charCodeAt(O+1)]>>4,E[x++]=l&255),_===1&&(l=s[h.charCodeAt(O)]<<10|s[h.charCodeAt(O+1)]<<4|s[h.charCodeAt(O+2)]>>2,E[x++]=l>>8&255,E[x++]=l&255),E}function m(h){return a[h>>18&63]+a[h>>12&63]+a[h>>6&63]+a[h&63]}function U(h,l,w){for(var A,_=[],E=l;E<w;E+=3)A=(h[E]<<16&16711680)+(h[E+1]<<8&65280)+(h[E+2]&255),_.push(m(A));return _.join("")}function P(h){for(var l,w=h.length,A=w%3,_=[],E=16383,x=0,M=w-A;x<M;x+=E)_.push(U(h,x,x+E>M?M:x+E));return A===1?(l=h[w-1],_.push(a[l>>2]+a[l<<4&63]+"==")):A===2&&(l=(h[w-2]<<8)+h[w-1],_.push(a[l>>10]+a[l>>4&63]+a[l<<2&63]+"=")),_.join("")}}),jt=W(p=>{p.read=function(a,s,S,b,B){var c,f,T=B*8-b-1,L=(1<<T)-1,$=L>>1,m=-7,U=S?B-1:0,P=S?-1:1,h=a[s+U];for(U+=P,c=h&(1<<-m)-1,h>>=-m,m+=T;m>0;c=c*256+a[s+U],U+=P,m-=8);for(f=c&(1<<-m)-1,c>>=-m,m+=b;m>0;f=f*256+a[s+U],U+=P,m-=8);if(c===0)c=1-$;else{if(c===L)return f?NaN:(h?-1:1)*(1/0);f=f+Math.pow(2,b),c=c-$}return(h?-1:1)*f*Math.pow(2,c-b)},p.write=function(a,s,S,b,B,c){var f,T,L,$=c*8-B-1,m=(1<<$)-1,U=m>>1,P=B===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=b?0:c-1,l=b?1:-1,w=s<0||s===0&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(T=isNaN(s)?1:0,f=m):(f=Math.floor(Math.log(s)/Math.LN2),s*(L=Math.pow(2,-f))<1&&(f--,L*=2),f+U>=1?s+=P/L:s+=P*Math.pow(2,1-U),s*L>=2&&(f++,L/=2),f+U>=m?(T=0,f=m):f+U>=1?(T=(s*L-1)*Math.pow(2,B),f=f+U):(T=s*Math.pow(2,U-1)*Math.pow(2,B),f=0));B>=8;a[S+h]=T&255,h+=l,T/=256,B-=8);for(f=f<<B|T,$+=B;$>0;a[S+h]=f&255,h+=l,f/=256,$-=8);a[S+h-l]|=w*128}}),ht=W(p=>{"use strict";var a=Nt(),s=jt(),S=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;p.Buffer=f,p.SlowBuffer=_,p.INSPECT_MAX_BYTES=50;var b=2147483647;p.kMaxLength=b,f.TYPED_ARRAY_SUPPORT=B(),!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function B(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}});function c(t){if(t>b)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,f.prototype),e}function f(t,e,n){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(t)}return T(t,e,n)}f.poolSize=8192;function T(t,e,n){if(typeof t=="string")return U(t,e);if(ArrayBuffer.isView(t))return h(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(N(t,ArrayBuffer)||t&&N(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(N(t,SharedArrayBuffer)||t&&N(t.buffer,SharedArrayBuffer)))return l(t,e,n);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let r=t.valueOf&&t.valueOf();if(r!=null&&r!==t)return f.from(r,e,n);let o=w(t);if(o)return o;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return f.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}f.from=function(t,e,n){return T(t,e,n)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array);function L(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function $(t,e,n){return L(t),t<=0?c(t):e!==void 0?typeof n=="string"?c(t).fill(e,n):c(t).fill(e):c(t)}f.alloc=function(t,e,n){return $(t,e,n)};function m(t){return L(t),c(t<0?0:A(t)|0)}f.allocUnsafe=function(t){return m(t)},f.allocUnsafeSlow=function(t){return m(t)};function U(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let n=E(t,e)|0,r=c(n),o=r.write(t,e);return o!==n&&(r=r.slice(0,o)),r}function P(t){let e=t.length<0?0:A(t.length)|0,n=c(e);for(let r=0;r<e;r+=1)n[r]=t[r]&255;return n}function h(t){if(N(t,Uint8Array)){let e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return P(t)}function l(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return e===void 0&&n===void 0?r=new Uint8Array(t):n===void 0?r=new Uint8Array(t,e):r=new Uint8Array(t,e,n),Object.setPrototypeOf(r,f.prototype),r}function w(t){if(f.isBuffer(t)){let e=A(t.length)|0,n=c(e);return n.length===0||t.copy(n,0,0,e),n}if(t.length!==void 0)return typeof t.length!="number"||X(t.length)?c(0):P(t);if(t.type==="Buffer"&&Array.isArray(t.data))return P(t.data)}function A(t){if(t>=b)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+b.toString(16)+" bytes");return t|0}function _(t){return+t!=t&&(t=0),f.alloc(+t)}f.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==f.prototype},f.compare=function(t,e){if(N(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),N(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,r=e.length;for(let o=0,i=Math.min(n,r);o<i;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return f.alloc(0);let n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;let r=f.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){let i=t[n];if(N(i,Uint8Array))o+i.length>r.length?(f.isBuffer(i)||(i=f.from(i)),i.copy(r,o)):Uint8Array.prototype.set.call(r,i,o);else if(f.isBuffer(i))i.copy(r,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=i.length}return r};function E(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let n=t.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return it(t).length;default:if(o)return r?-1:G(t).length;e=(""+e).toLowerCase(),o=!0}}f.byteLength=E;function x(t,e,n){let r=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,e>>>=0,n<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Et(this,e,n);case"utf8":case"utf-8":return H(this,e,n);case"ascii":return Bt(this,e,n);case"latin1":case"binary":return mt(this,e,n);case"base64":return dt(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vt(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}f.prototype._isBuffer=!0;function M(t,e,n){let r=t[e];t[e]=t[n],t[n]=r}f.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)M(this,e,e+1);return this},f.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)M(this,e,e+3),M(this,e+1,e+2);return this},f.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this},f.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?H(this,0,t):x.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:f.compare(this,t)===0},f.prototype.inspect=function(){let t="",e=p.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},S&&(f.prototype[S]=f.prototype.inspect),f.prototype.compare=function(t,e,n,r,o){if(N(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,o>>>=0,this===t)return 0;let i=o-r,u=n-e,g=Math.min(i,u),R=this.slice(r,o),d=t.slice(e,n);for(let y=0;y<g;++y)if(R[y]!==d[y]){i=R[y],u=d[y];break}return i<u?-1:u<i?1:0};function O(t,e,n,r,o){if(t.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,X(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0)if(o)n=0;else return-1;if(typeof e=="string"&&(e=f.from(e,r)),f.isBuffer(e))return e.length===0?-1:Z(t,e,n,r,o);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):Z(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function Z(t,e,n,r,o){let i=1,u=t.length,g=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(t.length<2||e.length<2)return-1;i=2,u/=2,g/=2,n/=2}function R(y,v){return i===1?y[v]:y.readUInt16BE(v*i)}let d;if(o){let y=-1;for(d=n;d<u;d++)if(R(t,d)===R(e,y===-1?0:d-y)){if(y===-1&&(y=d),d-y+1===g)return y*i}else y!==-1&&(d-=d-y),y=-1}else for(n+g>u&&(n=u-g),d=n;d>=0;d--){let y=!0;for(let v=0;v<g;v++)if(R(t,d+v)!==R(e,v)){y=!1;break}if(y)return d}return-1}f.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1},f.prototype.indexOf=function(t,e,n){return O(this,t,e,n,!0)},f.prototype.lastIndexOf=function(t,e,n){return O(this,t,e,n,!1)};function pt(t,e,n,r){n=Number(n)||0;let o=t.length-n;r?(r=Number(r),r>o&&(r=o)):r=o;let i=e.length;r>i/2&&(r=i/2);let u;for(u=0;u<r;++u){let g=parseInt(e.substr(u*2,2),16);if(X(g))return u;t[n+u]=g}return u}function ct(t,e,n,r){return Y(G(e,t.length-n),t,n,r)}function gt(t,e,n,r){return Y(Rt(e),t,n,r)}function yt(t,e,n,r){return Y(it(e),t,n,r)}function wt(t,e,n,r){return Y(Tt(e,t.length-n),t,n,r)}f.prototype.write=function(t,e,n,r){if(e===void 0)r="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")r=e,n=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(n)?(n=n>>>0,r===void 0&&(r="utf8")):(r=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-e;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let i=!1;for(;;)switch(r){case"hex":return pt(this,t,e,n);case"utf8":case"utf-8":return ct(this,t,e,n);case"ascii":case"latin1":case"binary":return gt(this,t,e,n);case"base64":return yt(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wt(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function dt(t,e,n){return e===0&&n===t.length?a.fromByteArray(t):a.fromByteArray(t.slice(e,n))}function H(t,e,n){n=Math.min(t.length,n);let r=[],o=e;for(;o<n;){let i=t[o],u=null,g=i>239?4:i>223?3:i>191?2:1;if(o+g<=n){let R,d,y,v;switch(g){case 1:i<128&&(u=i);break;case 2:R=t[o+1],(R&192)===128&&(v=(i&31)<<6|R&63,v>127&&(u=v));break;case 3:R=t[o+1],d=t[o+2],(R&192)===128&&(d&192)===128&&(v=(i&15)<<12|(R&63)<<6|d&63,v>2047&&(v<55296||v>57343)&&(u=v));break;case 4:R=t[o+1],d=t[o+2],y=t[o+3],(R&192)===128&&(d&192)===128&&(y&192)===128&&(v=(i&15)<<18|(R&63)<<12|(d&63)<<6|y&63,v>65535&&v<1114112&&(u=v))}}u===null?(u=65533,g=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|u&1023),r.push(u),o+=g}return bt(r)}var K=4096;function bt(t){let e=t.length;if(e<=K)return String.fromCharCode.apply(String,t);let n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=K));return n}function Bt(t,e,n){let r="";n=Math.min(t.length,n);for(let o=e;o<n;++o)r+=String.fromCharCode(t[o]&127);return r}function mt(t,e,n){let r="";n=Math.min(t.length,n);for(let o=e;o<n;++o)r+=String.fromCharCode(t[o]);return r}function Et(t,e,n){let r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);let o="";for(let i=e;i<n;++i)o+=Ot[t[i]];return o}function vt(t,e,n){let r=t.slice(e,n),o="";for(let i=0;i<r.length-1;i+=2)o+=String.fromCharCode(r[i]+r[i+1]*256);return o}f.prototype.slice=function(t,e){let n=this.length;t=~~t,e=e===void 0?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);let r=this.subarray(t,e);return Object.setPrototypeOf(r,f.prototype),r};function I(t,e,n){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUintLE=f.prototype.readUIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||I(t,e,this.length);let r=this[t],o=1,i=0;for(;++i<e&&(o*=256);)r+=this[t+i]*o;return r},f.prototype.readUintBE=f.prototype.readUIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||I(t,e,this.length);let r=this[t+--e],o=1;for(;e>0&&(o*=256);)r+=this[t+--e]*o;return r},f.prototype.readUint8=f.prototype.readUInt8=function(t,e){return t=t>>>0,e||I(t,1,this.length),this[t]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||I(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||I(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||I(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readBigUInt64LE=j(function(t){t=t>>>0,F(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&D(t,this.length-8);let r=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))}),f.prototype.readBigUInt64BE=j(function(t){t=t>>>0,F(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&D(t,this.length-8);let r=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(o)}),f.prototype.readIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||I(t,e,this.length);let r=this[t],o=1,i=0;for(;++i<e&&(o*=256);)r+=this[t+i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*e)),r},f.prototype.readIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||I(t,e,this.length);let r=e,o=1,i=this[t+--r];for(;r>0&&(o*=256);)i+=this[t+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},f.prototype.readInt8=function(t,e){return t=t>>>0,e||I(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},f.prototype.readInt16LE=function(t,e){t=t>>>0,e||I(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},f.prototype.readInt16BE=function(t,e){t=t>>>0,e||I(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},f.prototype.readInt32LE=function(t,e){return t=t>>>0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return t=t>>>0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readBigInt64LE=j(function(t){t=t>>>0,F(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&D(t,this.length-8);let r=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)}),f.prototype.readBigInt64BE=j(function(t){t=t>>>0,F(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&D(t,this.length-8);let r=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)}),f.prototype.readFloatLE=function(t,e){return t=t>>>0,e||I(t,4,this.length),s.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return t=t>>>0,e||I(t,4,this.length),s.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||I(t,8,this.length),s.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||I(t,8,this.length),s.read(this,t,!1,52,8)};function C(t,e,n,r,o,i){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}f.prototype.writeUintLE=f.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e=e>>>0,n=n>>>0,!r){let u=Math.pow(2,8*n)-1;C(this,t,e,n,u,0)}let o=1,i=0;for(this[e]=t&255;++i<n&&(o*=256);)this[e+i]=t/o&255;return e+n},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e=e>>>0,n=n>>>0,!r){let u=Math.pow(2,8*n)-1;C(this,t,e,n,u,0)}let o=n-1,i=1;for(this[e+o]=t&255;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+n},f.prototype.writeUint8=f.prototype.writeUInt8=function(t,e,n){return t=+t,e=e>>>0,n||C(this,t,e,1,255,0),this[e]=t&255,e+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||C(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||C(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||C(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function Q(t,e,n,r,o){ft(e,r,o,t,n,7);let i=Number(e&BigInt(4294967295));t[n++]=i,i=i>>8,t[n++]=i,i=i>>8,t[n++]=i,i=i>>8,t[n++]=i;let u=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=u,u=u>>8,t[n++]=u,u=u>>8,t[n++]=u,u=u>>8,t[n++]=u,n}function tt(t,e,n,r,o){ft(e,r,o,t,n,7);let i=Number(e&BigInt(4294967295));t[n+7]=i,i=i>>8,t[n+6]=i,i=i>>8,t[n+5]=i,i=i>>8,t[n+4]=i;let u=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=u,u=u>>8,t[n+2]=u,u=u>>8,t[n+1]=u,u=u>>8,t[n]=u,n+8}f.prototype.writeBigUInt64LE=j(function(t,e=0){return Q(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeBigUInt64BE=j(function(t,e=0){return tt(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e=e>>>0,!r){let g=Math.pow(2,8*n-1);C(this,t,e,n,g-1,-g)}let o=0,i=1,u=0;for(this[e]=t&255;++o<n&&(i*=256);)t<0&&u===0&&this[e+o-1]!==0&&(u=1),this[e+o]=(t/i>>0)-u&255;return e+n},f.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e=e>>>0,!r){let g=Math.pow(2,8*n-1);C(this,t,e,n,g-1,-g)}let o=n-1,i=1,u=0;for(this[e+o]=t&255;--o>=0&&(i*=256);)t<0&&u===0&&this[e+o+1]!==0&&(u=1),this[e+o]=(t/i>>0)-u&255;return e+n},f.prototype.writeInt8=function(t,e,n){return t=+t,e=e>>>0,n||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1},f.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||C(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2},f.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||C(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},f.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4},f.prototype.writeBigInt64LE=j(function(t,e=0){return Q(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeBigInt64BE=j(function(t,e=0){return tt(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function et(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function nt(t,e,n,r,o){return e=+e,n=n>>>0,o||et(t,e,n,4,34028234663852886e22,-34028234663852886e22),s.write(t,e,n,r,23,4),n+4}f.prototype.writeFloatLE=function(t,e,n){return nt(this,t,e,!0,n)},f.prototype.writeFloatBE=function(t,e,n){return nt(this,t,e,!1,n)};function rt(t,e,n,r,o){return e=+e,n=n>>>0,o||et(t,e,n,8,17976931348623157e292,-17976931348623157e292),s.write(t,e,n,r,52,8),n+8}f.prototype.writeDoubleLE=function(t,e,n){return rt(this,t,e,!0,n)},f.prototype.writeDoubleBE=function(t,e,n){return rt(this,t,e,!1,n)},f.prototype.copy=function(t,e,n,r){if(!f.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&r!==0&&(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);let o=r-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),o},f.prototype.fill=function(t,e,n,r){if(typeof t=="string"){if(typeof e=="string"?(r=e,e=0,n=this.length):typeof n=="string"&&(r=n,n=this.length),r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!f.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(t.length===1){let i=t.charCodeAt(0);(r==="utf8"&&i<128||r==="latin1")&&(t=i)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let o;if(typeof t=="number")for(o=e;o<n;++o)this[o]=t;else{let i=f.isBuffer(t)?t:f.from(t,r),u=i.length;if(u===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-e;++o)this[o+e]=i[o%u]}return this};var k={};function z(t,e,n){k[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(r){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:r,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}z("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),z("ERR_OUT_OF_RANGE",function(t,e,n){let r=`The value of "${t}" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>2**32?o=ot(String(n)):typeof n=="bigint"&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=ot(o)),o+="n"),r+=` It must be ${e}. Received ${o}`,r},RangeError);function ot(t){let e="",n=t.length,r=t[0]==="-"?1:0;for(;n>=r+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function At(t,e,n){F(e,"offset"),(t[e]===void 0||t[e+n]===void 0)&&D(e,t.length-(n+1))}function ft(t,e,n,r,o,i){if(t>n||t<e){let u=typeof e=="bigint"?"n":"",g;throw i>3?e===0||e===BigInt(0)?g=`>= 0${u} and < 2${u} ** ${(i+1)*8}${u}`:g=`>= -(2${u} ** ${(i+1)*8-1}${u}) and < 2 ** ${(i+1)*8-1}${u}`:g=`>= ${e}${u} and <= ${n}${u}`,new k.ERR_OUT_OF_RANGE("value",g,t)}At(r,o,i)}function F(t,e){if(typeof t!="number")throw new k.ERR_INVALID_ARG_TYPE(e,"number",t)}function D(t,e,n){throw Math.floor(t)!==t?(F(t,n),new k.ERR_OUT_OF_RANGE(n||"offset","an integer",t)):e<0?new k.ERR_BUFFER_OUT_OF_BOUNDS:new k.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${e}`,t)}var It=/[^+/0-9A-Za-z-_]/g;function Ut(t){if(t=t.split("=")[0],t=t.trim().replace(It,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function G(t,e){e=e||1/0;let n,r=t.length,o=null,i=[];for(let u=0;u<r;++u){if(n=t.charCodeAt(u),n>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(u+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=(o-55296<<10|n-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,n&63|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return i}function Rt(t){let e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n)&255);return e}function Tt(t,e){let n,r,o,i=[];for(let u=0;u<t.length&&!((e-=2)<0);++u)n=t.charCodeAt(u),r=n>>8,o=n%256,i.push(o),i.push(r);return i}function it(t){return a.toByteArray(Ut(t))}function Y(t,e,n,r){let o;for(o=0;o<r&&!(o+n>=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function N(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function X(t){return t!==t}var Ot=function(){let t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){let r=n*16;for(let o=0;o<16;++o)e[r+o]=t[n]+t[o]}return e}();function j(t){return typeof BigInt>"u"?St:t}function St(){throw new Error("BigInt not supported")}}),at={};Pt(at,{Buffer:()=>J,INSPECT_MAX_BYTES:()=>Ft,SlowBuffer:()=>kt,default:()=>zt,kMaxLength:()=>Dt});var lt=st(ht());$t(at,st(ht()));var{Buffer:J,SlowBuffer:kt,INSPECT_MAX_BYTES:Ft,kMaxLength:Dt}=lt,{default:ut,...Yt}=lt,zt=ut!==void 0?ut:Yt;globalThis.__Buffer$=J;})();
/*! Bundled license information:
ieee754/index.js:
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
buffer/index.js:
(*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*)
*/
var ln=Object.defineProperty;var as=(s,e)=>{for(var t in e)ln(s,t,{get:e[t],enumerable:!0})};var ls={};as(ls,{Alias:()=>te,CST:()=>ns,Composer:()=>be,Document:()=>se,Lexer:()=>Me,LineCounter:()=>Be,Pair:()=>C,Parser:()=>we,Scalar:()=>b,Schema:()=>Ce,YAMLError:()=>$e,YAMLMap:()=>$,YAMLParseError:()=>x,YAMLSeq:()=>M,YAMLWarning:()=>_e,isAlias:()=>F,isCollection:()=>T,isDocument:()=>z,isMap:()=>R,isNode:()=>L,isPair:()=>E,isScalar:()=>A,isSeq:()=>U,parse:()=>rn,parseAllDocuments:()=>nn,parseDocument:()=>os,stringify:()=>on,visit:()=>V,visitAsync:()=>je});var et=Symbol.for("yaml.alias"),tt=Symbol.for("yaml.document"),Q=Symbol.for("yaml.map"),Mt=Symbol.for("yaml.pair"),q=Symbol.for("yaml.scalar"),re=Symbol.for("yaml.seq"),j=Symbol.for("yaml.node.type"),F=s=>!!s&&typeof s=="object"&&s[j]===et,z=s=>!!s&&typeof s=="object"&&s[j]===tt,R=s=>!!s&&typeof s=="object"&&s[j]===Q,E=s=>!!s&&typeof s=="object"&&s[j]===Mt,A=s=>!!s&&typeof s=="object"&&s[j]===q,U=s=>!!s&&typeof s=="object"&&s[j]===re;function T(s){if(s&&typeof s=="object")switch(s[j]){case Q:case re:return!0}return!1}function L(s){if(s&&typeof s=="object")switch(s[j]){case et:case Q:case q:case re:return!0}return!1}var cs=s=>(A(s)||T(s))&&!!s.anchor;var K=Symbol("break visit"),fs=Symbol("skip children"),Z=Symbol("remove node");function V(s,e){let t=us(e);z(s)?ke(null,s.contents,t,Object.freeze([s]))===Z&&(s.contents=null):ke(null,s,t,Object.freeze([]))}V.BREAK=K;V.SKIP=fs;V.REMOVE=Z;function ke(s,e,t,n){let i=hs(s,e,t,n);if(L(i)||E(i))return ps(s,n,i),ke(s,i,t,n);if(typeof i!="symbol"){if(T(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=ke(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===K)return K;o===Z&&(e.items.splice(r,1),r-=1)}}}else if(E(e)){n=Object.freeze(n.concat(e));let r=ke("key",e.key,t,n);if(r===K)return K;r===Z&&(e.key=null);let o=ke("value",e.value,t,n);if(o===K)return K;o===Z&&(e.value=null)}}return i}async function je(s,e){let t=us(e);z(s)?await Ne(null,s.contents,t,Object.freeze([s]))===Z&&(s.contents=null):await Ne(null,s,t,Object.freeze([]))}je.BREAK=K;je.SKIP=fs;je.REMOVE=Z;async function Ne(s,e,t,n){let i=await hs(s,e,t,n);if(L(i)||E(i))return ps(s,n,i),Ne(s,i,t,n);if(typeof i!="symbol"){if(T(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=await Ne(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===K)return K;o===Z&&(e.items.splice(r,1),r-=1)}}}else if(E(e)){n=Object.freeze(n.concat(e));let r=await Ne("key",e.key,t,n);if(r===K)return K;r===Z&&(e.key=null);let o=await Ne("value",e.value,t,n);if(o===K)return K;o===Z&&(e.value=null)}}return i}function us(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 hs(s,e,t,n){if(typeof t=="function")return t(s,e,n);if(R(e))return t.Map?.(s,e,n);if(U(e))return t.Seq?.(s,e,n);if(E(e))return t.Pair?.(s,e,n);if(A(e))return t.Scalar?.(s,e,n);if(F(e))return t.Alias?.(s,e,n)}function ps(s,e,t){let n=e[e.length-1];if(T(n))n.items[s]=t;else if(E(n))s==="key"?n.key=t:n.value=t;else if(z(n))n.contents=t;else{let i=F(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}var an={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},cn=s=>s.replace(/[!,[\]{}]/g,e=>an[e]),ee=class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/);i||t(`The ${e} tag has no suffix`);let r=this.tags[n];return r?r+decodeURIComponent(i):n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+cn(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&L(e.contents)){let r={};V(e.contents,(o,l)=>{L(l)&&l.tag&&(r[l.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
`)}};ee.defaultYaml={explicit:!1,version:"1.2"};ee.defaultTags={"!!":"tag:yaml.org,2002:"};function st(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function Bt(s){let e=new Set;return V(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function Dt(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}function ms(s,e){let t=[],n=new Map,i=null;return{onAnchor:r=>{t.push(r),i||(i=Bt(s));let o=Dt(e,i);return i.add(o),o},setAnchors:()=>{for(let r of t){let o=n.get(r);if(typeof o=="object"&&o.anchor&&(A(o.node)||T(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=r,l}}},sourceObjects:n}}function fe(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){let o=n[i],l=fe(s,n,String(i),o);l===void 0?delete n[i]:l!==o&&(n[i]=l)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),o=fe(s,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let r=fe(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(let[i,r]of Object.entries(n)){let o=fe(s,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return s.call(e,t,n)}function _(s,e,t){if(Array.isArray(s))return s.map((n,i)=>_(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!cs(s))return s.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};let i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!t?.keep?Number(s):s}var ue=class{constructor(e){Object.defineProperty(this,j,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!z(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=_(this,"",o);if(typeof i=="function")for(let{count:a,res:c}of o.anchors.values())i(c,a);return typeof r=="function"?fe(r,{"":l},"",l):l}};var te=class extends ue{constructor(e){super(et),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return V(e,{Node:(n,i)=>{if(i===this)return V.BREAK;i.anchor===this.source&&(t=i)}}),t}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:r}=t,o=this.resolve(i);if(!o){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(a)}let l=n.get(o);if(l||(_(o,null,t),l=n.get(o)),!l||l.res===void 0){let a="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(a)}if(r>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=nt(i,o,n)),l.count*l.aliasCount>r)){let a="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(a)}return l.res}toString(e,t,n){let i=`*${this.source}`;if(e){if(st(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function nt(s,e,t){if(F(e)){let n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(T(e)){let n=0;for(let i of e.items){let r=nt(s,i,t);r>n&&(n=r)}return n}else if(E(e)){let n=nt(s,e.key,t),i=nt(s,e.value,t);return Math.max(n,i)}return 1}var it=s=>!s||typeof s!="function"&&typeof s!="object",b=class extends ue{constructor(e){super(q),this.value=e}toJSON(e,t){return t?.keep?this.value:_(this.value,e,t)}toString(){return String(this.value)}};b.BLOCK_FOLDED="BLOCK_FOLDED";b.BLOCK_LITERAL="BLOCK_LITERAL";b.PLAIN="PLAIN";b.QUOTE_DOUBLE="QUOTE_DOUBLE";b.QUOTE_SINGLE="QUOTE_SINGLE";var fn="tag:yaml.org,2002:";function un(s,e,t){if(e){let n=t.filter(r=>r.tag===e),i=n.find(r=>!r.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(n=>n.identify?.(s)&&!n.format)}function oe(s,e,t){if(z(s)&&(s=s.contents),L(s))return s;if(E(s)){let f=t.schema[Q].createNode?.(t.schema,null,t);return f.items.push(s),f}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:l}=t,a;if(n&&s&&typeof s=="object"){if(a=l.get(s),a)return a.anchor||(a.anchor=i(s)),new te(a.anchor);a={anchor:null,node:null},l.set(s,a)}e?.startsWith("!!")&&(e=fn+e.slice(2));let c=un(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let f=new b(s);return a&&(a.node=f),f}c=s instanceof Map?o[Q]:Symbol.iterator in Object(s)?o[re]:o[Q]}r&&(r(c),delete t.onTagObj);let p=c?.createNode?c.createNode(t.schema,s,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,s,t):new b(s);return e?p.tag=e:c.default||(p.tag=c.tag),a&&(a.node=p),p}function Ke(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return oe(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var Oe=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,le=class extends ue{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>L(n)||E(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Oe(e))this.add(t);else{let[n,...i]=e,r=this.get(n,!0);if(T(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,Ke(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let i=this.get(t,!0);if(T(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&A(r)?r.value:r:T(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!E(t))return!1;let n=t.value;return n==null||e&&A(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let i=this.get(t,!0);return T(i)?i.hasIn(n):!1}setIn(e,t){let[n,...i]=e;if(i.length===0)this.set(n,t);else{let r=this.get(n,!0);if(T(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,Ke(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};le.maxFlowStringSingleLineLength=60;var ds=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function Y(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var G=(s,e,t)=>s.endsWith(`
`)?Y(t,e):t.includes(`
`)?`
`+Y(t,e):(s.endsWith(" ")?"":" ")+t;var jt="flow",rt="block",xe="quoted";function qe(s,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return s;let a=Math.max(1+r,1+i-e.length);if(s.length<=a)return s;let c=[],p={},f=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?c.push(0):f=i-n);let u,m,w=!1,h=-1,d=-1,S=-1;t===rt&&(h=gs(s,h),h!==-1&&(f=h+a));for(let k;k=s[h+=1];){if(t===xe&&k==="\\"){switch(d=h,s[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}S=h}if(k===`
`)t===rt&&(h=gs(s,h)),f=h+a,u=void 0;else{if(k===" "&&m&&m!==" "&&m!==`
`&&m!==" "){let N=s[h+1];N&&N!==" "&&N!==`
`&&N!==" "&&(u=h)}if(h>=f)if(u)c.push(u),f=u+a,u=void 0;else if(t===xe){for(;m===" "||m===" ";)m=k,k=s[h+=1],w=!0;let N=h>S+1?h-2:d-1;if(p[N])return s;c.push(N),p[N]=!0,f=N+a,u=void 0}else w=!0}m=k}if(w&&l&&l(),c.length===0)return s;o&&o();let y=s.slice(0,c[0]);for(let k=0;k<c.length;++k){let N=c[k],O=c[k+1]||s.length;N===0?y=`
${e}${s.slice(0,O)}`:(t===xe&&p[N]&&(y+=`${s[N]}\\`),y+=`
${e}${s.slice(N+1,O)}`)}return y}function gs(s,e){let t=s[e+1];for(;t===" "||t===" ";){do t=s[e+=1];while(t&&t!==`
`);t=s[e+1]}return e}var lt=(s,e)=>({indentAtStart:e?s.inde