@ar.io/sdk 2.4.0 → 2.5.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var Xfe=Object.create;var Ib=Object.defineProperty;var Qfe=Object.getOwnPropertyDescriptor;var eue=Object.getOwnPropertyNames;var tue=Object.getPrototypeOf,rue=Object.prototype.hasOwnProperty;var Si=(t,e)=>()=>(t&&(e=t(t=0)),e);var ht=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ha=(t,e)=>{for(var r in e)Ib(t,r,{get:e[r],enumerable:!0})},MO=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of eue(e))!rue.call(t,i)&&i!==r&&Ib(t,i,{get:()=>e[i],enumerable:!(a=Qfe(e,i))||a.enumerable});return t};var gi=(t,e,r)=>(r=t!=null?Xfe(tue(t)):{},MO(e||!t||!t.__esModule?Ib(r,"default",{value:t,enumerable:!0}):r,t)),ei=t=>MO(Ib({},"__esModule",{value:!0}),t);var ie=Si(()=>{"use strict"});var He={};Ha(He,{_debugEnd:()=>hP,_debugProcess:()=>uP,_events:()=>EP,_eventsCount:()=>AP,_exiting:()=>ZO,_fatalExceptions:()=>aP,_getActiveHandles:()=>VO,_getActiveRequests:()=>WO,_kill:()=>YO,_linkedBinding:()=>jO,_maxListeners:()=>SP,_preload_modules:()=>MP,_rawDebug:()=>qO,_startProfilerIdleNotifier:()=>cP,_stopProfilerIdleNotifier:()=>lP,_tickCallback:()=>fP,abort:()=>mP,addListener:()=>RP,allowedNodeEnvironmentFlags:()=>rP,arch:()=>RO,argv:()=>IO,argv0:()=>_P,assert:()=>iP,binding:()=>CO,chdir:()=>DO,config:()=>HO,cpuUsage:()=>Pb,cwd:()=>$O,debugPort:()=>wP,default:()=>LP,dlopen:()=>KO,domain:()=>zO,emit:()=>OP,emitWarning:()=>NO,env:()=>kO,execArgv:()=>BO,execPath:()=>yP,exit:()=>eP,features:()=>nP,hasUncaughtExceptionCaptureCallback:()=>sP,hrtime:()=>Ob,kill:()=>QO,listeners:()=>CP,memoryUsage:()=>XO,moduleLoadList:()=>FO,nextTick:()=>SO,off:()=>kP,on:()=>Gu,once:()=>TP,openStdin:()=>tP,pid:()=>gP,platform:()=>TO,ppid:()=>bP,prependListener:()=>PP,prependOnceListener:()=>NP,reallyExit:()=>GO,release:()=>UO,removeAllListeners:()=>BP,removeListener:()=>IP,resourceUsage:()=>JO,setSourceMapsEnabled:()=>xP,setUncaughtExceptionCaptureCallback:()=>oP,stderr:()=>pP,stdin:()=>vP,stdout:()=>dP,title:()=>AO,umask:()=>LO,uptime:()=>Kd,version:()=>OO,versions:()=>PO});function Jw(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function iue(){!Hd||!Pl||(Hd=!1,Pl.length?Vu=Pl.concat(Vu):Bb=-1,Vu.length&&xO())}function xO(){if(!Hd){var t=setTimeout(iue,0);Hd=!0;for(var e=Vu.length;e;){for(Pl=Vu,Vu=[];++Bb<e;)Pl&&Pl[Bb].run();Bb=-1,e=Vu.length}Pl=null,Hd=!1,clearTimeout(t)}}function SO(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];Vu.push(new EO(t,e)),Vu.length===1&&!Hd&&setTimeout(xO,0)}function EO(t,e){this.fun=t,this.array=e}function pa(){}function jO(t){Jw("_linkedBinding")}function KO(t){Jw("dlopen")}function WO(){return[]}function VO(){return[]}function iP(t,e){if(!t)throw new Error(e||"assertion error")}function sP(){return!1}function Kd(){return nc.now()/1e3}function Ob(t){var e=Math.floor((Date.now()-nc.now())*.001),r=nc.now()*.001,a=Math.floor(r)+e,i=Math.floor(r%1*1e9);return t&&(a=a-t[0],i=i-t[1],i<0&&(a--,i+=Yw)),[a,i]}function Gu(){return LP}function CP(t){return[]}var Vu,Hd,Pl,Bb,AO,RO,TO,kO,IO,BO,OO,PO,NO,CO,LO,$O,DO,UO,qO,FO,zO,ZO,HO,GO,YO,Pb,JO,XO,QO,eP,tP,rP,nP,aP,oP,fP,uP,hP,cP,lP,dP,pP,vP,mP,gP,bP,yP,wP,_P,MP,xP,nc,Gw,Yw,SP,EP,AP,RP,TP,kP,IP,BP,OP,PP,NP,LP,Nb=Si(()=>{"use strict";ie();ae();ne();Vu=[],Hd=!1,Bb=-1;EO.prototype.run=function(){this.fun.apply(null,this.array)};AO="browser",RO="x64",TO="browser",kO={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},IO=["/usr/bin/node"],BO=[],OO="v16.8.0",PO={},NO=function(t,e){console.warn((e?e+": ":"")+t)},CO=function(t){Jw("binding")},LO=function(t){return 0},$O=function(){return"/"},DO=function(t){},UO={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};qO=pa,FO=[];zO={},ZO=!1,HO={};GO=pa,YO=pa,Pb=function(){return{}},JO=Pb,XO=Pb,QO=pa,eP=pa,tP=pa,rP={};nP={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},aP=pa,oP=pa;fP=pa,uP=pa,hP=pa,cP=pa,lP=pa,dP=void 0,pP=void 0,vP=void 0,mP=pa,gP=2,bP=1,yP="/bin/usr/node",wP=9229,_P="node",MP=[],xP=pa,nc={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};nc.now===void 0&&(Gw=Date.now(),nc.timing&&nc.timing.navigationStart&&(Gw=nc.timing.navigationStart),nc.now=()=>Date.now()-Gw);Yw=1e9;Ob.bigint=function(t){var e=Ob(t);return typeof BigInt>"u"?e[0]*Yw+e[1]:BigInt(e[0]*Yw)+BigInt(e[1])};SP=10,EP={},AP=0;RP=Gu,TP=Gu,kP=Gu,IP=Gu,BP=Gu,OP=pa,PP=Gu,NP=Gu;LP={version:OO,versions:PO,arch:RO,platform:TO,release:UO,_rawDebug:qO,moduleLoadList:FO,binding:CO,_linkedBinding:jO,_events:EP,_eventsCount:AP,_maxListeners:SP,on:Gu,addListener:RP,once:TP,off:kP,removeListener:IP,removeAllListeners:BP,emit:OP,prependListener:PP,prependOnceListener:NP,listeners:CP,domain:zO,_exiting:ZO,config:HO,dlopen:KO,uptime:Kd,_getActiveRequests:WO,_getActiveHandles:VO,reallyExit:GO,_kill:YO,cpuUsage:Pb,resourceUsage:JO,memoryUsage:XO,kill:QO,exit:eP,openStdin:tP,allowedNodeEnvironmentFlags:rP,assert:iP,features:nP,_fatalExceptions:aP,setUncaughtExceptionCaptureCallback:oP,hasUncaughtExceptionCaptureCallback:sP,emitWarning:NO,nextTick:SO,_tickCallback:fP,_debugProcess:uP,_debugEnd:hP,_startProfilerIdleNotifier:cP,_stopProfilerIdleNotifier:lP,stdout:dP,stdin:vP,stderr:pP,abort:mP,umask:LO,chdir:DO,cwd:$O,env:kO,title:AO,argv:IO,execArgv:BO,pid:gP,ppid:bP,execPath:yP,debugPort:wP,hrtime:Ob,argv0:_P,_preload_modules:MP,setSourceMapsEnabled:xP}});var ne=Si(()=>{"use strict";Nb()});var Yu={};Ha(Yu,{Buffer:()=>Me,INSPECT_MAX_BYTES:()=>sue,default:()=>ac,kMaxLength:()=>fue});function nue(){if($P)return gv;$P=!0,gv.byteLength=p,gv.toByteArray=g,gv.fromByteArray=x;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,h=a.length;i<h;++i)t[i]=a[i],e[a.charCodeAt(i)]=i;e[45]=62,e[95]=63;function c(E){var A=E.length;if(A%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=E.indexOf("=");k===-1&&(k=A);var O=k===A?0:4-k%4;return[k,O]}function p(E){var A=c(E),k=A[0],O=A[1];return(k+O)*3/4-O}function b(E,A,k){return(A+k)*3/4-k}function g(E){var A,k=c(E),O=k[0],N=k[1],L=new r(b(E,O,N)),C=0,Y=N>0?O-4:O,G;for(G=0;G<Y;G+=4)A=e[E.charCodeAt(G)]<<18|e[E.charCodeAt(G+1)]<<12|e[E.charCodeAt(G+2)]<<6|e[E.charCodeAt(G+3)],L[C++]=A>>16&255,L[C++]=A>>8&255,L[C++]=A&255;return N===2&&(A=e[E.charCodeAt(G)]<<2|e[E.charCodeAt(G+1)]>>4,L[C++]=A&255),N===1&&(A=e[E.charCodeAt(G)]<<10|e[E.charCodeAt(G+1)]<<4|e[E.charCodeAt(G+2)]>>2,L[C++]=A>>8&255,L[C++]=A&255),L}function y(E){return t[E>>18&63]+t[E>>12&63]+t[E>>6&63]+t[E&63]}function M(E,A,k){for(var O,N=[],L=A;L<k;L+=3)O=(E[L]<<16&16711680)+(E[L+1]<<8&65280)+(E[L+2]&255),N.push(y(O));return N.join("")}function x(E){for(var A,k=E.length,O=k%3,N=[],L=16383,C=0,Y=k-O;C<Y;C+=L)N.push(M(E,C,C+L>Y?Y:C+L));return O===1?(A=E[k-1],N.push(t[A>>2]+t[A<<4&63]+"==")):O===2&&(A=(E[k-2]<<8)+E[k-1],N.push(t[A>>10]+t[A>>4&63]+t[A<<2&63]+"=")),N.join("")}return gv}function aue(){if(DP)return Cb;DP=!0;return Cb.read=function(t,e,r,a,i){var h,c,p=i*8-a-1,b=(1<<p)-1,g=b>>1,y=-7,M=r?i-1:0,x=r?-1:1,E=t[e+M];for(M+=x,h=E&(1<<-y)-1,E>>=-y,y+=p;y>0;h=h*256+t[e+M],M+=x,y-=8);for(c=h&(1<<-y)-1,h>>=-y,y+=a;y>0;c=c*256+t[e+M],M+=x,y-=8);if(h===0)h=1-g;else{if(h===b)return c?NaN:(E?-1:1)*(1/0);c=c+Math.pow(2,a),h=h-g}return(E?-1:1)*c*Math.pow(2,h-a)},Cb.write=function(t,e,r,a,i,h){var c,p,b,g=h*8-i-1,y=(1<<g)-1,M=y>>1,x=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=a?0:h-1,A=a?1:-1,k=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(p=isNaN(e)?1:0,c=y):(c=Math.floor(Math.log(e)/Math.LN2),e*(b=Math.pow(2,-c))<1&&(c--,b*=2),c+M>=1?e+=x/b:e+=x*Math.pow(2,1-M),e*b>=2&&(c++,b/=2),c+M>=y?(p=0,c=y):c+M>=1?(p=(e*b-1)*Math.pow(2,i),c=c+M):(p=e*Math.pow(2,M-1)*Math.pow(2,i),c=0));i>=8;t[r+E]=p&255,E+=A,p/=256,i-=8);for(c=c<<i|p,g+=i;g>0;t[r+E]=c&255,E+=A,c/=256,g-=8);t[r+E-A]|=k*128},Cb}function oue(){if(UP)return Nl;UP=!0;let t=nue(),e=aue(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Nl.Buffer=c,Nl.SlowBuffer=N,Nl.INSPECT_MAX_BYTES=50;let a=2147483647;Nl.kMaxLength=a,c.TYPED_ARRAY_SUPPORT=i(),!c.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 i(){try{let z=new Uint8Array(1),T={foo:function(){return 42}};return Object.setPrototypeOf(T,Uint8Array.prototype),Object.setPrototypeOf(z,T),z.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function h(z){if(z>a)throw new RangeError('The value "'+z+'" is invalid for option "size"');let T=new Uint8Array(z);return Object.setPrototypeOf(T,c.prototype),T}function c(z,T,I){if(typeof z=="number"){if(typeof T=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return y(z)}return p(z,T,I)}c.poolSize=8192;function p(z,T,I){if(typeof z=="string")return M(z,T);if(ArrayBuffer.isView(z))return E(z);if(z==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z);if(Se(z,ArrayBuffer)||z&&Se(z.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Se(z,SharedArrayBuffer)||z&&Se(z.buffer,SharedArrayBuffer)))return A(z,T,I);if(typeof z=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let P=z.valueOf&&z.valueOf();if(P!=null&&P!==z)return c.from(P,T,I);let U=k(z);if(U)return U;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof z[Symbol.toPrimitive]=="function")return c.from(z[Symbol.toPrimitive]("string"),T,I);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z)}c.from=function(z,T,I){return p(z,T,I)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function b(z){if(typeof z!="number")throw new TypeError('"size" argument must be of type number');if(z<0)throw new RangeError('The value "'+z+'" is invalid for option "size"')}function g(z,T,I){return b(z),z<=0?h(z):T!==void 0?typeof I=="string"?h(z).fill(T,I):h(z).fill(T):h(z)}c.alloc=function(z,T,I){return g(z,T,I)};function y(z){return b(z),h(z<0?0:O(z)|0)}c.allocUnsafe=function(z){return y(z)},c.allocUnsafeSlow=function(z){return y(z)};function M(z,T){if((typeof T!="string"||T==="")&&(T="utf8"),!c.isEncoding(T))throw new TypeError("Unknown encoding: "+T);let I=L(z,T)|0,P=h(I),U=P.write(z,T);return U!==I&&(P=P.slice(0,U)),P}function x(z){let T=z.length<0?0:O(z.length)|0,I=h(T);for(let P=0;P<T;P+=1)I[P]=z[P]&255;return I}function E(z){if(Se(z,Uint8Array)){let T=new Uint8Array(z);return A(T.buffer,T.byteOffset,T.byteLength)}return x(z)}function A(z,T,I){if(T<0||z.byteLength<T)throw new RangeError('"offset" is outside of buffer bounds');if(z.byteLength<T+(I||0))throw new RangeError('"length" is outside of buffer bounds');let P;return T===void 0&&I===void 0?P=new Uint8Array(z):I===void 0?P=new Uint8Array(z,T):P=new Uint8Array(z,T,I),Object.setPrototypeOf(P,c.prototype),P}function k(z){if(c.isBuffer(z)){let T=O(z.length)|0,I=h(T);return I.length===0||z.copy(I,0,0,T),I}if(z.length!==void 0)return typeof z.length!="number"||ut(z.length)?h(0):x(z);if(z.type==="Buffer"&&Array.isArray(z.data))return x(z.data)}function O(z){if(z>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return z|0}function N(z){return+z!=z&&(z=0),c.alloc(+z)}c.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==c.prototype},c.compare=function(T,I){if(Se(T,Uint8Array)&&(T=c.from(T,T.offset,T.byteLength)),Se(I,Uint8Array)&&(I=c.from(I,I.offset,I.byteLength)),!c.isBuffer(T)||!c.isBuffer(I))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===I)return 0;let P=T.length,U=I.length;for(let H=0,W=Math.min(P,U);H<W;++H)if(T[H]!==I[H]){P=T[H],U=I[H];break}return P<U?-1:U<P?1:0},c.isEncoding=function(T){switch(String(T).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(T,I){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return c.alloc(0);let P;if(I===void 0)for(I=0,P=0;P<T.length;++P)I+=T[P].length;let U=c.allocUnsafe(I),H=0;for(P=0;P<T.length;++P){let W=T[P];if(Se(W,Uint8Array))H+W.length>U.length?(c.isBuffer(W)||(W=c.from(W)),W.copy(U,H)):Uint8Array.prototype.set.call(U,W,H);else if(c.isBuffer(W))W.copy(U,H);else throw new TypeError('"list" argument must be an Array of Buffers');H+=W.length}return U};function L(z,T){if(c.isBuffer(z))return z.length;if(ArrayBuffer.isView(z)||Se(z,ArrayBuffer))return z.byteLength;if(typeof z!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof z);let I=z.length,P=arguments.length>2&&arguments[2]===!0;if(!P&&I===0)return 0;let U=!1;for(;;)switch(T){case"ascii":case"latin1":case"binary":return I;case"utf8":case"utf-8":return Te(z).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I*2;case"hex":return I>>>1;case"base64":return ot(z).length;default:if(U)return P?-1:Te(z).length;T=(""+T).toLowerCase(),U=!0}}c.byteLength=L;function C(z,T,I){let P=!1;if((T===void 0||T<0)&&(T=0),T>this.length||((I===void 0||I>this.length)&&(I=this.length),I<=0)||(I>>>=0,T>>>=0,I<=T))return"";for(z||(z="utf8");;)switch(z){case"hex":return d(this,T,I);case"utf8":case"utf-8":return f(this,T,I);case"ascii":return m(this,T,I);case"latin1":case"binary":return w(this,T,I);case"base64":return s(this,T,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o(this,T,I);default:if(P)throw new TypeError("Unknown encoding: "+z);z=(z+"").toLowerCase(),P=!0}}c.prototype._isBuffer=!0;function Y(z,T,I){let P=z[T];z[T]=z[I],z[I]=P}c.prototype.swap16=function(){let T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let I=0;I<T;I+=2)Y(this,I,I+1);return this},c.prototype.swap32=function(){let T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let I=0;I<T;I+=4)Y(this,I,I+3),Y(this,I+1,I+2);return this},c.prototype.swap64=function(){let T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let I=0;I<T;I+=8)Y(this,I,I+7),Y(this,I+1,I+6),Y(this,I+2,I+5),Y(this,I+3,I+4);return this},c.prototype.toString=function(){let T=this.length;return T===0?"":arguments.length===0?f(this,0,T):C.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(T){if(!c.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:c.compare(this,T)===0},c.prototype.inspect=function(){let T="",I=Nl.INSPECT_MAX_BYTES;return T=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I&&(T+=" ... "),"<Buffer "+T+">"},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function(T,I,P,U,H){if(Se(T,Uint8Array)&&(T=c.from(T,T.offset,T.byteLength)),!c.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(I===void 0&&(I=0),P===void 0&&(P=T?T.length:0),U===void 0&&(U=0),H===void 0&&(H=this.length),I<0||P>T.length||U<0||H>this.length)throw new RangeError("out of range index");if(U>=H&&I>=P)return 0;if(U>=H)return-1;if(I>=P)return 1;if(I>>>=0,P>>>=0,U>>>=0,H>>>=0,this===T)return 0;let W=H-U,fe=P-I,st=Math.min(W,fe),ue=this.slice(U,H),me=T.slice(I,P);for(let pe=0;pe<st;++pe)if(ue[pe]!==me[pe]){W=ue[pe],fe=me[pe];break}return W<fe?-1:fe<W?1:0};function G(z,T,I,P,U){if(z.length===0)return-1;if(typeof I=="string"?(P=I,I=0):I>2147483647?I=2147483647:I<-2147483648&&(I=-2147483648),I=+I,ut(I)&&(I=U?0:z.length-1),I<0&&(I=z.length+I),I>=z.length){if(U)return-1;I=z.length-1}else if(I<0)if(U)I=0;else return-1;if(typeof T=="string"&&(T=c.from(T,P)),c.isBuffer(T))return T.length===0?-1:ee(z,T,I,P,U);if(typeof T=="number")return T=T&255,typeof Uint8Array.prototype.indexOf=="function"?U?Uint8Array.prototype.indexOf.call(z,T,I):Uint8Array.prototype.lastIndexOf.call(z,T,I):ee(z,[T],I,P,U);throw new TypeError("val must be string, number or Buffer")}function ee(z,T,I,P,U){let H=1,W=z.length,fe=T.length;if(P!==void 0&&(P=String(P).toLowerCase(),P==="ucs2"||P==="ucs-2"||P==="utf16le"||P==="utf-16le")){if(z.length<2||T.length<2)return-1;H=2,W/=2,fe/=2,I/=2}function st(me,pe){return H===1?me[pe]:me.readUInt16BE(pe*H)}let ue;if(U){let me=-1;for(ue=I;ue<W;ue++)if(st(z,ue)===st(T,me===-1?0:ue-me)){if(me===-1&&(me=ue),ue-me+1===fe)return me*H}else me!==-1&&(ue-=ue-me),me=-1}else for(I+fe>W&&(I=W-fe),ue=I;ue>=0;ue--){let me=!0;for(let pe=0;pe<fe;pe++)if(st(z,ue+pe)!==st(T,pe)){me=!1;break}if(me)return ue}return-1}c.prototype.includes=function(T,I,P){return this.indexOf(T,I,P)!==-1},c.prototype.indexOf=function(T,I,P){return G(this,T,I,P,!0)},c.prototype.lastIndexOf=function(T,I,P){return G(this,T,I,P,!1)};function $(z,T,I,P){I=Number(I)||0;let U=z.length-I;P?(P=Number(P),P>U&&(P=U)):P=U;let H=T.length;P>H/2&&(P=H/2);let W;for(W=0;W<P;++W){let fe=parseInt(T.substr(W*2,2),16);if(ut(fe))return W;z[I+W]=fe}return W}function q(z,T,I,P){return ge(Te(T,z.length-I),z,I,P)}function V(z,T,I,P){return ge(oe(T),z,I,P)}function _(z,T,I,P){return ge(ot(T),z,I,P)}function n(z,T,I,P){return ge(le(T,z.length-I),z,I,P)}c.prototype.write=function(T,I,P,U){if(I===void 0)U="utf8",P=this.length,I=0;else if(P===void 0&&typeof I=="string")U=I,P=this.length,I=0;else if(isFinite(I))I=I>>>0,isFinite(P)?(P=P>>>0,U===void 0&&(U="utf8")):(U=P,P=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let H=this.length-I;if((P===void 0||P>H)&&(P=H),T.length>0&&(P<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let W=!1;for(;;)switch(U){case"hex":return $(this,T,I,P);case"utf8":case"utf-8":return q(this,T,I,P);case"ascii":case"latin1":case"binary":return V(this,T,I,P);case"base64":return _(this,T,I,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n(this,T,I,P);default:if(W)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),W=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function s(z,T,I){return T===0&&I===z.length?t.fromByteArray(z):t.fromByteArray(z.slice(T,I))}function f(z,T,I){I=Math.min(z.length,I);let P=[],U=T;for(;U<I;){let H=z[U],W=null,fe=H>239?4:H>223?3:H>191?2:1;if(U+fe<=I){let st,ue,me,pe;switch(fe){case 1:H<128&&(W=H);break;case 2:st=z[U+1],(st&192)===128&&(pe=(H&31)<<6|st&63,pe>127&&(W=pe));break;case 3:st=z[U+1],ue=z[U+2],(st&192)===128&&(ue&192)===128&&(pe=(H&15)<<12|(st&63)<<6|ue&63,pe>2047&&(pe<55296||pe>57343)&&(W=pe));break;case 4:st=z[U+1],ue=z[U+2],me=z[U+3],(st&192)===128&&(ue&192)===128&&(me&192)===128&&(pe=(H&15)<<18|(st&63)<<12|(ue&63)<<6|me&63,pe>65535&&pe<1114112&&(W=pe))}}W===null?(W=65533,fe=1):W>65535&&(W-=65536,P.push(W>>>10&1023|55296),W=56320|W&1023),P.push(W),U+=fe}return l(P)}let u=4096;function l(z){let T=z.length;if(T<=u)return String.fromCharCode.apply(String,z);let I="",P=0;for(;P<T;)I+=String.fromCharCode.apply(String,z.slice(P,P+=u));return I}function m(z,T,I){let P="";I=Math.min(z.length,I);for(let U=T;U<I;++U)P+=String.fromCharCode(z[U]&127);return P}function w(z,T,I){let P="";I=Math.min(z.length,I);for(let U=T;U<I;++U)P+=String.fromCharCode(z[U]);return P}function d(z,T,I){let P=z.length;(!T||T<0)&&(T=0),(!I||I<0||I>P)&&(I=P);let U="";for(let H=T;H<I;++H)U+=Ze[z[H]];return U}function o(z,T,I){let P=z.slice(T,I),U="";for(let H=0;H<P.length-1;H+=2)U+=String.fromCharCode(P[H]+P[H+1]*256);return U}c.prototype.slice=function(T,I){let P=this.length;T=~~T,I=I===void 0?P:~~I,T<0?(T+=P,T<0&&(T=0)):T>P&&(T=P),I<0?(I+=P,I<0&&(I=0)):I>P&&(I=P),I<T&&(I=T);let U=this.subarray(T,I);return Object.setPrototypeOf(U,c.prototype),U};function v(z,T,I){if(z%1!==0||z<0)throw new RangeError("offset is not uint");if(z+T>I)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(T,I,P){T=T>>>0,I=I>>>0,P||v(T,I,this.length);let U=this[T],H=1,W=0;for(;++W<I&&(H*=256);)U+=this[T+W]*H;return U},c.prototype.readUintBE=c.prototype.readUIntBE=function(T,I,P){T=T>>>0,I=I>>>0,P||v(T,I,this.length);let U=this[T+--I],H=1;for(;I>0&&(H*=256);)U+=this[T+--I]*H;return U},c.prototype.readUint8=c.prototype.readUInt8=function(T,I){return T=T>>>0,I||v(T,1,this.length),this[T]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(T,I){return T=T>>>0,I||v(T,2,this.length),this[T]|this[T+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(T,I){return T=T>>>0,I||v(T,2,this.length),this[T]<<8|this[T+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(T,I){return T=T>>>0,I||v(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(T,I){return T=T>>>0,I||v(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},c.prototype.readBigUInt64LE=Ge(function(T){T=T>>>0,j(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&J(T,this.length-8);let U=I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,H=this[++T]+this[++T]*2**8+this[++T]*2**16+P*2**24;return BigInt(U)+(BigInt(H)<<BigInt(32))}),c.prototype.readBigUInt64BE=Ge(function(T){T=T>>>0,j(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&J(T,this.length-8);let U=I*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],H=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+P;return(BigInt(U)<<BigInt(32))+BigInt(H)}),c.prototype.readIntLE=function(T,I,P){T=T>>>0,I=I>>>0,P||v(T,I,this.length);let U=this[T],H=1,W=0;for(;++W<I&&(H*=256);)U+=this[T+W]*H;return H*=128,U>=H&&(U-=Math.pow(2,8*I)),U},c.prototype.readIntBE=function(T,I,P){T=T>>>0,I=I>>>0,P||v(T,I,this.length);let U=I,H=1,W=this[T+--U];for(;U>0&&(H*=256);)W+=this[T+--U]*H;return H*=128,W>=H&&(W-=Math.pow(2,8*I)),W},c.prototype.readInt8=function(T,I){return T=T>>>0,I||v(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},c.prototype.readInt16LE=function(T,I){T=T>>>0,I||v(T,2,this.length);let P=this[T]|this[T+1]<<8;return P&32768?P|4294901760:P},c.prototype.readInt16BE=function(T,I){T=T>>>0,I||v(T,2,this.length);let P=this[T+1]|this[T]<<8;return P&32768?P|4294901760:P},c.prototype.readInt32LE=function(T,I){return T=T>>>0,I||v(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},c.prototype.readInt32BE=function(T,I){return T=T>>>0,I||v(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},c.prototype.readBigInt64LE=Ge(function(T){T=T>>>0,j(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&J(T,this.length-8);let U=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(P<<24);return(BigInt(U)<<BigInt(32))+BigInt(I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),c.prototype.readBigInt64BE=Ge(function(T){T=T>>>0,j(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&J(T,this.length-8);let U=(I<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(U)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+P)}),c.prototype.readFloatLE=function(T,I){return T=T>>>0,I||v(T,4,this.length),e.read(this,T,!0,23,4)},c.prototype.readFloatBE=function(T,I){return T=T>>>0,I||v(T,4,this.length),e.read(this,T,!1,23,4)},c.prototype.readDoubleLE=function(T,I){return T=T>>>0,I||v(T,8,this.length),e.read(this,T,!0,52,8)},c.prototype.readDoubleBE=function(T,I){return T=T>>>0,I||v(T,8,this.length),e.read(this,T,!1,52,8)};function R(z,T,I,P,U,H){if(!c.isBuffer(z))throw new TypeError('"buffer" argument must be a Buffer instance');if(T>U||T<H)throw new RangeError('"value" argument is out of bounds');if(I+P>z.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(T,I,P,U){if(T=+T,I=I>>>0,P=P>>>0,!U){let fe=Math.pow(2,8*P)-1;R(this,T,I,P,fe,0)}let H=1,W=0;for(this[I]=T&255;++W<P&&(H*=256);)this[I+W]=T/H&255;return I+P},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(T,I,P,U){if(T=+T,I=I>>>0,P=P>>>0,!U){let fe=Math.pow(2,8*P)-1;R(this,T,I,P,fe,0)}let H=P-1,W=1;for(this[I+H]=T&255;--H>=0&&(W*=256);)this[I+H]=T/W&255;return I+P},c.prototype.writeUint8=c.prototype.writeUInt8=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,1,255,0),this[I]=T&255,I+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,2,65535,0),this[I]=T&255,this[I+1]=T>>>8,I+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,2,65535,0),this[I]=T>>>8,this[I+1]=T&255,I+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,4,4294967295,0),this[I+3]=T>>>24,this[I+2]=T>>>16,this[I+1]=T>>>8,this[I]=T&255,I+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,4,4294967295,0),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4};function S(z,T,I,P,U){te(T,P,U,z,I,7);let H=Number(T&BigInt(4294967295));z[I++]=H,H=H>>8,z[I++]=H,H=H>>8,z[I++]=H,H=H>>8,z[I++]=H;let W=Number(T>>BigInt(32)&BigInt(4294967295));return z[I++]=W,W=W>>8,z[I++]=W,W=W>>8,z[I++]=W,W=W>>8,z[I++]=W,I}function B(z,T,I,P,U){te(T,P,U,z,I,7);let H=Number(T&BigInt(4294967295));z[I+7]=H,H=H>>8,z[I+6]=H,H=H>>8,z[I+5]=H,H=H>>8,z[I+4]=H;let W=Number(T>>BigInt(32)&BigInt(4294967295));return z[I+3]=W,W=W>>8,z[I+2]=W,W=W>>8,z[I+1]=W,W=W>>8,z[I]=W,I+8}c.prototype.writeBigUInt64LE=Ge(function(T,I=0){return S(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=Ge(function(T,I=0){return B(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(T,I,P,U){if(T=+T,I=I>>>0,!U){let st=Math.pow(2,8*P-1);R(this,T,I,P,st-1,-st)}let H=0,W=1,fe=0;for(this[I]=T&255;++H<P&&(W*=256);)T<0&&fe===0&&this[I+H-1]!==0&&(fe=1),this[I+H]=(T/W>>0)-fe&255;return I+P},c.prototype.writeIntBE=function(T,I,P,U){if(T=+T,I=I>>>0,!U){let st=Math.pow(2,8*P-1);R(this,T,I,P,st-1,-st)}let H=P-1,W=1,fe=0;for(this[I+H]=T&255;--H>=0&&(W*=256);)T<0&&fe===0&&this[I+H+1]!==0&&(fe=1),this[I+H]=(T/W>>0)-fe&255;return I+P},c.prototype.writeInt8=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,1,127,-128),T<0&&(T=255+T+1),this[I]=T&255,I+1},c.prototype.writeInt16LE=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,2,32767,-32768),this[I]=T&255,this[I+1]=T>>>8,I+2},c.prototype.writeInt16BE=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,2,32767,-32768),this[I]=T>>>8,this[I+1]=T&255,I+2},c.prototype.writeInt32LE=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,4,2147483647,-2147483648),this[I]=T&255,this[I+1]=T>>>8,this[I+2]=T>>>16,this[I+3]=T>>>24,I+4},c.prototype.writeInt32BE=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4},c.prototype.writeBigInt64LE=Ge(function(T,I=0){return S(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=Ge(function(T,I=0){return B(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function F(z,T,I,P,U,H){if(I+P>z.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("Index out of range")}function D(z,T,I,P,U){return T=+T,I=I>>>0,U||F(z,T,I,4),e.write(z,T,I,P,23,4),I+4}c.prototype.writeFloatLE=function(T,I,P){return D(this,T,I,!0,P)},c.prototype.writeFloatBE=function(T,I,P){return D(this,T,I,!1,P)};function re(z,T,I,P,U){return T=+T,I=I>>>0,U||F(z,T,I,8),e.write(z,T,I,P,52,8),I+8}c.prototype.writeDoubleLE=function(T,I,P){return re(this,T,I,!0,P)},c.prototype.writeDoubleBE=function(T,I,P){return re(this,T,I,!1,P)},c.prototype.copy=function(T,I,P,U){if(!c.isBuffer(T))throw new TypeError("argument should be a Buffer");if(P||(P=0),!U&&U!==0&&(U=this.length),I>=T.length&&(I=T.length),I||(I=0),U>0&&U<P&&(U=P),U===P||T.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if(P<0||P>=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),T.length-I<U-P&&(U=T.length-I+P);let H=U-P;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(I,P,U):Uint8Array.prototype.set.call(T,this.subarray(P,U),I),H},c.prototype.fill=function(T,I,P,U){if(typeof T=="string"){if(typeof I=="string"?(U=I,I=0,P=this.length):typeof P=="string"&&(U=P,P=this.length),U!==void 0&&typeof U!="string")throw new TypeError("encoding must be a string");if(typeof U=="string"&&!c.isEncoding(U))throw new TypeError("Unknown encoding: "+U);if(T.length===1){let W=T.charCodeAt(0);(U==="utf8"&&W<128||U==="latin1")&&(T=W)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(I<0||this.length<I||this.length<P)throw new RangeError("Out of range index");if(P<=I)return this;I=I>>>0,P=P===void 0?this.length:P>>>0,T||(T=0);let H;if(typeof T=="number")for(H=I;H<P;++H)this[H]=T;else{let W=c.isBuffer(T)?T:c.from(T,U),fe=W.length;if(fe===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(H=0;H<P-I;++H)this[H+I]=W[H%fe]}return this};let Q={};function Z(z,T,I){Q[z]=class extends I{constructor(){super(),Object.defineProperty(this,"message",{value:T.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${z}]`,this.stack,delete this.name}get code(){return z}set code(U){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:U,writable:!0})}toString(){return`${this.name} [${z}]: ${this.message}`}}}Z("ERR_BUFFER_OUT_OF_BOUNDS",function(z){return z?`${z} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Z("ERR_INVALID_ARG_TYPE",function(z,T){return`The "${z}" argument must be of type number. Received type ${typeof T}`},TypeError),Z("ERR_OUT_OF_RANGE",function(z,T,I){let P=`The value of "${z}" is out of range.`,U=I;return Number.isInteger(I)&&Math.abs(I)>2**32?U=K(String(I)):typeof I=="bigint"&&(U=String(I),(I>BigInt(2)**BigInt(32)||I<-(BigInt(2)**BigInt(32)))&&(U=K(U)),U+="n"),P+=` It must be ${T}. Received ${U}`,P},RangeError);function K(z){let T="",I=z.length,P=z[0]==="-"?1:0;for(;I>=P+4;I-=3)T=`_${z.slice(I-3,I)}${T}`;return`${z.slice(0,I)}${T}`}function ce(z,T,I){j(T,"offset"),(z[T]===void 0||z[T+I]===void 0)&&J(T,z.length-(I+1))}function te(z,T,I,P,U,H){if(z>I||z<T){let W=typeof T=="bigint"?"n":"",fe;throw H>3?T===0||T===BigInt(0)?fe=`>= 0${W} and < 2${W} ** ${(H+1)*8}${W}`:fe=`>= -(2${W} ** ${(H+1)*8-1}${W}) and < 2 ** ${(H+1)*8-1}${W}`:fe=`>= ${T}${W} and <= ${I}${W}`,new Q.ERR_OUT_OF_RANGE("value",fe,z)}ce(P,U,H)}function j(z,T){if(typeof z!="number")throw new Q.ERR_INVALID_ARG_TYPE(T,"number",z)}function J(z,T,I){throw Math.floor(z)!==z?(j(z,I),new Q.ERR_OUT_OF_RANGE(I||"offset","an integer",z)):T<0?new Q.ERR_BUFFER_OUT_OF_BOUNDS:new Q.ERR_OUT_OF_RANGE(I||"offset",`>= ${I?1:0} and <= ${T}`,z)}let X=/[^+/0-9A-Za-z-_]/g;function he(z){if(z=z.split("=")[0],z=z.trim().replace(X,""),z.length<2)return"";for(;z.length%4!==0;)z=z+"=";return z}function Te(z,T){T=T||1/0;let I,P=z.length,U=null,H=[];for(let W=0;W<P;++W){if(I=z.charCodeAt(W),I>55295&&I<57344){if(!U){if(I>56319){(T-=3)>-1&&H.push(239,191,189);continue}else if(W+1===P){(T-=3)>-1&&H.push(239,191,189);continue}U=I;continue}if(I<56320){(T-=3)>-1&&H.push(239,191,189),U=I;continue}I=(U-55296<<10|I-56320)+65536}else U&&(T-=3)>-1&&H.push(239,191,189);if(U=null,I<128){if((T-=1)<0)break;H.push(I)}else if(I<2048){if((T-=2)<0)break;H.push(I>>6|192,I&63|128)}else if(I<65536){if((T-=3)<0)break;H.push(I>>12|224,I>>6&63|128,I&63|128)}else if(I<1114112){if((T-=4)<0)break;H.push(I>>18|240,I>>12&63|128,I>>6&63|128,I&63|128)}else throw new Error("Invalid code point")}return H}function oe(z){let T=[];for(let I=0;I<z.length;++I)T.push(z.charCodeAt(I)&255);return T}function le(z,T){let I,P,U,H=[];for(let W=0;W<z.length&&!((T-=2)<0);++W)I=z.charCodeAt(W),P=I>>8,U=I%256,H.push(U),H.push(P);return H}function ot(z){return t.toByteArray(he(z))}function ge(z,T,I,P){let U;for(U=0;U<P&&!(U+I>=T.length||U>=z.length);++U)T[U+I]=z[U];return U}function Se(z,T){return z instanceof T||z!=null&&z.constructor!=null&&z.constructor.name!=null&&z.constructor.name===T.name}function ut(z){return z!==z}let Ze=function(){let z="0123456789abcdef",T=new Array(256);for(let I=0;I<16;++I){let P=I*16;for(let U=0;U<16;++U)T[P+U]=z[I]+z[U]}return T}();function Ge(z){return typeof BigInt>"u"?ct:z}function ct(){throw new Error("BigInt not supported")}return Nl}var gv,$P,Cb,DP,Nl,UP,ac,Me,sue,fue,co=Si(()=>{"use strict";ie();ae();ne();gv={},$P=!1;Cb={},DP=!1;Nl={},UP=!1;ac=oue();ac.Buffer;ac.SlowBuffer;ac.INSPECT_MAX_BYTES;ac.kMaxLength;Me=ac.Buffer,sue=ac.INSPECT_MAX_BYTES,fue=ac.kMaxLength});var ae=Si(()=>{"use strict";co()});var qP=ht(Qw=>{"use strict";ie();ae();ne();Object.defineProperty(Qw,"__esModule",{value:!0});function uue(t){var e=4,r=t.length,a=r%e;if(!a)return t;var i=r,h=e-a,c=r+h,p=Me.alloc(c);for(p.write(t);h--;)p.write("=",i++);return p.toString()}Qw.default=uue});var jP=ht(r5=>{"use strict";ie();ae();ne();Object.defineProperty(r5,"__esModule",{value:!0});var hue=qP();function FP(t,e){return e===void 0&&(e="utf8"),Me.isBuffer(t)?e5(t.toString("base64")):e5(Me.from(t,e).toString("base64"))}function cue(t,e){return e===void 0&&(e="utf8"),Me.from(t5(t),"base64").toString(e)}function t5(t){return t=t.toString(),hue.default(t).replace(/\-/g,"+").replace(/_/g,"/")}function e5(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function lue(t){return Me.from(t5(t),"base64")}var Wd=FP;Wd.encode=FP;Wd.decode=cue;Wd.toBase64=t5;Wd.fromBase64=e5;Wd.toBuffer=lue;r5.default=Wd});var Do=ht((Sqe,Lb)=>{"use strict";ie();ae();ne();Lb.exports=jP().default;Lb.exports.default=Lb.exports});function Pi(){Pi.init.call(this)}function $b(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function XP(t){return t._maxListeners===void 0?Pi.defaultMaxListeners:t._maxListeners}function KP(t,e,r,a){var i,h,c,p;if($b(r),(h=t._events)===void 0?(h=t._events=Object.create(null),t._eventsCount=0):(h.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),h=t._events),c=h[e]),c===void 0)c=h[e]=r,++t._eventsCount;else if(typeof c=="function"?c=h[e]=a?[r,c]:[c,r]:a?c.unshift(r):c.push(r),(i=XP(t))>0&&c.length>i&&!c.warned){c.warned=!0;var b=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");b.name="MaxListenersExceededWarning",b.emitter=t,b.type=e,b.count=c.length,p=b,console&&console.warn&&console.warn(p)}return t}function due(){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 WP(t,e,r){var a={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=due.bind(a);return i.listener=r,a.wrapFn=i,i}function VP(t,e,r){var a=t._events;if(a===void 0)return[];var i=a[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?function(h){for(var c=new Array(h.length),p=0;p<c.length;++p)c[p]=h[p].listener||h[p];return c}(i):QP(i,i.length)}function GP(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}function QP(t,e){for(var r=new Array(e),a=0;a<e;++a)r[a]=t[a];return r}var YP,JP,Vd,zP,ZP,HP,Ei,Hs=Si(()=>{"use strict";ie();ae();ne();Vd=typeof Reflect=="object"?Reflect:null,zP=Vd&&typeof Vd.apply=="function"?Vd.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};JP=Vd&&typeof Vd.ownKeys=="function"?Vd.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};ZP=Number.isNaN||function(t){return t!=t};YP=Pi,Pi.EventEmitter=Pi,Pi.prototype._events=void 0,Pi.prototype._eventsCount=0,Pi.prototype._maxListeners=void 0;HP=10;Object.defineProperty(Pi,"defaultMaxListeners",{enumerable:!0,get:function(){return HP},set:function(t){if(typeof t!="number"||t<0||ZP(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");HP=t}}),Pi.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},Pi.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||ZP(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},Pi.prototype.getMaxListeners=function(){return XP(this)},Pi.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var a=t==="error",i=this._events;if(i!==void 0)a=a&&i.error===void 0;else if(!a)return!1;if(a){var h;if(e.length>0&&(h=e[0]),h instanceof Error)throw h;var c=new Error("Unhandled error."+(h?" ("+h.message+")":""));throw c.context=h,c}var p=i[t];if(p===void 0)return!1;if(typeof p=="function")zP(p,this,e);else{var b=p.length,g=QP(p,b);for(r=0;r<b;++r)zP(g[r],this,e)}return!0},Pi.prototype.addListener=function(t,e){return KP(this,t,e,!1)},Pi.prototype.on=Pi.prototype.addListener,Pi.prototype.prependListener=function(t,e){return KP(this,t,e,!0)},Pi.prototype.once=function(t,e){return $b(e),this.on(t,WP(this,t,e)),this},Pi.prototype.prependOnceListener=function(t,e){return $b(e),this.prependListener(t,WP(this,t,e)),this},Pi.prototype.removeListener=function(t,e){var r,a,i,h,c;if($b(e),(a=this._events)===void 0)return this;if((r=a[t])===void 0)return this;if(r===e||r.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete a[t],a.removeListener&&this.emit("removeListener",t,r.listener||e));else if(typeof r!="function"){for(i=-1,h=r.length-1;h>=0;h--)if(r[h]===e||r[h].listener===e){c=r[h].listener,i=h;break}if(i<0)return this;i===0?r.shift():function(p,b){for(;b+1<p.length;b++)p[b]=p[b+1];p.pop()}(r,i),r.length===1&&(a[t]=r[0]),a.removeListener!==void 0&&this.emit("removeListener",t,c||e)}return this},Pi.prototype.off=Pi.prototype.removeListener,Pi.prototype.removeAllListeners=function(t){var e,r,a;if((r=this._events)===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var i,h=Object.keys(r);for(a=0;a<h.length;++a)(i=h[a])!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=r[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(a=e.length-1;a>=0;a--)this.removeListener(t,e[a]);return this},Pi.prototype.listeners=function(t){return VP(this,t,!0)},Pi.prototype.rawListeners=function(t){return VP(this,t,!1)},Pi.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):GP.call(t,e)},Pi.prototype.listenerCount=GP,Pi.prototype.eventNames=function(){return this._eventsCount>0?JP(this._events):[]};Ei=YP;Ei.EventEmitter;Ei.defaultMaxListeners;Ei.init;Ei.listenerCount;Ei.EventEmitter;Ei.defaultMaxListeners;Ei.init;Ei.listenerCount});function i5(){throw new Error("setTimeout has not been defined")}function n5(){throw new Error("clearTimeout has not been defined")}function rN(t){if(Xu===setTimeout)return setTimeout(t,0);if((Xu===i5||!Xu)&&setTimeout)return Xu=setTimeout,setTimeout(t,0);try{return Xu(t,0)}catch{try{return Xu.call(null,t,0)}catch{return Xu.call(this||Yd,t,0)}}}function pue(){Gd&&Cl&&(Gd=!1,Cl.length?eh=Cl.concat(eh):Db=-1,eh.length&&iN())}function iN(){if(!Gd){var t=rN(pue);Gd=!0;for(var e=eh.length;e;){for(Cl=eh,eh=[];++Db<e;)Cl&&Cl[Db].run();Db=-1,e=eh.length}Cl=null,Gd=!1,function(r){if(Qu===clearTimeout)return clearTimeout(r);if((Qu===n5||!Qu)&&clearTimeout)return Qu=clearTimeout,clearTimeout(r);try{Qu(r)}catch{try{return Qu.call(null,r)}catch{return Qu.call(this||Yd,r)}}}(t)}}function eN(t,e){(this||Yd).fun=t,(this||Yd).array=e}function Ju(){}var tN,Xu,Qu,Yd,_n,Cl,eh,Gd,Db,fr,Uo=Si(()=>{"use strict";ie();ae();ne();Yd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,_n=tN={};(function(){try{Xu=typeof setTimeout=="function"?setTimeout:i5}catch{Xu=i5}try{Qu=typeof clearTimeout=="function"?clearTimeout:n5}catch{Qu=n5}})();eh=[],Gd=!1,Db=-1;_n.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];eh.push(new eN(t,e)),eh.length!==1||Gd||rN(iN)},eN.prototype.run=function(){(this||Yd).fun.apply(null,(this||Yd).array)},_n.title="browser",_n.browser=!0,_n.env={},_n.argv=[],_n.version="",_n.versions={},_n.on=Ju,_n.addListener=Ju,_n.once=Ju,_n.off=Ju,_n.removeListener=Ju,_n.removeAllListeners=Ju,_n.emit=Ju,_n.prependListener=Ju,_n.prependOnceListener=Ju,_n.listeners=function(t){return[]},_n.binding=function(t){throw new Error("process.binding is not supported")},_n.cwd=function(){return"/"},_n.chdir=function(t){throw new Error("process.chdir is not supported")},_n.umask=function(){return 0};fr=tN;fr.addListener;fr.argv;fr.binding;fr.browser;fr.chdir;fr.cwd;fr.emit;fr.env;fr.listeners;fr.nextTick;fr.off;fr.on;fr.once;fr.prependListener;fr.prependOnceListener;fr.removeAllListeners;fr.removeListener;fr.title;fr.umask;fr.version;fr.versions});function Dl(t){return t.call.bind(t)}function _v(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch{return!1}}function aN(t){return Ka&&lo?qo(t)!==void 0:wN(t)||_N(t)||MN(t)||xN(t)||SN(t)||EN(t)||AN(t)||RN(t)||TN(t)||kN(t)||IN(t)}function wN(t){return Ka&&lo?qo(t)==="Uint8Array":tn(t)==="[object Uint8Array]"||xue(t)&&t.buffer!==void 0}function _N(t){return Ka&&lo?qo(t)==="Uint8ClampedArray":tn(t)==="[object Uint8ClampedArray]"}function MN(t){return Ka&&lo?qo(t)==="Uint16Array":tn(t)==="[object Uint16Array]"}function xN(t){return Ka&&lo?qo(t)==="Uint32Array":tn(t)==="[object Uint32Array]"}function SN(t){return Ka&&lo?qo(t)==="Int8Array":tn(t)==="[object Int8Array]"}function EN(t){return Ka&&lo?qo(t)==="Int16Array":tn(t)==="[object Int16Array]"}function AN(t){return Ka&&lo?qo(t)==="Int32Array":tn(t)==="[object Int32Array]"}function RN(t){return Ka&&lo?qo(t)==="Float32Array":tn(t)==="[object Float32Array]"}function TN(t){return Ka&&lo?qo(t)==="Float64Array":tn(t)==="[object Float64Array]"}function kN(t){return Ka&&lo?qo(t)==="BigInt64Array":tn(t)==="[object BigInt64Array]"}function IN(t){return Ka&&lo?qo(t)==="BigUint64Array":tn(t)==="[object BigUint64Array]"}function Ub(t){return tn(t)==="[object Map]"}function qb(t){return tn(t)==="[object Set]"}function Fb(t){return tn(t)==="[object WeakMap]"}function a5(t){return tn(t)==="[object WeakSet]"}function Hb(t){return tn(t)==="[object ArrayBuffer]"}function oN(t){return typeof ArrayBuffer<"u"&&(Hb.working?Hb(t):t instanceof ArrayBuffer)}function Kb(t){return tn(t)==="[object DataView]"}function sN(t){return typeof DataView<"u"&&(Kb.working?Kb(t):t instanceof DataView)}function Wb(t){return tn(t)==="[object SharedArrayBuffer]"}function fN(t){return typeof SharedArrayBuffer<"u"&&(Wb.working?Wb(t):t instanceof SharedArrayBuffer)}function uN(t){return _v(t,Tue)}function hN(t){return _v(t,kue)}function cN(t){return _v(t,Iue)}function lN(t){return yN&&_v(t,Bue)}function dN(t){return h5&&_v(t,Oue)}function oc(t,e){var r={seen:[],stylize:Cue};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),c5(e)?r.showHidden=e:e&&gt._extend(r,e),$l(r.showHidden)&&(r.showHidden=!1),$l(r.depth)&&(r.depth=2),$l(r.colors)&&(r.colors=!1),$l(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Nue),Vb(r,t,r.depth)}function Nue(t,e){var r=oc.styles[e];return r?"\x1B["+oc.colors[r][0]+"m"+t+"\x1B["+oc.colors[r][1]+"m":t}function Cue(t,e){return t}function Vb(t,e,r){if(t.customInspect&&e&&Zb(e.inspect)&&e.inspect!==gt.inspect&&(!e.constructor||e.constructor.prototype!==e)){var a=e.inspect(r,t);return Gb(a)||(a=Vb(t,a,r)),a}var i=function(x,E){if($l(E))return x.stylize("undefined","undefined");if(Gb(E)){var A="'"+JSON.stringify(E).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return x.stylize(A,"string")}if(PN(E))return x.stylize(""+E,"number");if(c5(E))return x.stylize(""+E,"boolean");if(Xb(E))return x.stylize("null","null")}(t,e);if(i)return i;var h=Object.keys(e),c=function(x){var E={};return x.forEach(function(A,k){E[A]=!0}),E}(h);if(t.showHidden&&(h=Object.getOwnPropertyNames(e)),wv(e)&&(h.indexOf("message")>=0||h.indexOf("description")>=0))return o5(e);if(h.length===0){if(Zb(e)){var p=e.name?": "+e.name:"";return t.stylize("[Function"+p+"]","special")}if(yv(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Yb(e))return t.stylize(Date.prototype.toString.call(e),"date");if(wv(e))return o5(e)}var b,g="",y=!1,M=["{","}"];return ON(e)&&(y=!0,M=["[","]"]),Zb(e)&&(g=" [Function"+(e.name?": "+e.name:"")+"]"),yv(e)&&(g=" "+RegExp.prototype.toString.call(e)),Yb(e)&&(g=" "+Date.prototype.toUTCString.call(e)),wv(e)&&(g=" "+o5(e)),h.length!==0||y&&e.length!=0?r<0?yv(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),b=y?function(x,E,A,k,O){for(var N=[],L=0,C=E.length;L<C;++L)NN(E,String(L))?N.push(s5(x,E,A,k,String(L),!0)):N.push("");return O.forEach(function(Y){Y.match(/^\d+$/)||N.push(s5(x,E,A,k,Y,!0))}),N}(t,e,r,c,h):h.map(function(x){return s5(t,e,r,c,x,y)}),t.seen.pop(),function(x,E,A){var k=0;return x.reduce(function(O,N){return k++,N.indexOf(`
1
+ var Xfe=Object.create;var Ib=Object.defineProperty;var Qfe=Object.getOwnPropertyDescriptor;var eue=Object.getOwnPropertyNames;var tue=Object.getPrototypeOf,rue=Object.prototype.hasOwnProperty;var Si=(t,e)=>()=>(t&&(e=t(t=0)),e);var ht=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ha=(t,e)=>{for(var r in e)Ib(t,r,{get:e[r],enumerable:!0})},MO=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of eue(e))!rue.call(t,i)&&i!==r&&Ib(t,i,{get:()=>e[i],enumerable:!(a=Qfe(e,i))||a.enumerable});return t};var gi=(t,e,r)=>(r=t!=null?Xfe(tue(t)):{},MO(e||!t||!t.__esModule?Ib(r,"default",{value:t,enumerable:!0}):r,t)),ei=t=>MO(Ib({},"__esModule",{value:!0}),t);var ie=Si(()=>{"use strict"});var He={};Ha(He,{_debugEnd:()=>hP,_debugProcess:()=>uP,_events:()=>EP,_eventsCount:()=>AP,_exiting:()=>ZO,_fatalExceptions:()=>aP,_getActiveHandles:()=>VO,_getActiveRequests:()=>WO,_kill:()=>YO,_linkedBinding:()=>jO,_maxListeners:()=>SP,_preload_modules:()=>MP,_rawDebug:()=>qO,_startProfilerIdleNotifier:()=>cP,_stopProfilerIdleNotifier:()=>lP,_tickCallback:()=>fP,abort:()=>mP,addListener:()=>RP,allowedNodeEnvironmentFlags:()=>rP,arch:()=>RO,argv:()=>IO,argv0:()=>_P,assert:()=>iP,binding:()=>CO,chdir:()=>DO,config:()=>HO,cpuUsage:()=>Pb,cwd:()=>$O,debugPort:()=>wP,default:()=>LP,dlopen:()=>KO,domain:()=>zO,emit:()=>OP,emitWarning:()=>NO,env:()=>kO,execArgv:()=>BO,execPath:()=>yP,exit:()=>eP,features:()=>nP,hasUncaughtExceptionCaptureCallback:()=>sP,hrtime:()=>Ob,kill:()=>QO,listeners:()=>CP,memoryUsage:()=>XO,moduleLoadList:()=>FO,nextTick:()=>SO,off:()=>kP,on:()=>Gu,once:()=>TP,openStdin:()=>tP,pid:()=>gP,platform:()=>TO,ppid:()=>bP,prependListener:()=>PP,prependOnceListener:()=>NP,reallyExit:()=>GO,release:()=>UO,removeAllListeners:()=>BP,removeListener:()=>IP,resourceUsage:()=>JO,setSourceMapsEnabled:()=>xP,setUncaughtExceptionCaptureCallback:()=>oP,stderr:()=>pP,stdin:()=>vP,stdout:()=>dP,title:()=>AO,umask:()=>LO,uptime:()=>Kd,version:()=>OO,versions:()=>PO});function Jw(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function iue(){!Hd||!Pl||(Hd=!1,Pl.length?Vu=Pl.concat(Vu):Bb=-1,Vu.length&&xO())}function xO(){if(!Hd){var t=setTimeout(iue,0);Hd=!0;for(var e=Vu.length;e;){for(Pl=Vu,Vu=[];++Bb<e;)Pl&&Pl[Bb].run();Bb=-1,e=Vu.length}Pl=null,Hd=!1,clearTimeout(t)}}function SO(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];Vu.push(new EO(t,e)),Vu.length===1&&!Hd&&setTimeout(xO,0)}function EO(t,e){this.fun=t,this.array=e}function pa(){}function jO(t){Jw("_linkedBinding")}function KO(t){Jw("dlopen")}function WO(){return[]}function VO(){return[]}function iP(t,e){if(!t)throw new Error(e||"assertion error")}function sP(){return!1}function Kd(){return nc.now()/1e3}function Ob(t){var e=Math.floor((Date.now()-nc.now())*.001),r=nc.now()*.001,a=Math.floor(r)+e,i=Math.floor(r%1*1e9);return t&&(a=a-t[0],i=i-t[1],i<0&&(a--,i+=Yw)),[a,i]}function Gu(){return LP}function CP(t){return[]}var Vu,Hd,Pl,Bb,AO,RO,TO,kO,IO,BO,OO,PO,NO,CO,LO,$O,DO,UO,qO,FO,zO,ZO,HO,GO,YO,Pb,JO,XO,QO,eP,tP,rP,nP,aP,oP,fP,uP,hP,cP,lP,dP,pP,vP,mP,gP,bP,yP,wP,_P,MP,xP,nc,Gw,Yw,SP,EP,AP,RP,TP,kP,IP,BP,OP,PP,NP,LP,Nb=Si(()=>{"use strict";ie();ae();ne();Vu=[],Hd=!1,Bb=-1;EO.prototype.run=function(){this.fun.apply(null,this.array)};AO="browser",RO="x64",TO="browser",kO={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},IO=["/usr/bin/node"],BO=[],OO="v16.8.0",PO={},NO=function(t,e){console.warn((e?e+": ":"")+t)},CO=function(t){Jw("binding")},LO=function(t){return 0},$O=function(){return"/"},DO=function(t){},UO={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};qO=pa,FO=[];zO={},ZO=!1,HO={};GO=pa,YO=pa,Pb=function(){return{}},JO=Pb,XO=Pb,QO=pa,eP=pa,tP=pa,rP={};nP={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},aP=pa,oP=pa;fP=pa,uP=pa,hP=pa,cP=pa,lP=pa,dP=void 0,pP=void 0,vP=void 0,mP=pa,gP=2,bP=1,yP="/bin/usr/node",wP=9229,_P="node",MP=[],xP=pa,nc={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};nc.now===void 0&&(Gw=Date.now(),nc.timing&&nc.timing.navigationStart&&(Gw=nc.timing.navigationStart),nc.now=()=>Date.now()-Gw);Yw=1e9;Ob.bigint=function(t){var e=Ob(t);return typeof BigInt>"u"?e[0]*Yw+e[1]:BigInt(e[0]*Yw)+BigInt(e[1])};SP=10,EP={},AP=0;RP=Gu,TP=Gu,kP=Gu,IP=Gu,BP=Gu,OP=pa,PP=Gu,NP=Gu;LP={version:OO,versions:PO,arch:RO,platform:TO,release:UO,_rawDebug:qO,moduleLoadList:FO,binding:CO,_linkedBinding:jO,_events:EP,_eventsCount:AP,_maxListeners:SP,on:Gu,addListener:RP,once:TP,off:kP,removeListener:IP,removeAllListeners:BP,emit:OP,prependListener:PP,prependOnceListener:NP,listeners:CP,domain:zO,_exiting:ZO,config:HO,dlopen:KO,uptime:Kd,_getActiveRequests:WO,_getActiveHandles:VO,reallyExit:GO,_kill:YO,cpuUsage:Pb,resourceUsage:JO,memoryUsage:XO,kill:QO,exit:eP,openStdin:tP,allowedNodeEnvironmentFlags:rP,assert:iP,features:nP,_fatalExceptions:aP,setUncaughtExceptionCaptureCallback:oP,hasUncaughtExceptionCaptureCallback:sP,emitWarning:NO,nextTick:SO,_tickCallback:fP,_debugProcess:uP,_debugEnd:hP,_startProfilerIdleNotifier:cP,_stopProfilerIdleNotifier:lP,stdout:dP,stdin:vP,stderr:pP,abort:mP,umask:LO,chdir:DO,cwd:$O,env:kO,title:AO,argv:IO,execArgv:BO,pid:gP,ppid:bP,execPath:yP,debugPort:wP,hrtime:Ob,argv0:_P,_preload_modules:MP,setSourceMapsEnabled:xP}});var ne=Si(()=>{"use strict";Nb()});var Yu={};Ha(Yu,{Buffer:()=>Me,INSPECT_MAX_BYTES:()=>sue,default:()=>ac,kMaxLength:()=>fue});function nue(){if($P)return gv;$P=!0,gv.byteLength=p,gv.toByteArray=g,gv.fromByteArray=x;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,h=a.length;i<h;++i)t[i]=a[i],e[a.charCodeAt(i)]=i;e[45]=62,e[95]=63;function c(E){var A=E.length;if(A%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=E.indexOf("=");k===-1&&(k=A);var O=k===A?0:4-k%4;return[k,O]}function p(E){var A=c(E),k=A[0],O=A[1];return(k+O)*3/4-O}function b(E,A,k){return(A+k)*3/4-k}function g(E){var A,k=c(E),O=k[0],N=k[1],L=new r(b(E,O,N)),C=0,Y=N>0?O-4:O,G;for(G=0;G<Y;G+=4)A=e[E.charCodeAt(G)]<<18|e[E.charCodeAt(G+1)]<<12|e[E.charCodeAt(G+2)]<<6|e[E.charCodeAt(G+3)],L[C++]=A>>16&255,L[C++]=A>>8&255,L[C++]=A&255;return N===2&&(A=e[E.charCodeAt(G)]<<2|e[E.charCodeAt(G+1)]>>4,L[C++]=A&255),N===1&&(A=e[E.charCodeAt(G)]<<10|e[E.charCodeAt(G+1)]<<4|e[E.charCodeAt(G+2)]>>2,L[C++]=A>>8&255,L[C++]=A&255),L}function y(E){return t[E>>18&63]+t[E>>12&63]+t[E>>6&63]+t[E&63]}function M(E,A,k){for(var O,N=[],L=A;L<k;L+=3)O=(E[L]<<16&16711680)+(E[L+1]<<8&65280)+(E[L+2]&255),N.push(y(O));return N.join("")}function x(E){for(var A,k=E.length,O=k%3,N=[],L=16383,C=0,Y=k-O;C<Y;C+=L)N.push(M(E,C,C+L>Y?Y:C+L));return O===1?(A=E[k-1],N.push(t[A>>2]+t[A<<4&63]+"==")):O===2&&(A=(E[k-2]<<8)+E[k-1],N.push(t[A>>10]+t[A>>4&63]+t[A<<2&63]+"=")),N.join("")}return gv}function aue(){if(DP)return Cb;DP=!0;return Cb.read=function(t,e,r,a,i){var h,c,p=i*8-a-1,b=(1<<p)-1,g=b>>1,y=-7,M=r?i-1:0,x=r?-1:1,E=t[e+M];for(M+=x,h=E&(1<<-y)-1,E>>=-y,y+=p;y>0;h=h*256+t[e+M],M+=x,y-=8);for(c=h&(1<<-y)-1,h>>=-y,y+=a;y>0;c=c*256+t[e+M],M+=x,y-=8);if(h===0)h=1-g;else{if(h===b)return c?NaN:(E?-1:1)*(1/0);c=c+Math.pow(2,a),h=h-g}return(E?-1:1)*c*Math.pow(2,h-a)},Cb.write=function(t,e,r,a,i,h){var c,p,b,g=h*8-i-1,y=(1<<g)-1,M=y>>1,x=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=a?0:h-1,A=a?1:-1,k=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(p=isNaN(e)?1:0,c=y):(c=Math.floor(Math.log(e)/Math.LN2),e*(b=Math.pow(2,-c))<1&&(c--,b*=2),c+M>=1?e+=x/b:e+=x*Math.pow(2,1-M),e*b>=2&&(c++,b/=2),c+M>=y?(p=0,c=y):c+M>=1?(p=(e*b-1)*Math.pow(2,i),c=c+M):(p=e*Math.pow(2,M-1)*Math.pow(2,i),c=0));i>=8;t[r+E]=p&255,E+=A,p/=256,i-=8);for(c=c<<i|p,g+=i;g>0;t[r+E]=c&255,E+=A,c/=256,g-=8);t[r+E-A]|=k*128},Cb}function oue(){if(UP)return Nl;UP=!0;let t=nue(),e=aue(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Nl.Buffer=c,Nl.SlowBuffer=N,Nl.INSPECT_MAX_BYTES=50;let a=2147483647;Nl.kMaxLength=a,c.TYPED_ARRAY_SUPPORT=i(),!c.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 i(){try{let z=new Uint8Array(1),T={foo:function(){return 42}};return Object.setPrototypeOf(T,Uint8Array.prototype),Object.setPrototypeOf(z,T),z.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function h(z){if(z>a)throw new RangeError('The value "'+z+'" is invalid for option "size"');let T=new Uint8Array(z);return Object.setPrototypeOf(T,c.prototype),T}function c(z,T,I){if(typeof z=="number"){if(typeof T=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return y(z)}return p(z,T,I)}c.poolSize=8192;function p(z,T,I){if(typeof z=="string")return M(z,T);if(ArrayBuffer.isView(z))return E(z);if(z==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z);if(Se(z,ArrayBuffer)||z&&Se(z.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Se(z,SharedArrayBuffer)||z&&Se(z.buffer,SharedArrayBuffer)))return A(z,T,I);if(typeof z=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let P=z.valueOf&&z.valueOf();if(P!=null&&P!==z)return c.from(P,T,I);let U=k(z);if(U)return U;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof z[Symbol.toPrimitive]=="function")return c.from(z[Symbol.toPrimitive]("string"),T,I);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z)}c.from=function(z,T,I){return p(z,T,I)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function b(z){if(typeof z!="number")throw new TypeError('"size" argument must be of type number');if(z<0)throw new RangeError('The value "'+z+'" is invalid for option "size"')}function g(z,T,I){return b(z),z<=0?h(z):T!==void 0?typeof I=="string"?h(z).fill(T,I):h(z).fill(T):h(z)}c.alloc=function(z,T,I){return g(z,T,I)};function y(z){return b(z),h(z<0?0:O(z)|0)}c.allocUnsafe=function(z){return y(z)},c.allocUnsafeSlow=function(z){return y(z)};function M(z,T){if((typeof T!="string"||T==="")&&(T="utf8"),!c.isEncoding(T))throw new TypeError("Unknown encoding: "+T);let I=L(z,T)|0,P=h(I),U=P.write(z,T);return U!==I&&(P=P.slice(0,U)),P}function x(z){let T=z.length<0?0:O(z.length)|0,I=h(T);for(let P=0;P<T;P+=1)I[P]=z[P]&255;return I}function E(z){if(Se(z,Uint8Array)){let T=new Uint8Array(z);return A(T.buffer,T.byteOffset,T.byteLength)}return x(z)}function A(z,T,I){if(T<0||z.byteLength<T)throw new RangeError('"offset" is outside of buffer bounds');if(z.byteLength<T+(I||0))throw new RangeError('"length" is outside of buffer bounds');let P;return T===void 0&&I===void 0?P=new Uint8Array(z):I===void 0?P=new Uint8Array(z,T):P=new Uint8Array(z,T,I),Object.setPrototypeOf(P,c.prototype),P}function k(z){if(c.isBuffer(z)){let T=O(z.length)|0,I=h(T);return I.length===0||z.copy(I,0,0,T),I}if(z.length!==void 0)return typeof z.length!="number"||ut(z.length)?h(0):x(z);if(z.type==="Buffer"&&Array.isArray(z.data))return x(z.data)}function O(z){if(z>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return z|0}function N(z){return+z!=z&&(z=0),c.alloc(+z)}c.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==c.prototype},c.compare=function(T,I){if(Se(T,Uint8Array)&&(T=c.from(T,T.offset,T.byteLength)),Se(I,Uint8Array)&&(I=c.from(I,I.offset,I.byteLength)),!c.isBuffer(T)||!c.isBuffer(I))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===I)return 0;let P=T.length,U=I.length;for(let H=0,W=Math.min(P,U);H<W;++H)if(T[H]!==I[H]){P=T[H],U=I[H];break}return P<U?-1:U<P?1:0},c.isEncoding=function(T){switch(String(T).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(T,I){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return c.alloc(0);let P;if(I===void 0)for(I=0,P=0;P<T.length;++P)I+=T[P].length;let U=c.allocUnsafe(I),H=0;for(P=0;P<T.length;++P){let W=T[P];if(Se(W,Uint8Array))H+W.length>U.length?(c.isBuffer(W)||(W=c.from(W)),W.copy(U,H)):Uint8Array.prototype.set.call(U,W,H);else if(c.isBuffer(W))W.copy(U,H);else throw new TypeError('"list" argument must be an Array of Buffers');H+=W.length}return U};function L(z,T){if(c.isBuffer(z))return z.length;if(ArrayBuffer.isView(z)||Se(z,ArrayBuffer))return z.byteLength;if(typeof z!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof z);let I=z.length,P=arguments.length>2&&arguments[2]===!0;if(!P&&I===0)return 0;let U=!1;for(;;)switch(T){case"ascii":case"latin1":case"binary":return I;case"utf8":case"utf-8":return Te(z).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I*2;case"hex":return I>>>1;case"base64":return ot(z).length;default:if(U)return P?-1:Te(z).length;T=(""+T).toLowerCase(),U=!0}}c.byteLength=L;function C(z,T,I){let P=!1;if((T===void 0||T<0)&&(T=0),T>this.length||((I===void 0||I>this.length)&&(I=this.length),I<=0)||(I>>>=0,T>>>=0,I<=T))return"";for(z||(z="utf8");;)switch(z){case"hex":return d(this,T,I);case"utf8":case"utf-8":return f(this,T,I);case"ascii":return m(this,T,I);case"latin1":case"binary":return w(this,T,I);case"base64":return s(this,T,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o(this,T,I);default:if(P)throw new TypeError("Unknown encoding: "+z);z=(z+"").toLowerCase(),P=!0}}c.prototype._isBuffer=!0;function Y(z,T,I){let P=z[T];z[T]=z[I],z[I]=P}c.prototype.swap16=function(){let T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let I=0;I<T;I+=2)Y(this,I,I+1);return this},c.prototype.swap32=function(){let T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let I=0;I<T;I+=4)Y(this,I,I+3),Y(this,I+1,I+2);return this},c.prototype.swap64=function(){let T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let I=0;I<T;I+=8)Y(this,I,I+7),Y(this,I+1,I+6),Y(this,I+2,I+5),Y(this,I+3,I+4);return this},c.prototype.toString=function(){let T=this.length;return T===0?"":arguments.length===0?f(this,0,T):C.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(T){if(!c.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:c.compare(this,T)===0},c.prototype.inspect=function(){let T="",I=Nl.INSPECT_MAX_BYTES;return T=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I&&(T+=" ... "),"<Buffer "+T+">"},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function(T,I,P,U,H){if(Se(T,Uint8Array)&&(T=c.from(T,T.offset,T.byteLength)),!c.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(I===void 0&&(I=0),P===void 0&&(P=T?T.length:0),U===void 0&&(U=0),H===void 0&&(H=this.length),I<0||P>T.length||U<0||H>this.length)throw new RangeError("out of range index");if(U>=H&&I>=P)return 0;if(U>=H)return-1;if(I>=P)return 1;if(I>>>=0,P>>>=0,U>>>=0,H>>>=0,this===T)return 0;let W=H-U,fe=P-I,st=Math.min(W,fe),ue=this.slice(U,H),me=T.slice(I,P);for(let pe=0;pe<st;++pe)if(ue[pe]!==me[pe]){W=ue[pe],fe=me[pe];break}return W<fe?-1:fe<W?1:0};function G(z,T,I,P,U){if(z.length===0)return-1;if(typeof I=="string"?(P=I,I=0):I>2147483647?I=2147483647:I<-2147483648&&(I=-2147483648),I=+I,ut(I)&&(I=U?0:z.length-1),I<0&&(I=z.length+I),I>=z.length){if(U)return-1;I=z.length-1}else if(I<0)if(U)I=0;else return-1;if(typeof T=="string"&&(T=c.from(T,P)),c.isBuffer(T))return T.length===0?-1:ee(z,T,I,P,U);if(typeof T=="number")return T=T&255,typeof Uint8Array.prototype.indexOf=="function"?U?Uint8Array.prototype.indexOf.call(z,T,I):Uint8Array.prototype.lastIndexOf.call(z,T,I):ee(z,[T],I,P,U);throw new TypeError("val must be string, number or Buffer")}function ee(z,T,I,P,U){let H=1,W=z.length,fe=T.length;if(P!==void 0&&(P=String(P).toLowerCase(),P==="ucs2"||P==="ucs-2"||P==="utf16le"||P==="utf-16le")){if(z.length<2||T.length<2)return-1;H=2,W/=2,fe/=2,I/=2}function st(me,pe){return H===1?me[pe]:me.readUInt16BE(pe*H)}let ue;if(U){let me=-1;for(ue=I;ue<W;ue++)if(st(z,ue)===st(T,me===-1?0:ue-me)){if(me===-1&&(me=ue),ue-me+1===fe)return me*H}else me!==-1&&(ue-=ue-me),me=-1}else for(I+fe>W&&(I=W-fe),ue=I;ue>=0;ue--){let me=!0;for(let pe=0;pe<fe;pe++)if(st(z,ue+pe)!==st(T,pe)){me=!1;break}if(me)return ue}return-1}c.prototype.includes=function(T,I,P){return this.indexOf(T,I,P)!==-1},c.prototype.indexOf=function(T,I,P){return G(this,T,I,P,!0)},c.prototype.lastIndexOf=function(T,I,P){return G(this,T,I,P,!1)};function $(z,T,I,P){I=Number(I)||0;let U=z.length-I;P?(P=Number(P),P>U&&(P=U)):P=U;let H=T.length;P>H/2&&(P=H/2);let W;for(W=0;W<P;++W){let fe=parseInt(T.substr(W*2,2),16);if(ut(fe))return W;z[I+W]=fe}return W}function q(z,T,I,P){return ge(Te(T,z.length-I),z,I,P)}function V(z,T,I,P){return ge(oe(T),z,I,P)}function _(z,T,I,P){return ge(ot(T),z,I,P)}function n(z,T,I,P){return ge(le(T,z.length-I),z,I,P)}c.prototype.write=function(T,I,P,U){if(I===void 0)U="utf8",P=this.length,I=0;else if(P===void 0&&typeof I=="string")U=I,P=this.length,I=0;else if(isFinite(I))I=I>>>0,isFinite(P)?(P=P>>>0,U===void 0&&(U="utf8")):(U=P,P=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let H=this.length-I;if((P===void 0||P>H)&&(P=H),T.length>0&&(P<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let W=!1;for(;;)switch(U){case"hex":return $(this,T,I,P);case"utf8":case"utf-8":return q(this,T,I,P);case"ascii":case"latin1":case"binary":return V(this,T,I,P);case"base64":return _(this,T,I,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n(this,T,I,P);default:if(W)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),W=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function s(z,T,I){return T===0&&I===z.length?t.fromByteArray(z):t.fromByteArray(z.slice(T,I))}function f(z,T,I){I=Math.min(z.length,I);let P=[],U=T;for(;U<I;){let H=z[U],W=null,fe=H>239?4:H>223?3:H>191?2:1;if(U+fe<=I){let st,ue,me,pe;switch(fe){case 1:H<128&&(W=H);break;case 2:st=z[U+1],(st&192)===128&&(pe=(H&31)<<6|st&63,pe>127&&(W=pe));break;case 3:st=z[U+1],ue=z[U+2],(st&192)===128&&(ue&192)===128&&(pe=(H&15)<<12|(st&63)<<6|ue&63,pe>2047&&(pe<55296||pe>57343)&&(W=pe));break;case 4:st=z[U+1],ue=z[U+2],me=z[U+3],(st&192)===128&&(ue&192)===128&&(me&192)===128&&(pe=(H&15)<<18|(st&63)<<12|(ue&63)<<6|me&63,pe>65535&&pe<1114112&&(W=pe))}}W===null?(W=65533,fe=1):W>65535&&(W-=65536,P.push(W>>>10&1023|55296),W=56320|W&1023),P.push(W),U+=fe}return l(P)}let u=4096;function l(z){let T=z.length;if(T<=u)return String.fromCharCode.apply(String,z);let I="",P=0;for(;P<T;)I+=String.fromCharCode.apply(String,z.slice(P,P+=u));return I}function m(z,T,I){let P="";I=Math.min(z.length,I);for(let U=T;U<I;++U)P+=String.fromCharCode(z[U]&127);return P}function w(z,T,I){let P="";I=Math.min(z.length,I);for(let U=T;U<I;++U)P+=String.fromCharCode(z[U]);return P}function d(z,T,I){let P=z.length;(!T||T<0)&&(T=0),(!I||I<0||I>P)&&(I=P);let U="";for(let H=T;H<I;++H)U+=Ze[z[H]];return U}function o(z,T,I){let P=z.slice(T,I),U="";for(let H=0;H<P.length-1;H+=2)U+=String.fromCharCode(P[H]+P[H+1]*256);return U}c.prototype.slice=function(T,I){let P=this.length;T=~~T,I=I===void 0?P:~~I,T<0?(T+=P,T<0&&(T=0)):T>P&&(T=P),I<0?(I+=P,I<0&&(I=0)):I>P&&(I=P),I<T&&(I=T);let U=this.subarray(T,I);return Object.setPrototypeOf(U,c.prototype),U};function v(z,T,I){if(z%1!==0||z<0)throw new RangeError("offset is not uint");if(z+T>I)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(T,I,P){T=T>>>0,I=I>>>0,P||v(T,I,this.length);let U=this[T],H=1,W=0;for(;++W<I&&(H*=256);)U+=this[T+W]*H;return U},c.prototype.readUintBE=c.prototype.readUIntBE=function(T,I,P){T=T>>>0,I=I>>>0,P||v(T,I,this.length);let U=this[T+--I],H=1;for(;I>0&&(H*=256);)U+=this[T+--I]*H;return U},c.prototype.readUint8=c.prototype.readUInt8=function(T,I){return T=T>>>0,I||v(T,1,this.length),this[T]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(T,I){return T=T>>>0,I||v(T,2,this.length),this[T]|this[T+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(T,I){return T=T>>>0,I||v(T,2,this.length),this[T]<<8|this[T+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(T,I){return T=T>>>0,I||v(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(T,I){return T=T>>>0,I||v(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},c.prototype.readBigUInt64LE=Ge(function(T){T=T>>>0,j(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&J(T,this.length-8);let U=I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,H=this[++T]+this[++T]*2**8+this[++T]*2**16+P*2**24;return BigInt(U)+(BigInt(H)<<BigInt(32))}),c.prototype.readBigUInt64BE=Ge(function(T){T=T>>>0,j(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&J(T,this.length-8);let U=I*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],H=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+P;return(BigInt(U)<<BigInt(32))+BigInt(H)}),c.prototype.readIntLE=function(T,I,P){T=T>>>0,I=I>>>0,P||v(T,I,this.length);let U=this[T],H=1,W=0;for(;++W<I&&(H*=256);)U+=this[T+W]*H;return H*=128,U>=H&&(U-=Math.pow(2,8*I)),U},c.prototype.readIntBE=function(T,I,P){T=T>>>0,I=I>>>0,P||v(T,I,this.length);let U=I,H=1,W=this[T+--U];for(;U>0&&(H*=256);)W+=this[T+--U]*H;return H*=128,W>=H&&(W-=Math.pow(2,8*I)),W},c.prototype.readInt8=function(T,I){return T=T>>>0,I||v(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},c.prototype.readInt16LE=function(T,I){T=T>>>0,I||v(T,2,this.length);let P=this[T]|this[T+1]<<8;return P&32768?P|4294901760:P},c.prototype.readInt16BE=function(T,I){T=T>>>0,I||v(T,2,this.length);let P=this[T+1]|this[T]<<8;return P&32768?P|4294901760:P},c.prototype.readInt32LE=function(T,I){return T=T>>>0,I||v(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},c.prototype.readInt32BE=function(T,I){return T=T>>>0,I||v(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},c.prototype.readBigInt64LE=Ge(function(T){T=T>>>0,j(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&J(T,this.length-8);let U=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(P<<24);return(BigInt(U)<<BigInt(32))+BigInt(I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),c.prototype.readBigInt64BE=Ge(function(T){T=T>>>0,j(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&J(T,this.length-8);let U=(I<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(U)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+P)}),c.prototype.readFloatLE=function(T,I){return T=T>>>0,I||v(T,4,this.length),e.read(this,T,!0,23,4)},c.prototype.readFloatBE=function(T,I){return T=T>>>0,I||v(T,4,this.length),e.read(this,T,!1,23,4)},c.prototype.readDoubleLE=function(T,I){return T=T>>>0,I||v(T,8,this.length),e.read(this,T,!0,52,8)},c.prototype.readDoubleBE=function(T,I){return T=T>>>0,I||v(T,8,this.length),e.read(this,T,!1,52,8)};function R(z,T,I,P,U,H){if(!c.isBuffer(z))throw new TypeError('"buffer" argument must be a Buffer instance');if(T>U||T<H)throw new RangeError('"value" argument is out of bounds');if(I+P>z.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(T,I,P,U){if(T=+T,I=I>>>0,P=P>>>0,!U){let fe=Math.pow(2,8*P)-1;R(this,T,I,P,fe,0)}let H=1,W=0;for(this[I]=T&255;++W<P&&(H*=256);)this[I+W]=T/H&255;return I+P},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(T,I,P,U){if(T=+T,I=I>>>0,P=P>>>0,!U){let fe=Math.pow(2,8*P)-1;R(this,T,I,P,fe,0)}let H=P-1,W=1;for(this[I+H]=T&255;--H>=0&&(W*=256);)this[I+H]=T/W&255;return I+P},c.prototype.writeUint8=c.prototype.writeUInt8=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,1,255,0),this[I]=T&255,I+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,2,65535,0),this[I]=T&255,this[I+1]=T>>>8,I+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,2,65535,0),this[I]=T>>>8,this[I+1]=T&255,I+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,4,4294967295,0),this[I+3]=T>>>24,this[I+2]=T>>>16,this[I+1]=T>>>8,this[I]=T&255,I+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,4,4294967295,0),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4};function S(z,T,I,P,U){te(T,P,U,z,I,7);let H=Number(T&BigInt(4294967295));z[I++]=H,H=H>>8,z[I++]=H,H=H>>8,z[I++]=H,H=H>>8,z[I++]=H;let W=Number(T>>BigInt(32)&BigInt(4294967295));return z[I++]=W,W=W>>8,z[I++]=W,W=W>>8,z[I++]=W,W=W>>8,z[I++]=W,I}function B(z,T,I,P,U){te(T,P,U,z,I,7);let H=Number(T&BigInt(4294967295));z[I+7]=H,H=H>>8,z[I+6]=H,H=H>>8,z[I+5]=H,H=H>>8,z[I+4]=H;let W=Number(T>>BigInt(32)&BigInt(4294967295));return z[I+3]=W,W=W>>8,z[I+2]=W,W=W>>8,z[I+1]=W,W=W>>8,z[I]=W,I+8}c.prototype.writeBigUInt64LE=Ge(function(T,I=0){return S(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=Ge(function(T,I=0){return B(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(T,I,P,U){if(T=+T,I=I>>>0,!U){let st=Math.pow(2,8*P-1);R(this,T,I,P,st-1,-st)}let H=0,W=1,fe=0;for(this[I]=T&255;++H<P&&(W*=256);)T<0&&fe===0&&this[I+H-1]!==0&&(fe=1),this[I+H]=(T/W>>0)-fe&255;return I+P},c.prototype.writeIntBE=function(T,I,P,U){if(T=+T,I=I>>>0,!U){let st=Math.pow(2,8*P-1);R(this,T,I,P,st-1,-st)}let H=P-1,W=1,fe=0;for(this[I+H]=T&255;--H>=0&&(W*=256);)T<0&&fe===0&&this[I+H+1]!==0&&(fe=1),this[I+H]=(T/W>>0)-fe&255;return I+P},c.prototype.writeInt8=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,1,127,-128),T<0&&(T=255+T+1),this[I]=T&255,I+1},c.prototype.writeInt16LE=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,2,32767,-32768),this[I]=T&255,this[I+1]=T>>>8,I+2},c.prototype.writeInt16BE=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,2,32767,-32768),this[I]=T>>>8,this[I+1]=T&255,I+2},c.prototype.writeInt32LE=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,4,2147483647,-2147483648),this[I]=T&255,this[I+1]=T>>>8,this[I+2]=T>>>16,this[I+3]=T>>>24,I+4},c.prototype.writeInt32BE=function(T,I,P){return T=+T,I=I>>>0,P||R(this,T,I,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4},c.prototype.writeBigInt64LE=Ge(function(T,I=0){return S(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=Ge(function(T,I=0){return B(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function F(z,T,I,P,U,H){if(I+P>z.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("Index out of range")}function D(z,T,I,P,U){return T=+T,I=I>>>0,U||F(z,T,I,4),e.write(z,T,I,P,23,4),I+4}c.prototype.writeFloatLE=function(T,I,P){return D(this,T,I,!0,P)},c.prototype.writeFloatBE=function(T,I,P){return D(this,T,I,!1,P)};function re(z,T,I,P,U){return T=+T,I=I>>>0,U||F(z,T,I,8),e.write(z,T,I,P,52,8),I+8}c.prototype.writeDoubleLE=function(T,I,P){return re(this,T,I,!0,P)},c.prototype.writeDoubleBE=function(T,I,P){return re(this,T,I,!1,P)},c.prototype.copy=function(T,I,P,U){if(!c.isBuffer(T))throw new TypeError("argument should be a Buffer");if(P||(P=0),!U&&U!==0&&(U=this.length),I>=T.length&&(I=T.length),I||(I=0),U>0&&U<P&&(U=P),U===P||T.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if(P<0||P>=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),T.length-I<U-P&&(U=T.length-I+P);let H=U-P;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(I,P,U):Uint8Array.prototype.set.call(T,this.subarray(P,U),I),H},c.prototype.fill=function(T,I,P,U){if(typeof T=="string"){if(typeof I=="string"?(U=I,I=0,P=this.length):typeof P=="string"&&(U=P,P=this.length),U!==void 0&&typeof U!="string")throw new TypeError("encoding must be a string");if(typeof U=="string"&&!c.isEncoding(U))throw new TypeError("Unknown encoding: "+U);if(T.length===1){let W=T.charCodeAt(0);(U==="utf8"&&W<128||U==="latin1")&&(T=W)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(I<0||this.length<I||this.length<P)throw new RangeError("Out of range index");if(P<=I)return this;I=I>>>0,P=P===void 0?this.length:P>>>0,T||(T=0);let H;if(typeof T=="number")for(H=I;H<P;++H)this[H]=T;else{let W=c.isBuffer(T)?T:c.from(T,U),fe=W.length;if(fe===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(H=0;H<P-I;++H)this[H+I]=W[H%fe]}return this};let Q={};function Z(z,T,I){Q[z]=class extends I{constructor(){super(),Object.defineProperty(this,"message",{value:T.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${z}]`,this.stack,delete this.name}get code(){return z}set code(U){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:U,writable:!0})}toString(){return`${this.name} [${z}]: ${this.message}`}}}Z("ERR_BUFFER_OUT_OF_BOUNDS",function(z){return z?`${z} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Z("ERR_INVALID_ARG_TYPE",function(z,T){return`The "${z}" argument must be of type number. Received type ${typeof T}`},TypeError),Z("ERR_OUT_OF_RANGE",function(z,T,I){let P=`The value of "${z}" is out of range.`,U=I;return Number.isInteger(I)&&Math.abs(I)>2**32?U=K(String(I)):typeof I=="bigint"&&(U=String(I),(I>BigInt(2)**BigInt(32)||I<-(BigInt(2)**BigInt(32)))&&(U=K(U)),U+="n"),P+=` It must be ${T}. Received ${U}`,P},RangeError);function K(z){let T="",I=z.length,P=z[0]==="-"?1:0;for(;I>=P+4;I-=3)T=`_${z.slice(I-3,I)}${T}`;return`${z.slice(0,I)}${T}`}function ce(z,T,I){j(T,"offset"),(z[T]===void 0||z[T+I]===void 0)&&J(T,z.length-(I+1))}function te(z,T,I,P,U,H){if(z>I||z<T){let W=typeof T=="bigint"?"n":"",fe;throw H>3?T===0||T===BigInt(0)?fe=`>= 0${W} and < 2${W} ** ${(H+1)*8}${W}`:fe=`>= -(2${W} ** ${(H+1)*8-1}${W}) and < 2 ** ${(H+1)*8-1}${W}`:fe=`>= ${T}${W} and <= ${I}${W}`,new Q.ERR_OUT_OF_RANGE("value",fe,z)}ce(P,U,H)}function j(z,T){if(typeof z!="number")throw new Q.ERR_INVALID_ARG_TYPE(T,"number",z)}function J(z,T,I){throw Math.floor(z)!==z?(j(z,I),new Q.ERR_OUT_OF_RANGE(I||"offset","an integer",z)):T<0?new Q.ERR_BUFFER_OUT_OF_BOUNDS:new Q.ERR_OUT_OF_RANGE(I||"offset",`>= ${I?1:0} and <= ${T}`,z)}let X=/[^+/0-9A-Za-z-_]/g;function he(z){if(z=z.split("=")[0],z=z.trim().replace(X,""),z.length<2)return"";for(;z.length%4!==0;)z=z+"=";return z}function Te(z,T){T=T||1/0;let I,P=z.length,U=null,H=[];for(let W=0;W<P;++W){if(I=z.charCodeAt(W),I>55295&&I<57344){if(!U){if(I>56319){(T-=3)>-1&&H.push(239,191,189);continue}else if(W+1===P){(T-=3)>-1&&H.push(239,191,189);continue}U=I;continue}if(I<56320){(T-=3)>-1&&H.push(239,191,189),U=I;continue}I=(U-55296<<10|I-56320)+65536}else U&&(T-=3)>-1&&H.push(239,191,189);if(U=null,I<128){if((T-=1)<0)break;H.push(I)}else if(I<2048){if((T-=2)<0)break;H.push(I>>6|192,I&63|128)}else if(I<65536){if((T-=3)<0)break;H.push(I>>12|224,I>>6&63|128,I&63|128)}else if(I<1114112){if((T-=4)<0)break;H.push(I>>18|240,I>>12&63|128,I>>6&63|128,I&63|128)}else throw new Error("Invalid code point")}return H}function oe(z){let T=[];for(let I=0;I<z.length;++I)T.push(z.charCodeAt(I)&255);return T}function le(z,T){let I,P,U,H=[];for(let W=0;W<z.length&&!((T-=2)<0);++W)I=z.charCodeAt(W),P=I>>8,U=I%256,H.push(U),H.push(P);return H}function ot(z){return t.toByteArray(he(z))}function ge(z,T,I,P){let U;for(U=0;U<P&&!(U+I>=T.length||U>=z.length);++U)T[U+I]=z[U];return U}function Se(z,T){return z instanceof T||z!=null&&z.constructor!=null&&z.constructor.name!=null&&z.constructor.name===T.name}function ut(z){return z!==z}let Ze=function(){let z="0123456789abcdef",T=new Array(256);for(let I=0;I<16;++I){let P=I*16;for(let U=0;U<16;++U)T[P+U]=z[I]+z[U]}return T}();function Ge(z){return typeof BigInt>"u"?ct:z}function ct(){throw new Error("BigInt not supported")}return Nl}var gv,$P,Cb,DP,Nl,UP,ac,Me,sue,fue,co=Si(()=>{"use strict";ie();ae();ne();gv={},$P=!1;Cb={},DP=!1;Nl={},UP=!1;ac=oue();ac.Buffer;ac.SlowBuffer;ac.INSPECT_MAX_BYTES;ac.kMaxLength;Me=ac.Buffer,sue=ac.INSPECT_MAX_BYTES,fue=ac.kMaxLength});var ae=Si(()=>{"use strict";co()});var qP=ht(Qw=>{"use strict";ie();ae();ne();Object.defineProperty(Qw,"__esModule",{value:!0});function uue(t){var e=4,r=t.length,a=r%e;if(!a)return t;var i=r,h=e-a,c=r+h,p=Me.alloc(c);for(p.write(t);h--;)p.write("=",i++);return p.toString()}Qw.default=uue});var jP=ht(r5=>{"use strict";ie();ae();ne();Object.defineProperty(r5,"__esModule",{value:!0});var hue=qP();function FP(t,e){return e===void 0&&(e="utf8"),Me.isBuffer(t)?e5(t.toString("base64")):e5(Me.from(t,e).toString("base64"))}function cue(t,e){return e===void 0&&(e="utf8"),Me.from(t5(t),"base64").toString(e)}function t5(t){return t=t.toString(),hue.default(t).replace(/\-/g,"+").replace(/_/g,"/")}function e5(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function lue(t){return Me.from(t5(t),"base64")}var Wd=FP;Wd.encode=FP;Wd.decode=cue;Wd.toBase64=t5;Wd.fromBase64=e5;Wd.toBuffer=lue;r5.default=Wd});var Do=ht((Sqe,Lb)=>{"use strict";ie();ae();ne();Lb.exports=jP().default;Lb.exports.default=Lb.exports});function Pi(){Pi.init.call(this)}function $b(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function XP(t){return t._maxListeners===void 0?Pi.defaultMaxListeners:t._maxListeners}function KP(t,e,r,a){var i,h,c,p;if($b(r),(h=t._events)===void 0?(h=t._events=Object.create(null),t._eventsCount=0):(h.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),h=t._events),c=h[e]),c===void 0)c=h[e]=r,++t._eventsCount;else if(typeof c=="function"?c=h[e]=a?[r,c]:[c,r]:a?c.unshift(r):c.push(r),(i=XP(t))>0&&c.length>i&&!c.warned){c.warned=!0;var b=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");b.name="MaxListenersExceededWarning",b.emitter=t,b.type=e,b.count=c.length,p=b,console&&console.warn&&console.warn(p)}return t}function due(){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 WP(t,e,r){var a={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=due.bind(a);return i.listener=r,a.wrapFn=i,i}function VP(t,e,r){var a=t._events;if(a===void 0)return[];var i=a[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?function(h){for(var c=new Array(h.length),p=0;p<c.length;++p)c[p]=h[p].listener||h[p];return c}(i):QP(i,i.length)}function GP(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}function QP(t,e){for(var r=new Array(e),a=0;a<e;++a)r[a]=t[a];return r}var YP,JP,Vd,zP,ZP,HP,Ei,Hs=Si(()=>{"use strict";ie();ae();ne();Vd=typeof Reflect=="object"?Reflect:null,zP=Vd&&typeof Vd.apply=="function"?Vd.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};JP=Vd&&typeof Vd.ownKeys=="function"?Vd.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};ZP=Number.isNaN||function(t){return t!=t};YP=Pi,Pi.EventEmitter=Pi,Pi.prototype._events=void 0,Pi.prototype._eventsCount=0,Pi.prototype._maxListeners=void 0;HP=10;Object.defineProperty(Pi,"defaultMaxListeners",{enumerable:!0,get:function(){return HP},set:function(t){if(typeof t!="number"||t<0||ZP(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");HP=t}}),Pi.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},Pi.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||ZP(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},Pi.prototype.getMaxListeners=function(){return XP(this)},Pi.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var a=t==="error",i=this._events;if(i!==void 0)a=a&&i.error===void 0;else if(!a)return!1;if(a){var h;if(e.length>0&&(h=e[0]),h instanceof Error)throw h;var c=new Error("Unhandled error."+(h?" ("+h.message+")":""));throw c.context=h,c}var p=i[t];if(p===void 0)return!1;if(typeof p=="function")zP(p,this,e);else{var b=p.length,g=QP(p,b);for(r=0;r<b;++r)zP(g[r],this,e)}return!0},Pi.prototype.addListener=function(t,e){return KP(this,t,e,!1)},Pi.prototype.on=Pi.prototype.addListener,Pi.prototype.prependListener=function(t,e){return KP(this,t,e,!0)},Pi.prototype.once=function(t,e){return $b(e),this.on(t,WP(this,t,e)),this},Pi.prototype.prependOnceListener=function(t,e){return $b(e),this.prependListener(t,WP(this,t,e)),this},Pi.prototype.removeListener=function(t,e){var r,a,i,h,c;if($b(e),(a=this._events)===void 0)return this;if((r=a[t])===void 0)return this;if(r===e||r.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete a[t],a.removeListener&&this.emit("removeListener",t,r.listener||e));else if(typeof r!="function"){for(i=-1,h=r.length-1;h>=0;h--)if(r[h]===e||r[h].listener===e){c=r[h].listener,i=h;break}if(i<0)return this;i===0?r.shift():function(p,b){for(;b+1<p.length;b++)p[b]=p[b+1];p.pop()}(r,i),r.length===1&&(a[t]=r[0]),a.removeListener!==void 0&&this.emit("removeListener",t,c||e)}return this},Pi.prototype.off=Pi.prototype.removeListener,Pi.prototype.removeAllListeners=function(t){var e,r,a;if((r=this._events)===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var i,h=Object.keys(r);for(a=0;a<h.length;++a)(i=h[a])!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=r[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(a=e.length-1;a>=0;a--)this.removeListener(t,e[a]);return this},Pi.prototype.listeners=function(t){return VP(this,t,!0)},Pi.prototype.rawListeners=function(t){return VP(this,t,!1)},Pi.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):GP.call(t,e)},Pi.prototype.listenerCount=GP,Pi.prototype.eventNames=function(){return this._eventsCount>0?JP(this._events):[]};Ei=YP;Ei.EventEmitter;Ei.defaultMaxListeners;Ei.init;Ei.listenerCount;Ei.EventEmitter;Ei.defaultMaxListeners;Ei.init;Ei.listenerCount});function i5(){throw new Error("setTimeout has not been defined")}function n5(){throw new Error("clearTimeout has not been defined")}function rN(t){if(Xu===setTimeout)return setTimeout(t,0);if((Xu===i5||!Xu)&&setTimeout)return Xu=setTimeout,setTimeout(t,0);try{return Xu(t,0)}catch{try{return Xu.call(null,t,0)}catch{return Xu.call(this||Yd,t,0)}}}function pue(){Gd&&Cl&&(Gd=!1,Cl.length?eh=Cl.concat(eh):Db=-1,eh.length&&iN())}function iN(){if(!Gd){var t=rN(pue);Gd=!0;for(var e=eh.length;e;){for(Cl=eh,eh=[];++Db<e;)Cl&&Cl[Db].run();Db=-1,e=eh.length}Cl=null,Gd=!1,function(r){if(Qu===clearTimeout)return clearTimeout(r);if((Qu===n5||!Qu)&&clearTimeout)return Qu=clearTimeout,clearTimeout(r);try{Qu(r)}catch{try{return Qu.call(null,r)}catch{return Qu.call(this||Yd,r)}}}(t)}}function eN(t,e){(this||Yd).fun=t,(this||Yd).array=e}function Ju(){}var tN,Xu,Qu,Yd,Mn,Cl,eh,Gd,Db,fr,Uo=Si(()=>{"use strict";ie();ae();ne();Yd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Mn=tN={};(function(){try{Xu=typeof setTimeout=="function"?setTimeout:i5}catch{Xu=i5}try{Qu=typeof clearTimeout=="function"?clearTimeout:n5}catch{Qu=n5}})();eh=[],Gd=!1,Db=-1;Mn.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];eh.push(new eN(t,e)),eh.length!==1||Gd||rN(iN)},eN.prototype.run=function(){(this||Yd).fun.apply(null,(this||Yd).array)},Mn.title="browser",Mn.browser=!0,Mn.env={},Mn.argv=[],Mn.version="",Mn.versions={},Mn.on=Ju,Mn.addListener=Ju,Mn.once=Ju,Mn.off=Ju,Mn.removeListener=Ju,Mn.removeAllListeners=Ju,Mn.emit=Ju,Mn.prependListener=Ju,Mn.prependOnceListener=Ju,Mn.listeners=function(t){return[]},Mn.binding=function(t){throw new Error("process.binding is not supported")},Mn.cwd=function(){return"/"},Mn.chdir=function(t){throw new Error("process.chdir is not supported")},Mn.umask=function(){return 0};fr=tN;fr.addListener;fr.argv;fr.binding;fr.browser;fr.chdir;fr.cwd;fr.emit;fr.env;fr.listeners;fr.nextTick;fr.off;fr.on;fr.once;fr.prependListener;fr.prependOnceListener;fr.removeAllListeners;fr.removeListener;fr.title;fr.umask;fr.version;fr.versions});function Dl(t){return t.call.bind(t)}function _v(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch{return!1}}function aN(t){return Ka&&lo?qo(t)!==void 0:wN(t)||_N(t)||MN(t)||xN(t)||SN(t)||EN(t)||AN(t)||RN(t)||TN(t)||kN(t)||IN(t)}function wN(t){return Ka&&lo?qo(t)==="Uint8Array":tn(t)==="[object Uint8Array]"||xue(t)&&t.buffer!==void 0}function _N(t){return Ka&&lo?qo(t)==="Uint8ClampedArray":tn(t)==="[object Uint8ClampedArray]"}function MN(t){return Ka&&lo?qo(t)==="Uint16Array":tn(t)==="[object Uint16Array]"}function xN(t){return Ka&&lo?qo(t)==="Uint32Array":tn(t)==="[object Uint32Array]"}function SN(t){return Ka&&lo?qo(t)==="Int8Array":tn(t)==="[object Int8Array]"}function EN(t){return Ka&&lo?qo(t)==="Int16Array":tn(t)==="[object Int16Array]"}function AN(t){return Ka&&lo?qo(t)==="Int32Array":tn(t)==="[object Int32Array]"}function RN(t){return Ka&&lo?qo(t)==="Float32Array":tn(t)==="[object Float32Array]"}function TN(t){return Ka&&lo?qo(t)==="Float64Array":tn(t)==="[object Float64Array]"}function kN(t){return Ka&&lo?qo(t)==="BigInt64Array":tn(t)==="[object BigInt64Array]"}function IN(t){return Ka&&lo?qo(t)==="BigUint64Array":tn(t)==="[object BigUint64Array]"}function Ub(t){return tn(t)==="[object Map]"}function qb(t){return tn(t)==="[object Set]"}function Fb(t){return tn(t)==="[object WeakMap]"}function a5(t){return tn(t)==="[object WeakSet]"}function Hb(t){return tn(t)==="[object ArrayBuffer]"}function oN(t){return typeof ArrayBuffer<"u"&&(Hb.working?Hb(t):t instanceof ArrayBuffer)}function Kb(t){return tn(t)==="[object DataView]"}function sN(t){return typeof DataView<"u"&&(Kb.working?Kb(t):t instanceof DataView)}function Wb(t){return tn(t)==="[object SharedArrayBuffer]"}function fN(t){return typeof SharedArrayBuffer<"u"&&(Wb.working?Wb(t):t instanceof SharedArrayBuffer)}function uN(t){return _v(t,Tue)}function hN(t){return _v(t,kue)}function cN(t){return _v(t,Iue)}function lN(t){return yN&&_v(t,Bue)}function dN(t){return h5&&_v(t,Oue)}function oc(t,e){var r={seen:[],stylize:Cue};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),c5(e)?r.showHidden=e:e&&gt._extend(r,e),$l(r.showHidden)&&(r.showHidden=!1),$l(r.depth)&&(r.depth=2),$l(r.colors)&&(r.colors=!1),$l(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Nue),Vb(r,t,r.depth)}function Nue(t,e){var r=oc.styles[e];return r?"\x1B["+oc.colors[r][0]+"m"+t+"\x1B["+oc.colors[r][1]+"m":t}function Cue(t,e){return t}function Vb(t,e,r){if(t.customInspect&&e&&Zb(e.inspect)&&e.inspect!==gt.inspect&&(!e.constructor||e.constructor.prototype!==e)){var a=e.inspect(r,t);return Gb(a)||(a=Vb(t,a,r)),a}var i=function(x,E){if($l(E))return x.stylize("undefined","undefined");if(Gb(E)){var A="'"+JSON.stringify(E).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return x.stylize(A,"string")}if(PN(E))return x.stylize(""+E,"number");if(c5(E))return x.stylize(""+E,"boolean");if(Xb(E))return x.stylize("null","null")}(t,e);if(i)return i;var h=Object.keys(e),c=function(x){var E={};return x.forEach(function(A,k){E[A]=!0}),E}(h);if(t.showHidden&&(h=Object.getOwnPropertyNames(e)),wv(e)&&(h.indexOf("message")>=0||h.indexOf("description")>=0))return o5(e);if(h.length===0){if(Zb(e)){var p=e.name?": "+e.name:"";return t.stylize("[Function"+p+"]","special")}if(yv(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Yb(e))return t.stylize(Date.prototype.toString.call(e),"date");if(wv(e))return o5(e)}var b,g="",y=!1,M=["{","}"];return ON(e)&&(y=!0,M=["[","]"]),Zb(e)&&(g=" [Function"+(e.name?": "+e.name:"")+"]"),yv(e)&&(g=" "+RegExp.prototype.toString.call(e)),Yb(e)&&(g=" "+Date.prototype.toUTCString.call(e)),wv(e)&&(g=" "+o5(e)),h.length!==0||y&&e.length!=0?r<0?yv(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),b=y?function(x,E,A,k,O){for(var N=[],L=0,C=E.length;L<C;++L)NN(E,String(L))?N.push(s5(x,E,A,k,String(L),!0)):N.push("");return O.forEach(function(Y){Y.match(/^\d+$/)||N.push(s5(x,E,A,k,Y,!0))}),N}(t,e,r,c,h):h.map(function(x){return s5(t,e,r,c,x,y)}),t.seen.pop(),function(x,E,A){var k=0;return x.reduce(function(O,N){return k++,N.indexOf(`
2
2
  `)>=0&&k++,O+N.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?A[0]+(E===""?"":E+`
3
3
  `)+" "+x.join(`,
4
4
  `)+" "+A[1]:A[0]+E+" "+x.join(", ")+" "+A[1]}(b,g,M)):M[0]+g+M[1]}function o5(t){return"["+Error.prototype.toString.call(t)+"]"}function s5(t,e,r,a,i,h){var c,p,b;if((b=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?p=b.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):b.set&&(p=t.stylize("[Setter]","special")),NN(a,i)||(c="["+i+"]"),p||(t.seen.indexOf(b.value)<0?(p=Xb(r)?Vb(t,b.value,null):Vb(t,b.value,r-1)).indexOf(`
@@ -110,7 +110,7 @@ should equal
110
110
  `))}throw v}},C.strict=k(m,C,{equal:C.strictEqual,deepEqual:C.deepStrictEqual,notEqual:C.notStrictEqual,notDeepEqual:C.notDeepStrictEqual}),C.strict.strict=C.strict,hk}var j_e,Gte,bte,Yte,Kg,ik,yte,nk,wte,_te,Wg,e4,Mte,xte,z_e,Z_e,H_e,Ste,n4,Ete,K_e,W_e,V_e,G_e,Y_e,ck,Jte,J_e,Xte,f4,X_e,Ate,Q_e,e9e,t9e,ak,r9e,i9e,Qte,Yg,Ed,ok,n9e,xd,Sd,sk,fk,Rte,a9e,o9e,s9e,f9e,u9e,ere,Tte,tre,h9e,c9e,l9e,lk,dk,kte,d9e,p9e,v9e,m9e,g9e,rre,b9e,ire,nre,mk,gk,y9e,w9e,_9e,M9e,x9e,are,S9e,ore,E9e,uk,Ite,Bte,Ote,R9e,s4,Nte,Cte,a4,pk,Gg,o4,Lte,Ua,T9e,k9e,$te,t4,Dte,r4,I9e,B9e,Ute,qte,Fte,jte,O9e,P9e,N9e,Wte,hk,Vte,ar,Hlt,Klt,Wlt,Vlt,Glt,Ylt,Jlt,Xlt,Qlt,e0t,t0t,r0t,i0t,n0t,a0t,o0t,s0t,yk=Si(()=>{"use strict";ie();ae();ne();Fo();Uo();j_e={assign:gte,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:gte})}},bte=Object.prototype.toString,Yte=function(t){var e=bte.call(t),r=e==="[object Arguments]";return r||(r=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&bte.call(t.callee)==="[object Function]"),r};Object.keys||(Kg=Object.prototype.hasOwnProperty,ik=Object.prototype.toString,yte=Yte,nk=Object.prototype.propertyIsEnumerable,wte=!nk.call({toString:null},"toString"),_te=nk.call(function(){},"prototype"),Wg=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],e4=function(t){var e=t.constructor;return e&&e.prototype===t},Mte={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},xte=function(){if(typeof window>"u")return!1;for(var t in window)try{if(!Mte["$"+t]&&Kg.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{e4(window[t])}catch{return!0}}catch{return!0}return!1}(),Gte=function(t){var e=t!==null&&typeof t=="object",r=ik.call(t)==="[object Function]",a=yte(t),i=e&&ik.call(t)==="[object String]",h=[];if(!e&&!r&&!a)throw new TypeError("Object.keys called on a non-object");var c=_te&&r;if(i&&t.length>0&&!Kg.call(t,0))for(var p=0;p<t.length;++p)h.push(String(p));if(a&&t.length>0)for(var b=0;b<t.length;++b)h.push(String(b));else for(var g in t)c&&g==="prototype"||!Kg.call(t,g)||h.push(String(g));if(wte)for(var y=function(x){if(typeof window>"u"||!xte)return e4(x);try{return e4(x)}catch{return!1}}(t),M=0;M<Wg.length;++M)y&&Wg[M]==="constructor"||!Kg.call(t,Wg[M])||h.push(Wg[M]);return h});z_e=Gte,Z_e=Array.prototype.slice,H_e=Yte,Ste=Object.keys,n4=Ste?function(t){return Ste(t)}:z_e,Ete=Object.keys;n4.shim=function(){return Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return H_e(t)?Ete(Z_e.call(t)):Ete(t)}):Object.keys=n4,Object.keys||n4};K_e=n4,W_e=K_e,V_e=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",G_e=Object.prototype.toString,Y_e=Array.prototype.concat,ck=Object.defineProperty,Jte=ck&&function(){var t={};try{for(var e in ck(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch{return!1}}(),J_e=function(t,e,r,a){var i;(!(e in t)||typeof(i=a)=="function"&&G_e.call(i)==="[object Function]"&&a())&&(Jte?ck(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},Xte=function(t,e){var r=arguments.length>2?arguments[2]:{},a=W_e(e);V_e&&(a=Y_e.call(a,Object.getOwnPropertySymbols(e)));for(var i=0;i<a.length;i+=1)J_e(t,a[i],e[a[i]],r[a[i]])};Xte.supportsDescriptors=!!Jte;f4=Xte,X_e=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),r=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;for(e in t[e]=42,t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(t,e);if(i.value!==42||i.enumerable!==!0)return!1}return!0},Ate=(typeof globalThis<"u"?globalThis:typeof self<"u"?self:global).Symbol,Q_e=X_e,e9e=function(){return typeof Ate=="function"&&typeof Symbol=="function"&&typeof Ate("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&Q_e()},t9e="Function.prototype.bind called on incompatible ",ak=Array.prototype.slice,r9e=Object.prototype.toString,i9e=function(t){var e=this;if(typeof e!="function"||r9e.call(e)!=="[object Function]")throw new TypeError(t9e+e);for(var r,a=ak.call(arguments,1),i=function(){if(this instanceof r){var g=e.apply(this,a.concat(ak.call(arguments)));return Object(g)===g?g:this}return e.apply(t,a.concat(ak.call(arguments)))},h=Math.max(0,e.length-a.length),c=[],p=0;p<h;p++)c.push("$"+p);if(r=Function("binder","return function ("+c.join(",")+"){ return binder.apply(this,arguments); }")(i),e.prototype){var b=function(){};b.prototype=e.prototype,r.prototype=new b,b.prototype=null}return r},Qte=Function.prototype.bind||i9e,Yg=TypeError,Ed=Object.getOwnPropertyDescriptor;if(Ed)try{Ed({},"")}catch{Ed=null}ok=function(){throw new Yg},n9e=Ed?function(){try{return arguments.callee,ok}catch{try{return Ed(arguments,"callee").get}catch{return ok}}}():ok,xd=e9e(),Sd=Object.getPrototypeOf||function(t){return t.__proto__},sk=typeof Uint8Array>"u"?void 0:Sd(Uint8Array),fk={"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayBufferPrototype%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":xd?Sd([][Symbol.iterator]()):void 0,"%ArrayPrototype%":Array.prototype,"%ArrayProto_entries%":Array.prototype.entries,"%ArrayProto_forEach%":Array.prototype.forEach,"%ArrayProto_keys%":Array.prototype.keys,"%ArrayProto_values%":Array.prototype.values,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":void 0,"%AsyncFunctionPrototype%":void 0,"%AsyncGenerator%":void 0,"%AsyncGeneratorFunction%":void 0,"%AsyncGeneratorPrototype%":void 0,"%AsyncIteratorPrototype%":void 0,"%Atomics%":typeof Atomics>"u"?void 0:Atomics,"%Boolean%":Boolean,"%BooleanPrototype%":Boolean.prototype,"%DataView%":typeof DataView>"u"?void 0:DataView,"%DataViewPrototype%":typeof DataView>"u"?void 0:DataView.prototype,"%Date%":Date,"%DatePrototype%":Date.prototype,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%ErrorPrototype%":Error.prototype,"%eval%":eval,"%EvalError%":EvalError,"%EvalErrorPrototype%":EvalError.prototype,"%Float32Array%":typeof Float32Array>"u"?void 0:Float32Array,"%Float32ArrayPrototype%":typeof Float32Array>"u"?void 0:Float32Array.prototype,"%Float64Array%":typeof Float64Array>"u"?void 0:Float64Array,"%Float64ArrayPrototype%":typeof Float64Array>"u"?void 0:Float64Array.prototype,"%Function%":Function,"%FunctionPrototype%":Function.prototype,"%Generator%":void 0,"%GeneratorFunction%":void 0,"%GeneratorPrototype%":void 0,"%Int8Array%":typeof Int8Array>"u"?void 0:Int8Array,"%Int8ArrayPrototype%":typeof Int8Array>"u"?void 0:Int8Array.prototype,"%Int16Array%":typeof Int16Array>"u"?void 0:Int16Array,"%Int16ArrayPrototype%":typeof Int16Array>"u"?void 0:Int8Array.prototype,"%Int32Array%":typeof Int32Array>"u"?void 0:Int32Array,"%Int32ArrayPrototype%":typeof Int32Array>"u"?void 0:Int32Array.prototype,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":xd?Sd(Sd([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%JSONParse%":typeof JSON=="object"?JSON.parse:void 0,"%Map%":typeof Map>"u"?void 0:Map,"%MapIteratorPrototype%":typeof Map<"u"&&xd?Sd(new Map()[Symbol.iterator]()):void 0,"%MapPrototype%":typeof Map>"u"?void 0:Map.prototype,"%Math%":Math,"%Number%":Number,"%NumberPrototype%":Number.prototype,"%Object%":Object,"%ObjectPrototype%":Object.prototype,"%ObjProto_toString%":Object.prototype.toString,"%ObjProto_valueOf%":Object.prototype.valueOf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?void 0:Promise,"%PromisePrototype%":typeof Promise>"u"?void 0:Promise.prototype,"%PromiseProto_then%":typeof Promise>"u"?void 0:Promise.prototype.then,"%Promise_all%":typeof Promise>"u"?void 0:Promise.all,"%Promise_reject%":typeof Promise>"u"?void 0:Promise.reject,"%Promise_resolve%":typeof Promise>"u"?void 0:Promise.resolve,"%Proxy%":typeof Proxy>"u"?void 0:Proxy,"%RangeError%":RangeError,"%RangeErrorPrototype%":RangeError.prototype,"%ReferenceError%":ReferenceError,"%ReferenceErrorPrototype%":ReferenceError.prototype,"%Reflect%":typeof Reflect>"u"?void 0:Reflect,"%RegExp%":RegExp,"%RegExpPrototype%":RegExp.prototype,"%Set%":typeof Set>"u"?void 0:Set,"%SetIteratorPrototype%":typeof Set<"u"&&xd?Sd(new Set()[Symbol.iterator]()):void 0,"%SetPrototype%":typeof Set>"u"?void 0:Set.prototype,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer,"%SharedArrayBufferPrototype%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer.prototype,"%String%":String,"%StringIteratorPrototype%":xd?Sd(""[Symbol.iterator]()):void 0,"%StringPrototype%":String.prototype,"%Symbol%":xd?Symbol:void 0,"%SymbolPrototype%":xd?Symbol.prototype:void 0,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":n9e,"%TypedArray%":sk,"%TypedArrayPrototype%":sk?sk.prototype:void 0,"%TypeError%":Yg,"%TypeErrorPrototype%":Yg.prototype,"%Uint8Array%":typeof Uint8Array>"u"?void 0:Uint8Array,"%Uint8ArrayPrototype%":typeof Uint8Array>"u"?void 0:Uint8Array.prototype,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,"%Uint8ClampedArrayPrototype%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray.prototype,"%Uint16Array%":typeof Uint16Array>"u"?void 0:Uint16Array,"%Uint16ArrayPrototype%":typeof Uint16Array>"u"?void 0:Uint16Array.prototype,"%Uint32Array%":typeof Uint32Array>"u"?void 0:Uint32Array,"%Uint32ArrayPrototype%":typeof Uint32Array>"u"?void 0:Uint32Array.prototype,"%URIError%":URIError,"%URIErrorPrototype%":URIError.prototype,"%WeakMap%":typeof WeakMap>"u"?void 0:WeakMap,"%WeakMapPrototype%":typeof WeakMap>"u"?void 0:WeakMap.prototype,"%WeakSet%":typeof WeakSet>"u"?void 0:WeakSet,"%WeakSetPrototype%":typeof WeakSet>"u"?void 0:WeakSet.prototype},Rte=Qte.call(Function.call,String.prototype.replace),a9e=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,o9e=/\\(\\)?/g,s9e=function(t){var e=[];return Rte(t,a9e,function(r,a,i,h){e[e.length]=i?Rte(h,o9e,"$1"):a||r}),e},f9e=function(t,e){if(!(t in fk))throw new SyntaxError("intrinsic "+t+" does not exist!");if(fk[t]===void 0&&!e)throw new Yg("intrinsic "+t+" exists, but is not available. Please file an issue!");return fk[t]},u9e=function(t,e){if(typeof t!="string"||t.length===0)throw new TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new TypeError('"allowMissing" argument must be a boolean');for(var r=s9e(t),a=f9e("%"+(r.length>0?r[0]:"")+"%",e),i=1;i<r.length;i+=1)if(a!=null)if(Ed&&i+1>=r.length){var h=Ed(a,r[i]);if(!e&&!(r[i]in a))throw new Yg("base intrinsic for "+t+" exists, but the property is not available.");a=h?h.get||h.value:a[r[i]]}else a=a[r[i]];return a},Tte=Qte,tre=u9e("%Function%"),h9e=tre.apply,c9e=tre.call;(ere=function(){return Tte.apply(c9e,arguments)}).apply=function(){return Tte.apply(h9e,arguments)};l9e=ere,kte=function(t){return t!=t},d9e=(lk=function(t,e){return t===0&&e===0?1/t==1/e:t===e||!(!kte(t)||!kte(e))},lk),p9e=(dk=function(){return typeof Object.is=="function"?Object.is:d9e},dk),v9e=f4,m9e=f4,g9e=lk,rre=dk,b9e=function(){var t=p9e();return v9e(Object,{is:t},{is:function(){return Object.is!==t}}),t},ire=l9e(rre(),Object);m9e(ire,{getPolyfill:rre,implementation:g9e,shim:b9e});nre=ire;mk=function(t){return t!=t};y9e=mk,w9e=(gk=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:y9e},f4),_9e=gk,M9e=f4,x9e=mk,are=gk,S9e=function(){var t=_9e();return w9e(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t},ore=are();M9e(ore,{getPolyfill:are,implementation:x9e,shim:S9e});E9e=ore,uk={},Ite=!1;Bte={},Ote=!1;R9e=/a/g.flags!==void 0,s4=function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e},Nte=function(t){var e=[];return t.forEach(function(r,a){return e.push([a,r])}),e},Cte=Object.is?Object.is:nre,a4=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},pk=Number.isNaN?Number.isNaN:E9e;Gg=bk(Object.prototype.hasOwnProperty),o4=bk(Object.prototype.propertyIsEnumerable),Lte=bk(Object.prototype.toString),Ua=gt.types,T9e=Ua.isAnyArrayBuffer,k9e=Ua.isArrayBufferView,$te=Ua.isDate,t4=Ua.isMap,Dte=Ua.isRegExp,r4=Ua.isSet,I9e=Ua.isNativeError,B9e=Ua.isBoxedPrimitive,Ute=Ua.isNumberObject,qte=Ua.isStringObject,Fte=Ua.isBooleanObject,jte=Ua.isBigIntObject,O9e=Ua.isSymbolObject,P9e=Ua.isFloat32Array,N9e=Ua.isFloat64Array;Wte={isDeepEqual:function(t,e){return Os(t,e,!1)},isDeepStrictEqual:function(t,e){return Os(t,e,!0)}},hk={},Vte=!1;ar=vk();ar.AssertionError;ar.deepEqual;ar.deepStrictEqual;ar.doesNotReject;ar.doesNotThrow;ar.equal;ar.fail;ar.ifError;ar.notDeepEqual;ar.notDeepStrictEqual;ar.notEqual;ar.notStrictEqual;ar.ok;ar.rejects;ar.strict;ar.strictEqual;ar.throws;ar.AssertionError;ar.deepEqual;ar.deepStrictEqual;ar.doesNotReject;ar.doesNotThrow;ar.equal;ar.fail;ar.ifError;ar.notDeepEqual;ar.notDeepStrictEqual;ar.notEqual;ar.notStrictEqual;ar.ok;ar.rejects;ar.strict;ar.strictEqual;ar.throws;Hlt=ar.AssertionError,Klt=ar.deepEqual,Wlt=ar.deepStrictEqual,Vlt=ar.doesNotReject,Glt=ar.doesNotThrow,Ylt=ar.equal,Jlt=ar.fail,Xlt=ar.ifError,Qlt=ar.notDeepEqual,e0t=ar.notDeepStrictEqual,t0t=ar.notEqual,r0t=ar.notStrictEqual,i0t=ar.ok,n0t=ar.rejects,a0t=ar.strict,o0t=ar.strictEqual,s0t=ar.throws});function U9e(){if(ure)return wk;ure=!0;var t=yr;function e(h){if(typeof h!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(h))}function r(h,c){for(var p="",b=0,g=-1,y=0,M,x=0;x<=h.length;++x){if(x<h.length)M=h.charCodeAt(x);else{if(M===47)break;M=47}if(M===47){if(!(g===x-1||y===1))if(g!==x-1&&y===2){if(p.length<2||b!==2||p.charCodeAt(p.length-1)!==46||p.charCodeAt(p.length-2)!==46){if(p.length>2){var E=p.lastIndexOf("/");if(E!==p.length-1){E===-1?(p="",b=0):(p=p.slice(0,E),b=p.length-1-p.lastIndexOf("/")),g=x,y=0;continue}}else if(p.length===2||p.length===1){p="",b=0,g=x,y=0;continue}}c&&(p.length>0?p+="/..":p="..",b=2)}else p.length>0?p+="/"+h.slice(g+1,x):p=h.slice(g+1,x),b=x-g-1;g=x,y=0}else M===46&&y!==-1?++y:y=-1}return p}function a(h,c){var p=c.dir||c.root,b=c.base||(c.name||"")+(c.ext||"");return p?p===c.root?p+b:p+h+b:b}var i={resolve:function(){for(var c="",p=!1,b,g=arguments.length-1;g>=-1&&!p;g--){var y;g>=0?y=arguments[g]:(b===void 0&&(b=t.cwd()),y=b),e(y),y.length!==0&&(c=y+"/"+c,p=y.charCodeAt(0)===47)}return c=r(c,!p),p?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(c){if(e(c),c.length===0)return".";var p=c.charCodeAt(0)===47,b=c.charCodeAt(c.length-1)===47;return c=r(c,!p),c.length===0&&!p&&(c="."),c.length>0&&b&&(c+="/"),p?"/"+c:c},isAbsolute:function(c){return e(c),c.length>0&&c.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var c,p=0;p<arguments.length;++p){var b=arguments[p];e(b),b.length>0&&(c===void 0?c=b:c+="/"+b)}return c===void 0?".":i.normalize(c)},relative:function(c,p){if(e(c),e(p),c===p||(c=i.resolve(c),p=i.resolve(p),c===p))return"";for(var b=1;b<c.length&&c.charCodeAt(b)===47;++b);for(var g=c.length,y=g-b,M=1;M<p.length&&p.charCodeAt(M)===47;++M);for(var x=p.length,E=x-M,A=y<E?y:E,k=-1,O=0;O<=A;++O){if(O===A){if(E>A){if(p.charCodeAt(M+O)===47)return p.slice(M+O+1);if(O===0)return p.slice(M+O)}else y>A&&(c.charCodeAt(b+O)===47?k=O:O===0&&(k=0));break}var N=c.charCodeAt(b+O),L=p.charCodeAt(M+O);if(N!==L)break;N===47&&(k=O)}var C="";for(O=b+k+1;O<=g;++O)(O===g||c.charCodeAt(O)===47)&&(C.length===0?C+="..":C+="/..");return C.length>0?C+p.slice(M+k):(M+=k,p.charCodeAt(M)===47&&++M,p.slice(M))},_makeLong:function(c){return c},dirname:function(c){if(e(c),c.length===0)return".";for(var p=c.charCodeAt(0),b=p===47,g=-1,y=!0,M=c.length-1;M>=1;--M)if(p=c.charCodeAt(M),p===47){if(!y){g=M;break}}else y=!1;return g===-1?b?"/":".":b&&g===1?"//":c.slice(0,g)},basename:function(c,p){if(p!==void 0&&typeof p!="string")throw new TypeError('"ext" argument must be a string');e(c);var b=0,g=-1,y=!0,M;if(p!==void 0&&p.length>0&&p.length<=c.length){if(p.length===c.length&&p===c)return"";var x=p.length-1,E=-1;for(M=c.length-1;M>=0;--M){var A=c.charCodeAt(M);if(A===47){if(!y){b=M+1;break}}else E===-1&&(y=!1,E=M+1),x>=0&&(A===p.charCodeAt(x)?--x===-1&&(g=M):(x=-1,g=E))}return b===g?g=E:g===-1&&(g=c.length),c.slice(b,g)}else{for(M=c.length-1;M>=0;--M)if(c.charCodeAt(M)===47){if(!y){b=M+1;break}}else g===-1&&(y=!1,g=M+1);return g===-1?"":c.slice(b,g)}},extname:function(c){e(c);for(var p=-1,b=0,g=-1,y=!0,M=0,x=c.length-1;x>=0;--x){var E=c.charCodeAt(x);if(E===47){if(!y){b=x+1;break}continue}g===-1&&(y=!1,g=x+1),E===46?p===-1?p=x:M!==1&&(M=1):p!==-1&&(M=-1)}return p===-1||g===-1||M===0||M===1&&p===g-1&&p===b+1?"":c.slice(p,g)},format:function(c){if(c===null||typeof c!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof c);return a("/",c)},parse:function(c){e(c);var p={root:"",dir:"",base:"",ext:"",name:""};if(c.length===0)return p;var b=c.charCodeAt(0),g=b===47,y;g?(p.root="/",y=1):y=0;for(var M=-1,x=0,E=-1,A=!0,k=c.length-1,O=0;k>=y;--k){if(b=c.charCodeAt(k),b===47){if(!A){x=k+1;break}continue}E===-1&&(A=!1,E=k+1),b===46?M===-1?M=k:O!==1&&(O=1):M!==-1&&(O=-1)}return M===-1||E===-1||O===0||O===1&&M===E-1&&M===x+1?E!==-1&&(x===0&&g?p.base=p.name=c.slice(1,E):p.base=p.name=c.slice(x,E)):(x===0&&g?(p.name=c.slice(1,M),p.base=c.slice(1,E)):(p.name=c.slice(x,M),p.base=c.slice(x,E)),p.ext=c.slice(M,E)),x>0?p.dir=c.slice(0,x-1):g&&(p.dir="/"),p},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,wk=i,wk}var wk,ure,fn,Ad=Si(()=>{"use strict";ie();ae();ne();Ks();wk={},ure=!1;fn=U9e()});var hre={};Ha(hre,{_makeLong:()=>q9e,basename:()=>F9e,default:()=>fn,delimiter:()=>j9e,dirname:()=>z9e,extname:()=>Z9e,format:()=>H9e,isAbsolute:()=>K9e,join:()=>W9e,normalize:()=>V9e,parse:()=>G9e,posix:()=>Y9e,relative:()=>J9e,resolve:()=>X9e,sep:()=>Q9e,win32:()=>eMe});var q9e,F9e,j9e,z9e,Z9e,H9e,K9e,W9e,V9e,G9e,Y9e,J9e,X9e,Q9e,eMe,_k=Si(()=>{"use strict";ie();ae();ne();Ad();Ad();Ks();q9e=fn._makeLong,F9e=fn.basename,j9e=fn.delimiter,z9e=fn.dirname,Z9e=fn.extname,H9e=fn.format,K9e=fn.isAbsolute,W9e=fn.join,V9e=fn.normalize,G9e=fn.parse,Y9e=fn.posix,J9e=fn.relative,X9e=fn.resolve,Q9e=fn.sep,eMe=fn.win32});function Rd(t){throw new RangeError(nMe[t])}function cre(t,e){let r=t.split("@"),a="";r.length>1&&(a=r[0]+"@",t=r[1]);let i=function(h,c){let p=[],b=h.length;for(;b--;)p[b]=c(h[b]);return p}((t=t.replace(iMe,".")).split("."),e).join(".");return a+i}function vre(t){let e=[],r=0,a=t.length;for(;r<a;){let i=t.charCodeAt(r++);if(i>=55296&&i<=56319&&r<a){let h=t.charCodeAt(r++);(64512&h)==56320?e.push(((1023&i)<<10)+(1023&h)+65536):(e.push(i),r--)}else e.push(i)}return e}var tMe,rMe,iMe,nMe,Nu,Mk,lre,mre,dre,pre,ml,Jg=Si(()=>{"use strict";ie();ae();ne();tMe=/^xn--/,rMe=/[^\0-\x7E]/,iMe=/[\x2E\u3002\uFF0E\uFF61]/g,nMe={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Nu=Math.floor,Mk=String.fromCharCode;lre=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},mre=function(t,e,r){let a=0;for(t=r?Nu(t/700):t>>1,t+=Nu(t/e);t>455;a+=36)t=Nu(t/35);return Nu(a+36*t/(t+38))},dre=function(t){let e=[],r=t.length,a=0,i=128,h=72,c=t.lastIndexOf("-");c<0&&(c=0);for(let b=0;b<c;++b)t.charCodeAt(b)>=128&&Rd("not-basic"),e.push(t.charCodeAt(b));for(let b=c>0?c+1:0;b<r;){let g=a;for(let M=1,x=36;;x+=36){b>=r&&Rd("invalid-input");let E=(p=t.charCodeAt(b++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:36;(E>=36||E>Nu((2147483647-a)/M))&&Rd("overflow"),a+=E*M;let A=x<=h?1:x>=h+26?26:x-h;if(E<A)break;let k=36-A;M>Nu(2147483647/k)&&Rd("overflow"),M*=k}let y=e.length+1;h=mre(a-g,y,g==0),Nu(a/y)>2147483647-i&&Rd("overflow"),i+=Nu(a/y),a%=y,e.splice(a++,0,i)}var p;return String.fromCodePoint(...e)},pre=function(t){let e=[],r=(t=vre(t)).length,a=128,i=0,h=72;for(let b of t)b<128&&e.push(Mk(b));let c=e.length,p=c;for(c&&e.push("-");p<r;){let b=2147483647;for(let y of t)y>=a&&y<b&&(b=y);let g=p+1;b-a>Nu((2147483647-i)/g)&&Rd("overflow"),i+=(b-a)*g,a=b;for(let y of t)if(y<a&&++i>2147483647&&Rd("overflow"),y==a){let M=i;for(let x=36;;x+=36){let E=x<=h?1:x>=h+26?26:x-h;if(M<E)break;let A=M-E,k=36-E;e.push(Mk(lre(E+A%k,0))),M=Nu(A/k)}e.push(Mk(lre(M,0))),h=mre(i,g,p==c),i=0,++p}++i,++a}return e.join("")},ml={version:"2.1.0",ucs2:{decode:vre,encode:t=>String.fromCodePoint(...t)},decode:dre,encode:pre,toASCII:function(t){return cre(t,function(e){return rMe.test(e)?"xn--"+pre(e):e})},toUnicode:function(t){return cre(t,function(e){return tMe.test(e)?dre(e.slice(4).toLowerCase()):e})}};ml.decode;ml.encode;ml.toASCII;ml.toUnicode;ml.ucs2;ml.version});function aMe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var oMe,Xg,sMe,Cu,Qg=Si(()=>{"use strict";ie();ae();ne();oMe=function(t,e,r,a){e=e||"&",r=r||"=";var i={};if(typeof t!="string"||t.length===0)return i;var h=/\+/g;t=t.split(e);var c=1e3;a&&typeof a.maxKeys=="number"&&(c=a.maxKeys);var p=t.length;c>0&&p>c&&(p=c);for(var b=0;b<p;++b){var g,y,M,x,E=t[b].replace(h,"%20"),A=E.indexOf(r);A>=0?(g=E.substr(0,A),y=E.substr(A+1)):(g=E,y=""),M=decodeURIComponent(g),x=decodeURIComponent(y),aMe(i,M)?Array.isArray(i[M])?i[M].push(x):i[M]=[i[M],x]:i[M]=x}return i},Xg=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},sMe=function(t,e,r,a){return e=e||"&",r=r||"=",t===null&&(t=void 0),typeof t=="object"?Object.keys(t).map(function(i){var h=encodeURIComponent(Xg(i))+r;return Array.isArray(t[i])?t[i].map(function(c){return h+encodeURIComponent(Xg(c))}).join(e):h+encodeURIComponent(Xg(t[i]))}).join(e):a?encodeURIComponent(Xg(a))+r+encodeURIComponent(Xg(t)):""},Cu={};Cu.decode=Cu.parse=oMe,Cu.encode=Cu.stringify=sMe;Cu.decode;Cu.encode;Cu.parse;Cu.stringify});function Ps(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function e2(t,e,r){if(t&&Lu.isObject(t)&&t instanceof Ps)return t;var a=new Ps;return a.parse(t,e,r),a}function vMe(){if(wre)return Ek;wre=!0;var t=fr;function e(h){if(typeof h!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(h))}function r(h,c){for(var p="",b=0,g=-1,y=0,M,x=0;x<=h.length;++x){if(x<h.length)M=h.charCodeAt(x);else{if(M===47)break;M=47}if(M===47){if(!(g===x-1||y===1))if(g!==x-1&&y===2){if(p.length<2||b!==2||p.charCodeAt(p.length-1)!==46||p.charCodeAt(p.length-2)!==46){if(p.length>2){var E=p.lastIndexOf("/");if(E!==p.length-1){E===-1?(p="",b=0):(p=p.slice(0,E),b=p.length-1-p.lastIndexOf("/")),g=x,y=0;continue}}else if(p.length===2||p.length===1){p="",b=0,g=x,y=0;continue}}c&&(p.length>0?p+="/..":p="..",b=2)}else p.length>0?p+="/"+h.slice(g+1,x):p=h.slice(g+1,x),b=x-g-1;g=x,y=0}else M===46&&y!==-1?++y:y=-1}return p}function a(h,c){var p=c.dir||c.root,b=c.base||(c.name||"")+(c.ext||"");return p?p===c.root?p+b:p+h+b:b}var i={resolve:function(){for(var c="",p=!1,b,g=arguments.length-1;g>=-1&&!p;g--){var y;g>=0?y=arguments[g]:(b===void 0&&(b=t.cwd()),y=b),e(y),y.length!==0&&(c=y+"/"+c,p=y.charCodeAt(0)===47)}return c=r(c,!p),p?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(c){if(e(c),c.length===0)return".";var p=c.charCodeAt(0)===47,b=c.charCodeAt(c.length-1)===47;return c=r(c,!p),c.length===0&&!p&&(c="."),c.length>0&&b&&(c+="/"),p?"/"+c:c},isAbsolute:function(c){return e(c),c.length>0&&c.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var c,p=0;p<arguments.length;++p){var b=arguments[p];e(b),b.length>0&&(c===void 0?c=b:c+="/"+b)}return c===void 0?".":i.normalize(c)},relative:function(c,p){if(e(c),e(p),c===p||(c=i.resolve(c),p=i.resolve(p),c===p))return"";for(var b=1;b<c.length&&c.charCodeAt(b)===47;++b);for(var g=c.length,y=g-b,M=1;M<p.length&&p.charCodeAt(M)===47;++M);for(var x=p.length,E=x-M,A=y<E?y:E,k=-1,O=0;O<=A;++O){if(O===A){if(E>A){if(p.charCodeAt(M+O)===47)return p.slice(M+O+1);if(O===0)return p.slice(M+O)}else y>A&&(c.charCodeAt(b+O)===47?k=O:O===0&&(k=0));break}var N=c.charCodeAt(b+O),L=p.charCodeAt(M+O);if(N!==L)break;N===47&&(k=O)}var C="";for(O=b+k+1;O<=g;++O)(O===g||c.charCodeAt(O)===47)&&(C.length===0?C+="..":C+="/..");return C.length>0?C+p.slice(M+k):(M+=k,p.charCodeAt(M)===47&&++M,p.slice(M))},_makeLong:function(c){return c},dirname:function(c){if(e(c),c.length===0)return".";for(var p=c.charCodeAt(0),b=p===47,g=-1,y=!0,M=c.length-1;M>=1;--M)if(p=c.charCodeAt(M),p===47){if(!y){g=M;break}}else y=!1;return g===-1?b?"/":".":b&&g===1?"//":c.slice(0,g)},basename:function(c,p){if(p!==void 0&&typeof p!="string")throw new TypeError('"ext" argument must be a string');e(c);var b=0,g=-1,y=!0,M;if(p!==void 0&&p.length>0&&p.length<=c.length){if(p.length===c.length&&p===c)return"";var x=p.length-1,E=-1;for(M=c.length-1;M>=0;--M){var A=c.charCodeAt(M);if(A===47){if(!y){b=M+1;break}}else E===-1&&(y=!1,E=M+1),x>=0&&(A===p.charCodeAt(x)?--x===-1&&(g=M):(x=-1,g=E))}return b===g?g=E:g===-1&&(g=c.length),c.slice(b,g)}else{for(M=c.length-1;M>=0;--M)if(c.charCodeAt(M)===47){if(!y){b=M+1;break}}else g===-1&&(y=!1,g=M+1);return g===-1?"":c.slice(b,g)}},extname:function(c){e(c);for(var p=-1,b=0,g=-1,y=!0,M=0,x=c.length-1;x>=0;--x){var E=c.charCodeAt(x);if(E===47){if(!y){b=x+1;break}continue}g===-1&&(y=!1,g=x+1),E===46?p===-1?p=x:M!==1&&(M=1):p!==-1&&(M=-1)}return p===-1||g===-1||M===0||M===1&&p===g-1&&p===b+1?"":c.slice(p,g)},format:function(c){if(c===null||typeof c!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof c);return a("/",c)},parse:function(c){e(c);var p={root:"",dir:"",base:"",ext:"",name:""};if(c.length===0)return p;var b=c.charCodeAt(0),g=b===47,y;g?(p.root="/",y=1):y=0;for(var M=-1,x=0,E=-1,A=!0,k=c.length-1,O=0;k>=y;--k){if(b=c.charCodeAt(k),b===47){if(!A){x=k+1;break}continue}E===-1&&(A=!1,E=k+1),b===46?M===-1?M=k:O!==1&&(O=1):M!==-1&&(O=-1)}return M===-1||E===-1||O===0||O===1&&M===E-1&&M===x+1?E!==-1&&(x===0&&g?p.base=p.name=c.slice(1,E):p.base=p.name=c.slice(x,E)):(x===0&&g?(p.name=c.slice(1,M),p.base=c.slice(1,E)):(p.name=c.slice(x,M),p.base=c.slice(x,E)),p.ext=c.slice(M,E)),x>0?p.dir=c.slice(0,x-1):g&&(p.dir="/"),p},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,Ek=i,Ek}function RMe(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Rk?TMe(t):kMe(t)}function TMe(t){let e=t.hostname,r=t.pathname;for(let a=0;a<r.length;a++)if(r[a]==="%"){let i=r.codePointAt(a+2)||32;if(r[a+1]==="2"&&i===102||r[a+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(_Me,"\\"),r=decodeURIComponent(r),e!=="")return`\\\\${e}${r}`;{let a=r.codePointAt(1)|32,i=r[2];if(a<yMe||a>wMe||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function kMe(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let a=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function IMe(t){let e=_re.resolve(t),r=t.charCodeAt(t.length-1);(r===bMe||Rk&&r===gMe)&&e[e.length-1]!==_re.sep&&(e+="/");let a=new URL("file://");return e.includes("%")&&(e=e.replace(MMe,"%25")),!Rk&&e.includes("\\")&&(e=e.replace(xMe,"%5C")),e.includes(`
111
111
  `)&&(e=e.replace(SMe,"%0A")),e.includes("\r")&&(e=e.replace(EMe,"%0D")),e.includes(" ")&&(e=e.replace(AMe,"%09")),a.pathname=e,a}function kk(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Tk?jMe(t):zMe(t)}function jMe(t){let e=t.hostname,r=t.pathname;for(let a=0;a<r.length;a++)if(r[a]==="%"){let i=r.codePointAt(a+2)||32;if(r[a+1]==="2"&&i===102||r[a+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(LMe,"\\"),r=decodeURIComponent(r),e!=="")return`\\\\${e}${r}`;{let a=r.codePointAt(1)|32,i=r[2];if(a<NMe||a>CMe||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function zMe(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let a=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function ZMe(t){let e=fn.resolve(t),r=t.charCodeAt(t.length-1);(r===PMe||Tk&&r===OMe)&&e[e.length-1]!==fn.sep&&(e+="/");let a=new URL("file://");return e.includes("%")&&(e=e.replace($Me,"%25")),!Tk&&e.includes("\\")&&(e=e.replace(DMe,"%5C")),e.includes(`
112
112
  `)&&(e=e.replace(UMe,"%0A")),e.includes("\r")&&(e=e.replace(qMe,"%0D")),e.includes(" ")&&(e=e.replace(FMe,"%09")),a.pathname=e,a}var vi,fMe,Lu,uMe,hMe,cMe,lMe,Ak,gre,bre,yre,dMe,pMe,xk,L1,Sk,Ek,wre,_re,mMe,gMe,bMe,yMe,wMe,Rk,_Me,MMe,xMe,SMe,EMe,AMe,BMe,L0t,$0t,D0t,U0t,q0t,F0t,OMe,PMe,NMe,CMe,Tk,LMe,$Me,DMe,UMe,qMe,FMe,u4=Si(()=>{"use strict";ie();ae();ne();Jg();Qg();Uo();Ad();Ks();vi={},fMe=ml,Lu={isString:function(t){return typeof t=="string"},isObject:function(t){return typeof t=="object"&&t!==null},isNull:function(t){return t===null},isNullOrUndefined:function(t){return t==null}};vi.parse=e2,vi.resolve=function(t,e){return e2(t,!1,!0).resolve(e)},vi.resolveObject=function(t,e){return t?e2(t,!1,!0).resolveObject(e):e},vi.format=function(t){return Lu.isString(t)&&(t=e2(t)),t instanceof Ps?t.format():Ps.prototype.format.call(t)},vi.Url=Ps;uMe=/^([a-z0-9.+-]+:)/i,hMe=/:[0-9]*$/,cMe=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,lMe=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
113
- `," "]),Ak=["'"].concat(lMe),gre=["%","/","?",";","#"].concat(Ak),bre=["/","?","#"],yre=/^[+a-z0-9A-Z_-]{0,63}$/,dMe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,pMe={javascript:!0,"javascript:":!0},xk={javascript:!0,"javascript:":!0},L1={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Sk=Cu;Ps.prototype.parse=function(t,e,r){if(!Lu.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var a=t.indexOf("?"),i=a!==-1&&a<t.indexOf("#")?"?":"#",h=t.split(i);h[0]=h[0].replace(/\\/g,"/");var c=t=h.join(i);if(c=c.trim(),!r&&t.split("#").length===1){var p=cMe.exec(c);if(p)return this.path=c,this.href=c,this.pathname=p[1],p[2]?(this.search=p[2],this.query=e?Sk.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var b=uMe.exec(c);if(b){var g=(b=b[0]).toLowerCase();this.protocol=g,c=c.substr(b.length)}if(r||b||c.match(/^\/\/[^@\/]+@[^@\/]+/)){var y=c.substr(0,2)==="//";!y||b&&xk[b]||(c=c.substr(2),this.slashes=!0)}if(!xk[b]&&(y||b&&!L1[b])){for(var M,x,E=-1,A=0;A<bre.length;A++)(k=c.indexOf(bre[A]))!==-1&&(E===-1||k<E)&&(E=k);for((x=E===-1?c.lastIndexOf("@"):c.lastIndexOf("@",E))!==-1&&(M=c.slice(0,x),c=c.slice(x+1),this.auth=decodeURIComponent(M)),E=-1,A=0;A<gre.length;A++){var k;(k=c.indexOf(gre[A]))!==-1&&(E===-1||k<E)&&(E=k)}E===-1&&(E=c.length),this.host=c.slice(0,E),c=c.slice(E),this.parseHost(),this.hostname=this.hostname||"";var O=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!O)for(var N=this.hostname.split(/\./),L=(A=0,N.length);A<L;A++){var C=N[A];if(C&&!C.match(yre)){for(var Y="",G=0,ee=C.length;G<ee;G++)C.charCodeAt(G)>127?Y+="x":Y+=C[G];if(!Y.match(yre)){var $=N.slice(0,A),q=N.slice(A+1),V=C.match(dMe);V&&($.push(V[1]),q.unshift(V[2])),q.length&&(c="/"+q.join(".")+c),this.hostname=$.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=fMe.toASCII(this.hostname));var _=this.port?":"+this.port:"",n=this.hostname||"";this.host=n+_,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),c[0]!=="/"&&(c="/"+c))}if(!pMe[g])for(A=0,L=Ak.length;A<L;A++){var s=Ak[A];if(c.indexOf(s)!==-1){var f=encodeURIComponent(s);f===s&&(f=escape(s)),c=c.split(s).join(f)}}var u=c.indexOf("#");u!==-1&&(this.hash=c.substr(u),c=c.slice(0,u));var l=c.indexOf("?");if(l!==-1?(this.search=c.substr(l),this.query=c.substr(l+1),e&&(this.query=Sk.parse(this.query)),c=c.slice(0,l)):e&&(this.search="",this.query={}),c&&(this.pathname=c),L1[g]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){_=this.pathname||"";var m=this.search||"";this.path=_+m}return this.href=this.format(),this},Ps.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",a=this.hash||"",i=!1,h="";this.host?i=t+this.host:this.hostname&&(i=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&Lu.isObject(this.query)&&Object.keys(this.query).length&&(h=Sk.stringify(this.query));var c=this.search||h&&"?"+h||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||L1[e])&&i!==!1?(i="//"+(i||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):i||(i=""),a&&a.charAt(0)!=="#"&&(a="#"+a),c&&c.charAt(0)!=="?"&&(c="?"+c),e+i+(r=r.replace(/[?#]/g,function(p){return encodeURIComponent(p)}))+(c=c.replace("#","%23"))+a},Ps.prototype.resolve=function(t){return this.resolveObject(e2(t,!1,!0)).format()},Ps.prototype.resolveObject=function(t){if(Lu.isString(t)){var e=new Ps;e.parse(t,!1,!0),t=e}for(var r=new Ps,a=Object.keys(this),i=0;i<a.length;i++){var h=a[i];r[h]=this[h]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var c=Object.keys(t),p=0;p<c.length;p++){var b=c[p];b!=="protocol"&&(r[b]=t[b])}return L1[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!L1[t.protocol]){for(var g=Object.keys(t),y=0;y<g.length;y++){var M=g[y];r[M]=t[M]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||xk[t.protocol])r.pathname=t.pathname;else{for(var x=(t.pathname||"").split("/");x.length&&!(t.host=x.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),x[0]!==""&&x.unshift(""),x.length<2&&x.unshift(""),r.pathname=x.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var E=r.pathname||"",A=r.search||"";r.path=E+A}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var k=r.pathname&&r.pathname.charAt(0)==="/",O=t.host||t.pathname&&t.pathname.charAt(0)==="/",N=O||k||r.host&&t.pathname,L=N,C=r.pathname&&r.pathname.split("/")||[],Y=(x=t.pathname&&t.pathname.split("/")||[],r.protocol&&!L1[r.protocol]);if(Y&&(r.hostname="",r.port=null,r.host&&(C[0]===""?C[0]=r.host:C.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(x[0]===""?x[0]=t.host:x.unshift(t.host)),t.host=null),N=N&&(x[0]===""||C[0]==="")),O)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,C=x;else if(x.length)C||(C=[]),C.pop(),C=C.concat(x),r.search=t.search,r.query=t.query;else if(!Lu.isNullOrUndefined(t.search))return Y&&(r.hostname=r.host=C.shift(),(V=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=V.shift(),r.host=r.hostname=V.shift())),r.search=t.search,r.query=t.query,Lu.isNull(r.pathname)&&Lu.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!C.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var G=C.slice(-1)[0],ee=(r.host||t.host||C.length>1)&&(G==="."||G==="..")||G==="",$=0,q=C.length;q>=0;q--)(G=C[q])==="."?C.splice(q,1):G===".."?(C.splice(q,1),$++):$&&(C.splice(q,1),$--);if(!N&&!L)for(;$--;$)C.unshift("..");!N||C[0]===""||C[0]&&C[0].charAt(0)==="/"||C.unshift(""),ee&&C.join("/").substr(-1)!=="/"&&C.push("");var V,_=C[0]===""||C[0]&&C[0].charAt(0)==="/";return Y&&(r.hostname=r.host=_?"":C.length?C.shift():"",(V=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=V.shift(),r.host=r.hostname=V.shift())),(N=N||r.host&&C.length)&&!_&&C.unshift(""),C.length?r.pathname=C.join("/"):(r.pathname=null,r.path=null),Lu.isNull(r.pathname)&&Lu.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},Ps.prototype.parseHost=function(){var t=this.host,e=hMe.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};vi.Url;vi.format;vi.resolve;vi.resolveObject;Ek={},wre=!1;_re=vMe(),mMe=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;vi.URL=typeof URL<"u"?URL:null;vi.pathToFileURL=IMe;vi.fileURLToPath=RMe;vi.Url;vi.format;vi.resolve;vi.resolveObject;vi.URL;gMe=92,bMe=47,yMe=97,wMe=122,Rk=mMe==="win32",_Me=/\//g,MMe=/%/g,xMe=/\\/g,SMe=/\n/g,EMe=/\r/g,AMe=/\t/g;BMe=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;vi.URL=typeof URL<"u"?URL:null;vi.pathToFileURL=ZMe;vi.fileURLToPath=kk;L0t=vi.Url,$0t=vi.format,D0t=vi.resolve,U0t=vi.resolveObject,q0t=vi.parse,F0t=vi.URL,OMe=92,PMe=47,NMe=97,CMe=122,Tk=BMe==="win32",LMe=/\//g,$Me=/%/g,DMe=/\\/g,UMe=/\n/g,qMe=/\r/g,FMe=/\t/g});var Pk={};Ha(Pk,{Dir:()=>NSe,Dirent:()=>CSe,F_OK:()=>jSe,FileReadStream:()=>USe,FileWriteStream:()=>qSe,R_OK:()=>zSe,ReadStream:()=>$Se,Stats:()=>LSe,W_OK:()=>ZSe,WriteStream:()=>DSe,X_OK:()=>HSe,_toUnixTimestamp:()=>FSe,access:()=>sxe,accessSync:()=>fxe,appendFile:()=>axe,appendFileSync:()=>oxe,chmod:()=>cxe,chmodSync:()=>lxe,chown:()=>uxe,chownSync:()=>hxe,close:()=>dxe,closeSync:()=>pxe,constants:()=>KSe,copyFile:()=>vxe,copyFileSync:()=>mxe,cp:()=>gxe,cpSync:()=>bxe,createReadStream:()=>yxe,createWriteStream:()=>wxe,default:()=>Gi,exists:()=>_xe,existsSync:()=>Kre,fchmod:()=>Sxe,fchmodSync:()=>Exe,fchown:()=>Mxe,fchownSync:()=>xxe,fdatasync:()=>Axe,fdatasyncSync:()=>Rxe,fstat:()=>Txe,fstatSync:()=>kxe,fsync:()=>Ixe,fsyncSync:()=>Bxe,ftruncate:()=>Oxe,ftruncateSync:()=>Pxe,futimes:()=>Nxe,futimesSync:()=>Cxe,lchmod:()=>Dxe,lchmodSync:()=>Uxe,lchown:()=>Lxe,lchownSync:()=>$xe,link:()=>qxe,linkSync:()=>Fxe,lstat:()=>jxe,lstatSync:()=>zxe,mkdir:()=>Zxe,mkdirSync:()=>Hxe,mkdtemp:()=>Kxe,mkdtempSync:()=>Wxe,open:()=>Vxe,openSync:()=>Gxe,opendir:()=>Yxe,opendirSync:()=>Jxe,promises:()=>WSe,read:()=>eSe,readFile:()=>nSe,readFileSync:()=>aSe,readSync:()=>tSe,readdir:()=>Xxe,readdirSync:()=>Qxe,readlink:()=>oSe,readlinkSync:()=>sSe,readv:()=>rSe,readvSync:()=>iSe,realpath:()=>fSe,realpathSync:()=>uSe,rename:()=>hSe,renameSync:()=>cSe,rm:()=>lSe,rmSync:()=>dSe,rmdir:()=>pSe,rmdirSync:()=>vSe,stat:()=>mSe,statSync:()=>gSe,symlink:()=>bSe,symlinkSync:()=>ySe,truncate:()=>wSe,truncateSync:()=>_Se,unlink:()=>xSe,unlinkSync:()=>SSe,unwatchFile:()=>MSe,utimes:()=>ESe,utimesSync:()=>ASe,watch:()=>RSe,watchFile:()=>TSe,write:()=>ISe,writeFile:()=>kSe,writeFileSync:()=>Wre,writeSync:()=>BSe,writev:()=>OSe,writevSync:()=>PSe});function i2(){return Mre||(Mre=!0,Object.defineProperty(t2,"__esModule",{value:!0}),t2.constants=void 0,t2.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}),t2}function HMe(){return xre||(xre=!0,typeof BigInt=="function"?h4.default=BigInt:h4.default=function(){throw new Error("BigInt is not supported in this environment.")}),h4}function Ik(){if(Sre)return $1;Sre=!0,Object.defineProperty($1,"__esModule",{value:!0}),$1.Stats=void 0;var t=i2(),e=HMe(),r=t.constants.S_IFMT,a=t.constants.S_IFDIR,i=t.constants.S_IFREG,h=t.constants.S_IFBLK,c=t.constants.S_IFCHR,p=t.constants.S_IFLNK,b=t.constants.S_IFIFO,g=t.constants.S_IFSOCK,y=function(){function M(){}return M.build=function(x,E){E===void 0&&(E=!1);var A=new M,k=x.uid,O=x.gid,N=x.atime,L=x.mtime,C=x.ctime,Y=E?e.default:function(ee){return ee};A.uid=Y(k),A.gid=Y(O),A.rdev=Y(0),A.blksize=Y(4096),A.ino=Y(x.ino),A.size=Y(x.getSize()),A.blocks=Y(1),A.atime=N,A.mtime=L,A.ctime=C,A.birthtime=C,A.atimeMs=Y(N.getTime()),A.mtimeMs=Y(L.getTime());var G=Y(C.getTime());return A.ctimeMs=G,A.birthtimeMs=G,A.dev=Y(0),A.mode=Y(x.mode),A.nlink=Y(x.nlink),A},M.prototype._checkModeProperty=function(x){return(Number(this.mode)&r)===x},M.prototype.isDirectory=function(){return this._checkModeProperty(a)},M.prototype.isFile=function(){return this._checkModeProperty(i)},M.prototype.isBlockDevice=function(){return this._checkModeProperty(h)},M.prototype.isCharacterDevice=function(){return this._checkModeProperty(c)},M.prototype.isSymbolicLink=function(){return this._checkModeProperty(p)},M.prototype.isFIFO=function(){return this._checkModeProperty(b)},M.prototype.isSocket=function(){return this._checkModeProperty(g)},M}();return $1.Stats=y,$1.default=y,$1}function Bk(){if(Ere)return Bf;Ere=!0;var t=Bf&&Bf.__spreadArray||function(h,c,p){if(p||arguments.length===2)for(var b=0,g=c.length,y;b<g;b++)(y||!(b in c))&&(y||(y=Array.prototype.slice.call(c,0,b)),y[b]=c[b]);return h.concat(y||Array.prototype.slice.call(c))};Object.defineProperty(Bf,"__esModule",{value:!0}),Bf.bufferFrom=Bf.bufferAllocUnsafe=Bf.Buffer=void 0;var e=ni;Object.defineProperty(Bf,"Buffer",{enumerable:!0,get:function(){return e.Buffer}});function r(h){for(var c=[],p=1;p<arguments.length;p++)c[p-1]=arguments[p];return new(e.Buffer.bind.apply(e.Buffer,t([void 0,h],c,!1)))}var a=e.Buffer.allocUnsafe||r;Bf.bufferAllocUnsafe=a;var i=e.Buffer.from||r;return Bf.bufferFrom=i,Bf}function Ure(){if(Are)return qn;Are=!0;var t=qn&&qn.__extends||function(){var A=function(k,O){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,L){N.__proto__=L}||function(N,L){for(var C in L)Object.prototype.hasOwnProperty.call(L,C)&&(N[C]=L[C])},A(k,O)};return function(k,O){if(typeof O!="function"&&O!==null)throw new TypeError("Class extends value "+String(O)+" is not a constructor or null");A(k,O);function N(){this.constructor=k}k.prototype=O===null?Object.create(O):(N.prototype=O.prototype,new N)}}();Object.defineProperty(qn,"__esModule",{value:!0}),qn.E=qn.AssertionError=qn.message=qn.RangeError=qn.TypeError=qn.Error=void 0;var e=ar,r=gt,a=typeof Symbol>"u"?"_kCode":Symbol("code"),i={};function h(A){return function(k){t(O,k);function O(N){for(var L=[],C=1;C<arguments.length;C++)L[C-1]=arguments[C];var Y=k.call(this,b(N,L))||this;return Y.code=N,Y[a]=N,Y.name=k.prototype.name+" ["+Y[a]+"]",Y}return O}(A)}var c=typeof globalThis<"u"?globalThis:KMe,p=function(A){t(k,A);function k(O){var N=this;if(typeof O!="object"||O===null)throw new qn.TypeError("ERR_INVALID_ARG_TYPE","options","object");return O.message?N=A.call(this,O.message)||this:N=A.call(this,r.inspect(O.actual).slice(0,128)+" "+(O.operator+" "+r.inspect(O.expected).slice(0,128)))||this,N.generatedMessage=!O.message,N.name="AssertionError [ERR_ASSERTION]",N.code="ERR_ASSERTION",N.actual=O.actual,N.expected=O.expected,N.operator=O.operator,qn.Error.captureStackTrace(N,O.stackStartFunction),N}return k}(c.Error);qn.AssertionError=p;function b(A,k){e.strictEqual(typeof A,"string");var O=i[A];e(O,"An invalid error message key was used: "+A+".");var N;if(typeof O=="function")N=O;else{if(N=r.format,k===void 0||k.length===0)return O;k.unshift(O)}return String(N.apply(null,k))}qn.message=b;function g(A,k){i[A]=typeof k=="function"?k:String(k)}qn.E=g,qn.Error=h(c.Error),qn.TypeError=h(c.TypeError),qn.RangeError=h(c.RangeError),g("ERR_ARG_NOT_ITERABLE","%s must be iterable"),g("ERR_ASSERTION","%s"),g("ERR_BUFFER_OUT_OF_BOUNDS",E),g("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received"),g("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s"),g("ERR_CPU_USAGE","Unable to obtain cpu usage %s"),g("ERR_DNS_SET_SERVERS_FAILED",function(A,k){return'c-ares failed to set servers: "'+A+'" ['+k+"]"}),g("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value"),g("ERR_ENCODING_NOT_SUPPORTED",function(A){return'The "'+A+'" encoding is not supported'}),g("ERR_ENCODING_INVALID_ENCODED_DATA",function(A){return"The encoded data was not valid for encoding "+A}),g("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client"),g("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s"),g("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding"),g("ERR_INDEX_OUT_OF_RANGE","Index out of range"),g("ERR_INVALID_ARG_TYPE",y),g("ERR_INVALID_ARRAY_LENGTH",function(A,k,O){return e.strictEqual(typeof O,"number"),'The array "'+A+'" (length '+O+") must be of length "+k+"."}),g("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s"),g("ERR_INVALID_CALLBACK","Callback must be a function"),g("ERR_INVALID_CHAR","Invalid character in %s"),g("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column"),g("ERR_INVALID_FD",'"fd" must be a positive integer: %s'),g("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s'),g("ERR_INVALID_FILE_URL_PATH","File URL path %s"),g("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent"),g("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s"),g("ERR_INVALID_OPT_VALUE",function(A,k){return'The value "'+String(k)+'" is invalid for option "'+A+'"'}),g("ERR_INVALID_OPT_VALUE_ENCODING",function(A){return'The value "'+String(A)+'" is invalid for option "encoding"'}),g("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL'),g("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s"),g("ERR_INVALID_THIS",'Value of "this" must be of type %s'),g("ERR_INVALID_TUPLE","%s must be an iterable %s tuple"),g("ERR_INVALID_URL","Invalid URL: %s"),g("ERR_INVALID_URL_SCHEME",function(A){return"The URL must be "+x(A,"scheme")}),g("ERR_IPC_CHANNEL_CLOSED","Channel closed"),g("ERR_IPC_DISCONNECTED","IPC channel is already disconnected"),g("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe"),g("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks"),g("ERR_MISSING_ARGS",M),g("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),g("ERR_NAPI_CONS_FUNCTION","Constructor must be a function"),g("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object"),g("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support"),g("ERR_NO_LONGER_SUPPORTED","%s is no longer supported"),g("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s"),g("ERR_SOCKET_ALREADY_BOUND","Socket is already bound"),g("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536"),g("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6"),g("ERR_SOCKET_CANNOT_SEND","Unable to send data"),g("ERR_SOCKET_CLOSED","Socket is closed"),g("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running"),g("ERR_STDERR_CLOSE","process.stderr cannot be closed"),g("ERR_STDOUT_CLOSE","process.stdout cannot be closed"),g("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode"),g("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s"),g("ERR_TLS_DH_PARAM_SIZE",function(A){return"DH parameter size "+A+" is less than 2048"}),g("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout"),g("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate"),g("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext'),g("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected"),g("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming"),g("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0"),g("ERR_UNKNOWN_ENCODING","Unknown encoding: %s"),g("ERR_UNKNOWN_SIGNAL","Unknown signal: %s"),g("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type"),g("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type"),g("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl");function y(A,k,O){e(A,"name is required");var N;k.includes("not ")?(N="must not be",k=k.split("not ")[1]):N="must be";var L;if(Array.isArray(A)){var C=A.map(function(G){return'"'+G+'"'}).join(", ");L="The "+C+" arguments "+N+" "+x(k,"type")}else if(A.includes(" argument"))L="The "+A+" "+N+" "+x(k,"type");else{var Y=A.includes(".")?"property":"argument";L='The "'+A+'" '+Y+" "+N+" "+x(k,"type")}return arguments.length>=3&&(L+=". Received type "+(O!==null?typeof O:"null")),L}function M(){for(var A=[],k=0;k<arguments.length;k++)A[k]=arguments[k];e(A.length>0,"At least one arg needs to be specified");var O="The ",N=A.length;switch(A=A.map(function(L){return'"'+L+'"'}),N){case 1:O+=A[0]+" argument";break;case 2:O+=A[0]+" and "+A[1]+" arguments";break;default:O+=A.slice(0,N-1).join(", "),O+=", and "+A[N-1]+" arguments";break}return O+" must be specified"}function x(A,k){if(e(A,"expected is required"),e(typeof k=="string","thing is required"),Array.isArray(A)){var O=A.length;return e(O>0,"At least one expected value needs to be specified"),A=A.map(function(N){return String(N)}),O>2?"one of "+k+" "+A.slice(0,O-1).join(", ")+", or "+A[O-1]:O===2?"one of "+k+" "+A[0]+" or "+A[1]:"of "+k+" "+A[0]}else return"of "+k+" "+String(A)}function E(A,k){return k?"Attempt to write outside buffer bounds":'"'+A+'" is outside of buffer bounds'}return qn}function qre(){if(Rre)return $u;Rre=!0,Object.defineProperty($u,"__esModule",{value:!0}),$u.strToEncoding=$u.assertEncoding=$u.ENCODING_UTF8=void 0;var t=Bk(),e=Ure();$u.ENCODING_UTF8="utf8";function r(i){if(i&&!t.Buffer.isEncoding(i))throw new e.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",i)}$u.assertEncoding=r;function a(i,h){return!h||h===$u.ENCODING_UTF8?i:h==="buffer"?new t.Buffer(i):new t.Buffer(i).toString(h)}return $u.strToEncoding=a,$u}function Fre(){if(Tre)return D1;Tre=!0,Object.defineProperty(D1,"__esModule",{value:!0}),D1.Dirent=void 0;var t=i2(),e=qre(),r=t.constants.S_IFMT,a=t.constants.S_IFDIR,i=t.constants.S_IFREG,h=t.constants.S_IFBLK,c=t.constants.S_IFCHR,p=t.constants.S_IFLNK,b=t.constants.S_IFIFO,g=t.constants.S_IFSOCK,y=function(){function M(){this.name="",this.mode=0}return M.build=function(x,E){var A=new M,k=x.getNode().mode;return A.name=(0,e.strToEncoding)(x.getName(),E),A.mode=k,A},M.prototype._checkModeProperty=function(x){return(this.mode&r)===x},M.prototype.isDirectory=function(){return this._checkModeProperty(a)},M.prototype.isFile=function(){return this._checkModeProperty(i)},M.prototype.isBlockDevice=function(){return this._checkModeProperty(h)},M.prototype.isCharacterDevice=function(){return this._checkModeProperty(c)},M.prototype.isSymbolicLink=function(){return this._checkModeProperty(p)},M.prototype.isFIFO=function(){return this._checkModeProperty(b)},M.prototype.isSocket=function(){return this._checkModeProperty(g)},M}();return D1.Dirent=y,D1.default=y,D1}function jre(){if(kre)return c4;kre=!0;var t=yr;Object.defineProperty(c4,"__esModule",{value:!0});var e;return typeof t.nextTick=="function"?e=t.nextTick.bind(typeof globalThis<"u"?globalThis:Ire):e=setTimeout.bind(typeof globalThis<"u"?globalThis:Ire),c4.default=e,c4}function zre(){if(Bre)return U1;Bre=!0;var t=yr;Object.defineProperty(U1,"__esModule",{value:!0}),U1.createProcess=void 0;var e=function(){if(typeof t<"u")return t;try{return yr}catch{return}};function r(){var a=e()||{};return a.getuid||(a.getuid=function(){return 0}),a.getgid||(a.getgid=function(){return 0}),a.cwd||(a.cwd=function(){return"/"}),a.nextTick||(a.nextTick=jre().default),a.emitWarning||(a.emitWarning=function(i,h){console.warn(""+h+(h?": ":"")+i)}),a.env||(a.env={}),a}return U1.createProcess=r,U1.default=r(),U1}function WMe(){if(Ore)return so;Ore=!0;var t=so&&so.__extends||function(){var A=function(k,O){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,L){N.__proto__=L}||function(N,L){for(var C in L)Object.prototype.hasOwnProperty.call(L,C)&&(N[C]=L[C])},A(k,O)};return function(k,O){if(typeof O!="function"&&O!==null)throw new TypeError("Class extends value "+String(O)+" is not a constructor or null");A(k,O);function N(){this.constructor=k}k.prototype=O===null?Object.create(O):(N.prototype=O.prototype,new N)}}();Object.defineProperty(so,"__esModule",{value:!0}),so.File=so.Link=so.Node=so.SEP=void 0;var e=zre(),r=Bk(),a=i2(),i=Ei,h=Ik(),c=a.constants.S_IFMT,p=a.constants.S_IFDIR,b=a.constants.S_IFREG,g=a.constants.S_IFLNK,y=a.constants.O_APPEND;so.SEP="/";var M=function(A){t(k,A);function k(O,N){N===void 0&&(N=438);var L=A.call(this)||this;return L.uid=e.default.getuid(),L.gid=e.default.getgid(),L.atime=new Date,L.mtime=new Date,L.ctime=new Date,L.perm=438,L.mode=b,L.nlink=1,L.perm=N,L.mode|=N,L.ino=O,L}return k.prototype.getString=function(O){return O===void 0&&(O="utf8"),this.getBuffer().toString(O)},k.prototype.setString=function(O){this.buf=(0,r.bufferFrom)(O,"utf8"),this.touch()},k.prototype.getBuffer=function(){return this.buf||this.setBuffer((0,r.bufferAllocUnsafe)(0)),(0,r.bufferFrom)(this.buf)},k.prototype.setBuffer=function(O){this.buf=(0,r.bufferFrom)(O),this.touch()},k.prototype.getSize=function(){return this.buf?this.buf.length:0},k.prototype.setModeProperty=function(O){this.mode=this.mode&~c|O},k.prototype.setIsFile=function(){this.setModeProperty(b)},k.prototype.setIsDirectory=function(){this.setModeProperty(p)},k.prototype.setIsSymlink=function(){this.setModeProperty(g)},k.prototype.isFile=function(){return(this.mode&c)===b},k.prototype.isDirectory=function(){return(this.mode&c)===p},k.prototype.isSymlink=function(){return(this.mode&c)===g},k.prototype.makeSymlink=function(O){this.symlink=O,this.setIsSymlink()},k.prototype.write=function(O,N,L,C){if(N===void 0&&(N=0),L===void 0&&(L=O.length),C===void 0&&(C=0),this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0)),C+L>this.buf.length){var Y=(0,r.bufferAllocUnsafe)(C+L);this.buf.copy(Y,0,0,this.buf.length),this.buf=Y}return O.copy(this.buf,C,N,N+L),this.touch(),L},k.prototype.read=function(O,N,L,C){N===void 0&&(N=0),L===void 0&&(L=O.byteLength),C===void 0&&(C=0),this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0));var Y=L;return Y>O.byteLength&&(Y=O.byteLength),Y+C>this.buf.length&&(Y=this.buf.length-C),this.buf.copy(O,N,C,C+Y),Y},k.prototype.truncate=function(O){if(O===void 0&&(O=0),!O)this.buf=(0,r.bufferAllocUnsafe)(0);else if(this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0)),O<=this.buf.length)this.buf=this.buf.slice(0,O);else{var N=(0,r.bufferAllocUnsafe)(0);this.buf.copy(N),N.fill(0,O)}this.touch()},k.prototype.chmod=function(O){this.perm=O,this.mode=this.mode&-512|O,this.touch()},k.prototype.chown=function(O,N){this.uid=O,this.gid=N,this.touch()},k.prototype.touch=function(){this.mtime=new Date,this.emit("change",this)},k.prototype.canRead=function(O,N){return O===void 0&&(O=e.default.getuid()),N===void 0&&(N=e.default.getgid()),!!(this.perm&4||N===this.gid&&this.perm&32||O===this.uid&&this.perm&256)},k.prototype.canWrite=function(O,N){return O===void 0&&(O=e.default.getuid()),N===void 0&&(N=e.default.getgid()),!!(this.perm&2||N===this.gid&&this.perm&16||O===this.uid&&this.perm&128)},k.prototype.del=function(){this.emit("delete",this)},k.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}},k}(i.EventEmitter);so.Node=M;var x=function(A){t(k,A);function k(O,N,L){var C=A.call(this)||this;return C.children={},C.steps=[],C.ino=0,C.length=0,C.vol=O,C.parent=N,C.steps=N?N.steps.concat([L]):[L],C}return k.prototype.setNode=function(O){this.node=O,this.ino=O.ino},k.prototype.getNode=function(){return this.node},k.prototype.createChild=function(O,N){N===void 0&&(N=this.vol.createNode());var L=new k(this.vol,this,O);return L.setNode(N),N.isDirectory(),this.setChild(O,L),L},k.prototype.setChild=function(O,N){return N===void 0&&(N=new k(this.vol,this,O)),this.children[O]=N,N.parent=this,this.length++,this.emit("child:add",N,this),N},k.prototype.deleteChild=function(O){delete this.children[O.getName()],this.length--,this.emit("child:delete",O,this)},k.prototype.getChild=function(O){if(Object.hasOwnProperty.call(this.children,O))return this.children[O]},k.prototype.getPath=function(){return this.steps.join(so.SEP)},k.prototype.getName=function(){return this.steps[this.steps.length-1]},k.prototype.walk=function(O,N,L){if(N===void 0&&(N=O.length),L===void 0&&(L=0),L>=O.length)return this;if(L>=N)return this;var C=O[L],Y=this.getChild(C);return Y?Y.walk(O,N,L+1):null},k.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}},k}(i.EventEmitter);so.Link=x;var E=function(){function A(k,O,N,L){this.position=0,this.link=k,this.node=O,this.flags=N,this.fd=L}return A.prototype.getString=function(k){return this.node.getString()},A.prototype.setString=function(k){this.node.setString(k)},A.prototype.getBuffer=function(){return this.node.getBuffer()},A.prototype.setBuffer=function(k){this.node.setBuffer(k)},A.prototype.getSize=function(){return this.node.getSize()},A.prototype.truncate=function(k){this.node.truncate(k)},A.prototype.seekTo=function(k){this.position=k},A.prototype.stats=function(){return h.default.build(this.node)},A.prototype.write=function(k,O,N,L){O===void 0&&(O=0),N===void 0&&(N=k.length),typeof L!="number"&&(L=this.position),this.flags&y&&(L=this.getSize());var C=this.node.write(k,O,N,L);return this.position=L+C,C},A.prototype.read=function(k,O,N,L){O===void 0&&(O=0),N===void 0&&(N=k.byteLength),typeof L!="number"&&(L=this.position);var C=this.node.read(k,O,N,L);return this.position=L+C,C},A.prototype.chmod=function(k){this.node.chmod(k)},A.prototype.chown=function(k,O){this.node.chown(k,O)},A}();return so.File=E,so}function GMe(){if(Pre)return l4;Pre=!0,Object.defineProperty(l4,"__esModule",{value:!0});function t(e,r,a){var i=setTimeout.apply(typeof globalThis<"u"?globalThis:VMe,arguments);return i&&typeof i=="object"&&typeof i.unref=="function"&&i.unref(),i}return l4.default=t,l4}function YMe(){if(Nre)return gl;Nre=!0;var t=gl&&gl.__spreadArray||function(i,h,c){if(c||arguments.length===2)for(var p=0,b=h.length,g;p<b;p++)(g||!(p in h))&&(g||(g=Array.prototype.slice.call(h,0,p)),g[p]=h[p]);return i.concat(g||Array.prototype.slice.call(h))};Object.defineProperty(gl,"__esModule",{value:!0}),gl.FileHandle=void 0;function e(i,h,c){return c===void 0&&(c=function(p){return p}),function(){for(var p=[],b=0;b<arguments.length;b++)p[b]=arguments[b];return new Promise(function(g,y){i[h].bind(i).apply(void 0,t(t([],p,!1),[function(M,x){return M?y(M):g(c(x))}],!1))})}}var r=function(){function i(h,c){this.vol=h,this.fd=c}return i.prototype.appendFile=function(h,c){return e(this.vol,"appendFile")(this.fd,h,c)},i.prototype.chmod=function(h){return e(this.vol,"fchmod")(this.fd,h)},i.prototype.chown=function(h,c){return e(this.vol,"fchown")(this.fd,h,c)},i.prototype.close=function(){return e(this.vol,"close")(this.fd)},i.prototype.datasync=function(){return e(this.vol,"fdatasync")(this.fd)},i.prototype.read=function(h,c,p,b){return e(this.vol,"read",function(g){return{bytesRead:g,buffer:h}})(this.fd,h,c,p,b)},i.prototype.readFile=function(h){return e(this.vol,"readFile")(this.fd,h)},i.prototype.stat=function(h){return e(this.vol,"fstat")(this.fd,h)},i.prototype.sync=function(){return e(this.vol,"fsync")(this.fd)},i.prototype.truncate=function(h){return e(this.vol,"ftruncate")(this.fd,h)},i.prototype.utimes=function(h,c){return e(this.vol,"futimes")(this.fd,h,c)},i.prototype.write=function(h,c,p,b){return e(this.vol,"write",function(g){return{bytesWritten:g,buffer:h}})(this.fd,h,c,p,b)},i.prototype.writeFile=function(h,c){return e(this.vol,"writeFile")(this.fd,h,c)},i}();gl.FileHandle=r;function a(i){return typeof Promise>"u"?null:{FileHandle:r,access:function(h,c){return e(i,"access")(h,c)},appendFile:function(h,c,p){return e(i,"appendFile")(h instanceof r?h.fd:h,c,p)},chmod:function(h,c){return e(i,"chmod")(h,c)},chown:function(h,c,p){return e(i,"chown")(h,c,p)},copyFile:function(h,c,p){return e(i,"copyFile")(h,c,p)},lchmod:function(h,c){return e(i,"lchmod")(h,c)},lchown:function(h,c,p){return e(i,"lchown")(h,c,p)},link:function(h,c){return e(i,"link")(h,c)},lstat:function(h,c){return e(i,"lstat")(h,c)},mkdir:function(h,c){return e(i,"mkdir")(h,c)},mkdtemp:function(h,c){return e(i,"mkdtemp")(h,c)},open:function(h,c,p){return e(i,"open",function(b){return new r(i,b)})(h,c,p)},readdir:function(h,c){return e(i,"readdir")(h,c)},readFile:function(h,c){return e(i,"readFile")(h instanceof r?h.fd:h,c)},readlink:function(h,c){return e(i,"readlink")(h,c)},realpath:function(h,c){return e(i,"realpath")(h,c)},rename:function(h,c){return e(i,"rename")(h,c)},rmdir:function(h){return e(i,"rmdir")(h)},stat:function(h,c){return e(i,"stat")(h,c)},symlink:function(h,c,p){return e(i,"symlink")(h,c,p)},truncate:function(h,c){return e(i,"truncate")(h,c)},unlink:function(h){return e(i,"unlink")(h)},utimes:function(h,c,p){return e(i,"utimes")(h,c,p)},writeFile:function(h,c,p){return e(i,"writeFile")(h instanceof r?h.fd:h,c,p)}}}return gl.default=a,gl}function JMe(){if(Cre)return r2;Cre=!0;var t=yr;Object.defineProperty(r2,"__esModule",{value:!0}),r2.unixify=h,r2.correctPath=c;var e=t.platform==="win32";function r(p){var b=p.length-1;if(b<2)return p;for(;a(p,b);)b--;return p.substr(0,b+1)}function a(p,b){var g=p[b];return b>0&&(g==="/"||e&&g==="\\")}function i(p,b){if(typeof p!="string")throw new TypeError("expected a string");return p=p.replace(/[\\\/]+/g,"/"),b!==!1&&(p=r(p)),p}function h(p){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e?(p=i(p,b),p.replace(/^([a-zA-Z]+:|\.\/)/,"")):p}function c(p){return h(p.replace(/^\\\\\?\\.:\\/,"\\"))}return r2}function Zre(){if(Lre)return ui;Lre=!0;var t=ui&&ui.__extends||function(){var Ke=function(ve,we){return Ke=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ze,rt){ze.__proto__=rt}||function(ze,rt){for(var ft in rt)Object.prototype.hasOwnProperty.call(rt,ft)&&(ze[ft]=rt[ft])},Ke(ve,we)};return function(ve,we){if(typeof we!="function"&&we!==null)throw new TypeError("Class extends value "+String(we)+" is not a constructor or null");Ke(ve,we);function ze(){this.constructor=ve}ve.prototype=we===null?Object.create(we):(ze.prototype=we.prototype,new ze)}}(),e=ui&&ui.__spreadArray||function(Ke,ve,we){if(we||arguments.length===2)for(var ze=0,rt=ve.length,ft;ze<rt;ze++)(ft||!(ze in ve))&&(ft||(ft=Array.prototype.slice.call(ve,0,ze)),ft[ze]=ve[ze]);return Ke.concat(ft||Array.prototype.slice.call(ve))};Object.defineProperty(ui,"__esModule",{value:!0}),ui.FSWatcher=ui.StatWatcher=ui.Volume=ui.toUnixTimestamp=ui.bufferToEncoding=ui.dataToBuffer=ui.dataToStr=ui.pathToSteps=ui.filenameToSteps=ui.pathToFilename=ui.flagsToNumber=ui.FLAGS=void 0;var r=fn,a=WMe(),i=Ik(),h=Fre(),c=Bk(),p=jre(),b=zre(),g=GMe(),y=ka,M=i2(),x=Ei,E=qre(),A=Ure(),k=gt,O=YMe(),N=r.resolve,L=M.constants.O_RDONLY,C=M.constants.O_WRONLY,Y=M.constants.O_RDWR,G=M.constants.O_CREAT,ee=M.constants.O_EXCL,$=M.constants.O_TRUNC,q=M.constants.O_APPEND,V=M.constants.O_SYNC,_=M.constants.O_DIRECTORY,n=M.constants.F_OK,s=M.constants.COPYFILE_EXCL,f=M.constants.COPYFILE_FICLONE_FORCE,u=r.posix?r.posix:r,l=u.sep,m=u.relative,w=u.join,d=u.dirname,o=b.default.platform==="win32",v=128,R={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"},S=function(Ke){return"Expected options to be either an object or a string, but got "+Ke+" instead"},B="ENOENT",F="EBADF",D="EINVAL",re="EPERM",Q="EPROTO",Z="EEXIST",K="ENOTDIR",ce="EMFILE",te="EACCES",j="EISDIR",J="ENOTEMPTY",X="ENOSYS";function he(Ke,ve,we,ze){ve===void 0&&(ve=""),we===void 0&&(we=""),ze===void 0&&(ze="");var rt="";switch(we&&(rt=" '"+we+"'"),ze&&(rt+=" -> '"+ze+"'"),Ke){case B:return"ENOENT: no such file or directory, "+ve+rt;case F:return"EBADF: bad file descriptor, "+ve+rt;case D:return"EINVAL: invalid argument, "+ve+rt;case re:return"EPERM: operation not permitted, "+ve+rt;case Q:return"EPROTO: protocol error, "+ve+rt;case Z:return"EEXIST: file already exists, "+ve+rt;case K:return"ENOTDIR: not a directory, "+ve+rt;case j:return"EISDIR: illegal operation on a directory, "+ve+rt;case te:return"EACCES: permission denied, "+ve+rt;case J:return"ENOTEMPTY: directory not empty, "+ve+rt;case ce:return"EMFILE: too many open files, "+ve+rt;case X:return"ENOSYS: function not implemented, "+ve+rt;default:return Ke+": error occurred, "+ve+rt}}function Te(Ke,ve,we,ze,rt){ve===void 0&&(ve=""),we===void 0&&(we=""),ze===void 0&&(ze=""),rt===void 0&&(rt=Error);var ft=new rt(he(Ke,ve,we,ze));return ft.code=Ke,ft}var oe;(function(Ke){Ke[Ke.r=L]="r",Ke[Ke["r+"]=Y]="r+",Ke[Ke.rs=L|V]="rs",Ke[Ke.sr=Ke.rs]="sr",Ke[Ke["rs+"]=Y|V]="rs+",Ke[Ke["sr+"]=Ke["rs+"]]="sr+",Ke[Ke.w=C|G|$]="w",Ke[Ke.wx=C|G|$|ee]="wx",Ke[Ke.xw=Ke.wx]="xw",Ke[Ke["w+"]=Y|G|$]="w+",Ke[Ke["wx+"]=Y|G|$|ee]="wx+",Ke[Ke["xw+"]=Ke["wx+"]]="xw+",Ke[Ke.a=C|q|G]="a",Ke[Ke.ax=C|q|G|ee]="ax",Ke[Ke.xa=Ke.ax]="xa",Ke[Ke["a+"]=Y|q|G]="a+",Ke[Ke["ax+"]=Y|q|G|ee]="ax+",Ke[Ke["xa+"]=Ke["ax+"]]="xa+"})(oe=ui.FLAGS||(ui.FLAGS={}));function le(Ke){if(typeof Ke=="number")return Ke;if(typeof Ke=="string"){var ve=oe[Ke];if(typeof ve<"u")return ve}throw new A.TypeError("ERR_INVALID_OPT_VALUE","flags",Ke)}ui.flagsToNumber=le;function ot(Ke,ve){var we;if(ve){var ze=typeof ve;switch(ze){case"string":we=Object.assign({},Ke,{encoding:ve});break;case"object":we=Object.assign({},Ke,ve);break;default:throw TypeError(S(ze))}}else return Ke;return we.encoding!=="buffer"&&(0,E.assertEncoding)(we.encoding),we}function ge(Ke){return function(ve){return ot(Ke,ve)}}function Se(Ke){if(typeof Ke!="function")throw TypeError(R.CB);return Ke}function ut(Ke){return function(ve,we){return typeof ve=="function"?[Ke(),ve]:[Ke(ve),Se(we)]}}var Ze={encoding:"utf8"},Ge=ge(Ze),ct=ut(Ge),z={flag:"r"},T=ge(z),I={encoding:"utf8",mode:438,flag:oe[oe.w]},P=ge(I),U={encoding:"utf8",mode:438,flag:oe[oe.a]},H=ge(U),W=ut(H),fe=Ze,st=ge(fe),ue=ut(st),me={mode:511,recursive:!1},pe=function(Ke){return typeof Ke=="number"?Object.assign({},me,{mode:Ke}):Object.assign({},me,Ke)},be={recursive:!1},Qe=function(Ke){return Object.assign({},be,Ke)},se={encoding:"utf8",withFileTypes:!1},ye=ge(se),Ee=ut(ye),Fe={bigint:!1},de=function(Ke){return Ke===void 0&&(Ke={}),Object.assign({},Fe,Ke)},xe=function(Ke,ve){return typeof Ke=="function"?[de(),Ke]:[de(Ke),Se(ve)]};function lt(Ke){if(Ke.hostname!=="")throw new A.TypeError("ERR_INVALID_FILE_URL_HOST",b.default.platform);for(var ve=Ke.pathname,we=0;we<ve.length;we++)if(ve[we]==="%"){var ze=ve.codePointAt(we+2)|32;if(ve[we+1]==="2"&&ze===102)throw new A.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}return decodeURIComponent(ve)}function _e(Ke){if(typeof Ke!="string"&&!c.Buffer.isBuffer(Ke)){try{if(!(Ke instanceof vi.URL))throw new TypeError(R.PATH_STR)}catch{throw new TypeError(R.PATH_STR)}Ke=lt(Ke)}var ve=String(Ke);return Je(ve),ve}ui.pathToFilename=_e;var Ve=function(Ke,ve){return ve===void 0&&(ve=b.default.cwd()),N(ve,Ke)};if(o){var vt=Ve,Ye=JMe().unixify;Ve=function(Ke,ve){return Ye(vt(Ke,ve))}}function et(Ke,ve){var we=Ve(Ke,ve),ze=we.substr(1);return ze?ze.split(l):[]}ui.filenameToSteps=et;function mt(Ke){return et(_e(Ke))}ui.pathToSteps=mt;function We(Ke,ve){return ve===void 0&&(ve=E.ENCODING_UTF8),c.Buffer.isBuffer(Ke)?Ke.toString(ve):Ke instanceof Uint8Array?(0,c.bufferFrom)(Ke).toString(ve):String(Ke)}ui.dataToStr=We;function nt(Ke,ve){return ve===void 0&&(ve=E.ENCODING_UTF8),c.Buffer.isBuffer(Ke)?Ke:Ke instanceof Uint8Array?(0,c.bufferFrom)(Ke):(0,c.bufferFrom)(String(Ke),ve)}ui.dataToBuffer=nt;function bt(Ke,ve){return!ve||ve==="buffer"?Ke:Ke.toString(ve)}ui.bufferToEncoding=bt;function Je(Ke,ve){if((""+Ke).indexOf("\0")!==-1){var we=new Error("Path must be a string without null bytes");if(we.code=B,typeof ve!="function")throw we;return b.default.nextTick(ve,we),!1}return!0}function at(Ke,ve){if(typeof Ke=="number")return Ke;if(typeof Ke=="string")return parseInt(Ke,8);if(ve)return yt(ve)}function yt(Ke,ve){var we=at(Ke,ve);if(typeof we!="number"||isNaN(we))throw new TypeError(R.MODE_INT);return we}function Xe(Ke){return Ke>>>0===Ke}function it(Ke){if(!Xe(Ke))throw TypeError(R.FD)}function _t(Ke){if(typeof Ke=="string"&&+Ke==Ke)return+Ke;if(Ke instanceof Date)return Ke.getTime()/1e3;if(isFinite(Ke))return Ke<0?Date.now()/1e3:Ke;throw new Error("Cannot parse time: "+Ke)}ui.toUnixTimestamp=_t;function dt(Ke){if(typeof Ke!="number")throw TypeError(R.UID)}function Mt(Ke){if(typeof Ke!="number")throw TypeError(R.GID)}function Ut(Ke){var ve={};function we(ze,rt){for(var ft in rt){var pt=rt[ft],xt=w(ze,ft);typeof pt=="string"?ve[xt]=pt:typeof pt=="object"&&pt!==null&&Object.keys(pt).length>0?we(xt,pt):ve[xt]=null}}return we("",Ke),ve}var qt=function(){function Ke(ve){ve===void 0&&(ve={}),this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.promisesApi=(0,O.default)(this),this.statWatchers={},this.props=Object.assign({Node:a.Node,Link:a.Link,File:a.File},ve);var we=this.createLink();we.setNode(this.createNode(!0));var ze=this;this.StatWatcher=function(pt){t(xt,pt);function xt(){return pt.call(this,ze)||this}return xt}(Dt);var rt=Lt;this.ReadStream=function(pt){t(xt,pt);function xt(){for(var Kt=[],Qt=0;Qt<arguments.length;Qt++)Kt[Qt]=arguments[Qt];return pt.apply(this,e([ze],Kt,!1))||this}return xt}(rt);var ft=Nt;this.WriteStream=function(pt){t(xt,pt);function xt(){for(var Kt=[],Qt=0;Qt<arguments.length;Qt++)Kt[Qt]=arguments[Qt];return pt.apply(this,e([ze],Kt,!1))||this}return xt}(ft),this.FSWatcher=function(pt){t(xt,pt);function xt(){return pt.call(this,ze)||this}return xt}(zt),this.root=we}return Ke.fromJSON=function(ve,we){var ze=new Ke;return ze.fromJSON(ve,we),ze},Ke.fromNestedJSON=function(ve,we){var ze=new Ke;return ze.fromNestedJSON(ve,we),ze},Object.defineProperty(Ke.prototype,"promises",{get:function(){if(this.promisesApi===null)throw new Error("Promise is not supported in this environment.");return this.promisesApi},enumerable:!1,configurable:!0}),Ke.prototype.createLink=function(ve,we,ze,rt){if(ze===void 0&&(ze=!1),!ve)return new this.props.Link(this,null,"");if(!we)throw new Error("createLink: name cannot be empty");return ve.createChild(we,this.createNode(ze,rt))},Ke.prototype.deleteLink=function(ve){var we=ve.parent;return we?(we.deleteChild(ve),!0):!1},Ke.prototype.newInoNumber=function(){var ve=this.releasedInos.pop();return ve||(this.ino=(this.ino+1)%4294967295,this.ino)},Ke.prototype.newFdNumber=function(){var ve=this.releasedFds.pop();return typeof ve=="number"?ve:Ke.fd--},Ke.prototype.createNode=function(ve,we){ve===void 0&&(ve=!1);var ze=new this.props.Node(this.newInoNumber(),we);return ve&&ze.setIsDirectory(),this.inodes[ze.ino]=ze,ze},Ke.prototype.getNode=function(ve){return this.inodes[ve]},Ke.prototype.deleteNode=function(ve){ve.del(),delete this.inodes[ve.ino],this.releasedInos.push(ve.ino)},Ke.prototype.genRndStr=function(){var ve=(Math.random()+1).toString(36).substr(2,6);return ve.length===6?ve:this.genRndStr()},Ke.prototype.getLink=function(ve){return this.root.walk(ve)},Ke.prototype.getLinkOrThrow=function(ve,we){var ze=et(ve),rt=this.getLink(ze);if(!rt)throw Te(B,we,ve);return rt},Ke.prototype.getResolvedLink=function(ve){for(var we=typeof ve=="string"?et(ve):ve,ze=this.root,rt=0;rt<we.length;){var ft=we[rt];if(ze=ze.getChild(ft),!ze)return null;var pt=ze.getNode();if(pt.isSymlink()){we=pt.symlink.concat(we.slice(rt+1)),ze=this.root,rt=0;continue}rt++}return ze},Ke.prototype.getResolvedLinkOrThrow=function(ve,we){var ze=this.getResolvedLink(ve);if(!ze)throw Te(B,we,ve);return ze},Ke.prototype.resolveSymlinks=function(ve){return this.getResolvedLink(ve.steps.slice(1))},Ke.prototype.getLinkAsDirOrThrow=function(ve,we){var ze=this.getLinkOrThrow(ve,we);if(!ze.getNode().isDirectory())throw Te(K,we,ve);return ze},Ke.prototype.getLinkParent=function(ve){return this.root.walk(ve,ve.length-1)},Ke.prototype.getLinkParentAsDirOrThrow=function(ve,we){var ze=ve instanceof Array?ve:et(ve),rt=this.getLinkParent(ze);if(!rt)throw Te(B,we,l+ze.join(l));if(!rt.getNode().isDirectory())throw Te(K,we,l+ze.join(l));return rt},Ke.prototype.getFileByFd=function(ve){return this.fds[String(ve)]},Ke.prototype.getFileByFdOrThrow=function(ve,we){if(!Xe(ve))throw TypeError(R.FD);var ze=this.getFileByFd(ve);if(!ze)throw Te(F,we);return ze},Ke.prototype.getNodeByIdOrCreate=function(ve,we,ze){if(typeof ve=="number"){var rt=this.getFileByFd(ve);if(!rt)throw Error("File nto found");return rt.node}else{var ft=mt(ve),pt=this.getLink(ft);if(pt)return pt.getNode();if(we&G){var xt=this.getLinkParent(ft);if(xt){var Kt=ft[ft.length-1];return pt=this.createLink(xt,Kt,!1,ze),pt.getNode()}}throw Te(B,"getNodeByIdOrCreate",_e(ve))}},Ke.prototype.wrapAsync=function(ve,we,ze){var rt=this;Se(ze),(0,p.default)(function(){var ft;try{ft=ve.apply(rt,we)}catch(pt){ze(pt);return}ze(null,ft)})},Ke.prototype._toJSON=function(ve,we,ze){var rt;ve===void 0&&(ve=this.root),we===void 0&&(we={});var ft=!0,pt=ve.children;ve.getNode().isFile()&&(pt=(rt={},rt[ve.getName()]=ve.parent.getChild(ve.getName()),rt),ve=ve.parent);for(var xt in pt){ft=!1;var Kt=ve.getChild(xt);if(!Kt)throw new Error("_toJSON: unexpected undefined");var Qt=Kt.getNode();if(Qt.isFile()){var li=Kt.getPath();ze&&(li=m(ze,li)),we[li]=Qt.getString()}else Qt.isDirectory()&&this._toJSON(Kt,we,ze)}var wn=ve.getPath();return ze&&(wn=m(ze,wn)),wn&&ft&&(we[wn]=null),we},Ke.prototype.toJSON=function(ve,we,ze){we===void 0&&(we={}),ze===void 0&&(ze=!1);var rt=[];if(ve){ve instanceof Array||(ve=[ve]);for(var ft=0,pt=ve;ft<pt.length;ft++){var xt=pt[ft],Kt=_e(xt),Qt=this.getResolvedLink(Kt);Qt&&rt.push(Qt)}}else rt.push(this.root);if(!rt.length)return we;for(var li=0,wn=rt;li<wn.length;li++){var Qt=wn[li];this._toJSON(Qt,we,ze?Qt.getPath():"")}return we},Ke.prototype.fromJSON=function(ve,we){we===void 0&&(we=b.default.cwd());for(var ze in ve){var rt=ve[ze];if(ze=Ve(ze,we),typeof rt=="string"){var ft=d(ze);this.mkdirpBase(ft,511),this.writeFileSync(ze,rt)}else this.mkdirpBase(ze,511)}},Ke.prototype.fromNestedJSON=function(ve,we){this.fromJSON(Ut(ve),we)},Ke.prototype.reset=function(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(!0))},Ke.prototype.mountSync=function(ve,we){this.fromJSON(we,ve)},Ke.prototype.openLink=function(ve,we,ze){if(ze===void 0&&(ze=!0),this.openFiles>=this.maxFiles)throw Te(ce,"open",ve.getPath());var rt=ve;if(ze&&(rt=this.resolveSymlinks(ve)),!rt)throw Te(B,"open",ve.getPath());var ft=rt.getNode();if(ft.isDirectory()){if((we&(L|Y|C))!==L)throw Te(j,"open",ve.getPath())}else if(we&_)throw Te(K,"open",ve.getPath());if(!(we&C)&&!ft.canRead())throw Te(te,"open",ve.getPath());var pt=new this.props.File(ve,ft,we,this.newFdNumber());return this.fds[pt.fd]=pt,this.openFiles++,we&$&&pt.truncate(),pt},Ke.prototype.openFile=function(ve,we,ze,rt){rt===void 0&&(rt=!0);var ft=et(ve),pt=rt?this.getResolvedLink(ft):this.getLink(ft);if(!pt&&we&G){var xt=this.getResolvedLink(ft.slice(0,ft.length-1));if(!xt)throw Te(B,"open",l+ft.join(l));we&G&&typeof ze=="number"&&(pt=this.createLink(xt,ft[ft.length-1],!1,ze))}if(pt)return this.openLink(pt,we,rt);throw Te(B,"open",ve)},Ke.prototype.openBase=function(ve,we,ze,rt){rt===void 0&&(rt=!0);var ft=this.openFile(ve,we,ze,rt);if(!ft)throw Te(B,"open",ve);return ft.fd},Ke.prototype.openSync=function(ve,we,ze){ze===void 0&&(ze=438);var rt=yt(ze),ft=_e(ve),pt=le(we);return this.openBase(ft,pt,rt)},Ke.prototype.open=function(ve,we,ze,rt){var ft=ze,pt=rt;typeof ze=="function"&&(ft=438,pt=ze),ft=ft||438;var xt=yt(ft),Kt=_e(ve),Qt=le(we);this.wrapAsync(this.openBase,[Kt,Qt,xt],pt)},Ke.prototype.closeFile=function(ve){this.fds[ve.fd]&&(this.openFiles--,delete this.fds[ve.fd],this.releasedFds.push(ve.fd))},Ke.prototype.closeSync=function(ve){it(ve);var we=this.getFileByFdOrThrow(ve,"close");this.closeFile(we)},Ke.prototype.close=function(ve,we){it(ve),this.wrapAsync(this.closeSync,[ve],we)},Ke.prototype.openFileOrGetById=function(ve,we,ze){if(typeof ve=="number"){var rt=this.fds[ve];if(!rt)throw Te(B);return rt}else return this.openFile(_e(ve),we,ze)},Ke.prototype.readBase=function(ve,we,ze,rt,ft){var pt=this.getFileByFdOrThrow(ve);return pt.read(we,Number(ze),Number(rt),ft)},Ke.prototype.readSync=function(ve,we,ze,rt,ft){return it(ve),this.readBase(ve,we,ze,rt,ft)},Ke.prototype.read=function(ve,we,ze,rt,ft,pt){var xt=this;if(Se(pt),rt===0)return b.default.nextTick(function(){pt&&pt(null,0,we)});(0,p.default)(function(){try{var Kt=xt.readBase(ve,we,ze,rt,ft);pt(null,Kt,we)}catch(Qt){pt(Qt)}})},Ke.prototype.readFileBase=function(ve,we,ze){var rt,ft=typeof ve=="number",pt=ft&&Xe(ve),xt;if(pt)xt=ve;else{var Kt=_e(ve),Qt=et(Kt),li=this.getResolvedLink(Qt);if(li){var wn=li.getNode();if(wn.isDirectory())throw Te(j,"open",li.getPath())}xt=this.openSync(ve,we)}try{rt=bt(this.getFileByFdOrThrow(xt).getBuffer(),ze)}finally{pt||this.closeSync(xt)}return rt},Ke.prototype.readFileSync=function(ve,we){var ze=T(we),rt=le(ze.flag);return this.readFileBase(ve,rt,ze.encoding)},Ke.prototype.readFile=function(ve,we,ze){var rt=ut(T)(we,ze),ft=rt[0],pt=rt[1],xt=le(ft.flag);this.wrapAsync(this.readFileBase,[ve,xt,ft.encoding],pt)},Ke.prototype.writeBase=function(ve,we,ze,rt,ft){var pt=this.getFileByFdOrThrow(ve,"write");return pt.write(we,ze,rt,ft)},Ke.prototype.writeSync=function(ve,we,ze,rt,ft){it(ve);var pt,xt,Kt,Qt,li=typeof we!="string";li?(xt=(ze||0)|0,Kt=rt,Qt=ft):(Qt=ze,pt=rt);var wn=nt(we,pt);return li?typeof Kt>"u"&&(Kt=wn.length):(xt=0,Kt=wn.length),this.writeBase(ve,wn,xt,Kt,Qt)},Ke.prototype.write=function(ve,we,ze,rt,ft,pt){var xt=this;it(ve);var Kt,Qt,li,wn,Zs,Ww=typeof we,bO=typeof ze,yO=typeof rt,wO=typeof ft;Ww!=="string"?bO==="function"?Zs=ze:yO==="function"?(Kt=ze|0,Zs=rt):wO==="function"?(Kt=ze|0,Qt=rt,Zs=ft):(Kt=ze|0,Qt=rt,li=ft,Zs=pt):bO==="function"?Zs=ze:yO==="function"?(li=ze,Zs=rt):wO==="function"&&(li=ze,wn=rt,Zs=ft);var kb=nt(we,wn);Ww!=="string"?typeof Qt>"u"&&(Qt=kb.length):(Kt=0,Qt=kb.length);var Vw=Se(Zs);(0,p.default)(function(){try{var _O=xt.writeBase(ve,kb,Kt,Qt,li);Ww!=="string"?Vw(null,_O,kb):Vw(null,_O,we)}catch(Jfe){Vw(Jfe)}})},Ke.prototype.writeFileBase=function(ve,we,ze,rt){var ft=typeof ve=="number",pt;ft?pt=ve:pt=this.openBase(_e(ve),ze,rt);var xt=0,Kt=we.length,Qt=ze&q?void 0:0;try{for(;Kt>0;){var li=this.writeSync(pt,we,xt,Kt,Qt);xt+=li,Kt-=li,Qt!==void 0&&(Qt+=li)}}finally{ft||this.closeSync(pt)}},Ke.prototype.writeFileSync=function(ve,we,ze){var rt=P(ze),ft=le(rt.flag),pt=yt(rt.mode),xt=nt(we,rt.encoding);this.writeFileBase(ve,xt,ft,pt)},Ke.prototype.writeFile=function(ve,we,ze,rt){var ft=ze,pt=rt;typeof ze=="function"&&(ft=I,pt=ze);var xt=Se(pt),Kt=P(ft),Qt=le(Kt.flag),li=yt(Kt.mode),wn=nt(we,Kt.encoding);this.wrapAsync(this.writeFileBase,[ve,wn,Qt,li],xt)},Ke.prototype.linkBase=function(ve,we){var ze=et(ve),rt=this.getLink(ze);if(!rt)throw Te(B,"link",ve,we);var ft=et(we),pt=this.getLinkParent(ft);if(!pt)throw Te(B,"link",ve,we);var xt=ft[ft.length-1];if(pt.getChild(xt))throw Te(Z,"link",ve,we);var Kt=rt.getNode();Kt.nlink++,pt.createChild(xt,Kt)},Ke.prototype.copyFileBase=function(ve,we,ze){var rt=this.readFileSync(ve);if(ze&s&&this.existsSync(we))throw Te(Z,"copyFile",ve,we);if(ze&f)throw Te(X,"copyFile",ve,we);this.writeFileBase(we,rt,oe.w,438)},Ke.prototype.copyFileSync=function(ve,we,ze){var rt=_e(ve),ft=_e(we);return this.copyFileBase(rt,ft,(ze||0)|0)},Ke.prototype.copyFile=function(ve,we,ze,rt){var ft=_e(ve),pt=_e(we),xt,Kt;typeof ze=="function"?(xt=0,Kt=ze):(xt=ze,Kt=rt),Se(Kt),this.wrapAsync(this.copyFileBase,[ft,pt,xt],Kt)},Ke.prototype.linkSync=function(ve,we){var ze=_e(ve),rt=_e(we);this.linkBase(ze,rt)},Ke.prototype.link=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.wrapAsync(this.linkBase,[rt,ft],ze)},Ke.prototype.unlinkBase=function(ve){var we=et(ve),ze=this.getLink(we);if(!ze)throw Te(B,"unlink",ve);if(ze.length)throw Error("Dir not empty...");this.deleteLink(ze);var rt=ze.getNode();rt.nlink--,rt.nlink<=0&&this.deleteNode(rt)},Ke.prototype.unlinkSync=function(ve){var we=_e(ve);this.unlinkBase(we)},Ke.prototype.unlink=function(ve,we){var ze=_e(ve);this.wrapAsync(this.unlinkBase,[ze],we)},Ke.prototype.symlinkBase=function(ve,we){var ze=et(we),rt=this.getLinkParent(ze);if(!rt)throw Te(B,"symlink",ve,we);var ft=ze[ze.length-1];if(rt.getChild(ft))throw Te(Z,"symlink",ve,we);var pt=rt.createChild(ft);return pt.getNode().makeSymlink(et(ve)),pt},Ke.prototype.symlinkSync=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.symlinkBase(rt,ft)},Ke.prototype.symlink=function(ve,we,ze,rt){var ft=Se(typeof ze=="function"?ze:rt),pt=_e(ve),xt=_e(we);this.wrapAsync(this.symlinkBase,[pt,xt],ft)},Ke.prototype.realpathBase=function(ve,we){var ze=et(ve),rt=this.getResolvedLink(ze);if(!rt)throw Te(B,"realpath",ve);return(0,E.strToEncoding)(rt.getPath(),we)},Ke.prototype.realpathSync=function(ve,we){return this.realpathBase(_e(ve),st(we).encoding)},Ke.prototype.realpath=function(ve,we,ze){var rt=ue(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.realpathBase,[xt,ft.encoding],pt)},Ke.prototype.lstatBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getLink(et(ve));if(!ze)throw Te(B,"lstat",ve);return i.default.build(ze.getNode(),we)},Ke.prototype.lstatSync=function(ve,we){return this.lstatBase(_e(ve),de(we).bigint)},Ke.prototype.lstat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.lstatBase,[_e(ve),ft.bigint],pt)},Ke.prototype.statBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getResolvedLink(et(ve));if(!ze)throw Te(B,"stat",ve);return i.default.build(ze.getNode(),we)},Ke.prototype.statSync=function(ve,we){return this.statBase(_e(ve),de(we).bigint)},Ke.prototype.stat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.statBase,[_e(ve),ft.bigint],pt)},Ke.prototype.fstatBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getFileByFd(ve);if(!ze)throw Te(F,"fstat");return i.default.build(ze.node,we)},Ke.prototype.fstatSync=function(ve,we){return this.fstatBase(ve,de(we).bigint)},Ke.prototype.fstat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.fstatBase,[ve,ft.bigint],pt)},Ke.prototype.renameBase=function(ve,we){var ze=this.getLink(et(ve));if(!ze)throw Te(B,"rename",ve,we);var rt=et(we),ft=this.getLinkParent(rt);if(!ft)throw Te(B,"rename",ve,we);var pt=ze.parent;pt&&pt.deleteChild(ze);var xt=rt[rt.length-1];ze.steps=e(e([],ft.steps,!0),[xt],!1),ft.setChild(ze.getName(),ze)},Ke.prototype.renameSync=function(ve,we){var ze=_e(ve),rt=_e(we);this.renameBase(ze,rt)},Ke.prototype.rename=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.wrapAsync(this.renameBase,[rt,ft],ze)},Ke.prototype.existsBase=function(ve){return!!this.statBase(ve)},Ke.prototype.existsSync=function(ve){try{return this.existsBase(_e(ve))}catch{return!1}},Ke.prototype.exists=function(ve,we){var ze=this,rt=_e(ve);if(typeof we!="function")throw Error(R.CB);(0,p.default)(function(){try{we(ze.existsBase(rt))}catch{we(!1)}})},Ke.prototype.accessBase=function(ve,we){this.getLinkOrThrow(ve,"access")},Ke.prototype.accessSync=function(ve,we){we===void 0&&(we=n);var ze=_e(ve);we=we|0,this.accessBase(ze,we)},Ke.prototype.access=function(ve,we,ze){var rt=n,ft;typeof we!="function"?(rt=we|0,ft=Se(ze)):ft=we;var pt=_e(ve);this.wrapAsync(this.accessBase,[pt,rt],ft)},Ke.prototype.appendFileSync=function(ve,we,ze){ze===void 0&&(ze=U);var rt=H(ze);(!rt.flag||Xe(ve))&&(rt.flag="a"),this.writeFileSync(ve,we,rt)},Ke.prototype.appendFile=function(ve,we,ze,rt){var ft=W(ze,rt),pt=ft[0],xt=ft[1];(!pt.flag||Xe(ve))&&(pt.flag="a"),this.writeFile(ve,we,pt,xt)},Ke.prototype.readdirBase=function(ve,we){var ze=et(ve),rt=this.getResolvedLink(ze);if(!rt)throw Te(B,"readdir",ve);var ft=rt.getNode();if(!ft.isDirectory())throw Te(K,"scandir",ve);if(we.withFileTypes){var pt=[];for(var xt in rt.children){var Kt=rt.getChild(xt);Kt&&pt.push(h.default.build(Kt,we.encoding))}return!o&&we.encoding!=="buffer"&&pt.sort(function(wn,Zs){return wn.name<Zs.name?-1:wn.name>Zs.name?1:0}),pt}var Qt=[];for(var li in rt.children)Qt.push((0,E.strToEncoding)(li,we.encoding));return!o&&we.encoding!=="buffer"&&Qt.sort(),Qt},Ke.prototype.readdirSync=function(ve,we){var ze=ye(we),rt=_e(ve);return this.readdirBase(rt,ze)},Ke.prototype.readdir=function(ve,we,ze){var rt=Ee(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.readdirBase,[xt,ft],pt)},Ke.prototype.readlinkBase=function(ve,we){var ze=this.getLinkOrThrow(ve,"readlink"),rt=ze.getNode();if(!rt.isSymlink())throw Te(D,"readlink",ve);var ft=l+rt.symlink.join(l);return(0,E.strToEncoding)(ft,we)},Ke.prototype.readlinkSync=function(ve,we){var ze=Ge(we),rt=_e(ve);return this.readlinkBase(rt,ze.encoding)},Ke.prototype.readlink=function(ve,we,ze){var rt=ct(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.readlinkBase,[xt,ft.encoding],pt)},Ke.prototype.fsyncBase=function(ve){this.getFileByFdOrThrow(ve,"fsync")},Ke.prototype.fsyncSync=function(ve){this.fsyncBase(ve)},Ke.prototype.fsync=function(ve,we){this.wrapAsync(this.fsyncBase,[ve],we)},Ke.prototype.fdatasyncBase=function(ve){this.getFileByFdOrThrow(ve,"fdatasync")},Ke.prototype.fdatasyncSync=function(ve){this.fdatasyncBase(ve)},Ke.prototype.fdatasync=function(ve,we){this.wrapAsync(this.fdatasyncBase,[ve],we)},Ke.prototype.ftruncateBase=function(ve,we){var ze=this.getFileByFdOrThrow(ve,"ftruncate");ze.truncate(we)},Ke.prototype.ftruncateSync=function(ve,we){this.ftruncateBase(ve,we)},Ke.prototype.ftruncate=function(ve,we,ze){var rt=typeof we=="number"?we:0,ft=Se(typeof we=="number"?ze:we);this.wrapAsync(this.ftruncateBase,[ve,rt],ft)},Ke.prototype.truncateBase=function(ve,we){var ze=this.openSync(ve,"r+");try{this.ftruncateSync(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.truncateSync=function(ve,we){if(Xe(ve))return this.ftruncateSync(ve,we);this.truncateBase(ve,we)},Ke.prototype.truncate=function(ve,we,ze){var rt=typeof we=="number"?we:0,ft=Se(typeof we=="number"?ze:we);if(Xe(ve))return this.ftruncate(ve,rt,ft);this.wrapAsync(this.truncateBase,[ve,rt],ft)},Ke.prototype.futimesBase=function(ve,we,ze){var rt=this.getFileByFdOrThrow(ve,"futimes"),ft=rt.node;ft.atime=new Date(we*1e3),ft.mtime=new Date(ze*1e3)},Ke.prototype.futimesSync=function(ve,we,ze){this.futimesBase(ve,_t(we),_t(ze))},Ke.prototype.futimes=function(ve,we,ze,rt){this.wrapAsync(this.futimesBase,[ve,_t(we),_t(ze)],rt)},Ke.prototype.utimesBase=function(ve,we,ze){var rt=this.openSync(ve,"r+");try{this.futimesBase(rt,we,ze)}finally{this.closeSync(rt)}},Ke.prototype.utimesSync=function(ve,we,ze){this.utimesBase(_e(ve),_t(we),_t(ze))},Ke.prototype.utimes=function(ve,we,ze,rt){this.wrapAsync(this.utimesBase,[_e(ve),_t(we),_t(ze)],rt)},Ke.prototype.mkdirBase=function(ve,we){var ze=et(ve);if(!ze.length)throw Te(Z,"mkdir",ve);var rt=this.getLinkParentAsDirOrThrow(ve,"mkdir"),ft=ze[ze.length-1];if(rt.getChild(ft))throw Te(Z,"mkdir",ve);rt.createChild(ft,this.createNode(!0,we))},Ke.prototype.mkdirpBase=function(ve,we){for(var ze=et(ve),rt=this.root,ft=0;ft<ze.length;ft++){var pt=ze[ft];if(!rt.getNode().isDirectory())throw Te(K,"mkdir",rt.getPath());var xt=rt.getChild(pt);if(xt)if(xt.getNode().isDirectory())rt=xt;else throw Te(K,"mkdir",xt.getPath());else rt=rt.createChild(pt,this.createNode(!0,we))}},Ke.prototype.mkdirSync=function(ve,we){var ze=pe(we),rt=yt(ze.mode,511),ft=_e(ve);ze.recursive?this.mkdirpBase(ft,rt):this.mkdirBase(ft,rt)},Ke.prototype.mkdir=function(ve,we,ze){var rt=pe(we),ft=Se(typeof we=="function"?we:ze),pt=yt(rt.mode,511),xt=_e(ve);rt.recursive?this.wrapAsync(this.mkdirpBase,[xt,pt],ft):this.wrapAsync(this.mkdirBase,[xt,pt],ft)},Ke.prototype.mkdirpSync=function(ve,we){this.mkdirSync(ve,{mode:we,recursive:!0})},Ke.prototype.mkdirp=function(ve,we,ze){var rt=typeof we=="function"?void 0:we,ft=Se(typeof we=="function"?we:ze);this.mkdir(ve,{mode:rt,recursive:!0},ft)},Ke.prototype.mkdtempBase=function(ve,we,ze){ze===void 0&&(ze=5);var rt=ve+this.genRndStr();try{return this.mkdirBase(rt,511),(0,E.strToEncoding)(rt,we)}catch(ft){if(ft.code===Z){if(ze>1)return this.mkdtempBase(ve,we,ze-1);throw Error("Could not create temp dir.")}else throw ft}},Ke.prototype.mkdtempSync=function(ve,we){var ze=Ge(we).encoding;if(!ve||typeof ve!="string")throw new TypeError("filename prefix is required");return Je(ve),this.mkdtempBase(ve,ze)},Ke.prototype.mkdtemp=function(ve,we,ze){var rt=ct(we,ze),ft=rt[0].encoding,pt=rt[1];if(!ve||typeof ve!="string")throw new TypeError("filename prefix is required");Je(ve)&&this.wrapAsync(this.mkdtempBase,[ve,ft],pt)},Ke.prototype.rmdirBase=function(ve,we){var ze=Qe(we),rt=this.getLinkAsDirOrThrow(ve,"rmdir");if(rt.length&&!ze.recursive)throw Te(J,"rmdir",ve);this.deleteLink(rt)},Ke.prototype.rmdirSync=function(ve,we){this.rmdirBase(_e(ve),we)},Ke.prototype.rmdir=function(ve,we,ze){var rt=Qe(we),ft=Se(typeof we=="function"?we:ze);this.wrapAsync(this.rmdirBase,[_e(ve),rt],ft)},Ke.prototype.fchmodBase=function(ve,we){var ze=this.getFileByFdOrThrow(ve,"fchmod");ze.chmod(we)},Ke.prototype.fchmodSync=function(ve,we){this.fchmodBase(ve,yt(we))},Ke.prototype.fchmod=function(ve,we,ze){this.wrapAsync(this.fchmodBase,[ve,yt(we)],ze)},Ke.prototype.chmodBase=function(ve,we){var ze=this.openSync(ve,"r+");try{this.fchmodBase(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.chmodSync=function(ve,we){var ze=yt(we),rt=_e(ve);this.chmodBase(rt,ze)},Ke.prototype.chmod=function(ve,we,ze){var rt=yt(we),ft=_e(ve);this.wrapAsync(this.chmodBase,[ft,rt],ze)},Ke.prototype.lchmodBase=function(ve,we){var ze=this.openBase(ve,Y,0,!1);try{this.fchmodBase(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.lchmodSync=function(ve,we){var ze=yt(we),rt=_e(ve);this.lchmodBase(rt,ze)},Ke.prototype.lchmod=function(ve,we,ze){var rt=yt(we),ft=_e(ve);this.wrapAsync(this.lchmodBase,[ft,rt],ze)},Ke.prototype.fchownBase=function(ve,we,ze){this.getFileByFdOrThrow(ve,"fchown").chown(we,ze)},Ke.prototype.fchownSync=function(ve,we,ze){dt(we),Mt(ze),this.fchownBase(ve,we,ze)},Ke.prototype.fchown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.fchownBase,[ve,we,ze],rt)},Ke.prototype.chownBase=function(ve,we,ze){var rt=this.getResolvedLinkOrThrow(ve,"chown"),ft=rt.getNode();ft.chown(we,ze)},Ke.prototype.chownSync=function(ve,we,ze){dt(we),Mt(ze),this.chownBase(_e(ve),we,ze)},Ke.prototype.chown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.chownBase,[_e(ve),we,ze],rt)},Ke.prototype.lchownBase=function(ve,we,ze){this.getLinkOrThrow(ve,"lchown").getNode().chown(we,ze)},Ke.prototype.lchownSync=function(ve,we,ze){dt(we),Mt(ze),this.lchownBase(_e(ve),we,ze)},Ke.prototype.lchown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.lchownBase,[_e(ve),we,ze],rt)},Ke.prototype.watchFile=function(ve,we,ze){var rt=_e(ve),ft=we,pt=ze;if(typeof ft=="function"&&(pt=we,ft=null),typeof pt!="function")throw Error('"watchFile()" requires a listener function');var xt=5007,Kt=!0;ft&&typeof ft=="object"&&(typeof ft.interval=="number"&&(xt=ft.interval),typeof ft.persistent=="boolean"&&(Kt=ft.persistent));var Qt=this.statWatchers[rt];return Qt||(Qt=new this.StatWatcher,Qt.start(rt,Kt,xt),this.statWatchers[rt]=Qt),Qt.addListener("change",pt),Qt},Ke.prototype.unwatchFile=function(ve,we){var ze=_e(ve),rt=this.statWatchers[ze];rt&&(typeof we=="function"?rt.removeListener("change",we):rt.removeAllListeners("change"),rt.listenerCount("change")===0&&(rt.stop(),delete this.statWatchers[ze]))},Ke.prototype.createReadStream=function(ve,we){return new this.ReadStream(ve,we)},Ke.prototype.createWriteStream=function(ve,we){return new this.WriteStream(ve,we)},Ke.prototype.watch=function(ve,we,ze){var rt=_e(ve),ft=we;typeof we=="function"&&(ze=we,ft=null);var pt=Ge(ft),xt=pt.persistent,Kt=pt.recursive,Qt=pt.encoding;xt===void 0&&(xt=!0),Kt===void 0&&(Kt=!1);var li=new this.FSWatcher;return li.start(rt,xt,Kt,Qt),ze&&li.addListener("change",ze),li},Ke.fd=2147483647,Ke}();ui.Volume=qt;function Ft(Ke){Ke.emit("stop")}var Dt=function(Ke){t(ve,Ke);function ve(we){var ze=Ke.call(this)||this;return ze.onInterval=function(){try{var rt=ze.vol.statSync(ze.filename);ze.hasChanged(rt)&&(ze.emit("change",rt,ze.prev),ze.prev=rt)}finally{ze.loop()}},ze.vol=we,ze}return ve.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)},ve.prototype.hasChanged=function(we){return we.mtimeMs>this.prev.mtimeMs||we.nlink!==this.prev.nlink},ve.prototype.start=function(we,ze,rt){ze===void 0&&(ze=!0),rt===void 0&&(rt=5007),this.filename=_e(we),this.setTimeout=ze?setTimeout.bind(typeof globalThis<"u"?globalThis:XMe):g.default,this.interval=rt,this.prev=this.vol.statSync(this.filename),this.loop()},ve.prototype.stop=function(){clearTimeout(this.timeoutRef),b.default.nextTick(Ft,this)},ve}(x.EventEmitter);ui.StatWatcher=Dt;var Tt;function Zt(Ke){Tt=(0,c.bufferAllocUnsafe)(Ke),Tt.used=0}k.inherits(Lt,y.Readable),ui.ReadStream=Lt;function Lt(Ke,ve,we){if(!(this instanceof Lt))return new Lt(Ke,ve,we);if(this._vol=Ke,we=Object.assign({},ot(we,{})),we.highWaterMark===void 0&&(we.highWaterMark=64*1024),y.Readable.call(this,we),this.path=_e(ve),this.fd=we.fd===void 0?null:we.fd,this.flags=we.flags===void 0?"r":we.flags,this.mode=we.mode===void 0?438:we.mode,this.start=we.start,this.end=we.end,this.autoClose=we.autoClose===void 0?!0:we.autoClose,this.pos=void 0,this.bytesRead=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw new Error('"start" option must be <= "end" option');this.pos=this.start}typeof this.fd!="number"&&this.open(),this.on("end",function(){this.autoClose&&this.destroy&&this.destroy()})}Lt.prototype.open=function(){var Ke=this;this._vol.open(this.path,this.flags,this.mode,function(ve,we){if(ve){Ke.autoClose&&Ke.destroy&&Ke.destroy(),Ke.emit("error",ve);return}Ke.fd=we,Ke.emit("open",we),Ke.read()})},Lt.prototype._read=function(Ke){if(typeof this.fd!="number")return this.once("open",function(){this._read(Ke)});if(this.destroyed)return;(!Tt||Tt.length-Tt.used<v)&&Zt(this._readableState.highWaterMark);var ve=Tt,we=Math.min(Tt.length-Tt.used,Ke),ze=Tt.used;if(this.pos!==void 0&&(we=Math.min(this.end-this.pos+1,we)),we<=0)return this.push(null);var rt=this;this._vol.read(this.fd,Tt,Tt.used,we,this.pos,ft),this.pos!==void 0&&(this.pos+=we),Tt.used+=we;function ft(pt,xt){if(pt)rt.autoClose&&rt.destroy&&rt.destroy(),rt.emit("error",pt);else{var Kt=null;xt>0&&(rt.bytesRead+=xt,Kt=ve.slice(ze,ze+xt)),rt.push(Kt)}}},Lt.prototype._destroy=function(Ke,ve){this.close(function(we){ve(Ke||we)})},Lt.prototype.close=function(Ke){var ve=this;if(Ke&&this.once("close",Ke),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",Ht);return}return b.default.nextTick(function(){return ve.emit("close")})}this.closed=!0,this._vol.close(this.fd,function(we){we?ve.emit("error",we):ve.emit("close")}),this.fd=null};function Ht(Ke){this.close()}k.inherits(Nt,y.Writable),ui.WriteStream=Nt;function Nt(Ke,ve,we){if(!(this instanceof Nt))return new Nt(Ke,ve,we);if(this._vol=Ke,we=Object.assign({},ot(we,{})),y.Writable.call(this,we),this.path=_e(ve),this.fd=we.fd===void 0?null:we.fd,this.flags=we.flags===void 0?"w":we.flags,this.mode=we.mode===void 0?438:we.mode,this.start=we.start,this.autoClose=we.autoClose===void 0?!0:!!we.autoClose,this.pos=void 0,this.bytesWritten=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.start<0)throw new Error('"start" must be >= zero');this.pos=this.start}we.encoding&&this.setDefaultEncoding(we.encoding),typeof this.fd!="number"&&this.open(),this.once("finish",function(){this.autoClose&&this.close()})}Nt.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(Ke,ve){if(Ke){this.autoClose&&this.destroy&&this.destroy(),this.emit("error",Ke);return}this.fd=ve,this.emit("open",ve)}.bind(this))},Nt.prototype._write=function(Ke,ve,we){if(!(Ke instanceof c.Buffer))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!="number")return this.once("open",function(){this._write(Ke,ve,we)});var ze=this;this._vol.write(this.fd,Ke,0,Ke.length,this.pos,function(rt,ft){if(rt)return ze.autoClose&&ze.destroy&&ze.destroy(),we(rt);ze.bytesWritten+=ft,we()}),this.pos!==void 0&&(this.pos+=Ke.length)},Nt.prototype._writev=function(Ke,ve){if(typeof this.fd!="number")return this.once("open",function(){this._writev(Ke,ve)});for(var we=this,ze=Ke.length,rt=new Array(ze),ft=0,pt=0;pt<ze;pt++){var xt=Ke[pt].chunk;rt[pt]=xt,ft+=xt.length}var Kt=c.Buffer.concat(rt);this._vol.write(this.fd,Kt,0,Kt.length,this.pos,function(Qt,li){if(Qt)return we.destroy&&we.destroy(),ve(Qt);we.bytesWritten+=li,ve()}),this.pos!==void 0&&(this.pos+=ft)},Nt.prototype._destroy=Lt.prototype._destroy,Nt.prototype.close=Lt.prototype.close,Nt.prototype.destroySoon=Nt.prototype.end;var zt=function(Ke){t(ve,Ke);function ve(we){var ze=Ke.call(this)||this;return ze._filename="",ze._filenameEncoded="",ze._recursive=!1,ze._encoding=E.ENCODING_UTF8,ze._onNodeChange=function(){ze._emit("change")},ze._onParentChild=function(rt){rt.getName()===ze._getName()&&ze._emit("rename")},ze._emit=function(rt){ze.emit("change",rt,ze._filenameEncoded)},ze._persist=function(){ze._timer=setTimeout(ze._persist,1e6)},ze._vol=we,ze}return ve.prototype._getName=function(){return this._steps[this._steps.length-1]},ve.prototype.start=function(we,ze,rt,ft){ze===void 0&&(ze=!0),rt===void 0&&(rt=!1),ft===void 0&&(ft=E.ENCODING_UTF8),this._filename=_e(we),this._steps=et(this._filename),this._filenameEncoded=(0,E.strToEncoding)(this._filename),this._recursive=rt,this._encoding=ft;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(Kt){var pt=new Error("watch "+this._filename+" "+Kt.code);throw pt.code=Kt.code,pt.errno=Kt.code,pt}this._link.getNode().on("change",this._onNodeChange),this._link.on("child:add",this._onNodeChange),this._link.on("child:delete",this._onNodeChange);var xt=this._link.parent;xt&&(xt.setMaxListeners(xt.getMaxListeners()+1),xt.on("child:delete",this._onParentChild)),ze&&this._persist()},ve.prototype.close=function(){clearTimeout(this._timer),this._link.getNode().removeListener("change",this._onNodeChange);var we=this._link.parent;we&&we.removeListener("child:delete",this._onParentChild)},ve}(x.EventEmitter);return ui.FSWatcher=zt,ui}function QMe(){if($re)return Uh;$re=!0,Object.defineProperty(Uh,"__esModule",{value:!0}),Uh.fsAsyncMethods=Uh.fsSyncMethods=Uh.fsProps=void 0;var t=["constants","F_OK","R_OK","W_OK","X_OK","Stats"];Uh.fsProps=t;var e=["renameSync","ftruncateSync","truncateSync","chownSync","fchownSync","lchownSync","chmodSync","fchmodSync","lchmodSync","statSync","lstatSync","fstatSync","linkSync","symlinkSync","readlinkSync","realpathSync","unlinkSync","rmdirSync","mkdirSync","mkdirpSync","readdirSync","closeSync","openSync","utimesSync","futimesSync","fsyncSync","writeSync","readSync","readFileSync","writeFileSync","appendFileSync","existsSync","accessSync","fdatasyncSync","mkdtempSync","copyFileSync","createReadStream","createWriteStream"];Uh.fsSyncMethods=e;var r=["rename","ftruncate","truncate","chown","fchown","lchown","chmod","fchmod","lchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","mkdirp","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","exists","access","fdatasync","mkdtemp","copyFile","watchFile","unwatchFile","watch"];return Uh.fsAsyncMethods=r,Uh}function exe(){if(Dre)return ia;Dre=!0;var t=ia&&ia.__assign||function(){return t=Object.assign||function(E){for(var A,k=1,O=arguments.length;k<O;k++){A=arguments[k];for(var N in A)Object.prototype.hasOwnProperty.call(A,N)&&(E[N]=A[N])}return E},t.apply(this,arguments)};Object.defineProperty(ia,"__esModule",{value:!0}),ia.fs=ia.createFsFromVolume=ia.vol=ia.Volume=void 0;var e=Ik(),r=Fre(),a=Zre(),i=QMe(),h=i.fsSyncMethods,c=i.fsAsyncMethods,p=i2(),b=p.constants.F_OK,g=p.constants.R_OK,y=p.constants.W_OK,M=p.constants.X_OK;ia.Volume=a.Volume,ia.vol=new a.Volume;function x(E){for(var A={F_OK:b,R_OK:g,W_OK:y,X_OK:M,constants:p.constants,Stats:e.default,Dirent:r.default},k=0,O=h;k<O.length;k++){var N=O[k];typeof E[N]=="function"&&(A[N]=E[N].bind(E))}for(var L=0,C=c;L<C.length;L++){var N=C[L];typeof E[N]=="function"&&(A[N]=E[N].bind(E))}return A.StatWatcher=E.StatWatcher,A.FSWatcher=E.FSWatcher,A.WriteStream=E.WriteStream,A.ReadStream=E.ReadStream,A.promises=E.promises,A._toUnixTimestamp=a.toUnixTimestamp,A}return ia.createFsFromVolume=x,ia.fs=x(ia.vol),ia=t(t({},ia),ia.fs),ia.semantic=!0,ia}function Po(t){throw new Error(`Node.js fs ${t} is not supported by JSPM core in the browser`)}function Hre(t,e,r){let a=0,i=new TextDecoder;qh.watch(t,"utf8",()=>{let{size:h}=qh.fstatSync(e),c=Me.alloc(h-a);qh.readSync(e,c,0,c.length,a),a=h,r(i.decode(c,{stream:!0}))})}function Ok(t,e){if(t.protocol==="file:")return kk(t);if(t.protocol==="https:"||t.protocol==="http:"){let r="\\\\url\\"+t.href.replaceAll(/\//g,"\\\\");if(Kre(r))return r;if(e)throw new Error(`Cannot sync request URL ${t} via FS. JSPM FS support for network URLs requires using async FS methods or priming the MemFS cache first with an async request before a sync request.`);return(async()=>{let a=await fetch(t);if(!a.ok)throw new Error(`Unable to fetch ${t.href}, ${a.status}`);let i=await a.arrayBuffer();return Wre(r,Me.from(i)),r})()}throw new Error("URL "+t+" not supported in JSPM FS implementation.")}function rxe(t){return function(e,...r){return e instanceof URL?t(Ok(e,!0),...r):t(e,...r)}}function ixe(t){return async function(e,...r){return e instanceof URL?t(await Ok(e),...r):t(e,...r)}}function nxe(t){return function(e,...r){let a=r[r.length-1];e instanceof URL&&typeof a=="function"?Ok(e).then(i=>{t(i,...r)},a):t(e,...r)}}var t2,Mre,h4,xre,$1,Sre,Bf,Ere,qn,Are,KMe,$u,Rre,D1,Tre,c4,kre,Ire,U1,Bre,so,Ore,l4,Pre,VMe,gl,Nre,r2,Cre,ui,Lre,XMe,Uh,$re,ia,Dre,Td,qa,qh,txe,Gi,axe,oxe,sxe,fxe,uxe,hxe,cxe,lxe,dxe,pxe,vxe,mxe,gxe,bxe,yxe,wxe,_xe,Kre,Mxe,xxe,Sxe,Exe,Axe,Rxe,Txe,kxe,Ixe,Bxe,Oxe,Pxe,Nxe,Cxe,Lxe,$xe,Dxe,Uxe,qxe,Fxe,jxe,zxe,Zxe,Hxe,Kxe,Wxe,Vxe,Gxe,Yxe,Jxe,Xxe,Qxe,eSe,tSe,rSe,iSe,nSe,aSe,oSe,sSe,fSe,uSe,hSe,cSe,lSe,dSe,pSe,vSe,mSe,gSe,bSe,ySe,wSe,_Se,MSe,xSe,SSe,ESe,ASe,RSe,TSe,kSe,Wre,ISe,BSe,OSe,PSe,NSe,CSe,LSe,$Se,DSe,USe,qSe,FSe,jSe,zSe,ZSe,HSe,KSe,WSe,Nk=Si(()=>{"use strict";ie();ae();ne();ah();yk();no();Fo();_k();Ks();Z0();Hs();B8();u4();Ad();Rg();co();th();Uo();Gf();Jg();Qg();t2={},Mre=!1;h4={},xre=!1;$1={},Sre=!1;Bf={},Ere=!1;qn={},Are=!1,KMe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;$u={},Rre=!1;D1={},Tre=!1;c4={},kre=!1,Ire=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;U1={},Bre=!1;so={},Ore=!1;l4={},Pre=!1,VMe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;gl={},Nre=!1;r2={},Cre=!1;ui={},Lre=!1,XMe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Uh={},$re=!1;ia={},Dre=!1;Td=exe();Td.__esModule;Td.fs;Td.createFsFromVolume;Td.vol;Td.Volume;Td.semantic;qa=Zre();qa.__esModule;qa.FSWatcher;qa.StatWatcher;qa.Volume;qa.toUnixTimestamp;qa.bufferToEncoding;qa.dataToBuffer;qa.dataToStr;qa.pathToSteps;qa.filenameToSteps;qa.pathToFilename;qa.flagsToNumber;qa.FLAGS;qa.ReadStream;qa.WriteStream;({vol:qh,createFsFromVolume:txe}=Td);qh.fromNestedJSON({"/dev":{stdin:"",stdout:"",stderr:""},"/usr/bin":{},"/home":{},"/tmp":{}});qh.releasedFds=[2,1,0];qh.openSync("/dev/stdin","w");qh.openSync("/dev/stdout","r");qh.openSync("/dev/stderr","r");Hre("/dev/stdout",1,console.log);Hre("/dev/stderr",2,console.error);Gi=txe(qh);Gi.opendir=()=>Po("opendir");Gi.opendirSync=()=>Po("opendirSync");Gi.promises.opendir=()=>Po("promises.opendir");Gi.cp=()=>Po("cp");Gi.cpSync=()=>Po("cpSync");Gi.promises.cp=()=>Po("promises.cp");Gi.readv=()=>Po("readv");Gi.readvSync=()=>Po("readvSync");Gi.rm=()=>Po("rm");Gi.rmSync=()=>Po("rmSync");Gi.promises.rm=()=>Po("promises.rm");Gi.Dir=()=>Po("Dir");Gi.promises.watch=()=>Po("promises.watch");Gi.FileReadStream=Gi.ReadStream;Gi.FileWriteStream=Gi.WriteStream;Gi.promises.readFile=ixe(Gi.promises.readFile);Gi.readFile=nxe(Gi.readFile);Gi.readFileSync=rxe(Gi.readFileSync);({appendFile:axe,appendFileSync:oxe,access:sxe,accessSync:fxe,chown:uxe,chownSync:hxe,chmod:cxe,chmodSync:lxe,close:dxe,closeSync:pxe,copyFile:vxe,copyFileSync:mxe,cp:gxe,cpSync:bxe,createReadStream:yxe,createWriteStream:wxe,exists:_xe,existsSync:Kre,fchown:Mxe,fchownSync:xxe,fchmod:Sxe,fchmodSync:Exe,fdatasync:Axe,fdatasyncSync:Rxe,fstat:Txe,fstatSync:kxe,fsync:Ixe,fsyncSync:Bxe,ftruncate:Oxe,ftruncateSync:Pxe,futimes:Nxe,futimesSync:Cxe,lchown:Lxe,lchownSync:$xe,lchmod:Dxe,lchmodSync:Uxe,link:qxe,linkSync:Fxe,lstat:jxe,lstatSync:zxe,mkdir:Zxe,mkdirSync:Hxe,mkdtemp:Kxe,mkdtempSync:Wxe,open:Vxe,openSync:Gxe,opendir:Yxe,opendirSync:Jxe,readdir:Xxe,readdirSync:Qxe,read:eSe,readSync:tSe,readv:rSe,readvSync:iSe,readFile:nSe,readFileSync:aSe,readlink:oSe,readlinkSync:sSe,realpath:fSe,realpathSync:uSe,rename:hSe,renameSync:cSe,rm:lSe,rmSync:dSe,rmdir:pSe,rmdirSync:vSe,stat:mSe,statSync:gSe,symlink:bSe,symlinkSync:ySe,truncate:wSe,truncateSync:_Se,unwatchFile:MSe,unlink:xSe,unlinkSync:SSe,utimes:ESe,utimesSync:ASe,watch:RSe,watchFile:TSe,writeFile:kSe,writeFileSync:Wre,write:ISe,writeSync:BSe,writev:OSe,writevSync:PSe,Dir:NSe,Dirent:CSe,Stats:LSe,ReadStream:$Se,WriteStream:DSe,FileReadStream:USe,FileWriteStream:qSe,_toUnixTimestamp:FSe,constants:{F_OK:jSe,R_OK:zSe,W_OK:ZSe,X_OK:HSe},constants:KSe,promises:WSe}=Gi)});var p4=ht((d4,Vre)=>{"use strict";ie();ae();ne();Object.defineProperty(d4,"__esModule",{value:!0});d4.default=VSe;function VSe(t){return t&&typeof t.length=="number"&&t.length>=0&&t.length%1===0}Vre.exports=d4.default});var Yre=ht((v4,Gre)=>{"use strict";ie();ae();ne();Object.defineProperty(v4,"__esModule",{value:!0});v4.default=function(t){return function(...e){var r=e.pop();return t.call(this,e,r)}};Gre.exports=v4.default});var Qre=ht(bl=>{"use strict";ie();ae();ne();Object.defineProperty(bl,"__esModule",{value:!0});bl.fallback=Jre;bl.wrap=Xre;var GSe=bl.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,YSe=bl.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,JSe=bl.hasNextTick=typeof He=="object"&&typeof He.nextTick=="function";function Jre(t){setTimeout(t,0)}function Xre(t){return(e,...r)=>t(()=>e(...r))}var n2;GSe?n2=queueMicrotask:YSe?n2=setImmediate:JSe?n2=He.nextTick:n2=Jre;bl.default=Xre(n2)});var nie=ht((m4,iie)=>{"use strict";ie();ae();ne();Object.defineProperty(m4,"__esModule",{value:!0});m4.default=iEe;var XSe=Yre(),QSe=rie(XSe),eEe=Qre(),tEe=rie(eEe),rEe=kd();function rie(t){return t&&t.__esModule?t:{default:t}}function iEe(t){return(0,rEe.isAsync)(t)?function(...e){let r=e.pop(),a=t.apply(this,e);return eie(a,r)}:(0,QSe.default)(function(e,r){var a;try{a=t.apply(this,e)}catch(i){return r(i)}if(a&&typeof a.then=="function")return eie(a,r);r(null,a)})}function eie(t,e){return t.then(r=>{tie(e,null,r)},r=>{tie(e,r&&(r instanceof Error||r.message)?r:new Error(r))})}function tie(t,e,r){try{t(e,r)}catch(a){(0,tEe.default)(i=>{throw i},a)}}iie.exports=m4.default});var kd=ht(Fh=>{"use strict";ie();ae();ne();Object.defineProperty(Fh,"__esModule",{value:!0});Fh.isAsyncIterable=Fh.isAsyncGenerator=Fh.isAsync=void 0;var nEe=nie(),aEe=oEe(nEe);function oEe(t){return t&&t.__esModule?t:{default:t}}function aie(t){return t[Symbol.toStringTag]==="AsyncFunction"}function sEe(t){return t[Symbol.toStringTag]==="AsyncGenerator"}function fEe(t){return typeof t[Symbol.asyncIterator]=="function"}function uEe(t){if(typeof t!="function")throw new Error("expected a function");return aie(t)?(0,aEe.default)(t):t}Fh.default=uEe;Fh.isAsync=aie;Fh.isAsyncGenerator=sEe;Fh.isAsyncIterable=fEe});var q1=ht((g4,oie)=>{"use strict";ie();ae();ne();Object.defineProperty(g4,"__esModule",{value:!0});g4.default=hEe;function hEe(t,e){if(e||(e=t.length),!e)throw new Error("arity is undefined");function r(...a){return typeof a[e-1]=="function"?t.apply(this,a):new Promise((i,h)=>{a[e-1]=(c,...p)=>{if(c)return h(c);i(p.length>1?p:p[0])},t.apply(this,a)})}return r}oie.exports=g4.default});var fie=ht((b4,sie)=>{"use strict";ie();ae();ne();Object.defineProperty(b4,"__esModule",{value:!0});var cEe=p4(),lEe=Ck(cEe),dEe=kd(),pEe=Ck(dEe),vEe=q1(),mEe=Ck(vEe);function Ck(t){return t&&t.__esModule?t:{default:t}}b4.default=(0,mEe.default)((t,e,r)=>{var a=(0,lEe.default)(e)?[]:{};t(e,(i,h,c)=>{(0,pEe.default)(i)((p,...b)=>{b.length<2&&([b]=b),a[h]=b,c(p)})},i=>r(i,a))},3);sie.exports=b4.default});var Lk=ht((y4,uie)=>{"use strict";ie();ae();ne();Object.defineProperty(y4,"__esModule",{value:!0});y4.default=gEe;function gEe(t){function e(...r){if(t!==null){var a=t;t=null,a.apply(this,r)}}return Object.assign(e,t),e}uie.exports=y4.default});var cie=ht((w4,hie)=>{"use strict";ie();ae();ne();Object.defineProperty(w4,"__esModule",{value:!0});w4.default=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()};hie.exports=w4.default});var pie=ht((_4,die)=>{"use strict";ie();ae();ne();Object.defineProperty(_4,"__esModule",{value:!0});_4.default=EEe;var bEe=p4(),yEe=lie(bEe),wEe=cie(),_Ee=lie(wEe);function lie(t){return t&&t.__esModule?t:{default:t}}function MEe(t){var e=-1,r=t.length;return function(){return++e<r?{value:t[e],key:e}:null}}function xEe(t){var e=-1;return function(){var a=t.next();return a.done?null:(e++,{value:a.value,key:e})}}function SEe(t){var e=t?Object.keys(t):[],r=-1,a=e.length;return function i(){var h=e[++r];return h==="__proto__"?i():r<a?{value:t[h],key:h}:null}}function EEe(t){if((0,yEe.default)(t))return MEe(t);var e=(0,_Ee.default)(t);return e?xEe(e):SEe(t)}die.exports=_4.default});var $k=ht((M4,vie)=>{"use strict";ie();ae();ne();Object.defineProperty(M4,"__esModule",{value:!0});M4.default=AEe;function AEe(t){return function(...e){if(t===null)throw new Error("Callback was already called.");var r=t;t=null,r.apply(this,e)}}vie.exports=M4.default});var S4=ht((x4,mie)=>{"use strict";ie();ae();ne();Object.defineProperty(x4,"__esModule",{value:!0});var REe={};x4.default=REe;mie.exports=x4.default});var bie=ht((E4,gie)=>{"use strict";ie();ae();ne();Object.defineProperty(E4,"__esModule",{value:!0});E4.default=BEe;var TEe=S4(),kEe=IEe(TEe);function IEe(t){return t&&t.__esModule?t:{default:t}}function BEe(t,e,r,a){let i=!1,h=!1,c=!1,p=0,b=0;function g(){p>=e||c||i||(c=!0,t.next().then(({value:x,done:E})=>{if(!(h||i)){if(c=!1,E){i=!0,p<=0&&a(null);return}p++,r(x,b,y),b++,g()}}).catch(M))}function y(x,E){if(p-=1,!h){if(x)return M(x);if(x===!1){i=!0,h=!0;return}if(E===kEe.default||i&&p<=0)return i=!0,a(null);g()}}function M(x){h||(c=!1,i=!0,a(x))}g()}gie.exports=E4.default});var Mie=ht((A4,_ie)=>{"use strict";ie();ae();ne();Object.defineProperty(A4,"__esModule",{value:!0});var OEe=Lk(),PEe=a2(OEe),NEe=pie(),CEe=a2(NEe),LEe=$k(),$Ee=a2(LEe),yie=kd(),DEe=bie(),wie=a2(DEe),UEe=S4(),qEe=a2(UEe);function a2(t){return t&&t.__esModule?t:{default:t}}A4.default=t=>(e,r,a)=>{if(a=(0,PEe.default)(a),t<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return a(null);if((0,yie.isAsyncGenerator)(e))return(0,wie.default)(e,t,r,a);if((0,yie.isAsyncIterable)(e))return(0,wie.default)(e[Symbol.asyncIterator](),t,r,a);var i=(0,CEe.default)(e),h=!1,c=!1,p=0,b=!1;function g(M,x){if(!c)if(p-=1,M)h=!0,a(M);else if(M===!1)h=!0,c=!0;else{if(x===qEe.default||h&&p<=0)return h=!0,a(null);b||y()}}function y(){for(b=!0;p<t&&!h;){var M=i();if(M===null){h=!0,p<=0&&a(null);return}p+=1,r(M.value,M.key,(0,$Ee.default)(g))}b=!1}y()};_ie.exports=A4.default});var Uk=ht((R4,xie)=>{"use strict";ie();ae();ne();Object.defineProperty(R4,"__esModule",{value:!0});var FEe=Mie(),jEe=Dk(FEe),zEe=kd(),ZEe=Dk(zEe),HEe=q1(),KEe=Dk(HEe);function Dk(t){return t&&t.__esModule?t:{default:t}}function WEe(t,e,r,a){return(0,jEe.default)(e)(t,(0,ZEe.default)(r),a)}R4.default=(0,KEe.default)(WEe,4);xie.exports=R4.default});var Aie=ht((T4,Eie)=>{"use strict";ie();ae();ne();Object.defineProperty(T4,"__esModule",{value:!0});var VEe=Uk(),GEe=Sie(VEe),YEe=q1(),JEe=Sie(YEe);function Sie(t){return t&&t.__esModule?t:{default:t}}function XEe(t,e,r){return(0,GEe.default)(t,1,e,r)}T4.default=(0,JEe.default)(XEe,3);Eie.exports=T4.default});var kie=ht((k4,Tie)=>{"use strict";ie();ae();ne();Object.defineProperty(k4,"__esModule",{value:!0});k4.default=iAe;var QEe=fie(),eAe=Rie(QEe),tAe=Aie(),rAe=Rie(tAe);function Rie(t){return t&&t.__esModule?t:{default:t}}function iAe(t,e){return(0,eAe.default)(rAe.default,t,e)}Tie.exports=k4.default});var Hie={};Ha(Hie,{Deflate:()=>pAe,DeflateRaw:()=>vAe,Gunzip:()=>mAe,Gzip:()=>gAe,Inflate:()=>bAe,InflateRaw:()=>yAe,Unzip:()=>wAe,Z_BEST_COMPRESSION:()=>_Ae,Z_BEST_SPEED:()=>MAe,Z_BINARY:()=>xAe,Z_BLOCK:()=>SAe,Z_BUF_ERROR:()=>EAe,Z_DATA_ERROR:()=>AAe,Z_DEFAULT_CHUNK:()=>RAe,Z_DEFAULT_COMPRESSION:()=>TAe,Z_DEFAULT_LEVEL:()=>kAe,Z_DEFAULT_MEMLEVEL:()=>IAe,Z_DEFAULT_STRATEGY:()=>BAe,Z_DEFAULT_WINDOWBITS:()=>OAe,Z_DEFLATED:()=>PAe,Z_ERRNO:()=>NAe,Z_FILTERED:()=>CAe,Z_FINISH:()=>LAe,Z_FIXED:()=>$Ae,Z_FULL_FLUSH:()=>DAe,Z_HUFFMAN_ONLY:()=>UAe,Z_MAX_CHUNK:()=>qAe,Z_MAX_LEVEL:()=>FAe,Z_MAX_MEMLEVEL:()=>jAe,Z_MAX_WINDOWBITS:()=>zAe,Z_MIN_CHUNK:()=>ZAe,Z_MIN_LEVEL:()=>HAe,Z_MIN_MEMLEVEL:()=>KAe,Z_MIN_WINDOWBITS:()=>WAe,Z_NEED_DICT:()=>VAe,Z_NO_COMPRESSION:()=>GAe,Z_NO_FLUSH:()=>YAe,Z_OK:()=>JAe,Z_PARTIAL_FLUSH:()=>XAe,Z_RLE:()=>QAe,Z_STREAM_END:()=>eRe,Z_STREAM_ERROR:()=>tRe,Z_SYNC_FLUSH:()=>rRe,Z_TEXT:()=>iRe,Z_TREES:()=>nRe,Z_UNKNOWN:()=>aRe,Zlib:()=>oRe,codes:()=>sRe,createDeflate:()=>fRe,createDeflateRaw:()=>uRe,createGunzip:()=>hRe,createGzip:()=>cRe,createInflate:()=>lRe,createInflateRaw:()=>dRe,createUnzip:()=>pRe,default:()=>At,deflate:()=>vRe,deflateRaw:()=>mRe,deflateRawSync:()=>gRe,deflateSync:()=>bRe,gunzip:()=>yRe,gunzipSync:()=>wRe,gzip:()=>_Re,gzipSync:()=>MRe,inflate:()=>xRe,inflateRaw:()=>SRe,inflateRawSync:()=>ERe,inflateSync:()=>ARe,unzip:()=>RRe,unzipSync:()=>TRe});function nAe(){if(Iie)return qk;Iie=!0;function t(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return qk=t,qk}function I4(){if(Bie)return Ba;Bie=!0;var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function e(i,h){return Object.prototype.hasOwnProperty.call(i,h)}Ba.assign=function(i){for(var h=Array.prototype.slice.call(arguments,1);h.length;){var c=h.shift();if(c){if(typeof c!="object")throw new TypeError(c+"must be non-object");for(var p in c)e(c,p)&&(i[p]=c[p])}}return i},Ba.shrinkBuf=function(i,h){return i.length===h?i:i.subarray?i.subarray(0,h):(i.length=h,i)};var r={arraySet:function(i,h,c,p,b){if(h.subarray&&i.subarray){i.set(h.subarray(c,c+p),b);return}for(var g=0;g<p;g++)i[b+g]=h[c+g]},flattenChunks:function(i){var h,c,p,b,g,y;for(p=0,h=0,c=i.length;h<c;h++)p+=i[h].length;for(y=new Uint8Array(p),b=0,h=0,c=i.length;h<c;h++)g=i[h],y.set(g,b),b+=g.length;return y}},a={arraySet:function(i,h,c,p,b){for(var g=0;g<p;g++)i[b+g]=h[c+g]},flattenChunks:function(i){return[].concat.apply([],i)}};return Ba.setTyped=function(i){i?(Ba.Buf8=Uint8Array,Ba.Buf16=Uint16Array,Ba.Buf32=Int32Array,Ba.assign(Ba,r)):(Ba.Buf8=Array,Ba.Buf16=Array,Ba.Buf32=Array,Ba.assign(Ba,a))},Ba.setTyped(t),Ba}function aAe(){if(Oie)return Id;Oie=!0;var t=I4(),e=4,r=0,a=1,i=2;function h(H){for(var W=H.length;--W>=0;)H[W]=0}var c=0,p=1,b=2,g=3,y=258,M=29,x=256,E=x+1+M,A=30,k=19,O=2*E+1,N=15,L=16,C=7,Y=256,G=16,ee=17,$=18,q=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],V=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],n=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],s=512,f=new Array((E+2)*2);h(f);var u=new Array(A*2);h(u);var l=new Array(s);h(l);var m=new Array(y-g+1);h(m);var w=new Array(M);h(w);var d=new Array(A);h(d);function o(H,W,fe,st,ue){this.static_tree=H,this.extra_bits=W,this.extra_base=fe,this.elems=st,this.max_length=ue,this.has_stree=H&&H.length}var v,R,S;function B(H,W){this.dyn_tree=H,this.max_code=0,this.stat_desc=W}function F(H){return H<256?l[H]:l[256+(H>>>7)]}function D(H,W){H.pending_buf[H.pending++]=W&255,H.pending_buf[H.pending++]=W>>>8&255}function re(H,W,fe){H.bi_valid>L-fe?(H.bi_buf|=W<<H.bi_valid&65535,D(H,H.bi_buf),H.bi_buf=W>>L-H.bi_valid,H.bi_valid+=fe-L):(H.bi_buf|=W<<H.bi_valid&65535,H.bi_valid+=fe)}function Q(H,W,fe){re(H,fe[W*2],fe[W*2+1])}function Z(H,W){var fe=0;do fe|=H&1,H>>>=1,fe<<=1;while(--W>0);return fe>>>1}function K(H){H.bi_valid===16?(D(H,H.bi_buf),H.bi_buf=0,H.bi_valid=0):H.bi_valid>=8&&(H.pending_buf[H.pending++]=H.bi_buf&255,H.bi_buf>>=8,H.bi_valid-=8)}function ce(H,W){var fe=W.dyn_tree,st=W.max_code,ue=W.stat_desc.static_tree,me=W.stat_desc.has_stree,pe=W.stat_desc.extra_bits,be=W.stat_desc.extra_base,Qe=W.stat_desc.max_length,se,ye,Ee,Fe,de,xe,lt=0;for(Fe=0;Fe<=N;Fe++)H.bl_count[Fe]=0;for(fe[H.heap[H.heap_max]*2+1]=0,se=H.heap_max+1;se<O;se++)ye=H.heap[se],Fe=fe[fe[ye*2+1]*2+1]+1,Fe>Qe&&(Fe=Qe,lt++),fe[ye*2+1]=Fe,!(ye>st)&&(H.bl_count[Fe]++,de=0,ye>=be&&(de=pe[ye-be]),xe=fe[ye*2],H.opt_len+=xe*(Fe+de),me&&(H.static_len+=xe*(ue[ye*2+1]+de)));if(lt!==0){do{for(Fe=Qe-1;H.bl_count[Fe]===0;)Fe--;H.bl_count[Fe]--,H.bl_count[Fe+1]+=2,H.bl_count[Qe]--,lt-=2}while(lt>0);for(Fe=Qe;Fe!==0;Fe--)for(ye=H.bl_count[Fe];ye!==0;)Ee=H.heap[--se],!(Ee>st)&&(fe[Ee*2+1]!==Fe&&(H.opt_len+=(Fe-fe[Ee*2+1])*fe[Ee*2],fe[Ee*2+1]=Fe),ye--)}}function te(H,W,fe){var st=new Array(N+1),ue=0,me,pe;for(me=1;me<=N;me++)st[me]=ue=ue+fe[me-1]<<1;for(pe=0;pe<=W;pe++){var be=H[pe*2+1];be!==0&&(H[pe*2]=Z(st[be]++,be))}}function j(){var H,W,fe,st,ue,me=new Array(N+1);for(fe=0,st=0;st<M-1;st++)for(w[st]=fe,H=0;H<1<<q[st];H++)m[fe++]=st;for(m[fe-1]=st,ue=0,st=0;st<16;st++)for(d[st]=ue,H=0;H<1<<V[st];H++)l[ue++]=st;for(ue>>=7;st<A;st++)for(d[st]=ue<<7,H=0;H<1<<V[st]-7;H++)l[256+ue++]=st;for(W=0;W<=N;W++)me[W]=0;for(H=0;H<=143;)f[H*2+1]=8,H++,me[8]++;for(;H<=255;)f[H*2+1]=9,H++,me[9]++;for(;H<=279;)f[H*2+1]=7,H++,me[7]++;for(;H<=287;)f[H*2+1]=8,H++,me[8]++;for(te(f,E+1,me),H=0;H<A;H++)u[H*2+1]=5,u[H*2]=Z(H,5);v=new o(f,q,x+1,E,N),R=new o(u,V,0,A,N),S=new o(new Array(0),_,0,k,C)}function J(H){var W;for(W=0;W<E;W++)H.dyn_ltree[W*2]=0;for(W=0;W<A;W++)H.dyn_dtree[W*2]=0;for(W=0;W<k;W++)H.bl_tree[W*2]=0;H.dyn_ltree[Y*2]=1,H.opt_len=H.static_len=0,H.last_lit=H.matches=0}function X(H){H.bi_valid>8?D(H,H.bi_buf):H.bi_valid>0&&(H.pending_buf[H.pending++]=H.bi_buf),H.bi_buf=0,H.bi_valid=0}function he(H,W,fe,st){X(H),st&&(D(H,fe),D(H,~fe)),t.arraySet(H.pending_buf,H.window,W,fe,H.pending),H.pending+=fe}function Te(H,W,fe,st){var ue=W*2,me=fe*2;return H[ue]<H[me]||H[ue]===H[me]&&st[W]<=st[fe]}function oe(H,W,fe){for(var st=H.heap[fe],ue=fe<<1;ue<=H.heap_len&&(ue<H.heap_len&&Te(W,H.heap[ue+1],H.heap[ue],H.depth)&&ue++,!Te(W,st,H.heap[ue],H.depth));)H.heap[fe]=H.heap[ue],fe=ue,ue<<=1;H.heap[fe]=st}function le(H,W,fe){var st,ue,me=0,pe,be;if(H.last_lit!==0)do st=H.pending_buf[H.d_buf+me*2]<<8|H.pending_buf[H.d_buf+me*2+1],ue=H.pending_buf[H.l_buf+me],me++,st===0?Q(H,ue,W):(pe=m[ue],Q(H,pe+x+1,W),be=q[pe],be!==0&&(ue-=w[pe],re(H,ue,be)),st--,pe=F(st),Q(H,pe,fe),be=V[pe],be!==0&&(st-=d[pe],re(H,st,be)));while(me<H.last_lit);Q(H,Y,W)}function ot(H,W){var fe=W.dyn_tree,st=W.stat_desc.static_tree,ue=W.stat_desc.has_stree,me=W.stat_desc.elems,pe,be,Qe=-1,se;for(H.heap_len=0,H.heap_max=O,pe=0;pe<me;pe++)fe[pe*2]!==0?(H.heap[++H.heap_len]=Qe=pe,H.depth[pe]=0):fe[pe*2+1]=0;for(;H.heap_len<2;)se=H.heap[++H.heap_len]=Qe<2?++Qe:0,fe[se*2]=1,H.depth[se]=0,H.opt_len--,ue&&(H.static_len-=st[se*2+1]);for(W.max_code=Qe,pe=H.heap_len>>1;pe>=1;pe--)oe(H,fe,pe);se=me;do pe=H.heap[1],H.heap[1]=H.heap[H.heap_len--],oe(H,fe,1),be=H.heap[1],H.heap[--H.heap_max]=pe,H.heap[--H.heap_max]=be,fe[se*2]=fe[pe*2]+fe[be*2],H.depth[se]=(H.depth[pe]>=H.depth[be]?H.depth[pe]:H.depth[be])+1,fe[pe*2+1]=fe[be*2+1]=se,H.heap[1]=se++,oe(H,fe,1);while(H.heap_len>=2);H.heap[--H.heap_max]=H.heap[1],ce(H,W),te(fe,Qe,H.bl_count)}function ge(H,W,fe){var st,ue=-1,me,pe=W[0*2+1],be=0,Qe=7,se=4;for(pe===0&&(Qe=138,se=3),W[(fe+1)*2+1]=65535,st=0;st<=fe;st++)me=pe,pe=W[(st+1)*2+1],!(++be<Qe&&me===pe)&&(be<se?H.bl_tree[me*2]+=be:me!==0?(me!==ue&&H.bl_tree[me*2]++,H.bl_tree[G*2]++):be<=10?H.bl_tree[ee*2]++:H.bl_tree[$*2]++,be=0,ue=me,pe===0?(Qe=138,se=3):me===pe?(Qe=6,se=3):(Qe=7,se=4))}function Se(H,W,fe){var st,ue=-1,me,pe=W[0*2+1],be=0,Qe=7,se=4;for(pe===0&&(Qe=138,se=3),st=0;st<=fe;st++)if(me=pe,pe=W[(st+1)*2+1],!(++be<Qe&&me===pe)){if(be<se)do Q(H,me,H.bl_tree);while(--be!==0);else me!==0?(me!==ue&&(Q(H,me,H.bl_tree),be--),Q(H,G,H.bl_tree),re(H,be-3,2)):be<=10?(Q(H,ee,H.bl_tree),re(H,be-3,3)):(Q(H,$,H.bl_tree),re(H,be-11,7));be=0,ue=me,pe===0?(Qe=138,se=3):me===pe?(Qe=6,se=3):(Qe=7,se=4)}}function ut(H){var W;for(ge(H,H.dyn_ltree,H.l_desc.max_code),ge(H,H.dyn_dtree,H.d_desc.max_code),ot(H,H.bl_desc),W=k-1;W>=3&&H.bl_tree[n[W]*2+1]===0;W--);return H.opt_len+=3*(W+1)+5+5+4,W}function Ze(H,W,fe,st){var ue;for(re(H,W-257,5),re(H,fe-1,5),re(H,st-4,4),ue=0;ue<st;ue++)re(H,H.bl_tree[n[ue]*2+1],3);Se(H,H.dyn_ltree,W-1),Se(H,H.dyn_dtree,fe-1)}function Ge(H){var W=4093624447,fe;for(fe=0;fe<=31;fe++,W>>>=1)if(W&1&&H.dyn_ltree[fe*2]!==0)return r;if(H.dyn_ltree[9*2]!==0||H.dyn_ltree[10*2]!==0||H.dyn_ltree[13*2]!==0)return a;for(fe=32;fe<x;fe++)if(H.dyn_ltree[fe*2]!==0)return a;return r}var ct=!1;function z(H){ct||(j(),ct=!0),H.l_desc=new B(H.dyn_ltree,v),H.d_desc=new B(H.dyn_dtree,R),H.bl_desc=new B(H.bl_tree,S),H.bi_buf=0,H.bi_valid=0,J(H)}function T(H,W,fe,st){re(H,(c<<1)+(st?1:0),3),he(H,W,fe,!0)}function I(H){re(H,p<<1,3),Q(H,Y,f),K(H)}function P(H,W,fe,st){var ue,me,pe=0;H.level>0?(H.strm.data_type===i&&(H.strm.data_type=Ge(H)),ot(H,H.l_desc),ot(H,H.d_desc),pe=ut(H),ue=H.opt_len+3+7>>>3,me=H.static_len+3+7>>>3,me<=ue&&(ue=me)):ue=me=fe+5,fe+4<=ue&&W!==-1?T(H,W,fe,st):H.strategy===e||me===ue?(re(H,(p<<1)+(st?1:0),3),le(H,f,u)):(re(H,(b<<1)+(st?1:0),3),Ze(H,H.l_desc.max_code+1,H.d_desc.max_code+1,pe+1),le(H,H.dyn_ltree,H.dyn_dtree)),J(H),st&&X(H)}function U(H,W,fe){return H.pending_buf[H.d_buf+H.last_lit*2]=W>>>8&255,H.pending_buf[H.d_buf+H.last_lit*2+1]=W&255,H.pending_buf[H.l_buf+H.last_lit]=fe&255,H.last_lit++,W===0?H.dyn_ltree[fe*2]++:(H.matches++,W--,H.dyn_ltree[(m[fe]+x+1)*2]++,H.dyn_dtree[F(W)*2]++),H.last_lit===H.lit_bufsize-1}return Id._tr_init=z,Id._tr_stored_block=T,Id._tr_flush_block=P,Id._tr_tally=U,Id._tr_align=I,Id}function zie(){if(Pie)return Fk;Pie=!0;function t(e,r,a,i){for(var h=e&65535|0,c=e>>>16&65535|0,p=0;a!==0;){p=a>2e3?2e3:a,a-=p;do h=h+r[i++]|0,c=c+h|0;while(--p);h%=65521,c%=65521}return h|c<<16|0}return Fk=t,Fk}function Zie(){if(Nie)return jk;Nie=!0;function t(){for(var a,i=[],h=0;h<256;h++){a=h;for(var c=0;c<8;c++)a=a&1?3988292384^a>>>1:a>>>1;i[h]=a}return i}var e=t();function r(a,i,h,c){var p=e,b=c+h;a^=-1;for(var g=c;g<b;g++)a=a>>>8^p[(a^i[g])&255];return a^-1}return jk=r,jk}function oAe(){return Cie||(Cie=!0,zk={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),zk}function sAe(){if(Lie)return Of;Lie=!0;var t=I4(),e=aAe(),r=zie(),a=Zie(),i=oAe(),h=0,c=1,p=3,b=4,g=5,y=0,M=1,x=-2,E=-3,A=-5,k=-1,O=1,N=2,L=3,C=4,Y=0,G=2,ee=8,$=9,q=15,V=8,_=29,n=256,s=n+1+_,f=30,u=19,l=2*s+1,m=15,w=3,d=258,o=d+w+1,v=32,R=42,S=69,B=73,F=91,D=103,re=113,Q=666,Z=1,K=2,ce=3,te=4,j=3;function J(se,ye){return se.msg=i[ye],ye}function X(se){return(se<<1)-(se>4?9:0)}function he(se){for(var ye=se.length;--ye>=0;)se[ye]=0}function Te(se){var ye=se.state,Ee=ye.pending;Ee>se.avail_out&&(Ee=se.avail_out),Ee!==0&&(t.arraySet(se.output,ye.pending_buf,ye.pending_out,Ee,se.next_out),se.next_out+=Ee,ye.pending_out+=Ee,se.total_out+=Ee,se.avail_out-=Ee,ye.pending-=Ee,ye.pending===0&&(ye.pending_out=0))}function oe(se,ye){e._tr_flush_block(se,se.block_start>=0?se.block_start:-1,se.strstart-se.block_start,ye),se.block_start=se.strstart,Te(se.strm)}function le(se,ye){se.pending_buf[se.pending++]=ye}function ot(se,ye){se.pending_buf[se.pending++]=ye>>>8&255,se.pending_buf[se.pending++]=ye&255}function ge(se,ye,Ee,Fe){var de=se.avail_in;return de>Fe&&(de=Fe),de===0?0:(se.avail_in-=de,t.arraySet(ye,se.input,se.next_in,de,Ee),se.state.wrap===1?se.adler=r(se.adler,ye,de,Ee):se.state.wrap===2&&(se.adler=a(se.adler,ye,de,Ee)),se.next_in+=de,se.total_in+=de,de)}function Se(se,ye){var Ee=se.max_chain_length,Fe=se.strstart,de,xe,lt=se.prev_length,_e=se.nice_match,Ve=se.strstart>se.w_size-o?se.strstart-(se.w_size-o):0,vt=se.window,Ye=se.w_mask,et=se.prev,mt=se.strstart+d,We=vt[Fe+lt-1],nt=vt[Fe+lt];se.prev_length>=se.good_match&&(Ee>>=2),_e>se.lookahead&&(_e=se.lookahead);do if(de=ye,!(vt[de+lt]!==nt||vt[de+lt-1]!==We||vt[de]!==vt[Fe]||vt[++de]!==vt[Fe+1])){Fe+=2,de++;do;while(vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&Fe<mt);if(xe=d-(mt-Fe),Fe=mt-d,xe>lt){if(se.match_start=ye,lt=xe,xe>=_e)break;We=vt[Fe+lt-1],nt=vt[Fe+lt]}}while((ye=et[ye&Ye])>Ve&&--Ee!==0);return lt<=se.lookahead?lt:se.lookahead}function ut(se){var ye=se.w_size,Ee,Fe,de,xe,lt;do{if(xe=se.window_size-se.lookahead-se.strstart,se.strstart>=ye+(ye-o)){t.arraySet(se.window,se.window,ye,ye,0),se.match_start-=ye,se.strstart-=ye,se.block_start-=ye,Fe=se.hash_size,Ee=Fe;do de=se.head[--Ee],se.head[Ee]=de>=ye?de-ye:0;while(--Fe);Fe=ye,Ee=Fe;do de=se.prev[--Ee],se.prev[Ee]=de>=ye?de-ye:0;while(--Fe);xe+=ye}if(se.strm.avail_in===0)break;if(Fe=ge(se.strm,se.window,se.strstart+se.lookahead,xe),se.lookahead+=Fe,se.lookahead+se.insert>=w)for(lt=se.strstart-se.insert,se.ins_h=se.window[lt],se.ins_h=(se.ins_h<<se.hash_shift^se.window[lt+1])&se.hash_mask;se.insert&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[lt+w-1])&se.hash_mask,se.prev[lt&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=lt,lt++,se.insert--,!(se.lookahead+se.insert<w)););}while(se.lookahead<o&&se.strm.avail_in!==0)}function Ze(se,ye){var Ee=65535;for(Ee>se.pending_buf_size-5&&(Ee=se.pending_buf_size-5);;){if(se.lookahead<=1){if(ut(se),se.lookahead===0&&ye===h)return Z;if(se.lookahead===0)break}se.strstart+=se.lookahead,se.lookahead=0;var Fe=se.block_start+Ee;if((se.strstart===0||se.strstart>=Fe)&&(se.lookahead=se.strstart-Fe,se.strstart=Fe,oe(se,!1),se.strm.avail_out===0)||se.strstart-se.block_start>=se.w_size-o&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):(se.strstart>se.block_start&&(oe(se,!1),se.strm.avail_out===0),Z)}function Ge(se,ye){for(var Ee,Fe;;){if(se.lookahead<o){if(ut(se),se.lookahead<o&&ye===h)return Z;if(se.lookahead===0)break}if(Ee=0,se.lookahead>=w&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),Ee!==0&&se.strstart-Ee<=se.w_size-o&&(se.match_length=Se(se,Ee)),se.match_length>=w)if(Fe=e._tr_tally(se,se.strstart-se.match_start,se.match_length-w),se.lookahead-=se.match_length,se.match_length<=se.max_lazy_match&&se.lookahead>=w){se.match_length--;do se.strstart++,se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart;while(--se.match_length!==0);se.strstart++}else se.strstart+=se.match_length,se.match_length=0,se.ins_h=se.window[se.strstart],se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+1])&se.hash_mask;else Fe=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++;if(Fe&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=se.strstart<w-1?se.strstart:w-1,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function ct(se,ye){for(var Ee,Fe,de;;){if(se.lookahead<o){if(ut(se),se.lookahead<o&&ye===h)return Z;if(se.lookahead===0)break}if(Ee=0,se.lookahead>=w&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),se.prev_length=se.match_length,se.prev_match=se.match_start,se.match_length=w-1,Ee!==0&&se.prev_length<se.max_lazy_match&&se.strstart-Ee<=se.w_size-o&&(se.match_length=Se(se,Ee),se.match_length<=5&&(se.strategy===O||se.match_length===w&&se.strstart-se.match_start>4096)&&(se.match_length=w-1)),se.prev_length>=w&&se.match_length<=se.prev_length){de=se.strstart+se.lookahead-w,Fe=e._tr_tally(se,se.strstart-1-se.prev_match,se.prev_length-w),se.lookahead-=se.prev_length-1,se.prev_length-=2;do++se.strstart<=de&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart);while(--se.prev_length!==0);if(se.match_available=0,se.match_length=w-1,se.strstart++,Fe&&(oe(se,!1),se.strm.avail_out===0))return Z}else if(se.match_available){if(Fe=e._tr_tally(se,0,se.window[se.strstart-1]),Fe&&oe(se,!1),se.strstart++,se.lookahead--,se.strm.avail_out===0)return Z}else se.match_available=1,se.strstart++,se.lookahead--}return se.match_available&&(Fe=e._tr_tally(se,0,se.window[se.strstart-1]),se.match_available=0),se.insert=se.strstart<w-1?se.strstart:w-1,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function z(se,ye){for(var Ee,Fe,de,xe,lt=se.window;;){if(se.lookahead<=d){if(ut(se),se.lookahead<=d&&ye===h)return Z;if(se.lookahead===0)break}if(se.match_length=0,se.lookahead>=w&&se.strstart>0&&(de=se.strstart-1,Fe=lt[de],Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de])){xe=se.strstart+d;do;while(Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&de<xe);se.match_length=d-(xe-de),se.match_length>se.lookahead&&(se.match_length=se.lookahead)}if(se.match_length>=w?(Ee=e._tr_tally(se,1,se.match_length-w),se.lookahead-=se.match_length,se.strstart+=se.match_length,se.match_length=0):(Ee=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++),Ee&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function T(se,ye){for(var Ee;;){if(se.lookahead===0&&(ut(se),se.lookahead===0)){if(ye===h)return Z;break}if(se.match_length=0,Ee=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++,Ee&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function I(se,ye,Ee,Fe,de){this.good_length=se,this.max_lazy=ye,this.nice_length=Ee,this.max_chain=Fe,this.func=de}var P;P=[new I(0,0,0,0,Ze),new I(4,4,8,4,Ge),new I(4,5,16,8,Ge),new I(4,6,32,32,Ge),new I(4,4,16,16,ct),new I(8,16,32,32,ct),new I(8,16,128,128,ct),new I(8,32,128,256,ct),new I(32,128,258,1024,ct),new I(32,258,258,4096,ct)];function U(se){se.window_size=2*se.w_size,he(se.head),se.max_lazy_match=P[se.level].max_lazy,se.good_match=P[se.level].good_length,se.nice_match=P[se.level].nice_length,se.max_chain_length=P[se.level].max_chain,se.strstart=0,se.block_start=0,se.lookahead=0,se.insert=0,se.match_length=se.prev_length=w-1,se.match_available=0,se.ins_h=0}function H(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ee,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new t.Buf16(l*2),this.dyn_dtree=new t.Buf16((2*f+1)*2),this.bl_tree=new t.Buf16((2*u+1)*2),he(this.dyn_ltree),he(this.dyn_dtree),he(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(m+1),this.heap=new t.Buf16(2*s+1),he(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*s+1),he(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function W(se){var ye;return!se||!se.state?J(se,x):(se.total_in=se.total_out=0,se.data_type=G,ye=se.state,ye.pending=0,ye.pending_out=0,ye.wrap<0&&(ye.wrap=-ye.wrap),ye.status=ye.wrap?R:re,se.adler=ye.wrap===2?0:1,ye.last_flush=h,e._tr_init(ye),y)}function fe(se){var ye=W(se);return ye===y&&U(se.state),ye}function st(se,ye){return!se||!se.state||se.state.wrap!==2?x:(se.state.gzhead=ye,y)}function ue(se,ye,Ee,Fe,de,xe){if(!se)return x;var lt=1;if(ye===k&&(ye=6),Fe<0?(lt=0,Fe=-Fe):Fe>15&&(lt=2,Fe-=16),de<1||de>$||Ee!==ee||Fe<8||Fe>15||ye<0||ye>9||xe<0||xe>C)return J(se,x);Fe===8&&(Fe=9);var _e=new H;return se.state=_e,_e.strm=se,_e.wrap=lt,_e.gzhead=null,_e.w_bits=Fe,_e.w_size=1<<_e.w_bits,_e.w_mask=_e.w_size-1,_e.hash_bits=de+7,_e.hash_size=1<<_e.hash_bits,_e.hash_mask=_e.hash_size-1,_e.hash_shift=~~((_e.hash_bits+w-1)/w),_e.window=new t.Buf8(_e.w_size*2),_e.head=new t.Buf16(_e.hash_size),_e.prev=new t.Buf16(_e.w_size),_e.lit_bufsize=1<<de+6,_e.pending_buf_size=_e.lit_bufsize*4,_e.pending_buf=new t.Buf8(_e.pending_buf_size),_e.d_buf=1*_e.lit_bufsize,_e.l_buf=3*_e.lit_bufsize,_e.level=ye,_e.strategy=xe,_e.method=Ee,fe(se)}function me(se,ye){return ue(se,ye,ee,q,V,Y)}function pe(se,ye){var Ee,Fe,de,xe;if(!se||!se.state||ye>g||ye<0)return se?J(se,x):x;if(Fe=se.state,!se.output||!se.input&&se.avail_in!==0||Fe.status===Q&&ye!==b)return J(se,se.avail_out===0?A:x);if(Fe.strm=se,Ee=Fe.last_flush,Fe.last_flush=ye,Fe.status===R)if(Fe.wrap===2)se.adler=0,le(Fe,31),le(Fe,139),le(Fe,8),Fe.gzhead?(le(Fe,(Fe.gzhead.text?1:0)+(Fe.gzhead.hcrc?2:0)+(Fe.gzhead.extra?4:0)+(Fe.gzhead.name?8:0)+(Fe.gzhead.comment?16:0)),le(Fe,Fe.gzhead.time&255),le(Fe,Fe.gzhead.time>>8&255),le(Fe,Fe.gzhead.time>>16&255),le(Fe,Fe.gzhead.time>>24&255),le(Fe,Fe.level===9?2:Fe.strategy>=N||Fe.level<2?4:0),le(Fe,Fe.gzhead.os&255),Fe.gzhead.extra&&Fe.gzhead.extra.length&&(le(Fe,Fe.gzhead.extra.length&255),le(Fe,Fe.gzhead.extra.length>>8&255)),Fe.gzhead.hcrc&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending,0)),Fe.gzindex=0,Fe.status=S):(le(Fe,0),le(Fe,0),le(Fe,0),le(Fe,0),le(Fe,0),le(Fe,Fe.level===9?2:Fe.strategy>=N||Fe.level<2?4:0),le(Fe,j),Fe.status=re);else{var lt=ee+(Fe.w_bits-8<<4)<<8,_e=-1;Fe.strategy>=N||Fe.level<2?_e=0:Fe.level<6?_e=1:Fe.level===6?_e=2:_e=3,lt|=_e<<6,Fe.strstart!==0&&(lt|=v),lt+=31-lt%31,Fe.status=re,ot(Fe,lt),Fe.strstart!==0&&(ot(Fe,se.adler>>>16),ot(Fe,se.adler&65535)),se.adler=1}if(Fe.status===S)if(Fe.gzhead.extra){for(de=Fe.pending;Fe.gzindex<(Fe.gzhead.extra.length&65535)&&!(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size));)le(Fe,Fe.gzhead.extra[Fe.gzindex]&255),Fe.gzindex++;Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Fe.gzindex===Fe.gzhead.extra.length&&(Fe.gzindex=0,Fe.status=B)}else Fe.status=B;if(Fe.status===B)if(Fe.gzhead.name){de=Fe.pending;do{if(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size)){xe=1;break}Fe.gzindex<Fe.gzhead.name.length?xe=Fe.gzhead.name.charCodeAt(Fe.gzindex++)&255:xe=0,le(Fe,xe)}while(xe!==0);Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),xe===0&&(Fe.gzindex=0,Fe.status=F)}else Fe.status=F;if(Fe.status===F)if(Fe.gzhead.comment){de=Fe.pending;do{if(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size)){xe=1;break}Fe.gzindex<Fe.gzhead.comment.length?xe=Fe.gzhead.comment.charCodeAt(Fe.gzindex++)&255:xe=0,le(Fe,xe)}while(xe!==0);Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),xe===0&&(Fe.status=D)}else Fe.status=D;if(Fe.status===D&&(Fe.gzhead.hcrc?(Fe.pending+2>Fe.pending_buf_size&&Te(se),Fe.pending+2<=Fe.pending_buf_size&&(le(Fe,se.adler&255),le(Fe,se.adler>>8&255),se.adler=0,Fe.status=re)):Fe.status=re),Fe.pending!==0){if(Te(se),se.avail_out===0)return Fe.last_flush=-1,y}else if(se.avail_in===0&&X(ye)<=X(Ee)&&ye!==b)return J(se,A);if(Fe.status===Q&&se.avail_in!==0)return J(se,A);if(se.avail_in!==0||Fe.lookahead!==0||ye!==h&&Fe.status!==Q){var Ve=Fe.strategy===N?T(Fe,ye):Fe.strategy===L?z(Fe,ye):P[Fe.level].func(Fe,ye);if((Ve===ce||Ve===te)&&(Fe.status=Q),Ve===Z||Ve===ce)return se.avail_out===0&&(Fe.last_flush=-1),y;if(Ve===K&&(ye===c?e._tr_align(Fe):ye!==g&&(e._tr_stored_block(Fe,0,0,!1),ye===p&&(he(Fe.head),Fe.lookahead===0&&(Fe.strstart=0,Fe.block_start=0,Fe.insert=0))),Te(se),se.avail_out===0))return Fe.last_flush=-1,y}return ye!==b?y:Fe.wrap<=0?M:(Fe.wrap===2?(le(Fe,se.adler&255),le(Fe,se.adler>>8&255),le(Fe,se.adler>>16&255),le(Fe,se.adler>>24&255),le(Fe,se.total_in&255),le(Fe,se.total_in>>8&255),le(Fe,se.total_in>>16&255),le(Fe,se.total_in>>24&255)):(ot(Fe,se.adler>>>16),ot(Fe,se.adler&65535)),Te(se),Fe.wrap>0&&(Fe.wrap=-Fe.wrap),Fe.pending!==0?y:M)}function be(se){var ye;return!se||!se.state?x:(ye=se.state.status,ye!==R&&ye!==S&&ye!==B&&ye!==F&&ye!==D&&ye!==re&&ye!==Q?J(se,x):(se.state=null,ye===re?J(se,E):y))}function Qe(se,ye){var Ee=ye.length,Fe,de,xe,lt,_e,Ve,vt,Ye;if(!se||!se.state||(Fe=se.state,lt=Fe.wrap,lt===2||lt===1&&Fe.status!==R||Fe.lookahead))return x;for(lt===1&&(se.adler=r(se.adler,ye,Ee,0)),Fe.wrap=0,Ee>=Fe.w_size&&(lt===0&&(he(Fe.head),Fe.strstart=0,Fe.block_start=0,Fe.insert=0),Ye=new t.Buf8(Fe.w_size),t.arraySet(Ye,ye,Ee-Fe.w_size,Fe.w_size,0),ye=Ye,Ee=Fe.w_size),_e=se.avail_in,Ve=se.next_in,vt=se.input,se.avail_in=Ee,se.next_in=0,se.input=ye,ut(Fe);Fe.lookahead>=w;){de=Fe.strstart,xe=Fe.lookahead-(w-1);do Fe.ins_h=(Fe.ins_h<<Fe.hash_shift^Fe.window[de+w-1])&Fe.hash_mask,Fe.prev[de&Fe.w_mask]=Fe.head[Fe.ins_h],Fe.head[Fe.ins_h]=de,de++;while(--xe);Fe.strstart=de,Fe.lookahead=w-1,ut(Fe)}return Fe.strstart+=Fe.lookahead,Fe.block_start=Fe.strstart,Fe.insert=Fe.lookahead,Fe.lookahead=0,Fe.match_length=Fe.prev_length=w-1,Fe.match_available=0,se.next_in=Ve,se.input=vt,se.avail_in=_e,Fe.wrap=lt,y}return Of.deflateInit=me,Of.deflateInit2=ue,Of.deflateReset=fe,Of.deflateResetKeep=W,Of.deflateSetHeader=st,Of.deflate=pe,Of.deflateEnd=be,Of.deflateSetDictionary=Qe,Of.deflateInfo="pako deflate (from Nodeca project)",Of}function fAe(){if($ie)return Zk;$ie=!0;var t=30,e=12;return Zk=function(a,i){var h,c,p,b,g,y,M,x,E,A,k,O,N,L,C,Y,G,ee,$,q,V,_,n,s,f;h=a.state,c=a.next_in,s=a.input,p=c+(a.avail_in-5),b=a.next_out,f=a.output,g=b-(i-a.avail_out),y=b+(a.avail_out-257),M=h.dmax,x=h.wsize,E=h.whave,A=h.wnext,k=h.window,O=h.hold,N=h.bits,L=h.lencode,C=h.distcode,Y=(1<<h.lenbits)-1,G=(1<<h.distbits)-1;e:do{N<15&&(O+=s[c++]<<N,N+=8,O+=s[c++]<<N,N+=8),ee=L[O&Y];t:for(;;){if($=ee>>>24,O>>>=$,N-=$,$=ee>>>16&255,$===0)f[b++]=ee&65535;else if($&16){q=ee&65535,$&=15,$&&(N<$&&(O+=s[c++]<<N,N+=8),q+=O&(1<<$)-1,O>>>=$,N-=$),N<15&&(O+=s[c++]<<N,N+=8,O+=s[c++]<<N,N+=8),ee=C[O&G];r:for(;;){if($=ee>>>24,O>>>=$,N-=$,$=ee>>>16&255,$&16){if(V=ee&65535,$&=15,N<$&&(O+=s[c++]<<N,N+=8,N<$&&(O+=s[c++]<<N,N+=8)),V+=O&(1<<$)-1,V>M){a.msg="invalid distance too far back",h.mode=t;break e}if(O>>>=$,N-=$,$=b-g,V>$){if($=V-$,$>E&&h.sane){a.msg="invalid distance too far back",h.mode=t;break e}if(_=0,n=k,A===0){if(_+=x-$,$<q){q-=$;do f[b++]=k[_++];while(--$);_=b-V,n=f}}else if(A<$){if(_+=x+A-$,$-=A,$<q){q-=$;do f[b++]=k[_++];while(--$);if(_=0,A<q){$=A,q-=$;do f[b++]=k[_++];while(--$);_=b-V,n=f}}}else if(_+=A-$,$<q){q-=$;do f[b++]=k[_++];while(--$);_=b-V,n=f}for(;q>2;)f[b++]=n[_++],f[b++]=n[_++],f[b++]=n[_++],q-=3;q&&(f[b++]=n[_++],q>1&&(f[b++]=n[_++]))}else{_=b-V;do f[b++]=f[_++],f[b++]=f[_++],f[b++]=f[_++],q-=3;while(q>2);q&&(f[b++]=f[_++],q>1&&(f[b++]=f[_++]))}}else if($&64){a.msg="invalid distance code",h.mode=t;break e}else{ee=C[(ee&65535)+(O&(1<<$)-1)];continue r}break}}else if($&64)if($&32){h.mode=e;break e}else{a.msg="invalid literal/length code",h.mode=t;break e}else{ee=L[(ee&65535)+(O&(1<<$)-1)];continue t}break}}while(c<p&&b<y);q=N>>3,c-=q,N-=q<<3,O&=(1<<N)-1,a.next_in=c,a.next_out=b,a.avail_in=c<p?5+(p-c):5-(c-p),a.avail_out=b<y?257+(y-b):257-(b-y),h.hold=O,h.bits=N},Zk}function uAe(){if(Die)return Hk;Die=!0;var t=I4(),e=15,r=852,a=592,i=0,h=1,c=2,p=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],b=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],g=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],y=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return Hk=function(x,E,A,k,O,N,L,C){var Y=C.bits,G=0,ee=0,$=0,q=0,V=0,_=0,n=0,s=0,f=0,u=0,l,m,w,d,o,v=null,R=0,S,B=new t.Buf16(e+1),F=new t.Buf16(e+1),D=null,re=0,Q,Z,K;for(G=0;G<=e;G++)B[G]=0;for(ee=0;ee<k;ee++)B[E[A+ee]]++;for(V=Y,q=e;q>=1&&B[q]===0;q--);if(V>q&&(V=q),q===0)return O[N++]=1<<24|64<<16|0,O[N++]=1<<24|64<<16|0,C.bits=1,0;for($=1;$<q&&B[$]===0;$++);for(V<$&&(V=$),s=1,G=1;G<=e;G++)if(s<<=1,s-=B[G],s<0)return-1;if(s>0&&(x===i||q!==1))return-1;for(F[1]=0,G=1;G<e;G++)F[G+1]=F[G]+B[G];for(ee=0;ee<k;ee++)E[A+ee]!==0&&(L[F[E[A+ee]]++]=ee);if(x===i?(v=D=L,S=19):x===h?(v=p,R-=257,D=b,re-=257,S=256):(v=g,D=y,S=-1),u=0,ee=0,G=$,o=N,_=V,n=0,w=-1,f=1<<V,d=f-1,x===h&&f>r||x===c&&f>a)return 1;for(;;){Q=G-n,L[ee]<S?(Z=0,K=L[ee]):L[ee]>S?(Z=D[re+L[ee]],K=v[R+L[ee]]):(Z=96,K=0),l=1<<G-n,m=1<<_,$=m;do m-=l,O[o+(u>>n)+m]=Q<<24|Z<<16|K|0;while(m!==0);for(l=1<<G-1;u&l;)l>>=1;if(l!==0?(u&=l-1,u+=l):u=0,ee++,--B[G]===0){if(G===q)break;G=E[A+L[ee]]}if(G>V&&(u&d)!==w){for(n===0&&(n=V),o+=$,_=G-n,s=1<<_;_+n<q&&(s-=B[_+n],!(s<=0));)_++,s<<=1;if(f+=1<<_,x===h&&f>r||x===c&&f>a)return 1;w=u&d,O[w]=V<<24|_<<16|o-N|0}}return u!==0&&(O[o+u]=G-n<<24|64<<16|0),C.bits=V,0},Hk}function hAe(){if(Uie)return Ns;Uie=!0;var t=I4(),e=zie(),r=Zie(),a=fAe(),i=uAe(),h=0,c=1,p=2,b=4,g=5,y=6,M=0,x=1,E=2,A=-2,k=-3,O=-4,N=-5,L=8,C=1,Y=2,G=3,ee=4,$=5,q=6,V=7,_=8,n=9,s=10,f=11,u=12,l=13,m=14,w=15,d=16,o=17,v=18,R=19,S=20,B=21,F=22,D=23,re=24,Q=25,Z=26,K=27,ce=28,te=29,j=30,J=31,X=32,he=852,Te=592,oe=15,le=oe;function ot(ue){return(ue>>>24&255)+(ue>>>8&65280)+((ue&65280)<<8)+((ue&255)<<24)}function ge(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Se(ue){var me;return!ue||!ue.state?A:(me=ue.state,ue.total_in=ue.total_out=me.total=0,ue.msg="",me.wrap&&(ue.adler=me.wrap&1),me.mode=C,me.last=0,me.havedict=0,me.dmax=32768,me.head=null,me.hold=0,me.bits=0,me.lencode=me.lendyn=new t.Buf32(he),me.distcode=me.distdyn=new t.Buf32(Te),me.sane=1,me.back=-1,M)}function ut(ue){var me;return!ue||!ue.state?A:(me=ue.state,me.wsize=0,me.whave=0,me.wnext=0,Se(ue))}function Ze(ue,me){var pe,be;return!ue||!ue.state||(be=ue.state,me<0?(pe=0,me=-me):(pe=(me>>4)+1,me<48&&(me&=15)),me&&(me<8||me>15))?A:(be.window!==null&&be.wbits!==me&&(be.window=null),be.wrap=pe,be.wbits=me,ut(ue))}function Ge(ue,me){var pe,be;return ue?(be=new ge,ue.state=be,be.window=null,pe=Ze(ue,me),pe!==M&&(ue.state=null),pe):A}function ct(ue){return Ge(ue,le)}var z=!0,T,I;function P(ue){if(z){var me;for(T=new t.Buf32(512),I=new t.Buf32(32),me=0;me<144;)ue.lens[me++]=8;for(;me<256;)ue.lens[me++]=9;for(;me<280;)ue.lens[me++]=7;for(;me<288;)ue.lens[me++]=8;for(i(c,ue.lens,0,288,T,0,ue.work,{bits:9}),me=0;me<32;)ue.lens[me++]=5;i(p,ue.lens,0,32,I,0,ue.work,{bits:5}),z=!1}ue.lencode=T,ue.lenbits=9,ue.distcode=I,ue.distbits=5}function U(ue,me,pe,be){var Qe,se=ue.state;return se.window===null&&(se.wsize=1<<se.wbits,se.wnext=0,se.whave=0,se.window=new t.Buf8(se.wsize)),be>=se.wsize?(t.arraySet(se.window,me,pe-se.wsize,se.wsize,0),se.wnext=0,se.whave=se.wsize):(Qe=se.wsize-se.wnext,Qe>be&&(Qe=be),t.arraySet(se.window,me,pe-be,Qe,se.wnext),be-=Qe,be?(t.arraySet(se.window,me,pe-be,be,0),se.wnext=be,se.whave=se.wsize):(se.wnext+=Qe,se.wnext===se.wsize&&(se.wnext=0),se.whave<se.wsize&&(se.whave+=Qe))),0}function H(ue,me){var pe,be,Qe,se,ye,Ee,Fe,de,xe,lt,_e,Ve,vt,Ye,et=0,mt,We,nt,bt,Je,at,yt,Xe,it=new t.Buf8(4),_t,dt,Mt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!ue||!ue.state||!ue.output||!ue.input&&ue.avail_in!==0)return A;pe=ue.state,pe.mode===u&&(pe.mode=l),ye=ue.next_out,Qe=ue.output,Fe=ue.avail_out,se=ue.next_in,be=ue.input,Ee=ue.avail_in,de=pe.hold,xe=pe.bits,lt=Ee,_e=Fe,Xe=M;e:for(;;)switch(pe.mode){case C:if(pe.wrap===0){pe.mode=l;break}for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.wrap&2&&de===35615){pe.check=0,it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0),de=0,xe=0,pe.mode=Y;break}if(pe.flags=0,pe.head&&(pe.head.done=!1),!(pe.wrap&1)||(((de&255)<<8)+(de>>8))%31){ue.msg="incorrect header check",pe.mode=j;break}if((de&15)!==L){ue.msg="unknown compression method",pe.mode=j;break}if(de>>>=4,xe-=4,yt=(de&15)+8,pe.wbits===0)pe.wbits=yt;else if(yt>pe.wbits){ue.msg="invalid window size",pe.mode=j;break}pe.dmax=1<<yt,ue.adler=pe.check=1,pe.mode=de&512?s:u,de=0,xe=0;break;case Y:for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.flags=de,(pe.flags&255)!==L){ue.msg="unknown compression method",pe.mode=j;break}if(pe.flags&57344){ue.msg="unknown header flags set",pe.mode=j;break}pe.head&&(pe.head.text=de>>8&1),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0,pe.mode=G;case G:for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.head&&(pe.head.time=de),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,it[2]=de>>>16&255,it[3]=de>>>24&255,pe.check=r(pe.check,it,4,0)),de=0,xe=0,pe.mode=ee;case ee:for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.head&&(pe.head.xflags=de&255,pe.head.os=de>>8),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0,pe.mode=$;case $:if(pe.flags&1024){for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.length=de,pe.head&&(pe.head.extra_len=de),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0}else pe.head&&(pe.head.extra=null);pe.mode=q;case q:if(pe.flags&1024&&(Ve=pe.length,Ve>Ee&&(Ve=Ee),Ve&&(pe.head&&(yt=pe.head.extra_len-pe.length,pe.head.extra||(pe.head.extra=new Array(pe.head.extra_len)),t.arraySet(pe.head.extra,be,se,Ve,yt)),pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,pe.length-=Ve),pe.length))break e;pe.length=0,pe.mode=V;case V:if(pe.flags&2048){if(Ee===0)break e;Ve=0;do yt=be[se+Ve++],pe.head&&yt&&pe.length<65536&&(pe.head.name+=String.fromCharCode(yt));while(yt&&Ve<Ee);if(pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,yt)break e}else pe.head&&(pe.head.name=null);pe.length=0,pe.mode=_;case _:if(pe.flags&4096){if(Ee===0)break e;Ve=0;do yt=be[se+Ve++],pe.head&&yt&&pe.length<65536&&(pe.head.comment+=String.fromCharCode(yt));while(yt&&Ve<Ee);if(pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,yt)break e}else pe.head&&(pe.head.comment=null);pe.mode=n;case n:if(pe.flags&512){for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de!==(pe.check&65535)){ue.msg="header crc mismatch",pe.mode=j;break}de=0,xe=0}pe.head&&(pe.head.hcrc=pe.flags>>9&1,pe.head.done=!0),ue.adler=pe.check=0,pe.mode=u;break;case s:for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}ue.adler=pe.check=ot(de),de=0,xe=0,pe.mode=f;case f:if(pe.havedict===0)return ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,E;ue.adler=pe.check=1,pe.mode=u;case u:if(me===g||me===y)break e;case l:if(pe.last){de>>>=xe&7,xe-=xe&7,pe.mode=K;break}for(;xe<3;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}switch(pe.last=de&1,de>>>=1,xe-=1,de&3){case 0:pe.mode=m;break;case 1:if(P(pe),pe.mode=S,me===y){de>>>=2,xe-=2;break e}break;case 2:pe.mode=o;break;case 3:ue.msg="invalid block type",pe.mode=j}de>>>=2,xe-=2;break;case m:for(de>>>=xe&7,xe-=xe&7;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if((de&65535)!==(de>>>16^65535)){ue.msg="invalid stored block lengths",pe.mode=j;break}if(pe.length=de&65535,de=0,xe=0,pe.mode=w,me===y)break e;case w:pe.mode=d;case d:if(Ve=pe.length,Ve){if(Ve>Ee&&(Ve=Ee),Ve>Fe&&(Ve=Fe),Ve===0)break e;t.arraySet(Qe,be,se,Ve,ye),Ee-=Ve,se+=Ve,Fe-=Ve,ye+=Ve,pe.length-=Ve;break}pe.mode=u;break;case o:for(;xe<14;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.nlen=(de&31)+257,de>>>=5,xe-=5,pe.ndist=(de&31)+1,de>>>=5,xe-=5,pe.ncode=(de&15)+4,de>>>=4,xe-=4,pe.nlen>286||pe.ndist>30){ue.msg="too many length or distance symbols",pe.mode=j;break}pe.have=0,pe.mode=v;case v:for(;pe.have<pe.ncode;){for(;xe<3;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.lens[Mt[pe.have++]]=de&7,de>>>=3,xe-=3}for(;pe.have<19;)pe.lens[Mt[pe.have++]]=0;if(pe.lencode=pe.lendyn,pe.lenbits=7,_t={bits:pe.lenbits},Xe=i(h,pe.lens,0,19,pe.lencode,0,pe.work,_t),pe.lenbits=_t.bits,Xe){ue.msg="invalid code lengths set",pe.mode=j;break}pe.have=0,pe.mode=R;case R:for(;pe.have<pe.nlen+pe.ndist;){for(;et=pe.lencode[de&(1<<pe.lenbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(nt<16)de>>>=mt,xe-=mt,pe.lens[pe.have++]=nt;else{if(nt===16){for(dt=mt+2;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de>>>=mt,xe-=mt,pe.have===0){ue.msg="invalid bit length repeat",pe.mode=j;break}yt=pe.lens[pe.have-1],Ve=3+(de&3),de>>>=2,xe-=2}else if(nt===17){for(dt=mt+3;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=mt,xe-=mt,yt=0,Ve=3+(de&7),de>>>=3,xe-=3}else{for(dt=mt+7;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=mt,xe-=mt,yt=0,Ve=11+(de&127),de>>>=7,xe-=7}if(pe.have+Ve>pe.nlen+pe.ndist){ue.msg="invalid bit length repeat",pe.mode=j;break}for(;Ve--;)pe.lens[pe.have++]=yt}}if(pe.mode===j)break;if(pe.lens[256]===0){ue.msg="invalid code -- missing end-of-block",pe.mode=j;break}if(pe.lenbits=9,_t={bits:pe.lenbits},Xe=i(c,pe.lens,0,pe.nlen,pe.lencode,0,pe.work,_t),pe.lenbits=_t.bits,Xe){ue.msg="invalid literal/lengths set",pe.mode=j;break}if(pe.distbits=6,pe.distcode=pe.distdyn,_t={bits:pe.distbits},Xe=i(p,pe.lens,pe.nlen,pe.ndist,pe.distcode,0,pe.work,_t),pe.distbits=_t.bits,Xe){ue.msg="invalid distances set",pe.mode=j;break}if(pe.mode=S,me===y)break e;case S:pe.mode=B;case B:if(Ee>=6&&Fe>=258){ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,a(ue,_e),ye=ue.next_out,Qe=ue.output,Fe=ue.avail_out,se=ue.next_in,be=ue.input,Ee=ue.avail_in,de=pe.hold,xe=pe.bits,pe.mode===u&&(pe.back=-1);break}for(pe.back=0;et=pe.lencode[de&(1<<pe.lenbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(We&&!(We&240)){for(bt=mt,Je=We,at=nt;et=pe.lencode[at+((de&(1<<bt+Je)-1)>>bt)],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(bt+mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=bt,xe-=bt,pe.back+=bt}if(de>>>=mt,xe-=mt,pe.back+=mt,pe.length=nt,We===0){pe.mode=Z;break}if(We&32){pe.back=-1,pe.mode=u;break}if(We&64){ue.msg="invalid literal/length code",pe.mode=j;break}pe.extra=We&15,pe.mode=F;case F:if(pe.extra){for(dt=pe.extra;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.length+=de&(1<<pe.extra)-1,de>>>=pe.extra,xe-=pe.extra,pe.back+=pe.extra}pe.was=pe.length,pe.mode=D;case D:for(;et=pe.distcode[de&(1<<pe.distbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(!(We&240)){for(bt=mt,Je=We,at=nt;et=pe.distcode[at+((de&(1<<bt+Je)-1)>>bt)],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(bt+mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=bt,xe-=bt,pe.back+=bt}if(de>>>=mt,xe-=mt,pe.back+=mt,We&64){ue.msg="invalid distance code",pe.mode=j;break}pe.offset=nt,pe.extra=We&15,pe.mode=re;case re:if(pe.extra){for(dt=pe.extra;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.offset+=de&(1<<pe.extra)-1,de>>>=pe.extra,xe-=pe.extra,pe.back+=pe.extra}if(pe.offset>pe.dmax){ue.msg="invalid distance too far back",pe.mode=j;break}pe.mode=Q;case Q:if(Fe===0)break e;if(Ve=_e-Fe,pe.offset>Ve){if(Ve=pe.offset-Ve,Ve>pe.whave&&pe.sane){ue.msg="invalid distance too far back",pe.mode=j;break}Ve>pe.wnext?(Ve-=pe.wnext,vt=pe.wsize-Ve):vt=pe.wnext-Ve,Ve>pe.length&&(Ve=pe.length),Ye=pe.window}else Ye=Qe,vt=ye-pe.offset,Ve=pe.length;Ve>Fe&&(Ve=Fe),Fe-=Ve,pe.length-=Ve;do Qe[ye++]=Ye[vt++];while(--Ve);pe.length===0&&(pe.mode=B);break;case Z:if(Fe===0)break e;Qe[ye++]=pe.length,Fe--,pe.mode=B;break;case K:if(pe.wrap){for(;xe<32;){if(Ee===0)break e;Ee--,de|=be[se++]<<xe,xe+=8}if(_e-=Fe,ue.total_out+=_e,pe.total+=_e,_e&&(ue.adler=pe.check=pe.flags?r(pe.check,Qe,_e,ye-_e):e(pe.check,Qe,_e,ye-_e)),_e=Fe,(pe.flags?de:ot(de))!==pe.check){ue.msg="incorrect data check",pe.mode=j;break}de=0,xe=0}pe.mode=ce;case ce:if(pe.wrap&&pe.flags){for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de!==(pe.total&4294967295)){ue.msg="incorrect length check",pe.mode=j;break}de=0,xe=0}pe.mode=te;case te:Xe=x;break e;case j:Xe=k;break e;case J:return O;case X:default:return A}return ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,(pe.wsize||_e!==ue.avail_out&&pe.mode<j&&(pe.mode<K||me!==b))&&U(ue,ue.output,ue.next_out,_e-ue.avail_out),lt-=ue.avail_in,_e-=ue.avail_out,ue.total_in+=lt,ue.total_out+=_e,pe.total+=_e,pe.wrap&&_e&&(ue.adler=pe.check=pe.flags?r(pe.check,Qe,_e,ue.next_out-_e):e(pe.check,Qe,_e,ue.next_out-_e)),ue.data_type=pe.bits+(pe.last?64:0)+(pe.mode===u?128:0)+(pe.mode===S||pe.mode===w?256:0),(lt===0&&_e===0||me===b)&&Xe===M&&(Xe=N),Xe}function W(ue){if(!ue||!ue.state)return A;var me=ue.state;return me.window&&(me.window=null),ue.state=null,M}function fe(ue,me){var pe;return!ue||!ue.state||(pe=ue.state,!(pe.wrap&2))?A:(pe.head=me,me.done=!1,M)}function st(ue,me){var pe=me.length,be,Qe,se;return!ue||!ue.state||(be=ue.state,be.wrap!==0&&be.mode!==f)?A:be.mode===f&&(Qe=1,Qe=e(Qe,me,pe,0),Qe!==be.check)?k:(se=U(ue,me,pe,pe),se?(be.mode=J,O):(be.havedict=1,M))}return Ns.inflateReset=ut,Ns.inflateReset2=Ze,Ns.inflateResetKeep=Se,Ns.inflateInit=ct,Ns.inflateInit2=Ge,Ns.inflate=H,Ns.inflateEnd=W,Ns.inflateGetHeader=fe,Ns.inflateSetDictionary=st,Ns.inflateInfo="pako inflate (from Nodeca project)",Ns}function cAe(){return qie||(qie=!0,Kk={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),Kk}function lAe(){if(Fie)return $t;Fie=!0;var t=ni.Buffer,e=yr,r=ar,a=nAe(),i=sAe(),h=hAe(),c=cAe();for(var p in c)$t[p]=c[p];$t.NONE=0,$t.DEFLATE=1,$t.INFLATE=2,$t.GZIP=3,$t.GUNZIP=4,$t.DEFLATERAW=5,$t.INFLATERAW=6,$t.UNZIP=7;var b=31,g=139;function y(M){if(typeof M!="number"||M<$t.DEFLATE||M>$t.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=M,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}return y.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,r(this.init_done,"close before init"),r(this.mode<=$t.UNZIP),this.mode===$t.DEFLATE||this.mode===$t.GZIP||this.mode===$t.DEFLATERAW?i.deflateEnd(this.strm):(this.mode===$t.INFLATE||this.mode===$t.GUNZIP||this.mode===$t.INFLATERAW||this.mode===$t.UNZIP)&&h.inflateEnd(this.strm),this.mode=$t.NONE,this.dictionary=null},y.prototype.write=function(M,x,E,A,k,O,N){return this._write(!0,M,x,E,A,k,O,N)},y.prototype.writeSync=function(M,x,E,A,k,O,N){return this._write(!1,M,x,E,A,k,O,N)},y.prototype._write=function(M,x,E,A,k,O,N,L){if(r.equal(arguments.length,8),r(this.init_done,"write before init"),r(this.mode!==$t.NONE,"already finalized"),r.equal(!1,this.write_in_progress,"write already in progress"),r.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,r.equal(!1,x===void 0,"must provide flush value"),this.write_in_progress=!0,x!==$t.Z_NO_FLUSH&&x!==$t.Z_PARTIAL_FLUSH&&x!==$t.Z_SYNC_FLUSH&&x!==$t.Z_FULL_FLUSH&&x!==$t.Z_FINISH&&x!==$t.Z_BLOCK)throw new Error("Invalid flush value");if(E==null&&(E=t.alloc(0),k=0,A=0),this.strm.avail_in=k,this.strm.input=E,this.strm.next_in=A,this.strm.avail_out=L,this.strm.output=O,this.strm.next_out=N,this.flush=x,!M)return this._process(),this._checkError()?this._afterSync():void 0;var C=this;return e.nextTick(function(){C._process(),C._after()}),this},y.prototype._afterSync=function(){var M=this.strm.avail_out,x=this.strm.avail_in;return this.write_in_progress=!1,[x,M]},y.prototype._process=function(){var M=null;switch(this.mode){case $t.DEFLATE:case $t.GZIP:case $t.DEFLATERAW:this.err=i.deflate(this.strm,this.flush);break;case $t.UNZIP:switch(this.strm.avail_in>0&&(M=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(M===null)break;if(this.strm.input[M]===b){if(this.gzip_id_bytes_read=1,M++,this.strm.avail_in===1)break}else{this.mode=$t.INFLATE;break}case 1:if(M===null)break;this.strm.input[M]===g?(this.gzip_id_bytes_read=2,this.mode=$t.GUNZIP):this.mode=$t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case $t.INFLATE:case $t.GUNZIP:case $t.INFLATERAW:for(this.err=h.inflate(this.strm,this.flush),this.err===$t.Z_NEED_DICT&&this.dictionary&&(this.err=h.inflateSetDictionary(this.strm,this.dictionary),this.err===$t.Z_OK?this.err=h.inflate(this.strm,this.flush):this.err===$t.Z_DATA_ERROR&&(this.err=$t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===$t.GUNZIP&&this.err===$t.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=h.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},y.prototype._checkError=function(){switch(this.err){case $t.Z_OK:case $t.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===$t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case $t.Z_STREAM_END:break;case $t.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},y.prototype._after=function(){if(this._checkError()){var M=this.strm.avail_out,x=this.strm.avail_in;this.write_in_progress=!1,this.callback(x,M),this.pending_close&&this.close()}},y.prototype._error=function(M){this.strm.msg&&(M=this.strm.msg),this.onerror(M,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},y.prototype.init=function(M,x,E,A,k){r(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),r(M>=8&&M<=15,"invalid windowBits"),r(x>=-1&&x<=9,"invalid compression level"),r(E>=1&&E<=9,"invalid memlevel"),r(A===$t.Z_FILTERED||A===$t.Z_HUFFMAN_ONLY||A===$t.Z_RLE||A===$t.Z_FIXED||A===$t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(x,M,E,A,k),this._setDictionary()},y.prototype.params=function(){throw new Error("deflateParams Not supported")},y.prototype.reset=function(){this._reset(),this._setDictionary()},y.prototype._init=function(M,x,E,A,k){switch(this.level=M,this.windowBits=x,this.memLevel=E,this.strategy=A,this.flush=$t.Z_NO_FLUSH,this.err=$t.Z_OK,(this.mode===$t.GZIP||this.mode===$t.GUNZIP)&&(this.windowBits+=16),this.mode===$t.UNZIP&&(this.windowBits+=32),(this.mode===$t.DEFLATERAW||this.mode===$t.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new a,this.mode){case $t.DEFLATE:case $t.GZIP:case $t.DEFLATERAW:this.err=i.deflateInit2(this.strm,this.level,$t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case $t.INFLATE:case $t.GUNZIP:case $t.INFLATERAW:case $t.UNZIP:this.err=h.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==$t.Z_OK&&this._error("Init error"),this.dictionary=k,this.write_in_progress=!1,this.init_done=!0},y.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=$t.Z_OK,this.mode){case $t.DEFLATE:case $t.DEFLATERAW:this.err=i.deflateSetDictionary(this.strm,this.dictionary);break}this.err!==$t.Z_OK&&this._error("Failed to set dictionary")}},y.prototype._reset=function(){switch(this.err=$t.Z_OK,this.mode){case $t.DEFLATE:case $t.DEFLATERAW:case $t.GZIP:this.err=i.deflateReset(this.strm);break;case $t.INFLATE:case $t.INFLATERAW:case $t.GUNZIP:this.err=h.inflateReset(this.strm);break}this.err!==$t.Z_OK&&this._error("Failed to reset stream")},$t.Zlib=y,$t}function dAe(){if(jie)return tr;jie=!0;var t=yr,e=ni.Buffer,r=ka.Transform,a=lAe(),i=gt,h=ar.ok,c=ni.kMaxLength,p="Cannot create final Buffer. It would be larger than 0x"+c.toString(16)+" bytes";a.Z_MIN_WINDOWBITS=8,a.Z_MAX_WINDOWBITS=15,a.Z_DEFAULT_WINDOWBITS=15,a.Z_MIN_CHUNK=64,a.Z_MAX_CHUNK=1/0,a.Z_DEFAULT_CHUNK=16*1024,a.Z_MIN_MEMLEVEL=1,a.Z_MAX_MEMLEVEL=9,a.Z_DEFAULT_MEMLEVEL=8,a.Z_MIN_LEVEL=-1,a.Z_MAX_LEVEL=9,a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;for(var b=Object.keys(a),g=0;g<b.length;g++){var y=b[g];y.match(/^Z/)&&Object.defineProperty(tr,y,{enumerable:!0,value:a[y],writable:!1})}for(var M={Z_OK:a.Z_OK,Z_STREAM_END:a.Z_STREAM_END,Z_NEED_DICT:a.Z_NEED_DICT,Z_ERRNO:a.Z_ERRNO,Z_STREAM_ERROR:a.Z_STREAM_ERROR,Z_DATA_ERROR:a.Z_DATA_ERROR,Z_MEM_ERROR:a.Z_MEM_ERROR,Z_BUF_ERROR:a.Z_BUF_ERROR,Z_VERSION_ERROR:a.Z_VERSION_ERROR},x=Object.keys(M),E=0;E<x.length;E++){var A=x[E];M[M[A]]=A}Object.defineProperty(tr,"codes",{enumerable:!0,value:Object.freeze(M),writable:!1}),tr.Deflate=N,tr.Inflate=L,tr.Gzip=C,tr.Gunzip=Y,tr.DeflateRaw=G,tr.InflateRaw=ee,tr.Unzip=$,tr.createDeflate=function(s){return new N(s)},tr.createInflate=function(s){return new L(s)},tr.createDeflateRaw=function(s){return new G(s)},tr.createInflateRaw=function(s){return new ee(s)},tr.createGzip=function(s){return new C(s)},tr.createGunzip=function(s){return new Y(s)},tr.createUnzip=function(s){return new $(s)},tr.deflate=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new N(f),s,u)},tr.deflateSync=function(s,f){return O(new N(f),s)},tr.gzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new C(f),s,u)},tr.gzipSync=function(s,f){return O(new C(f),s)},tr.deflateRaw=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new G(f),s,u)},tr.deflateRawSync=function(s,f){return O(new G(f),s)},tr.unzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new $(f),s,u)},tr.unzipSync=function(s,f){return O(new $(f),s)},tr.inflate=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new L(f),s,u)},tr.inflateSync=function(s,f){return O(new L(f),s)},tr.gunzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new Y(f),s,u)},tr.gunzipSync=function(s,f){return O(new Y(f),s)},tr.inflateRaw=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new ee(f),s,u)},tr.inflateRawSync=function(s,f){return O(new ee(f),s)};function k(s,f,u){var l=[],m=0;s.on("error",d),s.on("end",o),s.end(f),w();function w(){for(var v;(v=s.read())!==null;)l.push(v),m+=v.length;s.once("readable",w)}function d(v){s.removeListener("end",o),s.removeListener("readable",w),u(v)}function o(){var v,R=null;m>=c?R=new RangeError(p):v=e.concat(l,m),l=[],s.close(),u(R,v)}}function O(s,f){if(typeof f=="string"&&(f=e.from(f)),!e.isBuffer(f))throw new TypeError("Not a string or buffer");var u=s._finishFlushFlag;return s._processChunk(f,u)}function N(s){if(!(this instanceof N))return new N(s);V.call(this,s,a.DEFLATE)}function L(s){if(!(this instanceof L))return new L(s);V.call(this,s,a.INFLATE)}function C(s){if(!(this instanceof C))return new C(s);V.call(this,s,a.GZIP)}function Y(s){if(!(this instanceof Y))return new Y(s);V.call(this,s,a.GUNZIP)}function G(s){if(!(this instanceof G))return new G(s);V.call(this,s,a.DEFLATERAW)}function ee(s){if(!(this instanceof ee))return new ee(s);V.call(this,s,a.INFLATERAW)}function $(s){if(!(this instanceof $))return new $(s);V.call(this,s,a.UNZIP)}function q(s){return s===a.Z_NO_FLUSH||s===a.Z_PARTIAL_FLUSH||s===a.Z_SYNC_FLUSH||s===a.Z_FULL_FLUSH||s===a.Z_FINISH||s===a.Z_BLOCK}function V(s,f){var u=this;if(this._opts=s=s||{},this._chunkSize=s.chunkSize||tr.Z_DEFAULT_CHUNK,r.call(this,s),s.flush&&!q(s.flush))throw new Error("Invalid flush flag: "+s.flush);if(s.finishFlush&&!q(s.finishFlush))throw new Error("Invalid flush flag: "+s.finishFlush);if(this._flushFlag=s.flush||a.Z_NO_FLUSH,this._finishFlushFlag=typeof s.finishFlush<"u"?s.finishFlush:a.Z_FINISH,s.chunkSize&&(s.chunkSize<tr.Z_MIN_CHUNK||s.chunkSize>tr.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+s.chunkSize);if(s.windowBits&&(s.windowBits<tr.Z_MIN_WINDOWBITS||s.windowBits>tr.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+s.windowBits);if(s.level&&(s.level<tr.Z_MIN_LEVEL||s.level>tr.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+s.level);if(s.memLevel&&(s.memLevel<tr.Z_MIN_MEMLEVEL||s.memLevel>tr.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+s.memLevel);if(s.strategy&&s.strategy!=tr.Z_FILTERED&&s.strategy!=tr.Z_HUFFMAN_ONLY&&s.strategy!=tr.Z_RLE&&s.strategy!=tr.Z_FIXED&&s.strategy!=tr.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+s.strategy);if(s.dictionary&&!e.isBuffer(s.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new a.Zlib(f);var l=this;this._hadError=!1,this._handle.onerror=function(d,o){_(l),l._hadError=!0;var v=new Error(d);v.errno=o,v.code=tr.codes[o],l.emit("error",v)};var m=tr.Z_DEFAULT_COMPRESSION;typeof s.level=="number"&&(m=s.level);var w=tr.Z_DEFAULT_STRATEGY;typeof s.strategy=="number"&&(w=s.strategy),this._handle.init(s.windowBits||tr.Z_DEFAULT_WINDOWBITS,m,s.memLevel||tr.Z_DEFAULT_MEMLEVEL,w,s.dictionary),this._buffer=e.allocUnsafe(this._chunkSize),this._offset=0,this._level=m,this._strategy=w,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!u._handle},configurable:!0,enumerable:!0})}i.inherits(V,r),V.prototype.params=function(s,f,u){if(s<tr.Z_MIN_LEVEL||s>tr.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+s);if(f!=tr.Z_FILTERED&&f!=tr.Z_HUFFMAN_ONLY&&f!=tr.Z_RLE&&f!=tr.Z_FIXED&&f!=tr.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+f);if(this._level!==s||this._strategy!==f){var l=this;this.flush(a.Z_SYNC_FLUSH,function(){h(l._handle,"zlib binding closed"),l._handle.params(s,f),l._hadError||(l._level=s,l._strategy=f,u&&u())})}else t.nextTick(u)},V.prototype.reset=function(){return h(this._handle,"zlib binding closed"),this._handle.reset()},V.prototype._flush=function(s){this._transform(e.alloc(0),"",s)},V.prototype.flush=function(s,f){var u=this,l=this._writableState;(typeof s=="function"||s===void 0&&!f)&&(f=s,s=a.Z_FULL_FLUSH),l.ended?f&&t.nextTick(f):l.ending?f&&this.once("end",f):l.needDrain?f&&this.once("drain",function(){return u.flush(s,f)}):(this._flushFlag=s,this.write(e.alloc(0),"",f))},V.prototype.close=function(s){_(this,s),t.nextTick(n,this)};function _(s,f){f&&t.nextTick(f),s._handle&&(s._handle.close(),s._handle=null)}function n(s){s.emit("close")}return V.prototype._transform=function(s,f,u){var l,m=this._writableState,w=m.ending||m.ended,d=w&&(!s||m.length===s.length);if(s!==null&&!e.isBuffer(s))return u(new Error("invalid input"));if(!this._handle)return u(new Error("zlib binding closed"));d?l=this._finishFlushFlag:(l=this._flushFlag,s.length>=m.length&&(this._flushFlag=this._opts.flush||a.Z_NO_FLUSH)),this._processChunk(s,l,u)},V.prototype._processChunk=function(s,f,u){var l=s&&s.length,m=this._chunkSize-this._offset,w=0,d=this,o=typeof u=="function";if(!o){var v=[],R=0,S;this.on("error",function(Q){S=Q}),h(this._handle,"zlib binding closed");do var B=this._handle.writeSync(f,s,w,l,this._buffer,this._offset,m);while(!this._hadError&&re(B[0],B[1]));if(this._hadError)throw S;if(R>=c)throw _(this),new RangeError(p);var F=e.concat(v,R);return _(this),F}h(this._handle,"zlib binding closed");var D=this._handle.write(f,s,w,l,this._buffer,this._offset,m);D.buffer=s,D.callback=re;function re(Q,Z){if(this&&(this.buffer=null,this.callback=null),!d._hadError){var K=m-Z;if(h(K>=0,"have should not go down"),K>0){var ce=d._buffer.slice(d._offset,d._offset+K);d._offset+=K,o?d.push(ce):(v.push(ce),R+=ce.length)}if((Z===0||d._offset>=d._chunkSize)&&(m=d._chunkSize,d._offset=0,d._buffer=e.allocUnsafe(d._chunkSize)),Z===0){if(w+=l-Q,l=Q,!o)return!0;var te=d._handle.write(f,s,w,l,d._buffer,d._offset,d._chunkSize);te.callback=re,te.buffer=s;return}if(!o)return!1;u()}}},i.inherits(N,V),i.inherits(L,V),i.inherits(C,V),i.inherits(Y,V),i.inherits(G,V),i.inherits(ee,V),i.inherits($,V),tr}var qk,Iie,Ba,Bie,Id,Oie,Fk,Pie,jk,Nie,zk,Cie,Of,Lie,Zk,$ie,Hk,Die,Ns,Uie,Kk,qie,$t,Fie,tr,jie,At,pAe,vAe,mAe,gAe,bAe,yAe,wAe,_Ae,MAe,xAe,SAe,EAe,AAe,RAe,TAe,kAe,IAe,BAe,OAe,PAe,NAe,CAe,LAe,$Ae,DAe,UAe,qAe,FAe,jAe,zAe,ZAe,HAe,KAe,WAe,VAe,GAe,YAe,JAe,XAe,QAe,eRe,tRe,rRe,iRe,nRe,aRe,oRe,sRe,fRe,uRe,hRe,cRe,lRe,dRe,pRe,vRe,mRe,gRe,bRe,yRe,wRe,_Re,MRe,xRe,SRe,ERe,ARe,RRe,TRe,Kie=Si(()=>{"use strict";ie();ae();ne();ah();B8();yk();Ks();no();Rg();Fo();Hs();th();Uo();Gf();Z0();qk={},Iie=!1;Ba={},Bie=!1;Id={},Oie=!1;Fk={},Pie=!1;jk={},Nie=!1;zk={},Cie=!1;Of={},Lie=!1;Zk={},$ie=!1;Hk={},Die=!1;Ns={},Uie=!1;Kk={},qie=!1;$t={},Fie=!1;tr={},jie=!1;At=dAe();At.codes;At.Deflate;At.Inflate;At.Gzip;At.Gunzip;At.DeflateRaw;At.InflateRaw;At.Unzip;At.createDeflate;At.createInflate;At.createDeflateRaw;At.createInflateRaw;At.createGzip;At.createGunzip;At.createUnzip;At.deflate;At.deflateSync;At.gzip;At.gzipSync;At.deflateRaw;At.deflateRawSync;At.unzip;At.unzipSync;At.inflate;At.inflateSync;At.gunzip;At.gunzipSync;At.inflateRaw;At.inflateRawSync;pAe=At.Deflate,vAe=At.DeflateRaw,mAe=At.Gunzip,gAe=At.Gzip,bAe=At.Inflate,yAe=At.InflateRaw,wAe=At.Unzip,_Ae=At.Z_BEST_COMPRESSION,MAe=At.Z_BEST_SPEED,xAe=At.Z_BINARY,SAe=At.Z_BLOCK,EAe=At.Z_BUF_ERROR,AAe=At.Z_DATA_ERROR,RAe=At.Z_DEFAULT_CHUNK,TAe=At.Z_DEFAULT_COMPRESSION,kAe=At.Z_DEFAULT_LEVEL,IAe=At.Z_DEFAULT_MEMLEVEL,BAe=At.Z_DEFAULT_STRATEGY,OAe=At.Z_DEFAULT_WINDOWBITS,PAe=At.Z_DEFLATED,NAe=At.Z_ERRNO,CAe=At.Z_FILTERED,LAe=At.Z_FINISH,$Ae=At.Z_FIXED,DAe=At.Z_FULL_FLUSH,UAe=At.Z_HUFFMAN_ONLY,qAe=At.Z_MAX_CHUNK,FAe=At.Z_MAX_LEVEL,jAe=At.Z_MAX_MEMLEVEL,zAe=At.Z_MAX_WINDOWBITS,ZAe=At.Z_MIN_CHUNK,HAe=At.Z_MIN_LEVEL,KAe=At.Z_MIN_MEMLEVEL,WAe=At.Z_MIN_WINDOWBITS,VAe=At.Z_NEED_DICT,GAe=At.Z_NO_COMPRESSION,YAe=At.Z_NO_FLUSH,JAe=At.Z_OK,XAe=At.Z_PARTIAL_FLUSH,QAe=At.Z_RLE,eRe=At.Z_STREAM_END,tRe=At.Z_STREAM_ERROR,rRe=At.Z_SYNC_FLUSH,iRe=At.Z_TEXT,nRe=At.Z_TREES,aRe=At.Z_UNKNOWN,oRe=At.Zlib,sRe=At.codes,fRe=At.createDeflate,uRe=At.createDeflateRaw,hRe=At.createGunzip,cRe=At.createGzip,lRe=At.createInflate,dRe=At.createInflateRaw,pRe=At.createUnzip,vRe=At.deflate,mRe=At.deflateRaw,gRe=At.deflateRawSync,bRe=At.deflateSync,yRe=At.gunzip,wRe=At.gunzipSync,_Re=At.gzip,MRe=At.gzipSync,xRe=At.inflate,SRe=At.inflateRaw,ERe=At.inflateRawSync,ARe=At.inflateSync,RRe=At.unzip,TRe=At.unzipSync});var Gie=ht((Rpt,Vie)=>{"use strict";ie();ae();ne();var F1=[],o2=[],Wk=function(){};function Gk(t){return~F1.indexOf(t)?!1:(F1.push(t),!0)}function Yk(t){Wk=t}function kRe(t){for(var e=[],r=0;r<F1.length;r++){if(F1[r].async){e.push(F1[r]);continue}if(F1[r](t))return!0}return e.length?new Promise(function(i){Promise.all(e.map(function(c){return c(t)})).then(function(c){i(c.some(Boolean))})}):!1}function Jk(t){return~o2.indexOf(t)?!1:(o2.push(t),!0)}function Vk(){Wk.apply(Wk,arguments)}function Wie(t){for(var e=0;e<o2.length;e++)t=o2[e].apply(o2[e],arguments);return t}function Xk(t,e){var r=Object.prototype.hasOwnProperty;for(var a in e)r.call(e,a)&&(t[a]=e[a]);return t}function IRe(t){return t.enabled=!1,t.modify=Jk,t.set=Yk,t.use=Gk,Xk(function(){return!1},t)}function BRe(t){function e(){var r=Array.prototype.slice.call(arguments,0);return Vk.call(Vk,t,Wie(r,t)),!0}return t.enabled=!0,t.modify=Jk,t.set=Yk,t.use=Gk,Xk(e,t)}Vie.exports=function(e){return e.introduce=Xk,e.enabled=kRe,e.process=Wie,e.modify=Jk,e.write=Vk,e.nope=IRe,e.yep=BRe,e.set=Yk,e.use=Gk,e}});var Jie=ht((Bpt,Yie)=>{"use strict";ie();ae();ne();var ORe=Gie(),PRe=ORe(function t(e,r){return r=r||{},r.namespace=e,r.prod=!0,r.dev=!1,r.force||t.force?t.yep(r):t.nope(r)});Yie.exports=PRe});var s2=ht((Cpt,Xie)=>{"use strict";ie();ae();ne();Xie.exports=Jie()});var Qie={};Ha(Qie,{StringDecoder:()=>NRe,default:()=>An});var NRe,ene=Si(()=>{"use strict";ie();ae();ne();Gf();Gf();NRe=An.StringDecoder});var rne=ht((Zpt,tne)=>{"use strict";ie();ae();ne();var Qk=(Nk(),ei(Pk)),CRe=(ene(),ei(Qie)),LRe=CRe.StringDecoder,$Re=Oh(),DRe=$Re.Stream;function URe(){}tne.exports=function(t,e){var r=Me.alloc(65536),a=new LRe("utf8"),i=new DRe,h="",c=0,p=0;return t.start===-1&&delete t.start,i.readable=!0,i.destroy=function(){i.destroyed=!0,i.emit("end"),i.emit("close")},Qk.open(t.file,"a+","0644",function(b,g){if(b){e?e(b):i.emit("error",b),i.destroy();return}(function y(){if(i.destroyed){Qk.close(g,URe);return}return Qk.read(g,r,0,r.length,c,function(M,x){if(M){e?e(M):i.emit("error",M),i.destroy();return}if(!x)return h&&((t.start==null||p>t.start)&&(e?e(null,h):i.emit("line",h)),p++,h=""),setTimeout(y,1e3);var E=a.write(r.slice(0,x));e||i.emit("data",E),E=(h+E).split(/\n+/);for(var A=E.length-1,k=0;k<A;k++)(t.start==null||p>t.start)&&(e?e(null,E[k]):i.emit("line",E[k])),p++;return h=E[A],c+=x,y()})})()}),e?i.destroy:i}});var hne=ht((Vpt,une)=>{"use strict";ie();ae();ne();function jh(t){"@babel/helpers - typeof";return jh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jh(t)}function qRe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ine(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,jRe(a.key),a)}}function FRe(t,e,r){return e&&ine(t.prototype,e),r&&ine(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function jRe(t){var e=zRe(t,"string");return jh(e)=="symbol"?e:String(e)}function zRe(t,e){if(jh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(jh(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ZRe(t,e,r){return e=B4(e),HRe(t,one()?Reflect.construct(e,r||[],B4(t).constructor):e.apply(t,r))}function HRe(t,e){if(e&&(jh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sne(t)}function one(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(one=function(){return!!t})()}function B4(t){return B4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},B4(t)}function sne(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function KRe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&eI(t,e)}function eI(t,e){return eI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},eI(t,e)}var fo=(Nk(),ei(Pk)),na=(_k(),ei(hre)),nne=kie(),WRe=(Kie(),ei(Hie)),VRe=sn(),GRe=VRe.MESSAGE,fne=Oh(),YRe=fne.Stream,ane=fne.PassThrough,JRe=P1(),Pf=s2()("winston:file"),XRe=(bd(),ei(gd)),QRe=rne();une.exports=function(t){KRe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};qRe(this,e),r=ZRe(this,e,[a]),r.name=a.name||"file";function i(h){for(var c=arguments.length,p=new Array(c>1?c-1:0),b=1;b<c;b++)p[b-1]=arguments[b];p.slice(1).forEach(function(g){if(a[g])throw new Error("Cannot set ".concat(g," and ").concat(h," together"))})}if(r._stream=new ane,r._stream.setMaxListeners(30),r._onError=r._onError.bind(sne(r)),a.filename||a.dirname)i("filename or dirname","stream"),r._basename=r.filename=a.filename?na.basename(a.filename):"winston.log",r.dirname=a.dirname||na.dirname(a.filename),r.options=a.options||{flags:"a"};else if(a.stream)console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),i("stream","filename","maxsize"),r._dest=r._stream.pipe(r._setupStream(a.stream)),r.dirname=na.dirname(r._dest.path);else throw new Error("Cannot log to file without filename or stream.");return r.maxsize=a.maxsize||null,r.rotationFormat=a.rotationFormat||!1,r.zippedArchive=a.zippedArchive||!1,r.maxFiles=a.maxFiles||null,r.eol=typeof a.eol=="string"?a.eol:XRe.EOL,r.tailable=a.tailable||!1,r.lazy=a.lazy||!1,r._size=0,r._pendingSize=0,r._created=0,r._drain=!1,r._opening=!1,r._ending=!1,r._fileExist=!1,r.dirname&&r._createLogDirIfNotExist(r.dirname),r.lazy||r.open(),r}return FRe(e,[{key:"finishIfEnding",value:function(){var a=this;this._ending&&(this._opening?this.once("open",function(){a._stream.once("finish",function(){return a.emit("finish")}),setImmediate(function(){return a._stream.end()})}):(this._stream.once("finish",function(){return a.emit("finish")}),setImmediate(function(){return a._stream.end()})))}},{key:"log",value:function(a){var i=this,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){};if(this.silent)return h(),!0;if(this._drain){this._stream.once("drain",function(){i._drain=!1,i.log(a,h)});return}if(this._rotate){this._stream.once("rotate",function(){i._rotate=!1,i.log(a,h)});return}if(this.lazy){if(!this._fileExist){this._opening||this.open(),this.once("open",function(){i._fileExist=!0,i.log(a,h)});return}if(this._needsNewFile(this._pendingSize)){this._dest.once("close",function(){i._opening||i.open(),i.once("open",function(){i.log(a,h)})});return}}var c="".concat(a[GRe]).concat(this.eol),p=Me.byteLength(c);function b(){var y=this;if(this._size+=p,this._pendingSize-=p,Pf("logged %s %s",this._size,c),this.emit("logged",a),!this._rotate&&!this._opening&&this._needsNewFile()){if(this.lazy){this._endStream(function(){y.emit("fileclosed")});return}this._rotate=!0,this._endStream(function(){return y._rotateFile()})}}this._pendingSize+=p,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);var g=this._stream.write(c,b.bind(this));return g?h():(this._drain=!0,this._stream.once("drain",function(){i._drain=!1,h()})),Pf("written",g,this._drain),this.finishIfEnding(),g}},{key:"query",value:function(a,i){typeof a=="function"&&(i=a,a={}),a=E(a);var h=na.join(this.dirname,this.filename),c="",p=[],b=0,g=fo.createReadStream(h,{encoding:"utf8"});g.on("error",function(A){if(g.readable&&g.destroy(),!!i)return A.code!=="ENOENT"?i(A):i(null,p)}),g.on("data",function(A){A=(c+A).split(/\n+/);for(var k=A.length-1,O=0;O<k;O++)(!a.start||b>=a.start)&&y(A[O]),b++;c=A[k]}),g.on("close",function(){c&&y(c,!0),a.order==="desc"&&(p=p.reverse()),i&&i(null,p)});function y(A,k){try{var O=JSON.parse(A);x(O)&&M(O)}catch(N){k||g.emit("error",N)}}function M(A){if(a.rows&&p.length>=a.rows&&a.order!=="desc"){g.readable&&g.destroy();return}a.fields&&(A=a.fields.reduce(function(k,O){return k[O]=A[O],k},{})),a.order==="desc"&&p.length>=a.rows&&p.shift(),p.push(A)}function x(A){if(A&&jh(A)==="object"){var k=new Date(A.timestamp);if(!(a.from&&k<a.from||a.until&&k>a.until||a.level&&a.level!==A.level))return!0}}function E(A){return A=A||{},A.rows=A.rows||A.limit||10,A.start=A.start||0,A.until=A.until||new Date,jh(A.until)!=="object"&&(A.until=new Date(A.until)),A.from=A.from||A.until-24*60*60*1e3,jh(A.from)!=="object"&&(A.from=new Date(A.from)),A.order=A.order||"desc",A}}},{key:"stream",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=na.join(this.dirname,this.filename),h=new YRe,c={file:i,start:a.start};return h.destroy=QRe(c,function(p,b){if(p)return h.emit("error",p);try{h.emit("data",b),b=JSON.parse(b),h.emit("log",b)}catch(g){h.emit("error",g)}}),h}},{key:"open",value:function(){var a=this;this.filename&&(this._opening||(this._opening=!0,this.stat(function(i,h){if(i)return a.emit("error",i);Pf("stat done: %s { size: %s }",a.filename,h),a._size=h,a._dest=a._createStream(a._stream),a._opening=!1,a.once("open",function(){a._stream.eventNames().includes("rotate")?a._stream.emit("rotate"):a._rotate=!1})})))}},{key:"stat",value:function(a){var i=this,h=this._getFile(),c=na.join(this.dirname,h);fo.stat(c,function(p,b){if(p&&p.code==="ENOENT")return Pf("ENOENT\xA0ok",c),i.filename=h,a(null,0);if(p)return Pf("err ".concat(p.code," ").concat(c)),a(p);if(!b||i._needsNewFile(b.size))return i._incFile(function(){return i.stat(a)});i.filename=h,a(null,b.size)})}},{key:"close",value:function(a){var i=this;this._stream&&this._stream.end(function(){a&&a(),i.emit("flush"),i.emit("closed")})}},{key:"_needsNewFile",value:function(a){return a=a||this._size,this.maxsize&&a>=this.maxsize}},{key:"_onError",value:function(a){this.emit("error",a)}},{key:"_setupStream",value:function(a){return a.on("error",this._onError),a}},{key:"_cleanupStream",value:function(a){return a.removeListener("error",this._onError),a.destroy(),a}},{key:"_rotateFile",value:function(){var a=this;this._incFile(function(){return a.open()})}},{key:"_endStream",value:function(){var a=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};this._dest?(this._stream.unpipe(this._dest),this._dest.end(function(){a._cleanupStream(a._dest),i()})):i()}},{key:"_createStream",value:function(a){var i=this,h=na.join(this.dirname,this.filename);Pf("create stream start",h,this.options);var c=fo.createWriteStream(h,this.options).on("error",function(p){return Pf(p)}).on("close",function(){return Pf("close",c.path,c.bytesWritten)}).on("open",function(){Pf("file open ok",h),i.emit("open",h),a.pipe(c),i.rotatedWhileOpening&&(i._stream=new ane,i._stream.setMaxListeners(30),i._rotateFile(),i.rotatedWhileOpening=!1,i._cleanupStream(c),a.end())});return Pf("create stream ok",h),c}},{key:"_incFile",value:function(a){Pf("_incFile",this.filename);var i=na.extname(this._basename),h=na.basename(this._basename,i),c=[];this.zippedArchive&&c.push(function(p){var b=this._created>0&&!this.tailable?this._created:"";this._compressFile(na.join(this.dirname,"".concat(h).concat(b).concat(i)),na.join(this.dirname,"".concat(h).concat(b).concat(i,".gz")),p)}.bind(this)),c.push(function(p){this.tailable?this._checkMaxFilesTailable(i,h,p):(this._created+=1,this._checkMaxFilesIncrementing(i,h,p))}.bind(this)),nne(c,a)}},{key:"_getFile",value:function(){var a=na.extname(this._basename),i=na.basename(this._basename,a),h=this.rotationFormat?this.rotationFormat():this._created;return!this.tailable&&this._created?"".concat(i).concat(h).concat(a):"".concat(i).concat(a)}},{key:"_checkMaxFilesIncrementing",value:function(a,i,h){if(!this.maxFiles||this._created<this.maxFiles)return setImmediate(h);var c=this._created-this.maxFiles,p=c!==0?c:"",b=this.zippedArchive?".gz":"",g="".concat(i).concat(p).concat(a).concat(b),y=na.join(this.dirname,g);fo.unlink(y,h)}},{key:"_checkMaxFilesTailable",value:function(a,i,h){var c=this,p=[];if(this.maxFiles){for(var b=this.zippedArchive?".gz":"",g=this.maxFiles-1;g>1;g--)p.push(function(y,M){var x=this,E="".concat(i).concat(y-1).concat(a).concat(b),A=na.join(this.dirname,E);fo.exists(A,function(k){if(!k)return M(null);E="".concat(i).concat(y).concat(a).concat(b),fo.rename(A,na.join(x.dirname,E),M)})}.bind(this,g));nne(p,function(){fo.rename(na.join(c.dirname,"".concat(i).concat(a).concat(b)),na.join(c.dirname,"".concat(i,"1").concat(a).concat(b)),h)})}}},{key:"_compressFile",value:function(a,i,h){fo.access(a,fo.F_OK,function(c){if(c)return h();var p=WRe.createGzip(),b=fo.createReadStream(a),g=fo.createWriteStream(i);g.on("finish",function(){fo.unlink(a,h)}),b.pipe(p).pipe(g)})}},{key:"_createLogDirIfNotExist",value:function(a){fo.existsSync(a)||fo.mkdirSync(a,{recursive:!0})}}]),e}(JRe)});var yne={};Ha(yne,{Agent:()=>aTe,ClientRequest:()=>oTe,IncomingMessage:()=>sTe,METHODS:()=>fTe,STATUS_CODES:()=>uTe,default:()=>Nf,get:()=>hTe,globalAgent:()=>cTe,request:()=>lTe});function gne(){if(cne)return No;cne=!0,No.fetch=a(Bd.fetch)&&a(Bd.ReadableStream),No.writableStream=a(Bd.WritableStream),No.abortController=a(Bd.AbortController);var t;function e(){if(t!==void 0)return t;if(Bd.XMLHttpRequest){t=new Bd.XMLHttpRequest;try{t.open("GET",Bd.XDomainRequest?"/":"https://example.com")}catch{t=null}}else t=null;return t}function r(i){var h=e();if(!h)return!1;try{return h.responseType=i,h.responseType===i}catch{}return!1}No.arraybuffer=No.fetch||r("arraybuffer"),No.msstream=!No.fetch&&r("ms-stream"),No.mozchunkedarraybuffer=!No.fetch&&r("moz-chunked-arraybuffer"),No.overrideMimeType=No.fetch||(e()?a(e().overrideMimeType):!1);function a(i){return typeof i=="function"}return t=null,No}function bne(){if(lne)return O4;lne=!0;var t=ni.Buffer,e=yr,r=gne(),a=Mr(),i=rp(),h=O4.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=O4.IncomingMessage=function(p,b,g,y){var M=this||P4;if(i.Readable.call(M),M._mode=g,M.headers={},M.rawHeaders=[],M.trailers={},M.rawTrailers=[],M.on("end",function(){e.nextTick(function(){M.emit("close")})}),g==="fetch"){let L=function(){E.read().then(function(C){if(!M._destroyed){if(y(C.done),C.done){M.push(null);return}M.push(t.from(C.value)),L()}}).catch(function(C){y(!0),M._destroyed||M.emit("error",C)})};var N=L;if(M._fetchResponse=b,M.url=b.url,M.statusCode=b.status,M.statusMessage=b.statusText,b.headers.forEach(function(C,Y){M.headers[Y.toLowerCase()]=C,M.rawHeaders.push(Y,C)}),r.writableStream){var x=new WritableStream({write:function(C){return y(!1),new Promise(function(Y,G){M._destroyed?G():M.push(t.from(C))?Y():M._resumeFetch=Y})},close:function(){y(!0),M._destroyed||M.push(null)},abort:function(C){y(!0),M._destroyed||M.emit("error",C)}});try{b.body.pipeTo(x).catch(function(C){y(!0),M._destroyed||M.emit("error",C)});return}catch{}}var E=b.body.getReader();L()}else{M._xhr=p,M._pos=0,M.url=p.responseURL,M.statusCode=p.status,M.statusMessage=p.statusText;var A=p.getAllResponseHeaders().split(/\r?\n/);if(A.forEach(function(L){var C=L.match(/^([^:]+):\s*(.*)/);if(C){var Y=C[1].toLowerCase();Y==="set-cookie"?(M.headers[Y]===void 0&&(M.headers[Y]=[]),M.headers[Y].push(C[2])):M.headers[Y]!==void 0?M.headers[Y]+=", "+C[2]:M.headers[Y]=C[2],M.rawHeaders.push(C[1],C[2])}}),M._charset="x-user-defined",!r.overrideMimeType){var k=M.rawHeaders["mime-type"];if(k){var O=k.match(/;\s*charset=([^;])(;|$)/);O&&(M._charset=O[1].toLowerCase())}M._charset||(M._charset="utf-8")}}};return a(c,i.Readable),c.prototype._read=function(){var p=this||P4,b=p._resumeFetch;b&&(p._resumeFetch=null,b())},c.prototype._onXHRProgress=function(p){var b=this||P4,g=b._xhr,y=null;switch(b._mode){case"text":if(y=g.responseText,y.length>b._pos){var M=y.substr(b._pos);if(b._charset==="x-user-defined"){for(var x=t.alloc(M.length),E=0;E<M.length;E++)x[E]=M.charCodeAt(E)&255;b.push(x)}else b.push(M,b._charset);b._pos=y.length}break;case"arraybuffer":if(g.readyState!==h.DONE||!g.response)break;y=g.response,b.push(t.from(new Uint8Array(y)));break;case"moz-chunked-arraybuffer":if(y=g.response,g.readyState!==h.LOADING||!y)break;b.push(t.from(new Uint8Array(y)));break;case"ms-stream":if(y=g.response,g.readyState!==h.LOADING)break;var A=new P4.MSStreamReader;A.onprogress=function(){A.result.byteLength>b._pos&&(b.push(t.from(new Uint8Array(A.result.slice(b._pos)))),b._pos=A.result.byteLength)},A.onload=function(){p(!0),b.push(null)},A.readAsArrayBuffer(y);break}b._xhr.readyState===h.DONE&&b._mode!=="ms-stream"&&(p(!0),b.push(null))},O4}function eTe(){if(dne)return tI;dne=!0;var t=ni.Buffer,e=yr,r=gne(),a=Mr(),i=bne(),h=rp(),c=i.IncomingMessage,p=i.readyStates;function b(x,E){return r.fetch&&E?"fetch":r.mozchunkedarraybuffer?"moz-chunked-arraybuffer":r.msstream?"ms-stream":r.arraybuffer&&x?"arraybuffer":"text"}var g=tI=function(x){var E=this||aa;h.Writable.call(E),E._opts=x,E._body=[],E._headers={},x.auth&&E.setHeader("Authorization","Basic "+t.from(x.auth).toString("base64")),Object.keys(x.headers).forEach(function(O){E.setHeader(O,x.headers[O])});var A,k=!0;if(x.mode==="disable-fetch"||"requestTimeout"in x&&!r.abortController)k=!1,A=!0;else if(x.mode==="prefer-streaming")A=!1;else if(x.mode==="allow-wrong-content-type")A=!r.overrideMimeType;else if(!x.mode||x.mode==="default"||x.mode==="prefer-fast")A=!0;else throw new Error("Invalid value for opts.mode");E._mode=b(A,k),E._fetchTimer=null,E._socketTimeout=null,E._socketTimer=null,E.on("finish",function(){E._onFinish()})};a(g,h.Writable),g.prototype.setHeader=function(x,E){var A=this||aa,k=x.toLowerCase();M.indexOf(k)===-1&&(A._headers[k]={name:x,value:E})},g.prototype.getHeader=function(x){var E=(this||aa)._headers[x.toLowerCase()];return E?E.value:null},g.prototype.removeHeader=function(x){var E=this||aa;delete E._headers[x.toLowerCase()]},g.prototype._onFinish=function(){var x=this||aa;if(!x._destroyed){var E=x._opts;"timeout"in E&&E.timeout!==0&&x.setTimeout(E.timeout);var A=x._headers,k=null;E.method!=="GET"&&E.method!=="HEAD"&&(k=new Blob(x._body,{type:(A["content-type"]||{}).value||""}));var O=[];if(Object.keys(A).forEach(function(Y){var G=A[Y].name,ee=A[Y].value;Array.isArray(ee)?ee.forEach(function($){O.push([G,$])}):O.push([G,ee])}),x._mode==="fetch"){var N=null;if(r.abortController){var L=new AbortController;N=L.signal,x._fetchAbortController=L,"requestTimeout"in E&&E.requestTimeout!==0&&(x._fetchTimer=aa.setTimeout(function(){x.emit("requestTimeout"),x._fetchAbortController&&x._fetchAbortController.abort()},E.requestTimeout))}aa.fetch(x._opts.url,{method:x._opts.method,headers:O,body:k||void 0,mode:"cors",credentials:E.withCredentials?"include":"same-origin",signal:N}).then(function(Y){x._fetchResponse=Y,x._resetTimers(!1),x._connect()},function(Y){x._resetTimers(!0),x._destroyed||x.emit("error",Y)})}else{var C=x._xhr=new aa.XMLHttpRequest;try{C.open(x._opts.method,x._opts.url,!0)}catch(Y){e.nextTick(function(){x.emit("error",Y)});return}"responseType"in C&&(C.responseType=x._mode),"withCredentials"in C&&(C.withCredentials=!!E.withCredentials),x._mode==="text"&&"overrideMimeType"in C&&C.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in E&&(C.timeout=E.requestTimeout,C.ontimeout=function(){x.emit("requestTimeout")}),O.forEach(function(Y){C.setRequestHeader(Y[0],Y[1])}),x._response=null,C.onreadystatechange=function(){switch(C.readyState){case p.LOADING:case p.DONE:x._onXHRProgress();break}},x._mode==="moz-chunked-arraybuffer"&&(C.onprogress=function(){x._onXHRProgress()}),C.onerror=function(){x._destroyed||(x._resetTimers(!0),x.emit("error",new Error("XHR error")))};try{C.send(k)}catch(Y){e.nextTick(function(){x.emit("error",Y)});return}}}};function y(x){try{var E=x.status;return E!==null&&E!==0}catch{return!1}}g.prototype._onXHRProgress=function(){var x=this||aa;x._resetTimers(!1),!(!y(x._xhr)||x._destroyed)&&(x._response||x._connect(),x._response._onXHRProgress(x._resetTimers.bind(x)))},g.prototype._connect=function(){var x=this||aa;x._destroyed||(x._response=new c(x._xhr,x._fetchResponse,x._mode,x._resetTimers.bind(x)),x._response.on("error",function(E){x.emit("error",E)}),x.emit("response",x._response))},g.prototype._write=function(x,E,A){var k=this||aa;k._body.push(x),A()},g.prototype._resetTimers=function(x){var E=this||aa;aa.clearTimeout(E._socketTimer),E._socketTimer=null,x?(aa.clearTimeout(E._fetchTimer),E._fetchTimer=null):E._socketTimeout&&(E._socketTimer=aa.setTimeout(function(){E.emit("timeout")},E._socketTimeout))},g.prototype.abort=g.prototype.destroy=function(x){var E=this||aa;E._destroyed=!0,E._resetTimers(!0),E._response&&(E._response._destroyed=!0),E._xhr?E._xhr.abort():E._fetchAbortController&&E._fetchAbortController.abort(),x&&E.emit("error",x)},g.prototype.end=function(x,E,A){var k=this||aa;typeof x=="function"&&(A=x,x=void 0),h.Writable.prototype.end.call(k,x,E,A)},g.prototype.setTimeout=function(x,E){var A=this||aa;E&&A.once("timeout",E),A._socketTimeout=x,A._resetTimers(!1)},g.prototype.flushHeaders=function(){},g.prototype.setNoDelay=function(){},g.prototype.setSocketKeepAlive=function(){};var M=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"];return tI}function tTe(){if(pne)return rI;pne=!0,rI=e;var t=Object.prototype.hasOwnProperty;function e(){for(var r={},a=0;a<arguments.length;a++){var i=arguments[a];for(var h in i)t.call(i,h)&&(r[h]=i[h])}return r}return rI}function rTe(){return vne||(vne=!0,iI={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}),iI}function nTe(){if(mne)return nI;mne=!0;var t=eTe(),e=bne(),r=tTe(),a=rTe(),i=vi,h=nI;return h.request=function(c,p){typeof c=="string"?c=i.parse(c):c=r(c);var b=iTe.location.protocol.search(/^https?:$/)===-1?"http:":"",g=c.protocol||b,y=c.hostname||c.host,M=c.port,x=c.path||"/";y&&y.indexOf(":")!==-1&&(y="["+y+"]"),c.url=(y?g+"//"+y:"")+(M?":"+M:"")+x,c.method=(c.method||"GET").toUpperCase(),c.headers=c.headers||{};var E=new t(c);return p&&E.on("response",p),E},h.get=function(p,b){var g=h.request(p,b);return g.end(),g},h.ClientRequest=t,h.IncomingMessage=e.IncomingMessage,h.Agent=function(){},h.Agent.defaultMaxSockets=4,h.globalAgent=new h.Agent,h.STATUS_CODES=a,h.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],nI}var No,cne,Bd,O4,lne,P4,tI,dne,aa,rI,pne,iI,vne,nI,mne,iTe,Nf,aTe,oTe,sTe,fTe,uTe,hTe,cTe,lTe,aI=Si(()=>{"use strict";ie();ae();ne();ah();sy();Ks();u4();Hs();th();Fo();Uo();Gf();Jg();Qg();Ad();No={},cne=!1,Bd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;O4={},lne=!1,P4=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;tI={},dne=!1,aa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;rI={},pne=!1;iI={},vne=!1;nI={},mne=!1,iTe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Nf=nTe(),aTe=Nf.Agent,oTe=Nf.ClientRequest,sTe=Nf.IncomingMessage,fTe=Nf.METHODS,uTe=Nf.STATUS_CODES,hTe=Nf.get,cTe=Nf.globalAgent,lTe=Nf.request});var Mne={};Ha(Mne,{Agent:()=>pTe,ClientRequest:()=>vTe,IncomingMessage:()=>mTe,METHODS:()=>gTe,STATUS_CODES:()=>bTe,default:()=>zh,get:()=>yTe,globalAgent:()=>wTe,request:()=>_Te});function dTe(){if(wne)return oI;wne=!0;var t=Nf,e=vi,r=oI;for(var a in t)t.hasOwnProperty(a)&&(r[a]=t[a]);r.request=function(h,c){return h=i(h),t.request.call(this||_ne,h,c)},r.get=function(h,c){return h=i(h),t.get.call(this||_ne,h,c)};function i(h){if(typeof h=="string"&&(h=e.parse(h)),h.protocol||(h.protocol="https:"),h.protocol!=="https:")throw new Error('Protocol "'+h.protocol+'" not supported. Expected "https:"');return h}return oI}var oI,wne,_ne,zh,pTe,vTe,mTe,gTe,bTe,yTe,wTe,_Te,xne=Si(()=>{"use strict";ie();ae();ne();aI();u4();ah();Hs();th();Fo();Uo();Ks();Gf();sy();Jg();Qg();Ad();oI={},wne=!1,_ne=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;zh=dTe(),pTe=zh.Agent,vTe=zh.ClientRequest,mTe=zh.IncomingMessage,gTe=zh.METHODS,bTe=zh.STATUS_CODES,yTe=zh.get,wTe=zh.globalAgent,_Te=zh.request});var kne=ht((k1t,Tne)=>{"use strict";ie();ae();ne();function j1(t){"@babel/helpers - typeof";return j1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j1(t)}function Sne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function sI(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Sne(Object(r),!0).forEach(function(a){MTe(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Sne(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function MTe(t,e,r){return e=Ane(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ene(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Ane(a.key),a)}}function STe(t,e,r){return e&&Ene(t.prototype,e),r&&Ene(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ane(t){var e=ETe(t,"string");return j1(e)=="symbol"?e:String(e)}function ETe(t,e){if(j1(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(j1(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ATe(t,e,r){return e=N4(e),RTe(t,Rne()?Reflect.construct(e,r||[],N4(t).constructor):e.apply(t,r))}function RTe(t,e){if(e&&(j1(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return TTe(t)}function TTe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Rne(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Rne=function(){return!!t})()}function N4(t){return N4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},N4(t)}function kTe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fI(t,e)}function fI(t,e){return fI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},fI(t,e)}var ITe=(aI(),ei(yne)),BTe=(xne(),ei(Mne)),OTe=Oh(),PTe=OTe.Stream,NTe=P1(),CTe=k1(),LTe=CTe.configure;Tne.exports=function(t){kTe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return xTe(this,e),r=ATe(this,e,[a]),r.options=a,r.name=a.name||"http",r.ssl=!!a.ssl,r.host=a.host||"localhost",r.port=a.port,r.auth=a.auth,r.path=a.path||"",r.maximumDepth=a.maximumDepth,r.agent=a.agent,r.headers=a.headers||{},r.headers["content-type"]="application/json",r.batch=a.batch||!1,r.batchInterval=a.batchInterval||5e3,r.batchCount=a.batchCount||10,r.batchOptions=[],r.batchTimeoutID=-1,r.batchCallback={},r.port||(r.port=r.ssl?443:80),r}return STe(e,[{key:"log",value:function(a,i){var h=this;this._request(a,null,null,function(c,p){p&&p.statusCode!==200&&(c=new Error("Invalid HTTP Status Code: ".concat(p.statusCode))),c?h.emit("warn",c):h.emit("logged",a)}),i&&setImmediate(i)}},{key:"query",value:function(a,i){typeof a=="function"&&(i=a,a={}),a={method:"query",params:this.normalizeQuery(a)};var h=a.params.auth||null;delete a.params.auth;var c=a.params.path||null;delete a.params.path,this._request(a,h,c,function(p,b,g){if(b&&b.statusCode!==200&&(p=new Error("Invalid HTTP Status Code: ".concat(b.statusCode))),p)return i(p);if(typeof g=="string")try{g=JSON.parse(g)}catch(y){return i(y)}i(null,g)})}},{key:"stream",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=new PTe;a={method:"stream",params:a};var h=a.params.path||null;delete a.params.path;var c=a.params.auth||null;delete a.params.auth;var p="",b=this._request(a,c,h);return i.destroy=function(){return b.destroy()},b.on("data",function(g){g=(p+g).split(/\n+/);for(var y=g.length-1,M=0;M<y;M++)try{i.emit("log",JSON.parse(g[M]))}catch(x){i.emit("error",x)}p=g[y]}),b.on("error",function(g){return i.emit("error",g)}),i}},{key:"_request",value:function(a,i,h,c){a=a||{},i=i||this.auth,h=h||this.path||"",this.batch?this._doBatch(a,c,i,h):this._doRequest(a,c,i,h)}},{key:"_doBatch",value:function(a,i,h,c){if(this.batchOptions.push(a),this.batchOptions.length===1){var p=this;this.batchCallback=i,this.batchTimeoutID=setTimeout(function(){p.batchTimeoutID=-1,p._doBatchRequest(p.batchCallback,h,c)},this.batchInterval)}this.batchOptions.length===this.batchCount&&this._doBatchRequest(this.batchCallback,h,c)}},{key:"_doBatchRequest",value:function(a,i,h){this.batchTimeoutID>0&&(clearTimeout(this.batchTimeoutID),this.batchTimeoutID=-1);var c=this.batchOptions.slice();this.batchOptions=[],this._doRequest(c,a,i,h)}},{key:"_doRequest",value:function(a,i,h,c){var p=Object.assign({},this.headers);h&&h.bearer&&(p.Authorization="Bearer ".concat(h.bearer));var b=(this.ssl?BTe:ITe).request(sI(sI({},this.options),{},{method:"POST",host:this.host,port:this.port,path:"/".concat(c.replace(/^\//,"")),headers:p,auth:h&&h.username&&h.password?"".concat(h.username,":").concat(h.password):"",agent:this.agent}));b.on("error",i),b.on("response",function(y){return y.on("end",function(){return i(null,y)}).resume()});var g=LTe(sI({},this.maximumDepth&&{maximumDepth:this.maximumDepth}));b.end(Me.from(g(a,this.options.replacer),"utf8"))}}]),e}(NTe)});var uI=ht((P1t,Ine)=>{"use strict";ie();ae();ne();var Du=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Du.writable=t=>Du(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Du.readable=t=>Du(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Du.duplex=t=>Du.writable(t)&&Du.readable(t);Du.transform=t=>Du.duplex(t)&&typeof t._transform=="function";Ine.exports=Du});var Nne=ht(($1t,Pne)=>{"use strict";ie();ae();ne();function z1(t){"@babel/helpers - typeof";return z1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z1(t)}function $Te(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bne(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,UTe(a.key),a)}}function DTe(t,e,r){return e&&Bne(t.prototype,e),r&&Bne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function UTe(t){var e=qTe(t,"string");return z1(e)=="symbol"?e:String(e)}function qTe(t,e){if(z1(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(z1(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function FTe(t,e,r){return e=C4(e),jTe(t,One()?Reflect.construct(e,r||[],C4(t).constructor):e.apply(t,r))}function jTe(t,e){if(e&&(z1(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zTe(t)}function zTe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function One(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(One=function(){return!!t})()}function C4(t){return C4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},C4(t)}function ZTe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hI(t,e)}function hI(t,e){return hI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},hI(t,e)}var HTe=uI(),KTe=sn(),WTe=KTe.MESSAGE,VTe=(bd(),ei(gd)),GTe=P1();Pne.exports=function(t){ZTe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if($Te(this,e),r=FTe(this,e,[a]),!a.stream||!HTe(a.stream))throw new Error("options.stream is required.");return r._stream=a.stream,r._stream.setMaxListeners(1/0),r.isObjectMode=a.stream._writableState.objectMode,r.eol=typeof a.eol=="string"?a.eol:VTe.EOL,r}return DTe(e,[{key:"log",value:function(a,i){var h=this;if(setImmediate(function(){return h.emit("logged",a)}),this.isObjectMode){this._stream.write(a),i&&i();return}this._stream.write("".concat(a[WTe]).concat(this.eol)),i&&i()}}]),e}(GTe)});var Cne=ht(f2=>{"use strict";ie();ae();ne();Object.defineProperty(f2,"Console",{configurable:!0,enumerable:!0,get:function(){return mte()}});Object.defineProperty(f2,"File",{configurable:!0,enumerable:!0,get:function(){return hne()}});Object.defineProperty(f2,"Http",{configurable:!0,enumerable:!0,get:function(){return kne()}});Object.defineProperty(f2,"Stream",{configurable:!0,enumerable:!0,get:function(){return Nne()}})});var $4=ht(u2=>{"use strict";ie();ae();ne();var L4=JT(),YTe=sn(),cI=YTe.configs;u2.cli=L4.levels(cI.cli);u2.npm=L4.levels(cI.npm);u2.syslog=L4.levels(cI.syslog);u2.addColors=L4.levels});var $ne=ht((D4,Lne)=>{"use strict";ie();ae();ne();Object.defineProperty(D4,"__esModule",{value:!0});var JTe=p4(),XTe=Od(JTe),QTe=S4(),eke=Od(QTe),tke=Uk(),rke=Od(tke),ike=Lk(),nke=Od(ike),ake=$k(),oke=Od(ake),ske=kd(),fke=Od(ske),uke=q1(),hke=Od(uke);function Od(t){return t&&t.__esModule?t:{default:t}}function cke(t,e,r){r=(0,nke.default)(r);var a=0,i=0,{length:h}=t,c=!1;h===0&&r(null);function p(b,g){b===!1&&(c=!0),c!==!0&&(b?r(b):(++i===h||g===eke.default)&&r(null))}for(;a<h;a++)e(t[a],a,(0,oke.default)(p))}function lke(t,e,r){return(0,rke.default)(t,1/0,e,r)}function dke(t,e,r){var a=(0,XTe.default)(t)?cke:lke;return a(t,(0,fke.default)(e),r)}D4.default=(0,hke.default)(dke,3);Lne.exports=D4.default});var Une=ht((U4,Dne)=>{"use strict";ie();ae();ne();Object.defineProperty(U4,"__esModule",{value:!0});U4.default=pke;function pke(t){return(e,r,a)=>t(e,a)}Dne.exports=U4.default});var j4=ht((F4,qne)=>{"use strict";ie();ae();ne();Object.defineProperty(F4,"__esModule",{value:!0});var vke=$ne(),mke=q4(vke),gke=Une(),bke=q4(gke),yke=kd(),wke=q4(yke),_ke=q1(),Mke=q4(_ke);function q4(t){return t&&t.__esModule?t:{default:t}}function xke(t,e,r){return(0,mke.default)(t,(0,bke.default)((0,wke.default)(e)),r)}F4.default=(0,Mke.default)(xke,3);qne.exports=F4.default});var jne=ht((nvt,Fne)=>{"use strict";ie();ae();ne();var Ske=Object.prototype.toString;Fne.exports=function(e){if(typeof e.displayName=="string"&&e.constructor.name)return e.displayName;if(typeof e.name=="string"&&e.name)return e.name;if(typeof e=="object"&&e.constructor&&typeof e.constructor.name=="string")return e.constructor.name;var r=e.toString(),a=Ske.call(e).slice(8,-1);return a==="Function"?r=r.substring(r.indexOf("(")+1,r.indexOf(")")):r=a,r||"anonymous"}});var lI=ht((fvt,zne)=>{"use strict";ie();ae();ne();var Eke=jne();zne.exports=function(e){var r=0,a;function i(){return r||(r=1,a=e.apply(this,arguments),e=null),a}return i.displayName=Eke(e),i}});var dI=ht(c2=>{"use strict";ie();ae();ne();c2.get=function(t){var e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var r={},a=Error.prepareStackTrace;Error.prepareStackTrace=function(h,c){return c},Error.captureStackTrace(r,t||c2.get);var i=r.stack;return Error.prepareStackTrace=a,Error.stackTraceLimit=e,i};c2.parse=function(t){if(!t.stack)return[];var e=this,r=t.stack.split(`
113
+ `," "]),Ak=["'"].concat(lMe),gre=["%","/","?",";","#"].concat(Ak),bre=["/","?","#"],yre=/^[+a-z0-9A-Z_-]{0,63}$/,dMe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,pMe={javascript:!0,"javascript:":!0},xk={javascript:!0,"javascript:":!0},L1={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Sk=Cu;Ps.prototype.parse=function(t,e,r){if(!Lu.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var a=t.indexOf("?"),i=a!==-1&&a<t.indexOf("#")?"?":"#",h=t.split(i);h[0]=h[0].replace(/\\/g,"/");var c=t=h.join(i);if(c=c.trim(),!r&&t.split("#").length===1){var p=cMe.exec(c);if(p)return this.path=c,this.href=c,this.pathname=p[1],p[2]?(this.search=p[2],this.query=e?Sk.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var b=uMe.exec(c);if(b){var g=(b=b[0]).toLowerCase();this.protocol=g,c=c.substr(b.length)}if(r||b||c.match(/^\/\/[^@\/]+@[^@\/]+/)){var y=c.substr(0,2)==="//";!y||b&&xk[b]||(c=c.substr(2),this.slashes=!0)}if(!xk[b]&&(y||b&&!L1[b])){for(var M,x,E=-1,A=0;A<bre.length;A++)(k=c.indexOf(bre[A]))!==-1&&(E===-1||k<E)&&(E=k);for((x=E===-1?c.lastIndexOf("@"):c.lastIndexOf("@",E))!==-1&&(M=c.slice(0,x),c=c.slice(x+1),this.auth=decodeURIComponent(M)),E=-1,A=0;A<gre.length;A++){var k;(k=c.indexOf(gre[A]))!==-1&&(E===-1||k<E)&&(E=k)}E===-1&&(E=c.length),this.host=c.slice(0,E),c=c.slice(E),this.parseHost(),this.hostname=this.hostname||"";var O=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!O)for(var N=this.hostname.split(/\./),L=(A=0,N.length);A<L;A++){var C=N[A];if(C&&!C.match(yre)){for(var Y="",G=0,ee=C.length;G<ee;G++)C.charCodeAt(G)>127?Y+="x":Y+=C[G];if(!Y.match(yre)){var $=N.slice(0,A),q=N.slice(A+1),V=C.match(dMe);V&&($.push(V[1]),q.unshift(V[2])),q.length&&(c="/"+q.join(".")+c),this.hostname=$.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=fMe.toASCII(this.hostname));var _=this.port?":"+this.port:"",n=this.hostname||"";this.host=n+_,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),c[0]!=="/"&&(c="/"+c))}if(!pMe[g])for(A=0,L=Ak.length;A<L;A++){var s=Ak[A];if(c.indexOf(s)!==-1){var f=encodeURIComponent(s);f===s&&(f=escape(s)),c=c.split(s).join(f)}}var u=c.indexOf("#");u!==-1&&(this.hash=c.substr(u),c=c.slice(0,u));var l=c.indexOf("?");if(l!==-1?(this.search=c.substr(l),this.query=c.substr(l+1),e&&(this.query=Sk.parse(this.query)),c=c.slice(0,l)):e&&(this.search="",this.query={}),c&&(this.pathname=c),L1[g]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){_=this.pathname||"";var m=this.search||"";this.path=_+m}return this.href=this.format(),this},Ps.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",a=this.hash||"",i=!1,h="";this.host?i=t+this.host:this.hostname&&(i=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&Lu.isObject(this.query)&&Object.keys(this.query).length&&(h=Sk.stringify(this.query));var c=this.search||h&&"?"+h||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||L1[e])&&i!==!1?(i="//"+(i||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):i||(i=""),a&&a.charAt(0)!=="#"&&(a="#"+a),c&&c.charAt(0)!=="?"&&(c="?"+c),e+i+(r=r.replace(/[?#]/g,function(p){return encodeURIComponent(p)}))+(c=c.replace("#","%23"))+a},Ps.prototype.resolve=function(t){return this.resolveObject(e2(t,!1,!0)).format()},Ps.prototype.resolveObject=function(t){if(Lu.isString(t)){var e=new Ps;e.parse(t,!1,!0),t=e}for(var r=new Ps,a=Object.keys(this),i=0;i<a.length;i++){var h=a[i];r[h]=this[h]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var c=Object.keys(t),p=0;p<c.length;p++){var b=c[p];b!=="protocol"&&(r[b]=t[b])}return L1[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!L1[t.protocol]){for(var g=Object.keys(t),y=0;y<g.length;y++){var M=g[y];r[M]=t[M]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||xk[t.protocol])r.pathname=t.pathname;else{for(var x=(t.pathname||"").split("/");x.length&&!(t.host=x.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),x[0]!==""&&x.unshift(""),x.length<2&&x.unshift(""),r.pathname=x.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var E=r.pathname||"",A=r.search||"";r.path=E+A}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var k=r.pathname&&r.pathname.charAt(0)==="/",O=t.host||t.pathname&&t.pathname.charAt(0)==="/",N=O||k||r.host&&t.pathname,L=N,C=r.pathname&&r.pathname.split("/")||[],Y=(x=t.pathname&&t.pathname.split("/")||[],r.protocol&&!L1[r.protocol]);if(Y&&(r.hostname="",r.port=null,r.host&&(C[0]===""?C[0]=r.host:C.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(x[0]===""?x[0]=t.host:x.unshift(t.host)),t.host=null),N=N&&(x[0]===""||C[0]==="")),O)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,C=x;else if(x.length)C||(C=[]),C.pop(),C=C.concat(x),r.search=t.search,r.query=t.query;else if(!Lu.isNullOrUndefined(t.search))return Y&&(r.hostname=r.host=C.shift(),(V=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=V.shift(),r.host=r.hostname=V.shift())),r.search=t.search,r.query=t.query,Lu.isNull(r.pathname)&&Lu.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!C.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var G=C.slice(-1)[0],ee=(r.host||t.host||C.length>1)&&(G==="."||G==="..")||G==="",$=0,q=C.length;q>=0;q--)(G=C[q])==="."?C.splice(q,1):G===".."?(C.splice(q,1),$++):$&&(C.splice(q,1),$--);if(!N&&!L)for(;$--;$)C.unshift("..");!N||C[0]===""||C[0]&&C[0].charAt(0)==="/"||C.unshift(""),ee&&C.join("/").substr(-1)!=="/"&&C.push("");var V,_=C[0]===""||C[0]&&C[0].charAt(0)==="/";return Y&&(r.hostname=r.host=_?"":C.length?C.shift():"",(V=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=V.shift(),r.host=r.hostname=V.shift())),(N=N||r.host&&C.length)&&!_&&C.unshift(""),C.length?r.pathname=C.join("/"):(r.pathname=null,r.path=null),Lu.isNull(r.pathname)&&Lu.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},Ps.prototype.parseHost=function(){var t=this.host,e=hMe.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};vi.Url;vi.format;vi.resolve;vi.resolveObject;Ek={},wre=!1;_re=vMe(),mMe=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;vi.URL=typeof URL<"u"?URL:null;vi.pathToFileURL=IMe;vi.fileURLToPath=RMe;vi.Url;vi.format;vi.resolve;vi.resolveObject;vi.URL;gMe=92,bMe=47,yMe=97,wMe=122,Rk=mMe==="win32",_Me=/\//g,MMe=/%/g,xMe=/\\/g,SMe=/\n/g,EMe=/\r/g,AMe=/\t/g;BMe=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;vi.URL=typeof URL<"u"?URL:null;vi.pathToFileURL=ZMe;vi.fileURLToPath=kk;L0t=vi.Url,$0t=vi.format,D0t=vi.resolve,U0t=vi.resolveObject,q0t=vi.parse,F0t=vi.URL,OMe=92,PMe=47,NMe=97,CMe=122,Tk=BMe==="win32",LMe=/\//g,$Me=/%/g,DMe=/\\/g,UMe=/\n/g,qMe=/\r/g,FMe=/\t/g});var Pk={};Ha(Pk,{Dir:()=>NSe,Dirent:()=>CSe,F_OK:()=>jSe,FileReadStream:()=>USe,FileWriteStream:()=>qSe,R_OK:()=>zSe,ReadStream:()=>$Se,Stats:()=>LSe,W_OK:()=>ZSe,WriteStream:()=>DSe,X_OK:()=>HSe,_toUnixTimestamp:()=>FSe,access:()=>sxe,accessSync:()=>fxe,appendFile:()=>axe,appendFileSync:()=>oxe,chmod:()=>cxe,chmodSync:()=>lxe,chown:()=>uxe,chownSync:()=>hxe,close:()=>dxe,closeSync:()=>pxe,constants:()=>KSe,copyFile:()=>vxe,copyFileSync:()=>mxe,cp:()=>gxe,cpSync:()=>bxe,createReadStream:()=>yxe,createWriteStream:()=>wxe,default:()=>Gi,exists:()=>_xe,existsSync:()=>Kre,fchmod:()=>Sxe,fchmodSync:()=>Exe,fchown:()=>Mxe,fchownSync:()=>xxe,fdatasync:()=>Axe,fdatasyncSync:()=>Rxe,fstat:()=>Txe,fstatSync:()=>kxe,fsync:()=>Ixe,fsyncSync:()=>Bxe,ftruncate:()=>Oxe,ftruncateSync:()=>Pxe,futimes:()=>Nxe,futimesSync:()=>Cxe,lchmod:()=>Dxe,lchmodSync:()=>Uxe,lchown:()=>Lxe,lchownSync:()=>$xe,link:()=>qxe,linkSync:()=>Fxe,lstat:()=>jxe,lstatSync:()=>zxe,mkdir:()=>Zxe,mkdirSync:()=>Hxe,mkdtemp:()=>Kxe,mkdtempSync:()=>Wxe,open:()=>Vxe,openSync:()=>Gxe,opendir:()=>Yxe,opendirSync:()=>Jxe,promises:()=>WSe,read:()=>eSe,readFile:()=>nSe,readFileSync:()=>aSe,readSync:()=>tSe,readdir:()=>Xxe,readdirSync:()=>Qxe,readlink:()=>oSe,readlinkSync:()=>sSe,readv:()=>rSe,readvSync:()=>iSe,realpath:()=>fSe,realpathSync:()=>uSe,rename:()=>hSe,renameSync:()=>cSe,rm:()=>lSe,rmSync:()=>dSe,rmdir:()=>pSe,rmdirSync:()=>vSe,stat:()=>mSe,statSync:()=>gSe,symlink:()=>bSe,symlinkSync:()=>ySe,truncate:()=>wSe,truncateSync:()=>_Se,unlink:()=>xSe,unlinkSync:()=>SSe,unwatchFile:()=>MSe,utimes:()=>ESe,utimesSync:()=>ASe,watch:()=>RSe,watchFile:()=>TSe,write:()=>ISe,writeFile:()=>kSe,writeFileSync:()=>Wre,writeSync:()=>BSe,writev:()=>OSe,writevSync:()=>PSe});function i2(){return Mre||(Mre=!0,Object.defineProperty(t2,"__esModule",{value:!0}),t2.constants=void 0,t2.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}),t2}function HMe(){return xre||(xre=!0,typeof BigInt=="function"?h4.default=BigInt:h4.default=function(){throw new Error("BigInt is not supported in this environment.")}),h4}function Ik(){if(Sre)return $1;Sre=!0,Object.defineProperty($1,"__esModule",{value:!0}),$1.Stats=void 0;var t=i2(),e=HMe(),r=t.constants.S_IFMT,a=t.constants.S_IFDIR,i=t.constants.S_IFREG,h=t.constants.S_IFBLK,c=t.constants.S_IFCHR,p=t.constants.S_IFLNK,b=t.constants.S_IFIFO,g=t.constants.S_IFSOCK,y=function(){function M(){}return M.build=function(x,E){E===void 0&&(E=!1);var A=new M,k=x.uid,O=x.gid,N=x.atime,L=x.mtime,C=x.ctime,Y=E?e.default:function(ee){return ee};A.uid=Y(k),A.gid=Y(O),A.rdev=Y(0),A.blksize=Y(4096),A.ino=Y(x.ino),A.size=Y(x.getSize()),A.blocks=Y(1),A.atime=N,A.mtime=L,A.ctime=C,A.birthtime=C,A.atimeMs=Y(N.getTime()),A.mtimeMs=Y(L.getTime());var G=Y(C.getTime());return A.ctimeMs=G,A.birthtimeMs=G,A.dev=Y(0),A.mode=Y(x.mode),A.nlink=Y(x.nlink),A},M.prototype._checkModeProperty=function(x){return(Number(this.mode)&r)===x},M.prototype.isDirectory=function(){return this._checkModeProperty(a)},M.prototype.isFile=function(){return this._checkModeProperty(i)},M.prototype.isBlockDevice=function(){return this._checkModeProperty(h)},M.prototype.isCharacterDevice=function(){return this._checkModeProperty(c)},M.prototype.isSymbolicLink=function(){return this._checkModeProperty(p)},M.prototype.isFIFO=function(){return this._checkModeProperty(b)},M.prototype.isSocket=function(){return this._checkModeProperty(g)},M}();return $1.Stats=y,$1.default=y,$1}function Bk(){if(Ere)return Bf;Ere=!0;var t=Bf&&Bf.__spreadArray||function(h,c,p){if(p||arguments.length===2)for(var b=0,g=c.length,y;b<g;b++)(y||!(b in c))&&(y||(y=Array.prototype.slice.call(c,0,b)),y[b]=c[b]);return h.concat(y||Array.prototype.slice.call(c))};Object.defineProperty(Bf,"__esModule",{value:!0}),Bf.bufferFrom=Bf.bufferAllocUnsafe=Bf.Buffer=void 0;var e=ni;Object.defineProperty(Bf,"Buffer",{enumerable:!0,get:function(){return e.Buffer}});function r(h){for(var c=[],p=1;p<arguments.length;p++)c[p-1]=arguments[p];return new(e.Buffer.bind.apply(e.Buffer,t([void 0,h],c,!1)))}var a=e.Buffer.allocUnsafe||r;Bf.bufferAllocUnsafe=a;var i=e.Buffer.from||r;return Bf.bufferFrom=i,Bf}function Ure(){if(Are)return qn;Are=!0;var t=qn&&qn.__extends||function(){var A=function(k,O){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,L){N.__proto__=L}||function(N,L){for(var C in L)Object.prototype.hasOwnProperty.call(L,C)&&(N[C]=L[C])},A(k,O)};return function(k,O){if(typeof O!="function"&&O!==null)throw new TypeError("Class extends value "+String(O)+" is not a constructor or null");A(k,O);function N(){this.constructor=k}k.prototype=O===null?Object.create(O):(N.prototype=O.prototype,new N)}}();Object.defineProperty(qn,"__esModule",{value:!0}),qn.E=qn.AssertionError=qn.message=qn.RangeError=qn.TypeError=qn.Error=void 0;var e=ar,r=gt,a=typeof Symbol>"u"?"_kCode":Symbol("code"),i={};function h(A){return function(k){t(O,k);function O(N){for(var L=[],C=1;C<arguments.length;C++)L[C-1]=arguments[C];var Y=k.call(this,b(N,L))||this;return Y.code=N,Y[a]=N,Y.name=k.prototype.name+" ["+Y[a]+"]",Y}return O}(A)}var c=typeof globalThis<"u"?globalThis:KMe,p=function(A){t(k,A);function k(O){var N=this;if(typeof O!="object"||O===null)throw new qn.TypeError("ERR_INVALID_ARG_TYPE","options","object");return O.message?N=A.call(this,O.message)||this:N=A.call(this,r.inspect(O.actual).slice(0,128)+" "+(O.operator+" "+r.inspect(O.expected).slice(0,128)))||this,N.generatedMessage=!O.message,N.name="AssertionError [ERR_ASSERTION]",N.code="ERR_ASSERTION",N.actual=O.actual,N.expected=O.expected,N.operator=O.operator,qn.Error.captureStackTrace(N,O.stackStartFunction),N}return k}(c.Error);qn.AssertionError=p;function b(A,k){e.strictEqual(typeof A,"string");var O=i[A];e(O,"An invalid error message key was used: "+A+".");var N;if(typeof O=="function")N=O;else{if(N=r.format,k===void 0||k.length===0)return O;k.unshift(O)}return String(N.apply(null,k))}qn.message=b;function g(A,k){i[A]=typeof k=="function"?k:String(k)}qn.E=g,qn.Error=h(c.Error),qn.TypeError=h(c.TypeError),qn.RangeError=h(c.RangeError),g("ERR_ARG_NOT_ITERABLE","%s must be iterable"),g("ERR_ASSERTION","%s"),g("ERR_BUFFER_OUT_OF_BOUNDS",E),g("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received"),g("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s"),g("ERR_CPU_USAGE","Unable to obtain cpu usage %s"),g("ERR_DNS_SET_SERVERS_FAILED",function(A,k){return'c-ares failed to set servers: "'+A+'" ['+k+"]"}),g("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value"),g("ERR_ENCODING_NOT_SUPPORTED",function(A){return'The "'+A+'" encoding is not supported'}),g("ERR_ENCODING_INVALID_ENCODED_DATA",function(A){return"The encoded data was not valid for encoding "+A}),g("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client"),g("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s"),g("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding"),g("ERR_INDEX_OUT_OF_RANGE","Index out of range"),g("ERR_INVALID_ARG_TYPE",y),g("ERR_INVALID_ARRAY_LENGTH",function(A,k,O){return e.strictEqual(typeof O,"number"),'The array "'+A+'" (length '+O+") must be of length "+k+"."}),g("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s"),g("ERR_INVALID_CALLBACK","Callback must be a function"),g("ERR_INVALID_CHAR","Invalid character in %s"),g("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column"),g("ERR_INVALID_FD",'"fd" must be a positive integer: %s'),g("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s'),g("ERR_INVALID_FILE_URL_PATH","File URL path %s"),g("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent"),g("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s"),g("ERR_INVALID_OPT_VALUE",function(A,k){return'The value "'+String(k)+'" is invalid for option "'+A+'"'}),g("ERR_INVALID_OPT_VALUE_ENCODING",function(A){return'The value "'+String(A)+'" is invalid for option "encoding"'}),g("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL'),g("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s"),g("ERR_INVALID_THIS",'Value of "this" must be of type %s'),g("ERR_INVALID_TUPLE","%s must be an iterable %s tuple"),g("ERR_INVALID_URL","Invalid URL: %s"),g("ERR_INVALID_URL_SCHEME",function(A){return"The URL must be "+x(A,"scheme")}),g("ERR_IPC_CHANNEL_CLOSED","Channel closed"),g("ERR_IPC_DISCONNECTED","IPC channel is already disconnected"),g("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe"),g("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks"),g("ERR_MISSING_ARGS",M),g("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),g("ERR_NAPI_CONS_FUNCTION","Constructor must be a function"),g("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object"),g("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support"),g("ERR_NO_LONGER_SUPPORTED","%s is no longer supported"),g("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s"),g("ERR_SOCKET_ALREADY_BOUND","Socket is already bound"),g("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536"),g("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6"),g("ERR_SOCKET_CANNOT_SEND","Unable to send data"),g("ERR_SOCKET_CLOSED","Socket is closed"),g("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running"),g("ERR_STDERR_CLOSE","process.stderr cannot be closed"),g("ERR_STDOUT_CLOSE","process.stdout cannot be closed"),g("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode"),g("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s"),g("ERR_TLS_DH_PARAM_SIZE",function(A){return"DH parameter size "+A+" is less than 2048"}),g("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout"),g("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate"),g("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext'),g("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected"),g("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming"),g("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0"),g("ERR_UNKNOWN_ENCODING","Unknown encoding: %s"),g("ERR_UNKNOWN_SIGNAL","Unknown signal: %s"),g("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type"),g("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type"),g("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl");function y(A,k,O){e(A,"name is required");var N;k.includes("not ")?(N="must not be",k=k.split("not ")[1]):N="must be";var L;if(Array.isArray(A)){var C=A.map(function(G){return'"'+G+'"'}).join(", ");L="The "+C+" arguments "+N+" "+x(k,"type")}else if(A.includes(" argument"))L="The "+A+" "+N+" "+x(k,"type");else{var Y=A.includes(".")?"property":"argument";L='The "'+A+'" '+Y+" "+N+" "+x(k,"type")}return arguments.length>=3&&(L+=". Received type "+(O!==null?typeof O:"null")),L}function M(){for(var A=[],k=0;k<arguments.length;k++)A[k]=arguments[k];e(A.length>0,"At least one arg needs to be specified");var O="The ",N=A.length;switch(A=A.map(function(L){return'"'+L+'"'}),N){case 1:O+=A[0]+" argument";break;case 2:O+=A[0]+" and "+A[1]+" arguments";break;default:O+=A.slice(0,N-1).join(", "),O+=", and "+A[N-1]+" arguments";break}return O+" must be specified"}function x(A,k){if(e(A,"expected is required"),e(typeof k=="string","thing is required"),Array.isArray(A)){var O=A.length;return e(O>0,"At least one expected value needs to be specified"),A=A.map(function(N){return String(N)}),O>2?"one of "+k+" "+A.slice(0,O-1).join(", ")+", or "+A[O-1]:O===2?"one of "+k+" "+A[0]+" or "+A[1]:"of "+k+" "+A[0]}else return"of "+k+" "+String(A)}function E(A,k){return k?"Attempt to write outside buffer bounds":'"'+A+'" is outside of buffer bounds'}return qn}function qre(){if(Rre)return $u;Rre=!0,Object.defineProperty($u,"__esModule",{value:!0}),$u.strToEncoding=$u.assertEncoding=$u.ENCODING_UTF8=void 0;var t=Bk(),e=Ure();$u.ENCODING_UTF8="utf8";function r(i){if(i&&!t.Buffer.isEncoding(i))throw new e.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",i)}$u.assertEncoding=r;function a(i,h){return!h||h===$u.ENCODING_UTF8?i:h==="buffer"?new t.Buffer(i):new t.Buffer(i).toString(h)}return $u.strToEncoding=a,$u}function Fre(){if(Tre)return D1;Tre=!0,Object.defineProperty(D1,"__esModule",{value:!0}),D1.Dirent=void 0;var t=i2(),e=qre(),r=t.constants.S_IFMT,a=t.constants.S_IFDIR,i=t.constants.S_IFREG,h=t.constants.S_IFBLK,c=t.constants.S_IFCHR,p=t.constants.S_IFLNK,b=t.constants.S_IFIFO,g=t.constants.S_IFSOCK,y=function(){function M(){this.name="",this.mode=0}return M.build=function(x,E){var A=new M,k=x.getNode().mode;return A.name=(0,e.strToEncoding)(x.getName(),E),A.mode=k,A},M.prototype._checkModeProperty=function(x){return(this.mode&r)===x},M.prototype.isDirectory=function(){return this._checkModeProperty(a)},M.prototype.isFile=function(){return this._checkModeProperty(i)},M.prototype.isBlockDevice=function(){return this._checkModeProperty(h)},M.prototype.isCharacterDevice=function(){return this._checkModeProperty(c)},M.prototype.isSymbolicLink=function(){return this._checkModeProperty(p)},M.prototype.isFIFO=function(){return this._checkModeProperty(b)},M.prototype.isSocket=function(){return this._checkModeProperty(g)},M}();return D1.Dirent=y,D1.default=y,D1}function jre(){if(kre)return c4;kre=!0;var t=yr;Object.defineProperty(c4,"__esModule",{value:!0});var e;return typeof t.nextTick=="function"?e=t.nextTick.bind(typeof globalThis<"u"?globalThis:Ire):e=setTimeout.bind(typeof globalThis<"u"?globalThis:Ire),c4.default=e,c4}function zre(){if(Bre)return U1;Bre=!0;var t=yr;Object.defineProperty(U1,"__esModule",{value:!0}),U1.createProcess=void 0;var e=function(){if(typeof t<"u")return t;try{return yr}catch{return}};function r(){var a=e()||{};return a.getuid||(a.getuid=function(){return 0}),a.getgid||(a.getgid=function(){return 0}),a.cwd||(a.cwd=function(){return"/"}),a.nextTick||(a.nextTick=jre().default),a.emitWarning||(a.emitWarning=function(i,h){console.warn(""+h+(h?": ":"")+i)}),a.env||(a.env={}),a}return U1.createProcess=r,U1.default=r(),U1}function WMe(){if(Ore)return so;Ore=!0;var t=so&&so.__extends||function(){var A=function(k,O){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,L){N.__proto__=L}||function(N,L){for(var C in L)Object.prototype.hasOwnProperty.call(L,C)&&(N[C]=L[C])},A(k,O)};return function(k,O){if(typeof O!="function"&&O!==null)throw new TypeError("Class extends value "+String(O)+" is not a constructor or null");A(k,O);function N(){this.constructor=k}k.prototype=O===null?Object.create(O):(N.prototype=O.prototype,new N)}}();Object.defineProperty(so,"__esModule",{value:!0}),so.File=so.Link=so.Node=so.SEP=void 0;var e=zre(),r=Bk(),a=i2(),i=Ei,h=Ik(),c=a.constants.S_IFMT,p=a.constants.S_IFDIR,b=a.constants.S_IFREG,g=a.constants.S_IFLNK,y=a.constants.O_APPEND;so.SEP="/";var M=function(A){t(k,A);function k(O,N){N===void 0&&(N=438);var L=A.call(this)||this;return L.uid=e.default.getuid(),L.gid=e.default.getgid(),L.atime=new Date,L.mtime=new Date,L.ctime=new Date,L.perm=438,L.mode=b,L.nlink=1,L.perm=N,L.mode|=N,L.ino=O,L}return k.prototype.getString=function(O){return O===void 0&&(O="utf8"),this.getBuffer().toString(O)},k.prototype.setString=function(O){this.buf=(0,r.bufferFrom)(O,"utf8"),this.touch()},k.prototype.getBuffer=function(){return this.buf||this.setBuffer((0,r.bufferAllocUnsafe)(0)),(0,r.bufferFrom)(this.buf)},k.prototype.setBuffer=function(O){this.buf=(0,r.bufferFrom)(O),this.touch()},k.prototype.getSize=function(){return this.buf?this.buf.length:0},k.prototype.setModeProperty=function(O){this.mode=this.mode&~c|O},k.prototype.setIsFile=function(){this.setModeProperty(b)},k.prototype.setIsDirectory=function(){this.setModeProperty(p)},k.prototype.setIsSymlink=function(){this.setModeProperty(g)},k.prototype.isFile=function(){return(this.mode&c)===b},k.prototype.isDirectory=function(){return(this.mode&c)===p},k.prototype.isSymlink=function(){return(this.mode&c)===g},k.prototype.makeSymlink=function(O){this.symlink=O,this.setIsSymlink()},k.prototype.write=function(O,N,L,C){if(N===void 0&&(N=0),L===void 0&&(L=O.length),C===void 0&&(C=0),this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0)),C+L>this.buf.length){var Y=(0,r.bufferAllocUnsafe)(C+L);this.buf.copy(Y,0,0,this.buf.length),this.buf=Y}return O.copy(this.buf,C,N,N+L),this.touch(),L},k.prototype.read=function(O,N,L,C){N===void 0&&(N=0),L===void 0&&(L=O.byteLength),C===void 0&&(C=0),this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0));var Y=L;return Y>O.byteLength&&(Y=O.byteLength),Y+C>this.buf.length&&(Y=this.buf.length-C),this.buf.copy(O,N,C,C+Y),Y},k.prototype.truncate=function(O){if(O===void 0&&(O=0),!O)this.buf=(0,r.bufferAllocUnsafe)(0);else if(this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0)),O<=this.buf.length)this.buf=this.buf.slice(0,O);else{var N=(0,r.bufferAllocUnsafe)(0);this.buf.copy(N),N.fill(0,O)}this.touch()},k.prototype.chmod=function(O){this.perm=O,this.mode=this.mode&-512|O,this.touch()},k.prototype.chown=function(O,N){this.uid=O,this.gid=N,this.touch()},k.prototype.touch=function(){this.mtime=new Date,this.emit("change",this)},k.prototype.canRead=function(O,N){return O===void 0&&(O=e.default.getuid()),N===void 0&&(N=e.default.getgid()),!!(this.perm&4||N===this.gid&&this.perm&32||O===this.uid&&this.perm&256)},k.prototype.canWrite=function(O,N){return O===void 0&&(O=e.default.getuid()),N===void 0&&(N=e.default.getgid()),!!(this.perm&2||N===this.gid&&this.perm&16||O===this.uid&&this.perm&128)},k.prototype.del=function(){this.emit("delete",this)},k.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}},k}(i.EventEmitter);so.Node=M;var x=function(A){t(k,A);function k(O,N,L){var C=A.call(this)||this;return C.children={},C.steps=[],C.ino=0,C.length=0,C.vol=O,C.parent=N,C.steps=N?N.steps.concat([L]):[L],C}return k.prototype.setNode=function(O){this.node=O,this.ino=O.ino},k.prototype.getNode=function(){return this.node},k.prototype.createChild=function(O,N){N===void 0&&(N=this.vol.createNode());var L=new k(this.vol,this,O);return L.setNode(N),N.isDirectory(),this.setChild(O,L),L},k.prototype.setChild=function(O,N){return N===void 0&&(N=new k(this.vol,this,O)),this.children[O]=N,N.parent=this,this.length++,this.emit("child:add",N,this),N},k.prototype.deleteChild=function(O){delete this.children[O.getName()],this.length--,this.emit("child:delete",O,this)},k.prototype.getChild=function(O){if(Object.hasOwnProperty.call(this.children,O))return this.children[O]},k.prototype.getPath=function(){return this.steps.join(so.SEP)},k.prototype.getName=function(){return this.steps[this.steps.length-1]},k.prototype.walk=function(O,N,L){if(N===void 0&&(N=O.length),L===void 0&&(L=0),L>=O.length)return this;if(L>=N)return this;var C=O[L],Y=this.getChild(C);return Y?Y.walk(O,N,L+1):null},k.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}},k}(i.EventEmitter);so.Link=x;var E=function(){function A(k,O,N,L){this.position=0,this.link=k,this.node=O,this.flags=N,this.fd=L}return A.prototype.getString=function(k){return this.node.getString()},A.prototype.setString=function(k){this.node.setString(k)},A.prototype.getBuffer=function(){return this.node.getBuffer()},A.prototype.setBuffer=function(k){this.node.setBuffer(k)},A.prototype.getSize=function(){return this.node.getSize()},A.prototype.truncate=function(k){this.node.truncate(k)},A.prototype.seekTo=function(k){this.position=k},A.prototype.stats=function(){return h.default.build(this.node)},A.prototype.write=function(k,O,N,L){O===void 0&&(O=0),N===void 0&&(N=k.length),typeof L!="number"&&(L=this.position),this.flags&y&&(L=this.getSize());var C=this.node.write(k,O,N,L);return this.position=L+C,C},A.prototype.read=function(k,O,N,L){O===void 0&&(O=0),N===void 0&&(N=k.byteLength),typeof L!="number"&&(L=this.position);var C=this.node.read(k,O,N,L);return this.position=L+C,C},A.prototype.chmod=function(k){this.node.chmod(k)},A.prototype.chown=function(k,O){this.node.chown(k,O)},A}();return so.File=E,so}function GMe(){if(Pre)return l4;Pre=!0,Object.defineProperty(l4,"__esModule",{value:!0});function t(e,r,a){var i=setTimeout.apply(typeof globalThis<"u"?globalThis:VMe,arguments);return i&&typeof i=="object"&&typeof i.unref=="function"&&i.unref(),i}return l4.default=t,l4}function YMe(){if(Nre)return gl;Nre=!0;var t=gl&&gl.__spreadArray||function(i,h,c){if(c||arguments.length===2)for(var p=0,b=h.length,g;p<b;p++)(g||!(p in h))&&(g||(g=Array.prototype.slice.call(h,0,p)),g[p]=h[p]);return i.concat(g||Array.prototype.slice.call(h))};Object.defineProperty(gl,"__esModule",{value:!0}),gl.FileHandle=void 0;function e(i,h,c){return c===void 0&&(c=function(p){return p}),function(){for(var p=[],b=0;b<arguments.length;b++)p[b]=arguments[b];return new Promise(function(g,y){i[h].bind(i).apply(void 0,t(t([],p,!1),[function(M,x){return M?y(M):g(c(x))}],!1))})}}var r=function(){function i(h,c){this.vol=h,this.fd=c}return i.prototype.appendFile=function(h,c){return e(this.vol,"appendFile")(this.fd,h,c)},i.prototype.chmod=function(h){return e(this.vol,"fchmod")(this.fd,h)},i.prototype.chown=function(h,c){return e(this.vol,"fchown")(this.fd,h,c)},i.prototype.close=function(){return e(this.vol,"close")(this.fd)},i.prototype.datasync=function(){return e(this.vol,"fdatasync")(this.fd)},i.prototype.read=function(h,c,p,b){return e(this.vol,"read",function(g){return{bytesRead:g,buffer:h}})(this.fd,h,c,p,b)},i.prototype.readFile=function(h){return e(this.vol,"readFile")(this.fd,h)},i.prototype.stat=function(h){return e(this.vol,"fstat")(this.fd,h)},i.prototype.sync=function(){return e(this.vol,"fsync")(this.fd)},i.prototype.truncate=function(h){return e(this.vol,"ftruncate")(this.fd,h)},i.prototype.utimes=function(h,c){return e(this.vol,"futimes")(this.fd,h,c)},i.prototype.write=function(h,c,p,b){return e(this.vol,"write",function(g){return{bytesWritten:g,buffer:h}})(this.fd,h,c,p,b)},i.prototype.writeFile=function(h,c){return e(this.vol,"writeFile")(this.fd,h,c)},i}();gl.FileHandle=r;function a(i){return typeof Promise>"u"?null:{FileHandle:r,access:function(h,c){return e(i,"access")(h,c)},appendFile:function(h,c,p){return e(i,"appendFile")(h instanceof r?h.fd:h,c,p)},chmod:function(h,c){return e(i,"chmod")(h,c)},chown:function(h,c,p){return e(i,"chown")(h,c,p)},copyFile:function(h,c,p){return e(i,"copyFile")(h,c,p)},lchmod:function(h,c){return e(i,"lchmod")(h,c)},lchown:function(h,c,p){return e(i,"lchown")(h,c,p)},link:function(h,c){return e(i,"link")(h,c)},lstat:function(h,c){return e(i,"lstat")(h,c)},mkdir:function(h,c){return e(i,"mkdir")(h,c)},mkdtemp:function(h,c){return e(i,"mkdtemp")(h,c)},open:function(h,c,p){return e(i,"open",function(b){return new r(i,b)})(h,c,p)},readdir:function(h,c){return e(i,"readdir")(h,c)},readFile:function(h,c){return e(i,"readFile")(h instanceof r?h.fd:h,c)},readlink:function(h,c){return e(i,"readlink")(h,c)},realpath:function(h,c){return e(i,"realpath")(h,c)},rename:function(h,c){return e(i,"rename")(h,c)},rmdir:function(h){return e(i,"rmdir")(h)},stat:function(h,c){return e(i,"stat")(h,c)},symlink:function(h,c,p){return e(i,"symlink")(h,c,p)},truncate:function(h,c){return e(i,"truncate")(h,c)},unlink:function(h){return e(i,"unlink")(h)},utimes:function(h,c,p){return e(i,"utimes")(h,c,p)},writeFile:function(h,c,p){return e(i,"writeFile")(h instanceof r?h.fd:h,c,p)}}}return gl.default=a,gl}function JMe(){if(Cre)return r2;Cre=!0;var t=yr;Object.defineProperty(r2,"__esModule",{value:!0}),r2.unixify=h,r2.correctPath=c;var e=t.platform==="win32";function r(p){var b=p.length-1;if(b<2)return p;for(;a(p,b);)b--;return p.substr(0,b+1)}function a(p,b){var g=p[b];return b>0&&(g==="/"||e&&g==="\\")}function i(p,b){if(typeof p!="string")throw new TypeError("expected a string");return p=p.replace(/[\\\/]+/g,"/"),b!==!1&&(p=r(p)),p}function h(p){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e?(p=i(p,b),p.replace(/^([a-zA-Z]+:|\.\/)/,"")):p}function c(p){return h(p.replace(/^\\\\\?\\.:\\/,"\\"))}return r2}function Zre(){if(Lre)return ui;Lre=!0;var t=ui&&ui.__extends||function(){var Ke=function(ve,we){return Ke=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ze,rt){ze.__proto__=rt}||function(ze,rt){for(var ft in rt)Object.prototype.hasOwnProperty.call(rt,ft)&&(ze[ft]=rt[ft])},Ke(ve,we)};return function(ve,we){if(typeof we!="function"&&we!==null)throw new TypeError("Class extends value "+String(we)+" is not a constructor or null");Ke(ve,we);function ze(){this.constructor=ve}ve.prototype=we===null?Object.create(we):(ze.prototype=we.prototype,new ze)}}(),e=ui&&ui.__spreadArray||function(Ke,ve,we){if(we||arguments.length===2)for(var ze=0,rt=ve.length,ft;ze<rt;ze++)(ft||!(ze in ve))&&(ft||(ft=Array.prototype.slice.call(ve,0,ze)),ft[ze]=ve[ze]);return Ke.concat(ft||Array.prototype.slice.call(ve))};Object.defineProperty(ui,"__esModule",{value:!0}),ui.FSWatcher=ui.StatWatcher=ui.Volume=ui.toUnixTimestamp=ui.bufferToEncoding=ui.dataToBuffer=ui.dataToStr=ui.pathToSteps=ui.filenameToSteps=ui.pathToFilename=ui.flagsToNumber=ui.FLAGS=void 0;var r=fn,a=WMe(),i=Ik(),h=Fre(),c=Bk(),p=jre(),b=zre(),g=GMe(),y=ka,M=i2(),x=Ei,E=qre(),A=Ure(),k=gt,O=YMe(),N=r.resolve,L=M.constants.O_RDONLY,C=M.constants.O_WRONLY,Y=M.constants.O_RDWR,G=M.constants.O_CREAT,ee=M.constants.O_EXCL,$=M.constants.O_TRUNC,q=M.constants.O_APPEND,V=M.constants.O_SYNC,_=M.constants.O_DIRECTORY,n=M.constants.F_OK,s=M.constants.COPYFILE_EXCL,f=M.constants.COPYFILE_FICLONE_FORCE,u=r.posix?r.posix:r,l=u.sep,m=u.relative,w=u.join,d=u.dirname,o=b.default.platform==="win32",v=128,R={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"},S=function(Ke){return"Expected options to be either an object or a string, but got "+Ke+" instead"},B="ENOENT",F="EBADF",D="EINVAL",re="EPERM",Q="EPROTO",Z="EEXIST",K="ENOTDIR",ce="EMFILE",te="EACCES",j="EISDIR",J="ENOTEMPTY",X="ENOSYS";function he(Ke,ve,we,ze){ve===void 0&&(ve=""),we===void 0&&(we=""),ze===void 0&&(ze="");var rt="";switch(we&&(rt=" '"+we+"'"),ze&&(rt+=" -> '"+ze+"'"),Ke){case B:return"ENOENT: no such file or directory, "+ve+rt;case F:return"EBADF: bad file descriptor, "+ve+rt;case D:return"EINVAL: invalid argument, "+ve+rt;case re:return"EPERM: operation not permitted, "+ve+rt;case Q:return"EPROTO: protocol error, "+ve+rt;case Z:return"EEXIST: file already exists, "+ve+rt;case K:return"ENOTDIR: not a directory, "+ve+rt;case j:return"EISDIR: illegal operation on a directory, "+ve+rt;case te:return"EACCES: permission denied, "+ve+rt;case J:return"ENOTEMPTY: directory not empty, "+ve+rt;case ce:return"EMFILE: too many open files, "+ve+rt;case X:return"ENOSYS: function not implemented, "+ve+rt;default:return Ke+": error occurred, "+ve+rt}}function Te(Ke,ve,we,ze,rt){ve===void 0&&(ve=""),we===void 0&&(we=""),ze===void 0&&(ze=""),rt===void 0&&(rt=Error);var ft=new rt(he(Ke,ve,we,ze));return ft.code=Ke,ft}var oe;(function(Ke){Ke[Ke.r=L]="r",Ke[Ke["r+"]=Y]="r+",Ke[Ke.rs=L|V]="rs",Ke[Ke.sr=Ke.rs]="sr",Ke[Ke["rs+"]=Y|V]="rs+",Ke[Ke["sr+"]=Ke["rs+"]]="sr+",Ke[Ke.w=C|G|$]="w",Ke[Ke.wx=C|G|$|ee]="wx",Ke[Ke.xw=Ke.wx]="xw",Ke[Ke["w+"]=Y|G|$]="w+",Ke[Ke["wx+"]=Y|G|$|ee]="wx+",Ke[Ke["xw+"]=Ke["wx+"]]="xw+",Ke[Ke.a=C|q|G]="a",Ke[Ke.ax=C|q|G|ee]="ax",Ke[Ke.xa=Ke.ax]="xa",Ke[Ke["a+"]=Y|q|G]="a+",Ke[Ke["ax+"]=Y|q|G|ee]="ax+",Ke[Ke["xa+"]=Ke["ax+"]]="xa+"})(oe=ui.FLAGS||(ui.FLAGS={}));function le(Ke){if(typeof Ke=="number")return Ke;if(typeof Ke=="string"){var ve=oe[Ke];if(typeof ve<"u")return ve}throw new A.TypeError("ERR_INVALID_OPT_VALUE","flags",Ke)}ui.flagsToNumber=le;function ot(Ke,ve){var we;if(ve){var ze=typeof ve;switch(ze){case"string":we=Object.assign({},Ke,{encoding:ve});break;case"object":we=Object.assign({},Ke,ve);break;default:throw TypeError(S(ze))}}else return Ke;return we.encoding!=="buffer"&&(0,E.assertEncoding)(we.encoding),we}function ge(Ke){return function(ve){return ot(Ke,ve)}}function Se(Ke){if(typeof Ke!="function")throw TypeError(R.CB);return Ke}function ut(Ke){return function(ve,we){return typeof ve=="function"?[Ke(),ve]:[Ke(ve),Se(we)]}}var Ze={encoding:"utf8"},Ge=ge(Ze),ct=ut(Ge),z={flag:"r"},T=ge(z),I={encoding:"utf8",mode:438,flag:oe[oe.w]},P=ge(I),U={encoding:"utf8",mode:438,flag:oe[oe.a]},H=ge(U),W=ut(H),fe=Ze,st=ge(fe),ue=ut(st),me={mode:511,recursive:!1},pe=function(Ke){return typeof Ke=="number"?Object.assign({},me,{mode:Ke}):Object.assign({},me,Ke)},be={recursive:!1},Qe=function(Ke){return Object.assign({},be,Ke)},se={encoding:"utf8",withFileTypes:!1},ye=ge(se),Ee=ut(ye),Fe={bigint:!1},de=function(Ke){return Ke===void 0&&(Ke={}),Object.assign({},Fe,Ke)},xe=function(Ke,ve){return typeof Ke=="function"?[de(),Ke]:[de(Ke),Se(ve)]};function lt(Ke){if(Ke.hostname!=="")throw new A.TypeError("ERR_INVALID_FILE_URL_HOST",b.default.platform);for(var ve=Ke.pathname,we=0;we<ve.length;we++)if(ve[we]==="%"){var ze=ve.codePointAt(we+2)|32;if(ve[we+1]==="2"&&ze===102)throw new A.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}return decodeURIComponent(ve)}function _e(Ke){if(typeof Ke!="string"&&!c.Buffer.isBuffer(Ke)){try{if(!(Ke instanceof vi.URL))throw new TypeError(R.PATH_STR)}catch{throw new TypeError(R.PATH_STR)}Ke=lt(Ke)}var ve=String(Ke);return Je(ve),ve}ui.pathToFilename=_e;var Ve=function(Ke,ve){return ve===void 0&&(ve=b.default.cwd()),N(ve,Ke)};if(o){var vt=Ve,Ye=JMe().unixify;Ve=function(Ke,ve){return Ye(vt(Ke,ve))}}function et(Ke,ve){var we=Ve(Ke,ve),ze=we.substr(1);return ze?ze.split(l):[]}ui.filenameToSteps=et;function mt(Ke){return et(_e(Ke))}ui.pathToSteps=mt;function We(Ke,ve){return ve===void 0&&(ve=E.ENCODING_UTF8),c.Buffer.isBuffer(Ke)?Ke.toString(ve):Ke instanceof Uint8Array?(0,c.bufferFrom)(Ke).toString(ve):String(Ke)}ui.dataToStr=We;function nt(Ke,ve){return ve===void 0&&(ve=E.ENCODING_UTF8),c.Buffer.isBuffer(Ke)?Ke:Ke instanceof Uint8Array?(0,c.bufferFrom)(Ke):(0,c.bufferFrom)(String(Ke),ve)}ui.dataToBuffer=nt;function bt(Ke,ve){return!ve||ve==="buffer"?Ke:Ke.toString(ve)}ui.bufferToEncoding=bt;function Je(Ke,ve){if((""+Ke).indexOf("\0")!==-1){var we=new Error("Path must be a string without null bytes");if(we.code=B,typeof ve!="function")throw we;return b.default.nextTick(ve,we),!1}return!0}function at(Ke,ve){if(typeof Ke=="number")return Ke;if(typeof Ke=="string")return parseInt(Ke,8);if(ve)return yt(ve)}function yt(Ke,ve){var we=at(Ke,ve);if(typeof we!="number"||isNaN(we))throw new TypeError(R.MODE_INT);return we}function Xe(Ke){return Ke>>>0===Ke}function it(Ke){if(!Xe(Ke))throw TypeError(R.FD)}function _t(Ke){if(typeof Ke=="string"&&+Ke==Ke)return+Ke;if(Ke instanceof Date)return Ke.getTime()/1e3;if(isFinite(Ke))return Ke<0?Date.now()/1e3:Ke;throw new Error("Cannot parse time: "+Ke)}ui.toUnixTimestamp=_t;function dt(Ke){if(typeof Ke!="number")throw TypeError(R.UID)}function Mt(Ke){if(typeof Ke!="number")throw TypeError(R.GID)}function Ut(Ke){var ve={};function we(ze,rt){for(var ft in rt){var pt=rt[ft],xt=w(ze,ft);typeof pt=="string"?ve[xt]=pt:typeof pt=="object"&&pt!==null&&Object.keys(pt).length>0?we(xt,pt):ve[xt]=null}}return we("",Ke),ve}var qt=function(){function Ke(ve){ve===void 0&&(ve={}),this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.promisesApi=(0,O.default)(this),this.statWatchers={},this.props=Object.assign({Node:a.Node,Link:a.Link,File:a.File},ve);var we=this.createLink();we.setNode(this.createNode(!0));var ze=this;this.StatWatcher=function(pt){t(xt,pt);function xt(){return pt.call(this,ze)||this}return xt}(Dt);var rt=Lt;this.ReadStream=function(pt){t(xt,pt);function xt(){for(var Kt=[],Qt=0;Qt<arguments.length;Qt++)Kt[Qt]=arguments[Qt];return pt.apply(this,e([ze],Kt,!1))||this}return xt}(rt);var ft=Nt;this.WriteStream=function(pt){t(xt,pt);function xt(){for(var Kt=[],Qt=0;Qt<arguments.length;Qt++)Kt[Qt]=arguments[Qt];return pt.apply(this,e([ze],Kt,!1))||this}return xt}(ft),this.FSWatcher=function(pt){t(xt,pt);function xt(){return pt.call(this,ze)||this}return xt}(zt),this.root=we}return Ke.fromJSON=function(ve,we){var ze=new Ke;return ze.fromJSON(ve,we),ze},Ke.fromNestedJSON=function(ve,we){var ze=new Ke;return ze.fromNestedJSON(ve,we),ze},Object.defineProperty(Ke.prototype,"promises",{get:function(){if(this.promisesApi===null)throw new Error("Promise is not supported in this environment.");return this.promisesApi},enumerable:!1,configurable:!0}),Ke.prototype.createLink=function(ve,we,ze,rt){if(ze===void 0&&(ze=!1),!ve)return new this.props.Link(this,null,"");if(!we)throw new Error("createLink: name cannot be empty");return ve.createChild(we,this.createNode(ze,rt))},Ke.prototype.deleteLink=function(ve){var we=ve.parent;return we?(we.deleteChild(ve),!0):!1},Ke.prototype.newInoNumber=function(){var ve=this.releasedInos.pop();return ve||(this.ino=(this.ino+1)%4294967295,this.ino)},Ke.prototype.newFdNumber=function(){var ve=this.releasedFds.pop();return typeof ve=="number"?ve:Ke.fd--},Ke.prototype.createNode=function(ve,we){ve===void 0&&(ve=!1);var ze=new this.props.Node(this.newInoNumber(),we);return ve&&ze.setIsDirectory(),this.inodes[ze.ino]=ze,ze},Ke.prototype.getNode=function(ve){return this.inodes[ve]},Ke.prototype.deleteNode=function(ve){ve.del(),delete this.inodes[ve.ino],this.releasedInos.push(ve.ino)},Ke.prototype.genRndStr=function(){var ve=(Math.random()+1).toString(36).substr(2,6);return ve.length===6?ve:this.genRndStr()},Ke.prototype.getLink=function(ve){return this.root.walk(ve)},Ke.prototype.getLinkOrThrow=function(ve,we){var ze=et(ve),rt=this.getLink(ze);if(!rt)throw Te(B,we,ve);return rt},Ke.prototype.getResolvedLink=function(ve){for(var we=typeof ve=="string"?et(ve):ve,ze=this.root,rt=0;rt<we.length;){var ft=we[rt];if(ze=ze.getChild(ft),!ze)return null;var pt=ze.getNode();if(pt.isSymlink()){we=pt.symlink.concat(we.slice(rt+1)),ze=this.root,rt=0;continue}rt++}return ze},Ke.prototype.getResolvedLinkOrThrow=function(ve,we){var ze=this.getResolvedLink(ve);if(!ze)throw Te(B,we,ve);return ze},Ke.prototype.resolveSymlinks=function(ve){return this.getResolvedLink(ve.steps.slice(1))},Ke.prototype.getLinkAsDirOrThrow=function(ve,we){var ze=this.getLinkOrThrow(ve,we);if(!ze.getNode().isDirectory())throw Te(K,we,ve);return ze},Ke.prototype.getLinkParent=function(ve){return this.root.walk(ve,ve.length-1)},Ke.prototype.getLinkParentAsDirOrThrow=function(ve,we){var ze=ve instanceof Array?ve:et(ve),rt=this.getLinkParent(ze);if(!rt)throw Te(B,we,l+ze.join(l));if(!rt.getNode().isDirectory())throw Te(K,we,l+ze.join(l));return rt},Ke.prototype.getFileByFd=function(ve){return this.fds[String(ve)]},Ke.prototype.getFileByFdOrThrow=function(ve,we){if(!Xe(ve))throw TypeError(R.FD);var ze=this.getFileByFd(ve);if(!ze)throw Te(F,we);return ze},Ke.prototype.getNodeByIdOrCreate=function(ve,we,ze){if(typeof ve=="number"){var rt=this.getFileByFd(ve);if(!rt)throw Error("File nto found");return rt.node}else{var ft=mt(ve),pt=this.getLink(ft);if(pt)return pt.getNode();if(we&G){var xt=this.getLinkParent(ft);if(xt){var Kt=ft[ft.length-1];return pt=this.createLink(xt,Kt,!1,ze),pt.getNode()}}throw Te(B,"getNodeByIdOrCreate",_e(ve))}},Ke.prototype.wrapAsync=function(ve,we,ze){var rt=this;Se(ze),(0,p.default)(function(){var ft;try{ft=ve.apply(rt,we)}catch(pt){ze(pt);return}ze(null,ft)})},Ke.prototype._toJSON=function(ve,we,ze){var rt;ve===void 0&&(ve=this.root),we===void 0&&(we={});var ft=!0,pt=ve.children;ve.getNode().isFile()&&(pt=(rt={},rt[ve.getName()]=ve.parent.getChild(ve.getName()),rt),ve=ve.parent);for(var xt in pt){ft=!1;var Kt=ve.getChild(xt);if(!Kt)throw new Error("_toJSON: unexpected undefined");var Qt=Kt.getNode();if(Qt.isFile()){var li=Kt.getPath();ze&&(li=m(ze,li)),we[li]=Qt.getString()}else Qt.isDirectory()&&this._toJSON(Kt,we,ze)}var _n=ve.getPath();return ze&&(_n=m(ze,_n)),_n&&ft&&(we[_n]=null),we},Ke.prototype.toJSON=function(ve,we,ze){we===void 0&&(we={}),ze===void 0&&(ze=!1);var rt=[];if(ve){ve instanceof Array||(ve=[ve]);for(var ft=0,pt=ve;ft<pt.length;ft++){var xt=pt[ft],Kt=_e(xt),Qt=this.getResolvedLink(Kt);Qt&&rt.push(Qt)}}else rt.push(this.root);if(!rt.length)return we;for(var li=0,_n=rt;li<_n.length;li++){var Qt=_n[li];this._toJSON(Qt,we,ze?Qt.getPath():"")}return we},Ke.prototype.fromJSON=function(ve,we){we===void 0&&(we=b.default.cwd());for(var ze in ve){var rt=ve[ze];if(ze=Ve(ze,we),typeof rt=="string"){var ft=d(ze);this.mkdirpBase(ft,511),this.writeFileSync(ze,rt)}else this.mkdirpBase(ze,511)}},Ke.prototype.fromNestedJSON=function(ve,we){this.fromJSON(Ut(ve),we)},Ke.prototype.reset=function(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(!0))},Ke.prototype.mountSync=function(ve,we){this.fromJSON(we,ve)},Ke.prototype.openLink=function(ve,we,ze){if(ze===void 0&&(ze=!0),this.openFiles>=this.maxFiles)throw Te(ce,"open",ve.getPath());var rt=ve;if(ze&&(rt=this.resolveSymlinks(ve)),!rt)throw Te(B,"open",ve.getPath());var ft=rt.getNode();if(ft.isDirectory()){if((we&(L|Y|C))!==L)throw Te(j,"open",ve.getPath())}else if(we&_)throw Te(K,"open",ve.getPath());if(!(we&C)&&!ft.canRead())throw Te(te,"open",ve.getPath());var pt=new this.props.File(ve,ft,we,this.newFdNumber());return this.fds[pt.fd]=pt,this.openFiles++,we&$&&pt.truncate(),pt},Ke.prototype.openFile=function(ve,we,ze,rt){rt===void 0&&(rt=!0);var ft=et(ve),pt=rt?this.getResolvedLink(ft):this.getLink(ft);if(!pt&&we&G){var xt=this.getResolvedLink(ft.slice(0,ft.length-1));if(!xt)throw Te(B,"open",l+ft.join(l));we&G&&typeof ze=="number"&&(pt=this.createLink(xt,ft[ft.length-1],!1,ze))}if(pt)return this.openLink(pt,we,rt);throw Te(B,"open",ve)},Ke.prototype.openBase=function(ve,we,ze,rt){rt===void 0&&(rt=!0);var ft=this.openFile(ve,we,ze,rt);if(!ft)throw Te(B,"open",ve);return ft.fd},Ke.prototype.openSync=function(ve,we,ze){ze===void 0&&(ze=438);var rt=yt(ze),ft=_e(ve),pt=le(we);return this.openBase(ft,pt,rt)},Ke.prototype.open=function(ve,we,ze,rt){var ft=ze,pt=rt;typeof ze=="function"&&(ft=438,pt=ze),ft=ft||438;var xt=yt(ft),Kt=_e(ve),Qt=le(we);this.wrapAsync(this.openBase,[Kt,Qt,xt],pt)},Ke.prototype.closeFile=function(ve){this.fds[ve.fd]&&(this.openFiles--,delete this.fds[ve.fd],this.releasedFds.push(ve.fd))},Ke.prototype.closeSync=function(ve){it(ve);var we=this.getFileByFdOrThrow(ve,"close");this.closeFile(we)},Ke.prototype.close=function(ve,we){it(ve),this.wrapAsync(this.closeSync,[ve],we)},Ke.prototype.openFileOrGetById=function(ve,we,ze){if(typeof ve=="number"){var rt=this.fds[ve];if(!rt)throw Te(B);return rt}else return this.openFile(_e(ve),we,ze)},Ke.prototype.readBase=function(ve,we,ze,rt,ft){var pt=this.getFileByFdOrThrow(ve);return pt.read(we,Number(ze),Number(rt),ft)},Ke.prototype.readSync=function(ve,we,ze,rt,ft){return it(ve),this.readBase(ve,we,ze,rt,ft)},Ke.prototype.read=function(ve,we,ze,rt,ft,pt){var xt=this;if(Se(pt),rt===0)return b.default.nextTick(function(){pt&&pt(null,0,we)});(0,p.default)(function(){try{var Kt=xt.readBase(ve,we,ze,rt,ft);pt(null,Kt,we)}catch(Qt){pt(Qt)}})},Ke.prototype.readFileBase=function(ve,we,ze){var rt,ft=typeof ve=="number",pt=ft&&Xe(ve),xt;if(pt)xt=ve;else{var Kt=_e(ve),Qt=et(Kt),li=this.getResolvedLink(Qt);if(li){var _n=li.getNode();if(_n.isDirectory())throw Te(j,"open",li.getPath())}xt=this.openSync(ve,we)}try{rt=bt(this.getFileByFdOrThrow(xt).getBuffer(),ze)}finally{pt||this.closeSync(xt)}return rt},Ke.prototype.readFileSync=function(ve,we){var ze=T(we),rt=le(ze.flag);return this.readFileBase(ve,rt,ze.encoding)},Ke.prototype.readFile=function(ve,we,ze){var rt=ut(T)(we,ze),ft=rt[0],pt=rt[1],xt=le(ft.flag);this.wrapAsync(this.readFileBase,[ve,xt,ft.encoding],pt)},Ke.prototype.writeBase=function(ve,we,ze,rt,ft){var pt=this.getFileByFdOrThrow(ve,"write");return pt.write(we,ze,rt,ft)},Ke.prototype.writeSync=function(ve,we,ze,rt,ft){it(ve);var pt,xt,Kt,Qt,li=typeof we!="string";li?(xt=(ze||0)|0,Kt=rt,Qt=ft):(Qt=ze,pt=rt);var _n=nt(we,pt);return li?typeof Kt>"u"&&(Kt=_n.length):(xt=0,Kt=_n.length),this.writeBase(ve,_n,xt,Kt,Qt)},Ke.prototype.write=function(ve,we,ze,rt,ft,pt){var xt=this;it(ve);var Kt,Qt,li,_n,Zs,Ww=typeof we,bO=typeof ze,yO=typeof rt,wO=typeof ft;Ww!=="string"?bO==="function"?Zs=ze:yO==="function"?(Kt=ze|0,Zs=rt):wO==="function"?(Kt=ze|0,Qt=rt,Zs=ft):(Kt=ze|0,Qt=rt,li=ft,Zs=pt):bO==="function"?Zs=ze:yO==="function"?(li=ze,Zs=rt):wO==="function"&&(li=ze,_n=rt,Zs=ft);var kb=nt(we,_n);Ww!=="string"?typeof Qt>"u"&&(Qt=kb.length):(Kt=0,Qt=kb.length);var Vw=Se(Zs);(0,p.default)(function(){try{var _O=xt.writeBase(ve,kb,Kt,Qt,li);Ww!=="string"?Vw(null,_O,kb):Vw(null,_O,we)}catch(Jfe){Vw(Jfe)}})},Ke.prototype.writeFileBase=function(ve,we,ze,rt){var ft=typeof ve=="number",pt;ft?pt=ve:pt=this.openBase(_e(ve),ze,rt);var xt=0,Kt=we.length,Qt=ze&q?void 0:0;try{for(;Kt>0;){var li=this.writeSync(pt,we,xt,Kt,Qt);xt+=li,Kt-=li,Qt!==void 0&&(Qt+=li)}}finally{ft||this.closeSync(pt)}},Ke.prototype.writeFileSync=function(ve,we,ze){var rt=P(ze),ft=le(rt.flag),pt=yt(rt.mode),xt=nt(we,rt.encoding);this.writeFileBase(ve,xt,ft,pt)},Ke.prototype.writeFile=function(ve,we,ze,rt){var ft=ze,pt=rt;typeof ze=="function"&&(ft=I,pt=ze);var xt=Se(pt),Kt=P(ft),Qt=le(Kt.flag),li=yt(Kt.mode),_n=nt(we,Kt.encoding);this.wrapAsync(this.writeFileBase,[ve,_n,Qt,li],xt)},Ke.prototype.linkBase=function(ve,we){var ze=et(ve),rt=this.getLink(ze);if(!rt)throw Te(B,"link",ve,we);var ft=et(we),pt=this.getLinkParent(ft);if(!pt)throw Te(B,"link",ve,we);var xt=ft[ft.length-1];if(pt.getChild(xt))throw Te(Z,"link",ve,we);var Kt=rt.getNode();Kt.nlink++,pt.createChild(xt,Kt)},Ke.prototype.copyFileBase=function(ve,we,ze){var rt=this.readFileSync(ve);if(ze&s&&this.existsSync(we))throw Te(Z,"copyFile",ve,we);if(ze&f)throw Te(X,"copyFile",ve,we);this.writeFileBase(we,rt,oe.w,438)},Ke.prototype.copyFileSync=function(ve,we,ze){var rt=_e(ve),ft=_e(we);return this.copyFileBase(rt,ft,(ze||0)|0)},Ke.prototype.copyFile=function(ve,we,ze,rt){var ft=_e(ve),pt=_e(we),xt,Kt;typeof ze=="function"?(xt=0,Kt=ze):(xt=ze,Kt=rt),Se(Kt),this.wrapAsync(this.copyFileBase,[ft,pt,xt],Kt)},Ke.prototype.linkSync=function(ve,we){var ze=_e(ve),rt=_e(we);this.linkBase(ze,rt)},Ke.prototype.link=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.wrapAsync(this.linkBase,[rt,ft],ze)},Ke.prototype.unlinkBase=function(ve){var we=et(ve),ze=this.getLink(we);if(!ze)throw Te(B,"unlink",ve);if(ze.length)throw Error("Dir not empty...");this.deleteLink(ze);var rt=ze.getNode();rt.nlink--,rt.nlink<=0&&this.deleteNode(rt)},Ke.prototype.unlinkSync=function(ve){var we=_e(ve);this.unlinkBase(we)},Ke.prototype.unlink=function(ve,we){var ze=_e(ve);this.wrapAsync(this.unlinkBase,[ze],we)},Ke.prototype.symlinkBase=function(ve,we){var ze=et(we),rt=this.getLinkParent(ze);if(!rt)throw Te(B,"symlink",ve,we);var ft=ze[ze.length-1];if(rt.getChild(ft))throw Te(Z,"symlink",ve,we);var pt=rt.createChild(ft);return pt.getNode().makeSymlink(et(ve)),pt},Ke.prototype.symlinkSync=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.symlinkBase(rt,ft)},Ke.prototype.symlink=function(ve,we,ze,rt){var ft=Se(typeof ze=="function"?ze:rt),pt=_e(ve),xt=_e(we);this.wrapAsync(this.symlinkBase,[pt,xt],ft)},Ke.prototype.realpathBase=function(ve,we){var ze=et(ve),rt=this.getResolvedLink(ze);if(!rt)throw Te(B,"realpath",ve);return(0,E.strToEncoding)(rt.getPath(),we)},Ke.prototype.realpathSync=function(ve,we){return this.realpathBase(_e(ve),st(we).encoding)},Ke.prototype.realpath=function(ve,we,ze){var rt=ue(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.realpathBase,[xt,ft.encoding],pt)},Ke.prototype.lstatBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getLink(et(ve));if(!ze)throw Te(B,"lstat",ve);return i.default.build(ze.getNode(),we)},Ke.prototype.lstatSync=function(ve,we){return this.lstatBase(_e(ve),de(we).bigint)},Ke.prototype.lstat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.lstatBase,[_e(ve),ft.bigint],pt)},Ke.prototype.statBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getResolvedLink(et(ve));if(!ze)throw Te(B,"stat",ve);return i.default.build(ze.getNode(),we)},Ke.prototype.statSync=function(ve,we){return this.statBase(_e(ve),de(we).bigint)},Ke.prototype.stat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.statBase,[_e(ve),ft.bigint],pt)},Ke.prototype.fstatBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getFileByFd(ve);if(!ze)throw Te(F,"fstat");return i.default.build(ze.node,we)},Ke.prototype.fstatSync=function(ve,we){return this.fstatBase(ve,de(we).bigint)},Ke.prototype.fstat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.fstatBase,[ve,ft.bigint],pt)},Ke.prototype.renameBase=function(ve,we){var ze=this.getLink(et(ve));if(!ze)throw Te(B,"rename",ve,we);var rt=et(we),ft=this.getLinkParent(rt);if(!ft)throw Te(B,"rename",ve,we);var pt=ze.parent;pt&&pt.deleteChild(ze);var xt=rt[rt.length-1];ze.steps=e(e([],ft.steps,!0),[xt],!1),ft.setChild(ze.getName(),ze)},Ke.prototype.renameSync=function(ve,we){var ze=_e(ve),rt=_e(we);this.renameBase(ze,rt)},Ke.prototype.rename=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.wrapAsync(this.renameBase,[rt,ft],ze)},Ke.prototype.existsBase=function(ve){return!!this.statBase(ve)},Ke.prototype.existsSync=function(ve){try{return this.existsBase(_e(ve))}catch{return!1}},Ke.prototype.exists=function(ve,we){var ze=this,rt=_e(ve);if(typeof we!="function")throw Error(R.CB);(0,p.default)(function(){try{we(ze.existsBase(rt))}catch{we(!1)}})},Ke.prototype.accessBase=function(ve,we){this.getLinkOrThrow(ve,"access")},Ke.prototype.accessSync=function(ve,we){we===void 0&&(we=n);var ze=_e(ve);we=we|0,this.accessBase(ze,we)},Ke.prototype.access=function(ve,we,ze){var rt=n,ft;typeof we!="function"?(rt=we|0,ft=Se(ze)):ft=we;var pt=_e(ve);this.wrapAsync(this.accessBase,[pt,rt],ft)},Ke.prototype.appendFileSync=function(ve,we,ze){ze===void 0&&(ze=U);var rt=H(ze);(!rt.flag||Xe(ve))&&(rt.flag="a"),this.writeFileSync(ve,we,rt)},Ke.prototype.appendFile=function(ve,we,ze,rt){var ft=W(ze,rt),pt=ft[0],xt=ft[1];(!pt.flag||Xe(ve))&&(pt.flag="a"),this.writeFile(ve,we,pt,xt)},Ke.prototype.readdirBase=function(ve,we){var ze=et(ve),rt=this.getResolvedLink(ze);if(!rt)throw Te(B,"readdir",ve);var ft=rt.getNode();if(!ft.isDirectory())throw Te(K,"scandir",ve);if(we.withFileTypes){var pt=[];for(var xt in rt.children){var Kt=rt.getChild(xt);Kt&&pt.push(h.default.build(Kt,we.encoding))}return!o&&we.encoding!=="buffer"&&pt.sort(function(_n,Zs){return _n.name<Zs.name?-1:_n.name>Zs.name?1:0}),pt}var Qt=[];for(var li in rt.children)Qt.push((0,E.strToEncoding)(li,we.encoding));return!o&&we.encoding!=="buffer"&&Qt.sort(),Qt},Ke.prototype.readdirSync=function(ve,we){var ze=ye(we),rt=_e(ve);return this.readdirBase(rt,ze)},Ke.prototype.readdir=function(ve,we,ze){var rt=Ee(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.readdirBase,[xt,ft],pt)},Ke.prototype.readlinkBase=function(ve,we){var ze=this.getLinkOrThrow(ve,"readlink"),rt=ze.getNode();if(!rt.isSymlink())throw Te(D,"readlink",ve);var ft=l+rt.symlink.join(l);return(0,E.strToEncoding)(ft,we)},Ke.prototype.readlinkSync=function(ve,we){var ze=Ge(we),rt=_e(ve);return this.readlinkBase(rt,ze.encoding)},Ke.prototype.readlink=function(ve,we,ze){var rt=ct(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.readlinkBase,[xt,ft.encoding],pt)},Ke.prototype.fsyncBase=function(ve){this.getFileByFdOrThrow(ve,"fsync")},Ke.prototype.fsyncSync=function(ve){this.fsyncBase(ve)},Ke.prototype.fsync=function(ve,we){this.wrapAsync(this.fsyncBase,[ve],we)},Ke.prototype.fdatasyncBase=function(ve){this.getFileByFdOrThrow(ve,"fdatasync")},Ke.prototype.fdatasyncSync=function(ve){this.fdatasyncBase(ve)},Ke.prototype.fdatasync=function(ve,we){this.wrapAsync(this.fdatasyncBase,[ve],we)},Ke.prototype.ftruncateBase=function(ve,we){var ze=this.getFileByFdOrThrow(ve,"ftruncate");ze.truncate(we)},Ke.prototype.ftruncateSync=function(ve,we){this.ftruncateBase(ve,we)},Ke.prototype.ftruncate=function(ve,we,ze){var rt=typeof we=="number"?we:0,ft=Se(typeof we=="number"?ze:we);this.wrapAsync(this.ftruncateBase,[ve,rt],ft)},Ke.prototype.truncateBase=function(ve,we){var ze=this.openSync(ve,"r+");try{this.ftruncateSync(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.truncateSync=function(ve,we){if(Xe(ve))return this.ftruncateSync(ve,we);this.truncateBase(ve,we)},Ke.prototype.truncate=function(ve,we,ze){var rt=typeof we=="number"?we:0,ft=Se(typeof we=="number"?ze:we);if(Xe(ve))return this.ftruncate(ve,rt,ft);this.wrapAsync(this.truncateBase,[ve,rt],ft)},Ke.prototype.futimesBase=function(ve,we,ze){var rt=this.getFileByFdOrThrow(ve,"futimes"),ft=rt.node;ft.atime=new Date(we*1e3),ft.mtime=new Date(ze*1e3)},Ke.prototype.futimesSync=function(ve,we,ze){this.futimesBase(ve,_t(we),_t(ze))},Ke.prototype.futimes=function(ve,we,ze,rt){this.wrapAsync(this.futimesBase,[ve,_t(we),_t(ze)],rt)},Ke.prototype.utimesBase=function(ve,we,ze){var rt=this.openSync(ve,"r+");try{this.futimesBase(rt,we,ze)}finally{this.closeSync(rt)}},Ke.prototype.utimesSync=function(ve,we,ze){this.utimesBase(_e(ve),_t(we),_t(ze))},Ke.prototype.utimes=function(ve,we,ze,rt){this.wrapAsync(this.utimesBase,[_e(ve),_t(we),_t(ze)],rt)},Ke.prototype.mkdirBase=function(ve,we){var ze=et(ve);if(!ze.length)throw Te(Z,"mkdir",ve);var rt=this.getLinkParentAsDirOrThrow(ve,"mkdir"),ft=ze[ze.length-1];if(rt.getChild(ft))throw Te(Z,"mkdir",ve);rt.createChild(ft,this.createNode(!0,we))},Ke.prototype.mkdirpBase=function(ve,we){for(var ze=et(ve),rt=this.root,ft=0;ft<ze.length;ft++){var pt=ze[ft];if(!rt.getNode().isDirectory())throw Te(K,"mkdir",rt.getPath());var xt=rt.getChild(pt);if(xt)if(xt.getNode().isDirectory())rt=xt;else throw Te(K,"mkdir",xt.getPath());else rt=rt.createChild(pt,this.createNode(!0,we))}},Ke.prototype.mkdirSync=function(ve,we){var ze=pe(we),rt=yt(ze.mode,511),ft=_e(ve);ze.recursive?this.mkdirpBase(ft,rt):this.mkdirBase(ft,rt)},Ke.prototype.mkdir=function(ve,we,ze){var rt=pe(we),ft=Se(typeof we=="function"?we:ze),pt=yt(rt.mode,511),xt=_e(ve);rt.recursive?this.wrapAsync(this.mkdirpBase,[xt,pt],ft):this.wrapAsync(this.mkdirBase,[xt,pt],ft)},Ke.prototype.mkdirpSync=function(ve,we){this.mkdirSync(ve,{mode:we,recursive:!0})},Ke.prototype.mkdirp=function(ve,we,ze){var rt=typeof we=="function"?void 0:we,ft=Se(typeof we=="function"?we:ze);this.mkdir(ve,{mode:rt,recursive:!0},ft)},Ke.prototype.mkdtempBase=function(ve,we,ze){ze===void 0&&(ze=5);var rt=ve+this.genRndStr();try{return this.mkdirBase(rt,511),(0,E.strToEncoding)(rt,we)}catch(ft){if(ft.code===Z){if(ze>1)return this.mkdtempBase(ve,we,ze-1);throw Error("Could not create temp dir.")}else throw ft}},Ke.prototype.mkdtempSync=function(ve,we){var ze=Ge(we).encoding;if(!ve||typeof ve!="string")throw new TypeError("filename prefix is required");return Je(ve),this.mkdtempBase(ve,ze)},Ke.prototype.mkdtemp=function(ve,we,ze){var rt=ct(we,ze),ft=rt[0].encoding,pt=rt[1];if(!ve||typeof ve!="string")throw new TypeError("filename prefix is required");Je(ve)&&this.wrapAsync(this.mkdtempBase,[ve,ft],pt)},Ke.prototype.rmdirBase=function(ve,we){var ze=Qe(we),rt=this.getLinkAsDirOrThrow(ve,"rmdir");if(rt.length&&!ze.recursive)throw Te(J,"rmdir",ve);this.deleteLink(rt)},Ke.prototype.rmdirSync=function(ve,we){this.rmdirBase(_e(ve),we)},Ke.prototype.rmdir=function(ve,we,ze){var rt=Qe(we),ft=Se(typeof we=="function"?we:ze);this.wrapAsync(this.rmdirBase,[_e(ve),rt],ft)},Ke.prototype.fchmodBase=function(ve,we){var ze=this.getFileByFdOrThrow(ve,"fchmod");ze.chmod(we)},Ke.prototype.fchmodSync=function(ve,we){this.fchmodBase(ve,yt(we))},Ke.prototype.fchmod=function(ve,we,ze){this.wrapAsync(this.fchmodBase,[ve,yt(we)],ze)},Ke.prototype.chmodBase=function(ve,we){var ze=this.openSync(ve,"r+");try{this.fchmodBase(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.chmodSync=function(ve,we){var ze=yt(we),rt=_e(ve);this.chmodBase(rt,ze)},Ke.prototype.chmod=function(ve,we,ze){var rt=yt(we),ft=_e(ve);this.wrapAsync(this.chmodBase,[ft,rt],ze)},Ke.prototype.lchmodBase=function(ve,we){var ze=this.openBase(ve,Y,0,!1);try{this.fchmodBase(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.lchmodSync=function(ve,we){var ze=yt(we),rt=_e(ve);this.lchmodBase(rt,ze)},Ke.prototype.lchmod=function(ve,we,ze){var rt=yt(we),ft=_e(ve);this.wrapAsync(this.lchmodBase,[ft,rt],ze)},Ke.prototype.fchownBase=function(ve,we,ze){this.getFileByFdOrThrow(ve,"fchown").chown(we,ze)},Ke.prototype.fchownSync=function(ve,we,ze){dt(we),Mt(ze),this.fchownBase(ve,we,ze)},Ke.prototype.fchown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.fchownBase,[ve,we,ze],rt)},Ke.prototype.chownBase=function(ve,we,ze){var rt=this.getResolvedLinkOrThrow(ve,"chown"),ft=rt.getNode();ft.chown(we,ze)},Ke.prototype.chownSync=function(ve,we,ze){dt(we),Mt(ze),this.chownBase(_e(ve),we,ze)},Ke.prototype.chown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.chownBase,[_e(ve),we,ze],rt)},Ke.prototype.lchownBase=function(ve,we,ze){this.getLinkOrThrow(ve,"lchown").getNode().chown(we,ze)},Ke.prototype.lchownSync=function(ve,we,ze){dt(we),Mt(ze),this.lchownBase(_e(ve),we,ze)},Ke.prototype.lchown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.lchownBase,[_e(ve),we,ze],rt)},Ke.prototype.watchFile=function(ve,we,ze){var rt=_e(ve),ft=we,pt=ze;if(typeof ft=="function"&&(pt=we,ft=null),typeof pt!="function")throw Error('"watchFile()" requires a listener function');var xt=5007,Kt=!0;ft&&typeof ft=="object"&&(typeof ft.interval=="number"&&(xt=ft.interval),typeof ft.persistent=="boolean"&&(Kt=ft.persistent));var Qt=this.statWatchers[rt];return Qt||(Qt=new this.StatWatcher,Qt.start(rt,Kt,xt),this.statWatchers[rt]=Qt),Qt.addListener("change",pt),Qt},Ke.prototype.unwatchFile=function(ve,we){var ze=_e(ve),rt=this.statWatchers[ze];rt&&(typeof we=="function"?rt.removeListener("change",we):rt.removeAllListeners("change"),rt.listenerCount("change")===0&&(rt.stop(),delete this.statWatchers[ze]))},Ke.prototype.createReadStream=function(ve,we){return new this.ReadStream(ve,we)},Ke.prototype.createWriteStream=function(ve,we){return new this.WriteStream(ve,we)},Ke.prototype.watch=function(ve,we,ze){var rt=_e(ve),ft=we;typeof we=="function"&&(ze=we,ft=null);var pt=Ge(ft),xt=pt.persistent,Kt=pt.recursive,Qt=pt.encoding;xt===void 0&&(xt=!0),Kt===void 0&&(Kt=!1);var li=new this.FSWatcher;return li.start(rt,xt,Kt,Qt),ze&&li.addListener("change",ze),li},Ke.fd=2147483647,Ke}();ui.Volume=qt;function Ft(Ke){Ke.emit("stop")}var Dt=function(Ke){t(ve,Ke);function ve(we){var ze=Ke.call(this)||this;return ze.onInterval=function(){try{var rt=ze.vol.statSync(ze.filename);ze.hasChanged(rt)&&(ze.emit("change",rt,ze.prev),ze.prev=rt)}finally{ze.loop()}},ze.vol=we,ze}return ve.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)},ve.prototype.hasChanged=function(we){return we.mtimeMs>this.prev.mtimeMs||we.nlink!==this.prev.nlink},ve.prototype.start=function(we,ze,rt){ze===void 0&&(ze=!0),rt===void 0&&(rt=5007),this.filename=_e(we),this.setTimeout=ze?setTimeout.bind(typeof globalThis<"u"?globalThis:XMe):g.default,this.interval=rt,this.prev=this.vol.statSync(this.filename),this.loop()},ve.prototype.stop=function(){clearTimeout(this.timeoutRef),b.default.nextTick(Ft,this)},ve}(x.EventEmitter);ui.StatWatcher=Dt;var Tt;function Zt(Ke){Tt=(0,c.bufferAllocUnsafe)(Ke),Tt.used=0}k.inherits(Lt,y.Readable),ui.ReadStream=Lt;function Lt(Ke,ve,we){if(!(this instanceof Lt))return new Lt(Ke,ve,we);if(this._vol=Ke,we=Object.assign({},ot(we,{})),we.highWaterMark===void 0&&(we.highWaterMark=64*1024),y.Readable.call(this,we),this.path=_e(ve),this.fd=we.fd===void 0?null:we.fd,this.flags=we.flags===void 0?"r":we.flags,this.mode=we.mode===void 0?438:we.mode,this.start=we.start,this.end=we.end,this.autoClose=we.autoClose===void 0?!0:we.autoClose,this.pos=void 0,this.bytesRead=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw new Error('"start" option must be <= "end" option');this.pos=this.start}typeof this.fd!="number"&&this.open(),this.on("end",function(){this.autoClose&&this.destroy&&this.destroy()})}Lt.prototype.open=function(){var Ke=this;this._vol.open(this.path,this.flags,this.mode,function(ve,we){if(ve){Ke.autoClose&&Ke.destroy&&Ke.destroy(),Ke.emit("error",ve);return}Ke.fd=we,Ke.emit("open",we),Ke.read()})},Lt.prototype._read=function(Ke){if(typeof this.fd!="number")return this.once("open",function(){this._read(Ke)});if(this.destroyed)return;(!Tt||Tt.length-Tt.used<v)&&Zt(this._readableState.highWaterMark);var ve=Tt,we=Math.min(Tt.length-Tt.used,Ke),ze=Tt.used;if(this.pos!==void 0&&(we=Math.min(this.end-this.pos+1,we)),we<=0)return this.push(null);var rt=this;this._vol.read(this.fd,Tt,Tt.used,we,this.pos,ft),this.pos!==void 0&&(this.pos+=we),Tt.used+=we;function ft(pt,xt){if(pt)rt.autoClose&&rt.destroy&&rt.destroy(),rt.emit("error",pt);else{var Kt=null;xt>0&&(rt.bytesRead+=xt,Kt=ve.slice(ze,ze+xt)),rt.push(Kt)}}},Lt.prototype._destroy=function(Ke,ve){this.close(function(we){ve(Ke||we)})},Lt.prototype.close=function(Ke){var ve=this;if(Ke&&this.once("close",Ke),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",Ht);return}return b.default.nextTick(function(){return ve.emit("close")})}this.closed=!0,this._vol.close(this.fd,function(we){we?ve.emit("error",we):ve.emit("close")}),this.fd=null};function Ht(Ke){this.close()}k.inherits(Nt,y.Writable),ui.WriteStream=Nt;function Nt(Ke,ve,we){if(!(this instanceof Nt))return new Nt(Ke,ve,we);if(this._vol=Ke,we=Object.assign({},ot(we,{})),y.Writable.call(this,we),this.path=_e(ve),this.fd=we.fd===void 0?null:we.fd,this.flags=we.flags===void 0?"w":we.flags,this.mode=we.mode===void 0?438:we.mode,this.start=we.start,this.autoClose=we.autoClose===void 0?!0:!!we.autoClose,this.pos=void 0,this.bytesWritten=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.start<0)throw new Error('"start" must be >= zero');this.pos=this.start}we.encoding&&this.setDefaultEncoding(we.encoding),typeof this.fd!="number"&&this.open(),this.once("finish",function(){this.autoClose&&this.close()})}Nt.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(Ke,ve){if(Ke){this.autoClose&&this.destroy&&this.destroy(),this.emit("error",Ke);return}this.fd=ve,this.emit("open",ve)}.bind(this))},Nt.prototype._write=function(Ke,ve,we){if(!(Ke instanceof c.Buffer))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!="number")return this.once("open",function(){this._write(Ke,ve,we)});var ze=this;this._vol.write(this.fd,Ke,0,Ke.length,this.pos,function(rt,ft){if(rt)return ze.autoClose&&ze.destroy&&ze.destroy(),we(rt);ze.bytesWritten+=ft,we()}),this.pos!==void 0&&(this.pos+=Ke.length)},Nt.prototype._writev=function(Ke,ve){if(typeof this.fd!="number")return this.once("open",function(){this._writev(Ke,ve)});for(var we=this,ze=Ke.length,rt=new Array(ze),ft=0,pt=0;pt<ze;pt++){var xt=Ke[pt].chunk;rt[pt]=xt,ft+=xt.length}var Kt=c.Buffer.concat(rt);this._vol.write(this.fd,Kt,0,Kt.length,this.pos,function(Qt,li){if(Qt)return we.destroy&&we.destroy(),ve(Qt);we.bytesWritten+=li,ve()}),this.pos!==void 0&&(this.pos+=ft)},Nt.prototype._destroy=Lt.prototype._destroy,Nt.prototype.close=Lt.prototype.close,Nt.prototype.destroySoon=Nt.prototype.end;var zt=function(Ke){t(ve,Ke);function ve(we){var ze=Ke.call(this)||this;return ze._filename="",ze._filenameEncoded="",ze._recursive=!1,ze._encoding=E.ENCODING_UTF8,ze._onNodeChange=function(){ze._emit("change")},ze._onParentChild=function(rt){rt.getName()===ze._getName()&&ze._emit("rename")},ze._emit=function(rt){ze.emit("change",rt,ze._filenameEncoded)},ze._persist=function(){ze._timer=setTimeout(ze._persist,1e6)},ze._vol=we,ze}return ve.prototype._getName=function(){return this._steps[this._steps.length-1]},ve.prototype.start=function(we,ze,rt,ft){ze===void 0&&(ze=!0),rt===void 0&&(rt=!1),ft===void 0&&(ft=E.ENCODING_UTF8),this._filename=_e(we),this._steps=et(this._filename),this._filenameEncoded=(0,E.strToEncoding)(this._filename),this._recursive=rt,this._encoding=ft;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(Kt){var pt=new Error("watch "+this._filename+" "+Kt.code);throw pt.code=Kt.code,pt.errno=Kt.code,pt}this._link.getNode().on("change",this._onNodeChange),this._link.on("child:add",this._onNodeChange),this._link.on("child:delete",this._onNodeChange);var xt=this._link.parent;xt&&(xt.setMaxListeners(xt.getMaxListeners()+1),xt.on("child:delete",this._onParentChild)),ze&&this._persist()},ve.prototype.close=function(){clearTimeout(this._timer),this._link.getNode().removeListener("change",this._onNodeChange);var we=this._link.parent;we&&we.removeListener("child:delete",this._onParentChild)},ve}(x.EventEmitter);return ui.FSWatcher=zt,ui}function QMe(){if($re)return Uh;$re=!0,Object.defineProperty(Uh,"__esModule",{value:!0}),Uh.fsAsyncMethods=Uh.fsSyncMethods=Uh.fsProps=void 0;var t=["constants","F_OK","R_OK","W_OK","X_OK","Stats"];Uh.fsProps=t;var e=["renameSync","ftruncateSync","truncateSync","chownSync","fchownSync","lchownSync","chmodSync","fchmodSync","lchmodSync","statSync","lstatSync","fstatSync","linkSync","symlinkSync","readlinkSync","realpathSync","unlinkSync","rmdirSync","mkdirSync","mkdirpSync","readdirSync","closeSync","openSync","utimesSync","futimesSync","fsyncSync","writeSync","readSync","readFileSync","writeFileSync","appendFileSync","existsSync","accessSync","fdatasyncSync","mkdtempSync","copyFileSync","createReadStream","createWriteStream"];Uh.fsSyncMethods=e;var r=["rename","ftruncate","truncate","chown","fchown","lchown","chmod","fchmod","lchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","mkdirp","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","exists","access","fdatasync","mkdtemp","copyFile","watchFile","unwatchFile","watch"];return Uh.fsAsyncMethods=r,Uh}function exe(){if(Dre)return ia;Dre=!0;var t=ia&&ia.__assign||function(){return t=Object.assign||function(E){for(var A,k=1,O=arguments.length;k<O;k++){A=arguments[k];for(var N in A)Object.prototype.hasOwnProperty.call(A,N)&&(E[N]=A[N])}return E},t.apply(this,arguments)};Object.defineProperty(ia,"__esModule",{value:!0}),ia.fs=ia.createFsFromVolume=ia.vol=ia.Volume=void 0;var e=Ik(),r=Fre(),a=Zre(),i=QMe(),h=i.fsSyncMethods,c=i.fsAsyncMethods,p=i2(),b=p.constants.F_OK,g=p.constants.R_OK,y=p.constants.W_OK,M=p.constants.X_OK;ia.Volume=a.Volume,ia.vol=new a.Volume;function x(E){for(var A={F_OK:b,R_OK:g,W_OK:y,X_OK:M,constants:p.constants,Stats:e.default,Dirent:r.default},k=0,O=h;k<O.length;k++){var N=O[k];typeof E[N]=="function"&&(A[N]=E[N].bind(E))}for(var L=0,C=c;L<C.length;L++){var N=C[L];typeof E[N]=="function"&&(A[N]=E[N].bind(E))}return A.StatWatcher=E.StatWatcher,A.FSWatcher=E.FSWatcher,A.WriteStream=E.WriteStream,A.ReadStream=E.ReadStream,A.promises=E.promises,A._toUnixTimestamp=a.toUnixTimestamp,A}return ia.createFsFromVolume=x,ia.fs=x(ia.vol),ia=t(t({},ia),ia.fs),ia.semantic=!0,ia}function Po(t){throw new Error(`Node.js fs ${t} is not supported by JSPM core in the browser`)}function Hre(t,e,r){let a=0,i=new TextDecoder;qh.watch(t,"utf8",()=>{let{size:h}=qh.fstatSync(e),c=Me.alloc(h-a);qh.readSync(e,c,0,c.length,a),a=h,r(i.decode(c,{stream:!0}))})}function Ok(t,e){if(t.protocol==="file:")return kk(t);if(t.protocol==="https:"||t.protocol==="http:"){let r="\\\\url\\"+t.href.replaceAll(/\//g,"\\\\");if(Kre(r))return r;if(e)throw new Error(`Cannot sync request URL ${t} via FS. JSPM FS support for network URLs requires using async FS methods or priming the MemFS cache first with an async request before a sync request.`);return(async()=>{let a=await fetch(t);if(!a.ok)throw new Error(`Unable to fetch ${t.href}, ${a.status}`);let i=await a.arrayBuffer();return Wre(r,Me.from(i)),r})()}throw new Error("URL "+t+" not supported in JSPM FS implementation.")}function rxe(t){return function(e,...r){return e instanceof URL?t(Ok(e,!0),...r):t(e,...r)}}function ixe(t){return async function(e,...r){return e instanceof URL?t(await Ok(e),...r):t(e,...r)}}function nxe(t){return function(e,...r){let a=r[r.length-1];e instanceof URL&&typeof a=="function"?Ok(e).then(i=>{t(i,...r)},a):t(e,...r)}}var t2,Mre,h4,xre,$1,Sre,Bf,Ere,qn,Are,KMe,$u,Rre,D1,Tre,c4,kre,Ire,U1,Bre,so,Ore,l4,Pre,VMe,gl,Nre,r2,Cre,ui,Lre,XMe,Uh,$re,ia,Dre,Td,qa,qh,txe,Gi,axe,oxe,sxe,fxe,uxe,hxe,cxe,lxe,dxe,pxe,vxe,mxe,gxe,bxe,yxe,wxe,_xe,Kre,Mxe,xxe,Sxe,Exe,Axe,Rxe,Txe,kxe,Ixe,Bxe,Oxe,Pxe,Nxe,Cxe,Lxe,$xe,Dxe,Uxe,qxe,Fxe,jxe,zxe,Zxe,Hxe,Kxe,Wxe,Vxe,Gxe,Yxe,Jxe,Xxe,Qxe,eSe,tSe,rSe,iSe,nSe,aSe,oSe,sSe,fSe,uSe,hSe,cSe,lSe,dSe,pSe,vSe,mSe,gSe,bSe,ySe,wSe,_Se,MSe,xSe,SSe,ESe,ASe,RSe,TSe,kSe,Wre,ISe,BSe,OSe,PSe,NSe,CSe,LSe,$Se,DSe,USe,qSe,FSe,jSe,zSe,ZSe,HSe,KSe,WSe,Nk=Si(()=>{"use strict";ie();ae();ne();ah();yk();no();Fo();_k();Ks();Z0();Hs();B8();u4();Ad();Rg();co();th();Uo();Gf();Jg();Qg();t2={},Mre=!1;h4={},xre=!1;$1={},Sre=!1;Bf={},Ere=!1;qn={},Are=!1,KMe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;$u={},Rre=!1;D1={},Tre=!1;c4={},kre=!1,Ire=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;U1={},Bre=!1;so={},Ore=!1;l4={},Pre=!1,VMe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;gl={},Nre=!1;r2={},Cre=!1;ui={},Lre=!1,XMe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Uh={},$re=!1;ia={},Dre=!1;Td=exe();Td.__esModule;Td.fs;Td.createFsFromVolume;Td.vol;Td.Volume;Td.semantic;qa=Zre();qa.__esModule;qa.FSWatcher;qa.StatWatcher;qa.Volume;qa.toUnixTimestamp;qa.bufferToEncoding;qa.dataToBuffer;qa.dataToStr;qa.pathToSteps;qa.filenameToSteps;qa.pathToFilename;qa.flagsToNumber;qa.FLAGS;qa.ReadStream;qa.WriteStream;({vol:qh,createFsFromVolume:txe}=Td);qh.fromNestedJSON({"/dev":{stdin:"",stdout:"",stderr:""},"/usr/bin":{},"/home":{},"/tmp":{}});qh.releasedFds=[2,1,0];qh.openSync("/dev/stdin","w");qh.openSync("/dev/stdout","r");qh.openSync("/dev/stderr","r");Hre("/dev/stdout",1,console.log);Hre("/dev/stderr",2,console.error);Gi=txe(qh);Gi.opendir=()=>Po("opendir");Gi.opendirSync=()=>Po("opendirSync");Gi.promises.opendir=()=>Po("promises.opendir");Gi.cp=()=>Po("cp");Gi.cpSync=()=>Po("cpSync");Gi.promises.cp=()=>Po("promises.cp");Gi.readv=()=>Po("readv");Gi.readvSync=()=>Po("readvSync");Gi.rm=()=>Po("rm");Gi.rmSync=()=>Po("rmSync");Gi.promises.rm=()=>Po("promises.rm");Gi.Dir=()=>Po("Dir");Gi.promises.watch=()=>Po("promises.watch");Gi.FileReadStream=Gi.ReadStream;Gi.FileWriteStream=Gi.WriteStream;Gi.promises.readFile=ixe(Gi.promises.readFile);Gi.readFile=nxe(Gi.readFile);Gi.readFileSync=rxe(Gi.readFileSync);({appendFile:axe,appendFileSync:oxe,access:sxe,accessSync:fxe,chown:uxe,chownSync:hxe,chmod:cxe,chmodSync:lxe,close:dxe,closeSync:pxe,copyFile:vxe,copyFileSync:mxe,cp:gxe,cpSync:bxe,createReadStream:yxe,createWriteStream:wxe,exists:_xe,existsSync:Kre,fchown:Mxe,fchownSync:xxe,fchmod:Sxe,fchmodSync:Exe,fdatasync:Axe,fdatasyncSync:Rxe,fstat:Txe,fstatSync:kxe,fsync:Ixe,fsyncSync:Bxe,ftruncate:Oxe,ftruncateSync:Pxe,futimes:Nxe,futimesSync:Cxe,lchown:Lxe,lchownSync:$xe,lchmod:Dxe,lchmodSync:Uxe,link:qxe,linkSync:Fxe,lstat:jxe,lstatSync:zxe,mkdir:Zxe,mkdirSync:Hxe,mkdtemp:Kxe,mkdtempSync:Wxe,open:Vxe,openSync:Gxe,opendir:Yxe,opendirSync:Jxe,readdir:Xxe,readdirSync:Qxe,read:eSe,readSync:tSe,readv:rSe,readvSync:iSe,readFile:nSe,readFileSync:aSe,readlink:oSe,readlinkSync:sSe,realpath:fSe,realpathSync:uSe,rename:hSe,renameSync:cSe,rm:lSe,rmSync:dSe,rmdir:pSe,rmdirSync:vSe,stat:mSe,statSync:gSe,symlink:bSe,symlinkSync:ySe,truncate:wSe,truncateSync:_Se,unwatchFile:MSe,unlink:xSe,unlinkSync:SSe,utimes:ESe,utimesSync:ASe,watch:RSe,watchFile:TSe,writeFile:kSe,writeFileSync:Wre,write:ISe,writeSync:BSe,writev:OSe,writevSync:PSe,Dir:NSe,Dirent:CSe,Stats:LSe,ReadStream:$Se,WriteStream:DSe,FileReadStream:USe,FileWriteStream:qSe,_toUnixTimestamp:FSe,constants:{F_OK:jSe,R_OK:zSe,W_OK:ZSe,X_OK:HSe},constants:KSe,promises:WSe}=Gi)});var p4=ht((d4,Vre)=>{"use strict";ie();ae();ne();Object.defineProperty(d4,"__esModule",{value:!0});d4.default=VSe;function VSe(t){return t&&typeof t.length=="number"&&t.length>=0&&t.length%1===0}Vre.exports=d4.default});var Yre=ht((v4,Gre)=>{"use strict";ie();ae();ne();Object.defineProperty(v4,"__esModule",{value:!0});v4.default=function(t){return function(...e){var r=e.pop();return t.call(this,e,r)}};Gre.exports=v4.default});var Qre=ht(bl=>{"use strict";ie();ae();ne();Object.defineProperty(bl,"__esModule",{value:!0});bl.fallback=Jre;bl.wrap=Xre;var GSe=bl.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,YSe=bl.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,JSe=bl.hasNextTick=typeof He=="object"&&typeof He.nextTick=="function";function Jre(t){setTimeout(t,0)}function Xre(t){return(e,...r)=>t(()=>e(...r))}var n2;GSe?n2=queueMicrotask:YSe?n2=setImmediate:JSe?n2=He.nextTick:n2=Jre;bl.default=Xre(n2)});var nie=ht((m4,iie)=>{"use strict";ie();ae();ne();Object.defineProperty(m4,"__esModule",{value:!0});m4.default=iEe;var XSe=Yre(),QSe=rie(XSe),eEe=Qre(),tEe=rie(eEe),rEe=kd();function rie(t){return t&&t.__esModule?t:{default:t}}function iEe(t){return(0,rEe.isAsync)(t)?function(...e){let r=e.pop(),a=t.apply(this,e);return eie(a,r)}:(0,QSe.default)(function(e,r){var a;try{a=t.apply(this,e)}catch(i){return r(i)}if(a&&typeof a.then=="function")return eie(a,r);r(null,a)})}function eie(t,e){return t.then(r=>{tie(e,null,r)},r=>{tie(e,r&&(r instanceof Error||r.message)?r:new Error(r))})}function tie(t,e,r){try{t(e,r)}catch(a){(0,tEe.default)(i=>{throw i},a)}}iie.exports=m4.default});var kd=ht(Fh=>{"use strict";ie();ae();ne();Object.defineProperty(Fh,"__esModule",{value:!0});Fh.isAsyncIterable=Fh.isAsyncGenerator=Fh.isAsync=void 0;var nEe=nie(),aEe=oEe(nEe);function oEe(t){return t&&t.__esModule?t:{default:t}}function aie(t){return t[Symbol.toStringTag]==="AsyncFunction"}function sEe(t){return t[Symbol.toStringTag]==="AsyncGenerator"}function fEe(t){return typeof t[Symbol.asyncIterator]=="function"}function uEe(t){if(typeof t!="function")throw new Error("expected a function");return aie(t)?(0,aEe.default)(t):t}Fh.default=uEe;Fh.isAsync=aie;Fh.isAsyncGenerator=sEe;Fh.isAsyncIterable=fEe});var q1=ht((g4,oie)=>{"use strict";ie();ae();ne();Object.defineProperty(g4,"__esModule",{value:!0});g4.default=hEe;function hEe(t,e){if(e||(e=t.length),!e)throw new Error("arity is undefined");function r(...a){return typeof a[e-1]=="function"?t.apply(this,a):new Promise((i,h)=>{a[e-1]=(c,...p)=>{if(c)return h(c);i(p.length>1?p:p[0])},t.apply(this,a)})}return r}oie.exports=g4.default});var fie=ht((b4,sie)=>{"use strict";ie();ae();ne();Object.defineProperty(b4,"__esModule",{value:!0});var cEe=p4(),lEe=Ck(cEe),dEe=kd(),pEe=Ck(dEe),vEe=q1(),mEe=Ck(vEe);function Ck(t){return t&&t.__esModule?t:{default:t}}b4.default=(0,mEe.default)((t,e,r)=>{var a=(0,lEe.default)(e)?[]:{};t(e,(i,h,c)=>{(0,pEe.default)(i)((p,...b)=>{b.length<2&&([b]=b),a[h]=b,c(p)})},i=>r(i,a))},3);sie.exports=b4.default});var Lk=ht((y4,uie)=>{"use strict";ie();ae();ne();Object.defineProperty(y4,"__esModule",{value:!0});y4.default=gEe;function gEe(t){function e(...r){if(t!==null){var a=t;t=null,a.apply(this,r)}}return Object.assign(e,t),e}uie.exports=y4.default});var cie=ht((w4,hie)=>{"use strict";ie();ae();ne();Object.defineProperty(w4,"__esModule",{value:!0});w4.default=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()};hie.exports=w4.default});var pie=ht((_4,die)=>{"use strict";ie();ae();ne();Object.defineProperty(_4,"__esModule",{value:!0});_4.default=EEe;var bEe=p4(),yEe=lie(bEe),wEe=cie(),_Ee=lie(wEe);function lie(t){return t&&t.__esModule?t:{default:t}}function MEe(t){var e=-1,r=t.length;return function(){return++e<r?{value:t[e],key:e}:null}}function xEe(t){var e=-1;return function(){var a=t.next();return a.done?null:(e++,{value:a.value,key:e})}}function SEe(t){var e=t?Object.keys(t):[],r=-1,a=e.length;return function i(){var h=e[++r];return h==="__proto__"?i():r<a?{value:t[h],key:h}:null}}function EEe(t){if((0,yEe.default)(t))return MEe(t);var e=(0,_Ee.default)(t);return e?xEe(e):SEe(t)}die.exports=_4.default});var $k=ht((M4,vie)=>{"use strict";ie();ae();ne();Object.defineProperty(M4,"__esModule",{value:!0});M4.default=AEe;function AEe(t){return function(...e){if(t===null)throw new Error("Callback was already called.");var r=t;t=null,r.apply(this,e)}}vie.exports=M4.default});var S4=ht((x4,mie)=>{"use strict";ie();ae();ne();Object.defineProperty(x4,"__esModule",{value:!0});var REe={};x4.default=REe;mie.exports=x4.default});var bie=ht((E4,gie)=>{"use strict";ie();ae();ne();Object.defineProperty(E4,"__esModule",{value:!0});E4.default=BEe;var TEe=S4(),kEe=IEe(TEe);function IEe(t){return t&&t.__esModule?t:{default:t}}function BEe(t,e,r,a){let i=!1,h=!1,c=!1,p=0,b=0;function g(){p>=e||c||i||(c=!0,t.next().then(({value:x,done:E})=>{if(!(h||i)){if(c=!1,E){i=!0,p<=0&&a(null);return}p++,r(x,b,y),b++,g()}}).catch(M))}function y(x,E){if(p-=1,!h){if(x)return M(x);if(x===!1){i=!0,h=!0;return}if(E===kEe.default||i&&p<=0)return i=!0,a(null);g()}}function M(x){h||(c=!1,i=!0,a(x))}g()}gie.exports=E4.default});var Mie=ht((A4,_ie)=>{"use strict";ie();ae();ne();Object.defineProperty(A4,"__esModule",{value:!0});var OEe=Lk(),PEe=a2(OEe),NEe=pie(),CEe=a2(NEe),LEe=$k(),$Ee=a2(LEe),yie=kd(),DEe=bie(),wie=a2(DEe),UEe=S4(),qEe=a2(UEe);function a2(t){return t&&t.__esModule?t:{default:t}}A4.default=t=>(e,r,a)=>{if(a=(0,PEe.default)(a),t<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return a(null);if((0,yie.isAsyncGenerator)(e))return(0,wie.default)(e,t,r,a);if((0,yie.isAsyncIterable)(e))return(0,wie.default)(e[Symbol.asyncIterator](),t,r,a);var i=(0,CEe.default)(e),h=!1,c=!1,p=0,b=!1;function g(M,x){if(!c)if(p-=1,M)h=!0,a(M);else if(M===!1)h=!0,c=!0;else{if(x===qEe.default||h&&p<=0)return h=!0,a(null);b||y()}}function y(){for(b=!0;p<t&&!h;){var M=i();if(M===null){h=!0,p<=0&&a(null);return}p+=1,r(M.value,M.key,(0,$Ee.default)(g))}b=!1}y()};_ie.exports=A4.default});var Uk=ht((R4,xie)=>{"use strict";ie();ae();ne();Object.defineProperty(R4,"__esModule",{value:!0});var FEe=Mie(),jEe=Dk(FEe),zEe=kd(),ZEe=Dk(zEe),HEe=q1(),KEe=Dk(HEe);function Dk(t){return t&&t.__esModule?t:{default:t}}function WEe(t,e,r,a){return(0,jEe.default)(e)(t,(0,ZEe.default)(r),a)}R4.default=(0,KEe.default)(WEe,4);xie.exports=R4.default});var Aie=ht((T4,Eie)=>{"use strict";ie();ae();ne();Object.defineProperty(T4,"__esModule",{value:!0});var VEe=Uk(),GEe=Sie(VEe),YEe=q1(),JEe=Sie(YEe);function Sie(t){return t&&t.__esModule?t:{default:t}}function XEe(t,e,r){return(0,GEe.default)(t,1,e,r)}T4.default=(0,JEe.default)(XEe,3);Eie.exports=T4.default});var kie=ht((k4,Tie)=>{"use strict";ie();ae();ne();Object.defineProperty(k4,"__esModule",{value:!0});k4.default=iAe;var QEe=fie(),eAe=Rie(QEe),tAe=Aie(),rAe=Rie(tAe);function Rie(t){return t&&t.__esModule?t:{default:t}}function iAe(t,e){return(0,eAe.default)(rAe.default,t,e)}Tie.exports=k4.default});var Hie={};Ha(Hie,{Deflate:()=>pAe,DeflateRaw:()=>vAe,Gunzip:()=>mAe,Gzip:()=>gAe,Inflate:()=>bAe,InflateRaw:()=>yAe,Unzip:()=>wAe,Z_BEST_COMPRESSION:()=>_Ae,Z_BEST_SPEED:()=>MAe,Z_BINARY:()=>xAe,Z_BLOCK:()=>SAe,Z_BUF_ERROR:()=>EAe,Z_DATA_ERROR:()=>AAe,Z_DEFAULT_CHUNK:()=>RAe,Z_DEFAULT_COMPRESSION:()=>TAe,Z_DEFAULT_LEVEL:()=>kAe,Z_DEFAULT_MEMLEVEL:()=>IAe,Z_DEFAULT_STRATEGY:()=>BAe,Z_DEFAULT_WINDOWBITS:()=>OAe,Z_DEFLATED:()=>PAe,Z_ERRNO:()=>NAe,Z_FILTERED:()=>CAe,Z_FINISH:()=>LAe,Z_FIXED:()=>$Ae,Z_FULL_FLUSH:()=>DAe,Z_HUFFMAN_ONLY:()=>UAe,Z_MAX_CHUNK:()=>qAe,Z_MAX_LEVEL:()=>FAe,Z_MAX_MEMLEVEL:()=>jAe,Z_MAX_WINDOWBITS:()=>zAe,Z_MIN_CHUNK:()=>ZAe,Z_MIN_LEVEL:()=>HAe,Z_MIN_MEMLEVEL:()=>KAe,Z_MIN_WINDOWBITS:()=>WAe,Z_NEED_DICT:()=>VAe,Z_NO_COMPRESSION:()=>GAe,Z_NO_FLUSH:()=>YAe,Z_OK:()=>JAe,Z_PARTIAL_FLUSH:()=>XAe,Z_RLE:()=>QAe,Z_STREAM_END:()=>eRe,Z_STREAM_ERROR:()=>tRe,Z_SYNC_FLUSH:()=>rRe,Z_TEXT:()=>iRe,Z_TREES:()=>nRe,Z_UNKNOWN:()=>aRe,Zlib:()=>oRe,codes:()=>sRe,createDeflate:()=>fRe,createDeflateRaw:()=>uRe,createGunzip:()=>hRe,createGzip:()=>cRe,createInflate:()=>lRe,createInflateRaw:()=>dRe,createUnzip:()=>pRe,default:()=>At,deflate:()=>vRe,deflateRaw:()=>mRe,deflateRawSync:()=>gRe,deflateSync:()=>bRe,gunzip:()=>yRe,gunzipSync:()=>wRe,gzip:()=>_Re,gzipSync:()=>MRe,inflate:()=>xRe,inflateRaw:()=>SRe,inflateRawSync:()=>ERe,inflateSync:()=>ARe,unzip:()=>RRe,unzipSync:()=>TRe});function nAe(){if(Iie)return qk;Iie=!0;function t(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return qk=t,qk}function I4(){if(Bie)return Ba;Bie=!0;var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function e(i,h){return Object.prototype.hasOwnProperty.call(i,h)}Ba.assign=function(i){for(var h=Array.prototype.slice.call(arguments,1);h.length;){var c=h.shift();if(c){if(typeof c!="object")throw new TypeError(c+"must be non-object");for(var p in c)e(c,p)&&(i[p]=c[p])}}return i},Ba.shrinkBuf=function(i,h){return i.length===h?i:i.subarray?i.subarray(0,h):(i.length=h,i)};var r={arraySet:function(i,h,c,p,b){if(h.subarray&&i.subarray){i.set(h.subarray(c,c+p),b);return}for(var g=0;g<p;g++)i[b+g]=h[c+g]},flattenChunks:function(i){var h,c,p,b,g,y;for(p=0,h=0,c=i.length;h<c;h++)p+=i[h].length;for(y=new Uint8Array(p),b=0,h=0,c=i.length;h<c;h++)g=i[h],y.set(g,b),b+=g.length;return y}},a={arraySet:function(i,h,c,p,b){for(var g=0;g<p;g++)i[b+g]=h[c+g]},flattenChunks:function(i){return[].concat.apply([],i)}};return Ba.setTyped=function(i){i?(Ba.Buf8=Uint8Array,Ba.Buf16=Uint16Array,Ba.Buf32=Int32Array,Ba.assign(Ba,r)):(Ba.Buf8=Array,Ba.Buf16=Array,Ba.Buf32=Array,Ba.assign(Ba,a))},Ba.setTyped(t),Ba}function aAe(){if(Oie)return Id;Oie=!0;var t=I4(),e=4,r=0,a=1,i=2;function h(H){for(var W=H.length;--W>=0;)H[W]=0}var c=0,p=1,b=2,g=3,y=258,M=29,x=256,E=x+1+M,A=30,k=19,O=2*E+1,N=15,L=16,C=7,Y=256,G=16,ee=17,$=18,q=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],V=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],n=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],s=512,f=new Array((E+2)*2);h(f);var u=new Array(A*2);h(u);var l=new Array(s);h(l);var m=new Array(y-g+1);h(m);var w=new Array(M);h(w);var d=new Array(A);h(d);function o(H,W,fe,st,ue){this.static_tree=H,this.extra_bits=W,this.extra_base=fe,this.elems=st,this.max_length=ue,this.has_stree=H&&H.length}var v,R,S;function B(H,W){this.dyn_tree=H,this.max_code=0,this.stat_desc=W}function F(H){return H<256?l[H]:l[256+(H>>>7)]}function D(H,W){H.pending_buf[H.pending++]=W&255,H.pending_buf[H.pending++]=W>>>8&255}function re(H,W,fe){H.bi_valid>L-fe?(H.bi_buf|=W<<H.bi_valid&65535,D(H,H.bi_buf),H.bi_buf=W>>L-H.bi_valid,H.bi_valid+=fe-L):(H.bi_buf|=W<<H.bi_valid&65535,H.bi_valid+=fe)}function Q(H,W,fe){re(H,fe[W*2],fe[W*2+1])}function Z(H,W){var fe=0;do fe|=H&1,H>>>=1,fe<<=1;while(--W>0);return fe>>>1}function K(H){H.bi_valid===16?(D(H,H.bi_buf),H.bi_buf=0,H.bi_valid=0):H.bi_valid>=8&&(H.pending_buf[H.pending++]=H.bi_buf&255,H.bi_buf>>=8,H.bi_valid-=8)}function ce(H,W){var fe=W.dyn_tree,st=W.max_code,ue=W.stat_desc.static_tree,me=W.stat_desc.has_stree,pe=W.stat_desc.extra_bits,be=W.stat_desc.extra_base,Qe=W.stat_desc.max_length,se,ye,Ee,Fe,de,xe,lt=0;for(Fe=0;Fe<=N;Fe++)H.bl_count[Fe]=0;for(fe[H.heap[H.heap_max]*2+1]=0,se=H.heap_max+1;se<O;se++)ye=H.heap[se],Fe=fe[fe[ye*2+1]*2+1]+1,Fe>Qe&&(Fe=Qe,lt++),fe[ye*2+1]=Fe,!(ye>st)&&(H.bl_count[Fe]++,de=0,ye>=be&&(de=pe[ye-be]),xe=fe[ye*2],H.opt_len+=xe*(Fe+de),me&&(H.static_len+=xe*(ue[ye*2+1]+de)));if(lt!==0){do{for(Fe=Qe-1;H.bl_count[Fe]===0;)Fe--;H.bl_count[Fe]--,H.bl_count[Fe+1]+=2,H.bl_count[Qe]--,lt-=2}while(lt>0);for(Fe=Qe;Fe!==0;Fe--)for(ye=H.bl_count[Fe];ye!==0;)Ee=H.heap[--se],!(Ee>st)&&(fe[Ee*2+1]!==Fe&&(H.opt_len+=(Fe-fe[Ee*2+1])*fe[Ee*2],fe[Ee*2+1]=Fe),ye--)}}function te(H,W,fe){var st=new Array(N+1),ue=0,me,pe;for(me=1;me<=N;me++)st[me]=ue=ue+fe[me-1]<<1;for(pe=0;pe<=W;pe++){var be=H[pe*2+1];be!==0&&(H[pe*2]=Z(st[be]++,be))}}function j(){var H,W,fe,st,ue,me=new Array(N+1);for(fe=0,st=0;st<M-1;st++)for(w[st]=fe,H=0;H<1<<q[st];H++)m[fe++]=st;for(m[fe-1]=st,ue=0,st=0;st<16;st++)for(d[st]=ue,H=0;H<1<<V[st];H++)l[ue++]=st;for(ue>>=7;st<A;st++)for(d[st]=ue<<7,H=0;H<1<<V[st]-7;H++)l[256+ue++]=st;for(W=0;W<=N;W++)me[W]=0;for(H=0;H<=143;)f[H*2+1]=8,H++,me[8]++;for(;H<=255;)f[H*2+1]=9,H++,me[9]++;for(;H<=279;)f[H*2+1]=7,H++,me[7]++;for(;H<=287;)f[H*2+1]=8,H++,me[8]++;for(te(f,E+1,me),H=0;H<A;H++)u[H*2+1]=5,u[H*2]=Z(H,5);v=new o(f,q,x+1,E,N),R=new o(u,V,0,A,N),S=new o(new Array(0),_,0,k,C)}function J(H){var W;for(W=0;W<E;W++)H.dyn_ltree[W*2]=0;for(W=0;W<A;W++)H.dyn_dtree[W*2]=0;for(W=0;W<k;W++)H.bl_tree[W*2]=0;H.dyn_ltree[Y*2]=1,H.opt_len=H.static_len=0,H.last_lit=H.matches=0}function X(H){H.bi_valid>8?D(H,H.bi_buf):H.bi_valid>0&&(H.pending_buf[H.pending++]=H.bi_buf),H.bi_buf=0,H.bi_valid=0}function he(H,W,fe,st){X(H),st&&(D(H,fe),D(H,~fe)),t.arraySet(H.pending_buf,H.window,W,fe,H.pending),H.pending+=fe}function Te(H,W,fe,st){var ue=W*2,me=fe*2;return H[ue]<H[me]||H[ue]===H[me]&&st[W]<=st[fe]}function oe(H,W,fe){for(var st=H.heap[fe],ue=fe<<1;ue<=H.heap_len&&(ue<H.heap_len&&Te(W,H.heap[ue+1],H.heap[ue],H.depth)&&ue++,!Te(W,st,H.heap[ue],H.depth));)H.heap[fe]=H.heap[ue],fe=ue,ue<<=1;H.heap[fe]=st}function le(H,W,fe){var st,ue,me=0,pe,be;if(H.last_lit!==0)do st=H.pending_buf[H.d_buf+me*2]<<8|H.pending_buf[H.d_buf+me*2+1],ue=H.pending_buf[H.l_buf+me],me++,st===0?Q(H,ue,W):(pe=m[ue],Q(H,pe+x+1,W),be=q[pe],be!==0&&(ue-=w[pe],re(H,ue,be)),st--,pe=F(st),Q(H,pe,fe),be=V[pe],be!==0&&(st-=d[pe],re(H,st,be)));while(me<H.last_lit);Q(H,Y,W)}function ot(H,W){var fe=W.dyn_tree,st=W.stat_desc.static_tree,ue=W.stat_desc.has_stree,me=W.stat_desc.elems,pe,be,Qe=-1,se;for(H.heap_len=0,H.heap_max=O,pe=0;pe<me;pe++)fe[pe*2]!==0?(H.heap[++H.heap_len]=Qe=pe,H.depth[pe]=0):fe[pe*2+1]=0;for(;H.heap_len<2;)se=H.heap[++H.heap_len]=Qe<2?++Qe:0,fe[se*2]=1,H.depth[se]=0,H.opt_len--,ue&&(H.static_len-=st[se*2+1]);for(W.max_code=Qe,pe=H.heap_len>>1;pe>=1;pe--)oe(H,fe,pe);se=me;do pe=H.heap[1],H.heap[1]=H.heap[H.heap_len--],oe(H,fe,1),be=H.heap[1],H.heap[--H.heap_max]=pe,H.heap[--H.heap_max]=be,fe[se*2]=fe[pe*2]+fe[be*2],H.depth[se]=(H.depth[pe]>=H.depth[be]?H.depth[pe]:H.depth[be])+1,fe[pe*2+1]=fe[be*2+1]=se,H.heap[1]=se++,oe(H,fe,1);while(H.heap_len>=2);H.heap[--H.heap_max]=H.heap[1],ce(H,W),te(fe,Qe,H.bl_count)}function ge(H,W,fe){var st,ue=-1,me,pe=W[0*2+1],be=0,Qe=7,se=4;for(pe===0&&(Qe=138,se=3),W[(fe+1)*2+1]=65535,st=0;st<=fe;st++)me=pe,pe=W[(st+1)*2+1],!(++be<Qe&&me===pe)&&(be<se?H.bl_tree[me*2]+=be:me!==0?(me!==ue&&H.bl_tree[me*2]++,H.bl_tree[G*2]++):be<=10?H.bl_tree[ee*2]++:H.bl_tree[$*2]++,be=0,ue=me,pe===0?(Qe=138,se=3):me===pe?(Qe=6,se=3):(Qe=7,se=4))}function Se(H,W,fe){var st,ue=-1,me,pe=W[0*2+1],be=0,Qe=7,se=4;for(pe===0&&(Qe=138,se=3),st=0;st<=fe;st++)if(me=pe,pe=W[(st+1)*2+1],!(++be<Qe&&me===pe)){if(be<se)do Q(H,me,H.bl_tree);while(--be!==0);else me!==0?(me!==ue&&(Q(H,me,H.bl_tree),be--),Q(H,G,H.bl_tree),re(H,be-3,2)):be<=10?(Q(H,ee,H.bl_tree),re(H,be-3,3)):(Q(H,$,H.bl_tree),re(H,be-11,7));be=0,ue=me,pe===0?(Qe=138,se=3):me===pe?(Qe=6,se=3):(Qe=7,se=4)}}function ut(H){var W;for(ge(H,H.dyn_ltree,H.l_desc.max_code),ge(H,H.dyn_dtree,H.d_desc.max_code),ot(H,H.bl_desc),W=k-1;W>=3&&H.bl_tree[n[W]*2+1]===0;W--);return H.opt_len+=3*(W+1)+5+5+4,W}function Ze(H,W,fe,st){var ue;for(re(H,W-257,5),re(H,fe-1,5),re(H,st-4,4),ue=0;ue<st;ue++)re(H,H.bl_tree[n[ue]*2+1],3);Se(H,H.dyn_ltree,W-1),Se(H,H.dyn_dtree,fe-1)}function Ge(H){var W=4093624447,fe;for(fe=0;fe<=31;fe++,W>>>=1)if(W&1&&H.dyn_ltree[fe*2]!==0)return r;if(H.dyn_ltree[9*2]!==0||H.dyn_ltree[10*2]!==0||H.dyn_ltree[13*2]!==0)return a;for(fe=32;fe<x;fe++)if(H.dyn_ltree[fe*2]!==0)return a;return r}var ct=!1;function z(H){ct||(j(),ct=!0),H.l_desc=new B(H.dyn_ltree,v),H.d_desc=new B(H.dyn_dtree,R),H.bl_desc=new B(H.bl_tree,S),H.bi_buf=0,H.bi_valid=0,J(H)}function T(H,W,fe,st){re(H,(c<<1)+(st?1:0),3),he(H,W,fe,!0)}function I(H){re(H,p<<1,3),Q(H,Y,f),K(H)}function P(H,W,fe,st){var ue,me,pe=0;H.level>0?(H.strm.data_type===i&&(H.strm.data_type=Ge(H)),ot(H,H.l_desc),ot(H,H.d_desc),pe=ut(H),ue=H.opt_len+3+7>>>3,me=H.static_len+3+7>>>3,me<=ue&&(ue=me)):ue=me=fe+5,fe+4<=ue&&W!==-1?T(H,W,fe,st):H.strategy===e||me===ue?(re(H,(p<<1)+(st?1:0),3),le(H,f,u)):(re(H,(b<<1)+(st?1:0),3),Ze(H,H.l_desc.max_code+1,H.d_desc.max_code+1,pe+1),le(H,H.dyn_ltree,H.dyn_dtree)),J(H),st&&X(H)}function U(H,W,fe){return H.pending_buf[H.d_buf+H.last_lit*2]=W>>>8&255,H.pending_buf[H.d_buf+H.last_lit*2+1]=W&255,H.pending_buf[H.l_buf+H.last_lit]=fe&255,H.last_lit++,W===0?H.dyn_ltree[fe*2]++:(H.matches++,W--,H.dyn_ltree[(m[fe]+x+1)*2]++,H.dyn_dtree[F(W)*2]++),H.last_lit===H.lit_bufsize-1}return Id._tr_init=z,Id._tr_stored_block=T,Id._tr_flush_block=P,Id._tr_tally=U,Id._tr_align=I,Id}function zie(){if(Pie)return Fk;Pie=!0;function t(e,r,a,i){for(var h=e&65535|0,c=e>>>16&65535|0,p=0;a!==0;){p=a>2e3?2e3:a,a-=p;do h=h+r[i++]|0,c=c+h|0;while(--p);h%=65521,c%=65521}return h|c<<16|0}return Fk=t,Fk}function Zie(){if(Nie)return jk;Nie=!0;function t(){for(var a,i=[],h=0;h<256;h++){a=h;for(var c=0;c<8;c++)a=a&1?3988292384^a>>>1:a>>>1;i[h]=a}return i}var e=t();function r(a,i,h,c){var p=e,b=c+h;a^=-1;for(var g=c;g<b;g++)a=a>>>8^p[(a^i[g])&255];return a^-1}return jk=r,jk}function oAe(){return Cie||(Cie=!0,zk={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),zk}function sAe(){if(Lie)return Of;Lie=!0;var t=I4(),e=aAe(),r=zie(),a=Zie(),i=oAe(),h=0,c=1,p=3,b=4,g=5,y=0,M=1,x=-2,E=-3,A=-5,k=-1,O=1,N=2,L=3,C=4,Y=0,G=2,ee=8,$=9,q=15,V=8,_=29,n=256,s=n+1+_,f=30,u=19,l=2*s+1,m=15,w=3,d=258,o=d+w+1,v=32,R=42,S=69,B=73,F=91,D=103,re=113,Q=666,Z=1,K=2,ce=3,te=4,j=3;function J(se,ye){return se.msg=i[ye],ye}function X(se){return(se<<1)-(se>4?9:0)}function he(se){for(var ye=se.length;--ye>=0;)se[ye]=0}function Te(se){var ye=se.state,Ee=ye.pending;Ee>se.avail_out&&(Ee=se.avail_out),Ee!==0&&(t.arraySet(se.output,ye.pending_buf,ye.pending_out,Ee,se.next_out),se.next_out+=Ee,ye.pending_out+=Ee,se.total_out+=Ee,se.avail_out-=Ee,ye.pending-=Ee,ye.pending===0&&(ye.pending_out=0))}function oe(se,ye){e._tr_flush_block(se,se.block_start>=0?se.block_start:-1,se.strstart-se.block_start,ye),se.block_start=se.strstart,Te(se.strm)}function le(se,ye){se.pending_buf[se.pending++]=ye}function ot(se,ye){se.pending_buf[se.pending++]=ye>>>8&255,se.pending_buf[se.pending++]=ye&255}function ge(se,ye,Ee,Fe){var de=se.avail_in;return de>Fe&&(de=Fe),de===0?0:(se.avail_in-=de,t.arraySet(ye,se.input,se.next_in,de,Ee),se.state.wrap===1?se.adler=r(se.adler,ye,de,Ee):se.state.wrap===2&&(se.adler=a(se.adler,ye,de,Ee)),se.next_in+=de,se.total_in+=de,de)}function Se(se,ye){var Ee=se.max_chain_length,Fe=se.strstart,de,xe,lt=se.prev_length,_e=se.nice_match,Ve=se.strstart>se.w_size-o?se.strstart-(se.w_size-o):0,vt=se.window,Ye=se.w_mask,et=se.prev,mt=se.strstart+d,We=vt[Fe+lt-1],nt=vt[Fe+lt];se.prev_length>=se.good_match&&(Ee>>=2),_e>se.lookahead&&(_e=se.lookahead);do if(de=ye,!(vt[de+lt]!==nt||vt[de+lt-1]!==We||vt[de]!==vt[Fe]||vt[++de]!==vt[Fe+1])){Fe+=2,de++;do;while(vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&Fe<mt);if(xe=d-(mt-Fe),Fe=mt-d,xe>lt){if(se.match_start=ye,lt=xe,xe>=_e)break;We=vt[Fe+lt-1],nt=vt[Fe+lt]}}while((ye=et[ye&Ye])>Ve&&--Ee!==0);return lt<=se.lookahead?lt:se.lookahead}function ut(se){var ye=se.w_size,Ee,Fe,de,xe,lt;do{if(xe=se.window_size-se.lookahead-se.strstart,se.strstart>=ye+(ye-o)){t.arraySet(se.window,se.window,ye,ye,0),se.match_start-=ye,se.strstart-=ye,se.block_start-=ye,Fe=se.hash_size,Ee=Fe;do de=se.head[--Ee],se.head[Ee]=de>=ye?de-ye:0;while(--Fe);Fe=ye,Ee=Fe;do de=se.prev[--Ee],se.prev[Ee]=de>=ye?de-ye:0;while(--Fe);xe+=ye}if(se.strm.avail_in===0)break;if(Fe=ge(se.strm,se.window,se.strstart+se.lookahead,xe),se.lookahead+=Fe,se.lookahead+se.insert>=w)for(lt=se.strstart-se.insert,se.ins_h=se.window[lt],se.ins_h=(se.ins_h<<se.hash_shift^se.window[lt+1])&se.hash_mask;se.insert&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[lt+w-1])&se.hash_mask,se.prev[lt&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=lt,lt++,se.insert--,!(se.lookahead+se.insert<w)););}while(se.lookahead<o&&se.strm.avail_in!==0)}function Ze(se,ye){var Ee=65535;for(Ee>se.pending_buf_size-5&&(Ee=se.pending_buf_size-5);;){if(se.lookahead<=1){if(ut(se),se.lookahead===0&&ye===h)return Z;if(se.lookahead===0)break}se.strstart+=se.lookahead,se.lookahead=0;var Fe=se.block_start+Ee;if((se.strstart===0||se.strstart>=Fe)&&(se.lookahead=se.strstart-Fe,se.strstart=Fe,oe(se,!1),se.strm.avail_out===0)||se.strstart-se.block_start>=se.w_size-o&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):(se.strstart>se.block_start&&(oe(se,!1),se.strm.avail_out===0),Z)}function Ge(se,ye){for(var Ee,Fe;;){if(se.lookahead<o){if(ut(se),se.lookahead<o&&ye===h)return Z;if(se.lookahead===0)break}if(Ee=0,se.lookahead>=w&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),Ee!==0&&se.strstart-Ee<=se.w_size-o&&(se.match_length=Se(se,Ee)),se.match_length>=w)if(Fe=e._tr_tally(se,se.strstart-se.match_start,se.match_length-w),se.lookahead-=se.match_length,se.match_length<=se.max_lazy_match&&se.lookahead>=w){se.match_length--;do se.strstart++,se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart;while(--se.match_length!==0);se.strstart++}else se.strstart+=se.match_length,se.match_length=0,se.ins_h=se.window[se.strstart],se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+1])&se.hash_mask;else Fe=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++;if(Fe&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=se.strstart<w-1?se.strstart:w-1,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function ct(se,ye){for(var Ee,Fe,de;;){if(se.lookahead<o){if(ut(se),se.lookahead<o&&ye===h)return Z;if(se.lookahead===0)break}if(Ee=0,se.lookahead>=w&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),se.prev_length=se.match_length,se.prev_match=se.match_start,se.match_length=w-1,Ee!==0&&se.prev_length<se.max_lazy_match&&se.strstart-Ee<=se.w_size-o&&(se.match_length=Se(se,Ee),se.match_length<=5&&(se.strategy===O||se.match_length===w&&se.strstart-se.match_start>4096)&&(se.match_length=w-1)),se.prev_length>=w&&se.match_length<=se.prev_length){de=se.strstart+se.lookahead-w,Fe=e._tr_tally(se,se.strstart-1-se.prev_match,se.prev_length-w),se.lookahead-=se.prev_length-1,se.prev_length-=2;do++se.strstart<=de&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart);while(--se.prev_length!==0);if(se.match_available=0,se.match_length=w-1,se.strstart++,Fe&&(oe(se,!1),se.strm.avail_out===0))return Z}else if(se.match_available){if(Fe=e._tr_tally(se,0,se.window[se.strstart-1]),Fe&&oe(se,!1),se.strstart++,se.lookahead--,se.strm.avail_out===0)return Z}else se.match_available=1,se.strstart++,se.lookahead--}return se.match_available&&(Fe=e._tr_tally(se,0,se.window[se.strstart-1]),se.match_available=0),se.insert=se.strstart<w-1?se.strstart:w-1,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function z(se,ye){for(var Ee,Fe,de,xe,lt=se.window;;){if(se.lookahead<=d){if(ut(se),se.lookahead<=d&&ye===h)return Z;if(se.lookahead===0)break}if(se.match_length=0,se.lookahead>=w&&se.strstart>0&&(de=se.strstart-1,Fe=lt[de],Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de])){xe=se.strstart+d;do;while(Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&Fe===lt[++de]&&de<xe);se.match_length=d-(xe-de),se.match_length>se.lookahead&&(se.match_length=se.lookahead)}if(se.match_length>=w?(Ee=e._tr_tally(se,1,se.match_length-w),se.lookahead-=se.match_length,se.strstart+=se.match_length,se.match_length=0):(Ee=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++),Ee&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function T(se,ye){for(var Ee;;){if(se.lookahead===0&&(ut(se),se.lookahead===0)){if(ye===h)return Z;break}if(se.match_length=0,Ee=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++,Ee&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?ce:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function I(se,ye,Ee,Fe,de){this.good_length=se,this.max_lazy=ye,this.nice_length=Ee,this.max_chain=Fe,this.func=de}var P;P=[new I(0,0,0,0,Ze),new I(4,4,8,4,Ge),new I(4,5,16,8,Ge),new I(4,6,32,32,Ge),new I(4,4,16,16,ct),new I(8,16,32,32,ct),new I(8,16,128,128,ct),new I(8,32,128,256,ct),new I(32,128,258,1024,ct),new I(32,258,258,4096,ct)];function U(se){se.window_size=2*se.w_size,he(se.head),se.max_lazy_match=P[se.level].max_lazy,se.good_match=P[se.level].good_length,se.nice_match=P[se.level].nice_length,se.max_chain_length=P[se.level].max_chain,se.strstart=0,se.block_start=0,se.lookahead=0,se.insert=0,se.match_length=se.prev_length=w-1,se.match_available=0,se.ins_h=0}function H(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ee,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new t.Buf16(l*2),this.dyn_dtree=new t.Buf16((2*f+1)*2),this.bl_tree=new t.Buf16((2*u+1)*2),he(this.dyn_ltree),he(this.dyn_dtree),he(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(m+1),this.heap=new t.Buf16(2*s+1),he(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*s+1),he(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function W(se){var ye;return!se||!se.state?J(se,x):(se.total_in=se.total_out=0,se.data_type=G,ye=se.state,ye.pending=0,ye.pending_out=0,ye.wrap<0&&(ye.wrap=-ye.wrap),ye.status=ye.wrap?R:re,se.adler=ye.wrap===2?0:1,ye.last_flush=h,e._tr_init(ye),y)}function fe(se){var ye=W(se);return ye===y&&U(se.state),ye}function st(se,ye){return!se||!se.state||se.state.wrap!==2?x:(se.state.gzhead=ye,y)}function ue(se,ye,Ee,Fe,de,xe){if(!se)return x;var lt=1;if(ye===k&&(ye=6),Fe<0?(lt=0,Fe=-Fe):Fe>15&&(lt=2,Fe-=16),de<1||de>$||Ee!==ee||Fe<8||Fe>15||ye<0||ye>9||xe<0||xe>C)return J(se,x);Fe===8&&(Fe=9);var _e=new H;return se.state=_e,_e.strm=se,_e.wrap=lt,_e.gzhead=null,_e.w_bits=Fe,_e.w_size=1<<_e.w_bits,_e.w_mask=_e.w_size-1,_e.hash_bits=de+7,_e.hash_size=1<<_e.hash_bits,_e.hash_mask=_e.hash_size-1,_e.hash_shift=~~((_e.hash_bits+w-1)/w),_e.window=new t.Buf8(_e.w_size*2),_e.head=new t.Buf16(_e.hash_size),_e.prev=new t.Buf16(_e.w_size),_e.lit_bufsize=1<<de+6,_e.pending_buf_size=_e.lit_bufsize*4,_e.pending_buf=new t.Buf8(_e.pending_buf_size),_e.d_buf=1*_e.lit_bufsize,_e.l_buf=3*_e.lit_bufsize,_e.level=ye,_e.strategy=xe,_e.method=Ee,fe(se)}function me(se,ye){return ue(se,ye,ee,q,V,Y)}function pe(se,ye){var Ee,Fe,de,xe;if(!se||!se.state||ye>g||ye<0)return se?J(se,x):x;if(Fe=se.state,!se.output||!se.input&&se.avail_in!==0||Fe.status===Q&&ye!==b)return J(se,se.avail_out===0?A:x);if(Fe.strm=se,Ee=Fe.last_flush,Fe.last_flush=ye,Fe.status===R)if(Fe.wrap===2)se.adler=0,le(Fe,31),le(Fe,139),le(Fe,8),Fe.gzhead?(le(Fe,(Fe.gzhead.text?1:0)+(Fe.gzhead.hcrc?2:0)+(Fe.gzhead.extra?4:0)+(Fe.gzhead.name?8:0)+(Fe.gzhead.comment?16:0)),le(Fe,Fe.gzhead.time&255),le(Fe,Fe.gzhead.time>>8&255),le(Fe,Fe.gzhead.time>>16&255),le(Fe,Fe.gzhead.time>>24&255),le(Fe,Fe.level===9?2:Fe.strategy>=N||Fe.level<2?4:0),le(Fe,Fe.gzhead.os&255),Fe.gzhead.extra&&Fe.gzhead.extra.length&&(le(Fe,Fe.gzhead.extra.length&255),le(Fe,Fe.gzhead.extra.length>>8&255)),Fe.gzhead.hcrc&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending,0)),Fe.gzindex=0,Fe.status=S):(le(Fe,0),le(Fe,0),le(Fe,0),le(Fe,0),le(Fe,0),le(Fe,Fe.level===9?2:Fe.strategy>=N||Fe.level<2?4:0),le(Fe,j),Fe.status=re);else{var lt=ee+(Fe.w_bits-8<<4)<<8,_e=-1;Fe.strategy>=N||Fe.level<2?_e=0:Fe.level<6?_e=1:Fe.level===6?_e=2:_e=3,lt|=_e<<6,Fe.strstart!==0&&(lt|=v),lt+=31-lt%31,Fe.status=re,ot(Fe,lt),Fe.strstart!==0&&(ot(Fe,se.adler>>>16),ot(Fe,se.adler&65535)),se.adler=1}if(Fe.status===S)if(Fe.gzhead.extra){for(de=Fe.pending;Fe.gzindex<(Fe.gzhead.extra.length&65535)&&!(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size));)le(Fe,Fe.gzhead.extra[Fe.gzindex]&255),Fe.gzindex++;Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Fe.gzindex===Fe.gzhead.extra.length&&(Fe.gzindex=0,Fe.status=B)}else Fe.status=B;if(Fe.status===B)if(Fe.gzhead.name){de=Fe.pending;do{if(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size)){xe=1;break}Fe.gzindex<Fe.gzhead.name.length?xe=Fe.gzhead.name.charCodeAt(Fe.gzindex++)&255:xe=0,le(Fe,xe)}while(xe!==0);Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),xe===0&&(Fe.gzindex=0,Fe.status=F)}else Fe.status=F;if(Fe.status===F)if(Fe.gzhead.comment){de=Fe.pending;do{if(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size)){xe=1;break}Fe.gzindex<Fe.gzhead.comment.length?xe=Fe.gzhead.comment.charCodeAt(Fe.gzindex++)&255:xe=0,le(Fe,xe)}while(xe!==0);Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),xe===0&&(Fe.status=D)}else Fe.status=D;if(Fe.status===D&&(Fe.gzhead.hcrc?(Fe.pending+2>Fe.pending_buf_size&&Te(se),Fe.pending+2<=Fe.pending_buf_size&&(le(Fe,se.adler&255),le(Fe,se.adler>>8&255),se.adler=0,Fe.status=re)):Fe.status=re),Fe.pending!==0){if(Te(se),se.avail_out===0)return Fe.last_flush=-1,y}else if(se.avail_in===0&&X(ye)<=X(Ee)&&ye!==b)return J(se,A);if(Fe.status===Q&&se.avail_in!==0)return J(se,A);if(se.avail_in!==0||Fe.lookahead!==0||ye!==h&&Fe.status!==Q){var Ve=Fe.strategy===N?T(Fe,ye):Fe.strategy===L?z(Fe,ye):P[Fe.level].func(Fe,ye);if((Ve===ce||Ve===te)&&(Fe.status=Q),Ve===Z||Ve===ce)return se.avail_out===0&&(Fe.last_flush=-1),y;if(Ve===K&&(ye===c?e._tr_align(Fe):ye!==g&&(e._tr_stored_block(Fe,0,0,!1),ye===p&&(he(Fe.head),Fe.lookahead===0&&(Fe.strstart=0,Fe.block_start=0,Fe.insert=0))),Te(se),se.avail_out===0))return Fe.last_flush=-1,y}return ye!==b?y:Fe.wrap<=0?M:(Fe.wrap===2?(le(Fe,se.adler&255),le(Fe,se.adler>>8&255),le(Fe,se.adler>>16&255),le(Fe,se.adler>>24&255),le(Fe,se.total_in&255),le(Fe,se.total_in>>8&255),le(Fe,se.total_in>>16&255),le(Fe,se.total_in>>24&255)):(ot(Fe,se.adler>>>16),ot(Fe,se.adler&65535)),Te(se),Fe.wrap>0&&(Fe.wrap=-Fe.wrap),Fe.pending!==0?y:M)}function be(se){var ye;return!se||!se.state?x:(ye=se.state.status,ye!==R&&ye!==S&&ye!==B&&ye!==F&&ye!==D&&ye!==re&&ye!==Q?J(se,x):(se.state=null,ye===re?J(se,E):y))}function Qe(se,ye){var Ee=ye.length,Fe,de,xe,lt,_e,Ve,vt,Ye;if(!se||!se.state||(Fe=se.state,lt=Fe.wrap,lt===2||lt===1&&Fe.status!==R||Fe.lookahead))return x;for(lt===1&&(se.adler=r(se.adler,ye,Ee,0)),Fe.wrap=0,Ee>=Fe.w_size&&(lt===0&&(he(Fe.head),Fe.strstart=0,Fe.block_start=0,Fe.insert=0),Ye=new t.Buf8(Fe.w_size),t.arraySet(Ye,ye,Ee-Fe.w_size,Fe.w_size,0),ye=Ye,Ee=Fe.w_size),_e=se.avail_in,Ve=se.next_in,vt=se.input,se.avail_in=Ee,se.next_in=0,se.input=ye,ut(Fe);Fe.lookahead>=w;){de=Fe.strstart,xe=Fe.lookahead-(w-1);do Fe.ins_h=(Fe.ins_h<<Fe.hash_shift^Fe.window[de+w-1])&Fe.hash_mask,Fe.prev[de&Fe.w_mask]=Fe.head[Fe.ins_h],Fe.head[Fe.ins_h]=de,de++;while(--xe);Fe.strstart=de,Fe.lookahead=w-1,ut(Fe)}return Fe.strstart+=Fe.lookahead,Fe.block_start=Fe.strstart,Fe.insert=Fe.lookahead,Fe.lookahead=0,Fe.match_length=Fe.prev_length=w-1,Fe.match_available=0,se.next_in=Ve,se.input=vt,se.avail_in=_e,Fe.wrap=lt,y}return Of.deflateInit=me,Of.deflateInit2=ue,Of.deflateReset=fe,Of.deflateResetKeep=W,Of.deflateSetHeader=st,Of.deflate=pe,Of.deflateEnd=be,Of.deflateSetDictionary=Qe,Of.deflateInfo="pako deflate (from Nodeca project)",Of}function fAe(){if($ie)return Zk;$ie=!0;var t=30,e=12;return Zk=function(a,i){var h,c,p,b,g,y,M,x,E,A,k,O,N,L,C,Y,G,ee,$,q,V,_,n,s,f;h=a.state,c=a.next_in,s=a.input,p=c+(a.avail_in-5),b=a.next_out,f=a.output,g=b-(i-a.avail_out),y=b+(a.avail_out-257),M=h.dmax,x=h.wsize,E=h.whave,A=h.wnext,k=h.window,O=h.hold,N=h.bits,L=h.lencode,C=h.distcode,Y=(1<<h.lenbits)-1,G=(1<<h.distbits)-1;e:do{N<15&&(O+=s[c++]<<N,N+=8,O+=s[c++]<<N,N+=8),ee=L[O&Y];t:for(;;){if($=ee>>>24,O>>>=$,N-=$,$=ee>>>16&255,$===0)f[b++]=ee&65535;else if($&16){q=ee&65535,$&=15,$&&(N<$&&(O+=s[c++]<<N,N+=8),q+=O&(1<<$)-1,O>>>=$,N-=$),N<15&&(O+=s[c++]<<N,N+=8,O+=s[c++]<<N,N+=8),ee=C[O&G];r:for(;;){if($=ee>>>24,O>>>=$,N-=$,$=ee>>>16&255,$&16){if(V=ee&65535,$&=15,N<$&&(O+=s[c++]<<N,N+=8,N<$&&(O+=s[c++]<<N,N+=8)),V+=O&(1<<$)-1,V>M){a.msg="invalid distance too far back",h.mode=t;break e}if(O>>>=$,N-=$,$=b-g,V>$){if($=V-$,$>E&&h.sane){a.msg="invalid distance too far back",h.mode=t;break e}if(_=0,n=k,A===0){if(_+=x-$,$<q){q-=$;do f[b++]=k[_++];while(--$);_=b-V,n=f}}else if(A<$){if(_+=x+A-$,$-=A,$<q){q-=$;do f[b++]=k[_++];while(--$);if(_=0,A<q){$=A,q-=$;do f[b++]=k[_++];while(--$);_=b-V,n=f}}}else if(_+=A-$,$<q){q-=$;do f[b++]=k[_++];while(--$);_=b-V,n=f}for(;q>2;)f[b++]=n[_++],f[b++]=n[_++],f[b++]=n[_++],q-=3;q&&(f[b++]=n[_++],q>1&&(f[b++]=n[_++]))}else{_=b-V;do f[b++]=f[_++],f[b++]=f[_++],f[b++]=f[_++],q-=3;while(q>2);q&&(f[b++]=f[_++],q>1&&(f[b++]=f[_++]))}}else if($&64){a.msg="invalid distance code",h.mode=t;break e}else{ee=C[(ee&65535)+(O&(1<<$)-1)];continue r}break}}else if($&64)if($&32){h.mode=e;break e}else{a.msg="invalid literal/length code",h.mode=t;break e}else{ee=L[(ee&65535)+(O&(1<<$)-1)];continue t}break}}while(c<p&&b<y);q=N>>3,c-=q,N-=q<<3,O&=(1<<N)-1,a.next_in=c,a.next_out=b,a.avail_in=c<p?5+(p-c):5-(c-p),a.avail_out=b<y?257+(y-b):257-(b-y),h.hold=O,h.bits=N},Zk}function uAe(){if(Die)return Hk;Die=!0;var t=I4(),e=15,r=852,a=592,i=0,h=1,c=2,p=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],b=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],g=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],y=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return Hk=function(x,E,A,k,O,N,L,C){var Y=C.bits,G=0,ee=0,$=0,q=0,V=0,_=0,n=0,s=0,f=0,u=0,l,m,w,d,o,v=null,R=0,S,B=new t.Buf16(e+1),F=new t.Buf16(e+1),D=null,re=0,Q,Z,K;for(G=0;G<=e;G++)B[G]=0;for(ee=0;ee<k;ee++)B[E[A+ee]]++;for(V=Y,q=e;q>=1&&B[q]===0;q--);if(V>q&&(V=q),q===0)return O[N++]=1<<24|64<<16|0,O[N++]=1<<24|64<<16|0,C.bits=1,0;for($=1;$<q&&B[$]===0;$++);for(V<$&&(V=$),s=1,G=1;G<=e;G++)if(s<<=1,s-=B[G],s<0)return-1;if(s>0&&(x===i||q!==1))return-1;for(F[1]=0,G=1;G<e;G++)F[G+1]=F[G]+B[G];for(ee=0;ee<k;ee++)E[A+ee]!==0&&(L[F[E[A+ee]]++]=ee);if(x===i?(v=D=L,S=19):x===h?(v=p,R-=257,D=b,re-=257,S=256):(v=g,D=y,S=-1),u=0,ee=0,G=$,o=N,_=V,n=0,w=-1,f=1<<V,d=f-1,x===h&&f>r||x===c&&f>a)return 1;for(;;){Q=G-n,L[ee]<S?(Z=0,K=L[ee]):L[ee]>S?(Z=D[re+L[ee]],K=v[R+L[ee]]):(Z=96,K=0),l=1<<G-n,m=1<<_,$=m;do m-=l,O[o+(u>>n)+m]=Q<<24|Z<<16|K|0;while(m!==0);for(l=1<<G-1;u&l;)l>>=1;if(l!==0?(u&=l-1,u+=l):u=0,ee++,--B[G]===0){if(G===q)break;G=E[A+L[ee]]}if(G>V&&(u&d)!==w){for(n===0&&(n=V),o+=$,_=G-n,s=1<<_;_+n<q&&(s-=B[_+n],!(s<=0));)_++,s<<=1;if(f+=1<<_,x===h&&f>r||x===c&&f>a)return 1;w=u&d,O[w]=V<<24|_<<16|o-N|0}}return u!==0&&(O[o+u]=G-n<<24|64<<16|0),C.bits=V,0},Hk}function hAe(){if(Uie)return Ns;Uie=!0;var t=I4(),e=zie(),r=Zie(),a=fAe(),i=uAe(),h=0,c=1,p=2,b=4,g=5,y=6,M=0,x=1,E=2,A=-2,k=-3,O=-4,N=-5,L=8,C=1,Y=2,G=3,ee=4,$=5,q=6,V=7,_=8,n=9,s=10,f=11,u=12,l=13,m=14,w=15,d=16,o=17,v=18,R=19,S=20,B=21,F=22,D=23,re=24,Q=25,Z=26,K=27,ce=28,te=29,j=30,J=31,X=32,he=852,Te=592,oe=15,le=oe;function ot(ue){return(ue>>>24&255)+(ue>>>8&65280)+((ue&65280)<<8)+((ue&255)<<24)}function ge(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Se(ue){var me;return!ue||!ue.state?A:(me=ue.state,ue.total_in=ue.total_out=me.total=0,ue.msg="",me.wrap&&(ue.adler=me.wrap&1),me.mode=C,me.last=0,me.havedict=0,me.dmax=32768,me.head=null,me.hold=0,me.bits=0,me.lencode=me.lendyn=new t.Buf32(he),me.distcode=me.distdyn=new t.Buf32(Te),me.sane=1,me.back=-1,M)}function ut(ue){var me;return!ue||!ue.state?A:(me=ue.state,me.wsize=0,me.whave=0,me.wnext=0,Se(ue))}function Ze(ue,me){var pe,be;return!ue||!ue.state||(be=ue.state,me<0?(pe=0,me=-me):(pe=(me>>4)+1,me<48&&(me&=15)),me&&(me<8||me>15))?A:(be.window!==null&&be.wbits!==me&&(be.window=null),be.wrap=pe,be.wbits=me,ut(ue))}function Ge(ue,me){var pe,be;return ue?(be=new ge,ue.state=be,be.window=null,pe=Ze(ue,me),pe!==M&&(ue.state=null),pe):A}function ct(ue){return Ge(ue,le)}var z=!0,T,I;function P(ue){if(z){var me;for(T=new t.Buf32(512),I=new t.Buf32(32),me=0;me<144;)ue.lens[me++]=8;for(;me<256;)ue.lens[me++]=9;for(;me<280;)ue.lens[me++]=7;for(;me<288;)ue.lens[me++]=8;for(i(c,ue.lens,0,288,T,0,ue.work,{bits:9}),me=0;me<32;)ue.lens[me++]=5;i(p,ue.lens,0,32,I,0,ue.work,{bits:5}),z=!1}ue.lencode=T,ue.lenbits=9,ue.distcode=I,ue.distbits=5}function U(ue,me,pe,be){var Qe,se=ue.state;return se.window===null&&(se.wsize=1<<se.wbits,se.wnext=0,se.whave=0,se.window=new t.Buf8(se.wsize)),be>=se.wsize?(t.arraySet(se.window,me,pe-se.wsize,se.wsize,0),se.wnext=0,se.whave=se.wsize):(Qe=se.wsize-se.wnext,Qe>be&&(Qe=be),t.arraySet(se.window,me,pe-be,Qe,se.wnext),be-=Qe,be?(t.arraySet(se.window,me,pe-be,be,0),se.wnext=be,se.whave=se.wsize):(se.wnext+=Qe,se.wnext===se.wsize&&(se.wnext=0),se.whave<se.wsize&&(se.whave+=Qe))),0}function H(ue,me){var pe,be,Qe,se,ye,Ee,Fe,de,xe,lt,_e,Ve,vt,Ye,et=0,mt,We,nt,bt,Je,at,yt,Xe,it=new t.Buf8(4),_t,dt,Mt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!ue||!ue.state||!ue.output||!ue.input&&ue.avail_in!==0)return A;pe=ue.state,pe.mode===u&&(pe.mode=l),ye=ue.next_out,Qe=ue.output,Fe=ue.avail_out,se=ue.next_in,be=ue.input,Ee=ue.avail_in,de=pe.hold,xe=pe.bits,lt=Ee,_e=Fe,Xe=M;e:for(;;)switch(pe.mode){case C:if(pe.wrap===0){pe.mode=l;break}for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.wrap&2&&de===35615){pe.check=0,it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0),de=0,xe=0,pe.mode=Y;break}if(pe.flags=0,pe.head&&(pe.head.done=!1),!(pe.wrap&1)||(((de&255)<<8)+(de>>8))%31){ue.msg="incorrect header check",pe.mode=j;break}if((de&15)!==L){ue.msg="unknown compression method",pe.mode=j;break}if(de>>>=4,xe-=4,yt=(de&15)+8,pe.wbits===0)pe.wbits=yt;else if(yt>pe.wbits){ue.msg="invalid window size",pe.mode=j;break}pe.dmax=1<<yt,ue.adler=pe.check=1,pe.mode=de&512?s:u,de=0,xe=0;break;case Y:for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.flags=de,(pe.flags&255)!==L){ue.msg="unknown compression method",pe.mode=j;break}if(pe.flags&57344){ue.msg="unknown header flags set",pe.mode=j;break}pe.head&&(pe.head.text=de>>8&1),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0,pe.mode=G;case G:for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.head&&(pe.head.time=de),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,it[2]=de>>>16&255,it[3]=de>>>24&255,pe.check=r(pe.check,it,4,0)),de=0,xe=0,pe.mode=ee;case ee:for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.head&&(pe.head.xflags=de&255,pe.head.os=de>>8),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0,pe.mode=$;case $:if(pe.flags&1024){for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.length=de,pe.head&&(pe.head.extra_len=de),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0}else pe.head&&(pe.head.extra=null);pe.mode=q;case q:if(pe.flags&1024&&(Ve=pe.length,Ve>Ee&&(Ve=Ee),Ve&&(pe.head&&(yt=pe.head.extra_len-pe.length,pe.head.extra||(pe.head.extra=new Array(pe.head.extra_len)),t.arraySet(pe.head.extra,be,se,Ve,yt)),pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,pe.length-=Ve),pe.length))break e;pe.length=0,pe.mode=V;case V:if(pe.flags&2048){if(Ee===0)break e;Ve=0;do yt=be[se+Ve++],pe.head&&yt&&pe.length<65536&&(pe.head.name+=String.fromCharCode(yt));while(yt&&Ve<Ee);if(pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,yt)break e}else pe.head&&(pe.head.name=null);pe.length=0,pe.mode=_;case _:if(pe.flags&4096){if(Ee===0)break e;Ve=0;do yt=be[se+Ve++],pe.head&&yt&&pe.length<65536&&(pe.head.comment+=String.fromCharCode(yt));while(yt&&Ve<Ee);if(pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,yt)break e}else pe.head&&(pe.head.comment=null);pe.mode=n;case n:if(pe.flags&512){for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de!==(pe.check&65535)){ue.msg="header crc mismatch",pe.mode=j;break}de=0,xe=0}pe.head&&(pe.head.hcrc=pe.flags>>9&1,pe.head.done=!0),ue.adler=pe.check=0,pe.mode=u;break;case s:for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}ue.adler=pe.check=ot(de),de=0,xe=0,pe.mode=f;case f:if(pe.havedict===0)return ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,E;ue.adler=pe.check=1,pe.mode=u;case u:if(me===g||me===y)break e;case l:if(pe.last){de>>>=xe&7,xe-=xe&7,pe.mode=K;break}for(;xe<3;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}switch(pe.last=de&1,de>>>=1,xe-=1,de&3){case 0:pe.mode=m;break;case 1:if(P(pe),pe.mode=S,me===y){de>>>=2,xe-=2;break e}break;case 2:pe.mode=o;break;case 3:ue.msg="invalid block type",pe.mode=j}de>>>=2,xe-=2;break;case m:for(de>>>=xe&7,xe-=xe&7;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if((de&65535)!==(de>>>16^65535)){ue.msg="invalid stored block lengths",pe.mode=j;break}if(pe.length=de&65535,de=0,xe=0,pe.mode=w,me===y)break e;case w:pe.mode=d;case d:if(Ve=pe.length,Ve){if(Ve>Ee&&(Ve=Ee),Ve>Fe&&(Ve=Fe),Ve===0)break e;t.arraySet(Qe,be,se,Ve,ye),Ee-=Ve,se+=Ve,Fe-=Ve,ye+=Ve,pe.length-=Ve;break}pe.mode=u;break;case o:for(;xe<14;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.nlen=(de&31)+257,de>>>=5,xe-=5,pe.ndist=(de&31)+1,de>>>=5,xe-=5,pe.ncode=(de&15)+4,de>>>=4,xe-=4,pe.nlen>286||pe.ndist>30){ue.msg="too many length or distance symbols",pe.mode=j;break}pe.have=0,pe.mode=v;case v:for(;pe.have<pe.ncode;){for(;xe<3;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.lens[Mt[pe.have++]]=de&7,de>>>=3,xe-=3}for(;pe.have<19;)pe.lens[Mt[pe.have++]]=0;if(pe.lencode=pe.lendyn,pe.lenbits=7,_t={bits:pe.lenbits},Xe=i(h,pe.lens,0,19,pe.lencode,0,pe.work,_t),pe.lenbits=_t.bits,Xe){ue.msg="invalid code lengths set",pe.mode=j;break}pe.have=0,pe.mode=R;case R:for(;pe.have<pe.nlen+pe.ndist;){for(;et=pe.lencode[de&(1<<pe.lenbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(nt<16)de>>>=mt,xe-=mt,pe.lens[pe.have++]=nt;else{if(nt===16){for(dt=mt+2;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de>>>=mt,xe-=mt,pe.have===0){ue.msg="invalid bit length repeat",pe.mode=j;break}yt=pe.lens[pe.have-1],Ve=3+(de&3),de>>>=2,xe-=2}else if(nt===17){for(dt=mt+3;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=mt,xe-=mt,yt=0,Ve=3+(de&7),de>>>=3,xe-=3}else{for(dt=mt+7;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=mt,xe-=mt,yt=0,Ve=11+(de&127),de>>>=7,xe-=7}if(pe.have+Ve>pe.nlen+pe.ndist){ue.msg="invalid bit length repeat",pe.mode=j;break}for(;Ve--;)pe.lens[pe.have++]=yt}}if(pe.mode===j)break;if(pe.lens[256]===0){ue.msg="invalid code -- missing end-of-block",pe.mode=j;break}if(pe.lenbits=9,_t={bits:pe.lenbits},Xe=i(c,pe.lens,0,pe.nlen,pe.lencode,0,pe.work,_t),pe.lenbits=_t.bits,Xe){ue.msg="invalid literal/lengths set",pe.mode=j;break}if(pe.distbits=6,pe.distcode=pe.distdyn,_t={bits:pe.distbits},Xe=i(p,pe.lens,pe.nlen,pe.ndist,pe.distcode,0,pe.work,_t),pe.distbits=_t.bits,Xe){ue.msg="invalid distances set",pe.mode=j;break}if(pe.mode=S,me===y)break e;case S:pe.mode=B;case B:if(Ee>=6&&Fe>=258){ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,a(ue,_e),ye=ue.next_out,Qe=ue.output,Fe=ue.avail_out,se=ue.next_in,be=ue.input,Ee=ue.avail_in,de=pe.hold,xe=pe.bits,pe.mode===u&&(pe.back=-1);break}for(pe.back=0;et=pe.lencode[de&(1<<pe.lenbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(We&&!(We&240)){for(bt=mt,Je=We,at=nt;et=pe.lencode[at+((de&(1<<bt+Je)-1)>>bt)],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(bt+mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=bt,xe-=bt,pe.back+=bt}if(de>>>=mt,xe-=mt,pe.back+=mt,pe.length=nt,We===0){pe.mode=Z;break}if(We&32){pe.back=-1,pe.mode=u;break}if(We&64){ue.msg="invalid literal/length code",pe.mode=j;break}pe.extra=We&15,pe.mode=F;case F:if(pe.extra){for(dt=pe.extra;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.length+=de&(1<<pe.extra)-1,de>>>=pe.extra,xe-=pe.extra,pe.back+=pe.extra}pe.was=pe.length,pe.mode=D;case D:for(;et=pe.distcode[de&(1<<pe.distbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(!(We&240)){for(bt=mt,Je=We,at=nt;et=pe.distcode[at+((de&(1<<bt+Je)-1)>>bt)],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(bt+mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=bt,xe-=bt,pe.back+=bt}if(de>>>=mt,xe-=mt,pe.back+=mt,We&64){ue.msg="invalid distance code",pe.mode=j;break}pe.offset=nt,pe.extra=We&15,pe.mode=re;case re:if(pe.extra){for(dt=pe.extra;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.offset+=de&(1<<pe.extra)-1,de>>>=pe.extra,xe-=pe.extra,pe.back+=pe.extra}if(pe.offset>pe.dmax){ue.msg="invalid distance too far back",pe.mode=j;break}pe.mode=Q;case Q:if(Fe===0)break e;if(Ve=_e-Fe,pe.offset>Ve){if(Ve=pe.offset-Ve,Ve>pe.whave&&pe.sane){ue.msg="invalid distance too far back",pe.mode=j;break}Ve>pe.wnext?(Ve-=pe.wnext,vt=pe.wsize-Ve):vt=pe.wnext-Ve,Ve>pe.length&&(Ve=pe.length),Ye=pe.window}else Ye=Qe,vt=ye-pe.offset,Ve=pe.length;Ve>Fe&&(Ve=Fe),Fe-=Ve,pe.length-=Ve;do Qe[ye++]=Ye[vt++];while(--Ve);pe.length===0&&(pe.mode=B);break;case Z:if(Fe===0)break e;Qe[ye++]=pe.length,Fe--,pe.mode=B;break;case K:if(pe.wrap){for(;xe<32;){if(Ee===0)break e;Ee--,de|=be[se++]<<xe,xe+=8}if(_e-=Fe,ue.total_out+=_e,pe.total+=_e,_e&&(ue.adler=pe.check=pe.flags?r(pe.check,Qe,_e,ye-_e):e(pe.check,Qe,_e,ye-_e)),_e=Fe,(pe.flags?de:ot(de))!==pe.check){ue.msg="incorrect data check",pe.mode=j;break}de=0,xe=0}pe.mode=ce;case ce:if(pe.wrap&&pe.flags){for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de!==(pe.total&4294967295)){ue.msg="incorrect length check",pe.mode=j;break}de=0,xe=0}pe.mode=te;case te:Xe=x;break e;case j:Xe=k;break e;case J:return O;case X:default:return A}return ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,(pe.wsize||_e!==ue.avail_out&&pe.mode<j&&(pe.mode<K||me!==b))&&U(ue,ue.output,ue.next_out,_e-ue.avail_out),lt-=ue.avail_in,_e-=ue.avail_out,ue.total_in+=lt,ue.total_out+=_e,pe.total+=_e,pe.wrap&&_e&&(ue.adler=pe.check=pe.flags?r(pe.check,Qe,_e,ue.next_out-_e):e(pe.check,Qe,_e,ue.next_out-_e)),ue.data_type=pe.bits+(pe.last?64:0)+(pe.mode===u?128:0)+(pe.mode===S||pe.mode===w?256:0),(lt===0&&_e===0||me===b)&&Xe===M&&(Xe=N),Xe}function W(ue){if(!ue||!ue.state)return A;var me=ue.state;return me.window&&(me.window=null),ue.state=null,M}function fe(ue,me){var pe;return!ue||!ue.state||(pe=ue.state,!(pe.wrap&2))?A:(pe.head=me,me.done=!1,M)}function st(ue,me){var pe=me.length,be,Qe,se;return!ue||!ue.state||(be=ue.state,be.wrap!==0&&be.mode!==f)?A:be.mode===f&&(Qe=1,Qe=e(Qe,me,pe,0),Qe!==be.check)?k:(se=U(ue,me,pe,pe),se?(be.mode=J,O):(be.havedict=1,M))}return Ns.inflateReset=ut,Ns.inflateReset2=Ze,Ns.inflateResetKeep=Se,Ns.inflateInit=ct,Ns.inflateInit2=Ge,Ns.inflate=H,Ns.inflateEnd=W,Ns.inflateGetHeader=fe,Ns.inflateSetDictionary=st,Ns.inflateInfo="pako inflate (from Nodeca project)",Ns}function cAe(){return qie||(qie=!0,Kk={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),Kk}function lAe(){if(Fie)return $t;Fie=!0;var t=ni.Buffer,e=yr,r=ar,a=nAe(),i=sAe(),h=hAe(),c=cAe();for(var p in c)$t[p]=c[p];$t.NONE=0,$t.DEFLATE=1,$t.INFLATE=2,$t.GZIP=3,$t.GUNZIP=4,$t.DEFLATERAW=5,$t.INFLATERAW=6,$t.UNZIP=7;var b=31,g=139;function y(M){if(typeof M!="number"||M<$t.DEFLATE||M>$t.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=M,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}return y.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,r(this.init_done,"close before init"),r(this.mode<=$t.UNZIP),this.mode===$t.DEFLATE||this.mode===$t.GZIP||this.mode===$t.DEFLATERAW?i.deflateEnd(this.strm):(this.mode===$t.INFLATE||this.mode===$t.GUNZIP||this.mode===$t.INFLATERAW||this.mode===$t.UNZIP)&&h.inflateEnd(this.strm),this.mode=$t.NONE,this.dictionary=null},y.prototype.write=function(M,x,E,A,k,O,N){return this._write(!0,M,x,E,A,k,O,N)},y.prototype.writeSync=function(M,x,E,A,k,O,N){return this._write(!1,M,x,E,A,k,O,N)},y.prototype._write=function(M,x,E,A,k,O,N,L){if(r.equal(arguments.length,8),r(this.init_done,"write before init"),r(this.mode!==$t.NONE,"already finalized"),r.equal(!1,this.write_in_progress,"write already in progress"),r.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,r.equal(!1,x===void 0,"must provide flush value"),this.write_in_progress=!0,x!==$t.Z_NO_FLUSH&&x!==$t.Z_PARTIAL_FLUSH&&x!==$t.Z_SYNC_FLUSH&&x!==$t.Z_FULL_FLUSH&&x!==$t.Z_FINISH&&x!==$t.Z_BLOCK)throw new Error("Invalid flush value");if(E==null&&(E=t.alloc(0),k=0,A=0),this.strm.avail_in=k,this.strm.input=E,this.strm.next_in=A,this.strm.avail_out=L,this.strm.output=O,this.strm.next_out=N,this.flush=x,!M)return this._process(),this._checkError()?this._afterSync():void 0;var C=this;return e.nextTick(function(){C._process(),C._after()}),this},y.prototype._afterSync=function(){var M=this.strm.avail_out,x=this.strm.avail_in;return this.write_in_progress=!1,[x,M]},y.prototype._process=function(){var M=null;switch(this.mode){case $t.DEFLATE:case $t.GZIP:case $t.DEFLATERAW:this.err=i.deflate(this.strm,this.flush);break;case $t.UNZIP:switch(this.strm.avail_in>0&&(M=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(M===null)break;if(this.strm.input[M]===b){if(this.gzip_id_bytes_read=1,M++,this.strm.avail_in===1)break}else{this.mode=$t.INFLATE;break}case 1:if(M===null)break;this.strm.input[M]===g?(this.gzip_id_bytes_read=2,this.mode=$t.GUNZIP):this.mode=$t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case $t.INFLATE:case $t.GUNZIP:case $t.INFLATERAW:for(this.err=h.inflate(this.strm,this.flush),this.err===$t.Z_NEED_DICT&&this.dictionary&&(this.err=h.inflateSetDictionary(this.strm,this.dictionary),this.err===$t.Z_OK?this.err=h.inflate(this.strm,this.flush):this.err===$t.Z_DATA_ERROR&&(this.err=$t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===$t.GUNZIP&&this.err===$t.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=h.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},y.prototype._checkError=function(){switch(this.err){case $t.Z_OK:case $t.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===$t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case $t.Z_STREAM_END:break;case $t.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},y.prototype._after=function(){if(this._checkError()){var M=this.strm.avail_out,x=this.strm.avail_in;this.write_in_progress=!1,this.callback(x,M),this.pending_close&&this.close()}},y.prototype._error=function(M){this.strm.msg&&(M=this.strm.msg),this.onerror(M,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},y.prototype.init=function(M,x,E,A,k){r(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),r(M>=8&&M<=15,"invalid windowBits"),r(x>=-1&&x<=9,"invalid compression level"),r(E>=1&&E<=9,"invalid memlevel"),r(A===$t.Z_FILTERED||A===$t.Z_HUFFMAN_ONLY||A===$t.Z_RLE||A===$t.Z_FIXED||A===$t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(x,M,E,A,k),this._setDictionary()},y.prototype.params=function(){throw new Error("deflateParams Not supported")},y.prototype.reset=function(){this._reset(),this._setDictionary()},y.prototype._init=function(M,x,E,A,k){switch(this.level=M,this.windowBits=x,this.memLevel=E,this.strategy=A,this.flush=$t.Z_NO_FLUSH,this.err=$t.Z_OK,(this.mode===$t.GZIP||this.mode===$t.GUNZIP)&&(this.windowBits+=16),this.mode===$t.UNZIP&&(this.windowBits+=32),(this.mode===$t.DEFLATERAW||this.mode===$t.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new a,this.mode){case $t.DEFLATE:case $t.GZIP:case $t.DEFLATERAW:this.err=i.deflateInit2(this.strm,this.level,$t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case $t.INFLATE:case $t.GUNZIP:case $t.INFLATERAW:case $t.UNZIP:this.err=h.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==$t.Z_OK&&this._error("Init error"),this.dictionary=k,this.write_in_progress=!1,this.init_done=!0},y.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=$t.Z_OK,this.mode){case $t.DEFLATE:case $t.DEFLATERAW:this.err=i.deflateSetDictionary(this.strm,this.dictionary);break}this.err!==$t.Z_OK&&this._error("Failed to set dictionary")}},y.prototype._reset=function(){switch(this.err=$t.Z_OK,this.mode){case $t.DEFLATE:case $t.DEFLATERAW:case $t.GZIP:this.err=i.deflateReset(this.strm);break;case $t.INFLATE:case $t.INFLATERAW:case $t.GUNZIP:this.err=h.inflateReset(this.strm);break}this.err!==$t.Z_OK&&this._error("Failed to reset stream")},$t.Zlib=y,$t}function dAe(){if(jie)return tr;jie=!0;var t=yr,e=ni.Buffer,r=ka.Transform,a=lAe(),i=gt,h=ar.ok,c=ni.kMaxLength,p="Cannot create final Buffer. It would be larger than 0x"+c.toString(16)+" bytes";a.Z_MIN_WINDOWBITS=8,a.Z_MAX_WINDOWBITS=15,a.Z_DEFAULT_WINDOWBITS=15,a.Z_MIN_CHUNK=64,a.Z_MAX_CHUNK=1/0,a.Z_DEFAULT_CHUNK=16*1024,a.Z_MIN_MEMLEVEL=1,a.Z_MAX_MEMLEVEL=9,a.Z_DEFAULT_MEMLEVEL=8,a.Z_MIN_LEVEL=-1,a.Z_MAX_LEVEL=9,a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;for(var b=Object.keys(a),g=0;g<b.length;g++){var y=b[g];y.match(/^Z/)&&Object.defineProperty(tr,y,{enumerable:!0,value:a[y],writable:!1})}for(var M={Z_OK:a.Z_OK,Z_STREAM_END:a.Z_STREAM_END,Z_NEED_DICT:a.Z_NEED_DICT,Z_ERRNO:a.Z_ERRNO,Z_STREAM_ERROR:a.Z_STREAM_ERROR,Z_DATA_ERROR:a.Z_DATA_ERROR,Z_MEM_ERROR:a.Z_MEM_ERROR,Z_BUF_ERROR:a.Z_BUF_ERROR,Z_VERSION_ERROR:a.Z_VERSION_ERROR},x=Object.keys(M),E=0;E<x.length;E++){var A=x[E];M[M[A]]=A}Object.defineProperty(tr,"codes",{enumerable:!0,value:Object.freeze(M),writable:!1}),tr.Deflate=N,tr.Inflate=L,tr.Gzip=C,tr.Gunzip=Y,tr.DeflateRaw=G,tr.InflateRaw=ee,tr.Unzip=$,tr.createDeflate=function(s){return new N(s)},tr.createInflate=function(s){return new L(s)},tr.createDeflateRaw=function(s){return new G(s)},tr.createInflateRaw=function(s){return new ee(s)},tr.createGzip=function(s){return new C(s)},tr.createGunzip=function(s){return new Y(s)},tr.createUnzip=function(s){return new $(s)},tr.deflate=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new N(f),s,u)},tr.deflateSync=function(s,f){return O(new N(f),s)},tr.gzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new C(f),s,u)},tr.gzipSync=function(s,f){return O(new C(f),s)},tr.deflateRaw=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new G(f),s,u)},tr.deflateRawSync=function(s,f){return O(new G(f),s)},tr.unzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new $(f),s,u)},tr.unzipSync=function(s,f){return O(new $(f),s)},tr.inflate=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new L(f),s,u)},tr.inflateSync=function(s,f){return O(new L(f),s)},tr.gunzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new Y(f),s,u)},tr.gunzipSync=function(s,f){return O(new Y(f),s)},tr.inflateRaw=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new ee(f),s,u)},tr.inflateRawSync=function(s,f){return O(new ee(f),s)};function k(s,f,u){var l=[],m=0;s.on("error",d),s.on("end",o),s.end(f),w();function w(){for(var v;(v=s.read())!==null;)l.push(v),m+=v.length;s.once("readable",w)}function d(v){s.removeListener("end",o),s.removeListener("readable",w),u(v)}function o(){var v,R=null;m>=c?R=new RangeError(p):v=e.concat(l,m),l=[],s.close(),u(R,v)}}function O(s,f){if(typeof f=="string"&&(f=e.from(f)),!e.isBuffer(f))throw new TypeError("Not a string or buffer");var u=s._finishFlushFlag;return s._processChunk(f,u)}function N(s){if(!(this instanceof N))return new N(s);V.call(this,s,a.DEFLATE)}function L(s){if(!(this instanceof L))return new L(s);V.call(this,s,a.INFLATE)}function C(s){if(!(this instanceof C))return new C(s);V.call(this,s,a.GZIP)}function Y(s){if(!(this instanceof Y))return new Y(s);V.call(this,s,a.GUNZIP)}function G(s){if(!(this instanceof G))return new G(s);V.call(this,s,a.DEFLATERAW)}function ee(s){if(!(this instanceof ee))return new ee(s);V.call(this,s,a.INFLATERAW)}function $(s){if(!(this instanceof $))return new $(s);V.call(this,s,a.UNZIP)}function q(s){return s===a.Z_NO_FLUSH||s===a.Z_PARTIAL_FLUSH||s===a.Z_SYNC_FLUSH||s===a.Z_FULL_FLUSH||s===a.Z_FINISH||s===a.Z_BLOCK}function V(s,f){var u=this;if(this._opts=s=s||{},this._chunkSize=s.chunkSize||tr.Z_DEFAULT_CHUNK,r.call(this,s),s.flush&&!q(s.flush))throw new Error("Invalid flush flag: "+s.flush);if(s.finishFlush&&!q(s.finishFlush))throw new Error("Invalid flush flag: "+s.finishFlush);if(this._flushFlag=s.flush||a.Z_NO_FLUSH,this._finishFlushFlag=typeof s.finishFlush<"u"?s.finishFlush:a.Z_FINISH,s.chunkSize&&(s.chunkSize<tr.Z_MIN_CHUNK||s.chunkSize>tr.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+s.chunkSize);if(s.windowBits&&(s.windowBits<tr.Z_MIN_WINDOWBITS||s.windowBits>tr.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+s.windowBits);if(s.level&&(s.level<tr.Z_MIN_LEVEL||s.level>tr.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+s.level);if(s.memLevel&&(s.memLevel<tr.Z_MIN_MEMLEVEL||s.memLevel>tr.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+s.memLevel);if(s.strategy&&s.strategy!=tr.Z_FILTERED&&s.strategy!=tr.Z_HUFFMAN_ONLY&&s.strategy!=tr.Z_RLE&&s.strategy!=tr.Z_FIXED&&s.strategy!=tr.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+s.strategy);if(s.dictionary&&!e.isBuffer(s.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new a.Zlib(f);var l=this;this._hadError=!1,this._handle.onerror=function(d,o){_(l),l._hadError=!0;var v=new Error(d);v.errno=o,v.code=tr.codes[o],l.emit("error",v)};var m=tr.Z_DEFAULT_COMPRESSION;typeof s.level=="number"&&(m=s.level);var w=tr.Z_DEFAULT_STRATEGY;typeof s.strategy=="number"&&(w=s.strategy),this._handle.init(s.windowBits||tr.Z_DEFAULT_WINDOWBITS,m,s.memLevel||tr.Z_DEFAULT_MEMLEVEL,w,s.dictionary),this._buffer=e.allocUnsafe(this._chunkSize),this._offset=0,this._level=m,this._strategy=w,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!u._handle},configurable:!0,enumerable:!0})}i.inherits(V,r),V.prototype.params=function(s,f,u){if(s<tr.Z_MIN_LEVEL||s>tr.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+s);if(f!=tr.Z_FILTERED&&f!=tr.Z_HUFFMAN_ONLY&&f!=tr.Z_RLE&&f!=tr.Z_FIXED&&f!=tr.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+f);if(this._level!==s||this._strategy!==f){var l=this;this.flush(a.Z_SYNC_FLUSH,function(){h(l._handle,"zlib binding closed"),l._handle.params(s,f),l._hadError||(l._level=s,l._strategy=f,u&&u())})}else t.nextTick(u)},V.prototype.reset=function(){return h(this._handle,"zlib binding closed"),this._handle.reset()},V.prototype._flush=function(s){this._transform(e.alloc(0),"",s)},V.prototype.flush=function(s,f){var u=this,l=this._writableState;(typeof s=="function"||s===void 0&&!f)&&(f=s,s=a.Z_FULL_FLUSH),l.ended?f&&t.nextTick(f):l.ending?f&&this.once("end",f):l.needDrain?f&&this.once("drain",function(){return u.flush(s,f)}):(this._flushFlag=s,this.write(e.alloc(0),"",f))},V.prototype.close=function(s){_(this,s),t.nextTick(n,this)};function _(s,f){f&&t.nextTick(f),s._handle&&(s._handle.close(),s._handle=null)}function n(s){s.emit("close")}return V.prototype._transform=function(s,f,u){var l,m=this._writableState,w=m.ending||m.ended,d=w&&(!s||m.length===s.length);if(s!==null&&!e.isBuffer(s))return u(new Error("invalid input"));if(!this._handle)return u(new Error("zlib binding closed"));d?l=this._finishFlushFlag:(l=this._flushFlag,s.length>=m.length&&(this._flushFlag=this._opts.flush||a.Z_NO_FLUSH)),this._processChunk(s,l,u)},V.prototype._processChunk=function(s,f,u){var l=s&&s.length,m=this._chunkSize-this._offset,w=0,d=this,o=typeof u=="function";if(!o){var v=[],R=0,S;this.on("error",function(Q){S=Q}),h(this._handle,"zlib binding closed");do var B=this._handle.writeSync(f,s,w,l,this._buffer,this._offset,m);while(!this._hadError&&re(B[0],B[1]));if(this._hadError)throw S;if(R>=c)throw _(this),new RangeError(p);var F=e.concat(v,R);return _(this),F}h(this._handle,"zlib binding closed");var D=this._handle.write(f,s,w,l,this._buffer,this._offset,m);D.buffer=s,D.callback=re;function re(Q,Z){if(this&&(this.buffer=null,this.callback=null),!d._hadError){var K=m-Z;if(h(K>=0,"have should not go down"),K>0){var ce=d._buffer.slice(d._offset,d._offset+K);d._offset+=K,o?d.push(ce):(v.push(ce),R+=ce.length)}if((Z===0||d._offset>=d._chunkSize)&&(m=d._chunkSize,d._offset=0,d._buffer=e.allocUnsafe(d._chunkSize)),Z===0){if(w+=l-Q,l=Q,!o)return!0;var te=d._handle.write(f,s,w,l,d._buffer,d._offset,d._chunkSize);te.callback=re,te.buffer=s;return}if(!o)return!1;u()}}},i.inherits(N,V),i.inherits(L,V),i.inherits(C,V),i.inherits(Y,V),i.inherits(G,V),i.inherits(ee,V),i.inherits($,V),tr}var qk,Iie,Ba,Bie,Id,Oie,Fk,Pie,jk,Nie,zk,Cie,Of,Lie,Zk,$ie,Hk,Die,Ns,Uie,Kk,qie,$t,Fie,tr,jie,At,pAe,vAe,mAe,gAe,bAe,yAe,wAe,_Ae,MAe,xAe,SAe,EAe,AAe,RAe,TAe,kAe,IAe,BAe,OAe,PAe,NAe,CAe,LAe,$Ae,DAe,UAe,qAe,FAe,jAe,zAe,ZAe,HAe,KAe,WAe,VAe,GAe,YAe,JAe,XAe,QAe,eRe,tRe,rRe,iRe,nRe,aRe,oRe,sRe,fRe,uRe,hRe,cRe,lRe,dRe,pRe,vRe,mRe,gRe,bRe,yRe,wRe,_Re,MRe,xRe,SRe,ERe,ARe,RRe,TRe,Kie=Si(()=>{"use strict";ie();ae();ne();ah();B8();yk();Ks();no();Rg();Fo();Hs();th();Uo();Gf();Z0();qk={},Iie=!1;Ba={},Bie=!1;Id={},Oie=!1;Fk={},Pie=!1;jk={},Nie=!1;zk={},Cie=!1;Of={},Lie=!1;Zk={},$ie=!1;Hk={},Die=!1;Ns={},Uie=!1;Kk={},qie=!1;$t={},Fie=!1;tr={},jie=!1;At=dAe();At.codes;At.Deflate;At.Inflate;At.Gzip;At.Gunzip;At.DeflateRaw;At.InflateRaw;At.Unzip;At.createDeflate;At.createInflate;At.createDeflateRaw;At.createInflateRaw;At.createGzip;At.createGunzip;At.createUnzip;At.deflate;At.deflateSync;At.gzip;At.gzipSync;At.deflateRaw;At.deflateRawSync;At.unzip;At.unzipSync;At.inflate;At.inflateSync;At.gunzip;At.gunzipSync;At.inflateRaw;At.inflateRawSync;pAe=At.Deflate,vAe=At.DeflateRaw,mAe=At.Gunzip,gAe=At.Gzip,bAe=At.Inflate,yAe=At.InflateRaw,wAe=At.Unzip,_Ae=At.Z_BEST_COMPRESSION,MAe=At.Z_BEST_SPEED,xAe=At.Z_BINARY,SAe=At.Z_BLOCK,EAe=At.Z_BUF_ERROR,AAe=At.Z_DATA_ERROR,RAe=At.Z_DEFAULT_CHUNK,TAe=At.Z_DEFAULT_COMPRESSION,kAe=At.Z_DEFAULT_LEVEL,IAe=At.Z_DEFAULT_MEMLEVEL,BAe=At.Z_DEFAULT_STRATEGY,OAe=At.Z_DEFAULT_WINDOWBITS,PAe=At.Z_DEFLATED,NAe=At.Z_ERRNO,CAe=At.Z_FILTERED,LAe=At.Z_FINISH,$Ae=At.Z_FIXED,DAe=At.Z_FULL_FLUSH,UAe=At.Z_HUFFMAN_ONLY,qAe=At.Z_MAX_CHUNK,FAe=At.Z_MAX_LEVEL,jAe=At.Z_MAX_MEMLEVEL,zAe=At.Z_MAX_WINDOWBITS,ZAe=At.Z_MIN_CHUNK,HAe=At.Z_MIN_LEVEL,KAe=At.Z_MIN_MEMLEVEL,WAe=At.Z_MIN_WINDOWBITS,VAe=At.Z_NEED_DICT,GAe=At.Z_NO_COMPRESSION,YAe=At.Z_NO_FLUSH,JAe=At.Z_OK,XAe=At.Z_PARTIAL_FLUSH,QAe=At.Z_RLE,eRe=At.Z_STREAM_END,tRe=At.Z_STREAM_ERROR,rRe=At.Z_SYNC_FLUSH,iRe=At.Z_TEXT,nRe=At.Z_TREES,aRe=At.Z_UNKNOWN,oRe=At.Zlib,sRe=At.codes,fRe=At.createDeflate,uRe=At.createDeflateRaw,hRe=At.createGunzip,cRe=At.createGzip,lRe=At.createInflate,dRe=At.createInflateRaw,pRe=At.createUnzip,vRe=At.deflate,mRe=At.deflateRaw,gRe=At.deflateRawSync,bRe=At.deflateSync,yRe=At.gunzip,wRe=At.gunzipSync,_Re=At.gzip,MRe=At.gzipSync,xRe=At.inflate,SRe=At.inflateRaw,ERe=At.inflateRawSync,ARe=At.inflateSync,RRe=At.unzip,TRe=At.unzipSync});var Gie=ht((Rpt,Vie)=>{"use strict";ie();ae();ne();var F1=[],o2=[],Wk=function(){};function Gk(t){return~F1.indexOf(t)?!1:(F1.push(t),!0)}function Yk(t){Wk=t}function kRe(t){for(var e=[],r=0;r<F1.length;r++){if(F1[r].async){e.push(F1[r]);continue}if(F1[r](t))return!0}return e.length?new Promise(function(i){Promise.all(e.map(function(c){return c(t)})).then(function(c){i(c.some(Boolean))})}):!1}function Jk(t){return~o2.indexOf(t)?!1:(o2.push(t),!0)}function Vk(){Wk.apply(Wk,arguments)}function Wie(t){for(var e=0;e<o2.length;e++)t=o2[e].apply(o2[e],arguments);return t}function Xk(t,e){var r=Object.prototype.hasOwnProperty;for(var a in e)r.call(e,a)&&(t[a]=e[a]);return t}function IRe(t){return t.enabled=!1,t.modify=Jk,t.set=Yk,t.use=Gk,Xk(function(){return!1},t)}function BRe(t){function e(){var r=Array.prototype.slice.call(arguments,0);return Vk.call(Vk,t,Wie(r,t)),!0}return t.enabled=!0,t.modify=Jk,t.set=Yk,t.use=Gk,Xk(e,t)}Vie.exports=function(e){return e.introduce=Xk,e.enabled=kRe,e.process=Wie,e.modify=Jk,e.write=Vk,e.nope=IRe,e.yep=BRe,e.set=Yk,e.use=Gk,e}});var Jie=ht((Bpt,Yie)=>{"use strict";ie();ae();ne();var ORe=Gie(),PRe=ORe(function t(e,r){return r=r||{},r.namespace=e,r.prod=!0,r.dev=!1,r.force||t.force?t.yep(r):t.nope(r)});Yie.exports=PRe});var s2=ht((Cpt,Xie)=>{"use strict";ie();ae();ne();Xie.exports=Jie()});var Qie={};Ha(Qie,{StringDecoder:()=>NRe,default:()=>An});var NRe,ene=Si(()=>{"use strict";ie();ae();ne();Gf();Gf();NRe=An.StringDecoder});var rne=ht((Zpt,tne)=>{"use strict";ie();ae();ne();var Qk=(Nk(),ei(Pk)),CRe=(ene(),ei(Qie)),LRe=CRe.StringDecoder,$Re=Oh(),DRe=$Re.Stream;function URe(){}tne.exports=function(t,e){var r=Me.alloc(65536),a=new LRe("utf8"),i=new DRe,h="",c=0,p=0;return t.start===-1&&delete t.start,i.readable=!0,i.destroy=function(){i.destroyed=!0,i.emit("end"),i.emit("close")},Qk.open(t.file,"a+","0644",function(b,g){if(b){e?e(b):i.emit("error",b),i.destroy();return}(function y(){if(i.destroyed){Qk.close(g,URe);return}return Qk.read(g,r,0,r.length,c,function(M,x){if(M){e?e(M):i.emit("error",M),i.destroy();return}if(!x)return h&&((t.start==null||p>t.start)&&(e?e(null,h):i.emit("line",h)),p++,h=""),setTimeout(y,1e3);var E=a.write(r.slice(0,x));e||i.emit("data",E),E=(h+E).split(/\n+/);for(var A=E.length-1,k=0;k<A;k++)(t.start==null||p>t.start)&&(e?e(null,E[k]):i.emit("line",E[k])),p++;return h=E[A],c+=x,y()})})()}),e?i.destroy:i}});var hne=ht((Vpt,une)=>{"use strict";ie();ae();ne();function jh(t){"@babel/helpers - typeof";return jh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jh(t)}function qRe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ine(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,jRe(a.key),a)}}function FRe(t,e,r){return e&&ine(t.prototype,e),r&&ine(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function jRe(t){var e=zRe(t,"string");return jh(e)=="symbol"?e:String(e)}function zRe(t,e){if(jh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(jh(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ZRe(t,e,r){return e=B4(e),HRe(t,one()?Reflect.construct(e,r||[],B4(t).constructor):e.apply(t,r))}function HRe(t,e){if(e&&(jh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sne(t)}function one(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(one=function(){return!!t})()}function B4(t){return B4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},B4(t)}function sne(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function KRe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&eI(t,e)}function eI(t,e){return eI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},eI(t,e)}var fo=(Nk(),ei(Pk)),na=(_k(),ei(hre)),nne=kie(),WRe=(Kie(),ei(Hie)),VRe=sn(),GRe=VRe.MESSAGE,fne=Oh(),YRe=fne.Stream,ane=fne.PassThrough,JRe=P1(),Pf=s2()("winston:file"),XRe=(bd(),ei(gd)),QRe=rne();une.exports=function(t){KRe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};qRe(this,e),r=ZRe(this,e,[a]),r.name=a.name||"file";function i(h){for(var c=arguments.length,p=new Array(c>1?c-1:0),b=1;b<c;b++)p[b-1]=arguments[b];p.slice(1).forEach(function(g){if(a[g])throw new Error("Cannot set ".concat(g," and ").concat(h," together"))})}if(r._stream=new ane,r._stream.setMaxListeners(30),r._onError=r._onError.bind(sne(r)),a.filename||a.dirname)i("filename or dirname","stream"),r._basename=r.filename=a.filename?na.basename(a.filename):"winston.log",r.dirname=a.dirname||na.dirname(a.filename),r.options=a.options||{flags:"a"};else if(a.stream)console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),i("stream","filename","maxsize"),r._dest=r._stream.pipe(r._setupStream(a.stream)),r.dirname=na.dirname(r._dest.path);else throw new Error("Cannot log to file without filename or stream.");return r.maxsize=a.maxsize||null,r.rotationFormat=a.rotationFormat||!1,r.zippedArchive=a.zippedArchive||!1,r.maxFiles=a.maxFiles||null,r.eol=typeof a.eol=="string"?a.eol:XRe.EOL,r.tailable=a.tailable||!1,r.lazy=a.lazy||!1,r._size=0,r._pendingSize=0,r._created=0,r._drain=!1,r._opening=!1,r._ending=!1,r._fileExist=!1,r.dirname&&r._createLogDirIfNotExist(r.dirname),r.lazy||r.open(),r}return FRe(e,[{key:"finishIfEnding",value:function(){var a=this;this._ending&&(this._opening?this.once("open",function(){a._stream.once("finish",function(){return a.emit("finish")}),setImmediate(function(){return a._stream.end()})}):(this._stream.once("finish",function(){return a.emit("finish")}),setImmediate(function(){return a._stream.end()})))}},{key:"log",value:function(a){var i=this,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){};if(this.silent)return h(),!0;if(this._drain){this._stream.once("drain",function(){i._drain=!1,i.log(a,h)});return}if(this._rotate){this._stream.once("rotate",function(){i._rotate=!1,i.log(a,h)});return}if(this.lazy){if(!this._fileExist){this._opening||this.open(),this.once("open",function(){i._fileExist=!0,i.log(a,h)});return}if(this._needsNewFile(this._pendingSize)){this._dest.once("close",function(){i._opening||i.open(),i.once("open",function(){i.log(a,h)})});return}}var c="".concat(a[GRe]).concat(this.eol),p=Me.byteLength(c);function b(){var y=this;if(this._size+=p,this._pendingSize-=p,Pf("logged %s %s",this._size,c),this.emit("logged",a),!this._rotate&&!this._opening&&this._needsNewFile()){if(this.lazy){this._endStream(function(){y.emit("fileclosed")});return}this._rotate=!0,this._endStream(function(){return y._rotateFile()})}}this._pendingSize+=p,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);var g=this._stream.write(c,b.bind(this));return g?h():(this._drain=!0,this._stream.once("drain",function(){i._drain=!1,h()})),Pf("written",g,this._drain),this.finishIfEnding(),g}},{key:"query",value:function(a,i){typeof a=="function"&&(i=a,a={}),a=E(a);var h=na.join(this.dirname,this.filename),c="",p=[],b=0,g=fo.createReadStream(h,{encoding:"utf8"});g.on("error",function(A){if(g.readable&&g.destroy(),!!i)return A.code!=="ENOENT"?i(A):i(null,p)}),g.on("data",function(A){A=(c+A).split(/\n+/);for(var k=A.length-1,O=0;O<k;O++)(!a.start||b>=a.start)&&y(A[O]),b++;c=A[k]}),g.on("close",function(){c&&y(c,!0),a.order==="desc"&&(p=p.reverse()),i&&i(null,p)});function y(A,k){try{var O=JSON.parse(A);x(O)&&M(O)}catch(N){k||g.emit("error",N)}}function M(A){if(a.rows&&p.length>=a.rows&&a.order!=="desc"){g.readable&&g.destroy();return}a.fields&&(A=a.fields.reduce(function(k,O){return k[O]=A[O],k},{})),a.order==="desc"&&p.length>=a.rows&&p.shift(),p.push(A)}function x(A){if(A&&jh(A)==="object"){var k=new Date(A.timestamp);if(!(a.from&&k<a.from||a.until&&k>a.until||a.level&&a.level!==A.level))return!0}}function E(A){return A=A||{},A.rows=A.rows||A.limit||10,A.start=A.start||0,A.until=A.until||new Date,jh(A.until)!=="object"&&(A.until=new Date(A.until)),A.from=A.from||A.until-24*60*60*1e3,jh(A.from)!=="object"&&(A.from=new Date(A.from)),A.order=A.order||"desc",A}}},{key:"stream",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=na.join(this.dirname,this.filename),h=new YRe,c={file:i,start:a.start};return h.destroy=QRe(c,function(p,b){if(p)return h.emit("error",p);try{h.emit("data",b),b=JSON.parse(b),h.emit("log",b)}catch(g){h.emit("error",g)}}),h}},{key:"open",value:function(){var a=this;this.filename&&(this._opening||(this._opening=!0,this.stat(function(i,h){if(i)return a.emit("error",i);Pf("stat done: %s { size: %s }",a.filename,h),a._size=h,a._dest=a._createStream(a._stream),a._opening=!1,a.once("open",function(){a._stream.eventNames().includes("rotate")?a._stream.emit("rotate"):a._rotate=!1})})))}},{key:"stat",value:function(a){var i=this,h=this._getFile(),c=na.join(this.dirname,h);fo.stat(c,function(p,b){if(p&&p.code==="ENOENT")return Pf("ENOENT\xA0ok",c),i.filename=h,a(null,0);if(p)return Pf("err ".concat(p.code," ").concat(c)),a(p);if(!b||i._needsNewFile(b.size))return i._incFile(function(){return i.stat(a)});i.filename=h,a(null,b.size)})}},{key:"close",value:function(a){var i=this;this._stream&&this._stream.end(function(){a&&a(),i.emit("flush"),i.emit("closed")})}},{key:"_needsNewFile",value:function(a){return a=a||this._size,this.maxsize&&a>=this.maxsize}},{key:"_onError",value:function(a){this.emit("error",a)}},{key:"_setupStream",value:function(a){return a.on("error",this._onError),a}},{key:"_cleanupStream",value:function(a){return a.removeListener("error",this._onError),a.destroy(),a}},{key:"_rotateFile",value:function(){var a=this;this._incFile(function(){return a.open()})}},{key:"_endStream",value:function(){var a=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};this._dest?(this._stream.unpipe(this._dest),this._dest.end(function(){a._cleanupStream(a._dest),i()})):i()}},{key:"_createStream",value:function(a){var i=this,h=na.join(this.dirname,this.filename);Pf("create stream start",h,this.options);var c=fo.createWriteStream(h,this.options).on("error",function(p){return Pf(p)}).on("close",function(){return Pf("close",c.path,c.bytesWritten)}).on("open",function(){Pf("file open ok",h),i.emit("open",h),a.pipe(c),i.rotatedWhileOpening&&(i._stream=new ane,i._stream.setMaxListeners(30),i._rotateFile(),i.rotatedWhileOpening=!1,i._cleanupStream(c),a.end())});return Pf("create stream ok",h),c}},{key:"_incFile",value:function(a){Pf("_incFile",this.filename);var i=na.extname(this._basename),h=na.basename(this._basename,i),c=[];this.zippedArchive&&c.push(function(p){var b=this._created>0&&!this.tailable?this._created:"";this._compressFile(na.join(this.dirname,"".concat(h).concat(b).concat(i)),na.join(this.dirname,"".concat(h).concat(b).concat(i,".gz")),p)}.bind(this)),c.push(function(p){this.tailable?this._checkMaxFilesTailable(i,h,p):(this._created+=1,this._checkMaxFilesIncrementing(i,h,p))}.bind(this)),nne(c,a)}},{key:"_getFile",value:function(){var a=na.extname(this._basename),i=na.basename(this._basename,a),h=this.rotationFormat?this.rotationFormat():this._created;return!this.tailable&&this._created?"".concat(i).concat(h).concat(a):"".concat(i).concat(a)}},{key:"_checkMaxFilesIncrementing",value:function(a,i,h){if(!this.maxFiles||this._created<this.maxFiles)return setImmediate(h);var c=this._created-this.maxFiles,p=c!==0?c:"",b=this.zippedArchive?".gz":"",g="".concat(i).concat(p).concat(a).concat(b),y=na.join(this.dirname,g);fo.unlink(y,h)}},{key:"_checkMaxFilesTailable",value:function(a,i,h){var c=this,p=[];if(this.maxFiles){for(var b=this.zippedArchive?".gz":"",g=this.maxFiles-1;g>1;g--)p.push(function(y,M){var x=this,E="".concat(i).concat(y-1).concat(a).concat(b),A=na.join(this.dirname,E);fo.exists(A,function(k){if(!k)return M(null);E="".concat(i).concat(y).concat(a).concat(b),fo.rename(A,na.join(x.dirname,E),M)})}.bind(this,g));nne(p,function(){fo.rename(na.join(c.dirname,"".concat(i).concat(a).concat(b)),na.join(c.dirname,"".concat(i,"1").concat(a).concat(b)),h)})}}},{key:"_compressFile",value:function(a,i,h){fo.access(a,fo.F_OK,function(c){if(c)return h();var p=WRe.createGzip(),b=fo.createReadStream(a),g=fo.createWriteStream(i);g.on("finish",function(){fo.unlink(a,h)}),b.pipe(p).pipe(g)})}},{key:"_createLogDirIfNotExist",value:function(a){fo.existsSync(a)||fo.mkdirSync(a,{recursive:!0})}}]),e}(JRe)});var yne={};Ha(yne,{Agent:()=>aTe,ClientRequest:()=>oTe,IncomingMessage:()=>sTe,METHODS:()=>fTe,STATUS_CODES:()=>uTe,default:()=>Nf,get:()=>hTe,globalAgent:()=>cTe,request:()=>lTe});function gne(){if(cne)return No;cne=!0,No.fetch=a(Bd.fetch)&&a(Bd.ReadableStream),No.writableStream=a(Bd.WritableStream),No.abortController=a(Bd.AbortController);var t;function e(){if(t!==void 0)return t;if(Bd.XMLHttpRequest){t=new Bd.XMLHttpRequest;try{t.open("GET",Bd.XDomainRequest?"/":"https://example.com")}catch{t=null}}else t=null;return t}function r(i){var h=e();if(!h)return!1;try{return h.responseType=i,h.responseType===i}catch{}return!1}No.arraybuffer=No.fetch||r("arraybuffer"),No.msstream=!No.fetch&&r("ms-stream"),No.mozchunkedarraybuffer=!No.fetch&&r("moz-chunked-arraybuffer"),No.overrideMimeType=No.fetch||(e()?a(e().overrideMimeType):!1);function a(i){return typeof i=="function"}return t=null,No}function bne(){if(lne)return O4;lne=!0;var t=ni.Buffer,e=yr,r=gne(),a=Mr(),i=rp(),h=O4.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=O4.IncomingMessage=function(p,b,g,y){var M=this||P4;if(i.Readable.call(M),M._mode=g,M.headers={},M.rawHeaders=[],M.trailers={},M.rawTrailers=[],M.on("end",function(){e.nextTick(function(){M.emit("close")})}),g==="fetch"){let L=function(){E.read().then(function(C){if(!M._destroyed){if(y(C.done),C.done){M.push(null);return}M.push(t.from(C.value)),L()}}).catch(function(C){y(!0),M._destroyed||M.emit("error",C)})};var N=L;if(M._fetchResponse=b,M.url=b.url,M.statusCode=b.status,M.statusMessage=b.statusText,b.headers.forEach(function(C,Y){M.headers[Y.toLowerCase()]=C,M.rawHeaders.push(Y,C)}),r.writableStream){var x=new WritableStream({write:function(C){return y(!1),new Promise(function(Y,G){M._destroyed?G():M.push(t.from(C))?Y():M._resumeFetch=Y})},close:function(){y(!0),M._destroyed||M.push(null)},abort:function(C){y(!0),M._destroyed||M.emit("error",C)}});try{b.body.pipeTo(x).catch(function(C){y(!0),M._destroyed||M.emit("error",C)});return}catch{}}var E=b.body.getReader();L()}else{M._xhr=p,M._pos=0,M.url=p.responseURL,M.statusCode=p.status,M.statusMessage=p.statusText;var A=p.getAllResponseHeaders().split(/\r?\n/);if(A.forEach(function(L){var C=L.match(/^([^:]+):\s*(.*)/);if(C){var Y=C[1].toLowerCase();Y==="set-cookie"?(M.headers[Y]===void 0&&(M.headers[Y]=[]),M.headers[Y].push(C[2])):M.headers[Y]!==void 0?M.headers[Y]+=", "+C[2]:M.headers[Y]=C[2],M.rawHeaders.push(C[1],C[2])}}),M._charset="x-user-defined",!r.overrideMimeType){var k=M.rawHeaders["mime-type"];if(k){var O=k.match(/;\s*charset=([^;])(;|$)/);O&&(M._charset=O[1].toLowerCase())}M._charset||(M._charset="utf-8")}}};return a(c,i.Readable),c.prototype._read=function(){var p=this||P4,b=p._resumeFetch;b&&(p._resumeFetch=null,b())},c.prototype._onXHRProgress=function(p){var b=this||P4,g=b._xhr,y=null;switch(b._mode){case"text":if(y=g.responseText,y.length>b._pos){var M=y.substr(b._pos);if(b._charset==="x-user-defined"){for(var x=t.alloc(M.length),E=0;E<M.length;E++)x[E]=M.charCodeAt(E)&255;b.push(x)}else b.push(M,b._charset);b._pos=y.length}break;case"arraybuffer":if(g.readyState!==h.DONE||!g.response)break;y=g.response,b.push(t.from(new Uint8Array(y)));break;case"moz-chunked-arraybuffer":if(y=g.response,g.readyState!==h.LOADING||!y)break;b.push(t.from(new Uint8Array(y)));break;case"ms-stream":if(y=g.response,g.readyState!==h.LOADING)break;var A=new P4.MSStreamReader;A.onprogress=function(){A.result.byteLength>b._pos&&(b.push(t.from(new Uint8Array(A.result.slice(b._pos)))),b._pos=A.result.byteLength)},A.onload=function(){p(!0),b.push(null)},A.readAsArrayBuffer(y);break}b._xhr.readyState===h.DONE&&b._mode!=="ms-stream"&&(p(!0),b.push(null))},O4}function eTe(){if(dne)return tI;dne=!0;var t=ni.Buffer,e=yr,r=gne(),a=Mr(),i=bne(),h=rp(),c=i.IncomingMessage,p=i.readyStates;function b(x,E){return r.fetch&&E?"fetch":r.mozchunkedarraybuffer?"moz-chunked-arraybuffer":r.msstream?"ms-stream":r.arraybuffer&&x?"arraybuffer":"text"}var g=tI=function(x){var E=this||aa;h.Writable.call(E),E._opts=x,E._body=[],E._headers={},x.auth&&E.setHeader("Authorization","Basic "+t.from(x.auth).toString("base64")),Object.keys(x.headers).forEach(function(O){E.setHeader(O,x.headers[O])});var A,k=!0;if(x.mode==="disable-fetch"||"requestTimeout"in x&&!r.abortController)k=!1,A=!0;else if(x.mode==="prefer-streaming")A=!1;else if(x.mode==="allow-wrong-content-type")A=!r.overrideMimeType;else if(!x.mode||x.mode==="default"||x.mode==="prefer-fast")A=!0;else throw new Error("Invalid value for opts.mode");E._mode=b(A,k),E._fetchTimer=null,E._socketTimeout=null,E._socketTimer=null,E.on("finish",function(){E._onFinish()})};a(g,h.Writable),g.prototype.setHeader=function(x,E){var A=this||aa,k=x.toLowerCase();M.indexOf(k)===-1&&(A._headers[k]={name:x,value:E})},g.prototype.getHeader=function(x){var E=(this||aa)._headers[x.toLowerCase()];return E?E.value:null},g.prototype.removeHeader=function(x){var E=this||aa;delete E._headers[x.toLowerCase()]},g.prototype._onFinish=function(){var x=this||aa;if(!x._destroyed){var E=x._opts;"timeout"in E&&E.timeout!==0&&x.setTimeout(E.timeout);var A=x._headers,k=null;E.method!=="GET"&&E.method!=="HEAD"&&(k=new Blob(x._body,{type:(A["content-type"]||{}).value||""}));var O=[];if(Object.keys(A).forEach(function(Y){var G=A[Y].name,ee=A[Y].value;Array.isArray(ee)?ee.forEach(function($){O.push([G,$])}):O.push([G,ee])}),x._mode==="fetch"){var N=null;if(r.abortController){var L=new AbortController;N=L.signal,x._fetchAbortController=L,"requestTimeout"in E&&E.requestTimeout!==0&&(x._fetchTimer=aa.setTimeout(function(){x.emit("requestTimeout"),x._fetchAbortController&&x._fetchAbortController.abort()},E.requestTimeout))}aa.fetch(x._opts.url,{method:x._opts.method,headers:O,body:k||void 0,mode:"cors",credentials:E.withCredentials?"include":"same-origin",signal:N}).then(function(Y){x._fetchResponse=Y,x._resetTimers(!1),x._connect()},function(Y){x._resetTimers(!0),x._destroyed||x.emit("error",Y)})}else{var C=x._xhr=new aa.XMLHttpRequest;try{C.open(x._opts.method,x._opts.url,!0)}catch(Y){e.nextTick(function(){x.emit("error",Y)});return}"responseType"in C&&(C.responseType=x._mode),"withCredentials"in C&&(C.withCredentials=!!E.withCredentials),x._mode==="text"&&"overrideMimeType"in C&&C.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in E&&(C.timeout=E.requestTimeout,C.ontimeout=function(){x.emit("requestTimeout")}),O.forEach(function(Y){C.setRequestHeader(Y[0],Y[1])}),x._response=null,C.onreadystatechange=function(){switch(C.readyState){case p.LOADING:case p.DONE:x._onXHRProgress();break}},x._mode==="moz-chunked-arraybuffer"&&(C.onprogress=function(){x._onXHRProgress()}),C.onerror=function(){x._destroyed||(x._resetTimers(!0),x.emit("error",new Error("XHR error")))};try{C.send(k)}catch(Y){e.nextTick(function(){x.emit("error",Y)});return}}}};function y(x){try{var E=x.status;return E!==null&&E!==0}catch{return!1}}g.prototype._onXHRProgress=function(){var x=this||aa;x._resetTimers(!1),!(!y(x._xhr)||x._destroyed)&&(x._response||x._connect(),x._response._onXHRProgress(x._resetTimers.bind(x)))},g.prototype._connect=function(){var x=this||aa;x._destroyed||(x._response=new c(x._xhr,x._fetchResponse,x._mode,x._resetTimers.bind(x)),x._response.on("error",function(E){x.emit("error",E)}),x.emit("response",x._response))},g.prototype._write=function(x,E,A){var k=this||aa;k._body.push(x),A()},g.prototype._resetTimers=function(x){var E=this||aa;aa.clearTimeout(E._socketTimer),E._socketTimer=null,x?(aa.clearTimeout(E._fetchTimer),E._fetchTimer=null):E._socketTimeout&&(E._socketTimer=aa.setTimeout(function(){E.emit("timeout")},E._socketTimeout))},g.prototype.abort=g.prototype.destroy=function(x){var E=this||aa;E._destroyed=!0,E._resetTimers(!0),E._response&&(E._response._destroyed=!0),E._xhr?E._xhr.abort():E._fetchAbortController&&E._fetchAbortController.abort(),x&&E.emit("error",x)},g.prototype.end=function(x,E,A){var k=this||aa;typeof x=="function"&&(A=x,x=void 0),h.Writable.prototype.end.call(k,x,E,A)},g.prototype.setTimeout=function(x,E){var A=this||aa;E&&A.once("timeout",E),A._socketTimeout=x,A._resetTimers(!1)},g.prototype.flushHeaders=function(){},g.prototype.setNoDelay=function(){},g.prototype.setSocketKeepAlive=function(){};var M=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"];return tI}function tTe(){if(pne)return rI;pne=!0,rI=e;var t=Object.prototype.hasOwnProperty;function e(){for(var r={},a=0;a<arguments.length;a++){var i=arguments[a];for(var h in i)t.call(i,h)&&(r[h]=i[h])}return r}return rI}function rTe(){return vne||(vne=!0,iI={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}),iI}function nTe(){if(mne)return nI;mne=!0;var t=eTe(),e=bne(),r=tTe(),a=rTe(),i=vi,h=nI;return h.request=function(c,p){typeof c=="string"?c=i.parse(c):c=r(c);var b=iTe.location.protocol.search(/^https?:$/)===-1?"http:":"",g=c.protocol||b,y=c.hostname||c.host,M=c.port,x=c.path||"/";y&&y.indexOf(":")!==-1&&(y="["+y+"]"),c.url=(y?g+"//"+y:"")+(M?":"+M:"")+x,c.method=(c.method||"GET").toUpperCase(),c.headers=c.headers||{};var E=new t(c);return p&&E.on("response",p),E},h.get=function(p,b){var g=h.request(p,b);return g.end(),g},h.ClientRequest=t,h.IncomingMessage=e.IncomingMessage,h.Agent=function(){},h.Agent.defaultMaxSockets=4,h.globalAgent=new h.Agent,h.STATUS_CODES=a,h.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],nI}var No,cne,Bd,O4,lne,P4,tI,dne,aa,rI,pne,iI,vne,nI,mne,iTe,Nf,aTe,oTe,sTe,fTe,uTe,hTe,cTe,lTe,aI=Si(()=>{"use strict";ie();ae();ne();ah();sy();Ks();u4();Hs();th();Fo();Uo();Gf();Jg();Qg();Ad();No={},cne=!1,Bd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;O4={},lne=!1,P4=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;tI={},dne=!1,aa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;rI={},pne=!1;iI={},vne=!1;nI={},mne=!1,iTe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Nf=nTe(),aTe=Nf.Agent,oTe=Nf.ClientRequest,sTe=Nf.IncomingMessage,fTe=Nf.METHODS,uTe=Nf.STATUS_CODES,hTe=Nf.get,cTe=Nf.globalAgent,lTe=Nf.request});var Mne={};Ha(Mne,{Agent:()=>pTe,ClientRequest:()=>vTe,IncomingMessage:()=>mTe,METHODS:()=>gTe,STATUS_CODES:()=>bTe,default:()=>zh,get:()=>yTe,globalAgent:()=>wTe,request:()=>_Te});function dTe(){if(wne)return oI;wne=!0;var t=Nf,e=vi,r=oI;for(var a in t)t.hasOwnProperty(a)&&(r[a]=t[a]);r.request=function(h,c){return h=i(h),t.request.call(this||_ne,h,c)},r.get=function(h,c){return h=i(h),t.get.call(this||_ne,h,c)};function i(h){if(typeof h=="string"&&(h=e.parse(h)),h.protocol||(h.protocol="https:"),h.protocol!=="https:")throw new Error('Protocol "'+h.protocol+'" not supported. Expected "https:"');return h}return oI}var oI,wne,_ne,zh,pTe,vTe,mTe,gTe,bTe,yTe,wTe,_Te,xne=Si(()=>{"use strict";ie();ae();ne();aI();u4();ah();Hs();th();Fo();Uo();Ks();Gf();sy();Jg();Qg();Ad();oI={},wne=!1,_ne=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;zh=dTe(),pTe=zh.Agent,vTe=zh.ClientRequest,mTe=zh.IncomingMessage,gTe=zh.METHODS,bTe=zh.STATUS_CODES,yTe=zh.get,wTe=zh.globalAgent,_Te=zh.request});var kne=ht((k1t,Tne)=>{"use strict";ie();ae();ne();function j1(t){"@babel/helpers - typeof";return j1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j1(t)}function Sne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function sI(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Sne(Object(r),!0).forEach(function(a){MTe(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Sne(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function MTe(t,e,r){return e=Ane(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ene(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Ane(a.key),a)}}function STe(t,e,r){return e&&Ene(t.prototype,e),r&&Ene(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ane(t){var e=ETe(t,"string");return j1(e)=="symbol"?e:String(e)}function ETe(t,e){if(j1(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(j1(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ATe(t,e,r){return e=N4(e),RTe(t,Rne()?Reflect.construct(e,r||[],N4(t).constructor):e.apply(t,r))}function RTe(t,e){if(e&&(j1(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return TTe(t)}function TTe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Rne(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Rne=function(){return!!t})()}function N4(t){return N4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},N4(t)}function kTe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fI(t,e)}function fI(t,e){return fI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},fI(t,e)}var ITe=(aI(),ei(yne)),BTe=(xne(),ei(Mne)),OTe=Oh(),PTe=OTe.Stream,NTe=P1(),CTe=k1(),LTe=CTe.configure;Tne.exports=function(t){kTe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return xTe(this,e),r=ATe(this,e,[a]),r.options=a,r.name=a.name||"http",r.ssl=!!a.ssl,r.host=a.host||"localhost",r.port=a.port,r.auth=a.auth,r.path=a.path||"",r.maximumDepth=a.maximumDepth,r.agent=a.agent,r.headers=a.headers||{},r.headers["content-type"]="application/json",r.batch=a.batch||!1,r.batchInterval=a.batchInterval||5e3,r.batchCount=a.batchCount||10,r.batchOptions=[],r.batchTimeoutID=-1,r.batchCallback={},r.port||(r.port=r.ssl?443:80),r}return STe(e,[{key:"log",value:function(a,i){var h=this;this._request(a,null,null,function(c,p){p&&p.statusCode!==200&&(c=new Error("Invalid HTTP Status Code: ".concat(p.statusCode))),c?h.emit("warn",c):h.emit("logged",a)}),i&&setImmediate(i)}},{key:"query",value:function(a,i){typeof a=="function"&&(i=a,a={}),a={method:"query",params:this.normalizeQuery(a)};var h=a.params.auth||null;delete a.params.auth;var c=a.params.path||null;delete a.params.path,this._request(a,h,c,function(p,b,g){if(b&&b.statusCode!==200&&(p=new Error("Invalid HTTP Status Code: ".concat(b.statusCode))),p)return i(p);if(typeof g=="string")try{g=JSON.parse(g)}catch(y){return i(y)}i(null,g)})}},{key:"stream",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=new PTe;a={method:"stream",params:a};var h=a.params.path||null;delete a.params.path;var c=a.params.auth||null;delete a.params.auth;var p="",b=this._request(a,c,h);return i.destroy=function(){return b.destroy()},b.on("data",function(g){g=(p+g).split(/\n+/);for(var y=g.length-1,M=0;M<y;M++)try{i.emit("log",JSON.parse(g[M]))}catch(x){i.emit("error",x)}p=g[y]}),b.on("error",function(g){return i.emit("error",g)}),i}},{key:"_request",value:function(a,i,h,c){a=a||{},i=i||this.auth,h=h||this.path||"",this.batch?this._doBatch(a,c,i,h):this._doRequest(a,c,i,h)}},{key:"_doBatch",value:function(a,i,h,c){if(this.batchOptions.push(a),this.batchOptions.length===1){var p=this;this.batchCallback=i,this.batchTimeoutID=setTimeout(function(){p.batchTimeoutID=-1,p._doBatchRequest(p.batchCallback,h,c)},this.batchInterval)}this.batchOptions.length===this.batchCount&&this._doBatchRequest(this.batchCallback,h,c)}},{key:"_doBatchRequest",value:function(a,i,h){this.batchTimeoutID>0&&(clearTimeout(this.batchTimeoutID),this.batchTimeoutID=-1);var c=this.batchOptions.slice();this.batchOptions=[],this._doRequest(c,a,i,h)}},{key:"_doRequest",value:function(a,i,h,c){var p=Object.assign({},this.headers);h&&h.bearer&&(p.Authorization="Bearer ".concat(h.bearer));var b=(this.ssl?BTe:ITe).request(sI(sI({},this.options),{},{method:"POST",host:this.host,port:this.port,path:"/".concat(c.replace(/^\//,"")),headers:p,auth:h&&h.username&&h.password?"".concat(h.username,":").concat(h.password):"",agent:this.agent}));b.on("error",i),b.on("response",function(y){return y.on("end",function(){return i(null,y)}).resume()});var g=LTe(sI({},this.maximumDepth&&{maximumDepth:this.maximumDepth}));b.end(Me.from(g(a,this.options.replacer),"utf8"))}}]),e}(NTe)});var uI=ht((P1t,Ine)=>{"use strict";ie();ae();ne();var Du=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Du.writable=t=>Du(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Du.readable=t=>Du(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Du.duplex=t=>Du.writable(t)&&Du.readable(t);Du.transform=t=>Du.duplex(t)&&typeof t._transform=="function";Ine.exports=Du});var Nne=ht(($1t,Pne)=>{"use strict";ie();ae();ne();function z1(t){"@babel/helpers - typeof";return z1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z1(t)}function $Te(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bne(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,UTe(a.key),a)}}function DTe(t,e,r){return e&&Bne(t.prototype,e),r&&Bne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function UTe(t){var e=qTe(t,"string");return z1(e)=="symbol"?e:String(e)}function qTe(t,e){if(z1(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(z1(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function FTe(t,e,r){return e=C4(e),jTe(t,One()?Reflect.construct(e,r||[],C4(t).constructor):e.apply(t,r))}function jTe(t,e){if(e&&(z1(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zTe(t)}function zTe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function One(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(One=function(){return!!t})()}function C4(t){return C4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},C4(t)}function ZTe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hI(t,e)}function hI(t,e){return hI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},hI(t,e)}var HTe=uI(),KTe=sn(),WTe=KTe.MESSAGE,VTe=(bd(),ei(gd)),GTe=P1();Pne.exports=function(t){ZTe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if($Te(this,e),r=FTe(this,e,[a]),!a.stream||!HTe(a.stream))throw new Error("options.stream is required.");return r._stream=a.stream,r._stream.setMaxListeners(1/0),r.isObjectMode=a.stream._writableState.objectMode,r.eol=typeof a.eol=="string"?a.eol:VTe.EOL,r}return DTe(e,[{key:"log",value:function(a,i){var h=this;if(setImmediate(function(){return h.emit("logged",a)}),this.isObjectMode){this._stream.write(a),i&&i();return}this._stream.write("".concat(a[WTe]).concat(this.eol)),i&&i()}}]),e}(GTe)});var Cne=ht(f2=>{"use strict";ie();ae();ne();Object.defineProperty(f2,"Console",{configurable:!0,enumerable:!0,get:function(){return mte()}});Object.defineProperty(f2,"File",{configurable:!0,enumerable:!0,get:function(){return hne()}});Object.defineProperty(f2,"Http",{configurable:!0,enumerable:!0,get:function(){return kne()}});Object.defineProperty(f2,"Stream",{configurable:!0,enumerable:!0,get:function(){return Nne()}})});var $4=ht(u2=>{"use strict";ie();ae();ne();var L4=JT(),YTe=sn(),cI=YTe.configs;u2.cli=L4.levels(cI.cli);u2.npm=L4.levels(cI.npm);u2.syslog=L4.levels(cI.syslog);u2.addColors=L4.levels});var $ne=ht((D4,Lne)=>{"use strict";ie();ae();ne();Object.defineProperty(D4,"__esModule",{value:!0});var JTe=p4(),XTe=Od(JTe),QTe=S4(),eke=Od(QTe),tke=Uk(),rke=Od(tke),ike=Lk(),nke=Od(ike),ake=$k(),oke=Od(ake),ske=kd(),fke=Od(ske),uke=q1(),hke=Od(uke);function Od(t){return t&&t.__esModule?t:{default:t}}function cke(t,e,r){r=(0,nke.default)(r);var a=0,i=0,{length:h}=t,c=!1;h===0&&r(null);function p(b,g){b===!1&&(c=!0),c!==!0&&(b?r(b):(++i===h||g===eke.default)&&r(null))}for(;a<h;a++)e(t[a],a,(0,oke.default)(p))}function lke(t,e,r){return(0,rke.default)(t,1/0,e,r)}function dke(t,e,r){var a=(0,XTe.default)(t)?cke:lke;return a(t,(0,fke.default)(e),r)}D4.default=(0,hke.default)(dke,3);Lne.exports=D4.default});var Une=ht((U4,Dne)=>{"use strict";ie();ae();ne();Object.defineProperty(U4,"__esModule",{value:!0});U4.default=pke;function pke(t){return(e,r,a)=>t(e,a)}Dne.exports=U4.default});var j4=ht((F4,qne)=>{"use strict";ie();ae();ne();Object.defineProperty(F4,"__esModule",{value:!0});var vke=$ne(),mke=q4(vke),gke=Une(),bke=q4(gke),yke=kd(),wke=q4(yke),_ke=q1(),Mke=q4(_ke);function q4(t){return t&&t.__esModule?t:{default:t}}function xke(t,e,r){return(0,mke.default)(t,(0,bke.default)((0,wke.default)(e)),r)}F4.default=(0,Mke.default)(xke,3);qne.exports=F4.default});var jne=ht((nvt,Fne)=>{"use strict";ie();ae();ne();var Ske=Object.prototype.toString;Fne.exports=function(e){if(typeof e.displayName=="string"&&e.constructor.name)return e.displayName;if(typeof e.name=="string"&&e.name)return e.name;if(typeof e=="object"&&e.constructor&&typeof e.constructor.name=="string")return e.constructor.name;var r=e.toString(),a=Ske.call(e).slice(8,-1);return a==="Function"?r=r.substring(r.indexOf("(")+1,r.indexOf(")")):r=a,r||"anonymous"}});var lI=ht((fvt,zne)=>{"use strict";ie();ae();ne();var Eke=jne();zne.exports=function(e){var r=0,a;function i(){return r||(r=1,a=e.apply(this,arguments),e=null),a}return i.displayName=Eke(e),i}});var dI=ht(c2=>{"use strict";ie();ae();ne();c2.get=function(t){var e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var r={},a=Error.prepareStackTrace;Error.prepareStackTrace=function(h,c){return c},Error.captureStackTrace(r,t||c2.get);var i=r.stack;return Error.prepareStackTrace=a,Error.stackTraceLimit=e,i};c2.parse=function(t){if(!t.stack)return[];var e=this,r=t.stack.split(`
114
114
  `).slice(1);return r.map(function(a){if(a.match(/^\s*[-]{4,}$/))return e._createParsedCallSite({fileName:a,lineNumber:null,functionName:null,typeName:null,methodName:null,columnNumber:null,native:null});var i=a.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);if(i){var h=null,c=null,p=null,b=null,g=null,y=i[5]==="native";if(i[1]){p=i[1];var M=p.lastIndexOf(".");if(p[M-1]=="."&&M--,M>0){h=p.substr(0,M),c=p.substr(M+1);var x=h.indexOf(".Module");x>0&&(p=p.substr(x+1),h=h.substr(0,x))}b=null}c&&(b=h,g=c),c==="<anonymous>"&&(g=null,p=null);var E={fileName:i[2]||null,lineNumber:parseInt(i[3],10)||null,functionName:p,typeName:b,methodName:g,columnNumber:parseInt(i[4],10)||null,native:y};return e._createParsedCallSite(E)}}).filter(function(a){return!!a})};function h2(t){for(var e in t)this[e]=t[e]}var Ake=["this","typeName","functionName","methodName","fileName","lineNumber","columnNumber","function","evalOrigin"],Rke=["topLevel","eval","native","constructor"];Ake.forEach(function(t){h2.prototype[t]=null,h2.prototype["get"+t[0].toUpperCase()+t.substr(1)]=function(){return this[t]}});Rke.forEach(function(t){h2.prototype[t]=!1,h2.prototype["is"+t[0].toUpperCase()+t.substr(1)]=function(){return this[t]}});c2._createParsedCallSite=function(t){return new h2(t)}});var Wne=ht((mvt,Kne)=>{"use strict";ie();ae();ne();function Z1(t){"@babel/helpers - typeof";return Z1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z1(t)}function Tke(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Zne(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Ike(a.key),a)}}function kke(t,e,r){return e&&Zne(t.prototype,e),r&&Zne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ike(t){var e=Bke(t,"string");return Z1(e)=="symbol"?e:String(e)}function Bke(t,e){if(Z1(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(Z1(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Oke(t,e,r){return e=z4(e),Pke(t,Hne()?Reflect.construct(e,r||[],z4(t).constructor):e.apply(t,r))}function Pke(t,e){if(e&&(Z1(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nke(t)}function Nke(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Hne(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Hne=function(){return!!t})()}function z4(t){return z4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},z4(t)}function Cke(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pI(t,e)}function pI(t,e){return pI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},pI(t,e)}var Lke=Oh(),$ke=Lke.Writable;Kne.exports=function(t){Cke(e,t);function e(r){var a;if(Tke(this,e),a=Oke(this,e,[{objectMode:!0}]),!r)throw new Error("ExceptionStream requires a TransportStream instance.");return a.handleExceptions=!0,a.transport=r,a}return kke(e,[{key:"_write",value:function(a,i,h){return a.exception?this.transport.log(a,h):(h(),!0)}}]),e}($ke)});var mI=ht((wvt,Jne)=>{"use strict";ie();ae();ne();function l2(t){"@babel/helpers - typeof";return l2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l2(t)}function Dke(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vne(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,qke(a.key),a)}}function Uke(t,e,r){return e&&Vne(t.prototype,e),r&&Vne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function qke(t){var e=Fke(t,"string");return l2(e)=="symbol"?e:String(e)}function Fke(t,e){if(l2(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(l2(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Gne=(bd(),ei(gd)),jke=j4(),vI=s2()("winston:exception"),zke=lI(),Yne=dI(),Zke=Wne();Jne.exports=function(){function t(e){if(Dke(this,t),!e)throw new Error("Logger is required to handle exceptions");this.logger=e,this.handlers=new Map}return Uke(t,[{key:"handle",value:function(){for(var r=this,a=arguments.length,i=new Array(a),h=0;h<a;h++)i[h]=arguments[h];i.forEach(function(c){if(Array.isArray(c))return c.forEach(function(p){return r._addHandler(p)});r._addHandler(c)}),this.catcher||(this.catcher=this._uncaughtException.bind(this),He.on("uncaughtException",this.catcher))}},{key:"unhandle",value:function(){var r=this;this.catcher&&(He.removeListener("uncaughtException",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(function(a){return r.logger.unpipe(a)}))}},{key:"getAllInfo",value:function(r){var a=null;return r&&(a=typeof r=="string"?r:r.message),{error:r,level:"error",message:["uncaughtException: ".concat(a||"(no error message)"),r&&r.stack||" No stack trace"].join(`
115
115
  `),stack:r&&r.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(r)}}},{key:"getProcessInfo",value:function(){return{pid:He.pid,uid:He.getuid?He.getuid():null,gid:He.getgid?He.getgid():null,cwd:He.cwd(),execPath:He.execPath,version:He.version,argv:He.argv,memoryUsage:He.memoryUsage()}}},{key:"getOsInfo",value:function(){return{loadavg:Gne.loadavg(),uptime:Gne.uptime()}}},{key:"getTrace",value:function(r){var a=r?Yne.parse(r):Yne.get();return a.map(function(i){return{column:i.getColumnNumber(),file:i.getFileName(),function:i.getFunctionName(),line:i.getLineNumber(),method:i.getMethodName(),native:i.isNative()}})}},{key:"_addHandler",value:function(r){if(!this.handlers.has(r)){r.handleExceptions=!0;var a=new Zke(r);this.handlers.set(r,a),this.logger.pipe(a)}}},{key:"_uncaughtException",value:function(r){var a=this.getAllInfo(r),i=this._getExceptionHandlers(),h=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(r):this.logger.exitOnError,c;!i.length&&h&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),h=!1);function p(){vI("doExit",h),vI("process._exiting",He._exiting),h&&!He._exiting&&(c&&clearTimeout(c),He.exit(1))}if(!i||i.length===0)return He.nextTick(p);jke(i,function(b,g){var y=zke(g),M=b.transport||b;function x(E){return function(){vI(E),y()}}M._ending=!0,M.once("finish",x("finished")),M.once("error",x("error"))},function(){return h&&p()}),this.logger.log(a),h&&(c=setTimeout(p,3e3))}},{key:"_getExceptionHandlers",value:function(){return this.logger.transports.filter(function(r){var a=r.transport||r;return a.handleExceptions})}}]),t}()});var tae=ht((Svt,eae)=>{"use strict";ie();ae();ne();function H1(t){"@babel/helpers - typeof";return H1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H1(t)}function Hke(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xne(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Wke(a.key),a)}}function Kke(t,e,r){return e&&Xne(t.prototype,e),r&&Xne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Wke(t){var e=Vke(t,"string");return H1(e)=="symbol"?e:String(e)}function Vke(t,e){if(H1(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(H1(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Gke(t,e,r){return e=Z4(e),Yke(t,Qne()?Reflect.construct(e,r||[],Z4(t).constructor):e.apply(t,r))}function Yke(t,e){if(e&&(H1(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jke(t)}function Jke(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Qne(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Qne=function(){return!!t})()}function Z4(t){return Z4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Z4(t)}function Xke(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gI(t,e)}function gI(t,e){return gI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},gI(t,e)}var Qke=Oh(),eIe=Qke.Writable;eae.exports=function(t){Xke(e,t);function e(r){var a;if(Hke(this,e),a=Gke(this,e,[{objectMode:!0}]),!r)throw new Error("RejectionStream requires a TransportStream instance.");return a.handleRejections=!0,a.transport=r,a}return Kke(e,[{key:"_write",value:function(a,i,h){return a.rejection?this.transport.log(a,h):(h(),!0)}}]),e}(eIe)});var yI=ht((Tvt,aae)=>{"use strict";ie();ae();ne();function d2(t){"@babel/helpers - typeof";return d2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d2(t)}function tIe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rae(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,iIe(a.key),a)}}function rIe(t,e,r){return e&&rae(t.prototype,e),r&&rae(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function iIe(t){var e=nIe(t,"string");return d2(e)=="symbol"?e:String(e)}function nIe(t,e){if(d2(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(d2(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var iae=(bd(),ei(gd)),aIe=j4(),bI=s2()("winston:rejection"),oIe=lI(),nae=dI(),sIe=tae();aae.exports=function(){function t(e){if(tIe(this,t),!e)throw new Error("Logger is required to handle rejections");this.logger=e,this.handlers=new Map}return rIe(t,[{key:"handle",value:function(){for(var r=this,a=arguments.length,i=new Array(a),h=0;h<a;h++)i[h]=arguments[h];i.forEach(function(c){if(Array.isArray(c))return c.forEach(function(p){return r._addHandler(p)});r._addHandler(c)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),He.on("unhandledRejection",this.catcher))}},{key:"unhandle",value:function(){var r=this;this.catcher&&(He.removeListener("unhandledRejection",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(function(a){return r.logger.unpipe(a)}))}},{key:"getAllInfo",value:function(r){var a=null;return r&&(a=typeof r=="string"?r:r.message),{error:r,level:"error",message:["unhandledRejection: ".concat(a||"(no error message)"),r&&r.stack||" No stack trace"].join(`
116
116
  `),stack:r&&r.stack,rejection:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(r)}}},{key:"getProcessInfo",value:function(){return{pid:He.pid,uid:He.getuid?He.getuid():null,gid:He.getgid?He.getgid():null,cwd:He.cwd(),execPath:He.execPath,version:He.version,argv:He.argv,memoryUsage:He.memoryUsage()}}},{key:"getOsInfo",value:function(){return{loadavg:iae.loadavg(),uptime:iae.uptime()}}},{key:"getTrace",value:function(r){var a=r?nae.parse(r):nae.get();return a.map(function(i){return{column:i.getColumnNumber(),file:i.getFileName(),function:i.getFunctionName(),line:i.getLineNumber(),method:i.getMethodName(),native:i.isNative()}})}},{key:"_addHandler",value:function(r){if(!this.handlers.has(r)){r.handleRejections=!0;var a=new sIe(r);this.handlers.set(r,a),this.logger.pipe(a)}}},{key:"_unhandledRejection",value:function(r){var a=this.getAllInfo(r),i=this._getRejectionHandlers(),h=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(r):this.logger.exitOnError,c;!i.length&&h&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),h=!1);function p(){bI("doExit",h),bI("process._exiting",He._exiting),h&&!He._exiting&&(c&&clearTimeout(c),He.exit(1))}if(!i||i.length===0)return He.nextTick(p);aIe(i,function(b,g){var y=oIe(g),M=b.transport||b;function x(E){return function(){bI(E),y()}}M._ending=!0,M.once("finish",x("finished")),M.once("error",x("error"))},function(){return h&&p()}),this.logger.log(a),h&&(c=setTimeout(p,3e3))}},{key:"_getRejectionHandlers",value:function(){return this.logger.transports.filter(function(r){var a=r.transport||r;return a.handleRejections})}}]),t}()});var uae=ht((Ovt,fae)=>{"use strict";ie();ae();ne();var fIe=(no(),ei(Af)),oae=og(),{LEVEL:sae}=sn(),p2=fae.exports=function(e={}){oae.call(this,{objectMode:!0,highWaterMark:e.highWaterMark}),this.format=e.format,this.level=e.level,this.handleExceptions=e.handleExceptions,this.handleRejections=e.handleRejections,this.silent=e.silent,e.log&&(this.log=e.log),e.logv&&(this.logv=e.logv),e.close&&(this.close=e.close),this.once("pipe",r=>{this.levels=r.levels,this.parent=r}),this.once("unpipe",r=>{r===this.parent&&(this.parent=null,this.close&&this.close())})};fIe.inherits(p2,oae);p2.prototype._write=function(e,r,a){if(this.silent||e.exception===!0&&!this.handleExceptions)return a(null);let i=this.level||this.parent&&this.parent.level;if(!i||this.levels[i]>=this.levels[e[sae]]){if(e&&!this.format)return this.log(e,a);let h,c;try{c=this.format.transform(Object.assign({},e),this.format.options)}catch(p){h=p}if(h||!c){if(a(),h)throw h;return}return this.log(c,a)}return this._writableState.sync=!1,a(null)};p2.prototype._writev=function(e,r){if(this.logv){let a=e.filter(this._accept,this);return a.length?this.logv(a,r):r(null)}for(let a=0;a<e.length;a++){if(!this._accept(e[a]))continue;if(e[a].chunk&&!this.format){this.log(e[a].chunk,e[a].callback);continue}let i,h;try{h=this.format.transform(Object.assign({},e[a].chunk),this.format.options)}catch(c){i=c}if(i||!h){if(e[a].callback(),i)throw r(null),i}else this.log(h,e[a].callback)}return r(null)};p2.prototype._accept=function(e){let r=e.chunk;if(this.silent)return!1;let a=this.level||this.parent&&this.parent.level;return!!((r.exception===!0||!a||this.levels[a]>=this.levels[r[sae]])&&(this.handleExceptions||r.exception!==!0))};p2.prototype._nop=function(){}});var lae=ht((Lvt,cae)=>{"use strict";ie();ae();ne();var uIe=(no(),ei(Af)),{LEVEL:wI}=sn(),hae=uae(),v2=cae.exports=function(e={}){if(hae.call(this,e),!e.transport||typeof e.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");this.transport=e.transport,this.level=this.level||e.transport.level,this.handleExceptions=this.handleExceptions||e.transport.handleExceptions,this._deprecated();function r(a){this.emit("error",a,this.transport)}this.transport.__winstonError||(this.transport.__winstonError=r.bind(this),this.transport.on("error",this.transport.__winstonError))};uIe.inherits(v2,hae);v2.prototype._write=function(e,r,a){if(this.silent||e.exception===!0&&!this.handleExceptions)return a(null);(!this.level||this.levels[this.level]>=this.levels[e[wI]])&&this.transport.log(e[wI],e.message,e,this._nop),a(null)};v2.prototype._writev=function(e,r){for(let a=0;a<e.length;a++)this._accept(e[a])&&(this.transport.log(e[a].chunk[wI],e[a].chunk.message,e[a].chunk,this._nop),e[a].callback());return r(null)};v2.prototype._deprecated=function(){console.error([`${this.transport.name} is a legacy winston transport. Consider upgrading: `,"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
@@ -124,12 +124,12 @@ Found: ${e.toString().split(`
124
124
  -----END RSA `+a+` KEY-----
125
125
  `,c=Me.alloc(0);r?(e.version="two-prime",c=Qse.encode(e,"der")):c=Yse.encode(e,"der");var p=c.toString("base64").match(/.{1,64}/g).join(`
126
126
  `);return i+p+h}Fs.jwkTopem=jDe});var afe=ht(Qh=>{"use strict";ie();ae();ne();var zDe=Qh&&Qh.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),ZDe=Qh&&Qh.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),HDe=Qh&&Qh.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&zDe(e,t,r);return ZDe(e,t),e};Object.defineProperty(Qh,"__esModule",{value:!0});var nfe=ife(),js=HDe((lu(),ei(Mm))),FB=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";encryptionAlgorithm="aes-256-cbc";generateJWK(){if(typeof js.generateKeyPair!="function")throw new Error("Keypair generation not supported in this version of Node, only supported in versions 10+");return new Promise((e,r)=>{js.generateKeyPair("rsa",{modulusLength:this.keyLength,publicExponent:this.publicExponent,privateKeyEncoding:{type:"pkcs1",format:"pem"},publicKeyEncoding:{type:"pkcs1",format:"pem"}},(a,i,h)=>{a&&r(a),e(this.pemToJWK(h))})})}sign(e,r,{saltLength:a}={}){return new Promise((i,h)=>{i(js.createSign(this.hashAlgorithm).update(r).sign({key:this.jwkToPem(e),padding:js.constants.RSA_PKCS1_PSS_PADDING,saltLength:a}))})}verify(e,r,a){return new Promise((i,h)=>{let c={kty:"RSA",e:"AQAB",n:e},p=this.jwkToPem(c);i(js.createVerify(this.hashAlgorithm).update(r).verify({key:p,padding:js.constants.RSA_PKCS1_PSS_PADDING},a))})}hash(e,r="SHA-256"){if(typeof e=="string")throw new TypeError("Data must be a Uint8Array");return new Promise((a,i)=>{a(js.createHash(this.parseHashAlgorithm(r)).update(e).digest())})}async encrypt(e,r,a){let i=js.pbkdf2Sync(r,a=a||"salt",1e5,32,this.hashAlgorithm),h=js.randomBytes(16),c=js.createCipheriv(this.encryptionAlgorithm,i,h);return Me.concat([h,c.update(e),c.final()])}async decrypt(e,r,a){try{let i=js.pbkdf2Sync(r,a=a||"salt",1e5,32,this.hashAlgorithm),h=e.slice(0,16),c=e.slice(16),p=js.createDecipheriv(this.encryptionAlgorithm,i,h);return Me.concat([p.update(c),p.final()])}catch{throw new Error("Failed to decrypt")}}jwkToPem(e){return(0,nfe.jwkTopem)(e)}pemToJWK(e){return(0,nfe.pemTojwk)(e)}parseHashAlgorithm(e){switch(e){case"SHA-256":return"sha256";case"SHA-384":return"sha384";default:throw new Error(`Algorithm not supported: ${e}`)}}};Qh.default=FB});var ofe=ht(zB=>{"use strict";ie();ae();ne();Object.defineProperty(zB,"__esModule",{value:!0});var jB=class{api;constructor(e){this.api=e}getInfo(){return this.api.get("info").then(e=>e.data)}getPeers(){return this.api.get("peers").then(e=>e.data)}};zB.default=jB});var mb=ht(vb=>{"use strict";ie();ae();ne();Object.defineProperty(vb,"__esModule",{value:!0});vb.getError=void 0;var ZB=class extends Error{type;response;constructor(e,r={}){r.message?super(r.message):super(),this.type=e,this.response=r.response}getType(){return this.type}};vb.default=ZB;function KDe(t){let e=t.data;if(typeof t.data=="string")try{e=JSON.parse(t.data)}catch{}if(t.data instanceof ArrayBuffer||t.data instanceof Uint8Array)try{e=JSON.parse(e.toString())}catch{}return e?e.error||e:t.statusText||"unknown"}vb.getError=KDe});var ec=ht(Di=>{"use strict";ie();ae();ne();var WDe=Di&&Di.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),VDe=Di&&Di.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),GDe=Di&&Di.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&WDe(e,t,r);return VDe(e,t),e};Object.defineProperty(Di,"__esModule",{value:!0});Di.b64UrlDecode=Di.b64UrlEncode=Di.bufferTob64Url=Di.bufferTob64=Di.b64UrlToBuffer=Di.stringToB64Url=Di.stringToBuffer=Di.bufferToString=Di.b64UrlToString=Di.concatBuffers=void 0;var sfe=GDe(pE());function YDe(t){let e=0;for(let i=0;i<t.length;i++)e+=t[i].byteLength;let r=new Uint8Array(e),a=0;r.set(new Uint8Array(t[0]),a),a+=t[0].byteLength;for(let i=1;i<t.length;i++)r.set(new Uint8Array(t[i]),a),a+=t[i].byteLength;return r}Di.concatBuffers=YDe;function JDe(t){let e=hfe(t);return ffe(e)}Di.b64UrlToString=JDe;function ffe(t){return new TextDecoder("utf-8",{fatal:!0}).decode(t)}Di.bufferToString=ffe;function ufe(t){return new TextEncoder().encode(t)}Di.stringToBuffer=ufe;function XDe(t){return lfe(ufe(t))}Di.stringToB64Url=XDe;function hfe(t){return new Uint8Array(sfe.toByteArray(pfe(t)))}Di.b64UrlToBuffer=hfe;function cfe(t){return sfe.fromByteArray(new Uint8Array(t))}Di.bufferTob64=cfe;function lfe(t){return dfe(cfe(t))}Di.bufferTob64Url=lfe;function dfe(t){return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}Di.b64UrlEncode=dfe;function pfe(t){t=t.replace(/\-/g,"+").replace(/\_/g,"/");let e;return t.length%4==0?e=0:e=4-t.length%4,t.concat("=".repeat(e))}Di.b64UrlDecode=pfe});var gfe=ht(gb=>{"use strict";ie();ae();ne();var QDe=gb&&gb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gb,"__esModule",{value:!0});var Lo=QDe(Cw());async function vfe(t){if(Array.isArray(t)){let a=Lo.default.utils.concatBuffers([Lo.default.utils.stringToBuffer("list"),Lo.default.utils.stringToBuffer(t.length.toString())]);return await mfe(t,await Lo.default.crypto.hash(a,"SHA-384"))}let e=Lo.default.utils.concatBuffers([Lo.default.utils.stringToBuffer("blob"),Lo.default.utils.stringToBuffer(t.byteLength.toString())]),r=Lo.default.utils.concatBuffers([await Lo.default.crypto.hash(e,"SHA-384"),await Lo.default.crypto.hash(t,"SHA-384")]);return await Lo.default.crypto.hash(r,"SHA-384")}gb.default=vfe;async function mfe(t,e){if(t.length<1)return e;let r=Lo.default.utils.concatBuffers([e,await vfe(t[0])]),a=await Lo.default.crypto.hash(r,"SHA-384");return await mfe(t.slice(1),a)}});var YB=ht(Fr=>{"use strict";ie();ae();ne();var eUe=Fr&&Fr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.debug=Fr.validatePath=Fr.arrayCompare=Fr.bufferToInt=Fr.intToBuffer=Fr.arrayFlatten=Fr.generateProofs=Fr.buildLayers=Fr.generateTransactionChunks=Fr.generateTree=Fr.computeRootHash=Fr.generateLeaves=Fr.chunkData=Fr.MIN_CHUNK_SIZE=Fr.MAX_CHUNK_SIZE=void 0;var Lw=eUe(Cw()),bfe=ec();Fr.MAX_CHUNK_SIZE=256*1024;Fr.MIN_CHUNK_SIZE=32*1024;var yb=32,mv=32;async function KB(t){let e=[],r=t,a=0;for(;r.byteLength>=Fr.MAX_CHUNK_SIZE;){let i=Fr.MAX_CHUNK_SIZE,h=r.byteLength-Fr.MAX_CHUNK_SIZE;h>0&&h<Fr.MIN_CHUNK_SIZE&&(i=Math.ceil(r.byteLength/2));let c=r.slice(0,i),p=await Lw.default.crypto.hash(c);a+=c.byteLength,e.push({dataHash:p,minByteRange:a-c.byteLength,maxByteRange:a}),r=r.slice(i)}return e.push({dataHash:await Lw.default.crypto.hash(r),minByteRange:a,maxByteRange:a+r.byteLength}),e}Fr.chunkData=KB;async function WB(t){return Promise.all(t.map(async({dataHash:e,minByteRange:r,maxByteRange:a})=>({type:"leaf",id:await oa(await Promise.all([oa(e),oa(wb(a))])),dataHash:e,minByteRange:r,maxByteRange:a})))}Fr.generateLeaves=WB;async function tUe(t){return(await yfe(t)).id}Fr.computeRootHash=tUe;async function yfe(t){return await $w(await WB(await KB(t)))}Fr.generateTree=yfe;async function rUe(t){let e=await KB(t),r=await WB(e),a=await $w(r),i=await wfe(a),h=e.slice(-1)[0];return h.maxByteRange-h.minByteRange===0&&(e.splice(e.length-1,1),i.splice(i.length-1,1)),{data_root:a.id,chunks:e,proofs:i}}Fr.generateTransactionChunks=rUe;async function $w(t,e=0){if(t.length<2)return t[0];let r=[];for(let a=0;a<t.length;a+=2)r.push(await iUe(t[a],t[a+1]));return $w(r,e+1)}Fr.buildLayers=$w;function wfe(t){let e=HB(t);return Array.isArray(e)?VB(e):[e]}Fr.generateProofs=wfe;function HB(t,e=new Uint8Array,r=0){if(t.type=="leaf")return{offset:t.maxByteRange-1,proof:(0,bfe.concatBuffers)([e,t.dataHash,wb(t.maxByteRange)])};if(t.type=="branch"){let a=(0,bfe.concatBuffers)([e,t.leftChild.id,t.rightChild.id,wb(t.byteRange)]);return[HB(t.leftChild,a,r+1),HB(t.rightChild,a,r+1)]}throw new Error("Unexpected node type")}function VB(t){let e=[];return t.forEach(r=>{Array.isArray(r)?e.push(...VB(r)):e.push(r)}),e}Fr.arrayFlatten=VB;async function iUe(t,e){return e?{type:"branch",id:await oa([await oa(t.id),await oa(e.id),await oa(wb(t.maxByteRange))]),byteRange:t.maxByteRange,maxByteRange:e.maxByteRange,leftChild:t,rightChild:e}:t}async function oa(t){return Array.isArray(t)&&(t=Lw.default.utils.concatBuffers(t)),new Uint8Array(await Lw.default.crypto.hash(t))}function wb(t){let e=new Uint8Array(yb);for(var r=e.length-1;r>=0;r--){var a=t%256;e[r]=a,t=(t-a)/256}return e}Fr.intToBuffer=wb;function GB(t){let e=0;for(var r=0;r<t.length;r++)e*=256,e+=t[r];return e}Fr.bufferToInt=GB;var nUe=(t,e)=>t.every((r,a)=>e[a]===r);Fr.arrayCompare=nUe;async function bb(t,e,r,a,i){if(a<=0)return!1;if(e>=a)return bb(t,0,a-1,a,i);if(e<0)return bb(t,0,0,a,i);if(i.length==mv+yb){let M=i.slice(0,mv),x=i.slice(M.length,M.length+yb),E=await oa([await oa(M),await oa(x)]);return(0,Fr.arrayCompare)(t,E)?{offset:a-1,leftBound:r,rightBound:a,chunkSize:a-r}:!1}let h=i.slice(0,mv),c=i.slice(h.length,h.length+mv),p=i.slice(h.length+c.length,h.length+c.length+yb),b=GB(p),g=i.slice(h.length+c.length+p.length),y=await oa([await oa(h),await oa(c),await oa(p)]);return(0,Fr.arrayCompare)(t,y)?e<b?await bb(h,e,r,Math.min(a,b),g):await bb(c,e,Math.max(r,b),a,g):!1}Fr.validatePath=bb;async function _fe(t,e=""){if(t.byteLength<1)return e;let r=t.slice(0,mv),a=t.slice(r.length,r.length+mv),i=t.slice(r.length+a.length,r.length+a.length+yb),h=GB(i),c=t.slice(r.length+a.length+i.length),p=await oa([await oa(r),await oa(a),await oa(i)]),b=`${e}
127
- ${JSON.stringify(Me.from(r))},${JSON.stringify(Me.from(a))},${h} => ${JSON.stringify(p)}`;return _fe(c,b)}Fr.debug=_fe});var Uw=ht($o=>{"use strict";ie();ae();ne();var aUe=$o&&$o.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),oUe=$o&&$o.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),sUe=$o&&$o.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&aUe(e,t,r);return oUe(e,t),e},fUe=$o&&$o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($o,"__esModule",{value:!0});$o.Tag=void 0;var jn=sUe(ec()),uUe=fUe(gfe()),hUe=YB(),Dw=class{get(e,r){if(!Object.getOwnPropertyNames(this).includes(e))throw new Error(`Field "${e}" is not a property of the Arweave Transaction class.`);if(this[e]instanceof Uint8Array)return r&&r.decode&&r.string?jn.bufferToString(this[e]):r&&r.decode&&!r.string?this[e]:jn.bufferTob64Url(this[e]);if(this[e]instanceof Array){if(r?.decode!==void 0||r?.string!==void 0)throw e==="tags"&&console.warn(`Did you mean to use 'transaction["tags"]' ?`),new Error("Cannot decode or stringify an array.");return this[e]}return r&&r.decode==!0?r&&r.string?jn.b64UrlToString(this[e]):jn.b64UrlToBuffer(this[e]):this[e]}},_b=class extends Dw{name;value;constructor(e,r,a=!1){super(),this.name=e,this.value=r}};$o.Tag=_b;var JB=class extends Dw{format=2;id="";last_tx="";owner="";tags=[];target="";quantity="0";data_size="0";data=new Uint8Array;data_root="";reward="0";signature="";chunks;constructor(e={}){super(),Object.assign(this,e),typeof this.data=="string"&&(this.data=jn.b64UrlToBuffer(this.data)),e.tags&&(this.tags=e.tags.map(r=>new _b(r.name,r.value)))}addTag(e,r){this.tags.push(new _b(jn.stringToB64Url(e),jn.stringToB64Url(r)))}toJSON(){return{format:this.format,id:this.id,last_tx:this.last_tx,owner:this.owner,tags:this.tags,target:this.target,quantity:this.quantity,data:jn.bufferTob64Url(this.data),data_size:this.data_size,data_root:this.data_root,data_tree:this.data_tree,reward:this.reward,signature:this.signature}}setOwner(e){this.owner=e}setSignature({id:e,owner:r,reward:a,tags:i,signature:h}){this.id=e,this.owner=r,a&&(this.reward=a),i&&(this.tags=i),this.signature=h}async prepareChunks(e){!this.chunks&&e.byteLength>0&&(this.chunks=await(0,hUe.generateTransactionChunks)(e),this.data_root=jn.bufferTob64Url(this.chunks.data_root)),!this.chunks&&e.byteLength===0&&(this.chunks={chunks:[],data_root:new Uint8Array,proofs:[]},this.data_root="")}getChunk(e,r){if(!this.chunks)throw new Error("Chunks have not been prepared");let a=this.chunks.proofs[e],i=this.chunks.chunks[e];return{data_root:this.data_root,data_size:this.data_size,data_path:jn.bufferTob64Url(a.proof),offset:a.offset.toString(),chunk:jn.bufferTob64Url(r.slice(i.minByteRange,i.maxByteRange))}}async getSignatureData(){switch(this.format){case 1:let e=this.tags.reduce((a,i)=>jn.concatBuffers([a,i.get("name",{decode:!0,string:!1}),i.get("value",{decode:!0,string:!1})]),new Uint8Array);return jn.concatBuffers([this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),this.get("data",{decode:!0,string:!1}),jn.stringToBuffer(this.quantity),jn.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),e]);case 2:this.data_root||await this.prepareChunks(this.data);let r=this.tags.map(a=>[a.get("name",{decode:!0,string:!1}),a.get("value",{decode:!0,string:!1})]);return await(0,uUe.default)([jn.stringToBuffer(this.format.toString()),this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),jn.stringToBuffer(this.quantity),jn.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),r,jn.stringToBuffer(this.data_size),this.get("data_root",{decode:!0,string:!1})]);default:throw new Error(`Unexpected transaction format: ${this.format}`)}}};$o.default=JB});var Efe=ht(zs=>{"use strict";ie();ae();ne();var cUe=zs&&zs.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),lUe=zs&&zs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),dUe=zs&&zs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&cUe(e,t,r);return lUe(e,t),e},pUe=zs&&zs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zs,"__esModule",{value:!0});zs.TransactionUploader=void 0;var Mfe=pUe(Uw()),vUe=dUe(ec()),XB=mb(),mUe=YB(),xfe=1,gUe=["invalid_json","chunk_too_big","data_path_too_big","offset_too_big","data_size_too_big","chunk_proof_ratio_not_attractive","invalid_proof"],Sfe=1e3*40,QB=class t{api;chunkIndex=0;txPosted=!1;transaction;lastRequestTimeEnd=0;totalErrors=0;data;lastResponseStatus=0;lastResponseError="";get isComplete(){return this.txPosted&&this.chunkIndex===this.transaction.chunks.chunks.length}get totalChunks(){return this.transaction.chunks.chunks.length}get uploadedChunks(){return this.chunkIndex}get pctComplete(){return Math.trunc(this.uploadedChunks/this.totalChunks*100)}constructor(e,r){if(this.api=e,!r.id)throw new Error("Transaction is not signed");if(!r.chunks)throw new Error("Transaction chunks not prepared");this.data=r.data,this.transaction=new Mfe.default(Object.assign({},r,{data:new Uint8Array(0)}))}async uploadChunk(e){if(this.isComplete)throw new Error("Upload is already complete");if(this.lastResponseError!==""?this.totalErrors++:this.totalErrors=0,this.totalErrors===100)throw new Error(`Unable to complete upload: ${this.lastResponseStatus}: ${this.lastResponseError}`);let r=this.lastResponseError===""?0:Math.max(this.lastRequestTimeEnd+Sfe-Date.now(),Sfe);if(r>0&&(r=r-r*Math.random()*.3,await new Promise(c=>setTimeout(c,r))),this.lastResponseError="",!this.txPosted){await this.postTransaction();return}e&&(this.chunkIndex=e);let a=this.transaction.getChunk(e||this.chunkIndex,this.data);if(!await(0,mUe.validatePath)(this.transaction.chunks.data_root,parseInt(a.offset),0,parseInt(a.data_size),vUe.b64UrlToBuffer(a.data_path)))throw new Error(`Unable to validate chunk ${this.chunkIndex}`);let h=await this.api.post("chunk",this.transaction.getChunk(this.chunkIndex,this.data)).catch(c=>(console.error(c.message),{status:-1,data:{error:c.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=h.status,this.lastResponseStatus==200)this.chunkIndex++;else if(this.lastResponseError=(0,XB.getError)(h),gUe.includes(this.lastResponseError))throw new Error(`Fatal error uploading chunk ${this.chunkIndex}: ${this.lastResponseError}`)}static async fromSerialized(e,r,a){if(!r||typeof r.chunkIndex!="number"||typeof r.transaction!="object")throw new Error("Serialized object does not match expected format.");var i=new Mfe.default(r.transaction);i.chunks||await i.prepareChunks(a);let h=new t(e,i);if(h.chunkIndex=r.chunkIndex,h.lastRequestTimeEnd=r.lastRequestTimeEnd,h.lastResponseError=r.lastResponseError,h.lastResponseStatus=r.lastResponseStatus,h.txPosted=r.txPosted,h.data=a,h.transaction.data_root!==r.transaction.data_root)throw new Error("Data mismatch: Uploader doesn't match provided data.");return h}static async fromTransactionId(e,r){let a=await e.get(`tx/${r}`);if(a.status!==200)throw new Error(`Tx ${r} not found: ${a.status}`);let i=a.data;return i.data=new Uint8Array(0),{txPosted:!0,chunkIndex:0,lastResponseError:"",lastRequestTimeEnd:0,lastResponseStatus:0,transaction:i}}toJSON(){return{chunkIndex:this.chunkIndex,transaction:this.transaction,lastRequestTimeEnd:this.lastRequestTimeEnd,lastResponseStatus:this.lastResponseStatus,lastResponseError:this.lastResponseError,txPosted:this.txPosted}}async postTransaction(){if(this.totalChunks<=xfe){this.transaction.data=this.data;let a=await this.api.post("tx",this.transaction).catch(i=>(console.error(i),{status:-1,data:{error:i.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=a.status,this.transaction.data=new Uint8Array(0),a.status>=200&&a.status<300){this.txPosted=!0,this.chunkIndex=xfe;return}throw this.lastResponseError=(0,XB.getError)(a),new Error(`Unable to upload transaction: ${a.status}, ${this.lastResponseError}`)}let r=await this.api.post("tx",this.transaction);if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=r.status,!(r.status>=200&&r.status<300))throw this.lastResponseError=(0,XB.getError)(r),new Error(`Unable to upload transaction: ${r.status}, ${this.lastResponseError}`);this.txPosted=!0}};zs.TransactionUploader=QB});var qw=ht((j2t,Afe)=>{"use strict";ie();ae();ne();Afe.exports={}});var Tfe=ht(Zf=>{"use strict";ie();ae();ne();var bUe=Zf&&Zf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),yUe=Zf&&Zf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),wUe=Zf&&Zf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&bUe(e,t,r);return yUe(e,t),e},Rfe=Zf&&Zf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zf,"__esModule",{value:!0});var eO=Rfe(mb()),tc=Rfe(Uw()),Mb=wUe(ec()),tO=Efe();qw();var rO=class{api;crypto;chunks;constructor(e,r,a){this.api=e,this.crypto=r,this.chunks=a}async getTransactionAnchor(){let e=await this.api.get("tx_anchor");if(!e.data.match(/^[a-z0-9_-]{43,}/i)||!e.ok)throw new Error(`Could not getTransactionAnchor. Received: ${e.data}. Status: ${e.status}, ${e.statusText}`);return e.data}async getPrice(e,r){let a=r?`price/${e}/${r}`:`price/${e}`,i=await this.api.get(a);if(!/^\d+$/.test(i.data)||!i.ok)throw new Error(`Could not getPrice. Received: ${i.data}. Status: ${i.status}, ${i.statusText}`);return i.data}async get(e){let r=await this.api.get(`tx/${e}`);if(r.status==200){let a=parseInt(r.data.data_size);if(r.data.format>=2&&a>0&&a<=1024*1024*12){let i=await this.getData(e);return new tc.default({...r.data,data:i})}return new tc.default({...r.data,format:r.data.format||1})}throw r.status==404?new eO.default("TX_NOT_FOUND"):r.status==410?new eO.default("TX_FAILED"):new eO.default("TX_INVALID")}fromRaw(e){return new tc.default(e)}async search(e,r){return this.api.post("arql",{op:"equals",expr1:e,expr2:r}).then(a=>a.data?a.data:[])}getStatus(e){return this.api.get(`tx/${e}/status`).then(r=>r.status==200?{status:200,confirmed:r.data}:{status:r.status,confirmed:null})}async getData(e,r){let a;try{a=await this.chunks.downloadChunkedData(e)}catch(i){console.error(`Error while trying to download chunked data for ${e}`),console.error(i)}if(!a){console.warn(`Falling back to gateway cache for ${e}`);try{let{data:i,ok:h,status:c,statusText:p}=await this.api.get(`/${e}`,{responseType:"arraybuffer"});if(!h)throw new Error("Bad http status code",{cause:{status:c,statusText:p}});a=i}catch(i){console.error(`Error while trying to download contiguous data from gateway cache for ${e}`),console.error(i)}}if(!a)throw new Error(`${e} data was not found!`);return r&&r.decode&&!r.string?a:r&&r.decode&&r.string?Mb.bufferToString(a):Mb.bufferTob64Url(a)}async sign(e,r,a){let h=typeof r=="object"&&(p=>{let b=!0;return["n","e","d","p","q","dp","dq","qi"].map(g=>!(g in p)&&(b=!1)),b})(r),c=typeof arweaveWallet=="object";if(!h&&!c)throw new Error("No valid JWK or external wallet found to sign transaction.");if(h){e.setOwner(r.n);let p=await e.getSignatureData(),b=await this.crypto.sign(r,p,a),g=await this.crypto.hash(b);e.setSignature({id:Mb.bufferTob64Url(g),owner:r.n,signature:Mb.bufferTob64Url(b)})}else if(c){try{(await arweaveWallet.getPermissions()).includes("SIGN_TRANSACTION")||await arweaveWallet.connect(["SIGN_TRANSACTION"])}catch{}let p=await arweaveWallet.sign(e,a);e.setSignature({id:p.id,owner:p.owner,reward:p.reward,tags:p.tags,signature:p.signature})}else throw new Error("An error occurred while signing. Check wallet is valid")}async verify(e){let r=await e.getSignatureData(),a=e.get("signature",{decode:!0,string:!1}),i=Mb.bufferTob64Url(await this.crypto.hash(a));if(e.id!==i)throw new Error("Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.");return this.crypto.verify(e.owner,r,a)}async post(e){if(typeof e=="string"?e=new tc.default(JSON.parse(e)):typeof e.readInt32BE=="function"?e=new tc.default(JSON.parse(e.toString())):typeof e=="object"&&!(e instanceof tc.default)&&(e=new tc.default(e)),!(e instanceof tc.default))throw new Error("Must be Transaction object");e.chunks||await e.prepareChunks(e.data);let r=await this.getUploader(e,e.data);try{for(;!r.isComplete;)await r.uploadChunk()}catch(a){if(r.lastResponseStatus>0)return{status:r.lastResponseStatus,statusText:r.lastResponseError,data:{error:r.lastResponseError}};throw a}return{status:200,statusText:"OK",data:{}}}async getUploader(e,r){let a;if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),e instanceof tc.default){if(r||(r=e.data),!(r instanceof Uint8Array))throw new Error("Data format is invalid");e.chunks||await e.prepareChunks(r),a=new tO.TransactionUploader(this.api,e),(!a.data||a.data.length===0)&&(a.data=r)}else{if(typeof e=="string"&&(e=await tO.TransactionUploader.fromTransactionId(this.api,e)),!r||!(r instanceof Uint8Array))throw new Error("Must provide data when resuming upload");a=await tO.TransactionUploader.fromSerialized(this.api,e,r)}return a}async*upload(e,r){let a=await this.getUploader(e,r);for(;!a.isComplete;)await a.uploadChunk(),yield a;return a}};Zf.default=rO});var Ife=ht(rc=>{"use strict";ie();ae();ne();var _Ue=rc&&rc.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),MUe=rc&&rc.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),xUe=rc&&rc.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&_Ue(e,t,r);return MUe(e,t),e};Object.defineProperty(rc,"__esModule",{value:!0});var kfe=xUe(ec());qw();var iO=class{api;crypto;constructor(e,r){this.api=e,this.crypto=r}getBalance(e){return this.api.get(`wallet/${e}/balance`).then(r=>r.data)}getLastTransactionID(e){return this.api.get(`wallet/${e}/last_tx`).then(r=>r.data)}generate(){return this.crypto.generateJWK()}async jwkToAddress(e){return!e||e==="use_wallet"?this.getAddress():this.getAddress(e)}async getAddress(e){if(!e||e==="use_wallet"){try{await arweaveWallet.connect(["ACCESS_ADDRESS"])}catch{}return arweaveWallet.getActiveAddress()}else return this.ownerToAddress(e.n)}async ownerToAddress(e){return kfe.bufferTob64Url(await this.crypto.hash(kfe.b64UrlToBuffer(e)))}};rc.default=iO});var Ofe=ht(Hf=>{"use strict";ie();ae();ne();var SUe=Hf&&Hf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),EUe=Hf&&Hf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),AUe=Hf&&Hf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&SUe(e,t,r);return EUe(e,t),e};Object.defineProperty(Hf,"__esModule",{value:!0});Hf.SiloResource=void 0;var Bfe=AUe(ec()),nO=class{api;crypto;transactions;constructor(e,r,a){this.api=e,this.crypto=r,this.transactions=a}async get(e){if(!e)throw new Error("No Silo URI specified");let r=await this.parseUri(e),a=await this.transactions.search("Silo-Name",r.getAccessKey());if(a.length==0)throw new Error(`No data could be found for the Silo URI: ${e}`);let i=await this.transactions.get(a[0]);if(!i)throw new Error(`No data could be found for the Silo URI: ${e}`);let h=i.get("data",{decode:!0,string:!1});return this.crypto.decrypt(h,r.getEncryptionKey())}async readTransactionData(e,r){if(!r)throw new Error("No Silo URI specified");let a=await this.parseUri(r),i=e.get("data",{decode:!0,string:!1});return this.crypto.decrypt(i,a.getEncryptionKey())}async parseUri(e){let r=e.match(/^([a-z0-9-_]+)\.([0-9]+)/i);if(!r)throw new Error("Invalid Silo name, must be a name in the format of [a-z0-9]+.[0-9]+, e.g. 'bubble.7'");let a=r[1],i=Math.pow(2,parseInt(r[2])),h=await this.hash(Bfe.stringToBuffer(a),i),c=Bfe.bufferTob64(h.slice(0,15)),p=await this.hash(h.slice(16,31),1);return new Fw(e,c,p)}async hash(e,r){let a=await this.crypto.hash(e);for(let i=0;i<r-1;i++)a=await this.crypto.hash(a);return a}};Hf.default=nO;var Fw=class{uri;accessKey;encryptionKey;constructor(e,r,a){this.uri=e,this.accessKey=r,this.encryptionKey=a}getUri(){return this.uri}getAccessKey(){return this.accessKey}getEncryptionKey(){return this.encryptionKey}};Hf.SiloResource=Fw});var Nfe=ht(ic=>{"use strict";ie();ae();ne();var RUe=ic&&ic.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),TUe=ic&&ic.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),kUe=ic&&ic.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&RUe(e,t,r);return TUe(e,t),e};Object.defineProperty(ic,"__esModule",{value:!0});var Pfe=mb(),IUe=kUe(ec()),aO=class{api;constructor(e){this.api=e}async getTransactionOffset(e){let r=await this.api.get(`tx/${e}/offset`);if(r.status===200)return r.data;throw new Error(`Unable to get transaction offset: ${(0,Pfe.getError)(r)}`)}async getChunk(e){let r=await this.api.get(`chunk/${e}`);if(r.status===200)return r.data;throw new Error(`Unable to get chunk: ${(0,Pfe.getError)(r)}`)}async getChunkData(e){let r=await this.getChunk(e);return IUe.b64UrlToBuffer(r.chunk)}firstChunkOffset(e){return parseInt(e.offset)-parseInt(e.size)+1}async downloadChunkedData(e){let r=await this.getTransactionOffset(e),a=parseInt(r.size),h=parseInt(r.offset)-a+1,c=new Uint8Array(a),p=0;for(;p<a;){this.api.config.logging&&console.log(`[chunk] ${p}/${a}`);let b;try{b=await this.getChunkData(h+p)}catch{console.error(`[chunk] Failed to fetch chunk at offset ${h+p}`),console.error("[chunk] This could indicate that the chunk wasn't uploaded or hasn't yet seeded properly to a particular gateway/node")}if(b)c.set(b,p),p+=b.length;else throw new Error(`Couldn't complete data download at ${p}/${a}`)}return c}};ic.default=aO});var Lfe=ht(xb=>{"use strict";ie();ae();ne();var BUe=xb&&xb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xb,"__esModule",{value:!0});var Cfe=BUe(mb());qw();var oO=class t{api;network;static HASH_ENDPOINT="block/hash/";static HEIGHT_ENDPOINT="block/height/";constructor(e,r){this.api=e,this.network=r}async get(e){let r=await this.api.get(`${t.HASH_ENDPOINT}${e}`);if(r.status===200)return r.data;throw r.status===404?new Cfe.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${r}`)}async getByHeight(e){let r=await this.api.get(`${t.HEIGHT_ENDPOINT}${e}`);if(r.status===200)return r.data;throw r.status===404?new Cfe.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${r}`)}async getCurrent(){let{current:e}=await this.network.getInfo();return await this.get(e)}};xb.default=oO});var Cw=ht(Kf=>{"use strict";ie();ae();ne();var OUe=Kf&&Kf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),PUe=Kf&&Kf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),NUe=Kf&&Kf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&OUe(e,t,r);return PUe(e,t),e},Wu=Kf&&Kf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Kf,"__esModule",{value:!0});var CUe=Wu(Vse()),LUe=Wu(Gse()),$Ue=Wu(afe()),DUe=Wu(ofe()),UUe=Wu(Tfe()),qUe=Wu(Ife()),$fe=Wu(Uw()),Sb=NUe(ec()),FUe=Wu(Ofe()),jUe=Wu(Nfe()),zUe=Wu(Lfe()),sO=class t{api;wallets;transactions;network;blocks;ar;silo;chunks;static init;static crypto=new $Ue.default;static utils=Sb;constructor(e){this.api=new LUe.default(e),this.wallets=new qUe.default(this.api,t.crypto),this.chunks=new jUe.default(this.api),this.transactions=new UUe.default(this.api,t.crypto,this.chunks),this.silo=new FUe.default(this.api,this.crypto,this.transactions),this.network=new DUe.default(this.api),this.blocks=new zUe.default(this.api,this.network),this.ar=new CUe.default}get crypto(){return t.crypto}get utils(){return t.utils}getConfig(){return{api:this.api.getConfig(),crypto:null}}async createTransaction(e,r){let a={};if(Object.assign(a,e),!e.data&&!(e.target&&e.quantity))throw new Error("A new Arweave transaction must have a 'data' value, or 'target' and 'quantity' values.");if(e.owner==null&&r&&r!=="use_wallet"&&(a.owner=r.n),e.last_tx==null&&(a.last_tx=await this.transactions.getTransactionAnchor()),typeof e.data=="string"&&(e.data=Sb.stringToBuffer(e.data)),e.data instanceof ArrayBuffer&&(e.data=new Uint8Array(e.data)),e.data&&!(e.data instanceof Uint8Array))throw new Error("Expected data to be a string, Uint8Array or ArrayBuffer");if(e.reward==null){let h=e.data?e.data.byteLength:0;a.reward=await this.transactions.getPrice(h,a.target)}a.data_root="",a.data_size=e.data?e.data.byteLength.toString():"0",a.data=e.data||new Uint8Array(0);let i=new $fe.default(a);return await i.getSignatureData(),i}async createSiloTransaction(e,r,a){let i={};if(Object.assign(i,e),!e.data)throw new Error("Silo transactions must have a 'data' value");if(!a)throw new Error("No Silo URI specified.");if(e.target||e.quantity)throw new Error("Silo transactions can only be used for storing data, sending AR to other wallets isn't supported.");if(e.owner==null){if(!r||!r.n)throw new Error("A new Arweave transaction must either have an 'owner' attribute, or you must provide the jwk parameter.");i.owner=r.n}e.last_tx==null&&(i.last_tx=await this.transactions.getTransactionAnchor());let h=await this.silo.parseUri(a);if(typeof e.data=="string"){let p=await this.crypto.encrypt(Sb.stringToBuffer(e.data),h.getEncryptionKey());i.reward=await this.transactions.getPrice(p.byteLength),i.data=Sb.bufferTob64Url(p)}if(e.data instanceof Uint8Array){let p=await this.crypto.encrypt(e.data,h.getEncryptionKey());i.reward=await this.transactions.getPrice(p.byteLength),i.data=Sb.bufferTob64Url(p)}let c=new $fe.default(i);return c.addTag("Silo-Name",h.getAccessKey()),c.addTag("Silo-Version","0.1.0"),c}arql(e){return this.api.post("/arql",e).then(r=>r.data||[])}};Kf.default=sO});var Ufe=ht((uO,Dfe)=>{"use strict";ie();ae();ne();var ZUe=uO&&uO.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},fO=ZUe(Cw());fO.default.init=function(t={}){return new fO.default(t)};Dfe.exports=fO.default});var Wfe=ht((_6t,pO)=>{"use strict";ie();ae();ne();var GUe=Object.prototype.hasOwnProperty,Za="~";function Rb(){}Object.create&&(Rb.prototype=Object.create(null),new Rb().__proto__||(Za=!1));function YUe(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function Kfe(t,e,r,a,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var h=new YUe(r,a||t,i),c=Za?Za+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],h]:t._events[c].push(h):(t._events[c]=h,t._eventsCount++),t}function Kw(t,e){--t._eventsCount===0?t._events=new Rb:delete t._events[e]}function Pa(){this._events=new Rb,this._eventsCount=0}Pa.prototype.eventNames=function(){var e=[],r,a;if(this._eventsCount===0)return e;for(a in r=this._events)GUe.call(r,a)&&e.push(Za?a.slice(1):a);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};Pa.prototype.listeners=function(e){var r=Za?Za+e:e,a=this._events[r];if(!a)return[];if(a.fn)return[a.fn];for(var i=0,h=a.length,c=new Array(h);i<h;i++)c[i]=a[i].fn;return c};Pa.prototype.listenerCount=function(e){var r=Za?Za+e:e,a=this._events[r];return a?a.fn?1:a.length:0};Pa.prototype.emit=function(e,r,a,i,h,c){var p=Za?Za+e:e;if(!this._events[p])return!1;var b=this._events[p],g=arguments.length,y,M;if(b.fn){switch(b.once&&this.removeListener(e,b.fn,void 0,!0),g){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,r),!0;case 3:return b.fn.call(b.context,r,a),!0;case 4:return b.fn.call(b.context,r,a,i),!0;case 5:return b.fn.call(b.context,r,a,i,h),!0;case 6:return b.fn.call(b.context,r,a,i,h,c),!0}for(M=1,y=new Array(g-1);M<g;M++)y[M-1]=arguments[M];b.fn.apply(b.context,y)}else{var x=b.length,E;for(M=0;M<x;M++)switch(b[M].once&&this.removeListener(e,b[M].fn,void 0,!0),g){case 1:b[M].fn.call(b[M].context);break;case 2:b[M].fn.call(b[M].context,r);break;case 3:b[M].fn.call(b[M].context,r,a);break;case 4:b[M].fn.call(b[M].context,r,a,i);break;default:if(!y)for(E=1,y=new Array(g-1);E<g;E++)y[E-1]=arguments[E];b[M].fn.apply(b[M].context,y)}}return!0};Pa.prototype.on=function(e,r,a){return Kfe(this,e,r,a,!1)};Pa.prototype.once=function(e,r,a){return Kfe(this,e,r,a,!0)};Pa.prototype.removeListener=function(e,r,a,i){var h=Za?Za+e:e;if(!this._events[h])return this;if(!r)return Kw(this,h),this;var c=this._events[h];if(c.fn)c.fn===r&&(!i||c.once)&&(!a||c.context===a)&&Kw(this,h);else{for(var p=0,b=[],g=c.length;p<g;p++)(c[p].fn!==r||i&&!c[p].once||a&&c[p].context!==a)&&b.push(c[p]);b.length?this._events[h]=b.length===1?b[0]:b:Kw(this,h)}return this};Pa.prototype.removeAllListeners=function(e){var r;return e?(r=Za?Za+e:e,this._events[r]&&Kw(this,r)):(this._events=new Rb,this._eventsCount=0),this};Pa.prototype.off=Pa.prototype.removeListener;Pa.prototype.addListener=Pa.prototype.on;Pa.prefixed=Za;Pa.EventEmitter=Pa;typeof pO<"u"&&(pO.exports=Pa)});ie();ae();ne();ie();ae();ne();var sT={};Ha(sT,{AVSCTap:()=>Sg,AlgorandSigner:()=>vg,AptosSigner:()=>gg,ArconnectSigner:()=>p1,Arweave:()=>_W.default,ArweaveSigner:()=>Hc,Bundle:()=>I8,BundleItem:()=>oT,CryptoDriver:()=>v3,Curve25519:()=>xo,DataItem:()=>R8,EthereumSigner:()=>Io,HexInjectedSolanaSigner:()=>J0,HexSolanaSigner:()=>mg,InjectedAptosSigner:()=>X0,InjectedEthereumSigner:()=>oR,InjectedSolanaSigner:()=>A0,InjectedTypedEthereumSigner:()=>rT,KyveSigner:()=>wg,MAX_TAG_BYTES:()=>A8,MIN_BINARY_SIZE:()=>T8,MultiSignatureAptosSigner:()=>Q0,NearSigner:()=>pg,PolygonSigner:()=>dg,Rsa4096:()=>S0,SIG_CONFIG:()=>Wr,SignatureConfig:()=>wr,Signer:()=>Xw,SolanaSigner:()=>kh,Transaction:()=>wW.default,TypedEthereumSigner:()=>ed,bundleAndSignData:()=>K4e,byteArrayToLong:()=>yn,concatBuffers:()=>Oi.concatBuffers,createData:()=>Ag,deepHash:()=>qc,deserializeTags:()=>v1,exportForTesting:()=>j4e,getCryptoDriver:()=>xn,getSignatureAndId:()=>DX,indexToType:()=>_g,keccak256:()=>QR,longTo16ByteArray:()=>Z4e,longTo32ByteArray:()=>E8,longTo8ByteArray:()=>S8,longToNByteArray:()=>xg,secp256k1:()=>Y0,serializeTags:()=>nT,shortTo2ByteArray:()=>iT,sign:()=>k8,stringToBuffer:()=>Oi.stringToBuffer,unbundleData:()=>H4e});ie();ae();ne();ie();ae();ne();ie();ae();ne();var Xw=class{publicKey;signatureType;signatureLength;ownerLength;pem;static verify(e,r,a,i){throw new Error("You must implement verify method on child")}};ie();ae();ne();ie();ae();ne();var NK=gi(Do(),1);ie();ae();ne();var wr;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM",t[t.KYVE=101]="KYVE"})(wr||(wr={}));var Wr={[wr.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[wr.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[wr.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[wr.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[wr.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[wr.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[wr.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"},[wr.KYVE]:{sigLength:65,pubLength:65,sigName:"kyve"}};ie();ae();ne();lu();var Jn=BigInt(0),oi=BigInt(1),$c=BigInt(2),_ge=BigInt(8),AK=BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),Vi=Object.freeze({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l:AK,n:AK,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")});var BK=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),xm=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),ije=BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742"),Mge=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),xge=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Sge=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Ege=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),Ln=class t{constructor(e,r,a,i){this.x=e,this.y=r,this.z=a,this.t=i}static fromAffine(e){if(!(e instanceof Mn))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return e.equals(Mn.ZERO)?t.ZERO:new t(e.x,e.y,oi,Et(e.x*e.y))}static toAffineBatch(e){let r=Tge(e.map(a=>a.z));return e.map((a,i)=>a.toAffine(r[i]))}static normalizeZ(e){return this.toAffineBatch(e).map(this.fromAffine)}equals(e){TK(e);let{x:r,y:a,z:i}=this,{x:h,y:c,z:p}=e,b=Et(r*p),g=Et(h*i),y=Et(a*p),M=Et(c*i);return b===g&&y===M}negate(){return new t(Et(-this.x),this.y,this.z,Et(-this.t))}double(){let{x:e,y:r,z:a}=this,{a:i}=Vi,h=Et(e*e),c=Et(r*r),p=Et($c*Et(a*a)),b=Et(i*h),g=e+r,y=Et(Et(g*g)-h-c),M=b+c,x=M-p,E=b-c,A=Et(y*x),k=Et(M*E),O=Et(y*E),N=Et(x*M);return new t(A,k,N,O)}add(e){TK(e);let{x:r,y:a,z:i,t:h}=this,{x:c,y:p,z:b,t:g}=e,y=Et((a-r)*(p+c)),M=Et((a+r)*(p-c)),x=Et(M-y);if(x===Jn)return this.double();let E=Et(i*$c*g),A=Et(h*$c*b),k=A+E,O=M+y,N=A-E,L=Et(k*x),C=Et(O*N),Y=Et(k*N),G=Et(x*O);return new t(L,C,G,Y)}subtract(e){return this.add(e.negate())}precomputeWindow(e){let r=1+256/e,a=[],i=this,h=i;for(let c=0;c<r;c++){h=i,a.push(h);for(let p=1;p<2**(e-1);p++)h=h.add(i),a.push(h);i=h.double()}return a}wNAF(e,r){!r&&this.equals(t.BASE)&&(r=Mn.BASE);let a=r&&r._WINDOW_SIZE||1;if(256%a)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let i=r&&uE.get(r);i||(i=this.precomputeWindow(a),r&&a!==1&&(i=t.normalizeZ(i),uE.set(r,i)));let h=t.ZERO,c=t.BASE,p=1+256/a,b=2**(a-1),g=BigInt(2**a-1),y=2**a,M=BigInt(a);for(let x=0;x<p;x++){let E=x*b,A=Number(e&g);e>>=M,A>b&&(A-=y,e+=oi);let k=E,O=E+Math.abs(A)-1,N=x%2!==0,L=A<0;A===0?c=c.add(RK(N,i[k])):h=h.add(RK(L,i[O]))}return t.normalizeZ([h,c])[0]}multiply(e,r){return this.wNAF(i3(e,Vi.l),r)}multiplyUnsafe(e){let r=i3(e,Vi.l,!1),a=t.BASE,i=t.ZERO;if(r===Jn)return i;if(this.equals(i)||r===oi)return this;if(this.equals(a))return this.wNAF(r);let h=i,c=this;for(;r>Jn;)r&oi&&(h=h.add(c)),c=c.double(),r>>=oi;return h}isSmallOrder(){return this.multiplyUnsafe(Vi.h).equals(t.ZERO)}isTorsionFree(){let e=this.multiplyUnsafe(Vi.l/$c).double();return Vi.l%$c&&(e=e.add(this)),e.equals(t.ZERO)}toAffine(e){let{x:r,y:a,z:i}=this,h=this.equals(t.ZERO);e==null&&(e=h?_ge:n3(i));let c=Et(r*e),p=Et(a*e),b=Et(i*e);if(h)return Mn.ZERO;if(b!==oi)throw new Error("invZ was invalid");return new Mn(c,p)}fromRistrettoBytes(){oE()}toRistrettoBytes(){oE()}fromRistrettoHash(){oE()}};Ln.BASE=new Ln(Vi.Gx,Vi.Gy,oi,Et(Vi.Gx*Vi.Gy));Ln.ZERO=new Ln(Jn,oi,oi,Jn);function RK(t,e){let r=e.negate();return t?r:e}function TK(t){if(!(t instanceof Ln))throw new TypeError("ExtendedPoint expected")}function aE(t){if(!(t instanceof M0))throw new TypeError("RistrettoPoint expected")}function oE(){throw new Error("Legacy method: switch to RistrettoPoint")}var M0=class t{constructor(e){this.ep=e}static calcElligatorRistrettoMap(e){let{d:r}=Vi,a=Et(xm*e*e),i=Et((a+oi)*Sge),h=BigInt(-1),c=Et((h-r*a)*Et(a+r)),{isValid:p,value:b}=cE(i,c),g=Et(b*e);Lc(g)||(g=Et(-g)),p||(b=g),p||(h=a);let y=Et(h*(a-oi)*Ege-c),M=b*b,x=Et((b+b)*c),E=Et(y*Mge),A=Et(oi-M),k=Et(oi+M);return new Ln(Et(x*k),Et(A*E),Et(E*k),Et(x*A))}static hashToCurve(e){e=Dc(e,64);let r=sE(e.slice(0,32)),a=this.calcElligatorRistrettoMap(r),i=sE(e.slice(32,64)),h=this.calcElligatorRistrettoMap(i);return new t(a.add(h))}static fromHex(e){e=Dc(e,32);let{a:r,d:a}=Vi,i="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",h=sE(e);if(!Ige(Em(h),e)||Lc(h))throw new Error(i);let c=Et(h*h),p=Et(oi+r*c),b=Et(oi-r*c),g=Et(p*p),y=Et(b*b),M=Et(r*a*g-y),{isValid:x,value:E}=IK(Et(M*y)),A=Et(E*b),k=Et(E*A*M),O=Et((h+h)*A);Lc(O)&&(O=Et(-O));let N=Et(p*k),L=Et(O*N);if(!x||Lc(L)||N===Jn)throw new Error(i);return new t(new Ln(O,N,oi,L))}toRawBytes(){let{x:e,y:r,z:a,t:i}=this.ep,h=Et(Et(a+r)*Et(a-r)),c=Et(e*r),p=Et(c*c),{value:b}=IK(Et(h*p)),g=Et(b*h),y=Et(b*c),M=Et(g*y*i),x;if(Lc(i*M)){let A=Et(r*xm),k=Et(e*xm);e=A,r=k,x=Et(g*xge)}else x=y;Lc(e*M)&&(r=Et(-r));let E=Et((a-r)*x);return Lc(E)&&(E=Et(-E)),Em(E)}toHex(){return Am(this.toRawBytes())}toString(){return this.toHex()}equals(e){aE(e);let r=this.ep,a=e.ep,i=Et(r.x*a.y)===Et(r.y*a.x),h=Et(r.y*a.y)===Et(r.x*a.x);return i||h}add(e){return aE(e),new t(this.ep.add(e.ep))}subtract(e){return aE(e),new t(this.ep.subtract(e.ep))}multiply(e){return new t(this.ep.multiply(e))}multiplyUnsafe(e){return new t(this.ep.multiplyUnsafe(e))}};M0.BASE=new M0(Ln.BASE);M0.ZERO=new M0(Ln.ZERO);var uE=new WeakMap,Mn=class t{constructor(e,r){this.x=e,this.y=r}_setWindowSize(e){this._WINDOW_SIZE=e,uE.delete(this)}static fromHex(e,r=!0){let{d:a,P:i}=Vi;e=Dc(e,32);let h=e.slice();h[31]=e[31]&-129;let c=Rm(h);if(r&&c>=i)throw new Error("Expected 0 < hex < P");if(!r&&c>=BK)throw new Error("Expected 0 < hex < 2**256");let p=Et(c*c),b=Et(p-oi),g=Et(a*p+oi),{isValid:y,value:M}=cE(b,g);if(!y)throw new Error("Point.fromHex: invalid y coordinate");let x=(M&oi)===oi;return(e[31]&128)!==0!==x&&(M=Et(-M)),new t(M,c)}static async fromPrivateKey(e){return(await lE(e)).point}toRawBytes(){let e=Em(this.y);return e[31]|=this.x&oi?128:0,e}toHex(){return Am(this.toRawBytes())}toX25519(){let{y:e}=this,r=Et((oi+e)*n3(oi-e));return Em(r)}isTorsionFree(){return Ln.fromAffine(this).isTorsionFree()}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new t(Et(-this.x),this.y)}add(e){return Ln.fromAffine(this).add(Ln.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return Ln.fromAffine(this).multiply(e,this).toAffine()}};Mn.BASE=new Mn(Vi.Gx,Vi.Gy);Mn.ZERO=new Mn(Jn,oi);var Sm=class t{constructor(e,r){this.r=e,this.s=r,this.assertValidity()}static fromHex(e){let r=Dc(e,64),a=Mn.fromHex(r.slice(0,32),!1),i=Rm(r.slice(32,64));return new t(a,i)}assertValidity(){let{r:e,s:r}=this;if(!(e instanceof Mn))throw new Error("Expected Point instance");return i3(r,Vi.l,!1),this}toRawBytes(){let e=new Uint8Array(64);return e.set(this.r.toRawBytes()),e.set(Em(this.s),32),e}toHex(){return Am(this.toRawBytes())}};function kK(...t){if(!t.every(a=>a instanceof Uint8Array))throw new Error("Expected Uint8Array list");if(t.length===1)return t[0];let e=t.reduce((a,i)=>a+i.length,0),r=new Uint8Array(e);for(let a=0,i=0;a<t.length;a++){let h=t[a];r.set(h,i),i+=h.length}return r}var Age=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Am(t){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=Age[t[r]];return e}function hE(t){if(typeof t!="string")throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){let a=r*2,i=t.slice(a,a+2),h=Number.parseInt(i,16);if(Number.isNaN(h)||h<0)throw new Error("Invalid byte sequence");e[r]=h}return e}function OK(t){let r=t.toString(16).padStart(64,"0");return hE(r)}function Em(t){return OK(t).reverse()}function Lc(t){return(Et(t)&oi)===oi}function Rm(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");return BigInt("0x"+Am(Uint8Array.from(t).reverse()))}var Rge=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function sE(t){return Et(Rm(t)&Rge)}function Et(t,e=Vi.P){let r=t%e;return r>=Jn?r:e+r}function n3(t,e=Vi.P){if(t===Jn||e<=Jn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Et(t,e),a=e,i=Jn,h=oi,c=oi,p=Jn;for(;r!==Jn;){let g=a/r,y=a%r,M=i-c*g,x=h-p*g;a=r,r=y,i=c,h=p,c=M,p=x}if(a!==oi)throw new Error("invert: does not exist");return Et(i,e)}function Tge(t,e=Vi.P){let r=new Array(t.length),a=t.reduce((h,c,p)=>c===Jn?h:(r[p]=h,Et(h*c,e)),oi),i=n3(a,e);return t.reduceRight((h,c,p)=>c===Jn?h:(r[p]=Et(h*r[p],e),Et(h*c,e)),i),r}function du(t,e){let{P:r}=Vi,a=t;for(;e-- >Jn;)a*=a,a%=r;return a}function kge(t){let{P:e}=Vi,r=BigInt(5),a=BigInt(10),i=BigInt(20),h=BigInt(40),c=BigInt(80),b=t*t%e*t%e,g=du(b,$c)*b%e,y=du(g,oi)*t%e,M=du(y,r)*y%e,x=du(M,a)*M%e,E=du(x,i)*x%e,A=du(E,h)*E%e,k=du(A,c)*A%e,O=du(k,c)*A%e,N=du(O,a)*M%e;return{pow_p_5_8:du(N,$c)*t%e,b2:b}}function cE(t,e){let r=Et(e*e*e),a=Et(r*r*e),i=kge(t*a).pow_p_5_8,h=Et(t*r*i),c=Et(e*h*h),p=h,b=Et(h*xm),g=c===t,y=c===Et(-t),M=c===Et(-t*xm);return g&&(h=p),(y||M)&&(h=b),Lc(h)&&(h=Et(-h)),{isValid:g||y,value:h}}function IK(t){return cE(oi,t)}function r3(t){return Et(Rm(t),Vi.l)}function Ige(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function Dc(t,e){let r=t instanceof Uint8Array?Uint8Array.from(t):hE(t);if(typeof e=="number"&&r.length!==e)throw new Error(`Expected ${e} bytes`);return r}function i3(t,e,r=!0){if(!e)throw new TypeError("Specify max value");if(typeof t=="number"&&Number.isSafeInteger(t)&&(t=BigInt(t)),typeof t=="bigint"&&t<e){if(r){if(Jn<t)return t}else if(Jn<=t)return t}throw new TypeError("Expected valid scalar: 0 < scalar < max")}function Bge(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function Oge(t){if(t=typeof t=="bigint"||typeof t=="number"?OK(i3(t,BK)):Dc(t),t.length!==32)throw new Error("Expected 32 bytes");return t}function Pge(t){let e=Bge(t.slice(0,32)),r=t.slice(32,64),a=r3(e),i=Mn.BASE.multiply(a),h=i.toRawBytes();return{head:e,prefix:r,scalar:a,point:i,pointBytes:h}}var fE;async function lE(t){return Pge(await Ip.sha512(Oge(t)))}async function PK(t,e){t=Dc(t);let{prefix:r,scalar:a,pointBytes:i}=await lE(e),h=r3(await Ip.sha512(r,t)),c=Mn.BASE.multiply(h),p=r3(await Ip.sha512(c.toRawBytes(),i,t)),b=Et(h+p*a,Vi.l);return new Sm(c,b).toRawBytes()}function Nge(t,e,r){e=Dc(e),r instanceof Mn||(r=Mn.fromHex(r,!1));let{r:a,s:i}=t instanceof Sm?t.assertValidity():Sm.fromHex(t),h=Ln.BASE.multiplyUnsafe(i);return{r:a,s:i,SB:h,pub:r,msg:e}}function Cge(t,e,r,a){let i=r3(a),h=Ln.fromAffine(t).multiplyUnsafe(i);return Ln.fromAffine(e).add(h).subtract(r).multiplyUnsafe(Vi.h).equals(Ln.ZERO)}async function Uc(t,e,r){let{r:a,SB:i,msg:h,pub:c}=Nge(t,e,r),p=await Ip.sha512(a.toRawBytes(),c.toRawBytes(),h);return Cge(c,a,i,p)}Mn.BASE._setWindowSize(8);var Cc={node:Mm,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0},Ip={bytesToHex:Am,hexToBytes:hE,concatBytes:kK,getExtendedPublicKey:lE,mod:Et,invert:n3,TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],hashToPrivateScalar:t=>{if(t=Dc(t),t.length<40||t.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return Et(Rm(t),Vi.l-oi)+oi},randomBytes:(t=32)=>{if(Cc.web)return Cc.web.getRandomValues(new Uint8Array(t));if(Cc.node){let{randomBytes:e}=Cc.node;return new Uint8Array(e(t).buffer)}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>Ip.randomBytes(32),sha512:async(...t)=>{let e=kK(...t);if(Cc.web){let r=await Cc.web.subtle.digest("SHA-512",e.buffer);return new Uint8Array(r)}else{if(Cc.node)return Uint8Array.from(Cc.node.createHash("sha512").update(e).digest());throw new Error("The environment doesn't have sha512 function")}},precompute(t=8,e=Mn.BASE){let r=e.equals(Mn.BASE)?e:new Mn(e.x,e.y);return r._setWindowSize(t),r.multiply($c),r},sha512Sync:void 0};Object.defineProperties(Ip,{sha512Sync:{configurable:!1,get(){return fE},set(t){fE||(fE=t)}}});var xo=class{_key;pk;ownerLength=Wr[2].pubLength;signatureLength=Wr[2].sigLength;_publicKey;get publicKey(){return this._publicKey}signatureType=2;constructor(e,r){this._key=e,this.pk=r}get key(){throw new Error("You must implement `key`")}sign(e){return PK(Me.from(e),Me.from(this.key))}static async verify(e,r,a){let i=e;return typeof e=="string"&&(i=NK.default.toBuffer(e)),Uc(Me.from(a),Me.from(r),Me.from(i))}};ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var Oi=gi(pf(),1);ie();ae();ne();lu();async function qc(t){if(typeof t[Symbol.asyncIterator]=="function"){let i=t,h=df("sha384"),c=0;for await(let g of i)c+=g.byteLength,h.update(g);let p=(0,Oi.concatBuffers)([(0,Oi.stringToBuffer)("blob"),(0,Oi.stringToBuffer)(c.toString())]),b=(0,Oi.concatBuffers)([await xn().hash(p,"SHA-384"),h.digest()]);return await xn().hash(b,"SHA-384")}else if(Array.isArray(t)){let i=(0,Oi.concatBuffers)([(0,Oi.stringToBuffer)("list"),(0,Oi.stringToBuffer)(t.length.toString())]);return await HK(t,await xn().hash(i,"SHA-384"))}let e=t,r=(0,Oi.concatBuffers)([(0,Oi.stringToBuffer)("blob"),(0,Oi.stringToBuffer)(e.byteLength.toString())]),a=(0,Oi.concatBuffers)([await xn().hash(r,"SHA-384"),await xn().hash(e,"SHA-384")]);return await xn().hash(a,"SHA-384")}async function HK(t,e){if(t.length<1)return e;let r=(0,Oi.concatBuffers)([e,await qc(t[0])]),a=await xn().hash(r,"SHA-384");return await HK(t.slice(1),a)}var p3=gi(gE(),1),wW=gi(Nm(),1),_W=gi(yW(),1),_2e=p3.default.default?p3.default.default:p3.default,v3=class extends _2e{getPublicKey(e){throw new Error("Unimplemented")}},M2e;function xn(){return M2e??=new v3}var MW=gi(Do(),1);lu();var S0=class{_key;pk;signatureType=1;ownerLength=Wr[1].pubLength;signatureLength=Wr[1].sigLength;_publicKey;get publicKey(){return this._publicKey}constructor(e,r){this._key=e,this.pk=r,r||(this.pk=xn().getPublicKey(JSON.parse(e)))}sign(e){return nE("sha256").update(e).sign({key:this._key,padding:iE.RSA_PKCS1_PSS_PADDING})}static async verify(e,r,a){return await xn().verify(Me.isBuffer(e)?MW.default.encode(e):e,r,a)}};var hV=gi(uV(),1),cV=gi(Do(),1);var Hc=class extends S0{jwk;constructor(e){super((0,hV.jwkTopem)(e),e.n),this.jwk=e}get publicKey(){if(!this.pk)throw new Error("ArweaveSigner - pk is undefined");return cV.default.toBuffer(this.pk)}sign(e){return xn().sign(this.jwk,e)}static async verify(e,r,a){return await xn().verify(e,r,a)}};ie();ae();ne();var lV=gi(Do(),1);var A0=class{_publicKey;ownerLength=Wr[2].pubLength;signatureLength=Wr[2].sigLength;signatureType=2;pem;provider;constructor(e){if(this.provider=e,!this.provider.publicKey)throw new Error("InjectedSolanaSigner - provider.publicKey is undefined");this._publicKey=this.provider.publicKey.toBuffer()}get publicKey(){return this._publicKey}async sign(e){if(!this.provider.signMessage)throw new Error("Selected Wallet does not support message signing");return await this.provider.signMessage(e)}static async verify(e,r,a){let i=e;return typeof e=="string"&&(i=lV.default.toBuffer(e)),Uc(Me.from(a),Me.from(r),Me.from(i))}};ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var xV=gi(dV());ie();ae();ne();ie();ae();ne();ie();ae();ne();var pV="logger/5.7.0";var vV=!1,mV=!1,S3={debug:1,default:2,info:2,warning:3,error:4,off:5},gV=S3.default,cA=null;function rbe(){try{let t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("\xE9".normalize("NFD")!=="e\u0301")throw new Error("broken implementation")}catch(t){return t.message}return null}var bV=rbe(),lA;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(lA||(lA={}));var mf;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(mf||(mf={}));var yV="0123456789abcdef",er=class t{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){let a=e.toLowerCase();S3[a]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(gV>S3[a])&&console.log.apply(console,r)}debug(...e){this._log(t.levels.DEBUG,e)}info(...e){this._log(t.levels.INFO,e)}warn(...e){this._log(t.levels.WARNING,e)}makeError(e,r,a){if(mV)return this.makeError("censored error",r,{});r||(r=t.errors.UNKNOWN_ERROR),a||(a={});let i=[];Object.keys(a).forEach(b=>{let g=a[b];try{if(g instanceof Uint8Array){let y="";for(let M=0;M<g.length;M++)y+=yV[g[M]>>4],y+=yV[g[M]&15];i.push(b+"=Uint8Array(0x"+y+")")}else i.push(b+"="+JSON.stringify(g))}catch{i.push(b+"="+JSON.stringify(a[b].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);let h=e,c="";switch(r){case mf.NUMERIC_FAULT:{c="NUMERIC_FAULT";let b=e;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case mf.CALL_EXCEPTION:case mf.INSUFFICIENT_FUNDS:case mf.MISSING_NEW:case mf.NONCE_EXPIRED:case mf.REPLACEMENT_UNDERPRICED:case mf.TRANSACTION_REPLACED:case mf.UNPREDICTABLE_GAS_LIMIT:c=r;break}c&&(e+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),i.length&&(e+=" ("+i.join(", ")+")");let p=new Error(e);return p.reason=h,p.code=r,Object.keys(a).forEach(function(b){p[b]=a[b]}),p}throwError(e,r,a){throw this.makeError(e,r,a)}throwArgumentError(e,r,a){return this.throwError(e,t.errors.INVALID_ARGUMENT,{argument:r,value:a})}assert(e,r,a,i){e||this.throwError(r,a,i)}assertArgument(e,r,a,i){e||this.throwArgumentError(r,a,i)}checkNormalize(e){e==null&&(e="platform missing String.prototype.normalize"),bV&&this.throwError("platform missing String.prototype.normalize",t.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:bV})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,a){a?a=": "+a:a="",e<r&&this.throwError("missing argument"+a,t.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+a,t.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",t.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return cA||(cA=new t(pV)),cA}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),vV){if(!e)return;this.globalLogger().throwError("error censorship permanent",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}mV=!!e,vV=!!r}static setLogLevel(e){let r=S3[e.toLowerCase()];if(r==null){t.globalLogger().warn("invalid log level - "+e);return}gV=r}static from(e){return new t(e)}};er.errors=mf;er.levels=lA;ie();ae();ne();var wV="bytes/5.7.0";var Sn=new er(wV);function MV(t){return!!t.toHexString}function Fp(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return Fp(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function qm(t){return Dn(t)&&!(t.length%2)||Fm(t)}function _V(t){return typeof t=="number"&&t==t&&t%1===0}function Fm(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!_V(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(!_V(r)||r<0||r>=256)return!1}return!0}function Ct(t,e){if(e||(e={}),typeof t=="number"){Sn.checkSafeUint53(t,"invalid arrayify value");let r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),Fp(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),MV(t)&&(t=t.toHexString()),Dn(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":Sn.throwArgumentError("hex data is odd-length","value",t));let a=[];for(let i=0;i<r.length;i+=2)a.push(parseInt(r.substring(i,i+2),16));return Fp(new Uint8Array(a))}return Fm(t)?Fp(new Uint8Array(t)):Sn.throwArgumentError("invalid arrayify value","value",t)}function Ao(t){let e=t.map(i=>Ct(i)),r=e.reduce((i,h)=>i+h.length,0),a=new Uint8Array(r);return e.reduce((i,h)=>(a.set(h,i),i+h.length),0),Fp(a)}function vu(t){let e=Ct(t);if(e.length===0)return e;let r=0;for(;r<e.length&&e[r]===0;)r++;return r&&(e=e.slice(r)),e}function ibe(t,e){t=Ct(t),t.length>e&&Sn.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(e);return r.set(t,e-t.length),Fp(r)}function Dn(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}var dA="0123456789abcdef";function sr(t,e){if(e||(e={}),typeof t=="number"){Sn.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=dA[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),MV(t))return t.toHexString();if(Dn(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":Sn.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(Fm(t)){let r="0x";for(let a=0;a<t.length;a++){let i=t[a];r+=dA[(i&240)>>4]+dA[i&15]}return r}return Sn.throwArgumentError("invalid hexlify value","value",t)}function jm(t){if(typeof t!="string")t=sr(t);else if(!Dn(t)||t.length%2)return null;return(t.length-2)/2}function _h(t,e,r){return typeof t!="string"?t=sr(t):(!Dn(t)||t.length%2)&&Sn.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Kc(t){let e="0x";return t.forEach(r=>{e+=sr(r).substring(2)}),e}function Ea(t,e){for(typeof t!="string"?t=sr(t):Dn(t)||Sn.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&Sn.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Wc(t){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(qm(t)){let r=Ct(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=sr(r.slice(0,32)),e.s=sr(r.slice(32,64))):r.length===65?(e.r=sr(r.slice(0,32)),e.s=sr(r.slice(32,64)),e.v=r[64]):Sn.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:Sn.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=sr(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){let i=ibe(Ct(e._vs),32);e._vs=sr(i);let h=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=h:e.recoveryParam!==h&&Sn.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;let c=sr(i);e.s==null?e.s=c:e.s!==c&&Sn.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?Sn.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{let i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&Sn.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Dn(e.r)?Sn.throwArgumentError("signature missing or invalid r","signature",t):e.r=Ea(e.r,32),e.s==null||!Dn(e.s)?Sn.throwArgumentError("signature missing or invalid s","signature",t):e.s=Ea(e.s,32);let r=Ct(e.s);r[0]>=128&&Sn.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);let a=sr(r);e._vs&&(Dn(e._vs)||Sn.throwArgumentError("signature invalid _vs","signature",t),e._vs=Ea(e._vs,32)),e._vs==null?e._vs=a:e._vs!==a&&Sn.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function pA(t){return t=Wc(t),sr(Ao([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}function rn(t){return"0x"+xV.default.keccak_256(Ct(t))}ie();ae();ne();ie();ae();ne();ie();ae();ne();var kV=gi(EV());ie();ae();ne();var AV="bignumber/5.7.0";var E3=kV.default.BN,Mh=new er(AV),mA={},RV=9007199254740991;var TV=!1,nn=class t{constructor(e,r){e!==mA&&Mh.throwError("cannot call constructor directly; use BigNumber.from",er.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return to(Xr(this).fromTwos(e))}toTwos(e){return to(Xr(this).toTwos(e))}abs(){return this._hex[0]==="-"?t.from(this._hex.substring(1)):this}add(e){return to(Xr(this).add(Xr(e)))}sub(e){return to(Xr(this).sub(Xr(e)))}div(e){return t.from(e).isZero()&&bs("division-by-zero","div"),to(Xr(this).div(Xr(e)))}mul(e){return to(Xr(this).mul(Xr(e)))}mod(e){let r=Xr(e);return r.isNeg()&&bs("division-by-zero","mod"),to(Xr(this).umod(r))}pow(e){let r=Xr(e);return r.isNeg()&&bs("negative-power","pow"),to(Xr(this).pow(r))}and(e){let r=Xr(e);return(this.isNegative()||r.isNeg())&&bs("unbound-bitwise-result","and"),to(Xr(this).and(r))}or(e){let r=Xr(e);return(this.isNegative()||r.isNeg())&&bs("unbound-bitwise-result","or"),to(Xr(this).or(r))}xor(e){let r=Xr(e);return(this.isNegative()||r.isNeg())&&bs("unbound-bitwise-result","xor"),to(Xr(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&bs("negative-width","mask"),to(Xr(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&bs("negative-width","shl"),to(Xr(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&bs("negative-width","shr"),to(Xr(this).shrn(e))}eq(e){return Xr(this).eq(Xr(e))}lt(e){return Xr(this).lt(Xr(e))}lte(e){return Xr(this).lte(Xr(e))}gt(e){return Xr(this).gt(Xr(e))}gte(e){return Xr(this).gte(Xr(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Xr(this).isZero()}toNumber(){try{return Xr(this).toNumber()}catch{bs("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Mh.throwError("this platform does not support BigInt",er.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?TV||(TV=!0,Mh.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Mh.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",er.errors.UNEXPECTED_ARGUMENT,{}):Mh.throwError("BigNumber.toString does not accept parameters",er.errors.UNEXPECTED_ARGUMENT,{})),Xr(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof t)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new t(mA,zm(e)):e.match(/^-?[0-9]+$/)?new t(mA,zm(new E3(e))):Mh.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&bs("underflow","BigNumber.from",e),(e>=RV||e<=-RV)&&bs("overflow","BigNumber.from",e),t.from(String(e));let r=e;if(typeof r=="bigint")return t.from(r.toString());if(Fm(r))return t.from(sr(r));if(r)if(r.toHexString){let a=r.toHexString();if(typeof a=="string")return t.from(a)}else{let a=r._hex;if(a==null&&r.type==="BigNumber"&&(a=r.hex),typeof a=="string"&&(Dn(a)||a[0]==="-"&&Dn(a.substring(1))))return t.from(a)}return Mh.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}};function zm(t){if(typeof t!="string")return zm(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Mh.throwArgumentError("invalid hex","value",t),t=zm(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function to(t){return nn.from(zm(t))}function Xr(t){let e=nn.from(t).toHexString();return e[0]==="-"?new E3("-"+e.substring(3),16):new E3(e.substring(2),16)}function bs(t,e,r){let a={fault:t,operation:e};return r!=null&&(a.value=r),Mh.throwError(t,er.errors.NUMERIC_FAULT,a)}function gA(t){return new E3(t,36).toString(16)}ie();ae();ne();ie();ae();ne();var IV="strings/5.7.0";var BV=new er(IV),mu;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(mu||(mu={}));var R0;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(R0||(R0={}));function abe(t,e,r,a,i){return BV.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function OV(t,e,r,a,i){if(t===R0.BAD_PREFIX||t===R0.UNEXPECTED_CONTINUE){let h=0;for(let c=e+1;c<r.length&&r[c]>>6===2;c++)h++;return h}return t===R0.OVERRUN?r.length-e-1:0}function obe(t,e,r,a,i){return t===R0.OVERLONG?(a.push(i),0):(a.push(65533),OV(t,e,r,a,i))}var sbe=Object.freeze({error:abe,ignore:OV,replace:obe});function Ca(t,e=mu.current){e!=mu.current&&(BV.checkNormalize(),t=t.normalize(e));let r=[];for(let a=0;a<t.length;a++){let i=t.charCodeAt(a);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){a++;let h=t.charCodeAt(a);if(a>=t.length||(h&64512)!==56320)throw new Error("invalid utf-8 string");let c=65536+((i&1023)<<10)+(h&1023);r.push(c>>18|240),r.push(c>>12&63|128),r.push(c>>6&63|128),r.push(c&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return Ct(r)}function jp(t){return rn(Ca(t))}ie();ae();ne();var PV="hash/5.7.0";ie();ae();ne();var NV=`Ethereum Signed Message:
127
+ ${JSON.stringify(Me.from(r))},${JSON.stringify(Me.from(a))},${h} => ${JSON.stringify(p)}`;return _fe(c,b)}Fr.debug=_fe});var Uw=ht($o=>{"use strict";ie();ae();ne();var aUe=$o&&$o.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),oUe=$o&&$o.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),sUe=$o&&$o.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&aUe(e,t,r);return oUe(e,t),e},fUe=$o&&$o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($o,"__esModule",{value:!0});$o.Tag=void 0;var jn=sUe(ec()),uUe=fUe(gfe()),hUe=YB(),Dw=class{get(e,r){if(!Object.getOwnPropertyNames(this).includes(e))throw new Error(`Field "${e}" is not a property of the Arweave Transaction class.`);if(this[e]instanceof Uint8Array)return r&&r.decode&&r.string?jn.bufferToString(this[e]):r&&r.decode&&!r.string?this[e]:jn.bufferTob64Url(this[e]);if(this[e]instanceof Array){if(r?.decode!==void 0||r?.string!==void 0)throw e==="tags"&&console.warn(`Did you mean to use 'transaction["tags"]' ?`),new Error("Cannot decode or stringify an array.");return this[e]}return r&&r.decode==!0?r&&r.string?jn.b64UrlToString(this[e]):jn.b64UrlToBuffer(this[e]):this[e]}},_b=class extends Dw{name;value;constructor(e,r,a=!1){super(),this.name=e,this.value=r}};$o.Tag=_b;var JB=class extends Dw{format=2;id="";last_tx="";owner="";tags=[];target="";quantity="0";data_size="0";data=new Uint8Array;data_root="";reward="0";signature="";chunks;constructor(e={}){super(),Object.assign(this,e),typeof this.data=="string"&&(this.data=jn.b64UrlToBuffer(this.data)),e.tags&&(this.tags=e.tags.map(r=>new _b(r.name,r.value)))}addTag(e,r){this.tags.push(new _b(jn.stringToB64Url(e),jn.stringToB64Url(r)))}toJSON(){return{format:this.format,id:this.id,last_tx:this.last_tx,owner:this.owner,tags:this.tags,target:this.target,quantity:this.quantity,data:jn.bufferTob64Url(this.data),data_size:this.data_size,data_root:this.data_root,data_tree:this.data_tree,reward:this.reward,signature:this.signature}}setOwner(e){this.owner=e}setSignature({id:e,owner:r,reward:a,tags:i,signature:h}){this.id=e,this.owner=r,a&&(this.reward=a),i&&(this.tags=i),this.signature=h}async prepareChunks(e){!this.chunks&&e.byteLength>0&&(this.chunks=await(0,hUe.generateTransactionChunks)(e),this.data_root=jn.bufferTob64Url(this.chunks.data_root)),!this.chunks&&e.byteLength===0&&(this.chunks={chunks:[],data_root:new Uint8Array,proofs:[]},this.data_root="")}getChunk(e,r){if(!this.chunks)throw new Error("Chunks have not been prepared");let a=this.chunks.proofs[e],i=this.chunks.chunks[e];return{data_root:this.data_root,data_size:this.data_size,data_path:jn.bufferTob64Url(a.proof),offset:a.offset.toString(),chunk:jn.bufferTob64Url(r.slice(i.minByteRange,i.maxByteRange))}}async getSignatureData(){switch(this.format){case 1:let e=this.tags.reduce((a,i)=>jn.concatBuffers([a,i.get("name",{decode:!0,string:!1}),i.get("value",{decode:!0,string:!1})]),new Uint8Array);return jn.concatBuffers([this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),this.get("data",{decode:!0,string:!1}),jn.stringToBuffer(this.quantity),jn.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),e]);case 2:this.data_root||await this.prepareChunks(this.data);let r=this.tags.map(a=>[a.get("name",{decode:!0,string:!1}),a.get("value",{decode:!0,string:!1})]);return await(0,uUe.default)([jn.stringToBuffer(this.format.toString()),this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),jn.stringToBuffer(this.quantity),jn.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),r,jn.stringToBuffer(this.data_size),this.get("data_root",{decode:!0,string:!1})]);default:throw new Error(`Unexpected transaction format: ${this.format}`)}}};$o.default=JB});var Efe=ht(zs=>{"use strict";ie();ae();ne();var cUe=zs&&zs.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),lUe=zs&&zs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),dUe=zs&&zs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&cUe(e,t,r);return lUe(e,t),e},pUe=zs&&zs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zs,"__esModule",{value:!0});zs.TransactionUploader=void 0;var Mfe=pUe(Uw()),vUe=dUe(ec()),XB=mb(),mUe=YB(),xfe=1,gUe=["invalid_json","chunk_too_big","data_path_too_big","offset_too_big","data_size_too_big","chunk_proof_ratio_not_attractive","invalid_proof"],Sfe=1e3*40,QB=class t{api;chunkIndex=0;txPosted=!1;transaction;lastRequestTimeEnd=0;totalErrors=0;data;lastResponseStatus=0;lastResponseError="";get isComplete(){return this.txPosted&&this.chunkIndex===this.transaction.chunks.chunks.length}get totalChunks(){return this.transaction.chunks.chunks.length}get uploadedChunks(){return this.chunkIndex}get pctComplete(){return Math.trunc(this.uploadedChunks/this.totalChunks*100)}constructor(e,r){if(this.api=e,!r.id)throw new Error("Transaction is not signed");if(!r.chunks)throw new Error("Transaction chunks not prepared");this.data=r.data,this.transaction=new Mfe.default(Object.assign({},r,{data:new Uint8Array(0)}))}async uploadChunk(e){if(this.isComplete)throw new Error("Upload is already complete");if(this.lastResponseError!==""?this.totalErrors++:this.totalErrors=0,this.totalErrors===100)throw new Error(`Unable to complete upload: ${this.lastResponseStatus}: ${this.lastResponseError}`);let r=this.lastResponseError===""?0:Math.max(this.lastRequestTimeEnd+Sfe-Date.now(),Sfe);if(r>0&&(r=r-r*Math.random()*.3,await new Promise(c=>setTimeout(c,r))),this.lastResponseError="",!this.txPosted){await this.postTransaction();return}e&&(this.chunkIndex=e);let a=this.transaction.getChunk(e||this.chunkIndex,this.data);if(!await(0,mUe.validatePath)(this.transaction.chunks.data_root,parseInt(a.offset),0,parseInt(a.data_size),vUe.b64UrlToBuffer(a.data_path)))throw new Error(`Unable to validate chunk ${this.chunkIndex}`);let h=await this.api.post("chunk",this.transaction.getChunk(this.chunkIndex,this.data)).catch(c=>(console.error(c.message),{status:-1,data:{error:c.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=h.status,this.lastResponseStatus==200)this.chunkIndex++;else if(this.lastResponseError=(0,XB.getError)(h),gUe.includes(this.lastResponseError))throw new Error(`Fatal error uploading chunk ${this.chunkIndex}: ${this.lastResponseError}`)}static async fromSerialized(e,r,a){if(!r||typeof r.chunkIndex!="number"||typeof r.transaction!="object")throw new Error("Serialized object does not match expected format.");var i=new Mfe.default(r.transaction);i.chunks||await i.prepareChunks(a);let h=new t(e,i);if(h.chunkIndex=r.chunkIndex,h.lastRequestTimeEnd=r.lastRequestTimeEnd,h.lastResponseError=r.lastResponseError,h.lastResponseStatus=r.lastResponseStatus,h.txPosted=r.txPosted,h.data=a,h.transaction.data_root!==r.transaction.data_root)throw new Error("Data mismatch: Uploader doesn't match provided data.");return h}static async fromTransactionId(e,r){let a=await e.get(`tx/${r}`);if(a.status!==200)throw new Error(`Tx ${r} not found: ${a.status}`);let i=a.data;return i.data=new Uint8Array(0),{txPosted:!0,chunkIndex:0,lastResponseError:"",lastRequestTimeEnd:0,lastResponseStatus:0,transaction:i}}toJSON(){return{chunkIndex:this.chunkIndex,transaction:this.transaction,lastRequestTimeEnd:this.lastRequestTimeEnd,lastResponseStatus:this.lastResponseStatus,lastResponseError:this.lastResponseError,txPosted:this.txPosted}}async postTransaction(){if(this.totalChunks<=xfe){this.transaction.data=this.data;let a=await this.api.post("tx",this.transaction).catch(i=>(console.error(i),{status:-1,data:{error:i.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=a.status,this.transaction.data=new Uint8Array(0),a.status>=200&&a.status<300){this.txPosted=!0,this.chunkIndex=xfe;return}throw this.lastResponseError=(0,XB.getError)(a),new Error(`Unable to upload transaction: ${a.status}, ${this.lastResponseError}`)}let r=await this.api.post("tx",this.transaction);if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=r.status,!(r.status>=200&&r.status<300))throw this.lastResponseError=(0,XB.getError)(r),new Error(`Unable to upload transaction: ${r.status}, ${this.lastResponseError}`);this.txPosted=!0}};zs.TransactionUploader=QB});var qw=ht((j2t,Afe)=>{"use strict";ie();ae();ne();Afe.exports={}});var Tfe=ht(Zf=>{"use strict";ie();ae();ne();var bUe=Zf&&Zf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),yUe=Zf&&Zf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),wUe=Zf&&Zf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&bUe(e,t,r);return yUe(e,t),e},Rfe=Zf&&Zf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zf,"__esModule",{value:!0});var eO=Rfe(mb()),tc=Rfe(Uw()),Mb=wUe(ec()),tO=Efe();qw();var rO=class{api;crypto;chunks;constructor(e,r,a){this.api=e,this.crypto=r,this.chunks=a}async getTransactionAnchor(){let e=await this.api.get("tx_anchor");if(!e.data.match(/^[a-z0-9_-]{43,}/i)||!e.ok)throw new Error(`Could not getTransactionAnchor. Received: ${e.data}. Status: ${e.status}, ${e.statusText}`);return e.data}async getPrice(e,r){let a=r?`price/${e}/${r}`:`price/${e}`,i=await this.api.get(a);if(!/^\d+$/.test(i.data)||!i.ok)throw new Error(`Could not getPrice. Received: ${i.data}. Status: ${i.status}, ${i.statusText}`);return i.data}async get(e){let r=await this.api.get(`tx/${e}`);if(r.status==200){let a=parseInt(r.data.data_size);if(r.data.format>=2&&a>0&&a<=1024*1024*12){let i=await this.getData(e);return new tc.default({...r.data,data:i})}return new tc.default({...r.data,format:r.data.format||1})}throw r.status==404?new eO.default("TX_NOT_FOUND"):r.status==410?new eO.default("TX_FAILED"):new eO.default("TX_INVALID")}fromRaw(e){return new tc.default(e)}async search(e,r){return this.api.post("arql",{op:"equals",expr1:e,expr2:r}).then(a=>a.data?a.data:[])}getStatus(e){return this.api.get(`tx/${e}/status`).then(r=>r.status==200?{status:200,confirmed:r.data}:{status:r.status,confirmed:null})}async getData(e,r){let a;try{a=await this.chunks.downloadChunkedData(e)}catch(i){console.error(`Error while trying to download chunked data for ${e}`),console.error(i)}if(!a){console.warn(`Falling back to gateway cache for ${e}`);try{let{data:i,ok:h,status:c,statusText:p}=await this.api.get(`/${e}`,{responseType:"arraybuffer"});if(!h)throw new Error("Bad http status code",{cause:{status:c,statusText:p}});a=i}catch(i){console.error(`Error while trying to download contiguous data from gateway cache for ${e}`),console.error(i)}}if(!a)throw new Error(`${e} data was not found!`);return r&&r.decode&&!r.string?a:r&&r.decode&&r.string?Mb.bufferToString(a):Mb.bufferTob64Url(a)}async sign(e,r,a){let h=typeof r=="object"&&(p=>{let b=!0;return["n","e","d","p","q","dp","dq","qi"].map(g=>!(g in p)&&(b=!1)),b})(r),c=typeof arweaveWallet=="object";if(!h&&!c)throw new Error("No valid JWK or external wallet found to sign transaction.");if(h){e.setOwner(r.n);let p=await e.getSignatureData(),b=await this.crypto.sign(r,p,a),g=await this.crypto.hash(b);e.setSignature({id:Mb.bufferTob64Url(g),owner:r.n,signature:Mb.bufferTob64Url(b)})}else if(c){try{(await arweaveWallet.getPermissions()).includes("SIGN_TRANSACTION")||await arweaveWallet.connect(["SIGN_TRANSACTION"])}catch{}let p=await arweaveWallet.sign(e,a);e.setSignature({id:p.id,owner:p.owner,reward:p.reward,tags:p.tags,signature:p.signature})}else throw new Error("An error occurred while signing. Check wallet is valid")}async verify(e){let r=await e.getSignatureData(),a=e.get("signature",{decode:!0,string:!1}),i=Mb.bufferTob64Url(await this.crypto.hash(a));if(e.id!==i)throw new Error("Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.");return this.crypto.verify(e.owner,r,a)}async post(e){if(typeof e=="string"?e=new tc.default(JSON.parse(e)):typeof e.readInt32BE=="function"?e=new tc.default(JSON.parse(e.toString())):typeof e=="object"&&!(e instanceof tc.default)&&(e=new tc.default(e)),!(e instanceof tc.default))throw new Error("Must be Transaction object");e.chunks||await e.prepareChunks(e.data);let r=await this.getUploader(e,e.data);try{for(;!r.isComplete;)await r.uploadChunk()}catch(a){if(r.lastResponseStatus>0)return{status:r.lastResponseStatus,statusText:r.lastResponseError,data:{error:r.lastResponseError}};throw a}return{status:200,statusText:"OK",data:{}}}async getUploader(e,r){let a;if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),e instanceof tc.default){if(r||(r=e.data),!(r instanceof Uint8Array))throw new Error("Data format is invalid");e.chunks||await e.prepareChunks(r),a=new tO.TransactionUploader(this.api,e),(!a.data||a.data.length===0)&&(a.data=r)}else{if(typeof e=="string"&&(e=await tO.TransactionUploader.fromTransactionId(this.api,e)),!r||!(r instanceof Uint8Array))throw new Error("Must provide data when resuming upload");a=await tO.TransactionUploader.fromSerialized(this.api,e,r)}return a}async*upload(e,r){let a=await this.getUploader(e,r);for(;!a.isComplete;)await a.uploadChunk(),yield a;return a}};Zf.default=rO});var Ife=ht(rc=>{"use strict";ie();ae();ne();var _Ue=rc&&rc.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),MUe=rc&&rc.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),xUe=rc&&rc.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&_Ue(e,t,r);return MUe(e,t),e};Object.defineProperty(rc,"__esModule",{value:!0});var kfe=xUe(ec());qw();var iO=class{api;crypto;constructor(e,r){this.api=e,this.crypto=r}getBalance(e){return this.api.get(`wallet/${e}/balance`).then(r=>r.data)}getLastTransactionID(e){return this.api.get(`wallet/${e}/last_tx`).then(r=>r.data)}generate(){return this.crypto.generateJWK()}async jwkToAddress(e){return!e||e==="use_wallet"?this.getAddress():this.getAddress(e)}async getAddress(e){if(!e||e==="use_wallet"){try{await arweaveWallet.connect(["ACCESS_ADDRESS"])}catch{}return arweaveWallet.getActiveAddress()}else return this.ownerToAddress(e.n)}async ownerToAddress(e){return kfe.bufferTob64Url(await this.crypto.hash(kfe.b64UrlToBuffer(e)))}};rc.default=iO});var Ofe=ht(Hf=>{"use strict";ie();ae();ne();var SUe=Hf&&Hf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),EUe=Hf&&Hf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),AUe=Hf&&Hf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&SUe(e,t,r);return EUe(e,t),e};Object.defineProperty(Hf,"__esModule",{value:!0});Hf.SiloResource=void 0;var Bfe=AUe(ec()),nO=class{api;crypto;transactions;constructor(e,r,a){this.api=e,this.crypto=r,this.transactions=a}async get(e){if(!e)throw new Error("No Silo URI specified");let r=await this.parseUri(e),a=await this.transactions.search("Silo-Name",r.getAccessKey());if(a.length==0)throw new Error(`No data could be found for the Silo URI: ${e}`);let i=await this.transactions.get(a[0]);if(!i)throw new Error(`No data could be found for the Silo URI: ${e}`);let h=i.get("data",{decode:!0,string:!1});return this.crypto.decrypt(h,r.getEncryptionKey())}async readTransactionData(e,r){if(!r)throw new Error("No Silo URI specified");let a=await this.parseUri(r),i=e.get("data",{decode:!0,string:!1});return this.crypto.decrypt(i,a.getEncryptionKey())}async parseUri(e){let r=e.match(/^([a-z0-9-_]+)\.([0-9]+)/i);if(!r)throw new Error("Invalid Silo name, must be a name in the format of [a-z0-9]+.[0-9]+, e.g. 'bubble.7'");let a=r[1],i=Math.pow(2,parseInt(r[2])),h=await this.hash(Bfe.stringToBuffer(a),i),c=Bfe.bufferTob64(h.slice(0,15)),p=await this.hash(h.slice(16,31),1);return new Fw(e,c,p)}async hash(e,r){let a=await this.crypto.hash(e);for(let i=0;i<r-1;i++)a=await this.crypto.hash(a);return a}};Hf.default=nO;var Fw=class{uri;accessKey;encryptionKey;constructor(e,r,a){this.uri=e,this.accessKey=r,this.encryptionKey=a}getUri(){return this.uri}getAccessKey(){return this.accessKey}getEncryptionKey(){return this.encryptionKey}};Hf.SiloResource=Fw});var Nfe=ht(ic=>{"use strict";ie();ae();ne();var RUe=ic&&ic.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),TUe=ic&&ic.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),kUe=ic&&ic.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&RUe(e,t,r);return TUe(e,t),e};Object.defineProperty(ic,"__esModule",{value:!0});var Pfe=mb(),IUe=kUe(ec()),aO=class{api;constructor(e){this.api=e}async getTransactionOffset(e){let r=await this.api.get(`tx/${e}/offset`);if(r.status===200)return r.data;throw new Error(`Unable to get transaction offset: ${(0,Pfe.getError)(r)}`)}async getChunk(e){let r=await this.api.get(`chunk/${e}`);if(r.status===200)return r.data;throw new Error(`Unable to get chunk: ${(0,Pfe.getError)(r)}`)}async getChunkData(e){let r=await this.getChunk(e);return IUe.b64UrlToBuffer(r.chunk)}firstChunkOffset(e){return parseInt(e.offset)-parseInt(e.size)+1}async downloadChunkedData(e){let r=await this.getTransactionOffset(e),a=parseInt(r.size),h=parseInt(r.offset)-a+1,c=new Uint8Array(a),p=0;for(;p<a;){this.api.config.logging&&console.log(`[chunk] ${p}/${a}`);let b;try{b=await this.getChunkData(h+p)}catch{console.error(`[chunk] Failed to fetch chunk at offset ${h+p}`),console.error("[chunk] This could indicate that the chunk wasn't uploaded or hasn't yet seeded properly to a particular gateway/node")}if(b)c.set(b,p),p+=b.length;else throw new Error(`Couldn't complete data download at ${p}/${a}`)}return c}};ic.default=aO});var Lfe=ht(xb=>{"use strict";ie();ae();ne();var BUe=xb&&xb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xb,"__esModule",{value:!0});var Cfe=BUe(mb());qw();var oO=class t{api;network;static HASH_ENDPOINT="block/hash/";static HEIGHT_ENDPOINT="block/height/";constructor(e,r){this.api=e,this.network=r}async get(e){let r=await this.api.get(`${t.HASH_ENDPOINT}${e}`);if(r.status===200)return r.data;throw r.status===404?new Cfe.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${r}`)}async getByHeight(e){let r=await this.api.get(`${t.HEIGHT_ENDPOINT}${e}`);if(r.status===200)return r.data;throw r.status===404?new Cfe.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${r}`)}async getCurrent(){let{current:e}=await this.network.getInfo();return await this.get(e)}};xb.default=oO});var Cw=ht(Kf=>{"use strict";ie();ae();ne();var OUe=Kf&&Kf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),PUe=Kf&&Kf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),NUe=Kf&&Kf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&OUe(e,t,r);return PUe(e,t),e},Wu=Kf&&Kf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Kf,"__esModule",{value:!0});var CUe=Wu(Vse()),LUe=Wu(Gse()),$Ue=Wu(afe()),DUe=Wu(ofe()),UUe=Wu(Tfe()),qUe=Wu(Ife()),$fe=Wu(Uw()),Sb=NUe(ec()),FUe=Wu(Ofe()),jUe=Wu(Nfe()),zUe=Wu(Lfe()),sO=class t{api;wallets;transactions;network;blocks;ar;silo;chunks;static init;static crypto=new $Ue.default;static utils=Sb;constructor(e){this.api=new LUe.default(e),this.wallets=new qUe.default(this.api,t.crypto),this.chunks=new jUe.default(this.api),this.transactions=new UUe.default(this.api,t.crypto,this.chunks),this.silo=new FUe.default(this.api,this.crypto,this.transactions),this.network=new DUe.default(this.api),this.blocks=new zUe.default(this.api,this.network),this.ar=new CUe.default}get crypto(){return t.crypto}get utils(){return t.utils}getConfig(){return{api:this.api.getConfig(),crypto:null}}async createTransaction(e,r){let a={};if(Object.assign(a,e),!e.data&&!(e.target&&e.quantity))throw new Error("A new Arweave transaction must have a 'data' value, or 'target' and 'quantity' values.");if(e.owner==null&&r&&r!=="use_wallet"&&(a.owner=r.n),e.last_tx==null&&(a.last_tx=await this.transactions.getTransactionAnchor()),typeof e.data=="string"&&(e.data=Sb.stringToBuffer(e.data)),e.data instanceof ArrayBuffer&&(e.data=new Uint8Array(e.data)),e.data&&!(e.data instanceof Uint8Array))throw new Error("Expected data to be a string, Uint8Array or ArrayBuffer");if(e.reward==null){let h=e.data?e.data.byteLength:0;a.reward=await this.transactions.getPrice(h,a.target)}a.data_root="",a.data_size=e.data?e.data.byteLength.toString():"0",a.data=e.data||new Uint8Array(0);let i=new $fe.default(a);return await i.getSignatureData(),i}async createSiloTransaction(e,r,a){let i={};if(Object.assign(i,e),!e.data)throw new Error("Silo transactions must have a 'data' value");if(!a)throw new Error("No Silo URI specified.");if(e.target||e.quantity)throw new Error("Silo transactions can only be used for storing data, sending AR to other wallets isn't supported.");if(e.owner==null){if(!r||!r.n)throw new Error("A new Arweave transaction must either have an 'owner' attribute, or you must provide the jwk parameter.");i.owner=r.n}e.last_tx==null&&(i.last_tx=await this.transactions.getTransactionAnchor());let h=await this.silo.parseUri(a);if(typeof e.data=="string"){let p=await this.crypto.encrypt(Sb.stringToBuffer(e.data),h.getEncryptionKey());i.reward=await this.transactions.getPrice(p.byteLength),i.data=Sb.bufferTob64Url(p)}if(e.data instanceof Uint8Array){let p=await this.crypto.encrypt(e.data,h.getEncryptionKey());i.reward=await this.transactions.getPrice(p.byteLength),i.data=Sb.bufferTob64Url(p)}let c=new $fe.default(i);return c.addTag("Silo-Name",h.getAccessKey()),c.addTag("Silo-Version","0.1.0"),c}arql(e){return this.api.post("/arql",e).then(r=>r.data||[])}};Kf.default=sO});var Ufe=ht((uO,Dfe)=>{"use strict";ie();ae();ne();var ZUe=uO&&uO.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},fO=ZUe(Cw());fO.default.init=function(t={}){return new fO.default(t)};Dfe.exports=fO.default});var Wfe=ht((M6t,pO)=>{"use strict";ie();ae();ne();var GUe=Object.prototype.hasOwnProperty,Za="~";function Rb(){}Object.create&&(Rb.prototype=Object.create(null),new Rb().__proto__||(Za=!1));function YUe(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function Kfe(t,e,r,a,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var h=new YUe(r,a||t,i),c=Za?Za+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],h]:t._events[c].push(h):(t._events[c]=h,t._eventsCount++),t}function Kw(t,e){--t._eventsCount===0?t._events=new Rb:delete t._events[e]}function Pa(){this._events=new Rb,this._eventsCount=0}Pa.prototype.eventNames=function(){var e=[],r,a;if(this._eventsCount===0)return e;for(a in r=this._events)GUe.call(r,a)&&e.push(Za?a.slice(1):a);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};Pa.prototype.listeners=function(e){var r=Za?Za+e:e,a=this._events[r];if(!a)return[];if(a.fn)return[a.fn];for(var i=0,h=a.length,c=new Array(h);i<h;i++)c[i]=a[i].fn;return c};Pa.prototype.listenerCount=function(e){var r=Za?Za+e:e,a=this._events[r];return a?a.fn?1:a.length:0};Pa.prototype.emit=function(e,r,a,i,h,c){var p=Za?Za+e:e;if(!this._events[p])return!1;var b=this._events[p],g=arguments.length,y,M;if(b.fn){switch(b.once&&this.removeListener(e,b.fn,void 0,!0),g){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,r),!0;case 3:return b.fn.call(b.context,r,a),!0;case 4:return b.fn.call(b.context,r,a,i),!0;case 5:return b.fn.call(b.context,r,a,i,h),!0;case 6:return b.fn.call(b.context,r,a,i,h,c),!0}for(M=1,y=new Array(g-1);M<g;M++)y[M-1]=arguments[M];b.fn.apply(b.context,y)}else{var x=b.length,E;for(M=0;M<x;M++)switch(b[M].once&&this.removeListener(e,b[M].fn,void 0,!0),g){case 1:b[M].fn.call(b[M].context);break;case 2:b[M].fn.call(b[M].context,r);break;case 3:b[M].fn.call(b[M].context,r,a);break;case 4:b[M].fn.call(b[M].context,r,a,i);break;default:if(!y)for(E=1,y=new Array(g-1);E<g;E++)y[E-1]=arguments[E];b[M].fn.apply(b[M].context,y)}}return!0};Pa.prototype.on=function(e,r,a){return Kfe(this,e,r,a,!1)};Pa.prototype.once=function(e,r,a){return Kfe(this,e,r,a,!0)};Pa.prototype.removeListener=function(e,r,a,i){var h=Za?Za+e:e;if(!this._events[h])return this;if(!r)return Kw(this,h),this;var c=this._events[h];if(c.fn)c.fn===r&&(!i||c.once)&&(!a||c.context===a)&&Kw(this,h);else{for(var p=0,b=[],g=c.length;p<g;p++)(c[p].fn!==r||i&&!c[p].once||a&&c[p].context!==a)&&b.push(c[p]);b.length?this._events[h]=b.length===1?b[0]:b:Kw(this,h)}return this};Pa.prototype.removeAllListeners=function(e){var r;return e?(r=Za?Za+e:e,this._events[r]&&Kw(this,r)):(this._events=new Rb,this._eventsCount=0),this};Pa.prototype.off=Pa.prototype.removeListener;Pa.prototype.addListener=Pa.prototype.on;Pa.prefixed=Za;Pa.EventEmitter=Pa;typeof pO<"u"&&(pO.exports=Pa)});ie();ae();ne();ie();ae();ne();var sT={};Ha(sT,{AVSCTap:()=>Sg,AlgorandSigner:()=>vg,AptosSigner:()=>gg,ArconnectSigner:()=>p1,Arweave:()=>_W.default,ArweaveSigner:()=>Hc,Bundle:()=>I8,BundleItem:()=>oT,CryptoDriver:()=>v3,Curve25519:()=>xo,DataItem:()=>R8,EthereumSigner:()=>Io,HexInjectedSolanaSigner:()=>J0,HexSolanaSigner:()=>mg,InjectedAptosSigner:()=>X0,InjectedEthereumSigner:()=>oR,InjectedSolanaSigner:()=>A0,InjectedTypedEthereumSigner:()=>rT,KyveSigner:()=>wg,MAX_TAG_BYTES:()=>A8,MIN_BINARY_SIZE:()=>T8,MultiSignatureAptosSigner:()=>Q0,NearSigner:()=>pg,PolygonSigner:()=>dg,Rsa4096:()=>S0,SIG_CONFIG:()=>Wr,SignatureConfig:()=>wr,Signer:()=>Xw,SolanaSigner:()=>kh,Transaction:()=>wW.default,TypedEthereumSigner:()=>ed,bundleAndSignData:()=>K4e,byteArrayToLong:()=>yn,concatBuffers:()=>Oi.concatBuffers,createData:()=>Ag,deepHash:()=>qc,deserializeTags:()=>v1,exportForTesting:()=>j4e,getCryptoDriver:()=>Sn,getSignatureAndId:()=>DX,indexToType:()=>_g,keccak256:()=>QR,longTo16ByteArray:()=>Z4e,longTo32ByteArray:()=>E8,longTo8ByteArray:()=>S8,longToNByteArray:()=>xg,secp256k1:()=>Y0,serializeTags:()=>nT,shortTo2ByteArray:()=>iT,sign:()=>k8,stringToBuffer:()=>Oi.stringToBuffer,unbundleData:()=>H4e});ie();ae();ne();ie();ae();ne();ie();ae();ne();var Xw=class{publicKey;signatureType;signatureLength;ownerLength;pem;static verify(e,r,a,i){throw new Error("You must implement verify method on child")}};ie();ae();ne();ie();ae();ne();var NK=gi(Do(),1);ie();ae();ne();var wr;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM",t[t.KYVE=101]="KYVE"})(wr||(wr={}));var Wr={[wr.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[wr.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[wr.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[wr.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[wr.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[wr.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[wr.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"},[wr.KYVE]:{sigLength:65,pubLength:65,sigName:"kyve"}};ie();ae();ne();lu();var Jn=BigInt(0),oi=BigInt(1),$c=BigInt(2),_ge=BigInt(8),AK=BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),Vi=Object.freeze({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l:AK,n:AK,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")});var BK=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),xm=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),ije=BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742"),Mge=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),xge=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Sge=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Ege=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),Ln=class t{constructor(e,r,a,i){this.x=e,this.y=r,this.z=a,this.t=i}static fromAffine(e){if(!(e instanceof xn))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return e.equals(xn.ZERO)?t.ZERO:new t(e.x,e.y,oi,Et(e.x*e.y))}static toAffineBatch(e){let r=Tge(e.map(a=>a.z));return e.map((a,i)=>a.toAffine(r[i]))}static normalizeZ(e){return this.toAffineBatch(e).map(this.fromAffine)}equals(e){TK(e);let{x:r,y:a,z:i}=this,{x:h,y:c,z:p}=e,b=Et(r*p),g=Et(h*i),y=Et(a*p),M=Et(c*i);return b===g&&y===M}negate(){return new t(Et(-this.x),this.y,this.z,Et(-this.t))}double(){let{x:e,y:r,z:a}=this,{a:i}=Vi,h=Et(e*e),c=Et(r*r),p=Et($c*Et(a*a)),b=Et(i*h),g=e+r,y=Et(Et(g*g)-h-c),M=b+c,x=M-p,E=b-c,A=Et(y*x),k=Et(M*E),O=Et(y*E),N=Et(x*M);return new t(A,k,N,O)}add(e){TK(e);let{x:r,y:a,z:i,t:h}=this,{x:c,y:p,z:b,t:g}=e,y=Et((a-r)*(p+c)),M=Et((a+r)*(p-c)),x=Et(M-y);if(x===Jn)return this.double();let E=Et(i*$c*g),A=Et(h*$c*b),k=A+E,O=M+y,N=A-E,L=Et(k*x),C=Et(O*N),Y=Et(k*N),G=Et(x*O);return new t(L,C,G,Y)}subtract(e){return this.add(e.negate())}precomputeWindow(e){let r=1+256/e,a=[],i=this,h=i;for(let c=0;c<r;c++){h=i,a.push(h);for(let p=1;p<2**(e-1);p++)h=h.add(i),a.push(h);i=h.double()}return a}wNAF(e,r){!r&&this.equals(t.BASE)&&(r=xn.BASE);let a=r&&r._WINDOW_SIZE||1;if(256%a)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let i=r&&uE.get(r);i||(i=this.precomputeWindow(a),r&&a!==1&&(i=t.normalizeZ(i),uE.set(r,i)));let h=t.ZERO,c=t.BASE,p=1+256/a,b=2**(a-1),g=BigInt(2**a-1),y=2**a,M=BigInt(a);for(let x=0;x<p;x++){let E=x*b,A=Number(e&g);e>>=M,A>b&&(A-=y,e+=oi);let k=E,O=E+Math.abs(A)-1,N=x%2!==0,L=A<0;A===0?c=c.add(RK(N,i[k])):h=h.add(RK(L,i[O]))}return t.normalizeZ([h,c])[0]}multiply(e,r){return this.wNAF(i3(e,Vi.l),r)}multiplyUnsafe(e){let r=i3(e,Vi.l,!1),a=t.BASE,i=t.ZERO;if(r===Jn)return i;if(this.equals(i)||r===oi)return this;if(this.equals(a))return this.wNAF(r);let h=i,c=this;for(;r>Jn;)r&oi&&(h=h.add(c)),c=c.double(),r>>=oi;return h}isSmallOrder(){return this.multiplyUnsafe(Vi.h).equals(t.ZERO)}isTorsionFree(){let e=this.multiplyUnsafe(Vi.l/$c).double();return Vi.l%$c&&(e=e.add(this)),e.equals(t.ZERO)}toAffine(e){let{x:r,y:a,z:i}=this,h=this.equals(t.ZERO);e==null&&(e=h?_ge:n3(i));let c=Et(r*e),p=Et(a*e),b=Et(i*e);if(h)return xn.ZERO;if(b!==oi)throw new Error("invZ was invalid");return new xn(c,p)}fromRistrettoBytes(){oE()}toRistrettoBytes(){oE()}fromRistrettoHash(){oE()}};Ln.BASE=new Ln(Vi.Gx,Vi.Gy,oi,Et(Vi.Gx*Vi.Gy));Ln.ZERO=new Ln(Jn,oi,oi,Jn);function RK(t,e){let r=e.negate();return t?r:e}function TK(t){if(!(t instanceof Ln))throw new TypeError("ExtendedPoint expected")}function aE(t){if(!(t instanceof M0))throw new TypeError("RistrettoPoint expected")}function oE(){throw new Error("Legacy method: switch to RistrettoPoint")}var M0=class t{constructor(e){this.ep=e}static calcElligatorRistrettoMap(e){let{d:r}=Vi,a=Et(xm*e*e),i=Et((a+oi)*Sge),h=BigInt(-1),c=Et((h-r*a)*Et(a+r)),{isValid:p,value:b}=cE(i,c),g=Et(b*e);Lc(g)||(g=Et(-g)),p||(b=g),p||(h=a);let y=Et(h*(a-oi)*Ege-c),M=b*b,x=Et((b+b)*c),E=Et(y*Mge),A=Et(oi-M),k=Et(oi+M);return new Ln(Et(x*k),Et(A*E),Et(E*k),Et(x*A))}static hashToCurve(e){e=Dc(e,64);let r=sE(e.slice(0,32)),a=this.calcElligatorRistrettoMap(r),i=sE(e.slice(32,64)),h=this.calcElligatorRistrettoMap(i);return new t(a.add(h))}static fromHex(e){e=Dc(e,32);let{a:r,d:a}=Vi,i="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",h=sE(e);if(!Ige(Em(h),e)||Lc(h))throw new Error(i);let c=Et(h*h),p=Et(oi+r*c),b=Et(oi-r*c),g=Et(p*p),y=Et(b*b),M=Et(r*a*g-y),{isValid:x,value:E}=IK(Et(M*y)),A=Et(E*b),k=Et(E*A*M),O=Et((h+h)*A);Lc(O)&&(O=Et(-O));let N=Et(p*k),L=Et(O*N);if(!x||Lc(L)||N===Jn)throw new Error(i);return new t(new Ln(O,N,oi,L))}toRawBytes(){let{x:e,y:r,z:a,t:i}=this.ep,h=Et(Et(a+r)*Et(a-r)),c=Et(e*r),p=Et(c*c),{value:b}=IK(Et(h*p)),g=Et(b*h),y=Et(b*c),M=Et(g*y*i),x;if(Lc(i*M)){let A=Et(r*xm),k=Et(e*xm);e=A,r=k,x=Et(g*xge)}else x=y;Lc(e*M)&&(r=Et(-r));let E=Et((a-r)*x);return Lc(E)&&(E=Et(-E)),Em(E)}toHex(){return Am(this.toRawBytes())}toString(){return this.toHex()}equals(e){aE(e);let r=this.ep,a=e.ep,i=Et(r.x*a.y)===Et(r.y*a.x),h=Et(r.y*a.y)===Et(r.x*a.x);return i||h}add(e){return aE(e),new t(this.ep.add(e.ep))}subtract(e){return aE(e),new t(this.ep.subtract(e.ep))}multiply(e){return new t(this.ep.multiply(e))}multiplyUnsafe(e){return new t(this.ep.multiplyUnsafe(e))}};M0.BASE=new M0(Ln.BASE);M0.ZERO=new M0(Ln.ZERO);var uE=new WeakMap,xn=class t{constructor(e,r){this.x=e,this.y=r}_setWindowSize(e){this._WINDOW_SIZE=e,uE.delete(this)}static fromHex(e,r=!0){let{d:a,P:i}=Vi;e=Dc(e,32);let h=e.slice();h[31]=e[31]&-129;let c=Rm(h);if(r&&c>=i)throw new Error("Expected 0 < hex < P");if(!r&&c>=BK)throw new Error("Expected 0 < hex < 2**256");let p=Et(c*c),b=Et(p-oi),g=Et(a*p+oi),{isValid:y,value:M}=cE(b,g);if(!y)throw new Error("Point.fromHex: invalid y coordinate");let x=(M&oi)===oi;return(e[31]&128)!==0!==x&&(M=Et(-M)),new t(M,c)}static async fromPrivateKey(e){return(await lE(e)).point}toRawBytes(){let e=Em(this.y);return e[31]|=this.x&oi?128:0,e}toHex(){return Am(this.toRawBytes())}toX25519(){let{y:e}=this,r=Et((oi+e)*n3(oi-e));return Em(r)}isTorsionFree(){return Ln.fromAffine(this).isTorsionFree()}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new t(Et(-this.x),this.y)}add(e){return Ln.fromAffine(this).add(Ln.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return Ln.fromAffine(this).multiply(e,this).toAffine()}};xn.BASE=new xn(Vi.Gx,Vi.Gy);xn.ZERO=new xn(Jn,oi);var Sm=class t{constructor(e,r){this.r=e,this.s=r,this.assertValidity()}static fromHex(e){let r=Dc(e,64),a=xn.fromHex(r.slice(0,32),!1),i=Rm(r.slice(32,64));return new t(a,i)}assertValidity(){let{r:e,s:r}=this;if(!(e instanceof xn))throw new Error("Expected Point instance");return i3(r,Vi.l,!1),this}toRawBytes(){let e=new Uint8Array(64);return e.set(this.r.toRawBytes()),e.set(Em(this.s),32),e}toHex(){return Am(this.toRawBytes())}};function kK(...t){if(!t.every(a=>a instanceof Uint8Array))throw new Error("Expected Uint8Array list");if(t.length===1)return t[0];let e=t.reduce((a,i)=>a+i.length,0),r=new Uint8Array(e);for(let a=0,i=0;a<t.length;a++){let h=t[a];r.set(h,i),i+=h.length}return r}var Age=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Am(t){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=Age[t[r]];return e}function hE(t){if(typeof t!="string")throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){let a=r*2,i=t.slice(a,a+2),h=Number.parseInt(i,16);if(Number.isNaN(h)||h<0)throw new Error("Invalid byte sequence");e[r]=h}return e}function OK(t){let r=t.toString(16).padStart(64,"0");return hE(r)}function Em(t){return OK(t).reverse()}function Lc(t){return(Et(t)&oi)===oi}function Rm(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");return BigInt("0x"+Am(Uint8Array.from(t).reverse()))}var Rge=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function sE(t){return Et(Rm(t)&Rge)}function Et(t,e=Vi.P){let r=t%e;return r>=Jn?r:e+r}function n3(t,e=Vi.P){if(t===Jn||e<=Jn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Et(t,e),a=e,i=Jn,h=oi,c=oi,p=Jn;for(;r!==Jn;){let g=a/r,y=a%r,M=i-c*g,x=h-p*g;a=r,r=y,i=c,h=p,c=M,p=x}if(a!==oi)throw new Error("invert: does not exist");return Et(i,e)}function Tge(t,e=Vi.P){let r=new Array(t.length),a=t.reduce((h,c,p)=>c===Jn?h:(r[p]=h,Et(h*c,e)),oi),i=n3(a,e);return t.reduceRight((h,c,p)=>c===Jn?h:(r[p]=Et(h*r[p],e),Et(h*c,e)),i),r}function du(t,e){let{P:r}=Vi,a=t;for(;e-- >Jn;)a*=a,a%=r;return a}function kge(t){let{P:e}=Vi,r=BigInt(5),a=BigInt(10),i=BigInt(20),h=BigInt(40),c=BigInt(80),b=t*t%e*t%e,g=du(b,$c)*b%e,y=du(g,oi)*t%e,M=du(y,r)*y%e,x=du(M,a)*M%e,E=du(x,i)*x%e,A=du(E,h)*E%e,k=du(A,c)*A%e,O=du(k,c)*A%e,N=du(O,a)*M%e;return{pow_p_5_8:du(N,$c)*t%e,b2:b}}function cE(t,e){let r=Et(e*e*e),a=Et(r*r*e),i=kge(t*a).pow_p_5_8,h=Et(t*r*i),c=Et(e*h*h),p=h,b=Et(h*xm),g=c===t,y=c===Et(-t),M=c===Et(-t*xm);return g&&(h=p),(y||M)&&(h=b),Lc(h)&&(h=Et(-h)),{isValid:g||y,value:h}}function IK(t){return cE(oi,t)}function r3(t){return Et(Rm(t),Vi.l)}function Ige(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function Dc(t,e){let r=t instanceof Uint8Array?Uint8Array.from(t):hE(t);if(typeof e=="number"&&r.length!==e)throw new Error(`Expected ${e} bytes`);return r}function i3(t,e,r=!0){if(!e)throw new TypeError("Specify max value");if(typeof t=="number"&&Number.isSafeInteger(t)&&(t=BigInt(t)),typeof t=="bigint"&&t<e){if(r){if(Jn<t)return t}else if(Jn<=t)return t}throw new TypeError("Expected valid scalar: 0 < scalar < max")}function Bge(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function Oge(t){if(t=typeof t=="bigint"||typeof t=="number"?OK(i3(t,BK)):Dc(t),t.length!==32)throw new Error("Expected 32 bytes");return t}function Pge(t){let e=Bge(t.slice(0,32)),r=t.slice(32,64),a=r3(e),i=xn.BASE.multiply(a),h=i.toRawBytes();return{head:e,prefix:r,scalar:a,point:i,pointBytes:h}}var fE;async function lE(t){return Pge(await Ip.sha512(Oge(t)))}async function PK(t,e){t=Dc(t);let{prefix:r,scalar:a,pointBytes:i}=await lE(e),h=r3(await Ip.sha512(r,t)),c=xn.BASE.multiply(h),p=r3(await Ip.sha512(c.toRawBytes(),i,t)),b=Et(h+p*a,Vi.l);return new Sm(c,b).toRawBytes()}function Nge(t,e,r){e=Dc(e),r instanceof xn||(r=xn.fromHex(r,!1));let{r:a,s:i}=t instanceof Sm?t.assertValidity():Sm.fromHex(t),h=Ln.BASE.multiplyUnsafe(i);return{r:a,s:i,SB:h,pub:r,msg:e}}function Cge(t,e,r,a){let i=r3(a),h=Ln.fromAffine(t).multiplyUnsafe(i);return Ln.fromAffine(e).add(h).subtract(r).multiplyUnsafe(Vi.h).equals(Ln.ZERO)}async function Uc(t,e,r){let{r:a,SB:i,msg:h,pub:c}=Nge(t,e,r),p=await Ip.sha512(a.toRawBytes(),c.toRawBytes(),h);return Cge(c,a,i,p)}xn.BASE._setWindowSize(8);var Cc={node:Mm,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0},Ip={bytesToHex:Am,hexToBytes:hE,concatBytes:kK,getExtendedPublicKey:lE,mod:Et,invert:n3,TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],hashToPrivateScalar:t=>{if(t=Dc(t),t.length<40||t.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return Et(Rm(t),Vi.l-oi)+oi},randomBytes:(t=32)=>{if(Cc.web)return Cc.web.getRandomValues(new Uint8Array(t));if(Cc.node){let{randomBytes:e}=Cc.node;return new Uint8Array(e(t).buffer)}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>Ip.randomBytes(32),sha512:async(...t)=>{let e=kK(...t);if(Cc.web){let r=await Cc.web.subtle.digest("SHA-512",e.buffer);return new Uint8Array(r)}else{if(Cc.node)return Uint8Array.from(Cc.node.createHash("sha512").update(e).digest());throw new Error("The environment doesn't have sha512 function")}},precompute(t=8,e=xn.BASE){let r=e.equals(xn.BASE)?e:new xn(e.x,e.y);return r._setWindowSize(t),r.multiply($c),r},sha512Sync:void 0};Object.defineProperties(Ip,{sha512Sync:{configurable:!1,get(){return fE},set(t){fE||(fE=t)}}});var xo=class{_key;pk;ownerLength=Wr[2].pubLength;signatureLength=Wr[2].sigLength;_publicKey;get publicKey(){return this._publicKey}signatureType=2;constructor(e,r){this._key=e,this.pk=r}get key(){throw new Error("You must implement `key`")}sign(e){return PK(Me.from(e),Me.from(this.key))}static async verify(e,r,a){let i=e;return typeof e=="string"&&(i=NK.default.toBuffer(e)),Uc(Me.from(a),Me.from(r),Me.from(i))}};ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var Oi=gi(pf(),1);ie();ae();ne();lu();async function qc(t){if(typeof t[Symbol.asyncIterator]=="function"){let i=t,h=df("sha384"),c=0;for await(let g of i)c+=g.byteLength,h.update(g);let p=(0,Oi.concatBuffers)([(0,Oi.stringToBuffer)("blob"),(0,Oi.stringToBuffer)(c.toString())]),b=(0,Oi.concatBuffers)([await Sn().hash(p,"SHA-384"),h.digest()]);return await Sn().hash(b,"SHA-384")}else if(Array.isArray(t)){let i=(0,Oi.concatBuffers)([(0,Oi.stringToBuffer)("list"),(0,Oi.stringToBuffer)(t.length.toString())]);return await HK(t,await Sn().hash(i,"SHA-384"))}let e=t,r=(0,Oi.concatBuffers)([(0,Oi.stringToBuffer)("blob"),(0,Oi.stringToBuffer)(e.byteLength.toString())]),a=(0,Oi.concatBuffers)([await Sn().hash(r,"SHA-384"),await Sn().hash(e,"SHA-384")]);return await Sn().hash(a,"SHA-384")}async function HK(t,e){if(t.length<1)return e;let r=(0,Oi.concatBuffers)([e,await qc(t[0])]),a=await Sn().hash(r,"SHA-384");return await HK(t.slice(1),a)}var p3=gi(gE(),1),wW=gi(Nm(),1),_W=gi(yW(),1),_2e=p3.default.default?p3.default.default:p3.default,v3=class extends _2e{getPublicKey(e){throw new Error("Unimplemented")}},M2e;function Sn(){return M2e??=new v3}var MW=gi(Do(),1);lu();var S0=class{_key;pk;signatureType=1;ownerLength=Wr[1].pubLength;signatureLength=Wr[1].sigLength;_publicKey;get publicKey(){return this._publicKey}constructor(e,r){this._key=e,this.pk=r,r||(this.pk=Sn().getPublicKey(JSON.parse(e)))}sign(e){return nE("sha256").update(e).sign({key:this._key,padding:iE.RSA_PKCS1_PSS_PADDING})}static async verify(e,r,a){return await Sn().verify(Me.isBuffer(e)?MW.default.encode(e):e,r,a)}};var hV=gi(uV(),1),cV=gi(Do(),1);var Hc=class extends S0{jwk;constructor(e){super((0,hV.jwkTopem)(e),e.n),this.jwk=e}get publicKey(){if(!this.pk)throw new Error("ArweaveSigner - pk is undefined");return cV.default.toBuffer(this.pk)}sign(e){return Sn().sign(this.jwk,e)}static async verify(e,r,a){return await Sn().verify(e,r,a)}};ie();ae();ne();var lV=gi(Do(),1);var A0=class{_publicKey;ownerLength=Wr[2].pubLength;signatureLength=Wr[2].sigLength;signatureType=2;pem;provider;constructor(e){if(this.provider=e,!this.provider.publicKey)throw new Error("InjectedSolanaSigner - provider.publicKey is undefined");this._publicKey=this.provider.publicKey.toBuffer()}get publicKey(){return this._publicKey}async sign(e){if(!this.provider.signMessage)throw new Error("Selected Wallet does not support message signing");return await this.provider.signMessage(e)}static async verify(e,r,a){let i=e;return typeof e=="string"&&(i=lV.default.toBuffer(e)),Uc(Me.from(a),Me.from(r),Me.from(i))}};ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var xV=gi(dV());ie();ae();ne();ie();ae();ne();ie();ae();ne();var pV="logger/5.7.0";var vV=!1,mV=!1,S3={debug:1,default:2,info:2,warning:3,error:4,off:5},gV=S3.default,cA=null;function rbe(){try{let t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("\xE9".normalize("NFD")!=="e\u0301")throw new Error("broken implementation")}catch(t){return t.message}return null}var bV=rbe(),lA;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(lA||(lA={}));var mf;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(mf||(mf={}));var yV="0123456789abcdef",er=class t{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){let a=e.toLowerCase();S3[a]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(gV>S3[a])&&console.log.apply(console,r)}debug(...e){this._log(t.levels.DEBUG,e)}info(...e){this._log(t.levels.INFO,e)}warn(...e){this._log(t.levels.WARNING,e)}makeError(e,r,a){if(mV)return this.makeError("censored error",r,{});r||(r=t.errors.UNKNOWN_ERROR),a||(a={});let i=[];Object.keys(a).forEach(b=>{let g=a[b];try{if(g instanceof Uint8Array){let y="";for(let M=0;M<g.length;M++)y+=yV[g[M]>>4],y+=yV[g[M]&15];i.push(b+"=Uint8Array(0x"+y+")")}else i.push(b+"="+JSON.stringify(g))}catch{i.push(b+"="+JSON.stringify(a[b].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);let h=e,c="";switch(r){case mf.NUMERIC_FAULT:{c="NUMERIC_FAULT";let b=e;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case mf.CALL_EXCEPTION:case mf.INSUFFICIENT_FUNDS:case mf.MISSING_NEW:case mf.NONCE_EXPIRED:case mf.REPLACEMENT_UNDERPRICED:case mf.TRANSACTION_REPLACED:case mf.UNPREDICTABLE_GAS_LIMIT:c=r;break}c&&(e+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),i.length&&(e+=" ("+i.join(", ")+")");let p=new Error(e);return p.reason=h,p.code=r,Object.keys(a).forEach(function(b){p[b]=a[b]}),p}throwError(e,r,a){throw this.makeError(e,r,a)}throwArgumentError(e,r,a){return this.throwError(e,t.errors.INVALID_ARGUMENT,{argument:r,value:a})}assert(e,r,a,i){e||this.throwError(r,a,i)}assertArgument(e,r,a,i){e||this.throwArgumentError(r,a,i)}checkNormalize(e){e==null&&(e="platform missing String.prototype.normalize"),bV&&this.throwError("platform missing String.prototype.normalize",t.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:bV})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,a){a?a=": "+a:a="",e<r&&this.throwError("missing argument"+a,t.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+a,t.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",t.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return cA||(cA=new t(pV)),cA}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),vV){if(!e)return;this.globalLogger().throwError("error censorship permanent",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}mV=!!e,vV=!!r}static setLogLevel(e){let r=S3[e.toLowerCase()];if(r==null){t.globalLogger().warn("invalid log level - "+e);return}gV=r}static from(e){return new t(e)}};er.errors=mf;er.levels=lA;ie();ae();ne();var wV="bytes/5.7.0";var En=new er(wV);function MV(t){return!!t.toHexString}function Fp(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return Fp(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function qm(t){return Dn(t)&&!(t.length%2)||Fm(t)}function _V(t){return typeof t=="number"&&t==t&&t%1===0}function Fm(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!_V(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(!_V(r)||r<0||r>=256)return!1}return!0}function Ct(t,e){if(e||(e={}),typeof t=="number"){En.checkSafeUint53(t,"invalid arrayify value");let r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),Fp(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),MV(t)&&(t=t.toHexString()),Dn(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":En.throwArgumentError("hex data is odd-length","value",t));let a=[];for(let i=0;i<r.length;i+=2)a.push(parseInt(r.substring(i,i+2),16));return Fp(new Uint8Array(a))}return Fm(t)?Fp(new Uint8Array(t)):En.throwArgumentError("invalid arrayify value","value",t)}function Ao(t){let e=t.map(i=>Ct(i)),r=e.reduce((i,h)=>i+h.length,0),a=new Uint8Array(r);return e.reduce((i,h)=>(a.set(h,i),i+h.length),0),Fp(a)}function vu(t){let e=Ct(t);if(e.length===0)return e;let r=0;for(;r<e.length&&e[r]===0;)r++;return r&&(e=e.slice(r)),e}function ibe(t,e){t=Ct(t),t.length>e&&En.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(e);return r.set(t,e-t.length),Fp(r)}function Dn(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}var dA="0123456789abcdef";function sr(t,e){if(e||(e={}),typeof t=="number"){En.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=dA[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),MV(t))return t.toHexString();if(Dn(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":En.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(Fm(t)){let r="0x";for(let a=0;a<t.length;a++){let i=t[a];r+=dA[(i&240)>>4]+dA[i&15]}return r}return En.throwArgumentError("invalid hexlify value","value",t)}function jm(t){if(typeof t!="string")t=sr(t);else if(!Dn(t)||t.length%2)return null;return(t.length-2)/2}function _h(t,e,r){return typeof t!="string"?t=sr(t):(!Dn(t)||t.length%2)&&En.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Kc(t){let e="0x";return t.forEach(r=>{e+=sr(r).substring(2)}),e}function Ea(t,e){for(typeof t!="string"?t=sr(t):Dn(t)||En.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&En.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Wc(t){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(qm(t)){let r=Ct(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=sr(r.slice(0,32)),e.s=sr(r.slice(32,64))):r.length===65?(e.r=sr(r.slice(0,32)),e.s=sr(r.slice(32,64)),e.v=r[64]):En.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:En.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=sr(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){let i=ibe(Ct(e._vs),32);e._vs=sr(i);let h=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=h:e.recoveryParam!==h&&En.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;let c=sr(i);e.s==null?e.s=c:e.s!==c&&En.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?En.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{let i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&En.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Dn(e.r)?En.throwArgumentError("signature missing or invalid r","signature",t):e.r=Ea(e.r,32),e.s==null||!Dn(e.s)?En.throwArgumentError("signature missing or invalid s","signature",t):e.s=Ea(e.s,32);let r=Ct(e.s);r[0]>=128&&En.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);let a=sr(r);e._vs&&(Dn(e._vs)||En.throwArgumentError("signature invalid _vs","signature",t),e._vs=Ea(e._vs,32)),e._vs==null?e._vs=a:e._vs!==a&&En.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function pA(t){return t=Wc(t),sr(Ao([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}function rn(t){return"0x"+xV.default.keccak_256(Ct(t))}ie();ae();ne();ie();ae();ne();ie();ae();ne();var kV=gi(EV());ie();ae();ne();var AV="bignumber/5.7.0";var E3=kV.default.BN,Mh=new er(AV),mA={},RV=9007199254740991;var TV=!1,nn=class t{constructor(e,r){e!==mA&&Mh.throwError("cannot call constructor directly; use BigNumber.from",er.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return to(Xr(this).fromTwos(e))}toTwos(e){return to(Xr(this).toTwos(e))}abs(){return this._hex[0]==="-"?t.from(this._hex.substring(1)):this}add(e){return to(Xr(this).add(Xr(e)))}sub(e){return to(Xr(this).sub(Xr(e)))}div(e){return t.from(e).isZero()&&bs("division-by-zero","div"),to(Xr(this).div(Xr(e)))}mul(e){return to(Xr(this).mul(Xr(e)))}mod(e){let r=Xr(e);return r.isNeg()&&bs("division-by-zero","mod"),to(Xr(this).umod(r))}pow(e){let r=Xr(e);return r.isNeg()&&bs("negative-power","pow"),to(Xr(this).pow(r))}and(e){let r=Xr(e);return(this.isNegative()||r.isNeg())&&bs("unbound-bitwise-result","and"),to(Xr(this).and(r))}or(e){let r=Xr(e);return(this.isNegative()||r.isNeg())&&bs("unbound-bitwise-result","or"),to(Xr(this).or(r))}xor(e){let r=Xr(e);return(this.isNegative()||r.isNeg())&&bs("unbound-bitwise-result","xor"),to(Xr(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&bs("negative-width","mask"),to(Xr(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&bs("negative-width","shl"),to(Xr(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&bs("negative-width","shr"),to(Xr(this).shrn(e))}eq(e){return Xr(this).eq(Xr(e))}lt(e){return Xr(this).lt(Xr(e))}lte(e){return Xr(this).lte(Xr(e))}gt(e){return Xr(this).gt(Xr(e))}gte(e){return Xr(this).gte(Xr(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Xr(this).isZero()}toNumber(){try{return Xr(this).toNumber()}catch{bs("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Mh.throwError("this platform does not support BigInt",er.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?TV||(TV=!0,Mh.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Mh.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",er.errors.UNEXPECTED_ARGUMENT,{}):Mh.throwError("BigNumber.toString does not accept parameters",er.errors.UNEXPECTED_ARGUMENT,{})),Xr(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof t)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new t(mA,zm(e)):e.match(/^-?[0-9]+$/)?new t(mA,zm(new E3(e))):Mh.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&bs("underflow","BigNumber.from",e),(e>=RV||e<=-RV)&&bs("overflow","BigNumber.from",e),t.from(String(e));let r=e;if(typeof r=="bigint")return t.from(r.toString());if(Fm(r))return t.from(sr(r));if(r)if(r.toHexString){let a=r.toHexString();if(typeof a=="string")return t.from(a)}else{let a=r._hex;if(a==null&&r.type==="BigNumber"&&(a=r.hex),typeof a=="string"&&(Dn(a)||a[0]==="-"&&Dn(a.substring(1))))return t.from(a)}return Mh.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}};function zm(t){if(typeof t!="string")return zm(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Mh.throwArgumentError("invalid hex","value",t),t=zm(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function to(t){return nn.from(zm(t))}function Xr(t){let e=nn.from(t).toHexString();return e[0]==="-"?new E3("-"+e.substring(3),16):new E3(e.substring(2),16)}function bs(t,e,r){let a={fault:t,operation:e};return r!=null&&(a.value=r),Mh.throwError(t,er.errors.NUMERIC_FAULT,a)}function gA(t){return new E3(t,36).toString(16)}ie();ae();ne();ie();ae();ne();var IV="strings/5.7.0";var BV=new er(IV),mu;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(mu||(mu={}));var R0;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(R0||(R0={}));function abe(t,e,r,a,i){return BV.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function OV(t,e,r,a,i){if(t===R0.BAD_PREFIX||t===R0.UNEXPECTED_CONTINUE){let h=0;for(let c=e+1;c<r.length&&r[c]>>6===2;c++)h++;return h}return t===R0.OVERRUN?r.length-e-1:0}function obe(t,e,r,a,i){return t===R0.OVERLONG?(a.push(i),0):(a.push(65533),OV(t,e,r,a,i))}var sbe=Object.freeze({error:abe,ignore:OV,replace:obe});function Ca(t,e=mu.current){e!=mu.current&&(BV.checkNormalize(),t=t.normalize(e));let r=[];for(let a=0;a<t.length;a++){let i=t.charCodeAt(a);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){a++;let h=t.charCodeAt(a);if(a>=t.length||(h&64512)!==56320)throw new Error("invalid utf-8 string");let c=65536+((i&1023)<<10)+(h&1023);r.push(c>>18|240),r.push(c>>12&63|128),r.push(c>>6&63|128),r.push(c&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return Ct(r)}function jp(t){return rn(Ca(t))}ie();ae();ne();var PV="hash/5.7.0";ie();ae();ne();var NV=`Ethereum Signed Message:
128
128
  `;function Vc(t){return typeof t=="string"&&(t=Ca(t)),rn(Ao([Ca(NV),Ca(String(t.length)),t]))}ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var CV="rlp/5.7.0";var fbe=new er(CV);function LV(t){let e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function $V(t){if(Array.isArray(t)){let a=[];if(t.forEach(function(h){a=a.concat($V(h))}),a.length<=55)return a.unshift(192+a.length),a;let i=LV(a.length);return i.unshift(247+i.length),i.concat(a)}qm(t)||fbe.throwArgumentError("RLP object must be BytesLike","object",t);let e=Array.prototype.slice.call(Ct(t));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;let r=LV(e.length);return r.unshift(183+r.length),r.concat(e)}function Zm(t){return sr($V(t))}ie();ae();ne();var DV="address/5.7.0";var Hm=new er(DV);function UV(t){Dn(t,20)||Hm.throwArgumentError("invalid address","address",t),t=t.toLowerCase();let e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);let a=Ct(rn(r));for(let i=0;i<40;i+=2)a[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(a[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}var hbe=9007199254740991;function cbe(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}var bA={};for(let t=0;t<10;t++)bA[String(t)]=String(t);for(let t=0;t<26;t++)bA[String.fromCharCode(65+t)]=String(10+t);var qV=Math.floor(cbe(hbe));function lbe(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(a=>bA[a]).join("");for(;e.length>=qV;){let a=e.substring(0,qV);e=parseInt(a,10)%97+e.substring(a.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function Aa(t){let e=null;if(typeof t!="string"&&Hm.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=UV(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Hm.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==lbe(t)&&Hm.throwArgumentError("bad icap checksum","address",t),e=gA(t.substring(4));e.length<40;)e="0"+e;e=UV("0x"+e)}else Hm.throwArgumentError("invalid address","address",t);return e}ie();ae();ne();ie();ae();ne();var FV="properties/5.7.0";var dbe=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(c){c(h)})}return new(r||(r=Promise))(function(h,c){function p(y){try{g(a.next(y))}catch(M){c(M)}}function b(y){try{g(a.throw(y))}catch(M){c(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},A3=new er(FV);function ur(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function xh(t){return dbe(this,void 0,void 0,function*(){let e=Object.keys(t).map(a=>{let i=t[a];return Promise.resolve(i).then(h=>({key:a,value:h}))});return(yield Promise.all(e)).reduce((a,i)=>(a[i.key]=i.value,a),{})})}function jV(t,e){(!t||typeof t!="object")&&A3.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||A3.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function Wm(t){let e={};for(let r in t)e[r]=t[r];return e}var pbe={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function zV(t){if(t==null||pbe[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;let e=Object.keys(t);for(let r=0;r<e.length;r++){let a=null;try{a=t[e[r]]}catch{continue}if(!zV(a))return!1}return!0}return A3.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function vbe(t){if(zV(t))return t;if(Array.isArray(t))return Object.freeze(t.map(e=>Km(e)));if(typeof t=="object"){let e={};for(let r in t){let a=t[r];a!==void 0&&ur(e,r,Km(a))}return e}return A3.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function Km(t){return vbe(t)}var T0=class{constructor(e){for(let r in e)this[r]=Km(e[r])}};var mbe=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(c){c(h)})}return new(r||(r=Promise))(function(h,c){function p(y){try{g(a.next(y))}catch(M){c(M)}}function b(y){try{g(a.throw(y))}catch(M){c(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},an=new er(PV),WV=new Uint8Array(32);WV.fill(0);var gbe=nn.from(-1),VV=nn.from(0),GV=nn.from(1),bbe=nn.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function ybe(t){let e=Ct(t),r=e.length%32;return r?Kc([e,WV.slice(r)]):sr(e)}var wbe=Ea(GV.toHexString(),32),_be=Ea(VV.toHexString(),32),ZV={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},yA=["name","version","chainId","verifyingContract","salt"];function HV(t){return function(e){return typeof e!="string"&&an.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}var Mbe={name:HV("name"),version:HV("version"),chainId:function(t){try{return nn.from(t).toString()}catch{}return an.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Aa(t).toLowerCase()}catch{}return an.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{let e=Ct(t);if(e.length!==32)throw new Error("bad length");return sr(e)}catch{}return an.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function wA(t){{let e=t.match(/^(u?)int(\d*)$/);if(e){let r=e[1]==="",a=parseInt(e[2]||"256");(a%8!==0||a>256||e[2]&&e[2]!==String(a))&&an.throwArgumentError("invalid numeric width","type",t);let i=bbe.mask(r?a-1:a),h=r?i.add(GV).mul(gbe):VV;return function(c){let p=nn.from(c);return(p.lt(h)||p.gt(i))&&an.throwArgumentError(`value out-of-bounds for ${t}`,"value",c),Ea(p.toTwos(256).toHexString(),32)}}}{let e=t.match(/^bytes(\d+)$/);if(e){let r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&an.throwArgumentError("invalid bytes width","type",t),function(a){return Ct(a).length!==r&&an.throwArgumentError(`invalid length for ${t}`,"value",a),ybe(a)}}}switch(t){case"address":return function(e){return Ea(Aa(e),32)};case"bool":return function(e){return e?wbe:_be};case"bytes":return function(e){return rn(e)};case"string":return function(e){return jp(e)}}return null}function KV(t,e){return`${t}(${e.map(({name:r,type:a})=>a+" "+r).join(",")})`}var k0=class t{constructor(e){ur(this,"types",Object.freeze(Km(e))),ur(this,"_encoderCache",{}),ur(this,"_types",{});let r={},a={},i={};Object.keys(e).forEach(p=>{r[p]={},a[p]=[],i[p]={}});for(let p in e){let b={};e[p].forEach(g=>{b[g.name]&&an.throwArgumentError(`duplicate variable name ${JSON.stringify(g.name)} in ${JSON.stringify(p)}`,"types",e),b[g.name]=!0;let y=g.type.match(/^([^\x5b]*)(\x5b|$)/)[1];y===p&&an.throwArgumentError(`circular type reference to ${JSON.stringify(y)}`,"types",e),!wA(y)&&(a[y]||an.throwArgumentError(`unknown type ${JSON.stringify(y)}`,"types",e),a[y].push(p),r[p][y]=!0)})}let h=Object.keys(a).filter(p=>a[p].length===0);h.length===0?an.throwArgumentError("missing primary type","types",e):h.length>1&&an.throwArgumentError(`ambiguous primary types or unused types: ${h.map(p=>JSON.stringify(p)).join(", ")}`,"types",e),ur(this,"primaryType",h[0]);function c(p,b){b[p]&&an.throwArgumentError(`circular type reference to ${JSON.stringify(p)}`,"types",e),b[p]=!0,Object.keys(r[p]).forEach(g=>{a[g]&&(c(g,b),Object.keys(b).forEach(y=>{i[y][g]=!0}))}),delete b[p]}c(this.primaryType,{});for(let p in i){let b=Object.keys(i[p]);b.sort(),this._types[p]=KV(p,e[p])+b.map(g=>KV(g,e[g])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{let i=wA(e);if(i)return i}let r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){let i=r[1],h=this.getEncoder(i),c=parseInt(r[3]);return p=>{c>=0&&p.length!==c&&an.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",p);let b=p.map(h);return this._types[i]&&(b=b.map(rn)),rn(Kc(b))}}let a=this.types[e];if(a){let i=jp(this._types[e]);return h=>{let c=a.map(({name:p,type:b})=>{let g=this.getEncoder(b)(h[p]);return this._types[b]?rn(g):g});return c.unshift(i),Kc(c)}}return an.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){let r=this._types[e];return r||an.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return rn(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,a){if(wA(e))return a(e,r);let i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){let c=i[1],p=parseInt(i[3]);return p>=0&&r.length!==p&&an.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(b=>this._visit(c,b,a))}let h=this.types[e];return h?h.reduce((c,{name:p,type:b})=>(c[p]=this._visit(b,r[p],a),c),{}):an.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new t(e)}static getPrimaryType(e){return t.from(e).primaryType}static hashStruct(e,r,a){return t.from(r).hashStruct(e,a)}static hashDomain(e){let r=[];for(let a in e){let i=ZV[a];i||an.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(a)}`,"domain",e),r.push({name:a,type:i})}return r.sort((a,i)=>yA.indexOf(a.name)-yA.indexOf(i.name)),t.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,a){return Kc(["0x1901",t.hashDomain(e),t.from(r).hash(a)])}static hash(e,r,a){return rn(t.encode(e,r,a))}static resolveNames(e,r,a,i){return mbe(this,void 0,void 0,function*(){e=Wm(e);let h={};e.verifyingContract&&!Dn(e.verifyingContract,20)&&(h[e.verifyingContract]="0x");let c=t.from(r);c.visit(a,(p,b)=>(p==="address"&&!Dn(b,20)&&(h[b]="0x"),b));for(let p in h)h[p]=yield i(p);return e.verifyingContract&&h[e.verifyingContract]&&(e.verifyingContract=h[e.verifyingContract]),a=c.visit(a,(p,b)=>p==="address"&&h[b]?h[b]:b),{domain:e,value:a}})}static getPayload(e,r,a){t.hashDomain(e);let i={},h=[];yA.forEach(b=>{let g=e[b];g!=null&&(i[b]=Mbe[b](g),h.push({name:b,type:ZV[b]}))});let c=t.from(r),p=Wm(r);return p.EIP712Domain?an.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):p.EIP712Domain=h,c.encode(a),{types:p,domain:i,primaryType:c.primaryType,message:c.visit(a,(b,g)=>{if(b.match(/^bytes(\d*)/))return sr(Ct(g));if(b.match(/^u?int/))return nn.from(g).toString();switch(b){case"address":return g.toLowerCase();case"bool":return!!g;case"string":return typeof g!="string"&&an.throwArgumentError("invalid string","value",g),g}return an.throwArgumentError("unsupported type","type",b)})}}};ie();ae();ne();ie();ae();ne();var Ir=gi(JV()),xu=gi(Gp());function Yp(t,e,r){return r={path:e,exports:{},require:function(a,i){return Hye(a,i??r.path)}},t(r,r.exports),r.exports}function Hye(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var PA=OG;function OG(t,e){if(!t)throw new Error(e||"Assertion failed")}OG.equal=function(e,r,a){if(e!=r)throw new Error(a||"Assertion failed: "+e+" != "+r)};var wf=Yp(function(t,e){"use strict";var r=e;function a(c,p){if(Array.isArray(c))return c.slice();if(!c)return[];var b=[];if(typeof c!="string"){for(var g=0;g<c.length;g++)b[g]=c[g]|0;return b}if(p==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var g=0;g<c.length;g+=2)b.push(parseInt(c[g]+c[g+1],16))}else for(var g=0;g<c.length;g++){var y=c.charCodeAt(g),M=y>>8,x=y&255;M?b.push(M,x):b.push(x)}return b}r.toArray=a;function i(c){return c.length===1?"0"+c:c}r.zero2=i;function h(c){for(var p="",b=0;b<c.length;b++)p+=i(c[b].toString(16));return p}r.toHex=h,r.encode=function(p,b){return b==="hex"?h(p):p}}),Ro=Yp(function(t,e){"use strict";var r=e;r.assert=PA,r.toArray=wf.toArray,r.zero2=wf.zero2,r.toHex=wf.toHex,r.encode=wf.encode;function a(b,g,y){var M=new Array(Math.max(b.bitLength(),y)+1);M.fill(0);for(var x=1<<g+1,E=b.clone(),A=0;A<M.length;A++){var k,O=E.andln(x-1);E.isOdd()?(O>(x>>1)-1?k=(x>>1)-O:k=O,E.isubn(k)):k=0,M[A]=k,E.iushrn(1)}return M}r.getNAF=a;function i(b,g){var y=[[],[]];b=b.clone(),g=g.clone();for(var M=0,x=0,E;b.cmpn(-M)>0||g.cmpn(-x)>0;){var A=b.andln(3)+M&3,k=g.andln(3)+x&3;A===3&&(A=-1),k===3&&(k=-1);var O;A&1?(E=b.andln(7)+M&7,(E===3||E===5)&&k===2?O=-A:O=A):O=0,y[0].push(O);var N;k&1?(E=g.andln(7)+x&7,(E===3||E===5)&&A===2?N=-k:N=k):N=0,y[1].push(N),2*M===O+1&&(M=1-M),2*x===N+1&&(x=1-x),b.iushrn(1),g.iushrn(1)}return y}r.getJSF=i;function h(b,g,y){var M="_"+g;b.prototype[g]=function(){return this[M]!==void 0?this[M]:this[M]=y.call(this)}}r.cachedProperty=h;function c(b){return typeof b=="string"?r.toArray(b,"hex"):b}r.parseBytes=c;function p(b){return new Ir.default(b,"hex","le")}r.intFromLE=p}),B3=Ro.getNAF,Kye=Ro.getJSF,O3=Ro.assert;function Jc(t,e){this.type=t,this.p=new Ir.default(e.p,16),this.red=e.prime?Ir.default.red(e.prime):Ir.default.mont(this.p),this.zero=new Ir.default(0).toRed(this.red),this.one=new Ir.default(1).toRed(this.red),this.two=new Ir.default(2).toRed(this.red),this.n=e.n&&new Ir.default(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var B0=Jc;Jc.prototype.point=function(){throw new Error("Not implemented")};Jc.prototype.validate=function(){throw new Error("Not implemented")};Jc.prototype._fixedNafMul=function(e,r){O3(e.precomputed);var a=e._getDoubles(),i=B3(r,1,this._bitLength),h=(1<<a.step+1)-(a.step%2===0?2:1);h/=3;var c=[],p,b;for(p=0;p<i.length;p+=a.step){b=0;for(var g=p+a.step-1;g>=p;g--)b=(b<<1)+i[g];c.push(b)}for(var y=this.jpoint(null,null,null),M=this.jpoint(null,null,null),x=h;x>0;x--){for(p=0;p<c.length;p++)b=c[p],b===x?M=M.mixedAdd(a.points[p]):b===-x&&(M=M.mixedAdd(a.points[p].neg()));y=y.add(M)}return y.toP()};Jc.prototype._wnafMul=function(e,r){var a=4,i=e._getNAFPoints(a);a=i.wnd;for(var h=i.points,c=B3(r,a,this._bitLength),p=this.jpoint(null,null,null),b=c.length-1;b>=0;b--){for(var g=0;b>=0&&c[b]===0;b--)g++;if(b>=0&&g++,p=p.dblp(g),b<0)break;var y=c[b];O3(y!==0),e.type==="affine"?y>0?p=p.mixedAdd(h[y-1>>1]):p=p.mixedAdd(h[-y-1>>1].neg()):y>0?p=p.add(h[y-1>>1]):p=p.add(h[-y-1>>1].neg())}return e.type==="affine"?p.toP():p};Jc.prototype._wnafMulAdd=function(e,r,a,i,h){var c=this._wnafT1,p=this._wnafT2,b=this._wnafT3,g=0,y,M,x;for(y=0;y<i;y++){x=r[y];var E=x._getNAFPoints(e);c[y]=E.wnd,p[y]=E.points}for(y=i-1;y>=1;y-=2){var A=y-1,k=y;if(c[A]!==1||c[k]!==1){b[A]=B3(a[A],c[A],this._bitLength),b[k]=B3(a[k],c[k],this._bitLength),g=Math.max(b[A].length,g),g=Math.max(b[k].length,g);continue}var O=[r[A],null,null,r[k]];r[A].y.cmp(r[k].y)===0?(O[1]=r[A].add(r[k]),O[2]=r[A].toJ().mixedAdd(r[k].neg())):r[A].y.cmp(r[k].y.redNeg())===0?(O[1]=r[A].toJ().mixedAdd(r[k]),O[2]=r[A].add(r[k].neg())):(O[1]=r[A].toJ().mixedAdd(r[k]),O[2]=r[A].toJ().mixedAdd(r[k].neg()));var N=[-3,-1,-5,-7,0,7,5,1,3],L=Kye(a[A],a[k]);for(g=Math.max(L[0].length,g),b[A]=new Array(g),b[k]=new Array(g),M=0;M<g;M++){var C=L[0][M]|0,Y=L[1][M]|0;b[A][M]=N[(C+1)*3+(Y+1)],b[k][M]=0,p[A]=O}}var G=this.jpoint(null,null,null),ee=this._wnafT4;for(y=g;y>=0;y--){for(var $=0;y>=0;){var q=!0;for(M=0;M<i;M++)ee[M]=b[M][y]|0,ee[M]!==0&&(q=!1);if(!q)break;$++,y--}if(y>=0&&$++,G=G.dblp($),y<0)break;for(M=0;M<i;M++){var V=ee[M];V!==0&&(V>0?x=p[M][V-1>>1]:V<0&&(x=p[M][-V-1>>1].neg()),x.type==="affine"?G=G.mixedAdd(x):G=G.add(x))}}for(y=0;y<i;y++)p[y]=null;return h?G:G.toP()};function ws(t,e){this.curve=t,this.type=e,this.precomputed=null}Jc.BasePoint=ws;ws.prototype.eq=function(){throw new Error("Not implemented")};ws.prototype.validate=function(){return this.curve.validate(this)};Jc.prototype.decodePoint=function(e,r){e=Ro.toArray(e,r);var a=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*a){e[0]===6?O3(e[e.length-1]%2===0):e[0]===7&&O3(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+a),e.slice(1+a,1+2*a));return i}else if((e[0]===2||e[0]===3)&&e.length-1===a)return this.pointFromX(e.slice(1,1+a),e[0]===3);throw new Error("Unknown point format")};ws.prototype.encodeCompressed=function(e){return this.encode(e,!0)};ws.prototype._encode=function(e){var r=this.curve.p.byteLength(),a=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(a):[4].concat(a,this.getY().toArray("be",r))};ws.prototype.encode=function(e,r){return Ro.encode(this._encode(r),e)};ws.prototype.precompute=function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this};ws.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1};ws.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var a=[this],i=this,h=0;h<r;h+=e){for(var c=0;c<e;c++)i=i.dbl();a.push(i)}return{step:e,points:a}};ws.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],a=(1<<e)-1,i=a===1?null:this.dbl(),h=1;h<a;h++)r[h]=r[h-1].add(i);return{wnd:e,points:r}};ws.prototype._getBeta=function(){return null};ws.prototype.dblp=function(e){for(var r=this,a=0;a<e;a++)r=r.dbl();return r};var NA=Yp(function(t){typeof Object.create=="function"?t.exports=function(r,a){a&&(r.super_=a,r.prototype=Object.create(a.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(r,a){if(a){r.super_=a;var i=function(){};i.prototype=a.prototype,r.prototype=new i,r.prototype.constructor=r}}}),Wye=Ro.assert;function _s(t){B0.call(this,"short",t),this.a=new Ir.default(t.a,16).toRed(this.red),this.b=new Ir.default(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}NA(_s,B0);var Vye=_s;_s.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,a;if(e.beta)r=new Ir.default(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(e.lambda)a=new Ir.default(e.lambda,16);else{var h=this._getEndoRoots(this.n);this.g.mul(h[0]).x.cmp(this.g.x.redMul(r))===0?a=h[0]:(a=h[1],Wye(this.g.mul(a).x.cmp(this.g.x.redMul(r))===0))}var c;return e.basis?c=e.basis.map(function(p){return{a:new Ir.default(p.a,16),b:new Ir.default(p.b,16)}}):c=this._getEndoBasis(a),{beta:r,lambda:a,basis:c}}};_s.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:Ir.default.mont(e),a=new Ir.default(2).toRed(r).redInvm(),i=a.redNeg(),h=new Ir.default(3).toRed(r).redNeg().redSqrt().redMul(a),c=i.redAdd(h).fromRed(),p=i.redSub(h).fromRed();return[c,p]};_s.prototype._getEndoBasis=function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),a=e,i=this.n.clone(),h=new Ir.default(1),c=new Ir.default(0),p=new Ir.default(0),b=new Ir.default(1),g,y,M,x,E,A,k,O=0,N,L;a.cmpn(0)!==0;){var C=i.div(a);N=i.sub(C.mul(a)),L=p.sub(C.mul(h));var Y=b.sub(C.mul(c));if(!M&&N.cmp(r)<0)g=k.neg(),y=h,M=N.neg(),x=L;else if(M&&++O===2)break;k=N,i=a,a=N,p=h,h=L,b=c,c=Y}E=N.neg(),A=L;var G=M.sqr().add(x.sqr()),ee=E.sqr().add(A.sqr());return ee.cmp(G)>=0&&(E=g,A=y),M.negative&&(M=M.neg(),x=x.neg()),E.negative&&(E=E.neg(),A=A.neg()),[{a:M,b:x},{a:E,b:A}]};_s.prototype._endoSplit=function(e){var r=this.endo.basis,a=r[0],i=r[1],h=i.b.mul(e).divRound(this.n),c=a.b.neg().mul(e).divRound(this.n),p=h.mul(a.a),b=c.mul(i.a),g=h.mul(a.b),y=c.mul(i.b),M=e.sub(p).sub(b),x=g.add(y).neg();return{k1:M,k2:x}};_s.prototype.pointFromX=function(e,r){e=new Ir.default(e,16),e.red||(e=e.toRed(this.red));var a=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=a.redSqrt();if(i.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var h=i.fromRed().isOdd();return(r&&!h||!r&&h)&&(i=i.redNeg()),this.point(e,i)};_s.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,a=e.y,i=this.a.redMul(r),h=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return a.redSqr().redISub(h).cmpn(0)===0};_s.prototype._endoWnafMulAdd=function(e,r,a){for(var i=this._endoWnafT1,h=this._endoWnafT2,c=0;c<e.length;c++){var p=this._endoSplit(r[c]),b=e[c],g=b._getBeta();p.k1.negative&&(p.k1.ineg(),b=b.neg(!0)),p.k2.negative&&(p.k2.ineg(),g=g.neg(!0)),i[c*2]=b,i[c*2+1]=g,h[c*2]=p.k1,h[c*2+1]=p.k2}for(var y=this._wnafMulAdd(1,i,h,c*2,a),M=0;M<c*2;M++)i[M]=null,h[M]=null;return y};function Qn(t,e,r,a){B0.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Ir.default(e,16),this.y=new Ir.default(r,16),a&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}NA(Qn,B0.BasePoint);_s.prototype.point=function(e,r,a){return new Qn(this,e,r,a)};_s.prototype.pointFromJSON=function(e,r){return Qn.fromJSON(this,e,r)};Qn.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var a=this.curve,i=function(h){return a.point(h.x.redMul(a.endo.beta),h.y)};e.beta=r,r.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return r}};Qn.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Qn.fromJSON=function(e,r,a){typeof r=="string"&&(r=JSON.parse(r));var i=e.point(r[0],r[1],a);if(!r[2])return i;function h(p){return e.point(p[0],p[1],a)}var c=r[2];return i.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[i].concat(c.doubles.points.map(h))},naf:c.naf&&{wnd:c.naf.wnd,points:[i].concat(c.naf.points.map(h))}},i};Qn.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Qn.prototype.isInfinity=function(){return this.inf};Qn.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var a=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,i)};Qn.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,a=this.x.redSqr(),i=e.redInvm(),h=a.redAdd(a).redIAdd(a).redIAdd(r).redMul(i),c=h.redSqr().redISub(this.x.redAdd(this.x)),p=h.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,p)};Qn.prototype.getX=function(){return this.x.fromRed()};Qn.prototype.getY=function(){return this.y.fromRed()};Qn.prototype.mul=function(e){return e=new Ir.default(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Qn.prototype.mulAdd=function(e,r,a){var i=[this,r],h=[e,a];return this.curve.endo?this.curve._endoWnafMulAdd(i,h):this.curve._wnafMulAdd(1,i,h,2)};Qn.prototype.jmulAdd=function(e,r,a){var i=[this,r],h=[e,a];return this.curve.endo?this.curve._endoWnafMulAdd(i,h,!0):this.curve._wnafMulAdd(1,i,h,2,!0)};Qn.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Qn.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var a=this.precomputed,i=function(h){return h.neg()};r.precomputed={naf:a.naf&&{wnd:a.naf.wnd,points:a.naf.points.map(i)},doubles:a.doubles&&{step:a.doubles.step,points:a.doubles.points.map(i)}}}return r};Qn.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function ca(t,e,r,a){B0.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&a===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Ir.default(0)):(this.x=new Ir.default(e,16),this.y=new Ir.default(r,16),this.z=new Ir.default(a,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}NA(ca,B0.BasePoint);_s.prototype.jpoint=function(e,r,a){return new ca(this,e,r,a)};ca.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),a=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(a,i)};ca.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};ca.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),a=this.z.redSqr(),i=this.x.redMul(r),h=e.x.redMul(a),c=this.y.redMul(r.redMul(e.z)),p=e.y.redMul(a.redMul(this.z)),b=i.redSub(h),g=c.redSub(p);if(b.cmpn(0)===0)return g.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=b.redSqr(),M=y.redMul(b),x=i.redMul(y),E=g.redSqr().redIAdd(M).redISub(x).redISub(x),A=g.redMul(x.redISub(E)).redISub(c.redMul(M)),k=this.z.redMul(e.z).redMul(b);return this.curve.jpoint(E,A,k)};ca.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),a=this.x,i=e.x.redMul(r),h=this.y,c=e.y.redMul(r).redMul(this.z),p=a.redSub(i),b=h.redSub(c);if(p.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=p.redSqr(),y=g.redMul(p),M=a.redMul(g),x=b.redSqr().redIAdd(y).redISub(M).redISub(M),E=b.redMul(M.redISub(x)).redISub(h.redMul(y)),A=this.z.redMul(p);return this.curve.jpoint(x,E,A)};ca.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var a=this;for(r=0;r<e;r++)a=a.dbl();return a}var i=this.curve.a,h=this.curve.tinv,c=this.x,p=this.y,b=this.z,g=b.redSqr().redSqr(),y=p.redAdd(p);for(r=0;r<e;r++){var M=c.redSqr(),x=y.redSqr(),E=x.redSqr(),A=M.redAdd(M).redIAdd(M).redIAdd(i.redMul(g)),k=c.redMul(x),O=A.redSqr().redISub(k.redAdd(k)),N=k.redISub(O),L=A.redMul(N);L=L.redIAdd(L).redISub(E);var C=y.redMul(b);r+1<e&&(g=g.redMul(E)),c=O,b=C,y=L}return this.curve.jpoint(c,y.redMul(h),b)};ca.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};ca.prototype._zeroDbl=function(){var e,r,a;if(this.zOne){var i=this.x.redSqr(),h=this.y.redSqr(),c=h.redSqr(),p=this.x.redAdd(h).redSqr().redISub(i).redISub(c);p=p.redIAdd(p);var b=i.redAdd(i).redIAdd(i),g=b.redSqr().redISub(p).redISub(p),y=c.redIAdd(c);y=y.redIAdd(y),y=y.redIAdd(y),e=g,r=b.redMul(p.redISub(g)).redISub(y),a=this.y.redAdd(this.y)}else{var M=this.x.redSqr(),x=this.y.redSqr(),E=x.redSqr(),A=this.x.redAdd(x).redSqr().redISub(M).redISub(E);A=A.redIAdd(A);var k=M.redAdd(M).redIAdd(M),O=k.redSqr(),N=E.redIAdd(E);N=N.redIAdd(N),N=N.redIAdd(N),e=O.redISub(A).redISub(A),r=k.redMul(A.redISub(e)).redISub(N),a=this.y.redMul(this.z),a=a.redIAdd(a)}return this.curve.jpoint(e,r,a)};ca.prototype._threeDbl=function(){var e,r,a;if(this.zOne){var i=this.x.redSqr(),h=this.y.redSqr(),c=h.redSqr(),p=this.x.redAdd(h).redSqr().redISub(i).redISub(c);p=p.redIAdd(p);var b=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),g=b.redSqr().redISub(p).redISub(p);e=g;var y=c.redIAdd(c);y=y.redIAdd(y),y=y.redIAdd(y),r=b.redMul(p.redISub(g)).redISub(y),a=this.y.redAdd(this.y)}else{var M=this.z.redSqr(),x=this.y.redSqr(),E=this.x.redMul(x),A=this.x.redSub(M).redMul(this.x.redAdd(M));A=A.redAdd(A).redIAdd(A);var k=E.redIAdd(E);k=k.redIAdd(k);var O=k.redAdd(k);e=A.redSqr().redISub(O),a=this.y.redAdd(this.z).redSqr().redISub(x).redISub(M);var N=x.redSqr();N=N.redIAdd(N),N=N.redIAdd(N),N=N.redIAdd(N),r=A.redMul(k.redISub(e)).redISub(N)}return this.curve.jpoint(e,r,a)};ca.prototype._dbl=function(){var e=this.curve.a,r=this.x,a=this.y,i=this.z,h=i.redSqr().redSqr(),c=r.redSqr(),p=a.redSqr(),b=c.redAdd(c).redIAdd(c).redIAdd(e.redMul(h)),g=r.redAdd(r);g=g.redIAdd(g);var y=g.redMul(p),M=b.redSqr().redISub(y.redAdd(y)),x=y.redISub(M),E=p.redSqr();E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E);var A=b.redMul(x).redISub(E),k=a.redAdd(a).redMul(i);return this.curve.jpoint(M,A,k)};ca.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),a=this.z.redSqr(),i=r.redSqr(),h=e.redAdd(e).redIAdd(e),c=h.redSqr(),p=this.x.redAdd(r).redSqr().redISub(e).redISub(i);p=p.redIAdd(p),p=p.redAdd(p).redIAdd(p),p=p.redISub(c);var b=p.redSqr(),g=i.redIAdd(i);g=g.redIAdd(g),g=g.redIAdd(g),g=g.redIAdd(g);var y=h.redIAdd(p).redSqr().redISub(c).redISub(b).redISub(g),M=r.redMul(y);M=M.redIAdd(M),M=M.redIAdd(M);var x=this.x.redMul(b).redISub(M);x=x.redIAdd(x),x=x.redIAdd(x);var E=this.y.redMul(y.redMul(g.redISub(y)).redISub(p.redMul(b)));E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E);var A=this.z.redAdd(p).redSqr().redISub(a).redISub(b);return this.curve.jpoint(x,E,A)};ca.prototype.mul=function(e,r){return e=new Ir.default(e,r),this.curve._wnafMul(this,e)};ca.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),a=e.z.redSqr();if(this.x.redMul(a).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),h=a.redMul(e.z);return this.y.redMul(h).redISub(e.y.redMul(i)).cmpn(0)===0};ca.prototype.eqXToP=function(e){var r=this.z.redSqr(),a=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(a)===0)return!0;for(var i=e.clone(),h=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(a.redIAdd(h),this.x.cmp(a)===0)return!0}};ca.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};ca.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var k3=Yp(function(t,e){"use strict";var r=e;r.base=B0,r.short=Vye,r.mont=null,r.edwards=null}),I3=Yp(function(t,e){"use strict";var r=e,a=Ro.assert;function i(p){p.type==="short"?this.curve=new k3.short(p):p.type==="edwards"?this.curve=new k3.edwards(p):this.curve=new k3.mont(p),this.g=this.curve.g,this.n=this.curve.n,this.hash=p.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function h(p,b){Object.defineProperty(r,p,{configurable:!0,enumerable:!0,get:function(){var g=new i(b);return Object.defineProperty(r,p,{configurable:!0,enumerable:!0,value:g}),g}})}h("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:xu.default.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:xu.default.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:xu.default.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:xu.default.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),h("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:xu.default.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:xu.default.sha256,gRed:!1,g:["9"]}),h("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:xu.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}h("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:xu.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function Yc(t){if(!(this instanceof Yc))return new Yc(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=wf.toArray(t.entropy,t.entropyEnc||"hex"),r=wf.toArray(t.nonce,t.nonceEnc||"hex"),a=wf.toArray(t.pers,t.persEnc||"hex");PA(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,a)}var PG=Yc;Yc.prototype._init=function(e,r,a){var i=e.concat(r).concat(a);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var h=0;h<this.V.length;h++)this.K[h]=0,this.V[h]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656};Yc.prototype._hmac=function(){return new xu.default.hmac(this.hash,this.K)};Yc.prototype._update=function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())};Yc.prototype.reseed=function(e,r,a,i){typeof r!="string"&&(i=a,a=r,r=null),e=wf.toArray(e,r),a=wf.toArray(a,i),PA(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(a||[])),this._reseed=1};Yc.prototype.generate=function(e,r,a,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=a,a=r,r=null),a&&(a=wf.toArray(a,i||"hex"),this._update(a));for(var h=[];h.length<e;)this.V=this._hmac().update(this.V).digest(),h=h.concat(this.V);var c=h.slice(0,e);return this._update(a),this._reseed++,wf.encode(c,r)};var OA=Ro.assert;function Ra(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var CA=Ra;Ra.fromPublic=function(e,r,a){return r instanceof Ra?r:new Ra(e,{pub:r,pubEnc:a})};Ra.fromPrivate=function(e,r,a){return r instanceof Ra?r:new Ra(e,{priv:r,privEnc:a})};Ra.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};Ra.prototype.getPublic=function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub};Ra.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};Ra.prototype._importPrivate=function(e,r){this.priv=new Ir.default(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)};Ra.prototype._importPublic=function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?OA(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&OA(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,r)};Ra.prototype.derive=function(e){return e.validate()||OA(e.validate(),"public point not validated"),e.mul(this.priv).getX()};Ra.prototype.sign=function(e,r,a){return this.ec.sign(e,this,r,a)};Ra.prototype.verify=function(e,r){return this.ec.verify(e,r,this)};Ra.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Gye=Ro.assert;function P3(t,e){if(t instanceof P3)return t;this._importDER(t,e)||(Gye(t.r&&t.s,"Signature without r or s"),this.r=new Ir.default(t.r,16),this.s=new Ir.default(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var N3=P3;function Yye(){this.place=0}function IA(t,e){var r=t[e.place++];if(!(r&128))return r;var a=r&15;if(a===0||a>4)return!1;for(var i=0,h=0,c=e.place;h<a;h++,c++)i<<=8,i|=t[c],i>>>=0;return i<=127?!1:(e.place=c,i)}function BG(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}P3.prototype._importDER=function(e,r){e=Ro.toArray(e,r);var a=new Yye;if(e[a.place++]!==48)return!1;var i=IA(e,a);if(i===!1||i+a.place!==e.length||e[a.place++]!==2)return!1;var h=IA(e,a);if(h===!1)return!1;var c=e.slice(a.place,h+a.place);if(a.place+=h,e[a.place++]!==2)return!1;var p=IA(e,a);if(p===!1||e.length!==p+a.place)return!1;var b=e.slice(a.place,p+a.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(b[0]===0)if(b[1]&128)b=b.slice(1);else return!1;return this.r=new Ir.default(c),this.s=new Ir.default(b),this.recoveryParam=null,!0};function BA(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}P3.prototype.toDER=function(e){var r=this.r.toArray(),a=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),a[0]&128&&(a=[0].concat(a)),r=BG(r),a=BG(a);!a[0]&&!(a[1]&128);)a=a.slice(1);var i=[2];BA(i,r.length),i=i.concat(r),i.push(2),BA(i,a.length);var h=i.concat(a),c=[48];return BA(c,h.length),c=c.concat(h),Ro.encode(c,e)};var Jye=function(){throw new Error("unsupported")},NG=Ro.assert;function ys(t){if(!(this instanceof ys))return new ys(t);typeof t=="string"&&(NG(Object.prototype.hasOwnProperty.call(I3,t),"Unknown curve "+t),t=I3[t]),t instanceof I3.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var Xye=ys;ys.prototype.keyPair=function(e){return new CA(this,e)};ys.prototype.keyFromPrivate=function(e,r){return CA.fromPrivate(this,e,r)};ys.prototype.keyFromPublic=function(e,r){return CA.fromPublic(this,e,r)};ys.prototype.genKeyPair=function(e){e||(e={});for(var r=new PG({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Jye(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),a=this.n.byteLength(),i=this.n.sub(new Ir.default(2));;){var h=new Ir.default(r.generate(a));if(!(h.cmp(i)>0))return h.iaddn(1),this.keyFromPrivate(h)}};ys.prototype._truncateToN=function(e,r){var a=e.byteLength()*8-this.n.bitLength();return a>0&&(e=e.ushrn(a)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};ys.prototype.sign=function(e,r,a,i){typeof a=="object"&&(i=a,a=null),i||(i={}),r=this.keyFromPrivate(r,a),e=this._truncateToN(new Ir.default(e,16));for(var h=this.n.byteLength(),c=r.getPrivate().toArray("be",h),p=e.toArray("be",h),b=new PG({hash:this.hash,entropy:c,nonce:p,pers:i.pers,persEnc:i.persEnc||"utf8"}),g=this.n.sub(new Ir.default(1)),y=0;;y++){var M=i.k?i.k(y):new Ir.default(b.generate(this.n.byteLength()));if(M=this._truncateToN(M,!0),!(M.cmpn(1)<=0||M.cmp(g)>=0)){var x=this.g.mul(M);if(!x.isInfinity()){var E=x.getX(),A=E.umod(this.n);if(A.cmpn(0)!==0){var k=M.invm(this.n).mul(A.mul(r.getPrivate()).iadd(e));if(k=k.umod(this.n),k.cmpn(0)!==0){var O=(x.getY().isOdd()?1:0)|(E.cmp(A)!==0?2:0);return i.canonical&&k.cmp(this.nh)>0&&(k=this.n.sub(k),O^=1),new N3({r:A,s:k,recoveryParam:O})}}}}}};ys.prototype.verify=function(e,r,a,i){e=this._truncateToN(new Ir.default(e,16)),a=this.keyFromPublic(a,i),r=new N3(r,"hex");var h=r.r,c=r.s;if(h.cmpn(1)<0||h.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var p=c.invm(this.n),b=p.mul(e).umod(this.n),g=p.mul(h).umod(this.n),y;return this.curve._maxwellTrick?(y=this.g.jmulAdd(b,a.getPublic(),g),y.isInfinity()?!1:y.eqXToP(h)):(y=this.g.mulAdd(b,a.getPublic(),g),y.isInfinity()?!1:y.getX().umod(this.n).cmp(h)===0)};ys.prototype.recoverPubKey=function(t,e,r,a){NG((3&r)===r,"The recovery param is more than two bits"),e=new N3(e,a);var i=this.n,h=new Ir.default(t),c=e.r,p=e.s,b=r&1,g=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&g)throw new Error("Unable to find sencond key candinate");g?c=this.curve.pointFromX(c.add(this.curve.n),b):c=this.curve.pointFromX(c,b);var y=e.r.invm(i),M=i.sub(h).mul(y).umod(i),x=p.mul(y).umod(i);return this.g.mulAdd(M,c,x)};ys.prototype.getKeyRecoveryParam=function(t,e,r,a){if(e=new N3(e,a),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var h;try{h=this.recoverPubKey(t,e,i)}catch{continue}if(h.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Qye=Yp(function(t,e){"use strict";var r=e;r.version="6.5.4",r.utils=Ro,r.rand=function(){throw new Error("unsupported")},r.curve=k3,r.curves=I3,r.ec=Xye,r.eddsa=null}),CG=Qye.ec;ie();ae();ne();var LG="signing-key/5.7.0";var $A=new er(LG),LA=null;function Su(){return LA||(LA=new CG("secp256k1")),LA}var Eu=class{constructor(e){ur(this,"curve","secp256k1"),ur(this,"privateKey",sr(e)),jm(this.privateKey)!==32&&$A.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let r=Su().keyFromPrivate(Ct(this.privateKey));ur(this,"publicKey","0x"+r.getPublic(!1,"hex")),ur(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),ur(this,"_isSigningKey",!0)}_addPoint(e){let r=Su().keyFromPublic(Ct(this.publicKey)),a=Su().keyFromPublic(Ct(e));return"0x"+r.pub.add(a.pub).encodeCompressed("hex")}signDigest(e){let r=Su().keyFromPrivate(Ct(this.privateKey)),a=Ct(e);a.length!==32&&$A.throwArgumentError("bad digest length","digest",e);let i=r.sign(a,{canonical:!0});return Wc({recoveryParam:i.recoveryParam,r:Ea("0x"+i.r.toString(16),32),s:Ea("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let r=Su().keyFromPrivate(Ct(this.privateKey)),a=Su().keyFromPublic(Ct(DA(e)));return Ea("0x"+r.derive(a.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};function C3(t,e){let r=Wc(e),a={r:Ct(r.r),s:Ct(r.s)};return"0x"+Su().recoverPubKey(Ct(t),a,r.recoveryParam).encode("hex",!1)}function DA(t,e){let r=Ct(t);if(r.length===32){let a=new Eu(r);return e?"0x"+Su().keyFromPrivate(r).getPublic(!0,"hex"):a.publicKey}else{if(r.length===33)return e?sr(r):"0x"+Su().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+Su().keyFromPublic(r).getPublic(!0,"hex"):sr(r)}return $A.throwArgumentError("invalid public or private key","key","[REDACTED]")}ie();ae();ne();ie();ae();ne();var $G="transactions/5.7.0";var _f=new er($G),DG;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(DG||(DG={}));var e6e=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],t6e={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Ms(t){let e=DA(t);return Aa(_h(rn(_h(e,1)),12))}function qA(t,e){return Ms(C3(Ct(t),e))}function To(t,e){let r=vu(nn.from(t).toHexString());return r.length>32&&_f.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function UA(t,e){return{address:Aa(t),storageKeys:(e||[]).map((r,a)=>(jm(r)!==32&&_f.throwArgumentError("invalid access list storageKey",`accessList[${t}:${a}]`,r),r.toLowerCase()))}}function r6e(t){if(Array.isArray(t))return t.map((r,a)=>Array.isArray(r)?(r.length>2&&_f.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${a}]`,r),UA(r[0],r[1])):UA(r.address,r.storageKeys));let e=Object.keys(t).map(r=>{let a=t[r].reduce((i,h)=>(i[h]=!0,i),{});return UA(r,Object.keys(a).sort())});return e.sort((r,a)=>r.address.localeCompare(a.address)),e}function UG(t){return r6e(t).map(e=>[e.address,e.storageKeys])}function i6e(t,e){if(t.gasPrice!=null){let a=nn.from(t.gasPrice),i=nn.from(t.maxFeePerGas||0);a.eq(i)||_f.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:a,maxFeePerGas:i})}let r=[To(t.chainId||0,"chainId"),To(t.nonce||0,"nonce"),To(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),To(t.maxFeePerGas||0,"maxFeePerGas"),To(t.gasLimit||0,"gasLimit"),t.to!=null?Aa(t.to):"0x",To(t.value||0,"value"),t.data||"0x",UG(t.accessList||[])];if(e){let a=Wc(e);r.push(To(a.recoveryParam,"recoveryParam")),r.push(vu(a.r)),r.push(vu(a.s))}return Kc(["0x02",Zm(r)])}function n6e(t,e){let r=[To(t.chainId||0,"chainId"),To(t.nonce||0,"nonce"),To(t.gasPrice||0,"gasPrice"),To(t.gasLimit||0,"gasLimit"),t.to!=null?Aa(t.to):"0x",To(t.value||0,"value"),t.data||"0x",UG(t.accessList||[])];if(e){let a=Wc(e);r.push(To(a.recoveryParam,"recoveryParam")),r.push(vu(a.r)),r.push(vu(a.s))}return Kc(["0x01",Zm(r)])}function a6e(t,e){jV(t,t6e);let r=[];e6e.forEach(function(c){let p=t[c.name]||[],b={};c.numeric&&(b.hexPad="left"),p=Ct(sr(p,b)),c.length&&p.length!==c.length&&p.length>0&&_f.throwArgumentError("invalid length for "+c.name,"transaction:"+c.name,p),c.maxLength&&(p=vu(p),p.length>c.maxLength&&_f.throwArgumentError("invalid length for "+c.name,"transaction:"+c.name,p)),r.push(sr(p))});let a=0;if(t.chainId!=null?(a=t.chainId,typeof a!="number"&&_f.throwArgumentError("invalid transaction.chainId","transaction",t)):e&&!qm(e)&&e.v>28&&(a=Math.floor((e.v-35)/2)),a!==0&&(r.push(sr(a)),r.push("0x"),r.push("0x")),!e)return Zm(r);let i=Wc(e),h=27+i.recoveryParam;return a!==0?(r.pop(),r.pop(),r.pop(),h+=a*2+8,i.v>28&&i.v!==h&&_f.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==h&&_f.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push(sr(h)),r.push(vu(Ct(i.r))),r.push(vu(Ct(i.s))),Zm(r)}function FA(t,e){if(t.type==null||t.type===0)return t.accessList!=null&&_f.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),a6e(t,e);switch(t.type){case 1:return n6e(t,e);case 2:return i6e(t,e);default:break}return _f.throwError(`unsupported transaction type: ${t.type}`,er.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}ie();ae();ne();ie();ae();ne();ie();ae();ne();var qG="abstract-provider/5.7.0";var o6e=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(c){c(h)})}return new(r||(r=Promise))(function(h,c){function p(y){try{g(a.next(y))}catch(M){c(M)}}function b(y){try{g(a.throw(y))}catch(M){c(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},s6e=new er(qG);var L3=class t{constructor(){s6e.checkAbstract(new.target,t),ur(this,"_isProvider",!0)}getFeeData(){return o6e(this,void 0,void 0,function*(){let{block:e,gasPrice:r}=yield xh({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(c=>null)}),a=null,i=null,h=null;return e&&e.baseFeePerGas&&(a=e.baseFeePerGas,h=nn.from("1500000000"),i=e.baseFeePerGas.mul(2).add(h)),{lastBaseFeePerGas:a,maxFeePerGas:i,maxPriorityFeePerGas:h,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}};ie();ae();ne();ie();ae();ne();var FG="abstract-signer/5.7.0";var Mf=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(c){c(h)})}return new(r||(r=Promise))(function(h,c){function p(y){try{g(a.next(y))}catch(M){c(M)}}function b(y){try{g(a.throw(y))}catch(M){c(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},xf=new er(FG),f6e=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],u6e=[er.errors.INSUFFICIENT_FUNDS,er.errors.NONCE_EXPIRED,er.errors.REPLACEMENT_UNDERPRICED],$3=class t{constructor(){xf.checkAbstract(new.target,t),ur(this,"_isSigner",!0)}getBalance(e){return Mf(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Mf(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Mf(this,void 0,void 0,function*(){this._checkProvider("estimateGas");let r=yield xh(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return Mf(this,void 0,void 0,function*(){this._checkProvider("call");let a=yield xh(this.checkTransaction(e));return yield this.provider.call(a,r)})}sendTransaction(e){return Mf(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");let r=yield this.populateTransaction(e),a=yield this.signTransaction(r);return yield this.provider.sendTransaction(a)})}getChainId(){return Mf(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Mf(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Mf(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Mf(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(let a in e)f6e.indexOf(a)===-1&&xf.throwArgumentError("invalid transaction key: "+a,"transaction",e);let r=Wm(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(a=>(a[0].toLowerCase()!==a[1].toLowerCase()&&xf.throwArgumentError("from address mismatch","transaction",e),a[0])),r}populateTransaction(e){return Mf(this,void 0,void 0,function*(){let r=yield xh(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>Mf(this,void 0,void 0,function*(){if(i==null)return null;let h=yield this.resolveName(i);return h==null&&xf.throwArgumentError("provided ENS name resolves to null","tx.to",i),h})),r.to.catch(i=>{}));let a=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||a)?xf.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&a&&xf.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{let i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){let h=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=h,r.maxPriorityFeePerGas=h}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(a&&xf.throwError("network does not support EIP-1559",er.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):xf.throwError("failed to get consistent fee data",er.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(u6e.indexOf(i.code)>=0)throw i;return xf.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",er.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&xf.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield xh(r)})}_checkProvider(e){this.provider||xf.throwError("missing provider",er.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}};ie();ae();ne();ie();ae();ne();var D3=class{constructor(e){ur(this,"alphabet",e),ur(this,"base",e.length),ur(this,"_alphabetMap",{}),ur(this,"_leader",e.charAt(0));for(let r=0;r<e.length;r++)this._alphabetMap[e.charAt(r)]=r}encode(e){let r=Ct(e);if(r.length===0)return"";let a=[0];for(let h=0;h<r.length;++h){let c=r[h];for(let p=0;p<a.length;++p)c+=a[p]<<8,a[p]=c%this.base,c=c/this.base|0;for(;c>0;)a.push(c%this.base),c=c/this.base|0}let i="";for(let h=0;r[h]===0&&h<r.length-1;++h)i+=this._leader;for(let h=a.length-1;h>=0;--h)i+=this.alphabet[a[h]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let a=0;a<e.length;a++){let i=this._alphabetMap[e[a]];if(i===void 0)throw new Error("Non-base"+this.base+" character");let h=i;for(let c=0;c<r.length;++c)h+=r[c]*this.base,r[c]=h&255,h>>=8;for(;h>0;)r.push(h&255),h>>=8}for(let a=0;e[a]===this._leader&&a<e.length-1;++a)r.push(0);return Ct(new Uint8Array(r.reverse()))}},mYe=new D3("abcdefghijklmnopqrstuvwxyz234567"),jA=new D3("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var Ym=gi(Gp());ie();ae();ne();var Xc;(function(t){t.sha256="sha256",t.sha512="sha512"})(Xc||(Xc={}));ie();ae();ne();var jG="sha2/5.7.0";var h6e=new er(jG);function zA(t){return"0x"+Ym.default.ripemd160().update(Ct(t)).digest("hex")}function O0(t){return"0x"+Ym.default.sha256().update(Ct(t)).digest("hex")}function P0(t,e,r){return Xc[t]||h6e.throwError("unsupported algorithm "+t,er.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),"0x"+Ym.default.hmac(Ym.default[t],Ct(e)).update(Ct(r)).digest("hex")}function N0(t,e,r,a,i){t=Ct(t),e=Ct(e);let h,c=1,p=new Uint8Array(a),b=new Uint8Array(e.length+4);b.set(e);let g,y;for(let M=1;M<=c;M++){b[e.length]=M>>24&255,b[e.length+1]=M>>16&255,b[e.length+2]=M>>8&255,b[e.length+3]=M&255;let x=Ct(P0(i,t,b));h||(h=x.length,y=new Uint8Array(h),c=Math.ceil(a/h),g=a-(c-1)*h),y.set(x);for(let k=1;k<r;k++){x=Ct(P0(i,t,x));for(let O=0;O<h;O++)y[O]^=x[O]}let E=(M-1)*h,A=M===c?g:h;p.set(Ct(y).slice(0,A),E)}return sr(p)}ie();ae();ne();ie();ae();ne();ie();ae();ne();var zG="wordlists/5.7.0";var c6e=!1,l6e=new er(zG),Jp=class t{constructor(e){l6e.checkAbstract(new.target,t),ur(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){let r=[];for(let a=0;a<2048;a++){let i=e.getWord(a);if(a!==e.getWordIndex(i))return"0x";r.push(i)}return jp(r.join(`
129
129
  `)+`
130
130
  `)}static register(e,r){if(r||(r=e.locale),c6e)try{let a=window;a._ethers&&a._ethers.wordlists&&(a._ethers.wordlists[r]||ur(a._ethers.wordlists,r,e))}catch{}}};ie();ae();ne();ie();ae();ne();var d6e="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo",Jm=null;function ZG(t){if(Jm==null&&(Jm=d6e.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),Jp.check(t)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw Jm=null,new Error("BIP39 Wordlist for en (English) FAILED")}var ZA=class extends Jp{constructor(){super("en")}getWord(e){return ZG(this),Jm[e]}getWordIndex(e){return ZG(this),Jm.indexOf(e)}},HA=new ZA;Jp.register(HA);var U3={en:HA};ie();ae();ne();var HG="hdnode/5.7.0";var F3=new er(HG),p6e=nn.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),v6e=Ca("Bitcoin seed"),Xm=2147483648;function WG(t){return(1<<t)-1<<8-t}function m6e(t){return(1<<t)-1}function q3(t){return Ea(sr(t),32)}function KG(t){return jA.encode(Ao([t,_h(O0(O0(t)),0,4)]))}function KA(t){if(t==null)return U3.en;if(typeof t=="string"){let e=U3[t];return e==null&&F3.throwArgumentError("unknown locale","wordlist",t),e}return t}var Xp={},C0="m/44'/60'/0'/0/0",Qc=class t{constructor(e,r,a,i,h,c,p,b){if(e!==Xp)throw new Error("HDNode constructor cannot be called directly");if(r){let g=new Eu(r);ur(this,"privateKey",g.privateKey),ur(this,"publicKey",g.compressedPublicKey)}else ur(this,"privateKey",null),ur(this,"publicKey",sr(a));ur(this,"parentFingerprint",i),ur(this,"fingerprint",_h(zA(O0(this.publicKey)),0,4)),ur(this,"address",Ms(this.publicKey)),ur(this,"chainCode",h),ur(this,"index",c),ur(this,"depth",p),b==null?(ur(this,"mnemonic",null),ur(this,"path",null)):typeof b=="string"?(ur(this,"mnemonic",null),ur(this,"path",b)):(ur(this,"mnemonic",b),ur(this,"path",b.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return KG(Ao([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",sr(this.depth),this.parentFingerprint,Ea(sr(this.index),4),this.chainCode,this.privateKey!=null?Ao(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new t(Xp,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(e&~Xm));let a=new Uint8Array(37);if(e&Xm){if(!this.privateKey)throw new Error("cannot derive child of neutered node");a.set(Ct(this.privateKey),1),r&&(r+="'")}else a.set(Ct(this.publicKey));for(let M=24;M>=0;M-=8)a[33+(M>>3)]=e>>24-M&255;let i=Ct(P0(Xc.sha512,this.chainCode,a)),h=i.slice(0,32),c=i.slice(32),p=null,b=null;this.privateKey?p=q3(nn.from(h).add(this.privateKey).mod(p6e)):b=new Eu(sr(h))._addPoint(this.publicKey);let g=r,y=this.mnemonic;return y&&(g=Object.freeze({phrase:y.phrase,path:r,locale:y.locale||"en"})),new t(Xp,p,b,this.fingerprint,q3(c),e,this.depth+1,g)}derivePath(e){let r=e.split("/");if(r.length===0||r[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);r[0]==="m"&&r.shift();let a=this;for(let i=0;i<r.length;i++){let h=r[i];if(h.match(/^[0-9]+'$/)){let c=parseInt(h.substring(0,h.length-1));if(c>=Xm)throw new Error("invalid path index - "+h);a=a._derive(Xm+c)}else if(h.match(/^[0-9]+$/)){let c=parseInt(h);if(c>=Xm)throw new Error("invalid path index - "+h);a=a._derive(c)}else throw new Error("invalid path component - "+h)}return a}static _fromSeed(e,r){let a=Ct(e);if(a.length<16||a.length>64)throw new Error("invalid seed");let i=Ct(P0(Xc.sha512,v6e,a));return new t(Xp,q3(i.slice(0,32)),null,"0x00000000",q3(i.slice(32)),0,0,r)}static fromMnemonic(e,r,a){return a=KA(a),e=Qm(WA(e,a),a),t._fromSeed(g6e(e,r),{phrase:e,path:"m",locale:a.locale})}static fromSeed(e){return t._fromSeed(e,null)}static fromExtendedKey(e){let r=jA.decode(e);(r.length!==82||KG(r.slice(0,78))!==e)&&F3.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");let a=r[4],i=sr(r.slice(5,9)),h=parseInt(sr(r.slice(9,13)).substring(2),16),c=sr(r.slice(13,45)),p=r.slice(45,78);switch(sr(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new t(Xp,null,sr(p),i,c,h,a,null);case"0x0488ade4":case"0x04358394 ":if(p[0]!==0)break;return new t(Xp,sr(p.slice(1)),null,i,c,h,a,null)}return F3.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}};function g6e(t,e){e||(e="");let r=Ca("mnemonic"+e,mu.NFKD);return N0(Ca(t,mu.NFKD),r,2048,64,"sha512")}function WA(t,e){e=KA(e),F3.checkNormalize();let r=e.split(t);if(r.length%3!==0)throw new Error("invalid mnemonic");let a=Ct(new Uint8Array(Math.ceil(11*r.length/8))),i=0;for(let g=0;g<r.length;g++){let y=e.getWordIndex(r[g].normalize("NFKD"));if(y===-1)throw new Error("invalid mnemonic");for(let M=0;M<11;M++)y&1<<10-M&&(a[i>>3]|=1<<7-i%8),i++}let h=32*r.length/3,c=r.length/3,p=WG(c);if((Ct(O0(a.slice(0,h/8)))[0]&p)!==(a[a.length-1]&p))throw new Error("invalid checksum");return sr(a.slice(0,h/8))}function Qm(t,e){if(e=KA(e),t=Ct(t),t.length%4!==0||t.length<16||t.length>32)throw new Error("invalid entropy");let r=[0],a=11;for(let c=0;c<t.length;c++)a>8?(r[r.length-1]<<=8,r[r.length-1]|=t[c],a-=8):(r[r.length-1]<<=a,r[r.length-1]|=t[c]>>8-a,r.push(t[c]&m6e(8-a)),a+=3);let i=t.length/4,h=Ct(O0(t))[0]&WG(i);return r[r.length-1]<<=i,r[r.length-1]|=h>>8-i,e.join(r.map(c=>e.getWord(c)))}ie();ae();ne();ie();ae();ne();ie();ae();ne();var VG="random/5.7.0";var VA=new er(VG);function b6e(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}var GG=b6e(),j3=GG.crypto||GG.msCrypto;(!j3||!j3.getRandomValues)&&(VA.warn("WARNING: Missing strong random number source"),j3={getRandomValues:function(t){return VA.throwError("no secure random source avaialble",er.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function el(t){(t<=0||t>1024||t%1||t!=t)&&VA.throwArgumentError("invalid length","length",t);let e=new Uint8Array(t);return j3.getRandomValues(e),Ct(e)}ie();ae();ne();ie();ae();ne();var JA=gi(YA());ie();ae();ne();var z3="json-wallets/5.7.0";ie();ae();ne();function Rh(t){return typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Ct(t)}function Qp(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function eg(t){return typeof t=="string"?Ca(t,mu.NFKC):Ct(t)}function on(t,e){let r=t,a=e.toLowerCase().split("/");for(let i=0;i<a.length;i++){let h=null;for(let c in r)if(c.toLowerCase()===a[i]){h=r[c];break}if(h===null)return null;r=h}return r}function JG(t){let e=Ct(t);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let r=sr(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}var y6e=new er(z3),XA=class extends T0{isCrowdsaleAccount(e){return!!(e&&e._isCrowdsaleAccount)}};function QA(t,e){let r=JSON.parse(t);e=eg(e);let a=Aa(on(r,"ethaddr")),i=Rh(on(r,"encseed"));(!i||i.length%16!==0)&&y6e.throwArgumentError("invalid encseed","json",t);let h=Ct(N0(e,e,2e3,32,"sha256")).slice(0,16),c=i.slice(0,16),p=i.slice(16),b=new JA.default.ModeOfOperation.cbc(h,c),g=JA.default.padding.pkcs7.strip(Ct(b.decrypt(p))),y="";for(let E=0;E<g.length;E++)y+=String.fromCharCode(g[E]);let M=Ca(y),x=rn(M);return new XA({_isCrowdsaleAccount:!0,address:a,privateKey:x})}ie();ae();ne();function eR(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return e.encseed&&e.ethaddr}function tR(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return!(!e.version||parseInt(e.version)!==e.version||parseInt(e.version)!==3)}ie();ae();ne();var Th=gi(YA()),Z3=gi(QG());var w6e=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(c){c(h)})}return new(r||(r=Promise))(function(h,c){function p(y){try{g(a.next(y))}catch(M){c(M)}}function b(y){try{g(a.throw(y))}catch(M){c(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},iR=new er(z3);function eY(t){return t!=null&&t.mnemonic&&t.mnemonic.phrase}var nR=class extends T0{isKeystoreAccount(e){return!!(e&&e._isKeystoreAccount)}};function _6e(t,e,r){if(on(t,"crypto/cipher")==="aes-128-ctr"){let i=Rh(on(t,"crypto/cipherparams/iv")),h=new Th.default.Counter(i),c=new Th.default.ModeOfOperation.ctr(e,h);return Ct(c.decrypt(r))}return null}function tY(t,e){let r=Rh(on(t,"crypto/ciphertext"));if(sr(rn(Ao([e.slice(16,32),r]))).substring(2)!==on(t,"crypto/mac").toLowerCase())throw new Error("invalid password");let i=_6e(t,e.slice(0,16),r);i||iR.throwError("unsupported cipher",er.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});let h=e.slice(32,64),c=Ms(i);if(t.address){let b=t.address.toLowerCase();if(b.substring(0,2)!=="0x"&&(b="0x"+b),Aa(b)!==c)throw new Error("address mismatch")}let p={_isKeystoreAccount:!0,address:c,privateKey:sr(i)};if(on(t,"x-ethers/version")==="0.1"){let b=Rh(on(t,"x-ethers/mnemonicCiphertext")),g=Rh(on(t,"x-ethers/mnemonicCounter")),y=new Th.default.Counter(g),M=new Th.default.ModeOfOperation.ctr(h,y),x=on(t,"x-ethers/path")||C0,E=on(t,"x-ethers/locale")||"en",A=Ct(M.decrypt(b));try{let k=Qm(A,E),O=Qc.fromMnemonic(k,null,E).derivePath(x);if(O.privateKey!=p.privateKey)throw new Error("mnemonic mismatch");p.mnemonic=O.mnemonic}catch(k){if(k.code!==er.errors.INVALID_ARGUMENT||k.argument!=="wordlist")throw k}}return new nR(p)}function rY(t,e,r,a,i){return Ct(N0(t,e,r,a,i))}function M6e(t,e,r,a,i){return Promise.resolve(rY(t,e,r,a,i))}function iY(t,e,r,a,i){let h=eg(e),c=on(t,"crypto/kdf");if(c&&typeof c=="string"){let p=function(b,g){return iR.throwArgumentError("invalid key-derivation function parameters",b,g)};if(c.toLowerCase()==="scrypt"){let b=Rh(on(t,"crypto/kdfparams/salt")),g=parseInt(on(t,"crypto/kdfparams/n")),y=parseInt(on(t,"crypto/kdfparams/r")),M=parseInt(on(t,"crypto/kdfparams/p"));(!g||!y||!M)&&p("kdf",c),g&g-1&&p("N",g);let x=parseInt(on(t,"crypto/kdfparams/dklen"));return x!==32&&p("dklen",x),a(h,b,g,y,M,64,i)}else if(c.toLowerCase()==="pbkdf2"){let b=Rh(on(t,"crypto/kdfparams/salt")),g=null,y=on(t,"crypto/kdfparams/prf");y==="hmac-sha256"?g="sha256":y==="hmac-sha512"?g="sha512":p("prf",y);let M=parseInt(on(t,"crypto/kdfparams/c")),x=parseInt(on(t,"crypto/kdfparams/dklen"));return x!==32&&p("dklen",x),r(h,b,M,x,g)}}return iR.throwArgumentError("unsupported key-derivation function","kdf",c)}function nY(t,e){let r=JSON.parse(t),a=iY(r,e,rY,Z3.default.syncScrypt);return tY(r,a)}function aY(t,e,r){return w6e(this,void 0,void 0,function*(){let a=JSON.parse(t),i=yield iY(a,e,M6e,Z3.default.scrypt,r);return tY(a,i)})}function aR(t,e,r,a){try{if(Aa(t.address)!==Ms(t.privateKey))throw new Error("address/privateKey mismatch");if(eY(t)){let O=t.mnemonic;if(Qc.fromMnemonic(O.phrase,null,O.locale).derivePath(O.path||C0).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(O){return Promise.reject(O)}typeof r=="function"&&!a&&(a=r,r={}),r||(r={});let i=Ct(t.privateKey),h=eg(e),c=null,p=null,b=null;if(eY(t)){let O=t.mnemonic;c=Ct(WA(O.phrase,O.locale||"en")),p=O.path||C0,b=O.locale||"en"}let g=r.client;g||(g="ethers.js");let y=null;r.salt?y=Ct(r.salt):y=el(32);let M=null;if(r.iv){if(M=Ct(r.iv),M.length!==16)throw new Error("invalid iv")}else M=el(16);let x=null;if(r.uuid){if(x=Ct(r.uuid),x.length!==16)throw new Error("invalid uuid")}else x=el(16);let E=1<<17,A=8,k=1;return r.scrypt&&(r.scrypt.N&&(E=r.scrypt.N),r.scrypt.r&&(A=r.scrypt.r),r.scrypt.p&&(k=r.scrypt.p)),Z3.default.scrypt(h,y,E,A,k,64,a).then(O=>{O=Ct(O);let N=O.slice(0,16),L=O.slice(16,32),C=O.slice(32,64),Y=new Th.default.Counter(M),G=new Th.default.ModeOfOperation.ctr(N,Y),ee=Ct(G.encrypt(i)),$=rn(Ao([L,ee])),q={address:t.address.substring(2).toLowerCase(),id:JG(x),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:sr(M).substring(2)},ciphertext:sr(ee).substring(2),kdf:"scrypt",kdfparams:{salt:sr(y).substring(2),n:E,dklen:32,p:k,r:A},mac:$.substring(2)}};if(c){let V=el(16),_=new Th.default.Counter(V),n=new Th.default.ModeOfOperation.ctr(C,_),s=Ct(n.encrypt(c)),f=new Date,u=f.getUTCFullYear()+"-"+Qp(f.getUTCMonth()+1,2)+"-"+Qp(f.getUTCDate(),2)+"T"+Qp(f.getUTCHours(),2)+"-"+Qp(f.getUTCMinutes(),2)+"-"+Qp(f.getUTCSeconds(),2)+".0Z";q["x-ethers"]={client:g,gethFilename:"UTC--"+u+"--"+q.address,mnemonicCounter:sr(V).substring(2),mnemonicCiphertext:sr(s).substring(2),path:p,locale:b,version:"0.1"}}return JSON.stringify(q)})}function oY(t,e,r){if(eR(t)){r&&r(0);let a=QA(t,e);return r&&r(1),Promise.resolve(a)}return tR(t)?aY(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function sY(t,e){if(eR(t))return QA(t,e);if(tR(t))return nY(t,e);throw new Error("invalid JSON wallet")}ie();ae();ne();var fY="wallet/5.7.0";var uY=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(c){c(h)})}return new(r||(r=Promise))(function(h,c){function p(y){try{g(a.next(y))}catch(M){c(M)}}function b(y){try{g(a.throw(y))}catch(M){c(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},e1=new er(fY);function x6e(t){return t!=null&&Dn(t.privateKey,32)&&t.address!=null}function S6e(t){let e=t.mnemonic;return e&&e.phrase}var t1=class t extends $3{constructor(e,r){if(super(),x6e(e)){let a=new Eu(e.privateKey);if(ur(this,"_signingKey",()=>a),ur(this,"address",Ms(this.publicKey)),this.address!==Aa(e.address)&&e1.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),S6e(e)){let i=e.mnemonic;ur(this,"_mnemonic",()=>({phrase:i.phrase,path:i.path||C0,locale:i.locale||"en"}));let h=this.mnemonic,c=Qc.fromMnemonic(h.phrase,null,h.locale).derivePath(h.path);Ms(c.privateKey)!==this.address&&e1.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else ur(this,"_mnemonic",()=>null)}else{if(Eu.isSigningKey(e))e.curve!=="secp256k1"&&e1.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),ur(this,"_signingKey",()=>e);else{typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e="0x"+e);let a=new Eu(e);ur(this,"_signingKey",()=>a)}ur(this,"_mnemonic",()=>null),ur(this,"address",Ms(this.publicKey))}r&&!L3.isProvider(r)&&e1.throwArgumentError("invalid provider","provider",r),ur(this,"provider",r||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new t(this,e)}signTransaction(e){return xh(e).then(r=>{r.from!=null&&(Aa(r.from)!==this.address&&e1.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);let a=this._signingKey().signDigest(rn(FA(r)));return FA(r,a)})}signMessage(e){return uY(this,void 0,void 0,function*(){return pA(this._signingKey().signDigest(Vc(e)))})}_signTypedData(e,r,a){return uY(this,void 0,void 0,function*(){let i=yield k0.resolveNames(e,r,a,h=>(this.provider==null&&e1.throwError("cannot resolve ENS names without a provider",er.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:h}),this.provider.resolveName(h)));return pA(this._signingKey().signDigest(k0.hash(i.domain,r,i.value)))})}encrypt(e,r,a){if(typeof r=="function"&&!a&&(a=r,r={}),a&&typeof a!="function")throw new Error("invalid callback");return r||(r={}),aR(this,e,r,a)}static createRandom(e){let r=el(16);e||(e={}),e.extraEntropy&&(r=Ct(_h(rn(Ao([r,e.extraEntropy])),0,16)));let a=Qm(r,e.locale);return t.fromMnemonic(a,e.path,e.locale)}static fromEncryptedJson(e,r,a){return oY(e,r,a).then(i=>new t(i))}static fromEncryptedJsonSync(e,r){return new t(sY(e,r))}static fromMnemonic(e,r,a){return r||(r=C0),new t(Qc.fromMnemonic(e,null,a).derivePath(r))}};function hY(t,e){return qA(Vc(t),e)}function H3(t,e,r,a){return qA(k0.hash(t,e,r),a)}var oR=class{signer;publicKey;ownerLength=Wr[wr.ETHEREUM].pubLength;signatureLength=Wr[wr.ETHEREUM].sigLength;signatureType=wr.ETHEREUM;constructor(e){this.signer=e.getSigner()}async setPublicKey(){let e="sign this message to connect to Bundlr.Network",r=await this.signer.signMessage(e),a=await Vc(e),i=C3(Ct(a),r);this.publicKey=Me.from(Ct(i))}async sign(e){this.publicKey||await this.setPublicKey();let r=await this.signer.signMessage(e);return Me.from(r.slice(2),"hex")}static verify(e,r,a){let i=Ms(e);return hY(r,a)===i}};ie();ae();ne();var r1=gi(mY(),1),kh=class extends xo{get publicKey(){return r1.default.decode(this.pk)}get key(){return r1.default.decode(this._key)}constructor(e){let r=r1.default.decode(e);super(r1.default.encode(r.subarray(0,32)),r1.default.encode(r.subarray(32,64)))}};ie();ae();ne();ie();ae();ne();ie();ae();ne();var CX=gi(Do(),1),eT=gi(ER(),1);ie();ae();ne();co();var TX=gi(RX(),1);function QR(t){return t=kX(t),(0,TX.default)("keccak256").update(t).digest()}function kX(t){if(!Me.isBuffer(t))if(Array.isArray(t))t=Me.from(t);else if(typeof t=="string")IX(t)?t=Me.from(x8(BX(t)),"hex"):t=Me.from(t);else if(typeof t=="number")t=PX(t);else if(typeof t=="bigint")t=F4e(t);else if(t==null)t=Me.allocUnsafe(0);else throw new Error("invalid type");return t}function IX(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}function x8(t){if(typeof t!="string")throw new Error(`while padding to even, value must be string, is currently ${typeof t}, while padToEven.`);return t.length%2&&(t=`0${t}`),t}function BX(t){return typeof t!="string"?t:OX(t)?t.slice(2):t}function OX(t){if(typeof t!="string")throw new Error("value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return t.startsWith("0x")}function PX(t){let e=NX(t);return Me.from(x8(e.slice(2)),"hex")}function NX(t){return`0x${t.toString(16)}`}function F4e(t){let e=t.toString(16);return Me.from(x8(e),"hex")}typeof window<"u"&&(window.keccak256=QR);var lg=QR,j4e={intToBuffer:PX,intToHex:NX,isHexPrefixed:OX,stripHexPrefix:BX,padToEven:x8,isHexString:IX,toBuffer:kX};var Y0=class{_key;ownerLength=Wr[wr.ETHEREUM].pubLength;signatureLength=Wr[wr.ETHEREUM].sigLength;signatureType=wr.ETHEREUM;pk;constructor(e,r){this._key=e,this.pk=r.toString("hex")}get publicKey(){throw new Error("You must implement `publicKey`")}get key(){return Me.from(this._key,"hex")}static async verify(e,r,a){let i=e;typeof e=="string"&&(i=CX.default.toBuffer(e));let h=!1;try{h=eT.default.ecdsaVerify(a,lg(Me.from(r)),i)}catch{}return h}async sign(e){return eT.default.ecdsaSign(lg(Me.from(e)),Me.from(this.key)).signature}};var tT=gi(ER(),1),LX=gi(Do(),1);var Io=class extends Y0{get publicKey(){return Me.from(this.pk,"hex")}constructor(e){e.startsWith("0x")&&(e=e.slice(2));let r=Me.from(e,"hex"),a=tT.default.publicKeyCreate(r,!1);super(e,Me.from(a))}async sign(e){return new t1(this._key).signMessage(e).then(a=>Me.from(a.slice(2),"hex"))}static async verify(e,r,a){return tT.default.ecdsaVerify(a.length===65?a.slice(0,-1):a,Ct(Vc(r)),typeof e=="string"?LX.default.toBuffer(e):e)}};var dg=class extends Io{};ie();ae();ne();var pg=class extends kh{constructor(e){super(e.replace("ed25519:",""))}};ie();ae();ne();var vg=class extends xo{get publicKey(){return Me.from(this.pk)}get key(){return Me.from(this._key)}constructor(e,r){super(e.subarray(0,32),r)}};ie();ae();ne();var J0=class extends A0{signatureType=4;constructor(e){super(e)}async sign(e){return super.sign(Me.from(Me.from(e).toString("hex")))}static async verify(e,r,a){return super.verify(e,Me.from(Me.from(r).toString("hex")),a)}};ie();ae();ne();var mg=class extends kh{signatureType=4;constructor(e){super(e)}async sign(e){return super.sign(Me.from(Me.from(e).toString("hex")))}static async verify(e,r,a){return super.verify(e,Me.from(Me.from(r).toString("hex")),a)}};ie();ae();ne();var gg=class extends xo{constructor(e,r){super(e,r)}get publicKey(){return Me.from(this.pk.slice(2),"hex")}get key(){return Me.from(this._key.slice(2),"hex")}};ie();ae();ne();var X0=class{_publicKey;ownerLength=Wr[wr.INJECTEDAPTOS].pubLength;signatureLength=Wr[wr.INJECTEDAPTOS].sigLength;signatureType=wr.INJECTEDAPTOS;pem;provider;constructor(e,r){this.provider=e,this._publicKey=r}get publicKey(){return this._publicKey}async sign(e){if(!this.provider.signMessage)throw new Error("Selected Wallet does not support message signing");let a=(await this.provider.signMessage({message:Me.from(e).toString("hex"),nonce:"bundlr"})).signature;return typeof a=="string"?Me.from(a,"hex"):a.data.toUint8Array()}static async verify(e,r,a){let i=e;return Uc(Me.from(a),Me.from(`APTOS
131
131
  message: ${Me.from(r).toString("hex")}
132
- nonce: bundlr`),Me.from(i))}};ie();ae();ne();var Q0=class{_publicKey;ownerLength=Wr[wr.MULTIAPTOS].pubLength;signatureLength=Wr[wr.MULTIAPTOS].sigLength;signatureType=wr.MULTIAPTOS;collectSignatures;provider;constructor(e,r){this._publicKey=e,this.collectSignatures=r}get publicKey(){return this._publicKey}async sign(e){let{signatures:r,bitmap:a}=await this.collectSignatures(e),i=128,h=new Uint8Array([0,0,0,0]),c=new Set;a.forEach(g=>{if(g>=32)throw new Error(`Invalid bit value ${g}.`);if(c.has(g))throw new Error("Duplicated bits detected.");c.add(g);let y=Math.floor(g/8),M=h[y];M|=i>>g%8,h[y]=M});let p=Me.alloc(this.signatureLength),b=0;for(let g=0;g<32;g++)a.includes(g)&&p.set(r[b++],g*64);return p.set(h,this.signatureLength-4),p}static async verify(e,r,a){let h=Wr[wr.MULTIAPTOS].sigLength-4,c=a.slice(0,h),p=a.slice(h),b=!1;for(let g=0;g<32;g++){let y=Math.floor(g/8),M=g-y*8;if((p[y]&128>>M)!==0){let E=c.slice(g*64,(g+1)*64),A=e.slice(g*32,(g+1)*32);await Uc(Me.from(E),Me.from(r),Me.from(A))||(b=!0)}}return!b}};ie();ae();ne();var ed=class extends Io{ownerLength=Wr[wr.TYPEDETHEREUM].pubLength;signatureLength=Wr[wr.TYPEDETHEREUM].sigLength;signatureType=wr.TYPEDETHEREUM;address;signer;constructor(e){super(e),this.address="0x"+lg(super.publicKey.slice(1)).slice(-20).toString("hex"),this.signer=new t1(e)}get publicKey(){return Me.from(this.address)}async sign(e){let r=await this.signer._signTypedData(bg,yg,{address:this.address,"Transaction hash":e});return Me.from(r.slice(2),"hex")}static async verify(e,r,a){let i=e.toString(),h=H3(bg,yg,{address:i,"Transaction hash":r},a);return i.toLowerCase()===h.toLowerCase()}},bg={name:"Bundlr",version:"1"},yg={Bundlr:[{name:"Transaction hash",type:"bytes"},{name:"address",type:"address"}]};ie();ae();ne();var rT=class{ownerLength=Wr[wr.TYPEDETHEREUM].pubLength;signatureLength=Wr[wr.TYPEDETHEREUM].sigLength;signatureType=wr.TYPEDETHEREUM;address;signer;publicKey;constructor(e){this.signer=e.getSigner()}async ready(){this.address=(await this.signer.getAddress()).toString().toLowerCase(),this.publicKey=Me.from(this.address)}async sign(e){let r=await this.signer._signTypedData(bg,yg,{address:this.address,"Transaction hash":e});return Me.from(r.slice(2),"hex")}static verify(e,r,a){let i=e.toString(),h=H3(bg,yg,{address:i,"Transaction hash":r},a);return i.toLowerCase()===h.toLowerCase()}};ie();ae();ne();var $X=gi(Do(),1);var p1=class{signer;publicKey;ownerLength=Wr[wr.ARWEAVE].pubLength;signatureLength=Wr[wr.ARWEAVE].sigLength;signatureType=wr.ARWEAVE;constructor(e){this.signer=e}async setPublicKey(){let e=await this.signer.getActivePublicKey();this.publicKey=$X.default.toBuffer(e)}async sign(e){this.publicKey||await this.setPublicKey();let r={name:"RSA-PSS",saltLength:32},a=await this.signer.signature(e,r);return new Uint8Array(Object.values(a).map(h=>+h))}static async verify(e,r,a){return await xn().verify(e,r,a)}};ie();ae();ne();var wg=class extends Io{signatureType=wr.KYVE};var _g={1:Hc,2:xo,3:Io,4:J0,5:X0,6:Q0,7:ed};ie();ae();ne();ie();ae();ne();async function z4e(t){return qc([(0,Oi.stringToBuffer)("dataitem"),(0,Oi.stringToBuffer)("1"),(0,Oi.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}var Mg=z4e;ie();ae();ne();ie();ae();ne();function xg(t,e){let r=new Uint8Array(t);if(e<0)throw new Error("Array is unsigned, cannot represent -ve numbers");if(e>2**(t*8)-1)throw new Error(`Number ${e} is too large for an array of ${t} bytes`);for(let a=0;a<r.length;a++){let i=e&255;r[a]=i,e=(e-i)/256}return r}function S8(t){return xg(8,t)}function iT(t){return xg(2,t)}function Z4e(t){return xg(16,t)}function E8(t){return xg(32,t)}function yn(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}ie();ae();ne();var Eg=gi(Do(),1);ie();ae();ne();var ks=gi(Do(),1);co();ie();ae();ne();var Sg=class{buf;pos;constructor(e=Me.alloc(A8),r=0){this.buf=e,this.pos=r}writeTags(e){if(!Array.isArray(e))throw new Error("input must be array");let r=e.length,a;if(r)for(this.writeLong(r),a=0;a<r;a++){let i=e[a];if(typeof i?.name!="string"||typeof i?.value!="string")throw new Error(`Invalid tag format for ${i}, expected {name:string, value: string}`);this.writeString(i.name),this.writeString(i.value)}this.writeLong(0)}toBuffer(){let e=Me.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(e,0,0,this.pos),e}writeLong(e){let r=this.buf,a,i;if(e>=-1073741824&&e<1073741824){i=e>=0?e<<1:~e<<1|1;do r[this.pos]=i&127,i>>=7;while(i&&(r[this.pos++]|=128))}else{a=e>=0?e*2:-e*2-1;do r[this.pos]=a&127,a/=128;while(a>=1&&(r[this.pos++]|=128))}this.pos++,this.buf=r}writeString(e){let r=Me.byteLength(e),a=this.buf;this.writeLong(r);let i=this.pos;if(this.pos+=r,!(this.pos>a.length)){if(r>64)this.buf.write(e,this.pos-r,r,"utf8");else{let h,c,p,b;for(h=0,c=r;h<c;h++)p=e.charCodeAt(h),p<128?a[i++]=p:p<2048?(a[i++]=p>>6|192,a[i++]=p&63|128):(p&64512)===55296&&((b=e.charCodeAt(h+1))&64512)===56320?(p=65536+((p&1023)<<10)+(b&1023),h++,a[i++]=p>>18|240,a[i++]=p>>12&63|128,a[i++]=p>>6&63|128,a[i++]=p&63|128):(a[i++]=p>>12|224,a[i++]=p>>6&63|128,a[i++]=p&63|128)}this.buf=a}}readLong(){let e=0,r=0,a=this.buf,i,h,c,p;do i=a[this.pos++],h=i&128,e|=(i&127)<<r,r+=7;while(h&&r<28);if(h){c=e,p=268435456;do i=a[this.pos++],c+=(i&127)*p,p*=128;while(i&128);return(c%2?-(c+1):c)/2}return e>>1^-(e&1)}skipLong(){let e=this.buf;for(;e[this.pos++]&128;);}readTags(){let e=[],r;for(;r=this.readLong();)for(r<0&&(r=-r,this.skipLong());r--;){let a=this.readString(),i=this.readString();e.push({name:a,value:i})}return e}readString(){let e=this.readLong(),r=this.pos,a=this.buf;if(this.pos+=e,this.pos>a.length)throw new Error("TAP Position out of range");return this.buf.slice(r,r+e).toString()}};function nT(t){if(t?.length===0)return Me.allocUnsafe(0);let e=new Sg;return e.writeTags(t),e.toBuffer()}function v1(t){return new Sg(t).readTags()}lu();var T8=80,A8=4096,R8=class t{binary;_id;constructor(e){this.binary=e}static isDataItem(e){return e.binary!==void 0}get signatureType(){let e=yn(this.binary.subarray(0,2));if(wr?.[e]!==void 0)return e;throw new Error("Unknown signature type: "+e)}async isValid(){return t.verify(this.binary)}get id(){return ks.default.encode(this.rawId)}set id(e){this._id=ks.default.toBuffer(e)}get rawId(){return df("sha256").update(this.rawSignature).digest()}set rawId(e){this._id=e}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return ks.default.encode(this.rawSignature)}set rawOwner(e){if(e.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${e.byteLength} bytes.`);this.binary.set(e,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return Wr[this.signatureType].sigLength}get owner(){return ks.default.encode(this.rawOwner)}get ownerLength(){return Wr[this.signatureType].pubLength}get rawTarget(){let e=this.getTargetStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Me.alloc(0)}get target(){return ks.default.encode(this.rawTarget)}get rawAnchor(){let e=this.getAnchorStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Me.alloc(0)}get anchor(){return ks.default.encode(this.rawAnchor)}get rawTags(){let e=this.getTagsStart(),r=yn(this.binary.subarray(e+8,e+16));return this.binary.subarray(e+16,e+16+r)}get tags(){let e=this.getTagsStart();if(yn(this.binary.subarray(e,e+8))==0)return[];let a=yn(this.binary.subarray(e+8,e+16));return v1(Me.from(this.binary.subarray(e+16,e+16+a)))}get tagsB64Url(){return this.tags.map(r=>({name:ks.default.encode(r.name),value:ks.default.encode(r.value)}))}getStartOfData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),a=yn(r);return e+16+a}get rawData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),a=yn(r),i=e+16+a;return this.binary.subarray(i,this.binary.length)}get data(){return ks.default.encode(this.rawData)}getRaw(){return this.binary}async sign(e){return this._id=await k8(this,e),this.rawId}async setSignature(e){this.binary.set(e,2),this._id=Me.from(await xn().hash(e))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(e=>({name:ks.default.encode(e.name),value:ks.default.encode(e.value)})),data:this.data}}static async verify(e){if(e.byteLength<T8)return!1;let r=new t(e),a=r.signatureType,i=r.getTagsStart(),h=yn(e.subarray(i,i+8)),c=e.subarray(i+8,i+16),p=yn(c);if(p>A8)return!1;if(h>0)try{if(v1(Me.from(e.subarray(i+16,i+16+p))).length!==h)return!1}catch{return!1}let b=_g[a],g=await Mg(r);return await b.verify(r.rawOwner,g,r.rawSignature)}async getSignatureData(){return Mg(this)}getTagsStart(){let e=this.getTargetStart(),r=this.binary[e]==1,a=e+(r?33:1),i=this.binary[a]==1;return a+=i?33:1,a}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let e=this.getTargetStart()+1,r=this.binary[this.getTargetStart()]==1;return e+=r?32:0,e}},m1=R8;lu();var Iu=32,I8=class{length;items;binary;constructor(e){this.binary=e,this.length=this.getDataItemCount(),this.items=this.getItems()}getRaw(){return this.binary}get(e){if(typeof e=="number"){if(e>=this.length)throw new RangeError("Index out of range");return this.getByIndex(e)}else return this.getById(e)}getSizes(){let e=[];for(let r=Iu;r<Iu+64*this.length;r+=64)e.push(yn(this.binary.subarray(r,r+32)));return e}getIds(){let e=[];for(let r=Iu;r<Iu+64*this.length;r+=64){let a=this.binary.subarray(r+32,r+64);if(a.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");e.push(Eg.default.encode(a))}return e}getIdBy(e){if(e>this.length-1)throw new RangeError("Index of bundle out of range");let r=64+64*e;return Eg.default.encode(this.binary.subarray(r,r+32))}async toTransaction(e,r,a){let i=await r.createTransaction({data:this.binary,...e},a);return i.addTag("Bundle-Format","binary"),i.addTag("Bundle-Version","2.0.0"),i}async verify(){for(let e of this.items){let r=await e.isValid(),a=(0,Eg.default)(df("sha256").update(e.rawSignature).digest());if(!(r&&e.id===a))return!1}return!0}getOffset(e){let r=0;for(let a=Iu;a<Iu+64*this.length;a+=64){let i=yn(this.binary.subarray(a,a+32));r+=i;let h=this.binary.subarray(a+32,a+64);if(Me.compare(h,e)===0)return{startOffset:r,size:i}}return{startOffset:-1,size:-1}}getByIndex(e){let r=0,a=this.getBundleStart(),i=0,h,c;for(let y=Iu;y<Iu+64*this.length;y+=64){if(h=yn(this.binary.subarray(y,y+32)),i++===e){c=this.binary.subarray(y+32,y+64);break}r+=h}let p=a+r,b=this.binary.subarray(p,p+h),g=new m1(b);return g.rawId=c,g}getById(e){let r=Eg.default.toBuffer(e),a=this.getOffset(r);if(a.startOffset===-1)throw new Error("Transaction not found");let h=this.getBundleStart()+a.startOffset;return new m1(this.binary.subarray(h,h+a.size))}getDataItemCount(){return yn(this.binary.subarray(0,32))}getBundleStart(){return 32+64*this.length}getItems(){let e=new Array(this.length),r=0,a=this.getBundleStart(),i=0;for(let h=Iu;h<Iu+64*this.length;h+=64){let c=yn(this.binary.subarray(h,h+32)),p=this.binary.subarray(h+32,h+64);if(p.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");let b=a+r,g=this.binary.subarray(b,b+c);r+=c;let y=new m1(g);y.rawId=p,e[i]=y,i++}return e}},aT=I8;function H4e(t){return new aT(t)}async function K4e(t,e){let r=new Uint8Array(64*t.length),a=await Promise.all(t.map(async(h,c)=>{let p=h.isSigned()?h.rawId:await k8(h,e),b=new Uint8Array(64);return b.set(E8(h.getRaw().byteLength),0),b.set(p,32),r.set(b,64*c),h.getRaw()})).then(h=>Me.concat(h)),i=Me.concat([Me.from(E8(t.length)),Me.from(r),a]);return new aT(i)}async function DX(t,e){let r=await Mg(t),a=await e.sign(r),i=await xn().hash(a);return{signature:Me.from(a),id:Me.from(i)}}async function k8(t,e){let{signature:r,id:a}=await DX(t,e);return t.getRaw().set(r,2),a}ie();ae();ne();var UX=gi(Do(),1);function Ag(t,e,r){let a=e.publicKey,i=r?.target?UX.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),c=r?.anchor?Me.from(r.anchor):null,p=1+(c?.byteLength??0),b=(r?.tags?.length??0)>0?nT(r?.tags):null,g=16+(b?b.byteLength:0),y=typeof t=="string"?Me.from(t):Me.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+p+g+M,E=Me.alloc(x);if(E.set(iT(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),a.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${a.byteLength}`);E.set(a,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let k=A+h,O=k+1;if(E[k]=c?1:0,c){if(O+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(c,k+1)}E.set(S8(r?.tags?.length??0),O);let N=S8(b?.byteLength??0);E.set(N,O+8),b&&E.set(b,O+16);let L=O+g;return E.set(y,L),new m1(E)}ie();ae();ne();ie();ae();ne();var oT=class{signatureType;rawSignature;signature;signatureLength;rawOwner;owner;ownerLength;rawTarget;target;rawAnchor;anchor;rawTags;tags;rawData;data;static async verify(...e){throw new Error("You must implement `verify`")}};ie();ae();ne();ie();ae();ne();var hT={};Ha(hT,{default:()=>G4e,processStream:()=>ZX,streamExportForTesting:()=>Y4e,streamSigner:()=>V4e});ie();ae();ne();B8();var td=gi(Do(),1);lu();async function ZX(t){let e=HX(t),r=(await e.next()).value;r=await La(e,r,32);let a=yn(r.subarray(0,32));r=r.subarray(32);let i=64*a;r=await La(e,r,i);let h=new Array(a);for(let b=0;b<i;b+=64)h[b/64]=[yn(r.subarray(b,b+32)),(0,td.default)(Me.from(r.subarray(b+32,b+64)))];r=r.subarray(i);let c=32+i,p=[];for(let[b,g]of h){r=await La(e,r,T8),r=await La(e,r,2);let y=yn(r.subarray(0,2));r=r.subarray(2);let{sigLength:M,pubLength:x,sigName:E}=Wr[y];r=await La(e,r,M);let A=r.subarray(0,M);r=r.subarray(M),r=await La(e,r,x);let k=r.subarray(0,x);r=r.subarray(x),r=await La(e,r,1);let O=r[0]===1;O&&(r=await La(e,r,33));let N=O?r.subarray(1,33):Me.allocUnsafe(0);r=r.subarray(O?33:1),r=await La(e,r,1);let L=r[0]===1;L&&(r=await La(e,r,33));let C=L?r.subarray(1,33):Me.allocUnsafe(0);r=r.subarray(L?33:1),r=await La(e,r,8);let Y=yn(r.subarray(0,8));r=r.subarray(8),r=await La(e,r,8);let G=yn(r.subarray(0,8));r=r.subarray(8),r=await La(e,r,G);let ee=r.subarray(0,G),$=Y!==0&&G!==0?v1(Me.from(ee)):[];if($.length!==Y)throw new Error("Tags lengths don't match");r=r.subarray(G);let q=new jX;q._transform=function(f,u,l){this.push(f),l()};let V=qc([(0,Oi.stringToBuffer)("dataitem"),(0,Oi.stringToBuffer)("1"),(0,Oi.stringToBuffer)(y.toString()),k,N,C,ee,q]),_=2+M+x+(O?33:1)+(L?33:1)+16+G,n=b-_;if(r.byteLength>n)q.write(r.subarray(0,n)),r=r.subarray(n);else{let f=r.byteLength;for(q.write(r);n>f;){if(r=(await e.next()).value,!r)throw new Error(`Not enough data bytes expected: ${n} received: ${f}`);f+=r.byteLength,f>n?q.write(r.subarray(0,r.byteLength-(f-n))):q.write(r)}r=r.subarray(r.byteLength-(f-n))}if(q.end(),g!==(0,td.default)(df("sha256").update(A).digest()))throw new Error("ID doesn't match signature");if(!await _g[y].verify(k,await V,A))throw new Error("Invalid signature");p.push({id:g,sigName:E,signature:(0,td.default)(Me.from(A)),target:(0,td.default)(Me.from(N)),anchor:(0,td.default)(Me.from(C)),owner:(0,td.default)(Me.from(k)),tags:$,dataOffset:c+_,dataSize:n}),c+=_+n}return p}async function V4e(t,e,r,a){let i=Ag("",r,a),h=new zX,c=[(0,Oi.stringToBuffer)("dataitem"),(0,Oi.stringToBuffer)("1"),(0,Oi.stringToBuffer)(i.signatureType.toString()),i.rawOwner,i.rawTarget,i.rawAnchor,i.rawTags,t],p=await qc(c),b=Me.from(await r.sign(p));return i.setSignature(b),h.write(i.getRaw()),e.pipe(h)}async function La(t,e,r){if(e.byteLength>=r)return e;let{done:a,value:i}=await t.next();if(a&&!i)throw new Error("Invalid buffer");return La(t,Me.concat([Me.from(e),Me.from(i)]),r)}async function*HX(t){for await(let e of t)yield e}var G4e=ZX,Y4e={readBytes:La,getReader:HX};var J4e={...sT,stream:hT};globalThis.arbundles??=J4e;ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var fi;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let h={};for(let c of i)h[c]=c;return h},t.getValidEnumValues=i=>{let h=t.objectKeys(i).filter(p=>typeof i[i[p]]!="number"),c={};for(let p of h)c[p]=i[p];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(h){return i[h]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let h=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&h.push(c);return h},t.find=(i,h)=>{for(let c of i)if(h(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function a(i,h=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(h)}t.joinValues=a,t.jsonStringifyReplacer=(i,h)=>typeof h=="bigint"?h.toString():h})(fi||(fi={}));var lT;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(lT||(lT={}));var Yt=fi.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cl=t=>{switch(typeof t){case"undefined":return Yt.undefined;case"string":return Yt.string;case"number":return isNaN(t)?Yt.nan:Yt.number;case"boolean":return Yt.boolean;case"function":return Yt.function;case"bigint":return Yt.bigint;case"symbol":return Yt.symbol;case"object":return Array.isArray(t)?Yt.array:t===null?Yt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Yt.promise:typeof Map<"u"&&t instanceof Map?Yt.map:typeof Set<"u"&&t instanceof Set?Yt.set:typeof Date<"u"&&t instanceof Date?Yt.date:Yt.object;default:return Yt.unknown}},Ot=fi.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),X4e=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Bo=class t extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(h){return h.message},a={_errors:[]},i=h=>{for(let c of h.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)a._errors.push(r(c));else{let p=a,b=0;for(;b<c.path.length;){let g=c.path[b];b===c.path.length-1?(p[g]=p[g]||{_errors:[]},p[g]._errors.push(r(c))):p[g]=p[g]||{_errors:[]},p=p[g],b++}}};return i(this),a}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,fi.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},a=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):a.push(e(i));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}};Bo.create=t=>new Bo(t);var y1=(t,e)=>{let r;switch(t.code){case Ot.invalid_type:t.received===Yt.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Ot.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,fi.jsonStringifyReplacer)}`;break;case Ot.unrecognized_keys:r=`Unrecognized key(s) in object: ${fi.joinValues(t.keys,", ")}`;break;case Ot.invalid_union:r="Invalid input";break;case Ot.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${fi.joinValues(t.options)}`;break;case Ot.invalid_enum_value:r=`Invalid enum value. Expected ${fi.joinValues(t.options)}, received '${t.received}'`;break;case Ot.invalid_arguments:r="Invalid function arguments";break;case Ot.invalid_return_type:r="Invalid function return type";break;case Ot.invalid_date:r="Invalid date";break;case Ot.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:fi.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Ot.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Ot.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Ot.custom:r="Invalid input";break;case Ot.invalid_intersection_types:r="Intersection results could not be merged";break;case Ot.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Ot.not_finite:r="Number must be finite";break;default:r=e.defaultError,fi.assertNever(t)}return{message:r}},VX=y1;function Q4e(t){VX=t}function O8(){return VX}var P8=t=>{let{data:e,path:r,errorMaps:a,issueData:i}=t,h=[...r,...i.path||[]],c={...i,path:h};if(i.message!==void 0)return{...i,path:h,message:i.message};let p="",b=a.filter(g=>!!g).slice().reverse();for(let g of b)p=g(c,{data:e,defaultError:p}).message;return{...i,path:h,message:p}},ewe=[];function Wt(t,e){let r=O8(),a=P8({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===y1?void 0:y1].filter(i=>!!i)});t.common.issues.push(a)}var Ia=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let a=[];for(let i of r){if(i.status==="aborted")return pr;i.status==="dirty"&&e.dirty(),a.push(i.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,r){let a=[];for(let i of r){let h=await i.key,c=await i.value;a.push({key:h,value:c})}return t.mergeObjectSync(e,a)}static mergeObjectSync(e,r){let a={};for(let i of r){let{key:h,value:c}=i;if(h.status==="aborted"||c.status==="aborted")return pr;h.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),h.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(a[h.value]=c.value)}return{status:e.value,value:a}}},pr=Object.freeze({status:"aborted"}),b1=t=>({status:"dirty",value:t}),$a=t=>({status:"valid",value:t}),dT=t=>t.status==="aborted",pT=t=>t.status==="dirty",Ig=t=>t.status==="valid",Bg=t=>typeof Promise<"u"&&t instanceof Promise;function N8(t,e,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(t):a?a.value:e.get(t)}function GX(t,e,r,a,i){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var rr;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(rr||(rr={}));var Tg,kg,Bs=class{constructor(e,r,a,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=a,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},KX=(t,e)=>{if(Ig(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Bo(t.common.issues);return this._error=r,this._error}}};function Br(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:a,description:i}=t;if(e&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,p)=>{var b,g;let{message:y}=t;return c.code==="invalid_enum_value"?{message:y??p.defaultError}:typeof p.data>"u"?{message:(b=y??a)!==null&&b!==void 0?b:p.defaultError}:c.code!=="invalid_type"?{message:p.defaultError}:{message:(g=y??r)!==null&&g!==void 0?g:p.defaultError}},description:i}}var Or=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return cl(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:cl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ia,ctx:{common:e.parent.common,data:e.data,parsedType:cl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Bg(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let a=this.safeParse(e,r);if(a.success)return a.data;throw a.error}safeParse(e,r){var a;let i={common:{issues:[],async:(a=r?.async)!==null&&a!==void 0?a:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cl(e)},h=this._parseSync({data:e,path:i.path,parent:i});return KX(i,h)}async parseAsync(e,r){let a=await this.safeParseAsync(e,r);if(a.success)return a.data;throw a.error}async safeParseAsync(e,r){let a={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cl(e)},i=this._parse({data:e,path:a.path,parent:a}),h=await(Bg(i)?i:Promise.resolve(i));return KX(a,h)}refine(e,r){let a=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,h)=>{let c=e(i),p=()=>h.addIssue({code:Ot.custom,...a(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(b=>b?!0:(p(),!1)):c?!0:(p(),!1)})}refinement(e,r){return this._refinement((a,i)=>e(a)?!0:(i.addIssue(typeof r=="function"?r(a,i):r),!1))}_refinement(e){return new Oo({schema:this,typeName:cr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Is.create(this,this._def)}nullable(){return Ou.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ch.create(this,this._def)}promise(){return pl.create(this,this._def)}or(e){return fd.create([this,e],this._def)}and(e){return ud.create(this,e,this._def)}transform(e){return new Oo({...Br(this._def),schema:this,typeName:cr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new pd({...Br(this._def),innerType:this,defaultValue:r,typeName:cr.ZodDefault})}brand(){return new Og({typeName:cr.ZodBranded,type:this,...Br(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new vd({...Br(this._def),innerType:this,catchValue:r,typeName:cr.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Pg.create(this,e)}readonly(){return md.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},twe=/^c[^\s-]{8,}$/i,rwe=/^[0-9a-z]+$/,iwe=/^[0-9A-HJKMNP-TV-Z]{26}$/,nwe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,awe=/^[a-z0-9_-]{21}$/i,owe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,swe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,fwe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",cT,uwe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,hwe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,cwe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,YX="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",lwe=new RegExp(`^${YX}$`);function JX(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function dwe(t){return new RegExp(`^${JX(t)}$`)}function XX(t){let e=`${YX}T${JX(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function pwe(t,e){return!!((e==="v4"||!e)&&uwe.test(t)||(e==="v6"||!e)&&hwe.test(t))}var ll=class t extends Or{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Yt.string){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_type,expected:Yt.string,received:h.parsedType}),pr}let a=new Ia,i;for(let h of this._def.checks)if(h.kind==="min")e.data.length<h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="max")e.data.length>h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="length"){let c=e.data.length>h.value,p=e.data.length<h.value;(c||p)&&(i=this._getOrReturnCtx(e,i),c?Wt(i,{code:Ot.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):p&&Wt(i,{code:Ot.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),a.dirty())}else if(h.kind==="email")swe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"email",code:Ot.invalid_string,message:h.message}),a.dirty());else if(h.kind==="emoji")cT||(cT=new RegExp(fwe,"u")),cT.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"emoji",code:Ot.invalid_string,message:h.message}),a.dirty());else if(h.kind==="uuid")nwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"uuid",code:Ot.invalid_string,message:h.message}),a.dirty());else if(h.kind==="nanoid")awe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"nanoid",code:Ot.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid")twe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"cuid",code:Ot.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid2")rwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"cuid2",code:Ot.invalid_string,message:h.message}),a.dirty());else if(h.kind==="ulid")iwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"ulid",code:Ot.invalid_string,message:h.message}),a.dirty());else if(h.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Wt(i,{validation:"url",code:Ot.invalid_string,message:h.message}),a.dirty()}else h.kind==="regex"?(h.regex.lastIndex=0,h.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"regex",code:Ot.invalid_string,message:h.message}),a.dirty())):h.kind==="trim"?e.data=e.data.trim():h.kind==="includes"?e.data.includes(h.value,h.position)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),a.dirty()):h.kind==="toLowerCase"?e.data=e.data.toLowerCase():h.kind==="toUpperCase"?e.data=e.data.toUpperCase():h.kind==="startsWith"?e.data.startsWith(h.value)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:{startsWith:h.value},message:h.message}),a.dirty()):h.kind==="endsWith"?e.data.endsWith(h.value)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:{endsWith:h.value},message:h.message}),a.dirty()):h.kind==="datetime"?XX(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:"datetime",message:h.message}),a.dirty()):h.kind==="date"?lwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:"date",message:h.message}),a.dirty()):h.kind==="time"?dwe(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:"time",message:h.message}),a.dirty()):h.kind==="duration"?owe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"duration",code:Ot.invalid_string,message:h.message}),a.dirty()):h.kind==="ip"?pwe(e.data,h.version)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"ip",code:Ot.invalid_string,message:h.message}),a.dirty()):h.kind==="base64"?cwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"base64",code:Ot.invalid_string,message:h.message}),a.dirty()):fi.assertNever(h);return{status:a.value,value:e.data}}_regex(e,r,a){return this.refinement(i=>e.test(i),{validation:r,code:Ot.invalid_string,...rr.errToObj(a)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...rr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...rr.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...rr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...rr.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...rr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...rr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...rr.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...rr.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...rr.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...rr.errToObj(e)})}datetime(e){var r,a;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(a=e?.local)!==null&&a!==void 0?a:!1,...rr.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...rr.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...rr.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...rr.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...rr.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...rr.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...rr.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...rr.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...rr.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...rr.errToObj(r)})}nonempty(e){return this.min(1,rr.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};ll.create=t=>{var e;return new ll({checks:[],typeName:cr.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Br(t)})};function vwe(t,e){let r=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,i=r>a?r:a,h=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return h%c/Math.pow(10,i)}var rd=class t extends Or{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Yt.number){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_type,expected:Yt.number,received:h.parsedType}),pr}let a,i=new Ia;for(let h of this._def.checks)h.kind==="int"?fi.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),Wt(a,{code:Ot.invalid_type,expected:"integer",received:"float",message:h.message}),i.dirty()):h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Ot.too_small,minimum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Ot.too_big,maximum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="multipleOf"?vwe(e.data,h.value)!==0&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Ot.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):h.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),Wt(a,{code:Ot.not_finite,message:h.message}),i.dirty()):fi.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,rr.toString(r))}gt(e,r){return this.setLimit("min",e,!1,rr.toString(r))}lte(e,r){return this.setLimit("max",e,!0,rr.toString(r))}lt(e,r){return this.setLimit("max",e,!1,rr.toString(r))}setLimit(e,r,a,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:rr.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:rr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:rr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:rr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:rr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:rr.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:rr.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:rr.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:rr.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:rr.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&fi.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(r)&&Number.isFinite(e)}};rd.create=t=>new rd({checks:[],typeName:cr.ZodNumber,coerce:t?.coerce||!1,...Br(t)});var id=class t extends Or{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Yt.bigint){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_type,expected:Yt.bigint,received:h.parsedType}),pr}let a,i=new Ia;for(let h of this._def.checks)h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Ot.too_small,type:"bigint",minimum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Ot.too_big,type:"bigint",maximum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="multipleOf"?e.data%h.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Ot.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):fi.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,rr.toString(r))}gt(e,r){return this.setLimit("min",e,!1,rr.toString(r))}lte(e,r){return this.setLimit("max",e,!0,rr.toString(r))}lt(e,r){return this.setLimit("max",e,!1,rr.toString(r))}setLimit(e,r,a,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:rr.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:rr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:rr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:rr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:rr.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:rr.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};id.create=t=>{var e;return new id({checks:[],typeName:cr.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Br(t)})};var nd=class extends Or{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Yt.boolean){let a=this._getOrReturnCtx(e);return Wt(a,{code:Ot.invalid_type,expected:Yt.boolean,received:a.parsedType}),pr}return $a(e.data)}};nd.create=t=>new nd({typeName:cr.ZodBoolean,coerce:t?.coerce||!1,...Br(t)});var ad=class t extends Or{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Yt.date){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_type,expected:Yt.date,received:h.parsedType}),pr}if(isNaN(e.data.getTime())){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_date}),pr}let a=new Ia,i;for(let h of this._def.checks)h.kind==="min"?e.data.getTime()<h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.too_small,message:h.message,inclusive:!0,exact:!1,minimum:h.value,type:"date"}),a.dirty()):h.kind==="max"?e.data.getTime()>h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.too_big,message:h.message,inclusive:!0,exact:!1,maximum:h.value,type:"date"}),a.dirty()):fi.assertNever(h);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:rr.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:rr.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};ad.create=t=>new ad({checks:[],coerce:t?.coerce||!1,typeName:cr.ZodDate,...Br(t)});var w1=class extends Or{_parse(e){if(this._getType(e)!==Yt.symbol){let a=this._getOrReturnCtx(e);return Wt(a,{code:Ot.invalid_type,expected:Yt.symbol,received:a.parsedType}),pr}return $a(e.data)}};w1.create=t=>new w1({typeName:cr.ZodSymbol,...Br(t)});var od=class extends Or{_parse(e){if(this._getType(e)!==Yt.undefined){let a=this._getOrReturnCtx(e);return Wt(a,{code:Ot.invalid_type,expected:Yt.undefined,received:a.parsedType}),pr}return $a(e.data)}};od.create=t=>new od({typeName:cr.ZodUndefined,...Br(t)});var sd=class extends Or{_parse(e){if(this._getType(e)!==Yt.null){let a=this._getOrReturnCtx(e);return Wt(a,{code:Ot.invalid_type,expected:Yt.null,received:a.parsedType}),pr}return $a(e.data)}};sd.create=t=>new sd({typeName:cr.ZodNull,...Br(t)});var dl=class extends Or{constructor(){super(...arguments),this._any=!0}_parse(e){return $a(e.data)}};dl.create=t=>new dl({typeName:cr.ZodAny,...Br(t)});var Nh=class extends Or{constructor(){super(...arguments),this._unknown=!0}_parse(e){return $a(e.data)}};Nh.create=t=>new Nh({typeName:cr.ZodUnknown,...Br(t)});var Rf=class extends Or{_parse(e){let r=this._getOrReturnCtx(e);return Wt(r,{code:Ot.invalid_type,expected:Yt.never,received:r.parsedType}),pr}};Rf.create=t=>new Rf({typeName:cr.ZodNever,...Br(t)});var _1=class extends Or{_parse(e){if(this._getType(e)!==Yt.undefined){let a=this._getOrReturnCtx(e);return Wt(a,{code:Ot.invalid_type,expected:Yt.void,received:a.parsedType}),pr}return $a(e.data)}};_1.create=t=>new _1({typeName:cr.ZodVoid,...Br(t)});var Ch=class t extends Or{_parse(e){let{ctx:r,status:a}=this._processInputParams(e),i=this._def;if(r.parsedType!==Yt.array)return Wt(r,{code:Ot.invalid_type,expected:Yt.array,received:r.parsedType}),pr;if(i.exactLength!==null){let c=r.data.length>i.exactLength.value,p=r.data.length<i.exactLength.value;(c||p)&&(Wt(r,{code:c?Ot.too_big:Ot.too_small,minimum:p?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Wt(r,{code:Ot.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Wt(r,{code:Ot.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((c,p)=>i.type._parseAsync(new Bs(r,c,r.path,p)))).then(c=>Ia.mergeArray(a,c));let h=[...r.data].map((c,p)=>i.type._parseSync(new Bs(r,c,r.path,p)));return Ia.mergeArray(a,h)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:rr.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:rr.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:rr.toString(r)}})}nonempty(e){return this.min(1,e)}};Ch.create=(t,e)=>new Ch({type:t,minLength:null,maxLength:null,exactLength:null,typeName:cr.ZodArray,...Br(e)});function g1(t){if(t instanceof ao){let e={};for(let r in t.shape){let a=t.shape[r];e[r]=Is.create(g1(a))}return new ao({...t._def,shape:()=>e})}else return t instanceof Ch?new Ch({...t._def,type:g1(t.element)}):t instanceof Is?Is.create(g1(t.unwrap())):t instanceof Ou?Ou.create(g1(t.unwrap())):t instanceof Bu?Bu.create(t.items.map(e=>g1(e))):t}var ao=class t extends Or{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=fi.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Yt.object){let g=this._getOrReturnCtx(e);return Wt(g,{code:Ot.invalid_type,expected:Yt.object,received:g.parsedType}),pr}let{status:a,ctx:i}=this._processInputParams(e),{shape:h,keys:c}=this._getCached(),p=[];if(!(this._def.catchall instanceof Rf&&this._def.unknownKeys==="strip"))for(let g in i.data)c.includes(g)||p.push(g);let b=[];for(let g of c){let y=h[g],M=i.data[g];b.push({key:{status:"valid",value:g},value:y._parse(new Bs(i,M,i.path,g)),alwaysSet:g in i.data})}if(this._def.catchall instanceof Rf){let g=this._def.unknownKeys;if(g==="passthrough")for(let y of p)b.push({key:{status:"valid",value:y},value:{status:"valid",value:i.data[y]}});else if(g==="strict")p.length>0&&(Wt(i,{code:Ot.unrecognized_keys,keys:p}),a.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let y of p){let M=i.data[y];b.push({key:{status:"valid",value:y},value:g._parse(new Bs(i,M,i.path,y)),alwaysSet:y in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let g=[];for(let y of b){let M=await y.key,x=await y.value;g.push({key:M,value:x,alwaysSet:y.alwaysSet})}return g}).then(g=>Ia.mergeObjectSync(a,g)):Ia.mergeObjectSync(a,b)}get shape(){return this._def.shape()}strict(e){return rr.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,a)=>{var i,h,c,p;let b=(c=(h=(i=this._def).errorMap)===null||h===void 0?void 0:h.call(i,r,a).message)!==null&&c!==void 0?c:a.defaultError;return r.code==="unrecognized_keys"?{message:(p=rr.errToObj(e).message)!==null&&p!==void 0?p:b}:{message:b}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:cr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return fi.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(r[a]=this.shape[a])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{e[a]||(r[a]=this.shape[a])}),new t({...this._def,shape:()=>r})}deepPartial(){return g1(this)}partial(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{let i=this.shape[a];e&&!e[a]?r[a]=i:r[a]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])r[a]=this.shape[a];else{let h=this.shape[a];for(;h instanceof Is;)h=h._def.innerType;r[a]=h}}),new t({...this._def,shape:()=>r})}keyof(){return QX(fi.objectKeys(this.shape))}};ao.create=(t,e)=>new ao({shape:()=>t,unknownKeys:"strip",catchall:Rf.create(),typeName:cr.ZodObject,...Br(e)});ao.strictCreate=(t,e)=>new ao({shape:()=>t,unknownKeys:"strict",catchall:Rf.create(),typeName:cr.ZodObject,...Br(e)});ao.lazycreate=(t,e)=>new ao({shape:t,unknownKeys:"strip",catchall:Rf.create(),typeName:cr.ZodObject,...Br(e)});var fd=class extends Or{_parse(e){let{ctx:r}=this._processInputParams(e),a=this._def.options;function i(h){for(let p of h)if(p.result.status==="valid")return p.result;for(let p of h)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let c=h.map(p=>new Bo(p.ctx.common.issues));return Wt(r,{code:Ot.invalid_union,unionErrors:c}),pr}if(r.common.async)return Promise.all(a.map(async h=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await h._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(i);{let h,c=[];for(let b of a){let g={...r,common:{...r.common,issues:[]},parent:null},y=b._parseSync({data:r.data,path:r.path,parent:g});if(y.status==="valid")return y;y.status==="dirty"&&!h&&(h={result:y,ctx:g}),g.common.issues.length&&c.push(g.common.issues)}if(h)return r.common.issues.push(...h.ctx.common.issues),h.result;let p=c.map(b=>new Bo(b));return Wt(r,{code:Ot.invalid_union,unionErrors:p}),pr}}get options(){return this._def.options}};fd.create=(t,e)=>new fd({options:t,typeName:cr.ZodUnion,...Br(e)});var Ph=t=>t instanceof hd?Ph(t.schema):t instanceof Oo?Ph(t.innerType()):t instanceof cd?[t.value]:t instanceof ld?t.options:t instanceof dd?fi.objectValues(t.enum):t instanceof pd?Ph(t._def.innerType):t instanceof od?[void 0]:t instanceof sd?[null]:t instanceof Is?[void 0,...Ph(t.unwrap())]:t instanceof Ou?[null,...Ph(t.unwrap())]:t instanceof Og||t instanceof md?Ph(t.unwrap()):t instanceof vd?Ph(t._def.innerType):[],C8=class t extends Or{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.object)return Wt(r,{code:Ot.invalid_type,expected:Yt.object,received:r.parsedType}),pr;let a=this.discriminator,i=r.data[a],h=this.optionsMap.get(i);return h?r.common.async?h._parseAsync({data:r.data,path:r.path,parent:r}):h._parseSync({data:r.data,path:r.path,parent:r}):(Wt(r,{code:Ot.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),pr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,a){let i=new Map;for(let h of r){let c=Ph(h.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let p of c){if(i.has(p))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(p)}`);i.set(p,h)}}return new t({typeName:cr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Br(a)})}};function vT(t,e){let r=cl(t),a=cl(e);if(t===e)return{valid:!0,data:t};if(r===Yt.object&&a===Yt.object){let i=fi.objectKeys(e),h=fi.objectKeys(t).filter(p=>i.indexOf(p)!==-1),c={...t,...e};for(let p of h){let b=vT(t[p],e[p]);if(!b.valid)return{valid:!1};c[p]=b.data}return{valid:!0,data:c}}else if(r===Yt.array&&a===Yt.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let h=0;h<t.length;h++){let c=t[h],p=e[h],b=vT(c,p);if(!b.valid)return{valid:!1};i.push(b.data)}return{valid:!0,data:i}}else return r===Yt.date&&a===Yt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ud=class extends Or{_parse(e){let{status:r,ctx:a}=this._processInputParams(e),i=(h,c)=>{if(dT(h)||dT(c))return pr;let p=vT(h.value,c.value);return p.valid?((pT(h)||pT(c))&&r.dirty(),{status:r.value,value:p.data}):(Wt(a,{code:Ot.invalid_intersection_types}),pr)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([h,c])=>i(h,c)):i(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};ud.create=(t,e,r)=>new ud({left:t,right:e,typeName:cr.ZodIntersection,...Br(r)});var Bu=class t extends Or{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.array)return Wt(a,{code:Ot.invalid_type,expected:Yt.array,received:a.parsedType}),pr;if(a.data.length<this._def.items.length)return Wt(a,{code:Ot.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pr;!this._def.rest&&a.data.length>this._def.items.length&&(Wt(a,{code:Ot.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let h=[...a.data].map((c,p)=>{let b=this._def.items[p]||this._def.rest;return b?b._parse(new Bs(a,c,a.path,p)):null}).filter(c=>!!c);return a.common.async?Promise.all(h).then(c=>Ia.mergeArray(r,c)):Ia.mergeArray(r,h)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Bu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bu({items:t,typeName:cr.ZodTuple,rest:null,...Br(e)})};var L8=class t extends Or{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.object)return Wt(a,{code:Ot.invalid_type,expected:Yt.object,received:a.parsedType}),pr;let i=[],h=this._def.keyType,c=this._def.valueType;for(let p in a.data)i.push({key:h._parse(new Bs(a,p,a.path,p)),value:c._parse(new Bs(a,a.data[p],a.path,p)),alwaysSet:p in a.data});return a.common.async?Ia.mergeObjectAsync(r,i):Ia.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,a){return r instanceof Or?new t({keyType:e,valueType:r,typeName:cr.ZodRecord,...Br(a)}):new t({keyType:ll.create(),valueType:e,typeName:cr.ZodRecord,...Br(r)})}},M1=class extends Or{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.map)return Wt(a,{code:Ot.invalid_type,expected:Yt.map,received:a.parsedType}),pr;let i=this._def.keyType,h=this._def.valueType,c=[...a.data.entries()].map(([p,b],g)=>({key:i._parse(new Bs(a,p,a.path,[g,"key"])),value:h._parse(new Bs(a,b,a.path,[g,"value"]))}));if(a.common.async){let p=new Map;return Promise.resolve().then(async()=>{for(let b of c){let g=await b.key,y=await b.value;if(g.status==="aborted"||y.status==="aborted")return pr;(g.status==="dirty"||y.status==="dirty")&&r.dirty(),p.set(g.value,y.value)}return{status:r.value,value:p}})}else{let p=new Map;for(let b of c){let g=b.key,y=b.value;if(g.status==="aborted"||y.status==="aborted")return pr;(g.status==="dirty"||y.status==="dirty")&&r.dirty(),p.set(g.value,y.value)}return{status:r.value,value:p}}}};M1.create=(t,e,r)=>new M1({valueType:e,keyType:t,typeName:cr.ZodMap,...Br(r)});var x1=class t extends Or{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.set)return Wt(a,{code:Ot.invalid_type,expected:Yt.set,received:a.parsedType}),pr;let i=this._def;i.minSize!==null&&a.data.size<i.minSize.value&&(Wt(a,{code:Ot.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&a.data.size>i.maxSize.value&&(Wt(a,{code:Ot.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let h=this._def.valueType;function c(b){let g=new Set;for(let y of b){if(y.status==="aborted")return pr;y.status==="dirty"&&r.dirty(),g.add(y.value)}return{status:r.value,value:g}}let p=[...a.data.values()].map((b,g)=>h._parse(new Bs(a,b,a.path,g)));return a.common.async?Promise.all(p).then(b=>c(b)):c(p)}min(e,r){return new t({...this._def,minSize:{value:e,message:rr.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:rr.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};x1.create=(t,e)=>new x1({valueType:t,minSize:null,maxSize:null,typeName:cr.ZodSet,...Br(e)});var $8=class t extends Or{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.function)return Wt(r,{code:Ot.invalid_type,expected:Yt.function,received:r.parsedType}),pr;function a(p,b){return P8({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,O8(),y1].filter(g=>!!g),issueData:{code:Ot.invalid_arguments,argumentsError:b}})}function i(p,b){return P8({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,O8(),y1].filter(g=>!!g),issueData:{code:Ot.invalid_return_type,returnTypeError:b}})}let h={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof pl){let p=this;return $a(async function(...b){let g=new Bo([]),y=await p._def.args.parseAsync(b,h).catch(E=>{throw g.addIssue(a(b,E)),g}),M=await Reflect.apply(c,this,y);return await p._def.returns._def.type.parseAsync(M,h).catch(E=>{throw g.addIssue(i(M,E)),g})})}else{let p=this;return $a(function(...b){let g=p._def.args.safeParse(b,h);if(!g.success)throw new Bo([a(b,g.error)]);let y=Reflect.apply(c,this,g.data),M=p._def.returns.safeParse(y,h);if(!M.success)throw new Bo([i(y,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Bu.create(e).rest(Nh.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,a){return new t({args:e||Bu.create([]).rest(Nh.create()),returns:r||Nh.create(),typeName:cr.ZodFunction,...Br(a)})}},hd=class extends Or{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};hd.create=(t,e)=>new hd({getter:t,typeName:cr.ZodLazy,...Br(e)});var cd=class extends Or{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return Wt(r,{received:r.data,code:Ot.invalid_literal,expected:this._def.value}),pr}return{status:"valid",value:e.data}}get value(){return this._def.value}};cd.create=(t,e)=>new cd({value:t,typeName:cr.ZodLiteral,...Br(e)});function QX(t,e){return new ld({values:t,typeName:cr.ZodEnum,...Br(e)})}var ld=class t extends Or{constructor(){super(...arguments),Tg.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),a=this._def.values;return Wt(r,{expected:fi.joinValues(a),received:r.parsedType,code:Ot.invalid_type}),pr}if(N8(this,Tg,"f")||GX(this,Tg,new Set(this._def.values),"f"),!N8(this,Tg,"f").has(e.data)){let r=this._getOrReturnCtx(e),a=this._def.values;return Wt(r,{received:r.data,code:Ot.invalid_enum_value,options:a}),pr}return $a(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(a=>!e.includes(a)),{...this._def,...r})}};Tg=new WeakMap;ld.create=QX;var dd=class extends Or{constructor(){super(...arguments),kg.set(this,void 0)}_parse(e){let r=fi.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==Yt.string&&a.parsedType!==Yt.number){let i=fi.objectValues(r);return Wt(a,{expected:fi.joinValues(i),received:a.parsedType,code:Ot.invalid_type}),pr}if(N8(this,kg,"f")||GX(this,kg,new Set(fi.getValidEnumValues(this._def.values)),"f"),!N8(this,kg,"f").has(e.data)){let i=fi.objectValues(r);return Wt(a,{received:a.data,code:Ot.invalid_enum_value,options:i}),pr}return $a(e.data)}get enum(){return this._def.values}};kg=new WeakMap;dd.create=(t,e)=>new dd({values:t,typeName:cr.ZodNativeEnum,...Br(e)});var pl=class extends Or{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.promise&&r.common.async===!1)return Wt(r,{code:Ot.invalid_type,expected:Yt.promise,received:r.parsedType}),pr;let a=r.parsedType===Yt.promise?r.data:Promise.resolve(r.data);return $a(a.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};pl.create=(t,e)=>new pl({type:t,typeName:cr.ZodPromise,...Br(e)});var Oo=class extends Or{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===cr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:a}=this._processInputParams(e),i=this._def.effect||null,h={addIssue:c=>{Wt(a,c),c.fatal?r.abort():r.dirty()},get path(){return a.path}};if(h.addIssue=h.addIssue.bind(h),i.type==="preprocess"){let c=i.transform(a.data,h);if(a.common.async)return Promise.resolve(c).then(async p=>{if(r.value==="aborted")return pr;let b=await this._def.schema._parseAsync({data:p,path:a.path,parent:a});return b.status==="aborted"?pr:b.status==="dirty"||r.value==="dirty"?b1(b.value):b});{if(r.value==="aborted")return pr;let p=this._def.schema._parseSync({data:c,path:a.path,parent:a});return p.status==="aborted"?pr:p.status==="dirty"||r.value==="dirty"?b1(p.value):p}}if(i.type==="refinement"){let c=p=>{let b=i.refinement(p,h);if(a.common.async)return Promise.resolve(b);if(b instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(a.common.async===!1){let p=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return p.status==="aborted"?pr:(p.status==="dirty"&&r.dirty(),c(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(p=>p.status==="aborted"?pr:(p.status==="dirty"&&r.dirty(),c(p.value).then(()=>({status:r.value,value:p.value}))))}if(i.type==="transform")if(a.common.async===!1){let c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Ig(c))return c;let p=i.transform(c.value,h);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(c=>Ig(c)?Promise.resolve(i.transform(c.value,h)).then(p=>({status:r.value,value:p})):c);fi.assertNever(i)}};Oo.create=(t,e,r)=>new Oo({schema:t,typeName:cr.ZodEffects,effect:e,...Br(r)});Oo.createWithPreprocess=(t,e,r)=>new Oo({schema:e,effect:{type:"preprocess",transform:t},typeName:cr.ZodEffects,...Br(r)});var Is=class extends Or{_parse(e){return this._getType(e)===Yt.undefined?$a(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Is.create=(t,e)=>new Is({innerType:t,typeName:cr.ZodOptional,...Br(e)});var Ou=class extends Or{_parse(e){return this._getType(e)===Yt.null?$a(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ou.create=(t,e)=>new Ou({innerType:t,typeName:cr.ZodNullable,...Br(e)});var pd=class extends Or{_parse(e){let{ctx:r}=this._processInputParams(e),a=r.data;return r.parsedType===Yt.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};pd.create=(t,e)=>new pd({innerType:t,typeName:cr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Br(e)});var vd=class extends Or{_parse(e){let{ctx:r}=this._processInputParams(e),a={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Bg(i)?i.then(h=>({status:"valid",value:h.status==="valid"?h.value:this._def.catchValue({get error(){return new Bo(a.common.issues)},input:a.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Bo(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};vd.create=(t,e)=>new vd({innerType:t,typeName:cr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Br(e)});var S1=class extends Or{_parse(e){if(this._getType(e)!==Yt.nan){let a=this._getOrReturnCtx(e);return Wt(a,{code:Ot.invalid_type,expected:Yt.nan,received:a.parsedType}),pr}return{status:"valid",value:e.data}}};S1.create=t=>new S1({typeName:cr.ZodNaN,...Br(t)});var mwe=Symbol("zod_brand"),Og=class extends Or{_parse(e){let{ctx:r}=this._processInputParams(e),a=r.data;return this._def.type._parse({data:a,path:r.path,parent:r})}unwrap(){return this._def.type}},Pg=class t extends Or{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{let h=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return h.status==="aborted"?pr:h.status==="dirty"?(r.dirty(),b1(h.value)):this._def.out._parseAsync({data:h.value,path:a.path,parent:a})})();{let i=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?pr:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:a.path,parent:a})}}static create(e,r){return new t({in:e,out:r,typeName:cr.ZodPipeline})}},md=class extends Or{_parse(e){let r=this._def.innerType._parse(e),a=i=>(Ig(i)&&(i.value=Object.freeze(i.value)),i);return Bg(r)?r.then(i=>a(i)):a(r)}unwrap(){return this._def.innerType}};md.create=(t,e)=>new md({innerType:t,typeName:cr.ZodReadonly,...Br(e)});function eQ(t,e={},r){return t?dl.create().superRefine((a,i)=>{var h,c;if(!t(a)){let p=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,b=(c=(h=p.fatal)!==null&&h!==void 0?h:r)!==null&&c!==void 0?c:!0,g=typeof p=="string"?{message:p}:p;i.addIssue({code:"custom",...g,fatal:b})}}):dl.create()}var gwe={object:ao.lazycreate},cr;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(cr||(cr={}));var bwe=(t,e={message:`Input not instance of ${t.name}`})=>eQ(r=>r instanceof t,e),tQ=ll.create,rQ=rd.create,ywe=S1.create,wwe=id.create,iQ=nd.create,_we=ad.create,Mwe=w1.create,xwe=od.create,Swe=sd.create,Ewe=dl.create,Awe=Nh.create,Rwe=Rf.create,Twe=_1.create,kwe=Ch.create,Iwe=ao.create,Bwe=ao.strictCreate,Owe=fd.create,Pwe=C8.create,Nwe=ud.create,Cwe=Bu.create,Lwe=L8.create,$we=M1.create,Dwe=x1.create,Uwe=$8.create,qwe=hd.create,Fwe=cd.create,jwe=ld.create,zwe=dd.create,Zwe=pl.create,WX=Oo.create,Hwe=Is.create,Kwe=Ou.create,Wwe=Oo.createWithPreprocess,Vwe=Pg.create,Gwe=()=>tQ().optional(),Ywe=()=>rQ().optional(),Jwe=()=>iQ().optional(),Xwe={string:t=>ll.create({...t,coerce:!0}),number:t=>rd.create({...t,coerce:!0}),boolean:t=>nd.create({...t,coerce:!0}),bigint:t=>id.create({...t,coerce:!0}),date:t=>ad.create({...t,coerce:!0})},Qwe=pr,vr=Object.freeze({__proto__:null,defaultErrorMap:y1,setErrorMap:Q4e,getErrorMap:O8,makeIssue:P8,EMPTY_PATH:ewe,addIssueToContext:Wt,ParseStatus:Ia,INVALID:pr,DIRTY:b1,OK:$a,isAborted:dT,isDirty:pT,isValid:Ig,isAsync:Bg,get util(){return fi},get objectUtil(){return lT},ZodParsedType:Yt,getParsedType:cl,ZodType:Or,datetimeRegex:XX,ZodString:ll,ZodNumber:rd,ZodBigInt:id,ZodBoolean:nd,ZodDate:ad,ZodSymbol:w1,ZodUndefined:od,ZodNull:sd,ZodAny:dl,ZodUnknown:Nh,ZodNever:Rf,ZodVoid:_1,ZodArray:Ch,ZodObject:ao,ZodUnion:fd,ZodDiscriminatedUnion:C8,ZodIntersection:ud,ZodTuple:Bu,ZodRecord:L8,ZodMap:M1,ZodSet:x1,ZodFunction:$8,ZodLazy:hd,ZodLiteral:cd,ZodEnum:ld,ZodNativeEnum:dd,ZodPromise:pl,ZodEffects:Oo,ZodTransformer:Oo,ZodOptional:Is,ZodNullable:Ou,ZodDefault:pd,ZodCatch:vd,ZodNaN:S1,BRAND:mwe,ZodBranded:Og,ZodPipeline:Pg,ZodReadonly:md,custom:eQ,Schema:Or,ZodSchema:Or,late:gwe,get ZodFirstPartyTypeKind(){return cr},coerce:Xwe,any:Ewe,array:kwe,bigint:wwe,boolean:iQ,date:_we,discriminatedUnion:Pwe,effect:WX,enum:jwe,function:Uwe,instanceof:bwe,intersection:Nwe,lazy:qwe,literal:Fwe,map:$we,nan:ywe,nativeEnum:zwe,never:Rwe,null:Swe,nullable:Kwe,number:rQ,object:Iwe,oboolean:Jwe,onumber:Ywe,optional:Hwe,ostring:Gwe,pipeline:Vwe,preprocess:Wwe,promise:Zwe,record:Lwe,set:Dwe,strictObject:Bwe,string:tQ,symbol:Mwe,transformer:WX,tuple:Cwe,undefined:xwe,union:Owe,unknown:Awe,void:Twe,NEVER:Qwe,ZodIssueCode:Ot,quotelessJson:X4e,ZodError:Bo});ie();ae();ne();var D8=new RegExp("^[a-zA-Z0-9_-]{43}$"),kft=new RegExp("^(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{1,63}$"),Ift=new RegExp("^[0-9]{12},[0-9]{13},[a-fA-F0-9]{64}$"),Bft=He.env.ARNS_REGISTRY_TX??"bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U",Oft="_NctcA2sRy1-J4OmIQZbYFPM17piNcbdBPH2ncX2RL8",e5e="GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc",Pft=e5e,E1="agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA",U8="i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc",mT=1e6,nQ="cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk",gT="pOh2yupSaQCrLI_-ah8tVTiusUdVNTxxeWTQQHNdf30",aQ="_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";var Lh=vr.string({description:"Arweave Transaction ID"}).refine(t=>D8.test(t),{message:"Must be an Arweave Transaction ID"}),oQ=vr.string({description:"Integer String"}).refine(t=>{let e=parseInt(t);return Number.isInteger(e)&&e>=0},{message:"Must be a non negative integer string"}),t5e=vr.string(),fQ=vr.array(vr.string()),q8=vr.object({transactionId:Lh.describe("The Target ID of the undername"),ttlSeconds:vr.number()}),bT=vr.record(vr.string(),q8),yT=vr.array(Lh.describe("Controller address")),wT=vr.record(Lh.describe("Holder address"),vr.number()),_T=vr.object({Name:vr.string().describe("The name of the ANT."),Ticker:vr.string().describe("The ticker symbol for the ANT."),Description:vr.string().describe("The description for the ANT."),Keywords:fQ.describe("The keywords for the ANT."),Denomination:vr.number().describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers.").min(0,{message:"Denomination must be a non-negative number"}),Owner:Lh.describe("The Owners address."),Controllers:yT.describe("Controllers of the ANT who have administrative privileges."),Records:bT.describe("Records associated with the ANT."),Balances:wT.describe("Balance details for each address holding the ANT."),Logo:Lh.describe("Transaction ID of the ANT logo."),TotalSupply:vr.number().describe("Total supply of the ANT in circulation.").min(0,{message:"Total supply must be a non-negative number"}),Initialized:vr.boolean().describe("Flag indicating whether the ANT has been initialized."),"Source-Code-TX-ID":Lh.describe("Transaction ID of the Source Code for the ANT.")}),r5e=["evolve","_eval","_default","transfer","balance","balances","totalSupply","info","addController","removeController","controllers","setRecord","removeRecord","record","records","setName","setTicker","setDescription","setKeywords","initializeState","state","releaseName","reassignName"],sQ=vr.array(vr.string({description:"Handler Name"})).refine(t=>r5e.every(e=>t.includes(e)),{message:"ANT is missing required handlers"}),uQ=vr.object({Name:vr.string().describe("The name of the ANT."),Owner:Lh.describe("The Owners address."),"Source-Code-TX-ID":Lh.describe("Transaction ID of the Source Code for the ANT."),Ticker:vr.string().describe("The ticker symbol for the ANT."),"Total-Supply":oQ.describe("Total supply of the ANT in circulation."),Description:t5e.describe("The description for the ANT."),Keywords:fQ.describe("The keywords for the ANT."),Logo:Lh.describe("Transaction ID of the ANT logo."),Denomination:oQ.describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers."),Handlers:sQ.optional().describe("List of handlers for the ANT."),HandlerNames:sQ.optional().describe('Deprecated: List of handlers for the ANT. Use "Handlers" instead.')});function qft(t){return _T.safeParse(t).success}ie();ae();ne();ie();ae();ne();ie();ae();ne();var hQ=t=>D8.test(t);function Gft(t){return t!==void 0&&!isNaN(parseInt(t.toString()))}var En=t=>t.filter(e=>e.value!==void 0),A1=async t=>await t.blocks.getCurrent().then(e=>e.timestamp*1e3).catch(()=>Date.now());function $h(t){return"process"in t}function Dh(t){return"processId"in t&&typeof t.processId=="string"&&hQ(t.processId)===!0}function tut(t){return t.type==="lease"}ie();ae();ne();var MT=class t{constructor(e){this.positiveFiniteInteger=e;if(!Number.isFinite(this.positiveFiniteInteger)||!Number.isInteger(this.positiveFiniteInteger)||this.positiveFiniteInteger<0)throw new Error(`Number must be a non-negative integer value! ${e}`)}[Symbol.toPrimitive](e){return e==="string"&&this.toString(),this.positiveFiniteInteger}plus(e){return new t(this.positiveFiniteInteger+e.positiveFiniteInteger)}minus(e){return new t(this.positiveFiniteInteger-e.positiveFiniteInteger)}isGreaterThan(e){return this.positiveFiniteInteger>e.positiveFiniteInteger}isGreaterThanOrEqualTo(e){return this.positiveFiniteInteger>=e.positiveFiniteInteger}isLessThan(e){return this.positiveFiniteInteger<e.positiveFiniteInteger}isLessThanOrEqualTo(e){return this.positiveFiniteInteger<=e.positiveFiniteInteger}toString(){return`${this.positiveFiniteInteger}`}valueOf(){return this.positiveFiniteInteger}toJSON(){return this.positiveFiniteInteger}equals(e){return this.positiveFiniteInteger===e.positiveFiniteInteger}},xT=class{value;constructor(e){if(!Number.isFinite(e)||e<0)throw new Error("IOToken must be a non-negative finite number");this.value=+e.toFixed(6)}valueOf(){return this.value}toMIO(){return new ST(Math.floor(this.value*mT))}toString(){return`${this.value}`}},ST=class t extends MT{constructor(e){super(e)}multiply(e){let r=Math.floor(this.valueOf()*e.valueOf());return new t(r)}divide(e){if(e.valueOf()===0)throw new Error("Cannot divide by zero");let r=Math.floor(this.valueOf()/e.valueOf());return new t(r)}plus(e){let r=super.plus(e);return new t(r.valueOf())}minus(e){let r=super.minus(e);return new t(r.valueOf())}toIO(){return new xT(this.valueOf()/mT)}};ie();ae();ne();ie();ae();ne();var Tf=class extends Error{constructor(e){super(e),this.name=this.constructor.name}},cQ=class extends Tf{},lQ=class extends Tf{},dQ=class extends Tf{constructor(e,r){super(`Failed request: ${e}: ${r}`)}},pQ=class extends Tf{},F8=class extends Tf{},vQ=class extends Tf{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},Pu=class extends Tf{constructor(){super("Invalid contract configuration")}},mQ=class extends Tf{constructor(){super("Invalid process configuration")}},gQ=class extends Tf{};ie();ae();ne();var $f=gi($ae(),1);ie();ae();ne();var V4="2.4.0-alpha.16";var qu=class t{logger;silent=!1;static default=new t;constructor({level:e="info"}={}){e==="none"&&(this.silent=!0),typeof window<"u"?this.logger=console:this.logger=(0,$f.createLogger)({level:e,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:V4},format:$f.format.combine($f.format.timestamp(),$f.format.json()),transports:[new $f.transports.Console({format:$f.format.combine($f.format.timestamp(),$f.format.json())})]})}info(e,...r){this.silent||this.logger.info(e,...r)}warn(e,...r){this.silent||this.logger.warn(e,...r)}error(e,...r){this.silent||this.logger.error(e,...r)}debug(e,...r){this.silent||this.logger.debug(e,...r)}setLogLevel(e){this.silent=e==="none","silent"in this.logger&&(this.logger.silent=e==="none"),"level"in this.logger&&(this.logger.level=e)}};ie();ae();ne();ie();ae();ne();ie();ae();ne();var rBe=Object.create,oB=Object.defineProperty,iBe=Object.getOwnPropertyDescriptor,uoe=Object.getOwnPropertyNames,nBe=Object.getPrototypeOf,aBe=Object.prototype.hasOwnProperty,Co=(t,e)=>function(){return e||(0,t[uoe(t)[0]])((e={exports:{}}).exports,e),e.exports},hoe=(t,e)=>{for(var r in e)oB(t,r,{get:e[r],enumerable:!0})},oBe=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of uoe(e))!aBe.call(t,i)&&i!==r&&oB(t,i,{get:()=>e[i],enumerable:!(a=iBe(e,i))||a.enumerable});return t},sB=(t,e,r)=>(r=t!=null?rBe(nBe(t)):{},oBe(e||!t||!t.__esModule?oB(r,"default",{value:t,enumerable:!0}):r,t)),sBe=Co({"node_modules/obliterator/iterator.js"(t,e){function r(a){if(typeof a!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=a}typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=function(){return this}),r.of=function(){var a=arguments,i=a.length,h=0;return new r(function(){return h>=i?{done:!0}:{done:!1,value:a[h++]}})},r.empty=function(){var a=new r(function(){return{done:!0}});return a},r.fromSequence=function(a){var i=0,h=a.length;return new r(function(){return i>=h?{done:!0}:{done:!1,value:a[i++]}})},r.is=function(a){return a instanceof r?!0:typeof a=="object"&&a!==null&&typeof a.next=="function"},e.exports=r}}),fBe=Co({"node_modules/obliterator/support.js"(t){t.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",t.SYMBOL_SUPPORT=typeof Symbol<"u"}}),fB=Co({"node_modules/obliterator/foreach.js"(t,e){var r=fBe(),a=r.ARRAY_BUFFER_SUPPORT,i=r.SYMBOL_SUPPORT;e.exports=function(c,p){var b,g,y,M,x;if(!c)throw new Error("obliterator/forEach: invalid iterable.");if(typeof p!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(c)||a&&ArrayBuffer.isView(c)||typeof c=="string"||c.toString()==="[object Arguments]"){for(y=0,M=c.length;y<M;y++)p(c[y],y);return}if(typeof c.forEach=="function"){c.forEach(p);return}if(i&&Symbol.iterator in c&&typeof c.next!="function"&&(c=c[Symbol.iterator]()),typeof c.next=="function"){for(b=c,y=0;x=b.next(),x.done!==!0;)p(x.value,y),y++;return}for(g in c)c.hasOwnProperty(g)&&p(c[g],g)}}}),uB=Co({"node_modules/mnemonist/utils/typed-arrays.js"(t){var e=Math.pow(2,8)-1,r=Math.pow(2,16)-1,a=Math.pow(2,32)-1,i=Math.pow(2,7)-1,h=Math.pow(2,15)-1,c=Math.pow(2,31)-1;t.getPointerArray=function(b){var g=b-1;if(g<=e)return Uint8Array;if(g<=r)return Uint16Array;if(g<=a)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},t.getSignedPointerArray=function(b){var g=b-1;return g<=i?Int8Array:g<=h?Int16Array:g<=c?Int32Array:Float64Array},t.getNumberType=function(b){return b===(b|0)?Math.sign(b)===-1?b<=127&&b>=-128?Int8Array:b<=32767&&b>=-32768?Int16Array:Int32Array:b<=255?Uint8Array:b<=65535?Uint16Array:Uint32Array:Float64Array};var p={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};t.getMinimalRepresentation=function(b,g){var y=null,M=0,x,E,A,k,O;for(k=0,O=b.length;k<O;k++)A=g?g(b[k]):b[k],E=t.getNumberType(A),x=p[E.name],x>M&&(M=x,y=E);return y},t.isTypedArray=function(b){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(b)},t.concat=function(){var b=0,g,y,M;for(g=0,M=arguments.length;g<M;g++)b+=arguments[g].length;var x=new arguments[0].constructor(b);for(g=0,y=0;g<M;g++)x.set(arguments[g],y),y+=arguments[g].length;return x},t.indices=function(b){for(var g=t.getPointerArray(b),y=new g(b),M=0;M<b;M++)y[M]=M;return y}}}),coe=Co({"node_modules/mnemonist/utils/iterables.js"(t){var e=fB(),r=uB();function a(p){return Array.isArray(p)||r.isTypedArray(p)}function i(p){if(typeof p.length=="number")return p.length;if(typeof p.size=="number")return p.size}function h(p){var b=i(p),g=typeof b=="number"?new Array(b):[],y=0;return e(p,function(M){g[y++]=M}),g}function c(p){var b=i(p),g=typeof b=="number"?r.getPointerArray(b):Array,y=typeof b=="number"?new Array(b):[],M=typeof b=="number"?new g(b):[],x=0;return e(p,function(E){y[x]=E,M[x]=x++}),[y,M]}t.isArrayLike=a,t.guessLength=i,t.toArray=h,t.toArrayWithIndices=c}}),uBe=Co({"node_modules/mnemonist/lru-cache.js"(t,e){var r=sBe(),a=fB(),i=uB(),h=coe();function c(p,b,g){if(arguments.length<2&&(g=p,p=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var y=i.getPointerArray(g);this.forward=new y(g),this.backward=new y(g),this.K=typeof p=="function"?new p(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items={}}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},c.prototype.splayOnTop=function(p){var b=this.head;if(this.head===p)return this;var g=this.backward[p],y=this.forward[p];return this.tail===p?this.tail=g:this.backward[y]=g,this.forward[g]=y,this.backward[b]=p,this.head=p,this.forward[p]=b,this},c.prototype.set=function(p,b){var g=this.items[p];if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],delete this.items[this.K[g]]),this.items[p]=g,this.K[g]=p,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},c.prototype.setpop=function(p,b){var g=null,y=null,M=this.items[p];return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:p,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],y=this.K[M],delete this.items[y]),this.items[p]=M,this.K[M]=p,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,y?{evicted:!0,key:y,value:g}:null)},c.prototype.has=function(p){return p in this.items},c.prototype.get=function(p){var b=this.items[p];if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},c.prototype.peek=function(p){var b=this.items[p];if(!(typeof b>"u"))return this.V[b]},c.prototype.forEach=function(p,b){b=arguments.length>1?b:this;for(var g=0,y=this.size,M=this.head,x=this.K,E=this.V,A=this.forward;g<y;)p.call(b,E[M],x[M],this),M=A[M],g++},c.prototype.keys=function(){var p=0,b=this.size,g=this.head,y=this.K,M=this.forward;return new r(function(){if(p>=b)return{done:!0};var x=y[g];return p++,p<b&&(g=M[g]),{done:!1,value:x}})},c.prototype.values=function(){var p=0,b=this.size,g=this.head,y=this.V,M=this.forward;return new r(function(){if(p>=b)return{done:!0};var x=y[g];return p++,p<b&&(g=M[g]),{done:!1,value:x}})},c.prototype.entries=function(){var p=0,b=this.size,g=this.head,y=this.K,M=this.V,x=this.forward;return new r(function(){if(p>=b)return{done:!0};var E=y[g],A=M[g];return p++,p<b&&(g=x[g]),{done:!1,value:[E,A]}})},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=function(){for(var p=new Map,b=this.entries(),g;g=b.next(),!g.done;)p.set(g.value[0],g.value[1]);return Object.defineProperty(p,"constructor",{value:c,enumerable:!1}),p},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.from=function(p,b,g,y){if(arguments.length<2){if(y=h.guessLength(p),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=b,b=null,g=null);var M=new c(b,g,y);return a(p,function(x,E){M.set(E,x)}),M},e.exports=c}}),hBe=Co({"node_modules/mnemonist/lru-map.js"(t,e){var r=uBe(),a=fB(),i=uB(),h=coe();function c(p,b,g){if(arguments.length<2&&(g=p,p=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var y=i.getPointerArray(g);this.forward=new y(g),this.backward=new y(g),this.K=typeof p=="function"?new p(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items=new Map}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},c.prototype.set=function(p,b){var g=this.items.get(p);if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],this.items.delete(this.K[g])),this.items.set(p,g),this.K[g]=p,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},c.prototype.setpop=function(p,b){var g=null,y=null,M=this.items.get(p);return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:p,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],y=this.K[M],this.items.delete(y)),this.items.set(p,M),this.K[M]=p,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,y?{evicted:!0,key:y,value:g}:null)},c.prototype.has=function(p){return this.items.has(p)},c.prototype.get=function(p){var b=this.items.get(p);if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},c.prototype.peek=function(p){var b=this.items.get(p);if(!(typeof b>"u"))return this.V[b]},c.prototype.splayOnTop=r.prototype.splayOnTop,c.prototype.forEach=r.prototype.forEach,c.prototype.keys=r.prototype.keys,c.prototype.values=r.prototype.values,c.prototype.entries=r.prototype.entries,typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=r.prototype.inspect,c.from=function(p,b,g,y){if(arguments.length<2){if(y=h.guessLength(p),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=b,b=null,g=null);var M=new c(b,g,y);return a(p,function(x,E){M.set(E,x)}),M},e.exports=c}}),cBe=Co({"node_modules/ms/index.js"(t,e){var r=1e3,a=r*60,i=a*60,h=i*24,c=h*7,p=h*365.25;e.exports=function(x,E){E=E||{};var A=typeof x;if(A==="string"&&x.length>0)return b(x);if(A==="number"&&isFinite(x))return E.long?y(x):g(x);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(x))};function b(x){if(x=String(x),!(x.length>100)){var E=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(x);if(E){var A=parseFloat(E[1]),k=(E[2]||"ms").toLowerCase();switch(k){case"years":case"year":case"yrs":case"yr":case"y":return A*p;case"weeks":case"week":case"w":return A*c;case"days":case"day":case"d":return A*h;case"hours":case"hour":case"hrs":case"hr":case"h":return A*i;case"minutes":case"minute":case"mins":case"min":case"m":return A*a;case"seconds":case"second":case"secs":case"sec":case"s":return A*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function g(x){var E=Math.abs(x);return E>=h?Math.round(x/h)+"d":E>=i?Math.round(x/i)+"h":E>=a?Math.round(x/a)+"m":E>=r?Math.round(x/r)+"s":x+"ms"}function y(x){var E=Math.abs(x);return E>=h?M(x,E,h,"day"):E>=i?M(x,E,i,"hour"):E>=a?M(x,E,a,"minute"):E>=r?M(x,E,r,"second"):x+" ms"}function M(x,E,A,k){var O=E>=A*1.5;return Math.round(x/A)+" "+k+(O?"s":"")}}}),lBe=Co({"node_modules/debug/src/common.js"(t,e){function r(a){h.debug=h,h.default=h,h.coerce=M,h.disable=b,h.enable=p,h.enabled=g,h.humanize=cBe(),h.destroy=x,Object.keys(a).forEach(E=>{h[E]=a[E]}),h.names=[],h.skips=[],h.formatters={};function i(E){let A=0;for(let k=0;k<E.length;k++)A=(A<<5)-A+E.charCodeAt(k),A|=0;return h.colors[Math.abs(A)%h.colors.length]}h.selectColor=i;function h(E){let A,k=null,O,N;function L(...C){if(!L.enabled)return;let Y=L,G=Number(new Date),ee=G-(A||G);Y.diff=ee,Y.prev=A,Y.curr=G,A=G,C[0]=h.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let $=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(V,_)=>{if(V==="%%")return"%";$++;let n=h.formatters[_];if(typeof n=="function"){let s=C[$];V=n.call(Y,s),C.splice($,1),$--}return V}),h.formatArgs.call(Y,C),(Y.log||h.log).apply(Y,C)}return L.namespace=E,L.useColors=h.useColors(),L.color=h.selectColor(E),L.extend=c,L.destroy=h.destroy,Object.defineProperty(L,"enabled",{enumerable:!0,configurable:!1,get:()=>k!==null?k:(O!==h.namespaces&&(O=h.namespaces,N=h.enabled(E)),N),set:C=>{k=C}}),typeof h.init=="function"&&h.init(L),L}function c(E,A){let k=h(this.namespace+(typeof A>"u"?":":A)+E);return k.log=this.log,k}function p(E){h.save(E),h.namespaces=E,h.names=[],h.skips=[];let A,k=(typeof E=="string"?E:"").split(/[\s,]+/),O=k.length;for(A=0;A<O;A++)k[A]&&(E=k[A].replace(/\*/g,".*?"),E[0]==="-"?h.skips.push(new RegExp("^"+E.slice(1)+"$")):h.names.push(new RegExp("^"+E+"$")))}function b(){let E=[...h.names.map(y),...h.skips.map(y).map(A=>"-"+A)].join(",");return h.enable(""),E}function g(E){if(E[E.length-1]==="*")return!0;let A,k;for(A=0,k=h.skips.length;A<k;A++)if(h.skips[A].test(E))return!1;for(A=0,k=h.names.length;A<k;A++)if(h.names[A].test(E))return!0;return!1}function y(E){return E.toString().substring(2,E.toString().length-2).replace(/\.\*\?$/,"*")}function M(E){return E instanceof Error?E.stack||E.message:E}function x(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return h.enable(h.load()),h}e.exports=r}}),dBe=Co({"node_modules/debug/src/browser.js"(t,e){t.formatArgs=a,t.save=i,t.load=h,t.useColors=r,t.storage=c(),t.destroy=(()=>{let b=!1;return()=>{b||(b=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(b){if(b[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+b[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let g="color: "+this.color;b.splice(1,0,g,"color: inherit");let y=0,M=0;b[0].replace(/%[a-zA-Z%]/g,x=>{x!=="%%"&&(y++,x==="%c"&&(M=y))}),b.splice(M,0,g)}t.log=console.debug||console.log||(()=>{});function i(b){try{b?t.storage.setItem("debug",b):t.storage.removeItem("debug")}catch{}}function h(){let b;try{b=t.storage.getItem("debug")}catch{}return!b&&typeof He<"u"&&"env"in He&&(b=He.env.DEBUG),b}function c(){try{return localStorage}catch{}}e.exports=lBe()(t);var{formatters:p}=e.exports;p.j=function(b){try{return JSON.stringify(b)}catch(g){return"[UnexpectedJSONParseError]: "+g.message}}}}),pBe=Co({"node_modules/base64-js/index.js"(t){"use strict";t.byteLength=b,t.toByteArray=y,t.fromByteArray=E;var e=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,c=i.length;h<c;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,c;r[45]=62,r[95]=63;function p(A){var k=A.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var O=A.indexOf("=");O===-1&&(O=k);var N=O===k?0:4-O%4;return[O,N]}function b(A){var k=p(A),O=k[0],N=k[1];return(O+N)*3/4-N}function g(A,k,O){return(k+O)*3/4-O}function y(A){var k,O=p(A),N=O[0],L=O[1],C=new a(g(A,N,L)),Y=0,G=L>0?N-4:N,ee;for(ee=0;ee<G;ee+=4)k=r[A.charCodeAt(ee)]<<18|r[A.charCodeAt(ee+1)]<<12|r[A.charCodeAt(ee+2)]<<6|r[A.charCodeAt(ee+3)],C[Y++]=k>>16&255,C[Y++]=k>>8&255,C[Y++]=k&255;return L===2&&(k=r[A.charCodeAt(ee)]<<2|r[A.charCodeAt(ee+1)]>>4,C[Y++]=k&255),L===1&&(k=r[A.charCodeAt(ee)]<<10|r[A.charCodeAt(ee+1)]<<4|r[A.charCodeAt(ee+2)]>>2,C[Y++]=k>>8&255,C[Y++]=k&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,k,O){for(var N,L=[],C=k;C<O;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var k,O=A.length,N=O%3,L=[],C=16383,Y=0,G=O-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(k=A[O-1],L.push(e[k>>2]+e[k<<4&63]+"==")):N===2&&(k=(A[O-2]<<8)+A[O-1],L.push(e[k>>10]+e[k>>4&63]+e[k<<2&63]+"=")),L.join("")}}}),vBe=Co({"node_modules/ieee754/index.js"(t){t.read=function(e,r,a,i,h){var c,p,b=h*8-i-1,g=(1<<b)-1,y=g>>1,M=-7,x=a?h-1:0,E=a?-1:1,A=e[r+x];for(x+=E,c=A&(1<<-M)-1,A>>=-M,M+=b;M>0;c=c*256+e[r+x],x+=E,M-=8);for(p=c&(1<<-M)-1,c>>=-M,M+=i;M>0;p=p*256+e[r+x],x+=E,M-=8);if(c===0)c=1-y;else{if(c===g)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,i),c=c-y}return(A?-1:1)*p*Math.pow(2,c-i)},t.write=function(e,r,a,i,h,c){var p,b,g,y=c*8-h-1,M=(1<<y)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:c-1,k=i?1:-1,O=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,p=M):(p=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-p))<1&&(p--,g*=2),p+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(p++,g/=2),p+x>=M?(b=0,p=M):p+x>=1?(b=(r*g-1)*Math.pow(2,h),p=p+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),p=0));h>=8;e[a+A]=b&255,A+=k,b/=256,h-=8);for(p=p<<h|b,y+=h;y>0;e[a+A]=p&255,A+=k,p/=256,y-=8);e[a+A-k]|=O*128}}}),mBe=Co({"node_modules/buffer/index.js"(t){"use strict";var e=pBe(),r=vBe(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=p,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,p.TYPED_ARRAY_SUPPORT=h(),!p.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 h(){try{let T=new Uint8Array(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,Uint8Array.prototype),Object.setPrototypeOf(T,I),T.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function c(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let I=new Uint8Array(T);return Object.setPrototypeOf(I,p.prototype),I}function p(T,I,P){if(typeof T=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,I,P)}p.poolSize=8192;function b(T,I,P){if(typeof T=="string")return x(T,I);if(ArrayBuffer.isView(T))return A(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(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return k(T,I,P);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let U=T.valueOf&&T.valueOf();if(U!=null&&U!==T)return p.from(U,I,P);let H=O(T);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return p.from(T[Symbol.toPrimitive]("string"),I,P);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}p.from=function(T,I,P){return b(T,I,P)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array);function g(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 y(T,I,P){return g(T),T<=0?c(T):I!==void 0?typeof P=="string"?c(T).fill(I,P):c(T).fill(I):c(T)}p.alloc=function(T,I,P){return y(T,I,P)};function M(T){return g(T),c(T<0?0:N(T)|0)}p.allocUnsafe=function(T){return M(T)},p.allocUnsafeSlow=function(T){return M(T)};function x(T,I){if((typeof I!="string"||I==="")&&(I="utf8"),!p.isEncoding(I))throw new TypeError("Unknown encoding: "+I);let P=C(T,I)|0,U=c(P),H=U.write(T,I);return H!==P&&(U=U.slice(0,H)),U}function E(T){let I=T.length<0?0:N(T.length)|0,P=c(I);for(let U=0;U<I;U+=1)P[U]=T[U]&255;return P}function A(T){if(ut(T,Uint8Array)){let I=new Uint8Array(T);return k(I.buffer,I.byteOffset,I.byteLength)}return E(T)}function k(T,I,P){if(I<0||T.byteLength<I)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<I+(P||0))throw new RangeError('"length" is outside of buffer bounds');let U;return I===void 0&&P===void 0?U=new Uint8Array(T):P===void 0?U=new Uint8Array(T,I):U=new Uint8Array(T,I,P),Object.setPrototypeOf(U,p.prototype),U}function O(T){if(p.isBuffer(T)){let I=N(T.length)|0,P=c(I);return P.length===0||T.copy(P,0,0,I),P}if(T.length!==void 0)return typeof T.length!="number"||Ze(T.length)?c(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),p.alloc(+T)}p.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==p.prototype},p.compare=function(I,P){if(ut(I,Uint8Array)&&(I=p.from(I,I.offset,I.byteLength)),ut(P,Uint8Array)&&(P=p.from(P,P.offset,P.byteLength)),!p.isBuffer(I)||!p.isBuffer(P))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===P)return 0;let U=I.length,H=P.length;for(let W=0,fe=Math.min(U,H);W<fe;++W)if(I[W]!==P[W]){U=I[W],H=P[W];break}return U<H?-1:H<U?1:0},p.isEncoding=function(I){switch(String(I).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}},p.concat=function(I,P){if(!Array.isArray(I))throw new TypeError('"list" argument must be an Array of Buffers');if(I.length===0)return p.alloc(0);let U;if(P===void 0)for(P=0,U=0;U<I.length;++U)P+=I[U].length;let H=p.allocUnsafe(P),W=0;for(U=0;U<I.length;++U){let fe=I[U];if(ut(fe,Uint8Array))W+fe.length>H.length?(p.isBuffer(fe)||(fe=p.from(fe)),fe.copy(H,W)):Uint8Array.prototype.set.call(H,fe,W);else if(p.isBuffer(fe))fe.copy(H,W);else throw new TypeError('"list" argument must be an Array of Buffers');W+=fe.length}return H};function C(T,I){if(p.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(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 P=T.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&P===0)return 0;let H=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return P;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P*2;case"hex":return P>>>1;case"base64":return ge(T).length;default:if(H)return U?-1:oe(T).length;I=(""+I).toLowerCase(),H=!0}}p.byteLength=C;function Y(T,I,P){let U=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((P===void 0||P>this.length)&&(P=this.length),P<=0)||(P>>>=0,I>>>=0,P<=I))return"";for(T||(T="utf8");;)switch(T){case"hex":return o(this,I,P);case"utf8":case"utf-8":return u(this,I,P);case"ascii":return w(this,I,P);case"latin1":case"binary":return d(this,I,P);case"base64":return f(this,I,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,I,P);default:if(U)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),U=!0}}p.prototype._isBuffer=!0;function G(T,I,P){let U=T[I];T[I]=T[P],T[P]=U}p.prototype.swap16=function(){let I=this.length;if(I%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let P=0;P<I;P+=2)G(this,P,P+1);return this},p.prototype.swap32=function(){let I=this.length;if(I%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let P=0;P<I;P+=4)G(this,P,P+3),G(this,P+1,P+2);return this},p.prototype.swap64=function(){let I=this.length;if(I%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let P=0;P<I;P+=8)G(this,P,P+7),G(this,P+1,P+6),G(this,P+2,P+5),G(this,P+3,P+4);return this},p.prototype.toString=function(){let I=this.length;return I===0?"":arguments.length===0?u(this,0,I):Y.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(I){if(!p.isBuffer(I))throw new TypeError("Argument must be a Buffer");return this===I?!0:p.compare(this,I)===0},p.prototype.inspect=function(){let I="",P=t.INSPECT_MAX_BYTES;return I=this.toString("hex",0,P).replace(/(.{2})/g,"$1 ").trim(),this.length>P&&(I+=" ... "),"<Buffer "+I+">"},a&&(p.prototype[a]=p.prototype.inspect),p.prototype.compare=function(I,P,U,H,W){if(ut(I,Uint8Array)&&(I=p.from(I,I.offset,I.byteLength)),!p.isBuffer(I))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(P===void 0&&(P=0),U===void 0&&(U=I?I.length:0),H===void 0&&(H=0),W===void 0&&(W=this.length),P<0||U>I.length||H<0||W>this.length)throw new RangeError("out of range index");if(H>=W&&P>=U)return 0;if(H>=W)return-1;if(P>=U)return 1;if(P>>>=0,U>>>=0,H>>>=0,W>>>=0,this===I)return 0;let fe=W-H,st=U-P,ue=Math.min(fe,st),me=this.slice(H,W),pe=I.slice(P,U);for(let be=0;be<ue;++be)if(me[be]!==pe[be]){fe=me[be],st=pe[be];break}return fe<st?-1:st<fe?1:0};function ee(T,I,P,U,H){if(T.length===0)return-1;if(typeof P=="string"?(U=P,P=0):P>2147483647?P=2147483647:P<-2147483648&&(P=-2147483648),P=+P,Ze(P)&&(P=H?0:T.length-1),P<0&&(P=T.length+P),P>=T.length){if(H)return-1;P=T.length-1}else if(P<0)if(H)P=0;else return-1;if(typeof I=="string"&&(I=p.from(I,U)),p.isBuffer(I))return I.length===0?-1:$(T,I,P,U,H);if(typeof I=="number")return I=I&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(T,I,P):Uint8Array.prototype.lastIndexOf.call(T,I,P):$(T,[I],P,U,H);throw new TypeError("val must be string, number or Buffer")}function $(T,I,P,U,H){let W=1,fe=T.length,st=I.length;if(U!==void 0&&(U=String(U).toLowerCase(),U==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(T.length<2||I.length<2)return-1;W=2,fe/=2,st/=2,P/=2}function ue(pe,be){return W===1?pe[be]:pe.readUInt16BE(be*W)}let me;if(H){let pe=-1;for(me=P;me<fe;me++)if(ue(T,me)===ue(I,pe===-1?0:me-pe)){if(pe===-1&&(pe=me),me-pe+1===st)return pe*W}else pe!==-1&&(me-=me-pe),pe=-1}else for(P+st>fe&&(P=fe-st),me=P;me>=0;me--){let pe=!0;for(let be=0;be<st;be++)if(ue(T,me+be)!==ue(I,be)){pe=!1;break}if(pe)return me}return-1}p.prototype.includes=function(I,P,U){return this.indexOf(I,P,U)!==-1},p.prototype.indexOf=function(I,P,U){return ee(this,I,P,U,!0)},p.prototype.lastIndexOf=function(I,P,U){return ee(this,I,P,U,!1)};function q(T,I,P,U){P=Number(P)||0;let H=T.length-P;U?(U=Number(U),U>H&&(U=H)):U=H;let W=I.length;U>W/2&&(U=W/2);let fe;for(fe=0;fe<U;++fe){let st=parseInt(I.substr(fe*2,2),16);if(Ze(st))return fe;T[P+fe]=st}return fe}function V(T,I,P,U){return Se(oe(I,T.length-P),T,P,U)}function _(T,I,P,U){return Se(le(I),T,P,U)}function n(T,I,P,U){return Se(ge(I),T,P,U)}function s(T,I,P,U){return Se(ot(I,T.length-P),T,P,U)}p.prototype.write=function(I,P,U,H){if(P===void 0)H="utf8",U=this.length,P=0;else if(U===void 0&&typeof P=="string")H=P,U=this.length,P=0;else if(isFinite(P))P=P>>>0,isFinite(U)?(U=U>>>0,H===void 0&&(H="utf8")):(H=U,U=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let W=this.length-P;if((U===void 0||U>W)&&(U=W),I.length>0&&(U<0||P<0)||P>this.length)throw new RangeError("Attempt to write outside buffer bounds");H||(H="utf8");let fe=!1;for(;;)switch(H){case"hex":return q(this,I,P,U);case"utf8":case"utf-8":return V(this,I,P,U);case"ascii":case"latin1":case"binary":return _(this,I,P,U);case"base64":return n(this,I,P,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,I,P,U);default:if(fe)throw new TypeError("Unknown encoding: "+H);H=(""+H).toLowerCase(),fe=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,I,P){return I===0&&P===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(I,P))}function u(T,I,P){P=Math.min(T.length,P);let U=[],H=I;for(;H<P;){let W=T[H],fe=null,st=W>239?4:W>223?3:W>191?2:1;if(H+st<=P){let ue,me,pe,be;switch(st){case 1:W<128&&(fe=W);break;case 2:ue=T[H+1],(ue&192)===128&&(be=(W&31)<<6|ue&63,be>127&&(fe=be));break;case 3:ue=T[H+1],me=T[H+2],(ue&192)===128&&(me&192)===128&&(be=(W&15)<<12|(ue&63)<<6|me&63,be>2047&&(be<55296||be>57343)&&(fe=be));break;case 4:ue=T[H+1],me=T[H+2],pe=T[H+3],(ue&192)===128&&(me&192)===128&&(pe&192)===128&&(be=(W&15)<<18|(ue&63)<<12|(me&63)<<6|pe&63,be>65535&&be<1114112&&(fe=be))}}fe===null?(fe=65533,st=1):fe>65535&&(fe-=65536,U.push(fe>>>10&1023|55296),fe=56320|fe&1023),U.push(fe),H+=st}return m(U)}var l=4096;function m(T){let I=T.length;if(I<=l)return String.fromCharCode.apply(String,T);let P="",U=0;for(;U<I;)P+=String.fromCharCode.apply(String,T.slice(U,U+=l));return P}function w(T,I,P){let U="";P=Math.min(T.length,P);for(let H=I;H<P;++H)U+=String.fromCharCode(T[H]&127);return U}function d(T,I,P){let U="";P=Math.min(T.length,P);for(let H=I;H<P;++H)U+=String.fromCharCode(T[H]);return U}function o(T,I,P){let U=T.length;(!I||I<0)&&(I=0),(!P||P<0||P>U)&&(P=U);let H="";for(let W=I;W<P;++W)H+=Ge[T[W]];return H}function v(T,I,P){let U=T.slice(I,P),H="";for(let W=0;W<U.length-1;W+=2)H+=String.fromCharCode(U[W]+U[W+1]*256);return H}p.prototype.slice=function(I,P){let U=this.length;I=~~I,P=P===void 0?U:~~P,I<0?(I+=U,I<0&&(I=0)):I>U&&(I=U),P<0?(P+=U,P<0&&(P=0)):P>U&&(P=U),P<I&&(P=I);let H=this.subarray(I,P);return Object.setPrototypeOf(H,p.prototype),H};function R(T,I,P){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+I>P)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(I,P,U){I=I>>>0,P=P>>>0,U||R(I,P,this.length);let H=this[I],W=1,fe=0;for(;++fe<P&&(W*=256);)H+=this[I+fe]*W;return H},p.prototype.readUintBE=p.prototype.readUIntBE=function(I,P,U){I=I>>>0,P=P>>>0,U||R(I,P,this.length);let H=this[I+--P],W=1;for(;P>0&&(W*=256);)H+=this[I+--P]*W;return H},p.prototype.readUint8=p.prototype.readUInt8=function(I,P){return I=I>>>0,P||R(I,1,this.length),this[I]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(I,P){return I=I>>>0,P||R(I,2,this.length),this[I]|this[I+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(I,P){return I=I>>>0,P||R(I,2,this.length),this[I]<<8|this[I+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(I,P){return I=I>>>0,P||R(I,4,this.length),(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(I,P){return I=I>>>0,P||R(I,4,this.length),this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])},p.prototype.readBigUInt64LE=ct(function(I){I=I>>>0,J(I,"offset");let P=this[I],U=this[I+7];(P===void 0||U===void 0)&&X(I,this.length-8);let H=P+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24,W=this[++I]+this[++I]*2**8+this[++I]*2**16+U*2**24;return BigInt(H)+(BigInt(W)<<BigInt(32))}),p.prototype.readBigUInt64BE=ct(function(I){I=I>>>0,J(I,"offset");let P=this[I],U=this[I+7];(P===void 0||U===void 0)&&X(I,this.length-8);let H=P*2**24+this[++I]*2**16+this[++I]*2**8+this[++I],W=this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+U;return(BigInt(H)<<BigInt(32))+BigInt(W)}),p.prototype.readIntLE=function(I,P,U){I=I>>>0,P=P>>>0,U||R(I,P,this.length);let H=this[I],W=1,fe=0;for(;++fe<P&&(W*=256);)H+=this[I+fe]*W;return W*=128,H>=W&&(H-=Math.pow(2,8*P)),H},p.prototype.readIntBE=function(I,P,U){I=I>>>0,P=P>>>0,U||R(I,P,this.length);let H=P,W=1,fe=this[I+--H];for(;H>0&&(W*=256);)fe+=this[I+--H]*W;return W*=128,fe>=W&&(fe-=Math.pow(2,8*P)),fe},p.prototype.readInt8=function(I,P){return I=I>>>0,P||R(I,1,this.length),this[I]&128?(255-this[I]+1)*-1:this[I]},p.prototype.readInt16LE=function(I,P){I=I>>>0,P||R(I,2,this.length);let U=this[I]|this[I+1]<<8;return U&32768?U|4294901760:U},p.prototype.readInt16BE=function(I,P){I=I>>>0,P||R(I,2,this.length);let U=this[I+1]|this[I]<<8;return U&32768?U|4294901760:U},p.prototype.readInt32LE=function(I,P){return I=I>>>0,P||R(I,4,this.length),this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24},p.prototype.readInt32BE=function(I,P){return I=I>>>0,P||R(I,4,this.length),this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]},p.prototype.readBigInt64LE=ct(function(I){I=I>>>0,J(I,"offset");let P=this[I],U=this[I+7];(P===void 0||U===void 0)&&X(I,this.length-8);let H=this[I+4]+this[I+5]*2**8+this[I+6]*2**16+(U<<24);return(BigInt(H)<<BigInt(32))+BigInt(P+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24)}),p.prototype.readBigInt64BE=ct(function(I){I=I>>>0,J(I,"offset");let P=this[I],U=this[I+7];(P===void 0||U===void 0)&&X(I,this.length-8);let H=(P<<24)+this[++I]*2**16+this[++I]*2**8+this[++I];return(BigInt(H)<<BigInt(32))+BigInt(this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+U)}),p.prototype.readFloatLE=function(I,P){return I=I>>>0,P||R(I,4,this.length),r.read(this,I,!0,23,4)},p.prototype.readFloatBE=function(I,P){return I=I>>>0,P||R(I,4,this.length),r.read(this,I,!1,23,4)},p.prototype.readDoubleLE=function(I,P){return I=I>>>0,P||R(I,8,this.length),r.read(this,I,!0,52,8)},p.prototype.readDoubleBE=function(I,P){return I=I>>>0,P||R(I,8,this.length),r.read(this,I,!1,52,8)};function S(T,I,P,U,H,W){if(!p.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>H||I<W)throw new RangeError('"value" argument is out of bounds');if(P+U>T.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(I,P,U,H){if(I=+I,P=P>>>0,U=U>>>0,!H){let st=Math.pow(2,8*U)-1;S(this,I,P,U,st,0)}let W=1,fe=0;for(this[P]=I&255;++fe<U&&(W*=256);)this[P+fe]=I/W&255;return P+U},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(I,P,U,H){if(I=+I,P=P>>>0,U=U>>>0,!H){let st=Math.pow(2,8*U)-1;S(this,I,P,U,st,0)}let W=U-1,fe=1;for(this[P+W]=I&255;--W>=0&&(fe*=256);)this[P+W]=I/fe&255;return P+U},p.prototype.writeUint8=p.prototype.writeUInt8=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,1,255,0),this[P]=I&255,P+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,2,65535,0),this[P]=I&255,this[P+1]=I>>>8,P+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,2,65535,0),this[P]=I>>>8,this[P+1]=I&255,P+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,4,4294967295,0),this[P+3]=I>>>24,this[P+2]=I>>>16,this[P+1]=I>>>8,this[P]=I&255,P+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,4,4294967295,0),this[P]=I>>>24,this[P+1]=I>>>16,this[P+2]=I>>>8,this[P+3]=I&255,P+4};function B(T,I,P,U,H){j(I,U,H,T,P,7);let W=Number(I&BigInt(4294967295));T[P++]=W,W=W>>8,T[P++]=W,W=W>>8,T[P++]=W,W=W>>8,T[P++]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[P++]=fe,fe=fe>>8,T[P++]=fe,fe=fe>>8,T[P++]=fe,fe=fe>>8,T[P++]=fe,P}function F(T,I,P,U,H){j(I,U,H,T,P,7);let W=Number(I&BigInt(4294967295));T[P+7]=W,W=W>>8,T[P+6]=W,W=W>>8,T[P+5]=W,W=W>>8,T[P+4]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[P+3]=fe,fe=fe>>8,T[P+2]=fe,fe=fe>>8,T[P+1]=fe,fe=fe>>8,T[P]=fe,P+8}p.prototype.writeBigUInt64LE=ct(function(I,P=0){return B(this,I,P,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=ct(function(I,P=0){return F(this,I,P,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(I,P,U,H){if(I=+I,P=P>>>0,!H){let ue=Math.pow(2,8*U-1);S(this,I,P,U,ue-1,-ue)}let W=0,fe=1,st=0;for(this[P]=I&255;++W<U&&(fe*=256);)I<0&&st===0&&this[P+W-1]!==0&&(st=1),this[P+W]=(I/fe>>0)-st&255;return P+U},p.prototype.writeIntBE=function(I,P,U,H){if(I=+I,P=P>>>0,!H){let ue=Math.pow(2,8*U-1);S(this,I,P,U,ue-1,-ue)}let W=U-1,fe=1,st=0;for(this[P+W]=I&255;--W>=0&&(fe*=256);)I<0&&st===0&&this[P+W+1]!==0&&(st=1),this[P+W]=(I/fe>>0)-st&255;return P+U},p.prototype.writeInt8=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,1,127,-128),I<0&&(I=255+I+1),this[P]=I&255,P+1},p.prototype.writeInt16LE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,2,32767,-32768),this[P]=I&255,this[P+1]=I>>>8,P+2},p.prototype.writeInt16BE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,2,32767,-32768),this[P]=I>>>8,this[P+1]=I&255,P+2},p.prototype.writeInt32LE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,4,2147483647,-2147483648),this[P]=I&255,this[P+1]=I>>>8,this[P+2]=I>>>16,this[P+3]=I>>>24,P+4},p.prototype.writeInt32BE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,4,2147483647,-2147483648),I<0&&(I=4294967295+I+1),this[P]=I>>>24,this[P+1]=I>>>16,this[P+2]=I>>>8,this[P+3]=I&255,P+4},p.prototype.writeBigInt64LE=ct(function(I,P=0){return B(this,I,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=ct(function(I,P=0){return F(this,I,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function D(T,I,P,U,H,W){if(P+U>T.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("Index out of range")}function re(T,I,P,U,H){return I=+I,P=P>>>0,H||D(T,I,P,4,34028234663852886e22,-34028234663852886e22),r.write(T,I,P,U,23,4),P+4}p.prototype.writeFloatLE=function(I,P,U){return re(this,I,P,!0,U)},p.prototype.writeFloatBE=function(I,P,U){return re(this,I,P,!1,U)};function Q(T,I,P,U,H){return I=+I,P=P>>>0,H||D(T,I,P,8,17976931348623157e292,-17976931348623157e292),r.write(T,I,P,U,52,8),P+8}p.prototype.writeDoubleLE=function(I,P,U){return Q(this,I,P,!0,U)},p.prototype.writeDoubleBE=function(I,P,U){return Q(this,I,P,!1,U)},p.prototype.copy=function(I,P,U,H){if(!p.isBuffer(I))throw new TypeError("argument should be a Buffer");if(U||(U=0),!H&&H!==0&&(H=this.length),P>=I.length&&(P=I.length),P||(P=0),H>0&&H<U&&(H=U),H===U||I.length===0||this.length===0)return 0;if(P<0)throw new RangeError("targetStart out of bounds");if(U<0||U>=this.length)throw new RangeError("Index out of range");if(H<0)throw new RangeError("sourceEnd out of bounds");H>this.length&&(H=this.length),I.length-P<H-U&&(H=I.length-P+U);let W=H-U;return this===I&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(P,U,H):Uint8Array.prototype.set.call(I,this.subarray(U,H),P),W},p.prototype.fill=function(I,P,U,H){if(typeof I=="string"){if(typeof P=="string"?(H=P,P=0,U=this.length):typeof U=="string"&&(H=U,U=this.length),H!==void 0&&typeof H!="string")throw new TypeError("encoding must be a string");if(typeof H=="string"&&!p.isEncoding(H))throw new TypeError("Unknown encoding: "+H);if(I.length===1){let fe=I.charCodeAt(0);(H==="utf8"&&fe<128||H==="latin1")&&(I=fe)}}else typeof I=="number"?I=I&255:typeof I=="boolean"&&(I=Number(I));if(P<0||this.length<P||this.length<U)throw new RangeError("Out of range index");if(U<=P)return this;P=P>>>0,U=U===void 0?this.length:U>>>0,I||(I=0);let W;if(typeof I=="number")for(W=P;W<U;++W)this[W]=I;else{let fe=p.isBuffer(I)?I:p.from(I,H),st=fe.length;if(st===0)throw new TypeError('The value "'+I+'" is invalid for argument "value"');for(W=0;W<U-P;++W)this[W+P]=fe[W%st]}return this};var Z={};function K(T,I,P){Z[T]=class extends P{constructor(){super(),Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(H){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:H,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,I){return`The "${T}" argument must be of type number. Received type ${typeof I}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,I,P){let U=`The value of "${T}" is out of range.`,H=P;return Number.isInteger(P)&&Math.abs(P)>2**32?H=ce(String(P)):typeof P=="bigint"&&(H=String(P),(P>BigInt(2)**BigInt(32)||P<-(BigInt(2)**BigInt(32)))&&(H=ce(H)),H+="n"),U+=` It must be ${I}. Received ${H}`,U},RangeError);function ce(T){let I="",P=T.length,U=T[0]==="-"?1:0;for(;P>=U+4;P-=3)I=`_${T.slice(P-3,P)}${I}`;return`${T.slice(0,P)}${I}`}function te(T,I,P){J(I,"offset"),(T[I]===void 0||T[I+P]===void 0)&&X(I,T.length-(P+1))}function j(T,I,P,U,H,W){if(T>P||T<I){let fe=typeof I=="bigint"?"n":"",st;throw W>3?I===0||I===BigInt(0)?st=`>= 0${fe} and < 2${fe} ** ${(W+1)*8}${fe}`:st=`>= -(2${fe} ** ${(W+1)*8-1}${fe}) and < 2 ** ${(W+1)*8-1}${fe}`:st=`>= ${I}${fe} and <= ${P}${fe}`,new Z.ERR_OUT_OF_RANGE("value",st,T)}te(U,H,W)}function J(T,I){if(typeof T!="number")throw new Z.ERR_INVALID_ARG_TYPE(I,"number",T)}function X(T,I,P){throw Math.floor(T)!==T?(J(T,P),new Z.ERR_OUT_OF_RANGE(P||"offset","an integer",T)):I<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(P||"offset",`>= ${P?1:0} and <= ${I}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function Te(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,I){I=I||1/0;let P,U=T.length,H=null,W=[];for(let fe=0;fe<U;++fe){if(P=T.charCodeAt(fe),P>55295&&P<57344){if(!H){if(P>56319){(I-=3)>-1&&W.push(239,191,189);continue}else if(fe+1===U){(I-=3)>-1&&W.push(239,191,189);continue}H=P;continue}if(P<56320){(I-=3)>-1&&W.push(239,191,189),H=P;continue}P=(H-55296<<10|P-56320)+65536}else H&&(I-=3)>-1&&W.push(239,191,189);if(H=null,P<128){if((I-=1)<0)break;W.push(P)}else if(P<2048){if((I-=2)<0)break;W.push(P>>6|192,P&63|128)}else if(P<65536){if((I-=3)<0)break;W.push(P>>12|224,P>>6&63|128,P&63|128)}else if(P<1114112){if((I-=4)<0)break;W.push(P>>18|240,P>>12&63|128,P>>6&63|128,P&63|128)}else throw new Error("Invalid code point")}return W}function le(T){let I=[];for(let P=0;P<T.length;++P)I.push(T.charCodeAt(P)&255);return I}function ot(T,I){let P,U,H,W=[];for(let fe=0;fe<T.length&&!((I-=2)<0);++fe)P=T.charCodeAt(fe),U=P>>8,H=P%256,W.push(H),W.push(U);return W}function ge(T){return e.toByteArray(Te(T))}function Se(T,I,P,U){let H;for(H=0;H<U&&!(H+P>=I.length||H>=T.length);++H)I[H+P]=T[H];return H}function ut(T,I){return T instanceof I||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===I.name}function Ze(T){return T!==T}var Ge=function(){let T="0123456789abcdef",I=new Array(256);for(let P=0;P<16;++P){let U=P*16;for(let H=0;H<16;++H)I[U+H]=T[P]+T[H]}return I}();function ct(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}}),gBe={"@@functional/placeholder":!0};function Yi(t){return t===gBe}function Fa(t){return function e(r){return arguments.length===0||Yi(r)?e:t.apply(this,arguments)}}function Fn(t){return function e(r,a){switch(arguments.length){case 0:return e;case 1:return Yi(r)?e:Fa(function(i){return t(r,i)});default:return Yi(r)&&Yi(a)?e:Yi(r)?Fa(function(i){return t(i,a)}):Yi(a)?Fa(function(i){return t(r,i)}):t(r,a)}}}function Ew(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(r){return e.apply(this,arguments)};case 2:return function(r,a){return e.apply(this,arguments)};case 3:return function(r,a,i){return e.apply(this,arguments)};case 4:return function(r,a,i,h){return e.apply(this,arguments)};case 5:return function(r,a,i,h,c){return e.apply(this,arguments)};case 6:return function(r,a,i,h,c,p){return e.apply(this,arguments)};case 7:return function(r,a,i,h,c,p,b){return e.apply(this,arguments)};case 8:return function(r,a,i,h,c,p,b,g){return e.apply(this,arguments)};case 9:return function(r,a,i,h,c,p,b,g,y){return e.apply(this,arguments)};case 10:return function(r,a,i,h,c,p,b,g,y,M){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function loe(t,e,r){return function(){for(var a=[],i=0,h=t,c=0,p=!1;c<e.length||i<arguments.length;){var b;c<e.length&&(!Yi(e[c])||i>=arguments.length)?b=e[c]:(b=arguments[i],i+=1),a[c]=b,Yi(b)?p=!0:h-=1,c+=1}return!p&&h<=0?r.apply(this,a):Ew(Math.max(0,h),loe(t,a,r))}}var bBe=Fn(function(t,e){return t===1?Fa(e):Ew(t,loe(t,[],e))}),doe=bBe;function hB(t){return function e(r,a,i){switch(arguments.length){case 0:return e;case 1:return Yi(r)?e:Fn(function(h,c){return t(r,h,c)});case 2:return Yi(r)&&Yi(a)?e:Yi(r)?Fn(function(h,c){return t(h,a,c)}):Yi(a)?Fn(function(h,c){return t(r,h,c)}):Fa(function(h){return t(r,a,h)});default:return Yi(r)&&Yi(a)&&Yi(i)?e:Yi(r)&&Yi(a)?Fn(function(h,c){return t(h,c,i)}):Yi(r)&&Yi(i)?Fn(function(h,c){return t(h,a,c)}):Yi(a)&&Yi(i)?Fn(function(h,c){return t(r,h,c)}):Yi(r)?Fa(function(h){return t(h,a,i)}):Yi(a)?Fa(function(h){return t(r,h,i)}):Yi(i)?Fa(function(h){return t(r,a,h)}):t(r,a,i)}}}var cB=Array.isArray||function(t){return t!=null&&t.length>=0&&Object.prototype.toString.call(t)==="[object Array]"};function yBe(t){return t!=null&&typeof t["@@transducer/step"]=="function"}function lB(t,e,r){return function(){if(arguments.length===0)return r();var a=arguments[arguments.length-1];if(!cB(a)){for(var i=0;i<t.length;){if(typeof a[t[i]]=="function")return a[t[i]].apply(a,Array.prototype.slice.call(arguments,0,-1));i+=1}if(yBe(a)){var h=e.apply(null,Array.prototype.slice.call(arguments,0,-1));return h(a)}}return r.apply(this,arguments)}}function wBe(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}var B2={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}};function Dae(t){for(var e=[],r;!(r=t.next()).done;)e.push(r.value);return e}function Uae(t,e,r){for(var a=0,i=r.length;a<i;){if(t(e,r[a]))return!0;a+=1}return!1}function _Be(t){var e=String(t).match(/^function (\w*)/);return e==null?"":e[1]}function tw(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function MBe(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var AI=typeof Object.is=="function"?Object.is:MBe,qae=Object.prototype.toString,xBe=function(){return qae.call(arguments)==="[object Arguments]"?function(t){return qae.call(t)==="[object Arguments]"}:function(t){return tw("callee",t)}}(),SBe=xBe,EBe=!{toString:null}.propertyIsEnumerable("toString"),Fae=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],jae=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),ABe=function(t,e){for(var r=0;r<t.length;){if(t[r]===e)return!0;r+=1}return!1},RBe=Fa(typeof Object.keys=="function"&&!jae?function(t){return Object(t)!==t?[]:Object.keys(t)}:function(t){if(Object(t)!==t)return[];var e,r,a=[],i=jae&&SBe(t);for(e in t)tw(e,t)&&(!i||e!=="length")&&(a[a.length]=e);if(EBe)for(r=Fae.length-1;r>=0;)e=Fae[r],tw(e,t)&&!ABe(a,e)&&(a[a.length]=e),r-=1;return a}),ev=RBe,TBe=Fa(function(t){return t===null?"Null":t===void 0?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}),zae=TBe;function Zae(t,e,r,a){var i=Dae(t),h=Dae(e);function c(p,b){return dB(p,b,r.slice(),a.slice())}return!Uae(function(p,b){return!Uae(c,b,p)},h,i)}function dB(t,e,r,a){if(AI(t,e))return!0;var i=zae(t);if(i!==zae(e))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof e.equals=="function")return typeof t.equals=="function"&&t.equals(e)&&typeof e.equals=="function"&&e.equals(t);switch(i){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&_Be(t.constructor)==="Promise")return t===e;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof e&&AI(t.valueOf(),e.valueOf())))return!1;break;case"Date":if(!AI(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(!(t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky&&t.unicode===e.unicode))return!1;break}for(var h=r.length-1;h>=0;){if(r[h]===t)return a[h]===e;h-=1}switch(i){case"Map":return t.size!==e.size?!1:Zae(t.entries(),e.entries(),r.concat([t]),a.concat([e]));case"Set":return t.size!==e.size?!1:Zae(t.values(),e.values(),r.concat([t]),a.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=ev(t);if(c.length!==ev(e).length)return!1;var p=r.concat([t]),b=a.concat([e]);for(h=c.length-1;h>=0;){var g=c[h];if(!(tw(g,e)&&dB(e[g],t[g],p,b)))return!1;h-=1}return!0}var kBe=Fn(function(t,e){return dB(t,e,[],[])}),poe=kBe;function IBe(t,e,r){var a,i;if(typeof t.indexOf=="function")switch(typeof e){case"number":if(e===0){for(a=1/e;r<t.length;){if(i=t[r],i===0&&1/i===a)return r;r+=1}return-1}else if(e!==e){for(;r<t.length;){if(i=t[r],typeof i=="number"&&i!==i)return r;r+=1}return-1}return t.indexOf(e,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(e,r);case"object":if(e===null)return t.indexOf(e,r)}for(;r<t.length;){if(poe(t[r],e))return r;r+=1}return-1}function BBe(t,e){return IBe(e,t,0)>=0}function k2(t,e){for(var r=0,a=e.length,i=Array(a);r<a;)i[r]=t(e[r]),r+=1;return i}function RI(t){var e=t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+e.replace(/"/g,'\\"')+'"'}var b2=function(t){return(t<10?"0":"")+t},OBe=typeof Date.prototype.toISOString=="function"?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+b2(t.getUTCMonth()+1)+"-"+b2(t.getUTCDate())+"T"+b2(t.getUTCHours())+":"+b2(t.getUTCMinutes())+":"+b2(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},PBe=OBe;function NBe(t){return function(){return!t.apply(this,arguments)}}function voe(t,e,r){for(var a=0,i=r.length;a<i;)e=t(e,r[a]),a+=1;return e}function CBe(t,e){for(var r=0,a=e.length,i=[];r<a;)t(e[r])&&(i[i.length]=e[r]),r+=1;return i}function LBe(t){return Object.prototype.toString.call(t)==="[object Object]"}var $Be=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=B2.init,t.prototype["@@transducer/result"]=B2.result,t.prototype["@@transducer/step"]=function(e,r){return this.f(r)?this.xf["@@transducer/step"](e,r):e},t}();function DBe(t){return function(e){return new $Be(t,e)}}var UBe=Fn(lB(["fantasy-land/filter","filter"],DBe,function(t,e){return LBe(e)?voe(function(r,a){return t(e[a])&&(r[a]=e[a]),r},{},ev(e)):CBe(t,e)})),qBe=UBe,FBe=Fn(function(t,e){return qBe(NBe(t),e)}),jBe=FBe;function moe(t,e){var r=function(h){var c=e.concat([t]);return BBe(h,c)?"<Circular>":moe(h,c)},a=function(h,c){return k2(function(p){return RI(p)+": "+r(h[p])},c.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+k2(r,t).join(", ")+"))";case"[object Array]":return"["+k2(r,t).concat(a(t,jBe(function(h){return/^\d+$/.test(h)},ev(t)))).join(", ")+"]";case"[object Boolean]":return typeof t=="object"?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):RI(PBe(t)))+")";case"[object Map]":return"new Map("+r(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return typeof t=="object"?"new Number("+r(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+r(Array.from(t).sort())+")";case"[object String]":return typeof t=="object"?"new String("+r(t.valueOf())+")":RI(t);case"[object Undefined]":return"undefined";default:if(typeof t.toString=="function"){var i=t.toString();if(i!=="[object Object]")return i}return"{"+a(t,ev(t)).join(", ")+"}"}}var zBe=Fa(function(t){return moe(t,[])}),Hae=zBe,ZBe=Fn(function(t,e){if(t===e)return e;function r(p,b){if(p>b!=b>p)return b>p?b:p}var a=r(t,e);if(a!==void 0)return a;var i=r(typeof t,typeof e);if(i!==void 0)return i===typeof t?t:e;var h=Hae(t),c=r(h,Hae(e));return c!==void 0&&c===h?t:e}),HBe=ZBe,KBe=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=B2.init,t.prototype["@@transducer/result"]=B2.result,t.prototype["@@transducer/step"]=function(e,r){return this.xf["@@transducer/step"](e,this.f(r))},t}(),WBe=function(t){return function(e){return new KBe(t,e)}},VBe=WBe,GBe=Fn(lB(["fantasy-land/map","map"],VBe,function(t,e){switch(Object.prototype.toString.call(e)){case"[object Function]":return doe(e.length,function(){return t.call(this,e.apply(this,arguments))});case"[object Object]":return voe(function(r,a){return r[a]=t(e[a]),r},{},ev(e));default:return k2(t,e)}})),YBe=GBe,goe=Number.isInteger||function(t){return t<<0===t};function boe(t){return Object.prototype.toString.call(t)==="[object String]"}function yoe(t,e){var r=t<0?e.length+t:t;return boe(e)?e.charAt(r):e[r]}var JBe=Fn(function(t,e){if(e!=null)return goe(t)?yoe(t,e):e[t]}),Aw=JBe,XBe=Fn(function(t,e){return YBe(Aw(t),e)}),QBe=XBe,eOe=Fa(function(t){return cB(t)?!0:!t||typeof t!="object"||boe(t)?!1:t.length===0?!0:t.length>0?t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1):!1}),tOe=eOe,Kae=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function rOe(t,e,r){return function(a,i,h){if(tOe(h))return t(a,i,h);if(h==null)return i;if(typeof h["fantasy-land/reduce"]=="function")return e(a,i,h,"fantasy-land/reduce");if(h[Kae]!=null)return r(a,i,h[Kae]());if(typeof h.next=="function")return r(a,i,h);if(typeof h.reduce=="function")return e(a,i,h,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function iOe(t,e,r){for(var a=0,i=r.length;a<i;){if(e=t["@@transducer/step"](e,r[a]),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a+=1}return t["@@transducer/result"](e)}var nOe=Fn(function(t,e){return Ew(t.length,function(){return t.apply(e,arguments)})}),aOe=nOe;function oOe(t,e,r){for(var a=r.next();!a.done;){if(e=t["@@transducer/step"](e,a.value),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a=r.next()}return t["@@transducer/result"](e)}function sOe(t,e,r,a){return t["@@transducer/result"](r[a](aOe(t["@@transducer/step"],t),e))}var fOe=rOe(iOe,sOe,oOe),uOe=fOe,hOe=function(){function t(e){this.f=e}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(e){return e},t.prototype["@@transducer/step"]=function(e,r){return this.f(e,r)},t}();function cOe(t){return new hOe(t)}var lOe=hB(function(t,e,r){return uOe(typeof t=="function"?cOe(t):t,e,r)}),woe=lOe;function dOe(t,e){return function(){return e.call(this,t.apply(this,arguments))}}function _oe(t,e){return function(){var r=arguments.length;if(r===0)return e();var a=arguments[r-1];return cB(a)||typeof a[t]!="function"?e.apply(this,arguments):a[t].apply(a,Array.prototype.slice.call(arguments,0,r-1))}}var pOe=hB(_oe("slice",function(t,e,r){return Array.prototype.slice.call(r,t,e)})),vOe=pOe,mOe=Fa(_oe("tail",vOe(1,1/0))),gOe=mOe;function Moe(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return Ew(arguments[0].length,woe(dOe,arguments[0],gOe(arguments)))}var bOe=Fn(function(t,e){return doe(woe(HBe,0,QBe("length",e)),function(){var r=arguments,a=this;return t.apply(a,k2(function(i){return i.apply(a,r)},e))})}),yOe=bOe,wOe=Fn(function(t,e){return e==null||e!==e?t:e}),CI=wOe,_Oe=function(){function t(e,r){this.xf=r,this.f=e,this.found=!1}return t.prototype["@@transducer/init"]=B2.init,t.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,void 0)),this.xf["@@transducer/result"](e)},t.prototype["@@transducer/step"]=function(e,r){return this.f(r)&&(this.found=!0,e=wBe(this.xf["@@transducer/step"](e,r))),e},t}();function MOe(t){return function(e){return new _Oe(t,e)}}var xOe=Fn(lB(["find"],MOe,function(t,e){for(var r=0,a=e.length;r<a;){if(t(e[r]))return e[r];r+=1}})),SOe=xOe,EOe=Fa(function(t){return yOe(function(){return Array.prototype.slice.call(arguments,0)},t)}),AOe=EOe;function ROe(t,e){for(var r=e,a=0;a<t.length;a+=1){if(r==null)return;var i=t[a];goe(i)?r=yoe(i,r):r=r[i]}return r}var TOe=Fn(ROe),xoe=TOe,kOe=hB(function(t,e,r){return poe(t,Aw(e,r))}),IOe=kOe,rw=class extends Error{name="InvalidSchedulerLocation"},BOe=class extends Error{name="SchedulerTagNotFound"},OOe=class extends Error{name="TransactionNotFound"},POe="Url",NOe="Time-To-Live",COe="Scheduler",LI=t=>Moe(CI([]),SOe(IOe(t,"name")),CI({}),Aw("value")),Soe=t=>Moe(e=>{if(!e)throw new OOe(t);return e},Aw("tags"),CI([]));function Eoe({fetch:t,GRAPHQL_URL:e}){return async({query:r,variables:a})=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:r,variables:a})}).then(i=>i.json())}function LOe({fetch:t,GRAPHQL_URL:e}){let r=Eoe({fetch:t,GRAPHQL_URL:e}),a=Aoe({fetch:t,GRAPHQL_URL:e}),i=`
132
+ nonce: bundlr`),Me.from(i))}};ie();ae();ne();var Q0=class{_publicKey;ownerLength=Wr[wr.MULTIAPTOS].pubLength;signatureLength=Wr[wr.MULTIAPTOS].sigLength;signatureType=wr.MULTIAPTOS;collectSignatures;provider;constructor(e,r){this._publicKey=e,this.collectSignatures=r}get publicKey(){return this._publicKey}async sign(e){let{signatures:r,bitmap:a}=await this.collectSignatures(e),i=128,h=new Uint8Array([0,0,0,0]),c=new Set;a.forEach(g=>{if(g>=32)throw new Error(`Invalid bit value ${g}.`);if(c.has(g))throw new Error("Duplicated bits detected.");c.add(g);let y=Math.floor(g/8),M=h[y];M|=i>>g%8,h[y]=M});let p=Me.alloc(this.signatureLength),b=0;for(let g=0;g<32;g++)a.includes(g)&&p.set(r[b++],g*64);return p.set(h,this.signatureLength-4),p}static async verify(e,r,a){let h=Wr[wr.MULTIAPTOS].sigLength-4,c=a.slice(0,h),p=a.slice(h),b=!1;for(let g=0;g<32;g++){let y=Math.floor(g/8),M=g-y*8;if((p[y]&128>>M)!==0){let E=c.slice(g*64,(g+1)*64),A=e.slice(g*32,(g+1)*32);await Uc(Me.from(E),Me.from(r),Me.from(A))||(b=!0)}}return!b}};ie();ae();ne();var ed=class extends Io{ownerLength=Wr[wr.TYPEDETHEREUM].pubLength;signatureLength=Wr[wr.TYPEDETHEREUM].sigLength;signatureType=wr.TYPEDETHEREUM;address;signer;constructor(e){super(e),this.address="0x"+lg(super.publicKey.slice(1)).slice(-20).toString("hex"),this.signer=new t1(e)}get publicKey(){return Me.from(this.address)}async sign(e){let r=await this.signer._signTypedData(bg,yg,{address:this.address,"Transaction hash":e});return Me.from(r.slice(2),"hex")}static async verify(e,r,a){let i=e.toString(),h=H3(bg,yg,{address:i,"Transaction hash":r},a);return i.toLowerCase()===h.toLowerCase()}},bg={name:"Bundlr",version:"1"},yg={Bundlr:[{name:"Transaction hash",type:"bytes"},{name:"address",type:"address"}]};ie();ae();ne();var rT=class{ownerLength=Wr[wr.TYPEDETHEREUM].pubLength;signatureLength=Wr[wr.TYPEDETHEREUM].sigLength;signatureType=wr.TYPEDETHEREUM;address;signer;publicKey;constructor(e){this.signer=e.getSigner()}async ready(){this.address=(await this.signer.getAddress()).toString().toLowerCase(),this.publicKey=Me.from(this.address)}async sign(e){let r=await this.signer._signTypedData(bg,yg,{address:this.address,"Transaction hash":e});return Me.from(r.slice(2),"hex")}static verify(e,r,a){let i=e.toString(),h=H3(bg,yg,{address:i,"Transaction hash":r},a);return i.toLowerCase()===h.toLowerCase()}};ie();ae();ne();var $X=gi(Do(),1);var p1=class{signer;publicKey;ownerLength=Wr[wr.ARWEAVE].pubLength;signatureLength=Wr[wr.ARWEAVE].sigLength;signatureType=wr.ARWEAVE;constructor(e){this.signer=e}async setPublicKey(){let e=await this.signer.getActivePublicKey();this.publicKey=$X.default.toBuffer(e)}async sign(e){this.publicKey||await this.setPublicKey();let r={name:"RSA-PSS",saltLength:32},a=await this.signer.signature(e,r);return new Uint8Array(Object.values(a).map(h=>+h))}static async verify(e,r,a){return await Sn().verify(e,r,a)}};ie();ae();ne();var wg=class extends Io{signatureType=wr.KYVE};var _g={1:Hc,2:xo,3:Io,4:J0,5:X0,6:Q0,7:ed};ie();ae();ne();ie();ae();ne();async function z4e(t){return qc([(0,Oi.stringToBuffer)("dataitem"),(0,Oi.stringToBuffer)("1"),(0,Oi.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}var Mg=z4e;ie();ae();ne();ie();ae();ne();function xg(t,e){let r=new Uint8Array(t);if(e<0)throw new Error("Array is unsigned, cannot represent -ve numbers");if(e>2**(t*8)-1)throw new Error(`Number ${e} is too large for an array of ${t} bytes`);for(let a=0;a<r.length;a++){let i=e&255;r[a]=i,e=(e-i)/256}return r}function S8(t){return xg(8,t)}function iT(t){return xg(2,t)}function Z4e(t){return xg(16,t)}function E8(t){return xg(32,t)}function yn(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}ie();ae();ne();var Eg=gi(Do(),1);ie();ae();ne();var ks=gi(Do(),1);co();ie();ae();ne();var Sg=class{buf;pos;constructor(e=Me.alloc(A8),r=0){this.buf=e,this.pos=r}writeTags(e){if(!Array.isArray(e))throw new Error("input must be array");let r=e.length,a;if(r)for(this.writeLong(r),a=0;a<r;a++){let i=e[a];if(typeof i?.name!="string"||typeof i?.value!="string")throw new Error(`Invalid tag format for ${i}, expected {name:string, value: string}`);this.writeString(i.name),this.writeString(i.value)}this.writeLong(0)}toBuffer(){let e=Me.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(e,0,0,this.pos),e}writeLong(e){let r=this.buf,a,i;if(e>=-1073741824&&e<1073741824){i=e>=0?e<<1:~e<<1|1;do r[this.pos]=i&127,i>>=7;while(i&&(r[this.pos++]|=128))}else{a=e>=0?e*2:-e*2-1;do r[this.pos]=a&127,a/=128;while(a>=1&&(r[this.pos++]|=128))}this.pos++,this.buf=r}writeString(e){let r=Me.byteLength(e),a=this.buf;this.writeLong(r);let i=this.pos;if(this.pos+=r,!(this.pos>a.length)){if(r>64)this.buf.write(e,this.pos-r,r,"utf8");else{let h,c,p,b;for(h=0,c=r;h<c;h++)p=e.charCodeAt(h),p<128?a[i++]=p:p<2048?(a[i++]=p>>6|192,a[i++]=p&63|128):(p&64512)===55296&&((b=e.charCodeAt(h+1))&64512)===56320?(p=65536+((p&1023)<<10)+(b&1023),h++,a[i++]=p>>18|240,a[i++]=p>>12&63|128,a[i++]=p>>6&63|128,a[i++]=p&63|128):(a[i++]=p>>12|224,a[i++]=p>>6&63|128,a[i++]=p&63|128)}this.buf=a}}readLong(){let e=0,r=0,a=this.buf,i,h,c,p;do i=a[this.pos++],h=i&128,e|=(i&127)<<r,r+=7;while(h&&r<28);if(h){c=e,p=268435456;do i=a[this.pos++],c+=(i&127)*p,p*=128;while(i&128);return(c%2?-(c+1):c)/2}return e>>1^-(e&1)}skipLong(){let e=this.buf;for(;e[this.pos++]&128;);}readTags(){let e=[],r;for(;r=this.readLong();)for(r<0&&(r=-r,this.skipLong());r--;){let a=this.readString(),i=this.readString();e.push({name:a,value:i})}return e}readString(){let e=this.readLong(),r=this.pos,a=this.buf;if(this.pos+=e,this.pos>a.length)throw new Error("TAP Position out of range");return this.buf.slice(r,r+e).toString()}};function nT(t){if(t?.length===0)return Me.allocUnsafe(0);let e=new Sg;return e.writeTags(t),e.toBuffer()}function v1(t){return new Sg(t).readTags()}lu();var T8=80,A8=4096,R8=class t{binary;_id;constructor(e){this.binary=e}static isDataItem(e){return e.binary!==void 0}get signatureType(){let e=yn(this.binary.subarray(0,2));if(wr?.[e]!==void 0)return e;throw new Error("Unknown signature type: "+e)}async isValid(){return t.verify(this.binary)}get id(){return ks.default.encode(this.rawId)}set id(e){this._id=ks.default.toBuffer(e)}get rawId(){return df("sha256").update(this.rawSignature).digest()}set rawId(e){this._id=e}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return ks.default.encode(this.rawSignature)}set rawOwner(e){if(e.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${e.byteLength} bytes.`);this.binary.set(e,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return Wr[this.signatureType].sigLength}get owner(){return ks.default.encode(this.rawOwner)}get ownerLength(){return Wr[this.signatureType].pubLength}get rawTarget(){let e=this.getTargetStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Me.alloc(0)}get target(){return ks.default.encode(this.rawTarget)}get rawAnchor(){let e=this.getAnchorStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Me.alloc(0)}get anchor(){return ks.default.encode(this.rawAnchor)}get rawTags(){let e=this.getTagsStart(),r=yn(this.binary.subarray(e+8,e+16));return this.binary.subarray(e+16,e+16+r)}get tags(){let e=this.getTagsStart();if(yn(this.binary.subarray(e,e+8))==0)return[];let a=yn(this.binary.subarray(e+8,e+16));return v1(Me.from(this.binary.subarray(e+16,e+16+a)))}get tagsB64Url(){return this.tags.map(r=>({name:ks.default.encode(r.name),value:ks.default.encode(r.value)}))}getStartOfData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),a=yn(r);return e+16+a}get rawData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),a=yn(r),i=e+16+a;return this.binary.subarray(i,this.binary.length)}get data(){return ks.default.encode(this.rawData)}getRaw(){return this.binary}async sign(e){return this._id=await k8(this,e),this.rawId}async setSignature(e){this.binary.set(e,2),this._id=Me.from(await Sn().hash(e))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(e=>({name:ks.default.encode(e.name),value:ks.default.encode(e.value)})),data:this.data}}static async verify(e){if(e.byteLength<T8)return!1;let r=new t(e),a=r.signatureType,i=r.getTagsStart(),h=yn(e.subarray(i,i+8)),c=e.subarray(i+8,i+16),p=yn(c);if(p>A8)return!1;if(h>0)try{if(v1(Me.from(e.subarray(i+16,i+16+p))).length!==h)return!1}catch{return!1}let b=_g[a],g=await Mg(r);return await b.verify(r.rawOwner,g,r.rawSignature)}async getSignatureData(){return Mg(this)}getTagsStart(){let e=this.getTargetStart(),r=this.binary[e]==1,a=e+(r?33:1),i=this.binary[a]==1;return a+=i?33:1,a}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let e=this.getTargetStart()+1,r=this.binary[this.getTargetStart()]==1;return e+=r?32:0,e}},m1=R8;lu();var Iu=32,I8=class{length;items;binary;constructor(e){this.binary=e,this.length=this.getDataItemCount(),this.items=this.getItems()}getRaw(){return this.binary}get(e){if(typeof e=="number"){if(e>=this.length)throw new RangeError("Index out of range");return this.getByIndex(e)}else return this.getById(e)}getSizes(){let e=[];for(let r=Iu;r<Iu+64*this.length;r+=64)e.push(yn(this.binary.subarray(r,r+32)));return e}getIds(){let e=[];for(let r=Iu;r<Iu+64*this.length;r+=64){let a=this.binary.subarray(r+32,r+64);if(a.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");e.push(Eg.default.encode(a))}return e}getIdBy(e){if(e>this.length-1)throw new RangeError("Index of bundle out of range");let r=64+64*e;return Eg.default.encode(this.binary.subarray(r,r+32))}async toTransaction(e,r,a){let i=await r.createTransaction({data:this.binary,...e},a);return i.addTag("Bundle-Format","binary"),i.addTag("Bundle-Version","2.0.0"),i}async verify(){for(let e of this.items){let r=await e.isValid(),a=(0,Eg.default)(df("sha256").update(e.rawSignature).digest());if(!(r&&e.id===a))return!1}return!0}getOffset(e){let r=0;for(let a=Iu;a<Iu+64*this.length;a+=64){let i=yn(this.binary.subarray(a,a+32));r+=i;let h=this.binary.subarray(a+32,a+64);if(Me.compare(h,e)===0)return{startOffset:r,size:i}}return{startOffset:-1,size:-1}}getByIndex(e){let r=0,a=this.getBundleStart(),i=0,h,c;for(let y=Iu;y<Iu+64*this.length;y+=64){if(h=yn(this.binary.subarray(y,y+32)),i++===e){c=this.binary.subarray(y+32,y+64);break}r+=h}let p=a+r,b=this.binary.subarray(p,p+h),g=new m1(b);return g.rawId=c,g}getById(e){let r=Eg.default.toBuffer(e),a=this.getOffset(r);if(a.startOffset===-1)throw new Error("Transaction not found");let h=this.getBundleStart()+a.startOffset;return new m1(this.binary.subarray(h,h+a.size))}getDataItemCount(){return yn(this.binary.subarray(0,32))}getBundleStart(){return 32+64*this.length}getItems(){let e=new Array(this.length),r=0,a=this.getBundleStart(),i=0;for(let h=Iu;h<Iu+64*this.length;h+=64){let c=yn(this.binary.subarray(h,h+32)),p=this.binary.subarray(h+32,h+64);if(p.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");let b=a+r,g=this.binary.subarray(b,b+c);r+=c;let y=new m1(g);y.rawId=p,e[i]=y,i++}return e}},aT=I8;function H4e(t){return new aT(t)}async function K4e(t,e){let r=new Uint8Array(64*t.length),a=await Promise.all(t.map(async(h,c)=>{let p=h.isSigned()?h.rawId:await k8(h,e),b=new Uint8Array(64);return b.set(E8(h.getRaw().byteLength),0),b.set(p,32),r.set(b,64*c),h.getRaw()})).then(h=>Me.concat(h)),i=Me.concat([Me.from(E8(t.length)),Me.from(r),a]);return new aT(i)}async function DX(t,e){let r=await Mg(t),a=await e.sign(r),i=await Sn().hash(a);return{signature:Me.from(a),id:Me.from(i)}}async function k8(t,e){let{signature:r,id:a}=await DX(t,e);return t.getRaw().set(r,2),a}ie();ae();ne();var UX=gi(Do(),1);function Ag(t,e,r){let a=e.publicKey,i=r?.target?UX.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),c=r?.anchor?Me.from(r.anchor):null,p=1+(c?.byteLength??0),b=(r?.tags?.length??0)>0?nT(r?.tags):null,g=16+(b?b.byteLength:0),y=typeof t=="string"?Me.from(t):Me.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+p+g+M,E=Me.alloc(x);if(E.set(iT(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),a.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${a.byteLength}`);E.set(a,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let k=A+h,O=k+1;if(E[k]=c?1:0,c){if(O+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(c,k+1)}E.set(S8(r?.tags?.length??0),O);let N=S8(b?.byteLength??0);E.set(N,O+8),b&&E.set(b,O+16);let L=O+g;return E.set(y,L),new m1(E)}ie();ae();ne();ie();ae();ne();var oT=class{signatureType;rawSignature;signature;signatureLength;rawOwner;owner;ownerLength;rawTarget;target;rawAnchor;anchor;rawTags;tags;rawData;data;static async verify(...e){throw new Error("You must implement `verify`")}};ie();ae();ne();ie();ae();ne();var hT={};Ha(hT,{default:()=>G4e,processStream:()=>ZX,streamExportForTesting:()=>Y4e,streamSigner:()=>V4e});ie();ae();ne();B8();var td=gi(Do(),1);lu();async function ZX(t){let e=HX(t),r=(await e.next()).value;r=await La(e,r,32);let a=yn(r.subarray(0,32));r=r.subarray(32);let i=64*a;r=await La(e,r,i);let h=new Array(a);for(let b=0;b<i;b+=64)h[b/64]=[yn(r.subarray(b,b+32)),(0,td.default)(Me.from(r.subarray(b+32,b+64)))];r=r.subarray(i);let c=32+i,p=[];for(let[b,g]of h){r=await La(e,r,T8),r=await La(e,r,2);let y=yn(r.subarray(0,2));r=r.subarray(2);let{sigLength:M,pubLength:x,sigName:E}=Wr[y];r=await La(e,r,M);let A=r.subarray(0,M);r=r.subarray(M),r=await La(e,r,x);let k=r.subarray(0,x);r=r.subarray(x),r=await La(e,r,1);let O=r[0]===1;O&&(r=await La(e,r,33));let N=O?r.subarray(1,33):Me.allocUnsafe(0);r=r.subarray(O?33:1),r=await La(e,r,1);let L=r[0]===1;L&&(r=await La(e,r,33));let C=L?r.subarray(1,33):Me.allocUnsafe(0);r=r.subarray(L?33:1),r=await La(e,r,8);let Y=yn(r.subarray(0,8));r=r.subarray(8),r=await La(e,r,8);let G=yn(r.subarray(0,8));r=r.subarray(8),r=await La(e,r,G);let ee=r.subarray(0,G),$=Y!==0&&G!==0?v1(Me.from(ee)):[];if($.length!==Y)throw new Error("Tags lengths don't match");r=r.subarray(G);let q=new jX;q._transform=function(f,u,l){this.push(f),l()};let V=qc([(0,Oi.stringToBuffer)("dataitem"),(0,Oi.stringToBuffer)("1"),(0,Oi.stringToBuffer)(y.toString()),k,N,C,ee,q]),_=2+M+x+(O?33:1)+(L?33:1)+16+G,n=b-_;if(r.byteLength>n)q.write(r.subarray(0,n)),r=r.subarray(n);else{let f=r.byteLength;for(q.write(r);n>f;){if(r=(await e.next()).value,!r)throw new Error(`Not enough data bytes expected: ${n} received: ${f}`);f+=r.byteLength,f>n?q.write(r.subarray(0,r.byteLength-(f-n))):q.write(r)}r=r.subarray(r.byteLength-(f-n))}if(q.end(),g!==(0,td.default)(df("sha256").update(A).digest()))throw new Error("ID doesn't match signature");if(!await _g[y].verify(k,await V,A))throw new Error("Invalid signature");p.push({id:g,sigName:E,signature:(0,td.default)(Me.from(A)),target:(0,td.default)(Me.from(N)),anchor:(0,td.default)(Me.from(C)),owner:(0,td.default)(Me.from(k)),tags:$,dataOffset:c+_,dataSize:n}),c+=_+n}return p}async function V4e(t,e,r,a){let i=Ag("",r,a),h=new zX,c=[(0,Oi.stringToBuffer)("dataitem"),(0,Oi.stringToBuffer)("1"),(0,Oi.stringToBuffer)(i.signatureType.toString()),i.rawOwner,i.rawTarget,i.rawAnchor,i.rawTags,t],p=await qc(c),b=Me.from(await r.sign(p));return i.setSignature(b),h.write(i.getRaw()),e.pipe(h)}async function La(t,e,r){if(e.byteLength>=r)return e;let{done:a,value:i}=await t.next();if(a&&!i)throw new Error("Invalid buffer");return La(t,Me.concat([Me.from(e),Me.from(i)]),r)}async function*HX(t){for await(let e of t)yield e}var G4e=ZX,Y4e={readBytes:La,getReader:HX};var J4e={...sT,stream:hT};globalThis.arbundles??=J4e;ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var fi;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let h={};for(let c of i)h[c]=c;return h},t.getValidEnumValues=i=>{let h=t.objectKeys(i).filter(p=>typeof i[i[p]]!="number"),c={};for(let p of h)c[p]=i[p];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(h){return i[h]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let h=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&h.push(c);return h},t.find=(i,h)=>{for(let c of i)if(h(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function a(i,h=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(h)}t.joinValues=a,t.jsonStringifyReplacer=(i,h)=>typeof h=="bigint"?h.toString():h})(fi||(fi={}));var lT;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(lT||(lT={}));var Yt=fi.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cl=t=>{switch(typeof t){case"undefined":return Yt.undefined;case"string":return Yt.string;case"number":return isNaN(t)?Yt.nan:Yt.number;case"boolean":return Yt.boolean;case"function":return Yt.function;case"bigint":return Yt.bigint;case"symbol":return Yt.symbol;case"object":return Array.isArray(t)?Yt.array:t===null?Yt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Yt.promise:typeof Map<"u"&&t instanceof Map?Yt.map:typeof Set<"u"&&t instanceof Set?Yt.set:typeof Date<"u"&&t instanceof Date?Yt.date:Yt.object;default:return Yt.unknown}},Ot=fi.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),X4e=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Bo=class t extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(h){return h.message},a={_errors:[]},i=h=>{for(let c of h.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)a._errors.push(r(c));else{let p=a,b=0;for(;b<c.path.length;){let g=c.path[b];b===c.path.length-1?(p[g]=p[g]||{_errors:[]},p[g]._errors.push(r(c))):p[g]=p[g]||{_errors:[]},p=p[g],b++}}};return i(this),a}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,fi.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},a=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):a.push(e(i));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}};Bo.create=t=>new Bo(t);var y1=(t,e)=>{let r;switch(t.code){case Ot.invalid_type:t.received===Yt.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Ot.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,fi.jsonStringifyReplacer)}`;break;case Ot.unrecognized_keys:r=`Unrecognized key(s) in object: ${fi.joinValues(t.keys,", ")}`;break;case Ot.invalid_union:r="Invalid input";break;case Ot.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${fi.joinValues(t.options)}`;break;case Ot.invalid_enum_value:r=`Invalid enum value. Expected ${fi.joinValues(t.options)}, received '${t.received}'`;break;case Ot.invalid_arguments:r="Invalid function arguments";break;case Ot.invalid_return_type:r="Invalid function return type";break;case Ot.invalid_date:r="Invalid date";break;case Ot.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:fi.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Ot.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Ot.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Ot.custom:r="Invalid input";break;case Ot.invalid_intersection_types:r="Intersection results could not be merged";break;case Ot.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Ot.not_finite:r="Number must be finite";break;default:r=e.defaultError,fi.assertNever(t)}return{message:r}},VX=y1;function Q4e(t){VX=t}function O8(){return VX}var P8=t=>{let{data:e,path:r,errorMaps:a,issueData:i}=t,h=[...r,...i.path||[]],c={...i,path:h};if(i.message!==void 0)return{...i,path:h,message:i.message};let p="",b=a.filter(g=>!!g).slice().reverse();for(let g of b)p=g(c,{data:e,defaultError:p}).message;return{...i,path:h,message:p}},ewe=[];function Wt(t,e){let r=O8(),a=P8({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===y1?void 0:y1].filter(i=>!!i)});t.common.issues.push(a)}var Ia=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let a=[];for(let i of r){if(i.status==="aborted")return pr;i.status==="dirty"&&e.dirty(),a.push(i.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,r){let a=[];for(let i of r){let h=await i.key,c=await i.value;a.push({key:h,value:c})}return t.mergeObjectSync(e,a)}static mergeObjectSync(e,r){let a={};for(let i of r){let{key:h,value:c}=i;if(h.status==="aborted"||c.status==="aborted")return pr;h.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),h.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(a[h.value]=c.value)}return{status:e.value,value:a}}},pr=Object.freeze({status:"aborted"}),b1=t=>({status:"dirty",value:t}),$a=t=>({status:"valid",value:t}),dT=t=>t.status==="aborted",pT=t=>t.status==="dirty",Ig=t=>t.status==="valid",Bg=t=>typeof Promise<"u"&&t instanceof Promise;function N8(t,e,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(t):a?a.value:e.get(t)}function GX(t,e,r,a,i){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var rr;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(rr||(rr={}));var Tg,kg,Bs=class{constructor(e,r,a,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=a,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},KX=(t,e)=>{if(Ig(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Bo(t.common.issues);return this._error=r,this._error}}};function Br(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:a,description:i}=t;if(e&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,p)=>{var b,g;let{message:y}=t;return c.code==="invalid_enum_value"?{message:y??p.defaultError}:typeof p.data>"u"?{message:(b=y??a)!==null&&b!==void 0?b:p.defaultError}:c.code!=="invalid_type"?{message:p.defaultError}:{message:(g=y??r)!==null&&g!==void 0?g:p.defaultError}},description:i}}var Or=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return cl(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:cl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ia,ctx:{common:e.parent.common,data:e.data,parsedType:cl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Bg(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let a=this.safeParse(e,r);if(a.success)return a.data;throw a.error}safeParse(e,r){var a;let i={common:{issues:[],async:(a=r?.async)!==null&&a!==void 0?a:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cl(e)},h=this._parseSync({data:e,path:i.path,parent:i});return KX(i,h)}async parseAsync(e,r){let a=await this.safeParseAsync(e,r);if(a.success)return a.data;throw a.error}async safeParseAsync(e,r){let a={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:cl(e)},i=this._parse({data:e,path:a.path,parent:a}),h=await(Bg(i)?i:Promise.resolve(i));return KX(a,h)}refine(e,r){let a=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,h)=>{let c=e(i),p=()=>h.addIssue({code:Ot.custom,...a(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(b=>b?!0:(p(),!1)):c?!0:(p(),!1)})}refinement(e,r){return this._refinement((a,i)=>e(a)?!0:(i.addIssue(typeof r=="function"?r(a,i):r),!1))}_refinement(e){return new Oo({schema:this,typeName:cr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Is.create(this,this._def)}nullable(){return Ou.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ch.create(this,this._def)}promise(){return pl.create(this,this._def)}or(e){return fd.create([this,e],this._def)}and(e){return ud.create(this,e,this._def)}transform(e){return new Oo({...Br(this._def),schema:this,typeName:cr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new pd({...Br(this._def),innerType:this,defaultValue:r,typeName:cr.ZodDefault})}brand(){return new Og({typeName:cr.ZodBranded,type:this,...Br(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new vd({...Br(this._def),innerType:this,catchValue:r,typeName:cr.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Pg.create(this,e)}readonly(){return md.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},twe=/^c[^\s-]{8,}$/i,rwe=/^[0-9a-z]+$/,iwe=/^[0-9A-HJKMNP-TV-Z]{26}$/,nwe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,awe=/^[a-z0-9_-]{21}$/i,owe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,swe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,fwe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",cT,uwe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,hwe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,cwe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,YX="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",lwe=new RegExp(`^${YX}$`);function JX(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function dwe(t){return new RegExp(`^${JX(t)}$`)}function XX(t){let e=`${YX}T${JX(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function pwe(t,e){return!!((e==="v4"||!e)&&uwe.test(t)||(e==="v6"||!e)&&hwe.test(t))}var ll=class t extends Or{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Yt.string){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_type,expected:Yt.string,received:h.parsedType}),pr}let a=new Ia,i;for(let h of this._def.checks)if(h.kind==="min")e.data.length<h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="max")e.data.length>h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="length"){let c=e.data.length>h.value,p=e.data.length<h.value;(c||p)&&(i=this._getOrReturnCtx(e,i),c?Wt(i,{code:Ot.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):p&&Wt(i,{code:Ot.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),a.dirty())}else if(h.kind==="email")swe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"email",code:Ot.invalid_string,message:h.message}),a.dirty());else if(h.kind==="emoji")cT||(cT=new RegExp(fwe,"u")),cT.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"emoji",code:Ot.invalid_string,message:h.message}),a.dirty());else if(h.kind==="uuid")nwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"uuid",code:Ot.invalid_string,message:h.message}),a.dirty());else if(h.kind==="nanoid")awe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"nanoid",code:Ot.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid")twe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"cuid",code:Ot.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid2")rwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"cuid2",code:Ot.invalid_string,message:h.message}),a.dirty());else if(h.kind==="ulid")iwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"ulid",code:Ot.invalid_string,message:h.message}),a.dirty());else if(h.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Wt(i,{validation:"url",code:Ot.invalid_string,message:h.message}),a.dirty()}else h.kind==="regex"?(h.regex.lastIndex=0,h.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"regex",code:Ot.invalid_string,message:h.message}),a.dirty())):h.kind==="trim"?e.data=e.data.trim():h.kind==="includes"?e.data.includes(h.value,h.position)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),a.dirty()):h.kind==="toLowerCase"?e.data=e.data.toLowerCase():h.kind==="toUpperCase"?e.data=e.data.toUpperCase():h.kind==="startsWith"?e.data.startsWith(h.value)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:{startsWith:h.value},message:h.message}),a.dirty()):h.kind==="endsWith"?e.data.endsWith(h.value)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:{endsWith:h.value},message:h.message}),a.dirty()):h.kind==="datetime"?XX(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:"datetime",message:h.message}),a.dirty()):h.kind==="date"?lwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:"date",message:h.message}),a.dirty()):h.kind==="time"?dwe(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.invalid_string,validation:"time",message:h.message}),a.dirty()):h.kind==="duration"?owe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"duration",code:Ot.invalid_string,message:h.message}),a.dirty()):h.kind==="ip"?pwe(e.data,h.version)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"ip",code:Ot.invalid_string,message:h.message}),a.dirty()):h.kind==="base64"?cwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"base64",code:Ot.invalid_string,message:h.message}),a.dirty()):fi.assertNever(h);return{status:a.value,value:e.data}}_regex(e,r,a){return this.refinement(i=>e.test(i),{validation:r,code:Ot.invalid_string,...rr.errToObj(a)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...rr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...rr.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...rr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...rr.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...rr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...rr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...rr.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...rr.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...rr.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...rr.errToObj(e)})}datetime(e){var r,a;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(a=e?.local)!==null&&a!==void 0?a:!1,...rr.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...rr.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...rr.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...rr.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...rr.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...rr.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...rr.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...rr.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...rr.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...rr.errToObj(r)})}nonempty(e){return this.min(1,rr.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};ll.create=t=>{var e;return new ll({checks:[],typeName:cr.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Br(t)})};function vwe(t,e){let r=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,i=r>a?r:a,h=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return h%c/Math.pow(10,i)}var rd=class t extends Or{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Yt.number){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_type,expected:Yt.number,received:h.parsedType}),pr}let a,i=new Ia;for(let h of this._def.checks)h.kind==="int"?fi.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),Wt(a,{code:Ot.invalid_type,expected:"integer",received:"float",message:h.message}),i.dirty()):h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Ot.too_small,minimum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Ot.too_big,maximum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="multipleOf"?vwe(e.data,h.value)!==0&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Ot.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):h.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),Wt(a,{code:Ot.not_finite,message:h.message}),i.dirty()):fi.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,rr.toString(r))}gt(e,r){return this.setLimit("min",e,!1,rr.toString(r))}lte(e,r){return this.setLimit("max",e,!0,rr.toString(r))}lt(e,r){return this.setLimit("max",e,!1,rr.toString(r))}setLimit(e,r,a,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:rr.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:rr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:rr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:rr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:rr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:rr.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:rr.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:rr.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:rr.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:rr.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&fi.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(r)&&Number.isFinite(e)}};rd.create=t=>new rd({checks:[],typeName:cr.ZodNumber,coerce:t?.coerce||!1,...Br(t)});var id=class t extends Or{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Yt.bigint){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_type,expected:Yt.bigint,received:h.parsedType}),pr}let a,i=new Ia;for(let h of this._def.checks)h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Ot.too_small,type:"bigint",minimum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Ot.too_big,type:"bigint",maximum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="multipleOf"?e.data%h.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Ot.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):fi.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,rr.toString(r))}gt(e,r){return this.setLimit("min",e,!1,rr.toString(r))}lte(e,r){return this.setLimit("max",e,!0,rr.toString(r))}lt(e,r){return this.setLimit("max",e,!1,rr.toString(r))}setLimit(e,r,a,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:rr.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:rr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:rr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:rr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:rr.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:rr.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};id.create=t=>{var e;return new id({checks:[],typeName:cr.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Br(t)})};var nd=class extends Or{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Yt.boolean){let a=this._getOrReturnCtx(e);return Wt(a,{code:Ot.invalid_type,expected:Yt.boolean,received:a.parsedType}),pr}return $a(e.data)}};nd.create=t=>new nd({typeName:cr.ZodBoolean,coerce:t?.coerce||!1,...Br(t)});var ad=class t extends Or{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Yt.date){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_type,expected:Yt.date,received:h.parsedType}),pr}if(isNaN(e.data.getTime())){let h=this._getOrReturnCtx(e);return Wt(h,{code:Ot.invalid_date}),pr}let a=new Ia,i;for(let h of this._def.checks)h.kind==="min"?e.data.getTime()<h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.too_small,message:h.message,inclusive:!0,exact:!1,minimum:h.value,type:"date"}),a.dirty()):h.kind==="max"?e.data.getTime()>h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Ot.too_big,message:h.message,inclusive:!0,exact:!1,maximum:h.value,type:"date"}),a.dirty()):fi.assertNever(h);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:rr.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:rr.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};ad.create=t=>new ad({checks:[],coerce:t?.coerce||!1,typeName:cr.ZodDate,...Br(t)});var w1=class extends Or{_parse(e){if(this._getType(e)!==Yt.symbol){let a=this._getOrReturnCtx(e);return Wt(a,{code:Ot.invalid_type,expected:Yt.symbol,received:a.parsedType}),pr}return $a(e.data)}};w1.create=t=>new w1({typeName:cr.ZodSymbol,...Br(t)});var od=class extends Or{_parse(e){if(this._getType(e)!==Yt.undefined){let a=this._getOrReturnCtx(e);return Wt(a,{code:Ot.invalid_type,expected:Yt.undefined,received:a.parsedType}),pr}return $a(e.data)}};od.create=t=>new od({typeName:cr.ZodUndefined,...Br(t)});var sd=class extends Or{_parse(e){if(this._getType(e)!==Yt.null){let a=this._getOrReturnCtx(e);return Wt(a,{code:Ot.invalid_type,expected:Yt.null,received:a.parsedType}),pr}return $a(e.data)}};sd.create=t=>new sd({typeName:cr.ZodNull,...Br(t)});var dl=class extends Or{constructor(){super(...arguments),this._any=!0}_parse(e){return $a(e.data)}};dl.create=t=>new dl({typeName:cr.ZodAny,...Br(t)});var Nh=class extends Or{constructor(){super(...arguments),this._unknown=!0}_parse(e){return $a(e.data)}};Nh.create=t=>new Nh({typeName:cr.ZodUnknown,...Br(t)});var Rf=class extends Or{_parse(e){let r=this._getOrReturnCtx(e);return Wt(r,{code:Ot.invalid_type,expected:Yt.never,received:r.parsedType}),pr}};Rf.create=t=>new Rf({typeName:cr.ZodNever,...Br(t)});var _1=class extends Or{_parse(e){if(this._getType(e)!==Yt.undefined){let a=this._getOrReturnCtx(e);return Wt(a,{code:Ot.invalid_type,expected:Yt.void,received:a.parsedType}),pr}return $a(e.data)}};_1.create=t=>new _1({typeName:cr.ZodVoid,...Br(t)});var Ch=class t extends Or{_parse(e){let{ctx:r,status:a}=this._processInputParams(e),i=this._def;if(r.parsedType!==Yt.array)return Wt(r,{code:Ot.invalid_type,expected:Yt.array,received:r.parsedType}),pr;if(i.exactLength!==null){let c=r.data.length>i.exactLength.value,p=r.data.length<i.exactLength.value;(c||p)&&(Wt(r,{code:c?Ot.too_big:Ot.too_small,minimum:p?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Wt(r,{code:Ot.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Wt(r,{code:Ot.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((c,p)=>i.type._parseAsync(new Bs(r,c,r.path,p)))).then(c=>Ia.mergeArray(a,c));let h=[...r.data].map((c,p)=>i.type._parseSync(new Bs(r,c,r.path,p)));return Ia.mergeArray(a,h)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:rr.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:rr.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:rr.toString(r)}})}nonempty(e){return this.min(1,e)}};Ch.create=(t,e)=>new Ch({type:t,minLength:null,maxLength:null,exactLength:null,typeName:cr.ZodArray,...Br(e)});function g1(t){if(t instanceof ao){let e={};for(let r in t.shape){let a=t.shape[r];e[r]=Is.create(g1(a))}return new ao({...t._def,shape:()=>e})}else return t instanceof Ch?new Ch({...t._def,type:g1(t.element)}):t instanceof Is?Is.create(g1(t.unwrap())):t instanceof Ou?Ou.create(g1(t.unwrap())):t instanceof Bu?Bu.create(t.items.map(e=>g1(e))):t}var ao=class t extends Or{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=fi.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Yt.object){let g=this._getOrReturnCtx(e);return Wt(g,{code:Ot.invalid_type,expected:Yt.object,received:g.parsedType}),pr}let{status:a,ctx:i}=this._processInputParams(e),{shape:h,keys:c}=this._getCached(),p=[];if(!(this._def.catchall instanceof Rf&&this._def.unknownKeys==="strip"))for(let g in i.data)c.includes(g)||p.push(g);let b=[];for(let g of c){let y=h[g],M=i.data[g];b.push({key:{status:"valid",value:g},value:y._parse(new Bs(i,M,i.path,g)),alwaysSet:g in i.data})}if(this._def.catchall instanceof Rf){let g=this._def.unknownKeys;if(g==="passthrough")for(let y of p)b.push({key:{status:"valid",value:y},value:{status:"valid",value:i.data[y]}});else if(g==="strict")p.length>0&&(Wt(i,{code:Ot.unrecognized_keys,keys:p}),a.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let y of p){let M=i.data[y];b.push({key:{status:"valid",value:y},value:g._parse(new Bs(i,M,i.path,y)),alwaysSet:y in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let g=[];for(let y of b){let M=await y.key,x=await y.value;g.push({key:M,value:x,alwaysSet:y.alwaysSet})}return g}).then(g=>Ia.mergeObjectSync(a,g)):Ia.mergeObjectSync(a,b)}get shape(){return this._def.shape()}strict(e){return rr.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,a)=>{var i,h,c,p;let b=(c=(h=(i=this._def).errorMap)===null||h===void 0?void 0:h.call(i,r,a).message)!==null&&c!==void 0?c:a.defaultError;return r.code==="unrecognized_keys"?{message:(p=rr.errToObj(e).message)!==null&&p!==void 0?p:b}:{message:b}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:cr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return fi.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(r[a]=this.shape[a])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{e[a]||(r[a]=this.shape[a])}),new t({...this._def,shape:()=>r})}deepPartial(){return g1(this)}partial(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{let i=this.shape[a];e&&!e[a]?r[a]=i:r[a]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])r[a]=this.shape[a];else{let h=this.shape[a];for(;h instanceof Is;)h=h._def.innerType;r[a]=h}}),new t({...this._def,shape:()=>r})}keyof(){return QX(fi.objectKeys(this.shape))}};ao.create=(t,e)=>new ao({shape:()=>t,unknownKeys:"strip",catchall:Rf.create(),typeName:cr.ZodObject,...Br(e)});ao.strictCreate=(t,e)=>new ao({shape:()=>t,unknownKeys:"strict",catchall:Rf.create(),typeName:cr.ZodObject,...Br(e)});ao.lazycreate=(t,e)=>new ao({shape:t,unknownKeys:"strip",catchall:Rf.create(),typeName:cr.ZodObject,...Br(e)});var fd=class extends Or{_parse(e){let{ctx:r}=this._processInputParams(e),a=this._def.options;function i(h){for(let p of h)if(p.result.status==="valid")return p.result;for(let p of h)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let c=h.map(p=>new Bo(p.ctx.common.issues));return Wt(r,{code:Ot.invalid_union,unionErrors:c}),pr}if(r.common.async)return Promise.all(a.map(async h=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await h._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(i);{let h,c=[];for(let b of a){let g={...r,common:{...r.common,issues:[]},parent:null},y=b._parseSync({data:r.data,path:r.path,parent:g});if(y.status==="valid")return y;y.status==="dirty"&&!h&&(h={result:y,ctx:g}),g.common.issues.length&&c.push(g.common.issues)}if(h)return r.common.issues.push(...h.ctx.common.issues),h.result;let p=c.map(b=>new Bo(b));return Wt(r,{code:Ot.invalid_union,unionErrors:p}),pr}}get options(){return this._def.options}};fd.create=(t,e)=>new fd({options:t,typeName:cr.ZodUnion,...Br(e)});var Ph=t=>t instanceof hd?Ph(t.schema):t instanceof Oo?Ph(t.innerType()):t instanceof cd?[t.value]:t instanceof ld?t.options:t instanceof dd?fi.objectValues(t.enum):t instanceof pd?Ph(t._def.innerType):t instanceof od?[void 0]:t instanceof sd?[null]:t instanceof Is?[void 0,...Ph(t.unwrap())]:t instanceof Ou?[null,...Ph(t.unwrap())]:t instanceof Og||t instanceof md?Ph(t.unwrap()):t instanceof vd?Ph(t._def.innerType):[],C8=class t extends Or{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.object)return Wt(r,{code:Ot.invalid_type,expected:Yt.object,received:r.parsedType}),pr;let a=this.discriminator,i=r.data[a],h=this.optionsMap.get(i);return h?r.common.async?h._parseAsync({data:r.data,path:r.path,parent:r}):h._parseSync({data:r.data,path:r.path,parent:r}):(Wt(r,{code:Ot.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),pr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,a){let i=new Map;for(let h of r){let c=Ph(h.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let p of c){if(i.has(p))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(p)}`);i.set(p,h)}}return new t({typeName:cr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Br(a)})}};function vT(t,e){let r=cl(t),a=cl(e);if(t===e)return{valid:!0,data:t};if(r===Yt.object&&a===Yt.object){let i=fi.objectKeys(e),h=fi.objectKeys(t).filter(p=>i.indexOf(p)!==-1),c={...t,...e};for(let p of h){let b=vT(t[p],e[p]);if(!b.valid)return{valid:!1};c[p]=b.data}return{valid:!0,data:c}}else if(r===Yt.array&&a===Yt.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let h=0;h<t.length;h++){let c=t[h],p=e[h],b=vT(c,p);if(!b.valid)return{valid:!1};i.push(b.data)}return{valid:!0,data:i}}else return r===Yt.date&&a===Yt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ud=class extends Or{_parse(e){let{status:r,ctx:a}=this._processInputParams(e),i=(h,c)=>{if(dT(h)||dT(c))return pr;let p=vT(h.value,c.value);return p.valid?((pT(h)||pT(c))&&r.dirty(),{status:r.value,value:p.data}):(Wt(a,{code:Ot.invalid_intersection_types}),pr)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([h,c])=>i(h,c)):i(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};ud.create=(t,e,r)=>new ud({left:t,right:e,typeName:cr.ZodIntersection,...Br(r)});var Bu=class t extends Or{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.array)return Wt(a,{code:Ot.invalid_type,expected:Yt.array,received:a.parsedType}),pr;if(a.data.length<this._def.items.length)return Wt(a,{code:Ot.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pr;!this._def.rest&&a.data.length>this._def.items.length&&(Wt(a,{code:Ot.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let h=[...a.data].map((c,p)=>{let b=this._def.items[p]||this._def.rest;return b?b._parse(new Bs(a,c,a.path,p)):null}).filter(c=>!!c);return a.common.async?Promise.all(h).then(c=>Ia.mergeArray(r,c)):Ia.mergeArray(r,h)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Bu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bu({items:t,typeName:cr.ZodTuple,rest:null,...Br(e)})};var L8=class t extends Or{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.object)return Wt(a,{code:Ot.invalid_type,expected:Yt.object,received:a.parsedType}),pr;let i=[],h=this._def.keyType,c=this._def.valueType;for(let p in a.data)i.push({key:h._parse(new Bs(a,p,a.path,p)),value:c._parse(new Bs(a,a.data[p],a.path,p)),alwaysSet:p in a.data});return a.common.async?Ia.mergeObjectAsync(r,i):Ia.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,a){return r instanceof Or?new t({keyType:e,valueType:r,typeName:cr.ZodRecord,...Br(a)}):new t({keyType:ll.create(),valueType:e,typeName:cr.ZodRecord,...Br(r)})}},M1=class extends Or{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.map)return Wt(a,{code:Ot.invalid_type,expected:Yt.map,received:a.parsedType}),pr;let i=this._def.keyType,h=this._def.valueType,c=[...a.data.entries()].map(([p,b],g)=>({key:i._parse(new Bs(a,p,a.path,[g,"key"])),value:h._parse(new Bs(a,b,a.path,[g,"value"]))}));if(a.common.async){let p=new Map;return Promise.resolve().then(async()=>{for(let b of c){let g=await b.key,y=await b.value;if(g.status==="aborted"||y.status==="aborted")return pr;(g.status==="dirty"||y.status==="dirty")&&r.dirty(),p.set(g.value,y.value)}return{status:r.value,value:p}})}else{let p=new Map;for(let b of c){let g=b.key,y=b.value;if(g.status==="aborted"||y.status==="aborted")return pr;(g.status==="dirty"||y.status==="dirty")&&r.dirty(),p.set(g.value,y.value)}return{status:r.value,value:p}}}};M1.create=(t,e,r)=>new M1({valueType:e,keyType:t,typeName:cr.ZodMap,...Br(r)});var x1=class t extends Or{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.set)return Wt(a,{code:Ot.invalid_type,expected:Yt.set,received:a.parsedType}),pr;let i=this._def;i.minSize!==null&&a.data.size<i.minSize.value&&(Wt(a,{code:Ot.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&a.data.size>i.maxSize.value&&(Wt(a,{code:Ot.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let h=this._def.valueType;function c(b){let g=new Set;for(let y of b){if(y.status==="aborted")return pr;y.status==="dirty"&&r.dirty(),g.add(y.value)}return{status:r.value,value:g}}let p=[...a.data.values()].map((b,g)=>h._parse(new Bs(a,b,a.path,g)));return a.common.async?Promise.all(p).then(b=>c(b)):c(p)}min(e,r){return new t({...this._def,minSize:{value:e,message:rr.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:rr.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};x1.create=(t,e)=>new x1({valueType:t,minSize:null,maxSize:null,typeName:cr.ZodSet,...Br(e)});var $8=class t extends Or{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.function)return Wt(r,{code:Ot.invalid_type,expected:Yt.function,received:r.parsedType}),pr;function a(p,b){return P8({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,O8(),y1].filter(g=>!!g),issueData:{code:Ot.invalid_arguments,argumentsError:b}})}function i(p,b){return P8({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,O8(),y1].filter(g=>!!g),issueData:{code:Ot.invalid_return_type,returnTypeError:b}})}let h={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof pl){let p=this;return $a(async function(...b){let g=new Bo([]),y=await p._def.args.parseAsync(b,h).catch(E=>{throw g.addIssue(a(b,E)),g}),M=await Reflect.apply(c,this,y);return await p._def.returns._def.type.parseAsync(M,h).catch(E=>{throw g.addIssue(i(M,E)),g})})}else{let p=this;return $a(function(...b){let g=p._def.args.safeParse(b,h);if(!g.success)throw new Bo([a(b,g.error)]);let y=Reflect.apply(c,this,g.data),M=p._def.returns.safeParse(y,h);if(!M.success)throw new Bo([i(y,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Bu.create(e).rest(Nh.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,a){return new t({args:e||Bu.create([]).rest(Nh.create()),returns:r||Nh.create(),typeName:cr.ZodFunction,...Br(a)})}},hd=class extends Or{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};hd.create=(t,e)=>new hd({getter:t,typeName:cr.ZodLazy,...Br(e)});var cd=class extends Or{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return Wt(r,{received:r.data,code:Ot.invalid_literal,expected:this._def.value}),pr}return{status:"valid",value:e.data}}get value(){return this._def.value}};cd.create=(t,e)=>new cd({value:t,typeName:cr.ZodLiteral,...Br(e)});function QX(t,e){return new ld({values:t,typeName:cr.ZodEnum,...Br(e)})}var ld=class t extends Or{constructor(){super(...arguments),Tg.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),a=this._def.values;return Wt(r,{expected:fi.joinValues(a),received:r.parsedType,code:Ot.invalid_type}),pr}if(N8(this,Tg,"f")||GX(this,Tg,new Set(this._def.values),"f"),!N8(this,Tg,"f").has(e.data)){let r=this._getOrReturnCtx(e),a=this._def.values;return Wt(r,{received:r.data,code:Ot.invalid_enum_value,options:a}),pr}return $a(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(a=>!e.includes(a)),{...this._def,...r})}};Tg=new WeakMap;ld.create=QX;var dd=class extends Or{constructor(){super(...arguments),kg.set(this,void 0)}_parse(e){let r=fi.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==Yt.string&&a.parsedType!==Yt.number){let i=fi.objectValues(r);return Wt(a,{expected:fi.joinValues(i),received:a.parsedType,code:Ot.invalid_type}),pr}if(N8(this,kg,"f")||GX(this,kg,new Set(fi.getValidEnumValues(this._def.values)),"f"),!N8(this,kg,"f").has(e.data)){let i=fi.objectValues(r);return Wt(a,{received:a.data,code:Ot.invalid_enum_value,options:i}),pr}return $a(e.data)}get enum(){return this._def.values}};kg=new WeakMap;dd.create=(t,e)=>new dd({values:t,typeName:cr.ZodNativeEnum,...Br(e)});var pl=class extends Or{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.promise&&r.common.async===!1)return Wt(r,{code:Ot.invalid_type,expected:Yt.promise,received:r.parsedType}),pr;let a=r.parsedType===Yt.promise?r.data:Promise.resolve(r.data);return $a(a.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};pl.create=(t,e)=>new pl({type:t,typeName:cr.ZodPromise,...Br(e)});var Oo=class extends Or{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===cr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:a}=this._processInputParams(e),i=this._def.effect||null,h={addIssue:c=>{Wt(a,c),c.fatal?r.abort():r.dirty()},get path(){return a.path}};if(h.addIssue=h.addIssue.bind(h),i.type==="preprocess"){let c=i.transform(a.data,h);if(a.common.async)return Promise.resolve(c).then(async p=>{if(r.value==="aborted")return pr;let b=await this._def.schema._parseAsync({data:p,path:a.path,parent:a});return b.status==="aborted"?pr:b.status==="dirty"||r.value==="dirty"?b1(b.value):b});{if(r.value==="aborted")return pr;let p=this._def.schema._parseSync({data:c,path:a.path,parent:a});return p.status==="aborted"?pr:p.status==="dirty"||r.value==="dirty"?b1(p.value):p}}if(i.type==="refinement"){let c=p=>{let b=i.refinement(p,h);if(a.common.async)return Promise.resolve(b);if(b instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(a.common.async===!1){let p=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return p.status==="aborted"?pr:(p.status==="dirty"&&r.dirty(),c(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(p=>p.status==="aborted"?pr:(p.status==="dirty"&&r.dirty(),c(p.value).then(()=>({status:r.value,value:p.value}))))}if(i.type==="transform")if(a.common.async===!1){let c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Ig(c))return c;let p=i.transform(c.value,h);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(c=>Ig(c)?Promise.resolve(i.transform(c.value,h)).then(p=>({status:r.value,value:p})):c);fi.assertNever(i)}};Oo.create=(t,e,r)=>new Oo({schema:t,typeName:cr.ZodEffects,effect:e,...Br(r)});Oo.createWithPreprocess=(t,e,r)=>new Oo({schema:e,effect:{type:"preprocess",transform:t},typeName:cr.ZodEffects,...Br(r)});var Is=class extends Or{_parse(e){return this._getType(e)===Yt.undefined?$a(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Is.create=(t,e)=>new Is({innerType:t,typeName:cr.ZodOptional,...Br(e)});var Ou=class extends Or{_parse(e){return this._getType(e)===Yt.null?$a(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ou.create=(t,e)=>new Ou({innerType:t,typeName:cr.ZodNullable,...Br(e)});var pd=class extends Or{_parse(e){let{ctx:r}=this._processInputParams(e),a=r.data;return r.parsedType===Yt.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};pd.create=(t,e)=>new pd({innerType:t,typeName:cr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Br(e)});var vd=class extends Or{_parse(e){let{ctx:r}=this._processInputParams(e),a={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Bg(i)?i.then(h=>({status:"valid",value:h.status==="valid"?h.value:this._def.catchValue({get error(){return new Bo(a.common.issues)},input:a.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Bo(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};vd.create=(t,e)=>new vd({innerType:t,typeName:cr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Br(e)});var S1=class extends Or{_parse(e){if(this._getType(e)!==Yt.nan){let a=this._getOrReturnCtx(e);return Wt(a,{code:Ot.invalid_type,expected:Yt.nan,received:a.parsedType}),pr}return{status:"valid",value:e.data}}};S1.create=t=>new S1({typeName:cr.ZodNaN,...Br(t)});var mwe=Symbol("zod_brand"),Og=class extends Or{_parse(e){let{ctx:r}=this._processInputParams(e),a=r.data;return this._def.type._parse({data:a,path:r.path,parent:r})}unwrap(){return this._def.type}},Pg=class t extends Or{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{let h=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return h.status==="aborted"?pr:h.status==="dirty"?(r.dirty(),b1(h.value)):this._def.out._parseAsync({data:h.value,path:a.path,parent:a})})();{let i=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?pr:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:a.path,parent:a})}}static create(e,r){return new t({in:e,out:r,typeName:cr.ZodPipeline})}},md=class extends Or{_parse(e){let r=this._def.innerType._parse(e),a=i=>(Ig(i)&&(i.value=Object.freeze(i.value)),i);return Bg(r)?r.then(i=>a(i)):a(r)}unwrap(){return this._def.innerType}};md.create=(t,e)=>new md({innerType:t,typeName:cr.ZodReadonly,...Br(e)});function eQ(t,e={},r){return t?dl.create().superRefine((a,i)=>{var h,c;if(!t(a)){let p=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,b=(c=(h=p.fatal)!==null&&h!==void 0?h:r)!==null&&c!==void 0?c:!0,g=typeof p=="string"?{message:p}:p;i.addIssue({code:"custom",...g,fatal:b})}}):dl.create()}var gwe={object:ao.lazycreate},cr;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(cr||(cr={}));var bwe=(t,e={message:`Input not instance of ${t.name}`})=>eQ(r=>r instanceof t,e),tQ=ll.create,rQ=rd.create,ywe=S1.create,wwe=id.create,iQ=nd.create,_we=ad.create,Mwe=w1.create,xwe=od.create,Swe=sd.create,Ewe=dl.create,Awe=Nh.create,Rwe=Rf.create,Twe=_1.create,kwe=Ch.create,Iwe=ao.create,Bwe=ao.strictCreate,Owe=fd.create,Pwe=C8.create,Nwe=ud.create,Cwe=Bu.create,Lwe=L8.create,$we=M1.create,Dwe=x1.create,Uwe=$8.create,qwe=hd.create,Fwe=cd.create,jwe=ld.create,zwe=dd.create,Zwe=pl.create,WX=Oo.create,Hwe=Is.create,Kwe=Ou.create,Wwe=Oo.createWithPreprocess,Vwe=Pg.create,Gwe=()=>tQ().optional(),Ywe=()=>rQ().optional(),Jwe=()=>iQ().optional(),Xwe={string:t=>ll.create({...t,coerce:!0}),number:t=>rd.create({...t,coerce:!0}),boolean:t=>nd.create({...t,coerce:!0}),bigint:t=>id.create({...t,coerce:!0}),date:t=>ad.create({...t,coerce:!0})},Qwe=pr,vr=Object.freeze({__proto__:null,defaultErrorMap:y1,setErrorMap:Q4e,getErrorMap:O8,makeIssue:P8,EMPTY_PATH:ewe,addIssueToContext:Wt,ParseStatus:Ia,INVALID:pr,DIRTY:b1,OK:$a,isAborted:dT,isDirty:pT,isValid:Ig,isAsync:Bg,get util(){return fi},get objectUtil(){return lT},ZodParsedType:Yt,getParsedType:cl,ZodType:Or,datetimeRegex:XX,ZodString:ll,ZodNumber:rd,ZodBigInt:id,ZodBoolean:nd,ZodDate:ad,ZodSymbol:w1,ZodUndefined:od,ZodNull:sd,ZodAny:dl,ZodUnknown:Nh,ZodNever:Rf,ZodVoid:_1,ZodArray:Ch,ZodObject:ao,ZodUnion:fd,ZodDiscriminatedUnion:C8,ZodIntersection:ud,ZodTuple:Bu,ZodRecord:L8,ZodMap:M1,ZodSet:x1,ZodFunction:$8,ZodLazy:hd,ZodLiteral:cd,ZodEnum:ld,ZodNativeEnum:dd,ZodPromise:pl,ZodEffects:Oo,ZodTransformer:Oo,ZodOptional:Is,ZodNullable:Ou,ZodDefault:pd,ZodCatch:vd,ZodNaN:S1,BRAND:mwe,ZodBranded:Og,ZodPipeline:Pg,ZodReadonly:md,custom:eQ,Schema:Or,ZodSchema:Or,late:gwe,get ZodFirstPartyTypeKind(){return cr},coerce:Xwe,any:Ewe,array:kwe,bigint:wwe,boolean:iQ,date:_we,discriminatedUnion:Pwe,effect:WX,enum:jwe,function:Uwe,instanceof:bwe,intersection:Nwe,lazy:qwe,literal:Fwe,map:$we,nan:ywe,nativeEnum:zwe,never:Rwe,null:Swe,nullable:Kwe,number:rQ,object:Iwe,oboolean:Jwe,onumber:Ywe,optional:Hwe,ostring:Gwe,pipeline:Vwe,preprocess:Wwe,promise:Zwe,record:Lwe,set:Dwe,strictObject:Bwe,string:tQ,symbol:Mwe,transformer:WX,tuple:Cwe,undefined:xwe,union:Owe,unknown:Awe,void:Twe,NEVER:Qwe,ZodIssueCode:Ot,quotelessJson:X4e,ZodError:Bo});ie();ae();ne();var D8=new RegExp("^[a-zA-Z0-9_-]{43}$"),kft=new RegExp("^(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{1,63}$"),Ift=new RegExp("^[0-9]{12},[0-9]{13},[a-fA-F0-9]{64}$"),Bft=He.env.ARNS_REGISTRY_TX??"bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U",Oft="_NctcA2sRy1-J4OmIQZbYFPM17piNcbdBPH2ncX2RL8",e5e="GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc",Pft=e5e,E1="agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA",U8="i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc",mT=1e6,nQ="cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk",gT="pOh2yupSaQCrLI_-ah8tVTiusUdVNTxxeWTQQHNdf30",aQ="_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";var Lh=vr.string({description:"Arweave Transaction ID"}).refine(t=>D8.test(t),{message:"Must be an Arweave Transaction ID"}),oQ=vr.string({description:"Integer String"}).refine(t=>{let e=parseInt(t);return Number.isInteger(e)&&e>=0},{message:"Must be a non negative integer string"}),t5e=vr.string(),fQ=vr.array(vr.string()),q8=vr.object({transactionId:Lh.describe("The Target ID of the undername"),ttlSeconds:vr.number()}),bT=vr.record(vr.string(),q8),yT=vr.array(Lh.describe("Controller address")),wT=vr.record(Lh.describe("Holder address"),vr.number()),_T=vr.object({Name:vr.string().describe("The name of the ANT."),Ticker:vr.string().describe("The ticker symbol for the ANT."),Description:vr.string().describe("The description for the ANT."),Keywords:fQ.describe("The keywords for the ANT."),Denomination:vr.number().describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers.").min(0,{message:"Denomination must be a non-negative number"}),Owner:Lh.describe("The Owners address."),Controllers:yT.describe("Controllers of the ANT who have administrative privileges."),Records:bT.describe("Records associated with the ANT."),Balances:wT.describe("Balance details for each address holding the ANT."),Logo:Lh.describe("Transaction ID of the ANT logo."),TotalSupply:vr.number().describe("Total supply of the ANT in circulation.").min(0,{message:"Total supply must be a non-negative number"}),Initialized:vr.boolean().describe("Flag indicating whether the ANT has been initialized."),"Source-Code-TX-ID":Lh.describe("Transaction ID of the Source Code for the ANT.")}),r5e=["evolve","_eval","_default","transfer","balance","balances","totalSupply","info","addController","removeController","controllers","setRecord","removeRecord","record","records","setName","setTicker","setDescription","setKeywords","initializeState","state","releaseName","reassignName"],sQ=vr.array(vr.string({description:"Handler Name"})).refine(t=>r5e.every(e=>t.includes(e)),{message:"ANT is missing required handlers"}),uQ=vr.object({Name:vr.string().describe("The name of the ANT."),Owner:Lh.describe("The Owners address."),"Source-Code-TX-ID":Lh.describe("Transaction ID of the Source Code for the ANT."),Ticker:vr.string().describe("The ticker symbol for the ANT."),"Total-Supply":oQ.describe("Total supply of the ANT in circulation."),Description:t5e.describe("The description for the ANT."),Keywords:fQ.describe("The keywords for the ANT."),Logo:Lh.describe("Transaction ID of the ANT logo."),Denomination:oQ.describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers."),Handlers:sQ.optional().describe("List of handlers for the ANT."),HandlerNames:sQ.optional().describe('Deprecated: List of handlers for the ANT. Use "Handlers" instead.')});function qft(t){return _T.safeParse(t).success}ie();ae();ne();ie();ae();ne();ie();ae();ne();var hQ=t=>D8.test(t);function Gft(t){return t!==void 0&&!isNaN(parseInt(t.toString()))}var wn=t=>t.filter(e=>e.value!==void 0),A1=async t=>await t.blocks.getCurrent().then(e=>e.timestamp*1e3).catch(()=>Date.now());function $h(t){return"process"in t}function Dh(t){return"processId"in t&&typeof t.processId=="string"&&hQ(t.processId)===!0}function tut(t){return t.type==="lease"}ie();ae();ne();var MT=class t{constructor(e){this.positiveFiniteInteger=e;if(!Number.isFinite(this.positiveFiniteInteger)||!Number.isInteger(this.positiveFiniteInteger)||this.positiveFiniteInteger<0)throw new Error(`Number must be a non-negative integer value! ${e}`)}[Symbol.toPrimitive](e){return e==="string"&&this.toString(),this.positiveFiniteInteger}plus(e){return new t(this.positiveFiniteInteger+e.positiveFiniteInteger)}minus(e){return new t(this.positiveFiniteInteger-e.positiveFiniteInteger)}isGreaterThan(e){return this.positiveFiniteInteger>e.positiveFiniteInteger}isGreaterThanOrEqualTo(e){return this.positiveFiniteInteger>=e.positiveFiniteInteger}isLessThan(e){return this.positiveFiniteInteger<e.positiveFiniteInteger}isLessThanOrEqualTo(e){return this.positiveFiniteInteger<=e.positiveFiniteInteger}toString(){return`${this.positiveFiniteInteger}`}valueOf(){return this.positiveFiniteInteger}toJSON(){return this.positiveFiniteInteger}equals(e){return this.positiveFiniteInteger===e.positiveFiniteInteger}},xT=class{value;constructor(e){if(!Number.isFinite(e)||e<0)throw new Error("IOToken must be a non-negative finite number");this.value=+e.toFixed(6)}valueOf(){return this.value}toMIO(){return new ST(Math.floor(this.value*mT))}toString(){return`${this.value}`}},ST=class t extends MT{constructor(e){super(e)}multiply(e){let r=Math.floor(this.valueOf()*e.valueOf());return new t(r)}divide(e){if(e.valueOf()===0)throw new Error("Cannot divide by zero");let r=Math.floor(this.valueOf()/e.valueOf());return new t(r)}plus(e){let r=super.plus(e);return new t(r.valueOf())}minus(e){let r=super.minus(e);return new t(r.valueOf())}toIO(){return new xT(this.valueOf()/mT)}};ie();ae();ne();ie();ae();ne();var Tf=class extends Error{constructor(e){super(e),this.name=this.constructor.name}},cQ=class extends Tf{},lQ=class extends Tf{},dQ=class extends Tf{constructor(e,r){super(`Failed request: ${e}: ${r}`)}},pQ=class extends Tf{},F8=class extends Tf{},vQ=class extends Tf{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},Pu=class extends Tf{constructor(){super("Invalid contract configuration")}},mQ=class extends Tf{constructor(){super("Invalid process configuration")}},gQ=class extends Tf{};ie();ae();ne();var $f=gi($ae(),1);ie();ae();ne();var V4="2.4.0";var qu=class t{logger;silent=!1;static default=new t;constructor({level:e="info"}={}){e==="none"&&(this.silent=!0),typeof window<"u"?this.logger=console:this.logger=(0,$f.createLogger)({level:e,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:V4},format:$f.format.combine($f.format.timestamp(),$f.format.json()),transports:[new $f.transports.Console({format:$f.format.combine($f.format.timestamp(),$f.format.json())})]})}info(e,...r){this.silent||this.logger.info(e,...r)}warn(e,...r){this.silent||this.logger.warn(e,...r)}error(e,...r){this.silent||this.logger.error(e,...r)}debug(e,...r){this.silent||this.logger.debug(e,...r)}setLogLevel(e){this.silent=e==="none","silent"in this.logger&&(this.logger.silent=e==="none"),"level"in this.logger&&(this.logger.level=e)}};ie();ae();ne();ie();ae();ne();ie();ae();ne();var rBe=Object.create,oB=Object.defineProperty,iBe=Object.getOwnPropertyDescriptor,uoe=Object.getOwnPropertyNames,nBe=Object.getPrototypeOf,aBe=Object.prototype.hasOwnProperty,Co=(t,e)=>function(){return e||(0,t[uoe(t)[0]])((e={exports:{}}).exports,e),e.exports},hoe=(t,e)=>{for(var r in e)oB(t,r,{get:e[r],enumerable:!0})},oBe=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of uoe(e))!aBe.call(t,i)&&i!==r&&oB(t,i,{get:()=>e[i],enumerable:!(a=iBe(e,i))||a.enumerable});return t},sB=(t,e,r)=>(r=t!=null?rBe(nBe(t)):{},oBe(e||!t||!t.__esModule?oB(r,"default",{value:t,enumerable:!0}):r,t)),sBe=Co({"node_modules/obliterator/iterator.js"(t,e){function r(a){if(typeof a!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=a}typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=function(){return this}),r.of=function(){var a=arguments,i=a.length,h=0;return new r(function(){return h>=i?{done:!0}:{done:!1,value:a[h++]}})},r.empty=function(){var a=new r(function(){return{done:!0}});return a},r.fromSequence=function(a){var i=0,h=a.length;return new r(function(){return i>=h?{done:!0}:{done:!1,value:a[i++]}})},r.is=function(a){return a instanceof r?!0:typeof a=="object"&&a!==null&&typeof a.next=="function"},e.exports=r}}),fBe=Co({"node_modules/obliterator/support.js"(t){t.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",t.SYMBOL_SUPPORT=typeof Symbol<"u"}}),fB=Co({"node_modules/obliterator/foreach.js"(t,e){var r=fBe(),a=r.ARRAY_BUFFER_SUPPORT,i=r.SYMBOL_SUPPORT;e.exports=function(c,p){var b,g,y,M,x;if(!c)throw new Error("obliterator/forEach: invalid iterable.");if(typeof p!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(c)||a&&ArrayBuffer.isView(c)||typeof c=="string"||c.toString()==="[object Arguments]"){for(y=0,M=c.length;y<M;y++)p(c[y],y);return}if(typeof c.forEach=="function"){c.forEach(p);return}if(i&&Symbol.iterator in c&&typeof c.next!="function"&&(c=c[Symbol.iterator]()),typeof c.next=="function"){for(b=c,y=0;x=b.next(),x.done!==!0;)p(x.value,y),y++;return}for(g in c)c.hasOwnProperty(g)&&p(c[g],g)}}}),uB=Co({"node_modules/mnemonist/utils/typed-arrays.js"(t){var e=Math.pow(2,8)-1,r=Math.pow(2,16)-1,a=Math.pow(2,32)-1,i=Math.pow(2,7)-1,h=Math.pow(2,15)-1,c=Math.pow(2,31)-1;t.getPointerArray=function(b){var g=b-1;if(g<=e)return Uint8Array;if(g<=r)return Uint16Array;if(g<=a)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},t.getSignedPointerArray=function(b){var g=b-1;return g<=i?Int8Array:g<=h?Int16Array:g<=c?Int32Array:Float64Array},t.getNumberType=function(b){return b===(b|0)?Math.sign(b)===-1?b<=127&&b>=-128?Int8Array:b<=32767&&b>=-32768?Int16Array:Int32Array:b<=255?Uint8Array:b<=65535?Uint16Array:Uint32Array:Float64Array};var p={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};t.getMinimalRepresentation=function(b,g){var y=null,M=0,x,E,A,k,O;for(k=0,O=b.length;k<O;k++)A=g?g(b[k]):b[k],E=t.getNumberType(A),x=p[E.name],x>M&&(M=x,y=E);return y},t.isTypedArray=function(b){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(b)},t.concat=function(){var b=0,g,y,M;for(g=0,M=arguments.length;g<M;g++)b+=arguments[g].length;var x=new arguments[0].constructor(b);for(g=0,y=0;g<M;g++)x.set(arguments[g],y),y+=arguments[g].length;return x},t.indices=function(b){for(var g=t.getPointerArray(b),y=new g(b),M=0;M<b;M++)y[M]=M;return y}}}),coe=Co({"node_modules/mnemonist/utils/iterables.js"(t){var e=fB(),r=uB();function a(p){return Array.isArray(p)||r.isTypedArray(p)}function i(p){if(typeof p.length=="number")return p.length;if(typeof p.size=="number")return p.size}function h(p){var b=i(p),g=typeof b=="number"?new Array(b):[],y=0;return e(p,function(M){g[y++]=M}),g}function c(p){var b=i(p),g=typeof b=="number"?r.getPointerArray(b):Array,y=typeof b=="number"?new Array(b):[],M=typeof b=="number"?new g(b):[],x=0;return e(p,function(E){y[x]=E,M[x]=x++}),[y,M]}t.isArrayLike=a,t.guessLength=i,t.toArray=h,t.toArrayWithIndices=c}}),uBe=Co({"node_modules/mnemonist/lru-cache.js"(t,e){var r=sBe(),a=fB(),i=uB(),h=coe();function c(p,b,g){if(arguments.length<2&&(g=p,p=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var y=i.getPointerArray(g);this.forward=new y(g),this.backward=new y(g),this.K=typeof p=="function"?new p(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items={}}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},c.prototype.splayOnTop=function(p){var b=this.head;if(this.head===p)return this;var g=this.backward[p],y=this.forward[p];return this.tail===p?this.tail=g:this.backward[y]=g,this.forward[g]=y,this.backward[b]=p,this.head=p,this.forward[p]=b,this},c.prototype.set=function(p,b){var g=this.items[p];if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],delete this.items[this.K[g]]),this.items[p]=g,this.K[g]=p,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},c.prototype.setpop=function(p,b){var g=null,y=null,M=this.items[p];return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:p,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],y=this.K[M],delete this.items[y]),this.items[p]=M,this.K[M]=p,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,y?{evicted:!0,key:y,value:g}:null)},c.prototype.has=function(p){return p in this.items},c.prototype.get=function(p){var b=this.items[p];if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},c.prototype.peek=function(p){var b=this.items[p];if(!(typeof b>"u"))return this.V[b]},c.prototype.forEach=function(p,b){b=arguments.length>1?b:this;for(var g=0,y=this.size,M=this.head,x=this.K,E=this.V,A=this.forward;g<y;)p.call(b,E[M],x[M],this),M=A[M],g++},c.prototype.keys=function(){var p=0,b=this.size,g=this.head,y=this.K,M=this.forward;return new r(function(){if(p>=b)return{done:!0};var x=y[g];return p++,p<b&&(g=M[g]),{done:!1,value:x}})},c.prototype.values=function(){var p=0,b=this.size,g=this.head,y=this.V,M=this.forward;return new r(function(){if(p>=b)return{done:!0};var x=y[g];return p++,p<b&&(g=M[g]),{done:!1,value:x}})},c.prototype.entries=function(){var p=0,b=this.size,g=this.head,y=this.K,M=this.V,x=this.forward;return new r(function(){if(p>=b)return{done:!0};var E=y[g],A=M[g];return p++,p<b&&(g=x[g]),{done:!1,value:[E,A]}})},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=function(){for(var p=new Map,b=this.entries(),g;g=b.next(),!g.done;)p.set(g.value[0],g.value[1]);return Object.defineProperty(p,"constructor",{value:c,enumerable:!1}),p},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.from=function(p,b,g,y){if(arguments.length<2){if(y=h.guessLength(p),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=b,b=null,g=null);var M=new c(b,g,y);return a(p,function(x,E){M.set(E,x)}),M},e.exports=c}}),hBe=Co({"node_modules/mnemonist/lru-map.js"(t,e){var r=uBe(),a=fB(),i=uB(),h=coe();function c(p,b,g){if(arguments.length<2&&(g=p,p=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var y=i.getPointerArray(g);this.forward=new y(g),this.backward=new y(g),this.K=typeof p=="function"?new p(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items=new Map}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},c.prototype.set=function(p,b){var g=this.items.get(p);if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],this.items.delete(this.K[g])),this.items.set(p,g),this.K[g]=p,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},c.prototype.setpop=function(p,b){var g=null,y=null,M=this.items.get(p);return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:p,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],y=this.K[M],this.items.delete(y)),this.items.set(p,M),this.K[M]=p,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,y?{evicted:!0,key:y,value:g}:null)},c.prototype.has=function(p){return this.items.has(p)},c.prototype.get=function(p){var b=this.items.get(p);if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},c.prototype.peek=function(p){var b=this.items.get(p);if(!(typeof b>"u"))return this.V[b]},c.prototype.splayOnTop=r.prototype.splayOnTop,c.prototype.forEach=r.prototype.forEach,c.prototype.keys=r.prototype.keys,c.prototype.values=r.prototype.values,c.prototype.entries=r.prototype.entries,typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=r.prototype.inspect,c.from=function(p,b,g,y){if(arguments.length<2){if(y=h.guessLength(p),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=b,b=null,g=null);var M=new c(b,g,y);return a(p,function(x,E){M.set(E,x)}),M},e.exports=c}}),cBe=Co({"node_modules/ms/index.js"(t,e){var r=1e3,a=r*60,i=a*60,h=i*24,c=h*7,p=h*365.25;e.exports=function(x,E){E=E||{};var A=typeof x;if(A==="string"&&x.length>0)return b(x);if(A==="number"&&isFinite(x))return E.long?y(x):g(x);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(x))};function b(x){if(x=String(x),!(x.length>100)){var E=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(x);if(E){var A=parseFloat(E[1]),k=(E[2]||"ms").toLowerCase();switch(k){case"years":case"year":case"yrs":case"yr":case"y":return A*p;case"weeks":case"week":case"w":return A*c;case"days":case"day":case"d":return A*h;case"hours":case"hour":case"hrs":case"hr":case"h":return A*i;case"minutes":case"minute":case"mins":case"min":case"m":return A*a;case"seconds":case"second":case"secs":case"sec":case"s":return A*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function g(x){var E=Math.abs(x);return E>=h?Math.round(x/h)+"d":E>=i?Math.round(x/i)+"h":E>=a?Math.round(x/a)+"m":E>=r?Math.round(x/r)+"s":x+"ms"}function y(x){var E=Math.abs(x);return E>=h?M(x,E,h,"day"):E>=i?M(x,E,i,"hour"):E>=a?M(x,E,a,"minute"):E>=r?M(x,E,r,"second"):x+" ms"}function M(x,E,A,k){var O=E>=A*1.5;return Math.round(x/A)+" "+k+(O?"s":"")}}}),lBe=Co({"node_modules/debug/src/common.js"(t,e){function r(a){h.debug=h,h.default=h,h.coerce=M,h.disable=b,h.enable=p,h.enabled=g,h.humanize=cBe(),h.destroy=x,Object.keys(a).forEach(E=>{h[E]=a[E]}),h.names=[],h.skips=[],h.formatters={};function i(E){let A=0;for(let k=0;k<E.length;k++)A=(A<<5)-A+E.charCodeAt(k),A|=0;return h.colors[Math.abs(A)%h.colors.length]}h.selectColor=i;function h(E){let A,k=null,O,N;function L(...C){if(!L.enabled)return;let Y=L,G=Number(new Date),ee=G-(A||G);Y.diff=ee,Y.prev=A,Y.curr=G,A=G,C[0]=h.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let $=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(V,_)=>{if(V==="%%")return"%";$++;let n=h.formatters[_];if(typeof n=="function"){let s=C[$];V=n.call(Y,s),C.splice($,1),$--}return V}),h.formatArgs.call(Y,C),(Y.log||h.log).apply(Y,C)}return L.namespace=E,L.useColors=h.useColors(),L.color=h.selectColor(E),L.extend=c,L.destroy=h.destroy,Object.defineProperty(L,"enabled",{enumerable:!0,configurable:!1,get:()=>k!==null?k:(O!==h.namespaces&&(O=h.namespaces,N=h.enabled(E)),N),set:C=>{k=C}}),typeof h.init=="function"&&h.init(L),L}function c(E,A){let k=h(this.namespace+(typeof A>"u"?":":A)+E);return k.log=this.log,k}function p(E){h.save(E),h.namespaces=E,h.names=[],h.skips=[];let A,k=(typeof E=="string"?E:"").split(/[\s,]+/),O=k.length;for(A=0;A<O;A++)k[A]&&(E=k[A].replace(/\*/g,".*?"),E[0]==="-"?h.skips.push(new RegExp("^"+E.slice(1)+"$")):h.names.push(new RegExp("^"+E+"$")))}function b(){let E=[...h.names.map(y),...h.skips.map(y).map(A=>"-"+A)].join(",");return h.enable(""),E}function g(E){if(E[E.length-1]==="*")return!0;let A,k;for(A=0,k=h.skips.length;A<k;A++)if(h.skips[A].test(E))return!1;for(A=0,k=h.names.length;A<k;A++)if(h.names[A].test(E))return!0;return!1}function y(E){return E.toString().substring(2,E.toString().length-2).replace(/\.\*\?$/,"*")}function M(E){return E instanceof Error?E.stack||E.message:E}function x(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return h.enable(h.load()),h}e.exports=r}}),dBe=Co({"node_modules/debug/src/browser.js"(t,e){t.formatArgs=a,t.save=i,t.load=h,t.useColors=r,t.storage=c(),t.destroy=(()=>{let b=!1;return()=>{b||(b=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(b){if(b[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+b[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let g="color: "+this.color;b.splice(1,0,g,"color: inherit");let y=0,M=0;b[0].replace(/%[a-zA-Z%]/g,x=>{x!=="%%"&&(y++,x==="%c"&&(M=y))}),b.splice(M,0,g)}t.log=console.debug||console.log||(()=>{});function i(b){try{b?t.storage.setItem("debug",b):t.storage.removeItem("debug")}catch{}}function h(){let b;try{b=t.storage.getItem("debug")}catch{}return!b&&typeof He<"u"&&"env"in He&&(b=He.env.DEBUG),b}function c(){try{return localStorage}catch{}}e.exports=lBe()(t);var{formatters:p}=e.exports;p.j=function(b){try{return JSON.stringify(b)}catch(g){return"[UnexpectedJSONParseError]: "+g.message}}}}),pBe=Co({"node_modules/base64-js/index.js"(t){"use strict";t.byteLength=b,t.toByteArray=y,t.fromByteArray=E;var e=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,c=i.length;h<c;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,c;r[45]=62,r[95]=63;function p(A){var k=A.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var O=A.indexOf("=");O===-1&&(O=k);var N=O===k?0:4-O%4;return[O,N]}function b(A){var k=p(A),O=k[0],N=k[1];return(O+N)*3/4-N}function g(A,k,O){return(k+O)*3/4-O}function y(A){var k,O=p(A),N=O[0],L=O[1],C=new a(g(A,N,L)),Y=0,G=L>0?N-4:N,ee;for(ee=0;ee<G;ee+=4)k=r[A.charCodeAt(ee)]<<18|r[A.charCodeAt(ee+1)]<<12|r[A.charCodeAt(ee+2)]<<6|r[A.charCodeAt(ee+3)],C[Y++]=k>>16&255,C[Y++]=k>>8&255,C[Y++]=k&255;return L===2&&(k=r[A.charCodeAt(ee)]<<2|r[A.charCodeAt(ee+1)]>>4,C[Y++]=k&255),L===1&&(k=r[A.charCodeAt(ee)]<<10|r[A.charCodeAt(ee+1)]<<4|r[A.charCodeAt(ee+2)]>>2,C[Y++]=k>>8&255,C[Y++]=k&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,k,O){for(var N,L=[],C=k;C<O;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var k,O=A.length,N=O%3,L=[],C=16383,Y=0,G=O-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(k=A[O-1],L.push(e[k>>2]+e[k<<4&63]+"==")):N===2&&(k=(A[O-2]<<8)+A[O-1],L.push(e[k>>10]+e[k>>4&63]+e[k<<2&63]+"=")),L.join("")}}}),vBe=Co({"node_modules/ieee754/index.js"(t){t.read=function(e,r,a,i,h){var c,p,b=h*8-i-1,g=(1<<b)-1,y=g>>1,M=-7,x=a?h-1:0,E=a?-1:1,A=e[r+x];for(x+=E,c=A&(1<<-M)-1,A>>=-M,M+=b;M>0;c=c*256+e[r+x],x+=E,M-=8);for(p=c&(1<<-M)-1,c>>=-M,M+=i;M>0;p=p*256+e[r+x],x+=E,M-=8);if(c===0)c=1-y;else{if(c===g)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,i),c=c-y}return(A?-1:1)*p*Math.pow(2,c-i)},t.write=function(e,r,a,i,h,c){var p,b,g,y=c*8-h-1,M=(1<<y)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:c-1,k=i?1:-1,O=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,p=M):(p=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-p))<1&&(p--,g*=2),p+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(p++,g/=2),p+x>=M?(b=0,p=M):p+x>=1?(b=(r*g-1)*Math.pow(2,h),p=p+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),p=0));h>=8;e[a+A]=b&255,A+=k,b/=256,h-=8);for(p=p<<h|b,y+=h;y>0;e[a+A]=p&255,A+=k,p/=256,y-=8);e[a+A-k]|=O*128}}}),mBe=Co({"node_modules/buffer/index.js"(t){"use strict";var e=pBe(),r=vBe(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=p,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,p.TYPED_ARRAY_SUPPORT=h(),!p.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 h(){try{let T=new Uint8Array(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,Uint8Array.prototype),Object.setPrototypeOf(T,I),T.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function c(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let I=new Uint8Array(T);return Object.setPrototypeOf(I,p.prototype),I}function p(T,I,P){if(typeof T=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,I,P)}p.poolSize=8192;function b(T,I,P){if(typeof T=="string")return x(T,I);if(ArrayBuffer.isView(T))return A(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(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return k(T,I,P);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let U=T.valueOf&&T.valueOf();if(U!=null&&U!==T)return p.from(U,I,P);let H=O(T);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return p.from(T[Symbol.toPrimitive]("string"),I,P);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}p.from=function(T,I,P){return b(T,I,P)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array);function g(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 y(T,I,P){return g(T),T<=0?c(T):I!==void 0?typeof P=="string"?c(T).fill(I,P):c(T).fill(I):c(T)}p.alloc=function(T,I,P){return y(T,I,P)};function M(T){return g(T),c(T<0?0:N(T)|0)}p.allocUnsafe=function(T){return M(T)},p.allocUnsafeSlow=function(T){return M(T)};function x(T,I){if((typeof I!="string"||I==="")&&(I="utf8"),!p.isEncoding(I))throw new TypeError("Unknown encoding: "+I);let P=C(T,I)|0,U=c(P),H=U.write(T,I);return H!==P&&(U=U.slice(0,H)),U}function E(T){let I=T.length<0?0:N(T.length)|0,P=c(I);for(let U=0;U<I;U+=1)P[U]=T[U]&255;return P}function A(T){if(ut(T,Uint8Array)){let I=new Uint8Array(T);return k(I.buffer,I.byteOffset,I.byteLength)}return E(T)}function k(T,I,P){if(I<0||T.byteLength<I)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<I+(P||0))throw new RangeError('"length" is outside of buffer bounds');let U;return I===void 0&&P===void 0?U=new Uint8Array(T):P===void 0?U=new Uint8Array(T,I):U=new Uint8Array(T,I,P),Object.setPrototypeOf(U,p.prototype),U}function O(T){if(p.isBuffer(T)){let I=N(T.length)|0,P=c(I);return P.length===0||T.copy(P,0,0,I),P}if(T.length!==void 0)return typeof T.length!="number"||Ze(T.length)?c(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),p.alloc(+T)}p.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==p.prototype},p.compare=function(I,P){if(ut(I,Uint8Array)&&(I=p.from(I,I.offset,I.byteLength)),ut(P,Uint8Array)&&(P=p.from(P,P.offset,P.byteLength)),!p.isBuffer(I)||!p.isBuffer(P))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===P)return 0;let U=I.length,H=P.length;for(let W=0,fe=Math.min(U,H);W<fe;++W)if(I[W]!==P[W]){U=I[W],H=P[W];break}return U<H?-1:H<U?1:0},p.isEncoding=function(I){switch(String(I).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}},p.concat=function(I,P){if(!Array.isArray(I))throw new TypeError('"list" argument must be an Array of Buffers');if(I.length===0)return p.alloc(0);let U;if(P===void 0)for(P=0,U=0;U<I.length;++U)P+=I[U].length;let H=p.allocUnsafe(P),W=0;for(U=0;U<I.length;++U){let fe=I[U];if(ut(fe,Uint8Array))W+fe.length>H.length?(p.isBuffer(fe)||(fe=p.from(fe)),fe.copy(H,W)):Uint8Array.prototype.set.call(H,fe,W);else if(p.isBuffer(fe))fe.copy(H,W);else throw new TypeError('"list" argument must be an Array of Buffers');W+=fe.length}return H};function C(T,I){if(p.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(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 P=T.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&P===0)return 0;let H=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return P;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P*2;case"hex":return P>>>1;case"base64":return ge(T).length;default:if(H)return U?-1:oe(T).length;I=(""+I).toLowerCase(),H=!0}}p.byteLength=C;function Y(T,I,P){let U=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((P===void 0||P>this.length)&&(P=this.length),P<=0)||(P>>>=0,I>>>=0,P<=I))return"";for(T||(T="utf8");;)switch(T){case"hex":return o(this,I,P);case"utf8":case"utf-8":return u(this,I,P);case"ascii":return w(this,I,P);case"latin1":case"binary":return d(this,I,P);case"base64":return f(this,I,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,I,P);default:if(U)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),U=!0}}p.prototype._isBuffer=!0;function G(T,I,P){let U=T[I];T[I]=T[P],T[P]=U}p.prototype.swap16=function(){let I=this.length;if(I%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let P=0;P<I;P+=2)G(this,P,P+1);return this},p.prototype.swap32=function(){let I=this.length;if(I%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let P=0;P<I;P+=4)G(this,P,P+3),G(this,P+1,P+2);return this},p.prototype.swap64=function(){let I=this.length;if(I%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let P=0;P<I;P+=8)G(this,P,P+7),G(this,P+1,P+6),G(this,P+2,P+5),G(this,P+3,P+4);return this},p.prototype.toString=function(){let I=this.length;return I===0?"":arguments.length===0?u(this,0,I):Y.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(I){if(!p.isBuffer(I))throw new TypeError("Argument must be a Buffer");return this===I?!0:p.compare(this,I)===0},p.prototype.inspect=function(){let I="",P=t.INSPECT_MAX_BYTES;return I=this.toString("hex",0,P).replace(/(.{2})/g,"$1 ").trim(),this.length>P&&(I+=" ... "),"<Buffer "+I+">"},a&&(p.prototype[a]=p.prototype.inspect),p.prototype.compare=function(I,P,U,H,W){if(ut(I,Uint8Array)&&(I=p.from(I,I.offset,I.byteLength)),!p.isBuffer(I))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(P===void 0&&(P=0),U===void 0&&(U=I?I.length:0),H===void 0&&(H=0),W===void 0&&(W=this.length),P<0||U>I.length||H<0||W>this.length)throw new RangeError("out of range index");if(H>=W&&P>=U)return 0;if(H>=W)return-1;if(P>=U)return 1;if(P>>>=0,U>>>=0,H>>>=0,W>>>=0,this===I)return 0;let fe=W-H,st=U-P,ue=Math.min(fe,st),me=this.slice(H,W),pe=I.slice(P,U);for(let be=0;be<ue;++be)if(me[be]!==pe[be]){fe=me[be],st=pe[be];break}return fe<st?-1:st<fe?1:0};function ee(T,I,P,U,H){if(T.length===0)return-1;if(typeof P=="string"?(U=P,P=0):P>2147483647?P=2147483647:P<-2147483648&&(P=-2147483648),P=+P,Ze(P)&&(P=H?0:T.length-1),P<0&&(P=T.length+P),P>=T.length){if(H)return-1;P=T.length-1}else if(P<0)if(H)P=0;else return-1;if(typeof I=="string"&&(I=p.from(I,U)),p.isBuffer(I))return I.length===0?-1:$(T,I,P,U,H);if(typeof I=="number")return I=I&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(T,I,P):Uint8Array.prototype.lastIndexOf.call(T,I,P):$(T,[I],P,U,H);throw new TypeError("val must be string, number or Buffer")}function $(T,I,P,U,H){let W=1,fe=T.length,st=I.length;if(U!==void 0&&(U=String(U).toLowerCase(),U==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(T.length<2||I.length<2)return-1;W=2,fe/=2,st/=2,P/=2}function ue(pe,be){return W===1?pe[be]:pe.readUInt16BE(be*W)}let me;if(H){let pe=-1;for(me=P;me<fe;me++)if(ue(T,me)===ue(I,pe===-1?0:me-pe)){if(pe===-1&&(pe=me),me-pe+1===st)return pe*W}else pe!==-1&&(me-=me-pe),pe=-1}else for(P+st>fe&&(P=fe-st),me=P;me>=0;me--){let pe=!0;for(let be=0;be<st;be++)if(ue(T,me+be)!==ue(I,be)){pe=!1;break}if(pe)return me}return-1}p.prototype.includes=function(I,P,U){return this.indexOf(I,P,U)!==-1},p.prototype.indexOf=function(I,P,U){return ee(this,I,P,U,!0)},p.prototype.lastIndexOf=function(I,P,U){return ee(this,I,P,U,!1)};function q(T,I,P,U){P=Number(P)||0;let H=T.length-P;U?(U=Number(U),U>H&&(U=H)):U=H;let W=I.length;U>W/2&&(U=W/2);let fe;for(fe=0;fe<U;++fe){let st=parseInt(I.substr(fe*2,2),16);if(Ze(st))return fe;T[P+fe]=st}return fe}function V(T,I,P,U){return Se(oe(I,T.length-P),T,P,U)}function _(T,I,P,U){return Se(le(I),T,P,U)}function n(T,I,P,U){return Se(ge(I),T,P,U)}function s(T,I,P,U){return Se(ot(I,T.length-P),T,P,U)}p.prototype.write=function(I,P,U,H){if(P===void 0)H="utf8",U=this.length,P=0;else if(U===void 0&&typeof P=="string")H=P,U=this.length,P=0;else if(isFinite(P))P=P>>>0,isFinite(U)?(U=U>>>0,H===void 0&&(H="utf8")):(H=U,U=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let W=this.length-P;if((U===void 0||U>W)&&(U=W),I.length>0&&(U<0||P<0)||P>this.length)throw new RangeError("Attempt to write outside buffer bounds");H||(H="utf8");let fe=!1;for(;;)switch(H){case"hex":return q(this,I,P,U);case"utf8":case"utf-8":return V(this,I,P,U);case"ascii":case"latin1":case"binary":return _(this,I,P,U);case"base64":return n(this,I,P,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,I,P,U);default:if(fe)throw new TypeError("Unknown encoding: "+H);H=(""+H).toLowerCase(),fe=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,I,P){return I===0&&P===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(I,P))}function u(T,I,P){P=Math.min(T.length,P);let U=[],H=I;for(;H<P;){let W=T[H],fe=null,st=W>239?4:W>223?3:W>191?2:1;if(H+st<=P){let ue,me,pe,be;switch(st){case 1:W<128&&(fe=W);break;case 2:ue=T[H+1],(ue&192)===128&&(be=(W&31)<<6|ue&63,be>127&&(fe=be));break;case 3:ue=T[H+1],me=T[H+2],(ue&192)===128&&(me&192)===128&&(be=(W&15)<<12|(ue&63)<<6|me&63,be>2047&&(be<55296||be>57343)&&(fe=be));break;case 4:ue=T[H+1],me=T[H+2],pe=T[H+3],(ue&192)===128&&(me&192)===128&&(pe&192)===128&&(be=(W&15)<<18|(ue&63)<<12|(me&63)<<6|pe&63,be>65535&&be<1114112&&(fe=be))}}fe===null?(fe=65533,st=1):fe>65535&&(fe-=65536,U.push(fe>>>10&1023|55296),fe=56320|fe&1023),U.push(fe),H+=st}return m(U)}var l=4096;function m(T){let I=T.length;if(I<=l)return String.fromCharCode.apply(String,T);let P="",U=0;for(;U<I;)P+=String.fromCharCode.apply(String,T.slice(U,U+=l));return P}function w(T,I,P){let U="";P=Math.min(T.length,P);for(let H=I;H<P;++H)U+=String.fromCharCode(T[H]&127);return U}function d(T,I,P){let U="";P=Math.min(T.length,P);for(let H=I;H<P;++H)U+=String.fromCharCode(T[H]);return U}function o(T,I,P){let U=T.length;(!I||I<0)&&(I=0),(!P||P<0||P>U)&&(P=U);let H="";for(let W=I;W<P;++W)H+=Ge[T[W]];return H}function v(T,I,P){let U=T.slice(I,P),H="";for(let W=0;W<U.length-1;W+=2)H+=String.fromCharCode(U[W]+U[W+1]*256);return H}p.prototype.slice=function(I,P){let U=this.length;I=~~I,P=P===void 0?U:~~P,I<0?(I+=U,I<0&&(I=0)):I>U&&(I=U),P<0?(P+=U,P<0&&(P=0)):P>U&&(P=U),P<I&&(P=I);let H=this.subarray(I,P);return Object.setPrototypeOf(H,p.prototype),H};function R(T,I,P){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+I>P)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(I,P,U){I=I>>>0,P=P>>>0,U||R(I,P,this.length);let H=this[I],W=1,fe=0;for(;++fe<P&&(W*=256);)H+=this[I+fe]*W;return H},p.prototype.readUintBE=p.prototype.readUIntBE=function(I,P,U){I=I>>>0,P=P>>>0,U||R(I,P,this.length);let H=this[I+--P],W=1;for(;P>0&&(W*=256);)H+=this[I+--P]*W;return H},p.prototype.readUint8=p.prototype.readUInt8=function(I,P){return I=I>>>0,P||R(I,1,this.length),this[I]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(I,P){return I=I>>>0,P||R(I,2,this.length),this[I]|this[I+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(I,P){return I=I>>>0,P||R(I,2,this.length),this[I]<<8|this[I+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(I,P){return I=I>>>0,P||R(I,4,this.length),(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(I,P){return I=I>>>0,P||R(I,4,this.length),this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])},p.prototype.readBigUInt64LE=ct(function(I){I=I>>>0,J(I,"offset");let P=this[I],U=this[I+7];(P===void 0||U===void 0)&&X(I,this.length-8);let H=P+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24,W=this[++I]+this[++I]*2**8+this[++I]*2**16+U*2**24;return BigInt(H)+(BigInt(W)<<BigInt(32))}),p.prototype.readBigUInt64BE=ct(function(I){I=I>>>0,J(I,"offset");let P=this[I],U=this[I+7];(P===void 0||U===void 0)&&X(I,this.length-8);let H=P*2**24+this[++I]*2**16+this[++I]*2**8+this[++I],W=this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+U;return(BigInt(H)<<BigInt(32))+BigInt(W)}),p.prototype.readIntLE=function(I,P,U){I=I>>>0,P=P>>>0,U||R(I,P,this.length);let H=this[I],W=1,fe=0;for(;++fe<P&&(W*=256);)H+=this[I+fe]*W;return W*=128,H>=W&&(H-=Math.pow(2,8*P)),H},p.prototype.readIntBE=function(I,P,U){I=I>>>0,P=P>>>0,U||R(I,P,this.length);let H=P,W=1,fe=this[I+--H];for(;H>0&&(W*=256);)fe+=this[I+--H]*W;return W*=128,fe>=W&&(fe-=Math.pow(2,8*P)),fe},p.prototype.readInt8=function(I,P){return I=I>>>0,P||R(I,1,this.length),this[I]&128?(255-this[I]+1)*-1:this[I]},p.prototype.readInt16LE=function(I,P){I=I>>>0,P||R(I,2,this.length);let U=this[I]|this[I+1]<<8;return U&32768?U|4294901760:U},p.prototype.readInt16BE=function(I,P){I=I>>>0,P||R(I,2,this.length);let U=this[I+1]|this[I]<<8;return U&32768?U|4294901760:U},p.prototype.readInt32LE=function(I,P){return I=I>>>0,P||R(I,4,this.length),this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24},p.prototype.readInt32BE=function(I,P){return I=I>>>0,P||R(I,4,this.length),this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]},p.prototype.readBigInt64LE=ct(function(I){I=I>>>0,J(I,"offset");let P=this[I],U=this[I+7];(P===void 0||U===void 0)&&X(I,this.length-8);let H=this[I+4]+this[I+5]*2**8+this[I+6]*2**16+(U<<24);return(BigInt(H)<<BigInt(32))+BigInt(P+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24)}),p.prototype.readBigInt64BE=ct(function(I){I=I>>>0,J(I,"offset");let P=this[I],U=this[I+7];(P===void 0||U===void 0)&&X(I,this.length-8);let H=(P<<24)+this[++I]*2**16+this[++I]*2**8+this[++I];return(BigInt(H)<<BigInt(32))+BigInt(this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+U)}),p.prototype.readFloatLE=function(I,P){return I=I>>>0,P||R(I,4,this.length),r.read(this,I,!0,23,4)},p.prototype.readFloatBE=function(I,P){return I=I>>>0,P||R(I,4,this.length),r.read(this,I,!1,23,4)},p.prototype.readDoubleLE=function(I,P){return I=I>>>0,P||R(I,8,this.length),r.read(this,I,!0,52,8)},p.prototype.readDoubleBE=function(I,P){return I=I>>>0,P||R(I,8,this.length),r.read(this,I,!1,52,8)};function S(T,I,P,U,H,W){if(!p.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>H||I<W)throw new RangeError('"value" argument is out of bounds');if(P+U>T.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(I,P,U,H){if(I=+I,P=P>>>0,U=U>>>0,!H){let st=Math.pow(2,8*U)-1;S(this,I,P,U,st,0)}let W=1,fe=0;for(this[P]=I&255;++fe<U&&(W*=256);)this[P+fe]=I/W&255;return P+U},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(I,P,U,H){if(I=+I,P=P>>>0,U=U>>>0,!H){let st=Math.pow(2,8*U)-1;S(this,I,P,U,st,0)}let W=U-1,fe=1;for(this[P+W]=I&255;--W>=0&&(fe*=256);)this[P+W]=I/fe&255;return P+U},p.prototype.writeUint8=p.prototype.writeUInt8=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,1,255,0),this[P]=I&255,P+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,2,65535,0),this[P]=I&255,this[P+1]=I>>>8,P+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,2,65535,0),this[P]=I>>>8,this[P+1]=I&255,P+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,4,4294967295,0),this[P+3]=I>>>24,this[P+2]=I>>>16,this[P+1]=I>>>8,this[P]=I&255,P+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,4,4294967295,0),this[P]=I>>>24,this[P+1]=I>>>16,this[P+2]=I>>>8,this[P+3]=I&255,P+4};function B(T,I,P,U,H){j(I,U,H,T,P,7);let W=Number(I&BigInt(4294967295));T[P++]=W,W=W>>8,T[P++]=W,W=W>>8,T[P++]=W,W=W>>8,T[P++]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[P++]=fe,fe=fe>>8,T[P++]=fe,fe=fe>>8,T[P++]=fe,fe=fe>>8,T[P++]=fe,P}function F(T,I,P,U,H){j(I,U,H,T,P,7);let W=Number(I&BigInt(4294967295));T[P+7]=W,W=W>>8,T[P+6]=W,W=W>>8,T[P+5]=W,W=W>>8,T[P+4]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[P+3]=fe,fe=fe>>8,T[P+2]=fe,fe=fe>>8,T[P+1]=fe,fe=fe>>8,T[P]=fe,P+8}p.prototype.writeBigUInt64LE=ct(function(I,P=0){return B(this,I,P,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=ct(function(I,P=0){return F(this,I,P,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(I,P,U,H){if(I=+I,P=P>>>0,!H){let ue=Math.pow(2,8*U-1);S(this,I,P,U,ue-1,-ue)}let W=0,fe=1,st=0;for(this[P]=I&255;++W<U&&(fe*=256);)I<0&&st===0&&this[P+W-1]!==0&&(st=1),this[P+W]=(I/fe>>0)-st&255;return P+U},p.prototype.writeIntBE=function(I,P,U,H){if(I=+I,P=P>>>0,!H){let ue=Math.pow(2,8*U-1);S(this,I,P,U,ue-1,-ue)}let W=U-1,fe=1,st=0;for(this[P+W]=I&255;--W>=0&&(fe*=256);)I<0&&st===0&&this[P+W+1]!==0&&(st=1),this[P+W]=(I/fe>>0)-st&255;return P+U},p.prototype.writeInt8=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,1,127,-128),I<0&&(I=255+I+1),this[P]=I&255,P+1},p.prototype.writeInt16LE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,2,32767,-32768),this[P]=I&255,this[P+1]=I>>>8,P+2},p.prototype.writeInt16BE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,2,32767,-32768),this[P]=I>>>8,this[P+1]=I&255,P+2},p.prototype.writeInt32LE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,4,2147483647,-2147483648),this[P]=I&255,this[P+1]=I>>>8,this[P+2]=I>>>16,this[P+3]=I>>>24,P+4},p.prototype.writeInt32BE=function(I,P,U){return I=+I,P=P>>>0,U||S(this,I,P,4,2147483647,-2147483648),I<0&&(I=4294967295+I+1),this[P]=I>>>24,this[P+1]=I>>>16,this[P+2]=I>>>8,this[P+3]=I&255,P+4},p.prototype.writeBigInt64LE=ct(function(I,P=0){return B(this,I,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=ct(function(I,P=0){return F(this,I,P,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function D(T,I,P,U,H,W){if(P+U>T.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("Index out of range")}function re(T,I,P,U,H){return I=+I,P=P>>>0,H||D(T,I,P,4,34028234663852886e22,-34028234663852886e22),r.write(T,I,P,U,23,4),P+4}p.prototype.writeFloatLE=function(I,P,U){return re(this,I,P,!0,U)},p.prototype.writeFloatBE=function(I,P,U){return re(this,I,P,!1,U)};function Q(T,I,P,U,H){return I=+I,P=P>>>0,H||D(T,I,P,8,17976931348623157e292,-17976931348623157e292),r.write(T,I,P,U,52,8),P+8}p.prototype.writeDoubleLE=function(I,P,U){return Q(this,I,P,!0,U)},p.prototype.writeDoubleBE=function(I,P,U){return Q(this,I,P,!1,U)},p.prototype.copy=function(I,P,U,H){if(!p.isBuffer(I))throw new TypeError("argument should be a Buffer");if(U||(U=0),!H&&H!==0&&(H=this.length),P>=I.length&&(P=I.length),P||(P=0),H>0&&H<U&&(H=U),H===U||I.length===0||this.length===0)return 0;if(P<0)throw new RangeError("targetStart out of bounds");if(U<0||U>=this.length)throw new RangeError("Index out of range");if(H<0)throw new RangeError("sourceEnd out of bounds");H>this.length&&(H=this.length),I.length-P<H-U&&(H=I.length-P+U);let W=H-U;return this===I&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(P,U,H):Uint8Array.prototype.set.call(I,this.subarray(U,H),P),W},p.prototype.fill=function(I,P,U,H){if(typeof I=="string"){if(typeof P=="string"?(H=P,P=0,U=this.length):typeof U=="string"&&(H=U,U=this.length),H!==void 0&&typeof H!="string")throw new TypeError("encoding must be a string");if(typeof H=="string"&&!p.isEncoding(H))throw new TypeError("Unknown encoding: "+H);if(I.length===1){let fe=I.charCodeAt(0);(H==="utf8"&&fe<128||H==="latin1")&&(I=fe)}}else typeof I=="number"?I=I&255:typeof I=="boolean"&&(I=Number(I));if(P<0||this.length<P||this.length<U)throw new RangeError("Out of range index");if(U<=P)return this;P=P>>>0,U=U===void 0?this.length:U>>>0,I||(I=0);let W;if(typeof I=="number")for(W=P;W<U;++W)this[W]=I;else{let fe=p.isBuffer(I)?I:p.from(I,H),st=fe.length;if(st===0)throw new TypeError('The value "'+I+'" is invalid for argument "value"');for(W=0;W<U-P;++W)this[W+P]=fe[W%st]}return this};var Z={};function K(T,I,P){Z[T]=class extends P{constructor(){super(),Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(H){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:H,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,I){return`The "${T}" argument must be of type number. Received type ${typeof I}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,I,P){let U=`The value of "${T}" is out of range.`,H=P;return Number.isInteger(P)&&Math.abs(P)>2**32?H=ce(String(P)):typeof P=="bigint"&&(H=String(P),(P>BigInt(2)**BigInt(32)||P<-(BigInt(2)**BigInt(32)))&&(H=ce(H)),H+="n"),U+=` It must be ${I}. Received ${H}`,U},RangeError);function ce(T){let I="",P=T.length,U=T[0]==="-"?1:0;for(;P>=U+4;P-=3)I=`_${T.slice(P-3,P)}${I}`;return`${T.slice(0,P)}${I}`}function te(T,I,P){J(I,"offset"),(T[I]===void 0||T[I+P]===void 0)&&X(I,T.length-(P+1))}function j(T,I,P,U,H,W){if(T>P||T<I){let fe=typeof I=="bigint"?"n":"",st;throw W>3?I===0||I===BigInt(0)?st=`>= 0${fe} and < 2${fe} ** ${(W+1)*8}${fe}`:st=`>= -(2${fe} ** ${(W+1)*8-1}${fe}) and < 2 ** ${(W+1)*8-1}${fe}`:st=`>= ${I}${fe} and <= ${P}${fe}`,new Z.ERR_OUT_OF_RANGE("value",st,T)}te(U,H,W)}function J(T,I){if(typeof T!="number")throw new Z.ERR_INVALID_ARG_TYPE(I,"number",T)}function X(T,I,P){throw Math.floor(T)!==T?(J(T,P),new Z.ERR_OUT_OF_RANGE(P||"offset","an integer",T)):I<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(P||"offset",`>= ${P?1:0} and <= ${I}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function Te(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,I){I=I||1/0;let P,U=T.length,H=null,W=[];for(let fe=0;fe<U;++fe){if(P=T.charCodeAt(fe),P>55295&&P<57344){if(!H){if(P>56319){(I-=3)>-1&&W.push(239,191,189);continue}else if(fe+1===U){(I-=3)>-1&&W.push(239,191,189);continue}H=P;continue}if(P<56320){(I-=3)>-1&&W.push(239,191,189),H=P;continue}P=(H-55296<<10|P-56320)+65536}else H&&(I-=3)>-1&&W.push(239,191,189);if(H=null,P<128){if((I-=1)<0)break;W.push(P)}else if(P<2048){if((I-=2)<0)break;W.push(P>>6|192,P&63|128)}else if(P<65536){if((I-=3)<0)break;W.push(P>>12|224,P>>6&63|128,P&63|128)}else if(P<1114112){if((I-=4)<0)break;W.push(P>>18|240,P>>12&63|128,P>>6&63|128,P&63|128)}else throw new Error("Invalid code point")}return W}function le(T){let I=[];for(let P=0;P<T.length;++P)I.push(T.charCodeAt(P)&255);return I}function ot(T,I){let P,U,H,W=[];for(let fe=0;fe<T.length&&!((I-=2)<0);++fe)P=T.charCodeAt(fe),U=P>>8,H=P%256,W.push(H),W.push(U);return W}function ge(T){return e.toByteArray(Te(T))}function Se(T,I,P,U){let H;for(H=0;H<U&&!(H+P>=I.length||H>=T.length);++H)I[H+P]=T[H];return H}function ut(T,I){return T instanceof I||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===I.name}function Ze(T){return T!==T}var Ge=function(){let T="0123456789abcdef",I=new Array(256);for(let P=0;P<16;++P){let U=P*16;for(let H=0;H<16;++H)I[U+H]=T[P]+T[H]}return I}();function ct(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}}),gBe={"@@functional/placeholder":!0};function Yi(t){return t===gBe}function Fa(t){return function e(r){return arguments.length===0||Yi(r)?e:t.apply(this,arguments)}}function Fn(t){return function e(r,a){switch(arguments.length){case 0:return e;case 1:return Yi(r)?e:Fa(function(i){return t(r,i)});default:return Yi(r)&&Yi(a)?e:Yi(r)?Fa(function(i){return t(i,a)}):Yi(a)?Fa(function(i){return t(r,i)}):t(r,a)}}}function Ew(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(r){return e.apply(this,arguments)};case 2:return function(r,a){return e.apply(this,arguments)};case 3:return function(r,a,i){return e.apply(this,arguments)};case 4:return function(r,a,i,h){return e.apply(this,arguments)};case 5:return function(r,a,i,h,c){return e.apply(this,arguments)};case 6:return function(r,a,i,h,c,p){return e.apply(this,arguments)};case 7:return function(r,a,i,h,c,p,b){return e.apply(this,arguments)};case 8:return function(r,a,i,h,c,p,b,g){return e.apply(this,arguments)};case 9:return function(r,a,i,h,c,p,b,g,y){return e.apply(this,arguments)};case 10:return function(r,a,i,h,c,p,b,g,y,M){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function loe(t,e,r){return function(){for(var a=[],i=0,h=t,c=0,p=!1;c<e.length||i<arguments.length;){var b;c<e.length&&(!Yi(e[c])||i>=arguments.length)?b=e[c]:(b=arguments[i],i+=1),a[c]=b,Yi(b)?p=!0:h-=1,c+=1}return!p&&h<=0?r.apply(this,a):Ew(Math.max(0,h),loe(t,a,r))}}var bBe=Fn(function(t,e){return t===1?Fa(e):Ew(t,loe(t,[],e))}),doe=bBe;function hB(t){return function e(r,a,i){switch(arguments.length){case 0:return e;case 1:return Yi(r)?e:Fn(function(h,c){return t(r,h,c)});case 2:return Yi(r)&&Yi(a)?e:Yi(r)?Fn(function(h,c){return t(h,a,c)}):Yi(a)?Fn(function(h,c){return t(r,h,c)}):Fa(function(h){return t(r,a,h)});default:return Yi(r)&&Yi(a)&&Yi(i)?e:Yi(r)&&Yi(a)?Fn(function(h,c){return t(h,c,i)}):Yi(r)&&Yi(i)?Fn(function(h,c){return t(h,a,c)}):Yi(a)&&Yi(i)?Fn(function(h,c){return t(r,h,c)}):Yi(r)?Fa(function(h){return t(h,a,i)}):Yi(a)?Fa(function(h){return t(r,h,i)}):Yi(i)?Fa(function(h){return t(r,a,h)}):t(r,a,i)}}}var cB=Array.isArray||function(t){return t!=null&&t.length>=0&&Object.prototype.toString.call(t)==="[object Array]"};function yBe(t){return t!=null&&typeof t["@@transducer/step"]=="function"}function lB(t,e,r){return function(){if(arguments.length===0)return r();var a=arguments[arguments.length-1];if(!cB(a)){for(var i=0;i<t.length;){if(typeof a[t[i]]=="function")return a[t[i]].apply(a,Array.prototype.slice.call(arguments,0,-1));i+=1}if(yBe(a)){var h=e.apply(null,Array.prototype.slice.call(arguments,0,-1));return h(a)}}return r.apply(this,arguments)}}function wBe(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}var B2={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}};function Dae(t){for(var e=[],r;!(r=t.next()).done;)e.push(r.value);return e}function Uae(t,e,r){for(var a=0,i=r.length;a<i;){if(t(e,r[a]))return!0;a+=1}return!1}function _Be(t){var e=String(t).match(/^function (\w*)/);return e==null?"":e[1]}function tw(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function MBe(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var AI=typeof Object.is=="function"?Object.is:MBe,qae=Object.prototype.toString,xBe=function(){return qae.call(arguments)==="[object Arguments]"?function(t){return qae.call(t)==="[object Arguments]"}:function(t){return tw("callee",t)}}(),SBe=xBe,EBe=!{toString:null}.propertyIsEnumerable("toString"),Fae=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],jae=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),ABe=function(t,e){for(var r=0;r<t.length;){if(t[r]===e)return!0;r+=1}return!1},RBe=Fa(typeof Object.keys=="function"&&!jae?function(t){return Object(t)!==t?[]:Object.keys(t)}:function(t){if(Object(t)!==t)return[];var e,r,a=[],i=jae&&SBe(t);for(e in t)tw(e,t)&&(!i||e!=="length")&&(a[a.length]=e);if(EBe)for(r=Fae.length-1;r>=0;)e=Fae[r],tw(e,t)&&!ABe(a,e)&&(a[a.length]=e),r-=1;return a}),ev=RBe,TBe=Fa(function(t){return t===null?"Null":t===void 0?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}),zae=TBe;function Zae(t,e,r,a){var i=Dae(t),h=Dae(e);function c(p,b){return dB(p,b,r.slice(),a.slice())}return!Uae(function(p,b){return!Uae(c,b,p)},h,i)}function dB(t,e,r,a){if(AI(t,e))return!0;var i=zae(t);if(i!==zae(e))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof e.equals=="function")return typeof t.equals=="function"&&t.equals(e)&&typeof e.equals=="function"&&e.equals(t);switch(i){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&_Be(t.constructor)==="Promise")return t===e;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof e&&AI(t.valueOf(),e.valueOf())))return!1;break;case"Date":if(!AI(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(!(t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky&&t.unicode===e.unicode))return!1;break}for(var h=r.length-1;h>=0;){if(r[h]===t)return a[h]===e;h-=1}switch(i){case"Map":return t.size!==e.size?!1:Zae(t.entries(),e.entries(),r.concat([t]),a.concat([e]));case"Set":return t.size!==e.size?!1:Zae(t.values(),e.values(),r.concat([t]),a.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=ev(t);if(c.length!==ev(e).length)return!1;var p=r.concat([t]),b=a.concat([e]);for(h=c.length-1;h>=0;){var g=c[h];if(!(tw(g,e)&&dB(e[g],t[g],p,b)))return!1;h-=1}return!0}var kBe=Fn(function(t,e){return dB(t,e,[],[])}),poe=kBe;function IBe(t,e,r){var a,i;if(typeof t.indexOf=="function")switch(typeof e){case"number":if(e===0){for(a=1/e;r<t.length;){if(i=t[r],i===0&&1/i===a)return r;r+=1}return-1}else if(e!==e){for(;r<t.length;){if(i=t[r],typeof i=="number"&&i!==i)return r;r+=1}return-1}return t.indexOf(e,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(e,r);case"object":if(e===null)return t.indexOf(e,r)}for(;r<t.length;){if(poe(t[r],e))return r;r+=1}return-1}function BBe(t,e){return IBe(e,t,0)>=0}function k2(t,e){for(var r=0,a=e.length,i=Array(a);r<a;)i[r]=t(e[r]),r+=1;return i}function RI(t){var e=t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+e.replace(/"/g,'\\"')+'"'}var b2=function(t){return(t<10?"0":"")+t},OBe=typeof Date.prototype.toISOString=="function"?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+b2(t.getUTCMonth()+1)+"-"+b2(t.getUTCDate())+"T"+b2(t.getUTCHours())+":"+b2(t.getUTCMinutes())+":"+b2(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},PBe=OBe;function NBe(t){return function(){return!t.apply(this,arguments)}}function voe(t,e,r){for(var a=0,i=r.length;a<i;)e=t(e,r[a]),a+=1;return e}function CBe(t,e){for(var r=0,a=e.length,i=[];r<a;)t(e[r])&&(i[i.length]=e[r]),r+=1;return i}function LBe(t){return Object.prototype.toString.call(t)==="[object Object]"}var $Be=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=B2.init,t.prototype["@@transducer/result"]=B2.result,t.prototype["@@transducer/step"]=function(e,r){return this.f(r)?this.xf["@@transducer/step"](e,r):e},t}();function DBe(t){return function(e){return new $Be(t,e)}}var UBe=Fn(lB(["fantasy-land/filter","filter"],DBe,function(t,e){return LBe(e)?voe(function(r,a){return t(e[a])&&(r[a]=e[a]),r},{},ev(e)):CBe(t,e)})),qBe=UBe,FBe=Fn(function(t,e){return qBe(NBe(t),e)}),jBe=FBe;function moe(t,e){var r=function(h){var c=e.concat([t]);return BBe(h,c)?"<Circular>":moe(h,c)},a=function(h,c){return k2(function(p){return RI(p)+": "+r(h[p])},c.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+k2(r,t).join(", ")+"))";case"[object Array]":return"["+k2(r,t).concat(a(t,jBe(function(h){return/^\d+$/.test(h)},ev(t)))).join(", ")+"]";case"[object Boolean]":return typeof t=="object"?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):RI(PBe(t)))+")";case"[object Map]":return"new Map("+r(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return typeof t=="object"?"new Number("+r(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+r(Array.from(t).sort())+")";case"[object String]":return typeof t=="object"?"new String("+r(t.valueOf())+")":RI(t);case"[object Undefined]":return"undefined";default:if(typeof t.toString=="function"){var i=t.toString();if(i!=="[object Object]")return i}return"{"+a(t,ev(t)).join(", ")+"}"}}var zBe=Fa(function(t){return moe(t,[])}),Hae=zBe,ZBe=Fn(function(t,e){if(t===e)return e;function r(p,b){if(p>b!=b>p)return b>p?b:p}var a=r(t,e);if(a!==void 0)return a;var i=r(typeof t,typeof e);if(i!==void 0)return i===typeof t?t:e;var h=Hae(t),c=r(h,Hae(e));return c!==void 0&&c===h?t:e}),HBe=ZBe,KBe=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=B2.init,t.prototype["@@transducer/result"]=B2.result,t.prototype["@@transducer/step"]=function(e,r){return this.xf["@@transducer/step"](e,this.f(r))},t}(),WBe=function(t){return function(e){return new KBe(t,e)}},VBe=WBe,GBe=Fn(lB(["fantasy-land/map","map"],VBe,function(t,e){switch(Object.prototype.toString.call(e)){case"[object Function]":return doe(e.length,function(){return t.call(this,e.apply(this,arguments))});case"[object Object]":return voe(function(r,a){return r[a]=t(e[a]),r},{},ev(e));default:return k2(t,e)}})),YBe=GBe,goe=Number.isInteger||function(t){return t<<0===t};function boe(t){return Object.prototype.toString.call(t)==="[object String]"}function yoe(t,e){var r=t<0?e.length+t:t;return boe(e)?e.charAt(r):e[r]}var JBe=Fn(function(t,e){if(e!=null)return goe(t)?yoe(t,e):e[t]}),Aw=JBe,XBe=Fn(function(t,e){return YBe(Aw(t),e)}),QBe=XBe,eOe=Fa(function(t){return cB(t)?!0:!t||typeof t!="object"||boe(t)?!1:t.length===0?!0:t.length>0?t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1):!1}),tOe=eOe,Kae=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function rOe(t,e,r){return function(a,i,h){if(tOe(h))return t(a,i,h);if(h==null)return i;if(typeof h["fantasy-land/reduce"]=="function")return e(a,i,h,"fantasy-land/reduce");if(h[Kae]!=null)return r(a,i,h[Kae]());if(typeof h.next=="function")return r(a,i,h);if(typeof h.reduce=="function")return e(a,i,h,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function iOe(t,e,r){for(var a=0,i=r.length;a<i;){if(e=t["@@transducer/step"](e,r[a]),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a+=1}return t["@@transducer/result"](e)}var nOe=Fn(function(t,e){return Ew(t.length,function(){return t.apply(e,arguments)})}),aOe=nOe;function oOe(t,e,r){for(var a=r.next();!a.done;){if(e=t["@@transducer/step"](e,a.value),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a=r.next()}return t["@@transducer/result"](e)}function sOe(t,e,r,a){return t["@@transducer/result"](r[a](aOe(t["@@transducer/step"],t),e))}var fOe=rOe(iOe,sOe,oOe),uOe=fOe,hOe=function(){function t(e){this.f=e}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(e){return e},t.prototype["@@transducer/step"]=function(e,r){return this.f(e,r)},t}();function cOe(t){return new hOe(t)}var lOe=hB(function(t,e,r){return uOe(typeof t=="function"?cOe(t):t,e,r)}),woe=lOe;function dOe(t,e){return function(){return e.call(this,t.apply(this,arguments))}}function _oe(t,e){return function(){var r=arguments.length;if(r===0)return e();var a=arguments[r-1];return cB(a)||typeof a[t]!="function"?e.apply(this,arguments):a[t].apply(a,Array.prototype.slice.call(arguments,0,r-1))}}var pOe=hB(_oe("slice",function(t,e,r){return Array.prototype.slice.call(r,t,e)})),vOe=pOe,mOe=Fa(_oe("tail",vOe(1,1/0))),gOe=mOe;function Moe(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return Ew(arguments[0].length,woe(dOe,arguments[0],gOe(arguments)))}var bOe=Fn(function(t,e){return doe(woe(HBe,0,QBe("length",e)),function(){var r=arguments,a=this;return t.apply(a,k2(function(i){return i.apply(a,r)},e))})}),yOe=bOe,wOe=Fn(function(t,e){return e==null||e!==e?t:e}),CI=wOe,_Oe=function(){function t(e,r){this.xf=r,this.f=e,this.found=!1}return t.prototype["@@transducer/init"]=B2.init,t.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,void 0)),this.xf["@@transducer/result"](e)},t.prototype["@@transducer/step"]=function(e,r){return this.f(r)&&(this.found=!0,e=wBe(this.xf["@@transducer/step"](e,r))),e},t}();function MOe(t){return function(e){return new _Oe(t,e)}}var xOe=Fn(lB(["find"],MOe,function(t,e){for(var r=0,a=e.length;r<a;){if(t(e[r]))return e[r];r+=1}})),SOe=xOe,EOe=Fa(function(t){return yOe(function(){return Array.prototype.slice.call(arguments,0)},t)}),AOe=EOe;function ROe(t,e){for(var r=e,a=0;a<t.length;a+=1){if(r==null)return;var i=t[a];goe(i)?r=yoe(i,r):r=r[i]}return r}var TOe=Fn(ROe),xoe=TOe,kOe=hB(function(t,e,r){return poe(t,Aw(e,r))}),IOe=kOe,rw=class extends Error{name="InvalidSchedulerLocation"},BOe=class extends Error{name="SchedulerTagNotFound"},OOe=class extends Error{name="TransactionNotFound"},POe="Url",NOe="Time-To-Live",COe="Scheduler",LI=t=>Moe(CI([]),SOe(IOe(t,"name")),CI({}),Aw("value")),Soe=t=>Moe(e=>{if(!e)throw new OOe(t);return e},Aw("tags"),CI([]));function Eoe({fetch:t,GRAPHQL_URL:e}){return async({query:r,variables:a})=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:r,variables:a})}).then(i=>i.json())}function LOe({fetch:t,GRAPHQL_URL:e}){let r=Eoe({fetch:t,GRAPHQL_URL:e}),a=Aoe({fetch:t,GRAPHQL_URL:e}),i=`
133
133
  query GetTransactions ($transactionIds: [ID!]!) {
134
134
  transactions(ids: $transactionIds) {
135
135
  edges {
@@ -184,7 +184,7 @@ nonce: bundlr`),Me.from(i))}};ie();ae();ne();var Q0=class{_publicKey;ownerLength
184
184
  }
185
185
  }
186
186
  }
187
- }`,i=wt.object({data:wt.object({transactions:wt.object({edges:wt.array(wt.object({node:wt.record(wt.any())}))})})});return h=>zr(h).chain($i(c=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:a,variables:{transactionIds:[c]}})}).then(async p=>{if(p.ok)return p.json();throw r('Error Encountered when querying gateway for transaction "%s"',c),new Error(`${p.status}: ${await p.text()}`)}).then(i.parse).then(VCe(["data","transactions","edges","0","node"])))).toPromise()}var a$e=sB(dBe(),1),Ose=(t="@permaweb/aoconnect")=>{let e=(0,a$e.default)(t);return e.child=r=>Ose(`${e.namespace}:${r}`),e.tap=(r,...a)=>tLe((...i)=>e(r,...a,...i)),e},Pse=({url:t,path:e})=>e?e.startsWith("/")?Pse({url:t,path:e.slice(1)}):(t=new URL(t),t.pathname+=e,t.toString()):t;function o$e(t){return uv(Ow([]),fv((e,r)=>uv(JCe([],r.name),xB(r.value),Us(r.name,Gh,e))(e),{}),Iw(e=>e.length>1?e:e[0]))(t)}function Ls(t,e){return r=>rse(oCe([noe(t,"name"),EB(MB(e),noe(e,"value"),yB)]),r)}function soe(t){return lse([[I2(String),X1(t)],[I2(Array),UCe(t)],[yB,mNe]])}function jd(t){let e;return I2($s,t)?(e=new Error(s$e(t)),e.stack+=t.stack):I2(Error,t)?e=t:LCe("message",t)?e=new Error(t.message):I2(String,t)?e=new Error(t):e=new Error("An error occurred"),e}function s$e(t){return uv(e=>function r(a,i,h){return fv((c,p)=>uv(lse([[X1(Rt.invalid_arguments),()=>r(p.argumentsError,422,"Invalid Arguments")],[X1(Rt.invalid_return_type),()=>r(p.returnTypeError,500,"Invalid Return")],[X1(Rt.invalid_union),()=>MCe(b=>r(b,400,"Invalid Union"),p.unionErrors)],[yB,()=>[{...p,status:i,contextCode:h}]]]),SB(c))(p.code),[],a.issues)}(e,400,""),e=>fv((r,a)=>{let{message:i,path:h,contextCode:c}=a,p=h[1]||h[0],b=c?`${c} `:"";return r.push(`${b}'${p}': ${i}.`),r},[],e),HCe(" | "))(t)}var f$e=wt.object({id:wt.string().min(1,{message:"message is required to be a message id"}),processId:wt.string().min(1,{message:"process is required to be a process id"})});function u$e(){return t=>zr(t).map(f$e.parse).map(()=>t)}var db=wt.object({name:wt.string(),value:wt.string()}),h$e=wt.function().args(wt.object({Id:wt.string(),Target:wt.string(),Owner:wt.string(),Anchor:wt.string().optional(),Data:wt.any().default("1234"),Tags:wt.array(wt.object({name:wt.string(),value:wt.string()}))})).returns(wt.promise(wt.any())),c$e=wt.function().args(wt.object({id:wt.string().min(1,{message:"message id is required"}),processId:wt.string().min(1,{message:"process id is required"})})).returns(wt.promise(wt.any())),l$e=wt.function().args(wt.object({process:wt.string().min(1,{message:"process id is required"}),from:wt.string().optional(),to:wt.string().optional(),sort:wt.enum(["ASC","DESC"]).default("ASC"),limit:wt.number().optional()})).returns(wt.promise(wt.object({edges:wt.array(wt.object({cursor:wt.string(),node:wt.object({Output:wt.any().optional(),Messages:wt.array(wt.any()).optional(),Spawns:wt.array(wt.any()).optional(),Error:wt.any().optional()})}))}))),Nse=wt.function().args(wt.object({processId:wt.string(),data:wt.any(),tags:wt.array(db),anchor:wt.string().optional(),signer:wt.any()})).returns(wt.promise(wt.object({messageId:wt.string()}).passthrough())),d$e=wt.function().args(wt.object({data:wt.any(),tags:wt.array(db),signer:wt.any()})).returns(wt.promise(wt.object({processId:wt.string()}).passthrough())),p$e=wt.function().args(wt.object({process:wt.string(),message:wt.string(),baseLayer:wt.boolean().optional(),exclude:wt.array(wt.string()).optional()})).returns(wt.promise(wt.object({assignmentId:wt.string()}).passthrough())),Cse=Nse,kmt=wt.function().args(wt.object({suUrl:wt.string().url(),processId:wt.string()})).returns(wt.promise(wt.object({tags:wt.array(db)}).passthrough())),Imt=wt.function().args(wt.string()).returns(wt.promise(wt.object({url:wt.string()}))),v$e=wt.function().args(wt.string()).returns(wt.promise(wt.boolean())),m$e=wt.function().args(wt.string()).returns(wt.promise(wt.object({tags:wt.array(db)}).passthrough())),Pw=wt.function().args(wt.object({data:wt.any(),tags:wt.array(db),target:wt.string().optional(),anchor:wt.string().optional()})).returns(wt.promise(wt.object({id:wt.string(),raw:wt.any()})));function g$e({loadResult:t}){return t=$i(c$e.implement(t)),e=>zr({id:e.id,processId:e.processId}).chain(t)}function b$e(t){let e=u$e(t),r=g$e(t);return({message:a,process:i})=>zr({id:a,processId:i}).chain(e).chain(r).map(t.logger.tap('readResult result for message "%s": %O',a)).map(h=>h).bimap(jd,Fd).toPromise()}var y$e=wt.array(wt.object({name:wt.string(),value:wt.string()}));function w$e(){return t=>zr(t.tags).map(Ow([])).map(Ls("Data-Protocol","ao")).map(Ls("Variant")).map(Ls("Type")).map(Ls("SDK")).map(SB(Gh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(y$e.parse).map(Us("tags",Gh,t))}function _$e({logger:t}){return e=>zr(e).chain(EB(MB(e.data),()=>$d(e),()=>$d(Math.random().toString().slice(-4)).map(Us("data",Gh,e)).map(r=>uv(qd("tags"),Ls("Content-Type"),xB({name:"Content-Type",value:"text/plain"}),Us("tags",Gh,r))(r)).map(t.tap('added pseudo-random string as message "data"'))))}function M$e(t){let e=w$e(t),r=_$e(t),a=Nse.implement(t.deployMessage);return i=>zr(i).chain(e).chain(r).chain($i(({id:h,data:c,tags:p,anchor:b,signer:g})=>a({processId:h,data:c,tags:p,anchor:b,signer:Pw.implement(g)}))).map(h=>Us("messageId",h.messageId,i))}function x$e(t){let e=M$e(t);return({process:r,data:a,tags:i,anchor:h,signer:c})=>zr({id:r,data:a,tags:i,anchor:h,signer:c}).chain(e).map(p=>p.messageId).bimap(jd,Fd).toPromise()}var w2=(t,e,r)=>a=>e(a[t])?$d(a):Tl(`Tag '${t}': ${r}`);function S$e({loadTransactionMeta:t,logger:e}){return t=$i(m$e.implement(t)),r=>zr(r).chain(t).map(qd("tags")).map(o$e).chain(w2("Data-Protocol",soe("ao"),"value 'ao' was not found on module")).chain(w2("Type",soe("Module"),"value 'Module' was not found on module")).chain(w2("Module-Format",OI,"was not found on module")).chain(w2("Input-Encoding",OI,"was not found on module")).chain(w2("Output-Encoding",OI,"was not found on module")).bimap(e.tap("Verifying module source failed: %s"),e.tap("Verified module source"))}function E$e({logger:t,validateScheduler:e}){return e=$i(v$e.implement(e)),r=>zr(r).chain(a=>e(a).chain(i=>i?$d(a):Tl(`Valid Scheduler-Location owned by ${a} not found`))).bimap(t.tap("Verifying scheduler failed: %s"),t.tap("Verified scheduler"))}function A$e({logger:t}){return e=>zr(e).map(t.tap("Checking for signer")).chain(r=>r?$d(r):Tl("signer not found"))}function R$e(t){let e=t.logger.child("verifyInput");t={...t,logger:e};let r=S$e(t),a=E$e(t),i=A$e(t);return h=>zr(h).chain(c=>r(c.module).map(()=>c)).chain(c=>a(c.scheduler)).map(()=>h).chain(c=>i(c.signer).map(()=>c)).bimap(e.tap("Error when verify input: %s"),e.tap("Successfully verified inputs"))}var T$e=wt.array(wt.object({name:wt.string(),value:wt.string()}));function k$e(){return t=>zr(t).map(qd("tags")).map(Ow([])).map(Ls("Data-Protocol","ao")).map(Ls("Variant")).map(Ls("Type")).map(Ls("Module")).map(Ls("Scheduler")).map(Ls("SDK")).map(SB(Gh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:t.module},{name:"Scheduler",value:t.scheduler},{name:"SDK",value:"aoconnect"}])).map(T$e.parse).map(Us("tags",Gh,t))}function I$e({logger:t}){return e=>zr(e).chain(EB(MB(e.data),()=>$d(e),()=>$d(Math.random().toString().slice(-4)).map(Us("data",Gh,e)).map(r=>uv(qd("tags"),Ls("Content-Type"),xB({name:"Content-Type",value:"text/plain"}),Us("tags",Gh,r))(r)).map(t.tap('added pseudo-random string as process "data"'))))}function B$e(t){let e=t.logger.child("uploadProcess");t={...t,logger:e};let r=k$e(t),a=I$e(t),i=d$e.implement(t.deployProcess);return h=>zr(h).chain(r).chain(a).chain($i(({data:c,tags:p,signer:b})=>i({data:c,tags:p,signer:Pw.implement(b)}))).map(c=>Us("processId",c.processId,h))}function O$e(t){let e=R$e(t),r=B$e(t);return({module:a,scheduler:i,signer:h,tags:c,data:p})=>zr({module:a,scheduler:i,signer:h,tags:c,data:p}).chain(e).chain(r).map(b=>b.processId).bimap(jd,Fd).toPromise()}function P$e(t){let e=Cse.implement(t.deployMonitor);return r=>zr(r).chain($i(({id:a,signer:i})=>e({processId:a,signer:Pw.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(a=>Us("monitorId",a.messageId,r))}function N$e(t){let e=P$e(t);return({process:r,signer:a})=>zr({id:r,signer:a}).chain(e).map(i=>i.monitorId).bimap(jd,Fd).toPromise()}function C$e(t){let e=Cse.implement(t.deployUnmonitor);return r=>zr(r).chain($i(({id:a,signer:i})=>e({processId:a,signer:Pw.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(a=>Us("monitorId",a.messageId,r))}function L$e(t){let e=C$e(t);return({process:r,signer:a})=>zr({id:r,signer:a}).chain(e).map(i=>i.monitorId).bimap(jd,Fd).toPromise()}var $$e=wt.object({process:wt.string().min(1,{message:"process identifier is required"}),from:wt.string().optional(),to:wt.string().optional(),sort:wt.enum(["ASC","DESC"]).default("ASC"),limit:wt.number().optional()});function D$e(){return t=>zr(t).map($$e.parse).map(()=>t)}function U$e({queryResults:t}){return t=$i(l$e.implement(t)),e=>zr({process:e.process,from:e.from,to:e.to,sort:e.sort,limit:e.limit}).chain(t)}function q$e(t){let e=D$e(t),r=U$e(t);return({process:a,from:i,to:h,sort:c,limit:p})=>zr({process:a,from:i,to:h,sort:c,limit:p}).chain(e).chain(r).map(t.logger.tap('readResults result for message "%s": %O',a)).map(b=>b).bimap(jd,Fd).toPromise()}var F$e=wt.object({Id:wt.string(),Target:wt.string(),Owner:wt.string(),Anchor:wt.string().optional(),Data:wt.any().default("1234"),Tags:wt.array(wt.object({name:wt.string(),value:wt.string()}))});function j$e(){return t=>zr(t).map(F$e.parse).map(e=>(e.Tags=e.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),e))}function z$e({dryrunFetch:t}){return $i(h$e.implement(t))}function Z$e(t){let e=j$e(t),r=z$e(t);return a=>zr(a).map(H$e).chain(e).chain(r).toPromise()}function H$e({process:t,data:e,tags:r,anchor:a,...i}){return{Id:"1234",Owner:"1234",...i,Target:t,Data:e||"1234",Tags:r||[],Anchor:a||"0"}}function K$e(t){let e=p$e.implement(t.deployAssign);return r=>zr(r).chain($i(({process:a,message:i,baseLayer:h,exclude:c})=>e({process:a,message:i,baseLayer:h,exclude:c}))).map(a=>Us("assignmentId",a.assignmentId,r))}function W$e(t){let e=K$e(t);return({process:r,message:a,baseLayer:i,exclude:h})=>zr({process:r,message:a,baseLayer:i,exclude:h}).chain(e).map(c=>c.assignmentId).bimap(jd,Fd).toPromise()}var V$e="https://arweave.net",G$e="https://mu.ao-testnet.xyz",Y$e="https://cu.ao-testnet.xyz";function vv({GRAPHQL_URL:t,GATEWAY_URL:e=V$e,MU_URL:r=G$e,CU_URL:a=Y$e}={}){let i=Ose();t||(t=Pse({url:e,path:"/graphql"}));let{validate:h}=Xoe({cacheSize:100,GRAPHQL_URL:t}),c=pNe({MAX_SIZE:25}),p=i.child("result"),b=b$e({loadResult:cNe({fetch,CU_URL:a,logger:p}),logger:p}),g=i.child("message"),y=x$e({loadProcessMeta:kI({fetch,cache:c,logger:g}),deployMessage:aNe({fetch,MU_URL:r,logger:g}),logger:g}),M=i.child("spawn"),x=O$e({loadTransactionMeta:n$e({fetch,GRAPHQL_URL:t,logger:M}),validateScheduler:h,deployProcess:oNe({fetch,MU_URL:r,logger:M}),logger:M}),E=i.child("monitor"),A=N$e({loadProcessMeta:kI({fetch,cache:c,logger:E}),deployMonitor:sNe({fetch,MU_URL:r,logger:E}),logger:E}),k=i.child("unmonitor"),O=L$e({loadProcessMeta:kI({fetch,cache:c,logger:k}),deployUnmonitor:fNe({fetch,MU_URL:r,logger:k}),logger:E}),N=i.child("results"),L=q$e({queryResults:lNe({fetch,CU_URL:a,logger:N}),logger:N}),C=i.child("dryrun"),Y=Z$e({dryrunFetch:hNe({fetch,CU_URL:a,logger:C}),logger:C}),G=i.child("assign"),ee=W$e({deployAssign:uNe({fetch,MU_URL:r,logger:G}),logger:g});return{result:b,results:L,message:y,spawn:x,monitor:A,unmonitor:O,dryrun:Y,assign:ee}}var Lse={};hoe(Lse,{createDataItemSigner:()=>_De});var $se=sB(mBe(),1),Dse={};hoe(Dse,{AVSCTap:()=>pb,ArweaveSigner:()=>IB,DataItem:()=>ub,MAX_TAG_BYTES:()=>Nw,MIN_BINARY_SIZE:()=>PB,SIG_CONFIG:()=>pv,SignatureConfig:()=>Cs,Signer:()=>jse,createData:()=>Kse,default:()=>bDe,deserializeTags:()=>Sw,indexToType:()=>BB,serializeTags:()=>OB,tagsExceedLimit:()=>Hse,warparbundles:()=>yDe});var J$e=Object.create,TB=Object.defineProperty,X$e=Object.getOwnPropertyDescriptor,Q$e=Object.getOwnPropertyNames,eDe=Object.getPrototypeOf,tDe=Object.prototype.hasOwnProperty,Jh=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),rDe=(t,e)=>{for(var r in e)TB(t,r,{get:e[r],enumerable:!0})},iDe=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Q$e(e))!tDe.call(t,i)&&i!==r&&TB(t,i,{get:()=>e[i],enumerable:!(a=X$e(e,i))||a.enumerable});return t},zd=(t,e,r)=>(r=t!=null?J$e(eDe(t)):{},iDe(e||!t||!t.__esModule?TB(r,"default",{value:t,enumerable:!0}):r,t)),nDe=Jh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function e(r){var a=4,i=r.length,h=i%a;if(!h)return r;var c=i,p=a-h,b=i+p,g=Me.alloc(b);for(g.write(r);p--;)g.write("=",c++);return g.toString()}t.default=e}),aDe=Jh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=nDe();function r(b,g){return g===void 0&&(g="utf8"),Me.isBuffer(b)?h(b.toString("base64")):h(Me.from(b,g).toString("base64"))}function a(b,g){return g===void 0&&(g="utf8"),Me.from(i(b),"base64").toString(g)}function i(b){return b=b.toString(),e.default(b).replace(/\-/g,"+").replace(/_/g,"/")}function h(b){return b.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(b){return Me.from(i(b),"base64")}var p=r;p.encode=r,p.decode=a,p.toBase64=i,p.fromBase64=h,p.toBuffer=c,t.default=p}),kB=Jh((t,e)=>{e.exports=aDe().default,e.exports.default=e.exports}),Use=Jh(t=>{"use strict";t.byteLength=b,t.toByteArray=y,t.fromByteArray=E;var e=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,c=i.length;h<c;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,c;r[45]=62,r[95]=63;function p(A){var k=A.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var O=A.indexOf("=");O===-1&&(O=k);var N=O===k?0:4-O%4;return[O,N]}function b(A){var k=p(A),O=k[0],N=k[1];return(O+N)*3/4-N}function g(A,k,O){return(k+O)*3/4-O}function y(A){var k,O=p(A),N=O[0],L=O[1],C=new a(g(A,N,L)),Y=0,G=L>0?N-4:N,ee;for(ee=0;ee<G;ee+=4)k=r[A.charCodeAt(ee)]<<18|r[A.charCodeAt(ee+1)]<<12|r[A.charCodeAt(ee+2)]<<6|r[A.charCodeAt(ee+3)],C[Y++]=k>>16&255,C[Y++]=k>>8&255,C[Y++]=k&255;return L===2&&(k=r[A.charCodeAt(ee)]<<2|r[A.charCodeAt(ee+1)]>>4,C[Y++]=k&255),L===1&&(k=r[A.charCodeAt(ee)]<<10|r[A.charCodeAt(ee+1)]<<4|r[A.charCodeAt(ee+2)]>>2,C[Y++]=k>>8&255,C[Y++]=k&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,k,O){for(var N,L=[],C=k;C<O;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var k,O=A.length,N=O%3,L=[],C=16383,Y=0,G=O-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(k=A[O-1],L.push(e[k>>2]+e[k<<4&63]+"==")):N===2&&(k=(A[O-2]<<8)+A[O-1],L.push(e[k>>10]+e[k>>4&63]+e[k<<2&63]+"=")),L.join("")}}),qse=Jh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.b64UrlDecode=t.b64UrlEncode=t.bufferTob64Url=t.bufferTob64=t.b64UrlToBuffer=t.stringToB64Url=t.stringToBuffer=t.bufferToString=t.b64UrlToString=t.concatBuffers=void 0;var e=Use();function r(x){let E=0;for(let O=0;O<x.length;O++)E+=x[O].byteLength;let A=new Uint8Array(E),k=0;A.set(new Uint8Array(x[0]),k),k+=x[0].byteLength;for(let O=1;O<x.length;O++)A.set(new Uint8Array(x[O]),k),k+=x[O].byteLength;return A}t.concatBuffers=r;function a(x){let E=p(x);return i(E)}t.b64UrlToString=a;function i(x){return new TextDecoder("utf-8",{fatal:!0}).decode(x)}t.bufferToString=i;function h(x){return new TextEncoder().encode(x)}t.stringToBuffer=h;function c(x){return g(h(x))}t.stringToB64Url=c;function p(x){return new Uint8Array(e.toByteArray(M(x)))}t.b64UrlToBuffer=p;function b(x){return e.fromByteArray(new Uint8Array(x))}t.bufferTob64=b;function g(x){return y(b(x))}t.bufferTob64Url=g;function y(x){return x.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}t.b64UrlEncode=y;function M(x){x=x.replace(/\-/g,"+").replace(/\_/g,"/");let E;return x.length%4==0?E=0:E=4-x.length%4,x.concat("=".repeat(E))}t.b64UrlDecode=M}),oDe=Jh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=qse(),r=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let a=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),i=await this.driver.exportKey("jwk",a.privateKey);return{kty:i.kty,e:i.e,n:i.n,d:i.d,p:i.p,q:i.q,dp:i.dp,dq:i.dq,qi:i.qi}}async sign(a,i,{saltLength:h}={}){let c=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(a),i);return new Uint8Array(c)}async hash(a,i="SHA-256"){let h=await this.driver.digest(i,a);return new Uint8Array(h)}async verify(a,i,h){let c={kty:"RSA",e:"AQAB",n:a},p=await this.jwkToPublicCryptoKey(c),b=await this.driver.digest("SHA-256",i),g=await this.driver.verify({name:"RSA-PSS",saltLength:0},p,h,i),y=await this.driver.verify({name:"RSA-PSS",saltLength:32},p,h,i),M=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((p.algorithm.modulusLength-1)/8)-b.byteLength-2},p,h,i);return g||y||M}async jwkToCryptoKey(a){return this.driver.importKey("jwk",a,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(a){return this.driver.importKey("jwk",a,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let a=crypto?.subtle;return a===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(i=>typeof a[i]=="function")}async encrypt(a,i,h){let c=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),p=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=new Uint8Array(16);crypto.getRandomValues(b);let g=await this.driver.encrypt({name:"AES-CBC",iv:b},p,a);return e.concatBuffers([b,g])}async decrypt(a,i,h){let c=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),p=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=a.slice(0,16),g=await this.driver.decrypt({name:"AES-CBC",iv:b},p,a.slice(16));return e.concatBuffers([g])}};t.default=r}),sDe=Jh(t=>{t.read=function(e,r,a,i,h){var c,p,b=h*8-i-1,g=(1<<b)-1,y=g>>1,M=-7,x=a?h-1:0,E=a?-1:1,A=e[r+x];for(x+=E,c=A&(1<<-M)-1,A>>=-M,M+=b;M>0;c=c*256+e[r+x],x+=E,M-=8);for(p=c&(1<<-M)-1,c>>=-M,M+=i;M>0;p=p*256+e[r+x],x+=E,M-=8);if(c===0)c=1-y;else{if(c===g)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,i),c=c-y}return(A?-1:1)*p*Math.pow(2,c-i)},t.write=function(e,r,a,i,h,c){var p,b,g,y=c*8-h-1,M=(1<<y)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:c-1,k=i?1:-1,O=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,p=M):(p=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-p))<1&&(p--,g*=2),p+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(p++,g/=2),p+x>=M?(b=0,p=M):p+x>=1?(b=(r*g-1)*Math.pow(2,h),p=p+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),p=0));h>=8;e[a+A]=b&255,A+=k,b/=256,h-=8);for(p=p<<h|b,y+=h;y>0;e[a+A]=p&255,A+=k,p/=256,y-=8);e[a+A-k]|=O*128}}),nB=Jh(t=>{"use strict";var e=Use(),r=sDe(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=p,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,p.TYPED_ARRAY_SUPPORT=h(),!p.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 h(){try{let T=new Uint8Array(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,Uint8Array.prototype),Object.setPrototypeOf(T,I),T.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function c(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let I=new Uint8Array(T);return Object.setPrototypeOf(I,p.prototype),I}function p(T,I,P){if(typeof T=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,I,P)}p.poolSize=8192;function b(T,I,P){if(typeof T=="string")return x(T,I);if(ArrayBuffer.isView(T))return A(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(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return k(T,I,P);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let U=T.valueOf&&T.valueOf();if(U!=null&&U!==T)return p.from(U,I,P);let H=O(T);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return p.from(T[Symbol.toPrimitive]("string"),I,P);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}p.from=function(T,I,P){return b(T,I,P)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array);function g(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 y(T,I,P){return g(T),T<=0?c(T):I!==void 0?typeof P=="string"?c(T).fill(I,P):c(T).fill(I):c(T)}p.alloc=function(T,I,P){return y(T,I,P)};function M(T){return g(T),c(T<0?0:N(T)|0)}p.allocUnsafe=function(T){return M(T)},p.allocUnsafeSlow=function(T){return M(T)};function x(T,I){if((typeof I!="string"||I==="")&&(I="utf8"),!p.isEncoding(I))throw new TypeError("Unknown encoding: "+I);let P=C(T,I)|0,U=c(P),H=U.write(T,I);return H!==P&&(U=U.slice(0,H)),U}function E(T){let I=T.length<0?0:N(T.length)|0,P=c(I);for(let U=0;U<I;U+=1)P[U]=T[U]&255;return P}function A(T){if(ut(T,Uint8Array)){let I=new Uint8Array(T);return k(I.buffer,I.byteOffset,I.byteLength)}return E(T)}function k(T,I,P){if(I<0||T.byteLength<I)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<I+(P||0))throw new RangeError('"length" is outside of buffer bounds');let U;return I===void 0&&P===void 0?U=new Uint8Array(T):P===void 0?U=new Uint8Array(T,I):U=new Uint8Array(T,I,P),Object.setPrototypeOf(U,p.prototype),U}function O(T){if(p.isBuffer(T)){let I=N(T.length)|0,P=c(I);return P.length===0||T.copy(P,0,0,I),P}if(T.length!==void 0)return typeof T.length!="number"||Ze(T.length)?c(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),p.alloc(+T)}p.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==p.prototype},p.compare=function(T,I){if(ut(T,Uint8Array)&&(T=p.from(T,T.offset,T.byteLength)),ut(I,Uint8Array)&&(I=p.from(I,I.offset,I.byteLength)),!p.isBuffer(T)||!p.isBuffer(I))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===I)return 0;let P=T.length,U=I.length;for(let H=0,W=Math.min(P,U);H<W;++H)if(T[H]!==I[H]){P=T[H],U=I[H];break}return P<U?-1:U<P?1:0},p.isEncoding=function(T){switch(String(T).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.concat=function(T,I){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return p.alloc(0);let P;if(I===void 0)for(I=0,P=0;P<T.length;++P)I+=T[P].length;let U=p.allocUnsafe(I),H=0;for(P=0;P<T.length;++P){let W=T[P];if(ut(W,Uint8Array))H+W.length>U.length?(p.isBuffer(W)||(W=p.from(W)),W.copy(U,H)):Uint8Array.prototype.set.call(U,W,H);else if(p.isBuffer(W))W.copy(U,H);else throw new TypeError('"list" argument must be an Array of Buffers');H+=W.length}return U};function C(T,I){if(p.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(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 P=T.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&P===0)return 0;let H=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return P;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P*2;case"hex":return P>>>1;case"base64":return ge(T).length;default:if(H)return U?-1:oe(T).length;I=(""+I).toLowerCase(),H=!0}}p.byteLength=C;function Y(T,I,P){let U=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((P===void 0||P>this.length)&&(P=this.length),P<=0)||(P>>>=0,I>>>=0,P<=I))return"";for(T||(T="utf8");;)switch(T){case"hex":return o(this,I,P);case"utf8":case"utf-8":return u(this,I,P);case"ascii":return w(this,I,P);case"latin1":case"binary":return d(this,I,P);case"base64":return f(this,I,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,I,P);default:if(U)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),U=!0}}p.prototype._isBuffer=!0;function G(T,I,P){let U=T[I];T[I]=T[P],T[P]=U}p.prototype.swap16=function(){let T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let I=0;I<T;I+=2)G(this,I,I+1);return this},p.prototype.swap32=function(){let T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let I=0;I<T;I+=4)G(this,I,I+3),G(this,I+1,I+2);return this},p.prototype.swap64=function(){let T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let I=0;I<T;I+=8)G(this,I,I+7),G(this,I+1,I+6),G(this,I+2,I+5),G(this,I+3,I+4);return this},p.prototype.toString=function(){let T=this.length;return T===0?"":arguments.length===0?u(this,0,T):Y.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(T){if(!p.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:p.compare(this,T)===0},p.prototype.inspect=function(){let T="",I=t.INSPECT_MAX_BYTES;return T=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I&&(T+=" ... "),"<Buffer "+T+">"},a&&(p.prototype[a]=p.prototype.inspect),p.prototype.compare=function(T,I,P,U,H){if(ut(T,Uint8Array)&&(T=p.from(T,T.offset,T.byteLength)),!p.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(I===void 0&&(I=0),P===void 0&&(P=T?T.length:0),U===void 0&&(U=0),H===void 0&&(H=this.length),I<0||P>T.length||U<0||H>this.length)throw new RangeError("out of range index");if(U>=H&&I>=P)return 0;if(U>=H)return-1;if(I>=P)return 1;if(I>>>=0,P>>>=0,U>>>=0,H>>>=0,this===T)return 0;let W=H-U,fe=P-I,st=Math.min(W,fe),ue=this.slice(U,H),me=T.slice(I,P);for(let pe=0;pe<st;++pe)if(ue[pe]!==me[pe]){W=ue[pe],fe=me[pe];break}return W<fe?-1:fe<W?1:0};function ee(T,I,P,U,H){if(T.length===0)return-1;if(typeof P=="string"?(U=P,P=0):P>2147483647?P=2147483647:P<-2147483648&&(P=-2147483648),P=+P,Ze(P)&&(P=H?0:T.length-1),P<0&&(P=T.length+P),P>=T.length){if(H)return-1;P=T.length-1}else if(P<0)if(H)P=0;else return-1;if(typeof I=="string"&&(I=p.from(I,U)),p.isBuffer(I))return I.length===0?-1:$(T,I,P,U,H);if(typeof I=="number")return I=I&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(T,I,P):Uint8Array.prototype.lastIndexOf.call(T,I,P):$(T,[I],P,U,H);throw new TypeError("val must be string, number or Buffer")}function $(T,I,P,U,H){let W=1,fe=T.length,st=I.length;if(U!==void 0&&(U=String(U).toLowerCase(),U==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(T.length<2||I.length<2)return-1;W=2,fe/=2,st/=2,P/=2}function ue(pe,be){return W===1?pe[be]:pe.readUInt16BE(be*W)}let me;if(H){let pe=-1;for(me=P;me<fe;me++)if(ue(T,me)===ue(I,pe===-1?0:me-pe)){if(pe===-1&&(pe=me),me-pe+1===st)return pe*W}else pe!==-1&&(me-=me-pe),pe=-1}else for(P+st>fe&&(P=fe-st),me=P;me>=0;me--){let pe=!0;for(let be=0;be<st;be++)if(ue(T,me+be)!==ue(I,be)){pe=!1;break}if(pe)return me}return-1}p.prototype.includes=function(T,I,P){return this.indexOf(T,I,P)!==-1},p.prototype.indexOf=function(T,I,P){return ee(this,T,I,P,!0)},p.prototype.lastIndexOf=function(T,I,P){return ee(this,T,I,P,!1)};function q(T,I,P,U){P=Number(P)||0;let H=T.length-P;U?(U=Number(U),U>H&&(U=H)):U=H;let W=I.length;U>W/2&&(U=W/2);let fe;for(fe=0;fe<U;++fe){let st=parseInt(I.substr(fe*2,2),16);if(Ze(st))return fe;T[P+fe]=st}return fe}function V(T,I,P,U){return Se(oe(I,T.length-P),T,P,U)}function _(T,I,P,U){return Se(le(I),T,P,U)}function n(T,I,P,U){return Se(ge(I),T,P,U)}function s(T,I,P,U){return Se(ot(I,T.length-P),T,P,U)}p.prototype.write=function(T,I,P,U){if(I===void 0)U="utf8",P=this.length,I=0;else if(P===void 0&&typeof I=="string")U=I,P=this.length,I=0;else if(isFinite(I))I=I>>>0,isFinite(P)?(P=P>>>0,U===void 0&&(U="utf8")):(U=P,P=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let H=this.length-I;if((P===void 0||P>H)&&(P=H),T.length>0&&(P<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let W=!1;for(;;)switch(U){case"hex":return q(this,T,I,P);case"utf8":case"utf-8":return V(this,T,I,P);case"ascii":case"latin1":case"binary":return _(this,T,I,P);case"base64":return n(this,T,I,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,T,I,P);default:if(W)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),W=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,I,P){return I===0&&P===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(I,P))}function u(T,I,P){P=Math.min(T.length,P);let U=[],H=I;for(;H<P;){let W=T[H],fe=null,st=W>239?4:W>223?3:W>191?2:1;if(H+st<=P){let ue,me,pe,be;switch(st){case 1:W<128&&(fe=W);break;case 2:ue=T[H+1],(ue&192)===128&&(be=(W&31)<<6|ue&63,be>127&&(fe=be));break;case 3:ue=T[H+1],me=T[H+2],(ue&192)===128&&(me&192)===128&&(be=(W&15)<<12|(ue&63)<<6|me&63,be>2047&&(be<55296||be>57343)&&(fe=be));break;case 4:ue=T[H+1],me=T[H+2],pe=T[H+3],(ue&192)===128&&(me&192)===128&&(pe&192)===128&&(be=(W&15)<<18|(ue&63)<<12|(me&63)<<6|pe&63,be>65535&&be<1114112&&(fe=be))}}fe===null?(fe=65533,st=1):fe>65535&&(fe-=65536,U.push(fe>>>10&1023|55296),fe=56320|fe&1023),U.push(fe),H+=st}return m(U)}var l=4096;function m(T){let I=T.length;if(I<=l)return String.fromCharCode.apply(String,T);let P="",U=0;for(;U<I;)P+=String.fromCharCode.apply(String,T.slice(U,U+=l));return P}function w(T,I,P){let U="";P=Math.min(T.length,P);for(let H=I;H<P;++H)U+=String.fromCharCode(T[H]&127);return U}function d(T,I,P){let U="";P=Math.min(T.length,P);for(let H=I;H<P;++H)U+=String.fromCharCode(T[H]);return U}function o(T,I,P){let U=T.length;(!I||I<0)&&(I=0),(!P||P<0||P>U)&&(P=U);let H="";for(let W=I;W<P;++W)H+=Ge[T[W]];return H}function v(T,I,P){let U=T.slice(I,P),H="";for(let W=0;W<U.length-1;W+=2)H+=String.fromCharCode(U[W]+U[W+1]*256);return H}p.prototype.slice=function(T,I){let P=this.length;T=~~T,I=I===void 0?P:~~I,T<0?(T+=P,T<0&&(T=0)):T>P&&(T=P),I<0?(I+=P,I<0&&(I=0)):I>P&&(I=P),I<T&&(I=T);let U=this.subarray(T,I);return Object.setPrototypeOf(U,p.prototype),U};function R(T,I,P){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+I>P)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(T,I,P){T=T>>>0,I=I>>>0,P||R(T,I,this.length);let U=this[T],H=1,W=0;for(;++W<I&&(H*=256);)U+=this[T+W]*H;return U},p.prototype.readUintBE=p.prototype.readUIntBE=function(T,I,P){T=T>>>0,I=I>>>0,P||R(T,I,this.length);let U=this[T+--I],H=1;for(;I>0&&(H*=256);)U+=this[T+--I]*H;return U},p.prototype.readUint8=p.prototype.readUInt8=function(T,I){return T=T>>>0,I||R(T,1,this.length),this[T]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(T,I){return T=T>>>0,I||R(T,2,this.length),this[T]|this[T+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(T,I){return T=T>>>0,I||R(T,2,this.length),this[T]<<8|this[T+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(T,I){return T=T>>>0,I||R(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},p.prototype.readBigUInt64LE=ct(function(T){T=T>>>0,J(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&X(T,this.length-8);let U=I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,H=this[++T]+this[++T]*2**8+this[++T]*2**16+P*2**24;return BigInt(U)+(BigInt(H)<<BigInt(32))}),p.prototype.readBigUInt64BE=ct(function(T){T=T>>>0,J(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&X(T,this.length-8);let U=I*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],H=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+P;return(BigInt(U)<<BigInt(32))+BigInt(H)}),p.prototype.readIntLE=function(T,I,P){T=T>>>0,I=I>>>0,P||R(T,I,this.length);let U=this[T],H=1,W=0;for(;++W<I&&(H*=256);)U+=this[T+W]*H;return H*=128,U>=H&&(U-=Math.pow(2,8*I)),U},p.prototype.readIntBE=function(T,I,P){T=T>>>0,I=I>>>0,P||R(T,I,this.length);let U=I,H=1,W=this[T+--U];for(;U>0&&(H*=256);)W+=this[T+--U]*H;return H*=128,W>=H&&(W-=Math.pow(2,8*I)),W},p.prototype.readInt8=function(T,I){return T=T>>>0,I||R(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},p.prototype.readInt16LE=function(T,I){T=T>>>0,I||R(T,2,this.length);let P=this[T]|this[T+1]<<8;return P&32768?P|4294901760:P},p.prototype.readInt16BE=function(T,I){T=T>>>0,I||R(T,2,this.length);let P=this[T+1]|this[T]<<8;return P&32768?P|4294901760:P},p.prototype.readInt32LE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},p.prototype.readInt32BE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},p.prototype.readBigInt64LE=ct(function(T){T=T>>>0,J(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&X(T,this.length-8);let U=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(P<<24);return(BigInt(U)<<BigInt(32))+BigInt(I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),p.prototype.readBigInt64BE=ct(function(T){T=T>>>0,J(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&X(T,this.length-8);let U=(I<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(U)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+P)}),p.prototype.readFloatLE=function(T,I){return T=T>>>0,I||R(T,4,this.length),r.read(this,T,!0,23,4)},p.prototype.readFloatBE=function(T,I){return T=T>>>0,I||R(T,4,this.length),r.read(this,T,!1,23,4)},p.prototype.readDoubleLE=function(T,I){return T=T>>>0,I||R(T,8,this.length),r.read(this,T,!0,52,8)},p.prototype.readDoubleBE=function(T,I){return T=T>>>0,I||R(T,8,this.length),r.read(this,T,!1,52,8)};function S(T,I,P,U,H,W){if(!p.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>H||I<W)throw new RangeError('"value" argument is out of bounds');if(P+U>T.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(T,I,P,U){if(T=+T,I=I>>>0,P=P>>>0,!U){let fe=Math.pow(2,8*P)-1;S(this,T,I,P,fe,0)}let H=1,W=0;for(this[I]=T&255;++W<P&&(H*=256);)this[I+W]=T/H&255;return I+P},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(T,I,P,U){if(T=+T,I=I>>>0,P=P>>>0,!U){let fe=Math.pow(2,8*P)-1;S(this,T,I,P,fe,0)}let H=P-1,W=1;for(this[I+H]=T&255;--H>=0&&(W*=256);)this[I+H]=T/W&255;return I+P},p.prototype.writeUint8=p.prototype.writeUInt8=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,1,255,0),this[I]=T&255,I+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,2,65535,0),this[I]=T&255,this[I+1]=T>>>8,I+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,2,65535,0),this[I]=T>>>8,this[I+1]=T&255,I+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,4,4294967295,0),this[I+3]=T>>>24,this[I+2]=T>>>16,this[I+1]=T>>>8,this[I]=T&255,I+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,4,4294967295,0),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4};function B(T,I,P,U,H){j(I,U,H,T,P,7);let W=Number(I&BigInt(4294967295));T[P++]=W,W=W>>8,T[P++]=W,W=W>>8,T[P++]=W,W=W>>8,T[P++]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[P++]=fe,fe=fe>>8,T[P++]=fe,fe=fe>>8,T[P++]=fe,fe=fe>>8,T[P++]=fe,P}function F(T,I,P,U,H){j(I,U,H,T,P,7);let W=Number(I&BigInt(4294967295));T[P+7]=W,W=W>>8,T[P+6]=W,W=W>>8,T[P+5]=W,W=W>>8,T[P+4]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[P+3]=fe,fe=fe>>8,T[P+2]=fe,fe=fe>>8,T[P+1]=fe,fe=fe>>8,T[P]=fe,P+8}p.prototype.writeBigUInt64LE=ct(function(T,I=0){return B(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=ct(function(T,I=0){return F(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(T,I,P,U){if(T=+T,I=I>>>0,!U){let st=Math.pow(2,8*P-1);S(this,T,I,P,st-1,-st)}let H=0,W=1,fe=0;for(this[I]=T&255;++H<P&&(W*=256);)T<0&&fe===0&&this[I+H-1]!==0&&(fe=1),this[I+H]=(T/W>>0)-fe&255;return I+P},p.prototype.writeIntBE=function(T,I,P,U){if(T=+T,I=I>>>0,!U){let st=Math.pow(2,8*P-1);S(this,T,I,P,st-1,-st)}let H=P-1,W=1,fe=0;for(this[I+H]=T&255;--H>=0&&(W*=256);)T<0&&fe===0&&this[I+H+1]!==0&&(fe=1),this[I+H]=(T/W>>0)-fe&255;return I+P},p.prototype.writeInt8=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,1,127,-128),T<0&&(T=255+T+1),this[I]=T&255,I+1},p.prototype.writeInt16LE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,2,32767,-32768),this[I]=T&255,this[I+1]=T>>>8,I+2},p.prototype.writeInt16BE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,2,32767,-32768),this[I]=T>>>8,this[I+1]=T&255,I+2},p.prototype.writeInt32LE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,4,2147483647,-2147483648),this[I]=T&255,this[I+1]=T>>>8,this[I+2]=T>>>16,this[I+3]=T>>>24,I+4},p.prototype.writeInt32BE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4},p.prototype.writeBigInt64LE=ct(function(T,I=0){return B(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=ct(function(T,I=0){return F(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function D(T,I,P,U,H,W){if(P+U>T.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("Index out of range")}function re(T,I,P,U,H){return I=+I,P=P>>>0,H||D(T,I,P,4,34028234663852886e22,-34028234663852886e22),r.write(T,I,P,U,23,4),P+4}p.prototype.writeFloatLE=function(T,I,P){return re(this,T,I,!0,P)},p.prototype.writeFloatBE=function(T,I,P){return re(this,T,I,!1,P)};function Q(T,I,P,U,H){return I=+I,P=P>>>0,H||D(T,I,P,8,17976931348623157e292,-17976931348623157e292),r.write(T,I,P,U,52,8),P+8}p.prototype.writeDoubleLE=function(T,I,P){return Q(this,T,I,!0,P)},p.prototype.writeDoubleBE=function(T,I,P){return Q(this,T,I,!1,P)},p.prototype.copy=function(T,I,P,U){if(!p.isBuffer(T))throw new TypeError("argument should be a Buffer");if(P||(P=0),!U&&U!==0&&(U=this.length),I>=T.length&&(I=T.length),I||(I=0),U>0&&U<P&&(U=P),U===P||T.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if(P<0||P>=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),T.length-I<U-P&&(U=T.length-I+P);let H=U-P;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(I,P,U):Uint8Array.prototype.set.call(T,this.subarray(P,U),I),H},p.prototype.fill=function(T,I,P,U){if(typeof T=="string"){if(typeof I=="string"?(U=I,I=0,P=this.length):typeof P=="string"&&(U=P,P=this.length),U!==void 0&&typeof U!="string")throw new TypeError("encoding must be a string");if(typeof U=="string"&&!p.isEncoding(U))throw new TypeError("Unknown encoding: "+U);if(T.length===1){let W=T.charCodeAt(0);(U==="utf8"&&W<128||U==="latin1")&&(T=W)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(I<0||this.length<I||this.length<P)throw new RangeError("Out of range index");if(P<=I)return this;I=I>>>0,P=P===void 0?this.length:P>>>0,T||(T=0);let H;if(typeof T=="number")for(H=I;H<P;++H)this[H]=T;else{let W=p.isBuffer(T)?T:p.from(T,U),fe=W.length;if(fe===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(H=0;H<P-I;++H)this[H+I]=W[H%fe]}return this};var Z={};function K(T,I,P){Z[T]=class extends P{constructor(){super(),Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(U){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:U,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,I){return`The "${T}" argument must be of type number. Received type ${typeof I}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,I,P){let U=`The value of "${T}" is out of range.`,H=P;return Number.isInteger(P)&&Math.abs(P)>2**32?H=ce(String(P)):typeof P=="bigint"&&(H=String(P),(P>BigInt(2)**BigInt(32)||P<-(BigInt(2)**BigInt(32)))&&(H=ce(H)),H+="n"),U+=` It must be ${I}. Received ${H}`,U},RangeError);function ce(T){let I="",P=T.length,U=T[0]==="-"?1:0;for(;P>=U+4;P-=3)I=`_${T.slice(P-3,P)}${I}`;return`${T.slice(0,P)}${I}`}function te(T,I,P){J(I,"offset"),(T[I]===void 0||T[I+P]===void 0)&&X(I,T.length-(P+1))}function j(T,I,P,U,H,W){if(T>P||T<I){let fe=typeof I=="bigint"?"n":"",st;throw W>3?I===0||I===BigInt(0)?st=`>= 0${fe} and < 2${fe} ** ${(W+1)*8}${fe}`:st=`>= -(2${fe} ** ${(W+1)*8-1}${fe}) and < 2 ** ${(W+1)*8-1}${fe}`:st=`>= ${I}${fe} and <= ${P}${fe}`,new Z.ERR_OUT_OF_RANGE("value",st,T)}te(U,H,W)}function J(T,I){if(typeof T!="number")throw new Z.ERR_INVALID_ARG_TYPE(I,"number",T)}function X(T,I,P){throw Math.floor(T)!==T?(J(T,P),new Z.ERR_OUT_OF_RANGE(P||"offset","an integer",T)):I<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(P||"offset",`>= ${P?1:0} and <= ${I}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function Te(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,I){I=I||1/0;let P,U=T.length,H=null,W=[];for(let fe=0;fe<U;++fe){if(P=T.charCodeAt(fe),P>55295&&P<57344){if(!H){if(P>56319){(I-=3)>-1&&W.push(239,191,189);continue}else if(fe+1===U){(I-=3)>-1&&W.push(239,191,189);continue}H=P;continue}if(P<56320){(I-=3)>-1&&W.push(239,191,189),H=P;continue}P=(H-55296<<10|P-56320)+65536}else H&&(I-=3)>-1&&W.push(239,191,189);if(H=null,P<128){if((I-=1)<0)break;W.push(P)}else if(P<2048){if((I-=2)<0)break;W.push(P>>6|192,P&63|128)}else if(P<65536){if((I-=3)<0)break;W.push(P>>12|224,P>>6&63|128,P&63|128)}else if(P<1114112){if((I-=4)<0)break;W.push(P>>18|240,P>>12&63|128,P>>6&63|128,P&63|128)}else throw new Error("Invalid code point")}return W}function le(T){let I=[];for(let P=0;P<T.length;++P)I.push(T.charCodeAt(P)&255);return I}function ot(T,I){let P,U,H,W=[];for(let fe=0;fe<T.length&&!((I-=2)<0);++fe)P=T.charCodeAt(fe),U=P>>8,H=P%256,W.push(H),W.push(U);return W}function ge(T){return e.toByteArray(Te(T))}function Se(T,I,P,U){let H;for(H=0;H<U&&!(H+P>=I.length||H>=T.length);++H)I[H+P]=T[H];return H}function ut(T,I){return T instanceof I||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===I.name}function Ze(T){return T!==T}var Ge=function(){let T="0123456789abcdef",I=new Array(256);for(let P=0;P<16;++P){let U=P*16;for(let H=0;H<16;++H)I[U+H]=T[P]+T[H]}return I}();function ct(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}),fDe=Jh((t,e)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,e.exports={Buffer:nB().Buffer,Crypto:window.crypto}):e.exports={Buffer:nB().Buffer,Crypto:crypto}}),Fse={};rDe(Fse,{AVSCTap:()=>pb,ArweaveSigner:()=>IB,DataItem:()=>ub,MAX_TAG_BYTES:()=>Nw,MIN_BINARY_SIZE:()=>PB,SIG_CONFIG:()=>pv,SignatureConfig:()=>Cs,Signer:()=>jse,createData:()=>Kse,deserializeTags:()=>Sw,indexToType:()=>BB,serializeTags:()=>OB,tagsExceedLimit:()=>Hse});var jse=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(t,e,r,a){throw new Error("You must implement verify method on child")}},uDe=zd(kB(),1),qf=zd(qse(),1);async function zse(t){if(Array.isArray(t)){let i=(0,qf.concatBuffers)([(0,qf.stringToBuffer)("list"),(0,qf.stringToBuffer)(t.length.toString())]);return await Zse(t,await Wh().hash(i,"SHA-384"))}let e=t,r=(0,qf.concatBuffers)([(0,qf.stringToBuffer)("blob"),(0,qf.stringToBuffer)(e.byteLength.toString())]),a=(0,qf.concatBuffers)([await Wh().hash(r,"SHA-384"),await Wh().hash(e,"SHA-384")]);return await Wh().hash(a,"SHA-384")}async function Zse(t,e){if(t.length<1)return e;let r=(0,qf.concatBuffers)([e,await zse(t[0])]),a=await Wh().hash(r,"SHA-384");return await Zse(t.slice(1),a)}var NI=zd(oDe(),1),hDe=NI.default.default?NI.default.default:NI.default,cDe=class extends hDe{getPublicKey(t){throw new Error("Unimplemented")}},lDe;function Wh(){return lDe??=new cDe}var Cs;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(Cs||(Cs={}));var pv={[Cs.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[Cs.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[Cs.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[Cs.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[Cs.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[Cs.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[Cs.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},IB=class{signatureType=1;ownerLength=pv[1].pubLength;signatureLength=pv[1].sigLength;jwk;pk;constructor(t){this.pk=t.n,this.jwk=t}get publicKey(){return uDe.default.toBuffer(this.pk)}sign(t){return Wh().sign(this.jwk,t)}static async verify(t,e,r){return await Wh().verify(t,e,r)}},BB={1:IB},Fu=zd(kB(),1);async function aB(t){return zse([(0,qf.stringToBuffer)("dataitem"),(0,qf.stringToBuffer)("1"),(0,qf.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}async function dDe(t,e){let r=await aB(t),a=await e.sign(r),i=await Wh().hash(a);return{signature:Me.from(a),id:Me.from(i)}}async function pDe(t,e){let{signature:r,id:a}=await dDe(t,e);return t.getRaw().set(r,2),a}var pb=class{buf;pos;constructor(t=Me.alloc(Nw),e=0){this.buf=t,this.pos=e}writeTags(t){if(!Array.isArray(t))throw new Error("input must be array");let e=t.length,r;if(e)for(this.writeLong(e),r=0;r<e;r++){let a=t[r];if(a?.name===void 0||a?.value===void 0)throw new Error(`Invalid tag format for ${a}, expected {name:string, value: string}`);this.writeString(a.name),this.writeString(a.value)}this.writeLong(0)}toBuffer(){let t=Me.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(t,0,0,this.pos),t}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(t){let e=this.buf,r,a;if(t>=-1073741824&&t<1073741824){a=t>=0?t<<1:~t<<1|1;do e[this.pos]=a&127,a>>=7;while(a&&(e[this.pos++]|=128))}else{r=t>=0?t*2:-t*2-1;do e[this.pos]=r&127,r/=128;while(r>=1&&(e[this.pos++]|=128))}this.pos++,this.buf=e}writeString(t){let e=Me.byteLength(t),r=this.buf;this.writeLong(e);let a=this.pos;if(this.pos+=e,!(this.pos>r.length)){if(e>64)this.buf.write(t,this.pos-e,e,"utf8");else{let i,h,c,p;for(i=0,h=e;i<h;i++)c=t.charCodeAt(i),c<128?r[a++]=c:c<2048?(r[a++]=c>>6|192,r[a++]=c&63|128):(c&64512)===55296&&((p=t.charCodeAt(i+1))&64512)===56320?(c=65536+((c&1023)<<10)+(p&1023),i++,r[a++]=c>>18|240,r[a++]=c>>12&63|128,r[a++]=c>>6&63|128,r[a++]=c&63|128):(r[a++]=c>>12|224,r[a++]=c>>6&63|128,r[a++]=c&63|128)}this.buf=r}}readLong(){let t=0,e=0,r=this.buf,a,i,h,c;do a=r[this.pos++],i=a&128,t|=(a&127)<<e,e+=7;while(i&&e<28);if(i){h=t,c=268435456;do a=r[this.pos++],h+=(a&127)*c,c*=128;while(a&128);return(h%2?-(h+1):h)/2}return t>>1^-(t&1)}skipLong(){let t=this.buf;for(;t[this.pos++]&128;);}readTags(){let t=[],e;for(;e=this.readLong();)for(e<0&&(e=-e,this.skipLong());e--;){let r=this.readString(),a=this.readString();t.push({name:r,value:a})}return t}readString(){let t=this.readLong(),e=this.pos,r=this.buf;if(this.pos+=t,!(this.pos>r.length))return this.buf.slice(e,e+t).toString()}};function OB(t){let e=new pb;return e.writeTags(t),e.toBuffer()}function Hse(t){let e=new pb;return e.writeTags(t),e.tagsExceedLimit()}function Sw(t){return new pb(t).readTags()}function yl(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}function vDe(t){if(t>29)throw new Error("Short too long");let e=[0,0];for(let r=0;r<e.length;r++){let a=t&255;e[r]=a,t=(t-a)/256}return Uint8Array.from(e)}function foe(t){let e=[0,0,0,0,0,0,0,0];for(let r=0;r<e.length;r++){let a=t&255;e[r]=a,t=(t-a)/256}return Uint8Array.from(e)}var mDe=zd(fDe(),1),V1=zd(nB(),1),Nw=4096,PB=80,ub=class{binary;_id;constructor(t){this.binary=t}static isDataItem(t){return t.binary!==void 0}get signatureType(){let t=yl(this.binary.subarray(0,2));if(Cs?.[t]!==void 0)return t;throw new Error("Unknown signature type: "+t)}async isValid(){return ub.verify(this.binary)}get id(){return(async()=>Fu.default.encode(await this.rawId))()}set id(t){this._id=Fu.default.toBuffer(t)}get rawId(){return(async()=>V1.Buffer.from(await mDe.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(t){this._id=t}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Fu.default.encode(this.rawSignature)}set rawOwner(t){if(t.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${t.byteLength} bytes.`);this.binary.set(t,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return pv[this.signatureType].sigLength}get owner(){return Fu.default.encode(this.rawOwner)}get ownerLength(){return pv[this.signatureType].pubLength}get rawTarget(){let t=this.getTargetStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):V1.Buffer.alloc(0)}get target(){return Fu.default.encode(this.rawTarget)}get rawAnchor(){let t=this.getAnchorStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):V1.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let t=this.getTagsStart(),e=yl(this.binary.subarray(t+8,t+16));return this.binary.subarray(t+16,t+16+e)}get tags(){let t=this.getTagsStart();if(yl(this.binary.subarray(t,t+8))==0)return[];let e=yl(this.binary.subarray(t+8,t+16));return Sw(V1.Buffer.from(this.binary.subarray(t+16,t+16+e)))}get tagsB64Url(){return this.tags.map(t=>({name:Fu.default.encode(t.name),value:Fu.default.encode(t.value)}))}getStartOfData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=yl(e);return t+16+r}get rawData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=yl(e),a=t+16+r;return this.binary.subarray(a,this.binary.length)}get data(){return Fu.default.encode(this.rawData)}getRaw(){return this.binary}async sign(t){return this._id=await pDe(this,t),this.rawId}async setSignature(t){this.binary.set(t,2),this._id=V1.Buffer.from(await Wh().hash(t))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(t=>({name:Fu.default.encode(t.name),value:Fu.default.encode(t.value)})),data:this.data}}static async verify(t){if(t.byteLength<PB)return!1;let e=new ub(t),r=e.signatureType,a=e.getTagsStart(),i=yl(t.subarray(a,a+8)),h=t.subarray(a+8,a+16),c=yl(h);if(c>Nw)return!1;if(i>0)try{if(Sw(V1.Buffer.from(t.subarray(a+16,a+16+c))).length!==i)return!1}catch{return!1}let p=BB[r],b=await aB(e);return await p.verify(e.rawOwner,b,e.rawSignature)}async getSignatureData(){return aB(this)}getTagsStart(){let t=this.getTargetStart(),e=this.binary[t]==1,r=t+(e?33:1),a=this.binary[r]==1;return r+=a?33:1,r}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let t=this.getTargetStart()+1,e=this.binary[this.getTargetStart()]==1;return t+=e?32:0,t}},gDe=zd(kB(),1);function Kse(t,e,r){let a=e.publicKey,i=r?.target?gDe.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),c=r?.anchor?Me.from(r.anchor):null,p=1+(c?.byteLength??0),b=(r?.tags?.length??0)>0?OB(r.tags):null,g=16+(b?b.byteLength:0),y=Me.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+p+g+M,E=Me.alloc(x);if(E.set(vDe(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),a.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${a.byteLength}`);E.set(a,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let k=A+h,O=k+1;if(E[k]=c?1:0,c){if(O+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(c,k+1)}E.set(foe(r?.tags?.length??0),O);let N=foe(b?.byteLength??0);E.set(N,O+8),b&&E.set(b,O+16);let L=O+g;return E.set(y,L),new ub(E)}var NB={...Fse};globalThis.arbundles??=NB;var bDe=NB,yDe=NB;globalThis.Buffer||(globalThis.Buffer=$se.Buffer);var{DataItem:wDe}=Dse;function _De(t){return async({data:r,tags:a,target:i,anchor:h,createDataItem:c=p=>new wDe(p)})=>{let p=await t.signDataItem({data:r,tags:a,target:i,anchor:h}),b=c($se.Buffer.from(p));return{id:await b.id,raw:await b.getRaw()}}}var MDe=globalThis.GATEWAY_URL||void 0,xDe=globalThis.MU_URL||void 0,SDe=globalThis.CU_URL||void 0,EDe=globalThis.GRAPHQL_URL||void 0,{result:Bmt,results:Omt,message:Pmt,spawn:Nmt,monitor:Cmt,unmonitor:Lmt,dryrun:$mt,assign:Dmt}=vv({GATEWAY_URL:MDe,MU_URL:xDe,CU_URL:SDe,GRAPHQL_URL:EDe}),Wse=Lse.createDataItemSigner;ie();ae();ne();var qfe=gi(Ufe(),1),Eb=qfe.default.init({host:"arweave.net",port:443,protocol:"https"});async function kbt({signer:t,module:e=nQ,luaCodeTxId:r=gT,ao:a=vv(),scheduler:i=aQ,state:h,stateContractTxId:c,antRegistryId:p=U8,logger:b=qu.default,arweave:g=Eb}){let y=Zd.init({process:new Oa({processId:p,ao:a,logger:b}),signer:t}),M=await g.transactions.getData(r,{decode:!0,string:!0}),x=await a.spawn({module:e,scheduler:i,signer:t,tags:[{name:"ANT-Registry-Id",value:p}]}),E=new Oa({processId:x,ao:a,logger:b}),{id:A}=await E.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:M,signer:t});if(b.info("Spawned ANT",{processId:x,module:e,scheduler:i,luaCodeTxId:r,evalId:A}),h){let{id:O}=await E.send({tags:[{name:"Action",value:"Initialize-State"},...c!==void 0?[{name:"State-Contract-TX-ID",value:c}]:[]],data:JSON.stringify(h),signer:t});b.info("Initialized ANT",{processId:x,module:e,scheduler:i,initializeMsgId:O})}let{id:k}=await y.register({processId:x});return b.info("Registered ANT to ANT Registry",{processId:x,module:e,scheduler:i,antRegistrationMsgId:k,antRegistryId:p}),x}async function Ibt({signer:t,processId:e,luaCodeTxId:r=gT,ao:a=vv(),logger:i=qu.default,arweave:h=Eb}){let c=new Oa({processId:e,ao:a,logger:i}),p=await h.transactions.getData(r,{decode:!0,string:!0}),{id:b}=await c.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:p,signer:t});return i.info("Evolved ANT",{processId:e,luaCodeTxId:r,evalMsgId:b}),b}function HUe(t){let e=vr.object({name:vr.string(),value:vr.union([vr.string(),vr.number()])}),r=vr.function().args(vr.object({data:vr.union([vr.string(),vr.instanceof(Me)]),tags:vr.array(e).optional(),target:vr.string().optional(),anchor:vr.string().optional()})).returns(vr.promise(vr.object({id:vr.string(),raw:vr.instanceof(ArrayBuffer)})));try{return r.parse(t),!0}catch{return!1}}function Bl(t){return HUe(t)?t:"publicKey"in t?async({data:r,tags:a,target:i,anchor:h})=>{t.publicKey===void 0&&"setPublicKey"in t&&typeof t.setPublicKey=="function"&&await t.setPublicKey();let c=Ag(r,t,{tags:a,target:i,anchor:h});return c.sign(t).then(async()=>({id:await c.id,raw:await c.getRaw()}))}:Wse(t)}ie();ae();ne();function Ol(t,e){let r=t.safeParse(e);if(!r.success)throw new Error(JSON.stringify(r.error.format(),null,2));return r}var jw=class{static init({signer:e,strict:r=!1,...a}){if($h(a)||Dh(a))return e?new hO({signer:e,strict:r,...a}):new zw({strict:r,...a});throw new Pu}},zw=class{process;strict;constructor(e){if(this.strict=e.strict||!1,$h(e))this.process=e.process;else if(Dh(e))this.process=new Oa({processId:e.processId});else throw new Pu}async getState({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"State"}],a=await this.process.read({tags:r});return e&&Ol(_T.passthrough().and(vr.object({Records:vr.record(vr.string(),q8.passthrough())})),a),a}async getInfo({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Info"}],a=await this.process.read({tags:r});return e&&Ol(uQ.passthrough(),a),a}async getRecord({undername:e},{strict:r}={strict:this.strict}){let a=[{name:"Sub-Domain",value:e},{name:"Action",value:"Record"}],i=await this.process.read({tags:a});return r&&Ol(q8.passthrough(),i),i}async getRecords({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Records"}],a=await this.process.read({tags:r});return e&&Ol(bT,a),a}async getOwner({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Owner}async getControllers({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Controllers"}],a=await this.process.read({tags:r});return e&&Ol(yT,a),a}async getName({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Name}async getTicker({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Ticker}async getBalances({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Balances"}],a=await this.process.read({tags:r});return e&&Ol(wT,a),a}async getBalance({address:e},{strict:r}={strict:this.strict}){let a=[{name:"Action",value:"Balance"},{name:"Recipient",value:e}],i=await this.process.read({tags:a});return r&&Ol(vr.number(),i),i}},hO=class extends zw{signer;constructor({signer:e,...r}){super(r),this.signer=Bl(e)}async transfer({target:e},r){let a=[...r?.tags??[],{name:"Action",value:"Transfer"},{name:"Recipient",value:e}];return this.process.send({tags:a,signer:this.signer})}async addController({controller:e},r){let a=[...r?.tags??[],{name:"Action",value:"Add-Controller"},{name:"Controller",value:e}];return this.process.send({tags:a,signer:this.signer})}async removeController({controller:e},r){let a=[...r?.tags??[],{name:"Action",value:"Remove-Controller"},{name:"Controller",value:e}];return this.process.send({tags:a,signer:this.signer})}async setRecord({undername:e,transactionId:r,ttlSeconds:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Set-Record"},{name:"Sub-Domain",value:e},{name:"Transaction-Id",value:r},{name:"TTL-Seconds",value:a.toString()}],signer:this.signer})}async removeRecord({undername:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Remove-Record"},{name:"Sub-Domain",value:e}],signer:this.signer})}async setTicker({ticker:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Ticker"},{name:"Ticker",value:e}],signer:this.signer})}async setName({name:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Name"},{name:"Name",value:e}],signer:this.signer})}async setDescription({description:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Description"},{name:"Description",value:e}],signer:this.signer})}async setKeywords({keywords:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Keywords"},{name:"Description",value:JSON.stringify(e)}],signer:this.signer})}async releaseName({name:e,ioProcessId:r},a){return this.process.send({tags:[...a?.tags??[],{name:"Action",value:"Release-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r}],signer:this.signer})}async reassignName({name:e,ioProcessId:r,antProcessId:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Reassign-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r},{name:"Process-Id",value:a}],signer:this.signer})}};ie();ae();ne();var Zd=class{static init(e){if(e&&e.signer){let{signer:r,...a}=e;return new cO({...a,signer:r})}return new Zw(e)}},Zw=class{process;constructor(e){if(e&&(Dh(e)||$h(e)))if($h(e))this.process=e.process;else if(Dh(e))this.process=new Oa({processId:e.processId});else throw new Pu;else this.process=new Oa({processId:U8})}async accessControlList({address:e}){return this.process.read({tags:[{name:"Action",value:"Access-Control-List"},{name:"Address",value:e}]})}},cO=class extends Zw{signer;constructor({signer:e,...r}){super(r),this.signer=Bl(e)}async register({processId:e}){return this.process.send({tags:[{name:"Action",value:"Register"},{name:"Process-Id",value:e}],signer:this.signer})}};ie();ae();ne();ie();ae();ne();ie();ae();ne();function lO(t){try{return JSON.parse(t)}catch{return t}}var Oa=class{logger;processId;ao;constructor({processId:e,ao:r=vv(),logger:a=qu.default}){this.processId=e,this.logger=a,this.ao=r}async read({tags:e,retries:r=3}){let a=0,i;for(;a<r;)try{this.logger.debug("Evaluating read interaction on contract",{tags:e});let h=await this.ao.dryrun({process:this.processId,tags:e});if(this.logger.debug("Read interaction result",{result:h}),h.Messages===void 0||h.Messages.length===0)throw this.logger.debug(`Process ${this.processId} does not support provided action.`,h,e),new Error(`Process ${this.processId} does not support provided action.`);let c=h.Messages[0].Tags,p=h.Messages[0].Data,b=c.find(y=>y.name==="Error");if(b)throw new Error(`${b.value}${p?`: ${p}`:""}`);return p===void 0?{}:lO(h.Messages[0].Data)}catch(h){a++,this.logger.debug(`Read attempt ${a} failed`,{error:h,tags:e}),i=h,await new Promise(c=>setTimeout(c,2**a*1e3))}throw i}async send({tags:e,data:r,signer:a,retries:i=3}){let h=0,c;for(;h<i;)try{this.logger.debug("Evaluating send interaction on contract",{tags:e,data:r,processId:this.processId});let p=await this.ao.message({process:this.processId,tags:[...e,{name:"AR-IO-SDK",value:V4}],data:r,signer:a});this.logger.debug("Sent message to process",{messageId:p,processId:this.processId});let b=await this.ao.result({message:p,process:this.processId});if(this.logger.debug("Message result",{output:b,messageId:p,processId:this.processId}),b.Messages?.length===0||b.Messages===void 0)return{id:p};let y=b.Messages[0].Tags.find(x=>x.name==="Error");if(y){let x=b.Messages[0].Data;throw new F8(`${y.Value}: ${x}`)}if(b.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);if(b.Messages[0].Data===void 0)return{id:p};let M=lO(b.Messages[0].Data);return this.logger.debug("Message result data",{resultData:M,messageId:p,processId:this.processId}),{id:p,result:M}}catch(p){if(this.logger.error("Error sending message to process",{error:p.message,processId:this.processId,tags:e}),p.message.includes("500"))this.logger.debug("Retrying send interaction",{attempts:h,retries:i,error:p.message,processId:this.processId}),await new Promise(b=>setTimeout(b,2**h*2e3)),h++,c=p;else throw p}throw c}};var Ab=class{static init(e){if(e&&e.signer){let{signer:r,...a}=e;return new dO({...a,signer:r})}return new Hw(e)}},Hw=class{process;arweave;constructor(e,r=Eb){if(!e)this.process=new Oa({processId:E1});else if($h(e))this.process=e.process;else if(Dh(e))this.process=new Oa({processId:e.processId});else throw new Pu;this.arweave=r}async getInfo(){return this.process.read({tags:[{name:"Action",value:"Info"}]})}async getTokenSupply(){return this.process.read({tags:[{name:"Action",value:"Total-Token-Supply"}]})}async getEpochSettings(e){let r=[{name:"Action",value:"Epoch-Settings"},{name:"Timestamp",value:e?.timestamp?.toString()??(await A1(this.arweave)).toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:En(r)})}async getEpoch(e){let r=[{name:"Action",value:"Epoch"},{name:"Timestamp",value:e?.timestamp?.toString()??(await A1(this.arweave)).toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:En(r)})}async getArNSRecord({name:e}){return this.process.read({tags:[{name:"Action",value:"Record"},{name:"Name",value:e}]})}async getArNSRecords(e){let r=[{name:"Action",value:"Paginated-Records"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}];return this.process.read({tags:En(r)})}async getArNSReservedNames(){return this.process.read({tags:[{name:"Action",value:"Reserved-Names"}]})}async getArNSReservedName({name:e}){return this.process.read({tags:[{name:"Action",value:"Reserved-Name"},{name:"Name",value:e}]})}async getBalance({address:e}){return this.process.read({tags:[{name:"Action",value:"Balance"},{name:"Address",value:e}]})}async getBalances(e){let r=[{name:"Action",value:"Paginated-Balances"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}];return this.process.read({tags:En(r)})}async getVault({address:e,vaultId:r}){return this.process.read({tags:[{name:"Action",value:"Vault"},{name:"Address",value:e},{name:"Vault-Id",value:r}]})}async getVaults(e){let r=[{name:"Action",value:"Paginated-Vaults"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}];return this.process.read({tags:En(r)})}async getGateway({address:e}){return this.process.read({tags:[{name:"Action",value:"Gateway"},{name:"Address",value:e}]})}async getGatewayDelegates({address:e,...r}){let a=[{name:"Action",value:"Paginated-Delegates"},{name:"Address",value:e},{name:"Cursor",value:r?.cursor?.toString()},{name:"Limit",value:r?.limit?.toString()},{name:"Sort-By",value:r?.sortBy},{name:"Sort-Order",value:r?.sortOrder}];return this.process.read({tags:En(a)})}async getGatewayDelegateAllowList({address:e,...r}){let a=[{name:"Action",value:"Paginated-Allowed-Delegates"},{name:"Address",value:e},{name:"Cursor",value:r?.cursor?.toString()},{name:"Limit",value:r?.limit?.toString()},{name:"Sort-Order",value:r?.sortOrder}];return this.process.read({tags:En(a)})}async getGateways(e){let r=[{name:"Action",value:"Paginated-Gateways"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}];return this.process.read({tags:En(r)})}async getCurrentEpoch(){return this.process.read({tags:[{name:"Action",value:"Epoch"},{name:"Timestamp",value:(await this.arweave.blocks.getCurrent().then(e=>({timestamp:e.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()}]})}async getPrescribedObservers(e){let r=[{name:"Action",value:"Epoch-Prescribed-Observers"},{name:"Timestamp",value:e?.timestamp?.toString()??(await A1(this.arweave)).toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:En(r)})}async getPrescribedNames(e){let r=[{name:"Action",value:"Epoch-Prescribed-Names"},{name:"Timestamp",value:e?.timestamp?.toString()??(await A1(this.arweave)).toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:En(r)})}async getObservations(e){let r=[{name:"Action",value:"Epoch-Observations"},{name:"Timestamp",value:e?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(a=>({timestamp:a.timestamp*1e3})).catch(()=>({timestamp:`${Date.now()}`}))).timestamp.toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:En(r)})}async getDistributions(e){let r=[{name:"Action",value:"Epoch-Distributions"},{name:"Timestamp",value:e?.timestamp?.toString()??(await A1(this.arweave)).toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:En(r)})}async getTokenCost({intent:e,type:r,years:a,name:i,quantity:h}){let c=[{name:"Action",value:"Token-Cost"},{name:"Intent",value:e},{name:"Name",value:i},{name:"Years",value:a?.toString()},{name:"Quantity",value:h?.toString()},{name:"Purchase-Type",value:r},{name:"Timestamp",value:(await this.arweave.blocks.getCurrent().then(p=>({timestamp:p.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()}];return this.process.read({tags:En(c)})}async getRegistrationFees(){return this.process.read({tags:[{name:"Action",value:"Get-Registration-Fees"}]})}async getDemandFactor(){return this.process.read({tags:[{name:"Action",value:"Demand-Factor"}]})}async getArNSAuctions(e){let r=[{name:"Action",value:"Auctions"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}];return this.process.read({tags:En(r)})}async getArNSAuction({name:e}){let r=[{name:"Action",value:"Auction-Info"},{name:"Name",value:e}];return this.process.read({tags:r})}async getArNSAuctionPrices({name:e,type:r,years:a,timestamp:i,intervalMs:h}){let c=[{name:"Action",value:"Auction-Prices"},{name:"Name",value:e},{name:"Timestamp",value:i?.toString()??Date.now().toString()},{name:"Purchase-Type",value:r??"lease"},{name:"Years",value:r==null||r==="lease"?a?.toString()??"1":void 0},{name:"Price-Interval-Ms",value:h?.toString()??"900000"}].filter(p=>p.value!==void 0);return this.process.read({tags:c})}},dO=class extends Hw{signer;constructor({signer:e,...r}){if(Object.keys(r).length===0)super({process:new Oa({processId:E1})}),this.signer=Bl(e);else if($h(r))super({process:r.process}),this.signer=Bl(e);else if(Dh(r))super({process:new Oa({processId:r.processId})}),this.signer=Bl(e);else throw new Pu}async transfer({target:e,qty:r},a){let{tags:i=[]}=a||{};return this.process.send({tags:[...i,{name:"Action",value:"Transfer"},{name:"Recipient",value:e},{name:"Quantity",value:r.valueOf().toString()}],signer:this.signer})}async joinNetwork({operatorStake:e,allowDelegatedStaking:r,allowedDelegates:a,delegateRewardShareRatio:i,fqdn:h,label:c,minDelegatedStake:p,note:b,port:g,properties:y,protocol:M,autoStake:x,observerAddress:E},A){let{tags:k=[]}=A||{},O=[...k,{name:"Action",value:"Join-Network"},{name:"Operator-Stake",value:e.valueOf().toString()},{name:"Allow-Delegated-Staking",value:r?.toString()},{name:"Allowed-Delegates",value:a?.join(",")},{name:"Delegate-Reward-Share-Ratio",value:i?.toString()},{name:"FQDN",value:h},{name:"Label",value:c},{name:"Min-Delegated-Stake",value:p?.valueOf().toString()},{name:"Note",value:b},{name:"Port",value:g?.toString()},{name:"Properties",value:y},{name:"Protocol",value:M},{name:"Auto-Stake",value:x?.toString()},{name:"Observer-Address",value:E}];return this.process.send({signer:this.signer,tags:En(O)})}async leaveNetwork(e){let{tags:r=[]}=e||{};return this.process.send({signer:this.signer,tags:[...r,{name:"Action",value:"Leave-Network"}]})}async updateGatewaySettings({allowDelegatedStaking:e,allowedDelegates:r,delegateRewardShareRatio:a,fqdn:i,label:h,minDelegatedStake:c,note:p,port:b,properties:g,protocol:y,autoStake:M,observerAddress:x},E){let{tags:A=[]}=E||{},k=[...A,{name:"Action",value:"Update-Gateway-Settings"},{name:"Label",value:h},{name:"Note",value:p},{name:"FQDN",value:i},{name:"Port",value:b?.toString()},{name:"Properties",value:g},{name:"Protocol",value:y},{name:"Observer-Address",value:x},{name:"Allow-Delegated-Staking",value:e?.toString()},{name:"Allowed-Delegates",value:r?.join(",")},{name:"Delegate-Reward-Share-Ratio",value:a?.toString()},{name:"Min-Delegated-Stake",value:c?.valueOf().toString()},{name:"Auto-Stake",value:M?.toString()}];return this.process.send({signer:this.signer,tags:En(k)})}async delegateStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.stakeQty.valueOf().toString()}]})}async decreaseDelegateStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Decrease-Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.decreaseQty.valueOf().toString()},{name:"Instant",value:`${e.instant||!1}`}]})}async instantWithdrawal(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Instant-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}];return this.process.send({signer:this.signer,tags:En(i)})}async increaseOperatorStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Increase-Operator-Stake"},{name:"Quantity",value:e.increaseQty.valueOf().toString()}]})}async decreaseOperatorStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Decrease-Operator-Stake"},{name:"Quantity",value:e.decreaseQty.valueOf().toString()}]})}async saveObservations(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Save-Observations"},{name:"Report-Tx-Id",value:e.reportTxId},{name:"Failed-Gateways",value:e.failedGateways.join(",")}]})}async buyRecord(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Buy-Record"},{name:"Name",value:e.name},{name:"Years",value:e.years?.toString()??"1"},{name:"Process-Id",value:e.processId},{name:"Purchase-Type",value:e.type||"lease"}];return this.process.send({signer:this.signer,tags:En(i)})}async upgradeRecord(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Upgrade-Name"},{name:"Name",value:e.name}]})}async extendLease(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Extend-Lease"},{name:"Name",value:e.name},{name:"Years",value:e.years.toString()}]})}async increaseUndernameLimit(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Increase-Undername-Limit"},{name:"Name",value:e.name},{name:"Quantity",value:e.increaseCount.toString()}]})}async cancelWithdrawal(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Cancel-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}];return this.process.send({signer:this.signer,tags:En(i)})}async submitAuctionBid(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Auction-Bid"},{name:"Name",value:e.name},{name:"Process-Id",value:e.processId},{name:"Quantity",value:e.quantity?.toString()??void 0},{name:"Purchase-Type",value:e.type||"lease"},{name:"Years",value:e.years?.toString()??void 0}];return this.process.send({signer:this.signer,tags:En(i)})}};ie();ae();ne();ie();ae();ne();lu();var Ffe="+",jfe="/",zfe="-",Zfe="_",Hfe="=";function KUe(t){let e=t.length%4;return e&&(t+=Hfe.repeat(4-e)),t.replaceAll(zfe,Ffe).replaceAll(Zfe,jfe)}function WUe(t){return t.replaceAll(Ffe,zfe).replaceAll(jfe,Zfe).replaceAll(Hfe,"")}function v6t(t){let e=KUe(t);return Me.from(e,"base64")}function VUe(t){let e=t.toString("base64");return WUe(e)}function m6t(t){return VUe(df("sha256").update(t).digest())}ie();ae();ne();ie();ae();ne();var vO=gi(Wfe(),1);ie();ae();ne();var JUe=Object.defineProperty,XUe=(t,e,r)=>e in t?JUe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Tb=(t,e,r)=>(XUe(t,typeof e!="symbol"?e+"":e,r),r),mO=class{constructor(e){Tb(this,"value"),Tb(this,"next"),this.value=e}},gO=class{constructor(){Tb(this,"head"),Tb(this,"tail"),Tb(this,"_size",0),this.clear()}clear(){this.head=void 0,this.tail=void 0,this._size=0}push(e){let r=new mO(e);return this.head&&this.tail?(this.tail.next=r,this.tail=r):(this.head=r,this.tail=r),this._size++,this._size}pop(){if(!this.head)return;let e=this.head;return this.head=this.head.next,this._size--,e.value}get size(){return this._size}*[Symbol.iterator](){let e=this.head;for(;e;)yield e.value,e=e.next}};function Vfe(t){if(!((Number.isInteger(t)||t===1/0)&&t>0))throw new TypeError("Expected `concurrency` to be a number greater than 1");let e=new gO,r=0,a=()=>{r--,e.size>0&&e.pop()()},i=async(p,b,g)=>{r++;let y=(async()=>p(...g))();b(y);try{await y}catch{}a()},h=(p,b,g)=>{e.push(i.bind(null,p,b,g)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.pop()()))()},c=(p,...b)=>new Promise(g=>{h(p,g,b)});return Object.defineProperties(c,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),c}var F6t=async({address:t,registry:e=Zd.init()})=>{let r=await e.accessControlList({address:t});return[...new Set([...r.Owned,...r.Controlled])]};function Gfe(t,e){return new Promise((r,a)=>{let i=setTimeout(()=>{a(new Error("Timeout"))},t);e.then(h=>{clearTimeout(i),r(h)}).catch(h=>{clearTimeout(i),a(h)})})}var Yfe=class extends vO.default{contract;timeoutMs;throttle;logger;strict;constructor({contract:e=Ab.init({processId:E1}),timeoutMs:r=6e4,concurrency:a=30,logger:i=qu.default,strict:h=!1}={}){super(),this.contract=e,this.timeoutMs=r,this.throttle=Vfe(a),this.logger=i,this.strict=h}async fetchProcessesOwnedByWallet({address:e,pageSize:r,antRegistry:a=Zd.init()}){let i={},h=await a.accessControlList({address:e}),c=new Set([...h.Owned,...h.Controlled]);await Gfe(this.timeoutMs,QUe({contract:this.contract,emitter:this,pageSize:r})).catch(b=>(this.emit("error",`Error getting ArNS records: ${b}`),this.logger.error("Error getting ArNS records",{message:b?.message,stack:b?.stack}),{})).then(b=>{Object.entries(b).forEach(([g,y])=>{c.has(y.processId)&&(i[y.processId]==null&&(i[y.processId]={state:void 0,names:{}}),i[y.processId].names[g]=y)})});let p=Object.keys(i).length;this.emit("progress",0,p),await Promise.all(Object.keys(i).map(async(b,g)=>this.throttle(async()=>{if(i[b].state!==void 0){this.emit("progress",g+1,p);return}let y=jw.init({processId:b,strict:this.strict}),M=await Gfe(this.timeoutMs,y.getState()).catch(x=>{this.emit("error",`Error getting state for process ${b}: ${x}`)});(M?.Owner===e||M?.Controllers.includes(e))&&(i[b].state=M,this.emit("process",b,i[b])),this.emit("progress",g+1,p)}))),this.emit("end",i)}},QUe=async({contract:t=Ab.init({processId:E1}),emitter:e,logger:r=qu.default,pageSize:a=5e4})=>{let i,h=Date.now(),c={};do{let p=await t.getArNSRecords({cursor:i,limit:a}).catch(b=>{r?.error("Error getting ArNS records",{message:b?.message,stack:b?.stack}),e?.emit("arns:error",`Error getting ArNS records: ${b}`)});if(!p)return{};p.items.forEach(b=>{let{name:g,...y}=b;c[g]=y}),r.debug("Fetched page of ArNS records",{totalRecordCount:p.totalItems,fetchedRecordCount:Object.keys(c).length,cursor:p.nextCursor}),e?.emit("arns:pageLoaded",{totalRecordCount:p.totalItems,fetchedRecordCount:Object.keys(c).length,records:p.items,cursor:p.nextCursor}),i=p.nextCursor}while(i!==void 0);return e?.emit("arns:end",c),r.debug("Fetched all ArNS records",{totalRecordCount:Object.keys(c).length,durationMs:Date.now()-h}),c};export{jw as ANT,Zd as ANTRegistry,gT as ANT_LUA_ID,U8 as ANT_REGISTRY_ID,Oa as AOProcess,nQ as AOS_MODULE_ID,Oft as ARNS_DEVNET_REGISTRY_TX,Bft as ARNS_TESTNET_REGISTRY_TX,D8 as ARWEAVE_TX_REGEX,gQ as AbortError,wT as AntBalancesSchema,yT as AntControllersSchema,t5e as AntDescriptionSchema,r5e as AntHandlerNames,sQ as AntHandlersSchema,uQ as AntInfoSchema,fQ as AntKeywordsSchema,q8 as AntRecordSchema,bT as AntRecordsSchema,_T as AntStateSchema,zw as AoANTReadable,Zw as AoANTRegistryReadable,cO as AoANTRegistryWriteable,hO as AoANTWriteable,Yfe as ArNSEventEmitter,p1 as ArconnectSigner,Hc as ArweaveSigner,Lh as ArweaveTxIdSchema,lQ as BadRequest,Tf as BaseError,aQ as DEFAULT_SCHEDULER_ID,kft as FQDN_REGEX,dQ as FailedRequestError,Ab as IO,Hw as IOReadable,xT as IOToken,dO as IOWriteable,e5e as IO_DEVNET_PROCESS_ID,E1 as IO_TESTNET_PROCESS_ID,oQ as IntegerStringSchema,Pu as InvalidContractConfigurationError,mQ as InvalidProcessConfigurationError,vQ as InvalidSignerError,qu as Logger,mT as MIO_PER_IO,cQ as NotFound,Ift as SORT_KEY_REGEX,pQ as UnknownError,F8 as WriteInteractionError,Bl as createAoSigner,Ibt as evolveANT,QUe as fetchAllArNSRecords,v6t as fromB64Url,F6t as getANTProcessesOwnedByWallet,A1 as getCurrentBlockUnixTimestampMs,Pft as ioDevnetProcessId,qft as isAoANTState,HUe as isAoSigner,Gft as isBlockHeight,tut as isLeasedArNSRecord,$h as isProcessConfiguration,Dh as isProcessIdConfiguration,ST as mIOToken,Ol as parseSchemaResult,En as pruneTags,lO as safeDecode,m6t as sha256B64Url,kbt as spawnANT,VUe as toB64Url,hQ as validateArweaveId};
187
+ }`,i=wt.object({data:wt.object({transactions:wt.object({edges:wt.array(wt.object({node:wt.record(wt.any())}))})})});return h=>zr(h).chain($i(c=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:a,variables:{transactionIds:[c]}})}).then(async p=>{if(p.ok)return p.json();throw r('Error Encountered when querying gateway for transaction "%s"',c),new Error(`${p.status}: ${await p.text()}`)}).then(i.parse).then(VCe(["data","transactions","edges","0","node"])))).toPromise()}var a$e=sB(dBe(),1),Ose=(t="@permaweb/aoconnect")=>{let e=(0,a$e.default)(t);return e.child=r=>Ose(`${e.namespace}:${r}`),e.tap=(r,...a)=>tLe((...i)=>e(r,...a,...i)),e},Pse=({url:t,path:e})=>e?e.startsWith("/")?Pse({url:t,path:e.slice(1)}):(t=new URL(t),t.pathname+=e,t.toString()):t;function o$e(t){return uv(Ow([]),fv((e,r)=>uv(JCe([],r.name),xB(r.value),Us(r.name,Gh,e))(e),{}),Iw(e=>e.length>1?e:e[0]))(t)}function Ls(t,e){return r=>rse(oCe([noe(t,"name"),EB(MB(e),noe(e,"value"),yB)]),r)}function soe(t){return lse([[I2(String),X1(t)],[I2(Array),UCe(t)],[yB,mNe]])}function jd(t){let e;return I2($s,t)?(e=new Error(s$e(t)),e.stack+=t.stack):I2(Error,t)?e=t:LCe("message",t)?e=new Error(t.message):I2(String,t)?e=new Error(t):e=new Error("An error occurred"),e}function s$e(t){return uv(e=>function r(a,i,h){return fv((c,p)=>uv(lse([[X1(Rt.invalid_arguments),()=>r(p.argumentsError,422,"Invalid Arguments")],[X1(Rt.invalid_return_type),()=>r(p.returnTypeError,500,"Invalid Return")],[X1(Rt.invalid_union),()=>MCe(b=>r(b,400,"Invalid Union"),p.unionErrors)],[yB,()=>[{...p,status:i,contextCode:h}]]]),SB(c))(p.code),[],a.issues)}(e,400,""),e=>fv((r,a)=>{let{message:i,path:h,contextCode:c}=a,p=h[1]||h[0],b=c?`${c} `:"";return r.push(`${b}'${p}': ${i}.`),r},[],e),HCe(" | "))(t)}var f$e=wt.object({id:wt.string().min(1,{message:"message is required to be a message id"}),processId:wt.string().min(1,{message:"process is required to be a process id"})});function u$e(){return t=>zr(t).map(f$e.parse).map(()=>t)}var db=wt.object({name:wt.string(),value:wt.string()}),h$e=wt.function().args(wt.object({Id:wt.string(),Target:wt.string(),Owner:wt.string(),Anchor:wt.string().optional(),Data:wt.any().default("1234"),Tags:wt.array(wt.object({name:wt.string(),value:wt.string()}))})).returns(wt.promise(wt.any())),c$e=wt.function().args(wt.object({id:wt.string().min(1,{message:"message id is required"}),processId:wt.string().min(1,{message:"process id is required"})})).returns(wt.promise(wt.any())),l$e=wt.function().args(wt.object({process:wt.string().min(1,{message:"process id is required"}),from:wt.string().optional(),to:wt.string().optional(),sort:wt.enum(["ASC","DESC"]).default("ASC"),limit:wt.number().optional()})).returns(wt.promise(wt.object({edges:wt.array(wt.object({cursor:wt.string(),node:wt.object({Output:wt.any().optional(),Messages:wt.array(wt.any()).optional(),Spawns:wt.array(wt.any()).optional(),Error:wt.any().optional()})}))}))),Nse=wt.function().args(wt.object({processId:wt.string(),data:wt.any(),tags:wt.array(db),anchor:wt.string().optional(),signer:wt.any()})).returns(wt.promise(wt.object({messageId:wt.string()}).passthrough())),d$e=wt.function().args(wt.object({data:wt.any(),tags:wt.array(db),signer:wt.any()})).returns(wt.promise(wt.object({processId:wt.string()}).passthrough())),p$e=wt.function().args(wt.object({process:wt.string(),message:wt.string(),baseLayer:wt.boolean().optional(),exclude:wt.array(wt.string()).optional()})).returns(wt.promise(wt.object({assignmentId:wt.string()}).passthrough())),Cse=Nse,kmt=wt.function().args(wt.object({suUrl:wt.string().url(),processId:wt.string()})).returns(wt.promise(wt.object({tags:wt.array(db)}).passthrough())),Imt=wt.function().args(wt.string()).returns(wt.promise(wt.object({url:wt.string()}))),v$e=wt.function().args(wt.string()).returns(wt.promise(wt.boolean())),m$e=wt.function().args(wt.string()).returns(wt.promise(wt.object({tags:wt.array(db)}).passthrough())),Pw=wt.function().args(wt.object({data:wt.any(),tags:wt.array(db),target:wt.string().optional(),anchor:wt.string().optional()})).returns(wt.promise(wt.object({id:wt.string(),raw:wt.any()})));function g$e({loadResult:t}){return t=$i(c$e.implement(t)),e=>zr({id:e.id,processId:e.processId}).chain(t)}function b$e(t){let e=u$e(t),r=g$e(t);return({message:a,process:i})=>zr({id:a,processId:i}).chain(e).chain(r).map(t.logger.tap('readResult result for message "%s": %O',a)).map(h=>h).bimap(jd,Fd).toPromise()}var y$e=wt.array(wt.object({name:wt.string(),value:wt.string()}));function w$e(){return t=>zr(t.tags).map(Ow([])).map(Ls("Data-Protocol","ao")).map(Ls("Variant")).map(Ls("Type")).map(Ls("SDK")).map(SB(Gh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(y$e.parse).map(Us("tags",Gh,t))}function _$e({logger:t}){return e=>zr(e).chain(EB(MB(e.data),()=>$d(e),()=>$d(Math.random().toString().slice(-4)).map(Us("data",Gh,e)).map(r=>uv(qd("tags"),Ls("Content-Type"),xB({name:"Content-Type",value:"text/plain"}),Us("tags",Gh,r))(r)).map(t.tap('added pseudo-random string as message "data"'))))}function M$e(t){let e=w$e(t),r=_$e(t),a=Nse.implement(t.deployMessage);return i=>zr(i).chain(e).chain(r).chain($i(({id:h,data:c,tags:p,anchor:b,signer:g})=>a({processId:h,data:c,tags:p,anchor:b,signer:Pw.implement(g)}))).map(h=>Us("messageId",h.messageId,i))}function x$e(t){let e=M$e(t);return({process:r,data:a,tags:i,anchor:h,signer:c})=>zr({id:r,data:a,tags:i,anchor:h,signer:c}).chain(e).map(p=>p.messageId).bimap(jd,Fd).toPromise()}var w2=(t,e,r)=>a=>e(a[t])?$d(a):Tl(`Tag '${t}': ${r}`);function S$e({loadTransactionMeta:t,logger:e}){return t=$i(m$e.implement(t)),r=>zr(r).chain(t).map(qd("tags")).map(o$e).chain(w2("Data-Protocol",soe("ao"),"value 'ao' was not found on module")).chain(w2("Type",soe("Module"),"value 'Module' was not found on module")).chain(w2("Module-Format",OI,"was not found on module")).chain(w2("Input-Encoding",OI,"was not found on module")).chain(w2("Output-Encoding",OI,"was not found on module")).bimap(e.tap("Verifying module source failed: %s"),e.tap("Verified module source"))}function E$e({logger:t,validateScheduler:e}){return e=$i(v$e.implement(e)),r=>zr(r).chain(a=>e(a).chain(i=>i?$d(a):Tl(`Valid Scheduler-Location owned by ${a} not found`))).bimap(t.tap("Verifying scheduler failed: %s"),t.tap("Verified scheduler"))}function A$e({logger:t}){return e=>zr(e).map(t.tap("Checking for signer")).chain(r=>r?$d(r):Tl("signer not found"))}function R$e(t){let e=t.logger.child("verifyInput");t={...t,logger:e};let r=S$e(t),a=E$e(t),i=A$e(t);return h=>zr(h).chain(c=>r(c.module).map(()=>c)).chain(c=>a(c.scheduler)).map(()=>h).chain(c=>i(c.signer).map(()=>c)).bimap(e.tap("Error when verify input: %s"),e.tap("Successfully verified inputs"))}var T$e=wt.array(wt.object({name:wt.string(),value:wt.string()}));function k$e(){return t=>zr(t).map(qd("tags")).map(Ow([])).map(Ls("Data-Protocol","ao")).map(Ls("Variant")).map(Ls("Type")).map(Ls("Module")).map(Ls("Scheduler")).map(Ls("SDK")).map(SB(Gh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:t.module},{name:"Scheduler",value:t.scheduler},{name:"SDK",value:"aoconnect"}])).map(T$e.parse).map(Us("tags",Gh,t))}function I$e({logger:t}){return e=>zr(e).chain(EB(MB(e.data),()=>$d(e),()=>$d(Math.random().toString().slice(-4)).map(Us("data",Gh,e)).map(r=>uv(qd("tags"),Ls("Content-Type"),xB({name:"Content-Type",value:"text/plain"}),Us("tags",Gh,r))(r)).map(t.tap('added pseudo-random string as process "data"'))))}function B$e(t){let e=t.logger.child("uploadProcess");t={...t,logger:e};let r=k$e(t),a=I$e(t),i=d$e.implement(t.deployProcess);return h=>zr(h).chain(r).chain(a).chain($i(({data:c,tags:p,signer:b})=>i({data:c,tags:p,signer:Pw.implement(b)}))).map(c=>Us("processId",c.processId,h))}function O$e(t){let e=R$e(t),r=B$e(t);return({module:a,scheduler:i,signer:h,tags:c,data:p})=>zr({module:a,scheduler:i,signer:h,tags:c,data:p}).chain(e).chain(r).map(b=>b.processId).bimap(jd,Fd).toPromise()}function P$e(t){let e=Cse.implement(t.deployMonitor);return r=>zr(r).chain($i(({id:a,signer:i})=>e({processId:a,signer:Pw.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(a=>Us("monitorId",a.messageId,r))}function N$e(t){let e=P$e(t);return({process:r,signer:a})=>zr({id:r,signer:a}).chain(e).map(i=>i.monitorId).bimap(jd,Fd).toPromise()}function C$e(t){let e=Cse.implement(t.deployUnmonitor);return r=>zr(r).chain($i(({id:a,signer:i})=>e({processId:a,signer:Pw.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(a=>Us("monitorId",a.messageId,r))}function L$e(t){let e=C$e(t);return({process:r,signer:a})=>zr({id:r,signer:a}).chain(e).map(i=>i.monitorId).bimap(jd,Fd).toPromise()}var $$e=wt.object({process:wt.string().min(1,{message:"process identifier is required"}),from:wt.string().optional(),to:wt.string().optional(),sort:wt.enum(["ASC","DESC"]).default("ASC"),limit:wt.number().optional()});function D$e(){return t=>zr(t).map($$e.parse).map(()=>t)}function U$e({queryResults:t}){return t=$i(l$e.implement(t)),e=>zr({process:e.process,from:e.from,to:e.to,sort:e.sort,limit:e.limit}).chain(t)}function q$e(t){let e=D$e(t),r=U$e(t);return({process:a,from:i,to:h,sort:c,limit:p})=>zr({process:a,from:i,to:h,sort:c,limit:p}).chain(e).chain(r).map(t.logger.tap('readResults result for message "%s": %O',a)).map(b=>b).bimap(jd,Fd).toPromise()}var F$e=wt.object({Id:wt.string(),Target:wt.string(),Owner:wt.string(),Anchor:wt.string().optional(),Data:wt.any().default("1234"),Tags:wt.array(wt.object({name:wt.string(),value:wt.string()}))});function j$e(){return t=>zr(t).map(F$e.parse).map(e=>(e.Tags=e.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),e))}function z$e({dryrunFetch:t}){return $i(h$e.implement(t))}function Z$e(t){let e=j$e(t),r=z$e(t);return a=>zr(a).map(H$e).chain(e).chain(r).toPromise()}function H$e({process:t,data:e,tags:r,anchor:a,...i}){return{Id:"1234",Owner:"1234",...i,Target:t,Data:e||"1234",Tags:r||[],Anchor:a||"0"}}function K$e(t){let e=p$e.implement(t.deployAssign);return r=>zr(r).chain($i(({process:a,message:i,baseLayer:h,exclude:c})=>e({process:a,message:i,baseLayer:h,exclude:c}))).map(a=>Us("assignmentId",a.assignmentId,r))}function W$e(t){let e=K$e(t);return({process:r,message:a,baseLayer:i,exclude:h})=>zr({process:r,message:a,baseLayer:i,exclude:h}).chain(e).map(c=>c.assignmentId).bimap(jd,Fd).toPromise()}var V$e="https://arweave.net",G$e="https://mu.ao-testnet.xyz",Y$e="https://cu.ao-testnet.xyz";function vv({GRAPHQL_URL:t,GATEWAY_URL:e=V$e,MU_URL:r=G$e,CU_URL:a=Y$e}={}){let i=Ose();t||(t=Pse({url:e,path:"/graphql"}));let{validate:h}=Xoe({cacheSize:100,GRAPHQL_URL:t}),c=pNe({MAX_SIZE:25}),p=i.child("result"),b=b$e({loadResult:cNe({fetch,CU_URL:a,logger:p}),logger:p}),g=i.child("message"),y=x$e({loadProcessMeta:kI({fetch,cache:c,logger:g}),deployMessage:aNe({fetch,MU_URL:r,logger:g}),logger:g}),M=i.child("spawn"),x=O$e({loadTransactionMeta:n$e({fetch,GRAPHQL_URL:t,logger:M}),validateScheduler:h,deployProcess:oNe({fetch,MU_URL:r,logger:M}),logger:M}),E=i.child("monitor"),A=N$e({loadProcessMeta:kI({fetch,cache:c,logger:E}),deployMonitor:sNe({fetch,MU_URL:r,logger:E}),logger:E}),k=i.child("unmonitor"),O=L$e({loadProcessMeta:kI({fetch,cache:c,logger:k}),deployUnmonitor:fNe({fetch,MU_URL:r,logger:k}),logger:E}),N=i.child("results"),L=q$e({queryResults:lNe({fetch,CU_URL:a,logger:N}),logger:N}),C=i.child("dryrun"),Y=Z$e({dryrunFetch:hNe({fetch,CU_URL:a,logger:C}),logger:C}),G=i.child("assign"),ee=W$e({deployAssign:uNe({fetch,MU_URL:r,logger:G}),logger:g});return{result:b,results:L,message:y,spawn:x,monitor:A,unmonitor:O,dryrun:Y,assign:ee}}var Lse={};hoe(Lse,{createDataItemSigner:()=>_De});var $se=sB(mBe(),1),Dse={};hoe(Dse,{AVSCTap:()=>pb,ArweaveSigner:()=>IB,DataItem:()=>ub,MAX_TAG_BYTES:()=>Nw,MIN_BINARY_SIZE:()=>PB,SIG_CONFIG:()=>pv,SignatureConfig:()=>Cs,Signer:()=>jse,createData:()=>Kse,default:()=>bDe,deserializeTags:()=>Sw,indexToType:()=>BB,serializeTags:()=>OB,tagsExceedLimit:()=>Hse,warparbundles:()=>yDe});var J$e=Object.create,TB=Object.defineProperty,X$e=Object.getOwnPropertyDescriptor,Q$e=Object.getOwnPropertyNames,eDe=Object.getPrototypeOf,tDe=Object.prototype.hasOwnProperty,Jh=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),rDe=(t,e)=>{for(var r in e)TB(t,r,{get:e[r],enumerable:!0})},iDe=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Q$e(e))!tDe.call(t,i)&&i!==r&&TB(t,i,{get:()=>e[i],enumerable:!(a=X$e(e,i))||a.enumerable});return t},zd=(t,e,r)=>(r=t!=null?J$e(eDe(t)):{},iDe(e||!t||!t.__esModule?TB(r,"default",{value:t,enumerable:!0}):r,t)),nDe=Jh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function e(r){var a=4,i=r.length,h=i%a;if(!h)return r;var c=i,p=a-h,b=i+p,g=Me.alloc(b);for(g.write(r);p--;)g.write("=",c++);return g.toString()}t.default=e}),aDe=Jh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=nDe();function r(b,g){return g===void 0&&(g="utf8"),Me.isBuffer(b)?h(b.toString("base64")):h(Me.from(b,g).toString("base64"))}function a(b,g){return g===void 0&&(g="utf8"),Me.from(i(b),"base64").toString(g)}function i(b){return b=b.toString(),e.default(b).replace(/\-/g,"+").replace(/_/g,"/")}function h(b){return b.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(b){return Me.from(i(b),"base64")}var p=r;p.encode=r,p.decode=a,p.toBase64=i,p.fromBase64=h,p.toBuffer=c,t.default=p}),kB=Jh((t,e)=>{e.exports=aDe().default,e.exports.default=e.exports}),Use=Jh(t=>{"use strict";t.byteLength=b,t.toByteArray=y,t.fromByteArray=E;var e=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,c=i.length;h<c;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,c;r[45]=62,r[95]=63;function p(A){var k=A.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var O=A.indexOf("=");O===-1&&(O=k);var N=O===k?0:4-O%4;return[O,N]}function b(A){var k=p(A),O=k[0],N=k[1];return(O+N)*3/4-N}function g(A,k,O){return(k+O)*3/4-O}function y(A){var k,O=p(A),N=O[0],L=O[1],C=new a(g(A,N,L)),Y=0,G=L>0?N-4:N,ee;for(ee=0;ee<G;ee+=4)k=r[A.charCodeAt(ee)]<<18|r[A.charCodeAt(ee+1)]<<12|r[A.charCodeAt(ee+2)]<<6|r[A.charCodeAt(ee+3)],C[Y++]=k>>16&255,C[Y++]=k>>8&255,C[Y++]=k&255;return L===2&&(k=r[A.charCodeAt(ee)]<<2|r[A.charCodeAt(ee+1)]>>4,C[Y++]=k&255),L===1&&(k=r[A.charCodeAt(ee)]<<10|r[A.charCodeAt(ee+1)]<<4|r[A.charCodeAt(ee+2)]>>2,C[Y++]=k>>8&255,C[Y++]=k&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,k,O){for(var N,L=[],C=k;C<O;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var k,O=A.length,N=O%3,L=[],C=16383,Y=0,G=O-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(k=A[O-1],L.push(e[k>>2]+e[k<<4&63]+"==")):N===2&&(k=(A[O-2]<<8)+A[O-1],L.push(e[k>>10]+e[k>>4&63]+e[k<<2&63]+"=")),L.join("")}}),qse=Jh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.b64UrlDecode=t.b64UrlEncode=t.bufferTob64Url=t.bufferTob64=t.b64UrlToBuffer=t.stringToB64Url=t.stringToBuffer=t.bufferToString=t.b64UrlToString=t.concatBuffers=void 0;var e=Use();function r(x){let E=0;for(let O=0;O<x.length;O++)E+=x[O].byteLength;let A=new Uint8Array(E),k=0;A.set(new Uint8Array(x[0]),k),k+=x[0].byteLength;for(let O=1;O<x.length;O++)A.set(new Uint8Array(x[O]),k),k+=x[O].byteLength;return A}t.concatBuffers=r;function a(x){let E=p(x);return i(E)}t.b64UrlToString=a;function i(x){return new TextDecoder("utf-8",{fatal:!0}).decode(x)}t.bufferToString=i;function h(x){return new TextEncoder().encode(x)}t.stringToBuffer=h;function c(x){return g(h(x))}t.stringToB64Url=c;function p(x){return new Uint8Array(e.toByteArray(M(x)))}t.b64UrlToBuffer=p;function b(x){return e.fromByteArray(new Uint8Array(x))}t.bufferTob64=b;function g(x){return y(b(x))}t.bufferTob64Url=g;function y(x){return x.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}t.b64UrlEncode=y;function M(x){x=x.replace(/\-/g,"+").replace(/\_/g,"/");let E;return x.length%4==0?E=0:E=4-x.length%4,x.concat("=".repeat(E))}t.b64UrlDecode=M}),oDe=Jh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=qse(),r=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let a=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),i=await this.driver.exportKey("jwk",a.privateKey);return{kty:i.kty,e:i.e,n:i.n,d:i.d,p:i.p,q:i.q,dp:i.dp,dq:i.dq,qi:i.qi}}async sign(a,i,{saltLength:h}={}){let c=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(a),i);return new Uint8Array(c)}async hash(a,i="SHA-256"){let h=await this.driver.digest(i,a);return new Uint8Array(h)}async verify(a,i,h){let c={kty:"RSA",e:"AQAB",n:a},p=await this.jwkToPublicCryptoKey(c),b=await this.driver.digest("SHA-256",i),g=await this.driver.verify({name:"RSA-PSS",saltLength:0},p,h,i),y=await this.driver.verify({name:"RSA-PSS",saltLength:32},p,h,i),M=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((p.algorithm.modulusLength-1)/8)-b.byteLength-2},p,h,i);return g||y||M}async jwkToCryptoKey(a){return this.driver.importKey("jwk",a,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(a){return this.driver.importKey("jwk",a,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let a=crypto?.subtle;return a===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(i=>typeof a[i]=="function")}async encrypt(a,i,h){let c=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),p=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=new Uint8Array(16);crypto.getRandomValues(b);let g=await this.driver.encrypt({name:"AES-CBC",iv:b},p,a);return e.concatBuffers([b,g])}async decrypt(a,i,h){let c=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),p=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=a.slice(0,16),g=await this.driver.decrypt({name:"AES-CBC",iv:b},p,a.slice(16));return e.concatBuffers([g])}};t.default=r}),sDe=Jh(t=>{t.read=function(e,r,a,i,h){var c,p,b=h*8-i-1,g=(1<<b)-1,y=g>>1,M=-7,x=a?h-1:0,E=a?-1:1,A=e[r+x];for(x+=E,c=A&(1<<-M)-1,A>>=-M,M+=b;M>0;c=c*256+e[r+x],x+=E,M-=8);for(p=c&(1<<-M)-1,c>>=-M,M+=i;M>0;p=p*256+e[r+x],x+=E,M-=8);if(c===0)c=1-y;else{if(c===g)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,i),c=c-y}return(A?-1:1)*p*Math.pow(2,c-i)},t.write=function(e,r,a,i,h,c){var p,b,g,y=c*8-h-1,M=(1<<y)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:c-1,k=i?1:-1,O=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,p=M):(p=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-p))<1&&(p--,g*=2),p+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(p++,g/=2),p+x>=M?(b=0,p=M):p+x>=1?(b=(r*g-1)*Math.pow(2,h),p=p+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),p=0));h>=8;e[a+A]=b&255,A+=k,b/=256,h-=8);for(p=p<<h|b,y+=h;y>0;e[a+A]=p&255,A+=k,p/=256,y-=8);e[a+A-k]|=O*128}}),nB=Jh(t=>{"use strict";var e=Use(),r=sDe(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=p,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,p.TYPED_ARRAY_SUPPORT=h(),!p.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 h(){try{let T=new Uint8Array(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,Uint8Array.prototype),Object.setPrototypeOf(T,I),T.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function c(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let I=new Uint8Array(T);return Object.setPrototypeOf(I,p.prototype),I}function p(T,I,P){if(typeof T=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,I,P)}p.poolSize=8192;function b(T,I,P){if(typeof T=="string")return x(T,I);if(ArrayBuffer.isView(T))return A(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(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return k(T,I,P);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let U=T.valueOf&&T.valueOf();if(U!=null&&U!==T)return p.from(U,I,P);let H=O(T);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return p.from(T[Symbol.toPrimitive]("string"),I,P);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}p.from=function(T,I,P){return b(T,I,P)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array);function g(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 y(T,I,P){return g(T),T<=0?c(T):I!==void 0?typeof P=="string"?c(T).fill(I,P):c(T).fill(I):c(T)}p.alloc=function(T,I,P){return y(T,I,P)};function M(T){return g(T),c(T<0?0:N(T)|0)}p.allocUnsafe=function(T){return M(T)},p.allocUnsafeSlow=function(T){return M(T)};function x(T,I){if((typeof I!="string"||I==="")&&(I="utf8"),!p.isEncoding(I))throw new TypeError("Unknown encoding: "+I);let P=C(T,I)|0,U=c(P),H=U.write(T,I);return H!==P&&(U=U.slice(0,H)),U}function E(T){let I=T.length<0?0:N(T.length)|0,P=c(I);for(let U=0;U<I;U+=1)P[U]=T[U]&255;return P}function A(T){if(ut(T,Uint8Array)){let I=new Uint8Array(T);return k(I.buffer,I.byteOffset,I.byteLength)}return E(T)}function k(T,I,P){if(I<0||T.byteLength<I)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<I+(P||0))throw new RangeError('"length" is outside of buffer bounds');let U;return I===void 0&&P===void 0?U=new Uint8Array(T):P===void 0?U=new Uint8Array(T,I):U=new Uint8Array(T,I,P),Object.setPrototypeOf(U,p.prototype),U}function O(T){if(p.isBuffer(T)){let I=N(T.length)|0,P=c(I);return P.length===0||T.copy(P,0,0,I),P}if(T.length!==void 0)return typeof T.length!="number"||Ze(T.length)?c(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),p.alloc(+T)}p.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==p.prototype},p.compare=function(T,I){if(ut(T,Uint8Array)&&(T=p.from(T,T.offset,T.byteLength)),ut(I,Uint8Array)&&(I=p.from(I,I.offset,I.byteLength)),!p.isBuffer(T)||!p.isBuffer(I))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===I)return 0;let P=T.length,U=I.length;for(let H=0,W=Math.min(P,U);H<W;++H)if(T[H]!==I[H]){P=T[H],U=I[H];break}return P<U?-1:U<P?1:0},p.isEncoding=function(T){switch(String(T).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},p.concat=function(T,I){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return p.alloc(0);let P;if(I===void 0)for(I=0,P=0;P<T.length;++P)I+=T[P].length;let U=p.allocUnsafe(I),H=0;for(P=0;P<T.length;++P){let W=T[P];if(ut(W,Uint8Array))H+W.length>U.length?(p.isBuffer(W)||(W=p.from(W)),W.copy(U,H)):Uint8Array.prototype.set.call(U,W,H);else if(p.isBuffer(W))W.copy(U,H);else throw new TypeError('"list" argument must be an Array of Buffers');H+=W.length}return U};function C(T,I){if(p.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(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 P=T.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&P===0)return 0;let H=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return P;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P*2;case"hex":return P>>>1;case"base64":return ge(T).length;default:if(H)return U?-1:oe(T).length;I=(""+I).toLowerCase(),H=!0}}p.byteLength=C;function Y(T,I,P){let U=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((P===void 0||P>this.length)&&(P=this.length),P<=0)||(P>>>=0,I>>>=0,P<=I))return"";for(T||(T="utf8");;)switch(T){case"hex":return o(this,I,P);case"utf8":case"utf-8":return u(this,I,P);case"ascii":return w(this,I,P);case"latin1":case"binary":return d(this,I,P);case"base64":return f(this,I,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,I,P);default:if(U)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),U=!0}}p.prototype._isBuffer=!0;function G(T,I,P){let U=T[I];T[I]=T[P],T[P]=U}p.prototype.swap16=function(){let T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let I=0;I<T;I+=2)G(this,I,I+1);return this},p.prototype.swap32=function(){let T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let I=0;I<T;I+=4)G(this,I,I+3),G(this,I+1,I+2);return this},p.prototype.swap64=function(){let T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let I=0;I<T;I+=8)G(this,I,I+7),G(this,I+1,I+6),G(this,I+2,I+5),G(this,I+3,I+4);return this},p.prototype.toString=function(){let T=this.length;return T===0?"":arguments.length===0?u(this,0,T):Y.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(T){if(!p.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:p.compare(this,T)===0},p.prototype.inspect=function(){let T="",I=t.INSPECT_MAX_BYTES;return T=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I&&(T+=" ... "),"<Buffer "+T+">"},a&&(p.prototype[a]=p.prototype.inspect),p.prototype.compare=function(T,I,P,U,H){if(ut(T,Uint8Array)&&(T=p.from(T,T.offset,T.byteLength)),!p.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(I===void 0&&(I=0),P===void 0&&(P=T?T.length:0),U===void 0&&(U=0),H===void 0&&(H=this.length),I<0||P>T.length||U<0||H>this.length)throw new RangeError("out of range index");if(U>=H&&I>=P)return 0;if(U>=H)return-1;if(I>=P)return 1;if(I>>>=0,P>>>=0,U>>>=0,H>>>=0,this===T)return 0;let W=H-U,fe=P-I,st=Math.min(W,fe),ue=this.slice(U,H),me=T.slice(I,P);for(let pe=0;pe<st;++pe)if(ue[pe]!==me[pe]){W=ue[pe],fe=me[pe];break}return W<fe?-1:fe<W?1:0};function ee(T,I,P,U,H){if(T.length===0)return-1;if(typeof P=="string"?(U=P,P=0):P>2147483647?P=2147483647:P<-2147483648&&(P=-2147483648),P=+P,Ze(P)&&(P=H?0:T.length-1),P<0&&(P=T.length+P),P>=T.length){if(H)return-1;P=T.length-1}else if(P<0)if(H)P=0;else return-1;if(typeof I=="string"&&(I=p.from(I,U)),p.isBuffer(I))return I.length===0?-1:$(T,I,P,U,H);if(typeof I=="number")return I=I&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(T,I,P):Uint8Array.prototype.lastIndexOf.call(T,I,P):$(T,[I],P,U,H);throw new TypeError("val must be string, number or Buffer")}function $(T,I,P,U,H){let W=1,fe=T.length,st=I.length;if(U!==void 0&&(U=String(U).toLowerCase(),U==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(T.length<2||I.length<2)return-1;W=2,fe/=2,st/=2,P/=2}function ue(pe,be){return W===1?pe[be]:pe.readUInt16BE(be*W)}let me;if(H){let pe=-1;for(me=P;me<fe;me++)if(ue(T,me)===ue(I,pe===-1?0:me-pe)){if(pe===-1&&(pe=me),me-pe+1===st)return pe*W}else pe!==-1&&(me-=me-pe),pe=-1}else for(P+st>fe&&(P=fe-st),me=P;me>=0;me--){let pe=!0;for(let be=0;be<st;be++)if(ue(T,me+be)!==ue(I,be)){pe=!1;break}if(pe)return me}return-1}p.prototype.includes=function(T,I,P){return this.indexOf(T,I,P)!==-1},p.prototype.indexOf=function(T,I,P){return ee(this,T,I,P,!0)},p.prototype.lastIndexOf=function(T,I,P){return ee(this,T,I,P,!1)};function q(T,I,P,U){P=Number(P)||0;let H=T.length-P;U?(U=Number(U),U>H&&(U=H)):U=H;let W=I.length;U>W/2&&(U=W/2);let fe;for(fe=0;fe<U;++fe){let st=parseInt(I.substr(fe*2,2),16);if(Ze(st))return fe;T[P+fe]=st}return fe}function V(T,I,P,U){return Se(oe(I,T.length-P),T,P,U)}function _(T,I,P,U){return Se(le(I),T,P,U)}function n(T,I,P,U){return Se(ge(I),T,P,U)}function s(T,I,P,U){return Se(ot(I,T.length-P),T,P,U)}p.prototype.write=function(T,I,P,U){if(I===void 0)U="utf8",P=this.length,I=0;else if(P===void 0&&typeof I=="string")U=I,P=this.length,I=0;else if(isFinite(I))I=I>>>0,isFinite(P)?(P=P>>>0,U===void 0&&(U="utf8")):(U=P,P=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let H=this.length-I;if((P===void 0||P>H)&&(P=H),T.length>0&&(P<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let W=!1;for(;;)switch(U){case"hex":return q(this,T,I,P);case"utf8":case"utf-8":return V(this,T,I,P);case"ascii":case"latin1":case"binary":return _(this,T,I,P);case"base64":return n(this,T,I,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,T,I,P);default:if(W)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),W=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,I,P){return I===0&&P===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(I,P))}function u(T,I,P){P=Math.min(T.length,P);let U=[],H=I;for(;H<P;){let W=T[H],fe=null,st=W>239?4:W>223?3:W>191?2:1;if(H+st<=P){let ue,me,pe,be;switch(st){case 1:W<128&&(fe=W);break;case 2:ue=T[H+1],(ue&192)===128&&(be=(W&31)<<6|ue&63,be>127&&(fe=be));break;case 3:ue=T[H+1],me=T[H+2],(ue&192)===128&&(me&192)===128&&(be=(W&15)<<12|(ue&63)<<6|me&63,be>2047&&(be<55296||be>57343)&&(fe=be));break;case 4:ue=T[H+1],me=T[H+2],pe=T[H+3],(ue&192)===128&&(me&192)===128&&(pe&192)===128&&(be=(W&15)<<18|(ue&63)<<12|(me&63)<<6|pe&63,be>65535&&be<1114112&&(fe=be))}}fe===null?(fe=65533,st=1):fe>65535&&(fe-=65536,U.push(fe>>>10&1023|55296),fe=56320|fe&1023),U.push(fe),H+=st}return m(U)}var l=4096;function m(T){let I=T.length;if(I<=l)return String.fromCharCode.apply(String,T);let P="",U=0;for(;U<I;)P+=String.fromCharCode.apply(String,T.slice(U,U+=l));return P}function w(T,I,P){let U="";P=Math.min(T.length,P);for(let H=I;H<P;++H)U+=String.fromCharCode(T[H]&127);return U}function d(T,I,P){let U="";P=Math.min(T.length,P);for(let H=I;H<P;++H)U+=String.fromCharCode(T[H]);return U}function o(T,I,P){let U=T.length;(!I||I<0)&&(I=0),(!P||P<0||P>U)&&(P=U);let H="";for(let W=I;W<P;++W)H+=Ge[T[W]];return H}function v(T,I,P){let U=T.slice(I,P),H="";for(let W=0;W<U.length-1;W+=2)H+=String.fromCharCode(U[W]+U[W+1]*256);return H}p.prototype.slice=function(T,I){let P=this.length;T=~~T,I=I===void 0?P:~~I,T<0?(T+=P,T<0&&(T=0)):T>P&&(T=P),I<0?(I+=P,I<0&&(I=0)):I>P&&(I=P),I<T&&(I=T);let U=this.subarray(T,I);return Object.setPrototypeOf(U,p.prototype),U};function R(T,I,P){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+I>P)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(T,I,P){T=T>>>0,I=I>>>0,P||R(T,I,this.length);let U=this[T],H=1,W=0;for(;++W<I&&(H*=256);)U+=this[T+W]*H;return U},p.prototype.readUintBE=p.prototype.readUIntBE=function(T,I,P){T=T>>>0,I=I>>>0,P||R(T,I,this.length);let U=this[T+--I],H=1;for(;I>0&&(H*=256);)U+=this[T+--I]*H;return U},p.prototype.readUint8=p.prototype.readUInt8=function(T,I){return T=T>>>0,I||R(T,1,this.length),this[T]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(T,I){return T=T>>>0,I||R(T,2,this.length),this[T]|this[T+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(T,I){return T=T>>>0,I||R(T,2,this.length),this[T]<<8|this[T+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(T,I){return T=T>>>0,I||R(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},p.prototype.readBigUInt64LE=ct(function(T){T=T>>>0,J(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&X(T,this.length-8);let U=I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,H=this[++T]+this[++T]*2**8+this[++T]*2**16+P*2**24;return BigInt(U)+(BigInt(H)<<BigInt(32))}),p.prototype.readBigUInt64BE=ct(function(T){T=T>>>0,J(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&X(T,this.length-8);let U=I*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],H=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+P;return(BigInt(U)<<BigInt(32))+BigInt(H)}),p.prototype.readIntLE=function(T,I,P){T=T>>>0,I=I>>>0,P||R(T,I,this.length);let U=this[T],H=1,W=0;for(;++W<I&&(H*=256);)U+=this[T+W]*H;return H*=128,U>=H&&(U-=Math.pow(2,8*I)),U},p.prototype.readIntBE=function(T,I,P){T=T>>>0,I=I>>>0,P||R(T,I,this.length);let U=I,H=1,W=this[T+--U];for(;U>0&&(H*=256);)W+=this[T+--U]*H;return H*=128,W>=H&&(W-=Math.pow(2,8*I)),W},p.prototype.readInt8=function(T,I){return T=T>>>0,I||R(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},p.prototype.readInt16LE=function(T,I){T=T>>>0,I||R(T,2,this.length);let P=this[T]|this[T+1]<<8;return P&32768?P|4294901760:P},p.prototype.readInt16BE=function(T,I){T=T>>>0,I||R(T,2,this.length);let P=this[T+1]|this[T]<<8;return P&32768?P|4294901760:P},p.prototype.readInt32LE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},p.prototype.readInt32BE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},p.prototype.readBigInt64LE=ct(function(T){T=T>>>0,J(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&X(T,this.length-8);let U=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(P<<24);return(BigInt(U)<<BigInt(32))+BigInt(I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),p.prototype.readBigInt64BE=ct(function(T){T=T>>>0,J(T,"offset");let I=this[T],P=this[T+7];(I===void 0||P===void 0)&&X(T,this.length-8);let U=(I<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(U)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+P)}),p.prototype.readFloatLE=function(T,I){return T=T>>>0,I||R(T,4,this.length),r.read(this,T,!0,23,4)},p.prototype.readFloatBE=function(T,I){return T=T>>>0,I||R(T,4,this.length),r.read(this,T,!1,23,4)},p.prototype.readDoubleLE=function(T,I){return T=T>>>0,I||R(T,8,this.length),r.read(this,T,!0,52,8)},p.prototype.readDoubleBE=function(T,I){return T=T>>>0,I||R(T,8,this.length),r.read(this,T,!1,52,8)};function S(T,I,P,U,H,W){if(!p.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>H||I<W)throw new RangeError('"value" argument is out of bounds');if(P+U>T.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(T,I,P,U){if(T=+T,I=I>>>0,P=P>>>0,!U){let fe=Math.pow(2,8*P)-1;S(this,T,I,P,fe,0)}let H=1,W=0;for(this[I]=T&255;++W<P&&(H*=256);)this[I+W]=T/H&255;return I+P},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(T,I,P,U){if(T=+T,I=I>>>0,P=P>>>0,!U){let fe=Math.pow(2,8*P)-1;S(this,T,I,P,fe,0)}let H=P-1,W=1;for(this[I+H]=T&255;--H>=0&&(W*=256);)this[I+H]=T/W&255;return I+P},p.prototype.writeUint8=p.prototype.writeUInt8=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,1,255,0),this[I]=T&255,I+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,2,65535,0),this[I]=T&255,this[I+1]=T>>>8,I+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,2,65535,0),this[I]=T>>>8,this[I+1]=T&255,I+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,4,4294967295,0),this[I+3]=T>>>24,this[I+2]=T>>>16,this[I+1]=T>>>8,this[I]=T&255,I+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,4,4294967295,0),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4};function B(T,I,P,U,H){j(I,U,H,T,P,7);let W=Number(I&BigInt(4294967295));T[P++]=W,W=W>>8,T[P++]=W,W=W>>8,T[P++]=W,W=W>>8,T[P++]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[P++]=fe,fe=fe>>8,T[P++]=fe,fe=fe>>8,T[P++]=fe,fe=fe>>8,T[P++]=fe,P}function F(T,I,P,U,H){j(I,U,H,T,P,7);let W=Number(I&BigInt(4294967295));T[P+7]=W,W=W>>8,T[P+6]=W,W=W>>8,T[P+5]=W,W=W>>8,T[P+4]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[P+3]=fe,fe=fe>>8,T[P+2]=fe,fe=fe>>8,T[P+1]=fe,fe=fe>>8,T[P]=fe,P+8}p.prototype.writeBigUInt64LE=ct(function(T,I=0){return B(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=ct(function(T,I=0){return F(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(T,I,P,U){if(T=+T,I=I>>>0,!U){let st=Math.pow(2,8*P-1);S(this,T,I,P,st-1,-st)}let H=0,W=1,fe=0;for(this[I]=T&255;++H<P&&(W*=256);)T<0&&fe===0&&this[I+H-1]!==0&&(fe=1),this[I+H]=(T/W>>0)-fe&255;return I+P},p.prototype.writeIntBE=function(T,I,P,U){if(T=+T,I=I>>>0,!U){let st=Math.pow(2,8*P-1);S(this,T,I,P,st-1,-st)}let H=P-1,W=1,fe=0;for(this[I+H]=T&255;--H>=0&&(W*=256);)T<0&&fe===0&&this[I+H+1]!==0&&(fe=1),this[I+H]=(T/W>>0)-fe&255;return I+P},p.prototype.writeInt8=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,1,127,-128),T<0&&(T=255+T+1),this[I]=T&255,I+1},p.prototype.writeInt16LE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,2,32767,-32768),this[I]=T&255,this[I+1]=T>>>8,I+2},p.prototype.writeInt16BE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,2,32767,-32768),this[I]=T>>>8,this[I+1]=T&255,I+2},p.prototype.writeInt32LE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,4,2147483647,-2147483648),this[I]=T&255,this[I+1]=T>>>8,this[I+2]=T>>>16,this[I+3]=T>>>24,I+4},p.prototype.writeInt32BE=function(T,I,P){return T=+T,I=I>>>0,P||S(this,T,I,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4},p.prototype.writeBigInt64LE=ct(function(T,I=0){return B(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=ct(function(T,I=0){return F(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function D(T,I,P,U,H,W){if(P+U>T.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("Index out of range")}function re(T,I,P,U,H){return I=+I,P=P>>>0,H||D(T,I,P,4,34028234663852886e22,-34028234663852886e22),r.write(T,I,P,U,23,4),P+4}p.prototype.writeFloatLE=function(T,I,P){return re(this,T,I,!0,P)},p.prototype.writeFloatBE=function(T,I,P){return re(this,T,I,!1,P)};function Q(T,I,P,U,H){return I=+I,P=P>>>0,H||D(T,I,P,8,17976931348623157e292,-17976931348623157e292),r.write(T,I,P,U,52,8),P+8}p.prototype.writeDoubleLE=function(T,I,P){return Q(this,T,I,!0,P)},p.prototype.writeDoubleBE=function(T,I,P){return Q(this,T,I,!1,P)},p.prototype.copy=function(T,I,P,U){if(!p.isBuffer(T))throw new TypeError("argument should be a Buffer");if(P||(P=0),!U&&U!==0&&(U=this.length),I>=T.length&&(I=T.length),I||(I=0),U>0&&U<P&&(U=P),U===P||T.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if(P<0||P>=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),T.length-I<U-P&&(U=T.length-I+P);let H=U-P;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(I,P,U):Uint8Array.prototype.set.call(T,this.subarray(P,U),I),H},p.prototype.fill=function(T,I,P,U){if(typeof T=="string"){if(typeof I=="string"?(U=I,I=0,P=this.length):typeof P=="string"&&(U=P,P=this.length),U!==void 0&&typeof U!="string")throw new TypeError("encoding must be a string");if(typeof U=="string"&&!p.isEncoding(U))throw new TypeError("Unknown encoding: "+U);if(T.length===1){let W=T.charCodeAt(0);(U==="utf8"&&W<128||U==="latin1")&&(T=W)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(I<0||this.length<I||this.length<P)throw new RangeError("Out of range index");if(P<=I)return this;I=I>>>0,P=P===void 0?this.length:P>>>0,T||(T=0);let H;if(typeof T=="number")for(H=I;H<P;++H)this[H]=T;else{let W=p.isBuffer(T)?T:p.from(T,U),fe=W.length;if(fe===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(H=0;H<P-I;++H)this[H+I]=W[H%fe]}return this};var Z={};function K(T,I,P){Z[T]=class extends P{constructor(){super(),Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(U){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:U,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,I){return`The "${T}" argument must be of type number. Received type ${typeof I}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,I,P){let U=`The value of "${T}" is out of range.`,H=P;return Number.isInteger(P)&&Math.abs(P)>2**32?H=ce(String(P)):typeof P=="bigint"&&(H=String(P),(P>BigInt(2)**BigInt(32)||P<-(BigInt(2)**BigInt(32)))&&(H=ce(H)),H+="n"),U+=` It must be ${I}. Received ${H}`,U},RangeError);function ce(T){let I="",P=T.length,U=T[0]==="-"?1:0;for(;P>=U+4;P-=3)I=`_${T.slice(P-3,P)}${I}`;return`${T.slice(0,P)}${I}`}function te(T,I,P){J(I,"offset"),(T[I]===void 0||T[I+P]===void 0)&&X(I,T.length-(P+1))}function j(T,I,P,U,H,W){if(T>P||T<I){let fe=typeof I=="bigint"?"n":"",st;throw W>3?I===0||I===BigInt(0)?st=`>= 0${fe} and < 2${fe} ** ${(W+1)*8}${fe}`:st=`>= -(2${fe} ** ${(W+1)*8-1}${fe}) and < 2 ** ${(W+1)*8-1}${fe}`:st=`>= ${I}${fe} and <= ${P}${fe}`,new Z.ERR_OUT_OF_RANGE("value",st,T)}te(U,H,W)}function J(T,I){if(typeof T!="number")throw new Z.ERR_INVALID_ARG_TYPE(I,"number",T)}function X(T,I,P){throw Math.floor(T)!==T?(J(T,P),new Z.ERR_OUT_OF_RANGE(P||"offset","an integer",T)):I<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(P||"offset",`>= ${P?1:0} and <= ${I}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function Te(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,I){I=I||1/0;let P,U=T.length,H=null,W=[];for(let fe=0;fe<U;++fe){if(P=T.charCodeAt(fe),P>55295&&P<57344){if(!H){if(P>56319){(I-=3)>-1&&W.push(239,191,189);continue}else if(fe+1===U){(I-=3)>-1&&W.push(239,191,189);continue}H=P;continue}if(P<56320){(I-=3)>-1&&W.push(239,191,189),H=P;continue}P=(H-55296<<10|P-56320)+65536}else H&&(I-=3)>-1&&W.push(239,191,189);if(H=null,P<128){if((I-=1)<0)break;W.push(P)}else if(P<2048){if((I-=2)<0)break;W.push(P>>6|192,P&63|128)}else if(P<65536){if((I-=3)<0)break;W.push(P>>12|224,P>>6&63|128,P&63|128)}else if(P<1114112){if((I-=4)<0)break;W.push(P>>18|240,P>>12&63|128,P>>6&63|128,P&63|128)}else throw new Error("Invalid code point")}return W}function le(T){let I=[];for(let P=0;P<T.length;++P)I.push(T.charCodeAt(P)&255);return I}function ot(T,I){let P,U,H,W=[];for(let fe=0;fe<T.length&&!((I-=2)<0);++fe)P=T.charCodeAt(fe),U=P>>8,H=P%256,W.push(H),W.push(U);return W}function ge(T){return e.toByteArray(Te(T))}function Se(T,I,P,U){let H;for(H=0;H<U&&!(H+P>=I.length||H>=T.length);++H)I[H+P]=T[H];return H}function ut(T,I){return T instanceof I||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===I.name}function Ze(T){return T!==T}var Ge=function(){let T="0123456789abcdef",I=new Array(256);for(let P=0;P<16;++P){let U=P*16;for(let H=0;H<16;++H)I[U+H]=T[P]+T[H]}return I}();function ct(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}),fDe=Jh((t,e)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,e.exports={Buffer:nB().Buffer,Crypto:window.crypto}):e.exports={Buffer:nB().Buffer,Crypto:crypto}}),Fse={};rDe(Fse,{AVSCTap:()=>pb,ArweaveSigner:()=>IB,DataItem:()=>ub,MAX_TAG_BYTES:()=>Nw,MIN_BINARY_SIZE:()=>PB,SIG_CONFIG:()=>pv,SignatureConfig:()=>Cs,Signer:()=>jse,createData:()=>Kse,deserializeTags:()=>Sw,indexToType:()=>BB,serializeTags:()=>OB,tagsExceedLimit:()=>Hse});var jse=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(t,e,r,a){throw new Error("You must implement verify method on child")}},uDe=zd(kB(),1),qf=zd(qse(),1);async function zse(t){if(Array.isArray(t)){let i=(0,qf.concatBuffers)([(0,qf.stringToBuffer)("list"),(0,qf.stringToBuffer)(t.length.toString())]);return await Zse(t,await Wh().hash(i,"SHA-384"))}let e=t,r=(0,qf.concatBuffers)([(0,qf.stringToBuffer)("blob"),(0,qf.stringToBuffer)(e.byteLength.toString())]),a=(0,qf.concatBuffers)([await Wh().hash(r,"SHA-384"),await Wh().hash(e,"SHA-384")]);return await Wh().hash(a,"SHA-384")}async function Zse(t,e){if(t.length<1)return e;let r=(0,qf.concatBuffers)([e,await zse(t[0])]),a=await Wh().hash(r,"SHA-384");return await Zse(t.slice(1),a)}var NI=zd(oDe(),1),hDe=NI.default.default?NI.default.default:NI.default,cDe=class extends hDe{getPublicKey(t){throw new Error("Unimplemented")}},lDe;function Wh(){return lDe??=new cDe}var Cs;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(Cs||(Cs={}));var pv={[Cs.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[Cs.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[Cs.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[Cs.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[Cs.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[Cs.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[Cs.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},IB=class{signatureType=1;ownerLength=pv[1].pubLength;signatureLength=pv[1].sigLength;jwk;pk;constructor(t){this.pk=t.n,this.jwk=t}get publicKey(){return uDe.default.toBuffer(this.pk)}sign(t){return Wh().sign(this.jwk,t)}static async verify(t,e,r){return await Wh().verify(t,e,r)}},BB={1:IB},Fu=zd(kB(),1);async function aB(t){return zse([(0,qf.stringToBuffer)("dataitem"),(0,qf.stringToBuffer)("1"),(0,qf.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}async function dDe(t,e){let r=await aB(t),a=await e.sign(r),i=await Wh().hash(a);return{signature:Me.from(a),id:Me.from(i)}}async function pDe(t,e){let{signature:r,id:a}=await dDe(t,e);return t.getRaw().set(r,2),a}var pb=class{buf;pos;constructor(t=Me.alloc(Nw),e=0){this.buf=t,this.pos=e}writeTags(t){if(!Array.isArray(t))throw new Error("input must be array");let e=t.length,r;if(e)for(this.writeLong(e),r=0;r<e;r++){let a=t[r];if(a?.name===void 0||a?.value===void 0)throw new Error(`Invalid tag format for ${a}, expected {name:string, value: string}`);this.writeString(a.name),this.writeString(a.value)}this.writeLong(0)}toBuffer(){let t=Me.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(t,0,0,this.pos),t}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(t){let e=this.buf,r,a;if(t>=-1073741824&&t<1073741824){a=t>=0?t<<1:~t<<1|1;do e[this.pos]=a&127,a>>=7;while(a&&(e[this.pos++]|=128))}else{r=t>=0?t*2:-t*2-1;do e[this.pos]=r&127,r/=128;while(r>=1&&(e[this.pos++]|=128))}this.pos++,this.buf=e}writeString(t){let e=Me.byteLength(t),r=this.buf;this.writeLong(e);let a=this.pos;if(this.pos+=e,!(this.pos>r.length)){if(e>64)this.buf.write(t,this.pos-e,e,"utf8");else{let i,h,c,p;for(i=0,h=e;i<h;i++)c=t.charCodeAt(i),c<128?r[a++]=c:c<2048?(r[a++]=c>>6|192,r[a++]=c&63|128):(c&64512)===55296&&((p=t.charCodeAt(i+1))&64512)===56320?(c=65536+((c&1023)<<10)+(p&1023),i++,r[a++]=c>>18|240,r[a++]=c>>12&63|128,r[a++]=c>>6&63|128,r[a++]=c&63|128):(r[a++]=c>>12|224,r[a++]=c>>6&63|128,r[a++]=c&63|128)}this.buf=r}}readLong(){let t=0,e=0,r=this.buf,a,i,h,c;do a=r[this.pos++],i=a&128,t|=(a&127)<<e,e+=7;while(i&&e<28);if(i){h=t,c=268435456;do a=r[this.pos++],h+=(a&127)*c,c*=128;while(a&128);return(h%2?-(h+1):h)/2}return t>>1^-(t&1)}skipLong(){let t=this.buf;for(;t[this.pos++]&128;);}readTags(){let t=[],e;for(;e=this.readLong();)for(e<0&&(e=-e,this.skipLong());e--;){let r=this.readString(),a=this.readString();t.push({name:r,value:a})}return t}readString(){let t=this.readLong(),e=this.pos,r=this.buf;if(this.pos+=t,!(this.pos>r.length))return this.buf.slice(e,e+t).toString()}};function OB(t){let e=new pb;return e.writeTags(t),e.toBuffer()}function Hse(t){let e=new pb;return e.writeTags(t),e.tagsExceedLimit()}function Sw(t){return new pb(t).readTags()}function yl(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}function vDe(t){if(t>29)throw new Error("Short too long");let e=[0,0];for(let r=0;r<e.length;r++){let a=t&255;e[r]=a,t=(t-a)/256}return Uint8Array.from(e)}function foe(t){let e=[0,0,0,0,0,0,0,0];for(let r=0;r<e.length;r++){let a=t&255;e[r]=a,t=(t-a)/256}return Uint8Array.from(e)}var mDe=zd(fDe(),1),V1=zd(nB(),1),Nw=4096,PB=80,ub=class{binary;_id;constructor(t){this.binary=t}static isDataItem(t){return t.binary!==void 0}get signatureType(){let t=yl(this.binary.subarray(0,2));if(Cs?.[t]!==void 0)return t;throw new Error("Unknown signature type: "+t)}async isValid(){return ub.verify(this.binary)}get id(){return(async()=>Fu.default.encode(await this.rawId))()}set id(t){this._id=Fu.default.toBuffer(t)}get rawId(){return(async()=>V1.Buffer.from(await mDe.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(t){this._id=t}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Fu.default.encode(this.rawSignature)}set rawOwner(t){if(t.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${t.byteLength} bytes.`);this.binary.set(t,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return pv[this.signatureType].sigLength}get owner(){return Fu.default.encode(this.rawOwner)}get ownerLength(){return pv[this.signatureType].pubLength}get rawTarget(){let t=this.getTargetStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):V1.Buffer.alloc(0)}get target(){return Fu.default.encode(this.rawTarget)}get rawAnchor(){let t=this.getAnchorStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):V1.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let t=this.getTagsStart(),e=yl(this.binary.subarray(t+8,t+16));return this.binary.subarray(t+16,t+16+e)}get tags(){let t=this.getTagsStart();if(yl(this.binary.subarray(t,t+8))==0)return[];let e=yl(this.binary.subarray(t+8,t+16));return Sw(V1.Buffer.from(this.binary.subarray(t+16,t+16+e)))}get tagsB64Url(){return this.tags.map(t=>({name:Fu.default.encode(t.name),value:Fu.default.encode(t.value)}))}getStartOfData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=yl(e);return t+16+r}get rawData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=yl(e),a=t+16+r;return this.binary.subarray(a,this.binary.length)}get data(){return Fu.default.encode(this.rawData)}getRaw(){return this.binary}async sign(t){return this._id=await pDe(this,t),this.rawId}async setSignature(t){this.binary.set(t,2),this._id=V1.Buffer.from(await Wh().hash(t))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(t=>({name:Fu.default.encode(t.name),value:Fu.default.encode(t.value)})),data:this.data}}static async verify(t){if(t.byteLength<PB)return!1;let e=new ub(t),r=e.signatureType,a=e.getTagsStart(),i=yl(t.subarray(a,a+8)),h=t.subarray(a+8,a+16),c=yl(h);if(c>Nw)return!1;if(i>0)try{if(Sw(V1.Buffer.from(t.subarray(a+16,a+16+c))).length!==i)return!1}catch{return!1}let p=BB[r],b=await aB(e);return await p.verify(e.rawOwner,b,e.rawSignature)}async getSignatureData(){return aB(this)}getTagsStart(){let t=this.getTargetStart(),e=this.binary[t]==1,r=t+(e?33:1),a=this.binary[r]==1;return r+=a?33:1,r}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let t=this.getTargetStart()+1,e=this.binary[this.getTargetStart()]==1;return t+=e?32:0,t}},gDe=zd(kB(),1);function Kse(t,e,r){let a=e.publicKey,i=r?.target?gDe.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),c=r?.anchor?Me.from(r.anchor):null,p=1+(c?.byteLength??0),b=(r?.tags?.length??0)>0?OB(r.tags):null,g=16+(b?b.byteLength:0),y=Me.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+p+g+M,E=Me.alloc(x);if(E.set(vDe(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),a.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${a.byteLength}`);E.set(a,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let k=A+h,O=k+1;if(E[k]=c?1:0,c){if(O+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(c,k+1)}E.set(foe(r?.tags?.length??0),O);let N=foe(b?.byteLength??0);E.set(N,O+8),b&&E.set(b,O+16);let L=O+g;return E.set(y,L),new ub(E)}var NB={...Fse};globalThis.arbundles??=NB;var bDe=NB,yDe=NB;globalThis.Buffer||(globalThis.Buffer=$se.Buffer);var{DataItem:wDe}=Dse;function _De(t){return async({data:r,tags:a,target:i,anchor:h,createDataItem:c=p=>new wDe(p)})=>{let p=await t.signDataItem({data:r,tags:a,target:i,anchor:h}),b=c($se.Buffer.from(p));return{id:await b.id,raw:await b.getRaw()}}}var MDe=globalThis.GATEWAY_URL||void 0,xDe=globalThis.MU_URL||void 0,SDe=globalThis.CU_URL||void 0,EDe=globalThis.GRAPHQL_URL||void 0,{result:Bmt,results:Omt,message:Pmt,spawn:Nmt,monitor:Cmt,unmonitor:Lmt,dryrun:$mt,assign:Dmt}=vv({GATEWAY_URL:MDe,MU_URL:xDe,CU_URL:SDe,GRAPHQL_URL:EDe}),Wse=Lse.createDataItemSigner;ie();ae();ne();var qfe=gi(Ufe(),1),Eb=qfe.default.init({host:"arweave.net",port:443,protocol:"https"});async function kbt({signer:t,module:e=nQ,luaCodeTxId:r=gT,ao:a=vv(),scheduler:i=aQ,state:h,stateContractTxId:c,antRegistryId:p=U8,logger:b=qu.default,arweave:g=Eb}){let y=Zd.init({process:new Oa({processId:p,ao:a,logger:b}),signer:t}),M=await g.transactions.getData(r,{decode:!0,string:!0}),x=await a.spawn({module:e,scheduler:i,signer:t,tags:[{name:"ANT-Registry-Id",value:p}]}),E=new Oa({processId:x,ao:a,logger:b}),{id:A}=await E.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:M,signer:t});if(b.info("Spawned ANT",{processId:x,module:e,scheduler:i,luaCodeTxId:r,evalId:A}),h){let{id:O}=await E.send({tags:[{name:"Action",value:"Initialize-State"},...c!==void 0?[{name:"State-Contract-TX-ID",value:c}]:[]],data:JSON.stringify(h),signer:t});b.info("Initialized ANT",{processId:x,module:e,scheduler:i,initializeMsgId:O})}let{id:k}=await y.register({processId:x});return b.info("Registered ANT to ANT Registry",{processId:x,module:e,scheduler:i,antRegistrationMsgId:k,antRegistryId:p}),x}async function Ibt({signer:t,processId:e,luaCodeTxId:r=gT,ao:a=vv(),logger:i=qu.default,arweave:h=Eb}){let c=new Oa({processId:e,ao:a,logger:i}),p=await h.transactions.getData(r,{decode:!0,string:!0}),{id:b}=await c.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:p,signer:t});return i.info("Evolved ANT",{processId:e,luaCodeTxId:r,evalMsgId:b}),b}function HUe(t){let e=vr.object({name:vr.string(),value:vr.union([vr.string(),vr.number()])}),r=vr.function().args(vr.object({data:vr.union([vr.string(),vr.instanceof(Me)]),tags:vr.array(e).optional(),target:vr.string().optional(),anchor:vr.string().optional()})).returns(vr.promise(vr.object({id:vr.string(),raw:vr.instanceof(ArrayBuffer)})));try{return r.parse(t),!0}catch{return!1}}function Bl(t){return HUe(t)?t:"publicKey"in t?async({data:r,tags:a,target:i,anchor:h})=>{t.publicKey===void 0&&"setPublicKey"in t&&typeof t.setPublicKey=="function"&&await t.setPublicKey();let c=Ag(r,t,{tags:a,target:i,anchor:h});return c.sign(t).then(async()=>({id:await c.id,raw:await c.getRaw()}))}:Wse(t)}ie();ae();ne();function Ol(t,e){let r=t.safeParse(e);if(!r.success)throw new Error(JSON.stringify(r.error.format(),null,2));return r}var jw=class{static init({signer:e,strict:r=!1,...a}){if($h(a)||Dh(a))return e?new hO({signer:e,strict:r,...a}):new zw({strict:r,...a});throw new Pu}},zw=class{process;strict;constructor(e){if(this.strict=e.strict||!1,$h(e))this.process=e.process;else if(Dh(e))this.process=new Oa({processId:e.processId});else throw new Pu}async getState({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"State"}],a=await this.process.read({tags:r});return e&&Ol(_T.passthrough().and(vr.object({Records:vr.record(vr.string(),q8.passthrough())})),a),a}async getInfo({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Info"}],a=await this.process.read({tags:r});return e&&Ol(uQ.passthrough(),a),a}async getRecord({undername:e},{strict:r}={strict:this.strict}){let a=[{name:"Sub-Domain",value:e},{name:"Action",value:"Record"}],i=await this.process.read({tags:a});return r&&Ol(q8.passthrough(),i),i}async getRecords({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Records"}],a=await this.process.read({tags:r});return e&&Ol(bT,a),a}async getOwner({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Owner}async getControllers({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Controllers"}],a=await this.process.read({tags:r});return e&&Ol(yT,a),a}async getName({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Name}async getTicker({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Ticker}async getBalances({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Balances"}],a=await this.process.read({tags:r});return e&&Ol(wT,a),a}async getBalance({address:e},{strict:r}={strict:this.strict}){let a=[{name:"Action",value:"Balance"},{name:"Recipient",value:e}],i=await this.process.read({tags:a});return r&&Ol(vr.number(),i),i}},hO=class extends zw{signer;constructor({signer:e,...r}){super(r),this.signer=Bl(e)}async transfer({target:e},r){let a=[...r?.tags??[],{name:"Action",value:"Transfer"},{name:"Recipient",value:e}];return this.process.send({tags:a,signer:this.signer})}async addController({controller:e},r){let a=[...r?.tags??[],{name:"Action",value:"Add-Controller"},{name:"Controller",value:e}];return this.process.send({tags:a,signer:this.signer})}async removeController({controller:e},r){let a=[...r?.tags??[],{name:"Action",value:"Remove-Controller"},{name:"Controller",value:e}];return this.process.send({tags:a,signer:this.signer})}async setRecord({undername:e,transactionId:r,ttlSeconds:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Set-Record"},{name:"Sub-Domain",value:e},{name:"Transaction-Id",value:r},{name:"TTL-Seconds",value:a.toString()}],signer:this.signer})}async removeRecord({undername:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Remove-Record"},{name:"Sub-Domain",value:e}],signer:this.signer})}async setTicker({ticker:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Ticker"},{name:"Ticker",value:e}],signer:this.signer})}async setName({name:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Name"},{name:"Name",value:e}],signer:this.signer})}async setDescription({description:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Description"},{name:"Description",value:e}],signer:this.signer})}async setKeywords({keywords:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Keywords"},{name:"Description",value:JSON.stringify(e)}],signer:this.signer})}async releaseName({name:e,ioProcessId:r},a){return this.process.send({tags:[...a?.tags??[],{name:"Action",value:"Release-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r}],signer:this.signer})}async reassignName({name:e,ioProcessId:r,antProcessId:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Reassign-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r},{name:"Process-Id",value:a}],signer:this.signer})}};ie();ae();ne();var Zd=class{static init(e){if(e&&e.signer){let{signer:r,...a}=e;return new cO({...a,signer:r})}return new Zw(e)}},Zw=class{process;constructor(e){if(e&&(Dh(e)||$h(e)))if($h(e))this.process=e.process;else if(Dh(e))this.process=new Oa({processId:e.processId});else throw new Pu;else this.process=new Oa({processId:U8})}async accessControlList({address:e}){return this.process.read({tags:[{name:"Action",value:"Access-Control-List"},{name:"Address",value:e}]})}},cO=class extends Zw{signer;constructor({signer:e,...r}){super(r),this.signer=Bl(e)}async register({processId:e}){return this.process.send({tags:[{name:"Action",value:"Register"},{name:"Process-Id",value:e}],signer:this.signer})}};ie();ae();ne();ie();ae();ne();ie();ae();ne();function lO(t){try{return JSON.parse(t)}catch{return t}}var Oa=class{logger;processId;ao;constructor({processId:e,ao:r=vv(),logger:a=qu.default}){this.processId=e,this.logger=a,this.ao=r}async read({tags:e,retries:r=3}){let a=0,i;for(;a<r;)try{this.logger.debug("Evaluating read interaction on contract",{tags:e});let h=await this.ao.dryrun({process:this.processId,tags:e});if(this.logger.debug("Read interaction result",{result:h}),h.Messages===void 0||h.Messages.length===0)throw this.logger.debug(`Process ${this.processId} does not support provided action.`,h,e),new Error(`Process ${this.processId} does not support provided action.`);let c=h.Messages[0].Tags,p=h.Messages[0].Data,b=c.find(y=>y.name==="Error");if(b)throw new Error(`${b.value}${p?`: ${p}`:""}`);return p===void 0?{}:lO(h.Messages[0].Data)}catch(h){a++,this.logger.debug(`Read attempt ${a} failed`,{error:h,tags:e}),i=h,await new Promise(c=>setTimeout(c,2**a*1e3))}throw i}async send({tags:e,data:r,signer:a,retries:i=3}){let h=0,c;for(;h<i;)try{this.logger.debug("Evaluating send interaction on contract",{tags:e,data:r,processId:this.processId});let p=await this.ao.message({process:this.processId,tags:[...e,{name:"AR-IO-SDK",value:V4}],data:r,signer:a});this.logger.debug("Sent message to process",{messageId:p,processId:this.processId});let b=await this.ao.result({message:p,process:this.processId});if(this.logger.debug("Message result",{output:b,messageId:p,processId:this.processId}),b.Messages?.length===0||b.Messages===void 0)return{id:p};let y=b.Messages[0].Tags.find(x=>x.name==="Error");if(y){let x=b.Messages[0].Data;throw new F8(`${y.Value}: ${x}`)}if(b.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);if(b.Messages[0].Data===void 0)return{id:p};let M=lO(b.Messages[0].Data);return this.logger.debug("Message result data",{resultData:M,messageId:p,processId:this.processId}),{id:p,result:M}}catch(p){if(this.logger.error("Error sending message to process",{error:p.message,processId:this.processId,tags:e}),p.message.includes("500"))this.logger.debug("Retrying send interaction",{attempts:h,retries:i,error:p.message,processId:this.processId}),await new Promise(b=>setTimeout(b,2**h*2e3)),h++,c=p;else throw p}throw c}};var Ab=class{static init(e){if(e&&e.signer){let{signer:r,...a}=e;return new dO({...a,signer:r})}return new Hw(e)}},Hw=class{process;arweave;constructor(e,r=Eb){if(!e)this.process=new Oa({processId:E1});else if($h(e))this.process=e.process;else if(Dh(e))this.process=new Oa({processId:e.processId});else throw new Pu;this.arweave=r}async getInfo(){return this.process.read({tags:[{name:"Action",value:"Info"}]})}async getTokenSupply(){return this.process.read({tags:[{name:"Action",value:"Total-Token-Supply"}]})}async getEpochSettings(e){let r=[{name:"Action",value:"Epoch-Settings"},{name:"Timestamp",value:e?.timestamp?.toString()??(await A1(this.arweave)).toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:wn(r)})}async getEpoch(e){let r=[{name:"Action",value:"Epoch"},{name:"Timestamp",value:e?.timestamp?.toString()??(await A1(this.arweave)).toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:wn(r)})}async getArNSRecord({name:e}){return this.process.read({tags:[{name:"Action",value:"Record"},{name:"Name",value:e}]})}async getArNSRecords(e){let r=[{name:"Action",value:"Paginated-Records"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}];return this.process.read({tags:wn(r)})}async getArNSReservedNames(){return this.process.read({tags:[{name:"Action",value:"Reserved-Names"}]})}async getArNSReservedName({name:e}){return this.process.read({tags:[{name:"Action",value:"Reserved-Name"},{name:"Name",value:e}]})}async getBalance({address:e}){return this.process.read({tags:[{name:"Action",value:"Balance"},{name:"Address",value:e}]})}async getBalances(e){let r=[{name:"Action",value:"Paginated-Balances"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}];return this.process.read({tags:wn(r)})}async getVault({address:e,vaultId:r}){return this.process.read({tags:[{name:"Action",value:"Vault"},{name:"Address",value:e},{name:"Vault-Id",value:r}]})}async getVaults(e){let r=[{name:"Action",value:"Paginated-Vaults"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}];return this.process.read({tags:wn(r)})}async getGateway({address:e}){return this.process.read({tags:[{name:"Action",value:"Gateway"},{name:"Address",value:e}]})}async getGatewayDelegates({address:e,...r}){let a=[{name:"Action",value:"Paginated-Delegates"},{name:"Address",value:e},{name:"Cursor",value:r?.cursor?.toString()},{name:"Limit",value:r?.limit?.toString()},{name:"Sort-By",value:r?.sortBy},{name:"Sort-Order",value:r?.sortOrder}];return this.process.read({tags:wn(a)})}async getGatewayDelegateAllowList({address:e,...r}){let a=[{name:"Action",value:"Paginated-Allowed-Delegates"},{name:"Address",value:e},{name:"Cursor",value:r?.cursor?.toString()},{name:"Limit",value:r?.limit?.toString()},{name:"Sort-Order",value:r?.sortOrder}];return this.process.read({tags:wn(a)})}async getGateways(e){let r=[{name:"Action",value:"Paginated-Gateways"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}];return this.process.read({tags:wn(r)})}async getCurrentEpoch(){return this.process.read({tags:[{name:"Action",value:"Epoch"},{name:"Timestamp",value:(await this.arweave.blocks.getCurrent().then(e=>({timestamp:e.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()}]})}async getPrescribedObservers(e){let r=[{name:"Action",value:"Epoch-Prescribed-Observers"},{name:"Timestamp",value:e?.timestamp?.toString()??(await A1(this.arweave)).toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:wn(r)})}async getPrescribedNames(e){let r=[{name:"Action",value:"Epoch-Prescribed-Names"},{name:"Timestamp",value:e?.timestamp?.toString()??(await A1(this.arweave)).toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:wn(r)})}async getObservations(e){let r=[{name:"Action",value:"Epoch-Observations"},{name:"Timestamp",value:e?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().then(a=>({timestamp:a.timestamp*1e3})).catch(()=>({timestamp:`${Date.now()}`}))).timestamp.toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:wn(r)})}async getDistributions(e){let r=[{name:"Action",value:"Epoch-Distributions"},{name:"Timestamp",value:e?.timestamp?.toString()??(await A1(this.arweave)).toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:wn(r)})}async getTokenCost({intent:e,type:r,years:a,name:i,quantity:h}){let c=[{name:"Action",value:"Token-Cost"},{name:"Intent",value:e},{name:"Name",value:i},{name:"Years",value:a?.toString()},{name:"Quantity",value:h?.toString()},{name:"Purchase-Type",value:r},{name:"Timestamp",value:(await this.arweave.blocks.getCurrent().then(p=>({timestamp:p.timestamp*1e3})).catch(()=>({timestamp:Date.now()}))).timestamp.toString()}];return this.process.read({tags:wn(c)})}async getRegistrationFees(){return this.process.read({tags:[{name:"Action",value:"Get-Registration-Fees"}]})}async getDemandFactor(){return this.process.read({tags:[{name:"Action",value:"Demand-Factor"}]})}async getArNSAuctions(e){let r=[{name:"Action",value:"Auctions"},{name:"Cursor",value:e?.cursor?.toString()},{name:"Limit",value:e?.limit?.toString()},{name:"Sort-By",value:e?.sortBy},{name:"Sort-Order",value:e?.sortOrder}];return this.process.read({tags:wn(r)})}async getArNSAuction({name:e}){let r=[{name:"Action",value:"Auction-Info"},{name:"Name",value:e}];return this.process.read({tags:r})}async getArNSAuctionPrices({name:e,type:r,years:a,timestamp:i,intervalMs:h}){let c=[{name:"Action",value:"Auction-Prices"},{name:"Name",value:e},{name:"Timestamp",value:i?.toString()??Date.now().toString()},{name:"Purchase-Type",value:r??"lease"},{name:"Years",value:r==null||r==="lease"?a?.toString()??"1":void 0},{name:"Price-Interval-Ms",value:h?.toString()??"900000"}].filter(p=>p.value!==void 0);return this.process.read({tags:c})}async getDelegations(e){let r=[{name:"Action",value:"Paginated-Delegations"},{name:"Cursor",value:e.cursor?.toString()},{name:"Limit",value:e.limit?.toString()},{name:"Sort-By",value:e.sortBy},{name:"Sort-Order",value:e.sortOrder},{name:"Address",value:e.address}];return this.process.read({tags:wn(r)})}},dO=class extends Hw{signer;constructor({signer:e,...r}){if(Object.keys(r).length===0)super({process:new Oa({processId:E1})}),this.signer=Bl(e);else if($h(r))super({process:r.process}),this.signer=Bl(e);else if(Dh(r))super({process:new Oa({processId:r.processId})}),this.signer=Bl(e);else throw new Pu}async transfer({target:e,qty:r},a){let{tags:i=[]}=a||{};return this.process.send({tags:[...i,{name:"Action",value:"Transfer"},{name:"Recipient",value:e},{name:"Quantity",value:r.valueOf().toString()}],signer:this.signer})}async joinNetwork({operatorStake:e,allowDelegatedStaking:r,allowedDelegates:a,delegateRewardShareRatio:i,fqdn:h,label:c,minDelegatedStake:p,note:b,port:g,properties:y,protocol:M,autoStake:x,observerAddress:E},A){let{tags:k=[]}=A||{},O=[...k,{name:"Action",value:"Join-Network"},{name:"Operator-Stake",value:e.valueOf().toString()},{name:"Allow-Delegated-Staking",value:r?.toString()},{name:"Allowed-Delegates",value:a?.join(",")},{name:"Delegate-Reward-Share-Ratio",value:i?.toString()},{name:"FQDN",value:h},{name:"Label",value:c},{name:"Min-Delegated-Stake",value:p?.valueOf().toString()},{name:"Note",value:b},{name:"Port",value:g?.toString()},{name:"Properties",value:y},{name:"Protocol",value:M},{name:"Auto-Stake",value:x?.toString()},{name:"Observer-Address",value:E}];return this.process.send({signer:this.signer,tags:wn(O)})}async leaveNetwork(e){let{tags:r=[]}=e||{};return this.process.send({signer:this.signer,tags:[...r,{name:"Action",value:"Leave-Network"}]})}async updateGatewaySettings({allowDelegatedStaking:e,allowedDelegates:r,delegateRewardShareRatio:a,fqdn:i,label:h,minDelegatedStake:c,note:p,port:b,properties:g,protocol:y,autoStake:M,observerAddress:x},E){let{tags:A=[]}=E||{},k=[...A,{name:"Action",value:"Update-Gateway-Settings"},{name:"Label",value:h},{name:"Note",value:p},{name:"FQDN",value:i},{name:"Port",value:b?.toString()},{name:"Properties",value:g},{name:"Protocol",value:y},{name:"Observer-Address",value:x},{name:"Allow-Delegated-Staking",value:e?.toString()},{name:"Allowed-Delegates",value:r?.join(",")},{name:"Delegate-Reward-Share-Ratio",value:a?.toString()},{name:"Min-Delegated-Stake",value:c?.valueOf().toString()},{name:"Auto-Stake",value:M?.toString()}];return this.process.send({signer:this.signer,tags:wn(k)})}async delegateStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.stakeQty.valueOf().toString()}]})}async decreaseDelegateStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Decrease-Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.decreaseQty.valueOf().toString()},{name:"Instant",value:`${e.instant||!1}`}]})}async instantWithdrawal(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Instant-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}];return this.process.send({signer:this.signer,tags:wn(i)})}async increaseOperatorStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Increase-Operator-Stake"},{name:"Quantity",value:e.increaseQty.valueOf().toString()}]})}async decreaseOperatorStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Decrease-Operator-Stake"},{name:"Quantity",value:e.decreaseQty.valueOf().toString()}]})}async saveObservations(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Save-Observations"},{name:"Report-Tx-Id",value:e.reportTxId},{name:"Failed-Gateways",value:e.failedGateways.join(",")}]})}async buyRecord(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Buy-Record"},{name:"Name",value:e.name},{name:"Years",value:e.years?.toString()??"1"},{name:"Process-Id",value:e.processId},{name:"Purchase-Type",value:e.type||"lease"}];return this.process.send({signer:this.signer,tags:wn(i)})}async upgradeRecord(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Upgrade-Name"},{name:"Name",value:e.name}]})}async extendLease(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Extend-Lease"},{name:"Name",value:e.name},{name:"Years",value:e.years.toString()}]})}async increaseUndernameLimit(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Increase-Undername-Limit"},{name:"Name",value:e.name},{name:"Quantity",value:e.increaseCount.toString()}]})}async cancelWithdrawal(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Cancel-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}];return this.process.send({signer:this.signer,tags:wn(i)})}async submitAuctionBid(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Auction-Bid"},{name:"Name",value:e.name},{name:"Process-Id",value:e.processId},{name:"Quantity",value:e.quantity?.toString()??void 0},{name:"Purchase-Type",value:e.type||"lease"},{name:"Years",value:e.years?.toString()??void 0}];return this.process.send({signer:this.signer,tags:wn(i)})}};ie();ae();ne();ie();ae();ne();lu();var Ffe="+",jfe="/",zfe="-",Zfe="_",Hfe="=";function KUe(t){let e=t.length%4;return e&&(t+=Hfe.repeat(4-e)),t.replaceAll(zfe,Ffe).replaceAll(Zfe,jfe)}function WUe(t){return t.replaceAll(Ffe,zfe).replaceAll(jfe,Zfe).replaceAll(Hfe,"")}function m6t(t){let e=KUe(t);return Me.from(e,"base64")}function VUe(t){let e=t.toString("base64");return WUe(e)}function g6t(t){return VUe(df("sha256").update(t).digest())}ie();ae();ne();ie();ae();ne();var vO=gi(Wfe(),1);ie();ae();ne();var JUe=Object.defineProperty,XUe=(t,e,r)=>e in t?JUe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Tb=(t,e,r)=>(XUe(t,typeof e!="symbol"?e+"":e,r),r),mO=class{constructor(e){Tb(this,"value"),Tb(this,"next"),this.value=e}},gO=class{constructor(){Tb(this,"head"),Tb(this,"tail"),Tb(this,"_size",0),this.clear()}clear(){this.head=void 0,this.tail=void 0,this._size=0}push(e){let r=new mO(e);return this.head&&this.tail?(this.tail.next=r,this.tail=r):(this.head=r,this.tail=r),this._size++,this._size}pop(){if(!this.head)return;let e=this.head;return this.head=this.head.next,this._size--,e.value}get size(){return this._size}*[Symbol.iterator](){let e=this.head;for(;e;)yield e.value,e=e.next}};function Vfe(t){if(!((Number.isInteger(t)||t===1/0)&&t>0))throw new TypeError("Expected `concurrency` to be a number greater than 1");let e=new gO,r=0,a=()=>{r--,e.size>0&&e.pop()()},i=async(p,b,g)=>{r++;let y=(async()=>p(...g))();b(y);try{await y}catch{}a()},h=(p,b,g)=>{e.push(i.bind(null,p,b,g)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.pop()()))()},c=(p,...b)=>new Promise(g=>{h(p,g,b)});return Object.defineProperties(c,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),c}var j6t=async({address:t,registry:e=Zd.init()})=>{let r=await e.accessControlList({address:t});return[...new Set([...r.Owned,...r.Controlled])]};function Gfe(t,e){return new Promise((r,a)=>{let i=setTimeout(()=>{a(new Error("Timeout"))},t);e.then(h=>{clearTimeout(i),r(h)}).catch(h=>{clearTimeout(i),a(h)})})}var Yfe=class extends vO.default{contract;timeoutMs;throttle;logger;strict;constructor({contract:e=Ab.init({processId:E1}),timeoutMs:r=6e4,concurrency:a=30,logger:i=qu.default,strict:h=!1}={}){super(),this.contract=e,this.timeoutMs=r,this.throttle=Vfe(a),this.logger=i,this.strict=h}async fetchProcessesOwnedByWallet({address:e,pageSize:r,antRegistry:a=Zd.init()}){let i={},h=await a.accessControlList({address:e}),c=new Set([...h.Owned,...h.Controlled]);await Gfe(this.timeoutMs,QUe({contract:this.contract,emitter:this,pageSize:r})).catch(b=>(this.emit("error",`Error getting ArNS records: ${b}`),this.logger.error("Error getting ArNS records",{message:b?.message,stack:b?.stack}),{})).then(b=>{Object.entries(b).forEach(([g,y])=>{c.has(y.processId)&&(i[y.processId]==null&&(i[y.processId]={state:void 0,names:{}}),i[y.processId].names[g]=y)})});let p=Object.keys(i).length;this.emit("progress",0,p),await Promise.all(Object.keys(i).map(async(b,g)=>this.throttle(async()=>{if(i[b].state!==void 0){this.emit("progress",g+1,p);return}let y=jw.init({processId:b,strict:this.strict}),M=await Gfe(this.timeoutMs,y.getState()).catch(x=>{this.emit("error",`Error getting state for process ${b}: ${x}`)});(M?.Owner===e||M?.Controllers.includes(e))&&(i[b].state=M,this.emit("process",b,i[b])),this.emit("progress",g+1,p)}))),this.emit("end",i)}},QUe=async({contract:t=Ab.init({processId:E1}),emitter:e,logger:r=qu.default,pageSize:a=5e4})=>{let i,h=Date.now(),c={};do{let p=await t.getArNSRecords({cursor:i,limit:a}).catch(b=>{r?.error("Error getting ArNS records",{message:b?.message,stack:b?.stack}),e?.emit("arns:error",`Error getting ArNS records: ${b}`)});if(!p)return{};p.items.forEach(b=>{let{name:g,...y}=b;c[g]=y}),r.debug("Fetched page of ArNS records",{totalRecordCount:p.totalItems,fetchedRecordCount:Object.keys(c).length,cursor:p.nextCursor}),e?.emit("arns:pageLoaded",{totalRecordCount:p.totalItems,fetchedRecordCount:Object.keys(c).length,records:p.items,cursor:p.nextCursor}),i=p.nextCursor}while(i!==void 0);return e?.emit("arns:end",c),r.debug("Fetched all ArNS records",{totalRecordCount:Object.keys(c).length,durationMs:Date.now()-h}),c};export{jw as ANT,Zd as ANTRegistry,gT as ANT_LUA_ID,U8 as ANT_REGISTRY_ID,Oa as AOProcess,nQ as AOS_MODULE_ID,Oft as ARNS_DEVNET_REGISTRY_TX,Bft as ARNS_TESTNET_REGISTRY_TX,D8 as ARWEAVE_TX_REGEX,gQ as AbortError,wT as AntBalancesSchema,yT as AntControllersSchema,t5e as AntDescriptionSchema,r5e as AntHandlerNames,sQ as AntHandlersSchema,uQ as AntInfoSchema,fQ as AntKeywordsSchema,q8 as AntRecordSchema,bT as AntRecordsSchema,_T as AntStateSchema,zw as AoANTReadable,Zw as AoANTRegistryReadable,cO as AoANTRegistryWriteable,hO as AoANTWriteable,Yfe as ArNSEventEmitter,p1 as ArconnectSigner,Hc as ArweaveSigner,Lh as ArweaveTxIdSchema,lQ as BadRequest,Tf as BaseError,aQ as DEFAULT_SCHEDULER_ID,kft as FQDN_REGEX,dQ as FailedRequestError,Ab as IO,Hw as IOReadable,xT as IOToken,dO as IOWriteable,e5e as IO_DEVNET_PROCESS_ID,E1 as IO_TESTNET_PROCESS_ID,oQ as IntegerStringSchema,Pu as InvalidContractConfigurationError,mQ as InvalidProcessConfigurationError,vQ as InvalidSignerError,qu as Logger,mT as MIO_PER_IO,cQ as NotFound,Ift as SORT_KEY_REGEX,pQ as UnknownError,F8 as WriteInteractionError,Bl as createAoSigner,Ibt as evolveANT,QUe as fetchAllArNSRecords,m6t as fromB64Url,j6t as getANTProcessesOwnedByWallet,A1 as getCurrentBlockUnixTimestampMs,Pft as ioDevnetProcessId,qft as isAoANTState,HUe as isAoSigner,Gft as isBlockHeight,tut as isLeasedArNSRecord,$h as isProcessConfiguration,Dh as isProcessIdConfiguration,ST as mIOToken,Ol as parseSchemaResult,wn as pruneTags,lO as safeDecode,g6t as sha256B64Url,kbt as spawnANT,VUe as toB64Url,hQ as validateArweaveId};
188
188
  /*! Bundled license information:
189
189
 
190
190
  @jspm/core/nodelibs/browser/buffer.js: