- Add GETTING_STARTED.md with quick start guide and development modes - Add INSTALL.sh automated installation script - Add INSTALLATION_CHECKLIST.md, INSTALLATION_SUCCESS.md, and INSTALLATION_SUMMARY.md - Add QUICK_REFERENCE.md for common commands - Add SETUP_GUIDE.md with detailed setup instructions - Update README.md with improved project overview - Add did-wallet app dependencies and node_modules
32 lines
201 KiB
JavaScript
32 lines
201 KiB
JavaScript
var kd=Object.create;var Mi=Object.defineProperty;var Ld=Object.getOwnPropertyDescriptor;var Cd=Object.getOwnPropertyNames;var Ud=Object.getPrototypeOf,Pd=Object.prototype.hasOwnProperty;var S=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Dd=(t,e)=>{for(var r in e)Mi(t,r,{get:e[r],enumerable:!0})},Nd=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Cd(e))!Pd.call(t,i)&&i!==r&&Mi(t,i,{get:()=>e[i],enumerable:!(n=Ld(e,i))||n.enumerable});return t};var f=(t,e,r)=>(r=t!=null?kd(Ud(t)):{},Nd(e||!t||!t.__esModule?Mi(r,"default",{value:t,enumerable:!0}):r,t));var Rc=S(mn=>{"use strict";var km=f(l());mn.byteLength=Kd;mn.toByteArray=qd;mn.fromByteArray=Vd;var Re=[],ge=[],Md=typeof Uint8Array<"u"?Uint8Array:Array,Ki="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(vt=0,Bc=Ki.length;vt<Bc;++vt)Re[vt]=Ki[vt],ge[Ki.charCodeAt(vt)]=vt;var vt,Bc;ge[45]=62;ge[95]=63;function Ic(t){var e=t.length;if(e%4>0)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 Kd(t){var e=Ic(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Fd(t,e,r){return(e+r)*3/4-r}function qd(t){var e,r=Ic(t),n=r[0],i=r[1],o=new Md(Fd(t,n,i)),s=0,c=i>0?n-4:n,a;for(a=0;a<c;a+=4)e=ge[t.charCodeAt(a)]<<18|ge[t.charCodeAt(a+1)]<<12|ge[t.charCodeAt(a+2)]<<6|ge[t.charCodeAt(a+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return i===2&&(e=ge[t.charCodeAt(a)]<<2|ge[t.charCodeAt(a+1)]>>4,o[s++]=e&255),i===1&&(e=ge[t.charCodeAt(a)]<<10|ge[t.charCodeAt(a+1)]<<4|ge[t.charCodeAt(a+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function jd(t){return Re[t>>18&63]+Re[t>>12&63]+Re[t>>6&63]+Re[t&63]}function $d(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(jd(n));return i.join("")}function Vd(t){for(var e,r=t.length,n=r%3,i=[],o=16383,s=0,c=r-n;s<c;s+=o)i.push($d(t,s,s+o>c?c:s+o));return n===1?(e=t[r-1],i.push(Re[e>>2]+Re[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Re[e>>10]+Re[e>>4&63]+Re[e<<2&63]+"=")),i.join("")}});var Oc=S(Fi=>{var Cm=f(l());Fi.read=function(t,e,r,n,i){var o,s,c=i*8-n-1,a=(1<<c)-1,u=a>>1,d=-7,h=r?i-1:0,w=r?-1:1,y=t[e+h];for(h+=w,o=y&(1<<-d)-1,y>>=-d,d+=c;d>0;o=o*256+t[e+h],h+=w,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=n;d>0;s=s*256+t[e+h],h+=w,d-=8);if(o===0)o=1-u;else{if(o===a)return s?NaN:(y?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-u}return(y?-1:1)*s*Math.pow(2,o-n)};Fi.write=function(t,e,r,n,i,o){var s,c,a,u=o*8-i-1,d=(1<<u)-1,h=d>>1,w=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:o-1,p=n?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,s=d):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),s+h>=1?e+=w/a:e+=w*Math.pow(2,1-h),e*a>=2&&(s++,a/=2),s+h>=d?(c=0,s=d):s+h>=1?(c=(e*a-1)*Math.pow(2,i),s=s+h):(c=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+y]=c&255,y+=p,c/=256,i-=8);for(s=s<<i|c,u+=i;u>0;t[r+y]=s&255,y+=p,s/=256,u-=8);t[r+y-p]|=b*128}});var fe=S(ur=>{"use strict";var Dm=f(l());var qi=Rc(),cr=Oc(),kc=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ur.Buffer=g;ur.SlowBuffer=Yd;ur.INSPECT_MAX_BYTES=50;var xn=2147483647;ur.kMaxLength=xn;g.TYPED_ARRAY_SUPPORT=Wd();!g.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 Wd(){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(g.prototype,"parent",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.buffer}});Object.defineProperty(g.prototype,"offset",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.byteOffset}});function We(t){if(t>xn)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,g.prototype),e}function g(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 Wi(t)}return Pc(t,e,r)}g.poolSize=8192;function Pc(t,e,r){if(typeof t=="string")return Hd(t,e);if(ArrayBuffer.isView(t))return Jd(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(Oe(t,ArrayBuffer)||t&&Oe(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Oe(t,SharedArrayBuffer)||t&&Oe(t.buffer,SharedArrayBuffer)))return $i(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 g.from(n,e,r);let i=zd(t);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return g.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)}g.from=function(t,e,r){return Pc(t,e,r)};Object.setPrototypeOf(g.prototype,Uint8Array.prototype);Object.setPrototypeOf(g,Uint8Array);function Dc(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 Gd(t,e,r){return Dc(t),t<=0?We(t):e!==void 0?typeof r=="string"?We(t).fill(e,r):We(t).fill(e):We(t)}g.alloc=function(t,e,r){return Gd(t,e,r)};function Wi(t){return Dc(t),We(t<0?0:Gi(t)|0)}g.allocUnsafe=function(t){return Wi(t)};g.allocUnsafeSlow=function(t){return Wi(t)};function Hd(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!g.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Nc(t,e)|0,n=We(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function ji(t){let e=t.length<0?0:Gi(t.length)|0,r=We(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Jd(t){if(Oe(t,Uint8Array)){let e=new Uint8Array(t);return $i(e.buffer,e.byteOffset,e.byteLength)}return ji(t)}function $i(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,g.prototype),n}function zd(t){if(g.isBuffer(t)){let e=Gi(t.length)|0,r=We(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Ji(t.length)?We(0):ji(t);if(t.type==="Buffer"&&Array.isArray(t.data))return ji(t.data)}function Gi(t){if(t>=xn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+xn.toString(16)+" bytes");return t|0}function Yd(t){return+t!=t&&(t=0),g.alloc(+t)}g.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==g.prototype};g.compare=function(e,r){if(Oe(e,Uint8Array)&&(e=g.from(e,e.offset,e.byteLength)),Oe(r,Uint8Array)&&(r=g.from(r,r.offset,r.byteLength)),!g.isBuffer(e)||!g.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 o=0,s=Math.min(n,i);o<s;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};g.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};g.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return g.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;let i=g.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){let s=e[n];if(Oe(s,Uint8Array))o+s.length>i.length?(g.isBuffer(s)||(s=g.from(s)),s.copy(i,o)):Uint8Array.prototype.set.call(i,s,o);else if(g.isBuffer(s))s.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return i};function Nc(t,e){if(g.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Oe(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 Vi(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Gc(t).length;default:if(i)return n?-1:Vi(t).length;e=(""+e).toLowerCase(),i=!0}}g.byteLength=Nc;function Xd(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 ch(this,e,r);case"utf8":case"utf-8":return Kc(this,e,r);case"ascii":return oh(this,e,r);case"latin1":case"binary":return sh(this,e,r);case"base64":return nh(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ah(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}g.prototype._isBuffer=!0;function _t(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}g.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;r<e;r+=2)_t(this,r,r+1);return this};g.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)_t(this,r,r+3),_t(this,r+1,r+2);return this};g.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)_t(this,r,r+7),_t(this,r+1,r+6),_t(this,r+2,r+5),_t(this,r+3,r+4);return this};g.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?Kc(this,0,e):Xd.apply(this,arguments)};g.prototype.toLocaleString=g.prototype.toString;g.prototype.equals=function(e){if(!g.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:g.compare(this,e)===0};g.prototype.inspect=function(){let e="",r=ur.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};kc&&(g.prototype[kc]=g.prototype.inspect);g.prototype.compare=function(e,r,n,i,o){if(Oe(e,Uint8Array)&&(e=g.from(e,e.offset,e.byteLength)),!g.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),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;let s=o-i,c=n-r,a=Math.min(s,c),u=this.slice(i,o),d=e.slice(r,n);for(let h=0;h<a;++h)if(u[h]!==d[h]){s=u[h],c=d[h];break}return s<c?-1:c<s?1:0};function Mc(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Ji(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=g.from(e,n)),g.isBuffer(e))return e.length===0?-1:Lc(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):Lc(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Lc(t,e,r,n,i){let o=1,s=t.length,c=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;o=2,s/=2,c/=2,r/=2}function a(d,h){return o===1?d[h]:d.readUInt16BE(h*o)}let u;if(i){let d=-1;for(u=r;u<s;u++)if(a(t,u)===a(e,d===-1?0:u-d)){if(d===-1&&(d=u),u-d+1===c)return d*o}else d!==-1&&(u-=u-d),d=-1}else for(r+c>s&&(r=s-c),u=r;u>=0;u--){let d=!0;for(let h=0;h<c;h++)if(a(t,u+h)!==a(e,h)){d=!1;break}if(d)return u}return-1}g.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};g.prototype.indexOf=function(e,r,n){return Mc(this,e,r,n,!0)};g.prototype.lastIndexOf=function(e,r,n){return Mc(this,e,r,n,!1)};function Zd(t,e,r,n){r=Number(r)||0;let i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;let o=e.length;n>o/2&&(n=o/2);let s;for(s=0;s<n;++s){let c=parseInt(e.substr(s*2,2),16);if(Ji(c))return s;t[r+s]=c}return s}function Qd(t,e,r,n){return En(Vi(e,t.length-r),t,r,n)}function eh(t,e,r,n){return En(dh(e),t,r,n)}function th(t,e,r,n){return En(Gc(e),t,r,n)}function rh(t,e,r,n){return En(hh(e,t.length-r),t,r,n)}g.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>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 o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return Zd(this,e,r,n);case"utf8":case"utf-8":return Qd(this,e,r,n);case"ascii":case"latin1":case"binary":return eh(this,e,r,n);case"base64":return th(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return rh(this,e,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nh(t,e,r){return e===0&&r===t.length?qi.fromByteArray(t):qi.fromByteArray(t.slice(e,r))}function Kc(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i<r;){let o=t[i],s=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=r){let a,u,d,h;switch(c){case 1:o<128&&(s=o);break;case 2:a=t[i+1],(a&192)===128&&(h=(o&31)<<6|a&63,h>127&&(s=h));break;case 3:a=t[i+1],u=t[i+2],(a&192)===128&&(u&192)===128&&(h=(o&15)<<12|(a&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:a=t[i+1],u=t[i+2],d=t[i+3],(a&192)===128&&(u&192)===128&&(d&192)===128&&(h=(o&15)<<18|(a&63)<<12|(u&63)<<6|d&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,c=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=c}return ih(n)}var Cc=4096;function ih(t){let e=t.length;if(e<=Cc)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Cc));return r}function oh(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function sh(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function ch(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let o=e;o<r;++o)i+=ph[t[o]];return i}function ah(t,e,r){let n=t.slice(e,r),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}g.prototype.slice=function(e,r){let n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);let i=this.subarray(e,r);return Object.setPrototypeOf(i,g.prototype),i};function re(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}g.prototype.readUintLE=g.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||re(e,r,this.length);let i=this[e],o=1,s=0;for(;++s<r&&(o*=256);)i+=this[e+s]*o;return i};g.prototype.readUintBE=g.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||re(e,r,this.length);let i=this[e+--r],o=1;for(;r>0&&(o*=256);)i+=this[e+--r]*o;return i};g.prototype.readUint8=g.prototype.readUInt8=function(e,r){return e=e>>>0,r||re(e,1,this.length),this[e]};g.prototype.readUint16LE=g.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||re(e,2,this.length),this[e]|this[e+1]<<8};g.prototype.readUint16BE=g.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||re(e,2,this.length),this[e]<<8|this[e+1]};g.prototype.readUint32LE=g.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||re(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};g.prototype.readUint32BE=g.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||re(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};g.prototype.readBigUInt64LE=ct(function(e){e=e>>>0,ar(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Ur(e,this.length-8);let i=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});g.prototype.readBigUInt64BE=ct(function(e){e=e>>>0,ar(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Ur(e,this.length-8);let i=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});g.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||re(e,r,this.length);let i=this[e],o=1,s=0;for(;++s<r&&(o*=256);)i+=this[e+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};g.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||re(e,r,this.length);let i=r,o=1,s=this[e+--i];for(;i>0&&(o*=256);)s+=this[e+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s};g.prototype.readInt8=function(e,r){return e=e>>>0,r||re(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};g.prototype.readInt16LE=function(e,r){e=e>>>0,r||re(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};g.prototype.readInt16BE=function(e,r){e=e>>>0,r||re(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};g.prototype.readInt32LE=function(e,r){return e=e>>>0,r||re(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};g.prototype.readInt32BE=function(e,r){return e=e>>>0,r||re(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};g.prototype.readBigInt64LE=ct(function(e){e=e>>>0,ar(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Ur(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});g.prototype.readBigInt64BE=ct(function(e){e=e>>>0,ar(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Ur(e,this.length-8);let i=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)});g.prototype.readFloatLE=function(e,r){return e=e>>>0,r||re(e,4,this.length),cr.read(this,e,!0,23,4)};g.prototype.readFloatBE=function(e,r){return e=e>>>0,r||re(e,4,this.length),cr.read(this,e,!1,23,4)};g.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||re(e,8,this.length),cr.read(this,e,!0,52,8)};g.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||re(e,8,this.length),cr.read(this,e,!1,52,8)};function ue(t,e,r,n,i,o){if(!g.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}g.prototype.writeUintLE=g.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let c=Math.pow(2,8*n)-1;ue(this,e,r,n,c,0)}let o=1,s=0;for(this[r]=e&255;++s<n&&(o*=256);)this[r+s]=e/o&255;return r+n};g.prototype.writeUintBE=g.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let c=Math.pow(2,8*n)-1;ue(this,e,r,n,c,0)}let o=n-1,s=1;for(this[r+o]=e&255;--o>=0&&(s*=256);)this[r+o]=e/s&255;return r+n};g.prototype.writeUint8=g.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||ue(this,e,r,1,255,0),this[r]=e&255,r+1};g.prototype.writeUint16LE=g.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||ue(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};g.prototype.writeUint16BE=g.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||ue(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};g.prototype.writeUint32LE=g.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||ue(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};g.prototype.writeUint32BE=g.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||ue(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 Fc(t,e,r,n,i){Wc(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,r}function qc(t,e,r,n,i){Wc(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s=s>>8,t[r+2]=s,s=s>>8,t[r+1]=s,s=s>>8,t[r]=s,r+8}g.prototype.writeBigUInt64LE=ct(function(e,r=0){return Fc(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});g.prototype.writeBigUInt64BE=ct(function(e,r=0){return qc(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});g.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let a=Math.pow(2,8*n-1);ue(this,e,r,n,a-1,-a)}let o=0,s=1,c=0;for(this[r]=e&255;++o<n&&(s*=256);)e<0&&c===0&&this[r+o-1]!==0&&(c=1),this[r+o]=(e/s>>0)-c&255;return r+n};g.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let a=Math.pow(2,8*n-1);ue(this,e,r,n,a-1,-a)}let o=n-1,s=1,c=0;for(this[r+o]=e&255;--o>=0&&(s*=256);)e<0&&c===0&&this[r+o+1]!==0&&(c=1),this[r+o]=(e/s>>0)-c&255;return r+n};g.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||ue(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};g.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||ue(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};g.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||ue(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};g.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||ue(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};g.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||ue(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};g.prototype.writeBigInt64LE=ct(function(e,r=0){return Fc(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});g.prototype.writeBigInt64BE=ct(function(e,r=0){return qc(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function jc(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function $c(t,e,r,n,i){return e=+e,r=r>>>0,i||jc(t,e,r,4,34028234663852886e22,-34028234663852886e22),cr.write(t,e,r,n,23,4),r+4}g.prototype.writeFloatLE=function(e,r,n){return $c(this,e,r,!0,n)};g.prototype.writeFloatBE=function(e,r,n){return $c(this,e,r,!1,n)};function Vc(t,e,r,n,i){return e=+e,r=r>>>0,i||jc(t,e,r,8,17976931348623157e292,-17976931348623157e292),cr.write(t,e,r,n,52,8),r+8}g.prototype.writeDoubleLE=function(e,r,n){return Vc(this,e,r,!0,n)};g.prototype.writeDoubleBE=function(e,r,n){return Vc(this,e,r,!1,n)};g.prototype.copy=function(e,r,n,i){if(!g.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<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=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<i-n&&(i=e.length-r+n);let o=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),r),o};g.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!g.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){let s=e.charCodeAt(0);(i==="utf8"&&s<128||i==="latin1")&&(e=s)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<n;++o)this[o]=e;else{let s=g.isBuffer(e)?e:g.from(e,i),c=s.length;if(c===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-r;++o)this[o+r]=s[o%c]}return this};var sr={};function Hi(t,e,r){sr[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}Hi("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Hi("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Hi("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=Uc(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Uc(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function Uc(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 uh(t,e,r){ar(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&Ur(e,t.length-(r+1))}function Wc(t,e,r,n,i,o){if(t>r||t<e){let s=typeof e=="bigint"?"n":"",c;throw o>3?e===0||e===BigInt(0)?c=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:c=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:c=`>= ${e}${s} and <= ${r}${s}`,new sr.ERR_OUT_OF_RANGE("value",c,t)}uh(n,i,o)}function ar(t,e){if(typeof t!="number")throw new sr.ERR_INVALID_ARG_TYPE(e,"number",t)}function Ur(t,e,r){throw Math.floor(t)!==t?(ar(t,r),new sr.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new sr.ERR_BUFFER_OUT_OF_BOUNDS:new sr.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var fh=/[^+/0-9A-Za-z-_]/g;function lh(t){if(t=t.split("=")[0],t=t.trim().replace(fh,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Vi(t,e){e=e||1/0;let r,n=t.length,i=null,o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function dh(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function hh(t,e){let r,n,i,o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function Gc(t){return qi.toByteArray(lh(t))}function En(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Oe(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Ji(t){return t!==t}var ph=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 ct(t){return typeof BigInt>"u"?yh:t}function yh(){throw new Error("BigInt not supported")}});var l=S(()=>{"use strict";var Hc=fe().Buffer,{Buffer:wh}=fe();Hc.prototype.writeBigUInt64BE=wh.prototype.writeBigUInt64BE;globalThis.Buffer=Hc});var zc=S((Km,Jc)=>{var Fm=f(l()),gh=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,vn=()=>gh.now(),bh=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),zi=t=>t===1/0||bh(t),Yi=class t{constructor({max:e=1/0,ttl:r,updateAgeOnGet:n=!1,checkAgeOnGet:i=!1,noUpdateTTL:o=!1,dispose:s,noDisposeOnSet:c=!1}={}){if(this.expirations=Object.create(null),this.data=new Map,this.expirationMap=new Map,r!==void 0&&!zi(r))throw new TypeError("ttl must be positive integer or Infinity if set");if(!zi(e))throw new TypeError("max must be positive integer or Infinity");if(this.ttl=r,this.max=e,this.updateAgeOnGet=!!n,this.checkAgeOnGet=!!i,this.noUpdateTTL=!!o,this.noDisposeOnSet=!!c,s!==void 0){if(typeof s!="function")throw new TypeError("dispose must be function if set");this.dispose=s}this.timer=void 0,this.timerExpiration=void 0}setTimer(e,r){if(this.timerExpiration<e)return;this.timer&&clearTimeout(this.timer);let n=setTimeout(()=>{this.timer=void 0,this.timerExpiration=void 0,this.purgeStale();for(let i in this.expirations){this.setTimer(i,i-vn());break}},r);n.unref&&n.unref(),this.timerExpiration=e,this.timer=n}cancelTimer(){this.timer&&(clearTimeout(this.timer),this.timerExpiration=void 0,this.timer=void 0)}cancelTimers(){return process.emitWarning('TTLCache.cancelTimers has been renamed to TTLCache.cancelTimer (no "s"), and will be removed in the next major version update'),this.cancelTimer()}clear(){let e=this.dispose!==t.prototype.dispose?[...this]:[];this.data.clear(),this.expirationMap.clear(),this.cancelTimer(),this.expirations=Object.create(null);for(let[r,n]of e)this.dispose(n,r,"delete")}setTTL(e,r=this.ttl){let n=this.expirationMap.get(e);if(n!==void 0){let i=this.expirations[n];!i||i.length<=1?delete this.expirations[n]:this.expirations[n]=i.filter(o=>o!==e)}if(r!==1/0){let i=Math.floor(vn()+r);this.expirationMap.set(e,i),this.expirations[i]||(this.expirations[i]=[],this.setTimer(i,r)),this.expirations[i].push(e)}else this.expirationMap.set(e,1/0)}set(e,r,{ttl:n=this.ttl,noUpdateTTL:i=this.noUpdateTTL,noDisposeOnSet:o=this.noDisposeOnSet}={}){if(!zi(n))throw new TypeError("ttl must be positive integer or Infinity");if(this.expirationMap.has(e)){i||this.setTTL(e,n);let s=this.data.get(e);s!==r&&(this.data.set(e,r),o||this.dispose(s,e,"set"))}else this.setTTL(e,n),this.data.set(e,r);for(;this.size>this.max;)this.purgeToCapacity();return this}has(e){return this.data.has(e)}getRemainingTTL(e){let r=this.expirationMap.get(e);return r===1/0?r:r!==void 0?Math.max(0,Math.ceil(r-vn())):0}get(e,{updateAgeOnGet:r=this.updateAgeOnGet,ttl:n=this.ttl,checkAgeOnGet:i=this.checkAgeOnGet}={}){let o=this.data.get(e);if(i&&this.getRemainingTTL(e)===0){this.delete(e);return}return r&&this.setTTL(e,n),o}dispose(e,r){}delete(e){let r=this.expirationMap.get(e);if(r!==void 0){let n=this.data.get(e);this.data.delete(e),this.expirationMap.delete(e);let i=this.expirations[r];return i&&(i.length<=1?delete this.expirations[r]:this.expirations[r]=i.filter(o=>o!==e)),this.dispose(n,e,"delete"),this.size===0&&this.cancelTimer(),!0}return!1}purgeToCapacity(){for(let e in this.expirations){let r=this.expirations[e];if(this.size-r.length>=this.max){delete this.expirations[e];let n=[];for(let i of r)n.push([i,this.data.get(i)]),this.data.delete(i),this.expirationMap.delete(i);for(let[i,o]of n)this.dispose(o,i,"evict")}else{let n=this.size-this.max,i=[];for(let o of r.splice(0,n))i.push([o,this.data.get(o)]),this.data.delete(o),this.expirationMap.delete(o);for(let[o,s]of i)this.dispose(s,o,"evict");return}}}get size(){return this.data.size}purgeStale(){let e=Math.ceil(vn());for(let r in this.expirations){if(r==="Infinity"||r>e)return;let n=[...this.expirations[r]||[]],i=[];delete this.expirations[r];for(let o of n)i.push([o,this.data.get(o)]),this.data.delete(o),this.expirationMap.delete(o);for(let[o,s]of i)this.dispose(s,o,"stale")}this.size===0&&this.cancelTimer()}*entries(){for(let e in this.expirations)for(let r of this.expirations[e])yield[r,this.data.get(r)]}*keys(){for(let e in this.expirations)for(let r of this.expirations[e])yield r}*values(){for(let e in this.expirations)for(let r of this.expirations[e])yield this.data.get(r)}[Symbol.iterator](){return this.entries()}};Jc.exports=Yi});var da=S(la=>{"use strict";var Qx=f(l());la.supports=function(...e){let r=e.reduce((n,i)=>Object.assign(n,i),{});return Object.assign(r,{snapshots:r.snapshots||!1,permanence:r.permanence||!1,seek:r.seek||!1,clear:r.clear||!1,getMany:r.getMany||!1,keyIterator:r.keyIterator||!1,valueIterator:r.valueIterator||!1,iteratorNextv:r.iteratorNextv||!1,iteratorAll:r.iteratorAll||!1,status:r.status||!1,createIfMissing:r.createIfMissing||!1,errorIfExists:r.errorIfExists||!1,deferredOpen:r.deferredOpen||!1,promises:r.promises||!1,streams:r.streams||!1,encodings:Object.assign({},r.encodings),events:Object.assign({},r.events),additionalMethods:Object.assign({},r.additionalMethods)})}});var _e=S((tE,ha)=>{"use strict";var rE=f(l());ha.exports=class extends Error{constructor(e,r){super(e||""),typeof r=="object"&&r!==null&&(r.code&&(this.code=String(r.code)),r.expected&&(this.expected=!0),r.transient&&(this.transient=!0),r.cause&&(this.cause=r.cause)),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}});var fo=S((nE,pa)=>{"use strict";var iE=f(l()),uo=null;pa.exports=function(){return uo===null&&(uo={textEncoder:new TextEncoder,textDecoder:new TextDecoder}),uo}});var po=S(ya=>{"use strict";var sE=f(l()),lo=_e(),Yh=new Set(["buffer","view","utf8"]),ho=class{constructor(e){if(this.encode=e.encode||this.encode,this.decode=e.decode||this.decode,this.name=e.name||this.name,this.format=e.format||this.format,typeof this.encode!="function")throw new TypeError("The 'encode' property must be a function");if(typeof this.decode!="function")throw new TypeError("The 'decode' property must be a function");if(this.encode=this.encode.bind(this),this.decode=this.decode.bind(this),typeof this.name!="string"||this.name==="")throw new TypeError("The 'name' property must be a string");if(typeof this.format!="string"||!Yh.has(this.format))throw new TypeError("The 'format' property must be one of 'buffer', 'view', 'utf8'");e.createViewTranscoder&&(this.createViewTranscoder=e.createViewTranscoder),e.createBufferTranscoder&&(this.createBufferTranscoder=e.createBufferTranscoder),e.createUTF8Transcoder&&(this.createUTF8Transcoder=e.createUTF8Transcoder)}get commonName(){return this.name.split("+")[0]}createBufferTranscoder(){throw new lo(`Encoding '${this.name}' cannot be transcoded to 'buffer'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createViewTranscoder(){throw new lo(`Encoding '${this.name}' cannot be transcoded to 'view'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createUTF8Transcoder(){throw new lo(`Encoding '${this.name}' cannot be transcoded to 'utf8'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}};ya.Encoding=ho});var bo=S(Tn=>{"use strict";var aE=f(l()),{Buffer:wo}=fe()||{},{Encoding:go}=po(),Xh=fo(),Kr=class extends go{constructor(e){super({...e,format:"buffer"})}createViewTranscoder(){return new Fr({encode:this.encode,decode:e=>this.decode(wo.from(e.buffer,e.byteOffset,e.byteLength)),name:`${this.name}+view`})}createBufferTranscoder(){return this}},Fr=class extends go{constructor(e){super({...e,format:"view"})}createBufferTranscoder(){return new Kr({encode:e=>{let r=this.encode(e);return wo.from(r.buffer,r.byteOffset,r.byteLength)},decode:this.decode,name:`${this.name}+buffer`})}createViewTranscoder(){return this}},yo=class extends go{constructor(e){super({...e,format:"utf8"})}createBufferTranscoder(){return new Kr({encode:e=>wo.from(this.encode(e),"utf8"),decode:e=>this.decode(e.toString("utf8")),name:`${this.name}+buffer`})}createViewTranscoder(){let{textEncoder:e,textDecoder:r}=Xh();return new Fr({encode:n=>e.encode(this.encode(n)),decode:n=>this.decode(r.decode(n)),name:`${this.name}+view`})}createUTF8Transcoder(){return this}};Tn.BufferFormat=Kr;Tn.ViewFormat=Fr;Tn.UTF8Format=yo});var ma=S(Bt=>{"use strict";var fE=f(l()),{Buffer:oe}=fe()||{Buffer:{isBuffer:()=>!1}},{textEncoder:ga,textDecoder:wa}=fo()(),{BufferFormat:qr,ViewFormat:mo,UTF8Format:ba}=bo(),An=t=>t;Bt.utf8=new ba({encode:function(t){return oe.isBuffer(t)?t.toString("utf8"):ArrayBuffer.isView(t)?wa.decode(t):String(t)},decode:An,name:"utf8",createViewTranscoder(){return new mo({encode:function(t){return ArrayBuffer.isView(t)?t:ga.encode(t)},decode:function(t){return wa.decode(t)},name:`${this.name}+view`})},createBufferTranscoder(){return new qr({encode:function(t){return oe.isBuffer(t)?t:ArrayBuffer.isView(t)?oe.from(t.buffer,t.byteOffset,t.byteLength):oe.from(String(t),"utf8")},decode:function(t){return t.toString("utf8")},name:`${this.name}+buffer`})}});Bt.json=new ba({encode:JSON.stringify,decode:JSON.parse,name:"json"});Bt.buffer=new qr({encode:function(t){return oe.isBuffer(t)?t:ArrayBuffer.isView(t)?oe.from(t.buffer,t.byteOffset,t.byteLength):oe.from(String(t),"utf8")},decode:An,name:"buffer",createViewTranscoder(){return new mo({encode:function(t){return ArrayBuffer.isView(t)?t:oe.from(String(t),"utf8")},decode:function(t){return oe.from(t.buffer,t.byteOffset,t.byteLength)},name:`${this.name}+view`})}});Bt.view=new mo({encode:function(t){return ArrayBuffer.isView(t)?t:ga.encode(t)},decode:An,name:"view",createBufferTranscoder(){return new qr({encode:function(t){return oe.isBuffer(t)?t:ArrayBuffer.isView(t)?oe.from(t.buffer,t.byteOffset,t.byteLength):oe.from(String(t),"utf8")},decode:An,name:`${this.name}+buffer`})}});Bt.hex=new qr({encode:function(t){return oe.isBuffer(t)?t:oe.from(String(t),"hex")},decode:function(t){return t.toString("hex")},name:"hex"});Bt.base64=new qr({encode:function(t){return oe.isBuffer(t)?t:oe.from(String(t),"base64")},decode:function(t){return t.toString("base64")},name:"base64"})});var va=S(Ea=>{"use strict";var dE=f(l()),xa=_e(),In=ma(),{Encoding:Zh}=po(),{BufferFormat:Qh,ViewFormat:ep,UTF8Format:tp}=bo(),jr=Symbol("formats"),Bn=Symbol("encodings"),rp=new Set(["buffer","view","utf8"]),xo=class{constructor(e){if(Array.isArray(e)){if(!e.every(r=>rp.has(r)))throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'")}else throw new TypeError("The first argument 'formats' must be an array");this[Bn]=new Map,this[jr]=new Set(e);for(let r in In)try{this.encoding(r)}catch(n){if(n.code!=="LEVEL_ENCODING_NOT_SUPPORTED")throw n}}encodings(){return Array.from(new Set(this[Bn].values()))}encoding(e){let r=this[Bn].get(e);if(r===void 0){if(typeof e=="string"&&e!==""){if(r=sp[e],!r)throw new xa(`Encoding '${e}' is not found`,{code:"LEVEL_ENCODING_NOT_FOUND"})}else{if(typeof e!="object"||e===null)throw new TypeError("First argument 'encoding' must be a string or object");r=np(e)}let{name:n,format:i}=r;if(!this[jr].has(i))if(this[jr].has("view"))r=r.createViewTranscoder();else if(this[jr].has("buffer"))r=r.createBufferTranscoder();else if(this[jr].has("utf8"))r=r.createUTF8Transcoder();else throw new xa(`Encoding '${n}' cannot be transcoded`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"});for(let o of[e,n,r.name,r.commonName])this[Bn].set(o,r)}return r}};Ea.Transcoder=xo;function np(t){if(t instanceof Zh)return t;let e="type"in t&&typeof t.type=="string"?t.type:void 0,r=t.name||e||`anonymous-${cp++}`;switch(ip(t)){case"view":return new ep({...t,name:r});case"utf8":return new tp({...t,name:r});case"buffer":return new Qh({...t,name:r});default:throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'")}}function ip(t){return"format"in t&&t.format!==void 0?t.format:"buffer"in t&&typeof t.buffer=="boolean"?t.buffer?"buffer":"utf8":"code"in t&&Number.isInteger(t.code)?"view":"buffer"}var op={binary:In.buffer,"utf-8":In.utf8},sp={...In,...op},cp=0});var $r=S((hE,Eo)=>{"use strict";var pE=f(l()),hr=typeof Reflect=="object"?Reflect:null,_a=hr&&typeof hr.apply=="function"?hr.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Rn;hr&&typeof hr.ownKeys=="function"?Rn=hr.ownKeys:Object.getOwnPropertySymbols?Rn=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Rn=function(e){return Object.getOwnPropertyNames(e)};function ap(t){console&&console.warn&&console.warn(t)}var Ta=Number.isNaN||function(e){return e!==e};function M(){M.init.call(this)}Eo.exports=M;Eo.exports.once=dp;M.EventEmitter=M;M.prototype._events=void 0;M.prototype._eventsCount=0;M.prototype._maxListeners=void 0;var Sa=10;function On(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(M,"defaultMaxListeners",{enumerable:!0,get:function(){return Sa},set:function(t){if(typeof t!="number"||t<0||Ta(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Sa=t}});M.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};M.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Ta(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 Aa(t){return t._maxListeners===void 0?M.defaultMaxListeners:t._maxListeners}M.prototype.getMaxListeners=function(){return Aa(this)};M.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var s;if(r.length>0&&(s=r[0]),s instanceof Error)throw s;var c=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw c.context=s,c}var a=o[e];if(a===void 0)return!1;if(typeof a=="function")_a(a,this,r);else for(var u=a.length,d=ka(a,u),n=0;n<u;++n)_a(d[n],this,r);return!0};function Ba(t,e,r,n){var i,o,s;if(On(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),s===void 0)s=o[e]=r,++t._eventsCount;else if(typeof s=="function"?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),i=Aa(t),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=s.length,ap(c)}return t}M.prototype.addListener=function(e,r){return Ba(this,e,r,!1)};M.prototype.on=M.prototype.addListener;M.prototype.prependListener=function(e,r){return Ba(this,e,r,!0)};function up(){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 Ia(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=up.bind(n);return i.listener=r,n.wrapFn=i,i}M.prototype.once=function(e,r){return On(r),this.on(e,Ia(this,e,r)),this};M.prototype.prependOnceListener=function(e,r){return On(r),this.prependListener(e,Ia(this,e,r)),this};M.prototype.removeListener=function(e,r){var n,i,o,s,c;if(On(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(o=-1,s=n.length-1;s>=0;s--)if(n[s]===r||n[s].listener===r){c=n[s].listener,o=s;break}if(o<0)return this;o===0?n.shift():fp(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,c||r)}return this};M.prototype.off=M.prototype.removeListener;M.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 o=Object.keys(n),s;for(i=0;i<o.length;++i)s=o[i],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function Ra(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?lp(i):ka(i,i.length)}M.prototype.listeners=function(e){return Ra(this,e,!0)};M.prototype.rawListeners=function(e){return Ra(this,e,!1)};M.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Oa.call(t,e)};M.prototype.listenerCount=Oa;function Oa(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}M.prototype.eventNames=function(){return this._eventsCount>0?Rn(this._events):[]};function ka(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function fp(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function lp(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function dp(t,e){return new Promise(function(r,n){function i(s){t.removeListener(e,o),n(s)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}La(t,e,o,{once:!0}),e!=="error"&&hp(t,i,{once:!0})})}function hp(t,e,r){typeof t.on=="function"&&La(t,"error",e,r)}function La(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}});var Ua=S((yE,Ca)=>{var wE=f(l());Ca.exports=typeof queueMicrotask=="function"?queueMicrotask:t=>Promise.resolve().then(t)});var Vr=S(vo=>{"use strict";var bE=f(l()),Pa=Ua();vo.fromCallback=function(t,e){if(t===void 0){var r=new Promise(function(n,i){t=function(o,s){o?i(o):n(s)}});t[e!==void 0?e:"promise"]=r}else if(typeof t!="function")throw new TypeError("Callback must be a function");return t};vo.fromPromise=function(t,e){if(e===void 0)return t;t.then(function(r){Pa(()=>e(null,r))}).catch(function(r){Pa(()=>e(r))})}});var kn=S(_o=>{"use strict";var xE=f(l());_o.getCallback=function(t,e){return typeof t=="function"?t:e};_o.getOptions=function(t,e){return typeof t=="object"&&t!==null?t:e!==void 0?e:{}}});var ht=S(Pn=>{"use strict";var vE=f(l()),{fromCallback:So}=Vr(),pe=_e(),{getOptions:To,getCallback:Da}=kn(),It=Symbol("promise"),pr=Symbol("callback"),Le=Symbol("working"),Rt=Symbol("handleOne"),He=Symbol("handleMany"),Ao=Symbol("autoClose"),lt=Symbol("finishWork"),Ce=Symbol("returnMany"),at=Symbol("closing"),Wr=Symbol("handleClose"),Ln=Symbol("closed"),Gr=Symbol("closeCallbacks"),ft=Symbol("keyEncoding"),Ot=Symbol("valueEncoding"),Bo=Symbol("abortOnClose"),Cn=Symbol("legacy"),Io=Symbol("keys"),Ro=Symbol("values"),ut=Symbol("limit"),be=Symbol("count"),Un=Object.freeze({}),pp=()=>{},Na=!1,Hr=class{constructor(e,r,n){if(typeof e!="object"||e===null){let i=e===null?"null":typeof e;throw new TypeError(`The first argument must be an abstract-level database, received ${i}`)}if(typeof r!="object"||r===null)throw new TypeError("The second argument must be an options object");this[Ln]=!1,this[Gr]=[],this[Le]=!1,this[at]=!1,this[Ao]=!1,this[pr]=null,this[Rt]=this[Rt].bind(this),this[He]=this[He].bind(this),this[Wr]=this[Wr].bind(this),this[ft]=r[ft],this[Ot]=r[Ot],this[Cn]=n,this[ut]=Number.isInteger(r.limit)&&r.limit>=0?r.limit:1/0,this[be]=0,this[Bo]=!!r.abortOnClose,this.db=e,this.db.attachResource(this),this.nextTick=e.nextTick}get count(){return this[be]}get limit(){return this[ut]}next(e){let r;if(e===void 0)r=new Promise((n,i)=>{e=(o,s,c)=>{o?i(o):this[Cn]?s===void 0&&c===void 0?n():n([s,c]):n(s)}});else if(typeof e!="function")throw new TypeError("Callback must be a function");return this[at]?this.nextTick(e,new pe("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[Le]?this.nextTick(e,new pe("Iterator is busy: cannot call next() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[Le]=!0,this[pr]=e,this[be]>=this[ut]?this.nextTick(this[Rt],null):this._next(this[Rt])),r}_next(e){this.nextTick(e)}nextv(e,r,n){return n=Da(r,n),n=So(n,It),r=To(r,Un),Number.isInteger(e)?(this[at]?this.nextTick(n,new pe("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[Le]?this.nextTick(n,new pe("Iterator is busy: cannot call nextv() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(e<1&&(e=1),this[ut]<1/0&&(e=Math.min(e,this[ut]-this[be])),this[Le]=!0,this[pr]=n,e<=0?this.nextTick(this[He],null,[]):this._nextv(e,r,this[He])),n[It]):(this.nextTick(n,new TypeError("The first argument 'size' must be an integer")),n[It])}_nextv(e,r,n){let i=[],o=(s,c,a)=>{if(s)return n(s);if(this[Cn]?c===void 0&&a===void 0:c===void 0)return n(null,i);i.push(this[Cn]?[c,a]:c),i.length===e?n(null,i):this._next(o)};this._next(o)}all(e,r){return r=Da(e,r),r=So(r,It),e=To(e,Un),this[at]?this.nextTick(r,new pe("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[Le]?this.nextTick(r,new pe("Iterator is busy: cannot call all() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[Le]=!0,this[pr]=r,this[Ao]=!0,this[be]>=this[ut]?this.nextTick(this[He],null,[]):this._all(e,this[He])),r[It]}_all(e,r){let n=this[be],i=[],o=()=>{let c=this[ut]<1/0?Math.min(1e3,this[ut]-n):1e3;c<=0?this.nextTick(r,null,i):this._nextv(c,Un,s)},s=(c,a)=>{c?r(c):a.length===0?r(null,i):(i.push.apply(i,a),n+=a.length,o())};o()}[lt](){let e=this[pr];return this[Bo]&&e===null?pp:(this[Le]=!1,this[pr]=null,this[at]&&this._close(this[Wr]),e)}[Ce](e,r,n){this[Ao]?this.close(e.bind(null,r,n)):e(r,n)}seek(e,r){if(r=To(r,Un),!this[at]){if(this[Le])throw new pe("Iterator is busy: cannot call seek() until next() has completed",{code:"LEVEL_ITERATOR_BUSY"});{let n=this.db.keyEncoding(r.keyEncoding||this[ft]),i=n.format;r.keyEncoding!==i&&(r={...r,keyEncoding:i});let o=this.db.prefixKey(n.encode(e),i);this._seek(o,r)}}}_seek(e,r){throw new pe("Iterator does not support seek()",{code:"LEVEL_NOT_SUPPORTED"})}close(e){return e=So(e,It),this[Ln]?this.nextTick(e):this[at]?this[Gr].push(e):(this[at]=!0,this[Gr].push(e),this[Le]?this[Bo]&&this[lt]()(new pe("Aborted on iterator close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this._close(this[Wr])),e[It]}_close(e){this.nextTick(e)}[Wr](){this[Ln]=!0,this.db.detachResource(this);let e=this[Gr];this[Gr]=[];for(let r of e)r()}async*[Symbol.asyncIterator](){try{let e;for(;(e=await this.next())!==void 0;)yield e}finally{this[Ln]||await this.close()}}},yr=class extends Hr{constructor(e,r){super(e,r,!0),this[Io]=r.keys!==!1,this[Ro]=r.values!==!1}[Rt](e,r,n){let i=this[lt]();if(e)return i(e);try{r=this[Io]&&r!==void 0?this[ft].decode(r):void 0,n=this[Ro]&&n!==void 0?this[Ot].decode(n):void 0}catch(o){return i(new dt("entry",o))}r===void 0&&n===void 0||this[be]++,i(null,r,n)}[He](e,r){let n=this[lt]();if(e)return this[Ce](n,e);try{for(let i of r){let o=i[0],s=i[1];i[0]=this[Io]&&o!==void 0?this[ft].decode(o):void 0,i[1]=this[Ro]&&s!==void 0?this[Ot].decode(s):void 0}}catch(i){return this[Ce](n,new dt("entries",i))}this[be]+=r.length,this[Ce](n,null,r)}end(e){return!Na&&typeof console<"u"&&(Na=!0,console.warn(new pe("The iterator.end() method was renamed to close() and end() is an alias that will be removed in a future version",{code:"LEVEL_LEGACY"}))),this.close(e)}},Oo=class extends Hr{constructor(e,r){super(e,r,!1)}[Rt](e,r){let n=this[lt]();if(e)return n(e);try{r=r!==void 0?this[ft].decode(r):void 0}catch(i){return n(new dt("key",i))}r!==void 0&&this[be]++,n(null,r)}[He](e,r){let n=this[lt]();if(e)return this[Ce](n,e);try{for(let i=0;i<r.length;i++){let o=r[i];r[i]=o!==void 0?this[ft].decode(o):void 0}}catch(i){return this[Ce](n,new dt("keys",i))}this[be]+=r.length,this[Ce](n,null,r)}},ko=class extends Hr{constructor(e,r){super(e,r,!1)}[Rt](e,r){let n=this[lt]();if(e)return n(e);try{r=r!==void 0?this[Ot].decode(r):void 0}catch(i){return n(new dt("value",i))}r!==void 0&&this[be]++,n(null,r)}[He](e,r){let n=this[lt]();if(e)return this[Ce](n,e);try{for(let i=0;i<r.length;i++){let o=r[i];r[i]=o!==void 0?this[Ot].decode(o):void 0}}catch(i){return this[Ce](n,new dt("values",i))}this[be]+=r.length,this[Ce](n,null,r)}},dt=class extends pe{constructor(e,r){super(`Iterator could not decode ${e}`,{code:"LEVEL_DECODE_ERROR",cause:r})}};for(let t of["_ended property","_nexting property","_end method"])Object.defineProperty(yr.prototype,t.split(" ")[0],{get(){throw new pe(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})},set(){throw new pe(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})}});yr.keyEncoding=ft;yr.valueEncoding=Ot;Pn.AbstractIterator=yr;Pn.AbstractKeyIterator=Oo;Pn.AbstractValueIterator=ko});var Ma=S(Lo=>{"use strict";var SE=f(l()),{AbstractKeyIterator:yp,AbstractValueIterator:wp}=ht(),kt=Symbol("iterator"),Jr=Symbol("callback"),wr=Symbol("handleOne"),Lt=Symbol("handleMany"),zr=class extends yp{constructor(e,r){super(e,r),this[kt]=e.iterator({...r,keys:!0,values:!1}),this[wr]=this[wr].bind(this),this[Lt]=this[Lt].bind(this)}},Dn=class extends wp{constructor(e,r){super(e,r),this[kt]=e.iterator({...r,keys:!1,values:!0}),this[wr]=this[wr].bind(this),this[Lt]=this[Lt].bind(this)}};for(let t of[zr,Dn]){let e=t===zr,r=e?n=>n[0]:n=>n[1];t.prototype._next=function(n){this[Jr]=n,this[kt].next(this[wr])},t.prototype[wr]=function(n,i,o){let s=this[Jr];n?s(n):s(null,e?i:o)},t.prototype._nextv=function(n,i,o){this[Jr]=o,this[kt].nextv(n,i,this[Lt])},t.prototype._all=function(n,i){this[Jr]=i,this[kt].all(n,this[Lt])},t.prototype[Lt]=function(n,i){let o=this[Jr];n?o(n):o(null,i.map(r))},t.prototype._seek=function(n,i){this[kt].seek(n,i)},t.prototype._close=function(n){this[kt].close(n)}}Lo.DefaultKeyIterator=zr;Lo.DefaultValueIterator=Dn});var Ka=S(jn=>{"use strict";var AE=f(l()),{AbstractIterator:gp,AbstractKeyIterator:bp,AbstractValueIterator:mp}=ht(),Co=_e(),de=Symbol("nut"),Fn=Symbol("undefer"),qn=Symbol("factory"),Nn=class extends gp{constructor(e,r){super(e,r),this[de]=null,this[qn]=()=>e.iterator(r),this.db.defer(()=>this[Fn]())}},Mn=class extends bp{constructor(e,r){super(e,r),this[de]=null,this[qn]=()=>e.keys(r),this.db.defer(()=>this[Fn]())}},Kn=class extends mp{constructor(e,r){super(e,r),this[de]=null,this[qn]=()=>e.values(r),this.db.defer(()=>this[Fn]())}};for(let t of[Nn,Mn,Kn])t.prototype[Fn]=function(){this.db.status==="open"&&(this[de]=this[qn]())},t.prototype._next=function(e){this[de]!==null?this[de].next(e):this.db.status==="opening"?this.db.defer(()=>this._next(e)):this.nextTick(e,new Co("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._nextv=function(e,r,n){this[de]!==null?this[de].nextv(e,r,n):this.db.status==="opening"?this.db.defer(()=>this._nextv(e,r,n)):this.nextTick(n,new Co("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._all=function(e,r){this[de]!==null?this[de].all(r):this.db.status==="opening"?this.db.defer(()=>this._all(e,r)):this.nextTick(r,new Co("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._seek=function(e,r){this[de]!==null?this[de]._seek(e,r):this.db.status==="opening"&&this.db.defer(()=>this._seek(e,r))},t.prototype._close=function(e){this[de]!==null?this[de].close(e):this.db.status==="opening"?this.db.defer(()=>this._close(e)):this.nextTick(e)};jn.DeferredIterator=Nn;jn.DeferredKeyIterator=Mn;jn.DeferredValueIterator=Kn});var Po=S(qa=>{"use strict";var IE=f(l()),{fromCallback:Fa}=Vr(),$n=_e(),{getCallback:xp,getOptions:Ep}=kn(),Vn=Symbol("promise"),me=Symbol("status"),gr=Symbol("operations"),Yr=Symbol("finishClose"),br=Symbol("closeCallbacks"),Uo=class{constructor(e){if(typeof e!="object"||e===null){let r=e===null?"null":typeof e;throw new TypeError(`The first argument must be an abstract-level database, received ${r}`)}this[gr]=[],this[br]=[],this[me]="open",this[Yr]=this[Yr].bind(this),this.db=e,this.db.attachResource(this),this.nextTick=e.nextTick}get length(){return this[gr].length}put(e,r,n){if(this[me]!=="open")throw new $n("Batch is not open: cannot call put() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});let i=this.db._checkKey(e)||this.db._checkValue(r);if(i)throw i;let o=n&&n.sublevel!=null?n.sublevel:this.db,s=n,c=o.keyEncoding(n&&n.keyEncoding),a=o.valueEncoding(n&&n.valueEncoding),u=c.format;n={...n,keyEncoding:u,valueEncoding:a.format},o!==this.db&&(n.sublevel=null);let d=o.prefixKey(c.encode(e),u),h=a.encode(r);return this._put(d,h,n),this[gr].push({...s,type:"put",key:e,value:r}),this}_put(e,r,n){}del(e,r){if(this[me]!=="open")throw new $n("Batch is not open: cannot call del() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});let n=this.db._checkKey(e);if(n)throw n;let i=r&&r.sublevel!=null?r.sublevel:this.db,o=r,s=i.keyEncoding(r&&r.keyEncoding),c=s.format;return r={...r,keyEncoding:c},i!==this.db&&(r.sublevel=null),this._del(i.prefixKey(s.encode(e),c),r),this[gr].push({...o,type:"del",key:e}),this}_del(e,r){}clear(){if(this[me]!=="open")throw new $n("Batch is not open: cannot call clear() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});return this._clear(),this[gr]=[],this}_clear(){}write(e,r){return r=xp(e,r),r=Fa(r,Vn),e=Ep(e),this[me]!=="open"?this.nextTick(r,new $n("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"})):this.length===0?this.close(r):(this[me]="writing",this._write(e,n=>{this[me]="closing",this[br].push(()=>r(n)),n||this.db.emit("batch",this[gr]),this._close(this[Yr])})),r[Vn]}_write(e,r){}close(e){return e=Fa(e,Vn),this[me]==="closing"?this[br].push(e):this[me]==="closed"?this.nextTick(e):(this[br].push(e),this[me]!=="writing"&&(this[me]="closing",this._close(this[Yr]))),e[Vn]}_close(e){this.nextTick(e)}[Yr](){this[me]="closed",this.db.detachResource(this);let e=this[br];this[br]=[];for(let r of e)r()}};qa.AbstractChainedBatch=Uo});var $a=S(ja=>{"use strict";var OE=f(l()),{AbstractChainedBatch:vp}=Po(),_p=_e(),mr=Symbol("encoded"),Do=class extends vp{constructor(e){super(e),this[mr]=[]}_put(e,r,n){this[mr].push({...n,type:"put",key:e,value:r})}_del(e,r){this[mr].push({...r,type:"del",key:e})}_clear(){this[mr]=[]}_write(e,r){this.db.status==="opening"?this.db.defer(()=>this._write(e,r)):this.db.status==="open"?this[mr].length===0?this.nextTick(r):this.db._batch(this[mr],e,r):this.nextTick(r,new _p("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"}))}};ja.DefaultChainedBatch=Do});var Ga=S((kE,Wa)=>{"use strict";var LE=f(l()),Va=_e(),Sp=Object.prototype.hasOwnProperty,Tp=new Set(["lt","lte","gt","gte"]);Wa.exports=function(t,e){let r={};for(let n in t)if(Sp.call(t,n)&&!(n==="keyEncoding"||n==="valueEncoding")){if(n==="start"||n==="end")throw new Va(`The legacy range option '${n}' has been removed`,{code:"LEVEL_LEGACY"});if(n==="encoding")throw new Va("The levelup-style 'encoding' alias has been removed, use 'valueEncoding' instead",{code:"LEVEL_LEGACY"});Tp.has(n)?r[n]=e.encode(t[n]):r[n]=t[n]}return r.reverse=!!r.reverse,r.limit=Number.isInteger(r.limit)&&r.limit>=0?r.limit:-1,r}});var No=S((CE,Ja)=>{var UE=f(l());var Ha;Ja.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:globalThis):t=>(Ha||(Ha=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var Xa=S((PE,Ya)=>{"use strict";var DE=f(l()),za=No();Ya.exports=function(t,...e){e.length===0?za(t):za(()=>t(...e))}});var Za=S(Wn=>{"use strict";var ME=f(l()),{AbstractIterator:Ap,AbstractKeyIterator:Bp,AbstractValueIterator:Ip}=ht(),xr=Symbol("unfix"),Se=Symbol("iterator"),Ct=Symbol("handleOne"),pt=Symbol("handleMany"),Je=Symbol("callback"),Xr=class extends Ap{constructor(e,r,n,i){super(e,r),this[Se]=n,this[xr]=i,this[Ct]=this[Ct].bind(this),this[pt]=this[pt].bind(this),this[Je]=null}[Ct](e,r,n){let i=this[Je];if(e)return i(e);r!==void 0&&(r=this[xr](r)),i(e,r,n)}[pt](e,r){let n=this[Je];if(e)return n(e);for(let i of r){let o=i[0];o!==void 0&&(i[0]=this[xr](o))}n(e,r)}},Zr=class extends Bp{constructor(e,r,n,i){super(e,r),this[Se]=n,this[xr]=i,this[Ct]=this[Ct].bind(this),this[pt]=this[pt].bind(this),this[Je]=null}[Ct](e,r){let n=this[Je];if(e)return n(e);r!==void 0&&(r=this[xr](r)),n(e,r)}[pt](e,r){let n=this[Je];if(e)return n(e);for(let i=0;i<r.length;i++){let o=r[i];o!==void 0&&(r[i]=this[xr](o))}n(e,r)}},Qr=class extends Ip{constructor(e,r,n){super(e,r),this[Se]=n}};for(let t of[Xr,Zr])t.prototype._next=function(e){this[Je]=e,this[Se].next(this[Ct])},t.prototype._nextv=function(e,r,n){this[Je]=n,this[Se].nextv(e,r,this[pt])},t.prototype._all=function(e,r){this[Je]=r,this[Se].all(e,this[pt])};for(let t of[Qr])t.prototype._next=function(e){this[Se].next(e)},t.prototype._nextv=function(e,r,n){this[Se].nextv(e,r,n)},t.prototype._all=function(e,r){this[Se].all(e,r)};for(let t of[Xr,Zr,Qr])t.prototype._seek=function(e,r){this[Se].seek(e,r)},t.prototype._close=function(e){this[Se].close(e)};Wn.AbstractSublevelIterator=Xr;Wn.AbstractSublevelKeyIterator=Zr;Wn.AbstractSublevelValueIterator=Qr});var ru=S((KE,tu)=>{"use strict";var FE=f(l()),Mo=_e(),{Buffer:qo}=fe()||{},{AbstractSublevelIterator:Rp,AbstractSublevelKeyIterator:Op,AbstractSublevelValueIterator:kp}=Za(),ze=Symbol("prefix"),Qa=Symbol("upperBound"),en=Symbol("prefixRange"),ye=Symbol("parent"),Ko=Symbol("unfix"),eu=new TextEncoder,Lp={separator:"!"};tu.exports=function({AbstractLevel:t}){class e extends t{static defaults(n){if(typeof n=="string")throw new Mo("The subleveldown string shorthand for { separator } has been removed",{code:"LEVEL_LEGACY"});if(n&&n.open)throw new Mo("The subleveldown open option has been removed",{code:"LEVEL_LEGACY"});return n==null?Lp:n.separator?n:{...n,separator:"!"}}constructor(n,i,o){let{separator:s,manifest:c,...a}=e.defaults(o);i=Up(i,s);let u=s.charCodeAt(0)+1,d=n[ye]||n;if(!eu.encode(i).every(y=>y>u&&y<127))throw new Mo(`Prefix must use bytes > ${u} < 127`,{code:"LEVEL_INVALID_PREFIX"});super(Cp(d,c),a);let h=(n.prefix||"")+s+i+s,w=h.slice(0,-1)+String.fromCharCode(u);this[ye]=d,this[ze]=new Gn(h),this[Qa]=new Gn(w),this[Ko]=new jo,this.nextTick=d.nextTick}prefixKey(n,i){if(i==="utf8")return this[ze].utf8+n;if(n.byteLength===0)return this[ze][i];if(i==="view"){let o=this[ze].view,s=new Uint8Array(o.byteLength+n.byteLength);return s.set(o,0),s.set(n,o.byteLength),s}else{let o=this[ze].buffer;return qo.concat([o,n],o.byteLength+n.byteLength)}}[en](n,i){n.gte!==void 0?n.gte=this.prefixKey(n.gte,i):n.gt!==void 0?n.gt=this.prefixKey(n.gt,i):n.gte=this[ze][i],n.lte!==void 0?n.lte=this.prefixKey(n.lte,i):n.lt!==void 0?n.lt=this.prefixKey(n.lt,i):n.lte=this[Qa][i]}get prefix(){return this[ze].utf8}get db(){return this[ye]}_open(n,i){this[ye].open({passive:!0},i)}_put(n,i,o,s){this[ye].put(n,i,o,s)}_get(n,i,o){this[ye].get(n,i,o)}_getMany(n,i,o){this[ye].getMany(n,i,o)}_del(n,i,o){this[ye].del(n,i,o)}_batch(n,i,o){this[ye].batch(n,i,o)}_clear(n,i){this[en](n,n.keyEncoding),this[ye].clear(n,i)}_iterator(n){this[en](n,n.keyEncoding);let i=this[ye].iterator(n),o=this[Ko].get(this[ze].utf8.length,n.keyEncoding);return new Rp(this,n,i,o)}_keys(n){this[en](n,n.keyEncoding);let i=this[ye].keys(n),o=this[Ko].get(this[ze].utf8.length,n.keyEncoding);return new Op(this,n,i,o)}_values(n){this[en](n,n.keyEncoding);let i=this[ye].values(n);return new kp(this,n,i)}}return{AbstractSublevel:e}};var Cp=function(t,e){return{...t.supports,createIfMissing:!1,errorIfExists:!1,events:{},additionalMethods:{},...e,encodings:{utf8:Fo(t,"utf8"),buffer:Fo(t,"buffer"),view:Fo(t,"view")}}},Fo=function(t,e){return t.supports.encodings[e]?t.keyEncoding(e).name===e:!1},Gn=class{constructor(e){this.utf8=e,this.view=eu.encode(e),this.buffer=qo?qo.from(this.view.buffer,0,this.view.byteLength):{}}},jo=class{constructor(){this.cache=new Map}get(e,r){let n=this.cache.get(r);return n===void 0&&(r==="view"?n=(function(i,o){return o.subarray(i)}).bind(null,e):n=(function(i,o){return o.slice(i)}).bind(null,e),this.cache.set(r,n)),n}},Up=function(t,e){let r=0,n=t.length;for(;r<n&&t[r]===e;)r++;for(;n>r&&t[n-1]===e;)n--;return t.slice(r,n)}});var Ho=S(Go=>{"use strict";var jE=f(l()),{supports:Pp}=da(),{Transcoder:Dp}=va(),{EventEmitter:Np}=$r(),{fromCallback:yt}=Vr(),Te=_e(),{AbstractIterator:Ut}=ht(),{DefaultKeyIterator:Mp,DefaultValueIterator:Kp}=Ma(),{DeferredIterator:Fp,DeferredKeyIterator:qp,DeferredValueIterator:jp}=Ka(),{DefaultChainedBatch:nu}=$a(),{getCallback:Pt,getOptions:wt}=kn(),Hn=Ga(),R=Symbol("promise"),Ye=Symbol("landed"),Dt=Symbol("resources"),$o=Symbol("closeResources"),tn=Symbol("operations"),rn=Symbol("undefer"),Jn=Symbol("deferOpen"),iu=Symbol("options"),L=Symbol("status"),Nt=Symbol("defaultOptions"),Er=Symbol("transcoder"),zn=Symbol("keyEncoding"),Vo=Symbol("valueEncoding"),$p=()=>{},nn=class extends Np{constructor(e,r){if(super(),typeof e!="object"||e===null)throw new TypeError("The first argument 'manifest' must be an object");r=wt(r);let{keyEncoding:n,valueEncoding:i,passive:o,...s}=r;this[Dt]=new Set,this[tn]=[],this[Jn]=!0,this[iu]=s,this[L]="opening",this.supports=Pp(e,{status:!0,promises:!0,clear:!0,getMany:!0,deferredOpen:!0,snapshots:e.snapshots!==!1,permanence:e.permanence!==!1,keyIterator:!0,valueIterator:!0,iteratorNextv:!0,iteratorAll:!0,encodings:e.encodings||{},events:Object.assign({},e.events,{opening:!0,open:!0,closing:!0,closed:!0,put:!0,del:!0,batch:!0,clear:!0})}),this[Er]=new Dp(Vp(this)),this[zn]=this[Er].encoding(n||"utf8"),this[Vo]=this[Er].encoding(i||"utf8");for(let c of this[Er].encodings())this.supports.encodings[c.commonName]||(this.supports.encodings[c.commonName]=!0);this[Nt]={empty:Object.freeze({}),entry:Object.freeze({keyEncoding:this[zn].commonName,valueEncoding:this[Vo].commonName}),key:Object.freeze({keyEncoding:this[zn].commonName})},this.nextTick(()=>{this[Jn]&&this.open({passive:!1},$p)})}get status(){return this[L]}keyEncoding(e){return this[Er].encoding(e??this[zn])}valueEncoding(e){return this[Er].encoding(e??this[Vo])}open(e,r){r=Pt(e,r),r=yt(r,R),e={...this[iu],...wt(e)},e.createIfMissing=e.createIfMissing!==!1,e.errorIfExists=!!e.errorIfExists;let n=i=>{this[L]==="closing"||this[L]==="opening"?this.once(Ye,i?()=>n(i):n):this[L]!=="open"?r(new Te("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN",cause:i})):r()};return e.passive?this[L]==="opening"?this.once(Ye,n):this.nextTick(n):this[L]==="closed"||this[Jn]?(this[Jn]=!1,this[L]="opening",this.emit("opening"),this._open(e,i=>{if(i){this[L]="closed",this[$o](()=>{this.emit(Ye),n(i)}),this[rn]();return}this[L]="open",this[rn](),this.emit(Ye),this[L]==="open"&&this.emit("open"),this[L]==="open"&&this.emit("ready"),n()})):this[L]==="open"?this.nextTick(n):this.once(Ye,()=>this.open(e,r)),r[R]}_open(e,r){this.nextTick(r)}close(e){e=yt(e,R);let r=n=>{this[L]==="opening"||this[L]==="closing"?this.once(Ye,n?r(n):r):this[L]!=="closed"?e(new Te("Database is not closed",{code:"LEVEL_DATABASE_NOT_CLOSED",cause:n})):e()};if(this[L]==="open"){this[L]="closing",this.emit("closing");let n=i=>{this[L]="open",this[rn](),this.emit(Ye),r(i)};this[$o](()=>{this._close(i=>{if(i)return n(i);this[L]="closed",this[rn](),this.emit(Ye),this[L]==="closed"&&this.emit("closed"),r()})})}else this[L]==="closed"?this.nextTick(r):this.once(Ye,()=>this.close(e));return e[R]}[$o](e){if(this[Dt].size===0)return this.nextTick(e);let r=this[Dt].size,n=!0,i=()=>{--r===0&&(n?this.nextTick(e):e())};for(let o of this[Dt])o.close(i);n=!1,this[Dt].clear()}_close(e){this.nextTick(e)}get(e,r,n){if(n=Pt(r,n),n=yt(n,R),r=wt(r,this[Nt].entry),this[L]==="opening")return this.defer(()=>this.get(e,r,n)),n[R];if(vr(this,n))return n[R];let i=this._checkKey(e);if(i)return this.nextTick(n,i),n[R];let o=this.keyEncoding(r.keyEncoding),s=this.valueEncoding(r.valueEncoding),c=o.format,a=s.format;return(r.keyEncoding!==c||r.valueEncoding!==a)&&(r=Object.assign({},r,{keyEncoding:c,valueEncoding:a})),this._get(this.prefixKey(o.encode(e),c),r,(u,d)=>{if(u)return(u.code==="LEVEL_NOT_FOUND"||u.notFound||/NotFound/i.test(u))&&(u.code||(u.code="LEVEL_NOT_FOUND"),u.notFound||(u.notFound=!0),u.status||(u.status=404)),n(u);try{d=s.decode(d)}catch(h){return n(new Te("Could not decode value",{code:"LEVEL_DECODE_ERROR",cause:h}))}n(null,d)}),n[R]}_get(e,r,n){this.nextTick(n,new Error("NotFound"))}getMany(e,r,n){if(n=Pt(r,n),n=yt(n,R),r=wt(r,this[Nt].entry),this[L]==="opening")return this.defer(()=>this.getMany(e,r,n)),n[R];if(vr(this,n))return n[R];if(!Array.isArray(e))return this.nextTick(n,new TypeError("The first argument 'keys' must be an array")),n[R];if(e.length===0)return this.nextTick(n,null,[]),n[R];let i=this.keyEncoding(r.keyEncoding),o=this.valueEncoding(r.valueEncoding),s=i.format,c=o.format;(r.keyEncoding!==s||r.valueEncoding!==c)&&(r=Object.assign({},r,{keyEncoding:s,valueEncoding:c}));let a=new Array(e.length);for(let u=0;u<e.length;u++){let d=e[u],h=this._checkKey(d);if(h)return this.nextTick(n,h),n[R];a[u]=this.prefixKey(i.encode(d),s)}return this._getMany(a,r,(u,d)=>{if(u)return n(u);try{for(let h=0;h<d.length;h++)d[h]!==void 0&&(d[h]=o.decode(d[h]))}catch(h){return n(new Te(`Could not decode one or more of ${d.length} value(s)`,{code:"LEVEL_DECODE_ERROR",cause:h}))}n(null,d)}),n[R]}_getMany(e,r,n){this.nextTick(n,null,new Array(e.length).fill(void 0))}put(e,r,n,i){if(i=Pt(n,i),i=yt(i,R),n=wt(n,this[Nt].entry),this[L]==="opening")return this.defer(()=>this.put(e,r,n,i)),i[R];if(vr(this,i))return i[R];let o=this._checkKey(e)||this._checkValue(r);if(o)return this.nextTick(i,o),i[R];let s=this.keyEncoding(n.keyEncoding),c=this.valueEncoding(n.valueEncoding),a=s.format,u=c.format;(n.keyEncoding!==a||n.valueEncoding!==u)&&(n=Object.assign({},n,{keyEncoding:a,valueEncoding:u}));let d=this.prefixKey(s.encode(e),a),h=c.encode(r);return this._put(d,h,n,w=>{if(w)return i(w);this.emit("put",e,r),i()}),i[R]}_put(e,r,n,i){this.nextTick(i)}del(e,r,n){if(n=Pt(r,n),n=yt(n,R),r=wt(r,this[Nt].key),this[L]==="opening")return this.defer(()=>this.del(e,r,n)),n[R];if(vr(this,n))return n[R];let i=this._checkKey(e);if(i)return this.nextTick(n,i),n[R];let o=this.keyEncoding(r.keyEncoding),s=o.format;return r.keyEncoding!==s&&(r=Object.assign({},r,{keyEncoding:s})),this._del(this.prefixKey(o.encode(e),s),r,c=>{if(c)return n(c);this.emit("del",e),n()}),n[R]}_del(e,r,n){this.nextTick(n)}batch(e,r,n){if(!arguments.length){if(this[L]==="opening")return new nu(this);if(this[L]!=="open")throw new Te("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._chainedBatch()}if(typeof e=="function"?n=e:n=Pt(r,n),n=yt(n,R),r=wt(r,this[Nt].empty),this[L]==="opening")return this.defer(()=>this.batch(e,r,n)),n[R];if(vr(this,n))return n[R];if(!Array.isArray(e))return this.nextTick(n,new TypeError("The first argument 'operations' must be an array")),n[R];if(e.length===0)return this.nextTick(n),n[R];let i=new Array(e.length),{keyEncoding:o,valueEncoding:s,...c}=r;for(let a=0;a<e.length;a++){if(typeof e[a]!="object"||e[a]===null)return this.nextTick(n,new TypeError("A batch operation must be an object")),n[R];let u=Object.assign({},e[a]);if(u.type!=="put"&&u.type!=="del")return this.nextTick(n,new TypeError("A batch operation must have a type property that is 'put' or 'del'")),n[R];let d=this._checkKey(u.key);if(d)return this.nextTick(n,d),n[R];let h=u.sublevel!=null?u.sublevel:this,w=h.keyEncoding(u.keyEncoding||o),y=w.format;if(u.key=h.prefixKey(w.encode(u.key),y),u.keyEncoding=y,u.type==="put"){let p=this._checkValue(u.value);if(p)return this.nextTick(n,p),n[R];let b=h.valueEncoding(u.valueEncoding||s);u.value=b.encode(u.value),u.valueEncoding=b.format}h!==this&&(u.sublevel=null),i[a]=u}return this._batch(i,c,a=>{if(a)return n(a);this.emit("batch",e),n()}),n[R]}_batch(e,r,n){this.nextTick(n)}sublevel(e,r){return this._sublevel(e,Wo.defaults(r))}_sublevel(e,r){return new Wo(this,e,r)}prefixKey(e,r){return e}clear(e,r){if(r=Pt(e,r),r=yt(r,R),e=wt(e,this[Nt].empty),this[L]==="opening")return this.defer(()=>this.clear(e,r)),r[R];if(vr(this,r))return r[R];let n=e,i=this.keyEncoding(e.keyEncoding);return e=Hn(e,i),e.keyEncoding=i.format,e.limit===0?this.nextTick(r):this._clear(e,o=>{if(o)return r(o);this.emit("clear",n),r()}),r[R]}_clear(e,r){this.nextTick(r)}iterator(e){let r=this.keyEncoding(e&&e.keyEncoding),n=this.valueEncoding(e&&e.valueEncoding);if(e=Hn(e,r),e.keys=e.keys!==!1,e.values=e.values!==!1,e[Ut.keyEncoding]=r,e[Ut.valueEncoding]=n,e.keyEncoding=r.format,e.valueEncoding=n.format,this[L]==="opening")return new Fp(this,e);if(this[L]!=="open")throw new Te("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._iterator(e)}_iterator(e){return new Ut(this,e)}keys(e){let r=this.keyEncoding(e&&e.keyEncoding),n=this.valueEncoding(e&&e.valueEncoding);if(e=Hn(e,r),e[Ut.keyEncoding]=r,e[Ut.valueEncoding]=n,e.keyEncoding=r.format,e.valueEncoding=n.format,this[L]==="opening")return new qp(this,e);if(this[L]!=="open")throw new Te("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._keys(e)}_keys(e){return new Mp(this,e)}values(e){let r=this.keyEncoding(e&&e.keyEncoding),n=this.valueEncoding(e&&e.valueEncoding);if(e=Hn(e,r),e[Ut.keyEncoding]=r,e[Ut.valueEncoding]=n,e.keyEncoding=r.format,e.valueEncoding=n.format,this[L]==="opening")return new jp(this,e);if(this[L]!=="open")throw new Te("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._values(e)}_values(e){return new Kp(this,e)}defer(e){if(typeof e!="function")throw new TypeError("The first argument must be a function");this[tn].push(e)}[rn](){if(this[tn].length===0)return;let e=this[tn];this[tn]=[];for(let r of e)r()}attachResource(e){if(typeof e!="object"||e===null||typeof e.close!="function")throw new TypeError("The first argument must be a resource object");this[Dt].add(e)}detachResource(e){this[Dt].delete(e)}_chainedBatch(){return new nu(this)}_checkKey(e){if(e==null)return new Te("Key cannot be null or undefined",{code:"LEVEL_INVALID_KEY"})}_checkValue(e){if(e==null)return new Te("Value cannot be null or undefined",{code:"LEVEL_INVALID_VALUE"})}};nn.prototype.nextTick=Xa();var{AbstractSublevel:Wo}=ru()({AbstractLevel:nn});Go.AbstractLevel=nn;Go.AbstractSublevel=Wo;var vr=function(t,e){return t[L]!=="open"?(t.nextTick(e,new Te("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"})),!0):!1},Vp=function(t){return Object.keys(t.supports.encodings).filter(e=>!!t.supports.encodings[e])}});var Jo=S(Mt=>{"use strict";var VE=f(l());Mt.AbstractLevel=Ho().AbstractLevel;Mt.AbstractSublevel=Ho().AbstractSublevel;Mt.AbstractIterator=ht().AbstractIterator;Mt.AbstractKeyIterator=ht().AbstractKeyIterator;Mt.AbstractValueIterator=ht().AbstractValueIterator;Mt.AbstractChainedBatch=Po().AbstractChainedBatch});var su=S((WE,ou)=>{var GE=f(l());ou.exports=Gp;var Wp=No();function Gp(t,e,r){if(typeof e!="number")throw new Error("second argument must be a Number");let n,i,o,s,c,a=!0,u;Array.isArray(t)?(n=[],o=i=t.length):(s=Object.keys(t),n={},o=i=s.length);function d(w){function y(){r&&r(w,n),r=null}a?Wp(y):y()}function h(w,y,p){if(n[w]=p,y&&(c=!0),--o===0||y)d(y);else if(!c&&u<i){let b;s?(b=s[u],u+=1,t[b](function(x,E){h(b,x,E)})):(b=u,u+=1,t[b](function(x,E){h(b,x,E)}))}}u=e,o?s?s.some(function(w,y){return t[w](function(p,b){h(w,p,b)}),y===e-1}):t.some(function(w,y){return w(function(p,b){h(y,p,b)}),y===e-1}):d(null),a=!1}});var zo=S((HE,cu)=>{"use strict";var JE=f(l());cu.exports=function(e){let r=e.gte!==void 0?e.gte:e.gt!==void 0?e.gt:void 0,n=e.lte!==void 0?e.lte:e.lt!==void 0?e.lt:void 0,i=e.gte===void 0,o=e.lte===void 0;return r!==void 0&&n!==void 0?IDBKeyRange.bound(r,n,i,o):r!==void 0?IDBKeyRange.lowerBound(r,i):n!==void 0?IDBKeyRange.upperBound(n,o):null}});var Yo=S((zE,au)=>{"use strict";var YE=f(l()),Hp=new TextEncoder;au.exports=function(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):Hp.encode(t)}});var hu=S(du=>{"use strict";var ZE=f(l()),{AbstractIterator:Jp}=Jo(),uu=zo(),Yn=Yo(),Ue=Symbol("cache"),Xe=Symbol("finished"),we=Symbol("options"),Ze=Symbol("currentOptions"),Kt=Symbol("position"),Xo=Symbol("location"),_r=Symbol("first"),fu={},Zo=class extends Jp{constructor(e,r,n){super(e,n),this[Ue]=[],this[Xe]=this.limit===0,this[we]=n,this[Ze]={...n},this[Kt]=void 0,this[Xo]=r,this[_r]=!0}_nextv(e,r,n){if(this[_r]=!1,this[Xe])return this.nextTick(n,null,[]);if(this[Ue].length>0)return e=Math.min(e,this[Ue].length),this.nextTick(n,null,this[Ue].splice(0,e));this[Kt]!==void 0&&(this[we].reverse?(this[Ze].lt=this[Kt],this[Ze].lte=void 0):(this[Ze].gt=this[Kt],this[Ze].gte=void 0));let i;try{i=uu(this[Ze])}catch{return this[Xe]=!0,this.nextTick(n,null,[])}let o=this.db.db.transaction([this[Xo]],"readonly"),s=o.objectStore(this[Xo]),c=[];if(this[we].reverse){let a=!this[we].values&&s.openKeyCursor?"openKeyCursor":"openCursor";s[a](i,"prev").onsuccess=u=>{let d=u.target.result;if(d){let{key:h,value:w}=d;this[Kt]=h,c.push([this[we].keys&&h!==void 0?Yn(h):void 0,this[we].values&&w!==void 0?Yn(w):void 0]),c.length<e?d.continue():lu(o)}else this[Xe]=!0}}else{let a,u,d=()=>{if(a===void 0||u===void 0)return;let h=Math.max(a.length,u.length);h===0||e===1/0?this[Xe]=!0:this[Kt]=a[h-1],c.length=h;for(let w=0;w<h;w++){let y=a[w],p=u[w];c[w]=[this[we].keys&&y!==void 0?Yn(y):void 0,this[we].values&&p!==void 0?Yn(p):void 0]}lu(o)};this[we].keys||e<1/0?s.getAllKeys(i,e<1/0?e:void 0).onsuccess=h=>{a=h.target.result,d()}:(a=[],this.nextTick(d)),this[we].values?s.getAll(i,e<1/0?e:void 0).onsuccess=h=>{u=h.target.result,d()}:(u=[],this.nextTick(d))}o.onabort=()=>{n(o.error||new Error("aborted by user")),n=null},o.oncomplete=()=>{n(null,c),n=null}}_next(e){if(this[Ue].length>0){let[r,n]=this[Ue].shift();this.nextTick(e,null,r,n)}else if(this[Xe])this.nextTick(e);else{let r=Math.min(100,this.limit-this.count);this[_r]&&(this[_r]=!1,r=1),this._nextv(r,fu,(n,i)=>{if(n)return e(n);this[Ue]=i,this._next(e)})}}_all(e,r){this[_r]=!1;let n=this[Ue].splice(0,this[Ue].length),i=this.limit-this.count-n.length;if(i<=0)return this.nextTick(r,null,n);this._nextv(i,fu,(o,s)=>{if(o)return r(o);n.length>0&&(s=n.concat(s)),r(null,s)})}_seek(e,r){this[_r]=!0,this[Ue]=[],this[Xe]=!1,this[Kt]=void 0,this[Ze]={...this[we]};let n;try{n=uu(this[we])}catch{this[Xe]=!0;return}n!==null&&!n.includes(e)?this[Xe]=!0:this[we].reverse?this[Ze].lte=e:this[Ze].gte=e}};du.Iterator=Zo;function lu(t){typeof t.commit=="function"&&t.commit()}});var yu=S((QE,pu)=>{"use strict";var ev=f(l());pu.exports=function(e,r,n,i,o){if(i.limit===0)return e.nextTick(o);let s=e.db.transaction([r],"readwrite"),c=s.objectStore(r),a=0;s.oncomplete=function(){o()},s.onabort=function(){o(s.error||new Error("aborted by user"))};let u=c.openKeyCursor?"openKeyCursor":"openCursor",d=i.reverse?"prev":"next";c[u](n,d).onsuccess=function(h){let w=h.target.result;w&&(c.delete(w.key).onsuccess=function(){(i.limit<=0||++a<i.limit)&&w.continue()})}}});var Eu=S(xu=>{"use strict";var rv=f(l()),{AbstractLevel:zp}=Jo(),wu=_e(),Yp=su(),{fromCallback:Xp}=Vr(),{Iterator:Zp}=hu(),gu=Yo(),Qp=yu(),ey=zo(),mu="level-js-",on=Symbol("idb"),Qo=Symbol("namePrefix"),Qe=Symbol("location"),es=Symbol("version"),Ft=Symbol("store"),sn=Symbol("onComplete"),bu=Symbol("promise"),Xn=class extends zp{constructor(e,r,n){if(typeof r=="function"||typeof n=="function")throw new wu("The levelup-style callback argument has been removed",{code:"LEVEL_LEGACY"});let{prefix:i,version:o,...s}=r||{};if(super({encodings:{view:!0},snapshots:!1,createIfMissing:!1,errorIfExists:!1,seek:!0},s),typeof e!="string")throw new Error("constructor requires a location string argument");this[Qe]=e,this[Qo]=i??mu,this[es]=parseInt(o||1,10),this[on]=null}get location(){return this[Qe]}get namePrefix(){return this[Qo]}get version(){return this[es]}get db(){return this[on]}get type(){return"browser-level"}_open(e,r){let n=indexedDB.open(this[Qo]+this[Qe],this[es]);n.onerror=function(){r(n.error||new Error("unknown error"))},n.onsuccess=()=>{this[on]=n.result,r()},n.onupgradeneeded=i=>{let o=i.target.result;o.objectStoreNames.contains(this[Qe])||o.createObjectStore(this[Qe])}}[Ft](e){return this[on].transaction([this[Qe]],e).objectStore(this[Qe])}[sn](e,r){let n=e.transaction;n.onabort=function(){r(n.error||new Error("aborted by user"))},n.oncomplete=function(){r(null,e.result)}}_get(e,r,n){let i=this[Ft]("readonly"),o;try{o=i.get(e)}catch(s){return this.nextTick(n,s)}this[sn](o,function(s,c){if(s)return n(s);if(c===void 0)return n(new wu("Entry not found",{code:"LEVEL_NOT_FOUND"}));n(null,gu(c))})}_getMany(e,r,n){let i=this[Ft]("readonly"),o=e.map(s=>c=>{let a;try{a=i.get(s)}catch(u){return c(u)}a.onsuccess=()=>{let u=a.result;c(null,u===void 0?u:gu(u))},a.onerror=u=>{u.stopPropagation(),c(a.error)}});Yp(o,16,n)}_del(e,r,n){let i=this[Ft]("readwrite"),o;try{o=i.delete(e)}catch(s){return this.nextTick(n,s)}this[sn](o,n)}_put(e,r,n,i){let o=this[Ft]("readwrite"),s;try{s=o.put(r,e)}catch(c){return this.nextTick(i,c)}this[sn](s,i)}_iterator(e){return new Zp(this,this[Qe],e)}_batch(e,r,n){let i=this[Ft]("readwrite"),o=i.transaction,s=0,c;o.onabort=function(){n(c||o.error||new Error("aborted by user"))},o.oncomplete=function(){n()};function a(){let u=e[s++],d=u.key,h;try{h=u.type==="del"?i.delete(d):i.put(u.value,d)}catch(w){c=w,o.abort();return}s<e.length?h.onsuccess=a:typeof o.commit=="function"&&o.commit()}a()}_clear(e,r){let n,i;try{n=ey(e)}catch{return this.nextTick(r)}if(e.limit>=0)return Qp(this,this[Qe],n,e,r);try{let o=this[Ft]("readwrite");i=n?o.delete(n):o.clear()}catch(o){return this.nextTick(r,o)}this[sn](i,r)}_close(e){this[on].close(),this.nextTick(e)}};Xn.destroy=function(t,e,r){typeof e=="function"&&(r=e,e=mu),r=Xp(r,bu);let n=indexedDB.deleteDatabase(e+t);return n.onsuccess=function(){r()},n.onerror=function(i){r(i)},r[bu]};xu.BrowserLevel=Xn});var _u=S(vu=>{var iv=f(l());vu.Level=Eu().BrowserLevel});var ee=S((fv,Su)=>{"use strict";var lv=f(l());Su.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)},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,TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Uint8Array}});var Pe=S((dv,rs)=>{"use strict";var hv=f(l()),ry=fe(),ny=Object.getPrototypeOf(async function(){}).constructor,Tu=globalThis.Blob||ry.Blob,iy=typeof Tu<"u"?function(e){return e instanceof Tu}:function(e){return!1},ts=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<e.length;n++)r+=` ${e[n].stack}
|
|
`;super(r),this.name="AggregateError",this.errors=e}};rs.exports={AggregateError:ts,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((n,i)=>{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 ny},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:iy};rs.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var Qn=S((pv,Zn)=>{"use strict";var yv=f(l()),{AbortController:Au,AbortSignal:oy}=typeof self<"u"?self:typeof window<"u"?window:void 0;Zn.exports=Au;Zn.exports.AbortSignal=oy;Zn.exports.default=Au});var ce=S((wv,Ru)=>{"use strict";var gv=f(l()),{format:sy,inspect:ei,AggregateError:cy}=Pe(),ay=globalThis.AggregateError||cy,uy=Symbol("kIsNodeError"),fy=["string","function","number","object","Function","Object","boolean","bigint","symbol"],ly=/^([A-Z][a-z0-9]*)+$/,dy="__node_internal_",ti={};function qt(t,e){if(!t)throw new ti.ERR_INTERNAL_ASSERTION(e)}function Bu(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 hy(t,e,r){if(typeof e=="function")return qt(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 qt(n===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?e:sy(e,...r)}function ne(t,e,r){r||(r=Error);class n extends r{constructor(...o){super(hy(t,e,o))}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[uy]=!0,ti[t]=n}function Iu(t){let e=dy+t.name;return Object.defineProperty(t,"name",{value:e}),t}function py(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new ay([e,t],e.message);return r.code=e.code,r}return t||e}var ns=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new ti.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};ne("ERR_ASSERTION","%s",Error);ne("ERR_INVALID_ARG_TYPE",(t,e,r)=>{qt(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=[],o=[],s=[];for(let a of e)qt(typeof a=="string","All expected entries have to be of type string"),fy.includes(a)?i.push(a.toLowerCase()):ly.test(a)?o.push(a):(qt(a!=="object",'The value "object" should be written as "Object"'),s.push(a));if(o.length>0){let a=i.indexOf("object");a!==-1&&(i.splice(i,a,1),o.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 a=i.pop();n+=`one of type ${i.join(", ")}, or ${a}`}}(o.length>0||s.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let a=o.pop();n+=`an instance of ${o.join(", ")}, or ${a}`}}s.length>0&&(n+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(n+="an "),n+=`${s[0]}`;break;case 2:n+=`one of ${s[0]} or ${s[1]}`;break;default:{let a=s.pop();n+=`one of ${s.join(", ")}, or ${a}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var c;if((c=r.constructor)!==null&&c!==void 0&&c.name)n+=`. Received an instance of ${r.constructor.name}`;else{let a=ei(r,{depth:-1});n+=`. Received ${a}`}}else{let a=ei(r,{colors:!1});a.length>25&&(a=`${a.slice(0,25)}...`),n+=`. Received type ${typeof r} (${a})`}return n},TypeError);ne("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let n=ei(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${n}`},TypeError);ne("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);ne("ERR_MISSING_ARGS",(...t)=>{qt(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);ne("ERR_OUT_OF_RANGE",(t,e,r)=>{qt(e,'Missing "range" argument');let n;return Number.isInteger(r)&&Math.abs(r)>2**32?n=Bu(String(r)):typeof r=="bigint"?(n=String(r),(r>2n**32n||r<-(2n**32n))&&(n=Bu(n)),n+="n"):n=ei(r),`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);ne("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);ne("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);ne("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);ne("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);ne("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);ne("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ne("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);ne("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);ne("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);ne("ERR_STREAM_WRITE_AFTER_END","write after end",Error);ne("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Ru.exports={AbortError:ns,aggregateTwoErrors:Iu(py),hideStackFrames:Iu,codes:ti}});var cn=S((bv,Mu)=>{"use strict";var mv=f(l()),{ArrayIsArray:os,ArrayPrototypeIncludes:Cu,ArrayPrototypeJoin:Uu,ArrayPrototypeMap:yy,NumberIsInteger:ss,NumberIsNaN:wy,NumberMAX_SAFE_INTEGER:gy,NumberMIN_SAFE_INTEGER:by,NumberParseInt:my,ObjectPrototypeHasOwnProperty:xy,RegExpPrototypeExec:Pu,String:Ey,StringPrototypeToUpperCase:vy,StringPrototypeTrim:_y}=ee(),{hideStackFrames:xe,codes:{ERR_SOCKET_BAD_PORT:Sy,ERR_INVALID_ARG_TYPE:ae,ERR_INVALID_ARG_VALUE:Sr,ERR_OUT_OF_RANGE:jt,ERR_UNKNOWN_SIGNAL:Ou}}=ce(),{normalizeEncoding:Ty}=Pe(),{isAsyncFunction:Ay,isArrayBufferView:By}=Pe().types,ku={};function Iy(t){return t===(t|0)}function Ry(t){return t===t>>>0}var Oy=/^[0-7]+$/,ky="must be a 32-bit unsigned integer or an octal string";function Ly(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(Pu(Oy,t)===null)throw new Sr(e,t,ky);t=my(t,8)}return Du(t,e),t}var Cy=xe((t,e,r=by,n=gy)=>{if(typeof t!="number")throw new ae(e,"number",t);if(!ss(t))throw new jt(e,"an integer",t);if(t<r||t>n)throw new jt(e,`>= ${r} && <= ${n}`,t)}),Uy=xe((t,e,r=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new ae(e,"number",t);if(!ss(t))throw new jt(e,"an integer",t);if(t<r||t>n)throw new jt(e,`>= ${r} && <= ${n}`,t)}),Du=xe((t,e,r=!1)=>{if(typeof t!="number")throw new ae(e,"number",t);if(!ss(t))throw new jt(e,"an integer",t);let n=r?1:0,i=4294967295;if(t<n||t>i)throw new jt(e,`>= ${n} && <= ${i}`,t)});function cs(t,e){if(typeof t!="string")throw new ae(e,"string",t)}function Py(t,e,r=void 0,n){if(typeof t!="number")throw new ae(e,"number",t);if(r!=null&&t<r||n!=null&&t>n||(r!=null||n!=null)&&wy(t))throw new jt(e,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}var Dy=xe((t,e,r)=>{if(!Cu(r,t)){let i="must be one of: "+Uu(yy(r,o=>typeof o=="string"?`'${o}'`:Ey(o)),", ");throw new Sr(e,t,i)}});function Nu(t,e){if(typeof t!="boolean")throw new ae(e,"boolean",t)}function is(t,e,r){return t==null||!xy(t,e)?r:t[e]}var Ny=xe((t,e,r=null)=>{let n=is(r,"allowArray",!1),i=is(r,"allowFunction",!1);if(!is(r,"nullable",!1)&&t===null||!n&&os(t)||typeof t!="object"&&(!i||typeof t!="function"))throw new ae(e,"Object",t)}),My=xe((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new ae(e,"a dictionary",t)}),as=xe((t,e,r=0)=>{if(!os(t))throw new ae(e,"Array",t);if(t.length<r){let n=`must be longer than ${r}`;throw new Sr(e,t,n)}});function Ky(t,e){as(t,e);for(let r=0;r<t.length;r++)cs(t[r],`${e}[${r}]`)}function Fy(t,e){as(t,e);for(let r=0;r<t.length;r++)Nu(t[r],`${e}[${r}]`)}function qy(t,e="signal"){if(cs(t,e),ku[t]===void 0)throw ku[vy(t)]!==void 0?new Ou(t+" (signals must use all capital letters)"):new Ou(t)}var jy=xe((t,e="buffer")=>{if(!By(t))throw new ae(e,["Buffer","TypedArray","DataView"],t)});function $y(t,e){let r=Ty(e),n=t.length;if(r==="hex"&&n%2!==0)throw new Sr("encoding",e,`is invalid for data of length ${n}`)}function Vy(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&_y(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new Sy(e,t,r);return t|0}var Wy=xe((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ae(e,"AbortSignal",t)}),Gy=xe((t,e)=>{if(typeof t!="function")throw new ae(e,"Function",t)}),Hy=xe((t,e)=>{if(typeof t!="function"||Ay(t))throw new ae(e,"Function",t)}),Jy=xe((t,e)=>{if(t!==void 0)throw new ae(e,"undefined",t)});function zy(t,e,r){if(!Cu(r,t))throw new ae(e,`('${Uu(r,"|")}')`,t)}var Yy=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Lu(t,e){if(typeof t>"u"||!Pu(Yy,t))throw new Sr(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Xy(t){if(typeof t=="string")return Lu(t,"hints"),t;if(os(t)){let e=t.length,r="";if(e===0)return r;for(let n=0;n<e;n++){let i=t[n];Lu(i,"hints"),r+=i,n!==e-1&&(r+=", ")}return r}throw new Sr("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}Mu.exports={isInt32:Iy,isUint32:Ry,parseFileMode:Ly,validateArray:as,validateStringArray:Ky,validateBooleanArray:Fy,validateBoolean:Nu,validateBuffer:jy,validateDictionary:My,validateEncoding:$y,validateFunction:Gy,validateInt32:Uy,validateInteger:Cy,validateNumber:Py,validateObject:Ny,validateOneOf:Dy,validatePlainFunction:Hy,validatePort:Vy,validateSignalName:qy,validateString:cs,validateUint32:Du,validateUndefined:Jy,validateUnion:zy,validateAbortSignal:Wy,validateLinkHeaderValue:Xy}});var gt=S((xv,ju)=>{var Ev=f(l()),X=ju.exports={},De,Ne;function us(){throw new Error("setTimeout has not been defined")}function fs(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?De=setTimeout:De=us}catch{De=us}try{typeof clearTimeout=="function"?Ne=clearTimeout:Ne=fs}catch{Ne=fs}})();function Ku(t){if(De===setTimeout)return setTimeout(t,0);if((De===us||!De)&&setTimeout)return De=setTimeout,setTimeout(t,0);try{return De(t,0)}catch{try{return De.call(null,t,0)}catch{return De.call(this,t,0)}}}function Zy(t){if(Ne===clearTimeout)return clearTimeout(t);if((Ne===fs||!Ne)&&clearTimeout)return Ne=clearTimeout,clearTimeout(t);try{return Ne(t)}catch{try{return Ne.call(null,t)}catch{return Ne.call(this,t)}}}var et=[],Tr=!1,$t,ri=-1;function Qy(){!Tr||!$t||(Tr=!1,$t.length?et=$t.concat(et):ri=-1,et.length&&Fu())}function Fu(){if(!Tr){var t=Ku(Qy);Tr=!0;for(var e=et.length;e;){for($t=et,et=[];++ri<e;)$t&&$t[ri].run();ri=-1,e=et.length}$t=null,Tr=!1,Zy(t)}}X.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];et.push(new qu(t,e)),et.length===1&&!Tr&&Ku(Fu)};function qu(t,e){this.fun=t,this.array=e}qu.prototype.run=function(){this.fun.apply(null,this.array)};X.title="browser";X.browser=!0;X.env={};X.argv=[];X.version="";X.versions={};function tt(){}X.on=tt;X.addListener=tt;X.once=tt;X.off=tt;X.removeListener=tt;X.removeAllListeners=tt;X.emit=tt;X.prependListener=tt;X.prependOnceListener=tt;X.listeners=function(t){return[]};X.binding=function(t){throw new Error("process.binding is not supported")};X.cwd=function(){return"/"};X.chdir=function(t){throw new Error("process.chdir is not supported")};X.umask=function(){return 0}});var Ke=S((vv,of)=>{"use strict";var _v=f(l()),{Symbol:ni,SymbolAsyncIterator:$u,SymbolIterator:Vu,SymbolFor:Wu}=ee(),Gu=ni("kDestroyed"),Hu=ni("kIsErrored"),ls=ni("kIsReadable"),Ju=ni("kIsDisturbed"),ew=Wu("nodejs.webstream.isClosedPromise"),tw=Wu("nodejs.webstream.controllerErrorFunction");function ii(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 oi(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 rw(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function Me(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function zu(t){return!!(t&&!Me(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function Yu(t){return!!(t&&!Me(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function Xu(t){return!!(t&&!Me(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function nw(t){return zu(t)||Yu(t)||Xu(t)}function iw(t,e){return t==null?!1:e===!0?typeof t[$u]=="function":e===!1?typeof t[Vu]=="function":typeof t[$u]=="function"||typeof t[Vu]=="function"}function si(t){if(!Me(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!!(t.destroyed||t[Gu]||n!=null&&n.destroyed)}function Zu(t){if(!oi(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 ow(t,e){if(!oi(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 sw(t){if(!ii(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 Qu(t,e){if(!ii(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 ef(t){return t&&t[ls]!=null?t[ls]:typeof t?.readable!="boolean"?null:si(t)?!1:ii(t)&&t.readable&&!Qu(t)}function tf(t){return typeof t?.writable!="boolean"?null:si(t)?!1:oi(t)&&t.writable&&!Zu(t)}function cw(t,e){return Me(t)?si(t)?!0:!(e?.readable!==!1&&ef(t)||e?.writable!==!1&&tf(t)):null}function aw(t){var e,r;return Me(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 uw(t){var e,r;return Me(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 fw(t){if(!Me(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"&&rf(t)?t._closed:null}function rf(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function nf(t){return typeof t._sent100=="boolean"&&rf(t)}function lw(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 dw(t){if(!Me(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!n&&nf(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function hw(t){var e;return!!(t&&((e=t[Ju])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function pw(t){var e,r,n,i,o,s,c,a,u,d;return!!(t&&((e=(r=(n=(i=(o=(s=t[Hu])!==null&&s!==void 0?s:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&i!==void 0?i:(c=t._readableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&n!==void 0?n:(a=t._writableState)===null||a===void 0?void 0:a.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))}of.exports={kDestroyed:Gu,isDisturbed:hw,kIsDisturbed:Ju,isErrored:pw,kIsErrored:Hu,isReadable:ef,kIsReadable:ls,kIsClosedPromise:ew,kControllerErrorFunction:tw,isClosed:fw,isDestroyed:si,isDuplexNodeStream:rw,isFinished:cw,isIterable:iw,isReadableNodeStream:ii,isReadableStream:zu,isReadableEnded:sw,isReadableFinished:Qu,isReadableErrored:uw,isNodeStream:Me,isWebStream:nw,isWritable:tf,isWritableNodeStream:oi,isWritableStream:Yu,isWritableEnded:Zu,isWritableFinished:ow,isWritableErrored:aw,isServerRequest:lw,isServerResponse:nf,willEmitClose:dw,isTransformStream:Xu}});var rt=S((Sv,ws)=>{var Tv=f(l()),bt=gt(),{AbortError:pf,codes:yw}=ce(),{ERR_INVALID_ARG_TYPE:ww,ERR_STREAM_PREMATURE_CLOSE:sf}=yw,{kEmptyObject:hs,once:ps}=Pe(),{validateAbortSignal:gw,validateFunction:bw,validateObject:mw,validateBoolean:xw}=cn(),{Promise:Ew,PromisePrototypeThen:vw}=ee(),{isClosed:_w,isReadable:cf,isReadableNodeStream:ds,isReadableStream:Sw,isReadableFinished:af,isReadableErrored:uf,isWritable:ff,isWritableNodeStream:lf,isWritableStream:Tw,isWritableFinished:df,isWritableErrored:hf,isNodeStream:Aw,willEmitClose:Bw,kIsClosedPromise:Iw}=Ke();function Rw(t){return t.setHeader&&typeof t.abort=="function"}var ys=()=>{};function yf(t,e,r){var n,i;if(arguments.length===2?(r=e,e=hs):e==null?e=hs:mw(e,"options"),bw(r,"callback"),gw(e.signal,"options.signal"),r=ps(r),Sw(t)||Tw(t))return Ow(t,e,r);if(!Aw(t))throw new ww("stream",["ReadableStream","WritableStream","Stream"],t);let o=(n=e.readable)!==null&&n!==void 0?n:ds(t),s=(i=e.writable)!==null&&i!==void 0?i:lf(t),c=t._writableState,a=t._readableState,u=()=>{t.writable||w()},d=Bw(t)&&ds(t)===o&&lf(t)===s,h=df(t,!1),w=()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||o))&&(!o||y)&&r.call(t)},y=af(t,!1),p=()=>{y=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||s))&&(!s||h)&&r.call(t)},b=C=>{r.call(t,C)},x=_w(t),E=()=>{x=!0;let C=hf(t)||uf(t);if(C&&typeof C!="boolean")return r.call(t,C);if(o&&!y&&ds(t,!0)&&!af(t,!1))return r.call(t,new sf);if(s&&!h&&!df(t,!1))return r.call(t,new sf);r.call(t)},v=()=>{x=!0;let C=hf(t)||uf(t);if(C&&typeof C!="boolean")return r.call(t,C);r.call(t)},m=()=>{t.req.on("finish",w)};Rw(t)?(t.on("complete",w),d||t.on("abort",E),t.req?m():t.on("request",m)):s&&!c&&(t.on("end",u),t.on("close",u)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",E),t.on("end",p),t.on("finish",w),e.error!==!1&&t.on("error",b),t.on("close",E),x?bt.nextTick(E):c!=null&&c.errorEmitted||a!=null&&a.errorEmitted?d||bt.nextTick(v):(!o&&(!d||cf(t))&&(h||ff(t)===!1)||!s&&(!d||ff(t))&&(y||cf(t)===!1)||a&&t.req&&t.aborted)&&bt.nextTick(v);let A=()=>{r=ys,t.removeListener("aborted",E),t.removeListener("complete",w),t.removeListener("abort",E),t.removeListener("request",m),t.req&&t.req.removeListener("finish",w),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",w),t.removeListener("end",p),t.removeListener("error",b),t.removeListener("close",E)};if(e.signal&&!x){let C=()=>{let I=r;A(),I.call(t,new pf(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)bt.nextTick(C);else{let I=r;r=ps((...P)=>{e.signal.removeEventListener("abort",C),I.apply(t,P)}),e.signal.addEventListener("abort",C)}}return A}function Ow(t,e,r){let n=!1,i=ys;if(e.signal)if(i=()=>{n=!0,r.call(t,new pf(void 0,{cause:e.signal.reason}))},e.signal.aborted)bt.nextTick(i);else{let s=r;r=ps((...c)=>{e.signal.removeEventListener("abort",i),s.apply(t,c)}),e.signal.addEventListener("abort",i)}let o=(...s)=>{n||bt.nextTick(()=>r.apply(t,s))};return vw(t[Iw].promise,o,o),ys}function kw(t,e){var r;let n=!1;return e===null&&(e=hs),(r=e)!==null&&r!==void 0&&r.cleanup&&(xw(e.cleanup,"cleanup"),n=e.cleanup),new Ew((i,o)=>{let s=yf(t,e,c=>{n&&s(),c?o(c):i()})})}ws.exports=yf;ws.exports.finished=kw});var Vt=S((Av,_f)=>{"use strict";var Bv=f(l()),Fe=gt(),{aggregateTwoErrors:Lw,codes:{ERR_MULTIPLE_CALLBACK:Cw},AbortError:Uw}=ce(),{Symbol:bf}=ee(),{kDestroyed:Pw,isDestroyed:Dw,isFinished:Nw,isServerRequest:Mw}=Ke(),mf=bf("kDestroy"),gs=bf("kConstruct");function xf(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function Kw(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):(xf(t,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?wf(this,t,e):this.once(mf,function(o){wf(this,Lw(o,t),e)}),this)}function wf(t,e,r){let n=!1;function i(o){if(n)return;n=!0;let s=t._readableState,c=t._writableState;xf(o,c,s),c&&(c.closed=!0),s&&(s.closed=!0),typeof r=="function"&&r(o),o?Fe.nextTick(Fw,t,o):Fe.nextTick(Ef,t)}try{t._destroy(e||null,i)}catch(o){i(o)}}function Fw(t,e){bs(t,e),Ef(t)}function Ef(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 bs(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 qw(){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 ms(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?Fe.nextTick(bs,t,e):bs(t,e))}function jw(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(gs,e),!(t.listenerCount(gs)>1)&&Fe.nextTick($w,t)}function $w(t){let e=!1;function r(n){if(e){ms(t,n??new Cw);return}e=!0;let i=t._readableState,o=t._writableState,s=o||i;i&&(i.constructed=!0),o&&(o.constructed=!0),s.destroyed?t.emit(mf,n):n?ms(t,n,!0):Fe.nextTick(Vw,t)}try{t._construct(n=>{Fe.nextTick(r,n)})}catch(n){Fe.nextTick(r,n)}}function Vw(t){t.emit(gs)}function gf(t){return t?.setHeader&&typeof t.abort=="function"}function vf(t){t.emit("close")}function Ww(t,e){t.emit("error",e),Fe.nextTick(vf,t)}function Gw(t,e){!t||Dw(t)||(!e&&!Nw(t)&&(e=new Uw),Mw(t)?(t.socket=null,t.destroy(e)):gf(t)?t.abort():gf(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Fe.nextTick(Ww,t,e):Fe.nextTick(vf,t),t.destroyed||(t[Pw]=!0))}_f.exports={construct:jw,destroyer:Gw,destroy:Kw,undestroy:qw,errorOrDestroy:ms}});var ui=S((Iv,Tf)=>{"use strict";var Rv=f(l()),{ArrayIsArray:Hw,ObjectSetPrototypeOf:Sf}=ee(),{EventEmitter:ci}=$r();function ai(t){ci.call(this,t)}Sf(ai.prototype,ci.prototype);Sf(ai,ci);ai.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",s),r.on("close",c));let o=!1;function s(){o||(o=!0,t.end())}function c(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}function a(d){u(),ci.listenerCount(this,"error")===0&&this.emit("error",d)}xs(r,"error",a),xs(t,"error",a);function u(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",c),r.removeListener("error",a),t.removeListener("error",a),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 xs(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Hw(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}Tf.exports={Stream:ai,prependListener:xs}});var an=S((Ov,fi)=>{"use strict";var kv=f(l()),{AbortError:Af,codes:Jw}=ce(),{isNodeStream:Bf,isWebStream:zw,kControllerErrorFunction:Yw}=Ke(),Xw=rt(),{ERR_INVALID_ARG_TYPE:If}=Jw,Zw=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new If(e,"AbortSignal",t)};fi.exports.addAbortSignal=function(e,r){if(Zw(e,"signal"),!Bf(r)&&!zw(r))throw new If("stream",["ReadableStream","WritableStream","Stream"],r);return fi.exports.addAbortSignalNoValidate(e,r)};fi.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=Bf(e)?()=>{e.destroy(new Af(void 0,{cause:t.reason}))}:()=>{e[Yw](new Af(void 0,{cause:t.reason}))};return t.aborted?r():(t.addEventListener("abort",r),Xw(e,()=>t.removeEventListener("abort",r))),e}});var kf=S((Cv,Of)=>{"use strict";var Uv=f(l()),{StringPrototypeSlice:Rf,SymbolIterator:Qw,TypedArrayPrototypeSet:li,Uint8Array:eg}=ee(),{Buffer:Es}=fe(),{inspect:tg}=Pe();Of.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 Es.alloc(0);let r=Es.allocUnsafe(e>>>0),n=this.head,i=0;for(;n;)li(r,n.data,i),i+=n.data.length,n=n.next;return r}consume(e,r){let n=this.head.data;if(e<n.length){let i=n.slice(0,e);return this.head.data=n.slice(e),i}return e===n.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[Qw](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let r="",n=this.head,i=0;do{let o=n.data;if(e>o.length)r+=o,e-=o.length;else{e===o.length?(r+=o,++i,n.next?this.head=n.next:this.head=this.tail=null):(r+=Rf(o,0,e),this.head=n,n.data=Rf(o,e));break}++i}while((n=n.next)!==null);return this.length-=i,r}_getBuffer(e){let r=Es.allocUnsafe(e),n=e,i=this.head,o=0;do{let s=i.data;if(e>s.length)li(r,s,n-e),e-=s.length;else{e===s.length?(li(r,s,n-e),++o,i.next?this.head=i.next:this.head=this.tail=null):(li(r,new eg(s.buffer,s.byteOffset,e),n-e),this.head=i,i.data=s.slice(e));break}++o}while((i=i.next)!==null);return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return tg(this,{...r,depth:0,customInspect:!1})}}});var di=S((Pv,Cf)=>{"use strict";var Dv=f(l()),{MathFloor:rg,NumberIsInteger:ng}=ee(),{ERR_INVALID_ARG_VALUE:ig}=ce().codes;function og(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Lf(t){return t?16:16*1024}function sg(t,e,r,n){let i=og(e,n,r);if(i!=null){if(!ng(i)||i<0){let o=n?`options.${r}`:"options.highWaterMark";throw new ig(o,i)}return rg(i)}return Lf(t.objectMode)}Cf.exports={getHighWaterMark:sg,getDefaultHighWaterMark:Lf}});var Df=S((vs,Pf)=>{var Nv=f(l());var hi=fe(),qe=hi.Buffer;function Uf(t,e){for(var r in t)e[r]=t[r]}qe.from&&qe.alloc&&qe.allocUnsafe&&qe.allocUnsafeSlow?Pf.exports=hi:(Uf(hi,vs),vs.Buffer=Wt);function Wt(t,e,r){return qe(t,e,r)}Wt.prototype=Object.create(qe.prototype);Uf(qe,Wt);Wt.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return qe(t,e,r)};Wt.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=qe(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Wt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return qe(t)};Wt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return hi.SlowBuffer(t)}});var Kf=S(Mf=>{"use strict";var Kv=f(l()),Ss=Df().Buffer,Nf=Ss.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 cg(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 ag(t){var e=cg(t);if(typeof e!="string"&&(Ss.isEncoding===Nf||!Nf(t)))throw new Error("Unknown encoding: "+t);return e||t}Mf.StringDecoder=un;function un(t){this.encoding=ag(t);var e;switch(this.encoding){case"utf16le":this.text=pg,this.end=yg,e=4;break;case"utf8":this.fillLast=lg,e=4;break;case"base64":this.text=wg,this.end=gg,e=3;break;default:this.write=bg,this.end=mg;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ss.allocUnsafe(e)}un.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<t.length?e?e+this.text(t,r):this.text(t,r):e||""};un.prototype.end=hg;un.prototype.text=dg;un.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function _s(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function ug(t,e,r){var n=e.length-1;if(n<r)return 0;var i=_s(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=_s(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=_s(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function fg(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 lg(t){var e=this.lastTotal-this.lastNeed,r=fg(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 dg(t,e){var r=ug(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 hg(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function pg(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 yg(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 wg(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 gg(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function bg(t){return t.toString(this.encoding)}function mg(t){return t&&t.length?this.write(t):""}});var Ts=S((Fv,$f)=>{"use strict";var qv=f(l()),Ff=gt(),{PromisePrototypeThen:xg,SymbolAsyncIterator:qf,SymbolIterator:jf}=ee(),{Buffer:Eg}=fe(),{ERR_INVALID_ARG_TYPE:vg,ERR_STREAM_NULL_VALUES:_g}=ce().codes;function Sg(t,e,r){let n;if(typeof e=="string"||e instanceof Eg)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null)}});let i;if(e&&e[qf])i=!0,n=e[qf]();else if(e&&e[jf])i=!1,n=e[jf]();else throw new vg("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...r}),s=!1;o._read=function(){s||(s=!0,a())},o._destroy=function(u,d){xg(c(u),()=>Ff.nextTick(d,u),h=>Ff.nextTick(d,h||u))};async function c(u){let d=u!=null,h=typeof n.throw=="function";if(d&&h){let{value:w,done:y}=await n.throw(u);if(await w,y)return}if(typeof n.return=="function"){let{value:w}=await n.return();await w}}async function a(){for(;;){try{let{value:u,done:d}=i?await n.next():n.next();if(d)o.push(null);else{let h=u&&typeof u.then=="function"?await u:u;if(h===null)throw s=!1,new _g;if(o.push(h))continue;s=!1}}catch(u){o.destroy(u)}break}}return o}$f.exports=Sg});var fn=S((jv,rl)=>{var $v=f(l()),Ae=gt(),{ArrayPrototypeIndexOf:Tg,NumberIsInteger:Ag,NumberIsNaN:Bg,NumberParseInt:Ig,ObjectDefineProperties:Gf,ObjectKeys:Rg,ObjectSetPrototypeOf:Hf,Promise:Og,SafeSet:kg,SymbolAsyncIterator:Lg,Symbol:Cg}=ee();rl.exports=k;k.ReadableState=ks;var{EventEmitter:Ug}=$r(),{Stream:mt,prependListener:Pg}=ui(),{Buffer:As}=fe(),{addAbortSignal:Dg}=an(),Ng=rt(),U=Pe().debuglog("stream",t=>{U=t}),Mg=kf(),Br=Vt(),{getHighWaterMark:Kg,getDefaultHighWaterMark:Fg}=di(),{aggregateTwoErrors:Vf,codes:{ERR_INVALID_ARG_TYPE:qg,ERR_METHOD_NOT_IMPLEMENTED:jg,ERR_OUT_OF_RANGE:$g,ERR_STREAM_PUSH_AFTER_EOF:Vg,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Wg}}=ce(),{validateObject:Gg}=cn(),Gt=Cg("kPaused"),{StringDecoder:Jf}=Kf(),Hg=Ts();Hf(k.prototype,mt.prototype);Hf(k,mt);var Bs=()=>{},{errorOrDestroy:Ar}=Br;function ks(t,e,r){typeof r!="boolean"&&(r=e instanceof je()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.readableObjectMode)),this.highWaterMark=t?Kg(this,t,"readableHighWaterMark",r):Fg(!1),this.buffer=new Mg,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[Gt]=null,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Jf(t.encoding),this.encoding=t.encoding)}function k(t){if(!(this instanceof k))return new k(t);let e=this instanceof je();this._readableState=new ks(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&&Dg(t.signal,this)),mt.call(this,t),Br.construct(this,()=>{this._readableState.needReadable&&pi(this,this._readableState)})}k.prototype.destroy=Br.destroy;k.prototype._undestroy=Br.undestroy;k.prototype._destroy=function(t,e){e(t)};k.prototype[Ug.captureRejectionSymbol]=function(t){this.destroy(t)};k.prototype.push=function(t,e){return zf(this,t,e,!1)};k.prototype.unshift=function(t,e){return zf(this,t,e,!0)};function zf(t,e,r,n){U("readableAddChunk",e);let i=t._readableState,o;if(i.objectMode||(typeof e=="string"?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?e=As.from(e,r).toString(i.encoding):(e=As.from(e,r),r=""))):e instanceof As?r="":mt._isUint8Array(e)?(e=mt._uint8ArrayToBuffer(e),r=""):e!=null&&(o=new qg("chunk",["string","Buffer","Uint8Array"],e))),o)Ar(t,o);else if(e===null)i.reading=!1,Yg(t,i);else if(i.objectMode||e&&e.length>0)if(n)if(i.endEmitted)Ar(t,new Wg);else{if(i.destroyed||i.errored)return!1;Is(t,i,e,!0)}else if(i.ended)Ar(t,new Vg);else{if(i.destroyed||i.errored)return!1;i.reading=!1,i.decoder&&!r?(e=i.decoder.write(e),i.objectMode||e.length!==0?Is(t,i,e,!1):pi(t,i)):Is(t,i,e,!1)}else n||(i.reading=!1,pi(t,i));return!i.ended&&(i.length<i.highWaterMark||i.length===0)}function Is(t,e,r,n){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.multiAwaitDrain?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.needReadable&&yi(t)),pi(t,e)}k.prototype.isPaused=function(){let t=this._readableState;return t[Gt]===!0||t.flowing===!1};k.prototype.setEncoding=function(t){let e=new Jf(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 Jg=1073741824;function zg(t){if(t>Jg)throw new $g("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function Wf(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:Bg(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}k.prototype.read=function(t){U("read",t),t===void 0?t=NaN:Ag(t)||(t=Ig(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=zg(t)),t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return U("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Rs(this):yi(this),null;if(t=Wf(t,e),t===0&&e.ended)return e.length===0&&Rs(this),null;let n=e.needReadable;if(U("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,U("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,U("reading, ended or constructing",n);else if(n){U("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0);try{this._read(e.highWaterMark)}catch(o){Ar(this,o)}e.sync=!1,e.reading||(t=Wf(r,e))}let i;return t>0?i=el(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&&Rs(this)),i!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",i)),i};function Yg(t,e){if(U("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?yi(t):(e.needReadable=!1,e.emittedReadable=!0,Yf(t))}}function yi(t){let e=t._readableState;U("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(U("emitReadable",e.flowing),e.emittedReadable=!0,Ae.nextTick(Yf,t))}function Yf(t){let e=t._readableState;U("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,Zf(t)}function pi(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,Ae.nextTick(Xg,t,e))}function Xg(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(U("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}k.prototype._read=function(t){throw new jg("_read()")};k.prototype.pipe=function(t,e){let r=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new kg(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),U("pipe count=%d opts=%j",n.pipes.length,e);let o=(!e||e.end!==!1)&&t!==Ae.stdout&&t!==Ae.stderr?c:x;n.endEmitted?Ae.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(E,v){U("onunpipe"),E===r&&v&&v.hasUnpiped===!1&&(v.hasUnpiped=!0,d())}function c(){U("onend"),t.end()}let a,u=!1;function d(){U("cleanup"),t.removeListener("close",p),t.removeListener("finish",b),a&&t.removeListener("drain",a),t.removeListener("error",y),t.removeListener("unpipe",s),r.removeListener("end",c),r.removeListener("end",x),r.removeListener("data",w),u=!0,a&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&a()}function h(){u||(n.pipes.length===1&&n.pipes[0]===t?(U("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(U("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),r.pause()),a||(a=Zg(r,t),t.on("drain",a))}r.on("data",w);function w(E){U("ondata");let v=t.write(E);U("dest.write",v),v===!1&&h()}function y(E){if(U("onerror",E),x(),t.removeListener("error",y),t.listenerCount("error")===0){let v=t._writableState||t._readableState;v&&!v.errorEmitted?Ar(t,E):t.emit("error",E)}}Pg(t,"error",y);function p(){t.removeListener("finish",b),x()}t.once("close",p);function b(){U("onfinish"),t.removeListener("close",p),x()}t.once("finish",b);function x(){U("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?n.flowing&&h():n.flowing||(U("pipe resume"),r.resume()),t};function Zg(t,e){return function(){let n=t._readableState;n.awaitDrainWriters===e?(U("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(U("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}k.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 o=0;o<i.length;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}let n=Tg(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};k.prototype.on=function(t,e){let r=mt.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,U("on readable",n.length,n.reading),n.length?yi(this):n.reading||Ae.nextTick(Qg,this)),r};k.prototype.addListener=k.prototype.on;k.prototype.removeListener=function(t,e){let r=mt.prototype.removeListener.call(this,t,e);return t==="readable"&&Ae.nextTick(Xf,this),r};k.prototype.off=k.prototype.removeListener;k.prototype.removeAllListeners=function(t){let e=mt.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&Ae.nextTick(Xf,this),e};function Xf(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[Gt]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function Qg(t){U("readable nexttick read 0"),t.read(0)}k.prototype.resume=function(){let t=this._readableState;return t.flowing||(U("resume"),t.flowing=!t.readableListening,eb(this,t)),t[Gt]=!1,this};function eb(t,e){e.resumeScheduled||(e.resumeScheduled=!0,Ae.nextTick(tb,t,e))}function tb(t,e){U("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Zf(t),e.flowing&&!e.reading&&t.read(0)}k.prototype.pause=function(){return U("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(U("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Gt]=!0,this};function Zf(t){let e=t._readableState;for(U("flow",e.flowing);e.flowing&&t.read()!==null;);}k.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=>{Ar(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=Rg(t);for(let n=1;n<r.length;n++){let i=r[n];this[i]===void 0&&typeof t[i]=="function"&&(this[i]=t[i].bind(t))}return this};k.prototype[Lg]=function(){return Qf(this)};k.prototype.iterator=function(t){return t!==void 0&&Gg(t,"options"),Qf(this,t)};function Qf(t,e){typeof t.read!="function"&&(t=k.wrap(t,{objectMode:!0}));let r=rb(t,e);return r.stream=t,r}async function*rb(t,e){let r=Bs;function n(s){this===t?(r(),r=Bs):r=s}t.on("readable",n);let i,o=Ng(t,{writable:!1},s=>{i=s?Vf(i,s):null,r(),r=Bs});try{for(;;){let s=t.destroyed?null:t.read();if(s!==null)yield s;else{if(i)throw i;if(i===null)return;await new Og(n)}}}catch(s){throw i=Vf(i,s),i}finally{(i||e?.destroyOnReturn!==!1)&&(i===void 0||t._readableState.autoDestroy)?Br.destroyer(t,null):(t.off("readable",n),o())}}Gf(k.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}}});Gf(ks.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Gt]!==!1},set(t){this[Gt]=!!t}}});k._fromList=el;function el(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 Rs(t){let e=t._readableState;U("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,Ae.nextTick(nb,e,t))}function nb(t,e){if(U("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)Ae.nextTick(ib,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function ib(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}k.from=function(t,e){return Hg(k,t,e)};var Os;function tl(){return Os===void 0&&(Os={}),Os}k.fromWeb=function(t,e){return tl().newStreamReadableFromReadableStream(t,e)};k.toWeb=function(t,e){return tl().newReadableStreamFromStreamReadable(t,e)};k.wrap=function(t,e){var r,n;return new k({objectMode:(r=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(i,o){Br.destroyer(t,i),o(i)}}).wrap(t)}});var Ms=S((Vv,pl)=>{var Wv=f(l()),Ht=gt(),{ArrayPrototypeSlice:ol,Error:ob,FunctionPrototypeSymbolHasInstance:sl,ObjectDefineProperty:cl,ObjectDefineProperties:sb,ObjectSetPrototypeOf:al,StringPrototypeToLowerCase:cb,Symbol:ab,SymbolHasInstance:ub}=ee();pl.exports=H;H.WritableState=hn;var{EventEmitter:fb}=$r(),ln=ui().Stream,{Buffer:wi}=fe(),mi=Vt(),{addAbortSignal:lb}=an(),{getHighWaterMark:db,getDefaultHighWaterMark:hb}=di(),{ERR_INVALID_ARG_TYPE:pb,ERR_METHOD_NOT_IMPLEMENTED:yb,ERR_MULTIPLE_CALLBACK:ul,ERR_STREAM_CANNOT_PIPE:wb,ERR_STREAM_DESTROYED:dn,ERR_STREAM_ALREADY_FINISHED:gb,ERR_STREAM_NULL_VALUES:bb,ERR_STREAM_WRITE_AFTER_END:mb,ERR_UNKNOWN_ENCODING:fl}=ce().codes,{errorOrDestroy:Ir}=mi;al(H.prototype,ln.prototype);al(H,ln);function Us(){}var Rr=ab("kOnFinished");function hn(t,e,r){typeof r!="boolean"&&(r=e instanceof je()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?db(this,t,"writableHighWaterMark",r):hb(!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=Eb.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,bi(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[Rr]=[]}function bi(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}hn.prototype.getBuffer=function(){return ol(this.buffered,this.bufferedIndex)};cl(hn.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function H(t){let e=this instanceof je();if(!e&&!sl(H,this))return new H(t);this._writableState=new hn(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&&lb(t.signal,this)),ln.call(this,t),mi.construct(this,()=>{let r=this._writableState;r.writing||Ds(this,r),Ns(this,r)})}cl(H,ub,{__proto__:null,value:function(t){return sl(this,t)?!0:this!==H?!1:t&&t._writableState instanceof hn}});H.prototype.pipe=function(){Ir(this,new wb)};function ll(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"&&!wi.isEncoding(r))throw new fl(r);typeof n!="function"&&(n=Us)}if(e===null)throw new bb;if(!i.objectMode)if(typeof e=="string")i.decodeStrings!==!1&&(e=wi.from(e,r),r="buffer");else if(e instanceof wi)r="buffer";else if(ln._isUint8Array(e))e=ln._uint8ArrayToBuffer(e),r="buffer";else throw new pb("chunk",["string","Buffer","Uint8Array"],e);let o;return i.ending?o=new mb:i.destroyed&&(o=new dn("write")),o?(Ht.nextTick(n,o),Ir(t,o,!0),o):(i.pendingcb++,xb(t,i,e,r,n))}H.prototype.write=function(t,e,r){return ll(this,t,e,r)===!0};H.prototype.cork=function(){this._writableState.corked++};H.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Ds(this,t))};H.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=cb(e)),!wi.isEncoding(e))throw new fl(e);return this._writableState.defaultEncoding=e,this};function xb(t,e,r,n,i){let o=e.objectMode?1:r.length;e.length+=o;let s=e.length<e.highWaterMark;return s||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:n,callback:i}),e.allBuffers&&n!=="buffer"&&(e.allBuffers=!1),e.allNoop&&i!==Us&&(e.allNoop=!1)):(e.writelen=o,e.writecb=i,e.writing=!0,e.sync=!0,t._write(r,n,e.onwrite),e.sync=!1),s&&!e.errored&&!e.destroyed}function nl(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new dn("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function il(t,e,r,n){--e.pendingcb,n(r),Ps(e),Ir(t,r)}function Eb(t,e){let r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function"){Ir(t,new ul);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e?(e.stack,r.errored||(r.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),n?Ht.nextTick(il,t,r,e,i):il(t,r,e,i)):(r.buffered.length>r.bufferedIndex&&Ds(t,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:t,state:r},Ht.nextTick(vb,r.afterWriteTickInfo)):dl(t,r,1,i))}function vb({stream:t,state:e,count:r,cb:n}){return e.afterWriteTickInfo=null,dl(t,e,r,n)}function dl(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&&Ps(e),Ns(t,e)}function Ps(t){if(t.writing)return;for(let i=t.bufferedIndex;i<t.buffered.length;++i){var e;let{chunk:o,callback:s}=t.buffered[i],c=t.objectMode?1:o.length;t.length-=c,s((e=t.errored)!==null&&e!==void 0?e:new dn("write"))}let r=t[Rr].splice(0);for(let i=0;i<r.length;i++){var n;r[i]((n=t.errored)!==null&&n!==void 0?n:new dn("end"))}bi(t)}function Ds(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:i}=e,o=r.length-n;if(!o)return;let s=n;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let c=e.allNoop?Us:u=>{for(let d=s;d<r.length;++d)r[d].callback(u)},a=e.allNoop&&s===0?r:ol(r,s);a.allBuffers=e.allBuffers,nl(t,e,!0,e.length,a,"",c),bi(e)}else{do{let{chunk:c,encoding:a,callback:u}=r[s];r[s++]=null;let d=i?1:c.length;nl(t,e,!1,d,c,a,u)}while(s<r.length&&!e.writing);s===r.length?bi(e):s>256?(r.splice(0,s),e.bufferedIndex=0):e.bufferedIndex=s}e.bufferProcessing=!1}H.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new yb("_write()")};H.prototype._writev=null;H.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 o=ll(this,t,e);o instanceof ob&&(i=o)}return n.corked&&(n.corked=1,this.uncork()),i||(!n.errored&&!n.ending?(n.ending=!0,Ns(this,n,!0),n.ended=!0):n.finished?i=new gb("end"):n.destroyed&&(i=new dn("end"))),typeof r=="function"&&(i||n.finished?Ht.nextTick(r,i):n[Rr].push(r)),this};function gi(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 _b(t,e){let r=!1;function n(i){if(r){Ir(t,i??ul());return}if(r=!0,e.pendingcb--,i){let o=e[Rr].splice(0);for(let s=0;s<o.length;s++)o[s](i);Ir(t,i,e.sync)}else gi(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,Ht.nextTick(Cs,t,e))}e.sync=!0,e.pendingcb++;try{t._final(n)}catch(i){n(i)}e.sync=!1}function Sb(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,_b(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function Ns(t,e,r){gi(e)&&(Sb(t,e),e.pendingcb===0&&(r?(e.pendingcb++,Ht.nextTick((n,i)=>{gi(i)?Cs(n,i):i.pendingcb--},t,e)):gi(e)&&(e.pendingcb++,Cs(t,e))))}function Cs(t,e){e.pendingcb--,e.finished=!0;let r=e[Rr].splice(0);for(let n=0;n<r.length;n++)r[n]();if(t.emit("finish"),e.autoDestroy){let n=t._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&t.destroy()}}sb(H.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Tb=mi.destroy;H.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[Rr].length)&&Ht.nextTick(Ps,r),Tb.call(this,t,e),this};H.prototype._undestroy=mi.undestroy;H.prototype._destroy=function(t,e){e(t)};H.prototype[fb.captureRejectionSymbol]=function(t){this.destroy(t)};var Ls;function hl(){return Ls===void 0&&(Ls={}),Ls}H.fromWeb=function(t,e){return hl().newStreamWritableFromWritableStream(t,e)};H.toWeb=function(t){return hl().newWritableStreamFromStreamWritable(t)}});var Al=S((Gv,Tl)=>{var Hv=f(l()),Ks=gt(),Ab=fe(),{isReadable:Bb,isWritable:Ib,isIterable:yl,isNodeStream:Rb,isReadableNodeStream:wl,isWritableNodeStream:gl,isDuplexNodeStream:Ob}=Ke(),bl=rt(),{AbortError:Sl,codes:{ERR_INVALID_ARG_TYPE:kb,ERR_INVALID_RETURN_VALUE:ml}}=ce(),{destroyer:Or}=Vt(),Lb=je(),Cb=fn(),{createDeferredPromise:xl}=Pe(),El=Ts(),vl=globalThis.Blob||Ab.Blob,Ub=typeof vl<"u"?function(e){return e instanceof vl}:function(e){return!1},Pb=globalThis.AbortController||Qn().AbortController,{FunctionPrototypeCall:_l}=ee(),Jt=class extends Lb{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)}};Tl.exports=function t(e,r){if(Ob(e))return e;if(wl(e))return xi({readable:e});if(gl(e))return xi({writable:e});if(Rb(e))return xi({writable:!1,readable:!1});if(typeof e=="function"){let{value:i,write:o,final:s,destroy:c}=Db(e);if(yl(i))return El(Jt,i,{objectMode:!0,write:o,final:s,destroy:c});let a=i?.then;if(typeof a=="function"){let u,d=_l(a,i,h=>{if(h!=null)throw new ml("nully","body",h)},h=>{Or(u,h)});return u=new Jt({objectMode:!0,readable:!1,write:o,final(h){s(async()=>{try{await d,Ks.nextTick(h,null)}catch(w){Ks.nextTick(h,w)}})},destroy:c})}throw new ml("Iterable, AsyncIterable or AsyncFunction",r,i)}if(Ub(e))return t(e.arrayBuffer());if(yl(e))return El(Jt,e,{objectMode:!0,writable:!1});if(typeof e?.writable=="object"||typeof e?.readable=="object"){let i=e!=null&&e.readable?wl(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?gl(e?.writable)?e?.writable:t(e.writable):void 0;return xi({readable:i,writable:o})}let n=e?.then;if(typeof n=="function"){let i;return _l(n,e,o=>{o!=null&&i.push(o),i.push(null)},o=>{Or(i,o)}),i=new Jt({objectMode:!0,writable:!1,read(){}})}throw new kb(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function Db(t){let{promise:e,resolve:r}=xl(),n=new Pb,i=n.signal;return{value:t(async function*(){for(;;){let s=e;e=null;let{chunk:c,done:a,cb:u}=await s;if(Ks.nextTick(u),a)return;if(i.aborted)throw new Sl(void 0,{cause:i.reason});({promise:e,resolve:r}=xl()),yield c}}(),{signal:i}),write(s,c,a){let u=r;r=null,u({chunk:s,done:!1,cb:a})},final(s){let c=r;r=null,c({done:!0,cb:s})},destroy(s,c){n.abort(),c(s)}}}function xi(t){let e=t.readable&&typeof t.readable.read!="function"?Cb.wrap(t.readable):t.readable,r=t.writable,n=!!Bb(e),i=!!Ib(r),o,s,c,a,u;function d(h){let w=a;a=null,w?w(h):h&&u.destroy(h)}return u=new Jt({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:i}),i&&(bl(r,h=>{i=!1,h&&Or(e,h),d(h)}),u._write=function(h,w,y){r.write(h,w)?y():o=y},u._final=function(h){r.end(),s=h},r.on("drain",function(){if(o){let h=o;o=null,h()}}),r.on("finish",function(){if(s){let h=s;s=null,h()}})),n&&(bl(e,h=>{n=!1,h&&Or(e,h),d(h)}),e.on("readable",function(){if(c){let h=c;c=null,h()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let h=e.read();if(h===null){c=u._read;return}if(!u.push(h))return}}),u._destroy=function(h,w){!h&&a!==null&&(h=new Sl),c=null,o=null,s=null,a===null?w(h):(a=w,Or(r,h),Or(e,h))},u}});var je=S((Jv,Rl)=>{"use strict";var zv=f(l()),{ObjectDefineProperties:Nb,ObjectGetOwnPropertyDescriptor:nt,ObjectKeys:Mb,ObjectSetPrototypeOf:Bl}=ee();Rl.exports=Be;var js=fn(),Ee=Ms();Bl(Be.prototype,js.prototype);Bl(Be,js);{let t=Mb(Ee.prototype);for(let e=0;e<t.length;e++){let r=t[e];Be.prototype[r]||(Be.prototype[r]=Ee.prototype[r])}}function Be(t){if(!(this instanceof Be))return new Be(t);js.call(this,t),Ee.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}Nb(Be.prototype,{writable:{__proto__:null,...nt(Ee.prototype,"writable")},writableHighWaterMark:{__proto__:null,...nt(Ee.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...nt(Ee.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...nt(Ee.prototype,"writableBuffer")},writableLength:{__proto__:null,...nt(Ee.prototype,"writableLength")},writableFinished:{__proto__:null,...nt(Ee.prototype,"writableFinished")},writableCorked:{__proto__:null,...nt(Ee.prototype,"writableCorked")},writableEnded:{__proto__:null,...nt(Ee.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...nt(Ee.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var Fs;function Il(){return Fs===void 0&&(Fs={}),Fs}Be.fromWeb=function(t,e){return Il().newStreamDuplexFromReadableWritablePair(t,e)};Be.toWeb=function(t){return Il().newReadableWritablePairFromDuplex(t)};var qs;Be.from=function(t){return qs||(qs=Al()),qs(t,"body")}});var Ws=S((Yv,kl)=>{"use strict";var Xv=f(l()),{ObjectSetPrototypeOf:Ol,Symbol:Kb}=ee();kl.exports=it;var{ERR_METHOD_NOT_IMPLEMENTED:Fb}=ce().codes,Vs=je(),{getHighWaterMark:qb}=di();Ol(it.prototype,Vs.prototype);Ol(it,Vs);var pn=Kb("kCallback");function it(t){if(!(this instanceof it))return new it(t);let e=t?qb(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),Vs.call(this,t),this._readableState.sync=!1,this[pn]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",jb)}function $s(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 jb(){this._final!==$s&&$s.call(this)}it.prototype._final=$s;it.prototype._transform=function(t,e,r){throw new Fb("_transform()")};it.prototype._write=function(t,e,r){let n=this._readableState,i=this._writableState,o=n.length;this._transform(t,e,(s,c)=>{if(s){r(s);return}c!=null&&this.push(c),i.ended||o===n.length||n.length<n.highWaterMark?r():this[pn]=r})};it.prototype._read=function(){if(this[pn]){let t=this[pn];this[pn]=null,t()}}});var Hs=S((Zv,Cl)=>{"use strict";var Qv=f(l()),{ObjectSetPrototypeOf:Ll}=ee();Cl.exports=kr;var Gs=Ws();Ll(kr.prototype,Gs.prototype);Ll(kr,Gs);function kr(t){if(!(this instanceof kr))return new kr(t);Gs.call(this,t)}kr.prototype._transform=function(t,e,r){r(null,t)}});var Si=S((e_,Ml)=>{var t_=f(l()),yn=gt(),{ArrayIsArray:$b,Promise:Vb,SymbolAsyncIterator:Wb}=ee(),_i=rt(),{once:Gb}=Pe(),Hb=Vt(),Ul=je(),{aggregateTwoErrors:Jb,codes:{ERR_INVALID_ARG_TYPE:tc,ERR_INVALID_RETURN_VALUE:Js,ERR_MISSING_ARGS:zb,ERR_STREAM_DESTROYED:Yb,ERR_STREAM_PREMATURE_CLOSE:Xb},AbortError:Zb}=ce(),{validateFunction:Qb,validateAbortSignal:e0}=cn(),{isIterable:zt,isReadable:zs,isReadableNodeStream:vi,isNodeStream:Pl,isTransformStream:Lr,isWebStream:t0,isReadableStream:Ys,isReadableEnded:r0}=Ke(),n0=globalThis.AbortController||Qn().AbortController,Xs,Zs;function Dl(t,e,r){let n=!1;t.on("close",()=>{n=!0});let i=_i(t,{readable:e,writable:r},o=>{n=!o});return{destroy:o=>{n||(n=!0,Hb.destroyer(t,o||new Yb("pipe")))},cleanup:i}}function i0(t){return Qb(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function Qs(t){if(zt(t))return t;if(vi(t))return o0(t);throw new tc("val",["Readable","Iterable","AsyncIterable"],t)}async function*o0(t){Zs||(Zs=fn()),yield*Zs.prototype[Wb].call(t)}async function Ei(t,e,r,{end:n}){let i,o=null,s=u=>{if(u&&(i=u),o){let d=o;o=null,d()}},c=()=>new Vb((u,d)=>{i?d(i):o=()=>{i?d(i):u()}});e.on("drain",s);let a=_i(e,{readable:!1},s);try{e.writableNeedDrain&&await c();for await(let u of t)e.write(u)||await c();n&&e.end(),await c(),r()}catch(u){r(i!==u?Jb(i,u):u)}finally{a(),e.off("drain",s)}}async function ec(t,e,r,{end:n}){Lr(e)&&(e=e.writable);let i=e.getWriter();try{for await(let o of t)await i.ready,i.write(o).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(o){try{await i.abort(o),r(o)}catch(s){r(s)}}}function s0(...t){return Nl(t,Gb(i0(t)))}function Nl(t,e,r){if(t.length===1&&$b(t[0])&&(t=t[0]),t.length<2)throw new zb("streams");let n=new n0,i=n.signal,o=r?.signal,s=[];e0(o,"options.signal");function c(){y(new Zb)}o?.addEventListener("abort",c);let a,u,d=[],h=0;function w(v){y(v,--h===0)}function y(v,m){if(v&&(!a||a.code==="ERR_STREAM_PREMATURE_CLOSE")&&(a=v),!(!a&&!m)){for(;d.length;)d.shift()(a);o?.removeEventListener("abort",c),n.abort(),m&&(a||s.forEach(A=>A()),yn.nextTick(e,a,u))}}let p;for(let v=0;v<t.length;v++){let m=t[v],A=v<t.length-1,C=v>0,I=A||r?.end!==!1,P=v===t.length-1;if(Pl(m)){let B=function(O){O&&O.name!=="AbortError"&&O.code!=="ERR_STREAM_PREMATURE_CLOSE"&&w(O)};var E=B;if(I){let{destroy:O,cleanup:N}=Dl(m,A,C);d.push(O),zs(m)&&P&&s.push(N)}m.on("error",B),zs(m)&&P&&s.push(()=>{m.removeListener("error",B)})}if(v===0)if(typeof m=="function"){if(p=m({signal:i}),!zt(p))throw new Js("Iterable, AsyncIterable or Stream","source",p)}else zt(m)||vi(m)||Lr(m)?p=m:p=Ul.from(m);else if(typeof m=="function"){if(Lr(p)){var b;p=Qs((b=p)===null||b===void 0?void 0:b.readable)}else p=Qs(p);if(p=m(p,{signal:i}),A){if(!zt(p,!0))throw new Js("AsyncIterable",`transform[${v-1}]`,p)}else{var x;Xs||(Xs=Hs());let B=new Xs({objectMode:!0}),O=(x=p)===null||x===void 0?void 0:x.then;if(typeof O=="function")h++,O.call(p,D=>{u=D,D!=null&&B.write(D),I&&B.end(),yn.nextTick(w)},D=>{B.destroy(D),yn.nextTick(w,D)});else if(zt(p,!0))h++,Ei(p,B,w,{end:I});else if(Ys(p)||Lr(p)){let D=p.readable||p;h++,Ei(D,B,w,{end:I})}else throw new Js("AsyncIterable or Promise","destination",p);p=B;let{destroy:N,cleanup:K}=Dl(p,!1,!0);d.push(N),P&&s.push(K)}}else if(Pl(m)){if(vi(p)){h+=2;let B=c0(p,m,w,{end:I});zs(m)&&P&&s.push(B)}else if(Lr(p)||Ys(p)){let B=p.readable||p;h++,Ei(B,m,w,{end:I})}else if(zt(p))h++,Ei(p,m,w,{end:I});else throw new tc("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],p);p=m}else if(t0(m)){if(vi(p))h++,ec(Qs(p),m,w,{end:I});else if(Ys(p)||zt(p))h++,ec(p,m,w,{end:I});else if(Lr(p))h++,ec(p.readable,m,w,{end:I});else throw new tc("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],p);p=m}else p=Ul.from(m)}return(i!=null&&i.aborted||o!=null&&o.aborted)&&yn.nextTick(c),p}function c0(t,e,r,{end:n}){let i=!1;if(e.on("close",()=>{i||r(new Xb)}),t.pipe(e,{end:!1}),n){let s=function(){i=!0,e.end()};var o=s;r0(t)?yn.nextTick(s):t.once("end",s)}else r();return _i(t,{readable:!0,writable:!1},s=>{let c=t._readableState;s&&s.code==="ERR_STREAM_PREMATURE_CLOSE"&&c&&c.ended&&!c.errored&&!c.errorEmitted?t.once("end",r).once("error",r):r(s)}),_i(e,{readable:!1,writable:!0},r)}Ml.exports={pipelineImpl:Nl,pipeline:s0}});var nc=S((r_,Vl)=>{"use strict";var n_=f(l()),{pipeline:a0}=Si(),Ti=je(),{destroyer:u0}=Vt(),{isNodeStream:Ai,isReadable:Kl,isWritable:Fl,isWebStream:rc,isTransformStream:Yt,isWritableStream:ql,isReadableStream:jl}=Ke(),{AbortError:f0,codes:{ERR_INVALID_ARG_VALUE:$l,ERR_MISSING_ARGS:l0}}=ce(),d0=rt();Vl.exports=function(...e){if(e.length===0)throw new l0("streams");if(e.length===1)return Ti.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=Ti.from(e[0])),typeof e[e.length-1]=="function"){let y=e.length-1;e[y]=Ti.from(e[y])}for(let y=0;y<e.length;++y)if(!(!Ai(e[y])&&!rc(e[y]))){if(y<e.length-1&&!(Kl(e[y])||jl(e[y])||Yt(e[y])))throw new $l(`streams[${y}]`,r[y],"must be readable");if(y>0&&!(Fl(e[y])||ql(e[y])||Yt(e[y])))throw new $l(`streams[${y}]`,r[y],"must be writable")}let n,i,o,s,c;function a(y){let p=s;s=null,p?p(y):y?c.destroy(y):!w&&!h&&c.destroy()}let u=e[0],d=a0(e,a),h=!!(Fl(u)||ql(u)||Yt(u)),w=!!(Kl(d)||jl(d)||Yt(d));if(c=new Ti({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(d!=null&&d.writableObjectMode),writable:h,readable:w}),h){if(Ai(u))c._write=function(p,b,x){u.write(p,b)?x():n=x},c._final=function(p){u.end(),i=p},u.on("drain",function(){if(n){let p=n;n=null,p()}});else if(rc(u)){let b=(Yt(u)?u.writable:u).getWriter();c._write=async function(x,E,v){try{await b.ready,b.write(x).catch(()=>{}),v()}catch(m){v(m)}},c._final=async function(x){try{await b.ready,b.close().catch(()=>{}),i=x}catch(E){x(E)}}}let y=Yt(d)?d.readable:d;d0(y,()=>{if(i){let p=i;i=null,p()}})}if(w){if(Ai(d))d.on("readable",function(){if(o){let y=o;o=null,y()}}),d.on("end",function(){c.push(null)}),c._read=function(){for(;;){let y=d.read();if(y===null){o=c._read;return}if(!c.push(y))return}};else if(rc(d)){let p=(Yt(d)?d.readable:d).getReader();c._read=async function(){for(;;)try{let{value:b,done:x}=await p.read();if(!c.push(b))return;if(x){c.push(null);return}}catch{return}}}}return c._destroy=function(y,p){!y&&s!==null&&(y=new f0),o=null,n=null,i=null,s===null?p(y):(s=p,Ai(d)&&u0(d,y))},c}});var Zl=S((i_,sc)=>{"use strict";var o_=f(l()),Jl=globalThis.AbortController||Qn().AbortController,{codes:{ERR_INVALID_ARG_VALUE:h0,ERR_INVALID_ARG_TYPE:wn,ERR_MISSING_ARGS:p0,ERR_OUT_OF_RANGE:y0},AbortError:$e}=ce(),{validateAbortSignal:Xt,validateInteger:w0,validateObject:Zt}=cn(),g0=ee().Symbol("kWeak"),{finished:b0}=rt(),m0=nc(),{addAbortSignalNoValidate:x0}=an(),{isWritable:E0,isNodeStream:v0}=Ke(),{ArrayPrototypePush:_0,MathFloor:S0,Number:T0,NumberIsNaN:A0,Promise:Wl,PromiseReject:Gl,PromisePrototypeThen:B0,Symbol:zl}=ee(),Bi=zl("kEmpty"),Hl=zl("kEof");function I0(t,e){if(e!=null&&Zt(e,"options"),e?.signal!=null&&Xt(e.signal,"options.signal"),v0(t)&&!E0(t))throw new h0("stream",t,"must be writable");let r=m0(this,t);return e!=null&&e.signal&&x0(e.signal,r),r}function Ii(t,e){if(typeof t!="function")throw new wn("fn",["Function","AsyncFunction"],t);e!=null&&Zt(e,"options"),e?.signal!=null&&Xt(e.signal,"options.signal");let r=1;return e?.concurrency!=null&&(r=S0(e.concurrency)),w0(r,"concurrency",1),(async function*(){var i,o;let s=new Jl,c=this,a=[],u=s.signal,d={signal:u},h=()=>s.abort();e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted&&h(),e==null||(o=e.signal)===null||o===void 0||o.addEventListener("abort",h);let w,y,p=!1;function b(){p=!0}async function x(){try{for await(let m of c){var E;if(p)return;if(u.aborted)throw new $e;try{m=t(m,d)}catch(A){m=Gl(A)}m!==Bi&&(typeof((E=m)===null||E===void 0?void 0:E.catch)=="function"&&m.catch(b),a.push(m),w&&(w(),w=null),!p&&a.length&&a.length>=r&&await new Wl(A=>{y=A}))}a.push(Hl)}catch(m){let A=Gl(m);B0(A,void 0,b),a.push(A)}finally{var v;p=!0,w&&(w(),w=null),e==null||(v=e.signal)===null||v===void 0||v.removeEventListener("abort",h)}}x();try{for(;;){for(;a.length>0;){let E=await a[0];if(E===Hl)return;if(u.aborted)throw new $e;E!==Bi&&(yield E),a.shift(),y&&(y(),y=null)}await new Wl(E=>{w=E})}}finally{s.abort(),p=!0,y&&(y(),y=null)}}).call(this)}function R0(t=void 0){return t!=null&&Zt(t,"options"),t?.signal!=null&&Xt(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 $e({cause:t.signal.reason});yield[r++,i]}}).call(this)}async function Yl(t,e=void 0){for await(let r of oc.call(this,t,e))return!0;return!1}async function O0(t,e=void 0){if(typeof t!="function")throw new wn("fn",["Function","AsyncFunction"],t);return!await Yl.call(this,async(...r)=>!await t(...r),e)}async function k0(t,e){for await(let r of oc.call(this,t,e))return r}async function L0(t,e){if(typeof t!="function")throw new wn("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i),Bi}for await(let n of Ii.call(this,r,e));}function oc(t,e){if(typeof t!="function")throw new wn("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i)?n:Bi}return Ii.call(this,r,e)}var ic=class extends p0{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function C0(t,e,r){var n;if(typeof t!="function")throw new wn("reducer",["Function","AsyncFunction"],t);r!=null&&Zt(r,"options"),r?.signal!=null&&Xt(r.signal,"options.signal");let i=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let u=new $e(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await b0(this.destroy(u)),u}let o=new Jl,s=o.signal;if(r!=null&&r.signal){let u={once:!0,[g0]:this};r.signal.addEventListener("abort",()=>o.abort(),u)}let c=!1;try{for await(let u of this){var a;if(c=!0,r!=null&&(a=r.signal)!==null&&a!==void 0&&a.aborted)throw new $e;i?e=await t(e,u,{signal:s}):(e=u,i=!0)}if(!c&&!i)throw new ic}finally{o.abort()}return e}async function U0(t){t!=null&&Zt(t,"options"),t?.signal!=null&&Xt(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 $e(void 0,{cause:t.signal.reason});_0(e,n)}return e}function P0(t,e){let r=Ii.call(this,t,e);return(async function*(){for await(let i of r)yield*i}).call(this)}function Xl(t){if(t=T0(t),A0(t))return 0;if(t<0)throw new y0("number",">= 0",t);return t}function D0(t,e=void 0){return e!=null&&Zt(e,"options"),e?.signal!=null&&Xt(e.signal,"options.signal"),t=Xl(t),(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new $e;for await(let o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new $e;t--<=0&&(yield o)}}).call(this)}function N0(t,e=void 0){return e!=null&&Zt(e,"options"),e?.signal!=null&&Xt(e.signal,"options.signal"),t=Xl(t),(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new $e;for await(let o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new $e;if(t-- >0)yield o;else return}}).call(this)}sc.exports.streamReturningOperators={asIndexedPairs:R0,drop:D0,filter:oc,flatMap:P0,map:Ii,take:N0,compose:I0};sc.exports.promiseReturningOperators={every:O0,forEach:L0,reduce:C0,toArray:U0,some:Yl,find:k0}});var cc=S((s_,Ql)=>{"use strict";var c_=f(l()),{ArrayPrototypePop:M0,Promise:K0}=ee(),{isIterable:F0,isNodeStream:q0,isWebStream:j0}=Ke(),{pipelineImpl:$0}=Si(),{finished:V0}=rt();ac();function W0(...t){return new K0((e,r)=>{let n,i,o=t[t.length-1];if(o&&typeof o=="object"&&!q0(o)&&!F0(o)&&!j0(o)){let s=M0(t);n=s.signal,i=s.end}$0(t,(s,c)=>{s?r(s):e(c)},{signal:n,end:i})})}Ql.exports={finished:V0,pipeline:W0}});var ac=S((a_,ad)=>{var u_=f(l()),{Buffer:G0}=fe(),{ObjectDefineProperty:ot,ObjectKeys:rd,ReflectApply:nd}=ee(),{promisify:{custom:id}}=Pe(),{streamReturningOperators:ed,promiseReturningOperators:td}=Zl(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:od}}=ce(),H0=nc(),{pipeline:sd}=Si(),{destroyer:J0}=Vt(),cd=rt(),uc=cc(),fc=Ke(),Z=ad.exports=ui().Stream;Z.isDisturbed=fc.isDisturbed;Z.isErrored=fc.isErrored;Z.isReadable=fc.isReadable;Z.Readable=fn();for(let t of rd(ed)){let r=function(...n){if(new.target)throw od();return Z.Readable.from(nd(e,this,n))};lc=r;let e=ed[t];ot(r,"name",{__proto__:null,value:e.name}),ot(r,"length",{__proto__:null,value:e.length}),ot(Z.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var lc;for(let t of rd(td)){let r=function(...i){if(new.target)throw od();return nd(e,this,i)};lc=r;let e=td[t];ot(r,"name",{__proto__:null,value:e.name}),ot(r,"length",{__proto__:null,value:e.length}),ot(Z.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var lc;Z.Writable=Ms();Z.Duplex=je();Z.Transform=Ws();Z.PassThrough=Hs();Z.pipeline=sd;var{addAbortSignal:z0}=an();Z.addAbortSignal=z0;Z.finished=cd;Z.destroy=J0;Z.compose=H0;ot(Z,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return uc}});ot(sd,id,{__proto__:null,enumerable:!0,get(){return uc.pipeline}});ot(cd,id,{__proto__:null,enumerable:!0,get(){return uc.finished}});Z.Stream=Z;Z._isUint8Array=function(e){return e instanceof Uint8Array};Z._uint8ArrayToBuffer=function(e){return G0.from(e.buffer,e.byteOffset,e.byteLength)}});var dc=S((f_,Q)=>{"use strict";var l_=f(l()),te=ac(),Y0=cc(),X0=te.Readable.destroy;Q.exports=te.Readable;Q.exports._uint8ArrayToBuffer=te._uint8ArrayToBuffer;Q.exports._isUint8Array=te._isUint8Array;Q.exports.isDisturbed=te.isDisturbed;Q.exports.isErrored=te.isErrored;Q.exports.isReadable=te.isReadable;Q.exports.Readable=te.Readable;Q.exports.Writable=te.Writable;Q.exports.Duplex=te.Duplex;Q.exports.Transform=te.Transform;Q.exports.PassThrough=te.PassThrough;Q.exports.addAbortSignal=te.addAbortSignal;Q.exports.finished=te.finished;Q.exports.destroy=te.destroy;Q.exports.destroy=X0;Q.exports.pipeline=te.pipeline;Q.exports.compose=te.compose;Object.defineProperty(te,"promises",{configurable:!0,enumerable:!0,get(){return Y0}});Q.exports.Stream=te.Stream;Q.exports.default=Q.exports});var z1=f(l(),1);var b_=f(l(),1);var jm=f(l(),1),mh=f(zc(),1);var Ax=f(l(),1);var ax=f(l(),1);var Zm=f(l(),1);var Vm=f(l(),1);function xh(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),s=o.charCodeAt(0);if(r[s]!==255)throw new TypeError(o+" is ambiguous");r[s]=i}var c=t.length,a=t.charAt(0),u=Math.log(c)/Math.log(256),d=Math.log(256)/Math.log(c);function h(p){if(p instanceof Uint8Array||(ArrayBuffer.isView(p)?p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength):Array.isArray(p)&&(p=Uint8Array.from(p))),!(p instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(p.length===0)return"";for(var b=0,x=0,E=0,v=p.length;E!==v&&p[E]===0;)E++,b++;for(var m=(v-E)*d+1>>>0,A=new Uint8Array(m);E!==v;){for(var C=p[E],I=0,P=m-1;(C!==0||I<x)&&P!==-1;P--,I++)C+=256*A[P]>>>0,A[P]=C%c>>>0,C=C/c>>>0;if(C!==0)throw new Error("Non-zero carry");x=I,E++}for(var B=m-x;B!==m&&A[B]===0;)B++;for(var O=a.repeat(b);B<m;++B)O+=t.charAt(A[B]);return O}function w(p){if(typeof p!="string")throw new TypeError("Expected String");if(p.length===0)return new Uint8Array;var b=0;if(p[b]!==" "){for(var x=0,E=0;p[b]===a;)x++,b++;for(var v=(p.length-b)*u+1>>>0,m=new Uint8Array(v);p[b];){var A=r[p.charCodeAt(b)];if(A===255)return;for(var C=0,I=v-1;(A!==0||C<E)&&I!==-1;I--,C++)A+=c*m[I]>>>0,m[I]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");E=C,b++}if(p[b]!==" "){for(var P=v-E;P!==v&&m[P]===0;)P++;for(var B=new Uint8Array(x+(v-P)),O=x;P!==v;)B[O++]=m[P++];return B}}}function y(p){var b=w(p);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:h,decodeUnsafe:w,decode:y}}var Eh=xh,vh=Eh,Yc=vh;var Gm=f(l(),1),Wm=new Uint8Array(0);var Xc=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0},fr=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var Hm=f(l(),1);var Xi=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Zi=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Zc(this,e)}},Qi=class{constructor(e){this.decoders=e}or(e){return Zc(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Zc=(t,e)=>new Qi({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),eo=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Xi(e,r,n),this.decoder=new Zi(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Qc=({name:t,prefix:e,encode:r,decode:n})=>new eo(t,e,r,n),to=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=Yc(r,e);return Qc({prefix:t,name:e,encode:n,decode:o=>fr(i(o))})},Sh=(t,e,r,n)=>{let i={};for(let d=0;d<e.length;++d)i[e[d]]=d;let o=t.length;for(;t[o-1]==="=";)--o;let s=new Uint8Array(o*r/8|0),c=0,a=0,u=0;for(let d=0;d<o;++d){let h=i[t[d]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);a=a<<r|h,c+=r,c>=8&&(c-=8,s[u++]=255&a>>c)}if(c>=r||255&a<<8-c)throw new SyntaxError("Unexpected end of data");return s},Th=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<<r)-1,o="",s=0,c=0;for(let a=0;a<t.length;++a)for(c=c<<8|t[a],s+=8;s>r;)s-=r,o+=e[i&c>>s];if(s&&(o+=e[i&c<<r-s]),n)for(;o.length*r&7;)o+="=";return o},se=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Qc({prefix:e,name:t,encode(i){return Th(i,n,r)},decode(i){return Sh(i,n,r,t)}});var Pr=se({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ex=se({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),tx=se({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),rx=se({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),nx=se({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),ix=se({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),ox=se({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),sx=se({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ro=se({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var dx=f(l(),1);var le=to({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),fx=to({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var bx=f(l(),1);var px=se({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),yx=se({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ke=se({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),wx=se({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var xx=f(l(),1);function ea(t){return t.byteOffset!==0||t.byteLength!==t.buffer.byteLength}function ta(t){return typeof t!="object"||t===null?!1:typeof t[Symbol.asyncIterator]=="function"}function _n(t){let r=Object.prototype.toString.call(t).match(/\s([a-zA-Z0-9]+)/),[n,i]=r;return i}var Dr=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function c(d){try{u(n.next(d))}catch(h){s(h)}}function a(d){try{u(n.throw(d))}catch(h){s(h)}}function u(d){d.done?o(d.value):i(d.value).then(c,a)}u((n=n.apply(t,e||[])).next())})},ra=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(c,a){s=t[o](s),i(c,a,s.done,s.value)})}}function i(o,s,c,a){Promise.resolve(a).then(function(u){o({value:u,done:c})},s)}},Sn=new TextEncoder,St=new TextDecoder,Y=class t{constructor(e,r){this.data=e,this.format=r}static arrayBuffer(e){return new t(e,"ArrayBuffer")}static asyncIterable(e){if(!ta(e))throw new TypeError("Input must be of type AsyncIterable.");return new t(e,"AsyncIterable")}static base32Z(e){return new t(e,"Base32Z")}static base58Btc(e){return new t(e,"Base58Btc")}static base64Url(e){return new t(e,"Base64Url")}static bufferSource(e){return new t(e,"BufferSource")}static hex(e){if(typeof e!="string")throw new TypeError("Hex input must be a string.");if(e.length%2!==0)throw new TypeError("Hex input must have an even number of characters.");return new t(e,"Hex")}static multibase(e){return new t(e,"Multibase")}static object(e){return new t(e,"Object")}static string(e){return new t(e,"String")}static uint8Array(e){return new t(e,"Uint8Array")}toArrayBuffer(){switch(this.format){case"Base58Btc":return le.baseDecode(this.data).buffer;case"Base64Url":return ke.baseDecode(this.data).buffer;case"BufferSource":{if(_n(this.data)==="ArrayBuffer")return this.data;if(ArrayBuffer.isView(this.data))return ea(this.data)?this.data.buffer.slice(this.data.byteOffset,this.data.byteOffset+this.data.byteLength):this.data.buffer;throw new TypeError(`${this.format} value is not of type: ArrayBuffer, DataView, or TypedArray.`)}case"Hex":return this.toUint8Array().buffer;case"String":return this.toUint8Array().buffer;case"Uint8Array":return this.data.buffer;default:throw new TypeError(`Conversion from ${this.format} to ArrayBuffer is not supported.`)}}toArrayBufferAsync(){return Dr(this,void 0,void 0,function*(){switch(this.format){case"AsyncIterable":return yield(yield this.toBlobAsync()).arrayBuffer();default:throw new TypeError(`Asynchronous conversion from ${this.format} to ArrayBuffer is not supported.`)}})}toBase32Z(){switch(this.format){case"Uint8Array":return ro.baseEncode(this.data);default:throw new TypeError(`Conversion from ${this.format} to Base64Z is not supported.`)}}toBase58Btc(){switch(this.format){case"ArrayBuffer":{let e=new Uint8Array(this.data);return le.baseEncode(e)}case"Multibase":return this.data.substring(1);case"Uint8Array":return le.baseEncode(this.data);default:throw new TypeError(`Conversion from ${this.format} to Base58Btc is not supported.`)}}toBase64Url(){switch(this.format){case"ArrayBuffer":{let e=new Uint8Array(this.data);return ke.baseEncode(e)}case"BufferSource":{let e=this.toUint8Array();return ke.baseEncode(e)}case"Object":{let e=JSON.stringify(this.data),r=Sn.encode(e);return ke.baseEncode(r)}case"String":{let e=Sn.encode(this.data);return ke.baseEncode(e)}case"Uint8Array":return ke.baseEncode(this.data);default:throw new TypeError(`Conversion from ${this.format} to Base64Url is not supported.`)}}toBlobAsync(){var e,r,n,i;return Dr(this,void 0,void 0,function*(){switch(this.format){case"AsyncIterable":{let a=[];try{for(var o=!0,s=ra(this.data),c;c=yield s.next(),e=c.done,!e;o=!0){i=c.value,o=!1;let d=i;a.push(d)}}catch(d){r={error:d}}finally{try{!o&&!e&&(n=s.return)&&(yield n.call(s))}finally{if(r)throw r.error}}return new Blob(a)}default:throw new TypeError(`Asynchronous conversion from ${this.format} to Blob is not supported.`)}})}toHex(){let e=Array.from({length:256},(r,n)=>n.toString(16).padStart(2,"0"));switch(this.format){case"ArrayBuffer":{let r=this.toUint8Array();return t.uint8Array(r).toHex()}case"Base64Url":{let r=this.toUint8Array();return t.uint8Array(r).toHex()}case"Uint8Array":{let r="";for(let n=0;n<this.data.length;n++)r+=e[this.data[n]];return r}default:throw new TypeError(`Conversion from ${this.format} to Hex is not supported.`)}}toMultibase(){switch(this.format){case"Base58Btc":return`z${this.data}`;default:throw new TypeError(`Conversion from ${this.format} to Multibase is not supported.`)}}toObject(){switch(this.format){case"Base64Url":{let e=ke.baseDecode(this.data),r=St.decode(e);return JSON.parse(r)}case"String":return JSON.parse(this.data);case"Uint8Array":{let e=St.decode(this.data);return JSON.parse(e)}default:throw new TypeError(`Conversion from ${this.format} to Object is not supported.`)}}toObjectAsync(){return Dr(this,void 0,void 0,function*(){switch(this.format){case"AsyncIterable":{let e=yield this.toStringAsync();return JSON.parse(e)}default:throw new TypeError(`Asynchronous conversion from ${this.format} to Object is not supported.`)}})}toString(){switch(this.format){case"ArrayBuffer":return St.decode(this.data);case"Base64Url":{let e=ke.baseDecode(this.data);return St.decode(e)}case"Object":return JSON.stringify(this.data);case"Uint8Array":return St.decode(this.data);default:throw new TypeError(`Conversion from ${this.format} to String is not supported.`)}}toStringAsync(){var e,r,n,i;return Dr(this,void 0,void 0,function*(){switch(this.format){case"AsyncIterable":{let a="";try{for(var o=!0,s=ra(this.data),c;c=yield s.next(),e=c.done,!e;o=!0){i=c.value,o=!1;let u=i;typeof u=="string"?a+=u:a+=St.decode(u,{stream:!0})}}catch(u){r={error:u}}finally{try{!o&&!e&&(n=s.return)&&(yield n.call(s))}finally{if(r)throw r.error}}return a+=St.decode(void 0,{stream:!1}),a}default:throw new TypeError(`Asynchronous conversion from ${this.format} to String is not supported.`)}})}toUint8Array(){switch(this.format){case"ArrayBuffer":return new Uint8Array(this.data);case"Base32Z":return ro.baseDecode(this.data);case"Base58Btc":return le.baseDecode(this.data);case"Base64Url":return ke.baseDecode(this.data);case"BufferSource":{let e=_n(this.data);if(e==="Uint8Array")return this.data;if(e==="ArrayBuffer")return new Uint8Array(this.data);if(ArrayBuffer.isView(this.data))return new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength);throw new TypeError(`${this.format} value is not of type: ArrayBuffer, DataView, or TypedArray.`)}case"Hex":{let e=new Uint8Array(this.data.length/2);for(let r=0;r<this.data.length;r+=2){let n=parseInt(this.data.substring(r,r+2),16);if(isNaN(n))throw new TypeError("Input is not a valid hexadecimal string.");e[r/2]=n}return e}case"Object":{let e=JSON.stringify(this.data);return Sn.encode(e)}case"String":return Sn.encode(this.data);default:throw new TypeError(`Conversion from ${this.format} to Uint8Array is not supported.`)}}toUint8ArrayAsync(){return Dr(this,void 0,void 0,function*(){switch(this.format){case"AsyncIterable":{let e=yield this.toArrayBufferAsync();return new Uint8Array(e)}default:throw new TypeError(`Asynchronous conversion from ${this.format} to Uint8Array is not supported.`)}})}};var zx=f(l(),1);var Wx=f(l(),1);var Kx=f(l(),1);var Ge={};Dd(Ge,{decode:()=>lr,encodeTo:()=>Tt,encodingLength:()=>At});var Ox=f(l(),1);var Ix=f(l(),1),Ah=oa,na=128,Bh=127,Ih=~Bh,Rh=Math.pow(2,31);function oa(t,e,r){e=e||[],r=r||0;for(var n=r;t>=Rh;)e[r++]=t&255|na,t/=128;for(;t&Ih;)e[r++]=t&255|na,t>>>=7;return e[r]=t|0,oa.bytes=r-n+1,e}var Oh=no,kh=128,ia=127;function no(t,n){var r=0,n=n||0,i=0,o=n,s,c=t.length;do{if(o>=c)throw no.bytes=0,new RangeError("Could not decode varint");s=t[o++],r+=i<28?(s&ia)<<i:(s&ia)*Math.pow(2,i),i+=7}while(s>=kh);return no.bytes=o-n,r}var Lh=Math.pow(2,7),Ch=Math.pow(2,14),Uh=Math.pow(2,21),Ph=Math.pow(2,28),Dh=Math.pow(2,35),Nh=Math.pow(2,42),Mh=Math.pow(2,49),Kh=Math.pow(2,56),Fh=Math.pow(2,63),qh=function(t){return t<Lh?1:t<Ch?2:t<Uh?3:t<Ph?4:t<Dh?5:t<Nh?6:t<Mh?7:t<Kh?8:t<Fh?9:10},jh={encode:Ah,decode:Oh,encodingLength:qh},$h=jh,Nr=$h;var lr=(t,e=0)=>[Nr.decode(t,e),Nr.decode.bytes],Tt=(t,e,r=0)=>(Nr.encode(t,e,r),e),At=t=>Nr.encodingLength(t);var Lx=f(l(),1);var io=(t,e)=>{let r=e.byteLength,n=At(t),i=n+At(r),o=new Uint8Array(i+r);return Tt(t,o,0),Tt(r,o,n),o.set(e,i),new dr(t,r,e,o)},sa=t=>{let e=fr(t),[r,n]=lr(e),[i,o]=lr(e.subarray(n)),s=e.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new dr(r,i,s,e)},ca=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&Xc(t.bytes,r.bytes)}},dr=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var Cx=f(l(),1);var aa=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return Wh(r,so(t),e||le.encoder);default:return Gh(r,so(t),e||Pr.encoder)}};var ua=new WeakMap,so=t=>{let e=ua.get(t);if(e==null){let r=new Map;return ua.set(t,r),r}return e},co=class t{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==Mr)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Hh)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=io(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&ca(e.multihash,n.multihash)}toString(e){return aa(this,e)}toJSON(){return{"/":aa(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:o,bytes:s}=r;return new t(n,i,o,s||fa(n,i,o.bytes))}else if(r[Jh]===!0){let{version:n,multihash:i,code:o}=r,s=sa(i);return t.create(n,o,s)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==Mr)throw new Error(`Version 0 CID must use dag-pb (code: ${Mr}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=fa(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,Mr,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=fr(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let o=i.subarray(r.multihashSize-r.digestSize),s=new dr(r.multihashCode,r.digestSize,o,i);return[r.version===0?t.createV0(s):t.createV1(r.codec,s),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[h,w]=lr(e.subarray(r));return r+=w,h},i=n(),o=Mr;if(i===18?(i=0,r=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=r,c=n(),a=n(),u=r+a,d=u-s;return{version:i,codec:o,multihashCode:c,digestSize:a,multihashSize:d,size:u}}static parse(e,r){let[n,i]=Vh(e,r),o=t.decode(i);if(o.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return so(o).set(n,e),o}},Vh=(t,e)=>{switch(t[0]){case"Q":{let r=e||le;return[le.prefix,r.decode(`${le.prefix}${t}`)]}case le.prefix:{let r=e||le;return[le.prefix,r.decode(t)]}case Pr.prefix:{let r=e||Pr;return[Pr.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},Wh=(t,e,r)=>{let{prefix:n}=r;if(n!==le.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let o=r.encode(t).slice(1);return e.set(n,o),o}else return i},Gh=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let o=r.encode(t);return e.set(n,o),o}else return i},Mr=112,Hh=18,fa=(t,e,r)=>{let n=At(t),i=n+At(e),o=new Uint8Array(i+r.byteLength);return Tt(t,o,0),Tt(e,o,n),o.set(r,i),o},Jh=Symbol.for("@ipld/js-cid/CID");var qx=f(l(),1);var jx=f(l(),1);var he=class t{static addPrefix(e){var r;let{code:n,data:i,name:o}=e;if(!(o?!n:n))throw new Error("Either 'name' or 'code' must be defined, but not both.");if(n=t.codeToName.has(n)?n:t.nameToCode.get(o),n===void 0)throw new Error(`Unsupported multicodec: ${(r=e.name)!==null&&r!==void 0?r:e.code}`);let s=Ge.encodingLength(n),c=new Uint8Array(s+i.byteLength);return c.set(i,s),Ge.encodeTo(n,c),c}static getCodeFromData(e){let{prefixedData:r}=e,[n,i]=Ge.decode(r);return n}static getCodeFromName(e){let{name:r}=e,n=t.nameToCode.get(r);if(n===void 0)throw new Error(`Unsupported multicodec: ${r}`);return n}static getNameFromCode(e){let{code:r}=e,n=t.codeToName.get(r);if(n===void 0)throw new Error(`Unsupported multicodec: ${r}`);return n}static registerCodec(e){t.codeToName.set(e.code,e.name),t.nameToCode.set(e.name,e.code)}static removePrefix(e){let{prefixedData:r}=e,[n,i]=Ge.decode(r),o=t.codeToName.get(n);if(o===void 0)throw new Error(`Unsupported multicodec: ${n}`);return{code:n,data:r.slice(i),name:o}}};he.codeToName=new Map;he.nameToCode=new Map;he.registerCodec({code:237,name:"ed25519-pub"});he.registerCodec({code:4864,name:"ed25519-priv"});he.registerCodec({code:236,name:"x25519-pub"});he.registerCodec({code:4866,name:"x25519-priv"});he.registerCodec({code:231,name:"secp256k1-pub"});he.registerCodec({code:4865,name:"secp256k1-priv"});var Xx=f(l(),1);function ao(t){Object.keys(t).forEach(e=>{t[e]===void 0?delete t[e]:typeof t[e]=="object"&&ao(t[e])})}var sv=f(l(),1),ty=f(_u(),1);var uv=f(l(),1);var w_=f(l(),1),Z0=f(dc(),1);var Q0=f(dc(),1);var o1=f(l(),1);var FS=f(l(),1);var J_=f(l(),1);var j_=f(l(),1);var K_=f(l(),1);var P_=f(l(),1);var I_=f(l(),1);function em(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function tm(t,...e){if(!em(t))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function hc(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function ud(t,e){tm(t);let r=e.outputLen;if(t.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}var k_=f(l(),1);function rm(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}var Oi=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Ie=(t,e)=>t<<32-e|t>>>e,nm=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!nm)throw new Error("Non little-endian hardware is not supported");function im(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function pc(t){if(typeof t=="string"&&(t=im(t)),!rm(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}var Ri=class{clone(){return this._cloneInto()}},R_={}.toString;function fd(t){let e=n=>t().update(pc(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function om(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),c=Number(r&o),a=n?4:0,u=n?0:4;t.setUint32(e+a,s,n),t.setUint32(e+u,c,n)}var ki=class extends Ri{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Oi(this.buffer)}update(e){hc(this);let{view:r,buffer:n,blockLen:i}=this;e=pc(e);let o=e.length;for(let s=0;s<o;){let c=Math.min(i-this.pos,o-s);if(c===i){let a=Oi(e);for(;i<=o-s;s+=i)this.process(a,s);continue}n.set(e.subarray(s,s+c),this.pos),this.pos+=c,s+=c,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){hc(this),ud(e,this),this.finished=!0;let{buffer:r,view:n,blockLen:i,isLE:o}=this,{pos:s}=this;r[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(n,0),s=0);for(let h=s;h<i;h++)r[h]=0;om(n,i-8,BigInt(this.length*8),o),this.process(n,0);let c=Oi(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let u=a/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<u;h++)c.setUint32(4*h,d[h],o)}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:r,buffer:n,length:i,finished:o,destroyed:s,pos:c}=this;return e.length=i,e.pos=c,e.finished=o,e.destroyed=s,i%r&&e.buffer.set(n),e}};var sm=(t,e,r)=>t&e^~t&r,cm=(t,e,r)=>t&e^t&r^e&r,am=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),xt=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Et=new Uint32Array(64),yc=class extends ki{constructor(){super(64,32,8,!1),this.A=xt[0]|0,this.B=xt[1]|0,this.C=xt[2]|0,this.D=xt[3]|0,this.E=xt[4]|0,this.F=xt[5]|0,this.G=xt[6]|0,this.H=xt[7]|0}get(){let{A:e,B:r,C:n,D:i,E:o,F:s,G:c,H:a}=this;return[e,r,n,i,o,s,c,a]}set(e,r,n,i,o,s,c,a){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=c|0,this.H=a|0}process(e,r){for(let h=0;h<16;h++,r+=4)Et[h]=e.getUint32(r,!1);for(let h=16;h<64;h++){let w=Et[h-15],y=Et[h-2],p=Ie(w,7)^Ie(w,18)^w>>>3,b=Ie(y,17)^Ie(y,19)^y>>>10;Et[h]=b+Et[h-7]+p+Et[h-16]|0}let{A:n,B:i,C:o,D:s,E:c,F:a,G:u,H:d}=this;for(let h=0;h<64;h++){let w=Ie(c,6)^Ie(c,11)^Ie(c,25),y=d+w+sm(c,a,u)+am[h]+Et[h]|0,b=(Ie(n,2)^Ie(n,13)^Ie(n,22))+cm(n,i,o)|0;d=u,u=a,a=c,c=s+y|0,s=o,o=i,i=n,n=y+b|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,c=c+this.E|0,a=a+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(n,i,o,s,c,a,u,d)}roundClean(){Et.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var ld=fd(()=>new yc);var um=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function c(d){try{u(n.next(d))}catch(h){s(h)}}function a(d){try{u(n.throw(d))}catch(h){s(h)}}function u(d){d.done?o(d.value):i(d.value).then(c,a)}u((n=n.apply(t,e||[])).next())})},gn=class{static digest({data:e}){return um(this,void 0,void 0,function*(){return ld(e)})}};var V_=f(l(),1);var gS=f(l(),1);var oS=f(l(),1);var tS=f(l(),1);var Y_=f(l(),1);function dd(t){let e=n=>{if(n!==null&&typeof n=="object"&&!Array.isArray(n)){let i=Object.keys(n).sort(),o={};for(let s of i)o[s]=e(n[s]);return o}return n},r=e(t);return JSON.stringify(r)}var fm=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function c(d){try{u(n.next(d))}catch(h){s(h)}}function a(d){try{u(n.throw(d))}catch(h){s(h)}}function u(d){d.done?o(d.value):i(d.value).then(c,a)}u((n=n.apply(t,e||[])).next())})};function ve({jwk:t}){return fm(this,void 0,void 0,function*(){let e=t.kty,r;if(e==="EC")r={crv:t.crv,kty:t.kty,x:t.x,y:t.y};else if(e==="oct")r={k:t.k,kty:t.kty};else if(e==="OKP")r={crv:t.crv,kty:t.kty,x:t.x};else if(e==="RSA")r={e:t.e,kty:t.kty,n:t.n};else throw new Error(`Unsupported key type: ${e}`);ao(r);let n=dd(r),i=Y.string(n).toUint8Array(),o=yield gn.digest({data:i});return Y.uint8Array(o).toBase64Url()})}var uS=f(l(),1);var BS=f(l(),1);var ES=f(l(),1);var qS=f(l(),1);var uT=f(l(),1);var iT=f(l(),1);var QS=f(l(),1);var $S=f(l(),1),dm=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var WS=f(l(),1);var st=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4));function gd(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}var bd=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),hm=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!hm)throw new Error("Non little-endian hardware is not supported");function Ci(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Ui(t){if(typeof t=="string")t=Ci(t);else if(gd(t))t=t.slice();else throw new Error(`expected Uint8Array, got ${typeof t}`);return t}var pm=t=>Object.prototype.toString.call(t)==="[object Object]"&&t.constructor===Object;function md(t,e){if(e!==void 0&&(typeof e!="object"||!pm(e)))throw new Error("options must be object or undefined");return Object.assign(t,e)}function Qt(t,e){if(!gd(t))throw new Error("Uint8Array expected");if(typeof e=="number"&&t.length!==e)throw new Error(`Uint8Array length ${e} expected`)}function xd(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}var wc=(t,e)=>(Object.assign(e,t),e);function gc(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),c=Number(r&o),a=n?4:0,u=n?0:4;t.setUint32(e+a,s,n),t.setUint32(e+u,c,n)}var HS=f(l(),1);function bn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`wrong positive integer: ${t}`)}function bc(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}function ym(t){return t!=null&&typeof t=="object"&&(t instanceof Uint8Array||t.constructor.name==="Uint8Array")}function Cr(t,...e){if(!ym(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function mc(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Ed(t,e){Cr(t);let r=e.outputLen;if(t.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}var mT=f(l(),1);var pT=f(l(),1);var xT=f(l(),1);var ET=f(l(),1);var vT=f(l(),1);var TT=f(l(),1);var BT=f(l(),1);var kT=f(l(),1);var XT=f(l(),1);var WT=f(l(),1);var PT=f(l(),1);var ie=(t,e)=>t[e++]&255|(t[e++]&255)<<8,vc=class{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=Ui(e),Qt(e,32);let r=ie(e,0),n=ie(e,2),i=ie(e,4),o=ie(e,6),s=ie(e,8),c=ie(e,10),a=ie(e,12),u=ie(e,14);this.r[0]=r&8191,this.r[1]=(r>>>13|n<<3)&8191,this.r[2]=(n>>>10|i<<6)&7939,this.r[3]=(i>>>7|o<<9)&8191,this.r[4]=(o>>>4|s<<12)&255,this.r[5]=s>>>1&8190,this.r[6]=(s>>>14|c<<2)&8191,this.r[7]=(c>>>11|a<<5)&8065,this.r[8]=(a>>>8|u<<8)&8191,this.r[9]=u>>>5&127;for(let d=0;d<8;d++)this.pad[d]=ie(e,16+2*d)}process(e,r,n=!1){let i=n?0:2048,{h:o,r:s}=this,c=s[0],a=s[1],u=s[2],d=s[3],h=s[4],w=s[5],y=s[6],p=s[7],b=s[8],x=s[9],E=ie(e,r+0),v=ie(e,r+2),m=ie(e,r+4),A=ie(e,r+6),C=ie(e,r+8),I=ie(e,r+10),P=ie(e,r+12),B=ie(e,r+14),O=o[0]+(E&8191),N=o[1]+((E>>>13|v<<3)&8191),K=o[2]+((v>>>10|m<<6)&8191),D=o[3]+((m>>>7|A<<9)&8191),F=o[4]+((A>>>4|C<<12)&8191),q=o[5]+(C>>>1&8191),j=o[6]+((C>>>14|I<<2)&8191),$=o[7]+((I>>>11|P<<5)&8191),V=o[8]+((P>>>8|B<<8)&8191),W=o[9]+(B>>>5|i),T=0,J=T+O*c+N*(5*x)+K*(5*b)+D*(5*p)+F*(5*y);T=J>>>13,J&=8191,J+=q*(5*w)+j*(5*h)+$*(5*d)+V*(5*u)+W*(5*a),T+=J>>>13,J&=8191;let z=T+O*a+N*c+K*(5*x)+D*(5*b)+F*(5*p);T=z>>>13,z&=8191,z+=q*(5*y)+j*(5*w)+$*(5*h)+V*(5*d)+W*(5*u),T+=z>>>13,z&=8191;let G=T+O*u+N*a+K*c+D*(5*x)+F*(5*b);T=G>>>13,G&=8191,G+=q*(5*p)+j*(5*y)+$*(5*w)+V*(5*h)+W*(5*d),T+=G>>>13,G&=8191;let Ve=T+O*d+N*u+K*a+D*c+F*(5*x);T=Ve>>>13,Ve&=8191,Ve+=q*(5*b)+j*(5*p)+$*(5*y)+V*(5*w)+W*(5*h),T+=Ve>>>13,Ve&=8191;let er=T+O*h+N*d+K*u+D*a+F*c;T=er>>>13,er&=8191,er+=q*(5*x)+j*(5*b)+$*(5*p)+V*(5*y)+W*(5*w),T+=er>>>13,er&=8191;let tr=T+O*w+N*h+K*d+D*u+F*a;T=tr>>>13,tr&=8191,tr+=q*c+j*(5*x)+$*(5*b)+V*(5*p)+W*(5*y),T+=tr>>>13,tr&=8191;let rr=T+O*y+N*w+K*h+D*d+F*u;T=rr>>>13,rr&=8191,rr+=q*a+j*c+$*(5*x)+V*(5*b)+W*(5*p),T+=rr>>>13,rr&=8191;let nr=T+O*p+N*y+K*w+D*h+F*d;T=nr>>>13,nr&=8191,nr+=q*u+j*a+$*c+V*(5*x)+W*(5*b),T+=nr>>>13,nr&=8191;let ir=T+O*b+N*p+K*y+D*w+F*h;T=ir>>>13,ir&=8191,ir+=q*d+j*u+$*a+V*c+W*(5*x),T+=ir>>>13,ir&=8191;let or=T+O*x+N*b+K*p+D*y+F*w;T=or>>>13,or&=8191,or+=q*h+j*d+$*u+V*a+W*c,T+=or>>>13,or&=8191,T=(T<<2)+T|0,T=T+J|0,J=T&8191,T=T>>>13,z+=T,o[0]=J,o[1]=z,o[2]=G,o[3]=Ve,o[4]=er,o[5]=tr,o[6]=rr,o[7]=nr,o[8]=ir,o[9]=or}finalize(){let{h:e,pad:r}=this,n=new Uint16Array(10),i=e[1]>>>13;e[1]&=8191;for(let c=2;c<10;c++)e[c]+=i,i=e[c]>>>13,e[c]&=8191;e[0]+=i*5,i=e[0]>>>13,e[0]&=8191,e[1]+=i,i=e[1]>>>13,e[1]&=8191,e[2]+=i,n[0]=e[0]+5,i=n[0]>>>13,n[0]&=8191;for(let c=1;c<10;c++)n[c]=e[c]+i,i=n[c]>>>13,n[c]&=8191;n[9]-=8192;let o=(i^1)-1;for(let c=0;c<10;c++)n[c]&=o;o=~o;for(let c=0;c<10;c++)e[c]=e[c]&o|n[c];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let s=e[0]+r[0];e[0]=s&65535;for(let c=1;c<8;c++)s=(e[c]+r[c]|0)+(s>>>16)|0,e[c]=s&65535}update(e){mc(this);let{buffer:r,blockLen:n}=this;e=Ui(e);let i=e.length;for(let o=0;o<i;){let s=Math.min(n-this.pos,i-o);if(s===n){for(;n<=i-o;o+=n)this.process(e,o);continue}r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(r,0,!1),this.pos=0)}return this}destroy(){this.h.fill(0),this.r.fill(0),this.buffer.fill(0),this.pad.fill(0)}digestInto(e){mc(this),Ed(e,this),this.finished=!0;let{buffer:r,h:n}=this,{pos:i}=this;if(i){for(r[i++]=1;i<16;i++)r[i]=0;this.process(r,0,!0)}this.finalize();let o=0;for(let s=0;s<8;s++)e[o++]=n[s]>>>0,e[o++]=n[s]>>>8;return e}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}};function wm(t){let e=(n,i)=>t(i).update(Ui(n)).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}var vd=wm(t=>new vc(t));var KT=f(l(),1);var gm=Ci("expand 16-byte k"),bm=Ci("expand 32-byte k"),mm=st(gm),xm=st(bm);function _(t,e){return t<<e|t>>>32-e}function _c(t){return t.byteOffset%4===0}var Pi=64,Em=16,Sd=2**32-1,_d=new Uint32Array;function vm(t,e,r,n,i,o,s,c){let a=i.length,u=new Uint8Array(Pi),d=st(u),h=_c(i)&&_c(o),w=h?st(i):_d,y=h?st(o):_d;for(let p=0;p<a;s++){if(t(e,r,n,d,s,c),s>=Sd)throw new Error("arx: counter overflow");let b=Math.min(Pi,a-p);if(h&&b===Pi){let x=p/4;if(p%4!==0)throw new Error("arx: invalid block position");for(let E=0,v;E<Em;E++)v=x+E,y[v]=w[v]^d[E];p+=Pi;continue}for(let x=0,E;x<b;x++)E=p+x,o[E]=i[E]^u[x];p+=b}}function Sc(t,e){let{allowShortKeys:r,extendNonceFn:n,counterLength:i,counterRight:o,rounds:s}=md({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},e);if(typeof t!="function")throw new Error("core must be a function");return bn(i),bn(s),bc(o),bc(r),(c,a,u,d,h=0)=>{Cr(c),Cr(a),Cr(u);let w=u.length;if(d||(d=new Uint8Array(w)),Cr(d),bn(h),h<0||h>=Sd)throw new Error("arx: counter overflow");if(d.length<w)throw new Error(`arx: output (${d.length}) is shorter than data (${w})`);let y=[],p=c.length,b,x;if(p===32)b=c.slice(),y.push(b),x=xm;else if(p===16&&r)b=new Uint8Array(32),b.set(c),b.set(c,16),x=mm,y.push(b);else throw new Error(`arx: invalid 32-byte key, got length=${p}`);_c(a)||(a=a.slice(),y.push(a));let E=st(b);if(n){if(a.length!==24)throw new Error("arx: extended nonce must be 24 bytes");n(x,E,st(a.subarray(0,16)),E),a=a.subarray(16)}let v=16-i;if(v!==a.length)throw new Error(`arx: nonce must be ${v} or 16 bytes`);if(v!==12){let A=new Uint8Array(12);A.set(a,o?0:12-a.length),a=A,y.push(a)}let m=st(a);for(vm(t,x,E,m,u,d,h,s);y.length>0;)y.pop().fill(0);return d}}function Bd(t,e,r,n,i,o=20){let s=t[0],c=t[1],a=t[2],u=t[3],d=e[0],h=e[1],w=e[2],y=e[3],p=e[4],b=e[5],x=e[6],E=e[7],v=i,m=r[0],A=r[1],C=r[2],I=s,P=c,B=a,O=u,N=d,K=h,D=w,F=y,q=p,j=b,$=x,V=E,W=v,T=m,J=A,z=C;for(let Ve=0;Ve<o;Ve+=2)I=I+N|0,W=_(W^I,16),q=q+W|0,N=_(N^q,12),I=I+N|0,W=_(W^I,8),q=q+W|0,N=_(N^q,7),P=P+K|0,T=_(T^P,16),j=j+T|0,K=_(K^j,12),P=P+K|0,T=_(T^P,8),j=j+T|0,K=_(K^j,7),B=B+D|0,J=_(J^B,16),$=$+J|0,D=_(D^$,12),B=B+D|0,J=_(J^B,8),$=$+J|0,D=_(D^$,7),O=O+F|0,z=_(z^O,16),V=V+z|0,F=_(F^V,12),O=O+F|0,z=_(z^O,8),V=V+z|0,F=_(F^V,7),I=I+K|0,z=_(z^I,16),$=$+z|0,K=_(K^$,12),I=I+K|0,z=_(z^I,8),$=$+z|0,K=_(K^$,7),P=P+D|0,W=_(W^P,16),V=V+W|0,D=_(D^V,12),P=P+D|0,W=_(W^P,8),V=V+W|0,D=_(D^V,7),B=B+F|0,T=_(T^B,16),q=q+T|0,F=_(F^q,12),B=B+F|0,T=_(T^B,8),q=q+T|0,F=_(F^q,7),O=O+N|0,J=_(J^O,16),j=j+J|0,N=_(N^j,12),O=O+N|0,J=_(J^O,8),j=j+J|0,N=_(N^j,7);let G=0;n[G++]=s+I|0,n[G++]=c+P|0,n[G++]=a+B|0,n[G++]=u+O|0,n[G++]=d+N|0,n[G++]=h+K|0,n[G++]=w+D|0,n[G++]=y+F|0,n[G++]=p+q|0,n[G++]=b+j|0,n[G++]=x+$|0,n[G++]=E+V|0,n[G++]=v+W|0,n[G++]=m+T|0,n[G++]=A+J|0,n[G++]=C+z|0}function _m(t,e,r,n){let i=t[0],o=t[1],s=t[2],c=t[3],a=e[0],u=e[1],d=e[2],h=e[3],w=e[4],y=e[5],p=e[6],b=e[7],x=r[0],E=r[1],v=r[2],m=r[3];for(let C=0;C<20;C+=2)i=i+a|0,x=_(x^i,16),w=w+x|0,a=_(a^w,12),i=i+a|0,x=_(x^i,8),w=w+x|0,a=_(a^w,7),o=o+u|0,E=_(E^o,16),y=y+E|0,u=_(u^y,12),o=o+u|0,E=_(E^o,8),y=y+E|0,u=_(u^y,7),s=s+d|0,v=_(v^s,16),p=p+v|0,d=_(d^p,12),s=s+d|0,v=_(v^s,8),p=p+v|0,d=_(d^p,7),c=c+h|0,m=_(m^c,16),b=b+m|0,h=_(h^b,12),c=c+h|0,m=_(m^c,8),b=b+m|0,h=_(h^b,7),i=i+u|0,m=_(m^i,16),p=p+m|0,u=_(u^p,12),i=i+u|0,m=_(m^i,8),p=p+m|0,u=_(u^p,7),o=o+d|0,x=_(x^o,16),b=b+x|0,d=_(d^b,12),o=o+d|0,x=_(x^o,8),b=b+x|0,d=_(d^b,7),s=s+h|0,E=_(E^s,16),w=w+E|0,h=_(h^w,12),s=s+h|0,E=_(E^s,8),w=w+E|0,h=_(h^w,7),c=c+a|0,v=_(v^c,16),y=y+v|0,a=_(a^y,12),c=c+a|0,v=_(v^c,8),y=y+v|0,a=_(a^y,7);let A=0;n[A++]=i,n[A++]=o,n[A++]=s,n[A++]=c,n[A++]=x,n[A++]=E,n[A++]=v,n[A++]=m}var Sm=Sc(Bd,{counterRight:!1,counterLength:4,allowShortKeys:!1}),Id=Sc(Bd,{counterRight:!1,counterLength:8,extendNonceFn:_m,allowShortKeys:!1});var Tm=new Uint8Array(16),Td=(t,e)=>{t.update(e);let r=e.length%16;r&&t.update(Tm.subarray(r))},Am=new Uint8Array(32);function Ad(t,e,r,n,i){let o=t(e,r,Am),s=vd.create(o);i&&Td(s,i),Td(s,n);let c=new Uint8Array(16),a=bd(c);gc(a,0,BigInt(i?i.length:0),!0),gc(a,8,BigInt(n.length),!0),s.update(c);let u=s.digest();return o.fill(0),u}var Rd=t=>(e,r,n)=>(Qt(e,32),Qt(r),{encrypt:(o,s)=>{let c=o.length,a=c+16;s?Qt(s,a):s=new Uint8Array(a),t(e,r,o,s,1);let u=Ad(t,e,r,s.subarray(0,-16),n);return s.set(u,c),s},decrypt:(o,s)=>{let c=o.length,a=c-16;if(c<16)throw new Error("encrypted data must be at least 16 bytes");s?Qt(s,a):s=new Uint8Array(a);let u=o.subarray(0,-16),d=o.subarray(-16),h=Ad(t,e,r,u,n);if(!xd(d,h))throw new Error("invalid tag");return t(e,r,u,s,1),s}}),$T=wc({blockSize:64,nonceLength:12,tagLength:16},Rd(Sm)),Bm=wc({blockSize:64,nonceLength:24,tagLength:16},Rd(Id));var n1=f(l(),1);var O1=f(l(),1),Di=class t extends Error{constructor(r,n){super(`${r}: ${n}`);this.code=r;this.name="DidError",Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,t)}};var L1=f(l(),1),Ni=(o=>(o.authentication="authentication",o.assertionMethod="assertionMethod",o.keyAgreement="keyAgreement",o.capabilityInvocation="capabilityInvocation",o.capabilityDelegation="capabilityDelegation",o))(Ni||{});function Tc(t){if(typeof t=="string"&&t.length!==0)return t.split("#").pop()}function q1({didDocument:t,id:e,type:r}){return t?.service?.filter(n=>!(e&&n.id!==e||r&&n.type!==r))??[]}async function j1({didDocument:t,publicKeyJwk:e,publicKeyMultibase:r}){let n=Od({didDocument:t});for(let i of n)if(e&&i.publicKeyJwk){if(await ve({jwk:e})===await ve({jwk:i.publicKeyJwk}))return i}else if(r&&i.publicKeyMultibase&&r===i.publicKeyMultibase)return i;return null}function Od({didDocument:t}){if(!t)throw new TypeError("Required parameter missing: 'didDocument'");let e=[];return e.push(...t.verificationMethod?.filter(Ac)??[]),Object.keys(Ni).forEach(r=>{e.push(...t[r]?.filter(Ac)??[])}),e}function $1({didDocument:t}){let r=Od({didDocument:t}).map(n=>n.type);return[...new Set(r)]}function V1({didDocument:t,methodId:e}){let r=[];return Object.keys(Ni).forEach(n=>{if(Array.isArray(t[n])){let i=t[n],o=Tc(e);i.some(c=>{let a=Tc(c)===o,u=Ac(c)&&Tc(c.id)===o;return a||u})&&r.push(n)}}),r}function Im(t){return!t||typeof t!="object"||t===null?!1:"id"in t&&"type"in t&&"serviceEndpoint"in t}function W1(t){if(!Im(t)||t.type!=="DecentralizedWebNode"||!("enc"in t&&"sig"in t))return!1;let e=r=>typeof r=="string"||Array.isArray(r)&&r.every(n=>typeof n=="string");return e(t.enc)&&e(t.sig)}function Ac(t){return!(!t||typeof t!="object"||t===null||!("id"in t&&"type"in t&&"controller"in t)||typeof t.id!="string"||typeof t.type!="string"||typeof t.controller!="string")}function G1({keyBytes:t,multicodecCode:e,multicodecName:r}){let n=he.addPrefix({code:e,data:t,name:r}),i=Y.uint8Array(n).toBase58Btc();return Y.base58Btc(i).toMultibase()}function H1({multibaseKeyId:t}){try{let e=Y.multibase(t).toBase58Btc(),r=Y.base58Btc(e).toUint8Array(),{code:n,data:i,name:o}=he.removePrefix({prefixedData:r});return{keyBytes:i,multicodecCode:n,multicodecName:o}}catch{throw new Di("invalidDid",`Invalid multibase identifier: ${t}`)}}export{Tc as extractDidFragment,q1 as getServices,j1 as getVerificationMethodByKey,$1 as getVerificationMethodTypes,Od as getVerificationMethods,V1 as getVerificationRelationshipsById,Im as isDidService,Ac as isDidVerificationMethod,W1 as isDwnDidService,G1 as keyBytesToMultibaseId,H1 as multibaseIdToKeyBytes};
|
|
/*! Bundled license information:
|
|
|
|
ieee754/index.js:
|
|
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
|
|
buffer/index.js:
|
|
(*!
|
|
* The buffer module from node.js, for the browser.
|
|
*
|
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
* @license MIT
|
|
*)
|
|
|
|
queue-microtask/index.js:
|
|
(*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
|
|
run-parallel-limit/index.js:
|
|
(*! run-parallel-limit. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
|
|
safe-buffer/index.js:
|
|
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
|
|
@noble/hashes/esm/utils.js:
|
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
|
|
@noble/ciphers/esm/utils.js:
|
|
(*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *)
|
|
*/
|
|
//# sourceMappingURL=utils.js.map
|