- 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
26 lines
184 KiB
JavaScript
26 lines
184 KiB
JavaScript
var pc=Object.create;var Qn=Object.defineProperty;var yc=Object.getOwnPropertyDescriptor;var bc=Object.getOwnPropertyNames;var wc=Object.getPrototypeOf,gc=Object.prototype.hasOwnProperty;var b=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),mc=(t,e)=>{for(var r in e)Qn(t,r,{get:e[r],enumerable:!0})},Ec=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of bc(e))!gc.call(t,i)&&i!==r&&Qn(t,i,{get:()=>e[i],enumerable:!(n=yc(e,i))||n.enumerable});return t};var qr=(t,e,r)=>(r=t!=null?pc(wc(t)):{},Ec(e||!t||!t.__esModule?Qn(r,"default",{value:t,enumerable:!0}):r,t));var Ls=b((Fg,Is)=>{var _c=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,$r=()=>_c.now(),xc=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),ei=t=>t===1/0||xc(t),ti=class t{constructor({max:e=1/0,ttl:r,updateAgeOnGet:n=!1,checkAgeOnGet:i=!1,noUpdateTTL:o=!1,dispose:s,noDisposeOnSet:a=!1}={}){if(this.expirations=Object.create(null),this.data=new Map,this.expirationMap=new Map,r!==void 0&&!ei(r))throw new TypeError("ttl must be positive integer or Infinity if set");if(!ei(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=!!a,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-$r());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($r()+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(!ei(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-$r())):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($r());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()}};Is.exports=ti});var Ks=b(Ws=>{"use strict";Ws.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 oe=b((Om,Gs)=>{"use strict";Gs.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 Ys=b(Vr=>{"use strict";Vr.byteLength=id;Vr.toByteArray=sd;Vr.fromByteArray=fd;var ce=[],Z=[],nd=typeof Uint8Array<"u"?Uint8Array:Array,pi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(it=0,Hs=pi.length;it<Hs;++it)ce[it]=pi[it],Z[pi.charCodeAt(it)]=it;var it,Hs;Z[45]=62;Z[95]=63;function zs(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 id(t){var e=zs(t),r=e[0],n=e[1];return(r+n)*3/4-n}function od(t,e,r){return(e+r)*3/4-r}function sd(t){var e,r=zs(t),n=r[0],i=r[1],o=new nd(od(t,n,i)),s=0,a=i>0?n-4:n,u;for(u=0;u<a;u+=4)e=Z[t.charCodeAt(u)]<<18|Z[t.charCodeAt(u+1)]<<12|Z[t.charCodeAt(u+2)]<<6|Z[t.charCodeAt(u+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return i===2&&(e=Z[t.charCodeAt(u)]<<2|Z[t.charCodeAt(u+1)]>>4,o[s++]=e&255),i===1&&(e=Z[t.charCodeAt(u)]<<10|Z[t.charCodeAt(u+1)]<<4|Z[t.charCodeAt(u+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function ad(t){return ce[t>>18&63]+ce[t>>12&63]+ce[t>>6&63]+ce[t&63]}function ud(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(ad(n));return i.join("")}function fd(t){for(var e,r=t.length,n=r%3,i=[],o=16383,s=0,a=r-n;s<a;s+=o)i.push(ud(t,s,s+o>a?a:s+o));return n===1?(e=t[r-1],i.push(ce[e>>2]+ce[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(ce[e>>10]+ce[e>>4&63]+ce[e<<2&63]+"=")),i.join("")}});var Js=b(yi=>{yi.read=function(t,e,r,n,i){var o,s,a=i*8-n-1,u=(1<<a)-1,f=u>>1,c=-7,l=r?i-1:0,p=r?-1:1,y=t[e+l];for(l+=p,o=y&(1<<-c)-1,y>>=-c,c+=a;c>0;o=o*256+t[e+l],l+=p,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=s*256+t[e+l],l+=p,c-=8);if(o===0)o=1-f;else{if(o===u)return s?NaN:(y?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-f}return(y?-1:1)*s*Math.pow(2,o-n)};yi.write=function(t,e,r,n,i,o){var s,a,u,f=o*8-i-1,c=(1<<f)-1,l=c>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:o-1,h=n?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+l>=1?e+=p/u:e+=p*Math.pow(2,1-l),e*u>=2&&(s++,u/=2),s+l>=c?(a=0,s=c):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s=s+l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+y]=a&255,y+=h,a/=256,i-=8);for(s=s<<i|a,f+=i;f>0;t[r+y]=s&255,y+=h,s/=256,f-=8);t[r+y-h]|=g*128}});var Q=b(Ft=>{"use strict";var bi=Ys(),Dt=Js(),Xs=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ft.Buffer=d;Ft.SlowBuffer=yd;Ft.INSPECT_MAX_BYTES=50;var Wr=2147483647;Ft.kMaxLength=Wr;d.TYPED_ARRAY_SUPPORT=ld();!d.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 ld(){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(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function Re(t){if(t>Wr)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,d.prototype),e}function d(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 Ei(t)}return ta(t,e,r)}d.poolSize=8192;function ta(t,e,r){if(typeof t=="string")return dd(t,e);if(ArrayBuffer.isView(t))return hd(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(de(t,ArrayBuffer)||t&&de(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(de(t,SharedArrayBuffer)||t&&de(t.buffer,SharedArrayBuffer)))return gi(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 d.from(n,e,r);let i=pd(t);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return d.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)}d.from=function(t,e,r){return ta(t,e,r)};Object.setPrototypeOf(d.prototype,Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function ra(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 cd(t,e,r){return ra(t),t<=0?Re(t):e!==void 0?typeof r=="string"?Re(t).fill(e,r):Re(t).fill(e):Re(t)}d.alloc=function(t,e,r){return cd(t,e,r)};function Ei(t){return ra(t),Re(t<0?0:_i(t)|0)}d.allocUnsafe=function(t){return Ei(t)};d.allocUnsafeSlow=function(t){return Ei(t)};function dd(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=na(t,e)|0,n=Re(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function wi(t){let e=t.length<0?0:_i(t.length)|0,r=Re(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function hd(t){if(de(t,Uint8Array)){let e=new Uint8Array(t);return gi(e.buffer,e.byteOffset,e.byteLength)}return wi(t)}function gi(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,d.prototype),n}function pd(t){if(d.isBuffer(t)){let e=_i(t.length)|0,r=Re(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Si(t.length)?Re(0):wi(t);if(t.type==="Buffer"&&Array.isArray(t.data))return wi(t.data)}function _i(t){if(t>=Wr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Wr.toString(16)+" bytes");return t|0}function yd(t){return+t!=t&&(t=0),d.alloc(+t)}d.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==d.prototype};d.compare=function(e,r){if(de(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),de(r,Uint8Array)&&(r=d.from(r,r.offset,r.byteLength)),!d.isBuffer(e)||!d.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};d.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}};d.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return d.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;let i=d.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){let s=e[n];if(de(s,Uint8Array))o+s.length>i.length?(d.isBuffer(s)||(s=d.from(s)),s.copy(i,o)):Uint8Array.prototype.set.call(i,s,o);else if(d.isBuffer(s))s.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return i};function na(t,e){if(d.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||de(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return mi(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return da(t).length;default:if(i)return n?-1:mi(t).length;e=(""+e).toLowerCase(),i=!0}}d.byteLength=na;function bd(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 Rd(this,e,r);case"utf8":case"utf-8":return oa(this,e,r);case"ascii":return Td(this,e,r);case"latin1":case"binary":return Ad(this,e,r);case"base64":return xd(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vd(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}d.prototype._isBuffer=!0;function ot(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}d.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)ot(this,r,r+1);return this};d.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)ot(this,r,r+3),ot(this,r+1,r+2);return this};d.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)ot(this,r,r+7),ot(this,r+1,r+6),ot(this,r+2,r+5),ot(this,r+3,r+4);return this};d.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?oa(this,0,e):bd.apply(this,arguments)};d.prototype.toLocaleString=d.prototype.toString;d.prototype.equals=function(e){if(!d.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:d.compare(this,e)===0};d.prototype.inspect=function(){let e="",r=Ft.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Xs&&(d.prototype[Xs]=d.prototype.inspect);d.prototype.compare=function(e,r,n,i,o){if(de(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.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,a=n-r,u=Math.min(s,a),f=this.slice(i,o),c=e.slice(r,n);for(let l=0;l<u;++l)if(f[l]!==c[l]){s=f[l],a=c[l];break}return s<a?-1:a<s?1:0};function ia(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,Si(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=d.from(e,n)),d.isBuffer(e))return e.length===0?-1:Zs(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):Zs(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Zs(t,e,r,n,i){let o=1,s=t.length,a=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,a/=2,r/=2}function u(c,l){return o===1?c[l]:c.readUInt16BE(l*o)}let f;if(i){let c=-1;for(f=r;f<s;f++)if(u(t,f)===u(e,c===-1?0:f-c)){if(c===-1&&(c=f),f-c+1===a)return c*o}else c!==-1&&(f-=f-c),c=-1}else for(r+a>s&&(r=s-a),f=r;f>=0;f--){let c=!0;for(let l=0;l<a;l++)if(u(t,f+l)!==u(e,l)){c=!1;break}if(c)return f}return-1}d.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};d.prototype.indexOf=function(e,r,n){return ia(this,e,r,n,!0)};d.prototype.lastIndexOf=function(e,r,n){return ia(this,e,r,n,!1)};function wd(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 a=parseInt(e.substr(s*2,2),16);if(Si(a))return s;t[r+s]=a}return s}function gd(t,e,r,n){return Kr(mi(e,t.length-r),t,r,n)}function md(t,e,r,n){return Kr(Od(e),t,r,n)}function Ed(t,e,r,n){return Kr(da(e),t,r,n)}function _d(t,e,r,n){return Kr(Cd(e,t.length-r),t,r,n)}d.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 wd(this,e,r,n);case"utf8":case"utf-8":return gd(this,e,r,n);case"ascii":case"latin1":case"binary":return md(this,e,r,n);case"base64":return Ed(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _d(this,e,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function xd(t,e,r){return e===0&&r===t.length?bi.fromByteArray(t):bi.fromByteArray(t.slice(e,r))}function oa(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i<r;){let o=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=r){let u,f,c,l;switch(a){case 1:o<128&&(s=o);break;case 2:u=t[i+1],(u&192)===128&&(l=(o&31)<<6|u&63,l>127&&(s=l));break;case 3:u=t[i+1],f=t[i+2],(u&192)===128&&(f&192)===128&&(l=(o&15)<<12|(u&63)<<6|f&63,l>2047&&(l<55296||l>57343)&&(s=l));break;case 4:u=t[i+1],f=t[i+2],c=t[i+3],(u&192)===128&&(f&192)===128&&(c&192)===128&&(l=(o&15)<<18|(u&63)<<12|(f&63)<<6|c&63,l>65535&&l<1114112&&(s=l))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return Sd(n)}var Qs=4096;function Sd(t){let e=t.length;if(e<=Qs)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Qs));return r}function Td(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 Ad(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 Rd(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+=Nd[t[o]];return i}function vd(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}d.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,d.prototype),i};function F(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")}d.prototype.readUintLE=d.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||F(e,r,this.length);let i=this[e],o=1,s=0;for(;++s<r&&(o*=256);)i+=this[e+s]*o;return i};d.prototype.readUintBE=d.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||F(e,r,this.length);let i=this[e+--r],o=1;for(;r>0&&(o*=256);)i+=this[e+--r]*o;return i};d.prototype.readUint8=d.prototype.readUInt8=function(e,r){return e=e>>>0,r||F(e,1,this.length),this[e]};d.prototype.readUint16LE=d.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||F(e,2,this.length),this[e]|this[e+1]<<8};d.prototype.readUint16BE=d.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||F(e,2,this.length),this[e]<<8|this[e+1]};d.prototype.readUint32LE=d.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};d.prototype.readUint32BE=d.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||F(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};d.prototype.readBigUInt64LE=je(function(e){e=e>>>0,Ut(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))});d.prototype.readBigUInt64BE=je(function(e){e=e>>>0,Ut(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)});d.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||F(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};d.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||F(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};d.prototype.readInt8=function(e,r){return e=e>>>0,r||F(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};d.prototype.readInt16LE=function(e,r){e=e>>>0,r||F(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};d.prototype.readInt16BE=function(e,r){e=e>>>0,r||F(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};d.prototype.readInt32LE=function(e,r){return e=e>>>0,r||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};d.prototype.readInt32BE=function(e,r){return e=e>>>0,r||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};d.prototype.readBigInt64LE=je(function(e){e=e>>>0,Ut(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)});d.prototype.readBigInt64BE=je(function(e){e=e>>>0,Ut(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)});d.prototype.readFloatLE=function(e,r){return e=e>>>0,r||F(e,4,this.length),Dt.read(this,e,!0,23,4)};d.prototype.readFloatBE=function(e,r){return e=e>>>0,r||F(e,4,this.length),Dt.read(this,e,!1,23,4)};d.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||F(e,8,this.length),Dt.read(this,e,!0,52,8)};d.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||F(e,8,this.length),Dt.read(this,e,!1,52,8)};function H(t,e,r,n,i,o){if(!d.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")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;H(this,e,r,n,a,0)}let o=1,s=0;for(this[r]=e&255;++s<n&&(o*=256);)this[r+s]=e/o&255;return r+n};d.prototype.writeUintBE=d.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;H(this,e,r,n,a,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};d.prototype.writeUint8=d.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||H(this,e,r,1,255,0),this[r]=e&255,r+1};d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||H(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||H(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||H(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};d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||H(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 sa(t,e,r,n,i){ca(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 aa(t,e,r,n,i){ca(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}d.prototype.writeBigUInt64LE=je(function(e,r=0){return sa(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});d.prototype.writeBigUInt64BE=je(function(e,r=0){return aa(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});d.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let u=Math.pow(2,8*n-1);H(this,e,r,n,u-1,-u)}let o=0,s=1,a=0;for(this[r]=e&255;++o<n&&(s*=256);)e<0&&a===0&&this[r+o-1]!==0&&(a=1),this[r+o]=(e/s>>0)-a&255;return r+n};d.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let u=Math.pow(2,8*n-1);H(this,e,r,n,u-1,-u)}let o=n-1,s=1,a=0;for(this[r+o]=e&255;--o>=0&&(s*=256);)e<0&&a===0&&this[r+o+1]!==0&&(a=1),this[r+o]=(e/s>>0)-a&255;return r+n};d.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||H(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};d.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||H(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};d.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||H(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};d.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||H(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};d.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||H(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};d.prototype.writeBigInt64LE=je(function(e,r=0){return sa(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});d.prototype.writeBigInt64BE=je(function(e,r=0){return aa(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ua(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 fa(t,e,r,n,i){return e=+e,r=r>>>0,i||ua(t,e,r,4,34028234663852886e22,-34028234663852886e22),Dt.write(t,e,r,n,23,4),r+4}d.prototype.writeFloatLE=function(e,r,n){return fa(this,e,r,!0,n)};d.prototype.writeFloatBE=function(e,r,n){return fa(this,e,r,!1,n)};function la(t,e,r,n,i){return e=+e,r=r>>>0,i||ua(t,e,r,8,17976931348623157e292,-17976931348623157e292),Dt.write(t,e,r,n,52,8),r+8}d.prototype.writeDoubleLE=function(e,r,n){return la(this,e,r,!0,n)};d.prototype.writeDoubleBE=function(e,r,n){return la(this,e,r,!1,n)};d.prototype.copy=function(e,r,n,i){if(!d.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};d.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"&&!d.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=d.isBuffer(e)?e:d.from(e,i),a=s.length;if(a===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-r;++o)this[o+r]=s[o%a]}return this};var kt={};function xi(t,e,r){kt[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}`}}}xi("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);xi("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);xi("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=ea(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=ea(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function ea(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 Id(t,e,r){Ut(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&ur(e,t.length-(r+1))}function ca(t,e,r,n,i,o){if(t>r||t<e){let s=typeof e=="bigint"?"n":"",a;throw o>3?e===0||e===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${e}${s} and <= ${r}${s}`,new kt.ERR_OUT_OF_RANGE("value",a,t)}Id(n,i,o)}function Ut(t,e){if(typeof t!="number")throw new kt.ERR_INVALID_ARG_TYPE(e,"number",t)}function ur(t,e,r){throw Math.floor(t)!==t?(Ut(t,r),new kt.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new kt.ERR_BUFFER_OUT_OF_BOUNDS:new kt.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var Ld=/[^+/0-9A-Za-z-_]/g;function Bd(t){if(t=t.split("=")[0],t=t.trim().replace(Ld,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function mi(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 Od(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Cd(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 da(t){return bi.toByteArray(Bd(t))}function Kr(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 de(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Si(t){return t!==t}var Nd=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function je(t){return typeof BigInt>"u"?Md:t}function Md(){throw new Error("BigInt not supported")}});var Ai=b((Dm,ha)=>{"use strict";var Ti=null;ha.exports=function(){return Ti===null&&(Ti={textEncoder:new TextEncoder,textDecoder:new TextDecoder}),Ti}});var Ii=b(pa=>{"use strict";var Ri=oe(),kd=new Set(["buffer","view","utf8"]),vi=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"||!kd.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 Ri(`Encoding '${this.name}' cannot be transcoded to 'buffer'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createViewTranscoder(){throw new Ri(`Encoding '${this.name}' cannot be transcoded to 'view'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createUTF8Transcoder(){throw new Ri(`Encoding '${this.name}' cannot be transcoded to 'utf8'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}};pa.Encoding=vi});var Ci=b(Gr=>{"use strict";var{Buffer:Bi}=Q()||{},{Encoding:Oi}=Ii(),Dd=Ai(),fr=class extends Oi{constructor(e){super({...e,format:"buffer"})}createViewTranscoder(){return new lr({encode:this.encode,decode:e=>this.decode(Bi.from(e.buffer,e.byteOffset,e.byteLength)),name:`${this.name}+view`})}createBufferTranscoder(){return this}},lr=class extends Oi{constructor(e){super({...e,format:"view"})}createBufferTranscoder(){return new fr({encode:e=>{let r=this.encode(e);return Bi.from(r.buffer,r.byteOffset,r.byteLength)},decode:this.decode,name:`${this.name}+buffer`})}createViewTranscoder(){return this}},Li=class extends Oi{constructor(e){super({...e,format:"utf8"})}createBufferTranscoder(){return new fr({encode:e=>Bi.from(this.encode(e),"utf8"),decode:e=>this.decode(e.toString("utf8")),name:`${this.name}+buffer`})}createViewTranscoder(){let{textEncoder:e,textDecoder:r}=Dd();return new lr({encode:n=>e.encode(this.encode(n)),decode:n=>this.decode(r.decode(n)),name:`${this.name}+view`})}createUTF8Transcoder(){return this}};Gr.BufferFormat=fr;Gr.ViewFormat=lr;Gr.UTF8Format=Li});var ga=b(st=>{"use strict";var{Buffer:q}=Q()||{Buffer:{isBuffer:()=>!1}},{textEncoder:ba,textDecoder:ya}=Ai()(),{BufferFormat:cr,ViewFormat:Ni,UTF8Format:wa}=Ci(),Hr=t=>t;st.utf8=new wa({encode:function(t){return q.isBuffer(t)?t.toString("utf8"):ArrayBuffer.isView(t)?ya.decode(t):String(t)},decode:Hr,name:"utf8",createViewTranscoder(){return new Ni({encode:function(t){return ArrayBuffer.isView(t)?t:ba.encode(t)},decode:function(t){return ya.decode(t)},name:`${this.name}+view`})},createBufferTranscoder(){return new cr({encode:function(t){return q.isBuffer(t)?t:ArrayBuffer.isView(t)?q.from(t.buffer,t.byteOffset,t.byteLength):q.from(String(t),"utf8")},decode:function(t){return t.toString("utf8")},name:`${this.name}+buffer`})}});st.json=new wa({encode:JSON.stringify,decode:JSON.parse,name:"json"});st.buffer=new cr({encode:function(t){return q.isBuffer(t)?t:ArrayBuffer.isView(t)?q.from(t.buffer,t.byteOffset,t.byteLength):q.from(String(t),"utf8")},decode:Hr,name:"buffer",createViewTranscoder(){return new Ni({encode:function(t){return ArrayBuffer.isView(t)?t:q.from(String(t),"utf8")},decode:function(t){return q.from(t.buffer,t.byteOffset,t.byteLength)},name:`${this.name}+view`})}});st.view=new Ni({encode:function(t){return ArrayBuffer.isView(t)?t:ba.encode(t)},decode:Hr,name:"view",createBufferTranscoder(){return new cr({encode:function(t){return q.isBuffer(t)?t:ArrayBuffer.isView(t)?q.from(t.buffer,t.byteOffset,t.byteLength):q.from(String(t),"utf8")},decode:Hr,name:`${this.name}+buffer`})}});st.hex=new cr({encode:function(t){return q.isBuffer(t)?t:q.from(String(t),"hex")},decode:function(t){return t.toString("hex")},name:"hex"});st.base64=new cr({encode:function(t){return q.isBuffer(t)?t:q.from(String(t),"base64")},decode:function(t){return t.toString("base64")},name:"base64"})});var _a=b(Ea=>{"use strict";var ma=oe(),Yr=ga(),{Encoding:Ud}=Ii(),{BufferFormat:Fd,ViewFormat:Pd,UTF8Format:qd}=Ci(),dr=Symbol("formats"),zr=Symbol("encodings"),$d=new Set(["buffer","view","utf8"]),Mi=class{constructor(e){if(Array.isArray(e)){if(!e.every(r=>$d.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[zr]=new Map,this[dr]=new Set(e);for(let r in Yr)try{this.encoding(r)}catch(n){if(n.code!=="LEVEL_ENCODING_NOT_SUPPORTED")throw n}}encodings(){return Array.from(new Set(this[zr].values()))}encoding(e){let r=this[zr].get(e);if(r===void 0){if(typeof e=="string"&&e!==""){if(r=Kd[e],!r)throw new ma(`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=jd(e)}let{name:n,format:i}=r;if(!this[dr].has(i))if(this[dr].has("view"))r=r.createViewTranscoder();else if(this[dr].has("buffer"))r=r.createBufferTranscoder();else if(this[dr].has("utf8"))r=r.createUTF8Transcoder();else throw new ma(`Encoding '${n}' cannot be transcoded`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"});for(let o of[e,n,r.name,r.commonName])this[zr].set(o,r)}return r}};Ea.Transcoder=Mi;function jd(t){if(t instanceof Ud)return t;let e="type"in t&&typeof t.type=="string"?t.type:void 0,r=t.name||e||`anonymous-${Gd++}`;switch(Vd(t)){case"view":return new Pd({...t,name:r});case"utf8":return new qd({...t,name:r});case"buffer":return new Fd({...t,name:r});default:throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'")}}function Vd(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 Wd={binary:Yr.buffer,"utf-8":Yr.utf8},Kd={...Yr,...Wd},Gd=0});var hr=b(($m,ki)=>{"use strict";var Pt=typeof Reflect=="object"?Reflect:null,xa=Pt&&typeof Pt.apply=="function"?Pt.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Jr;Pt&&typeof Pt.ownKeys=="function"?Jr=Pt.ownKeys:Object.getOwnPropertySymbols?Jr=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Jr=function(e){return Object.getOwnPropertyNames(e)};function Hd(t){console&&console.warn&&console.warn(t)}var Ta=Number.isNaN||function(e){return e!==e};function v(){v.init.call(this)}ki.exports=v;ki.exports.once=Xd;v.EventEmitter=v;v.prototype._events=void 0;v.prototype._eventsCount=0;v.prototype._maxListeners=void 0;var Sa=10;function Xr(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(v,"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}});v.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};v.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?v.defaultMaxListeners:t._maxListeners}v.prototype.getMaxListeners=function(){return Aa(this)};v.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 a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(u===void 0)return!1;if(typeof u=="function")xa(u,this,r);else for(var f=u.length,c=Ba(u,f),n=0;n<f;++n)xa(c[n],this,r);return!0};function Ra(t,e,r,n){var i,o,s;if(Xr(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 a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,Hd(a)}return t}v.prototype.addListener=function(e,r){return Ra(this,e,r,!1)};v.prototype.on=v.prototype.addListener;v.prototype.prependListener=function(e,r){return Ra(this,e,r,!0)};function zd(){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 va(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=zd.bind(n);return i.listener=r,n.wrapFn=i,i}v.prototype.once=function(e,r){return Xr(r),this.on(e,va(this,e,r)),this};v.prototype.prependOnceListener=function(e,r){return Xr(r),this.prependListener(e,va(this,e,r)),this};v.prototype.removeListener=function(e,r){var n,i,o,s,a;if(Xr(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){a=n[s].listener,o=s;break}if(o<0)return this;o===0?n.shift():Yd(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};v.prototype.off=v.prototype.removeListener;v.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 Ia(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?Jd(i):Ba(i,i.length)}v.prototype.listeners=function(e){return Ia(this,e,!0)};v.prototype.rawListeners=function(e){return Ia(this,e,!1)};v.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):La.call(t,e)};v.prototype.listenerCount=La;function La(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}v.prototype.eventNames=function(){return this._eventsCount>0?Jr(this._events):[]};function Ba(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function Yd(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Jd(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Xd(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))}Oa(t,e,o,{once:!0}),e!=="error"&&Zd(t,i,{once:!0})})}function Zd(t,e,r){typeof t.on=="function"&&Oa(t,"error",e,r)}function Oa(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 Na=b((jm,Ca)=>{Ca.exports=typeof queueMicrotask=="function"?queueMicrotask:t=>Promise.resolve().then(t)});var pr=b(Di=>{"use strict";var Ma=Na();Di.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};Di.fromPromise=function(t,e){if(e===void 0)return t;t.then(function(r){Ma(()=>e(null,r))}).catch(function(r){Ma(()=>e(r))})}});var Zr=b(Ui=>{"use strict";Ui.getCallback=function(t,e){return typeof t=="function"?t:e};Ui.getOptions=function(t,e){return typeof t=="object"&&t!==null?t:e!==void 0?e:{}}});var ze=b(rn=>{"use strict";var{fromCallback:Fi}=pr(),Y=oe(),{getOptions:Pi,getCallback:ka}=Zr(),at=Symbol("promise"),qt=Symbol("callback"),he=Symbol("working"),ut=Symbol("handleOne"),ve=Symbol("handleMany"),qi=Symbol("autoClose"),Ge=Symbol("finishWork"),pe=Symbol("returnMany"),Ve=Symbol("closing"),yr=Symbol("handleClose"),Qr=Symbol("closed"),br=Symbol("closeCallbacks"),Ke=Symbol("keyEncoding"),ft=Symbol("valueEncoding"),$i=Symbol("abortOnClose"),en=Symbol("legacy"),ji=Symbol("keys"),Vi=Symbol("values"),We=Symbol("limit"),ee=Symbol("count"),tn=Object.freeze({}),Qd=()=>{},Da=!1,wr=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[Qr]=!1,this[br]=[],this[he]=!1,this[Ve]=!1,this[qi]=!1,this[qt]=null,this[ut]=this[ut].bind(this),this[ve]=this[ve].bind(this),this[yr]=this[yr].bind(this),this[Ke]=r[Ke],this[ft]=r[ft],this[en]=n,this[We]=Number.isInteger(r.limit)&&r.limit>=0?r.limit:1/0,this[ee]=0,this[$i]=!!r.abortOnClose,this.db=e,this.db.attachResource(this),this.nextTick=e.nextTick}get count(){return this[ee]}get limit(){return this[We]}next(e){let r;if(e===void 0)r=new Promise((n,i)=>{e=(o,s,a)=>{o?i(o):this[en]?s===void 0&&a===void 0?n():n([s,a]):n(s)}});else if(typeof e!="function")throw new TypeError("Callback must be a function");return this[Ve]?this.nextTick(e,new Y("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[he]?this.nextTick(e,new Y("Iterator is busy: cannot call next() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[he]=!0,this[qt]=e,this[ee]>=this[We]?this.nextTick(this[ut],null):this._next(this[ut])),r}_next(e){this.nextTick(e)}nextv(e,r,n){return n=ka(r,n),n=Fi(n,at),r=Pi(r,tn),Number.isInteger(e)?(this[Ve]?this.nextTick(n,new Y("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[he]?this.nextTick(n,new Y("Iterator is busy: cannot call nextv() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(e<1&&(e=1),this[We]<1/0&&(e=Math.min(e,this[We]-this[ee])),this[he]=!0,this[qt]=n,e<=0?this.nextTick(this[ve],null,[]):this._nextv(e,r,this[ve])),n[at]):(this.nextTick(n,new TypeError("The first argument 'size' must be an integer")),n[at])}_nextv(e,r,n){let i=[],o=(s,a,u)=>{if(s)return n(s);if(this[en]?a===void 0&&u===void 0:a===void 0)return n(null,i);i.push(this[en]?[a,u]:a),i.length===e?n(null,i):this._next(o)};this._next(o)}all(e,r){return r=ka(e,r),r=Fi(r,at),e=Pi(e,tn),this[Ve]?this.nextTick(r,new Y("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[he]?this.nextTick(r,new Y("Iterator is busy: cannot call all() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[he]=!0,this[qt]=r,this[qi]=!0,this[ee]>=this[We]?this.nextTick(this[ve],null,[]):this._all(e,this[ve])),r[at]}_all(e,r){let n=this[ee],i=[],o=()=>{let a=this[We]<1/0?Math.min(1e3,this[We]-n):1e3;a<=0?this.nextTick(r,null,i):this._nextv(a,tn,s)},s=(a,u)=>{a?r(a):u.length===0?r(null,i):(i.push.apply(i,u),n+=u.length,o())};o()}[Ge](){let e=this[qt];return this[$i]&&e===null?Qd:(this[he]=!1,this[qt]=null,this[Ve]&&this._close(this[yr]),e)}[pe](e,r,n){this[qi]?this.close(e.bind(null,r,n)):e(r,n)}seek(e,r){if(r=Pi(r,tn),!this[Ve]){if(this[he])throw new Y("Iterator is busy: cannot call seek() until next() has completed",{code:"LEVEL_ITERATOR_BUSY"});{let n=this.db.keyEncoding(r.keyEncoding||this[Ke]),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 Y("Iterator does not support seek()",{code:"LEVEL_NOT_SUPPORTED"})}close(e){return e=Fi(e,at),this[Qr]?this.nextTick(e):this[Ve]?this[br].push(e):(this[Ve]=!0,this[br].push(e),this[he]?this[$i]&&this[Ge]()(new Y("Aborted on iterator close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this._close(this[yr])),e[at]}_close(e){this.nextTick(e)}[yr](){this[Qr]=!0,this.db.detachResource(this);let e=this[br];this[br]=[];for(let r of e)r()}async*[Symbol.asyncIterator](){try{let e;for(;(e=await this.next())!==void 0;)yield e}finally{this[Qr]||await this.close()}}},$t=class extends wr{constructor(e,r){super(e,r,!0),this[ji]=r.keys!==!1,this[Vi]=r.values!==!1}[ut](e,r,n){let i=this[Ge]();if(e)return i(e);try{r=this[ji]&&r!==void 0?this[Ke].decode(r):void 0,n=this[Vi]&&n!==void 0?this[ft].decode(n):void 0}catch(o){return i(new He("entry",o))}r===void 0&&n===void 0||this[ee]++,i(null,r,n)}[ve](e,r){let n=this[Ge]();if(e)return this[pe](n,e);try{for(let i of r){let o=i[0],s=i[1];i[0]=this[ji]&&o!==void 0?this[Ke].decode(o):void 0,i[1]=this[Vi]&&s!==void 0?this[ft].decode(s):void 0}}catch(i){return this[pe](n,new He("entries",i))}this[ee]+=r.length,this[pe](n,null,r)}end(e){return!Da&&typeof console<"u"&&(Da=!0,console.warn(new Y("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)}},Wi=class extends wr{constructor(e,r){super(e,r,!1)}[ut](e,r){let n=this[Ge]();if(e)return n(e);try{r=r!==void 0?this[Ke].decode(r):void 0}catch(i){return n(new He("key",i))}r!==void 0&&this[ee]++,n(null,r)}[ve](e,r){let n=this[Ge]();if(e)return this[pe](n,e);try{for(let i=0;i<r.length;i++){let o=r[i];r[i]=o!==void 0?this[Ke].decode(o):void 0}}catch(i){return this[pe](n,new He("keys",i))}this[ee]+=r.length,this[pe](n,null,r)}},Ki=class extends wr{constructor(e,r){super(e,r,!1)}[ut](e,r){let n=this[Ge]();if(e)return n(e);try{r=r!==void 0?this[ft].decode(r):void 0}catch(i){return n(new He("value",i))}r!==void 0&&this[ee]++,n(null,r)}[ve](e,r){let n=this[Ge]();if(e)return this[pe](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[pe](n,new He("values",i))}this[ee]+=r.length,this[pe](n,null,r)}},He=class extends Y{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($t.prototype,t.split(" ")[0],{get(){throw new Y(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})},set(){throw new Y(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})}});$t.keyEncoding=Ke;$t.valueEncoding=ft;rn.AbstractIterator=$t;rn.AbstractKeyIterator=Wi;rn.AbstractValueIterator=Ki});var Ua=b(Gi=>{"use strict";var{AbstractKeyIterator:eh,AbstractValueIterator:th}=ze(),lt=Symbol("iterator"),gr=Symbol("callback"),jt=Symbol("handleOne"),ct=Symbol("handleMany"),mr=class extends eh{constructor(e,r){super(e,r),this[lt]=e.iterator({...r,keys:!0,values:!1}),this[jt]=this[jt].bind(this),this[ct]=this[ct].bind(this)}},nn=class extends th{constructor(e,r){super(e,r),this[lt]=e.iterator({...r,keys:!1,values:!0}),this[jt]=this[jt].bind(this),this[ct]=this[ct].bind(this)}};for(let t of[mr,nn]){let e=t===mr,r=e?n=>n[0]:n=>n[1];t.prototype._next=function(n){this[gr]=n,this[lt].next(this[jt])},t.prototype[jt]=function(n,i,o){let s=this[gr];n?s(n):s(null,e?i:o)},t.prototype._nextv=function(n,i,o){this[gr]=o,this[lt].nextv(n,i,this[ct])},t.prototype._all=function(n,i){this[gr]=i,this[lt].all(n,this[ct])},t.prototype[ct]=function(n,i){let o=this[gr];n?o(n):o(null,i.map(r))},t.prototype._seek=function(n,i){this[lt].seek(n,i)},t.prototype._close=function(n){this[lt].close(n)}}Gi.DefaultKeyIterator=mr;Gi.DefaultValueIterator=nn});var Fa=b(ln=>{"use strict";var{AbstractIterator:rh,AbstractKeyIterator:nh,AbstractValueIterator:ih}=ze(),Hi=oe(),z=Symbol("nut"),un=Symbol("undefer"),fn=Symbol("factory"),on=class extends rh{constructor(e,r){super(e,r),this[z]=null,this[fn]=()=>e.iterator(r),this.db.defer(()=>this[un]())}},sn=class extends nh{constructor(e,r){super(e,r),this[z]=null,this[fn]=()=>e.keys(r),this.db.defer(()=>this[un]())}},an=class extends ih{constructor(e,r){super(e,r),this[z]=null,this[fn]=()=>e.values(r),this.db.defer(()=>this[un]())}};for(let t of[on,sn,an])t.prototype[un]=function(){this.db.status==="open"&&(this[z]=this[fn]())},t.prototype._next=function(e){this[z]!==null?this[z].next(e):this.db.status==="opening"?this.db.defer(()=>this._next(e)):this.nextTick(e,new Hi("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._nextv=function(e,r,n){this[z]!==null?this[z].nextv(e,r,n):this.db.status==="opening"?this.db.defer(()=>this._nextv(e,r,n)):this.nextTick(n,new Hi("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._all=function(e,r){this[z]!==null?this[z].all(r):this.db.status==="opening"?this.db.defer(()=>this._all(e,r)):this.nextTick(r,new Hi("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._seek=function(e,r){this[z]!==null?this[z]._seek(e,r):this.db.status==="opening"&&this.db.defer(()=>this._seek(e,r))},t.prototype._close=function(e){this[z]!==null?this[z].close(e):this.db.status==="opening"?this.db.defer(()=>this._close(e)):this.nextTick(e)};ln.DeferredIterator=on;ln.DeferredKeyIterator=sn;ln.DeferredValueIterator=an});var Yi=b(qa=>{"use strict";var{fromCallback:Pa}=pr(),cn=oe(),{getCallback:oh,getOptions:sh}=Zr(),dn=Symbol("promise"),te=Symbol("status"),Vt=Symbol("operations"),Er=Symbol("finishClose"),Wt=Symbol("closeCallbacks"),zi=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[Vt]=[],this[Wt]=[],this[te]="open",this[Er]=this[Er].bind(this),this.db=e,this.db.attachResource(this),this.nextTick=e.nextTick}get length(){return this[Vt].length}put(e,r,n){if(this[te]!=="open")throw new cn("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,a=o.keyEncoding(n&&n.keyEncoding),u=o.valueEncoding(n&&n.valueEncoding),f=a.format;n={...n,keyEncoding:f,valueEncoding:u.format},o!==this.db&&(n.sublevel=null);let c=o.prefixKey(a.encode(e),f),l=u.encode(r);return this._put(c,l,n),this[Vt].push({...s,type:"put",key:e,value:r}),this}_put(e,r,n){}del(e,r){if(this[te]!=="open")throw new cn("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),a=s.format;return r={...r,keyEncoding:a},i!==this.db&&(r.sublevel=null),this._del(i.prefixKey(s.encode(e),a),r),this[Vt].push({...o,type:"del",key:e}),this}_del(e,r){}clear(){if(this[te]!=="open")throw new cn("Batch is not open: cannot call clear() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});return this._clear(),this[Vt]=[],this}_clear(){}write(e,r){return r=oh(e,r),r=Pa(r,dn),e=sh(e),this[te]!=="open"?this.nextTick(r,new cn("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"})):this.length===0?this.close(r):(this[te]="writing",this._write(e,n=>{this[te]="closing",this[Wt].push(()=>r(n)),n||this.db.emit("batch",this[Vt]),this._close(this[Er])})),r[dn]}_write(e,r){}close(e){return e=Pa(e,dn),this[te]==="closing"?this[Wt].push(e):this[te]==="closed"?this.nextTick(e):(this[Wt].push(e),this[te]!=="writing"&&(this[te]="closing",this._close(this[Er]))),e[dn]}_close(e){this.nextTick(e)}[Er](){this[te]="closed",this.db.detachResource(this);let e=this[Wt];this[Wt]=[];for(let r of e)r()}};qa.AbstractChainedBatch=zi});var ja=b($a=>{"use strict";var{AbstractChainedBatch:ah}=Yi(),uh=oe(),Kt=Symbol("encoded"),Ji=class extends ah{constructor(e){super(e),this[Kt]=[]}_put(e,r,n){this[Kt].push({...n,type:"put",key:e,value:r})}_del(e,r){this[Kt].push({...r,type:"del",key:e})}_clear(){this[Kt]=[]}_write(e,r){this.db.status==="opening"?this.db.defer(()=>this._write(e,r)):this.db.status==="open"?this[Kt].length===0?this.nextTick(r):this.db._batch(this[Kt],e,r):this.nextTick(r,new uh("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"}))}};$a.DefaultChainedBatch=Ji});var Ka=b((Jm,Wa)=>{"use strict";var Va=oe(),fh=Object.prototype.hasOwnProperty,lh=new Set(["lt","lte","gt","gte"]);Wa.exports=function(t,e){let r={};for(let n in t)if(fh.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"});lh.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 Xi=b((Xm,Ha)=>{var Ga;Ha.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:globalThis):t=>(Ga||(Ga=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var Ja=b((Zm,Ya)=>{"use strict";var za=Xi();Ya.exports=function(t,...e){e.length===0?za(t):za(()=>t(...e))}});var Xa=b(hn=>{"use strict";var{AbstractIterator:ch,AbstractKeyIterator:dh,AbstractValueIterator:hh}=ze(),Gt=Symbol("unfix"),se=Symbol("iterator"),dt=Symbol("handleOne"),Ye=Symbol("handleMany"),Ie=Symbol("callback"),_r=class extends ch{constructor(e,r,n,i){super(e,r),this[se]=n,this[Gt]=i,this[dt]=this[dt].bind(this),this[Ye]=this[Ye].bind(this),this[Ie]=null}[dt](e,r,n){let i=this[Ie];if(e)return i(e);r!==void 0&&(r=this[Gt](r)),i(e,r,n)}[Ye](e,r){let n=this[Ie];if(e)return n(e);for(let i of r){let o=i[0];o!==void 0&&(i[0]=this[Gt](o))}n(e,r)}},xr=class extends dh{constructor(e,r,n,i){super(e,r),this[se]=n,this[Gt]=i,this[dt]=this[dt].bind(this),this[Ye]=this[Ye].bind(this),this[Ie]=null}[dt](e,r){let n=this[Ie];if(e)return n(e);r!==void 0&&(r=this[Gt](r)),n(e,r)}[Ye](e,r){let n=this[Ie];if(e)return n(e);for(let i=0;i<r.length;i++){let o=r[i];o!==void 0&&(r[i]=this[Gt](o))}n(e,r)}},Sr=class extends hh{constructor(e,r,n){super(e,r),this[se]=n}};for(let t of[_r,xr])t.prototype._next=function(e){this[Ie]=e,this[se].next(this[dt])},t.prototype._nextv=function(e,r,n){this[Ie]=n,this[se].nextv(e,r,this[Ye])},t.prototype._all=function(e,r){this[Ie]=r,this[se].all(e,this[Ye])};for(let t of[Sr])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[_r,xr,Sr])t.prototype._seek=function(e,r){this[se].seek(e,r)},t.prototype._close=function(e){this[se].close(e)};hn.AbstractSublevelIterator=_r;hn.AbstractSublevelKeyIterator=xr;hn.AbstractSublevelValueIterator=Sr});var tu=b((eE,eu)=>{"use strict";var Zi=oe(),{Buffer:to}=Q()||{},{AbstractSublevelIterator:ph,AbstractSublevelKeyIterator:yh,AbstractSublevelValueIterator:bh}=Xa(),Le=Symbol("prefix"),Za=Symbol("upperBound"),Tr=Symbol("prefixRange"),J=Symbol("parent"),Qi=Symbol("unfix"),Qa=new TextEncoder,wh={separator:"!"};eu.exports=function({AbstractLevel:t}){class e extends t{static defaults(n){if(typeof n=="string")throw new Zi("The subleveldown string shorthand for { separator } has been removed",{code:"LEVEL_LEGACY"});if(n&&n.open)throw new Zi("The subleveldown open option has been removed",{code:"LEVEL_LEGACY"});return n==null?wh:n.separator?n:{...n,separator:"!"}}constructor(n,i,o){let{separator:s,manifest:a,...u}=e.defaults(o);i=mh(i,s);let f=s.charCodeAt(0)+1,c=n[J]||n;if(!Qa.encode(i).every(y=>y>f&&y<127))throw new Zi(`Prefix must use bytes > ${f} < 127`,{code:"LEVEL_INVALID_PREFIX"});super(gh(c,a),u);let l=(n.prefix||"")+s+i+s,p=l.slice(0,-1)+String.fromCharCode(f);this[J]=c,this[Le]=new pn(l),this[Za]=new pn(p),this[Qi]=new ro,this.nextTick=c.nextTick}prefixKey(n,i){if(i==="utf8")return this[Le].utf8+n;if(n.byteLength===0)return this[Le][i];if(i==="view"){let o=this[Le].view,s=new Uint8Array(o.byteLength+n.byteLength);return s.set(o,0),s.set(n,o.byteLength),s}else{let o=this[Le].buffer;return to.concat([o,n],o.byteLength+n.byteLength)}}[Tr](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[Le][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[Za][i]}get prefix(){return this[Le].utf8}get db(){return this[J]}_open(n,i){this[J].open({passive:!0},i)}_put(n,i,o,s){this[J].put(n,i,o,s)}_get(n,i,o){this[J].get(n,i,o)}_getMany(n,i,o){this[J].getMany(n,i,o)}_del(n,i,o){this[J].del(n,i,o)}_batch(n,i,o){this[J].batch(n,i,o)}_clear(n,i){this[Tr](n,n.keyEncoding),this[J].clear(n,i)}_iterator(n){this[Tr](n,n.keyEncoding);let i=this[J].iterator(n),o=this[Qi].get(this[Le].utf8.length,n.keyEncoding);return new ph(this,n,i,o)}_keys(n){this[Tr](n,n.keyEncoding);let i=this[J].keys(n),o=this[Qi].get(this[Le].utf8.length,n.keyEncoding);return new yh(this,n,i,o)}_values(n){this[Tr](n,n.keyEncoding);let i=this[J].values(n);return new bh(this,n,i)}}return{AbstractSublevel:e}};var gh=function(t,e){return{...t.supports,createIfMissing:!1,errorIfExists:!1,events:{},additionalMethods:{},...e,encodings:{utf8:eo(t,"utf8"),buffer:eo(t,"buffer"),view:eo(t,"view")}}},eo=function(t,e){return t.supports.encodings[e]?t.keyEncoding(e).name===e:!1},pn=class{constructor(e){this.utf8=e,this.view=Qa.encode(e),this.buffer=to?to.from(this.view.buffer,0,this.view.byteLength):{}}},ro=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}},mh=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 ao=b(so=>{"use strict";var{supports:Eh}=Ks(),{Transcoder:_h}=_a(),{EventEmitter:xh}=hr(),{fromCallback:Je}=pr(),ae=oe(),{AbstractIterator:ht}=ze(),{DefaultKeyIterator:Sh,DefaultValueIterator:Th}=Ua(),{DeferredIterator:Ah,DeferredKeyIterator:Rh,DeferredValueIterator:vh}=Fa(),{DefaultChainedBatch:ru}=ja(),{getCallback:pt,getOptions:Xe}=Zr(),yn=Ka(),_=Symbol("promise"),Be=Symbol("landed"),yt=Symbol("resources"),no=Symbol("closeResources"),Ar=Symbol("operations"),Rr=Symbol("undefer"),bn=Symbol("deferOpen"),nu=Symbol("options"),T=Symbol("status"),bt=Symbol("defaultOptions"),Ht=Symbol("transcoder"),wn=Symbol("keyEncoding"),io=Symbol("valueEncoding"),Ih=()=>{},vr=class extends xh{constructor(e,r){if(super(),typeof e!="object"||e===null)throw new TypeError("The first argument 'manifest' must be an object");r=Xe(r);let{keyEncoding:n,valueEncoding:i,passive:o,...s}=r;this[yt]=new Set,this[Ar]=[],this[bn]=!0,this[nu]=s,this[T]="opening",this.supports=Eh(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[Ht]=new _h(Lh(this)),this[wn]=this[Ht].encoding(n||"utf8"),this[io]=this[Ht].encoding(i||"utf8");for(let a of this[Ht].encodings())this.supports.encodings[a.commonName]||(this.supports.encodings[a.commonName]=!0);this[bt]={empty:Object.freeze({}),entry:Object.freeze({keyEncoding:this[wn].commonName,valueEncoding:this[io].commonName}),key:Object.freeze({keyEncoding:this[wn].commonName})},this.nextTick(()=>{this[bn]&&this.open({passive:!1},Ih)})}get status(){return this[T]}keyEncoding(e){return this[Ht].encoding(e??this[wn])}valueEncoding(e){return this[Ht].encoding(e??this[io])}open(e,r){r=pt(e,r),r=Je(r,_),e={...this[nu],...Xe(e)},e.createIfMissing=e.createIfMissing!==!1,e.errorIfExists=!!e.errorIfExists;let n=i=>{this[T]==="closing"||this[T]==="opening"?this.once(Be,i?()=>n(i):n):this[T]!=="open"?r(new ae("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN",cause:i})):r()};return e.passive?this[T]==="opening"?this.once(Be,n):this.nextTick(n):this[T]==="closed"||this[bn]?(this[bn]=!1,this[T]="opening",this.emit("opening"),this._open(e,i=>{if(i){this[T]="closed",this[no](()=>{this.emit(Be),n(i)}),this[Rr]();return}this[T]="open",this[Rr](),this.emit(Be),this[T]==="open"&&this.emit("open"),this[T]==="open"&&this.emit("ready"),n()})):this[T]==="open"?this.nextTick(n):this.once(Be,()=>this.open(e,r)),r[_]}_open(e,r){this.nextTick(r)}close(e){e=Je(e,_);let r=n=>{this[T]==="opening"||this[T]==="closing"?this.once(Be,n?r(n):r):this[T]!=="closed"?e(new ae("Database is not closed",{code:"LEVEL_DATABASE_NOT_CLOSED",cause:n})):e()};if(this[T]==="open"){this[T]="closing",this.emit("closing");let n=i=>{this[T]="open",this[Rr](),this.emit(Be),r(i)};this[no](()=>{this._close(i=>{if(i)return n(i);this[T]="closed",this[Rr](),this.emit(Be),this[T]==="closed"&&this.emit("closed"),r()})})}else this[T]==="closed"?this.nextTick(r):this.once(Be,()=>this.close(e));return e[_]}[no](e){if(this[yt].size===0)return this.nextTick(e);let r=this[yt].size,n=!0,i=()=>{--r===0&&(n?this.nextTick(e):e())};for(let o of this[yt])o.close(i);n=!1,this[yt].clear()}_close(e){this.nextTick(e)}get(e,r,n){if(n=pt(r,n),n=Je(n,_),r=Xe(r,this[bt].entry),this[T]==="opening")return this.defer(()=>this.get(e,r,n)),n[_];if(zt(this,n))return n[_];let i=this._checkKey(e);if(i)return this.nextTick(n,i),n[_];let o=this.keyEncoding(r.keyEncoding),s=this.valueEncoding(r.valueEncoding),a=o.format,u=s.format;return(r.keyEncoding!==a||r.valueEncoding!==u)&&(r=Object.assign({},r,{keyEncoding:a,valueEncoding:u})),this._get(this.prefixKey(o.encode(e),a),r,(f,c)=>{if(f)return(f.code==="LEVEL_NOT_FOUND"||f.notFound||/NotFound/i.test(f))&&(f.code||(f.code="LEVEL_NOT_FOUND"),f.notFound||(f.notFound=!0),f.status||(f.status=404)),n(f);try{c=s.decode(c)}catch(l){return n(new ae("Could not decode value",{code:"LEVEL_DECODE_ERROR",cause:l}))}n(null,c)}),n[_]}_get(e,r,n){this.nextTick(n,new Error("NotFound"))}getMany(e,r,n){if(n=pt(r,n),n=Je(n,_),r=Xe(r,this[bt].entry),this[T]==="opening")return this.defer(()=>this.getMany(e,r,n)),n[_];if(zt(this,n))return n[_];if(!Array.isArray(e))return this.nextTick(n,new TypeError("The first argument 'keys' must be an array")),n[_];if(e.length===0)return this.nextTick(n,null,[]),n[_];let i=this.keyEncoding(r.keyEncoding),o=this.valueEncoding(r.valueEncoding),s=i.format,a=o.format;(r.keyEncoding!==s||r.valueEncoding!==a)&&(r=Object.assign({},r,{keyEncoding:s,valueEncoding:a}));let u=new Array(e.length);for(let f=0;f<e.length;f++){let c=e[f],l=this._checkKey(c);if(l)return this.nextTick(n,l),n[_];u[f]=this.prefixKey(i.encode(c),s)}return this._getMany(u,r,(f,c)=>{if(f)return n(f);try{for(let l=0;l<c.length;l++)c[l]!==void 0&&(c[l]=o.decode(c[l]))}catch(l){return n(new ae(`Could not decode one or more of ${c.length} value(s)`,{code:"LEVEL_DECODE_ERROR",cause:l}))}n(null,c)}),n[_]}_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=Je(i,_),n=Xe(n,this[bt].entry),this[T]==="opening")return this.defer(()=>this.put(e,r,n,i)),i[_];if(zt(this,i))return i[_];let o=this._checkKey(e)||this._checkValue(r);if(o)return this.nextTick(i,o),i[_];let s=this.keyEncoding(n.keyEncoding),a=this.valueEncoding(n.valueEncoding),u=s.format,f=a.format;(n.keyEncoding!==u||n.valueEncoding!==f)&&(n=Object.assign({},n,{keyEncoding:u,valueEncoding:f}));let c=this.prefixKey(s.encode(e),u),l=a.encode(r);return this._put(c,l,n,p=>{if(p)return i(p);this.emit("put",e,r),i()}),i[_]}_put(e,r,n,i){this.nextTick(i)}del(e,r,n){if(n=pt(r,n),n=Je(n,_),r=Xe(r,this[bt].key),this[T]==="opening")return this.defer(()=>this.del(e,r,n)),n[_];if(zt(this,n))return n[_];let i=this._checkKey(e);if(i)return this.nextTick(n,i),n[_];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,a=>{if(a)return n(a);this.emit("del",e),n()}),n[_]}_del(e,r,n){this.nextTick(n)}batch(e,r,n){if(!arguments.length){if(this[T]==="opening")return new ru(this);if(this[T]!=="open")throw new ae("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._chainedBatch()}if(typeof e=="function"?n=e:n=pt(r,n),n=Je(n,_),r=Xe(r,this[bt].empty),this[T]==="opening")return this.defer(()=>this.batch(e,r,n)),n[_];if(zt(this,n))return n[_];if(!Array.isArray(e))return this.nextTick(n,new TypeError("The first argument 'operations' must be an array")),n[_];if(e.length===0)return this.nextTick(n),n[_];let i=new Array(e.length),{keyEncoding:o,valueEncoding:s,...a}=r;for(let u=0;u<e.length;u++){if(typeof e[u]!="object"||e[u]===null)return this.nextTick(n,new TypeError("A batch operation must be an object")),n[_];let f=Object.assign({},e[u]);if(f.type!=="put"&&f.type!=="del")return this.nextTick(n,new TypeError("A batch operation must have a type property that is 'put' or 'del'")),n[_];let c=this._checkKey(f.key);if(c)return this.nextTick(n,c),n[_];let l=f.sublevel!=null?f.sublevel:this,p=l.keyEncoding(f.keyEncoding||o),y=p.format;if(f.key=l.prefixKey(p.encode(f.key),y),f.keyEncoding=y,f.type==="put"){let h=this._checkValue(f.value);if(h)return this.nextTick(n,h),n[_];let g=l.valueEncoding(f.valueEncoding||s);f.value=g.encode(f.value),f.valueEncoding=g.format}l!==this&&(f.sublevel=null),i[u]=f}return this._batch(i,a,u=>{if(u)return n(u);this.emit("batch",e),n()}),n[_]}_batch(e,r,n){this.nextTick(n)}sublevel(e,r){return this._sublevel(e,oo.defaults(r))}_sublevel(e,r){return new oo(this,e,r)}prefixKey(e,r){return e}clear(e,r){if(r=pt(e,r),r=Je(r,_),e=Xe(e,this[bt].empty),this[T]==="opening")return this.defer(()=>this.clear(e,r)),r[_];if(zt(this,r))return r[_];let n=e,i=this.keyEncoding(e.keyEncoding);return e=yn(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[_]}_clear(e,r){this.nextTick(r)}iterator(e){let r=this.keyEncoding(e&&e.keyEncoding),n=this.valueEncoding(e&&e.valueEncoding);if(e=yn(e,r),e.keys=e.keys!==!1,e.values=e.values!==!1,e[ht.keyEncoding]=r,e[ht.valueEncoding]=n,e.keyEncoding=r.format,e.valueEncoding=n.format,this[T]==="opening")return new Ah(this,e);if(this[T]!=="open")throw new ae("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._iterator(e)}_iterator(e){return new ht(this,e)}keys(e){let r=this.keyEncoding(e&&e.keyEncoding),n=this.valueEncoding(e&&e.valueEncoding);if(e=yn(e,r),e[ht.keyEncoding]=r,e[ht.valueEncoding]=n,e.keyEncoding=r.format,e.valueEncoding=n.format,this[T]==="opening")return new Rh(this,e);if(this[T]!=="open")throw new ae("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._keys(e)}_keys(e){return new Sh(this,e)}values(e){let r=this.keyEncoding(e&&e.keyEncoding),n=this.valueEncoding(e&&e.valueEncoding);if(e=yn(e,r),e[ht.keyEncoding]=r,e[ht.valueEncoding]=n,e.keyEncoding=r.format,e.valueEncoding=n.format,this[T]==="opening")return new vh(this,e);if(this[T]!=="open")throw new ae("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._values(e)}_values(e){return new Th(this,e)}defer(e){if(typeof e!="function")throw new TypeError("The first argument must be a function");this[Ar].push(e)}[Rr](){if(this[Ar].length===0)return;let e=this[Ar];this[Ar]=[];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[yt].add(e)}detachResource(e){this[yt].delete(e)}_chainedBatch(){return new ru(this)}_checkKey(e){if(e==null)return new ae("Key cannot be null or undefined",{code:"LEVEL_INVALID_KEY"})}_checkValue(e){if(e==null)return new ae("Value cannot be null or undefined",{code:"LEVEL_INVALID_VALUE"})}};vr.prototype.nextTick=Ja();var{AbstractSublevel:oo}=tu()({AbstractLevel:vr});so.AbstractLevel=vr;so.AbstractSublevel=oo;var zt=function(t,e){return t[T]!=="open"?(t.nextTick(e,new ae("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"})),!0):!1},Lh=function(t){return Object.keys(t.supports.encodings).filter(e=>!!t.supports.encodings[e])}});var uo=b(wt=>{"use strict";wt.AbstractLevel=ao().AbstractLevel;wt.AbstractSublevel=ao().AbstractSublevel;wt.AbstractIterator=ze().AbstractIterator;wt.AbstractKeyIterator=ze().AbstractKeyIterator;wt.AbstractValueIterator=ze().AbstractValueIterator;wt.AbstractChainedBatch=Yi().AbstractChainedBatch});var ou=b((nE,iu)=>{iu.exports=Oh;var Bh=Xi();function Oh(t,e,r){if(typeof e!="number")throw new Error("second argument must be a Number");let n,i,o,s,a,u=!0,f;Array.isArray(t)?(n=[],o=i=t.length):(s=Object.keys(t),n={},o=i=s.length);function c(p){function y(){r&&r(p,n),r=null}u?Bh(y):y()}function l(p,y,h){if(n[p]=h,y&&(a=!0),--o===0||y)c(y);else if(!a&&f<i){let g;s?(g=s[f],f+=1,t[g](function(S,E){l(g,S,E)})):(g=f,f+=1,t[g](function(S,E){l(g,S,E)}))}}f=e,o?s?s.some(function(p,y){return t[p](function(h,g){l(p,h,g)}),y===e-1}):t.some(function(p,y){return p(function(h,g){l(y,h,g)}),y===e-1}):c(null),u=!1}});var fo=b((iE,su)=>{"use strict";su.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 lo=b((oE,au)=>{"use strict";var Ch=new TextEncoder;au.exports=function(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):Ch.encode(t)}});var du=b(cu=>{"use strict";var{AbstractIterator:Nh}=uo(),uu=fo(),gn=lo(),ye=Symbol("cache"),Oe=Symbol("finished"),X=Symbol("options"),Ce=Symbol("currentOptions"),gt=Symbol("position"),co=Symbol("location"),Yt=Symbol("first"),fu={},ho=class extends Nh{constructor(e,r,n){super(e,n),this[ye]=[],this[Oe]=this.limit===0,this[X]=n,this[Ce]={...n},this[gt]=void 0,this[co]=r,this[Yt]=!0}_nextv(e,r,n){if(this[Yt]=!1,this[Oe])return this.nextTick(n,null,[]);if(this[ye].length>0)return e=Math.min(e,this[ye].length),this.nextTick(n,null,this[ye].splice(0,e));this[gt]!==void 0&&(this[X].reverse?(this[Ce].lt=this[gt],this[Ce].lte=void 0):(this[Ce].gt=this[gt],this[Ce].gte=void 0));let i;try{i=uu(this[Ce])}catch{return this[Oe]=!0,this.nextTick(n,null,[])}let o=this.db.db.transaction([this[co]],"readonly"),s=o.objectStore(this[co]),a=[];if(this[X].reverse){let u=!this[X].values&&s.openKeyCursor?"openKeyCursor":"openCursor";s[u](i,"prev").onsuccess=f=>{let c=f.target.result;if(c){let{key:l,value:p}=c;this[gt]=l,a.push([this[X].keys&&l!==void 0?gn(l):void 0,this[X].values&&p!==void 0?gn(p):void 0]),a.length<e?c.continue():lu(o)}else this[Oe]=!0}}else{let u,f,c=()=>{if(u===void 0||f===void 0)return;let l=Math.max(u.length,f.length);l===0||e===1/0?this[Oe]=!0:this[gt]=u[l-1],a.length=l;for(let p=0;p<l;p++){let y=u[p],h=f[p];a[p]=[this[X].keys&&y!==void 0?gn(y):void 0,this[X].values&&h!==void 0?gn(h):void 0]}lu(o)};this[X].keys||e<1/0?s.getAllKeys(i,e<1/0?e:void 0).onsuccess=l=>{u=l.target.result,c()}:(u=[],this.nextTick(c)),this[X].values?s.getAll(i,e<1/0?e:void 0).onsuccess=l=>{f=l.target.result,c()}:(f=[],this.nextTick(c))}o.onabort=()=>{n(o.error||new Error("aborted by user")),n=null},o.oncomplete=()=>{n(null,a),n=null}}_next(e){if(this[ye].length>0){let[r,n]=this[ye].shift();this.nextTick(e,null,r,n)}else if(this[Oe])this.nextTick(e);else{let r=Math.min(100,this.limit-this.count);this[Yt]&&(this[Yt]=!1,r=1),this._nextv(r,fu,(n,i)=>{if(n)return e(n);this[ye]=i,this._next(e)})}}_all(e,r){this[Yt]=!1;let n=this[ye].splice(0,this[ye].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[Yt]=!0,this[ye]=[],this[Oe]=!1,this[gt]=void 0,this[Ce]={...this[X]};let n;try{n=uu(this[X])}catch{this[Oe]=!0;return}n!==null&&!n.includes(e)?this[Oe]=!0:this[X].reverse?this[Ce].lte=e:this[Ce].gte=e}};cu.Iterator=ho;function lu(t){typeof t.commit=="function"&&t.commit()}});var pu=b((aE,hu)=>{"use strict";hu.exports=function(e,r,n,i,o){if(i.limit===0)return e.nextTick(o);let s=e.db.transaction([r],"readwrite"),a=s.objectStore(r),u=0;s.oncomplete=function(){o()},s.onabort=function(){o(s.error||new Error("aborted by user"))};let f=a.openKeyCursor?"openKeyCursor":"openCursor",c=i.reverse?"prev":"next";a[f](n,c).onsuccess=function(l){let p=l.target.result;p&&(a.delete(p.key).onsuccess=function(){(i.limit<=0||++u<i.limit)&&p.continue()})}}});var Eu=b(mu=>{"use strict";var{AbstractLevel:Mh}=uo(),yu=oe(),kh=ou(),{fromCallback:Dh}=pr(),{Iterator:Uh}=du(),bu=lo(),Fh=pu(),Ph=fo(),gu="level-js-",Ir=Symbol("idb"),po=Symbol("namePrefix"),Ne=Symbol("location"),yo=Symbol("version"),mt=Symbol("store"),Lr=Symbol("onComplete"),wu=Symbol("promise"),mn=class extends Mh{constructor(e,r,n){if(typeof r=="function"||typeof n=="function")throw new yu("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[Ne]=e,this[po]=i??gu,this[yo]=parseInt(o||1,10),this[Ir]=null}get location(){return this[Ne]}get namePrefix(){return this[po]}get version(){return this[yo]}get db(){return this[Ir]}get type(){return"browser-level"}_open(e,r){let n=indexedDB.open(this[po]+this[Ne],this[yo]);n.onerror=function(){r(n.error||new Error("unknown error"))},n.onsuccess=()=>{this[Ir]=n.result,r()},n.onupgradeneeded=i=>{let o=i.target.result;o.objectStoreNames.contains(this[Ne])||o.createObjectStore(this[Ne])}}[mt](e){return this[Ir].transaction([this[Ne]],e).objectStore(this[Ne])}[Lr](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[mt]("readonly"),o;try{o=i.get(e)}catch(s){return this.nextTick(n,s)}this[Lr](o,function(s,a){if(s)return n(s);if(a===void 0)return n(new yu("Entry not found",{code:"LEVEL_NOT_FOUND"}));n(null,bu(a))})}_getMany(e,r,n){let i=this[mt]("readonly"),o=e.map(s=>a=>{let u;try{u=i.get(s)}catch(f){return a(f)}u.onsuccess=()=>{let f=u.result;a(null,f===void 0?f:bu(f))},u.onerror=f=>{f.stopPropagation(),a(u.error)}});kh(o,16,n)}_del(e,r,n){let i=this[mt]("readwrite"),o;try{o=i.delete(e)}catch(s){return this.nextTick(n,s)}this[Lr](o,n)}_put(e,r,n,i){let o=this[mt]("readwrite"),s;try{s=o.put(r,e)}catch(a){return this.nextTick(i,a)}this[Lr](s,i)}_iterator(e){return new Uh(this,this[Ne],e)}_batch(e,r,n){let i=this[mt]("readwrite"),o=i.transaction,s=0,a;o.onabort=function(){n(a||o.error||new Error("aborted by user"))},o.oncomplete=function(){n()};function u(){let f=e[s++],c=f.key,l;try{l=f.type==="del"?i.delete(c):i.put(f.value,c)}catch(p){a=p,o.abort();return}s<e.length?l.onsuccess=u:typeof o.commit=="function"&&o.commit()}u()}_clear(e,r){let n,i;try{n=Ph(e)}catch{return this.nextTick(r)}if(e.limit>=0)return Fh(this,this[Ne],n,e,r);try{let o=this[mt]("readwrite");i=n?o.delete(n):o.clear()}catch(o){return this.nextTick(r,o)}this[Lr](i,r)}_close(e){this[Ir].close(),this.nextTick(e)}};mn.destroy=function(t,e,r){typeof e=="function"&&(r=e,e=gu),r=Dh(r,wu);let n=indexedDB.deleteDatabase(e+t);return n.onsuccess=function(){r()},n.onerror=function(i){r(i)},r[wu]};mu.BrowserLevel=mn});var xu=b(_u=>{_u.Level=Eu().BrowserLevel});var k=b((hE,Ru)=>{"use strict";Ru.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 be=b((pE,wo)=>{"use strict";var qh=Q(),$h=Object.getPrototypeOf(async function(){}).constructor,vu=globalThis.Blob||qh.Blob,jh=typeof vu<"u"?function(e){return e instanceof vu}:function(e){return!1},bo=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}};wo.exports={AggregateError:bo,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 $h},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:jh};wo.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var xn=b((yE,_n)=>{"use strict";var{AbortController:Iu,AbortSignal:Vh}=typeof self<"u"?self:typeof window<"u"?window:void 0;_n.exports=Iu;_n.exports.AbortSignal=Vh;_n.exports.default=Iu});var j=b((bE,Ou)=>{"use strict";var{format:Wh,inspect:Sn,AggregateError:Kh}=be(),Gh=globalThis.AggregateError||Kh,Hh=Symbol("kIsNodeError"),zh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Yh=/^([A-Z][a-z0-9]*)+$/,Jh="__node_internal_",Tn={};function Et(t,e){if(!t)throw new Tn.ERR_INTERNAL_ASSERTION(e)}function Lu(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 Xh(t,e,r){if(typeof e=="function")return Et(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 Et(n===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?e:Wh(e,...r)}function P(t,e,r){r||(r=Error);class n extends r{constructor(...o){super(Xh(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[Hh]=!0,Tn[t]=n}function Bu(t){let e=Jh+t.name;return Object.defineProperty(t,"name",{value:e}),t}function Zh(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new Gh([e,t],e.message);return r.code=e.code,r}return t||e}var go=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Tn.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};P("ERR_ASSERTION","%s",Error);P("ERR_INVALID_ARG_TYPE",(t,e,r)=>{Et(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 u of e)Et(typeof u=="string","All expected entries have to be of type string"),zh.includes(u)?i.push(u.toLowerCase()):Yh.test(u)?o.push(u):(Et(u!=="object",'The value "object" should be written as "Object"'),s.push(u));if(o.length>0){let u=i.indexOf("object");u!==-1&&(i.splice(i,u,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 u=i.pop();n+=`one of type ${i.join(", ")}, or ${u}`}}(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 u=o.pop();n+=`an instance of ${o.join(", ")}, or ${u}`}}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 u=s.pop();n+=`one of ${s.join(", ")}, or ${u}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)n+=`. Received an instance of ${r.constructor.name}`;else{let u=Sn(r,{depth:-1});n+=`. Received ${u}`}}else{let u=Sn(r,{colors:!1});u.length>25&&(u=`${u.slice(0,25)}...`),n+=`. Received type ${typeof r} (${u})`}return n},TypeError);P("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let n=Sn(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${n}`},TypeError);P("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);P("ERR_MISSING_ARGS",(...t)=>{Et(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);P("ERR_OUT_OF_RANGE",(t,e,r)=>{Et(e,'Missing "range" argument');let n;return Number.isInteger(r)&&Math.abs(r)>2**32?n=Lu(String(r)):typeof r=="bigint"?(n=String(r),(r>2n**32n||r<-(2n**32n))&&(n=Lu(n)),n+="n"):n=Sn(r),`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);P("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);P("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);P("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);P("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);P("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);P("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);P("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);P("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);P("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);P("ERR_STREAM_WRITE_AFTER_END","write after end",Error);P("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Ou.exports={AbortError:go,aggregateTwoErrors:Bu(Zh),hideStackFrames:Bu,codes:Tn}});var Br=b((wE,qu)=>{"use strict";var{ArrayIsArray:Eo,ArrayPrototypeIncludes:ku,ArrayPrototypeJoin:Du,ArrayPrototypeMap:Qh,NumberIsInteger:_o,NumberIsNaN:ep,NumberMAX_SAFE_INTEGER:tp,NumberMIN_SAFE_INTEGER:rp,NumberParseInt:np,ObjectPrototypeHasOwnProperty:ip,RegExpPrototypeExec:Uu,String:op,StringPrototypeToUpperCase:sp,StringPrototypeTrim:ap}=k(),{hideStackFrames:re,codes:{ERR_SOCKET_BAD_PORT:up,ERR_INVALID_ARG_TYPE:V,ERR_INVALID_ARG_VALUE:Jt,ERR_OUT_OF_RANGE:_t,ERR_UNKNOWN_SIGNAL:Cu}}=j(),{normalizeEncoding:fp}=be(),{isAsyncFunction:lp,isArrayBufferView:cp}=be().types,Nu={};function dp(t){return t===(t|0)}function hp(t){return t===t>>>0}var pp=/^[0-7]+$/,yp="must be a 32-bit unsigned integer or an octal string";function bp(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(Uu(pp,t)===null)throw new Jt(e,t,yp);t=np(t,8)}return Fu(t,e),t}var wp=re((t,e,r=rp,n=tp)=>{if(typeof t!="number")throw new V(e,"number",t);if(!_o(t))throw new _t(e,"an integer",t);if(t<r||t>n)throw new _t(e,`>= ${r} && <= ${n}`,t)}),gp=re((t,e,r=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new V(e,"number",t);if(!_o(t))throw new _t(e,"an integer",t);if(t<r||t>n)throw new _t(e,`>= ${r} && <= ${n}`,t)}),Fu=re((t,e,r=!1)=>{if(typeof t!="number")throw new V(e,"number",t);if(!_o(t))throw new _t(e,"an integer",t);let n=r?1:0,i=4294967295;if(t<n||t>i)throw new _t(e,`>= ${n} && <= ${i}`,t)});function xo(t,e){if(typeof t!="string")throw new V(e,"string",t)}function mp(t,e,r=void 0,n){if(typeof t!="number")throw new V(e,"number",t);if(r!=null&&t<r||n!=null&&t>n||(r!=null||n!=null)&&ep(t))throw new _t(e,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}var Ep=re((t,e,r)=>{if(!ku(r,t)){let i="must be one of: "+Du(Qh(r,o=>typeof o=="string"?`'${o}'`:op(o)),", ");throw new Jt(e,t,i)}});function Pu(t,e){if(typeof t!="boolean")throw new V(e,"boolean",t)}function mo(t,e,r){return t==null||!ip(t,e)?r:t[e]}var _p=re((t,e,r=null)=>{let n=mo(r,"allowArray",!1),i=mo(r,"allowFunction",!1);if(!mo(r,"nullable",!1)&&t===null||!n&&Eo(t)||typeof t!="object"&&(!i||typeof t!="function"))throw new V(e,"Object",t)}),xp=re((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new V(e,"a dictionary",t)}),So=re((t,e,r=0)=>{if(!Eo(t))throw new V(e,"Array",t);if(t.length<r){let n=`must be longer than ${r}`;throw new Jt(e,t,n)}});function Sp(t,e){So(t,e);for(let r=0;r<t.length;r++)xo(t[r],`${e}[${r}]`)}function Tp(t,e){So(t,e);for(let r=0;r<t.length;r++)Pu(t[r],`${e}[${r}]`)}function Ap(t,e="signal"){if(xo(t,e),Nu[t]===void 0)throw Nu[sp(t)]!==void 0?new Cu(t+" (signals must use all capital letters)"):new Cu(t)}var Rp=re((t,e="buffer")=>{if(!cp(t))throw new V(e,["Buffer","TypedArray","DataView"],t)});function vp(t,e){let r=fp(e),n=t.length;if(r==="hex"&&n%2!==0)throw new Jt("encoding",e,`is invalid for data of length ${n}`)}function Ip(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&ap(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new up(e,t,r);return t|0}var Lp=re((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new V(e,"AbortSignal",t)}),Bp=re((t,e)=>{if(typeof t!="function")throw new V(e,"Function",t)}),Op=re((t,e)=>{if(typeof t!="function"||lp(t))throw new V(e,"Function",t)}),Cp=re((t,e)=>{if(t!==void 0)throw new V(e,"undefined",t)});function Np(t,e,r){if(!ku(r,t))throw new V(e,`('${Du(r,"|")}')`,t)}var Mp=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Mu(t,e){if(typeof t>"u"||!Uu(Mp,t))throw new Jt(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function kp(t){if(typeof t=="string")return Mu(t,"hints"),t;if(Eo(t)){let e=t.length,r="";if(e===0)return r;for(let n=0;n<e;n++){let i=t[n];Mu(i,"hints"),r+=i,n!==e-1&&(r+=", ")}return r}throw new Jt("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}qu.exports={isInt32:dp,isUint32:hp,parseFileMode:bp,validateArray:So,validateStringArray:Sp,validateBooleanArray:Tp,validateBoolean:Pu,validateBuffer:Rp,validateDictionary:xp,validateEncoding:vp,validateFunction:Bp,validateInt32:gp,validateInteger:wp,validateNumber:mp,validateObject:_p,validateOneOf:Ep,validatePlainFunction:Op,validatePort:Ip,validateSignalName:Ap,validateString:xo,validateUint32:Fu,validateUndefined:Cp,validateUnion:Np,validateAbortSignal:Lp,validateLinkHeaderValue:kp}});var Ze=b((gE,Wu)=>{var C=Wu.exports={},we,ge;function To(){throw new Error("setTimeout has not been defined")}function Ao(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?we=setTimeout:we=To}catch{we=To}try{typeof clearTimeout=="function"?ge=clearTimeout:ge=Ao}catch{ge=Ao}})();function $u(t){if(we===setTimeout)return setTimeout(t,0);if((we===To||!we)&&setTimeout)return we=setTimeout,setTimeout(t,0);try{return we(t,0)}catch{try{return we.call(null,t,0)}catch{return we.call(this,t,0)}}}function Dp(t){if(ge===clearTimeout)return clearTimeout(t);if((ge===Ao||!ge)&&clearTimeout)return ge=clearTimeout,clearTimeout(t);try{return ge(t)}catch{try{return ge.call(null,t)}catch{return ge.call(this,t)}}}var Me=[],Xt=!1,xt,An=-1;function Up(){!Xt||!xt||(Xt=!1,xt.length?Me=xt.concat(Me):An=-1,Me.length&&ju())}function ju(){if(!Xt){var t=$u(Up);Xt=!0;for(var e=Me.length;e;){for(xt=Me,Me=[];++An<e;)xt&&xt[An].run();An=-1,e=Me.length}xt=null,Xt=!1,Dp(t)}}C.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];Me.push(new Vu(t,e)),Me.length===1&&!Xt&&$u(ju)};function Vu(t,e){this.fun=t,this.array=e}Vu.prototype.run=function(){this.fun.apply(null,this.array)};C.title="browser";C.browser=!0;C.env={};C.argv=[];C.version="";C.versions={};function ke(){}C.on=ke;C.addListener=ke;C.once=ke;C.off=ke;C.removeListener=ke;C.removeAllListeners=ke;C.emit=ke;C.prependListener=ke;C.prependOnceListener=ke;C.listeners=function(t){return[]};C.binding=function(t){throw new Error("process.binding is not supported")};C.cwd=function(){return"/"};C.chdir=function(t){throw new Error("process.chdir is not supported")};C.umask=function(){return 0}});var Ee=b((mE,af)=>{"use strict";var{Symbol:Rn,SymbolAsyncIterator:Ku,SymbolIterator:Gu,SymbolFor:Hu}=k(),zu=Rn("kDestroyed"),Yu=Rn("kIsErrored"),Ro=Rn("kIsReadable"),Ju=Rn("kIsDisturbed"),Fp=Hu("nodejs.webstream.isClosedPromise"),Pp=Hu("nodejs.webstream.controllerErrorFunction");function vn(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 In(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 qp(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 Xu(t){return!!(t&&!me(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function Zu(t){return!!(t&&!me(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function Qu(t){return!!(t&&!me(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function $p(t){return Xu(t)||Zu(t)||Qu(t)}function jp(t,e){return t==null?!1:e===!0?typeof t[Ku]=="function":e===!1?typeof t[Gu]=="function":typeof t[Ku]=="function"||typeof t[Gu]=="function"}function Ln(t){if(!me(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!!(t.destroyed||t[zu]||n!=null&&n.destroyed)}function ef(t){if(!In(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 Vp(t,e){if(!In(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 Wp(t){if(!vn(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 tf(t,e){if(!vn(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 rf(t){return t&&t[Ro]!=null?t[Ro]:typeof t?.readable!="boolean"?null:Ln(t)?!1:vn(t)&&t.readable&&!tf(t)}function nf(t){return typeof t?.writable!="boolean"?null:Ln(t)?!1:In(t)&&t.writable&&!ef(t)}function Kp(t,e){return me(t)?Ln(t)?!0:!(e?.readable!==!1&&rf(t)||e?.writable!==!1&&nf(t)):null}function Gp(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 Hp(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 zp(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"&&of(t)?t._closed:null}function of(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function sf(t){return typeof t._sent100=="boolean"&&of(t)}function Yp(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 Jp(t){if(!me(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!n&&sf(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function Xp(t){var e;return!!(t&&((e=t[Ju])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function Zp(t){var e,r,n,i,o,s,a,u,f,c;return!!(t&&((e=(r=(n=(i=(o=(s=t[Yu])!==null&&s!==void 0?s:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&i!==void 0?i:(a=t._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&n!==void 0?n:(u=t._writableState)===null||u===void 0?void 0:u.errorEmitted)!==null&&r!==void 0?r:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((c=t._writableState)===null||c===void 0)&&c.errored))}af.exports={kDestroyed:zu,isDisturbed:Xp,kIsDisturbed:Ju,isErrored:Zp,kIsErrored:Yu,isReadable:rf,kIsReadable:Ro,kIsClosedPromise:Fp,kControllerErrorFunction:Pp,isClosed:zp,isDestroyed:Ln,isDuplexNodeStream:qp,isFinished:Kp,isIterable:jp,isReadableNodeStream:vn,isReadableStream:Xu,isReadableEnded:Wp,isReadableFinished:tf,isReadableErrored:Hp,isNodeStream:me,isWebStream:$p,isWritable:nf,isWritableNodeStream:In,isWritableStream:Zu,isWritableEnded:ef,isWritableFinished:Vp,isWritableErrored:Gp,isServerRequest:Yp,isServerResponse:sf,willEmitClose:Jp,isTransformStream:Qu}});var De=b((EE,Oo)=>{var Qe=Ze(),{AbortError:bf,codes:Qp}=j(),{ERR_INVALID_ARG_TYPE:ey,ERR_STREAM_PREMATURE_CLOSE:uf}=Qp,{kEmptyObject:Io,once:Lo}=be(),{validateAbortSignal:ty,validateFunction:ry,validateObject:ny,validateBoolean:iy}=Br(),{Promise:oy,PromisePrototypeThen:sy}=k(),{isClosed:ay,isReadable:ff,isReadableNodeStream:vo,isReadableStream:uy,isReadableFinished:lf,isReadableErrored:cf,isWritable:df,isWritableNodeStream:hf,isWritableStream:fy,isWritableFinished:pf,isWritableErrored:yf,isNodeStream:ly,willEmitClose:cy,kIsClosedPromise:dy}=Ee();function hy(t){return t.setHeader&&typeof t.abort=="function"}var Bo=()=>{};function wf(t,e,r){var n,i;if(arguments.length===2?(r=e,e=Io):e==null?e=Io:ny(e,"options"),ry(r,"callback"),ty(e.signal,"options.signal"),r=Lo(r),uy(t)||fy(t))return py(t,e,r);if(!ly(t))throw new ey("stream",["ReadableStream","WritableStream","Stream"],t);let o=(n=e.readable)!==null&&n!==void 0?n:vo(t),s=(i=e.writable)!==null&&i!==void 0?i:hf(t),a=t._writableState,u=t._readableState,f=()=>{t.writable||p()},c=cy(t)&&vo(t)===o&&hf(t)===s,l=pf(t,!1),p=()=>{l=!0,t.destroyed&&(c=!1),!(c&&(!t.readable||o))&&(!o||y)&&r.call(t)},y=lf(t,!1),h=()=>{y=!0,t.destroyed&&(c=!1),!(c&&(!t.writable||s))&&(!s||l)&&r.call(t)},g=I=>{r.call(t,I)},S=ay(t),E=()=>{S=!0;let I=yf(t)||cf(t);if(I&&typeof I!="boolean")return r.call(t,I);if(o&&!y&&vo(t,!0)&&!lf(t,!1))return r.call(t,new uf);if(s&&!l&&!pf(t,!1))return r.call(t,new uf);r.call(t)},m=()=>{S=!0;let I=yf(t)||cf(t);if(I&&typeof I!="boolean")return r.call(t,I);r.call(t)},w=()=>{t.req.on("finish",p)};hy(t)?(t.on("complete",p),c||t.on("abort",E),t.req?w():t.on("request",w)):s&&!a&&(t.on("end",f),t.on("close",f)),!c&&typeof t.aborted=="boolean"&&t.on("aborted",E),t.on("end",h),t.on("finish",p),e.error!==!1&&t.on("error",g),t.on("close",E),S?Qe.nextTick(E):a!=null&&a.errorEmitted||u!=null&&u.errorEmitted?c||Qe.nextTick(m):(!o&&(!c||ff(t))&&(l||df(t)===!1)||!s&&(!c||df(t))&&(y||ff(t)===!1)||u&&t.req&&t.aborted)&&Qe.nextTick(m);let R=()=>{r=Bo,t.removeListener("aborted",E),t.removeListener("complete",p),t.removeListener("abort",E),t.removeListener("request",w),t.req&&t.req.removeListener("finish",p),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",p),t.removeListener("end",h),t.removeListener("error",g),t.removeListener("close",E)};if(e.signal&&!S){let I=()=>{let B=r;R(),B.call(t,new bf(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)Qe.nextTick(I);else{let B=r;r=Lo((...U)=>{e.signal.removeEventListener("abort",I),B.apply(t,U)}),e.signal.addEventListener("abort",I)}}return R}function py(t,e,r){let n=!1,i=Bo;if(e.signal)if(i=()=>{n=!0,r.call(t,new bf(void 0,{cause:e.signal.reason}))},e.signal.aborted)Qe.nextTick(i);else{let s=r;r=Lo((...a)=>{e.signal.removeEventListener("abort",i),s.apply(t,a)}),e.signal.addEventListener("abort",i)}let o=(...s)=>{n||Qe.nextTick(()=>r.apply(t,s))};return sy(t[dy].promise,o,o),Bo}function yy(t,e){var r;let n=!1;return e===null&&(e=Io),(r=e)!==null&&r!==void 0&&r.cleanup&&(iy(e.cleanup,"cleanup"),n=e.cleanup),new oy((i,o)=>{let s=wf(t,e,a=>{n&&s(),a?o(a):i()})})}Oo.exports=wf;Oo.exports.finished=yy});var St=b((_E,Af)=>{"use strict";var _e=Ze(),{aggregateTwoErrors:by,codes:{ERR_MULTIPLE_CALLBACK:wy},AbortError:gy}=j(),{Symbol:Ef}=k(),{kDestroyed:my,isDestroyed:Ey,isFinished:_y,isServerRequest:xy}=Ee(),_f=Ef("kDestroy"),Co=Ef("kConstruct");function xf(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function Sy(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?gf(this,t,e):this.once(_f,function(o){gf(this,by(o,t),e)}),this)}function gf(t,e,r){let n=!1;function i(o){if(n)return;n=!0;let s=t._readableState,a=t._writableState;xf(o,a,s),a&&(a.closed=!0),s&&(s.closed=!0),typeof r=="function"&&r(o),o?_e.nextTick(Ty,t,o):_e.nextTick(Sf,t)}try{t._destroy(e||null,i)}catch(o){i(o)}}function Ty(t,e){No(t,e),Sf(t)}function Sf(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 No(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 Ay(){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 Mo(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?_e.nextTick(No,t,e):No(t,e))}function Ry(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(Co,e),!(t.listenerCount(Co)>1)&&_e.nextTick(vy,t)}function vy(t){let e=!1;function r(n){if(e){Mo(t,n??new wy);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(_f,n):n?Mo(t,n,!0):_e.nextTick(Iy,t)}try{t._construct(n=>{_e.nextTick(r,n)})}catch(n){_e.nextTick(r,n)}}function Iy(t){t.emit(Co)}function mf(t){return t?.setHeader&&typeof t.abort=="function"}function Tf(t){t.emit("close")}function Ly(t,e){t.emit("error",e),_e.nextTick(Tf,t)}function By(t,e){!t||Ey(t)||(!e&&!_y(t)&&(e=new gy),xy(t)?(t.socket=null,t.destroy(e)):mf(t)?t.abort():mf(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?_e.nextTick(Ly,t,e):_e.nextTick(Tf,t),t.destroyed||(t[my]=!0))}Af.exports={construct:Ry,destroyer:By,destroy:Sy,undestroy:Ay,errorOrDestroy:Mo}});var Cn=b((xE,vf)=>{"use strict";var{ArrayIsArray:Oy,ObjectSetPrototypeOf:Rf}=k(),{EventEmitter:Bn}=hr();function On(t){Bn.call(this,t)}Rf(On.prototype,Bn.prototype);Rf(On,Bn);On.prototype.pipe=function(t,e){let r=this;function n(c){t.writable&&t.write(c)===!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",a));let o=!1;function s(){o||(o=!0,t.end())}function a(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}function u(c){f(),Bn.listenerCount(this,"error")===0&&this.emit("error",c)}ko(r,"error",u),ko(t,"error",u);function f(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",a),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t};function ko(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Oy(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}vf.exports={Stream:On,prependListener:ko}});var Or=b((SE,Nn)=>{"use strict";var{AbortError:If,codes:Cy}=j(),{isNodeStream:Lf,isWebStream:Ny,kControllerErrorFunction:My}=Ee(),ky=De(),{ERR_INVALID_ARG_TYPE:Bf}=Cy,Dy=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new Bf(e,"AbortSignal",t)};Nn.exports.addAbortSignal=function(e,r){if(Dy(e,"signal"),!Lf(r)&&!Ny(r))throw new Bf("stream",["ReadableStream","WritableStream","Stream"],r);return Nn.exports.addAbortSignalNoValidate(e,r)};Nn.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=Lf(e)?()=>{e.destroy(new If(void 0,{cause:t.reason}))}:()=>{e[My](new If(void 0,{cause:t.reason}))};return t.aborted?r():(t.addEventListener("abort",r),ky(e,()=>t.removeEventListener("abort",r))),e}});var Nf=b((AE,Cf)=>{"use strict";var{StringPrototypeSlice:Of,SymbolIterator:Uy,TypedArrayPrototypeSet:Mn,Uint8Array:Fy}=k(),{Buffer:Do}=Q(),{inspect:Py}=be();Cf.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 Do.alloc(0);let r=Do.allocUnsafe(e>>>0),n=this.head,i=0;for(;n;)Mn(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}*[Uy](){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+=Of(o,0,e),this.head=n,n.data=Of(o,e));break}++i}while((n=n.next)!==null);return this.length-=i,r}_getBuffer(e){let r=Do.allocUnsafe(e),n=e,i=this.head,o=0;do{let s=i.data;if(e>s.length)Mn(r,s,n-e),e-=s.length;else{e===s.length?(Mn(r,s,n-e),++o,i.next?this.head=i.next:this.head=this.tail=null):(Mn(r,new Fy(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 Py(this,{...r,depth:0,customInspect:!1})}}});var kn=b((RE,kf)=>{"use strict";var{MathFloor:qy,NumberIsInteger:$y}=k(),{ERR_INVALID_ARG_VALUE:jy}=j().codes;function Vy(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Mf(t){return t?16:16*1024}function Wy(t,e,r,n){let i=Vy(e,n,r);if(i!=null){if(!$y(i)||i<0){let o=n?`options.${r}`:"options.highWaterMark";throw new jy(o,i)}return qy(i)}return Mf(t.objectMode)}kf.exports={getHighWaterMark:Wy,getDefaultHighWaterMark:Mf}});var Ff=b((Uo,Uf)=>{var Dn=Q(),xe=Dn.Buffer;function Df(t,e){for(var r in t)e[r]=t[r]}xe.from&&xe.alloc&&xe.allocUnsafe&&xe.allocUnsafeSlow?Uf.exports=Dn:(Df(Dn,Uo),Uo.Buffer=Tt);function Tt(t,e,r){return xe(t,e,r)}Tt.prototype=Object.create(xe.prototype);Df(xe,Tt);Tt.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return xe(t,e,r)};Tt.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=xe(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Tt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return xe(t)};Tt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Dn.SlowBuffer(t)}});var $f=b(qf=>{"use strict";var Po=Ff().Buffer,Pf=Po.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 Ky(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 Gy(t){var e=Ky(t);if(typeof e!="string"&&(Po.isEncoding===Pf||!Pf(t)))throw new Error("Unknown encoding: "+t);return e||t}qf.StringDecoder=Cr;function Cr(t){this.encoding=Gy(t);var e;switch(this.encoding){case"utf16le":this.text=Zy,this.end=Qy,e=4;break;case"utf8":this.fillLast=Yy,e=4;break;case"base64":this.text=eb,this.end=tb,e=3;break;default:this.write=rb,this.end=nb;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Po.allocUnsafe(e)}Cr.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||""};Cr.prototype.end=Xy;Cr.prototype.text=Jy;Cr.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 Fo(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function Hy(t,e,r){var n=e.length-1;if(n<r)return 0;var i=Fo(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=Fo(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=Fo(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function zy(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 Yy(t){var e=this.lastTotal-this.lastNeed,r=zy(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 Jy(t,e){var r=Hy(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 Xy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function Zy(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 Qy(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 eb(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 tb(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function rb(t){return t.toString(this.encoding)}function nb(t){return t&&t.length?this.write(t):""}});var qo=b((IE,Kf)=>{"use strict";var jf=Ze(),{PromisePrototypeThen:ib,SymbolAsyncIterator:Vf,SymbolIterator:Wf}=k(),{Buffer:ob}=Q(),{ERR_INVALID_ARG_TYPE:sb,ERR_STREAM_NULL_VALUES:ab}=j().codes;function ub(t,e,r){let n;if(typeof e=="string"||e instanceof ob)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null)}});let i;if(e&&e[Vf])i=!0,n=e[Vf]();else if(e&&e[Wf])i=!1,n=e[Wf]();else throw new sb("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...r}),s=!1;o._read=function(){s||(s=!0,u())},o._destroy=function(f,c){ib(a(f),()=>jf.nextTick(c,f),l=>jf.nextTick(c,l||f))};async function a(f){let c=f!=null,l=typeof n.throw=="function";if(c&&l){let{value:p,done:y}=await n.throw(f);if(await p,y)return}if(typeof n.return=="function"){let{value:p}=await n.return();await p}}async function u(){for(;;){try{let{value:f,done:c}=i?await n.next():n.next();if(c)o.push(null);else{let l=f&&typeof f.then=="function"?await f:f;if(l===null)throw s=!1,new ab;if(o.push(l))continue;s=!1}}catch(f){o.destroy(f)}break}}return o}Kf.exports=ub});var Nr=b((LE,il)=>{var ue=Ze(),{ArrayPrototypeIndexOf:fb,NumberIsInteger:lb,NumberIsNaN:cb,NumberParseInt:db,ObjectDefineProperties:zf,ObjectKeys:hb,ObjectSetPrototypeOf:Yf,Promise:pb,SafeSet:yb,SymbolAsyncIterator:bb,Symbol:wb}=k();il.exports=x;x.ReadableState=Go;var{EventEmitter:gb}=hr(),{Stream:et,prependListener:mb}=Cn(),{Buffer:$o}=Q(),{addAbortSignal:Eb}=Or(),_b=De(),A=be().debuglog("stream",t=>{A=t}),xb=Nf(),Qt=St(),{getHighWaterMark:Sb,getDefaultHighWaterMark:Tb}=kn(),{aggregateTwoErrors:Gf,codes:{ERR_INVALID_ARG_TYPE:Ab,ERR_METHOD_NOT_IMPLEMENTED:Rb,ERR_OUT_OF_RANGE:vb,ERR_STREAM_PUSH_AFTER_EOF:Ib,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Lb}}=j(),{validateObject:Bb}=Br(),At=wb("kPaused"),{StringDecoder:Jf}=$f(),Ob=qo();Yf(x.prototype,et.prototype);Yf(x,et);var jo=()=>{},{errorOrDestroy:Zt}=Qt;function Go(t,e,r){typeof r!="boolean"&&(r=e instanceof Se()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.readableObjectMode)),this.highWaterMark=t?Sb(this,t,"readableHighWaterMark",r):Tb(!1),this.buffer=new xb,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[At]=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 x(t){if(!(this instanceof x))return new x(t);let e=this instanceof Se();this._readableState=new Go(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&&Eb(t.signal,this)),et.call(this,t),Qt.construct(this,()=>{this._readableState.needReadable&&Un(this,this._readableState)})}x.prototype.destroy=Qt.destroy;x.prototype._undestroy=Qt.undestroy;x.prototype._destroy=function(t,e){e(t)};x.prototype[gb.captureRejectionSymbol]=function(t){this.destroy(t)};x.prototype.push=function(t,e){return Xf(this,t,e,!1)};x.prototype.unshift=function(t,e){return Xf(this,t,e,!0)};function Xf(t,e,r,n){A("readableAddChunk",e);let i=t._readableState,o;if(i.objectMode||(typeof e=="string"?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?e=$o.from(e,r).toString(i.encoding):(e=$o.from(e,r),r=""))):e instanceof $o?r="":et._isUint8Array(e)?(e=et._uint8ArrayToBuffer(e),r=""):e!=null&&(o=new Ab("chunk",["string","Buffer","Uint8Array"],e))),o)Zt(t,o);else if(e===null)i.reading=!1,Mb(t,i);else if(i.objectMode||e&&e.length>0)if(n)if(i.endEmitted)Zt(t,new Lb);else{if(i.destroyed||i.errored)return!1;Vo(t,i,e,!0)}else if(i.ended)Zt(t,new Ib);else{if(i.destroyed||i.errored)return!1;i.reading=!1,i.decoder&&!r?(e=i.decoder.write(e),i.objectMode||e.length!==0?Vo(t,i,e,!1):Un(t,i)):Vo(t,i,e,!1)}else n||(i.reading=!1,Un(t,i));return!i.ended&&(i.length<i.highWaterMark||i.length===0)}function Vo(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&&Fn(t)),Un(t,e)}x.prototype.isPaused=function(){let t=this._readableState;return t[At]===!0||t.flowing===!1};x.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 Cb=1073741824;function Nb(t){if(t>Cb)throw new vb("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function Hf(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:cb(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}x.prototype.read=function(t){A("read",t),t===void 0?t=NaN:lb(t)||(t=db(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=Nb(t)),t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return A("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Wo(this):Fn(this),null;if(t=Hf(t,e),t===0&&e.ended)return e.length===0&&Wo(this),null;let n=e.needReadable;if(A("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,A("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,A("reading, ended or constructing",n);else if(n){A("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0);try{this._read(e.highWaterMark)}catch(o){Zt(this,o)}e.sync=!1,e.reading||(t=Hf(r,e))}let i;return t>0?i=rl(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&&Wo(this)),i!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",i)),i};function Mb(t,e){if(A("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?Fn(t):(e.needReadable=!1,e.emittedReadable=!0,Zf(t))}}function Fn(t){let e=t._readableState;A("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(A("emitReadable",e.flowing),e.emittedReadable=!0,ue.nextTick(Zf,t))}function Zf(t){let e=t._readableState;A("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,el(t)}function Un(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,ue.nextTick(kb,t,e))}function kb(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(A("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}x.prototype._read=function(t){throw new Rb("_read()")};x.prototype.pipe=function(t,e){let r=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new yb(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),A("pipe count=%d opts=%j",n.pipes.length,e);let o=(!e||e.end!==!1)&&t!==ue.stdout&&t!==ue.stderr?a:S;n.endEmitted?ue.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(E,m){A("onunpipe"),E===r&&m&&m.hasUnpiped===!1&&(m.hasUnpiped=!0,c())}function a(){A("onend"),t.end()}let u,f=!1;function c(){A("cleanup"),t.removeListener("close",h),t.removeListener("finish",g),u&&t.removeListener("drain",u),t.removeListener("error",y),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",S),r.removeListener("data",p),f=!0,u&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&u()}function l(){f||(n.pipes.length===1&&n.pipes[0]===t?(A("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(A("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),r.pause()),u||(u=Db(r,t),t.on("drain",u))}r.on("data",p);function p(E){A("ondata");let m=t.write(E);A("dest.write",m),m===!1&&l()}function y(E){if(A("onerror",E),S(),t.removeListener("error",y),t.listenerCount("error")===0){let m=t._writableState||t._readableState;m&&!m.errorEmitted?Zt(t,E):t.emit("error",E)}}mb(t,"error",y);function h(){t.removeListener("finish",g),S()}t.once("close",h);function g(){A("onfinish"),t.removeListener("close",h),S()}t.once("finish",g);function S(){A("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?n.flowing&&l():n.flowing||(A("pipe resume"),r.resume()),t};function Db(t,e){return function(){let n=t._readableState;n.awaitDrainWriters===e?(A("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(A("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}x.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=fb(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};x.prototype.on=function(t,e){let r=et.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,A("on readable",n.length,n.reading),n.length?Fn(this):n.reading||ue.nextTick(Ub,this)),r};x.prototype.addListener=x.prototype.on;x.prototype.removeListener=function(t,e){let r=et.prototype.removeListener.call(this,t,e);return t==="readable"&&ue.nextTick(Qf,this),r};x.prototype.off=x.prototype.removeListener;x.prototype.removeAllListeners=function(t){let e=et.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&ue.nextTick(Qf,this),e};function Qf(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[At]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function Ub(t){A("readable nexttick read 0"),t.read(0)}x.prototype.resume=function(){let t=this._readableState;return t.flowing||(A("resume"),t.flowing=!t.readableListening,Fb(this,t)),t[At]=!1,this};function Fb(t,e){e.resumeScheduled||(e.resumeScheduled=!0,ue.nextTick(Pb,t,e))}function Pb(t,e){A("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),el(t),e.flowing&&!e.reading&&t.read(0)}x.prototype.pause=function(){return A("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(A("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[At]=!0,this};function el(t){let e=t._readableState;for(A("flow",e.flowing);e.flowing&&t.read()!==null;);}x.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=>{Zt(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=hb(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};x.prototype[bb]=function(){return tl(this)};x.prototype.iterator=function(t){return t!==void 0&&Bb(t,"options"),tl(this,t)};function tl(t,e){typeof t.read!="function"&&(t=x.wrap(t,{objectMode:!0}));let r=qb(t,e);return r.stream=t,r}async function*qb(t,e){let r=jo;function n(s){this===t?(r(),r=jo):r=s}t.on("readable",n);let i,o=_b(t,{writable:!1},s=>{i=s?Gf(i,s):null,r(),r=jo});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 pb(n)}}}catch(s){throw i=Gf(i,s),i}finally{(i||e?.destroyOnReturn!==!1)&&(i===void 0||t._readableState.autoDestroy)?Qt.destroyer(t,null):(t.off("readable",n),o())}}zf(x.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}}});zf(Go.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[At]!==!1},set(t){this[At]=!!t}}});x._fromList=rl;function rl(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 Wo(t){let e=t._readableState;A("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,ue.nextTick($b,e,t))}function $b(t,e){if(A("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)ue.nextTick(jb,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function jb(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}x.from=function(t,e){return Ob(x,t,e)};var Ko;function nl(){return Ko===void 0&&(Ko={}),Ko}x.fromWeb=function(t,e){return nl().newStreamReadableFromReadableStream(t,e)};x.toWeb=function(t,e){return nl().newReadableStreamFromStreamReadable(t,e)};x.wrap=function(t,e){var r,n;return new x({objectMode:(r=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(i,o){Qt.destroyer(t,i),o(i)}}).wrap(t)}});var Qo=b((BE,bl)=>{var Rt=Ze(),{ArrayPrototypeSlice:al,Error:Vb,FunctionPrototypeSymbolHasInstance:ul,ObjectDefineProperty:fl,ObjectDefineProperties:Wb,ObjectSetPrototypeOf:ll,StringPrototypeToLowerCase:Kb,Symbol:Gb,SymbolHasInstance:Hb}=k();bl.exports=O;O.WritableState=Dr;var{EventEmitter:zb}=hr(),Mr=Cn().Stream,{Buffer:Pn}=Q(),jn=St(),{addAbortSignal:Yb}=Or(),{getHighWaterMark:Jb,getDefaultHighWaterMark:Xb}=kn(),{ERR_INVALID_ARG_TYPE:Zb,ERR_METHOD_NOT_IMPLEMENTED:Qb,ERR_MULTIPLE_CALLBACK:cl,ERR_STREAM_CANNOT_PIPE:ew,ERR_STREAM_DESTROYED:kr,ERR_STREAM_ALREADY_FINISHED:tw,ERR_STREAM_NULL_VALUES:rw,ERR_STREAM_WRITE_AFTER_END:nw,ERR_UNKNOWN_ENCODING:dl}=j().codes,{errorOrDestroy:er}=jn;ll(O.prototype,Mr.prototype);ll(O,Mr);function Yo(){}var tr=Gb("kOnFinished");function Dr(t,e,r){typeof r!="boolean"&&(r=e instanceof Se()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?Jb(this,t,"writableHighWaterMark",r):Xb(!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=ow.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,$n(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[tr]=[]}function $n(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}Dr.prototype.getBuffer=function(){return al(this.buffered,this.bufferedIndex)};fl(Dr.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function O(t){let e=this instanceof Se();if(!e&&!ul(O,this))return new O(t);this._writableState=new Dr(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&&Yb(t.signal,this)),Mr.call(this,t),jn.construct(this,()=>{let r=this._writableState;r.writing||Xo(this,r),Zo(this,r)})}fl(O,Hb,{__proto__:null,value:function(t){return ul(this,t)?!0:this!==O?!1:t&&t._writableState instanceof Dr}});O.prototype.pipe=function(){er(this,new ew)};function hl(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"&&!Pn.isEncoding(r))throw new dl(r);typeof n!="function"&&(n=Yo)}if(e===null)throw new rw;if(!i.objectMode)if(typeof e=="string")i.decodeStrings!==!1&&(e=Pn.from(e,r),r="buffer");else if(e instanceof Pn)r="buffer";else if(Mr._isUint8Array(e))e=Mr._uint8ArrayToBuffer(e),r="buffer";else throw new Zb("chunk",["string","Buffer","Uint8Array"],e);let o;return i.ending?o=new nw:i.destroyed&&(o=new kr("write")),o?(Rt.nextTick(n,o),er(t,o,!0),o):(i.pendingcb++,iw(t,i,e,r,n))}O.prototype.write=function(t,e,r){return hl(this,t,e,r)===!0};O.prototype.cork=function(){this._writableState.corked++};O.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Xo(this,t))};O.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=Kb(e)),!Pn.isEncoding(e))throw new dl(e);return this._writableState.defaultEncoding=e,this};function iw(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!==Yo&&(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 ol(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new kr("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function sl(t,e,r,n){--e.pendingcb,n(r),Jo(e),er(t,r)}function ow(t,e){let r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function"){er(t,new cl);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?Rt.nextTick(sl,t,r,e,i):sl(t,r,e,i)):(r.buffered.length>r.bufferedIndex&&Xo(t,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:t,state:r},Rt.nextTick(sw,r.afterWriteTickInfo)):pl(t,r,1,i))}function sw({stream:t,state:e,count:r,cb:n}){return e.afterWriteTickInfo=null,pl(t,e,r,n)}function pl(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&&Jo(e),Zo(t,e)}function Jo(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],a=t.objectMode?1:o.length;t.length-=a,s((e=t.errored)!==null&&e!==void 0?e:new kr("write"))}let r=t[tr].splice(0);for(let i=0;i<r.length;i++){var n;r[i]((n=t.errored)!==null&&n!==void 0?n:new kr("end"))}$n(t)}function Xo(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 a=e.allNoop?Yo:f=>{for(let c=s;c<r.length;++c)r[c].callback(f)},u=e.allNoop&&s===0?r:al(r,s);u.allBuffers=e.allBuffers,ol(t,e,!0,e.length,u,"",a),$n(e)}else{do{let{chunk:a,encoding:u,callback:f}=r[s];r[s++]=null;let c=i?1:a.length;ol(t,e,!1,c,a,u,f)}while(s<r.length&&!e.writing);s===r.length?$n(e):s>256?(r.splice(0,s),e.bufferedIndex=0):e.bufferedIndex=s}e.bufferProcessing=!1}O.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new Qb("_write()")};O.prototype._writev=null;O.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=hl(this,t,e);o instanceof Vb&&(i=o)}return n.corked&&(n.corked=1,this.uncork()),i||(!n.errored&&!n.ending?(n.ending=!0,Zo(this,n,!0),n.ended=!0):n.finished?i=new tw("end"):n.destroyed&&(i=new kr("end"))),typeof r=="function"&&(i||n.finished?Rt.nextTick(r,i):n[tr].push(r)),this};function qn(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 aw(t,e){let r=!1;function n(i){if(r){er(t,i??cl());return}if(r=!0,e.pendingcb--,i){let o=e[tr].splice(0);for(let s=0;s<o.length;s++)o[s](i);er(t,i,e.sync)}else qn(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,Rt.nextTick(zo,t,e))}e.sync=!0,e.pendingcb++;try{t._final(n)}catch(i){n(i)}e.sync=!1}function uw(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,aw(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function Zo(t,e,r){qn(e)&&(uw(t,e),e.pendingcb===0&&(r?(e.pendingcb++,Rt.nextTick((n,i)=>{qn(i)?zo(n,i):i.pendingcb--},t,e)):qn(e)&&(e.pendingcb++,zo(t,e))))}function zo(t,e){e.pendingcb--,e.finished=!0;let r=e[tr].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()}}Wb(O.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 fw=jn.destroy;O.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[tr].length)&&Rt.nextTick(Jo,r),fw.call(this,t,e),this};O.prototype._undestroy=jn.undestroy;O.prototype._destroy=function(t,e){e(t)};O.prototype[zb.captureRejectionSymbol]=function(t){this.destroy(t)};var Ho;function yl(){return Ho===void 0&&(Ho={}),Ho}O.fromWeb=function(t,e){return yl().newStreamWritableFromWritableStream(t,e)};O.toWeb=function(t){return yl().newWritableStreamFromStreamWritable(t)}});var Il=b((OE,vl)=>{var es=Ze(),lw=Q(),{isReadable:cw,isWritable:dw,isIterable:wl,isNodeStream:hw,isReadableNodeStream:gl,isWritableNodeStream:ml,isDuplexNodeStream:pw}=Ee(),El=De(),{AbortError:Rl,codes:{ERR_INVALID_ARG_TYPE:yw,ERR_INVALID_RETURN_VALUE:_l}}=j(),{destroyer:rr}=St(),bw=Se(),ww=Nr(),{createDeferredPromise:xl}=be(),Sl=qo(),Tl=globalThis.Blob||lw.Blob,gw=typeof Tl<"u"?function(e){return e instanceof Tl}:function(e){return!1},mw=globalThis.AbortController||xn().AbortController,{FunctionPrototypeCall:Al}=k(),vt=class extends bw{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)}};vl.exports=function t(e,r){if(pw(e))return e;if(gl(e))return Vn({readable:e});if(ml(e))return Vn({writable:e});if(hw(e))return Vn({writable:!1,readable:!1});if(typeof e=="function"){let{value:i,write:o,final:s,destroy:a}=Ew(e);if(wl(i))return Sl(vt,i,{objectMode:!0,write:o,final:s,destroy:a});let u=i?.then;if(typeof u=="function"){let f,c=Al(u,i,l=>{if(l!=null)throw new _l("nully","body",l)},l=>{rr(f,l)});return f=new vt({objectMode:!0,readable:!1,write:o,final(l){s(async()=>{try{await c,es.nextTick(l,null)}catch(p){es.nextTick(l,p)}})},destroy:a})}throw new _l("Iterable, AsyncIterable or AsyncFunction",r,i)}if(gw(e))return t(e.arrayBuffer());if(wl(e))return Sl(vt,e,{objectMode:!0,writable:!1});if(typeof e?.writable=="object"||typeof e?.readable=="object"){let i=e!=null&&e.readable?gl(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?ml(e?.writable)?e?.writable:t(e.writable):void 0;return Vn({readable:i,writable:o})}let n=e?.then;if(typeof n=="function"){let i;return Al(n,e,o=>{o!=null&&i.push(o),i.push(null)},o=>{rr(i,o)}),i=new vt({objectMode:!0,writable:!1,read(){}})}throw new yw(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function Ew(t){let{promise:e,resolve:r}=xl(),n=new mw,i=n.signal;return{value:t(async function*(){for(;;){let s=e;e=null;let{chunk:a,done:u,cb:f}=await s;if(es.nextTick(f),u)return;if(i.aborted)throw new Rl(void 0,{cause:i.reason});({promise:e,resolve:r}=xl()),yield a}}(),{signal:i}),write(s,a,u){let f=r;r=null,f({chunk:s,done:!1,cb:u})},final(s){let a=r;r=null,a({done:!0,cb:s})},destroy(s,a){n.abort(),a(s)}}}function Vn(t){let e=t.readable&&typeof t.readable.read!="function"?ww.wrap(t.readable):t.readable,r=t.writable,n=!!cw(e),i=!!dw(r),o,s,a,u,f;function c(l){let p=u;u=null,p?p(l):l&&f.destroy(l)}return f=new vt({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:i}),i&&(El(r,l=>{i=!1,l&&rr(e,l),c(l)}),f._write=function(l,p,y){r.write(l,p)?y():o=y},f._final=function(l){r.end(),s=l},r.on("drain",function(){if(o){let l=o;o=null,l()}}),r.on("finish",function(){if(s){let l=s;s=null,l()}})),n&&(El(e,l=>{n=!1,l&&rr(e,l),c(l)}),e.on("readable",function(){if(a){let l=a;a=null,l()}}),e.on("end",function(){f.push(null)}),f._read=function(){for(;;){let l=e.read();if(l===null){a=f._read;return}if(!f.push(l))return}}),f._destroy=function(l,p){!l&&u!==null&&(l=new Rl),a=null,o=null,s=null,u===null?p(l):(u=p,rr(r,l),rr(e,l))},f}});var Se=b((CE,Ol)=>{"use strict";var{ObjectDefineProperties:_w,ObjectGetOwnPropertyDescriptor:Ue,ObjectKeys:xw,ObjectSetPrototypeOf:Ll}=k();Ol.exports=fe;var ns=Nr(),ne=Qo();Ll(fe.prototype,ns.prototype);Ll(fe,ns);{let t=xw(ne.prototype);for(let e=0;e<t.length;e++){let r=t[e];fe.prototype[r]||(fe.prototype[r]=ne.prototype[r])}}function fe(t){if(!(this instanceof fe))return new fe(t);ns.call(this,t),ne.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}_w(fe.prototype,{writable:{__proto__:null,...Ue(ne.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Ue(ne.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Ue(ne.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Ue(ne.prototype,"writableBuffer")},writableLength:{__proto__:null,...Ue(ne.prototype,"writableLength")},writableFinished:{__proto__:null,...Ue(ne.prototype,"writableFinished")},writableCorked:{__proto__:null,...Ue(ne.prototype,"writableCorked")},writableEnded:{__proto__:null,...Ue(ne.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Ue(ne.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 ts;function Bl(){return ts===void 0&&(ts={}),ts}fe.fromWeb=function(t,e){return Bl().newStreamDuplexFromReadableWritablePair(t,e)};fe.toWeb=function(t){return Bl().newReadableWritablePairFromDuplex(t)};var rs;fe.from=function(t){return rs||(rs=Il()),rs(t,"body")}});var ss=b((NE,Nl)=>{"use strict";var{ObjectSetPrototypeOf:Cl,Symbol:Sw}=k();Nl.exports=Fe;var{ERR_METHOD_NOT_IMPLEMENTED:Tw}=j().codes,os=Se(),{getHighWaterMark:Aw}=kn();Cl(Fe.prototype,os.prototype);Cl(Fe,os);var Ur=Sw("kCallback");function Fe(t){if(!(this instanceof Fe))return new Fe(t);let e=t?Aw(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),os.call(this,t),this._readableState.sync=!1,this[Ur]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Rw)}function is(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 Rw(){this._final!==is&&is.call(this)}Fe.prototype._final=is;Fe.prototype._transform=function(t,e,r){throw new Tw("_transform()")};Fe.prototype._write=function(t,e,r){let n=this._readableState,i=this._writableState,o=n.length;this._transform(t,e,(s,a)=>{if(s){r(s);return}a!=null&&this.push(a),i.ended||o===n.length||n.length<n.highWaterMark?r():this[Ur]=r})};Fe.prototype._read=function(){if(this[Ur]){let t=this[Ur];this[Ur]=null,t()}}});var us=b((ME,kl)=>{"use strict";var{ObjectSetPrototypeOf:Ml}=k();kl.exports=nr;var as=ss();Ml(nr.prototype,as.prototype);Ml(nr,as);function nr(t){if(!(this instanceof nr))return new nr(t);as.call(this,t)}nr.prototype._transform=function(t,e,r){r(null,t)}});var Hn=b((kE,ql)=>{var Fr=Ze(),{ArrayIsArray:vw,Promise:Iw,SymbolAsyncIterator:Lw}=k(),Gn=De(),{once:Bw}=be(),Ow=St(),Dl=Se(),{aggregateTwoErrors:Cw,codes:{ERR_INVALID_ARG_TYPE:bs,ERR_INVALID_RETURN_VALUE:fs,ERR_MISSING_ARGS:Nw,ERR_STREAM_DESTROYED:Mw,ERR_STREAM_PREMATURE_CLOSE:kw},AbortError:Dw}=j(),{validateFunction:Uw,validateAbortSignal:Fw}=Br(),{isIterable:It,isReadable:ls,isReadableNodeStream:Kn,isNodeStream:Ul,isTransformStream:ir,isWebStream:Pw,isReadableStream:cs,isReadableEnded:qw}=Ee(),$w=globalThis.AbortController||xn().AbortController,ds,hs;function Fl(t,e,r){let n=!1;t.on("close",()=>{n=!0});let i=Gn(t,{readable:e,writable:r},o=>{n=!o});return{destroy:o=>{n||(n=!0,Ow.destroyer(t,o||new Mw("pipe")))},cleanup:i}}function jw(t){return Uw(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function ps(t){if(It(t))return t;if(Kn(t))return Vw(t);throw new bs("val",["Readable","Iterable","AsyncIterable"],t)}async function*Vw(t){hs||(hs=Nr()),yield*hs.prototype[Lw].call(t)}async function Wn(t,e,r,{end:n}){let i,o=null,s=f=>{if(f&&(i=f),o){let c=o;o=null,c()}},a=()=>new Iw((f,c)=>{i?c(i):o=()=>{i?c(i):f()}});e.on("drain",s);let u=Gn(e,{readable:!1},s);try{e.writableNeedDrain&&await a();for await(let f of t)e.write(f)||await a();n&&e.end(),await a(),r()}catch(f){r(i!==f?Cw(i,f):f)}finally{u(),e.off("drain",s)}}async function ys(t,e,r,{end:n}){ir(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 Ww(...t){return Pl(t,Bw(jw(t)))}function Pl(t,e,r){if(t.length===1&&vw(t[0])&&(t=t[0]),t.length<2)throw new Nw("streams");let n=new $w,i=n.signal,o=r?.signal,s=[];Fw(o,"options.signal");function a(){y(new Dw)}o?.addEventListener("abort",a);let u,f,c=[],l=0;function p(m){y(m,--l===0)}function y(m,w){if(m&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=m),!(!u&&!w)){for(;c.length;)c.shift()(u);o?.removeEventListener("abort",a),n.abort(),w&&(u||s.forEach(R=>R()),Fr.nextTick(e,u,f))}}let h;for(let m=0;m<t.length;m++){let w=t[m],R=m<t.length-1,I=m>0,B=R||r?.end!==!1,U=m===t.length-1;if(Ul(w)){let L=function(W){W&&W.name!=="AbortError"&&W.code!=="ERR_STREAM_PREMATURE_CLOSE"&&p(W)};var E=L;if(B){let{destroy:W,cleanup:Zn}=Fl(w,R,I);c.push(W),ls(w)&&U&&s.push(Zn)}w.on("error",L),ls(w)&&U&&s.push(()=>{w.removeListener("error",L)})}if(m===0)if(typeof w=="function"){if(h=w({signal:i}),!It(h))throw new fs("Iterable, AsyncIterable or Stream","source",h)}else It(w)||Kn(w)||ir(w)?h=w:h=Dl.from(w);else if(typeof w=="function"){if(ir(h)){var g;h=ps((g=h)===null||g===void 0?void 0:g.readable)}else h=ps(h);if(h=w(h,{signal:i}),R){if(!It(h,!0))throw new fs("AsyncIterable",`transform[${m-1}]`,h)}else{var S;ds||(ds=us());let L=new ds({objectMode:!0}),W=(S=h)===null||S===void 0?void 0:S.then;if(typeof W=="function")l++,W.call(h,qe=>{f=qe,qe!=null&&L.write(qe),B&&L.end(),Fr.nextTick(p)},qe=>{L.destroy(qe),Fr.nextTick(p,qe)});else if(It(h,!0))l++,Wn(h,L,p,{end:B});else if(cs(h)||ir(h)){let qe=h.readable||h;l++,Wn(qe,L,p,{end:B})}else throw new fs("AsyncIterable or Promise","destination",h);h=L;let{destroy:Zn,cleanup:hc}=Fl(h,!1,!0);c.push(Zn),U&&s.push(hc)}}else if(Ul(w)){if(Kn(h)){l+=2;let L=Kw(h,w,p,{end:B});ls(w)&&U&&s.push(L)}else if(ir(h)||cs(h)){let L=h.readable||h;l++,Wn(L,w,p,{end:B})}else if(It(h))l++,Wn(h,w,p,{end:B});else throw new bs("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],h);h=w}else if(Pw(w)){if(Kn(h))l++,ys(ps(h),w,p,{end:B});else if(cs(h)||It(h))l++,ys(h,w,p,{end:B});else if(ir(h))l++,ys(h.readable,w,p,{end:B});else throw new bs("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],h);h=w}else h=Dl.from(w)}return(i!=null&&i.aborted||o!=null&&o.aborted)&&Fr.nextTick(a),h}function Kw(t,e,r,{end:n}){let i=!1;if(e.on("close",()=>{i||r(new kw)}),t.pipe(e,{end:!1}),n){let s=function(){i=!0,e.end()};var o=s;qw(t)?Fr.nextTick(s):t.once("end",s)}else r();return Gn(t,{readable:!0,writable:!1},s=>{let a=t._readableState;s&&s.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?t.once("end",r).once("error",r):r(s)}),Gn(e,{readable:!1,writable:!0},r)}ql.exports={pipelineImpl:Pl,pipeline:Ww}});var gs=b((DE,Gl)=>{"use strict";var{pipeline:Gw}=Hn(),zn=Se(),{destroyer:Hw}=St(),{isNodeStream:Yn,isReadable:$l,isWritable:jl,isWebStream:ws,isTransformStream:Lt,isWritableStream:Vl,isReadableStream:Wl}=Ee(),{AbortError:zw,codes:{ERR_INVALID_ARG_VALUE:Kl,ERR_MISSING_ARGS:Yw}}=j(),Jw=De();Gl.exports=function(...e){if(e.length===0)throw new Yw("streams");if(e.length===1)return zn.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=zn.from(e[0])),typeof e[e.length-1]=="function"){let y=e.length-1;e[y]=zn.from(e[y])}for(let y=0;y<e.length;++y)if(!(!Yn(e[y])&&!ws(e[y]))){if(y<e.length-1&&!($l(e[y])||Wl(e[y])||Lt(e[y])))throw new Kl(`streams[${y}]`,r[y],"must be readable");if(y>0&&!(jl(e[y])||Vl(e[y])||Lt(e[y])))throw new Kl(`streams[${y}]`,r[y],"must be writable")}let n,i,o,s,a;function u(y){let h=s;s=null,h?h(y):y?a.destroy(y):!p&&!l&&a.destroy()}let f=e[0],c=Gw(e,u),l=!!(jl(f)||Vl(f)||Lt(f)),p=!!($l(c)||Wl(c)||Lt(c));if(a=new zn({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(c!=null&&c.writableObjectMode),writable:l,readable:p}),l){if(Yn(f))a._write=function(h,g,S){f.write(h,g)?S():n=S},a._final=function(h){f.end(),i=h},f.on("drain",function(){if(n){let h=n;n=null,h()}});else if(ws(f)){let g=(Lt(f)?f.writable:f).getWriter();a._write=async function(S,E,m){try{await g.ready,g.write(S).catch(()=>{}),m()}catch(w){m(w)}},a._final=async function(S){try{await g.ready,g.close().catch(()=>{}),i=S}catch(E){S(E)}}}let y=Lt(c)?c.readable:c;Jw(y,()=>{if(i){let h=i;i=null,h()}})}if(p){if(Yn(c))c.on("readable",function(){if(o){let y=o;o=null,y()}}),c.on("end",function(){a.push(null)}),a._read=function(){for(;;){let y=c.read();if(y===null){o=a._read;return}if(!a.push(y))return}};else if(ws(c)){let h=(Lt(c)?c.readable:c).getReader();a._read=async function(){for(;;)try{let{value:g,done:S}=await h.read();if(!a.push(g))return;if(S){a.push(null);return}}catch{return}}}}return a._destroy=function(y,h){!y&&s!==null&&(y=new zw),o=null,n=null,i=null,s===null?h(y):(s=h,Yn(c)&&Hw(c,y))},a}});var ec=b((UE,_s)=>{"use strict";var Jl=globalThis.AbortController||xn().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Xw,ERR_INVALID_ARG_TYPE:Pr,ERR_MISSING_ARGS:Zw,ERR_OUT_OF_RANGE:Qw},AbortError:Te}=j(),{validateAbortSignal:Bt,validateInteger:eg,validateObject:Ot}=Br(),tg=k().Symbol("kWeak"),{finished:rg}=De(),ng=gs(),{addAbortSignalNoValidate:ig}=Or(),{isWritable:og,isNodeStream:sg}=Ee(),{ArrayPrototypePush:ag,MathFloor:ug,Number:fg,NumberIsNaN:lg,Promise:Hl,PromiseReject:zl,PromisePrototypeThen:cg,Symbol:Xl}=k(),Jn=Xl("kEmpty"),Yl=Xl("kEof");function dg(t,e){if(e!=null&&Ot(e,"options"),e?.signal!=null&&Bt(e.signal,"options.signal"),sg(t)&&!og(t))throw new Xw("stream",t,"must be writable");let r=ng(this,t);return e!=null&&e.signal&&ig(e.signal,r),r}function Xn(t,e){if(typeof t!="function")throw new Pr("fn",["Function","AsyncFunction"],t);e!=null&&Ot(e,"options"),e?.signal!=null&&Bt(e.signal,"options.signal");let r=1;return e?.concurrency!=null&&(r=ug(e.concurrency)),eg(r,"concurrency",1),(async function*(){var i,o;let s=new Jl,a=this,u=[],f=s.signal,c={signal:f},l=()=>s.abort();e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted&&l(),e==null||(o=e.signal)===null||o===void 0||o.addEventListener("abort",l);let p,y,h=!1;function g(){h=!0}async function S(){try{for await(let w of a){var E;if(h)return;if(f.aborted)throw new Te;try{w=t(w,c)}catch(R){w=zl(R)}w!==Jn&&(typeof((E=w)===null||E===void 0?void 0:E.catch)=="function"&&w.catch(g),u.push(w),p&&(p(),p=null),!h&&u.length&&u.length>=r&&await new Hl(R=>{y=R}))}u.push(Yl)}catch(w){let R=zl(w);cg(R,void 0,g),u.push(R)}finally{var m;h=!0,p&&(p(),p=null),e==null||(m=e.signal)===null||m===void 0||m.removeEventListener("abort",l)}}S();try{for(;;){for(;u.length>0;){let E=await u[0];if(E===Yl)return;if(f.aborted)throw new Te;E!==Jn&&(yield E),u.shift(),y&&(y(),y=null)}await new Hl(E=>{p=E})}}finally{s.abort(),h=!0,y&&(y(),y=null)}}).call(this)}function hg(t=void 0){return t!=null&&Ot(t,"options"),t?.signal!=null&&Bt(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 Te({cause:t.signal.reason});yield[r++,i]}}).call(this)}async function Zl(t,e=void 0){for await(let r of Es.call(this,t,e))return!0;return!1}async function pg(t,e=void 0){if(typeof t!="function")throw new Pr("fn",["Function","AsyncFunction"],t);return!await Zl.call(this,async(...r)=>!await t(...r),e)}async function yg(t,e){for await(let r of Es.call(this,t,e))return r}async function bg(t,e){if(typeof t!="function")throw new Pr("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i),Jn}for await(let n of Xn.call(this,r,e));}function Es(t,e){if(typeof t!="function")throw new Pr("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i)?n:Jn}return Xn.call(this,r,e)}var ms=class extends Zw{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function wg(t,e,r){var n;if(typeof t!="function")throw new Pr("reducer",["Function","AsyncFunction"],t);r!=null&&Ot(r,"options"),r?.signal!=null&&Bt(r.signal,"options.signal");let i=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let f=new Te(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await rg(this.destroy(f)),f}let o=new Jl,s=o.signal;if(r!=null&&r.signal){let f={once:!0,[tg]:this};r.signal.addEventListener("abort",()=>o.abort(),f)}let a=!1;try{for await(let f of this){var u;if(a=!0,r!=null&&(u=r.signal)!==null&&u!==void 0&&u.aborted)throw new Te;i?e=await t(e,f,{signal:s}):(e=f,i=!0)}if(!a&&!i)throw new ms}finally{o.abort()}return e}async function gg(t){t!=null&&Ot(t,"options"),t?.signal!=null&&Bt(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 Te(void 0,{cause:t.signal.reason});ag(e,n)}return e}function mg(t,e){let r=Xn.call(this,t,e);return(async function*(){for await(let i of r)yield*i}).call(this)}function Ql(t){if(t=fg(t),lg(t))return 0;if(t<0)throw new Qw("number",">= 0",t);return t}function Eg(t,e=void 0){return e!=null&&Ot(e,"options"),e?.signal!=null&&Bt(e.signal,"options.signal"),t=Ql(t),(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Te;for await(let o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Te;t--<=0&&(yield o)}}).call(this)}function _g(t,e=void 0){return e!=null&&Ot(e,"options"),e?.signal!=null&&Bt(e.signal,"options.signal"),t=Ql(t),(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Te;for await(let o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Te;if(t-- >0)yield o;else return}}).call(this)}_s.exports.streamReturningOperators={asIndexedPairs:hg,drop:Eg,filter:Es,flatMap:mg,map:Xn,take:_g,compose:dg};_s.exports.promiseReturningOperators={every:pg,forEach:bg,reduce:wg,toArray:gg,some:Zl,find:yg}});var xs=b((FE,tc)=>{"use strict";var{ArrayPrototypePop:xg,Promise:Sg}=k(),{isIterable:Tg,isNodeStream:Ag,isWebStream:Rg}=Ee(),{pipelineImpl:vg}=Hn(),{finished:Ig}=De();Ss();function Lg(...t){return new Sg((e,r)=>{let n,i,o=t[t.length-1];if(o&&typeof o=="object"&&!Ag(o)&&!Tg(o)&&!Rg(o)){let s=xg(t);n=s.signal,i=s.end}vg(t,(s,a)=>{s?r(s):e(a)},{signal:n,end:i})})}tc.exports={finished:Ig,pipeline:Lg}});var Ss=b((PE,lc)=>{var{Buffer:Bg}=Q(),{ObjectDefineProperty:Pe,ObjectKeys:ic,ReflectApply:oc}=k(),{promisify:{custom:sc}}=be(),{streamReturningOperators:rc,promiseReturningOperators:nc}=ec(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:ac}}=j(),Og=gs(),{pipeline:uc}=Hn(),{destroyer:Cg}=St(),fc=De(),Ts=xs(),As=Ee(),N=lc.exports=Cn().Stream;N.isDisturbed=As.isDisturbed;N.isErrored=As.isErrored;N.isReadable=As.isReadable;N.Readable=Nr();for(let t of ic(rc)){let r=function(...n){if(new.target)throw ac();return N.Readable.from(oc(e,this,n))};Rs=r;let e=rc[t];Pe(r,"name",{__proto__:null,value:e.name}),Pe(r,"length",{__proto__:null,value:e.length}),Pe(N.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var Rs;for(let t of ic(nc)){let r=function(...i){if(new.target)throw ac();return oc(e,this,i)};Rs=r;let e=nc[t];Pe(r,"name",{__proto__:null,value:e.name}),Pe(r,"length",{__proto__:null,value:e.length}),Pe(N.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var Rs;N.Writable=Qo();N.Duplex=Se();N.Transform=ss();N.PassThrough=us();N.pipeline=uc;var{addAbortSignal:Ng}=Or();N.addAbortSignal=Ng;N.finished=fc;N.destroy=Cg;N.compose=Og;Pe(N,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Ts}});Pe(uc,sc,{__proto__:null,enumerable:!0,get(){return Ts.pipeline}});Pe(fc,sc,{__proto__:null,enumerable:!0,get(){return Ts.finished}});N.Stream=N;N._isUint8Array=function(e){return e instanceof Uint8Array};N._uint8ArrayToBuffer=function(e){return Bg.from(e.buffer,e.byteOffset,e.byteLength)}});var vs=b((qE,M)=>{"use strict";var D=Ss(),Mg=xs(),kg=D.Readable.destroy;M.exports=D.Readable;M.exports._uint8ArrayToBuffer=D._uint8ArrayToBuffer;M.exports._isUint8Array=D._isUint8Array;M.exports.isDisturbed=D.isDisturbed;M.exports.isErrored=D.isErrored;M.exports.isReadable=D.isReadable;M.exports.Readable=D.Readable;M.exports.Writable=D.Writable;M.exports.Duplex=D.Duplex;M.exports.Transform=D.Transform;M.exports.PassThrough=D.PassThrough;M.exports.addAbortSignal=D.addAbortSignal;M.exports.finished=D.finished;M.exports.destroy=D.destroy;M.exports.destroy=kg;M.exports.pipeline=D.pipeline;M.exports.compose=D.compose;Object.defineProperty(D,"promises",{configurable:!0,enumerable:!0,get(){return Mg}});M.exports.Stream=D.Stream;M.exports.default=M.exports});var Sc=qr(Ls(),1);function Tc(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 a=t.length,u=t.charAt(0),f=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function l(h){if(h instanceof Uint8Array||(ArrayBuffer.isView(h)?h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength):Array.isArray(h)&&(h=Uint8Array.from(h))),!(h instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(h.length===0)return"";for(var g=0,S=0,E=0,m=h.length;E!==m&&h[E]===0;)E++,g++;for(var w=(m-E)*c+1>>>0,R=new Uint8Array(w);E!==m;){for(var I=h[E],B=0,U=w-1;(I!==0||B<S)&&U!==-1;U--,B++)I+=256*R[U]>>>0,R[U]=I%a>>>0,I=I/a>>>0;if(I!==0)throw new Error("Non-zero carry");S=B,E++}for(var L=w-S;L!==w&&R[L]===0;)L++;for(var W=u.repeat(g);L<w;++L)W+=t.charAt(R[L]);return W}function p(h){if(typeof h!="string")throw new TypeError("Expected String");if(h.length===0)return new Uint8Array;var g=0;if(h[g]!==" "){for(var S=0,E=0;h[g]===u;)S++,g++;for(var m=(h.length-g)*f+1>>>0,w=new Uint8Array(m);h[g];){var R=r[h.charCodeAt(g)];if(R===255)return;for(var I=0,B=m-1;(R!==0||I<E)&&B!==-1;B--,I++)R+=a*w[B]>>>0,w[B]=R%256>>>0,R=R/256>>>0;if(R!==0)throw new Error("Non-zero carry");E=I,g++}if(h[g]!==" "){for(var U=m-E;U!==m&&w[U]===0;)U++;for(var L=new Uint8Array(S+(m-U)),W=S;U!==m;)L[W++]=w[U++];return L}}}function y(h){var g=p(h);if(g)return g;throw new Error(`Non-${e} character`)}return{encode:l,decodeUnsafe:p,decode:y}}var Ac=Tc,Rc=Ac,Bs=Rc;var $g=new Uint8Array(0);var Os=(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},Ct=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 ri=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")}},ni=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 Cs(this,e)}},ii=class{constructor(e){this.decoders=e}or(e){return Cs(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`)}},Cs=(t,e)=>new ii({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),oi=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ri(e,r,n),this.decoder=new ni(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Ns=({name:t,prefix:e,encode:r,decode:n})=>new oi(t,e,r,n),si=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=Bs(r,e);return Ns({prefix:t,name:e,encode:n,decode:o=>Ct(i(o))})},Ic=(t,e,r,n)=>{let i={};for(let c=0;c<e.length;++c)i[e[c]]=c;let o=t.length;for(;t[o-1]==="=";)--o;let s=new Uint8Array(o*r/8|0),a=0,u=0,f=0;for(let c=0;c<o;++c){let l=i[t[c]];if(l===void 0)throw new SyntaxError(`Non-${n} character`);u=u<<r|l,a+=r,a>=8&&(a-=8,s[f++]=255&u>>a)}if(a>=r||255&u<<8-a)throw new SyntaxError("Unexpected end of data");return s},Lc=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<<r)-1,o="",s=0,a=0;for(let u=0;u<t.length;++u)for(a=a<<8|t[u],s+=8;s>r;)s-=r,o+=e[i&a>>s];if(s&&(o+=e[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o},$=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Ns({prefix:e,name:t,encode(i){return Lc(i,n,r)},decode(i){return Ic(i,n,r,t)}});var or=$({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Gg=$({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Hg=$({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),zg=$({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Yg=$({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Jg=$({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Xg=$({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Zg=$({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ai=$({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var K=si({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),tm=si({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var im=$({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),om=$({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),le=$({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),sm=$({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function Ms(t){return t.byteOffset!==0||t.byteLength!==t.buffer.byteLength}function ks(t){return typeof t!="object"||t===null?!1:typeof t[Symbol.asyncIterator]=="function"}function um(t){return t!==null&&typeof t<"u"}function ui(t){let r=Object.prototype.toString.call(t).match(/\s([a-zA-Z0-9]+)/),[n,i]=r;return i}var jr=new TextEncoder,tt=new TextDecoder,G=class t{constructor(e,r){this.data=e,this.format=r}static arrayBuffer(e){return new t(e,"ArrayBuffer")}static asyncIterable(e){if(!ks(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 K.baseDecode(this.data).buffer;case"Base64Url":return le.baseDecode(this.data).buffer;case"BufferSource":{if(ui(this.data)==="ArrayBuffer")return this.data;if(ArrayBuffer.isView(this.data))return Ms(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.`)}}async toArrayBufferAsync(){switch(this.format){case"AsyncIterable":return await(await this.toBlobAsync()).arrayBuffer();default:throw new TypeError(`Asynchronous conversion from ${this.format} to ArrayBuffer is not supported.`)}}toBase32Z(){switch(this.format){case"Uint8Array":return ai.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 K.baseEncode(e)}case"Multibase":return this.data.substring(1);case"Uint8Array":return K.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 le.baseEncode(e)}case"BufferSource":{let e=this.toUint8Array();return le.baseEncode(e)}case"Object":{let e=JSON.stringify(this.data),r=jr.encode(e);return le.baseEncode(r)}case"String":{let e=jr.encode(this.data);return le.baseEncode(e)}case"Uint8Array":return le.baseEncode(this.data);default:throw new TypeError(`Conversion from ${this.format} to Base64Url is not supported.`)}}async toBlobAsync(){switch(this.format){case"AsyncIterable":{let e=[];for await(let n of this.data)e.push(n);return new Blob(e)}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=le.baseDecode(this.data),r=tt.decode(e);return JSON.parse(r)}case"String":return JSON.parse(this.data);case"Uint8Array":{let e=tt.decode(this.data);return JSON.parse(e)}default:throw new TypeError(`Conversion from ${this.format} to Object is not supported.`)}}async toObjectAsync(){switch(this.format){case"AsyncIterable":{let e=await 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 tt.decode(this.data);case"Base64Url":{let e=le.baseDecode(this.data);return tt.decode(e)}case"Object":return JSON.stringify(this.data);case"Uint8Array":return tt.decode(this.data);default:throw new TypeError(`Conversion from ${this.format} to String is not supported.`)}}async toStringAsync(){switch(this.format){case"AsyncIterable":{let e="";for await(let r of this.data)typeof r=="string"?e+=r:e+=tt.decode(r,{stream:!0});return e+=tt.decode(void 0,{stream:!1}),e}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 ai.baseDecode(this.data);case"Base58Btc":return K.baseDecode(this.data);case"Base64Url":return le.baseDecode(this.data);case"BufferSource":{let e=ui(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 jr.encode(e)}case"String":return jr.encode(this.data);default:throw new TypeError(`Conversion from ${this.format} to Uint8Array is not supported.`)}}async toUint8ArrayAsync(){switch(this.format){case"AsyncIterable":{let e=await this.toArrayBufferAsync();return new Uint8Array(e)}default:throw new TypeError(`Asynchronous conversion from ${this.format} to Uint8Array is not supported.`)}}};var Ae={};mc(Ae,{decode:()=>Nt,encodeTo:()=>rt,encodingLength:()=>nt});var Bc=Fs,Ds=128,Oc=127,Cc=~Oc,Nc=Math.pow(2,31);function Fs(t,e,r){e=e||[],r=r||0;for(var n=r;t>=Nc;)e[r++]=t&255|Ds,t/=128;for(;t&Cc;)e[r++]=t&255|Ds,t>>>=7;return e[r]=t|0,Fs.bytes=r-n+1,e}var Mc=fi,kc=128,Us=127;function fi(t,n){var r=0,n=n||0,i=0,o=n,s,a=t.length;do{if(o>=a)throw fi.bytes=0,new RangeError("Could not decode varint");s=t[o++],r+=i<28?(s&Us)<<i:(s&Us)*Math.pow(2,i),i+=7}while(s>=kc);return fi.bytes=o-n,r}var Dc=Math.pow(2,7),Uc=Math.pow(2,14),Fc=Math.pow(2,21),Pc=Math.pow(2,28),qc=Math.pow(2,35),$c=Math.pow(2,42),jc=Math.pow(2,49),Vc=Math.pow(2,56),Wc=Math.pow(2,63),Kc=function(t){return t<Dc?1:t<Uc?2:t<Fc?3:t<Pc?4:t<qc?5:t<$c?6:t<jc?7:t<Vc?8:t<Wc?9:10},Gc={encode:Bc,decode:Mc,encodingLength:Kc},Hc=Gc,sr=Hc;var Nt=(t,e=0)=>[sr.decode(t,e),sr.decode.bytes],rt=(t,e,r=0)=>(sr.encode(t,e,r),e),nt=t=>sr.encodingLength(t);var li=(t,e)=>{let r=e.byteLength,n=nt(t),i=n+nt(r),o=new Uint8Array(i+r);return rt(t,o,0),rt(r,o,n),o.set(e,i),new Mt(t,r,e,o)},Ps=t=>{let e=Ct(t),[r,n]=Nt(e),[i,o]=Nt(e.subarray(n)),s=e.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new Mt(r,i,s,e)},qs=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&Os(t.bytes,r.bytes)}},Mt=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};var $s=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return Yc(r,di(t),e||K.encoder);default:return Jc(r,di(t),e||or.encoder)}};var js=new WeakMap,di=t=>{let e=js.get(t);if(e==null){let r=new Map;return js.set(t,r),r}return e},hi=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!==ar)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Xc)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=li(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&&qs(e.multihash,n.multihash)}toString(e){return $s(this,e)}toJSON(){return{"/":$s(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||Vs(n,i,o.bytes))}else if(r[Zc]===!0){let{version:n,multihash:i,code:o}=r,s=Ps(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!==ar)throw new Error(`Version 0 CID must use dag-pb (code: ${ar}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=Vs(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,ar,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=Ct(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 Mt(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[l,p]=Nt(e.subarray(r));return r+=p,l},i=n(),o=ar;if(i===18?(i=0,r=0):o=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=r,a=n(),u=n(),f=r+u,c=f-s;return{version:i,codec:o,multihashCode:a,digestSize:u,multihashSize:c,size:f}}static parse(e,r){let[n,i]=zc(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 di(o).set(n,e),o}},zc=(t,e)=>{switch(t[0]){case"Q":{let r=e||K;return[K.prefix,r.decode(`${K.prefix}${t}`)]}case K.prefix:{let r=e||K;return[K.prefix,r.decode(t)]}case or.prefix:{let r=e||or;return[or.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)]}}},Yc=(t,e,r)=>{let{prefix:n}=r;if(n!==K.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},Jc=(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},ar=112,Xc=18,Vs=(t,e,r)=>{let n=nt(t),i=n+nt(e),o=new Uint8Array(i+r.byteLength);return rt(t,o,0),rt(e,o,n),o.set(r,i),o},Zc=Symbol.for("@ipld/js-cid/CID");var ie=class ie{static addPrefix(e){let{code:r,data:n,name:i}=e;if(!(i?!r:r))throw new Error("Either 'name' or 'code' must be defined, but not both.");if(r=ie.codeToName.has(r)?r:ie.nameToCode.get(i),r===void 0)throw new Error(`Unsupported multicodec: ${e.name??e.code}`);let o=Ae.encodingLength(r),s=new Uint8Array(o+n.byteLength);return s.set(n,o),Ae.encodeTo(r,s),s}static getCodeFromData(e){let{prefixedData:r}=e,[n,i]=Ae.decode(r);return n}static getCodeFromName(e){let{name:r}=e,n=ie.nameToCode.get(r);if(n===void 0)throw new Error(`Unsupported multicodec: ${r}`);return n}static getNameFromCode(e){let{code:r}=e,n=ie.codeToName.get(r);if(n===void 0)throw new Error(`Unsupported multicodec: ${r}`);return n}static registerCodec(e){ie.codeToName.set(e.code,e.name),ie.nameToCode.set(e.name,e.code)}static removePrefix(e){let{prefixedData:r}=e,[n,i]=Ae.decode(r),o=ie.codeToName.get(n);if(o===void 0)throw new Error(`Unsupported multicodec: ${n}`);return{code:n,data:r.slice(i),name:o}}};ie.codeToName=new Map,ie.nameToCode=new Map;var $e=ie;$e.registerCodec({code:237,name:"ed25519-pub"});$e.registerCodec({code:4864,name:"ed25519-priv"});$e.registerCodec({code:236,name:"x25519-pub"});$e.registerCodec({code:4866,name:"x25519-priv"});$e.registerCodec({code:231,name:"secp256k1-pub"});$e.registerCodec({code:4865,name:"secp256k1-priv"});function ed(t){return typeof t!="object"||t===null||Object.getOwnPropertySymbols(t).length>0?!1:Object.keys(t).length===0}function td(t){Object.keys(t).forEach(e=>{typeof t[e]=="object"&&td(t[e]),ed(t[e])&&delete t[e]})}function rd(t){Object.keys(t).forEach(e=>{t[e]===void 0?delete t[e]:typeof t[e]=="object"&&rd(t[e])})}var Au=qr(xu(),1),Su=class{constructor({db:e,location:r="DATASTORE"}={}){this.store=e??new Au.Level(r)}async clear(){await this.store.clear()}async close(){await this.store.close()}async delete(e){await this.store.del(e)}async get(e){try{return await this.store.get(e)}catch(r){if(r.notFound)return;throw r}}async set(e,r){await this.store.put(e,r)}},Tu=class{constructor(){this.store=new Map}async clear(){this.store.clear()}async close(){}async delete(e){return this.store.delete(e)}async get(e){return this.store.get(e)}async has(e){return this.store.has(e)}async list(){return Array.from(this.store.values())}async set(e,r){this.store.set(e,r)}};var En=class t{static async*asAsyncIterator(e){let r=e.getReader();try{for(;;){let{done:n,value:i}=await r.read();if(n)break;yield i}}finally{r.releaseLock()}}static async consumeToArrayBuffer({readableStream:e}){let r=t.asAsyncIterator(e);return await G.asyncIterable(r).toArrayBufferAsync()}static async consumeToBlob({readableStream:e}){let r=t.asAsyncIterator(e);return await G.asyncIterable(r).toBlobAsync()}static async consumeToBytes({readableStream:e}){let r=t.asAsyncIterator(e);return await G.asyncIterable(r).toUint8ArrayAsync()}static async consumeToJson({readableStream:e}){let r=t.asAsyncIterator(e);return await G.asyncIterable(r).toObjectAsync()}static async consumeToText({readableStream:e}){let r=t.asAsyncIterator(e);return await G.asyncIterable(r).toStringAsync()}static generateByteStream({streamLength:e,chunkLength:r,fillValue:n}){let i=e??1/0,o;function s(){let a=Math.min(i,r??1/0);i-=a;let u;if(typeof n=="number")u=new Uint8Array(a).fill(n);else if(Array.isArray(n)){u=new Uint8Array(a);let[f,c]=n,l=c-f+1;for(let p=0;p<a;p++)u[p]=Math.floor(Math.random()*l)+f}else u=new Uint8Array(a);o.enqueue(u),i<=0&&o.close()}return new ReadableStream({start(a){o=a,s()},pull(){s()}})}static isReadable({readableStream:e}){if(!t.isReadableStream(e)||e.locked)return!1;try{return e.getReader().releaseLock(),!0}catch{return!1}}static isReadableStream(e){return typeof e=="object"&&e!==null&&"getReader"in e&&typeof e.getReader=="function"}static isStream(e){return t.isReadableStream(e)||t.isWritableStream(e)||t.isTransformStream(e)}static isTransformStream(e){return typeof e=="object"&&e!==null&&"readable"in e&&typeof e.readable=="object"&&"writable"in e&&typeof e.writable=="object"}static isWritableStream(e){return typeof e=="object"&&e!==null&&"getWriter"in e&&typeof e.getWriter=="function"&&"abort"in e&&typeof e.abort=="function"}};var dc=qr(vs(),1);var Dg=qr(vs(),1),cc=class t{static async consumeToArrayBuffer({readable:e}){return await G.asyncIterable(e).toArrayBufferAsync()}static async consumeToBlob({readable:e}){return await G.asyncIterable(e).toBlobAsync()}static async consumeToBytes({readable:e}){return await G.asyncIterable(e).toUint8ArrayAsync()}static async consumeToJson({readable:e}){return await G.asyncIterable(e).toObjectAsync()}static async consumeToText({readable:e}){return await G.asyncIterable(e).toStringAsync()}static fromWebReadable({readableStream:e,readableOptions:r}){if(!En.isReadableStream(e))throw new TypeError("NodeStream.fromWebReadable: 'readableStream' is not a Web ReadableStream.");let n=e.getReader(),i=!1,o=new dc.Readable({...r,read:function(){n.read().then(({done:s,value:a})=>{if(s)this.push(null);else if(!this.push(a))return}).catch(s=>{this.destroy(s)})},destroy:function(s,a){function u(){a(s)}if(!i){n.cancel(s).then(u).catch(u);return}u()}});return n.closed.then(()=>{i=!0}).catch(s=>{i=!0,o.destroy(s)}),o}static isDestroyed({stream:e}){if(!t.isStream(e))throw new TypeError("NodeStream.isDestroyed: 'stream' is not a Node stream.");let r="_writableState"in e?e._writableState:void 0,n=e._readableState,i=r||n;return!!(e.destroyed||i.destroyed)}static isReadable({readable:e}){return t.isReadableStream(e)?e.readable&&typeof e._readableState.ended=="boolean"&&!e._readableState.ended&&typeof e._readableState.endEmitted=="boolean"&&!e._readableState.endEmitted&&!e.destroyed&&!e.isPaused():!1}static isReadableStream(e){return typeof e=="object"&&e!==null&&"pipe"in e&&typeof e.pipe=="function"&&"on"in e&&typeof e.on=="function"&&!("_writableState"in e)&&"_readableState"in e}static isStream(e){return typeof e=="object"&&e!==null&&("_readableState"in e||"_writableState"in e)}static toWebReadable({readable:e}){if(!t.isReadableStream(e))throw new TypeError("NodeStream.toWebReadable: 'readable' is not a Node Readable stream.");if(t.isDestroyed({stream:e})){let r=new ReadableStream;return r.cancel(),r}return new ReadableStream({start(r){e.on("data",n=>{r.enqueue(n)}),e.on("end",()=>{r.close()}),e.on("error",n=>{r.error(n)})},cancel(){e.destroy()}})}};var export_Readable=Dg.Readable;var export_TtlCache=Sc.default;export{G as Convert,Su as LevelStore,Tu as MemoryStore,$e as Multicodec,cc as NodeStream,export_Readable as Readable,En as Stream,export_TtlCache as TtlCache,Ms as isArrayBufferSlice,ks as isAsyncIterable,um as isDefined,ed as isEmptyObject,td as removeEmptyObjects,rd as removeUndefinedProperties,ui as universalTypeOf};
|
|
/*! 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> *)
|
|
*/
|
|
//# sourceMappingURL=browser.mjs.map
|