UNPKG

@substrate-system/bittorrent-protocol

Version:

Simple, robust, BitTorrent peer wire protocol implementation

2 lines 2.36 MB
var IC=Object.create;var Mf=Object.defineProperty;var TC=Object.getOwnPropertyDescriptor;var PC=Object.getOwnPropertyNames;var CC=Object.getPrototypeOf,DC=Object.prototype.hasOwnProperty;var n=(u,d)=>Mf(u,"name",{value:d,configurable:!0});var vi=(u,d)=>()=>(u&&(d=u(u=0)),d);var ki=(u,d)=>()=>(d||u((d={exports:{}}).exports,d),d.exports),iu=(u,d)=>{for(var l in d)Mf(u,l,{get:d[l],enumerable:!0})},Yg=(u,d,l,g)=>{if(d&&typeof d=="object"||typeof d=="function")for(let o of PC(d))!DC.call(u,o)&&o!==l&&Mf(u,o,{get:()=>d[o],enumerable:!(g=TC(d,o))||g.enumerable});return u};var _f=(u,d,l)=>(l=u!=null?IC(CC(u)):{},Yg(d||!u||!u.__esModule?Mf(l,"default",{value:u,enumerable:!0}):l,u)),nu=u=>Yg(Mf({},"__esModule",{value:!0}),u);var me=vi(()=>{"use strict"});var We={};iu(We,{_debugEnd:()=>U4,_debugProcess:()=>O4,_events:()=>ry,_eventsCount:()=>iy,_exiting:()=>w4,_fatalExceptions:()=>D4,_getActiveHandles:()=>E4,_getActiveRequests:()=>S4,_kill:()=>x4,_linkedBinding:()=>g4,_maxListeners:()=>ey,_preload_modules:()=>J4,_rawDebug:()=>m4,_startProfilerIdleNotifier:()=>z4,_stopProfilerIdleNotifier:()=>F4,_tickCallback:()=>q4,abort:()=>j4,addListener:()=>ny,allowedNodeEnvironmentFlags:()=>T4,arch:()=>r4,argv:()=>a4,argv0:()=>Y4,assert:()=>P4,binding:()=>u4,browser:()=>v4,chdir:()=>c4,config:()=>M4,cpuUsage:()=>su,cwd:()=>d4,debugPort:()=>X4,default:()=>cy,dlopen:()=>_4,domain:()=>y4,emit:()=>fy,emitWarning:()=>f4,env:()=>n4,execArgv:()=>o4,execPath:()=>G4,exit:()=>$4,features:()=>C4,hasUncaughtExceptionCaptureCallback:()=>N4,hrtime:()=>ou,kill:()=>R4,listeners:()=>dy,memoryUsage:()=>k4,moduleLoadList:()=>b4,nextTick:()=>Qg,off:()=>oy,on:()=>no,once:()=>ay,openStdin:()=>I4,pid:()=>W4,platform:()=>i4,ppid:()=>V4,prependListener:()=>uy,prependOnceListener:()=>ly,reallyExit:()=>A4,release:()=>p4,removeAllListeners:()=>hy,removeListener:()=>sy,resourceUsage:()=>B4,setSourceMapsEnabled:()=>Q4,setUncaughtExceptionCaptureCallback:()=>L4,stderr:()=>K4,stdin:()=>Z4,stdout:()=>H4,title:()=>e4,umask:()=>l4,uptime:()=>ty,version:()=>s4,versions:()=>h4});function Bc(u){throw new Error("Node.js process "+u+" is not supported by JSPM core outside of Node.js")}function LC(){!_h||!ys||(_h=!1,ys.length?io=ys.concat(io):au=-1,io.length&&Jg())}function Jg(){if(!_h){var u=setTimeout(LC,0);_h=!0;for(var d=io.length;d;){for(ys=io,io=[];++au<d;)ys&&ys[au].run();au=-1,d=io.length}ys=null,_h=!1,clearTimeout(u)}}function Qg(u){var d=new Array(arguments.length-1);if(arguments.length>1)for(var l=1;l<arguments.length;l++)d[l-1]=arguments[l];io.push(new t4(u,d)),io.length===1&&!_h&&setTimeout(Jg,0)}function t4(u,d){this.fun=u,this.array=d}function Fi(){}function g4(u){Bc("_linkedBinding")}function _4(u){Bc("dlopen")}function S4(){return[]}function E4(){return[]}function P4(u,d){if(!u)throw new Error(d||"assertion error")}function N4(){return!1}function ty(){return Ro.now()/1e3}function ou(u){var d=Math.floor((Date.now()-Ro.now())*.001),l=Ro.now()*.001,g=Math.floor(l)+d,o=Math.floor(l%1*1e9);return u&&(g=g-u[0],o=o-u[1],o<0&&(g--,o+=xc)),[g,o]}function no(){return cy}function dy(u){return[]}var io,_h,ys,au,e4,r4,i4,n4,a4,o4,s4,h4,f4,u4,l4,d4,c4,p4,v4,m4,b4,y4,w4,M4,A4,x4,su,B4,k4,R4,$4,I4,T4,C4,D4,L4,q4,O4,U4,z4,F4,H4,K4,Z4,j4,W4,V4,G4,X4,Y4,J4,Q4,Ro,Ac,xc,ey,ry,iy,ny,ay,oy,sy,hy,fy,uy,ly,cy,py=vi(()=>{"use strict";me();ge();be();n(Bc,"unimplemented");io=[],_h=!1,au=-1;n(LC,"cleanUpNextTick");n(Jg,"drainQueue");n(Qg,"nextTick");n(t4,"Item");t4.prototype.run=function(){this.fun.apply(null,this.array)};e4="browser",r4="x64",i4="browser",n4={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},a4=["/usr/bin/node"],o4=[],s4="v16.8.0",h4={},f4=n(function(u,d){console.warn((d?d+": ":"")+u)},"emitWarning"),u4=n(function(u){Bc("binding")},"binding"),l4=n(function(u){return 0},"umask"),d4=n(function(){return"/"},"cwd"),c4=n(function(u){},"chdir"),p4={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};n(Fi,"noop");v4=!0,m4=Fi,b4=[];n(g4,"_linkedBinding");y4={},w4=!1,M4={};n(_4,"dlopen");n(S4,"_getActiveRequests");n(E4,"_getActiveHandles");A4=Fi,x4=Fi,su=n(function(){return{}},"cpuUsage"),B4=su,k4=su,R4=Fi,$4=Fi,I4=Fi,T4={};n(P4,"assert");C4={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},D4=Fi,L4=Fi;n(N4,"hasUncaughtExceptionCaptureCallback");q4=Fi,O4=Fi,U4=Fi,z4=Fi,F4=Fi,H4=void 0,K4=void 0,Z4=void 0,j4=Fi,W4=2,V4=1,G4="/bin/usr/node",X4=9229,Y4="node",J4=[],Q4=Fi,Ro={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Ro.now===void 0&&(Ac=Date.now(),Ro.timing&&Ro.timing.navigationStart&&(Ac=Ro.timing.navigationStart),Ro.now=()=>Date.now()-Ac);n(ty,"uptime");xc=1e9;n(ou,"hrtime");ou.bigint=function(u){var d=ou(u);return typeof BigInt>"u"?d[0]*xc+d[1]:BigInt(d[0]*xc)+BigInt(d[1])};ey=10,ry={},iy=0;n(no,"on");ny=no,ay=no,oy=no,sy=no,hy=no,fy=Fi,uy=no,ly=no;n(dy,"listeners");cy={version:s4,versions:h4,arch:r4,platform:i4,browser:v4,release:p4,_rawDebug:m4,moduleLoadList:b4,binding:u4,_linkedBinding:g4,_events:ry,_eventsCount:iy,_maxListeners:ey,on:no,addListener:ny,once:ay,off:oy,removeListener:sy,removeAllListeners:hy,emit:fy,prependListener:uy,prependOnceListener:ly,listeners:dy,domain:y4,_exiting:w4,config:M4,dlopen:_4,uptime:ty,_getActiveRequests:S4,_getActiveHandles:E4,reallyExit:A4,_kill:x4,cpuUsage:su,resourceUsage:B4,memoryUsage:k4,kill:R4,exit:$4,openStdin:I4,allowedNodeEnvironmentFlags:T4,assert:P4,features:C4,_fatalExceptions:D4,setUncaughtExceptionCaptureCallback:L4,hasUncaughtExceptionCaptureCallback:N4,emitWarning:f4,nextTick:Qg,_tickCallback:q4,_debugProcess:O4,_debugEnd:U4,_startProfilerIdleNotifier:z4,_stopProfilerIdleNotifier:F4,stdout:H4,stdin:Z4,stderr:K4,abort:j4,umask:l4,chdir:c4,cwd:d4,env:n4,title:e4,argv:a4,execArgv:o4,pid:W4,ppid:V4,execPath:G4,debugPort:X4,hrtime:ou,argv0:Y4,_preload_modules:J4,setSourceMapsEnabled:Q4}});var be=vi(()=>{"use strict";py()});function NC(){if(vy)return Sf;vy=!0,Sf.byteLength=M,Sf.toByteArray=w,Sf.fromByteArray=S;for(var u=[],d=[],l=typeof Uint8Array<"u"?Uint8Array:Array,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,b=g.length;o<b;++o)u[o]=g[o],d[g.charCodeAt(o)]=o;d[45]=62,d[95]=63;function y(x){var B=x.length;if(B%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var R=x.indexOf("=");R===-1&&(R=B);var T=R===B?0:4-R%4;return[R,T]}n(y,"getLens");function M(x){var B=y(x),R=B[0],T=B[1];return(R+T)*3/4-T}n(M,"byteLength");function _(x,B,R){return(B+R)*3/4-R}n(_,"_byteLength");function w(x){var B,R=y(x),T=R[0],$=R[1],C=new l(_(x,T,$)),D=0,Z=$>0?T-4:T,W;for(W=0;W<Z;W+=4)B=d[x.charCodeAt(W)]<<18|d[x.charCodeAt(W+1)]<<12|d[x.charCodeAt(W+2)]<<6|d[x.charCodeAt(W+3)],C[D++]=B>>16&255,C[D++]=B>>8&255,C[D++]=B&255;return $===2&&(B=d[x.charCodeAt(W)]<<2|d[x.charCodeAt(W+1)]>>4,C[D++]=B&255),$===1&&(B=d[x.charCodeAt(W)]<<10|d[x.charCodeAt(W+1)]<<4|d[x.charCodeAt(W+2)]>>2,C[D++]=B>>8&255,C[D++]=B&255),C}n(w,"toByteArray");function m(x){return u[x>>18&63]+u[x>>12&63]+u[x>>6&63]+u[x&63]}n(m,"tripletToBase64");function E(x,B,R){for(var T,$=[],C=B;C<R;C+=3)T=(x[C]<<16&16711680)+(x[C+1]<<8&65280)+(x[C+2]&255),$.push(m(T));return $.join("")}n(E,"encodeChunk");function S(x){for(var B,R=x.length,T=R%3,$=[],C=16383,D=0,Z=R-T;D<Z;D+=C)$.push(E(x,D,D+C>Z?Z:D+C));return T===1?(B=x[R-1],$.push(u[B>>2]+u[B<<4&63]+"==")):T===2&&(B=(x[R-2]<<8)+x[R-1],$.push(u[B>>10]+u[B>>4&63]+u[B<<2&63]+"=")),$.join("")}return n(S,"fromByteArray"),Sf}function qC(){if(my)return hu;my=!0;return hu.read=function(u,d,l,g,o){var b,y,M=o*8-g-1,_=(1<<M)-1,w=_>>1,m=-7,E=l?o-1:0,S=l?-1:1,x=u[d+E];for(E+=S,b=x&(1<<-m)-1,x>>=-m,m+=M;m>0;b=b*256+u[d+E],E+=S,m-=8);for(y=b&(1<<-m)-1,b>>=-m,m+=g;m>0;y=y*256+u[d+E],E+=S,m-=8);if(b===0)b=1-w;else{if(b===_)return y?NaN:(x?-1:1)*(1/0);y=y+Math.pow(2,g),b=b-w}return(x?-1:1)*y*Math.pow(2,b-g)},hu.write=function(u,d,l,g,o,b){var y,M,_,w=b*8-o-1,m=(1<<w)-1,E=m>>1,S=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=g?0:b-1,B=g?1:-1,R=d<0||d===0&&1/d<0?1:0;for(d=Math.abs(d),isNaN(d)||d===1/0?(M=isNaN(d)?1:0,y=m):(y=Math.floor(Math.log(d)/Math.LN2),d*(_=Math.pow(2,-y))<1&&(y--,_*=2),y+E>=1?d+=S/_:d+=S*Math.pow(2,1-E),d*_>=2&&(y++,_/=2),y+E>=m?(M=0,y=m):y+E>=1?(M=(d*_-1)*Math.pow(2,o),y=y+E):(M=d*Math.pow(2,E-1)*Math.pow(2,o),y=0));o>=8;u[l+x]=M&255,x+=B,M/=256,o-=8);for(y=y<<o|M,w+=o;w>0;u[l+x]=y&255,x+=B,y/=256,w-=8);u[l+x-B]|=R*128},hu}function ni(){if(by)return ws;by=!0;let u=NC(),d=qC(),l=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ws.Buffer=y,ws.SlowBuffer=$,ws.INSPECT_MAX_BYTES=50;let g=2147483647;ws.kMaxLength=g,y.TYPED_ARRAY_SUPPORT=o(),!y.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 o(){try{let U=new Uint8Array(1),P={foo:n(function(){return 42},"foo")};return Object.setPrototypeOf(P,Uint8Array.prototype),Object.setPrototypeOf(U,P),U.foo()===42}catch{return!1}}n(o,"typedArraySupport"),Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:n(function(){if(y.isBuffer(this))return this.buffer},"get")}),Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:n(function(){if(y.isBuffer(this))return this.byteOffset},"get")});function b(U){if(U>g)throw new RangeError('The value "'+U+'" is invalid for option "size"');let P=new Uint8Array(U);return Object.setPrototypeOf(P,y.prototype),P}n(b,"createBuffer");function y(U,P,O){if(typeof U=="number"){if(typeof P=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(U)}return M(U,P,O)}n(y,"Buffer"),y.poolSize=8192;function M(U,P,O){if(typeof U=="string")return E(U,P);if(ArrayBuffer.isView(U))return x(U);if(U==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U);if(ft(U,ArrayBuffer)||U&&ft(U.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ft(U,SharedArrayBuffer)||U&&ft(U.buffer,SharedArrayBuffer)))return B(U,P,O);if(typeof U=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let F=U.valueOf&&U.valueOf();if(F!=null&&F!==U)return y.from(F,P,O);let G=R(U);if(G)return G;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof U[Symbol.toPrimitive]=="function")return y.from(U[Symbol.toPrimitive]("string"),P,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U)}n(M,"from"),y.from=function(U,P,O){return M(U,P,O)},Object.setPrototypeOf(y.prototype,Uint8Array.prototype),Object.setPrototypeOf(y,Uint8Array);function _(U){if(typeof U!="number")throw new TypeError('"size" argument must be of type number');if(U<0)throw new RangeError('The value "'+U+'" is invalid for option "size"')}n(_,"assertSize");function w(U,P,O){return _(U),U<=0?b(U):P!==void 0?typeof O=="string"?b(U).fill(P,O):b(U).fill(P):b(U)}n(w,"alloc"),y.alloc=function(U,P,O){return w(U,P,O)};function m(U){return _(U),b(U<0?0:T(U)|0)}n(m,"allocUnsafe"),y.allocUnsafe=function(U){return m(U)},y.allocUnsafeSlow=function(U){return m(U)};function E(U,P){if((typeof P!="string"||P==="")&&(P="utf8"),!y.isEncoding(P))throw new TypeError("Unknown encoding: "+P);let O=C(U,P)|0,F=b(O),G=F.write(U,P);return G!==O&&(F=F.slice(0,G)),F}n(E,"fromString");function S(U){let P=U.length<0?0:T(U.length)|0,O=b(P);for(let F=0;F<P;F+=1)O[F]=U[F]&255;return O}n(S,"fromArrayLike");function x(U){if(ft(U,Uint8Array)){let P=new Uint8Array(U);return B(P.buffer,P.byteOffset,P.byteLength)}return S(U)}n(x,"fromArrayView");function B(U,P,O){if(P<0||U.byteLength<P)throw new RangeError('"offset" is outside of buffer bounds');if(U.byteLength<P+(O||0))throw new RangeError('"length" is outside of buffer bounds');let F;return P===void 0&&O===void 0?F=new Uint8Array(U):O===void 0?F=new Uint8Array(U,P):F=new Uint8Array(U,P,O),Object.setPrototypeOf(F,y.prototype),F}n(B,"fromArrayBuffer");function R(U){if(y.isBuffer(U)){let P=T(U.length)|0,O=b(P);return O.length===0||U.copy(O,0,0,P),O}if(U.length!==void 0)return typeof U.length!="number"||ee(U.length)?b(0):S(U);if(U.type==="Buffer"&&Array.isArray(U.data))return S(U.data)}n(R,"fromObject");function T(U){if(U>=g)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+g.toString(16)+" bytes");return U|0}n(T,"checked");function $(U){return+U!=U&&(U=0),y.alloc(+U)}n($,"SlowBuffer"),y.isBuffer=n(function(P){return P!=null&&P._isBuffer===!0&&P!==y.prototype},"isBuffer"),y.compare=n(function(P,O){if(ft(P,Uint8Array)&&(P=y.from(P,P.offset,P.byteLength)),ft(O,Uint8Array)&&(O=y.from(O,O.offset,O.byteLength)),!y.isBuffer(P)||!y.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(P===O)return 0;let F=P.length,G=O.length;for(let Ht=0,Q=Math.min(F,G);Ht<Q;++Ht)if(P[Ht]!==O[Ht]){F=P[Ht],G=O[Ht];break}return F<G?-1:G<F?1:0},"compare"),y.isEncoding=n(function(P){switch(String(P).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}},"isEncoding"),y.concat=n(function(P,O){if(!Array.isArray(P))throw new TypeError('"list" argument must be an Array of Buffers');if(P.length===0)return y.alloc(0);let F;if(O===void 0)for(O=0,F=0;F<P.length;++F)O+=P[F].length;let G=y.allocUnsafe(O),Ht=0;for(F=0;F<P.length;++F){let Q=P[F];if(ft(Q,Uint8Array))Ht+Q.length>G.length?(y.isBuffer(Q)||(Q=y.from(Q)),Q.copy(G,Ht)):Uint8Array.prototype.set.call(G,Q,Ht);else if(y.isBuffer(Q))Q.copy(G,Ht);else throw new TypeError('"list" argument must be an Array of Buffers');Ht+=Q.length}return G},"concat");function C(U,P){if(y.isBuffer(U))return U.length;if(ArrayBuffer.isView(U)||ft(U,ArrayBuffer))return U.byteLength;if(typeof U!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof U);let O=U.length,F=arguments.length>2&&arguments[2]===!0;if(!F&&O===0)return 0;let G=!1;for(;;)switch(P){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return Qt(U).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return ie(U).length;default:if(G)return F?-1:Qt(U).length;P=(""+P).toLowerCase(),G=!0}}n(C,"byteLength"),y.byteLength=C;function D(U,P,O){let F=!1;if((P===void 0||P<0)&&(P=0),P>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,P>>>=0,O<=P))return"";for(U||(U="utf8");;)switch(U){case"hex":return h(this,P,O);case"utf8":case"utf-8":return i(this,P,O);case"ascii":return p(this,P,O);case"latin1":case"binary":return v(this,P,O);case"base64":return r(this,P,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e(this,P,O);default:if(F)throw new TypeError("Unknown encoding: "+U);U=(U+"").toLowerCase(),F=!0}}n(D,"slowToString"),y.prototype._isBuffer=!0;function Z(U,P,O){let F=U[P];U[P]=U[O],U[O]=F}n(Z,"swap"),y.prototype.swap16=n(function(){let P=this.length;if(P%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<P;O+=2)Z(this,O,O+1);return this},"swap16"),y.prototype.swap32=n(function(){let P=this.length;if(P%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<P;O+=4)Z(this,O,O+3),Z(this,O+1,O+2);return this},"swap32"),y.prototype.swap64=n(function(){let P=this.length;if(P%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<P;O+=8)Z(this,O,O+7),Z(this,O+1,O+6),Z(this,O+2,O+5),Z(this,O+3,O+4);return this},"swap64"),y.prototype.toString=n(function(){let P=this.length;return P===0?"":arguments.length===0?i(this,0,P):D.apply(this,arguments)},"toString"),y.prototype.toLocaleString=y.prototype.toString,y.prototype.equals=n(function(P){if(!y.isBuffer(P))throw new TypeError("Argument must be a Buffer");return this===P?!0:y.compare(this,P)===0},"equals"),y.prototype.inspect=n(function(){let P="",O=ws.INSPECT_MAX_BYTES;return P=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(P+=" ... "),"<Buffer "+P+">"},"inspect"),l&&(y.prototype[l]=y.prototype.inspect),y.prototype.compare=n(function(P,O,F,G,Ht){if(ft(P,Uint8Array)&&(P=y.from(P,P.offset,P.byteLength)),!y.isBuffer(P))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof P);if(O===void 0&&(O=0),F===void 0&&(F=P?P.length:0),G===void 0&&(G=0),Ht===void 0&&(Ht=this.length),O<0||F>P.length||G<0||Ht>this.length)throw new RangeError("out of range index");if(G>=Ht&&O>=F)return 0;if(G>=Ht)return-1;if(O>=F)return 1;if(O>>>=0,F>>>=0,G>>>=0,Ht>>>=0,this===P)return 0;let Q=Ht-G,ut=F-O,re=Math.min(Q,ut),at=this.slice(G,Ht),zt=P.slice(O,F);for(let te=0;te<re;++te)if(at[te]!==zt[te]){Q=at[te],ut=zt[te];break}return Q<ut?-1:ut<Q?1:0},"compare");function W(U,P,O,F,G){if(U.length===0)return-1;if(typeof O=="string"?(F=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,ee(O)&&(O=G?0:U.length-1),O<0&&(O=U.length+O),O>=U.length){if(G)return-1;O=U.length-1}else if(O<0)if(G)O=0;else return-1;if(typeof P=="string"&&(P=y.from(P,F)),y.isBuffer(P))return P.length===0?-1:X(U,P,O,F,G);if(typeof P=="number")return P=P&255,typeof Uint8Array.prototype.indexOf=="function"?G?Uint8Array.prototype.indexOf.call(U,P,O):Uint8Array.prototype.lastIndexOf.call(U,P,O):X(U,[P],O,F,G);throw new TypeError("val must be string, number or Buffer")}n(W,"bidirectionalIndexOf");function X(U,P,O,F,G){let Ht=1,Q=U.length,ut=P.length;if(F!==void 0&&(F=String(F).toLowerCase(),F==="ucs2"||F==="ucs-2"||F==="utf16le"||F==="utf-16le")){if(U.length<2||P.length<2)return-1;Ht=2,Q/=2,ut/=2,O/=2}function re(zt,te){return Ht===1?zt[te]:zt.readUInt16BE(te*Ht)}n(re,"read");let at;if(G){let zt=-1;for(at=O;at<Q;at++)if(re(U,at)===re(P,zt===-1?0:at-zt)){if(zt===-1&&(zt=at),at-zt+1===ut)return zt*Ht}else zt!==-1&&(at-=at-zt),zt=-1}else for(O+ut>Q&&(O=Q-ut),at=O;at>=0;at--){let zt=!0;for(let te=0;te<ut;te++)if(re(U,at+te)!==re(P,te)){zt=!1;break}if(zt)return at}return-1}n(X,"arrayIndexOf"),y.prototype.includes=n(function(P,O,F){return this.indexOf(P,O,F)!==-1},"includes"),y.prototype.indexOf=n(function(P,O,F){return W(this,P,O,F,!0)},"indexOf"),y.prototype.lastIndexOf=n(function(P,O,F){return W(this,P,O,F,!1)},"lastIndexOf");function z(U,P,O,F){O=Number(O)||0;let G=U.length-O;F?(F=Number(F),F>G&&(F=G)):F=G;let Ht=P.length;F>Ht/2&&(F=Ht/2);let Q;for(Q=0;Q<F;++Q){let ut=parseInt(P.substr(Q*2,2),16);if(ee(ut))return Q;U[O+Q]=ut}return Q}n(z,"hexWrite");function q(U,P,O,F){return ot(Qt(P,U.length-O),U,O,F)}n(q,"utf8Write");function V(U,P,O,F){return ot(it(P),U,O,F)}n(V,"asciiWrite");function c(U,P,O,F){return ot(ie(P),U,O,F)}n(c,"base64Write");function t(U,P,O,F){return ot(ht(P,U.length-O),U,O,F)}n(t,"ucs2Write"),y.prototype.write=n(function(P,O,F,G){if(O===void 0)G="utf8",F=this.length,O=0;else if(F===void 0&&typeof O=="string")G=O,F=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(F)?(F=F>>>0,G===void 0&&(G="utf8")):(G=F,F=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let Ht=this.length-O;if((F===void 0||F>Ht)&&(F=Ht),P.length>0&&(F<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");G||(G="utf8");let Q=!1;for(;;)switch(G){case"hex":return z(this,P,O,F);case"utf8":case"utf-8":return q(this,P,O,F);case"ascii":case"latin1":case"binary":return V(this,P,O,F);case"base64":return c(this,P,O,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t(this,P,O,F);default:if(Q)throw new TypeError("Unknown encoding: "+G);G=(""+G).toLowerCase(),Q=!0}},"write"),y.prototype.toJSON=n(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function r(U,P,O){return P===0&&O===U.length?u.fromByteArray(U):u.fromByteArray(U.slice(P,O))}n(r,"base64Slice");function i(U,P,O){O=Math.min(U.length,O);let F=[],G=P;for(;G<O;){let Ht=U[G],Q=null,ut=Ht>239?4:Ht>223?3:Ht>191?2:1;if(G+ut<=O){let re,at,zt,te;switch(ut){case 1:Ht<128&&(Q=Ht);break;case 2:re=U[G+1],(re&192)===128&&(te=(Ht&31)<<6|re&63,te>127&&(Q=te));break;case 3:re=U[G+1],at=U[G+2],(re&192)===128&&(at&192)===128&&(te=(Ht&15)<<12|(re&63)<<6|at&63,te>2047&&(te<55296||te>57343)&&(Q=te));break;case 4:re=U[G+1],at=U[G+2],zt=U[G+3],(re&192)===128&&(at&192)===128&&(zt&192)===128&&(te=(Ht&15)<<18|(re&63)<<12|(at&63)<<6|zt&63,te>65535&&te<1114112&&(Q=te))}}Q===null?(Q=65533,ut=1):Q>65535&&(Q-=65536,F.push(Q>>>10&1023|55296),Q=56320|Q&1023),F.push(Q),G+=ut}return s(F)}n(i,"utf8Slice");let a=4096;function s(U){let P=U.length;if(P<=a)return String.fromCharCode.apply(String,U);let O="",F=0;for(;F<P;)O+=String.fromCharCode.apply(String,U.slice(F,F+=a));return O}n(s,"decodeCodePointsArray");function p(U,P,O){let F="";O=Math.min(U.length,O);for(let G=P;G<O;++G)F+=String.fromCharCode(U[G]&127);return F}n(p,"asciiSlice");function v(U,P,O){let F="";O=Math.min(U.length,O);for(let G=P;G<O;++G)F+=String.fromCharCode(U[G]);return F}n(v,"latin1Slice");function h(U,P,O){let F=U.length;(!P||P<0)&&(P=0),(!O||O<0||O>F)&&(O=F);let G="";for(let Ht=P;Ht<O;++Ht)G+=st[U[Ht]];return G}n(h,"hexSlice");function e(U,P,O){let F=U.slice(P,O),G="";for(let Ht=0;Ht<F.length-1;Ht+=2)G+=String.fromCharCode(F[Ht]+F[Ht+1]*256);return G}n(e,"utf16leSlice"),y.prototype.slice=n(function(P,O){let F=this.length;P=~~P,O=O===void 0?F:~~O,P<0?(P+=F,P<0&&(P=0)):P>F&&(P=F),O<0?(O+=F,O<0&&(O=0)):O>F&&(O=F),O<P&&(O=P);let G=this.subarray(P,O);return Object.setPrototypeOf(G,y.prototype),G},"slice");function f(U,P,O){if(U%1!==0||U<0)throw new RangeError("offset is not uint");if(U+P>O)throw new RangeError("Trying to access beyond buffer length")}n(f,"checkOffset"),y.prototype.readUintLE=y.prototype.readUIntLE=n(function(P,O,F){P=P>>>0,O=O>>>0,F||f(P,O,this.length);let G=this[P],Ht=1,Q=0;for(;++Q<O&&(Ht*=256);)G+=this[P+Q]*Ht;return G},"readUIntLE"),y.prototype.readUintBE=y.prototype.readUIntBE=n(function(P,O,F){P=P>>>0,O=O>>>0,F||f(P,O,this.length);let G=this[P+--O],Ht=1;for(;O>0&&(Ht*=256);)G+=this[P+--O]*Ht;return G},"readUIntBE"),y.prototype.readUint8=y.prototype.readUInt8=n(function(P,O){return P=P>>>0,O||f(P,1,this.length),this[P]},"readUInt8"),y.prototype.readUint16LE=y.prototype.readUInt16LE=n(function(P,O){return P=P>>>0,O||f(P,2,this.length),this[P]|this[P+1]<<8},"readUInt16LE"),y.prototype.readUint16BE=y.prototype.readUInt16BE=n(function(P,O){return P=P>>>0,O||f(P,2,this.length),this[P]<<8|this[P+1]},"readUInt16BE"),y.prototype.readUint32LE=y.prototype.readUInt32LE=n(function(P,O){return P=P>>>0,O||f(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+this[P+3]*16777216},"readUInt32LE"),y.prototype.readUint32BE=y.prototype.readUInt32BE=n(function(P,O){return P=P>>>0,O||f(P,4,this.length),this[P]*16777216+(this[P+1]<<16|this[P+2]<<8|this[P+3])},"readUInt32BE"),y.prototype.readBigUInt64LE=Ft(n(function(P){P=P>>>0,H(P,"offset");let O=this[P],F=this[P+7];(O===void 0||F===void 0)&&J(P,this.length-8);let G=O+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24,Ht=this[++P]+this[++P]*2**8+this[++P]*2**16+F*2**24;return BigInt(G)+(BigInt(Ht)<<BigInt(32))},"readBigUInt64LE")),y.prototype.readBigUInt64BE=Ft(n(function(P){P=P>>>0,H(P,"offset");let O=this[P],F=this[P+7];(O===void 0||F===void 0)&&J(P,this.length-8);let G=O*2**24+this[++P]*2**16+this[++P]*2**8+this[++P],Ht=this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+F;return(BigInt(G)<<BigInt(32))+BigInt(Ht)},"readBigUInt64BE")),y.prototype.readIntLE=n(function(P,O,F){P=P>>>0,O=O>>>0,F||f(P,O,this.length);let G=this[P],Ht=1,Q=0;for(;++Q<O&&(Ht*=256);)G+=this[P+Q]*Ht;return Ht*=128,G>=Ht&&(G-=Math.pow(2,8*O)),G},"readIntLE"),y.prototype.readIntBE=n(function(P,O,F){P=P>>>0,O=O>>>0,F||f(P,O,this.length);let G=O,Ht=1,Q=this[P+--G];for(;G>0&&(Ht*=256);)Q+=this[P+--G]*Ht;return Ht*=128,Q>=Ht&&(Q-=Math.pow(2,8*O)),Q},"readIntBE"),y.prototype.readInt8=n(function(P,O){return P=P>>>0,O||f(P,1,this.length),this[P]&128?(255-this[P]+1)*-1:this[P]},"readInt8"),y.prototype.readInt16LE=n(function(P,O){P=P>>>0,O||f(P,2,this.length);let F=this[P]|this[P+1]<<8;return F&32768?F|4294901760:F},"readInt16LE"),y.prototype.readInt16BE=n(function(P,O){P=P>>>0,O||f(P,2,this.length);let F=this[P+1]|this[P]<<8;return F&32768?F|4294901760:F},"readInt16BE"),y.prototype.readInt32LE=n(function(P,O){return P=P>>>0,O||f(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},"readInt32LE"),y.prototype.readInt32BE=n(function(P,O){return P=P>>>0,O||f(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},"readInt32BE"),y.prototype.readBigInt64LE=Ft(n(function(P){P=P>>>0,H(P,"offset");let O=this[P],F=this[P+7];(O===void 0||F===void 0)&&J(P,this.length-8);let G=this[P+4]+this[P+5]*2**8+this[P+6]*2**16+(F<<24);return(BigInt(G)<<BigInt(32))+BigInt(O+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24)},"readBigInt64LE")),y.prototype.readBigInt64BE=Ft(n(function(P){P=P>>>0,H(P,"offset");let O=this[P],F=this[P+7];(O===void 0||F===void 0)&&J(P,this.length-8);let G=(O<<24)+this[++P]*2**16+this[++P]*2**8+this[++P];return(BigInt(G)<<BigInt(32))+BigInt(this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+F)},"readBigInt64BE")),y.prototype.readFloatLE=n(function(P,O){return P=P>>>0,O||f(P,4,this.length),d.read(this,P,!0,23,4)},"readFloatLE"),y.prototype.readFloatBE=n(function(P,O){return P=P>>>0,O||f(P,4,this.length),d.read(this,P,!1,23,4)},"readFloatBE"),y.prototype.readDoubleLE=n(function(P,O){return P=P>>>0,O||f(P,8,this.length),d.read(this,P,!0,52,8)},"readDoubleLE"),y.prototype.readDoubleBE=n(function(P,O){return P=P>>>0,O||f(P,8,this.length),d.read(this,P,!1,52,8)},"readDoubleBE");function A(U,P,O,F,G,Ht){if(!y.isBuffer(U))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>G||P<Ht)throw new RangeError('"value" argument is out of bounds');if(O+F>U.length)throw new RangeError("Index out of range")}n(A,"checkInt"),y.prototype.writeUintLE=y.prototype.writeUIntLE=n(function(P,O,F,G){if(P=+P,O=O>>>0,F=F>>>0,!G){let ut=Math.pow(2,8*F)-1;A(this,P,O,F,ut,0)}let Ht=1,Q=0;for(this[O]=P&255;++Q<F&&(Ht*=256);)this[O+Q]=P/Ht&255;return O+F},"writeUIntLE"),y.prototype.writeUintBE=y.prototype.writeUIntBE=n(function(P,O,F,G){if(P=+P,O=O>>>0,F=F>>>0,!G){let ut=Math.pow(2,8*F)-1;A(this,P,O,F,ut,0)}let Ht=F-1,Q=1;for(this[O+Ht]=P&255;--Ht>=0&&(Q*=256);)this[O+Ht]=P/Q&255;return O+F},"writeUIntBE"),y.prototype.writeUint8=y.prototype.writeUInt8=n(function(P,O,F){return P=+P,O=O>>>0,F||A(this,P,O,1,255,0),this[O]=P&255,O+1},"writeUInt8"),y.prototype.writeUint16LE=y.prototype.writeUInt16LE=n(function(P,O,F){return P=+P,O=O>>>0,F||A(this,P,O,2,65535,0),this[O]=P&255,this[O+1]=P>>>8,O+2},"writeUInt16LE"),y.prototype.writeUint16BE=y.prototype.writeUInt16BE=n(function(P,O,F){return P=+P,O=O>>>0,F||A(this,P,O,2,65535,0),this[O]=P>>>8,this[O+1]=P&255,O+2},"writeUInt16BE"),y.prototype.writeUint32LE=y.prototype.writeUInt32LE=n(function(P,O,F){return P=+P,O=O>>>0,F||A(this,P,O,4,4294967295,0),this[O+3]=P>>>24,this[O+2]=P>>>16,this[O+1]=P>>>8,this[O]=P&255,O+4},"writeUInt32LE"),y.prototype.writeUint32BE=y.prototype.writeUInt32BE=n(function(P,O,F){return P=+P,O=O>>>0,F||A(this,P,O,4,4294967295,0),this[O]=P>>>24,this[O+1]=P>>>16,this[O+2]=P>>>8,this[O+3]=P&255,O+4},"writeUInt32BE");function k(U,P,O,F,G){tt(P,F,G,U,O,7);let Ht=Number(P&BigInt(4294967295));U[O++]=Ht,Ht=Ht>>8,U[O++]=Ht,Ht=Ht>>8,U[O++]=Ht,Ht=Ht>>8,U[O++]=Ht;let Q=Number(P>>BigInt(32)&BigInt(4294967295));return U[O++]=Q,Q=Q>>8,U[O++]=Q,Q=Q>>8,U[O++]=Q,Q=Q>>8,U[O++]=Q,O}n(k,"wrtBigUInt64LE");function I(U,P,O,F,G){tt(P,F,G,U,O,7);let Ht=Number(P&BigInt(4294967295));U[O+7]=Ht,Ht=Ht>>8,U[O+6]=Ht,Ht=Ht>>8,U[O+5]=Ht,Ht=Ht>>8,U[O+4]=Ht;let Q=Number(P>>BigInt(32)&BigInt(4294967295));return U[O+3]=Q,Q=Q>>8,U[O+2]=Q,Q=Q>>8,U[O+1]=Q,Q=Q>>8,U[O]=Q,O+8}n(I,"wrtBigUInt64BE"),y.prototype.writeBigUInt64LE=Ft(n(function(P,O=0){return k(this,P,O,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE")),y.prototype.writeBigUInt64BE=Ft(n(function(P,O=0){return I(this,P,O,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE")),y.prototype.writeIntLE=n(function(P,O,F,G){if(P=+P,O=O>>>0,!G){let re=Math.pow(2,8*F-1);A(this,P,O,F,re-1,-re)}let Ht=0,Q=1,ut=0;for(this[O]=P&255;++Ht<F&&(Q*=256);)P<0&&ut===0&&this[O+Ht-1]!==0&&(ut=1),this[O+Ht]=(P/Q>>0)-ut&255;return O+F},"writeIntLE"),y.prototype.writeIntBE=n(function(P,O,F,G){if(P=+P,O=O>>>0,!G){let re=Math.pow(2,8*F-1);A(this,P,O,F,re-1,-re)}let Ht=F-1,Q=1,ut=0;for(this[O+Ht]=P&255;--Ht>=0&&(Q*=256);)P<0&&ut===0&&this[O+Ht+1]!==0&&(ut=1),this[O+Ht]=(P/Q>>0)-ut&255;return O+F},"writeIntBE"),y.prototype.writeInt8=n(function(P,O,F){return P=+P,O=O>>>0,F||A(this,P,O,1,127,-128),P<0&&(P=255+P+1),this[O]=P&255,O+1},"writeInt8"),y.prototype.writeInt16LE=n(function(P,O,F){return P=+P,O=O>>>0,F||A(this,P,O,2,32767,-32768),this[O]=P&255,this[O+1]=P>>>8,O+2},"writeInt16LE"),y.prototype.writeInt16BE=n(function(P,O,F){return P=+P,O=O>>>0,F||A(this,P,O,2,32767,-32768),this[O]=P>>>8,this[O+1]=P&255,O+2},"writeInt16BE"),y.prototype.writeInt32LE=n(function(P,O,F){return P=+P,O=O>>>0,F||A(this,P,O,4,2147483647,-2147483648),this[O]=P&255,this[O+1]=P>>>8,this[O+2]=P>>>16,this[O+3]=P>>>24,O+4},"writeInt32LE"),y.prototype.writeInt32BE=n(function(P,O,F){return P=+P,O=O>>>0,F||A(this,P,O,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),this[O]=P>>>24,this[O+1]=P>>>16,this[O+2]=P>>>8,this[O+3]=P&255,O+4},"writeInt32BE"),y.prototype.writeBigInt64LE=Ft(n(function(P,O=0){return k(this,P,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE")),y.prototype.writeBigInt64BE=Ft(n(function(P,O=0){return I(this,P,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function N(U,P,O,F,G,Ht){if(O+F>U.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}n(N,"checkIEEE754");function j(U,P,O,F,G){return P=+P,O=O>>>0,G||N(U,P,O,4),d.write(U,P,O,F,23,4),O+4}n(j,"writeFloat"),y.prototype.writeFloatLE=n(function(P,O,F){return j(this,P,O,!0,F)},"writeFloatLE"),y.prototype.writeFloatBE=n(function(P,O,F){return j(this,P,O,!1,F)},"writeFloatBE");function et(U,P,O,F,G){return P=+P,O=O>>>0,G||N(U,P,O,8),d.write(U,P,O,F,52,8),O+8}n(et,"writeDouble"),y.prototype.writeDoubleLE=n(function(P,O,F){return et(this,P,O,!0,F)},"writeDoubleLE"),y.prototype.writeDoubleBE=n(function(P,O,F){return et(this,P,O,!1,F)},"writeDoubleBE"),y.prototype.copy=n(function(P,O,F,G){if(!y.isBuffer(P))throw new TypeError("argument should be a Buffer");if(F||(F=0),!G&&G!==0&&(G=this.length),O>=P.length&&(O=P.length),O||(O=0),G>0&&G<F&&(G=F),G===F||P.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(F<0||F>=this.length)throw new RangeError("Index out of range");if(G<0)throw new RangeError("sourceEnd out of bounds");G>this.length&&(G=this.length),P.length-O<G-F&&(G=P.length-O+F);let Ht=G-F;return this===P&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(O,F,G):Uint8Array.prototype.set.call(P,this.subarray(F,G),O),Ht},"copy"),y.prototype.fill=n(function(P,O,F,G){if(typeof P=="string"){if(typeof O=="string"?(G=O,O=0,F=this.length):typeof F=="string"&&(G=F,F=this.length),G!==void 0&&typeof G!="string")throw new TypeError("encoding must be a string");if(typeof G=="string"&&!y.isEncoding(G))throw new TypeError("Unknown encoding: "+G);if(P.length===1){let Q=P.charCodeAt(0);(G==="utf8"&&Q<128||G==="latin1")&&(P=Q)}}else typeof P=="number"?P=P&255:typeof P=="boolean"&&(P=Number(P));if(O<0||this.length<O||this.length<F)throw new RangeError("Out of range index");if(F<=O)return this;O=O>>>0,F=F===void 0?this.length:F>>>0,P||(P=0);let Ht;if(typeof P=="number")for(Ht=O;Ht<F;++Ht)this[Ht]=P;else{let Q=y.isBuffer(P)?P:y.from(P,G),ut=Q.length;if(ut===0)throw new TypeError('The value "'+P+'" is invalid for argument "value"');for(Ht=0;Ht<F-O;++Ht)this[Ht+O]=Q[Ht%ut]}return this},"fill");let rt={};function L(U,P,O){rt[U]=class extends O{static{n(this,"NodeError")}constructor(){super(),Object.defineProperty(this,"message",{value:P.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${U}]`,this.stack,delete this.name}get code(){return U}set code(G){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:G,writable:!0})}toString(){return`${this.name} [${U}]: ${this.message}`}}}n(L,"E"),L("ERR_BUFFER_OUT_OF_BOUNDS",function(U){return U?`${U} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),L("ERR_INVALID_ARG_TYPE",function(U,P){return`The "${U}" argument must be of type number. Received type ${typeof P}`},TypeError),L("ERR_OUT_OF_RANGE",function(U,P,O){let F=`The value of "${U}" is out of range.`,G=O;return Number.isInteger(O)&&Math.abs(O)>2**32?G=K(String(O)):typeof O=="bigint"&&(G=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(G=K(G)),G+="n"),F+=` It must be ${P}. Received ${G}`,F},RangeError);function K(U){let P="",O=U.length,F=U[0]==="-"?1:0;for(;O>=F+4;O-=3)P=`_${U.slice(O-3,O)}${P}`;return`${U.slice(0,O)}${P}`}n(K,"addNumericalSeparator");function Jt(U,P,O){H(P,"offset"),(U[P]===void 0||U[P+O]===void 0)&&J(P,U.length-(O+1))}n(Jt,"checkBounds");function tt(U,P,O,F,G,Ht){if(U>O||U<P){let Q=typeof P=="bigint"?"n":"",ut;throw P===0||P===BigInt(0)?ut=`>= 0${Q} and < 2${Q} ** ${(Ht+1)*8}${Q}`:ut=`>= -(2${Q} ** ${(Ht+1)*8-1}${Q}) and < 2 ** ${(Ht+1)*8-1}${Q}`,new rt.ERR_OUT_OF_RANGE("value",ut,U)}Jt(F,G,Ht)}n(tt,"checkIntBI");function H(U,P){if(typeof U!="number")throw new rt.ERR_INVALID_ARG_TYPE(P,"number",U)}n(H,"validateNumber");function J(U,P,O){throw Math.floor(U)!==U?(H(U,O),new rt.ERR_OUT_OF_RANGE("offset","an integer",U)):P<0?new rt.ERR_BUFFER_OUT_OF_BOUNDS:new rt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${P}`,U)}n(J,"boundsError");let Y=/[^+/0-9A-Za-z-_]/g;function nt(U){if(U=U.split("=")[0],U=U.trim().replace(Y,""),U.length<2)return"";for(;U.length%4!==0;)U=U+"=";return U}n(nt,"base64clean");function Qt(U,P){P=P||1/0;let O,F=U.length,G=null,Ht=[];for(let Q=0;Q<F;++Q){if(O=U.charCodeAt(Q),O>55295&&O<57344){if(!G){if(O>56319){(P-=3)>-1&&Ht.push(239,191,189);continue}else if(Q+1===F){(P-=3)>-1&&Ht.push(239,191,189);continue}G=O;continue}if(O<56320){(P-=3)>-1&&Ht.push(239,191,189),G=O;continue}O=(G-55296<<10|O-56320)+65536}else G&&(P-=3)>-1&&Ht.push(239,191,189);if(G=null,O<128){if((P-=1)<0)break;Ht.push(O)}else if(O<2048){if((P-=2)<0)break;Ht.push(O>>6|192,O&63|128)}else if(O<65536){if((P-=3)<0)break;Ht.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((P-=4)<0)break;Ht.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return Ht}n(Qt,"utf8ToBytes");function it(U){let P=[];for(let O=0;O<U.length;++O)P.push(U.charCodeAt(O)&255);return P}n(it,"asciiToBytes");function ht(U,P){let O,F,G,Ht=[];for(let Q=0;Q<U.length&&!((P-=2)<0);++Q)O=U.charCodeAt(Q),F=O>>8,G=O%256,Ht.push(G),Ht.push(F);return Ht}n(ht,"utf16leToBytes");function ie(U){return u.toByteArray(nt(U))}n(ie,"base64ToBytes");function ot(U,P,O,F){let G;for(G=0;G<F&&!(G+O>=P.length||G>=U.length);++G)P[G+O]=U[G];return G}n(ot,"blitBuffer");function ft(U,P){return U instanceof P||U!=null&&U.constructor!=null&&U.constructor.name!=null&&U.constructor.name===P.name}n(ft,"isInstance");function ee(U){return U!==U}n(ee,"numberIsNaN");let st=function(){let U="0123456789abcdef",P=new Array(256);for(let O=0;O<16;++O){let F=O*16;for(let G=0;G<16;++G)P[F+G]=U[O]+U[G]}return P}();function Ft(U){return typeof BigInt>"u"?ne:U}n(Ft,"defineBigIntMethod");function ne(){throw new Error("BigInt not supported")}return n(ne,"BufferBigIntNotDefined"),ws}var Sf,vy,hu,my,ws,by,fu=vi(()=>{"use strict";me();ge();be();Sf={},vy=!1;n(NC,"dew$2");hu={},my=!1;n(qC,"dew$1");ws={},by=!1;n(ni,"dew")});var kc={};iu(kc,{Buffer:()=>Fe,INSPECT_MAX_BYTES:()=>OC,default:()=>$o,kMaxLength:()=>UC});var $o,Fe,OC,UC,uu=vi(()=>{"use strict";me();ge();be();fu();$o=ni();$o.Buffer;$o.SlowBuffer;$o.INSPECT_MAX_BYTES;$o.kMaxLength;Fe=$o.Buffer,OC=$o.INSPECT_MAX_BYTES,UC=$o.kMaxLength});var ge=vi(()=>{"use strict";uu()});var Ny=ki((Cc,Ly)=>{"use strict";me();ge();be();var mu=(uu(),nu(kc)),ao=mu.Buffer;function Dy(u,d){for(var l in u)d[l]=u[l]}n(Dy,"copyProps");ao.from&&ao.alloc&&ao.allocUnsafe&&ao.allocUnsafeSlow?Ly.exports=mu:(Dy(mu,Cc),Cc.Buffer=Ah);function Ah(u,d,l){return ao(u,d,l)}n(Ah,"SafeBuffer");Dy(ao,Ah);Ah.from=function(u,d,l){if(typeof u=="number")throw new TypeError("Argument must not be a number");return ao(u,d,l)};Ah.alloc=function(u,d,l){if(typeof u!="number")throw new TypeError("Argument must be a number");var g=ao(u);return d!==void 0?typeof l=="string"?g.fill(d,l):g.fill(d):g.fill(0),g};Ah.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return ao(u)};Ah.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return mu.SlowBuffer(u)}});var Nc=ki((GY,Lc)=>{"use strict";me();ge();be();var Dc=65536,aD=4294967295;function oD(){throw new Error(`Secure random number generation is not supported by this browser. Use Chrome, Firefox or Internet Explorer 11`)}n(oD,"oldBrowser");var sD=Ny().Buffer,bu=global.crypto||global.msCrypto;bu&&bu.getRandomValues?Lc.exports=hD:Lc.exports=oD;function hD(u,d){if(u>aD)throw new RangeError("requested too many random bytes");var l=sD.allocUnsafe(u);if(u>0)if(u>Dc)for(var g=0;g<u;g+=Dc)bu.getRandomValues(l.slice(g,g+Dc));else bu.getRandomValues(l);return typeof d=="function"?We.nextTick(function(){d(null,l)}):l}n(hD,"randomBytes")});var gu=ki((qy,qc)=>{"use strict";me();ge();be();(function(u,d){"use strict";function l(c,t){if(!c)throw new Error(t||"Assertion failed")}n(l,"assert");function g(c,t){c.super_=t;var r=n(function(){},"TempCtor");r.prototype=t.prototype,c.prototype=new r,c.prototype.constructor=c}n(g,"inherits");function o(c,t,r){if(o.isBN(c))return c;this.negative=0,this.words=null,this.length=0,this.red=null,c!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(c||0,t||10,r||"be"))}n(o,"BN"),typeof u=="object"?u.exports=o:d.BN=o,o.BN=o,o.wordSize=26;var b;try{typeof window<"u"&&typeof window.Buffer<"u"?b=window.Buffer:b=(uu(),nu(kc)).Buffer}catch{}o.isBN=n(function(t){return t instanceof o?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},"isBN"),o.max=n(function(t,r){return t.cmp(r)>0?t:r},"max"),o.min=n(function(t,r){return t.cmp(r)<0?t:r},"min"),o.prototype._init=n(function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),l(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},"init"),o.prototype._initNumber=n(function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(l(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},"_initNumber"),o.prototype._initArray=n(function(t,r,i){if(l(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var s,p,v=0;if(i==="be")for(a=t.length-1,s=0;a>=0;a-=3)p=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[s]|=p<<v&67108863,this.words[s+1]=p>>>26-v&67108863,v+=24,v>=26&&(v-=26,s++);else if(i==="le")for(a=0,s=0;a<t.length;a+=3)p=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[s]|=p<<v&67108863,this.words[s+1]=p>>>26-v&67108863,v+=24,v>=26&&(v-=26,s++);return this.strip()},"_initArray");function y(c,t){var r=c.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}n(y,"parseHex4Bits");function M(c,t,r){var i=y(c,r);return r-1>=t&&(i|=y(c,r-1)<<4),i}n(M,"parseHexByte"),o.prototype._parseHex=n(function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var s=0,p=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=M(t,r,a)<<s,this.words[p]|=v&67108863,s>=18?(s-=18,p+=1,this.words[p]|=v>>>26):s+=8;else{var h=t.length-r;for(a=h%2===0?r+1:r;a<t.length;a+=2)v=M(t,r,a)<<s,this.words[p]|=v&67108863,s>=18?(s-=18,p+=1,this.words[p]|=v>>>26):s+=8}this.strip()},"_parseHex");function _(c,t,r,i){for(var a=0,s=Math.min(c.length,r),p=t;p<s;p++){var v=c.charCodeAt(p)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}n(_,"parseBase"),o.prototype._parseBase=n(function(t,r,i){this.words=[0],this.length=1;for(var a=0,s=1;s<=67108863;s*=r)a++;a--,s=s/r|0;for(var p=t.length-i,v=p%a,h=Math.min(p,p-v)+i,e=0,f=i;f<h;f+=a)e=_(t,f,f+a,r),this.imuln(s),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var A=1;for(e=_(t,f,t.length,r),f=0;f<v;f++)A*=r;this.imuln(A),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},"_parseBase"),o.prototype.copy=n(function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},"copy"),o.prototype.clone=n(function(){var t=new o(null);return this.copy(t),t},"clone"),o.prototype._expand=n(function(t){for(;this.length<t;)this.words[this.length++]=0;return this},"_expand"),o.prototype.strip=n(function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},"strip"),o.prototype._normSign=n(function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},"_normSign"),o.prototype.inspect=n(function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"},"inspect");var w=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],m=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=n(function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,s=0,p=0;p<this.length;p++){var v=this.words[p],h=((v<<a|s)&16777215).toString(16);s=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,p--),s!==0||p!==this.length-1?i=w[6-h.length]+h+i:i=h+i}for(s!==0&&(i=s.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=m[t],f=E[t];i="";var A=this.clone();for(A.negative=0;!A.isZero();){var k=A.modn(f).toString(t);A=A.idivn(f),A.isZero()?i=k+i:i=w[e-k.length]+k+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}l(!1,"Base should be between 2 and 36")},"toString"),o.prototype.toNumber=n(function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&l(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},"toNumber"),o.prototype.toJSON=n(function(){return this.toString(16)},"toJSON"),o.prototype.toBuffer=n(function(t,r){return l(typeof b<"u"),this.toArrayLike(b,t,r)},"toBuffer"),o.prototype.toArray=n(function(t,r){return this.toArrayLike(Array,t,r)},"toArray"),o.prototype.toArrayLike=n(function(t,r,i){var a=this.byteLength(),s=i||Math.max(1,a);l(a<=s,"byte array longer than desired length"),l(s>0,"Requested array length <= 0"),this.strip();var p=r==="le",v=new t(s),h,e,f=this.clone();if(p){for(e=0;!f.isZero();e++)h=f.andln(255),f.iushrn(8),v[e]=h;for(;e<s;e++)v[e]=0}else{for(e=0;e<s-a;e++)v[e]=0;for(e=0;!f.isZero();e++)h=f.andln(255),f.iushrn(8),v[s-e-1]=h}return v},"toArrayLike"),Math.clz32?o.prototype._countBits=n(function(t){return 32-Math.clz32(t)},"_countBits"):o.prototype._countBits=n(function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},"_countBits"),o.prototype._zeroBits=n(function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},"_zeroBits"),o.prototype.bitLength=n(function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r},"bitLength");function S(c){for(var t=new Array(c.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(c.words[i]&1<<a)>>>a}return t}n(S,"toBitArray"),o.prototype.zeroBits=n(function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},"zeroBits"),o.prototype.byteLength=n(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),o.prototype.toTwos=n(function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},"toTwos"),o.prototype.fromTwos=n(function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},"fromTwos"),o.prototype.isNeg=n(function(){return this.negative!==0},"isNeg"),o.prototype.neg=n(function(){return this.clone().ineg()},"neg"),o.prototype.ineg=n(function(){return this.isZero()||(this.negative^=1),this},"ineg"),o.prototype.iuor=n(function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},"iuor"),o.prototype.ior=n(function(t){return l((this.negative|t.negative)===0),this.iuor(t)},"ior"),o.prototype.or=n(function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},"or"),o.prototype.uor=n(function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},"uor"),o.prototype.iuand=n(function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},"iuand"),o.prototype.iand=n(function(t){return l((this.negative|t.negative)===0),this.iuand(t)},"iand"),o.prototype.and=n(function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},"and"),o.prototype.uand=n(function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},"uand"),o.prototype.iuxor=n(function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},"iuxor"),o.prototype.ixor=n(function(t){return l((this.negative|t.negative)===0),this.iuxor(t)},"ixor"),o.prototype.xor=n(function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},"xor"),o.prototype.uxor=n(function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},"uxor"),o.prototype.inotn=n(function(t){l(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},"inotn"),o.prototype.notn=n(function(t){return this.clone().inotn(t)},"notn"),o.prototype.setn=n(function(t,r){l(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},"setn"),o.prototype.iadd=n(function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var s=0,p=0;p<a.length;p++)r=(i.words[p]|0)+(a.words[p]|0)+s,this.words[p]=r&67108863,s=r>>>26;for(;s!==0&&p<i.length;p++)r=(i.words[p]|0)+s,this.words[p]=r&67108863,s=r>>>26;if(this.length=i.length,s!==0)this.words[this.length]=s,this.length++;else if(i!==this)for(;p<i.length;p++)this.words[p]=i.words[p];return this},"iadd"),o.prototype.add=n(function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},"add"),o.prototype.isub=n(function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,s;i>0?(a=this,s=t):(a=t,s=this);for(var p=0,v=0;v<s.length;v++)r=(a.words[v]|0)-(s.words[v]|0)+p,p=r>>26,this.words[v]=r&67108863;for(;p!==0&&v<a.length;v++)r=(a.words[v]|0)+p,p=r>>26,this.words[v]=r&67108863;if(p===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},"isub"),o.prototype.sub=n(function(t){return this.clone().isub(t)},"sub");function x(c,t,r){r.negative=t.negative^c.negative;var i=c.length+t.length|0;r.length=i,i=i-1|0;var a=c.words[0]|0,s=t.words[0]|0,p=a*s,v=p&67108863,h=p/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var f=h>>>26,A=h&67108863,k=Math.min(e,t.length-1),I=Math.max(0,e-c.length+1);I<=k;I++){var N=e-I|0;a=c.words[N]|0,s=t.words[I]|0,p=a*s+A,f+=p/67108864|0,A=p&67108863}r.words