From d2a5633bbee3128271f2184df48041e4fd84c6b4 Mon Sep 17 00:00:00 2001 From: Auke van Slooten Date: Thu, 4 Apr 2024 13:55:07 +0200 Subject: [PATCH 1/4] add github action to automatically create the dist/oldm.mjs bundle --- .github/workflows/run-build.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/run-build.yml diff --git a/.github/workflows/run-build.yml b/.github/workflows/run-build.yml new file mode 100644 index 0000000..dc0befc --- /dev/null +++ b/.github/workflows/run-build.yml @@ -0,0 +1,28 @@ +--- +name: Run esbuild bundle + +on: + - pull_request + # Allow manually triggering the workflow. + - workflow_dispatch + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + # The concurrency group contains the workflow name and the branch name. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - run: npm install + - run: npm run build + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: auto create bundle + + \ No newline at end of file From 33bcba96ffc3dd1dc02a1e7271cc6d2a86deed25 Mon Sep 17 00:00:00 2001 From: Auke van Slooten Date: Thu, 4 Apr 2024 14:04:54 +0200 Subject: [PATCH 2/4] updated jsontag to fix autobuild --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 31df811..e131c01 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "node": ">=20.0.0" }, "dependencies": { - "@muze-nl/jsontag": "^0.9.4", + "@muze-nl/jsontag": "^0.9.5", "n3": "^1.17.2" }, "files": [ From 832b1d16e7ed1d8bf72580795f7424b93cbc94f8 Mon Sep 17 00:00:00 2001 From: Auke van Slooten Date: Thu, 4 Apr 2024 14:11:14 +0200 Subject: [PATCH 3/4] maybe don't autocommit node_modules and stuff... --- .github/workflows/run-build.yml | 2 ++ .gitignore | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 .gitignore diff --git a/.github/workflows/run-build.yml b/.github/workflows/run-build.yml index dc0befc..a036352 100644 --- a/.github/workflows/run-build.yml +++ b/.github/workflows/run-build.yml @@ -24,5 +24,7 @@ jobs: - uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: auto create bundle + file_pattern: 'dist/*' + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..504afef --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +package-lock.json From 5ca3390568d7d8cf66faaa1e85b3ff6cb82f2ed8 Mon Sep 17 00:00:00 2001 From: poef Date: Thu, 4 Apr 2024 12:12:10 +0000 Subject: [PATCH 4/4] auto create bundle --- dist/oldm.mjs | 16 ++++++++-------- dist/oldm.mjs.map | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dist/oldm.mjs b/dist/oldm.mjs index e6ca059..cf129be 100644 --- a/dist/oldm.mjs +++ b/dist/oldm.mjs @@ -1,12 +1,12 @@ -var Bl=Object.create;var zr=Object.defineProperty;var Fl=Object.getOwnPropertyDescriptor;var jl=Object.getOwnPropertyNames;var Pl=Object.getPrototypeOf,Ol=Object.prototype.hasOwnProperty;var A=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Cl=(t,e)=>{for(var r in e)zr(t,r,{get:e[r],enumerable:!0})},Ml=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of jl(e))!Ol.call(t,i)&&i!==r&&zr(t,i,{get:()=>e[i],enumerable:!(n=Fl(e,i))||n.enumerable});return t};var nr=(t,e,r)=>(r=t!=null?Bl(Pl(t)):{},Ml(e||!t||!t.__esModule?zr(r,"default",{value:t,enumerable:!0}):r,t));var Di=A((T_,$i)=>{var Mi;$i.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(Mi||(Mi=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var Xi=A(or=>{"use strict";or.byteLength=lu;or.toByteArray=fu;or.fromByteArray=hu;var fe=[],ee=[],au=typeof Uint8Array<"u"?Uint8Array:Array,rn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Qe=0,Yi=rn.length;Qe0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function lu(t){var e=Zi(t),r=e[0],n=e[1];return(r+n)*3/4-n}function uu(t,e,r){return(e+r)*3/4-r}function fu(t){var e,r=Zi(t),n=r[0],i=r[1],s=new au(uu(t,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=ee[t.charCodeAt(l)]<<2|ee[t.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=ee[t.charCodeAt(l)]<<10|ee[t.charCodeAt(l+1)]<<4|ee[t.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function du(t){return fe[t>>18&63]+fe[t>>12&63]+fe[t>>6&63]+fe[t&63]}function cu(t,e,r){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=t[r-1],i.push(fe[e>>2]+fe[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(fe[e>>10]+fe[e>>4&63]+fe[e<<2&63]+"=")),i.join("")}});var es=A(nn=>{nn.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,l=(1<>1,d=-7,f=r?i-1:0,b=r?-1:1,_=t[e+f];for(f+=b,s=_&(1<<-d)-1,_>>=-d,d+=a;d>0;s=s*256+t[e+f],f+=b,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=n;d>0;o=o*256+t[e+f],f+=b,d-=8);if(s===0)s=1-u;else{if(s===l)return o?NaN:(_?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-u}return(_?-1:1)*o*Math.pow(2,s-n)};nn.write=function(t,e,r,n,i,s){var o,a,l,u=s*8-i-1,d=(1<>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:s-1,y=n?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+f>=1?e+=b/l:e+=b*Math.pow(2,1-f),e*l>=2&&(o++,l/=2),o+f>=d?(a=0,o=d):o+f>=1?(a=(e*l-1)*Math.pow(2,i),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+_]=a&255,_+=y,a/=256,i-=8);for(o=o<0;t[r+_]=o&255,_+=y,o/=256,u-=8);t[r+_-y]|=g*128}});var Ee=A(dt=>{"use strict";var sn=Xi(),ut=es(),ts=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;dt.Buffer=h;dt.SlowBuffer=wu;dt.INSPECT_MAX_BYTES=50;var ar=2147483647;dt.kMaxLength=ar;h.TYPED_ARRAY_SUPPORT=pu();!h.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 pu(){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(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}});Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}});function Se(t){if(t>ar)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,h.prototype),e}function h(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return un(t)}return ss(t,e,r)}h.poolSize=8192;function ss(t,e,r){if(typeof t=="string")return bu(t,e);if(ArrayBuffer.isView(t))return yu(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(de(t,ArrayBuffer)||t&&de(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(de(t,SharedArrayBuffer)||t&&de(t.buffer,SharedArrayBuffer)))return an(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return h.from(n,e,r);let i=gu(t);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return h.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}h.from=function(t,e,r){return ss(t,e,r)};Object.setPrototypeOf(h.prototype,Uint8Array.prototype);Object.setPrototypeOf(h,Uint8Array);function os(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 _u(t,e,r){return os(t),t<=0?Se(t):e!==void 0?typeof r=="string"?Se(t).fill(e,r):Se(t).fill(e):Se(t)}h.alloc=function(t,e,r){return _u(t,e,r)};function un(t){return os(t),Se(t<0?0:fn(t)|0)}h.allocUnsafe=function(t){return un(t)};h.allocUnsafeSlow=function(t){return un(t)};function bu(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!h.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=as(t,e)|0,n=Se(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function on(t){let e=t.length<0?0:fn(t.length)|0,r=Se(e);for(let n=0;n=ar)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ar.toString(16)+" bytes");return t|0}function wu(t){return+t!=t&&(t=0),h.alloc(+t)}h.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==h.prototype};h.compare=function(e,r){if(de(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),de(r,Uint8Array)&&(r=h.from(r,r.offset,r.byteLength)),!h.isBuffer(e)||!h.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,i=r.length;for(let s=0,o=Math.min(n,i);si.length?(h.isBuffer(o)||(o=h.from(o)),o.copy(i,s)):Uint8Array.prototype.set.call(i,o,s);else if(h.isBuffer(o))o.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=o.length}return i};function as(t,e){if(h.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||de(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 r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return ln(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return bs(t).length;default:if(i)return n?-1:ln(t).length;e=(""+e).toLowerCase(),i=!0}}h.byteLength=as;function mu(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Lu(this,e,r);case"utf8":case"utf-8":return us(this,e,r);case"ascii":return Nu(this,e,r);case"latin1":case"binary":return ku(this,e,r);case"base64":return Au(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vu(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}h.prototype._isBuffer=!0;function ze(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}h.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;rr&&(e+=" ... "),""};ts&&(h.prototype[ts]=h.prototype.inspect);h.prototype.compare=function(e,r,n,i,s){if(de(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),r<0||n>e.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&r>=n)return 0;if(i>=s)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,s>>>=0,this===e)return 0;let o=s-i,a=n-r,l=Math.min(o,a),u=this.slice(i,s),d=e.slice(r,n);for(let f=0;f2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,cn(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=h.from(e,n)),h.isBuffer(e))return e.length===0?-1:rs(t,e,r,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):rs(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function rs(t,e,r,n,i){let s=1,o=t.length,a=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,o/=2,a/=2,r/=2}function l(d,f){return s===1?d[f]:d.readUInt16BE(f*s)}let u;if(i){let d=-1;for(u=r;uo&&(r=o-a),u=r;u>=0;u--){let d=!0;for(let f=0;fi&&(n=i)):n=i;let s=e.length;n>s/2&&(n=s/2);let o;for(o=0;o>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let s=this.length-r;if((n===void 0||n>s)&&(n=s),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return xu(this,e,r,n);case"utf8":case"utf-8":return Su(this,e,r,n);case"ascii":case"latin1":case"binary":return Eu(this,e,r,n);case"base64":return Ru(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Iu(this,e,r,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Au(t,e,r){return e===0&&r===t.length?sn.fromByteArray(t):sn.fromByteArray(t.slice(e,r))}function us(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i239?4:s>223?3:s>191?2:1;if(i+a<=r){let l,u,d,f;switch(a){case 1:s<128&&(o=s);break;case 2:l=t[i+1],(l&192)===128&&(f=(s&31)<<6|l&63,f>127&&(o=f));break;case 3:l=t[i+1],u=t[i+2],(l&192)===128&&(u&192)===128&&(f=(s&15)<<12|(l&63)<<6|u&63,f>2047&&(f<55296||f>57343)&&(o=f));break;case 4:l=t[i+1],u=t[i+2],d=t[i+3],(l&192)===128&&(u&192)===128&&(d&192)===128&&(f=(s&15)<<18|(l&63)<<12|(u&63)<<6|d&63,f>65535&&f<1114112&&(o=f))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=a}return Tu(n)}var ns=4096;function Tu(t){let e=t.length;if(e<=ns)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn)&&(r=n);let i="";for(let s=e;sn&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),rr)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUintLE=h.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||q(e,r,this.length);let i=this[e],s=1,o=0;for(;++o>>0,r=r>>>0,n||q(e,r,this.length);let i=this[e+--r],s=1;for(;r>0&&(s*=256);)i+=this[e+--r]*s;return i};h.prototype.readUint8=h.prototype.readUInt8=function(e,r){return e=e>>>0,r||q(e,1,this.length),this[e]};h.prototype.readUint16LE=h.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||q(e,2,this.length),this[e]|this[e+1]<<8};h.prototype.readUint16BE=h.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||q(e,2,this.length),this[e]<<8|this[e+1]};h.prototype.readUint32LE=h.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||q(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};h.prototype.readUint32BE=h.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||q(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};h.prototype.readBigUInt64LE=je(function(e){e=e>>>0,ft(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&qt(e,this.length-8);let i=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<>>0,ft(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&qt(e,this.length-8);let i=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<>>0,r=r>>>0,n||q(e,r,this.length);let i=this[e],s=1,o=0;for(;++o=s&&(i-=Math.pow(2,8*r)),i};h.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||q(e,r,this.length);let i=r,s=1,o=this[e+--i];for(;i>0&&(s*=256);)o+=this[e+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*r)),o};h.prototype.readInt8=function(e,r){return e=e>>>0,r||q(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};h.prototype.readInt16LE=function(e,r){e=e>>>0,r||q(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};h.prototype.readInt16BE=function(e,r){e=e>>>0,r||q(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};h.prototype.readInt32LE=function(e,r){return e=e>>>0,r||q(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};h.prototype.readInt32BE=function(e,r){return e=e>>>0,r||q(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};h.prototype.readBigInt64LE=je(function(e){e=e>>>0,ft(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&qt(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,ft(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&qt(e,this.length-8);let i=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,r||q(e,4,this.length),ut.read(this,e,!0,23,4)};h.prototype.readFloatBE=function(e,r){return e=e>>>0,r||q(e,4,this.length),ut.read(this,e,!1,23,4)};h.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||q(e,8,this.length),ut.read(this,e,!0,52,8)};h.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||q(e,8,this.length),ut.read(this,e,!1,52,8)};function Y(t,e,r,n,i,s){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}h.prototype.writeUintLE=h.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;Y(this,e,r,n,a,0)}let s=1,o=0;for(this[r]=e&255;++o>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;Y(this,e,r,n,a,0)}let s=n-1,o=1;for(this[r+s]=e&255;--s>=0&&(o*=256);)this[r+s]=e/o&255;return r+n};h.prototype.writeUint8=h.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,1,255,0),this[r]=e&255,r+1};h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function fs(t,e,r,n,i){_s(e,n,i,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,r}function ds(t,e,r,n,i){_s(e,n,i,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s=s>>8,t[r+6]=s,s=s>>8,t[r+5]=s,s=s>>8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o=o>>8,t[r+2]=o,o=o>>8,t[r+1]=o,o=o>>8,t[r]=o,r+8}h.prototype.writeBigUInt64LE=je(function(e,r=0){return fs(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});h.prototype.writeBigUInt64BE=je(function(e,r=0){return ds(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});h.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let l=Math.pow(2,8*n-1);Y(this,e,r,n,l-1,-l)}let s=0,o=1,a=0;for(this[r]=e&255;++s>0)-a&255;return r+n};h.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let l=Math.pow(2,8*n-1);Y(this,e,r,n,l-1,-l)}let s=n-1,o=1,a=0;for(this[r+s]=e&255;--s>=0&&(o*=256);)e<0&&a===0&&this[r+s+1]!==0&&(a=1),this[r+s]=(e/o>>0)-a&255;return r+n};h.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};h.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};h.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};h.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};h.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};h.prototype.writeBigInt64LE=je(function(e,r=0){return fs(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});h.prototype.writeBigInt64BE=je(function(e,r=0){return ds(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function cs(t,e,r,n,i,s){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function hs(t,e,r,n,i){return e=+e,r=r>>>0,i||cs(t,e,r,4,34028234663852886e22,-34028234663852886e22),ut.write(t,e,r,n,23,4),r+4}h.prototype.writeFloatLE=function(e,r,n){return hs(this,e,r,!0,n)};h.prototype.writeFloatBE=function(e,r,n){return hs(this,e,r,!1,n)};function ps(t,e,r,n,i){return e=+e,r=r>>>0,i||cs(t,e,r,8,17976931348623157e292,-17976931348623157e292),ut.write(t,e,r,n,52,8),r+8}h.prototype.writeDoubleLE=function(e,r,n){return ps(this,e,r,!0,n)};h.prototype.writeDoubleBE=function(e,r,n){return ps(this,e,r,!1,n)};h.prototype.copy=function(e,r,n,i){if(!h.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let s;if(typeof e=="number")for(s=r;s2**32?i=is(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=is(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function is(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Bu(t,e,r){ft(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&qt(e,t.length-(r+1))}function _s(t,e,r,n,i,s){if(t>r||t3?e===0||e===BigInt(0)?a=`>= 0${o} and < 2${o} ** ${(s+1)*8}${o}`:a=`>= -(2${o} ** ${(s+1)*8-1}${o}) and < 2 ** ${(s+1)*8-1}${o}`:a=`>= ${e}${o} and <= ${r}${o}`,new lt.ERR_OUT_OF_RANGE("value",a,t)}Bu(n,i,s)}function ft(t,e){if(typeof t!="number")throw new lt.ERR_INVALID_ARG_TYPE(e,"number",t)}function qt(t,e,r){throw Math.floor(t)!==t?(ft(t,r),new lt.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new lt.ERR_BUFFER_OUT_OF_BOUNDS:new lt.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var Fu=/[^+/0-9A-Za-z-_]/g;function ju(t){if(t=t.split("=")[0],t=t.trim().replace(Fu,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ln(t,e){e=e||1/0;let r,n=t.length,i=null,s=[];for(let o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function Pu(t){let e=[];for(let r=0;r>8,i=r%256,s.push(i),s.push(n);return s}function bs(t){return sn.toByteArray(ju(t))}function lr(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function de(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function cn(t){return t!==t}var Cu=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function je(t){return typeof BigInt>"u"?Mu:t}function Mu(){throw new Error("BigInt not supported")}});var B=A((Q_,ys)=>{"use strict";ys.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Boolean,Uint8Array}});var ct=A((z_,ur)=>{"use strict";var{AbortController:gs,AbortSignal:$u}=typeof self<"u"?self:typeof window<"u"?window:void 0;ur.exports=gs;ur.exports.AbortSignal=$u;ur.exports.default=gs});var Ut=A((V_,hn)=>{"use strict";var ht=typeof Reflect=="object"?Reflect:null,ws=ht&&typeof ht.apply=="function"?ht.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},fr;ht&&typeof ht.ownKeys=="function"?fr=ht.ownKeys:Object.getOwnPropertySymbols?fr=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:fr=function(e){return Object.getOwnPropertyNames(e)};function Du(t){console&&console.warn&&console.warn(t)}var xs=Number.isNaN||function(e){return e!==e};function T(){T.init.call(this)}hn.exports=T;hn.exports.once=Gu;T.EventEmitter=T;T.prototype._events=void 0;T.prototype._eventsCount=0;T.prototype._maxListeners=void 0;var ms=10;function dr(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(T,"defaultMaxListeners",{enumerable:!0,get:function(){return ms},set:function(t){if(typeof t!="number"||t<0||xs(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");ms=t}});T.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};T.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||xs(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 Ss(t){return t._maxListeners===void 0?T.defaultMaxListeners:t._maxListeners}T.prototype.getMaxListeners=function(){return Ss(this)};T.prototype.emit=function(e){for(var r=[],n=1;n0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=s[e];if(l===void 0)return!1;if(typeof l=="function")ws(l,this,r);else for(var u=l.length,d=Ts(l,u),n=0;n0&&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=t,a.type=e,a.count=o.length,Du(a)}return t}T.prototype.addListener=function(e,r){return Es(this,e,r,!1)};T.prototype.on=T.prototype.addListener;T.prototype.prependListener=function(e,r){return Es(this,e,r,!0)};function qu(){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 Rs(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=qu.bind(n);return i.listener=r,n.wrapFn=i,i}T.prototype.once=function(e,r){return dr(r),this.on(e,Rs(this,e,r)),this};T.prototype.prependOnceListener=function(e,r){return dr(r),this.prependListener(e,Rs(this,e,r)),this};T.prototype.removeListener=function(e,r){var n,i,s,o,a;if(dr(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():Uu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};T.prototype.off=T.prototype.removeListener;T.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i=0;i--)this.removeListener(e,r[i]);return this};function Is(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?Wu(i):Ts(i,i.length)}T.prototype.listeners=function(e){return Is(this,e,!0)};T.prototype.rawListeners=function(e){return Is(this,e,!1)};T.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):As.call(t,e)};T.prototype.listenerCount=As;function As(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}T.prototype.eventNames=function(){return this._eventsCount>0?fr(this._events):[]};function Ts(t,e){for(var r=new Array(e),n=0;n{"use strict";var Qu=Ee(),{kResistStopPropagation:zu,SymbolDispose:Vu}=B(),Ju=globalThis.AbortSignal||ct().AbortSignal,Ku=globalThis.AbortController||ct().AbortController,Yu=Object.getPrototypeOf(async function(){}).constructor,ks=globalThis.Blob||Qu.Blob,Zu=typeof ks<"u"?function(e){return e instanceof ks}:function(e){return!1},Ls=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},Xu=(t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},pn=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let n=0;n{t=n,e=i}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((n,...i)=>n?r(n):e(...i))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,n]){let i=e.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof Yu},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:Zu,deprecate(t,e){return t},addAbortListener:Ut().addAbortListener||function(e,r){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);Ls(e,"signal"),Xu(r,"listener");let n;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[zu]:!0}),n=()=>{e.removeEventListener("abort",r)}),{__proto__:null,[Vu](){var i;(i=n)===null||i===void 0||i()}}},AbortSignalAny:Ju.any||function(e){if(e.length===1)return e[0];let r=new Ku,n=()=>r.abort();return e.forEach(i=>{Ls(i,"signals"),i.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(i=>i.removeEventListener("abort",n))},{once:!0}),r.signal}};_n.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var V=A((K_,Fs)=>{"use strict";var{format:ef,inspect:cr,AggregateError:tf}=Q(),rf=globalThis.AggregateError||tf,nf=Symbol("kIsNodeError"),sf=["string","function","number","object","Function","Object","boolean","bigint","symbol"],of=/^([A-Z][a-z0-9]*)+$/,af="__node_internal_",hr={};function Ve(t,e){if(!t)throw new hr.ERR_INTERNAL_ASSERTION(e)}function vs(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function lf(t,e,r){if(typeof e=="function")return Ve(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let n=(e.match(/%[dfijoOs]/g)||[]).length;return Ve(n===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?e:ef(e,...r)}function U(t,e,r){r||(r=Error);class n extends r{constructor(...s){super(lf(t,e,s))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=t,n.prototype[nf]=!0,hr[t]=n}function Bs(t){let e=af+t.name;return Object.defineProperty(t,"name",{value:e}),t}function uf(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new rf([e,t],e.message);return r.code=e.code,r}return t||e}var bn=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new hr.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};U("ERR_ASSERTION","%s",Error);U("ERR_INVALID_ARG_TYPE",(t,e,r)=>{Ve(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let i=[],s=[],o=[];for(let l of e)Ve(typeof l=="string","All expected entries have to be of type string"),sf.includes(l)?i.push(l.toLowerCase()):of.test(l)?s.push(l):(Ve(l!=="object",'The value "object" should be written as "Object"'),o.push(l));if(s.length>0){let l=i.indexOf("object");l!==-1&&(i.splice(i,l,1),s.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{let l=i.pop();n+=`one of type ${i.join(", ")}, or ${l}`}}(s.length>0||o.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let l=s.pop();n+=`an instance of ${s.join(", ")}, or ${l}`}}o.length>0&&(n+=" or ")}switch(o.length){case 0:break;case 1:o[0].toLowerCase()!==o[0]&&(n+="an "),n+=`${o[0]}`;break;case 2:n+=`one of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();n+=`one of ${o.join(", ")}, or ${l}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)n+=`. Received an instance of ${r.constructor.name}`;else{let l=cr(r,{depth:-1});n+=`. Received ${l}`}}else{let l=cr(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),n+=`. Received type ${typeof r} (${l})`}return n},TypeError);U("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let n=cr(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${n}`},TypeError);U("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var n;let i=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${i}.`},TypeError);U("ERR_MISSING_ARGS",(...t)=>{Ve(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}break}return`${e} must be specified`},TypeError);U("ERR_OUT_OF_RANGE",(t,e,r)=>{Ve(e,'Missing "range" argument');let n;return Number.isInteger(r)&&Math.abs(r)>2**32?n=vs(String(r)):typeof r=="bigint"?(n=String(r),(r>2n**32n||r<-(2n**32n))&&(n=vs(n)),n+="n"):n=cr(r),`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);U("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);U("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);U("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);U("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);U("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);U("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);U("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);U("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);U("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);U("ERR_STREAM_WRITE_AFTER_END","write after end",Error);U("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Fs.exports={AbortError:bn,aggregateTwoErrors:Bs(uf),hideStackFrames:Bs,codes:hr}});var _t=A((Y_,Ws)=>{"use strict";var{ArrayIsArray:gn,ArrayPrototypeIncludes:Cs,ArrayPrototypeJoin:Ms,ArrayPrototypeMap:ff,NumberIsInteger:wn,NumberIsNaN:df,NumberMAX_SAFE_INTEGER:cf,NumberMIN_SAFE_INTEGER:hf,NumberParseInt:pf,ObjectPrototypeHasOwnProperty:_f,RegExpPrototypeExec:$s,String:bf,StringPrototypeToUpperCase:yf,StringPrototypeTrim:gf}=B(),{hideStackFrames:te,codes:{ERR_SOCKET_BAD_PORT:wf,ERR_INVALID_ARG_TYPE:z,ERR_INVALID_ARG_VALUE:pt,ERR_OUT_OF_RANGE:Je,ERR_UNKNOWN_SIGNAL:js}}=V(),{normalizeEncoding:mf}=Q(),{isAsyncFunction:xf,isArrayBufferView:Sf}=Q().types,Ps={};function Ef(t){return t===(t|0)}function Rf(t){return t===t>>>0}var If=/^[0-7]+$/,Af="must be a 32-bit unsigned integer or an octal string";function Tf(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if($s(If,t)===null)throw new pt(e,t,Af);t=pf(t,8)}return Ds(t,e),t}var Nf=te((t,e,r=hf,n=cf)=>{if(typeof t!="number")throw new z(e,"number",t);if(!wn(t))throw new Je(e,"an integer",t);if(tn)throw new Je(e,`>= ${r} && <= ${n}`,t)}),kf=te((t,e,r=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new z(e,"number",t);if(!wn(t))throw new Je(e,"an integer",t);if(tn)throw new Je(e,`>= ${r} && <= ${n}`,t)}),Ds=te((t,e,r=!1)=>{if(typeof t!="number")throw new z(e,"number",t);if(!wn(t))throw new Je(e,"an integer",t);let n=r?1:0,i=4294967295;if(ti)throw new Je(e,`>= ${n} && <= ${i}`,t)});function mn(t,e){if(typeof t!="string")throw new z(e,"string",t)}function Lf(t,e,r=void 0,n){if(typeof t!="number")throw new z(e,"number",t);if(r!=null&&tn||(r!=null||n!=null)&&df(t))throw new Je(e,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}var vf=te((t,e,r)=>{if(!Cs(r,t)){let i="must be one of: "+Ms(ff(r,s=>typeof s=="string"?`'${s}'`:bf(s)),", ");throw new pt(e,t,i)}});function qs(t,e){if(typeof t!="boolean")throw new z(e,"boolean",t)}function yn(t,e,r){return t==null||!_f(t,e)?r:t[e]}var Bf=te((t,e,r=null)=>{let n=yn(r,"allowArray",!1),i=yn(r,"allowFunction",!1);if(!yn(r,"nullable",!1)&&t===null||!n&&gn(t)||typeof t!="object"&&(!i||typeof t!="function"))throw new z(e,"Object",t)}),Ff=te((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new z(e,"a dictionary",t)}),pr=te((t,e,r=0)=>{if(!gn(t))throw new z(e,"Array",t);if(t.length{if(!Sf(t))throw new z(e,["Buffer","TypedArray","DataView"],t)});function $f(t,e){let r=mf(e),n=t.length;if(r==="hex"&&n%2!==0)throw new pt("encoding",e,`is invalid for data of length ${n}`)}function Df(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&gf(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new wf(e,t,r);return t|0}var Us=te((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new z(e,"AbortSignal",t)}),qf=te((t,e)=>{if(typeof t!="function")throw new z(e,"Function",t)}),Uf=te((t,e)=>{if(typeof t!="function"||xf(t))throw new z(e,"Function",t)}),Wf=te((t,e)=>{if(t!==void 0)throw new z(e,"undefined",t)});function Gf(t,e,r){if(!Cs(r,t))throw new z(e,`('${Ms(r,"|")}')`,t)}var Hf=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Os(t,e){if(typeof t>"u"||!$s(Hf,t))throw new pt(e,t,'must be an array or string of format "; rel=preload; as=style"')}function Qf(t){if(typeof t=="string")return Os(t,"hints"),t;if(gn(t)){let e=t.length,r="";if(e===0)return r;for(let n=0;n; rel=preload; as=style"')}Ws.exports={isInt32:Ef,isUint32:Rf,parseFileMode:Tf,validateArray:pr,validateStringArray:jf,validateBooleanArray:Pf,validateAbortSignalArray:Of,validateBoolean:qs,validateBuffer:Mf,validateDictionary:Ff,validateEncoding:$f,validateFunction:qf,validateInt32:kf,validateInteger:Nf,validateNumber:Lf,validateObject:Bf,validateOneOf:vf,validatePlainFunction:Uf,validatePort:Df,validateSignalName:Cf,validateString:mn,validateUint32:Ds,validateUndefined:Wf,validateUnion:Gf,validateAbortSignal:Us,validateLinkHeaderValue:Qf}});var Pe=A((Z_,zs)=>{var O=zs.exports={},ce,he;function xn(){throw new Error("setTimeout has not been defined")}function Sn(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ce=setTimeout:ce=xn}catch{ce=xn}try{typeof clearTimeout=="function"?he=clearTimeout:he=Sn}catch{he=Sn}})();function Gs(t){if(ce===setTimeout)return setTimeout(t,0);if((ce===xn||!ce)&&setTimeout)return ce=setTimeout,setTimeout(t,0);try{return ce(t,0)}catch{try{return ce.call(null,t,0)}catch{return ce.call(this,t,0)}}}function zf(t){if(he===clearTimeout)return clearTimeout(t);if((he===Sn||!he)&&clearTimeout)return he=clearTimeout,clearTimeout(t);try{return he(t)}catch{try{return he.call(null,t)}catch{return he.call(this,t)}}}var Re=[],bt=!1,Ke,_r=-1;function Vf(){!bt||!Ke||(bt=!1,Ke.length?Re=Ke.concat(Re):_r=-1,Re.length&&Hs())}function Hs(){if(!bt){var t=Gs(Vf);bt=!0;for(var e=Re.length;e;){for(Ke=Re,Re=[];++_r1)for(var r=1;r{"use strict";var{SymbolAsyncIterator:Vs,SymbolIterator:Js,SymbolFor:Ye}=B(),Ks=Ye("nodejs.stream.destroyed"),Ys=Ye("nodejs.stream.errored"),En=Ye("nodejs.stream.readable"),Rn=Ye("nodejs.stream.writable"),Zs=Ye("nodejs.stream.disturbed"),Jf=Ye("nodejs.webstream.isClosedPromise"),Kf=Ye("nodejs.webstream.controllerErrorFunction");function br(t,e=!1){var r;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}function yr(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function Yf(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function pe(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function Xs(t){return!!(t&&!pe(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function eo(t){return!!(t&&!pe(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function to(t){return!!(t&&!pe(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function Zf(t){return Xs(t)||eo(t)||to(t)}function Xf(t,e){return t==null?!1:e===!0?typeof t[Vs]=="function":e===!1?typeof t[Js]=="function":typeof t[Vs]=="function"||typeof t[Js]=="function"}function gr(t){if(!pe(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!!(t.destroyed||t[Ks]||n!=null&&n.destroyed)}function ro(t){if(!yr(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function ed(t,e){if(!yr(t))return null;if(t.writableFinished===!0)return!0;let r=t._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}function td(t){if(!br(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function no(t,e){if(!br(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}function io(t){return t&&t[En]!=null?t[En]:typeof t?.readable!="boolean"?null:gr(t)?!1:br(t)&&t.readable&&!no(t)}function so(t){return t&&t[Rn]!=null?t[Rn]:typeof t?.writable!="boolean"?null:gr(t)?!1:yr(t)&&t.writable&&!ro(t)}function rd(t,e){return pe(t)?gr(t)?!0:!(e?.readable!==!1&&io(t)||e?.writable!==!1&&so(t)):null}function nd(t){var e,r;return pe(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function id(t){var e,r;return pe(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function sd(t){if(!pe(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof e?.closed=="boolean"||typeof r?.closed=="boolean"?e?.closed||r?.closed:typeof t._closed=="boolean"&&oo(t)?t._closed:null}function oo(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function ao(t){return typeof t._sent100=="boolean"&&oo(t)}function od(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function ad(t){if(!pe(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!n&&ao(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function ld(t){var e;return!!(t&&((e=t[Zs])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function ud(t){var e,r,n,i,s,o,a,l,u,d;return!!(t&&((e=(r=(n=(i=(s=(o=t[Ys])!==null&&o!==void 0?o:t.readableErrored)!==null&&s!==void 0?s:t.writableErrored)!==null&&i!==void 0?i:(a=t._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&n!==void 0?n:(l=t._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(u=t._readableState)===null||u===void 0?void 0:u.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}lo.exports={isDestroyed:gr,kIsDestroyed:Ks,isDisturbed:ld,kIsDisturbed:Zs,isErrored:ud,kIsErrored:Ys,isReadable:io,kIsReadable:En,kIsClosedPromise:Jf,kControllerErrorFunction:Kf,kIsWritable:Rn,isClosed:sd,isDuplexNodeStream:Yf,isFinished:rd,isIterable:Xf,isReadableNodeStream:br,isReadableStream:Xs,isReadableEnded:td,isReadableFinished:no,isReadableErrored:id,isNodeStream:pe,isWebStream:Zf,isWritable:so,isWritableNodeStream:yr,isWritableStream:eo,isWritableEnded:ro,isWritableFinished:ed,isWritableErrored:nd,isServerRequest:od,isServerResponse:ao,willEmitClose:ad,isTransformStream:to}});var Ae=A((eb,kn)=>{var Oe=Pe(),{AbortError:go,codes:fd}=V(),{ERR_INVALID_ARG_TYPE:dd,ERR_STREAM_PREMATURE_CLOSE:uo}=fd,{kEmptyObject:An,once:Tn}=Q(),{validateAbortSignal:cd,validateFunction:hd,validateObject:pd,validateBoolean:_d}=_t(),{Promise:bd,PromisePrototypeThen:yd,SymbolDispose:wo}=B(),{isClosed:gd,isReadable:fo,isReadableNodeStream:In,isReadableStream:wd,isReadableFinished:co,isReadableErrored:ho,isWritable:po,isWritableNodeStream:_o,isWritableStream:md,isWritableFinished:bo,isWritableErrored:yo,isNodeStream:xd,willEmitClose:Sd,kIsClosedPromise:Ed}=_e(),yt;function Rd(t){return t.setHeader&&typeof t.abort=="function"}var Nn=()=>{};function mo(t,e,r){var n,i;if(arguments.length===2?(r=e,e=An):e==null?e=An:pd(e,"options"),hd(r,"callback"),cd(e.signal,"options.signal"),r=Tn(r),wd(t)||md(t))return Id(t,e,r);if(!xd(t))throw new dd("stream",["ReadableStream","WritableStream","Stream"],t);let s=(n=e.readable)!==null&&n!==void 0?n:In(t),o=(i=e.writable)!==null&&i!==void 0?i:_o(t),a=t._writableState,l=t._readableState,u=()=>{t.writable||b()},d=Sd(t)&&In(t)===s&&_o(t)===o,f=bo(t,!1),b=()=>{f=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||s))&&(!s||_)&&r.call(t)},_=co(t,!1),y=()=>{_=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||o))&&(!o||f)&&r.call(t)},g=j=>{r.call(t,j)},m=gd(t),w=()=>{m=!0;let j=yo(t)||ho(t);if(j&&typeof j!="boolean")return r.call(t,j);if(s&&!_&&In(t,!0)&&!co(t,!1))return r.call(t,new uo);if(o&&!f&&!bo(t,!1))return r.call(t,new uo);r.call(t)},R=()=>{m=!0;let j=yo(t)||ho(t);if(j&&typeof j!="boolean")return r.call(t,j);r.call(t)},N=()=>{t.req.on("finish",b)};Rd(t)?(t.on("complete",b),d||t.on("abort",w),t.req?N():t.on("request",N)):o&&!a&&(t.on("end",u),t.on("close",u)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",w),t.on("end",y),t.on("finish",b),e.error!==!1&&t.on("error",g),t.on("close",w),m?Oe.nextTick(w):a!=null&&a.errorEmitted||l!=null&&l.errorEmitted?d||Oe.nextTick(R):(!s&&(!d||fo(t))&&(f||po(t)===!1)||!o&&(!d||po(t))&&(_||fo(t)===!1)||l&&t.req&&t.aborted)&&Oe.nextTick(R);let S=()=>{r=Nn,t.removeListener("aborted",w),t.removeListener("complete",b),t.removeListener("abort",w),t.removeListener("request",N),t.req&&t.req.removeListener("finish",b),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",b),t.removeListener("end",y),t.removeListener("error",g),t.removeListener("close",w)};if(e.signal&&!m){let j=()=>{let me=r;S(),me.call(t,new go(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)Oe.nextTick(j);else{yt=yt||Q().addAbortListener;let me=yt(e.signal,j),J=r;r=Tn((...Le)=>{me[wo](),J.apply(t,Le)})}}return S}function Id(t,e,r){let n=!1,i=Nn;if(e.signal)if(i=()=>{n=!0,r.call(t,new go(void 0,{cause:e.signal.reason}))},e.signal.aborted)Oe.nextTick(i);else{yt=yt||Q().addAbortListener;let o=yt(e.signal,i),a=r;r=Tn((...l)=>{o[wo](),a.apply(t,l)})}let s=(...o)=>{n||Oe.nextTick(()=>r.apply(t,o))};return yd(t[Ed].promise,s,s),Nn}function Ad(t,e){var r;let n=!1;return e===null&&(e=An),(r=e)!==null&&r!==void 0&&r.cleanup&&(_d(e.cleanup,"cleanup"),n=e.cleanup),new bd((i,s)=>{let o=mo(t,e,a=>{n&&o(),a?s(a):i()})})}kn.exports=mo;kn.exports.finished=Ad});var Ze=A((tb,No)=>{"use strict";var be=Pe(),{aggregateTwoErrors:Td,codes:{ERR_MULTIPLE_CALLBACK:Nd},AbortError:kd}=V(),{Symbol:Eo}=B(),{kIsDestroyed:Ld,isDestroyed:vd,isFinished:Bd,isServerRequest:Fd}=_e(),Ro=Eo("kDestroy"),Ln=Eo("kConstruct");function Io(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function jd(t,e){let r=this._readableState,n=this._writableState,i=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(Io(t,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?xo(this,t,e):this.once(Ro,function(s){xo(this,Td(s,t),e)}),this)}function xo(t,e,r){let n=!1;function i(s){if(n)return;n=!0;let o=t._readableState,a=t._writableState;Io(s,a,o),a&&(a.closed=!0),o&&(o.closed=!0),typeof r=="function"&&r(s),s?be.nextTick(Pd,t,s):be.nextTick(Ao,t)}try{t._destroy(e||null,i)}catch(s){i(s)}}function Pd(t,e){vn(t,e),Ao(t)}function Ao(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close")}function vn(t,e){let r=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}function Od(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}function Bn(t,e,r){let n=t._readableState,i=t._writableState;if(i!=null&&i.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||i!=null&&i.autoDestroy?t.destroy(e):e&&(e.stack,i&&!i.errored&&(i.errored=e),n&&!n.errored&&(n.errored=e),r?be.nextTick(vn,t,e):vn(t,e))}function Cd(t,e){if(typeof t._construct!="function")return;let r=t._readableState,n=t._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),t.once(Ln,e),!(t.listenerCount(Ln)>1)&&be.nextTick(Md,t)}function Md(t){let e=!1;function r(n){if(e){Bn(t,n??new Nd);return}e=!0;let i=t._readableState,s=t._writableState,o=s||i;i&&(i.constructed=!0),s&&(s.constructed=!0),o.destroyed?t.emit(Ro,n):n?Bn(t,n,!0):be.nextTick($d,t)}try{t._construct(n=>{be.nextTick(r,n)})}catch(n){be.nextTick(r,n)}}function $d(t){t.emit(Ln)}function So(t){return t?.setHeader&&typeof t.abort=="function"}function To(t){t.emit("close")}function Dd(t,e){t.emit("error",e),be.nextTick(To,t)}function qd(t,e){!t||vd(t)||(!e&&!Bd(t)&&(e=new kd),Fd(t)?(t.socket=null,t.destroy(e)):So(t)?t.abort():So(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?be.nextTick(Dd,t,e):be.nextTick(To,t),t.destroyed||(t[Ld]=!0))}No.exports={construct:Cd,destroyer:qd,destroy:jd,undestroy:Od,errorOrDestroy:Bn}});var xr=A((rb,Lo)=>{"use strict";var{ArrayIsArray:Ud,ObjectSetPrototypeOf:ko}=B(),{EventEmitter:wr}=Ut();function mr(t){wr.call(this,t)}ko(mr.prototype,wr.prototype);ko(mr,wr);mr.prototype.pipe=function(t,e){let r=this;function n(d){t.writable&&t.write(d)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}t.on("drain",i),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",o),r.on("close",a));let s=!1;function o(){s||(s=!0,t.end())}function a(){s||(s=!0,typeof t.destroy=="function"&&t.destroy())}function l(d){u(),wr.listenerCount(this,"error")===0&&this.emit("error",d)}Fn(r,"error",l),Fn(t,"error",l);function u(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",o),r.removeListener("close",a),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",u),r.removeListener("close",u),t.removeListener("close",u)}return r.on("end",u),r.on("close",u),t.on("close",u),t.emit("pipe",r),t};function Fn(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Ud(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}Lo.exports={Stream:mr,prependListener:Fn}});var Wt=A((nb,Sr)=>{"use strict";var{SymbolDispose:Wd}=B(),{AbortError:vo,codes:Gd}=V(),{isNodeStream:Bo,isWebStream:Hd,kControllerErrorFunction:Qd}=_e(),zd=Ae(),{ERR_INVALID_ARG_TYPE:Fo}=Gd,jn,Vd=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new Fo(e,"AbortSignal",t)};Sr.exports.addAbortSignal=function(e,r){if(Vd(e,"signal"),!Bo(r)&&!Hd(r))throw new Fo("stream",["ReadableStream","WritableStream","Stream"],r);return Sr.exports.addAbortSignalNoValidate(e,r)};Sr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=Bo(e)?()=>{e.destroy(new vo(void 0,{cause:t.reason}))}:()=>{e[Qd](new vo(void 0,{cause:t.reason}))};if(t.aborted)r();else{jn=jn||Q().addAbortListener;let n=jn(t,r);zd(e,n[Wd])}return e}});var Oo=A((sb,Po)=>{"use strict";var{StringPrototypeSlice:jo,SymbolIterator:Jd,TypedArrayPrototypeSet:Er,Uint8Array:Kd}=B(),{Buffer:Pn}=Ee(),{inspect:Yd}=Q();Po.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=e+r.data;return n}concat(e){if(this.length===0)return Pn.alloc(0);let r=Pn.allocUnsafe(e>>>0),n=this.head,i=0;for(;n;)Er(r,n.data,i),i+=n.data.length,n=n.next;return r}consume(e,r){let n=this.head.data;if(es.length)r+=s,e-=s.length;else{e===s.length?(r+=s,++i,n.next?this.head=n.next:this.head=this.tail=null):(r+=jo(s,0,e),this.head=n,n.data=jo(s,e));break}++i}while((n=n.next)!==null);return this.length-=i,r}_getBuffer(e){let r=Pn.allocUnsafe(e),n=e,i=this.head,s=0;do{let o=i.data;if(e>o.length)Er(r,o,n-e),e-=o.length;else{e===o.length?(Er(r,o,n-e),++s,i.next?this.head=i.next:this.head=this.tail=null):(Er(r,new Kd(o.buffer,o.byteOffset,e),n-e),this.head=i,i.data=o.slice(e));break}++s}while((i=i.next)!==null);return this.length-=s,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return Yd(this,{...r,depth:0,customInspect:!1})}}});var Gt=A((ob,Do)=>{"use strict";var{MathFloor:Zd,NumberIsInteger:Xd}=B(),{validateInteger:ec}=_t(),{ERR_INVALID_ARG_VALUE:tc}=V().codes,Co=16*1024,Mo=16;function rc(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function $o(t){return t?Mo:Co}function nc(t,e){ec(e,"value",0),t?Mo=e:Co=e}function ic(t,e,r,n){let i=rc(e,n,r);if(i!=null){if(!Xd(i)||i<0){let s=n?`options.${r}`:"options.highWaterMark";throw new tc(s,i)}return Zd(i)}return $o(t.objectMode)}Do.exports={getHighWaterMark:ic,getDefaultHighWaterMark:$o,setDefaultHighWaterMark:nc}});var Wo=A((On,Uo)=>{var Rr=Ee(),ye=Rr.Buffer;function qo(t,e){for(var r in t)e[r]=t[r]}ye.from&&ye.alloc&&ye.allocUnsafe&&ye.allocUnsafeSlow?Uo.exports=Rr:(qo(Rr,On),On.Buffer=Xe);function Xe(t,e,r){return ye(t,e,r)}Xe.prototype=Object.create(ye.prototype);qo(ye,Xe);Xe.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return ye(t,e,r)};Xe.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=ye(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Xe.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ye(t)};Xe.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Rr.SlowBuffer(t)}});var Qo=A(Ho=>{"use strict";var Mn=Wo().Buffer,Go=Mn.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function sc(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function oc(t){var e=sc(t);if(typeof e!="string"&&(Mn.isEncoding===Go||!Go(t)))throw new Error("Unknown encoding: "+t);return e||t}Ho.StringDecoder=Ht;function Ht(t){this.encoding=oc(t);var e;switch(this.encoding){case"utf16le":this.text=cc,this.end=hc,e=4;break;case"utf8":this.fillLast=uc,e=4;break;case"base64":this.text=pc,this.end=_c,e=3;break;default:this.write=bc,this.end=yc;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Mn.allocUnsafe(e)}Ht.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function ac(t,e,r){var n=e.length-1;if(n=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function lc(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function uc(t){var e=this.lastTotal-this.lastNeed,r=lc(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function fc(t,e){var r=ac(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function dc(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function cc(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function hc(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function pc(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function _c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function bc(t){return t.toString(this.encoding)}function yc(t){return t&&t.length?this.write(t):""}});var $n=A((lb,Ko)=>{"use strict";var zo=Pe(),{PromisePrototypeThen:gc,SymbolAsyncIterator:Vo,SymbolIterator:Jo}=B(),{Buffer:wc}=Ee(),{ERR_INVALID_ARG_TYPE:mc,ERR_STREAM_NULL_VALUES:xc}=V().codes;function Sc(t,e,r){let n;if(typeof e=="string"||e instanceof wc)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null)}});let i;if(e&&e[Vo])i=!0,n=e[Vo]();else if(e&&e[Jo])i=!1,n=e[Jo]();else throw new mc("iterable",["Iterable"],e);let s=new t({objectMode:!0,highWaterMark:1,...r}),o=!1;s._read=function(){o||(o=!0,l())},s._destroy=function(u,d){gc(a(u),()=>zo.nextTick(d,u),f=>zo.nextTick(d,f||u))};async function a(u){let d=u!=null,f=typeof n.throw=="function";if(d&&f){let{value:b,done:_}=await n.throw(u);if(await b,_)return}if(typeof n.return=="function"){let{value:b}=await n.return();await b}}async function l(){for(;;){try{let{value:u,done:d}=i?await n.next():n.next();if(d)s.push(null);else{let f=u&&typeof u.then=="function"?await u:u;if(f===null)throw o=!1,new xc;if(s.push(f))continue;o=!1}}catch(u){s.destroy(u)}break}}return s}Ko.exports=Sc});var zt=A((ub,pa)=>{var ie=Pe(),{ArrayPrototypeIndexOf:Ec,NumberIsInteger:Rc,NumberIsNaN:Ic,NumberParseInt:Ac,ObjectDefineProperties:zn,ObjectKeys:Tc,ObjectSetPrototypeOf:Xo,Promise:ea,SafeSet:Nc,SymbolAsyncDispose:kc,SymbolAsyncIterator:Lc,Symbol:vc}=B();pa.exports=E;E.ReadableState=Nr;var{EventEmitter:Bc}=Ut(),{Stream:Ce,prependListener:Fc}=xr(),{Buffer:Dn}=Ee(),{addAbortSignal:jc}=Wt(),ta=Ae(),I=Q().debuglog("stream",t=>{I=t}),Pc=Oo(),mt=Ze(),{getHighWaterMark:Oc,getDefaultHighWaterMark:Cc}=Gt(),{aggregateTwoErrors:Yo,codes:{ERR_INVALID_ARG_TYPE:Mc,ERR_METHOD_NOT_IMPLEMENTED:$c,ERR_OUT_OF_RANGE:Dc,ERR_STREAM_PUSH_AFTER_EOF:qc,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Uc},AbortError:Wc}=V(),{validateObject:Gc}=_t(),et=vc("kPaused"),{StringDecoder:ra}=Qo(),Hc=$n();Xo(E.prototype,Ce.prototype);Xo(E,Ce);var qn=()=>{},{errorOrDestroy:gt}=mt,wt=1,Qc=2,na=4,Qt=8,ia=16,Ir=32,Ar=64,sa=128,zc=256,Vc=512,Jc=1024,Hn=2048,Qn=4096,Kc=8192,Yc=16384,Zc=32768,oa=65536,Xc=1<<17,eh=1<<18;function $(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}zn(Nr.prototype,{objectMode:$(wt),ended:$(Qc),endEmitted:$(na),reading:$(Qt),constructed:$(ia),sync:$(Ir),needReadable:$(Ar),emittedReadable:$(sa),readableListening:$(zc),resumeScheduled:$(Vc),errorEmitted:$(Jc),emitClose:$(Hn),autoDestroy:$(Qn),destroyed:$(Kc),closed:$(Yc),closeEmitted:$(Zc),multiAwaitDrain:$(oa),readingMore:$(Xc),dataEmitted:$(eh)});function Nr(t,e,r){typeof r!="boolean"&&(r=e instanceof ge()),this.state=Hn|Qn|ia|Ir,t&&t.objectMode&&(this.state|=wt),r&&t&&t.readableObjectMode&&(this.state|=wt),this.highWaterMark=t?Oc(this,t,"readableHighWaterMark",r):Cc(!1),this.buffer=new Pc,this.length=0,this.pipes=[],this.flowing=null,this[et]=null,t&&t.emitClose===!1&&(this.state&=~Hn),t&&t.autoDestroy===!1&&(this.state&=~Qn),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new ra(t.encoding),this.encoding=t.encoding)}function E(t){if(!(this instanceof E))return new E(t);let e=this instanceof ge();this._readableState=new Nr(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&jc(t.signal,this)),Ce.call(this,t),mt.construct(this,()=>{this._readableState.needReadable&&Tr(this,this._readableState)})}E.prototype.destroy=mt.destroy;E.prototype._undestroy=mt.undestroy;E.prototype._destroy=function(t,e){e(t)};E.prototype[Bc.captureRejectionSymbol]=function(t){this.destroy(t)};E.prototype[kc]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new Wc,this.destroy(t)),new ea((e,r)=>ta(this,n=>n&&n!==t?r(n):e(null)))};E.prototype.push=function(t,e){return aa(this,t,e,!1)};E.prototype.unshift=function(t,e){return aa(this,t,e,!0)};function aa(t,e,r,n){I("readableAddChunk",e);let i=t._readableState,s;if(i.state&wt||(typeof e=="string"?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?e=Dn.from(e,r).toString(i.encoding):(e=Dn.from(e,r),r=""))):e instanceof Dn?r="":Ce._isUint8Array(e)?(e=Ce._uint8ArrayToBuffer(e),r=""):e!=null&&(s=new Mc("chunk",["string","Buffer","Uint8Array"],e))),s)gt(t,s);else if(e===null)i.state&=~Qt,nh(t,i);else if(i.state&wt||e&&e.length>0)if(n)if(i.state&na)gt(t,new Uc);else{if(i.destroyed||i.errored)return!1;Un(t,i,e,!0)}else if(i.ended)gt(t,new qc);else{if(i.destroyed||i.errored)return!1;i.state&=~Qt,i.decoder&&!r?(e=i.decoder.write(e),i.objectMode||e.length!==0?Un(t,i,e,!1):Tr(t,i)):Un(t,i,e,!1)}else n||(i.state&=~Qt,Tr(t,i));return!i.ended&&(i.length0?(e.state&oa?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.state&Ar&&kr(t)),Tr(t,e)}E.prototype.isPaused=function(){let t=this._readableState;return t[et]===!0||t.flowing===!1};E.prototype.setEncoding=function(t){let e=new ra(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let i of r)n+=e.write(i);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var th=1073741824;function rh(t){if(t>th)throw new Dc("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function Zo(t,e){return t<=0||e.length===0&&e.ended?0:e.state&wt?1:Ic(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}E.prototype.read=function(t){I("read",t),t===void 0?t=NaN:Rc(t)||(t=Ac(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=rh(t)),t!==0&&(e.state&=~sa),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return I("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Wn(this):kr(this),null;if(t=Zo(t,e),t===0&&e.ended)return e.length===0&&Wn(this),null;let n=(e.state&Ar)!==0;if(I("need readable",n),(e.length===0||e.length-t0?i=ca(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Wn(this)),i!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",i)),i};function nh(t,e){if(I("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?kr(t):(e.needReadable=!1,e.emittedReadable=!0,la(t))}}function kr(t){let e=t._readableState;I("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(I("emitReadable",e.flowing),e.emittedReadable=!0,ie.nextTick(la,t))}function la(t){let e=t._readableState;I("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,fa(t)}function Tr(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,ie.nextTick(ih,t,e))}function ih(t,e){for(;!e.reading&&!e.ended&&(e.length1&&n.pipes.includes(t)&&(I("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),r.pause()),l||(l=sh(r,t),t.on("drain",l))}r.on("data",b);function b(w){I("ondata");let R=t.write(w);I("dest.write",R),R===!1&&f()}function _(w){if(I("onerror",w),m(),t.removeListener("error",_),t.listenerCount("error")===0){let R=t._writableState||t._readableState;R&&!R.errorEmitted?gt(t,w):t.emit("error",w)}}Fc(t,"error",_);function y(){t.removeListener("finish",g),m()}t.once("close",y);function g(){I("onfinish"),t.removeListener("close",y),m()}t.once("finish",g);function m(){I("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?f():n.flowing||(I("pipe resume"),r.resume()),t};function sh(t,e){return function(){let n=t._readableState;n.awaitDrainWriters===e?(I("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(I("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}E.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let i=e.pipes;e.pipes=[],this.pause();for(let s=0;s0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,I("on readable",n.length,n.reading),n.length?kr(this):n.reading||ie.nextTick(oh,this)),r};E.prototype.addListener=E.prototype.on;E.prototype.removeListener=function(t,e){let r=Ce.prototype.removeListener.call(this,t,e);return t==="readable"&&ie.nextTick(ua,this),r};E.prototype.off=E.prototype.removeListener;E.prototype.removeAllListeners=function(t){let e=Ce.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&ie.nextTick(ua,this),e};function ua(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[et]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function oh(t){I("readable nexttick read 0"),t.read(0)}E.prototype.resume=function(){let t=this._readableState;return t.flowing||(I("resume"),t.flowing=!t.readableListening,ah(this,t)),t[et]=!1,this};function ah(t,e){e.resumeScheduled||(e.resumeScheduled=!0,ie.nextTick(lh,t,e))}function lh(t,e){I("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),fa(t),e.flowing&&!e.reading&&t.read(0)}E.prototype.pause=function(){return I("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(I("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[et]=!0,this};function fa(t){let e=t._readableState;for(I("flow",e.flowing);e.flowing&&t.read()!==null;);}E.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",n=>{gt(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=Tc(t);for(let n=1;n{i=o?Yo(i,o):null,r(),r=qn});try{for(;;){let o=t.destroyed?null:t.read();if(o!==null)yield o;else{if(i)throw i;if(i===null)return;await new ea(n)}}}catch(o){throw i=Yo(i,o),i}finally{(i||e?.destroyOnReturn!==!1)&&(i===void 0||t._readableState.autoDestroy)?mt.destroyer(t,null):(t.off("readable",n),s())}}zn(E.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});zn(Nr.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[et]!==!1},set(t){this[et]=!!t}}});E._fromList=ca;function ca(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function Wn(t){let e=t._readableState;I("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,ie.nextTick(fh,e,t))}function fh(t,e){if(I("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)ie.nextTick(dh,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function dh(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}E.from=function(t,e){return Hc(E,t,e)};var Gn;function ha(){return Gn===void 0&&(Gn={}),Gn}E.fromWeb=function(t,e){return ha().newStreamReadableFromReadableStream(t,e)};E.toWeb=function(t,e){return ha().newReadableStreamFromStreamReadable(t,e)};E.wrap=function(t,e){var r,n;return new E({objectMode:(r=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(i,s){mt.destroyer(t,i),s(i)}}).wrap(t)}});var jr=A((fb,Aa)=>{var tt=Pe(),{ArrayPrototypeSlice:ya,Error:ch,FunctionPrototypeSymbolHasInstance:ga,ObjectDefineProperty:wa,ObjectDefineProperties:hh,ObjectSetPrototypeOf:ma,StringPrototypeToLowerCase:ph,Symbol:_h,SymbolHasInstance:bh}=B();Aa.exports=F;F.WritableState=Kt;var{EventEmitter:yh}=Ut(),Vt=xr().Stream,{Buffer:Lr}=Ee(),Fr=Ze(),{addAbortSignal:gh}=Wt(),{getHighWaterMark:wh,getDefaultHighWaterMark:mh}=Gt(),{ERR_INVALID_ARG_TYPE:xh,ERR_METHOD_NOT_IMPLEMENTED:Sh,ERR_MULTIPLE_CALLBACK:xa,ERR_STREAM_CANNOT_PIPE:Eh,ERR_STREAM_DESTROYED:Jt,ERR_STREAM_ALREADY_FINISHED:Rh,ERR_STREAM_NULL_VALUES:Ih,ERR_STREAM_WRITE_AFTER_END:Ah,ERR_UNKNOWN_ENCODING:Sa}=V().codes,{errorOrDestroy:xt}=Fr;ma(F.prototype,Vt.prototype);ma(F,Vt);function Kn(){}var St=_h("kOnFinished");function Kt(t,e,r){typeof r!="boolean"&&(r=e instanceof ge()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?wh(this,t,"writableHighWaterMark",r):mh(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Nh.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Br(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[St]=[]}function Br(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}Kt.prototype.getBuffer=function(){return ya(this.buffered,this.bufferedIndex)};wa(Kt.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function F(t){let e=this instanceof ge();if(!e&&!ga(F,this))return new F(t);this._writableState=new Kt(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&gh(t.signal,this)),Vt.call(this,t),Fr.construct(this,()=>{let r=this._writableState;r.writing||Zn(this,r),Xn(this,r)})}wa(F,bh,{__proto__:null,value:function(t){return ga(this,t)?!0:this!==F?!1:t&&t._writableState instanceof Kt}});F.prototype.pipe=function(){xt(this,new Eh)};function Ea(t,e,r,n){let i=t._writableState;if(typeof r=="function")n=r,r=i.defaultEncoding;else{if(!r)r=i.defaultEncoding;else if(r!=="buffer"&&!Lr.isEncoding(r))throw new Sa(r);typeof n!="function"&&(n=Kn)}if(e===null)throw new Ih;if(!i.objectMode)if(typeof e=="string")i.decodeStrings!==!1&&(e=Lr.from(e,r),r="buffer");else if(e instanceof Lr)r="buffer";else if(Vt._isUint8Array(e))e=Vt._uint8ArrayToBuffer(e),r="buffer";else throw new xh("chunk",["string","Buffer","Uint8Array"],e);let s;return i.ending?s=new Ah:i.destroyed&&(s=new Jt("write")),s?(tt.nextTick(n,s),xt(t,s,!0),s):(i.pendingcb++,Th(t,i,e,r,n))}F.prototype.write=function(t,e,r){return Ea(this,t,e,r)===!0};F.prototype.cork=function(){this._writableState.corked++};F.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Zn(this,t))};F.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=ph(e)),!Lr.isEncoding(e))throw new Sa(e);return this._writableState.defaultEncoding=e,this};function Th(t,e,r,n,i){let s=e.objectMode?1:r.length;e.length+=s;let o=e.lengthr.bufferedIndex&&Zn(t,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:t,state:r},tt.nextTick(kh,r.afterWriteTickInfo)):Ra(t,r,1,i))}function kh({stream:t,state:e,count:r,cb:n}){return e.afterWriteTickInfo=null,Ra(t,e,r,n)}function Ra(t,e,r,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,n();e.destroyed&&Yn(e),Xn(t,e)}function Yn(t){if(t.writing)return;for(let i=t.bufferedIndex;i1&&t._writev){e.pendingcb-=s-1;let a=e.allNoop?Kn:u=>{for(let d=o;d256?(r.splice(0,o),e.bufferedIndex=0):e.bufferedIndex=o}e.bufferProcessing=!1}F.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new Sh("_write()")};F.prototype._writev=null;F.prototype.end=function(t,e,r){let n=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let i;if(t!=null){let s=Ea(this,t,e);s instanceof ch&&(i=s)}return n.corked&&(n.corked=1,this.uncork()),i||(!n.errored&&!n.ending?(n.ending=!0,Xn(this,n,!0),n.ended=!0):n.finished?i=new Rh("end"):n.destroyed&&(i=new Jt("end"))),typeof r=="function"&&(i||n.finished?tt.nextTick(r,i):n[St].push(r)),this};function vr(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function Lh(t,e){let r=!1;function n(i){if(r){xt(t,i??xa());return}if(r=!0,e.pendingcb--,i){let s=e[St].splice(0);for(let o=0;o{vr(i)?Jn(n,i):i.pendingcb--},t,e)):vr(e)&&(e.pendingcb++,Jn(t,e))))}function Jn(t,e){e.pendingcb--,e.finished=!0;let r=e[St].splice(0);for(let n=0;n{var ei=Pe(),Fh=Ee(),{isReadable:jh,isWritable:Ph,isIterable:Ta,isNodeStream:Oh,isReadableNodeStream:Na,isWritableNodeStream:ka,isDuplexNodeStream:Ch,isReadableStream:La,isWritableStream:va}=_e(),Ba=Ae(),{AbortError:Ma,codes:{ERR_INVALID_ARG_TYPE:Mh,ERR_INVALID_RETURN_VALUE:Fa}}=V(),{destroyer:Rt}=Ze(),$h=ge(),$a=zt(),Dh=jr(),{createDeferredPromise:ja}=Q(),Pa=$n(),Oa=globalThis.Blob||Fh.Blob,qh=typeof Oa<"u"?function(e){return e instanceof Oa}:function(e){return!1},Uh=globalThis.AbortController||ct().AbortController,{FunctionPrototypeCall:Ca}=B(),Me=class extends $h{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};Da.exports=function t(e,r){if(Ch(e))return e;if(Na(e))return Et({readable:e});if(ka(e))return Et({writable:e});if(Oh(e))return Et({writable:!1,readable:!1});if(La(e))return Et({readable:$a.fromWeb(e)});if(va(e))return Et({writable:Dh.fromWeb(e)});if(typeof e=="function"){let{value:i,write:s,final:o,destroy:a}=Wh(e);if(Ta(i))return Pa(Me,i,{objectMode:!0,write:s,final:o,destroy:a});let l=i?.then;if(typeof l=="function"){let u,d=Ca(l,i,f=>{if(f!=null)throw new Fa("nully","body",f)},f=>{Rt(u,f)});return u=new Me({objectMode:!0,readable:!1,write:s,final(f){o(async()=>{try{await d,ei.nextTick(f,null)}catch(b){ei.nextTick(f,b)}})},destroy:a})}throw new Fa("Iterable, AsyncIterable or AsyncFunction",r,i)}if(qh(e))return t(e.arrayBuffer());if(Ta(e))return Pa(Me,e,{objectMode:!0,writable:!1});if(La(e?.readable)&&va(e?.writable))return Me.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let i=e!=null&&e.readable?Na(e?.readable)?e?.readable:t(e.readable):void 0,s=e!=null&&e.writable?ka(e?.writable)?e?.writable:t(e.writable):void 0;return Et({readable:i,writable:s})}let n=e?.then;if(typeof n=="function"){let i;return Ca(n,e,s=>{s!=null&&i.push(s),i.push(null)},s=>{Rt(i,s)}),i=new Me({objectMode:!0,writable:!1,read(){}})}throw new Mh(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function Wh(t){let{promise:e,resolve:r}=ja(),n=new Uh,i=n.signal;return{value:t(async function*(){for(;;){let o=e;e=null;let{chunk:a,done:l,cb:u}=await o;if(ei.nextTick(u),l)return;if(i.aborted)throw new Ma(void 0,{cause:i.reason});({promise:e,resolve:r}=ja()),yield a}}(),{signal:i}),write(o,a,l){let u=r;r=null,u({chunk:o,done:!1,cb:l})},final(o){let a=r;r=null,a({done:!0,cb:o})},destroy(o,a){n.abort(),a(o)}}}function Et(t){let e=t.readable&&typeof t.readable.read!="function"?$a.wrap(t.readable):t.readable,r=t.writable,n=!!jh(e),i=!!Ph(r),s,o,a,l,u;function d(f){let b=l;l=null,b?b(f):f&&u.destroy(f)}return u=new Me({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:i}),i&&(Ba(r,f=>{i=!1,f&&Rt(e,f),d(f)}),u._write=function(f,b,_){r.write(f,b)?_():s=_},u._final=function(f){r.end(),o=f},r.on("drain",function(){if(s){let f=s;s=null,f()}}),r.on("finish",function(){if(o){let f=o;o=null,f()}})),n&&(Ba(e,f=>{n=!1,f&&Rt(e,f),d(f)}),e.on("readable",function(){if(a){let f=a;a=null,f()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let f=e.read();if(f===null){a=u._read;return}if(!u.push(f))return}}),u._destroy=function(f,b){!f&&l!==null&&(f=new Ma),a=null,s=null,o=null,l===null?b(f):(l=b,Rt(r,f),Rt(e,f))},u}});var ge=A((cb,Ga)=>{"use strict";var{ObjectDefineProperties:Gh,ObjectGetOwnPropertyDescriptor:Te,ObjectKeys:Hh,ObjectSetPrototypeOf:Ua}=B();Ga.exports=se;var ni=zt(),re=jr();Ua(se.prototype,ni.prototype);Ua(se,ni);{let t=Hh(re.prototype);for(let e=0;e{"use strict";var{ObjectSetPrototypeOf:Ha,Symbol:Qh}=B();Qa.exports=Ne;var{ERR_METHOD_NOT_IMPLEMENTED:zh}=V().codes,si=ge(),{getHighWaterMark:Vh}=Gt();Ha(Ne.prototype,si.prototype);Ha(Ne,si);var Yt=Qh("kCallback");function Ne(t){if(!(this instanceof Ne))return new Ne(t);let e=t?Vh(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),si.call(this,t),this._readableState.sync=!1,this[Yt]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Jh)}function ii(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t()}):(this.push(null),t&&t())}function Jh(){this._final!==ii&&ii.call(this)}Ne.prototype._final=ii;Ne.prototype._transform=function(t,e,r){throw new zh("_transform()")};Ne.prototype._write=function(t,e,r){let n=this._readableState,i=this._writableState,s=n.length;this._transform(t,e,(o,a)=>{if(o){r(o);return}a!=null&&this.push(a),i.ended||s===n.length||n.length{"use strict";var{ObjectSetPrototypeOf:za}=B();Va.exports=It;var ai=oi();za(It.prototype,ai.prototype);za(It,ai);function It(t){if(!(this instanceof It))return new It(t);ai.call(this,t)}It.prototype._transform=function(t,e,r){r(null,t)}});var Mr=A((_b,Xa)=>{var Zt=Pe(),{ArrayIsArray:Kh,Promise:Yh,SymbolAsyncIterator:Zh,SymbolDispose:Xh}=B(),Cr=Ae(),{once:ep}=Q(),tp=Ze(),Ja=ge(),{aggregateTwoErrors:rp,codes:{ERR_INVALID_ARG_TYPE:yi,ERR_INVALID_RETURN_VALUE:ui,ERR_MISSING_ARGS:np,ERR_STREAM_DESTROYED:ip,ERR_STREAM_PREMATURE_CLOSE:sp},AbortError:op}=V(),{validateFunction:ap,validateAbortSignal:lp}=_t(),{isIterable:rt,isReadable:fi,isReadableNodeStream:Or,isNodeStream:Ka,isTransformStream:At,isWebStream:up,isReadableStream:di,isReadableFinished:fp}=_e(),dp=globalThis.AbortController||ct().AbortController,ci,hi,pi;function Ya(t,e,r){let n=!1;t.on("close",()=>{n=!0});let i=Cr(t,{readable:e,writable:r},s=>{n=!s});return{destroy:s=>{n||(n=!0,tp.destroyer(t,s||new ip("pipe")))},cleanup:i}}function cp(t){return ap(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function _i(t){if(rt(t))return t;if(Or(t))return hp(t);throw new yi("val",["Readable","Iterable","AsyncIterable"],t)}async function*hp(t){hi||(hi=zt()),yield*hi.prototype[Zh].call(t)}async function Pr(t,e,r,{end:n}){let i,s=null,o=u=>{if(u&&(i=u),s){let d=s;s=null,d()}},a=()=>new Yh((u,d)=>{i?d(i):s=()=>{i?d(i):u()}});e.on("drain",o);let l=Cr(e,{readable:!1},o);try{e.writableNeedDrain&&await a();for await(let u of t)e.write(u)||await a();n&&(e.end(),await a()),r()}catch(u){r(i!==u?rp(i,u):u)}finally{l(),e.off("drain",o)}}async function bi(t,e,r,{end:n}){At(e)&&(e=e.writable);let i=e.getWriter();try{for await(let s of t)await i.ready,i.write(s).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(s){try{await i.abort(s),r(s)}catch(o){r(o)}}}function pp(...t){return Za(t,ep(cp(t)))}function Za(t,e,r){if(t.length===1&&Kh(t[0])&&(t=t[0]),t.length<2)throw new np("streams");let n=new dp,i=n.signal,s=r?.signal,o=[];lp(s,"options.signal");function a(){y(new op)}pi=pi||Q().addAbortListener;let l;s&&(l=pi(s,a));let u,d,f=[],b=0;function _(N){y(N,--b===0)}function y(N,S){var j;if(N&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=N),!(!u&&!S)){for(;f.length;)f.shift()(u);(j=l)===null||j===void 0||j[Xh](),n.abort(),S&&(u||o.forEach(me=>me()),Zt.nextTick(e,u,d))}}let g;for(let N=0;N0,J=j||r?.end!==!1,Le=N===t.length-1;if(Ka(S)){let W=function(ne){ne&&ne.name!=="AbortError"&&ne.code!=="ERR_STREAM_PREMATURE_CLOSE"&&_(ne)};var R=W;if(J){let{destroy:ne,cleanup:Nt}=Ya(S,j,me);f.push(ne),fi(S)&&Le&&o.push(Nt)}S.on("error",W),fi(S)&&Le&&o.push(()=>{S.removeListener("error",W)})}if(N===0)if(typeof S=="function"){if(g=S({signal:i}),!rt(g))throw new ui("Iterable, AsyncIterable or Stream","source",g)}else rt(S)||Or(S)||At(S)?g=S:g=Ja.from(S);else if(typeof S=="function"){if(At(g)){var m;g=_i((m=g)===null||m===void 0?void 0:m.readable)}else g=_i(g);if(g=S(g,{signal:i}),j){if(!rt(g,!0))throw new ui("AsyncIterable",`transform[${N-1}]`,g)}else{var w;ci||(ci=li());let W=new ci({objectMode:!0}),ne=(w=g)===null||w===void 0?void 0:w.then;if(typeof ne=="function")b++,ne.call(g,oe=>{d=oe,oe!=null&&W.write(oe),J&&W.end(),Zt.nextTick(_)},oe=>{W.destroy(oe),Zt.nextTick(_,oe)});else if(rt(g,!0))b++,Pr(g,W,_,{end:J});else if(di(g)||At(g)){let oe=g.readable||g;b++,Pr(oe,W,_,{end:J})}else throw new ui("AsyncIterable or Promise","destination",g);g=W;let{destroy:Nt,cleanup:kt}=Ya(g,!1,!0);f.push(Nt),Le&&o.push(kt)}}else if(Ka(S)){if(Or(g)){b+=2;let W=_p(g,S,_,{end:J});fi(S)&&Le&&o.push(W)}else if(At(g)||di(g)){let W=g.readable||g;b++,Pr(W,S,_,{end:J})}else if(rt(g))b++,Pr(g,S,_,{end:J});else throw new yi("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=S}else if(up(S)){if(Or(g))b++,bi(_i(g),S,_,{end:J});else if(di(g)||rt(g))b++,bi(g,S,_,{end:J});else if(At(g))b++,bi(g.readable,S,_,{end:J});else throw new yi("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=S}else g=Ja.from(S)}return(i!=null&&i.aborted||s!=null&&s.aborted)&&Zt.nextTick(a),g}function _p(t,e,r,{end:n}){let i=!1;if(e.on("close",()=>{i||r(new sp)}),t.pipe(e,{end:!1}),n){let o=function(){i=!0,e.end()};var s=o;fp(t)?Zt.nextTick(o):t.once("end",o)}else r();return Cr(t,{readable:!0,writable:!1},o=>{let a=t._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?t.once("end",r).once("error",r):r(o)}),Cr(e,{readable:!1,writable:!0},r)}Xa.exports={pipelineImpl:Za,pipeline:pp}});var wi=A((bb,sl)=>{"use strict";var{pipeline:bp}=Mr(),$r=ge(),{destroyer:yp}=Ze(),{isNodeStream:Dr,isReadable:el,isWritable:tl,isWebStream:gi,isTransformStream:nt,isWritableStream:rl,isReadableStream:nl}=_e(),{AbortError:gp,codes:{ERR_INVALID_ARG_VALUE:il,ERR_MISSING_ARGS:wp}}=V(),mp=Ae();sl.exports=function(...e){if(e.length===0)throw new wp("streams");if(e.length===1)return $r.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=$r.from(e[0])),typeof e[e.length-1]=="function"){let _=e.length-1;e[_]=$r.from(e[_])}for(let _=0;_0&&!(tl(e[_])||rl(e[_])||nt(e[_])))throw new il(`streams[${_}]`,r[_],"must be writable")}let n,i,s,o,a;function l(_){let y=o;o=null,y?y(_):_?a.destroy(_):!b&&!f&&a.destroy()}let u=e[0],d=bp(e,l),f=!!(tl(u)||rl(u)||nt(u)),b=!!(el(d)||nl(d)||nt(d));if(a=new $r({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:f,readable:b}),f){if(Dr(u))a._write=function(y,g,m){u.write(y,g)?m():n=m},a._final=function(y){u.end(),i=y},u.on("drain",function(){if(n){let y=n;n=null,y()}});else if(gi(u)){let g=(nt(u)?u.writable:u).getWriter();a._write=async function(m,w,R){try{await g.ready,g.write(m).catch(()=>{}),R()}catch(N){R(N)}},a._final=async function(m){try{await g.ready,g.close().catch(()=>{}),i=m}catch(w){m(w)}}}let _=nt(d)?d.readable:d;mp(_,()=>{if(i){let y=i;i=null,y()}})}if(b){if(Dr(d))d.on("readable",function(){if(s){let _=s;s=null,_()}}),d.on("end",function(){a.push(null)}),a._read=function(){for(;;){let _=d.read();if(_===null){s=a._read;return}if(!a.push(_))return}};else if(gi(d)){let y=(nt(d)?d.readable:d).getReader();a._read=async function(){for(;;)try{let{value:g,done:m}=await y.read();if(!a.push(g))return;if(m){a.push(null);return}}catch{return}}}}return a._destroy=function(_,y){!_&&o!==null&&(_=new gp),s=null,n=null,i=null,o===null?y(_):(o=y,Dr(d)&&yp(d,_))},a}});var _l=A((yb,Si)=>{"use strict";var xp=globalThis.AbortController||ct().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Sp,ERR_INVALID_ARG_TYPE:Xt,ERR_MISSING_ARGS:Ep,ERR_OUT_OF_RANGE:Rp},AbortError:we}=V(),{validateAbortSignal:it,validateInteger:ol,validateObject:st}=_t(),Ip=B().Symbol("kWeak"),Ap=B().Symbol("kResistStopPropagation"),{finished:Tp}=Ae(),Np=wi(),{addAbortSignalNoValidate:kp}=Wt(),{isWritable:Lp,isNodeStream:vp}=_e(),{deprecate:Bp}=Q(),{ArrayPrototypePush:Fp,Boolean:jp,MathFloor:al,Number:Pp,NumberIsNaN:Op,Promise:ll,PromiseReject:ul,PromiseResolve:Cp,PromisePrototypeThen:fl,Symbol:cl}=B(),qr=cl("kEmpty"),dl=cl("kEof");function Mp(t,e){if(e!=null&&st(e,"options"),e?.signal!=null&&it(e.signal,"options.signal"),vp(t)&&!Lp(t))throw new Sp("stream",t,"must be writable");let r=Np(this,t);return e!=null&&e.signal&&kp(e.signal,r),r}function Ur(t,e){if(typeof t!="function")throw new Xt("fn",["Function","AsyncFunction"],t);e!=null&&st(e,"options"),e?.signal!=null&&it(e.signal,"options.signal");let r=1;e?.concurrency!=null&&(r=al(e.concurrency));let n=r-1;return e?.highWaterMark!=null&&(n=al(e.highWaterMark)),ol(r,"options.concurrency",1),ol(n,"options.highWaterMark",0),n+=r,async function*(){let s=Q().AbortSignalAny([e?.signal].filter(jp)),o=this,a=[],l={signal:s},u,d,f=!1,b=0;function _(){f=!0,y()}function y(){b-=1,g()}function g(){d&&!f&&b=n||b>=r)&&await new ll(R=>{d=R})}a.push(dl)}catch(w){let R=ul(w);fl(R,y,_),a.push(R)}finally{f=!0,u&&(u(),u=null)}}m();try{for(;;){for(;a.length>0;){let w=await a[0];if(w===dl)return;if(s.aborted)throw new we;w!==qr&&(yield w),a.shift(),g()}await new ll(w=>{u=w})}}finally{f=!0,d&&(d(),d=null)}}.call(this)}function $p(t=void 0){return t!=null&&st(t,"options"),t?.signal!=null&&it(t.signal,"options.signal"),async function*(){let r=0;for await(let i of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new we({cause:t.signal.reason});yield[r++,i]}}.call(this)}async function hl(t,e=void 0){for await(let r of xi.call(this,t,e))return!0;return!1}async function Dp(t,e=void 0){if(typeof t!="function")throw new Xt("fn",["Function","AsyncFunction"],t);return!await hl.call(this,async(...r)=>!await t(...r),e)}async function qp(t,e){for await(let r of xi.call(this,t,e))return r}async function Up(t,e){if(typeof t!="function")throw new Xt("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i),qr}for await(let n of Ur.call(this,r,e));}function xi(t,e){if(typeof t!="function")throw new Xt("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i)?n:qr}return Ur.call(this,r,e)}var mi=class extends Ep{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function Wp(t,e,r){var n;if(typeof t!="function")throw new Xt("reducer",["Function","AsyncFunction"],t);r!=null&&st(r,"options"),r?.signal!=null&&it(r.signal,"options.signal");let i=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let u=new we(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await Tp(this.destroy(u)),u}let s=new xp,o=s.signal;if(r!=null&&r.signal){let u={once:!0,[Ip]:this,[Ap]:!0};r.signal.addEventListener("abort",()=>s.abort(),u)}let a=!1;try{for await(let u of this){var l;if(a=!0,r!=null&&(l=r.signal)!==null&&l!==void 0&&l.aborted)throw new we;i?e=await t(e,u,{signal:o}):(e=u,i=!0)}if(!a&&!i)throw new mi}finally{s.abort()}return e}async function Gp(t){t!=null&&st(t,"options"),t?.signal!=null&&it(t.signal,"options.signal");let e=[];for await(let n of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new we(void 0,{cause:t.signal.reason});Fp(e,n)}return e}function Hp(t,e){let r=Ur.call(this,t,e);return async function*(){for await(let i of r)yield*i}.call(this)}function pl(t){if(t=Pp(t),Op(t))return 0;if(t<0)throw new Rp("number",">= 0",t);return t}function Qp(t,e=void 0){return e!=null&&st(e,"options"),e?.signal!=null&&it(e.signal,"options.signal"),t=pl(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new we;for await(let s of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new we;t--<=0&&(yield s)}}.call(this)}function zp(t,e=void 0){return e!=null&&st(e,"options"),e?.signal!=null&&it(e.signal,"options.signal"),t=pl(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new we;for await(let s of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new we;if(t-- >0&&(yield s),t<=0)return}}.call(this)}Si.exports.streamReturningOperators={asIndexedPairs:Bp($p,"readable.asIndexedPairs will be removed in a future version."),drop:Qp,filter:xi,flatMap:Hp,map:Ur,take:zp,compose:Mp};Si.exports.promiseReturningOperators={every:Dp,forEach:Up,reduce:Wp,toArray:Gp,some:hl,find:qp}});var Ei=A((gb,bl)=>{"use strict";var{ArrayPrototypePop:Vp,Promise:Jp}=B(),{isIterable:Kp,isNodeStream:Yp,isWebStream:Zp}=_e(),{pipelineImpl:Xp}=Mr(),{finished:e_}=Ae();Ri();function t_(...t){return new Jp((e,r)=>{let n,i,s=t[t.length-1];if(s&&typeof s=="object"&&!Yp(s)&&!Kp(s)&&!Zp(s)){let o=Vp(t);n=o.signal,i=o.end}Xp(t,(o,a)=>{o?r(o):e(a)},{signal:n,end:i})})}bl.exports={finished:e_,pipeline:t_}});var Ri=A((wb,Il)=>{var{Buffer:r_}=Ee(),{ObjectDefineProperty:ke,ObjectKeys:wl,ReflectApply:ml}=B(),{promisify:{custom:xl}}=Q(),{streamReturningOperators:yl,promiseReturningOperators:gl}=_l(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Sl}}=V(),n_=wi(),{setDefaultHighWaterMark:i_,getDefaultHighWaterMark:s_}=Gt(),{pipeline:El}=Mr(),{destroyer:o_}=Ze(),Rl=Ae(),Ii=Ei(),er=_e(),L=Il.exports=xr().Stream;L.isDestroyed=er.isDestroyed;L.isDisturbed=er.isDisturbed;L.isErrored=er.isErrored;L.isReadable=er.isReadable;L.isWritable=er.isWritable;L.Readable=zt();for(let t of wl(yl)){let r=function(...n){if(new.target)throw Sl();return L.Readable.from(ml(e,this,n))};Ai=r;let e=yl[t];ke(r,"name",{__proto__:null,value:e.name}),ke(r,"length",{__proto__:null,value:e.length}),ke(L.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var Ai;for(let t of wl(gl)){let r=function(...i){if(new.target)throw Sl();return ml(e,this,i)};Ai=r;let e=gl[t];ke(r,"name",{__proto__:null,value:e.name}),ke(r,"length",{__proto__:null,value:e.length}),ke(L.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var Ai;L.Writable=jr();L.Duplex=ge();L.Transform=oi();L.PassThrough=li();L.pipeline=El;var{addAbortSignal:a_}=Wt();L.addAbortSignal=a_;L.finished=Rl;L.destroy=o_;L.compose=n_;L.setDefaultHighWaterMark=i_;L.getDefaultHighWaterMark=s_;ke(L,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Ii}});ke(El,xl,{__proto__:null,enumerable:!0,get(){return Ii.pipeline}});ke(Rl,xl,{__proto__:null,enumerable:!0,get(){return Ii.finished}});L.Stream=L;L._isUint8Array=function(e){return e instanceof Uint8Array};L._uint8ArrayToBuffer=function(e){return r_.from(e.buffer,e.byteOffset,e.byteLength)}});var Wr=A((mb,C)=>{"use strict";var D=Ri(),l_=Ei(),u_=D.Readable.destroy;C.exports=D.Readable;C.exports._uint8ArrayToBuffer=D._uint8ArrayToBuffer;C.exports._isUint8Array=D._isUint8Array;C.exports.isDisturbed=D.isDisturbed;C.exports.isErrored=D.isErrored;C.exports.isReadable=D.isReadable;C.exports.Readable=D.Readable;C.exports.Writable=D.Writable;C.exports.Duplex=D.Duplex;C.exports.Transform=D.Transform;C.exports.PassThrough=D.PassThrough;C.exports.addAbortSignal=D.addAbortSignal;C.exports.finished=D.finished;C.exports.destroy=D.destroy;C.exports.destroy=u_;C.exports.pipeline=D.pipeline;C.exports.compose=D.compose;Object.defineProperty(D,"promises",{configurable:!0,enumerable:!0,get(){return l_}});C.exports.Stream=D.Stream;C.exports.default=C.exports});var Vr=JSON.stringify,Bi=(t,e=null,r="")=>{let n=new WeakMap,i="",s="";if(typeof r=="number"?i+=" ".repeat(r):typeof r=="string"&&(i=r),e&&typeof e!="function"&&(typeof e!="object"||typeof e.length!="number"))throw new Error("JSONTag.stringify");let o=u=>{let d=s;s+=i;let f="",b="",_=Object.keys(u);Array.isArray(e)&&(_=_.filter(g=>e.indexOf(g)!==-1)),s&&(f=` +var Bl=Object.create;var zr=Object.defineProperty;var Fl=Object.getOwnPropertyDescriptor;var jl=Object.getOwnPropertyNames;var Pl=Object.getPrototypeOf,Ol=Object.prototype.hasOwnProperty;var A=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Cl=(t,e)=>{for(var r in e)zr(t,r,{get:e[r],enumerable:!0})},Ml=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of jl(e))!Ol.call(t,i)&&i!==r&&zr(t,i,{get:()=>e[i],enumerable:!(n=Fl(e,i))||n.enumerable});return t};var nr=(t,e,r)=>(r=t!=null?Bl(Pl(t)):{},Ml(e||!t||!t.__esModule?zr(r,"default",{value:t,enumerable:!0}):r,t));var Di=A((A_,$i)=>{var Mi;$i.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(Mi||(Mi=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var Xi=A(or=>{"use strict";or.byteLength=lu;or.toByteArray=fu;or.fromByteArray=hu;var fe=[],ee=[],au=typeof Uint8Array<"u"?Uint8Array:Array,rn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Qe=0,Yi=rn.length;Qe0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function lu(t){var e=Zi(t),r=e[0],n=e[1];return(r+n)*3/4-n}function uu(t,e,r){return(e+r)*3/4-r}function fu(t){var e,r=Zi(t),n=r[0],i=r[1],s=new au(uu(t,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=ee[t.charCodeAt(l)]<<2|ee[t.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=ee[t.charCodeAt(l)]<<10|ee[t.charCodeAt(l+1)]<<4|ee[t.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function du(t){return fe[t>>18&63]+fe[t>>12&63]+fe[t>>6&63]+fe[t&63]}function cu(t,e,r){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=t[r-1],i.push(fe[e>>2]+fe[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(fe[e>>10]+fe[e>>4&63]+fe[e<<2&63]+"=")),i.join("")}});var es=A(nn=>{nn.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,l=(1<>1,d=-7,f=r?i-1:0,b=r?-1:1,_=t[e+f];for(f+=b,s=_&(1<<-d)-1,_>>=-d,d+=a;d>0;s=s*256+t[e+f],f+=b,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=n;d>0;o=o*256+t[e+f],f+=b,d-=8);if(s===0)s=1-u;else{if(s===l)return o?NaN:(_?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-u}return(_?-1:1)*o*Math.pow(2,s-n)};nn.write=function(t,e,r,n,i,s){var o,a,l,u=s*8-i-1,d=(1<>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:s-1,y=n?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+f>=1?e+=b/l:e+=b*Math.pow(2,1-f),e*l>=2&&(o++,l/=2),o+f>=d?(a=0,o=d):o+f>=1?(a=(e*l-1)*Math.pow(2,i),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+_]=a&255,_+=y,a/=256,i-=8);for(o=o<0;t[r+_]=o&255,_+=y,o/=256,u-=8);t[r+_-y]|=g*128}});var Se=A(dt=>{"use strict";var sn=Xi(),ut=es(),ts=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;dt.Buffer=h;dt.SlowBuffer=wu;dt.INSPECT_MAX_BYTES=50;var ar=2147483647;dt.kMaxLength=ar;h.TYPED_ARRAY_SUPPORT=pu();!h.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 pu(){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(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}});Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}});function xe(t){if(t>ar)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,h.prototype),e}function h(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return un(t)}return ss(t,e,r)}h.poolSize=8192;function ss(t,e,r){if(typeof t=="string")return bu(t,e);if(ArrayBuffer.isView(t))return yu(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(de(t,ArrayBuffer)||t&&de(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(de(t,SharedArrayBuffer)||t&&de(t.buffer,SharedArrayBuffer)))return an(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return h.from(n,e,r);let i=gu(t);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return h.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}h.from=function(t,e,r){return ss(t,e,r)};Object.setPrototypeOf(h.prototype,Uint8Array.prototype);Object.setPrototypeOf(h,Uint8Array);function os(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 _u(t,e,r){return os(t),t<=0?xe(t):e!==void 0?typeof r=="string"?xe(t).fill(e,r):xe(t).fill(e):xe(t)}h.alloc=function(t,e,r){return _u(t,e,r)};function un(t){return os(t),xe(t<0?0:fn(t)|0)}h.allocUnsafe=function(t){return un(t)};h.allocUnsafeSlow=function(t){return un(t)};function bu(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!h.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=as(t,e)|0,n=xe(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function on(t){let e=t.length<0?0:fn(t.length)|0,r=xe(e);for(let n=0;n=ar)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ar.toString(16)+" bytes");return t|0}function wu(t){return+t!=t&&(t=0),h.alloc(+t)}h.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==h.prototype};h.compare=function(e,r){if(de(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),de(r,Uint8Array)&&(r=h.from(r,r.offset,r.byteLength)),!h.isBuffer(e)||!h.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,i=r.length;for(let s=0,o=Math.min(n,i);si.length?(h.isBuffer(o)||(o=h.from(o)),o.copy(i,s)):Uint8Array.prototype.set.call(i,o,s);else if(h.isBuffer(o))o.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=o.length}return i};function as(t,e){if(h.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||de(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 r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return ln(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return bs(t).length;default:if(i)return n?-1:ln(t).length;e=(""+e).toLowerCase(),i=!0}}h.byteLength=as;function mu(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Lu(this,e,r);case"utf8":case"utf-8":return us(this,e,r);case"ascii":return Nu(this,e,r);case"latin1":case"binary":return ku(this,e,r);case"base64":return Au(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vu(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}h.prototype._isBuffer=!0;function ze(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}h.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;rr&&(e+=" ... "),""};ts&&(h.prototype[ts]=h.prototype.inspect);h.prototype.compare=function(e,r,n,i,s){if(de(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),r<0||n>e.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&r>=n)return 0;if(i>=s)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,s>>>=0,this===e)return 0;let o=s-i,a=n-r,l=Math.min(o,a),u=this.slice(i,s),d=e.slice(r,n);for(let f=0;f2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,cn(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=h.from(e,n)),h.isBuffer(e))return e.length===0?-1:rs(t,e,r,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):rs(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function rs(t,e,r,n,i){let s=1,o=t.length,a=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,o/=2,a/=2,r/=2}function l(d,f){return s===1?d[f]:d.readUInt16BE(f*s)}let u;if(i){let d=-1;for(u=r;uo&&(r=o-a),u=r;u>=0;u--){let d=!0;for(let f=0;fi&&(n=i)):n=i;let s=e.length;n>s/2&&(n=s/2);let o;for(o=0;o>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let s=this.length-r;if((n===void 0||n>s)&&(n=s),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return xu(this,e,r,n);case"utf8":case"utf-8":return Su(this,e,r,n);case"ascii":case"latin1":case"binary":return Eu(this,e,r,n);case"base64":return Ru(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Iu(this,e,r,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Au(t,e,r){return e===0&&r===t.length?sn.fromByteArray(t):sn.fromByteArray(t.slice(e,r))}function us(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i239?4:s>223?3:s>191?2:1;if(i+a<=r){let l,u,d,f;switch(a){case 1:s<128&&(o=s);break;case 2:l=t[i+1],(l&192)===128&&(f=(s&31)<<6|l&63,f>127&&(o=f));break;case 3:l=t[i+1],u=t[i+2],(l&192)===128&&(u&192)===128&&(f=(s&15)<<12|(l&63)<<6|u&63,f>2047&&(f<55296||f>57343)&&(o=f));break;case 4:l=t[i+1],u=t[i+2],d=t[i+3],(l&192)===128&&(u&192)===128&&(d&192)===128&&(f=(s&15)<<18|(l&63)<<12|(u&63)<<6|d&63,f>65535&&f<1114112&&(o=f))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=a}return Tu(n)}var ns=4096;function Tu(t){let e=t.length;if(e<=ns)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn)&&(r=n);let i="";for(let s=e;sn&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),rr)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUintLE=h.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||q(e,r,this.length);let i=this[e],s=1,o=0;for(;++o>>0,r=r>>>0,n||q(e,r,this.length);let i=this[e+--r],s=1;for(;r>0&&(s*=256);)i+=this[e+--r]*s;return i};h.prototype.readUint8=h.prototype.readUInt8=function(e,r){return e=e>>>0,r||q(e,1,this.length),this[e]};h.prototype.readUint16LE=h.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||q(e,2,this.length),this[e]|this[e+1]<<8};h.prototype.readUint16BE=h.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||q(e,2,this.length),this[e]<<8|this[e+1]};h.prototype.readUint32LE=h.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||q(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};h.prototype.readUint32BE=h.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||q(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};h.prototype.readBigUInt64LE=Fe(function(e){e=e>>>0,ft(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&qt(e,this.length-8);let i=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<>>0,ft(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&qt(e,this.length-8);let i=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<>>0,r=r>>>0,n||q(e,r,this.length);let i=this[e],s=1,o=0;for(;++o=s&&(i-=Math.pow(2,8*r)),i};h.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||q(e,r,this.length);let i=r,s=1,o=this[e+--i];for(;i>0&&(s*=256);)o+=this[e+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*r)),o};h.prototype.readInt8=function(e,r){return e=e>>>0,r||q(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};h.prototype.readInt16LE=function(e,r){e=e>>>0,r||q(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};h.prototype.readInt16BE=function(e,r){e=e>>>0,r||q(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};h.prototype.readInt32LE=function(e,r){return e=e>>>0,r||q(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};h.prototype.readInt32BE=function(e,r){return e=e>>>0,r||q(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};h.prototype.readBigInt64LE=Fe(function(e){e=e>>>0,ft(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&qt(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,ft(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&qt(e,this.length-8);let i=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,r||q(e,4,this.length),ut.read(this,e,!0,23,4)};h.prototype.readFloatBE=function(e,r){return e=e>>>0,r||q(e,4,this.length),ut.read(this,e,!1,23,4)};h.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||q(e,8,this.length),ut.read(this,e,!0,52,8)};h.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||q(e,8,this.length),ut.read(this,e,!1,52,8)};function Y(t,e,r,n,i,s){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}h.prototype.writeUintLE=h.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;Y(this,e,r,n,a,0)}let s=1,o=0;for(this[r]=e&255;++o>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;Y(this,e,r,n,a,0)}let s=n-1,o=1;for(this[r+s]=e&255;--s>=0&&(o*=256);)this[r+s]=e/o&255;return r+n};h.prototype.writeUint8=h.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,1,255,0),this[r]=e&255,r+1};h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function fs(t,e,r,n,i){_s(e,n,i,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,r}function ds(t,e,r,n,i){_s(e,n,i,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s=s>>8,t[r+6]=s,s=s>>8,t[r+5]=s,s=s>>8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o=o>>8,t[r+2]=o,o=o>>8,t[r+1]=o,o=o>>8,t[r]=o,r+8}h.prototype.writeBigUInt64LE=Fe(function(e,r=0){return fs(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});h.prototype.writeBigUInt64BE=Fe(function(e,r=0){return ds(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});h.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let l=Math.pow(2,8*n-1);Y(this,e,r,n,l-1,-l)}let s=0,o=1,a=0;for(this[r]=e&255;++s>0)-a&255;return r+n};h.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let l=Math.pow(2,8*n-1);Y(this,e,r,n,l-1,-l)}let s=n-1,o=1,a=0;for(this[r+s]=e&255;--s>=0&&(o*=256);)e<0&&a===0&&this[r+s+1]!==0&&(a=1),this[r+s]=(e/o>>0)-a&255;return r+n};h.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};h.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};h.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};h.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};h.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||Y(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};h.prototype.writeBigInt64LE=Fe(function(e,r=0){return fs(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});h.prototype.writeBigInt64BE=Fe(function(e,r=0){return ds(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function cs(t,e,r,n,i,s){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function hs(t,e,r,n,i){return e=+e,r=r>>>0,i||cs(t,e,r,4,34028234663852886e22,-34028234663852886e22),ut.write(t,e,r,n,23,4),r+4}h.prototype.writeFloatLE=function(e,r,n){return hs(this,e,r,!0,n)};h.prototype.writeFloatBE=function(e,r,n){return hs(this,e,r,!1,n)};function ps(t,e,r,n,i){return e=+e,r=r>>>0,i||cs(t,e,r,8,17976931348623157e292,-17976931348623157e292),ut.write(t,e,r,n,52,8),r+8}h.prototype.writeDoubleLE=function(e,r,n){return ps(this,e,r,!0,n)};h.prototype.writeDoubleBE=function(e,r,n){return ps(this,e,r,!1,n)};h.prototype.copy=function(e,r,n,i){if(!h.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let s;if(typeof e=="number")for(s=r;s2**32?i=is(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=is(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function is(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Bu(t,e,r){ft(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&qt(e,t.length-(r+1))}function _s(t,e,r,n,i,s){if(t>r||t3?e===0||e===BigInt(0)?a=`>= 0${o} and < 2${o} ** ${(s+1)*8}${o}`:a=`>= -(2${o} ** ${(s+1)*8-1}${o}) and < 2 ** ${(s+1)*8-1}${o}`:a=`>= ${e}${o} and <= ${r}${o}`,new lt.ERR_OUT_OF_RANGE("value",a,t)}Bu(n,i,s)}function ft(t,e){if(typeof t!="number")throw new lt.ERR_INVALID_ARG_TYPE(e,"number",t)}function qt(t,e,r){throw Math.floor(t)!==t?(ft(t,r),new lt.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new lt.ERR_BUFFER_OUT_OF_BOUNDS:new lt.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var Fu=/[^+/0-9A-Za-z-_]/g;function ju(t){if(t=t.split("=")[0],t=t.trim().replace(Fu,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ln(t,e){e=e||1/0;let r,n=t.length,i=null,s=[];for(let o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function Pu(t){let e=[];for(let r=0;r>8,i=r%256,s.push(i),s.push(n);return s}function bs(t){return sn.toByteArray(ju(t))}function lr(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function de(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function cn(t){return t!==t}var Cu=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Fe(t){return typeof BigInt>"u"?Mu:t}function Mu(){throw new Error("BigInt not supported")}});var B=A((H_,ys)=>{"use strict";ys.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Boolean,Uint8Array}});var ct=A((Q_,ur)=>{"use strict";var{AbortController:gs,AbortSignal:$u}=typeof self<"u"?self:typeof window<"u"?window:void 0;ur.exports=gs;ur.exports.AbortSignal=$u;ur.exports.default=gs});var Ut=A((z_,hn)=>{"use strict";var ht=typeof Reflect=="object"?Reflect:null,ws=ht&&typeof ht.apply=="function"?ht.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},fr;ht&&typeof ht.ownKeys=="function"?fr=ht.ownKeys:Object.getOwnPropertySymbols?fr=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:fr=function(e){return Object.getOwnPropertyNames(e)};function Du(t){console&&console.warn&&console.warn(t)}var xs=Number.isNaN||function(e){return e!==e};function T(){T.init.call(this)}hn.exports=T;hn.exports.once=Gu;T.EventEmitter=T;T.prototype._events=void 0;T.prototype._eventsCount=0;T.prototype._maxListeners=void 0;var ms=10;function dr(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(T,"defaultMaxListeners",{enumerable:!0,get:function(){return ms},set:function(t){if(typeof t!="number"||t<0||xs(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");ms=t}});T.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};T.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||xs(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 Ss(t){return t._maxListeners===void 0?T.defaultMaxListeners:t._maxListeners}T.prototype.getMaxListeners=function(){return Ss(this)};T.prototype.emit=function(e){for(var r=[],n=1;n0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=s[e];if(l===void 0)return!1;if(typeof l=="function")ws(l,this,r);else for(var u=l.length,d=Ts(l,u),n=0;n0&&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=t,a.type=e,a.count=o.length,Du(a)}return t}T.prototype.addListener=function(e,r){return Es(this,e,r,!1)};T.prototype.on=T.prototype.addListener;T.prototype.prependListener=function(e,r){return Es(this,e,r,!0)};function qu(){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 Rs(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=qu.bind(n);return i.listener=r,n.wrapFn=i,i}T.prototype.once=function(e,r){return dr(r),this.on(e,Rs(this,e,r)),this};T.prototype.prependOnceListener=function(e,r){return dr(r),this.prependListener(e,Rs(this,e,r)),this};T.prototype.removeListener=function(e,r){var n,i,s,o,a;if(dr(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():Uu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};T.prototype.off=T.prototype.removeListener;T.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i=0;i--)this.removeListener(e,r[i]);return this};function Is(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?Wu(i):Ts(i,i.length)}T.prototype.listeners=function(e){return Is(this,e,!0)};T.prototype.rawListeners=function(e){return Is(this,e,!1)};T.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):As.call(t,e)};T.prototype.listenerCount=As;function As(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}T.prototype.eventNames=function(){return this._eventsCount>0?fr(this._events):[]};function Ts(t,e){for(var r=new Array(e),n=0;n{"use strict";var Qu=Se(),{kResistStopPropagation:zu,SymbolDispose:Vu}=B(),Ju=globalThis.AbortSignal||ct().AbortSignal,Ku=globalThis.AbortController||ct().AbortController,Yu=Object.getPrototypeOf(async function(){}).constructor,ks=globalThis.Blob||Qu.Blob,Zu=typeof ks<"u"?function(e){return e instanceof ks}:function(e){return!1},Ls=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},Xu=(t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},pn=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let n=0;n{t=n,e=i}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((n,...i)=>n?r(n):e(...i))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,n]){let i=e.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof Yu},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:Zu,deprecate(t,e){return t},addAbortListener:Ut().addAbortListener||function(e,r){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);Ls(e,"signal"),Xu(r,"listener");let n;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[zu]:!0}),n=()=>{e.removeEventListener("abort",r)}),{__proto__:null,[Vu](){var i;(i=n)===null||i===void 0||i()}}},AbortSignalAny:Ju.any||function(e){if(e.length===1)return e[0];let r=new Ku,n=()=>r.abort();return e.forEach(i=>{Ls(i,"signals"),i.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(i=>i.removeEventListener("abort",n))},{once:!0}),r.signal}};_n.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var V=A((J_,Fs)=>{"use strict";var{format:ef,inspect:cr,AggregateError:tf}=Q(),rf=globalThis.AggregateError||tf,nf=Symbol("kIsNodeError"),sf=["string","function","number","object","Function","Object","boolean","bigint","symbol"],of=/^([A-Z][a-z0-9]*)+$/,af="__node_internal_",hr={};function Ve(t,e){if(!t)throw new hr.ERR_INTERNAL_ASSERTION(e)}function vs(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function lf(t,e,r){if(typeof e=="function")return Ve(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let n=(e.match(/%[dfijoOs]/g)||[]).length;return Ve(n===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?e:ef(e,...r)}function U(t,e,r){r||(r=Error);class n extends r{constructor(...s){super(lf(t,e,s))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=t,n.prototype[nf]=!0,hr[t]=n}function Bs(t){let e=af+t.name;return Object.defineProperty(t,"name",{value:e}),t}function uf(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new rf([e,t],e.message);return r.code=e.code,r}return t||e}var bn=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new hr.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};U("ERR_ASSERTION","%s",Error);U("ERR_INVALID_ARG_TYPE",(t,e,r)=>{Ve(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let i=[],s=[],o=[];for(let l of e)Ve(typeof l=="string","All expected entries have to be of type string"),sf.includes(l)?i.push(l.toLowerCase()):of.test(l)?s.push(l):(Ve(l!=="object",'The value "object" should be written as "Object"'),o.push(l));if(s.length>0){let l=i.indexOf("object");l!==-1&&(i.splice(i,l,1),s.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{let l=i.pop();n+=`one of type ${i.join(", ")}, or ${l}`}}(s.length>0||o.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let l=s.pop();n+=`an instance of ${s.join(", ")}, or ${l}`}}o.length>0&&(n+=" or ")}switch(o.length){case 0:break;case 1:o[0].toLowerCase()!==o[0]&&(n+="an "),n+=`${o[0]}`;break;case 2:n+=`one of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();n+=`one of ${o.join(", ")}, or ${l}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)n+=`. Received an instance of ${r.constructor.name}`;else{let l=cr(r,{depth:-1});n+=`. Received ${l}`}}else{let l=cr(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),n+=`. Received type ${typeof r} (${l})`}return n},TypeError);U("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let n=cr(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${n}`},TypeError);U("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var n;let i=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${i}.`},TypeError);U("ERR_MISSING_ARGS",(...t)=>{Ve(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}break}return`${e} must be specified`},TypeError);U("ERR_OUT_OF_RANGE",(t,e,r)=>{Ve(e,'Missing "range" argument');let n;return Number.isInteger(r)&&Math.abs(r)>2**32?n=vs(String(r)):typeof r=="bigint"?(n=String(r),(r>2n**32n||r<-(2n**32n))&&(n=vs(n)),n+="n"):n=cr(r),`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);U("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);U("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);U("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);U("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);U("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);U("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);U("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);U("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);U("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);U("ERR_STREAM_WRITE_AFTER_END","write after end",Error);U("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Fs.exports={AbortError:bn,aggregateTwoErrors:Bs(uf),hideStackFrames:Bs,codes:hr}});var _t=A((K_,Ws)=>{"use strict";var{ArrayIsArray:gn,ArrayPrototypeIncludes:Cs,ArrayPrototypeJoin:Ms,ArrayPrototypeMap:ff,NumberIsInteger:wn,NumberIsNaN:df,NumberMAX_SAFE_INTEGER:cf,NumberMIN_SAFE_INTEGER:hf,NumberParseInt:pf,ObjectPrototypeHasOwnProperty:_f,RegExpPrototypeExec:$s,String:bf,StringPrototypeToUpperCase:yf,StringPrototypeTrim:gf}=B(),{hideStackFrames:te,codes:{ERR_SOCKET_BAD_PORT:wf,ERR_INVALID_ARG_TYPE:z,ERR_INVALID_ARG_VALUE:pt,ERR_OUT_OF_RANGE:Je,ERR_UNKNOWN_SIGNAL:js}}=V(),{normalizeEncoding:mf}=Q(),{isAsyncFunction:xf,isArrayBufferView:Sf}=Q().types,Ps={};function Ef(t){return t===(t|0)}function Rf(t){return t===t>>>0}var If=/^[0-7]+$/,Af="must be a 32-bit unsigned integer or an octal string";function Tf(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if($s(If,t)===null)throw new pt(e,t,Af);t=pf(t,8)}return Ds(t,e),t}var Nf=te((t,e,r=hf,n=cf)=>{if(typeof t!="number")throw new z(e,"number",t);if(!wn(t))throw new Je(e,"an integer",t);if(tn)throw new Je(e,`>= ${r} && <= ${n}`,t)}),kf=te((t,e,r=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new z(e,"number",t);if(!wn(t))throw new Je(e,"an integer",t);if(tn)throw new Je(e,`>= ${r} && <= ${n}`,t)}),Ds=te((t,e,r=!1)=>{if(typeof t!="number")throw new z(e,"number",t);if(!wn(t))throw new Je(e,"an integer",t);let n=r?1:0,i=4294967295;if(ti)throw new Je(e,`>= ${n} && <= ${i}`,t)});function mn(t,e){if(typeof t!="string")throw new z(e,"string",t)}function Lf(t,e,r=void 0,n){if(typeof t!="number")throw new z(e,"number",t);if(r!=null&&tn||(r!=null||n!=null)&&df(t))throw new Je(e,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}var vf=te((t,e,r)=>{if(!Cs(r,t)){let i="must be one of: "+Ms(ff(r,s=>typeof s=="string"?`'${s}'`:bf(s)),", ");throw new pt(e,t,i)}});function qs(t,e){if(typeof t!="boolean")throw new z(e,"boolean",t)}function yn(t,e,r){return t==null||!_f(t,e)?r:t[e]}var Bf=te((t,e,r=null)=>{let n=yn(r,"allowArray",!1),i=yn(r,"allowFunction",!1);if(!yn(r,"nullable",!1)&&t===null||!n&&gn(t)||typeof t!="object"&&(!i||typeof t!="function"))throw new z(e,"Object",t)}),Ff=te((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new z(e,"a dictionary",t)}),pr=te((t,e,r=0)=>{if(!gn(t))throw new z(e,"Array",t);if(t.length{if(!Sf(t))throw new z(e,["Buffer","TypedArray","DataView"],t)});function $f(t,e){let r=mf(e),n=t.length;if(r==="hex"&&n%2!==0)throw new pt("encoding",e,`is invalid for data of length ${n}`)}function Df(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&gf(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new wf(e,t,r);return t|0}var Us=te((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new z(e,"AbortSignal",t)}),qf=te((t,e)=>{if(typeof t!="function")throw new z(e,"Function",t)}),Uf=te((t,e)=>{if(typeof t!="function"||xf(t))throw new z(e,"Function",t)}),Wf=te((t,e)=>{if(t!==void 0)throw new z(e,"undefined",t)});function Gf(t,e,r){if(!Cs(r,t))throw new z(e,`('${Ms(r,"|")}')`,t)}var Hf=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Os(t,e){if(typeof t>"u"||!$s(Hf,t))throw new pt(e,t,'must be an array or string of format "; rel=preload; as=style"')}function Qf(t){if(typeof t=="string")return Os(t,"hints"),t;if(gn(t)){let e=t.length,r="";if(e===0)return r;for(let n=0;n; rel=preload; as=style"')}Ws.exports={isInt32:Ef,isUint32:Rf,parseFileMode:Tf,validateArray:pr,validateStringArray:jf,validateBooleanArray:Pf,validateAbortSignalArray:Of,validateBoolean:qs,validateBuffer:Mf,validateDictionary:Ff,validateEncoding:$f,validateFunction:qf,validateInt32:kf,validateInteger:Nf,validateNumber:Lf,validateObject:Bf,validateOneOf:vf,validatePlainFunction:Uf,validatePort:Df,validateSignalName:Cf,validateString:mn,validateUint32:Ds,validateUndefined:Wf,validateUnion:Gf,validateAbortSignal:Us,validateLinkHeaderValue:Qf}});var je=A((Y_,zs)=>{var O=zs.exports={},ce,he;function xn(){throw new Error("setTimeout has not been defined")}function Sn(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ce=setTimeout:ce=xn}catch{ce=xn}try{typeof clearTimeout=="function"?he=clearTimeout:he=Sn}catch{he=Sn}})();function Gs(t){if(ce===setTimeout)return setTimeout(t,0);if((ce===xn||!ce)&&setTimeout)return ce=setTimeout,setTimeout(t,0);try{return ce(t,0)}catch{try{return ce.call(null,t,0)}catch{return ce.call(this,t,0)}}}function zf(t){if(he===clearTimeout)return clearTimeout(t);if((he===Sn||!he)&&clearTimeout)return he=clearTimeout,clearTimeout(t);try{return he(t)}catch{try{return he.call(null,t)}catch{return he.call(this,t)}}}var Ee=[],bt=!1,Ke,_r=-1;function Vf(){!bt||!Ke||(bt=!1,Ke.length?Ee=Ke.concat(Ee):_r=-1,Ee.length&&Hs())}function Hs(){if(!bt){var t=Gs(Vf);bt=!0;for(var e=Ee.length;e;){for(Ke=Ee,Ee=[];++_r1)for(var r=1;r{"use strict";var{SymbolAsyncIterator:Vs,SymbolIterator:Js,SymbolFor:Ye}=B(),Ks=Ye("nodejs.stream.destroyed"),Ys=Ye("nodejs.stream.errored"),En=Ye("nodejs.stream.readable"),Rn=Ye("nodejs.stream.writable"),Zs=Ye("nodejs.stream.disturbed"),Jf=Ye("nodejs.webstream.isClosedPromise"),Kf=Ye("nodejs.webstream.controllerErrorFunction");function br(t,e=!1){var r;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}function yr(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function Yf(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function pe(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function Xs(t){return!!(t&&!pe(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function eo(t){return!!(t&&!pe(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function to(t){return!!(t&&!pe(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function Zf(t){return Xs(t)||eo(t)||to(t)}function Xf(t,e){return t==null?!1:e===!0?typeof t[Vs]=="function":e===!1?typeof t[Js]=="function":typeof t[Vs]=="function"||typeof t[Js]=="function"}function gr(t){if(!pe(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!!(t.destroyed||t[Ks]||n!=null&&n.destroyed)}function ro(t){if(!yr(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function ed(t,e){if(!yr(t))return null;if(t.writableFinished===!0)return!0;let r=t._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}function td(t){if(!br(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function no(t,e){if(!br(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}function io(t){return t&&t[En]!=null?t[En]:typeof t?.readable!="boolean"?null:gr(t)?!1:br(t)&&t.readable&&!no(t)}function so(t){return t&&t[Rn]!=null?t[Rn]:typeof t?.writable!="boolean"?null:gr(t)?!1:yr(t)&&t.writable&&!ro(t)}function rd(t,e){return pe(t)?gr(t)?!0:!(e?.readable!==!1&&io(t)||e?.writable!==!1&&so(t)):null}function nd(t){var e,r;return pe(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function id(t){var e,r;return pe(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function sd(t){if(!pe(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof e?.closed=="boolean"||typeof r?.closed=="boolean"?e?.closed||r?.closed:typeof t._closed=="boolean"&&oo(t)?t._closed:null}function oo(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function ao(t){return typeof t._sent100=="boolean"&&oo(t)}function od(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function ad(t){if(!pe(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!n&&ao(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function ld(t){var e;return!!(t&&((e=t[Zs])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function ud(t){var e,r,n,i,s,o,a,l,u,d;return!!(t&&((e=(r=(n=(i=(s=(o=t[Ys])!==null&&o!==void 0?o:t.readableErrored)!==null&&s!==void 0?s:t.writableErrored)!==null&&i!==void 0?i:(a=t._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&n!==void 0?n:(l=t._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(u=t._readableState)===null||u===void 0?void 0:u.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}lo.exports={isDestroyed:gr,kIsDestroyed:Ks,isDisturbed:ld,kIsDisturbed:Zs,isErrored:ud,kIsErrored:Ys,isReadable:io,kIsReadable:En,kIsClosedPromise:Jf,kControllerErrorFunction:Kf,kIsWritable:Rn,isClosed:sd,isDuplexNodeStream:Yf,isFinished:rd,isIterable:Xf,isReadableNodeStream:br,isReadableStream:Xs,isReadableEnded:td,isReadableFinished:no,isReadableErrored:id,isNodeStream:pe,isWebStream:Zf,isWritable:so,isWritableNodeStream:yr,isWritableStream:eo,isWritableEnded:ro,isWritableFinished:ed,isWritableErrored:nd,isServerRequest:od,isServerResponse:ao,willEmitClose:ad,isTransformStream:to}});var Ie=A((X_,kn)=>{var Pe=je(),{AbortError:go,codes:fd}=V(),{ERR_INVALID_ARG_TYPE:dd,ERR_STREAM_PREMATURE_CLOSE:uo}=fd,{kEmptyObject:An,once:Tn}=Q(),{validateAbortSignal:cd,validateFunction:hd,validateObject:pd,validateBoolean:_d}=_t(),{Promise:bd,PromisePrototypeThen:yd,SymbolDispose:wo}=B(),{isClosed:gd,isReadable:fo,isReadableNodeStream:In,isReadableStream:wd,isReadableFinished:co,isReadableErrored:ho,isWritable:po,isWritableNodeStream:_o,isWritableStream:md,isWritableFinished:bo,isWritableErrored:yo,isNodeStream:xd,willEmitClose:Sd,kIsClosedPromise:Ed}=_e(),yt;function Rd(t){return t.setHeader&&typeof t.abort=="function"}var Nn=()=>{};function mo(t,e,r){var n,i;if(arguments.length===2?(r=e,e=An):e==null?e=An:pd(e,"options"),hd(r,"callback"),cd(e.signal,"options.signal"),r=Tn(r),wd(t)||md(t))return Id(t,e,r);if(!xd(t))throw new dd("stream",["ReadableStream","WritableStream","Stream"],t);let s=(n=e.readable)!==null&&n!==void 0?n:In(t),o=(i=e.writable)!==null&&i!==void 0?i:_o(t),a=t._writableState,l=t._readableState,u=()=>{t.writable||b()},d=Sd(t)&&In(t)===s&&_o(t)===o,f=bo(t,!1),b=()=>{f=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||s))&&(!s||_)&&r.call(t)},_=co(t,!1),y=()=>{_=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||o))&&(!o||f)&&r.call(t)},g=j=>{r.call(t,j)},m=gd(t),w=()=>{m=!0;let j=yo(t)||ho(t);if(j&&typeof j!="boolean")return r.call(t,j);if(s&&!_&&In(t,!0)&&!co(t,!1))return r.call(t,new uo);if(o&&!f&&!bo(t,!1))return r.call(t,new uo);r.call(t)},R=()=>{m=!0;let j=yo(t)||ho(t);if(j&&typeof j!="boolean")return r.call(t,j);r.call(t)},N=()=>{t.req.on("finish",b)};Rd(t)?(t.on("complete",b),d||t.on("abort",w),t.req?N():t.on("request",N)):o&&!a&&(t.on("end",u),t.on("close",u)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",w),t.on("end",y),t.on("finish",b),e.error!==!1&&t.on("error",g),t.on("close",w),m?Pe.nextTick(w):a!=null&&a.errorEmitted||l!=null&&l.errorEmitted?d||Pe.nextTick(R):(!s&&(!d||fo(t))&&(f||po(t)===!1)||!o&&(!d||po(t))&&(_||fo(t)===!1)||l&&t.req&&t.aborted)&&Pe.nextTick(R);let S=()=>{r=Nn,t.removeListener("aborted",w),t.removeListener("complete",b),t.removeListener("abort",w),t.removeListener("request",N),t.req&&t.req.removeListener("finish",b),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",b),t.removeListener("end",y),t.removeListener("error",g),t.removeListener("close",w)};if(e.signal&&!m){let j=()=>{let me=r;S(),me.call(t,new go(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)Pe.nextTick(j);else{yt=yt||Q().addAbortListener;let me=yt(e.signal,j),J=r;r=Tn((...ke)=>{me[wo](),J.apply(t,ke)})}}return S}function Id(t,e,r){let n=!1,i=Nn;if(e.signal)if(i=()=>{n=!0,r.call(t,new go(void 0,{cause:e.signal.reason}))},e.signal.aborted)Pe.nextTick(i);else{yt=yt||Q().addAbortListener;let o=yt(e.signal,i),a=r;r=Tn((...l)=>{o[wo](),a.apply(t,l)})}let s=(...o)=>{n||Pe.nextTick(()=>r.apply(t,o))};return yd(t[Ed].promise,s,s),Nn}function Ad(t,e){var r;let n=!1;return e===null&&(e=An),(r=e)!==null&&r!==void 0&&r.cleanup&&(_d(e.cleanup,"cleanup"),n=e.cleanup),new bd((i,s)=>{let o=mo(t,e,a=>{n&&o(),a?s(a):i()})})}kn.exports=mo;kn.exports.finished=Ad});var Ze=A((eb,No)=>{"use strict";var be=je(),{aggregateTwoErrors:Td,codes:{ERR_MULTIPLE_CALLBACK:Nd},AbortError:kd}=V(),{Symbol:Eo}=B(),{kIsDestroyed:Ld,isDestroyed:vd,isFinished:Bd,isServerRequest:Fd}=_e(),Ro=Eo("kDestroy"),Ln=Eo("kConstruct");function Io(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function jd(t,e){let r=this._readableState,n=this._writableState,i=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(Io(t,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?xo(this,t,e):this.once(Ro,function(s){xo(this,Td(s,t),e)}),this)}function xo(t,e,r){let n=!1;function i(s){if(n)return;n=!0;let o=t._readableState,a=t._writableState;Io(s,a,o),a&&(a.closed=!0),o&&(o.closed=!0),typeof r=="function"&&r(s),s?be.nextTick(Pd,t,s):be.nextTick(Ao,t)}try{t._destroy(e||null,i)}catch(s){i(s)}}function Pd(t,e){vn(t,e),Ao(t)}function Ao(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close")}function vn(t,e){let r=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}function Od(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}function Bn(t,e,r){let n=t._readableState,i=t._writableState;if(i!=null&&i.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||i!=null&&i.autoDestroy?t.destroy(e):e&&(e.stack,i&&!i.errored&&(i.errored=e),n&&!n.errored&&(n.errored=e),r?be.nextTick(vn,t,e):vn(t,e))}function Cd(t,e){if(typeof t._construct!="function")return;let r=t._readableState,n=t._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),t.once(Ln,e),!(t.listenerCount(Ln)>1)&&be.nextTick(Md,t)}function Md(t){let e=!1;function r(n){if(e){Bn(t,n??new Nd);return}e=!0;let i=t._readableState,s=t._writableState,o=s||i;i&&(i.constructed=!0),s&&(s.constructed=!0),o.destroyed?t.emit(Ro,n):n?Bn(t,n,!0):be.nextTick($d,t)}try{t._construct(n=>{be.nextTick(r,n)})}catch(n){be.nextTick(r,n)}}function $d(t){t.emit(Ln)}function So(t){return t?.setHeader&&typeof t.abort=="function"}function To(t){t.emit("close")}function Dd(t,e){t.emit("error",e),be.nextTick(To,t)}function qd(t,e){!t||vd(t)||(!e&&!Bd(t)&&(e=new kd),Fd(t)?(t.socket=null,t.destroy(e)):So(t)?t.abort():So(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?be.nextTick(Dd,t,e):be.nextTick(To,t),t.destroyed||(t[Ld]=!0))}No.exports={construct:Cd,destroyer:qd,destroy:jd,undestroy:Od,errorOrDestroy:Bn}});var xr=A((tb,Lo)=>{"use strict";var{ArrayIsArray:Ud,ObjectSetPrototypeOf:ko}=B(),{EventEmitter:wr}=Ut();function mr(t){wr.call(this,t)}ko(mr.prototype,wr.prototype);ko(mr,wr);mr.prototype.pipe=function(t,e){let r=this;function n(d){t.writable&&t.write(d)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}t.on("drain",i),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",o),r.on("close",a));let s=!1;function o(){s||(s=!0,t.end())}function a(){s||(s=!0,typeof t.destroy=="function"&&t.destroy())}function l(d){u(),wr.listenerCount(this,"error")===0&&this.emit("error",d)}Fn(r,"error",l),Fn(t,"error",l);function u(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",o),r.removeListener("close",a),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",u),r.removeListener("close",u),t.removeListener("close",u)}return r.on("end",u),r.on("close",u),t.on("close",u),t.emit("pipe",r),t};function Fn(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Ud(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}Lo.exports={Stream:mr,prependListener:Fn}});var Wt=A((rb,Sr)=>{"use strict";var{SymbolDispose:Wd}=B(),{AbortError:vo,codes:Gd}=V(),{isNodeStream:Bo,isWebStream:Hd,kControllerErrorFunction:Qd}=_e(),zd=Ie(),{ERR_INVALID_ARG_TYPE:Fo}=Gd,jn,Vd=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new Fo(e,"AbortSignal",t)};Sr.exports.addAbortSignal=function(e,r){if(Vd(e,"signal"),!Bo(r)&&!Hd(r))throw new Fo("stream",["ReadableStream","WritableStream","Stream"],r);return Sr.exports.addAbortSignalNoValidate(e,r)};Sr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=Bo(e)?()=>{e.destroy(new vo(void 0,{cause:t.reason}))}:()=>{e[Qd](new vo(void 0,{cause:t.reason}))};if(t.aborted)r();else{jn=jn||Q().addAbortListener;let n=jn(t,r);zd(e,n[Wd])}return e}});var Oo=A((ib,Po)=>{"use strict";var{StringPrototypeSlice:jo,SymbolIterator:Jd,TypedArrayPrototypeSet:Er,Uint8Array:Kd}=B(),{Buffer:Pn}=Se(),{inspect:Yd}=Q();Po.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=e+r.data;return n}concat(e){if(this.length===0)return Pn.alloc(0);let r=Pn.allocUnsafe(e>>>0),n=this.head,i=0;for(;n;)Er(r,n.data,i),i+=n.data.length,n=n.next;return r}consume(e,r){let n=this.head.data;if(es.length)r+=s,e-=s.length;else{e===s.length?(r+=s,++i,n.next?this.head=n.next:this.head=this.tail=null):(r+=jo(s,0,e),this.head=n,n.data=jo(s,e));break}++i}while((n=n.next)!==null);return this.length-=i,r}_getBuffer(e){let r=Pn.allocUnsafe(e),n=e,i=this.head,s=0;do{let o=i.data;if(e>o.length)Er(r,o,n-e),e-=o.length;else{e===o.length?(Er(r,o,n-e),++s,i.next?this.head=i.next:this.head=this.tail=null):(Er(r,new Kd(o.buffer,o.byteOffset,e),n-e),this.head=i,i.data=o.slice(e));break}++s}while((i=i.next)!==null);return this.length-=s,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return Yd(this,{...r,depth:0,customInspect:!1})}}});var Gt=A((sb,Do)=>{"use strict";var{MathFloor:Zd,NumberIsInteger:Xd}=B(),{validateInteger:ec}=_t(),{ERR_INVALID_ARG_VALUE:tc}=V().codes,Co=16*1024,Mo=16;function rc(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function $o(t){return t?Mo:Co}function nc(t,e){ec(e,"value",0),t?Mo=e:Co=e}function ic(t,e,r,n){let i=rc(e,n,r);if(i!=null){if(!Xd(i)||i<0){let s=n?`options.${r}`:"options.highWaterMark";throw new tc(s,i)}return Zd(i)}return $o(t.objectMode)}Do.exports={getHighWaterMark:ic,getDefaultHighWaterMark:$o,setDefaultHighWaterMark:nc}});var Wo=A((On,Uo)=>{var Rr=Se(),ye=Rr.Buffer;function qo(t,e){for(var r in t)e[r]=t[r]}ye.from&&ye.alloc&&ye.allocUnsafe&&ye.allocUnsafeSlow?Uo.exports=Rr:(qo(Rr,On),On.Buffer=Xe);function Xe(t,e,r){return ye(t,e,r)}Xe.prototype=Object.create(ye.prototype);qo(ye,Xe);Xe.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return ye(t,e,r)};Xe.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=ye(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Xe.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ye(t)};Xe.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Rr.SlowBuffer(t)}});var Qo=A(Ho=>{"use strict";var Mn=Wo().Buffer,Go=Mn.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function sc(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function oc(t){var e=sc(t);if(typeof e!="string"&&(Mn.isEncoding===Go||!Go(t)))throw new Error("Unknown encoding: "+t);return e||t}Ho.StringDecoder=Ht;function Ht(t){this.encoding=oc(t);var e;switch(this.encoding){case"utf16le":this.text=cc,this.end=hc,e=4;break;case"utf8":this.fillLast=uc,e=4;break;case"base64":this.text=pc,this.end=_c,e=3;break;default:this.write=bc,this.end=yc;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Mn.allocUnsafe(e)}Ht.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function ac(t,e,r){var n=e.length-1;if(n=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function lc(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function uc(t){var e=this.lastTotal-this.lastNeed,r=lc(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function fc(t,e){var r=ac(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function dc(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function cc(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function hc(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function pc(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function _c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function bc(t){return t.toString(this.encoding)}function yc(t){return t&&t.length?this.write(t):""}});var $n=A((ab,Ko)=>{"use strict";var zo=je(),{PromisePrototypeThen:gc,SymbolAsyncIterator:Vo,SymbolIterator:Jo}=B(),{Buffer:wc}=Se(),{ERR_INVALID_ARG_TYPE:mc,ERR_STREAM_NULL_VALUES:xc}=V().codes;function Sc(t,e,r){let n;if(typeof e=="string"||e instanceof wc)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null)}});let i;if(e&&e[Vo])i=!0,n=e[Vo]();else if(e&&e[Jo])i=!1,n=e[Jo]();else throw new mc("iterable",["Iterable"],e);let s=new t({objectMode:!0,highWaterMark:1,...r}),o=!1;s._read=function(){o||(o=!0,l())},s._destroy=function(u,d){gc(a(u),()=>zo.nextTick(d,u),f=>zo.nextTick(d,f||u))};async function a(u){let d=u!=null,f=typeof n.throw=="function";if(d&&f){let{value:b,done:_}=await n.throw(u);if(await b,_)return}if(typeof n.return=="function"){let{value:b}=await n.return();await b}}async function l(){for(;;){try{let{value:u,done:d}=i?await n.next():n.next();if(d)s.push(null);else{let f=u&&typeof u.then=="function"?await u:u;if(f===null)throw o=!1,new xc;if(s.push(f))continue;o=!1}}catch(u){s.destroy(u)}break}}return s}Ko.exports=Sc});var zt=A((lb,pa)=>{var ie=je(),{ArrayPrototypeIndexOf:Ec,NumberIsInteger:Rc,NumberIsNaN:Ic,NumberParseInt:Ac,ObjectDefineProperties:zn,ObjectKeys:Tc,ObjectSetPrototypeOf:Xo,Promise:ea,SafeSet:Nc,SymbolAsyncDispose:kc,SymbolAsyncIterator:Lc,Symbol:vc}=B();pa.exports=E;E.ReadableState=Nr;var{EventEmitter:Bc}=Ut(),{Stream:Oe,prependListener:Fc}=xr(),{Buffer:Dn}=Se(),{addAbortSignal:jc}=Wt(),ta=Ie(),I=Q().debuglog("stream",t=>{I=t}),Pc=Oo(),mt=Ze(),{getHighWaterMark:Oc,getDefaultHighWaterMark:Cc}=Gt(),{aggregateTwoErrors:Yo,codes:{ERR_INVALID_ARG_TYPE:Mc,ERR_METHOD_NOT_IMPLEMENTED:$c,ERR_OUT_OF_RANGE:Dc,ERR_STREAM_PUSH_AFTER_EOF:qc,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Uc},AbortError:Wc}=V(),{validateObject:Gc}=_t(),et=vc("kPaused"),{StringDecoder:ra}=Qo(),Hc=$n();Xo(E.prototype,Oe.prototype);Xo(E,Oe);var qn=()=>{},{errorOrDestroy:gt}=mt,wt=1,Qc=2,na=4,Qt=8,ia=16,Ir=32,Ar=64,sa=128,zc=256,Vc=512,Jc=1024,Hn=2048,Qn=4096,Kc=8192,Yc=16384,Zc=32768,oa=65536,Xc=1<<17,eh=1<<18;function $(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}zn(Nr.prototype,{objectMode:$(wt),ended:$(Qc),endEmitted:$(na),reading:$(Qt),constructed:$(ia),sync:$(Ir),needReadable:$(Ar),emittedReadable:$(sa),readableListening:$(zc),resumeScheduled:$(Vc),errorEmitted:$(Jc),emitClose:$(Hn),autoDestroy:$(Qn),destroyed:$(Kc),closed:$(Yc),closeEmitted:$(Zc),multiAwaitDrain:$(oa),readingMore:$(Xc),dataEmitted:$(eh)});function Nr(t,e,r){typeof r!="boolean"&&(r=e instanceof ge()),this.state=Hn|Qn|ia|Ir,t&&t.objectMode&&(this.state|=wt),r&&t&&t.readableObjectMode&&(this.state|=wt),this.highWaterMark=t?Oc(this,t,"readableHighWaterMark",r):Cc(!1),this.buffer=new Pc,this.length=0,this.pipes=[],this.flowing=null,this[et]=null,t&&t.emitClose===!1&&(this.state&=~Hn),t&&t.autoDestroy===!1&&(this.state&=~Qn),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new ra(t.encoding),this.encoding=t.encoding)}function E(t){if(!(this instanceof E))return new E(t);let e=this instanceof ge();this._readableState=new Nr(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&jc(t.signal,this)),Oe.call(this,t),mt.construct(this,()=>{this._readableState.needReadable&&Tr(this,this._readableState)})}E.prototype.destroy=mt.destroy;E.prototype._undestroy=mt.undestroy;E.prototype._destroy=function(t,e){e(t)};E.prototype[Bc.captureRejectionSymbol]=function(t){this.destroy(t)};E.prototype[kc]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new Wc,this.destroy(t)),new ea((e,r)=>ta(this,n=>n&&n!==t?r(n):e(null)))};E.prototype.push=function(t,e){return aa(this,t,e,!1)};E.prototype.unshift=function(t,e){return aa(this,t,e,!0)};function aa(t,e,r,n){I("readableAddChunk",e);let i=t._readableState,s;if(i.state&wt||(typeof e=="string"?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?e=Dn.from(e,r).toString(i.encoding):(e=Dn.from(e,r),r=""))):e instanceof Dn?r="":Oe._isUint8Array(e)?(e=Oe._uint8ArrayToBuffer(e),r=""):e!=null&&(s=new Mc("chunk",["string","Buffer","Uint8Array"],e))),s)gt(t,s);else if(e===null)i.state&=~Qt,nh(t,i);else if(i.state&wt||e&&e.length>0)if(n)if(i.state&na)gt(t,new Uc);else{if(i.destroyed||i.errored)return!1;Un(t,i,e,!0)}else if(i.ended)gt(t,new qc);else{if(i.destroyed||i.errored)return!1;i.state&=~Qt,i.decoder&&!r?(e=i.decoder.write(e),i.objectMode||e.length!==0?Un(t,i,e,!1):Tr(t,i)):Un(t,i,e,!1)}else n||(i.state&=~Qt,Tr(t,i));return!i.ended&&(i.length0?(e.state&oa?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.state&Ar&&kr(t)),Tr(t,e)}E.prototype.isPaused=function(){let t=this._readableState;return t[et]===!0||t.flowing===!1};E.prototype.setEncoding=function(t){let e=new ra(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let i of r)n+=e.write(i);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var th=1073741824;function rh(t){if(t>th)throw new Dc("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function Zo(t,e){return t<=0||e.length===0&&e.ended?0:e.state&wt?1:Ic(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}E.prototype.read=function(t){I("read",t),t===void 0?t=NaN:Rc(t)||(t=Ac(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=rh(t)),t!==0&&(e.state&=~sa),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return I("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Wn(this):kr(this),null;if(t=Zo(t,e),t===0&&e.ended)return e.length===0&&Wn(this),null;let n=(e.state&Ar)!==0;if(I("need readable",n),(e.length===0||e.length-t0?i=ca(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Wn(this)),i!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",i)),i};function nh(t,e){if(I("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?kr(t):(e.needReadable=!1,e.emittedReadable=!0,la(t))}}function kr(t){let e=t._readableState;I("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(I("emitReadable",e.flowing),e.emittedReadable=!0,ie.nextTick(la,t))}function la(t){let e=t._readableState;I("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,fa(t)}function Tr(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,ie.nextTick(ih,t,e))}function ih(t,e){for(;!e.reading&&!e.ended&&(e.length1&&n.pipes.includes(t)&&(I("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),r.pause()),l||(l=sh(r,t),t.on("drain",l))}r.on("data",b);function b(w){I("ondata");let R=t.write(w);I("dest.write",R),R===!1&&f()}function _(w){if(I("onerror",w),m(),t.removeListener("error",_),t.listenerCount("error")===0){let R=t._writableState||t._readableState;R&&!R.errorEmitted?gt(t,w):t.emit("error",w)}}Fc(t,"error",_);function y(){t.removeListener("finish",g),m()}t.once("close",y);function g(){I("onfinish"),t.removeListener("close",y),m()}t.once("finish",g);function m(){I("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?f():n.flowing||(I("pipe resume"),r.resume()),t};function sh(t,e){return function(){let n=t._readableState;n.awaitDrainWriters===e?(I("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(I("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}E.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let i=e.pipes;e.pipes=[],this.pause();for(let s=0;s0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,I("on readable",n.length,n.reading),n.length?kr(this):n.reading||ie.nextTick(oh,this)),r};E.prototype.addListener=E.prototype.on;E.prototype.removeListener=function(t,e){let r=Oe.prototype.removeListener.call(this,t,e);return t==="readable"&&ie.nextTick(ua,this),r};E.prototype.off=E.prototype.removeListener;E.prototype.removeAllListeners=function(t){let e=Oe.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&ie.nextTick(ua,this),e};function ua(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[et]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function oh(t){I("readable nexttick read 0"),t.read(0)}E.prototype.resume=function(){let t=this._readableState;return t.flowing||(I("resume"),t.flowing=!t.readableListening,ah(this,t)),t[et]=!1,this};function ah(t,e){e.resumeScheduled||(e.resumeScheduled=!0,ie.nextTick(lh,t,e))}function lh(t,e){I("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),fa(t),e.flowing&&!e.reading&&t.read(0)}E.prototype.pause=function(){return I("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(I("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[et]=!0,this};function fa(t){let e=t._readableState;for(I("flow",e.flowing);e.flowing&&t.read()!==null;);}E.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",n=>{gt(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=Tc(t);for(let n=1;n{i=o?Yo(i,o):null,r(),r=qn});try{for(;;){let o=t.destroyed?null:t.read();if(o!==null)yield o;else{if(i)throw i;if(i===null)return;await new ea(n)}}}catch(o){throw i=Yo(i,o),i}finally{(i||e?.destroyOnReturn!==!1)&&(i===void 0||t._readableState.autoDestroy)?mt.destroyer(t,null):(t.off("readable",n),s())}}zn(E.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});zn(Nr.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[et]!==!1},set(t){this[et]=!!t}}});E._fromList=ca;function ca(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function Wn(t){let e=t._readableState;I("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,ie.nextTick(fh,e,t))}function fh(t,e){if(I("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)ie.nextTick(dh,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function dh(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}E.from=function(t,e){return Hc(E,t,e)};var Gn;function ha(){return Gn===void 0&&(Gn={}),Gn}E.fromWeb=function(t,e){return ha().newStreamReadableFromReadableStream(t,e)};E.toWeb=function(t,e){return ha().newReadableStreamFromStreamReadable(t,e)};E.wrap=function(t,e){var r,n;return new E({objectMode:(r=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(i,s){mt.destroyer(t,i),s(i)}}).wrap(t)}});var jr=A((ub,Aa)=>{var tt=je(),{ArrayPrototypeSlice:ya,Error:ch,FunctionPrototypeSymbolHasInstance:ga,ObjectDefineProperty:wa,ObjectDefineProperties:hh,ObjectSetPrototypeOf:ma,StringPrototypeToLowerCase:ph,Symbol:_h,SymbolHasInstance:bh}=B();Aa.exports=F;F.WritableState=Kt;var{EventEmitter:yh}=Ut(),Vt=xr().Stream,{Buffer:Lr}=Se(),Fr=Ze(),{addAbortSignal:gh}=Wt(),{getHighWaterMark:wh,getDefaultHighWaterMark:mh}=Gt(),{ERR_INVALID_ARG_TYPE:xh,ERR_METHOD_NOT_IMPLEMENTED:Sh,ERR_MULTIPLE_CALLBACK:xa,ERR_STREAM_CANNOT_PIPE:Eh,ERR_STREAM_DESTROYED:Jt,ERR_STREAM_ALREADY_FINISHED:Rh,ERR_STREAM_NULL_VALUES:Ih,ERR_STREAM_WRITE_AFTER_END:Ah,ERR_UNKNOWN_ENCODING:Sa}=V().codes,{errorOrDestroy:xt}=Fr;ma(F.prototype,Vt.prototype);ma(F,Vt);function Kn(){}var St=_h("kOnFinished");function Kt(t,e,r){typeof r!="boolean"&&(r=e instanceof ge()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?wh(this,t,"writableHighWaterMark",r):mh(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Nh.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Br(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[St]=[]}function Br(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}Kt.prototype.getBuffer=function(){return ya(this.buffered,this.bufferedIndex)};wa(Kt.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function F(t){let e=this instanceof ge();if(!e&&!ga(F,this))return new F(t);this._writableState=new Kt(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&gh(t.signal,this)),Vt.call(this,t),Fr.construct(this,()=>{let r=this._writableState;r.writing||Zn(this,r),Xn(this,r)})}wa(F,bh,{__proto__:null,value:function(t){return ga(this,t)?!0:this!==F?!1:t&&t._writableState instanceof Kt}});F.prototype.pipe=function(){xt(this,new Eh)};function Ea(t,e,r,n){let i=t._writableState;if(typeof r=="function")n=r,r=i.defaultEncoding;else{if(!r)r=i.defaultEncoding;else if(r!=="buffer"&&!Lr.isEncoding(r))throw new Sa(r);typeof n!="function"&&(n=Kn)}if(e===null)throw new Ih;if(!i.objectMode)if(typeof e=="string")i.decodeStrings!==!1&&(e=Lr.from(e,r),r="buffer");else if(e instanceof Lr)r="buffer";else if(Vt._isUint8Array(e))e=Vt._uint8ArrayToBuffer(e),r="buffer";else throw new xh("chunk",["string","Buffer","Uint8Array"],e);let s;return i.ending?s=new Ah:i.destroyed&&(s=new Jt("write")),s?(tt.nextTick(n,s),xt(t,s,!0),s):(i.pendingcb++,Th(t,i,e,r,n))}F.prototype.write=function(t,e,r){return Ea(this,t,e,r)===!0};F.prototype.cork=function(){this._writableState.corked++};F.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Zn(this,t))};F.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=ph(e)),!Lr.isEncoding(e))throw new Sa(e);return this._writableState.defaultEncoding=e,this};function Th(t,e,r,n,i){let s=e.objectMode?1:r.length;e.length+=s;let o=e.lengthr.bufferedIndex&&Zn(t,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:t,state:r},tt.nextTick(kh,r.afterWriteTickInfo)):Ra(t,r,1,i))}function kh({stream:t,state:e,count:r,cb:n}){return e.afterWriteTickInfo=null,Ra(t,e,r,n)}function Ra(t,e,r,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,n();e.destroyed&&Yn(e),Xn(t,e)}function Yn(t){if(t.writing)return;for(let i=t.bufferedIndex;i1&&t._writev){e.pendingcb-=s-1;let a=e.allNoop?Kn:u=>{for(let d=o;d256?(r.splice(0,o),e.bufferedIndex=0):e.bufferedIndex=o}e.bufferProcessing=!1}F.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new Sh("_write()")};F.prototype._writev=null;F.prototype.end=function(t,e,r){let n=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let i;if(t!=null){let s=Ea(this,t,e);s instanceof ch&&(i=s)}return n.corked&&(n.corked=1,this.uncork()),i||(!n.errored&&!n.ending?(n.ending=!0,Xn(this,n,!0),n.ended=!0):n.finished?i=new Rh("end"):n.destroyed&&(i=new Jt("end"))),typeof r=="function"&&(i||n.finished?tt.nextTick(r,i):n[St].push(r)),this};function vr(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function Lh(t,e){let r=!1;function n(i){if(r){xt(t,i??xa());return}if(r=!0,e.pendingcb--,i){let s=e[St].splice(0);for(let o=0;o{vr(i)?Jn(n,i):i.pendingcb--},t,e)):vr(e)&&(e.pendingcb++,Jn(t,e))))}function Jn(t,e){e.pendingcb--,e.finished=!0;let r=e[St].splice(0);for(let n=0;n{var ei=je(),Fh=Se(),{isReadable:jh,isWritable:Ph,isIterable:Ta,isNodeStream:Oh,isReadableNodeStream:Na,isWritableNodeStream:ka,isDuplexNodeStream:Ch,isReadableStream:La,isWritableStream:va}=_e(),Ba=Ie(),{AbortError:Ma,codes:{ERR_INVALID_ARG_TYPE:Mh,ERR_INVALID_RETURN_VALUE:Fa}}=V(),{destroyer:Rt}=Ze(),$h=ge(),$a=zt(),Dh=jr(),{createDeferredPromise:ja}=Q(),Pa=$n(),Oa=globalThis.Blob||Fh.Blob,qh=typeof Oa<"u"?function(e){return e instanceof Oa}:function(e){return!1},Uh=globalThis.AbortController||ct().AbortController,{FunctionPrototypeCall:Ca}=B(),Ce=class extends $h{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};Da.exports=function t(e,r){if(Ch(e))return e;if(Na(e))return Et({readable:e});if(ka(e))return Et({writable:e});if(Oh(e))return Et({writable:!1,readable:!1});if(La(e))return Et({readable:$a.fromWeb(e)});if(va(e))return Et({writable:Dh.fromWeb(e)});if(typeof e=="function"){let{value:i,write:s,final:o,destroy:a}=Wh(e);if(Ta(i))return Pa(Ce,i,{objectMode:!0,write:s,final:o,destroy:a});let l=i?.then;if(typeof l=="function"){let u,d=Ca(l,i,f=>{if(f!=null)throw new Fa("nully","body",f)},f=>{Rt(u,f)});return u=new Ce({objectMode:!0,readable:!1,write:s,final(f){o(async()=>{try{await d,ei.nextTick(f,null)}catch(b){ei.nextTick(f,b)}})},destroy:a})}throw new Fa("Iterable, AsyncIterable or AsyncFunction",r,i)}if(qh(e))return t(e.arrayBuffer());if(Ta(e))return Pa(Ce,e,{objectMode:!0,writable:!1});if(La(e?.readable)&&va(e?.writable))return Ce.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let i=e!=null&&e.readable?Na(e?.readable)?e?.readable:t(e.readable):void 0,s=e!=null&&e.writable?ka(e?.writable)?e?.writable:t(e.writable):void 0;return Et({readable:i,writable:s})}let n=e?.then;if(typeof n=="function"){let i;return Ca(n,e,s=>{s!=null&&i.push(s),i.push(null)},s=>{Rt(i,s)}),i=new Ce({objectMode:!0,writable:!1,read(){}})}throw new Mh(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function Wh(t){let{promise:e,resolve:r}=ja(),n=new Uh,i=n.signal;return{value:t(async function*(){for(;;){let o=e;e=null;let{chunk:a,done:l,cb:u}=await o;if(ei.nextTick(u),l)return;if(i.aborted)throw new Ma(void 0,{cause:i.reason});({promise:e,resolve:r}=ja()),yield a}}(),{signal:i}),write(o,a,l){let u=r;r=null,u({chunk:o,done:!1,cb:l})},final(o){let a=r;r=null,a({done:!0,cb:o})},destroy(o,a){n.abort(),a(o)}}}function Et(t){let e=t.readable&&typeof t.readable.read!="function"?$a.wrap(t.readable):t.readable,r=t.writable,n=!!jh(e),i=!!Ph(r),s,o,a,l,u;function d(f){let b=l;l=null,b?b(f):f&&u.destroy(f)}return u=new Ce({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:i}),i&&(Ba(r,f=>{i=!1,f&&Rt(e,f),d(f)}),u._write=function(f,b,_){r.write(f,b)?_():s=_},u._final=function(f){r.end(),o=f},r.on("drain",function(){if(s){let f=s;s=null,f()}}),r.on("finish",function(){if(o){let f=o;o=null,f()}})),n&&(Ba(e,f=>{n=!1,f&&Rt(e,f),d(f)}),e.on("readable",function(){if(a){let f=a;a=null,f()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let f=e.read();if(f===null){a=u._read;return}if(!u.push(f))return}}),u._destroy=function(f,b){!f&&l!==null&&(f=new Ma),a=null,s=null,o=null,l===null?b(f):(l=b,Rt(r,f),Rt(e,f))},u}});var ge=A((db,Ga)=>{"use strict";var{ObjectDefineProperties:Gh,ObjectGetOwnPropertyDescriptor:Ae,ObjectKeys:Hh,ObjectSetPrototypeOf:Ua}=B();Ga.exports=se;var ni=zt(),re=jr();Ua(se.prototype,ni.prototype);Ua(se,ni);{let t=Hh(re.prototype);for(let e=0;e{"use strict";var{ObjectSetPrototypeOf:Ha,Symbol:Qh}=B();Qa.exports=Te;var{ERR_METHOD_NOT_IMPLEMENTED:zh}=V().codes,si=ge(),{getHighWaterMark:Vh}=Gt();Ha(Te.prototype,si.prototype);Ha(Te,si);var Yt=Qh("kCallback");function Te(t){if(!(this instanceof Te))return new Te(t);let e=t?Vh(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),si.call(this,t),this._readableState.sync=!1,this[Yt]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Jh)}function ii(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t()}):(this.push(null),t&&t())}function Jh(){this._final!==ii&&ii.call(this)}Te.prototype._final=ii;Te.prototype._transform=function(t,e,r){throw new zh("_transform()")};Te.prototype._write=function(t,e,r){let n=this._readableState,i=this._writableState,s=n.length;this._transform(t,e,(o,a)=>{if(o){r(o);return}a!=null&&this.push(a),i.ended||s===n.length||n.length{"use strict";var{ObjectSetPrototypeOf:za}=B();Va.exports=It;var ai=oi();za(It.prototype,ai.prototype);za(It,ai);function It(t){if(!(this instanceof It))return new It(t);ai.call(this,t)}It.prototype._transform=function(t,e,r){r(null,t)}});var Mr=A((pb,Xa)=>{var Zt=je(),{ArrayIsArray:Kh,Promise:Yh,SymbolAsyncIterator:Zh,SymbolDispose:Xh}=B(),Cr=Ie(),{once:ep}=Q(),tp=Ze(),Ja=ge(),{aggregateTwoErrors:rp,codes:{ERR_INVALID_ARG_TYPE:yi,ERR_INVALID_RETURN_VALUE:ui,ERR_MISSING_ARGS:np,ERR_STREAM_DESTROYED:ip,ERR_STREAM_PREMATURE_CLOSE:sp},AbortError:op}=V(),{validateFunction:ap,validateAbortSignal:lp}=_t(),{isIterable:rt,isReadable:fi,isReadableNodeStream:Or,isNodeStream:Ka,isTransformStream:At,isWebStream:up,isReadableStream:di,isReadableFinished:fp}=_e(),dp=globalThis.AbortController||ct().AbortController,ci,hi,pi;function Ya(t,e,r){let n=!1;t.on("close",()=>{n=!0});let i=Cr(t,{readable:e,writable:r},s=>{n=!s});return{destroy:s=>{n||(n=!0,tp.destroyer(t,s||new ip("pipe")))},cleanup:i}}function cp(t){return ap(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function _i(t){if(rt(t))return t;if(Or(t))return hp(t);throw new yi("val",["Readable","Iterable","AsyncIterable"],t)}async function*hp(t){hi||(hi=zt()),yield*hi.prototype[Zh].call(t)}async function Pr(t,e,r,{end:n}){let i,s=null,o=u=>{if(u&&(i=u),s){let d=s;s=null,d()}},a=()=>new Yh((u,d)=>{i?d(i):s=()=>{i?d(i):u()}});e.on("drain",o);let l=Cr(e,{readable:!1},o);try{e.writableNeedDrain&&await a();for await(let u of t)e.write(u)||await a();n&&(e.end(),await a()),r()}catch(u){r(i!==u?rp(i,u):u)}finally{l(),e.off("drain",o)}}async function bi(t,e,r,{end:n}){At(e)&&(e=e.writable);let i=e.getWriter();try{for await(let s of t)await i.ready,i.write(s).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(s){try{await i.abort(s),r(s)}catch(o){r(o)}}}function pp(...t){return Za(t,ep(cp(t)))}function Za(t,e,r){if(t.length===1&&Kh(t[0])&&(t=t[0]),t.length<2)throw new np("streams");let n=new dp,i=n.signal,s=r?.signal,o=[];lp(s,"options.signal");function a(){y(new op)}pi=pi||Q().addAbortListener;let l;s&&(l=pi(s,a));let u,d,f=[],b=0;function _(N){y(N,--b===0)}function y(N,S){var j;if(N&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=N),!(!u&&!S)){for(;f.length;)f.shift()(u);(j=l)===null||j===void 0||j[Xh](),n.abort(),S&&(u||o.forEach(me=>me()),Zt.nextTick(e,u,d))}}let g;for(let N=0;N0,J=j||r?.end!==!1,ke=N===t.length-1;if(Ka(S)){let W=function(ne){ne&&ne.name!=="AbortError"&&ne.code!=="ERR_STREAM_PREMATURE_CLOSE"&&_(ne)};var R=W;if(J){let{destroy:ne,cleanup:Nt}=Ya(S,j,me);f.push(ne),fi(S)&&ke&&o.push(Nt)}S.on("error",W),fi(S)&&ke&&o.push(()=>{S.removeListener("error",W)})}if(N===0)if(typeof S=="function"){if(g=S({signal:i}),!rt(g))throw new ui("Iterable, AsyncIterable or Stream","source",g)}else rt(S)||Or(S)||At(S)?g=S:g=Ja.from(S);else if(typeof S=="function"){if(At(g)){var m;g=_i((m=g)===null||m===void 0?void 0:m.readable)}else g=_i(g);if(g=S(g,{signal:i}),j){if(!rt(g,!0))throw new ui("AsyncIterable",`transform[${N-1}]`,g)}else{var w;ci||(ci=li());let W=new ci({objectMode:!0}),ne=(w=g)===null||w===void 0?void 0:w.then;if(typeof ne=="function")b++,ne.call(g,oe=>{d=oe,oe!=null&&W.write(oe),J&&W.end(),Zt.nextTick(_)},oe=>{W.destroy(oe),Zt.nextTick(_,oe)});else if(rt(g,!0))b++,Pr(g,W,_,{end:J});else if(di(g)||At(g)){let oe=g.readable||g;b++,Pr(oe,W,_,{end:J})}else throw new ui("AsyncIterable or Promise","destination",g);g=W;let{destroy:Nt,cleanup:kt}=Ya(g,!1,!0);f.push(Nt),ke&&o.push(kt)}}else if(Ka(S)){if(Or(g)){b+=2;let W=_p(g,S,_,{end:J});fi(S)&&ke&&o.push(W)}else if(At(g)||di(g)){let W=g.readable||g;b++,Pr(W,S,_,{end:J})}else if(rt(g))b++,Pr(g,S,_,{end:J});else throw new yi("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=S}else if(up(S)){if(Or(g))b++,bi(_i(g),S,_,{end:J});else if(di(g)||rt(g))b++,bi(g,S,_,{end:J});else if(At(g))b++,bi(g.readable,S,_,{end:J});else throw new yi("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=S}else g=Ja.from(S)}return(i!=null&&i.aborted||s!=null&&s.aborted)&&Zt.nextTick(a),g}function _p(t,e,r,{end:n}){let i=!1;if(e.on("close",()=>{i||r(new sp)}),t.pipe(e,{end:!1}),n){let o=function(){i=!0,e.end()};var s=o;fp(t)?Zt.nextTick(o):t.once("end",o)}else r();return Cr(t,{readable:!0,writable:!1},o=>{let a=t._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?t.once("end",r).once("error",r):r(o)}),Cr(e,{readable:!1,writable:!0},r)}Xa.exports={pipelineImpl:Za,pipeline:pp}});var wi=A((_b,sl)=>{"use strict";var{pipeline:bp}=Mr(),$r=ge(),{destroyer:yp}=Ze(),{isNodeStream:Dr,isReadable:el,isWritable:tl,isWebStream:gi,isTransformStream:nt,isWritableStream:rl,isReadableStream:nl}=_e(),{AbortError:gp,codes:{ERR_INVALID_ARG_VALUE:il,ERR_MISSING_ARGS:wp}}=V(),mp=Ie();sl.exports=function(...e){if(e.length===0)throw new wp("streams");if(e.length===1)return $r.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=$r.from(e[0])),typeof e[e.length-1]=="function"){let _=e.length-1;e[_]=$r.from(e[_])}for(let _=0;_0&&!(tl(e[_])||rl(e[_])||nt(e[_])))throw new il(`streams[${_}]`,r[_],"must be writable")}let n,i,s,o,a;function l(_){let y=o;o=null,y?y(_):_?a.destroy(_):!b&&!f&&a.destroy()}let u=e[0],d=bp(e,l),f=!!(tl(u)||rl(u)||nt(u)),b=!!(el(d)||nl(d)||nt(d));if(a=new $r({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:f,readable:b}),f){if(Dr(u))a._write=function(y,g,m){u.write(y,g)?m():n=m},a._final=function(y){u.end(),i=y},u.on("drain",function(){if(n){let y=n;n=null,y()}});else if(gi(u)){let g=(nt(u)?u.writable:u).getWriter();a._write=async function(m,w,R){try{await g.ready,g.write(m).catch(()=>{}),R()}catch(N){R(N)}},a._final=async function(m){try{await g.ready,g.close().catch(()=>{}),i=m}catch(w){m(w)}}}let _=nt(d)?d.readable:d;mp(_,()=>{if(i){let y=i;i=null,y()}})}if(b){if(Dr(d))d.on("readable",function(){if(s){let _=s;s=null,_()}}),d.on("end",function(){a.push(null)}),a._read=function(){for(;;){let _=d.read();if(_===null){s=a._read;return}if(!a.push(_))return}};else if(gi(d)){let y=(nt(d)?d.readable:d).getReader();a._read=async function(){for(;;)try{let{value:g,done:m}=await y.read();if(!a.push(g))return;if(m){a.push(null);return}}catch{return}}}}return a._destroy=function(_,y){!_&&o!==null&&(_=new gp),s=null,n=null,i=null,o===null?y(_):(o=y,Dr(d)&&yp(d,_))},a}});var _l=A((bb,Si)=>{"use strict";var xp=globalThis.AbortController||ct().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Sp,ERR_INVALID_ARG_TYPE:Xt,ERR_MISSING_ARGS:Ep,ERR_OUT_OF_RANGE:Rp},AbortError:we}=V(),{validateAbortSignal:it,validateInteger:ol,validateObject:st}=_t(),Ip=B().Symbol("kWeak"),Ap=B().Symbol("kResistStopPropagation"),{finished:Tp}=Ie(),Np=wi(),{addAbortSignalNoValidate:kp}=Wt(),{isWritable:Lp,isNodeStream:vp}=_e(),{deprecate:Bp}=Q(),{ArrayPrototypePush:Fp,Boolean:jp,MathFloor:al,Number:Pp,NumberIsNaN:Op,Promise:ll,PromiseReject:ul,PromiseResolve:Cp,PromisePrototypeThen:fl,Symbol:cl}=B(),qr=cl("kEmpty"),dl=cl("kEof");function Mp(t,e){if(e!=null&&st(e,"options"),e?.signal!=null&&it(e.signal,"options.signal"),vp(t)&&!Lp(t))throw new Sp("stream",t,"must be writable");let r=Np(this,t);return e!=null&&e.signal&&kp(e.signal,r),r}function Ur(t,e){if(typeof t!="function")throw new Xt("fn",["Function","AsyncFunction"],t);e!=null&&st(e,"options"),e?.signal!=null&&it(e.signal,"options.signal");let r=1;e?.concurrency!=null&&(r=al(e.concurrency));let n=r-1;return e?.highWaterMark!=null&&(n=al(e.highWaterMark)),ol(r,"options.concurrency",1),ol(n,"options.highWaterMark",0),n+=r,async function*(){let s=Q().AbortSignalAny([e?.signal].filter(jp)),o=this,a=[],l={signal:s},u,d,f=!1,b=0;function _(){f=!0,y()}function y(){b-=1,g()}function g(){d&&!f&&b=n||b>=r)&&await new ll(R=>{d=R})}a.push(dl)}catch(w){let R=ul(w);fl(R,y,_),a.push(R)}finally{f=!0,u&&(u(),u=null)}}m();try{for(;;){for(;a.length>0;){let w=await a[0];if(w===dl)return;if(s.aborted)throw new we;w!==qr&&(yield w),a.shift(),g()}await new ll(w=>{u=w})}}finally{f=!0,d&&(d(),d=null)}}.call(this)}function $p(t=void 0){return t!=null&&st(t,"options"),t?.signal!=null&&it(t.signal,"options.signal"),async function*(){let r=0;for await(let i of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new we({cause:t.signal.reason});yield[r++,i]}}.call(this)}async function hl(t,e=void 0){for await(let r of xi.call(this,t,e))return!0;return!1}async function Dp(t,e=void 0){if(typeof t!="function")throw new Xt("fn",["Function","AsyncFunction"],t);return!await hl.call(this,async(...r)=>!await t(...r),e)}async function qp(t,e){for await(let r of xi.call(this,t,e))return r}async function Up(t,e){if(typeof t!="function")throw new Xt("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i),qr}for await(let n of Ur.call(this,r,e));}function xi(t,e){if(typeof t!="function")throw new Xt("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i)?n:qr}return Ur.call(this,r,e)}var mi=class extends Ep{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function Wp(t,e,r){var n;if(typeof t!="function")throw new Xt("reducer",["Function","AsyncFunction"],t);r!=null&&st(r,"options"),r?.signal!=null&&it(r.signal,"options.signal");let i=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let u=new we(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await Tp(this.destroy(u)),u}let s=new xp,o=s.signal;if(r!=null&&r.signal){let u={once:!0,[Ip]:this,[Ap]:!0};r.signal.addEventListener("abort",()=>s.abort(),u)}let a=!1;try{for await(let u of this){var l;if(a=!0,r!=null&&(l=r.signal)!==null&&l!==void 0&&l.aborted)throw new we;i?e=await t(e,u,{signal:o}):(e=u,i=!0)}if(!a&&!i)throw new mi}finally{s.abort()}return e}async function Gp(t){t!=null&&st(t,"options"),t?.signal!=null&&it(t.signal,"options.signal");let e=[];for await(let n of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new we(void 0,{cause:t.signal.reason});Fp(e,n)}return e}function Hp(t,e){let r=Ur.call(this,t,e);return async function*(){for await(let i of r)yield*i}.call(this)}function pl(t){if(t=Pp(t),Op(t))return 0;if(t<0)throw new Rp("number",">= 0",t);return t}function Qp(t,e=void 0){return e!=null&&st(e,"options"),e?.signal!=null&&it(e.signal,"options.signal"),t=pl(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new we;for await(let s of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new we;t--<=0&&(yield s)}}.call(this)}function zp(t,e=void 0){return e!=null&&st(e,"options"),e?.signal!=null&&it(e.signal,"options.signal"),t=pl(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new we;for await(let s of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new we;if(t-- >0&&(yield s),t<=0)return}}.call(this)}Si.exports.streamReturningOperators={asIndexedPairs:Bp($p,"readable.asIndexedPairs will be removed in a future version."),drop:Qp,filter:xi,flatMap:Hp,map:Ur,take:zp,compose:Mp};Si.exports.promiseReturningOperators={every:Dp,forEach:Up,reduce:Wp,toArray:Gp,some:hl,find:qp}});var Ei=A((yb,bl)=>{"use strict";var{ArrayPrototypePop:Vp,Promise:Jp}=B(),{isIterable:Kp,isNodeStream:Yp,isWebStream:Zp}=_e(),{pipelineImpl:Xp}=Mr(),{finished:e_}=Ie();Ri();function t_(...t){return new Jp((e,r)=>{let n,i,s=t[t.length-1];if(s&&typeof s=="object"&&!Yp(s)&&!Kp(s)&&!Zp(s)){let o=Vp(t);n=o.signal,i=o.end}Xp(t,(o,a)=>{o?r(o):e(a)},{signal:n,end:i})})}bl.exports={finished:e_,pipeline:t_}});var Ri=A((gb,Il)=>{var{Buffer:r_}=Se(),{ObjectDefineProperty:Ne,ObjectKeys:wl,ReflectApply:ml}=B(),{promisify:{custom:xl}}=Q(),{streamReturningOperators:yl,promiseReturningOperators:gl}=_l(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Sl}}=V(),n_=wi(),{setDefaultHighWaterMark:i_,getDefaultHighWaterMark:s_}=Gt(),{pipeline:El}=Mr(),{destroyer:o_}=Ze(),Rl=Ie(),Ii=Ei(),er=_e(),L=Il.exports=xr().Stream;L.isDestroyed=er.isDestroyed;L.isDisturbed=er.isDisturbed;L.isErrored=er.isErrored;L.isReadable=er.isReadable;L.isWritable=er.isWritable;L.Readable=zt();for(let t of wl(yl)){let r=function(...n){if(new.target)throw Sl();return L.Readable.from(ml(e,this,n))};Ai=r;let e=yl[t];Ne(r,"name",{__proto__:null,value:e.name}),Ne(r,"length",{__proto__:null,value:e.length}),Ne(L.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var Ai;for(let t of wl(gl)){let r=function(...i){if(new.target)throw Sl();return ml(e,this,i)};Ai=r;let e=gl[t];Ne(r,"name",{__proto__:null,value:e.name}),Ne(r,"length",{__proto__:null,value:e.length}),Ne(L.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var Ai;L.Writable=jr();L.Duplex=ge();L.Transform=oi();L.PassThrough=li();L.pipeline=El;var{addAbortSignal:a_}=Wt();L.addAbortSignal=a_;L.finished=Rl;L.destroy=o_;L.compose=n_;L.setDefaultHighWaterMark=i_;L.getDefaultHighWaterMark=s_;Ne(L,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Ii}});Ne(El,xl,{__proto__:null,enumerable:!0,get(){return Ii.pipeline}});Ne(Rl,xl,{__proto__:null,enumerable:!0,get(){return Ii.finished}});L.Stream=L;L._isUint8Array=function(e){return e instanceof Uint8Array};L._uint8ArrayToBuffer=function(e){return r_.from(e.buffer,e.byteOffset,e.byteLength)}});var Wr=A((wb,C)=>{"use strict";var D=Ri(),l_=Ei(),u_=D.Readable.destroy;C.exports=D.Readable;C.exports._uint8ArrayToBuffer=D._uint8ArrayToBuffer;C.exports._isUint8Array=D._isUint8Array;C.exports.isDisturbed=D.isDisturbed;C.exports.isErrored=D.isErrored;C.exports.isReadable=D.isReadable;C.exports.Readable=D.Readable;C.exports.Writable=D.Writable;C.exports.Duplex=D.Duplex;C.exports.Transform=D.Transform;C.exports.PassThrough=D.PassThrough;C.exports.addAbortSignal=D.addAbortSignal;C.exports.finished=D.finished;C.exports.destroy=D.destroy;C.exports.destroy=u_;C.exports.pipeline=D.pipeline;C.exports.compose=D.compose;Object.defineProperty(D,"promises",{configurable:!0,enumerable:!0,get(){return l_}});C.exports.Stream=D.Stream;C.exports.default=C.exports});var Vr=JSON.stringify,Bi=(t,e=null,r="")=>{let n=new WeakMap,i="",s="";if(typeof r=="number"?i+=" ".repeat(r):typeof r=="string"&&(i=r),e&&typeof e!="function"&&(typeof e!="object"||typeof e.length!="number"))throw new Error("JSONTag.stringify");let o=u=>{let d=s;s+=i;let f="",b="",_=Object.keys(u);Array.isArray(e)&&(_=_.filter(g=>e.indexOf(g)!==-1)),s&&(f=` `+s,b=` `+d);let y=f+_.map(g=>'"'+g+'":'+l(g,u)).join(","+f)+b;return s=d,y},a=u=>{let d=s;s+=i;let f="",b="";s&&(f=` `+s,b=` -`+d);let _=f+u.map((y,g)=>l(g,u)).join(","+f)+b;return s=d,_},l=(u,d)=>{let f=d[u];if(typeof e=="function"&&u!==""&&(f=e.call(d,u,f)),typeof f=="object"&&n.has(f)){let b=Jr(f,"id");return b||(b=$l(f)),'"'+b+'"'}if(typeof f>"u"||f===null)return"null";if(typeof f=="object"&&n.set(f,!0),typeof f.toJSONTag=="function")return f.toJSONTag(n,e,r);if(Array.isArray(f))return ae(f)+"["+a(f)+"]";if(f instanceof Object)switch(le(f)){case"string":case"decimal":case"money":case"link":case"text":case"blob":case"color":case"email":case"hash":case"duration":case"phone":case"url":case"uuid":case"date":case"time":case"datetime":return ae(f)+Vr(""+f,e,r);case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":case"int64":case"uint64":case"float":case"float32":case"float64":case"timestamp":case"number":case"boolean":return ae(f)+Vr(f,e,r);case"array":let b=a(f);return ae(f)+"["+b+"}";case"object":if(f===null)return"null";let _=o(f);return ae(f)+"{"+_+"}";default:throw new Error(le(f)+" type not yet implemented")}else return Vr(f,e,r)};return l("",{"":t})};function $l(t){if(typeof crypto>"u")throw console.error("JSONTag: cannot generate uuid, crypto support is disabled."),new Error("Cannot create links to resolve references, crypto support is disabled");if(typeof crypto.randomUUID=="function")var e=crypto.randomUUID();else var e=("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16));return Lt(t,"id",e),e}var Fi=t=>t===null||typeof t.isNull<"u"&&t.isNull;globalThis.JSONTagTypeInfo||(globalThis.JSONTagTypeInfo=new WeakMap);var Z=globalThis.JSONTagTypeInfo,le=t=>{if(Z.has(t)){let e=Z.get(t);if(e.type)return e.type}return Array.isArray(t)?"array":typeof t},Dl=["object","array","string","number","boolean","decimal","money","uuid","url","link","date","time","datetime","duration","timestamp","text","blob","color","email","hash","phone","int","int8","int16","int32","int64","uint","uint8","uint16","uint32","uint64","float","float32","float64"],$e=(t,e)=>{if(typeof t!="object")throw new TypeError("JSONTag can only add attributes to objects, convert literals to objects first");let r={};if(Z.has(t)&&(r=Z.get(t)),!Dl.includes(e))throw new TypeError("unknown type "+e);r.type=e,typeof r.attributes>"u"&&(r.attributes={}),Z.set(t,r)},Lt=(t,e,r)=>{if(typeof t!="object")throw new TypeError("JSONTag can only add attributes to objects, convert literals to objects first");if(Array.isArray(r)&&(r=r.join(" ")),typeof r!="string")throw new TypeError("attribute values must be a string or an array of strings");if(r.indexOf('"')!==-1)throw new TypeError('attribute values must not contain " character');r.indexOf(" ")!==-1&&(r=r.split(" "));let n=Z.get(t)||{attributes:{}};n.attributes[e]=r,Z.set(t,n)},vt=(t,e)=>{if(typeof t!="object")throw new TypeError("JSONTag can only add attributes to objects, convert literals to objects first");if(typeof e!="object")throw new TypeError("attributes param must be an object");Object.keys(e).forEach(r=>{Lt(t,r,e[r])})},Jr=(t,e)=>(Z.get(t)||{attributes:{}}).attributes[e],ji=(t,e,r)=>{if(typeof r!="string")throw new TypeError("attribute values must be a string");if(r.indexOf('"')!==-1)throw new TypeError('attribute values must not contain " characters');let n=Z.get(t)||{attributes:{}};typeof n.attributes[e]>"u"?Lt(t,e,r):(Array.isArray(n.attributes[e])||(n.attributes[e]=[n.attributes[e]]),r.indexOf(" ")!==-1?r=r.split(" "):r=[r],n.attributes[e]=n.attributes[e].concat(r),Z.set(t,n))},Pi=(t,e)=>{let r=Z.get(t)||{attributes:{}};typeof r.attributes[e]<"u"&&(delete r.attributes[e],Z.set(t,r))},Bt=t=>{let e=Z.get(t)||{attributes:{}};return Object.assign({},e.attributes)},ir=t=>Object.entries(Bt(t)).map(([e,r])=>(Array.isArray(r)&&(r=r.join(" ")),e+'="'+r+'"')).join(" "),ae=t=>{let e=le(t),r=Bt(t),n=Object.entries(r).map(([i,s])=>(Array.isArray(s)&&(s=s.join(" ")),i+'="'+s+'"')).join(" ");return n||["object","array","string","number","boolean"].indexOf(e)!==-1&&(e=""),e||n?"<"+[e,n].filter(Boolean).join(" ")+">":""};function ql(t){return t instanceof Number?new Number(t):t instanceof Boolean?new Boolean(t):t instanceof String?new String(t):Array.isArray(t)?[...t]:{...t}}var Oi=t=>{let e=ae(t),r=le(t),n=Bt(t),i=ql(t);return e&&($e(i,r),n&&vt(i,n)),i};var Ft=class t{#e;constructor(e){if(typeof e!="string")throw new Error("not a url:",e);this.#e=""+e,$e(this,"link")}static from(e){if(e instanceof t)return e;if(typeof e!="string")throw new Error("not a url:",e);return new t(e)}get value(){return this.#e}toString(){return this.#e}toJSON(){return'"'+this.#e+'"'}toJSONTag(){let e=ir(this);return""+this.toJSON()}};var Kr=class{constructor(){return new Proxy(this,{get:(e,r)=>{if(typeof e[r]<"u")return e[r];if(r!="then")throw console.error("Attempting to get from Null",r,typeof r,JSON.stringify(r)),new Error("Attempting to get "+r+" from Null")},set:(e,r,n)=>{throw console.error("Attempting to set "+r+" in Null to",n),new Error("Attempting to set "+r+" in Null")}})}},De=class extends Kr{isNull=!0;toString(){return""}toJSON(){return"null"}toJSONTag(){return ae(this)+this.toJSON()}};function Yr(t,e,r){r||(r={}),r.index||(r.index={}),r.index.id||(r.index.id=new Map),r.unresolved||(r.unresolved=new Map),r.baseURL||(r.baseURL="http://localhost/");let n,i,s,o,a={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:` -`,r:"\r",t:" "},l=function(p){let c=t.substring(n-100,n+100);throw{name:"SyntaxError",message:p,at:n,input:c}},u=function(p){return p&&p!==i&&l("Expected '"+p+"' instead of '"+i+"'"),i=t.charAt(n),n+=1,i},d=function(p){let c="";for(i==="-"&&(c="-",u("-"));i>="0"&&i<="9";)c+=i,u();if(i===".")for(c+=".";u()&&i>="0"&&i<="9";)c+=i;if(i==="e"||i==="E")for(c+=i,u(),(i==="-"||i==="+")&&(c+=i,u());i>="0"&&i<="9";)c+=i,u();let x=new Number(c).valueOf();if(p)switch(p){case"int":y(c);break;case"uint":y(c,[0,1/0]);break;case"int8":y(c,[-128,127]);break;case"uint8":y(c,[0,255]);break;case"int16":y(c,[-32768,32767]);break;case"uint16":y(c,[0,65535]);break;case"int32":y(c,[-2147483648,2147483647]);break;case"uint32":y(c,[0,4294967295]);break;case"timestamp":case"int64":y(c,[-9223372036854776e3,9223372036854776e3]);break;case"uint64":y(c,[0,18446744073709552e3]);break;case"float":_(c);break;case"float32":_(c,[-34e37,34e37]);break;case"float64":_(c,[-17e307,17e307]);break;case"number":break;default:f(p,c);break}return x},f=function(p,c){l("Syntax error, expected "+p+", got: "+c)},b={color:/^(rgb|hsl)a?\((\d+%?(deg|rad|grad|turn)?[,\s]+){2,3}[\s\/]*[\d\.]+%?\)$/i,email:/^[A-Za-z0-9_!#$%&'*+\/=?`{|}~^.-]+@[A-Za-z0-9.-]+$/,uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,decimal:/^\d*\.?\d*$/,money:/^[A-Z]+\$\d*\.?\d*$/,duration:/^(-?)P(?=\d|T\d)(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)([DW]))?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?)?$/,phone:/^[+]?(?:\(\d+(?:\.\d+)?\)|\d+(?:\.\d+)?)(?:[ -]?(?:\(\d+(?:\.\d+)?\)|\d+(?:\.\d+)?))*(?:[ ]?(?:x|ext)\.?[ ]?\d{1,5})?$/,time:/^(\d{2}):(\d{2})(?::(\d{2}(?:\.\d+)?))?$/,date:/^-?[1-9][0-9]{3,}-([0][1-9]|[1][0-2])-([1-2][0-9]|[0][1-9]|[3][0-1])$/,datetime:/^(\d{4,})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2}(?:\.\d+)?))?Z?$/,range:/^\[-?(\d+\.)?\d+\,-?(\d+\.)?\d+\]$/},_=function(p,c){let x=new Number(parseFloat(p)),k=x.toString();p!==k&&l("Syntax Error: expected float value"),c&&(typeof c[0]=="number"&&xc[1]&&l("Syntax Error: float value out of range"))},y=function(p,c){let x=new Number(parseInt(p)),k=x.toString();p!==k&&l("Syntax Error: expected integer value"),c&&(typeof c[0]=="number"&&xc[1]&&l("Syntax Error: integer value out of range"))},g=function(p){let c=!1;return p.charAt(0)==="#"?(p=p.substring(1),c=[3,4,6,8].indexOf(p.length)>-1&&!isNaN(parseInt(p,16)),c.toString(16)!==p&&f("color",p)):c=b.color.test(p),c||f("color",p),!0},m=function(p){return b.email.test(p)||f("email",p),!0},w=function(p){return b.uuid.test(p)||f("uuid",p),!0},R=function(p){return b.decimal.test(p)||f("decimal",p),!0},N=function(p){return b.money.test(p)||f("money",p),!0},S=function(p){try{return!!new URL(p,r.baseURL)}catch(c){console.log(c),f("url",p)}},j=function(p){return b.duration.test(p)||f("duration",p),!0},me=function(p){return b.phone.test(p)||f("phone",p),!0},J=function(p){return b.range.test(p)||f("range",p),!0},Le=function(p){return b.time.test(p)||f("time",p),!0},W=function(p){return b.date.test(p)||f("date",p),!0},ne=function(p){return b.datetime.test(p)||f("datetime",p),!0},Nt=function(p,c){if(p){switch(p){case"object":case"array":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":case"int64":case"uint64":case"int":case"uint":case"float32":case"float64":case"float":case"timestamp":f(p,c);break;case"uuid":return w(c);case"decimal":return R(c);case"money":return N(c);case"url":return S(c);case"link":case"string":case"text":case"blob":case"hash":return!0;case"color":return g(c);case"email":return m(c);case"duration":return j(c);case"phone":return me(c);case"range":return J(c);case"time":return Le(c);case"date":return W(c);case"datetime":return ne(c)}l("Syntax error: unknown tagName "+p)}},kt=function(p){let c="",x,k,M;for(i!=='"'&&l("Syntax Error"),u('"');i;){if(i==='"')return u(),Nt(p,c),c;if(i==="\\")if(u(),i==="u"){for(M=0,k=0;k<4&&(x=parseInt(u(),16),!!isFinite(x));k++)M=M*16+x;c+=String.fromCharCode(M),u()}else if(typeof a[i]=="string")c+=a[i],u();else break;else c+=i,u()}l("Syntax error: incomplete string")},oe=function(){let p,c,x={attributes:{}};for(i!=="<"&&l("Syntax Error"),u("<"),p=Hr(),p||l("Syntax Error: expected tag name"),x.tagName=p,K();i;){if(i===">")return u(">"),x;p=Hr(),p||l("Syntax Error: expected attribute name"),K(),u("="),K(),c=kt(),x.attributes[p]=c,K()}l("Syntax Error: unexpected end of input")},K=function(){for(;i;)switch(i){case" ":case" ":case"\r":case` -`:u();break;default:return}},Hr=function(){let p="";for(i>="a"&&i<="z"||i>="A"&&i<="Z"?(p+=i,u()):l("Syntax Error: expected word");i>="a"&&i<="z"||i>="A"&&i<="Z"||i>="0"&&i<="9"||i=="_";)p+=i,u();return p},kl=function(p){let c=Hr();switch((!c||typeof c!="string")&&l('Syntax error: expected boolean or null, got "'+c+'"'),c.toLowerCase()){case"true":return p&&p!=="boolean"&&f(p,c),!0;break;case"false":return p&&p!=="boolean"&&f(p,c),!1;break;case"null":return null;default:l('Syntax error: expected boolean or null, got "'+c+'"');break}},Qr=function(p,c,x){if(le(p)==="link"){let k=""+p,M=r.unresolved.get(k);typeof M>"u"&&(r.unresolved.set(k,[]),M=r.unresolved.get(k));let G=M.push({src:new WeakRef(c),key:x})}},Ll=function(){let p,c=[];if(i!=="["&&l("Syntax error"),u("["),K(),i==="]")return u("]"),c;for(;i;){if(p=s(),Qr(p,c,c.length),c.push(p),K(),i==="]")return u("]"),c;u(","),K()}l("Input stopped early")},vl=function(){let p,c,x={};if(i!=="{"&&l("Syntax Error"),u("{"),K(),i==="}")return u("}"),x;for(;i;){if(p=kt(),p==="__proto__"&&l("Attempt at prototype pollution"),K(),u(":"),c=s(),x[p]=c,Qr(c,x,p),K(),i==="}")return u("}"),x;u(","),K()}l("Input stopped early")};if(s=function(){let p,c,x;switch(K(),i==="<"&&(p=oe(),x=p.tagName,K()),i){case"{":x&&x!=="object"&&f(x,i),c=vl();break;case"[":x&&x!=="array"&&f(x,i),c=Ll();break;case'"':c=kt(x);break;case"-":c=d(x);break;default:i>="0"&&i<="9"?c=d(x):c=kl(x);break}if(p){if(c===null&&(c=new De),typeof c!="object")switch(typeof c){case"string":c=new String(c);break;case"number":c=new Number(c);break;default:l("Syntax Error: unexpected type "+typeof c);break}p.tagName&&$e(c,p.tagName),p.attributes&&(vt(c,p.attributes),p.attributes?.id&&r.index.id.set(p.attributes.id,new WeakRef(c)))}return c},n=0,i=" ",o=s(),K(),i&&l("Syntax error"),typeof e=="function"){let p=function(c,x){var k,M,G=c[x];if(G!==null&&typeof G=="object"&&!(G instanceof String||G instanceof Number||G instanceof Boolean))for(k in G)Object.prototype.hasOwnProperty.call(G,k)&&(M=p(G,k),M!==void 0&&(typeof G[k]>"u"||G[k]!==M)?(G[k]=M,le(M)==="link"&&Qr(M,G,k)):M===void 0&&delete G[k]);return e.call(c,x,G,r)};p({"":o},"")}let vi=function(p,c){if(typeof c<"u"){let x=p.src.deref();if(typeof x<"u"&&le(x[p.key])==="link")return x[p.key]=c,!0}};return r.index.id.size>r.unresolved.size?r.unresolved.forEach((p,c)=>{let x=r.index.id.get(c)?.deref();x!==void 0&&p.forEach((k,M)=>{vi(k,x)&&delete p[M]})}):r.index.id.forEach((p,c)=>{let x=p.deref(),k=r.unresolved.get(c);x!==void 0&&typeof k<"u"&&(k.forEach((M,G)=>{vi(M,x)}),r.unresolved.delete(c))}),o}var v=class t{static{t.stringify=Bi,t.parse=Yr,t.getType=le,t.setType=$e,t.getTypeString=ae,t.setAttribute=Lt,t.getAttribute=Jr,t.addAttribute=ji,t.removeAttribute=Pi,t.getAttributes=Bt,t.setAttributes=vt,t.getAttributesString=ir,t.isNull=Fi,t.clone=Oi,t.Link=Ft,t.Null=De}};var jt="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Pt="http://www.w3.org/2001/XMLSchema#",Zr="http://www.w3.org/2000/10/swap/",P={xsd:{decimal:`${Pt}decimal`,boolean:`${Pt}boolean`,double:`${Pt}double`,integer:`${Pt}integer`,string:`${Pt}string`},rdf:{type:`${jt}type`,nil:`${jt}nil`,first:`${jt}first`,rest:`${jt}rest`,langString:`${jt}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${Zr}reify#forSome`,forAll:`${Zr}reify#forAll`},log:{implies:`${Zr}log#implies`}};var Ui=nr(Di()),{xsd:sr}=P,Ul=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,qi={"\\":"\\","'":"'",'"':'"',n:` -`,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Wl=/[\x00-\x20<>\\"\{\}\|\^\`]/,Gl={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},Hl=/$0^/,qe=class{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._lineMode=!!e.lineMode){this._n3Mode=!1;for(let r in this)!(r in Gl)&&this[r]instanceof RegExp&&(this[r]=Hl)}else this._n3Mode=e.n3!==!1;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,r){let n=this._input,i=n.length;for(;;){let a,l;for(;a=this._newline.exec(n);)this._comments&&(l=this._comment.exec(a[0]))&&s("comment",l[1],"",this._line,a[0].length),n=n.substr(a[0].length,n.length),i=n.length,this._line++;if(!a&&(a=this._whitespace.exec(n))&&(n=n.substr(a[0].length,n.length)),this._endOfFile.test(n))return r&&(this._comments&&(l=this._comment.exec(n))&&s("comment",l[1],"",this._line,n.length),n=null,s("eof","","",this._line,0)),this._input=n;let u=this._line,d=n[0],f="",b="",_="",y=null,g=0,m=!1;switch(d){case"^":if(n.length<3)break;if(n[1]==="^"){if(this._previousMarker="^^",n=n.substr(2),n[0]!=="<"){m=!0;break}}else{this._n3Mode&&(g=1,f="^");break}case"<":if(y=this._unescapedIri.exec(n))f="IRI",b=y[1];else if(y=this._iri.exec(n)){if(b=this._unescape(y[1]),b===null||Wl.test(b))return o(this);f="IRI"}else n.length>1&&n[1]==="<"?(f="<<",g=2):this._n3Mode&&n.length>1&&n[1]==="="&&(f="inverse",g=2,b=">");break;case">":n.length>1&&n[1]===">"&&(f=">>",g=2);break;case"_":((y=this._blank.exec(n))||r&&(y=this._blank.exec(`${n} `)))&&(f="blank",_="_",b=y[1]);break;case'"':if(y=this._simpleQuotedString.exec(n))b=y[1];else if({value:b,matchLength:g}=this._parseLiteral(n),b===null)return o(this);(y!==null||g!==0)&&(f="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(y=this._simpleApostropheString.exec(n))b=y[1];else if({value:b,matchLength:g}=this._parseLiteral(n),b===null)return o(this);(y!==null||g!==0)&&(f="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(y=this._variable.exec(n))&&(f="var",b=y[0]);break;case"@":this._previousMarker==="literal"&&(y=this._langcode.exec(n))?(f="langcode",b=y[1]):(y=this._keyword.exec(n))&&(f=y[0]);break;case".":if(n.length===1?r:n[1]<"0"||n[1]>"9"){f=".",g=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(y=this._number.exec(n)||r&&(y=this._number.exec(`${n} `)))&&(f="literal",b=y[0],_=typeof y[1]=="string"?sr.double:typeof y[2]=="string"?sr.decimal:sr.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(y=this._sparqlKeyword.exec(n))?f=y[0].toUpperCase():m=!0;break;case"f":case"t":(y=this._boolean.exec(n))?(f="literal",b=y[0],_=sr.boolean):m=!0;break;case"a":(y=this._shortPredicates.exec(n))?(f="abbreviation",b="a"):m=!0;break;case"=":this._n3Mode&&n.length>1&&(f="abbreviation",n[1]!==">"?(g=1,b="="):(g=2,b=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(g=1,f=d);break;case"{":!this._lineMode&&n.length>=2&&(n[1]==="|"?(f="{|",g=2):(f=d,g=1));break;case"|":n.length>=2&&n[1]==="}"&&(f="|}",g=2);break;default:m=!0}if(m&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(y=this._prefix.exec(n))?(f="prefix",b=y[1]||""):((y=this._prefixed.exec(n))||r&&(y=this._prefixed.exec(`${n} `)))&&(f="prefixed",_=y[1]||"",b=this._unescape(y[2]))),this._previousMarker==="^^")switch(f){case"prefixed":f="type";break;case"IRI":f="typeIRI";break;default:f=""}if(!f)return r||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?o(this):this._input=n;let w=g||y[0].length,R=s(f,b,_,u,w);this.previousToken=R,this._previousMarker=f,n=n.substr(w,n.length)}function s(a,l,u,d,f){let b=n?i-n.length:i,_=b+f,y={type:a,value:l,prefix:u,line:d,start:b,end:_};return e(null,y),y}function o(a){e(a._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let r=!1,n=e.replace(Ul,(i,s,o,a)=>{if(typeof s=="string")return String.fromCharCode(Number.parseInt(s,16));if(typeof o=="string"){let l=Number.parseInt(o,16);return l<=65535?String.fromCharCode(Number.parseInt(o,16)):String.fromCharCode(55296+((l-=65536)>>10),56320+(l&1023))}return a in qi?qi[a]:(r=!0,"")});return r?null:n}_parseLiteral(e){if(e.length>=3){let r=e.match(/^(?:"""|"|'''|'|)/)[0],n=r.length,i=Math.max(this._literalClosingPos,n);for(;(i=e.indexOf(r,i))>0;){let s=0;for(;e[i-s-1]==="\\";)s++;if(s%2===0){let o=e.substring(n,i),a=o.split(/\r\n|\r|\n/).length-1,l=i+n;if(n===1&&a!==0||n===3&&this._lineMode)break;return this._line+=a,{value:this._unescape(o),matchLength:l}}i++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;let r=new Error(`Unexpected "${e}" on line ${this._line}.`);return r.context={token:void 0,line:this._line,previousToken:this.previousToken},r}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,r){if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof r=="function")(0,Ui.default)(()=>this._tokenizeToEnd(r,!0));else{let n=[],i;if(this._tokenizeToEnd((s,o)=>s?i=s:n.push(o),!0),i)throw i;return n}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",n=>{this._input!==null&&n.length!==0&&(this._pendingBuffer&&(n=Buffer.concat([this._pendingBuffer,n]),this._pendingBuffer=null),n[n.length-1]&128?this._pendingBuffer=n:(typeof this._input>"u"?this._input=this._readStartingBom(typeof n=="string"?n:n.toString()):this._input+=n,this._tokenizeToEnd(r,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(r,!0)}),e.on("error",r)}};var Xr={};Cl(Xr,{inDefaultGraph:()=>Kl,isBlankNode:()=>zl,isDefaultGraph:()=>xe,isLiteral:()=>Vl,isNamedNode:()=>Ql,isVariable:()=>Jl,prefix:()=>Yl,prefixes:()=>Wi});function Ql(t){return!!t&&t.termType==="NamedNode"}function zl(t){return!!t&&t.termType==="BlankNode"}function Vl(t){return!!t&&t.termType==="Literal"}function Jl(t){return!!t&&t.termType==="Variable"}function xe(t){return!!t&&t.termType==="DefaultGraph"}function Kl(t){return xe(t.graph)}function Yl(t,e){return Wi({"":t.value||t},e)("")}function Wi(t,e){let r=Object.create(null);for(let i in t)n(i,t[i]);e=e||ue;function n(i,s){if(typeof s=="string"){let o=Object.create(null);r[i]=a=>o[a]||(o[a]=e.namedNode(s+a))}else if(!(i in r))throw new Error(`Unknown prefix: ${i}`);return r[i]}return n}var{rdf:Zl,xsd:Ue}=P,$t,Xl=0;var en={namedNode:eu,blankNode:tu,variable:nu,literal:ru,defaultGraph:iu,quad:Gi,triple:Gi},ue=en,X=class t{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof t?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}},ot=class extends X{get termType(){return"NamedNode"}},Be=class t extends X{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){let e=this.id,r=e.lastIndexOf('"')+1;return r0?"INF":"-INF")))),r===""||r===Ue.string?new Be(`"${t}"`):new Be(`"${t}"^^${r}`)}function nu(t){return new Ct(t)}function iu(){return $t}function Gi(t,e,r,n){return new We(t,e,r,n)}var Hi=0,Fe=class{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&Qi(this,e.factory);let r=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(r),i=/trig/.test(r),s=/triple/.test(r),o=/quad/.test(r),a=this._n3Mode=/n3/.test(r),l=s||o;(this._supportsNamedGraphs=!(n||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||i||s||a),this._supportsRDFStar=r===""||/star|\*$/.test(r),l&&(this._resolveRelativeIRI=u=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new qe({lineMode:l,n3:a}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Hi=0}_setBase(e){if(!e)this._base="",this._basePath="";else{let r=e.indexOf("#");r>=0&&(e=e.substr(0,r)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}}_saveContext(e,r,n,i,s){let o=this._n3Mode;this._contextStack.push({type:e,subject:n,predicate:i,object:s,graph:r,inverse:o?this._inversePredicate:!1,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,r){let n=this._contextStack.pop();if(!n||n.type!==e)return this._error(`Unexpected ${r.type}`,r);this._subject=n.subject,this._predicate=n.predicate,this._object=n.object,this._graph=n.graph,this._n3Mode&&(this._inversePredicate=n.inverse,this._prefixes._=n.blankPrefix,this._quantified=n.quantified)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,r){let n;switch(e.type){case"IRI":case"typeIRI":let i=this._resolveIRI(e.value);if(i===null)return this._error("Invalid IRI",e);n=this._namedNode(i);break;case"type":case"prefixed":let s=this._prefixes[e.prefix];if(s===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);n=this._namedNode(s+e.value);break;case"blank":n=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!r&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){let r=e.type;switch(r){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return this._predicate===null?this._error(`Unexpected ${r}`,e):(this._subject=null,r==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if((this._object=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return e.type==="{"?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return e.type!=="{"?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return e.type==="]"?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);let r=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:r?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let r=null,n=null,i=this._readListItem,s=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=r=this._blankNode()),i=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),o.length!==0&&o[o.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(i=this._readPredicate,this._subject===this.RDF_NIL)return i}else if(i=this._getContextEndReader(),this._object===this.RDF_NIL)return i;n=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,i=this._readListItemDataTypeOrLang):(r=this._literal(e.value,this._namedNode(e.prefix)),i=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if((r=this._readEntity(e))===void 0)return}if(n===null&&(this._subject=n=this._blankNode()),s===null?a.predicate===null?a.subject=n:a.object=n:this._emit(s,this.RDF_REST,n,this._graph),r!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,n,this.RDF_FIRST,r),this._subject=r,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,r,this._graph)}return i}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let r=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":let n=this._readEntity(e);if(n===void 0)return;r=this._literal(this._literalValue,n),e=null;break;case"langcode":r=this._literal(this._literalValue,e.value),e=null;break}return{token:e,literal:r}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,r){let n=this._completeLiteral(e);if(n)return this._object=n.literal,r&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),n.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let r,n=this._graph,i=this._subject,s=this._inversePredicate;switch(e.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,r=this._contextStack.length?this._readSubject:this._readInTopContext,s&&(this._inversePredicate=!1);break;case";":r=this._readPredicate;break;case",":r=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF* syntax",e);let o=this._predicate,a=this._object;this._subject=this._quad(i,o,a,this.DEFAULTGRAPH),r=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",e);this._subject=null,r=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(n=this._readEntity(e))!==void 0){r=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(i!==null){let o=this._predicate,a=this._object;s?this._emit(a,o,i,n):this._emit(i,o,a,n)}return r}_readBlankNodePunctuation(e){let r;switch(e.type){case";":r=this._readPredicate;break;case",":r=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),r}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);let r=this._readEntity(e);return this._prefixes[this._prefix]=r.value,this._prefixCallback(this._prefix,r),this._readDeclarationPunctuation}_readBaseIRI(e){let r=e.type==="IRI"&&this._resolveIRI(e.value);return r?(this._setBase(r),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return e.type!=="]"?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let r;switch(e.type){case"IRI":case"prefixed":if((r=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,r,this.QUANTIFIERS_GRAPH)):this._quantified[r.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return e.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:let r=this._contextStack,n=r.length&&r[r.length-1];if(n&&n.type==="item"){let i=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,i,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let r,n,i=this._blankNode();if((n=this._readEntity(e))!==void 0)return this._predicate===null?(r=this._subject,this._subject=i):(r=this._object,this._object=i),this._emit(r,n,i,this._graph),this._readPath}_readBackwardPath(e){let r=this._blankNode(),n,i;if((n=this._readEntity(e))!==void 0)return this._predicate===null?(i=this._subject,this._subject=r):(i=this._object,this._object=r),this._emit(r,n,i,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);let r=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=r,this._readPredicate):(this._object=r,this._getContextEndReader())}_getContextEndReader(){let e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,r,n,i){this._callback(null,this._quad(e,r,n,i||this.DEFAULTGRAPH))}_error(e,r){let n=new Error(`${e} on line ${r.line}.`);n.context={token:r,line:r.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=tn}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return(e[1]==="/"?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;let r=e.length,n="",i=-1,s=-1,o=0,a="/";for(;i=s&&(n=n.substr(0,o)),a!=="/")return`${n}/${e.substr(i+1)}`;o=i+1}}}a=e[++i]}return n+e.substring(o)}parse(e,r,n){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Hi++}_`,this._prefixCallback=n||tn,this._inversePredicate=!1,this._quantified=Object.create(null),!r){let i=[],s;if(this._callback=(o,a)=>{o?s=o:a&&i.push(a)},this._lexer.tokenize(e).every(o=>this._readCallback=this._readCallback(o)),s)throw s;return i}this._callback=r,this._lexer.tokenize(e,(i,s)=>{i!==null?(this._callback(i),this._callback=tn):this._readCallback&&(this._readCallback=this._readCallback(s))})}};function tn(){}function Qi(t,e){let r=e.namedNode;t._namedNode=r,t._blankNode=e.blankNode,t._literal=e.literal,t._variable=e.variable,t._quad=e.quad,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=r(P.rdf.first),t.RDF_REST=r(P.rdf.rest),t.RDF_NIL=r(P.rdf.nil),t.N3_FORALL=r(P.r.forAll),t.N3_FORSOME=r(P.r.forSome),t.ABBREVIATIONS={a:r(P.rdf.type),"=":r(P.owl.sameAs),">":r(P.log.implies)},t.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}Qi(Fe.prototype,ue);var Dt=ue.defaultGraph(),{rdf:su,xsd:at}=P,zi=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,Vi=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,ou={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"},Ge=class extends X{equals(e){return e===this}},He=class{constructor(e,r){if(this._prefixRegex=/$0^/,e&&typeof e.write!="function"&&(r=e,e=null),r=r||{},this._lists=r.lists,e)this._outputStream=e,this._endStream=r.end===void 0?!0:!!r.end;else{let n="";this._outputStream={write(i,s,o){n+=i,o&&o()},end:i=>{i&&i(null,n)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(r.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=Dt,this._prefixIRIs=Object.create(null),r.prefixes&&this.addPrefixes(r.prefixes),r.baseIRI&&(this._baseMatcher=new RegExp(`^${Ki(r.baseIRI)}${r.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=r.baseIRI.length))}get _inDefaultGraph(){return Dt.equals(this._graph)}_write(e,r){this._outputStream.write(e,"utf8",r)}_writeQuad(e,r,n,i,s){try{i.equals(this._graph)||(this._write((this._subject===null?"":this._inDefaultGraph?`. +`+d);let _=f+u.map((y,g)=>l(g,u)).join(","+f)+b;return s=d,_},l=(u,d)=>{let f=d[u];if(typeof e=="function"&&u!==""&&(f=e.call(d,u,f)),typeof f=="object"&&n.has(f)){let b=Jr(f,"id");return b||(b=$l(f)),'"'+b+'"'}if(typeof f>"u"||f===null)return"null";if(typeof f=="object"&&n.set(f,!0),typeof f.toJSONTag=="function")return f.toJSONTag(n,e,r);if(Array.isArray(f))return ae(f)+"["+a(f)+"]";if(f instanceof Object)switch(le(f)){case"string":case"decimal":case"money":case"link":case"text":case"blob":case"color":case"email":case"hash":case"duration":case"phone":case"url":case"uuid":case"date":case"time":case"datetime":return ae(f)+Vr(""+f,e,r);case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":case"int64":case"uint64":case"float":case"float32":case"float64":case"timestamp":case"number":case"boolean":return ae(f)+Vr(f,e,r);case"array":let b=a(f);return ae(f)+"["+b+"}";case"object":if(f===null)return"null";let _=o(f);return ae(f)+"{"+_+"}";default:throw new Error(le(f)+" type not yet implemented")}else return Vr(f,e,r)};return l("",{"":t})};function $l(t){if(typeof crypto>"u")throw console.error("JSONTag: cannot generate uuid, crypto support is disabled."),new Error("Cannot create links to resolve references, crypto support is disabled");if(typeof crypto.randomUUID=="function")var e=crypto.randomUUID();else var e=("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16));return Lt(t,"id",e),e}var Fi=t=>t===null||typeof t.isNull<"u"&&t.isNull;globalThis.JSONTagTypeInfo||(globalThis.JSONTagTypeInfo=new WeakMap);var Z=globalThis.JSONTagTypeInfo,le=t=>{if(Z.has(t)){let e=Z.get(t);if(e.type)return e.type}return Array.isArray(t)?"array":typeof t},Dl=["object","array","string","number","boolean","decimal","money","uuid","url","link","date","time","datetime","duration","timestamp","text","blob","color","email","hash","phone","int","int8","int16","int32","int64","uint","uint8","uint16","uint32","uint64","float","float32","float64"],Me=(t,e)=>{if(typeof t!="object")throw new TypeError("JSONTag can only add attributes to objects, convert literals to objects first");let r={};if(Z.has(t)&&(r=Z.get(t)),!Dl.includes(e))throw new TypeError("unknown type "+e);r.type=e,typeof r.attributes>"u"&&(r.attributes={}),Z.set(t,r)},Lt=(t,e,r)=>{if(typeof t!="object")throw new TypeError("JSONTag can only add attributes to objects, convert literals to objects first");if(Array.isArray(r)&&(r=r.join(" ")),typeof r!="string")throw new TypeError("attribute values must be a string or an array of strings");if(r.indexOf('"')!==-1)throw new TypeError('attribute values must not contain " character');r.indexOf(" ")!==-1&&(r=r.split(" "));let n=Z.get(t)||{attributes:{}};n.attributes[e]=r,Z.set(t,n)},vt=(t,e)=>{if(typeof t!="object")throw new TypeError("JSONTag can only add attributes to objects, convert literals to objects first");if(typeof e!="object")throw new TypeError("attributes param must be an object");Object.keys(e).forEach(r=>{Lt(t,r,e[r])})},Jr=(t,e)=>(Z.get(t)||{attributes:{}}).attributes[e],ji=(t,e,r)=>{if(typeof r!="string")throw new TypeError("attribute values must be a string");if(r.indexOf('"')!==-1)throw new TypeError('attribute values must not contain " characters');let n=Z.get(t)||{attributes:{}};typeof n.attributes[e]>"u"?Lt(t,e,r):(Array.isArray(n.attributes[e])||(n.attributes[e]=[n.attributes[e]]),r.indexOf(" ")!==-1?r=r.split(" "):r=[r],n.attributes[e]=n.attributes[e].concat(r),Z.set(t,n))},Pi=(t,e)=>{let r=Z.get(t)||{attributes:{}};typeof r.attributes[e]<"u"&&(delete r.attributes[e],Z.set(t,r))},Bt=t=>{let e=Z.get(t)||{attributes:{}};return Object.assign({},e.attributes)},ir=t=>Object.entries(Bt(t)).map(([e,r])=>(Array.isArray(r)&&(r=r.join(" ")),e+'="'+r+'"')).join(" "),ae=t=>{let e=le(t),r=Bt(t),n=Object.entries(r).map(([i,s])=>(Array.isArray(s)&&(s=s.join(" ")),i+'="'+s+'"')).join(" ");return n||["object","array","string","number","boolean"].indexOf(e)!==-1&&(e=""),e||n?"<"+[e,n].filter(Boolean).join(" ")+">":""};function ql(t){return t instanceof Number?new Number(t):t instanceof Boolean?new Boolean(t):t instanceof String?new String(t):Array.isArray(t)?[...t]:{...t}}var Oi=t=>{let e=ae(t),r=le(t),n=Bt(t),i=ql(t);return e&&(Me(i,r),n&&vt(i,n)),i};var Ft=class t{#e;constructor(e){if(typeof e!="string")throw new Error("not a url:",e);this.#e=""+e,Me(this,"link")}static from(e){if(e instanceof t)return e;if(typeof e!="string")throw new Error("not a url:",e);return new t(e)}get value(){return this.#e}toString(){return this.#e}toJSON(){return'"'+this.#e+'"'}toJSONTag(){let e=ir(this);return""+this.toJSON()}};var Kr=class{constructor(){return new Proxy(this,{get:(e,r)=>{if(typeof e[r]<"u")return e[r];if(r!="then")throw console.error("Attempting to get from Null",r,typeof r,JSON.stringify(r)),new Error("Attempting to get "+r+" from Null")},set:(e,r,n)=>{throw console.error("Attempting to set "+r+" in Null to",n),new Error("Attempting to set "+r+" in Null")}})}},$e=class extends Kr{isNull=!0;toString(){return""}toJSON(){return"null"}toJSONTag(){return ae(this)+this.toJSON()}};function Yr(t,e,r){r||(r={}),r.index||(r.index={}),r.index.id||(r.index.id=new Map),r.unresolved||(r.unresolved=new Map),r.baseURL||(r.baseURL="http://localhost/");let n,i,s,o,a={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:` +`,r:"\r",t:" "},l=function(p){let c=t.substring(n-100,n+100);throw{name:"SyntaxError",message:p,at:n,input:c}},u=function(p){return p&&p!==i&&l("Expected '"+p+"' instead of '"+i+"'"),i=t.charAt(n),n+=1,i},d=function(p){let c="";for(i==="-"&&(c="-",u("-"));i>="0"&&i<="9";)c+=i,u();if(i===".")for(c+=".";u()&&i>="0"&&i<="9";)c+=i;if(i==="e"||i==="E")for(c+=i,u(),(i==="-"||i==="+")&&(c+=i,u());i>="0"&&i<="9";)c+=i,u();let x=new Number(c).valueOf();if(p)switch(p){case"int":y(c);break;case"uint":y(c,[0,1/0]);break;case"int8":y(c,[-128,127]);break;case"uint8":y(c,[0,255]);break;case"int16":y(c,[-32768,32767]);break;case"uint16":y(c,[0,65535]);break;case"int32":y(c,[-2147483648,2147483647]);break;case"uint32":y(c,[0,4294967295]);break;case"timestamp":case"int64":y(c,[-9223372036854776e3,9223372036854776e3]);break;case"uint64":y(c,[0,18446744073709552e3]);break;case"float":_(c);break;case"float32":_(c,[-34e37,34e37]);break;case"float64":_(c,[-17e307,17e307]);break;case"number":break;default:f(p,c);break}return x},f=function(p,c){l("Syntax error, expected "+p+", got: "+c)},b={color:/^(rgb|hsl)a?\((\d+%?(deg|rad|grad|turn)?[,\s]+){2,3}[\s\/]*[\d\.]+%?\)$/i,email:/^[A-Za-z0-9_!#$%&'*+\/=?`{|}~^.-]+@[A-Za-z0-9.-]+$/,uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,decimal:/^\d*\.?\d*$/,money:/^[A-Z]+\$\d*\.?\d*$/,duration:/^(-?)P(?=\d|T\d)(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)([DW]))?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?)?$/,phone:/^[+]?(?:\(\d+(?:\.\d+)?\)|\d+(?:\.\d+)?)(?:[ -]?(?:\(\d+(?:\.\d+)?\)|\d+(?:\.\d+)?))*(?:[ ]?(?:x|ext)\.?[ ]?\d{1,5})?$/,time:/^(\d{2}):(\d{2})(?::(\d{2}(?:\.\d+)?))?$/,date:/^-?[1-9][0-9]{3,}-([0][1-9]|[1][0-2])-([1-2][0-9]|[0][1-9]|[3][0-1])$/,datetime:/^(\d{4,})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2}(?:\.\d+)?))?Z?$/,range:/^\[-?(\d+\.)?\d+\,-?(\d+\.)?\d+\]$/},_=function(p,c){let x=new Number(parseFloat(p)),k=x.toString();p!==k&&l("Syntax Error: expected float value"),c&&(typeof c[0]=="number"&&xc[1]&&l("Syntax Error: float value out of range"))},y=function(p,c){let x=new Number(parseInt(p)),k=x.toString();p!==k&&l("Syntax Error: expected integer value"),c&&(typeof c[0]=="number"&&xc[1]&&l("Syntax Error: integer value out of range"))},g=function(p){let c=!1;return p.charAt(0)==="#"?(p=p.substring(1),c=[3,4,6,8].indexOf(p.length)>-1&&!isNaN(parseInt(p,16)),c.toString(16)!==p&&f("color",p)):c=b.color.test(p),c||f("color",p),!0},m=function(p){return b.email.test(p)||f("email",p),!0},w=function(p){return b.uuid.test(p)||f("uuid",p),!0},R=function(p){return b.decimal.test(p)||f("decimal",p),!0},N=function(p){return b.money.test(p)||f("money",p),!0},S=function(p){try{return!!new URL(p,r.baseURL)}catch(c){console.log(c),f("url",p)}},j=function(p){return b.duration.test(p)||f("duration",p),!0},me=function(p){return b.phone.test(p)||f("phone",p),!0},J=function(p){return b.range.test(p)||f("range",p),!0},ke=function(p){return b.time.test(p)||f("time",p),!0},W=function(p){return b.date.test(p)||f("date",p),!0},ne=function(p){return b.datetime.test(p)||f("datetime",p),!0},Nt=function(p,c){if(p){switch(p){case"object":case"array":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":case"int64":case"uint64":case"int":case"uint":case"float32":case"float64":case"float":case"timestamp":f(p,c);break;case"uuid":return w(c);case"decimal":return R(c);case"money":return N(c);case"url":return S(c);case"link":case"string":case"text":case"blob":case"hash":return!0;case"color":return g(c);case"email":return m(c);case"duration":return j(c);case"phone":return me(c);case"range":return J(c);case"time":return ke(c);case"date":return W(c);case"datetime":return ne(c)}l("Syntax error: unknown tagName "+p)}},kt=function(p){let c="",x,k,M;for(i!=='"'&&l("Syntax Error"),u('"');i;){if(i==='"')return u(),Nt(p,c),c;if(i==="\\")if(u(),i==="u"){for(M=0,k=0;k<4&&(x=parseInt(u(),16),!!isFinite(x));k++)M=M*16+x;c+=String.fromCharCode(M),u()}else if(typeof a[i]=="string")c+=a[i],u();else break;else c+=i,u()}l("Syntax error: incomplete string")},oe=function(){let p,c,x={attributes:{}};for(i!=="<"&&l("Syntax Error"),u("<"),p=Hr(),p||l("Syntax Error: expected tag name"),x.tagName=p,K();i;){if(i===">")return u(">"),x;p=Hr(),p||l("Syntax Error: expected attribute name"),K(),u("="),K(),c=kt(),x.attributes[p]=c,K()}l("Syntax Error: unexpected end of input")},K=function(){for(;i;)switch(i){case" ":case" ":case"\r":case` +`:u();break;default:return}},Hr=function(){let p="";for(i>="a"&&i<="z"||i>="A"&&i<="Z"?(p+=i,u()):l("Syntax Error: expected word");i>="a"&&i<="z"||i>="A"&&i<="Z"||i>="0"&&i<="9"||i=="_";)p+=i,u();return p},kl=function(p){let c=Hr();switch((!c||typeof c!="string")&&l('Syntax error: expected boolean or null, got "'+c+'"'),c.toLowerCase()){case"true":return p&&p!=="boolean"&&f(p,c),!0;break;case"false":return p&&p!=="boolean"&&f(p,c),!1;break;case"null":return null;default:l('Syntax error: expected boolean or null, got "'+c+'"');break}},Qr=function(p,c,x){if(le(p)==="link"){let k=""+p,M=r.unresolved.get(k);typeof M>"u"&&(r.unresolved.set(k,[]),M=r.unresolved.get(k));let G=M.push({src:new WeakRef(c),key:x})}},Ll=function(){let p,c=[];if(i!=="["&&l("Syntax error"),u("["),K(),i==="]")return u("]"),c;for(;i;){if(p=s(),Qr(p,c,c.length),c.push(p),K(),i==="]")return u("]"),c;u(","),K()}l("Input stopped early")},vl=function(){let p,c,x={};if(i!=="{"&&l("Syntax Error"),u("{"),K(),i==="}")return u("}"),x;for(;i;){if(p=kt(),p==="__proto__"&&l("Attempt at prototype pollution"),K(),u(":"),c=s(),x[p]=c,Qr(c,x,p),K(),i==="}")return u("}"),x;u(","),K()}l("Input stopped early")};if(s=function(){let p,c,x;switch(K(),i==="<"&&(p=oe(),x=p.tagName,K()),i){case"{":x&&x!=="object"&&f(x,i),c=vl();break;case"[":x&&x!=="array"&&f(x,i),c=Ll();break;case'"':c=kt(x);break;case"-":c=d(x);break;default:i>="0"&&i<="9"?c=d(x):c=kl(x);break}if(p){if(c===null&&(c=new $e),typeof c!="object")switch(typeof c){case"string":c=new String(c);break;case"number":c=new Number(c);break;default:l("Syntax Error: unexpected type "+typeof c);break}p.tagName&&Me(c,p.tagName),p.attributes&&(vt(c,p.attributes),p.attributes?.id&&r.index.id.set(p.attributes.id,new WeakRef(c)))}return c},n=0,i=" ",o=s(),K(),i&&l("Syntax error"),typeof e=="function"){let p=function(c,x){var k,M,G=c[x];if(G!==null&&typeof G=="object"&&!(G instanceof String||G instanceof Number||G instanceof Boolean))for(k in G)Object.prototype.hasOwnProperty.call(G,k)&&(M=p(G,k),M!==void 0&&(typeof G[k]>"u"||G[k]!==M)?(G[k]=M,le(M)==="link"&&Qr(M,G,k)):M===void 0&&delete G[k]);return e.call(c,x,G,r)};p({"":o},"")}let vi=function(p,c){if(typeof c<"u"){let x=p.src.deref();if(typeof x<"u"&&le(x[p.key])==="link")return x[p.key]=c,!0}};return r.index.id.size>r.unresolved.size?r.unresolved.forEach((p,c)=>{let x=r.index.id.get(c)?.deref();x!==void 0&&p.forEach((k,M)=>{vi(k,x)&&delete p[M]})}):r.index.id.forEach((p,c)=>{let x=p.deref(),k=r.unresolved.get(c);x!==void 0&&typeof k<"u"&&(k.forEach((M,G)=>{vi(M,x)}),r.unresolved.delete(c))}),o}var v=class t{static{t.stringify=Bi,t.parse=Yr,t.getType=le,t.setType=Me,t.getTypeString=ae,t.setAttribute=Lt,t.getAttribute=Jr,t.addAttribute=ji,t.removeAttribute=Pi,t.getAttributes=Bt,t.setAttributes=vt,t.getAttributesString=ir,t.isNull=Fi,t.clone=Oi,t.Link=Ft,t.Null=$e}};var Ui=nr(Di());var jt="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Pt="http://www.w3.org/2001/XMLSchema#",Zr="http://www.w3.org/2000/10/swap/",P={xsd:{decimal:`${Pt}decimal`,boolean:`${Pt}boolean`,double:`${Pt}double`,integer:`${Pt}integer`,string:`${Pt}string`},rdf:{type:`${jt}type`,nil:`${jt}nil`,first:`${jt}first`,rest:`${jt}rest`,langString:`${jt}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${Zr}reify#forSome`,forAll:`${Zr}reify#forAll`},log:{implies:`${Zr}log#implies`}};var{xsd:sr}=P,Ul=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,qi={"\\":"\\","'":"'",'"':'"',n:` +`,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Wl=/[\x00-\x20<>\\"\{\}\|\^\`]/,Gl={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},Hl=/$0^/,De=class{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._lineMode=!!e.lineMode){this._n3Mode=!1;for(let r in this)!(r in Gl)&&this[r]instanceof RegExp&&(this[r]=Hl)}else this._n3Mode=e.n3!==!1;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,r){let n=this._input,i=n.length;for(;;){let a,l;for(;a=this._newline.exec(n);)this._comments&&(l=this._comment.exec(a[0]))&&s("comment",l[1],"",this._line,a[0].length),n=n.substr(a[0].length,n.length),i=n.length,this._line++;if(!a&&(a=this._whitespace.exec(n))&&(n=n.substr(a[0].length,n.length)),this._endOfFile.test(n))return r&&(this._comments&&(l=this._comment.exec(n))&&s("comment",l[1],"",this._line,n.length),n=null,s("eof","","",this._line,0)),this._input=n;let u=this._line,d=n[0],f="",b="",_="",y=null,g=0,m=!1;switch(d){case"^":if(n.length<3)break;if(n[1]==="^"){if(this._previousMarker="^^",n=n.substr(2),n[0]!=="<"){m=!0;break}}else{this._n3Mode&&(g=1,f="^");break}case"<":if(y=this._unescapedIri.exec(n))f="IRI",b=y[1];else if(y=this._iri.exec(n)){if(b=this._unescape(y[1]),b===null||Wl.test(b))return o(this);f="IRI"}else n.length>1&&n[1]==="<"?(f="<<",g=2):this._n3Mode&&n.length>1&&n[1]==="="&&(f="inverse",g=2,b=">");break;case">":n.length>1&&n[1]===">"&&(f=">>",g=2);break;case"_":((y=this._blank.exec(n))||r&&(y=this._blank.exec(`${n} `)))&&(f="blank",_="_",b=y[1]);break;case'"':if(y=this._simpleQuotedString.exec(n))b=y[1];else if({value:b,matchLength:g}=this._parseLiteral(n),b===null)return o(this);(y!==null||g!==0)&&(f="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(y=this._simpleApostropheString.exec(n))b=y[1];else if({value:b,matchLength:g}=this._parseLiteral(n),b===null)return o(this);(y!==null||g!==0)&&(f="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(y=this._variable.exec(n))&&(f="var",b=y[0]);break;case"@":this._previousMarker==="literal"&&(y=this._langcode.exec(n))?(f="langcode",b=y[1]):(y=this._keyword.exec(n))&&(f=y[0]);break;case".":if(n.length===1?r:n[1]<"0"||n[1]>"9"){f=".",g=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(y=this._number.exec(n)||r&&(y=this._number.exec(`${n} `)))&&(f="literal",b=y[0],_=typeof y[1]=="string"?sr.double:typeof y[2]=="string"?sr.decimal:sr.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(y=this._sparqlKeyword.exec(n))?f=y[0].toUpperCase():m=!0;break;case"f":case"t":(y=this._boolean.exec(n))?(f="literal",b=y[0],_=sr.boolean):m=!0;break;case"a":(y=this._shortPredicates.exec(n))?(f="abbreviation",b="a"):m=!0;break;case"=":this._n3Mode&&n.length>1&&(f="abbreviation",n[1]!==">"?(g=1,b="="):(g=2,b=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(g=1,f=d);break;case"{":!this._lineMode&&n.length>=2&&(n[1]==="|"?(f="{|",g=2):(f=d,g=1));break;case"|":n.length>=2&&n[1]==="}"&&(f="|}",g=2);break;default:m=!0}if(m&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(y=this._prefix.exec(n))?(f="prefix",b=y[1]||""):((y=this._prefixed.exec(n))||r&&(y=this._prefixed.exec(`${n} `)))&&(f="prefixed",_=y[1]||"",b=this._unescape(y[2]))),this._previousMarker==="^^")switch(f){case"prefixed":f="type";break;case"IRI":f="typeIRI";break;default:f=""}if(!f)return r||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?o(this):this._input=n;let w=g||y[0].length,R=s(f,b,_,u,w);this.previousToken=R,this._previousMarker=f,n=n.substr(w,n.length)}function s(a,l,u,d,f){let b=n?i-n.length:i,_=b+f,y={type:a,value:l,prefix:u,line:d,start:b,end:_};return e(null,y),y}function o(a){e(a._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let r=!1,n=e.replace(Ul,(i,s,o,a)=>{if(typeof s=="string")return String.fromCharCode(Number.parseInt(s,16));if(typeof o=="string"){let l=Number.parseInt(o,16);return l<=65535?String.fromCharCode(Number.parseInt(o,16)):String.fromCharCode(55296+((l-=65536)>>10),56320+(l&1023))}return a in qi?qi[a]:(r=!0,"")});return r?null:n}_parseLiteral(e){if(e.length>=3){let r=e.match(/^(?:"""|"|'''|'|)/)[0],n=r.length,i=Math.max(this._literalClosingPos,n);for(;(i=e.indexOf(r,i))>0;){let s=0;for(;e[i-s-1]==="\\";)s++;if(s%2===0){let o=e.substring(n,i),a=o.split(/\r\n|\r|\n/).length-1,l=i+n;if(n===1&&a!==0||n===3&&this._lineMode)break;return this._line+=a,{value:this._unescape(o),matchLength:l}}i++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;let r=new Error(`Unexpected "${e}" on line ${this._line}.`);return r.context={token:void 0,line:this._line,previousToken:this.previousToken},r}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,r){if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof r=="function")(0,Ui.default)(()=>this._tokenizeToEnd(r,!0));else{let n=[],i;if(this._tokenizeToEnd((s,o)=>s?i=s:n.push(o),!0),i)throw i;return n}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",n=>{this._input!==null&&n.length!==0&&(this._pendingBuffer&&(n=Buffer.concat([this._pendingBuffer,n]),this._pendingBuffer=null),n[n.length-1]&128?this._pendingBuffer=n:(typeof this._input>"u"?this._input=this._readStartingBom(typeof n=="string"?n:n.toString()):this._input+=n,this._tokenizeToEnd(r,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(r,!0)}),e.on("error",r)}};var{rdf:Ql,xsd:qe}=P,$t,zl=0;var Xr={namedNode:Vl,blankNode:Jl,variable:Yl,literal:Kl,defaultGraph:Zl,quad:Wi,triple:Wi},ue=Xr,X=class t{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof t?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}},ot=class extends X{get termType(){return"NamedNode"}},ve=class t extends X{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){let e=this.id,r=e.lastIndexOf('"')+1;return r0?"INF":"-INF")))),r===""||r===qe.string?new ve(`"${t}"`):new ve(`"${t}"^^${r}`)}function Yl(t){return new Ct(t)}function Zl(){return $t}function Wi(t,e,r,n){return new Ue(t,e,r,n)}var Gi=0,Be=class{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&Hi(this,e.factory);let r=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(r),i=/trig/.test(r),s=/triple/.test(r),o=/quad/.test(r),a=this._n3Mode=/n3/.test(r),l=s||o;(this._supportsNamedGraphs=!(n||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||i||s||a),this._supportsRDFStar=r===""||/star|\*$/.test(r),l&&(this._resolveRelativeIRI=u=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new De({lineMode:l,n3:a}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Gi=0}_setBase(e){if(!e)this._base="",this._basePath="";else{let r=e.indexOf("#");r>=0&&(e=e.substr(0,r)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}}_saveContext(e,r,n,i,s){let o=this._n3Mode;this._contextStack.push({type:e,subject:n,predicate:i,object:s,graph:r,inverse:o?this._inversePredicate:!1,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,r){let n=this._contextStack.pop();if(!n||n.type!==e)return this._error(`Unexpected ${r.type}`,r);this._subject=n.subject,this._predicate=n.predicate,this._object=n.object,this._graph=n.graph,this._n3Mode&&(this._inversePredicate=n.inverse,this._prefixes._=n.blankPrefix,this._quantified=n.quantified)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,r){let n;switch(e.type){case"IRI":case"typeIRI":let i=this._resolveIRI(e.value);if(i===null)return this._error("Invalid IRI",e);n=this._namedNode(i);break;case"type":case"prefixed":let s=this._prefixes[e.prefix];if(s===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);n=this._namedNode(s+e.value);break;case"blank":n=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!r&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){let r=e.type;switch(r){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return this._predicate===null?this._error(`Unexpected ${r}`,e):(this._subject=null,r==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if((this._object=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return e.type==="{"?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return e.type!=="{"?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return e.type==="]"?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);let r=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:r?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let r=null,n=null,i=this._readListItem,s=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._blankNode(),this.RDF_FIRST,this._subject=r=this._blankNode()),i=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),o.length!==0&&o[o.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(i=this._readPredicate,this._subject===this.RDF_NIL)return i}else if(i=this._getContextEndReader(),this._object===this.RDF_NIL)return i;n=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,i=this._readListItemDataTypeOrLang):(r=this._literal(e.value,this._namedNode(e.prefix)),i=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if((r=this._readEntity(e))===void 0)return}if(n===null&&(this._subject=n=this._blankNode()),s===null?a.predicate===null?a.subject=n:a.object=n:this._emit(s,this.RDF_REST,n,this._graph),r!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,n,this.RDF_FIRST,r),this._subject=r,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,r,this._graph)}return i}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let r=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":let n=this._readEntity(e);if(n===void 0)return;r=this._literal(this._literalValue,n),e=null;break;case"langcode":r=this._literal(this._literalValue,e.value),e=null;break}return{token:e,literal:r}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,r){let n=this._completeLiteral(e);if(n)return this._object=n.literal,r&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),n.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let r,n=this._graph,i=this._subject,s=this._inversePredicate;switch(e.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,r=this._contextStack.length?this._readSubject:this._readInTopContext,s&&(this._inversePredicate=!1);break;case";":r=this._readPredicate;break;case",":r=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF* syntax",e);let o=this._predicate,a=this._object;this._subject=this._quad(i,o,a,this.DEFAULTGRAPH),r=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",e);this._subject=null,r=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(n=this._readEntity(e))!==void 0){r=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(i!==null){let o=this._predicate,a=this._object;s?this._emit(a,o,i,n):this._emit(i,o,a,n)}return r}_readBlankNodePunctuation(e){let r;switch(e.type){case";":r=this._readPredicate;break;case",":r=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),r}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);let r=this._readEntity(e);return this._prefixes[this._prefix]=r.value,this._prefixCallback(this._prefix,r),this._readDeclarationPunctuation}_readBaseIRI(e){let r=e.type==="IRI"&&this._resolveIRI(e.value);return r?(this._setBase(r),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return e.type!=="]"?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let r;switch(e.type){case"IRI":case"prefixed":if((r=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,r,this.QUANTIFIERS_GRAPH)):this._quantified[r.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return e.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:let r=this._contextStack,n=r.length&&r[r.length-1];if(n&&n.type==="item"){let i=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,i,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let r,n,i=this._blankNode();if((n=this._readEntity(e))!==void 0)return this._predicate===null?(r=this._subject,this._subject=i):(r=this._object,this._object=i),this._emit(r,n,i,this._graph),this._readPath}_readBackwardPath(e){let r=this._blankNode(),n,i;if((n=this._readEntity(e))!==void 0)return this._predicate===null?(i=this._subject,this._subject=r):(i=this._object,this._object=r),this._emit(r,n,i,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);let r=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=r,this._readPredicate):(this._object=r,this._getContextEndReader())}_getContextEndReader(){let e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,r,n,i){this._callback(null,this._quad(e,r,n,i||this.DEFAULTGRAPH))}_error(e,r){let n=new Error(`${e} on line ${r.line}.`);n.context={token:r,line:r.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=en}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return(e[1]==="/"?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;let r=e.length,n="",i=-1,s=-1,o=0,a="/";for(;i=s&&(n=n.substr(0,o)),a!=="/")return`${n}/${e.substr(i+1)}`;o=i+1}}}a=e[++i]}return n+e.substring(o)}parse(e,r,n){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Gi++}_`,this._prefixCallback=n||en,this._inversePredicate=!1,this._quantified=Object.create(null),!r){let i=[],s;if(this._callback=(o,a)=>{o?s=o:a&&i.push(a)},this._lexer.tokenize(e).every(o=>this._readCallback=this._readCallback(o)),s)throw s;return i}this._callback=r,this._lexer.tokenize(e,(i,s)=>{i!==null?(this._callback(i),this._callback=en):this._readCallback&&(this._readCallback=this._readCallback(s))})}};function en(){}function Hi(t,e){let r=e.namedNode;t._namedNode=r,t._blankNode=e.blankNode,t._literal=e.literal,t._variable=e.variable,t._quad=e.quad,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=r(P.rdf.first),t.RDF_REST=r(P.rdf.rest),t.RDF_NIL=r(P.rdf.nil),t.N3_FORALL=r(P.r.forAll),t.N3_FORSOME=r(P.r.forSome),t.ABBREVIATIONS={a:r(P.rdf.type),"=":r(P.owl.sameAs),">":r(P.log.implies)},t.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}Hi(Be.prototype,ue);var tn={};Cl(tn,{inDefaultGraph:()=>nu,isBlankNode:()=>eu,isDefaultGraph:()=>We,isLiteral:()=>tu,isNamedNode:()=>Xl,isVariable:()=>ru,prefix:()=>iu,prefixes:()=>Qi});function Xl(t){return!!t&&t.termType==="NamedNode"}function eu(t){return!!t&&t.termType==="BlankNode"}function tu(t){return!!t&&t.termType==="Literal"}function ru(t){return!!t&&t.termType==="Variable"}function We(t){return!!t&&t.termType==="DefaultGraph"}function nu(t){return We(t.graph)}function iu(t,e){return Qi({"":t.value||t},e)("")}function Qi(t,e){let r=Object.create(null);for(let i in t)n(i,t[i]);e=e||ue;function n(i,s){if(typeof s=="string"){let o=Object.create(null);r[i]=a=>o[a]||(o[a]=e.namedNode(s+a))}else if(!(i in r))throw new Error(`Unknown prefix: ${i}`);return r[i]}return n}var Dt=ue.defaultGraph(),{rdf:su,xsd:at}=P,zi=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,Vi=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,ou={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"},Ge=class extends X{equals(e){return e===this}},He=class{constructor(e,r){if(this._prefixRegex=/$0^/,e&&typeof e.write!="function"&&(r=e,e=null),r=r||{},this._lists=r.lists,e)this._outputStream=e,this._endStream=r.end===void 0?!0:!!r.end;else{let n="";this._outputStream={write(i,s,o){n+=i,o&&o()},end:i=>{i&&i(null,n)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(r.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=Dt,this._prefixIRIs=Object.create(null),r.prefixes&&this.addPrefixes(r.prefixes),r.baseIRI&&(this._baseMatcher=new RegExp(`^${Ki(r.baseIRI)}${r.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=r.baseIRI.length))}get _inDefaultGraph(){return Dt.equals(this._graph)}_write(e,r){this._outputStream.write(e,"utf8",r)}_writeQuad(e,r,n,i,s){try{i.equals(this._graph)||(this._write((this._subject===null?"":this._inDefaultGraph?`. `:` } `)+(Dt.equals(i)?"":`${this._encodeIriOrBlank(i)} { @@ -14,7 +14,7 @@ var Bl=Object.create;var zr=Object.defineProperty;var Fl=Object.getOwnPropertyDe ${this._encodePredicate(this._predicate=r)} ${this._encodeObject(n)}`,s):this._write(`${(this._subject===null?"":`. `)+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=r)} ${this._encodeObject(n)}`,s)}catch(o){s&&s(o)}}_writeQuadLine(e,r,n,i,s){delete this._prefixMatch,this._write(this.quadToString(e,r,n,i),s)}quadToString(e,r,n,i){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(r)} ${this._encodeObject(n)}${i&&i.value?` ${this._encodeIriOrBlank(i)} . `:` . -`}`}quadsToString(e){return e.map(r=>this.quadToString(r.subject,r.predicate,r.object,r.graph)).join("")}_encodeSubject(e){return e.termType==="Quad"?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if(e.termType!=="NamedNode")return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let r=e.value;this._baseMatcher&&this._baseMatcher.test(r)&&(r=r.substr(this._baseLength)),zi.test(r)&&(r=r.replace(Vi,Ji));let n=this._prefixRegex.exec(r);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:r:`<${r}>`}_encodeLiteral(e){let r=e.value;if(zi.test(r)&&(r=r.replace(Vi,Ji)),e.language)return`"${r}"@${e.language}`;if(this._lineMode){if(e.datatype.value===at.string)return`"${r}"`}else switch(e.datatype.value){case at.string:return`"${r}"`;case at.boolean:if(r==="true"||r==="false")return r;break;case at.integer:if(/^[+-]?\d+$/.test(r))return r;break;case at.decimal:if(/^[+-]?\d*\.\d+$/.test(r))return r;break;case at.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(r))return r;break}return`"${r}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===su.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:r,object:n,graph:i}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(r)} ${this._encodeObject(n)}${xe(i)?"":` ${this._encodeIriOrBlank(i)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,r,n,i,s){n===void 0?this._writeQuad(e.subject,e.predicate,e.object,e.graph,r):typeof i=="function"?this._writeQuad(e,r,n,Dt,i):this._writeQuad(e,r,n,i||Dt,s)}addQuads(e){for(let r=0;rthis.quadToString(r.subject,r.predicate,r.object,r.graph)).join("")}_encodeSubject(e){return e.termType==="Quad"?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if(e.termType!=="NamedNode")return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let r=e.value;this._baseMatcher&&this._baseMatcher.test(r)&&(r=r.substr(this._baseLength)),zi.test(r)&&(r=r.replace(Vi,Ji));let n=this._prefixRegex.exec(r);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:r:`<${r}>`}_encodeLiteral(e){let r=e.value;if(zi.test(r)&&(r=r.replace(Vi,Ji)),e.language)return`"${r}"@${e.language}`;if(this._lineMode){if(e.datatype.value===at.string)return`"${r}"`}else switch(e.datatype.value){case at.string:return`"${r}"`;case at.boolean:if(r==="true"||r==="false")return r;break;case at.integer:if(/^[+-]?\d+$/.test(r))return r;break;case at.decimal:if(/^[+-]?\d*\.\d+$/.test(r))return r;break;case at.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(r))return r;break}return`"${r}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===su.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:r,object:n,graph:i}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(r)} ${this._encodeObject(n)}${We(i)?"":` ${this._encodeIriOrBlank(i)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,r,n,i,s){n===void 0?this._writeQuad(e.subject,e.predicate,e.object,e.graph,r):typeof i=="function"?this._writeQuad(e,r,n,Dt,i):this._writeQuad(e,r,n,i||Dt,s)}addQuads(e){for(let r=0;r. @@ -25,7 +25,7 @@ var Bl=Object.create;var zr=Object.defineProperty;var Fl=Object.getOwnPropertyDe ]`)}}list(e){let r=e&&e.length||0,n=new Array(r);for(let i=0;i{r=null,e(n,i)});if(this._endStream)try{return this._outputStream.end(r)}catch{}r&&r()}};function Ji(t){let e=ou[t];return e===void 0&&(t.length===1?(e=t.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=((t.charCodeAt(0)-55296)*1024+t.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}function Ki(t){return t.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}var Ni=nr(Wr());var Tt=class{constructor(e,r){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._entities=Object.create(null),this._blankNodeIndex=0,!r&&e&&!e[0]&&(r=e,e=null),r=r||{},this._factory=r.factory||ue,e&&this.addQuads(e)}_termFromId(e,r){if(e[0]==="."){let n=this._entities,i=e.split(".");return this._factory.quad(this._termFromId(n[i[1]]),this._termFromId(n[i[2]]),this._termFromId(n[i[3]]),i[4]&&this._termFromId(n[i[4]]))}return ve(e,r)}_termToNumericId(e){if(e.termType==="Quad"){let r=this._termToNumericId(e.subject),n=this._termToNumericId(e.predicate),i=this._termToNumericId(e.object),s;return r&&n&&i&&(xe(e.graph)||(s=this._termToNumericId(e.graph)))&&this._ids[s?`.${r}.${n}.${i}.${s}`:`.${r}.${n}.${i}`]}return this._ids[H(e)]}_termToNewNumericId(e){let r=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${xe(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:H(e);return this._ids[r]||(this._ids[this._entities[++this._id]=r]=this._id)}get size(){let e=this._size;if(e!==null)return e;e=0;let r=this._graphs,n,i;for(let s in r)for(let o in n=r[s].subjects)for(let a in i=n[o])e+=Object.keys(i[a]).length;return this._size=e}_addToIndex(e,r,n,i){let s=e[r]||(e[r]={}),o=s[n]||(s[n]={}),a=i in o;return a||(o[i]=null),!a}_removeFromIndex(e,r,n,i){let s=e[r],o=s[n];delete o[i];for(let a in o)return;delete s[n];for(let a in s)return;delete e[r]}*_findInIndex(e,r,n,i,s,o,a,l){let u,d,f,b=this._entities,_=this._termFromId(l,this._factory),y={subject:null,predicate:null,object:null};r&&((u=e,e={})[r]=u[r]);for(let g in e)if(d=e[g]){y[s]=this._termFromId(b[g],this._factory),n&&((u=d,d={})[n]=u[n]);for(let m in d)if(f=d[m]){y[o]=this._termFromId(b[m],this._factory);let w=i?i in f?[i]:[]:Object.keys(f);for(let R=0;R{n in r||(r[n]=!0,e(this._termFromId(this._entities[n],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,r,n,i){r||(i=e.graph,n=e.object,r=e.predicate,e=e.subject),i=H(i);let s=this._graphs[i];s||(s=this._graphs[i]={subjects:{},predicates:{},objects:{}},Object.freeze(s)),e=this._termToNewNumericId(e),r=this._termToNewNumericId(r),n=this._termToNewNumericId(n);let o=this._addToIndex(s.subjects,e,r,n);return this._addToIndex(s.predicates,r,n,e),this._addToIndex(s.objects,n,e,r),this._size=null,o}addQuads(e){for(let r=0;r{this.addQuad(r)}),e}removeQuad(e,r,n,i){r||(i=e.graph,n=e.object,r=e.predicate,e=e.subject),i=H(i);let s=this._graphs,o,a,l;if(!(e=e&&this._termToNumericId(e))||!(r=r&&this._termToNumericId(r))||!(n=n&&this._termToNumericId(n))||!(o=s[i])||!(a=o.subjects[e])||!(l=a[r])||!(n in l))return!1;this._removeFromIndex(o.subjects,e,r,n),this._removeFromIndex(o.predicates,r,n,e),this._removeFromIndex(o.objects,n,e,r),this._size!==null&&this._size--;for(e in o.subjects)return!0;return delete s[i],!0}removeQuads(e){for(let r=0;r{this.removeQuad(r)}),e}removeMatches(e,r,n,i){let s=new Ni.Readable({objectMode:!0});return s._read=()=>{for(let o of this.readQuads(e,r,n,i))s.push(o);s.push(null)},this.remove(s)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,r,n,i){return[...this.readQuads(e,r,n,i)]}*readQuads(e,r,n,i){i=i&&H(i);let s=this._getGraphs(i),o,a,l,u;if(!(e&&!(a=this._termToNumericId(e))||r&&!(l=this._termToNumericId(r))||n&&!(u=this._termToNumericId(n))))for(let d in s)(o=s[d])&&(a?u?yield*this._findInIndex(o.objects,u,a,l,"object","subject","predicate",d):yield*this._findInIndex(o.subjects,a,l,null,"subject","predicate","object",d):l?yield*this._findInIndex(o.predicates,l,u,null,"predicate","object","subject",d):u?yield*this._findInIndex(o.objects,u,null,null,"object","subject","predicate",d):yield*this._findInIndex(o.subjects,null,null,null,"subject","predicate","object",d))}match(e,r,n,i){return new Ti(this,e,r,n,i)}countQuads(e,r,n,i){i=i&&H(i);let s=this._getGraphs(i),o=0,a,l,u,d;if(e&&!(l=this._termToNumericId(e))||r&&!(u=this._termToNumericId(r))||n&&!(d=this._termToNumericId(n)))return 0;for(let f in s)(a=s[f])&&(e?n?o+=this._countInIndex(a.objects,d,l,u):o+=this._countInIndex(a.subjects,l,u,d):r?o+=this._countInIndex(a.predicates,u,d,l):o+=this._countInIndex(a.objects,d,l,u));return o}forEach(e,r,n,i,s){this.some(o=>(e(o),!1),r,n,i,s)}every(e,r,n,i,s){let o=!1,a=!this.some(l=>(o=!0,!e(l)),r,n,i,s);return o&&a}some(e,r,n,i,s){for(let o of this.readQuads(r,n,i,s))if(e(o))return!0;return!1}getSubjects(e,r,n){let i=[];return this.forSubjects(s=>{i.push(s)},e,r,n),i}forSubjects(e,r,n,i){i=i&&H(i);let s=this._getGraphs(i),o,a,l;if(e=this._uniqueEntities(e),!(r&&!(a=this._termToNumericId(r))||n&&!(l=this._termToNumericId(n))))for(i in s)(o=s[i])&&(a?l?this._loopBy2Keys(o.predicates,a,l,e):this._loopByKey1(o.subjects,a,e):l?this._loopByKey0(o.objects,l,e):this._loop(o.subjects,e))}getPredicates(e,r,n){let i=[];return this.forPredicates(s=>{i.push(s)},e,r,n),i}forPredicates(e,r,n,i){i=i&&H(i);let s=this._getGraphs(i),o,a,l;if(e=this._uniqueEntities(e),!(r&&!(a=this._termToNumericId(r))||n&&!(l=this._termToNumericId(n))))for(i in s)(o=s[i])&&(a?l?this._loopBy2Keys(o.objects,l,a,e):this._loopByKey0(o.subjects,a,e):l?this._loopByKey1(o.predicates,l,e):this._loop(o.predicates,e))}getObjects(e,r,n){let i=[];return this.forObjects(s=>{i.push(s)},e,r,n),i}forObjects(e,r,n,i){i=i&&H(i);let s=this._getGraphs(i),o,a,l;if(e=this._uniqueEntities(e),!(r&&!(a=this._termToNumericId(r))||n&&!(l=this._termToNumericId(n))))for(i in s)(o=s[i])&&(a?l?this._loopBy2Keys(o.subjects,a,l,e):this._loopByKey1(o.objects,a,e):l?this._loopByKey0(o.predicates,l,e):this._loop(o.objects,e))}getGraphs(e,r,n){let i=[];return this.forGraphs(s=>{i.push(s)},e,r,n),i}forGraphs(e,r,n,i){for(let s in this._graphs)this.some(o=>(e(o.graph),!0),r,n,i,s)}createBlankNode(e){let r,n;if(e)for(r=e=`_:${e}`,n=1;this._ids[r];)r=e+n++;else do r=`_:b${this._blankNodeIndex++}`;while(this._ids[r]);return this._ids[r]=++this._id,this._entities[this._id]=r,this._factory.blankNode(r.substr(2))}extractLists({remove:e=!1,ignoreErrors:r=!1}={}){let n={},i=r?()=>!0:(a,l)=>{throw new Error(`${a.value} ${l}`)},s=this.getQuads(null,P.rdf.rest,P.rdf.nil,null),o=e?[...s]:[];return s.forEach(a=>{let l=[],u=!1,d,f,b=a.graph,_=a.subject;for(;_&&!u;){let y=this.getQuads(null,null,_,null),g=this.getQuads(_,null,null,null),m,w=null,R=null,N=null;for(let S=0;S{switch(s){case"data":n=o;break;case"end":i=o;break}}},(s,o)=>{s&&this.emit("error",s)||o&&this.push(o)},(s,o)=>{this.emit("prefix",s,o)}),this._transform=(s,o,a)=>{n(s),a()},this._flush=s=>{i(),s()}}import(e){return e.on("data",r=>{this.write(r)}),e.on("end",()=>{this.end()}),e.on("error",r=>{this.emit("error",r)}),this}};var Tl=nr(Wr());var rr=class extends Tl.Transform{constructor(e){super({encoding:"utf8",writableObjectMode:!0});let r=this._writer=new He({write:(n,i,s)=>{this.push(n),s&&s()},end:n=>{this.push(null),n&&n()}},e);this._transform=(n,i,s)=>{r.addQuad(n,s)},this._flush=n=>{r.end(n)}}import(e){return e.on("data",r=>{this.write(r)}),e.on("end",()=>{this.end()}),e.on("error",r=>{this.emit("error",r)}),e.on("prefix",(r,n)=>{this._writer.addPrefix(r,n)}),this}};var Nl={Lexer:qe,Parser:Fe,Writer:He,Store:Tt,StreamParser:tr,StreamWriter:rr,Util:Xr,DataFactory:ue,Term:X,NamedNode:ot,Literal:Be,BlankNode:Ot,Variable:Ct,DefaultGraph:Mt,Quad:We,Triple:We,termFromId:ve,termToId:H};var d_={xsd$dateTime:"",xsd$time:"