@wormhole-foundation/wormhole-connect 0.3.0-beta.8-development → 0.3.0-beta.9-development

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.
Files changed (43) hide show
  1. package/dist/assets/{cosmos-TcYN7x14.js → cosmos-9t5ds48M.js} +1 -1
  2. package/dist/assets/index-bti7uInf.js +3 -0
  3. package/dist/assets/{solana-r3vOVfGL.js → solana-QOFlt-jY.js} +2 -2
  4. package/dist/assets/{solanaEmbed.esm-8lU7Qhqn.js → solanaEmbed.esm-bag_3ej_.js} +1 -1
  5. package/dist/main.js +7 -7
  6. package/lib/{aptos-Kvkg4y1o.js → aptos-GJE1nDRp.js} +1 -1
  7. package/lib/{aptos-RA5iW4NV.mjs → aptos-lQe9oQx9.mjs} +1 -1
  8. package/lib/{ccip-G2uREay3.js → ccip-PDyqSMDW.js} +1 -1
  9. package/lib/{ccip-wRn1bYeQ.mjs → ccip-hO7ZYWLY.mjs} +3 -3
  10. package/lib/{cosmos--no8V1um.mjs → cosmos-2pujjmSz.mjs} +3 -3
  11. package/lib/{cosmos-bdL65Z0D.js → cosmos-uH1IUSzG.js} +1 -1
  12. package/lib/{evm-JKoM6R7y.mjs → evm-2S3g0YZh.mjs} +4 -4
  13. package/lib/{evm-wBlzASHY.js → evm-4AJ7TCsa.js} +3 -3
  14. package/lib/{index-RYKL0JGL.js → index-0K-htcXG.js} +1 -1
  15. package/lib/{index-w26o4sIn.mjs → index-KUjbVp29.mjs} +2 -2
  16. package/lib/{index-4jpmcnL6.mjs → index-SfFT4aTV.mjs} +17 -17
  17. package/lib/{index-V4Euj2EI.mjs → index-baBmnoG_.mjs} +1 -1
  18. package/lib/{index-izXk6gtS.mjs → index-cuRxIAc3.mjs} +3 -3
  19. package/lib/{index-gID7pSyB.js → index-ekCcQNpw.js} +1 -1
  20. package/lib/{index-Qlj1EGMR.js → index-grSJdpFa.js} +1 -1
  21. package/lib/{index-1nBJ0fIG.js → index-qnIvXh1E.js} +2 -2
  22. package/lib/{index-HXuJzuVC.mjs → index-sMX44CDh.mjs} +1 -1
  23. package/lib/{index-tzLR9U2N.js → index-u0Rvcbvi.js} +1 -1
  24. package/lib/{index.es-4R5tFA5N.js → index.es-CKx7JtqQ.js} +2 -2
  25. package/lib/{index.es-t3Ur36FH.mjs → index.es-Va6ZmIbG.mjs} +4 -4
  26. package/lib/{index.es-P_LzX9At.mjs → index.es-idrMx4v3.mjs} +2 -2
  27. package/lib/{index.es-dkNwJlUl.js → index.es-jUK9hn27.js} +1 -1
  28. package/lib/{index.es-OSzAvNi0.mjs → index.es-tpPeyRI3.mjs} +1 -1
  29. package/lib/{index.es-w4GgAuDK.js → index.es-vpF2C8hS.js} +1 -1
  30. package/lib/index.js +1 -1
  31. package/lib/index.mjs +1 -1
  32. package/lib/{libsodium-wrappers-mdWTP0YY.js → libsodium-wrappers-8b6Wtf-j.js} +1 -1
  33. package/lib/{libsodium-wrappers--M52lOWq.mjs → libsodium-wrappers-C-lAPAZG.mjs} +1 -1
  34. package/lib/{sei-6MAtFKIn.mjs → sei-Gy2pFt1v.mjs} +24864 -24870
  35. package/lib/{sei-YRSnv_xE.js → sei-z1tt6ZDO.js} +89 -89
  36. package/lib/{solana-wJCxn4Sl.mjs → solana-V08irroN.mjs} +3 -3
  37. package/lib/{solana-E1ubkDac.js → solana-cYgEVGXM.js} +1 -1
  38. package/lib/{solanaEmbed.esm-cjqIbdkY.js → solanaEmbed.esm-KpT3PcpY.js} +1 -1
  39. package/lib/{solanaEmbed.esm-JcxHJxQn.mjs → solanaEmbed.esm-VCYctIaN.mjs} +2 -2
  40. package/lib/{sui-T22lg74W.mjs → sui-l0Ay_MM6.mjs} +1 -1
  41. package/lib/{sui-SajG7-Ll.js → sui-sUfbUCm4.js} +1 -1
  42. package/package.json +1 -1
  43. package/dist/assets/index-7UgR9Epe.js +0 -3
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./index-1nBJ0fIG.js"),co=require("./index-tzLR9U2N.js");require("react");require("react-dom");var Os=In;In.default=In;In.stable=Bf;In.stableStringify=Bf;var oi="[...]",Lf="[Circular]",Or=[],Ar=[];function Nf(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function In(e,t,r,n){typeof n>"u"&&(n=Nf()),is(e,"",0,[],void 0,0,n);var i;try{Ar.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,$f(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Or.length!==0;){var o=Or.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function Wr(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),Or.push([n,r,t,i])):Ar.push([t,r,e]):(n[r]=e,Or.push([n,r,t]))}function is(e,t,r,n,i,o,s){o+=1;var f;if(typeof e=="object"&&e!==null){for(f=0;f<n.length;f++)if(n[f]===e){Wr(Lf,e,t,i);return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){Wr(oi,e,t,i);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){Wr(oi,e,t,i);return}if(n.push(e),Array.isArray(e))for(f=0;f<e.length;f++)is(e[f],f,f,n,e,o,s);else{var l=Object.keys(e);for(f=0;f<l.length;f++){var u=l[f];is(e[u],u,f,n,e,o,s)}}n.pop()}}function Md(e,t){return e<t?-1:e>t?1:0}function Bf(e,t,r,n){typeof n>"u"&&(n=Nf());var i=os(e,"",0,[],void 0,0,n)||e,o;try{Ar.length===0?o=JSON.stringify(i,t,r):o=JSON.stringify(i,$f(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Or.length!==0;){var s=Or.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return o}function os(e,t,r,n,i,o,s){o+=1;var f;if(typeof e=="object"&&e!==null){for(f=0;f<n.length;f++)if(n[f]===e){Wr(Lf,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){Wr(oi,e,t,i);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){Wr(oi,e,t,i);return}if(n.push(e),Array.isArray(e))for(f=0;f<e.length;f++)os(e[f],f,f,n,e,o,s);else{var l={},u=Object.keys(e).sort(Md);for(f=0;f<u.length;f++){var c=u[f];os(e[c],c,f,n,e,o,s),l[c]=e[c]}if(typeof i<"u")Or.push([i,t,e]),i[t]=l;else return l}n.pop()}}function $f(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(Ar.length>0)for(var n=0;n<Ar.length;n++){var i=Ar[n];if(i[1]===t&&i[0]===r){r=i[2],Ar.splice(n,1);break}}return e.call(this,t,r)}}const Ud=x.getDefaultExportFromCjs(Os);var Fd=Hd;function Hd(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const zd=x.getDefaultExportFromCjs(Fd),Br=x.getAugmentedNamespace(x.dist$2);var ss={exports:{}},ho,Ca;function Wd(){if(Ca)return ho;Ca=1;var e=1e3,t=e*60,r=t*60,n=r*24,i=n*7,o=n*365.25;ho=function(c,h){h=h||{};var m=typeof c;if(m==="string"&&c.length>0)return s(c);if(m==="number"&&isFinite(c))return h.long?l(c):f(c);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))};function s(c){if(c=String(c),!(c.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(h){var m=parseFloat(h[1]),y=(h[2]||"ms").toLowerCase();switch(y){case"years":case"year":case"yrs":case"yr":case"y":return m*o;case"weeks":case"week":case"w":return m*i;case"days":case"day":case"d":return m*n;case"hours":case"hour":case"hrs":case"hr":case"h":return m*r;case"minutes":case"minute":case"mins":case"min":case"m":return m*t;case"seconds":case"second":case"secs":case"sec":case"s":return m*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function f(c){var h=Math.abs(c);return h>=n?Math.round(c/n)+"d":h>=r?Math.round(c/r)+"h":h>=t?Math.round(c/t)+"m":h>=e?Math.round(c/e)+"s":c+"ms"}function l(c){var h=Math.abs(c);return h>=n?u(c,h,n,"day"):h>=r?u(c,h,r,"hour"):h>=t?u(c,h,t,"minute"):h>=e?u(c,h,e,"second"):c+" ms"}function u(c,h,m,y){var v=h>=m*1.5;return Math.round(c/m)+" "+y+(v?"s":"")}return ho}function Vd(e){r.debug=r,r.default=r,r.coerce=l,r.disable=o,r.enable=i,r.enabled=s,r.humanize=Wd(),r.destroy=u,Object.keys(e).forEach(c=>{r[c]=e[c]}),r.names=[],r.skips=[],r.formatters={};function t(c){let h=0;for(let m=0;m<c.length;m++)h=(h<<5)-h+c.charCodeAt(m),h|=0;return r.colors[Math.abs(h)%r.colors.length]}r.selectColor=t;function r(c){let h,m=null,y,v;function G(...M){if(!G.enabled)return;const j=G,E=Number(new Date),z=E-(h||E);j.diff=z,j.prev=h,j.curr=E,h=E,M[0]=r.coerce(M[0]),typeof M[0]!="string"&&M.unshift("%O");let R=0;M[0]=M[0].replace(/%([a-zA-Z%])/g,(k,U)=>{if(k==="%%")return"%";R++;const te=r.formatters[U];if(typeof te=="function"){const W=M[R];k=te.call(j,W),M.splice(R,1),R--}return k}),r.formatArgs.call(j,M),(j.log||r.log).apply(j,M)}return G.namespace=c,G.useColors=r.useColors(),G.color=r.selectColor(c),G.extend=n,G.destroy=r.destroy,Object.defineProperty(G,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(y!==r.namespaces&&(y=r.namespaces,v=r.enabled(c)),v),set:M=>{m=M}}),typeof r.init=="function"&&r.init(G),G}function n(c,h){const m=r(this.namespace+(typeof h>"u"?":":h)+c);return m.log=this.log,m}function i(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let h;const m=(typeof c=="string"?c:"").split(/[\s,]+/),y=m.length;for(h=0;h<y;h++)m[h]&&(c=m[h].replace(/\*/g,".*?"),c[0]==="-"?r.skips.push(new RegExp("^"+c.slice(1)+"$")):r.names.push(new RegExp("^"+c+"$")))}function o(){const c=[...r.names.map(f),...r.skips.map(f).map(h=>"-"+h)].join(",");return r.enable(""),c}function s(c){if(c[c.length-1]==="*")return!0;let h,m;for(h=0,m=r.skips.length;h<m;h++)if(r.skips[h].test(c))return!1;for(h=0,m=r.names.length;h<m;h++)if(r.names[h].test(c))return!0;return!1}function f(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}function l(c){return c instanceof Error?c.stack||c.message:c}function u(){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 r.enable(r.load()),r}var qd=Vd;(function(e,t){t.formatArgs=n,t.save=i,t.load=o,t.useColors=r,t.storage=s(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!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 n(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;l.splice(1,0,u,"color: inherit");let c=0,h=0;l[0].replace(/%[a-zA-Z%]/g,m=>{m!=="%%"&&(c++,m==="%c"&&(h=c))}),l.splice(h,0,u)}t.log=console.debug||console.log||(()=>{});function i(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function o(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof x.dist.process<"u"&&"env"in x.dist.process&&(l=x.dist.process.env.DEBUG),l}function s(){try{return localStorage}catch{}}e.exports=qd(t);const{formatters:f}=e.exports;f.j=function(l){try{return JSON.stringify(l)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(ss,ss.exports);var Gd=ss.exports,Ut={},_r={};Object.defineProperty(_r,"__esModule",{value:!0});_r.EthereumProviderError=_r.EthereumRpcError=void 0;const Zd=Os;class xf extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return Zd.default(this.serialize(),Xd,2)}}_r.EthereumRpcError=xf;let Kd=class extends xf{constructor(t,r,n){if(!Jd(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};_r.EthereumProviderError=Kd;function Jd(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function Xd(e,t){if(t!=="[Circular]")return t}var Ps={},br={};Object.defineProperty(br,"__esModule",{value:!0});br.errorValues=br.errorCodes=void 0;br.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};br.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=br,r=_r,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",o={code:n,message:s(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function s(m,y=i){if(Number.isInteger(m)){const v=m.toString();if(h(t.errorValues,v))return t.errorValues[v].message;if(u(m))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return y}e.getMessageFromCode=s;function f(m){if(!Number.isInteger(m))return!1;const y=m.toString();return!!(t.errorValues[y]||u(m))}e.isValidCode=f;function l(m,{fallbackError:y=o,shouldIncludeStack:v=!1}={}){var G,M;if(!y||!Number.isInteger(y.code)||typeof y.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(m instanceof r.EthereumRpcError)return m.serialize();const j={};if(m&&typeof m=="object"&&!Array.isArray(m)&&h(m,"code")&&f(m.code)){const z=m;j.code=z.code,z.message&&typeof z.message=="string"?(j.message=z.message,h(z,"data")&&(j.data=z.data)):(j.message=s(j.code),j.data={originalError:c(m)})}else{j.code=y.code;const z=(G=m)===null||G===void 0?void 0:G.message;j.message=z&&typeof z=="string"?z:y.message,j.data={originalError:c(m)}}const E=(M=m)===null||M===void 0?void 0:M.stack;return v&&m&&E&&typeof E=="string"&&(j.stack=E),j}e.serializeError=l;function u(m){return m>=-32099&&m<=-32e3}function c(m){return m&&typeof m=="object"&&!Array.isArray(m)?Object.assign({},m):m}function h(m,y){return Object.prototype.hasOwnProperty.call(m,y)}})(Ps);var bi={};Object.defineProperty(bi,"__esModule",{value:!0});bi.ethErrors=void 0;const Cs=_r,kf=Ps,ht=br;bi.ethErrors={rpc:{parse:e=>At(ht.errorCodes.rpc.parse,e),invalidRequest:e=>At(ht.errorCodes.rpc.invalidRequest,e),invalidParams:e=>At(ht.errorCodes.rpc.invalidParams,e),methodNotFound:e=>At(ht.errorCodes.rpc.methodNotFound,e),internal:e=>At(ht.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return At(t,e)},invalidInput:e=>At(ht.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>At(ht.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>At(ht.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>At(ht.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>At(ht.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>At(ht.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>un(ht.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>un(ht.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>un(ht.errorCodes.provider.unsupportedMethod,e),disconnected:e=>un(ht.errorCodes.provider.disconnected,e),chainDisconnected:e=>un(ht.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Cs.EthereumProviderError(t,r,n)}}};function At(e,t){const[r,n]=Df(t);return new Cs.EthereumRpcError(e,r||kf.getMessageFromCode(e),n)}function un(e,t){const[r,n]=Df(t);return new Cs.EthereumProviderError(e,r||kf.getMessageFromCode(e),n)}function Df(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=_r;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=Ps;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=bi;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=br;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Ut);var Yd={exports:{}},go={exports:{}},it={ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Uint8Array},jf={exports:{}};(function(e){const t=x.bufferPolyfill,r=Object.getPrototypeOf(async function(){}).constructor,n=globalThis.Blob||t.Blob,i=typeof n<"u"?function(f){return f instanceof n}:function(f){return!1};class o extends Error{constructor(f){if(!Array.isArray(f))throw new TypeError(`Expected input to be an Array, got ${typeof f}`);let l="";for(let u=0;u<f.length;u++)l+=` ${f[u].stack}
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./index-qnIvXh1E.js"),co=require("./index-u0Rvcbvi.js");require("react");require("react-dom");var Os=In;In.default=In;In.stable=Bf;In.stableStringify=Bf;var oi="[...]",Lf="[Circular]",Or=[],Ar=[];function Nf(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function In(e,t,r,n){typeof n>"u"&&(n=Nf()),is(e,"",0,[],void 0,0,n);var i;try{Ar.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,$f(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Or.length!==0;){var o=Or.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function Wr(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),Or.push([n,r,t,i])):Ar.push([t,r,e]):(n[r]=e,Or.push([n,r,t]))}function is(e,t,r,n,i,o,s){o+=1;var f;if(typeof e=="object"&&e!==null){for(f=0;f<n.length;f++)if(n[f]===e){Wr(Lf,e,t,i);return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){Wr(oi,e,t,i);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){Wr(oi,e,t,i);return}if(n.push(e),Array.isArray(e))for(f=0;f<e.length;f++)is(e[f],f,f,n,e,o,s);else{var l=Object.keys(e);for(f=0;f<l.length;f++){var u=l[f];is(e[u],u,f,n,e,o,s)}}n.pop()}}function Md(e,t){return e<t?-1:e>t?1:0}function Bf(e,t,r,n){typeof n>"u"&&(n=Nf());var i=os(e,"",0,[],void 0,0,n)||e,o;try{Ar.length===0?o=JSON.stringify(i,t,r):o=JSON.stringify(i,$f(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Or.length!==0;){var s=Or.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return o}function os(e,t,r,n,i,o,s){o+=1;var f;if(typeof e=="object"&&e!==null){for(f=0;f<n.length;f++)if(n[f]===e){Wr(Lf,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){Wr(oi,e,t,i);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){Wr(oi,e,t,i);return}if(n.push(e),Array.isArray(e))for(f=0;f<e.length;f++)os(e[f],f,f,n,e,o,s);else{var l={},u=Object.keys(e).sort(Md);for(f=0;f<u.length;f++){var c=u[f];os(e[c],c,f,n,e,o,s),l[c]=e[c]}if(typeof i<"u")Or.push([i,t,e]),i[t]=l;else return l}n.pop()}}function $f(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(Ar.length>0)for(var n=0;n<Ar.length;n++){var i=Ar[n];if(i[1]===t&&i[0]===r){r=i[2],Ar.splice(n,1);break}}return e.call(this,t,r)}}const Ud=x.getDefaultExportFromCjs(Os);var Fd=Hd;function Hd(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const zd=x.getDefaultExportFromCjs(Fd),Br=x.getAugmentedNamespace(x.dist$2);var ss={exports:{}},ho,Ca;function Wd(){if(Ca)return ho;Ca=1;var e=1e3,t=e*60,r=t*60,n=r*24,i=n*7,o=n*365.25;ho=function(c,h){h=h||{};var m=typeof c;if(m==="string"&&c.length>0)return s(c);if(m==="number"&&isFinite(c))return h.long?l(c):f(c);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))};function s(c){if(c=String(c),!(c.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(h){var m=parseFloat(h[1]),y=(h[2]||"ms").toLowerCase();switch(y){case"years":case"year":case"yrs":case"yr":case"y":return m*o;case"weeks":case"week":case"w":return m*i;case"days":case"day":case"d":return m*n;case"hours":case"hour":case"hrs":case"hr":case"h":return m*r;case"minutes":case"minute":case"mins":case"min":case"m":return m*t;case"seconds":case"second":case"secs":case"sec":case"s":return m*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function f(c){var h=Math.abs(c);return h>=n?Math.round(c/n)+"d":h>=r?Math.round(c/r)+"h":h>=t?Math.round(c/t)+"m":h>=e?Math.round(c/e)+"s":c+"ms"}function l(c){var h=Math.abs(c);return h>=n?u(c,h,n,"day"):h>=r?u(c,h,r,"hour"):h>=t?u(c,h,t,"minute"):h>=e?u(c,h,e,"second"):c+" ms"}function u(c,h,m,y){var v=h>=m*1.5;return Math.round(c/m)+" "+y+(v?"s":"")}return ho}function Vd(e){r.debug=r,r.default=r,r.coerce=l,r.disable=o,r.enable=i,r.enabled=s,r.humanize=Wd(),r.destroy=u,Object.keys(e).forEach(c=>{r[c]=e[c]}),r.names=[],r.skips=[],r.formatters={};function t(c){let h=0;for(let m=0;m<c.length;m++)h=(h<<5)-h+c.charCodeAt(m),h|=0;return r.colors[Math.abs(h)%r.colors.length]}r.selectColor=t;function r(c){let h,m=null,y,v;function G(...M){if(!G.enabled)return;const j=G,E=Number(new Date),z=E-(h||E);j.diff=z,j.prev=h,j.curr=E,h=E,M[0]=r.coerce(M[0]),typeof M[0]!="string"&&M.unshift("%O");let R=0;M[0]=M[0].replace(/%([a-zA-Z%])/g,(k,U)=>{if(k==="%%")return"%";R++;const te=r.formatters[U];if(typeof te=="function"){const W=M[R];k=te.call(j,W),M.splice(R,1),R--}return k}),r.formatArgs.call(j,M),(j.log||r.log).apply(j,M)}return G.namespace=c,G.useColors=r.useColors(),G.color=r.selectColor(c),G.extend=n,G.destroy=r.destroy,Object.defineProperty(G,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(y!==r.namespaces&&(y=r.namespaces,v=r.enabled(c)),v),set:M=>{m=M}}),typeof r.init=="function"&&r.init(G),G}function n(c,h){const m=r(this.namespace+(typeof h>"u"?":":h)+c);return m.log=this.log,m}function i(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let h;const m=(typeof c=="string"?c:"").split(/[\s,]+/),y=m.length;for(h=0;h<y;h++)m[h]&&(c=m[h].replace(/\*/g,".*?"),c[0]==="-"?r.skips.push(new RegExp("^"+c.slice(1)+"$")):r.names.push(new RegExp("^"+c+"$")))}function o(){const c=[...r.names.map(f),...r.skips.map(f).map(h=>"-"+h)].join(",");return r.enable(""),c}function s(c){if(c[c.length-1]==="*")return!0;let h,m;for(h=0,m=r.skips.length;h<m;h++)if(r.skips[h].test(c))return!1;for(h=0,m=r.names.length;h<m;h++)if(r.names[h].test(c))return!0;return!1}function f(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}function l(c){return c instanceof Error?c.stack||c.message:c}function u(){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 r.enable(r.load()),r}var qd=Vd;(function(e,t){t.formatArgs=n,t.save=i,t.load=o,t.useColors=r,t.storage=s(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!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 n(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;l.splice(1,0,u,"color: inherit");let c=0,h=0;l[0].replace(/%[a-zA-Z%]/g,m=>{m!=="%%"&&(c++,m==="%c"&&(h=c))}),l.splice(h,0,u)}t.log=console.debug||console.log||(()=>{});function i(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function o(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof x.dist.process<"u"&&"env"in x.dist.process&&(l=x.dist.process.env.DEBUG),l}function s(){try{return localStorage}catch{}}e.exports=qd(t);const{formatters:f}=e.exports;f.j=function(l){try{return JSON.stringify(l)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(ss,ss.exports);var Gd=ss.exports,Ut={},_r={};Object.defineProperty(_r,"__esModule",{value:!0});_r.EthereumProviderError=_r.EthereumRpcError=void 0;const Zd=Os;class xf extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return Zd.default(this.serialize(),Xd,2)}}_r.EthereumRpcError=xf;let Kd=class extends xf{constructor(t,r,n){if(!Jd(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};_r.EthereumProviderError=Kd;function Jd(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function Xd(e,t){if(t!=="[Circular]")return t}var Ps={},br={};Object.defineProperty(br,"__esModule",{value:!0});br.errorValues=br.errorCodes=void 0;br.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};br.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=br,r=_r,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",o={code:n,message:s(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function s(m,y=i){if(Number.isInteger(m)){const v=m.toString();if(h(t.errorValues,v))return t.errorValues[v].message;if(u(m))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return y}e.getMessageFromCode=s;function f(m){if(!Number.isInteger(m))return!1;const y=m.toString();return!!(t.errorValues[y]||u(m))}e.isValidCode=f;function l(m,{fallbackError:y=o,shouldIncludeStack:v=!1}={}){var G,M;if(!y||!Number.isInteger(y.code)||typeof y.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(m instanceof r.EthereumRpcError)return m.serialize();const j={};if(m&&typeof m=="object"&&!Array.isArray(m)&&h(m,"code")&&f(m.code)){const z=m;j.code=z.code,z.message&&typeof z.message=="string"?(j.message=z.message,h(z,"data")&&(j.data=z.data)):(j.message=s(j.code),j.data={originalError:c(m)})}else{j.code=y.code;const z=(G=m)===null||G===void 0?void 0:G.message;j.message=z&&typeof z=="string"?z:y.message,j.data={originalError:c(m)}}const E=(M=m)===null||M===void 0?void 0:M.stack;return v&&m&&E&&typeof E=="string"&&(j.stack=E),j}e.serializeError=l;function u(m){return m>=-32099&&m<=-32e3}function c(m){return m&&typeof m=="object"&&!Array.isArray(m)?Object.assign({},m):m}function h(m,y){return Object.prototype.hasOwnProperty.call(m,y)}})(Ps);var bi={};Object.defineProperty(bi,"__esModule",{value:!0});bi.ethErrors=void 0;const Cs=_r,kf=Ps,ht=br;bi.ethErrors={rpc:{parse:e=>At(ht.errorCodes.rpc.parse,e),invalidRequest:e=>At(ht.errorCodes.rpc.invalidRequest,e),invalidParams:e=>At(ht.errorCodes.rpc.invalidParams,e),methodNotFound:e=>At(ht.errorCodes.rpc.methodNotFound,e),internal:e=>At(ht.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return At(t,e)},invalidInput:e=>At(ht.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>At(ht.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>At(ht.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>At(ht.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>At(ht.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>At(ht.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>un(ht.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>un(ht.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>un(ht.errorCodes.provider.unsupportedMethod,e),disconnected:e=>un(ht.errorCodes.provider.disconnected,e),chainDisconnected:e=>un(ht.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Cs.EthereumProviderError(t,r,n)}}};function At(e,t){const[r,n]=Df(t);return new Cs.EthereumRpcError(e,r||kf.getMessageFromCode(e),n)}function un(e,t){const[r,n]=Df(t);return new Cs.EthereumProviderError(e,r||kf.getMessageFromCode(e),n)}function Df(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=_r;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=Ps;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=bi;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=br;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Ut);var Yd={exports:{}},go={exports:{}},it={ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Uint8Array},jf={exports:{}};(function(e){const t=x.bufferPolyfill,r=Object.getPrototypeOf(async function(){}).constructor,n=globalThis.Blob||t.Blob,i=typeof n<"u"?function(f){return f instanceof n}:function(f){return!1};class o extends Error{constructor(f){if(!Array.isArray(f))throw new TypeError(`Expected input to be an Array, got ${typeof f}`);let l="";for(let u=0;u<f.length;u++)l+=` ${f[u].stack}
2
2
  `;super(l),this.name="AggregateError",this.errors=f}}e.exports={AggregateError:o,kEmptyObject:Object.freeze({}),once(s){let f=!1;return function(...l){f||(f=!0,s.apply(this,l))}},createDeferredPromise:function(){let s,f;return{promise:new Promise((u,c)=>{s=u,f=c}),resolve:s,reject:f}},promisify(s){return new Promise((f,l)=>{s((u,...c)=>u?l(u):f(...c))})},debuglog(){return function(){}},format(s,...f){return s.replace(/%([sdifj])/g,function(...[l,u]){const c=f.shift();return u==="f"?c.toFixed(6):u==="j"?JSON.stringify(c):u==="s"&&typeof c=="object"?`${c.constructor!==Object?c.constructor.name:""} {}`.trim():c.toString()})},inspect(s){switch(typeof s){case"string":if(s.includes("'"))if(s.includes('"')){if(!s.includes("`")&&!s.includes("${"))return`\`${s}\``}else return`"${s}"`;return`'${s}'`;case"number":return isNaN(s)?"NaN":Object.is(s,-0)?String(s):s;case"bigint":return`${String(s)}n`;case"boolean":case"undefined":return String(s);case"object":return"{}"}},types:{isAsyncFunction(s){return s instanceof r},isArrayBufferView(s){return ArrayBuffer.isView(s)}},isBlob:i},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(jf);var lr=jf.exports,Ls={},cn={exports:{}},La;function Ns(){if(La)return cn.exports;La=1;const{AbortController:e,AbortSignal:t}=typeof self<"u"?self:typeof window<"u"?window:void 0;return cn.exports=e,cn.exports.AbortSignal=t,cn.exports.default=e,cn.exports}const{format:Qd,inspect:si,AggregateError:eh}=lr,th=globalThis.AggregateError||eh,rh=Symbol("kIsNodeError"),nh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],ih=/^([A-Z][a-z0-9]*)+$/,oh="__node_internal_",pi={};function Tr(e,t){if(!e)throw new pi.ERR_INTERNAL_ASSERTION(t)}function Na(e){let t="",r=e.length;const n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function sh(e,t,r){if(typeof t=="function")return Tr(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const n=(t.match(/%[dfijoOs]/g)||[]).length;return Tr(n===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?t:Qd(t,...r)}function ct(e,t,r){r||(r=Error);class n extends r{constructor(...o){super(sh(e,t,o))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=e,n.prototype[rh]=!0,pi[e]=n}function Ba(e){const t=oh+e.name;return Object.defineProperty(e,"name",{value:t}),e}function ah(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new th([t,e],t.message);return r.code=t.code,r}return e||t}let lh=class extends Error{constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new pi.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}};ct("ERR_ASSERTION","%s",Error);ct("ERR_INVALID_ARG_TYPE",(e,t,r)=>{Tr(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";const i=[],o=[],s=[];for(const l of t)Tr(typeof l=="string","All expected entries have to be of type string"),nh.includes(l)?i.push(l.toLowerCase()):ih.test(l)?o.push(l):(Tr(l!=="object",'The value "object" should be written as "Object"'),s.push(l));if(o.length>0){const l=i.indexOf("object");l!==-1&&(i.splice(i,l,1),o.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{const l=i.pop();n+=`one of type ${i.join(", ")}, or ${l}`}}(o.length>0||s.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{const l=o.pop();n+=`an instance of ${o.join(", ")}, or ${l}`}}s.length>0&&(n+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(n+="an "),n+=`${s[0]}`;break;case 2:n+=`one of ${s[0]} or ${s[1]}`;break;default:{const l=s.pop();n+=`one of ${s.join(", ")}, or ${l}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var f;if((f=r.constructor)!==null&&f!==void 0&&f.name)n+=`. Received an instance of ${r.constructor.name}`;else{const l=si(r,{depth:-1});n+=`. Received ${l}`}}else{let l=si(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),n+=`. Received type ${typeof r} (${l})`}return n},TypeError);ct("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=si(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError);ct("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;const i=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${i}.`},TypeError);ct("ERR_MISSING_ARGS",(...e)=>{Tr(e.length>0,"At least one arg needs to be specified");let t;const r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(n=>`"${n}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}break}return`${t} must be specified`},TypeError);ct("ERR_OUT_OF_RANGE",(e,t,r)=>{Tr(t,'Missing "range" argument');let n;return Number.isInteger(r)&&Math.abs(r)>2**32?n=Na(String(r)):typeof r=="bigint"?(n=String(r),(r>2n**32n||r<-(2n**32n))&&(n=Na(n)),n+="n"):n=si(r),`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError);ct("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);ct("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);ct("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);ct("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);ct("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);ct("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ct("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);ct("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);ct("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);ct("ERR_STREAM_WRITE_AFTER_END","write after end",Error);ct("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);var Et={AbortError:lh,aggregateTwoErrors:Ba(ah),hideStackFrames:Ba,codes:pi};const{ArrayIsArray:Bs,ArrayPrototypeIncludes:Mf,ArrayPrototypeJoin:Uf,ArrayPrototypeMap:fh,NumberIsInteger:$s,NumberIsNaN:uh,NumberMAX_SAFE_INTEGER:ch,NumberMIN_SAFE_INTEGER:dh,NumberParseInt:hh,ObjectPrototypeHasOwnProperty:gh,RegExpPrototypeExec:Ff,String:_h,StringPrototypeToUpperCase:bh,StringPrototypeTrim:ph}=it,{hideStackFrames:Nt,codes:{ERR_SOCKET_BAD_PORT:yh,ERR_INVALID_ARG_TYPE:pt,ERR_INVALID_ARG_VALUE:rn,ERR_OUT_OF_RANGE:Pr,ERR_UNKNOWN_SIGNAL:$a}}=Et,{normalizeEncoding:wh}=lr,{isAsyncFunction:mh,isArrayBufferView:Eh}=lr.types,xa={};function vh(e){return e===(e|0)}function Sh(e){return e===e>>>0}const Rh=/^[0-7]+$/,Ah="must be a 32-bit unsigned integer or an octal string";function Ih(e,t,r){if(typeof e>"u"&&(e=r),typeof e=="string"){if(Ff(Rh,e)===null)throw new rn(t,e,Ah);e=hh(e,8)}return Hf(e,t),e}const Th=Nt((e,t,r=dh,n=ch)=>{if(typeof e!="number")throw new pt(t,"number",e);if(!$s(e))throw new Pr(t,"an integer",e);if(e<r||e>n)throw new Pr(t,`>= ${r} && <= ${n}`,e)}),Oh=Nt((e,t,r=-2147483648,n=2147483647)=>{if(typeof e!="number")throw new pt(t,"number",e);if(!$s(e))throw new Pr(t,"an integer",e);if(e<r||e>n)throw new Pr(t,`>= ${r} && <= ${n}`,e)}),Hf=Nt((e,t,r=!1)=>{if(typeof e!="number")throw new pt(t,"number",e);if(!$s(e))throw new Pr(t,"an integer",e);const n=r?1:0,i=4294967295;if(e<n||e>i)throw new Pr(t,`>= ${n} && <= ${i}`,e)});function xs(e,t){if(typeof e!="string")throw new pt(t,"string",e)}function Ph(e,t,r=void 0,n){if(typeof e!="number")throw new pt(t,"number",e);if(r!=null&&e<r||n!=null&&e>n||(r!=null||n!=null)&&uh(e))throw new Pr(t,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,e)}const Ch=Nt((e,t,r)=>{if(!Mf(r,e)){const i="must be one of: "+Uf(fh(r,o=>typeof o=="string"?`'${o}'`:_h(o)),", ");throw new rn(t,e,i)}});function zf(e,t){if(typeof e!="boolean")throw new pt(t,"boolean",e)}function _o(e,t,r){return e==null||!gh(e,t)?r:e[t]}const Lh=Nt((e,t,r=null)=>{const n=_o(r,"allowArray",!1),i=_o(r,"allowFunction",!1);if(!_o(r,"nullable",!1)&&e===null||!n&&Bs(e)||typeof e!="object"&&(!i||typeof e!="function"))throw new pt(t,"Object",e)}),Nh=Nt((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new pt(t,"a dictionary",e)}),ks=Nt((e,t,r=0)=>{if(!Bs(e))throw new pt(t,"Array",e);if(e.length<r){const n=`must be longer than ${r}`;throw new rn(t,e,n)}});function Bh(e,t){ks(e,t);for(let r=0;r<e.length;r++)xs(e[r],`${t}[${r}]`)}function $h(e,t){ks(e,t);for(let r=0;r<e.length;r++)zf(e[r],`${t}[${r}]`)}function xh(e,t="signal"){if(xs(e,t),xa[e]===void 0)throw xa[bh(e)]!==void 0?new $a(e+" (signals must use all capital letters)"):new $a(e)}const kh=Nt((e,t="buffer")=>{if(!Eh(e))throw new pt(t,["Buffer","TypedArray","DataView"],e)});function Dh(e,t){const r=wh(t),n=e.length;if(r==="hex"&&n%2!==0)throw new rn("encoding",t,`is invalid for data of length ${n}`)}function jh(e,t="Port",r=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&ph(e).length===0||+e!==+e>>>0||e>65535||e===0&&!r)throw new yh(t,e,r);return e|0}const Mh=Nt((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new pt(t,"AbortSignal",e)}),Uh=Nt((e,t)=>{if(typeof e!="function")throw new pt(t,"Function",e)}),Fh=Nt((e,t)=>{if(typeof e!="function"||mh(e))throw new pt(t,"Function",e)}),Hh=Nt((e,t)=>{if(e!==void 0)throw new pt(t,"undefined",e)});function zh(e,t,r){if(!Mf(r,e))throw new pt(t,`('${Uf(r,"|")}')`,e)}const Wh=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ka(e,t){if(typeof e>"u"||!Ff(Wh,e))throw new rn(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Vh(e){if(typeof e=="string")return ka(e,"hints"),e;if(Bs(e)){const t=e.length;let r="";if(t===0)return r;for(let n=0;n<t;n++){const i=e[n];ka(i,"hints"),r+=i,n!==t-1&&(r+=", ")}return r}throw new rn("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}var yi={isInt32:vh,isUint32:Sh,parseFileMode:Ih,validateArray:ks,validateStringArray:Bh,validateBooleanArray:$h,validateBoolean:zf,validateBuffer:kh,validateDictionary:Nh,validateEncoding:Dh,validateFunction:Uh,validateInt32:Oh,validateInteger:Th,validateNumber:Ph,validateObject:Lh,validateOneOf:Ch,validatePlainFunction:Fh,validatePort:jh,validateSignalName:xh,validateString:xs,validateUint32:Hf,validateUndefined:Hh,validateUnion:zh,validateAbortSignal:Mh,validateLinkHeaderValue:Vh},Ds={exports:{}};const{Symbol:wi,SymbolAsyncIterator:Da,SymbolIterator:ja,SymbolFor:Wf}=it,Vf=wi("kDestroyed"),qf=wi("kIsErrored"),as=wi("kIsReadable"),Gf=wi("kIsDisturbed"),qh=Wf("nodejs.webstream.isClosedPromise"),Gh=Wf("nodejs.webstream.controllerErrorFunction");function mi(e,t=!1){var r;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((r=e._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!e._writableState||e._readableState))}function Ei(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}function Zh(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}function Qt(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}function Zf(e){return!!(e&&!Qt(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}function Kf(e){return!!(e&&!Qt(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}function Jf(e){return!!(e&&!Qt(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}function Kh(e){return Zf(e)||Kf(e)||Jf(e)}function Jh(e,t){return e==null?!1:t===!0?typeof e[Da]=="function":t===!1?typeof e[ja]=="function":typeof e[Da]=="function"||typeof e[ja]=="function"}function vi(e){if(!Qt(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[Vf]||n!=null&&n.destroyed)}function Xf(e){if(!Ei(e))return null;if(e.writableEnded===!0)return!0;const t=e._writableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function Xh(e,t){if(!Ei(e))return null;if(e.writableFinished===!0)return!0;const r=e._writableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.finished)!="boolean"?null:!!(r.finished||t===!1&&r.ended===!0&&r.length===0)}function Yh(e){if(!mi(e))return null;if(e.readableEnded===!0)return!0;const t=e._readableState;return!t||t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function Yf(e,t){if(!mi(e))return null;const r=e._readableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.endEmitted)!="boolean"?null:!!(r.endEmitted||t===!1&&r.ended===!0&&r.length===0)}function Qf(e){return e&&e[as]!=null?e[as]:typeof(e==null?void 0:e.readable)!="boolean"?null:vi(e)?!1:mi(e)&&e.readable&&!Yf(e)}function eu(e){return typeof(e==null?void 0:e.writable)!="boolean"?null:vi(e)?!1:Ei(e)&&e.writable&&!Xf(e)}function Qh(e,t){return Qt(e)?vi(e)?!0:!((t==null?void 0:t.readable)!==!1&&Qf(e)||(t==null?void 0:t.writable)!==!1&&eu(e)):null}function eg(e){var t,r;return Qt(e)?e.writableErrored?e.writableErrored:(t=(r=e._writableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function tg(e){var t,r;return Qt(e)?e.readableErrored?e.readableErrored:(t=(r=e._readableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function rg(e){if(!Qt(e))return null;if(typeof e.closed=="boolean")return e.closed;const t=e._writableState,r=e._readableState;return typeof(t==null?void 0:t.closed)=="boolean"||typeof(r==null?void 0:r.closed)=="boolean"?(t==null?void 0:t.closed)||(r==null?void 0:r.closed):typeof e._closed=="boolean"&&tu(e)?e._closed:null}function tu(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}function ru(e){return typeof e._sent100=="boolean"&&tu(e)}function ng(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}function ig(e){if(!Qt(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!n&&ru(e)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function og(e){var t;return!!(e&&((t=e[Gf])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}function sg(e){var t,r,n,i,o,s,f,l,u,c;return!!(e&&((t=(r=(n=(i=(o=(s=e[qf])!==null&&s!==void 0?s:e.readableErrored)!==null&&o!==void 0?o:e.writableErrored)!==null&&i!==void 0?i:(f=e._readableState)===null||f===void 0?void 0:f.errorEmitted)!==null&&n!==void 0?n:(l=e._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(u=e._readableState)===null||u===void 0?void 0:u.errored)!==null&&t!==void 0?t:!((c=e._writableState)===null||c===void 0)&&c.errored))}var fr={kDestroyed:Vf,isDisturbed:og,kIsDisturbed:Gf,isErrored:sg,kIsErrored:qf,isReadable:Qf,kIsReadable:as,kIsClosedPromise:qh,kControllerErrorFunction:Gh,isClosed:rg,isDestroyed:vi,isDuplexNodeStream:Zh,isFinished:Qh,isIterable:Jh,isReadableNodeStream:mi,isReadableStream:Zf,isReadableEnded:Yh,isReadableFinished:Yf,isReadableErrored:tg,isNodeStream:Qt,isWebStream:Kh,isWritable:eu,isWritableNodeStream:Ei,isWritableStream:Kf,isWritableEnded:Xf,isWritableFinished:Xh,isWritableErrored:eg,isServerRequest:ng,isServerResponse:ru,willEmitClose:ig,isTransformStream:Jf};const dr=x.browserExports,{AbortError:nu,codes:ag}=Et,{ERR_INVALID_ARG_TYPE:lg,ERR_STREAM_PREMATURE_CLOSE:Ma}=ag,{kEmptyObject:ls,once:fs}=lr,{validateAbortSignal:fg,validateFunction:ug,validateObject:cg,validateBoolean:dg}=yi,{Promise:hg,PromisePrototypeThen:gg}=it,{isClosed:_g,isReadable:Ua,isReadableNodeStream:bo,isReadableStream:bg,isReadableFinished:Fa,isReadableErrored:Ha,isWritable:za,isWritableNodeStream:Wa,isWritableStream:pg,isWritableFinished:Va,isWritableErrored:qa,isNodeStream:yg,willEmitClose:wg,kIsClosedPromise:mg}=fr;function Eg(e){return e.setHeader&&typeof e.abort=="function"}const us=()=>{};function iu(e,t,r){var n,i;if(arguments.length===2?(r=t,t=ls):t==null?t=ls:cg(t,"options"),ug(r,"callback"),fg(t.signal,"options.signal"),r=fs(r),bg(e)||pg(e))return vg(e,t,r);if(!yg(e))throw new lg("stream",["ReadableStream","WritableStream","Stream"],e);const o=(n=t.readable)!==null&&n!==void 0?n:bo(e),s=(i=t.writable)!==null&&i!==void 0?i:Wa(e),f=e._writableState,l=e._readableState,u=()=>{e.writable||m()};let c=wg(e)&&bo(e)===o&&Wa(e)===s,h=Va(e,!1);const m=()=>{h=!0,e.destroyed&&(c=!1),!(c&&(!e.readable||o))&&(!o||y)&&r.call(e)};let y=Fa(e,!1);const v=()=>{y=!0,e.destroyed&&(c=!1),!(c&&(!e.writable||s))&&(!s||h)&&r.call(e)},G=q=>{r.call(e,q)};let M=_g(e);const j=()=>{M=!0;const q=qa(e)||Ha(e);if(q&&typeof q!="boolean")return r.call(e,q);if(o&&!y&&bo(e,!0)&&!Fa(e,!1))return r.call(e,new Ma);if(s&&!h&&!Va(e,!1))return r.call(e,new Ma);r.call(e)},E=()=>{M=!0;const q=qa(e)||Ha(e);if(q&&typeof q!="boolean")return r.call(e,q);r.call(e)},z=()=>{e.req.on("finish",m)};Eg(e)?(e.on("complete",m),c||e.on("abort",j),e.req?z():e.on("request",z)):s&&!f&&(e.on("end",u),e.on("close",u)),!c&&typeof e.aborted=="boolean"&&e.on("aborted",j),e.on("end",v),e.on("finish",m),t.error!==!1&&e.on("error",G),e.on("close",j),M?dr.nextTick(j):f!=null&&f.errorEmitted||l!=null&&l.errorEmitted?c||dr.nextTick(E):(!o&&(!c||Ua(e))&&(h||za(e)===!1)||!s&&(!c||za(e))&&(y||Ua(e)===!1)||l&&e.req&&e.aborted)&&dr.nextTick(E);const R=()=>{r=us,e.removeListener("aborted",j),e.removeListener("complete",m),e.removeListener("abort",j),e.removeListener("request",z),e.req&&e.req.removeListener("finish",m),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",m),e.removeListener("end",v),e.removeListener("error",G),e.removeListener("close",j)};if(t.signal&&!M){const q=()=>{const k=r;R(),k.call(e,new nu(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)dr.nextTick(q);else{const k=r;r=fs((...U)=>{t.signal.removeEventListener("abort",q),k.apply(e,U)}),t.signal.addEventListener("abort",q)}}return R}function vg(e,t,r){let n=!1,i=us;if(t.signal)if(i=()=>{n=!0,r.call(e,new nu(void 0,{cause:t.signal.reason}))},t.signal.aborted)dr.nextTick(i);else{const s=r;r=fs((...f)=>{t.signal.removeEventListener("abort",i),s.apply(e,f)}),t.signal.addEventListener("abort",i)}const o=(...s)=>{n||dr.nextTick(()=>r.apply(e,s))};return gg(e[mg].promise,o,o),us}function Sg(e,t){var r;let n=!1;return t===null&&(t=ls),(r=t)!==null&&r!==void 0&&r.cleanup&&(dg(t.cleanup,"cleanup"),n=t.cleanup),new hg((i,o)=>{const s=iu(e,t,f=>{n&&s(),f?o(f):i()})})}Ds.exports=iu;Ds.exports.finished=Sg;var yr=Ds.exports;const Jt=x.browserExports,{aggregateTwoErrors:Rg,codes:{ERR_MULTIPLE_CALLBACK:Ag},AbortError:Ig}=Et,{Symbol:ou}=it,{kDestroyed:Tg,isDestroyed:Og,isFinished:Pg,isServerRequest:Cg}=fr,su=ou("kDestroy"),cs=ou("kConstruct");function au(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function Lg(e,t){const r=this._readableState,n=this._writableState,i=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof t=="function"&&t(),this):(au(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?Ga(this,e,t):this.once(su,function(o){Ga(this,Rg(o,e),t)}),this)}function Ga(e,t,r){let n=!1;function i(o){if(n)return;n=!0;const s=e._readableState,f=e._writableState;au(o,f,s),f&&(f.closed=!0),s&&(s.closed=!0),typeof r=="function"&&r(o),o?Jt.nextTick(Ng,e,o):Jt.nextTick(lu,e)}try{e._destroy(t||null,i)}catch(o){i(o)}}function Ng(e,t){ds(e,t),lu(e)}function lu(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(r!=null&&r.emitClose||t!=null&&t.emitClose)&&e.emit("close")}function ds(e,t){const r=e._readableState,n=e._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function Bg(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function hs(e,t,r){const n=e._readableState,i=e._writableState;if(i!=null&&i.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||i!=null&&i.autoDestroy?e.destroy(t):t&&(t.stack,i&&!i.errored&&(i.errored=t),n&&!n.errored&&(n.errored=t),r?Jt.nextTick(ds,e,t):ds(e,t))}function $g(e,t){if(typeof e._construct!="function")return;const r=e._readableState,n=e._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),e.once(cs,t),!(e.listenerCount(cs)>1)&&Jt.nextTick(xg,e)}function xg(e){let t=!1;function r(n){if(t){hs(e,n??new Ag);return}t=!0;const i=e._readableState,o=e._writableState,s=o||i;i&&(i.constructed=!0),o&&(o.constructed=!0),s.destroyed?e.emit(su,n):n?hs(e,n,!0):Jt.nextTick(kg,e)}try{e._construct(n=>{Jt.nextTick(r,n)})}catch(n){Jt.nextTick(r,n)}}function kg(e){e.emit(cs)}function Za(e){return(e==null?void 0:e.setHeader)&&typeof e.abort=="function"}function fu(e){e.emit("close")}function Dg(e,t){e.emit("error",t),Jt.nextTick(fu,e)}function jg(e,t){!e||Og(e)||(!t&&!Pg(e)&&(t=new Ig),Cg(e)?(e.socket=null,e.destroy(t)):Za(e)?e.abort():Za(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?Jt.nextTick(Dg,e,t):Jt.nextTick(fu,e),e.destroyed||(e[Tg]=!0))}var nn={construct:$g,destroyer:jg,destroy:Lg,undestroy:Bg,errorOrDestroy:hs};const{ArrayIsArray:Mg,ObjectSetPrototypeOf:uu}=it,{EventEmitter:Si}=x.eventsExports;function Ri(e){Si.call(this,e)}uu(Ri.prototype,Si.prototype);uu(Ri,Si);Ri.prototype.pipe=function(e,t){const r=this;function n(c){e.writable&&e.write(c)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}e.on("drain",i),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",s),r.on("close",f));let o=!1;function s(){o||(o=!0,e.end())}function f(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}function l(c){u(),Si.listenerCount(this,"error")===0&&this.emit("error",c)}gs(r,"error",l),gs(e,"error",l);function u(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",f),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",u),r.removeListener("close",u),e.removeListener("close",u)}return r.on("end",u),r.on("close",u),e.on("close",u),e.emit("pipe",r),e};function gs(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Mg(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}var js={Stream:Ri,prependListener:gs},cu={exports:{}};(function(e){const{AbortError:t,codes:r}=Et,{isNodeStream:n,isWebStream:i,kControllerErrorFunction:o}=fr,s=yr,{ERR_INVALID_ARG_TYPE:f}=r,l=(u,c)=>{if(typeof u!="object"||!("aborted"in u))throw new f(c,"AbortSignal",u)};e.exports.addAbortSignal=function(c,h){if(l(c,"signal"),!n(h)&&!i(h))throw new f("stream",["ReadableStream","WritableStream","Stream"],h);return e.exports.addAbortSignalNoValidate(c,h)},e.exports.addAbortSignalNoValidate=function(u,c){if(typeof u!="object"||!("aborted"in u))return c;const h=n(c)?()=>{c.destroy(new t(void 0,{cause:u.reason}))}:()=>{c[o](new t(void 0,{cause:u.reason}))};return u.aborted?h():(u.addEventListener("abort",h),s(c,()=>u.removeEventListener("abort",h))),c}})(cu);var Ai=cu.exports;const{StringPrototypeSlice:Ka,SymbolIterator:Ug,TypedArrayPrototypeSet:Wn,Uint8Array:Fg}=it,{Buffer:po}=x.bufferPolyfill,{inspect:Hg}=lr;var zg=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){const r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){const r={data:t,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;const t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=t+r.data;return n}concat(t){if(this.length===0)return po.alloc(0);const r=po.allocUnsafe(t>>>0);let n=this.head,i=0;for(;n;)Wn(r,n.data,i),i+=n.data.length,n=n.next;return r}consume(t,r){const n=this.head.data;if(t<n.length){const i=n.slice(0,t);return this.head.data=n.slice(t),i}return t===n.length?this.shift():r?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[Ug](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let r="",n=this.head,i=0;do{const o=n.data;if(t>o.length)r+=o,t-=o.length;else{t===o.length?(r+=o,++i,n.next?this.head=n.next:this.head=this.tail=null):(r+=Ka(o,0,t),this.head=n,n.data=Ka(o,t));break}++i}while((n=n.next)!==null);return this.length-=i,r}_getBuffer(t){const r=po.allocUnsafe(t),n=t;let i=this.head,o=0;do{const s=i.data;if(t>s.length)Wn(r,s,n-t),t-=s.length;else{t===s.length?(Wn(r,s,n-t),++o,i.next?this.head=i.next:this.head=this.tail=null):(Wn(r,new Fg(s.buffer,s.byteOffset,t),n-t),this.head=i,i.data=s.slice(t));break}++o}while((i=i.next)!==null);return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return Hg(this,{...r,depth:0,customInspect:!1})}};const{MathFloor:Wg,NumberIsInteger:Vg}=it,{ERR_INVALID_ARG_VALUE:qg}=Et.codes;function Gg(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function du(e){return e?16:16*1024}function Zg(e,t,r,n){const i=Gg(t,n,r);if(i!=null){if(!Vg(i)||i<0){const o=n?`options.${r}`:"options.highWaterMark";throw new qg(o,i)}return Wg(i)}return du(e.objectMode)}var Ms={getHighWaterMark:Zg,getDefaultHighWaterMark:du};const Ja=x.browserExports,{PromisePrototypeThen:Kg,SymbolAsyncIterator:Xa,SymbolIterator:Ya}=it,{Buffer:Jg}=x.bufferPolyfill,{ERR_INVALID_ARG_TYPE:Xg,ERR_STREAM_NULL_VALUES:Yg}=Et.codes;function Qg(e,t,r){let n;if(typeof t=="string"||t instanceof Jg)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});let i;if(t&&t[Xa])i=!0,n=t[Xa]();else if(t&&t[Ya])i=!1,n=t[Ya]();else throw new Xg("iterable",["Iterable"],t);const o=new e({objectMode:!0,highWaterMark:1,...r});let s=!1;o._read=function(){s||(s=!0,l())},o._destroy=function(u,c){Kg(f(u),()=>Ja.nextTick(c,u),h=>Ja.nextTick(c,h||u))};async function f(u){const c=u!=null,h=typeof n.throw=="function";if(c&&h){const{value:m,done:y}=await n.throw(u);if(await m,y)return}if(typeof n.return=="function"){const{value:m}=await n.return();await m}}async function l(){for(;;){try{const{value:u,done:c}=i?await n.next():n.next();if(c)o.push(null);else{const h=u&&typeof u.then=="function"?await u:u;if(h===null)throw s=!1,new Yg;if(o.push(h))continue;s=!1}}catch(u){o.destroy(u)}break}}return o}var hu=Qg,yo,Qa;function Ii(){if(Qa)return yo;Qa=1;const e=x.browserExports,{ArrayPrototypeIndexOf:t,NumberIsInteger:r,NumberIsNaN:n,NumberParseInt:i,ObjectDefineProperties:o,ObjectKeys:s,ObjectSetPrototypeOf:f,Promise:l,SafeSet:u,SymbolAsyncIterator:c,Symbol:h}=it;yo=O,O.ReadableState=N;const{EventEmitter:m}=x.eventsExports,{Stream:y,prependListener:v}=js,{Buffer:G}=x.bufferPolyfill,{addAbortSignal:M}=Ai,j=yr;let E=lr.debuglog("stream",S=>{E=S});const z=zg,R=nn,{getHighWaterMark:q,getDefaultHighWaterMark:k}=Ms,{aggregateTwoErrors:U,codes:{ERR_INVALID_ARG_TYPE:te,ERR_METHOD_NOT_IMPLEMENTED:W,ERR_OUT_OF_RANGE:P,ERR_STREAM_PUSH_AFTER_EOF:Z,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:_}}=Et,{validateObject:p}=yi,b=h("kPaused"),{StringDecoder:B}=x.requireString_decoder(),V=hu;f(O.prototype,y.prototype),f(O,y);const L=()=>{},{errorOrDestroy:D}=R;function N(S,I,he){typeof he!="boolean"&&(he=I instanceof or()),this.objectMode=!!(S&&S.objectMode),he&&(this.objectMode=this.objectMode||!!(S&&S.readableObjectMode)),this.highWaterMark=S?q(this,S,"readableHighWaterMark",he):k(!1),this.buffer=new z,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[b]=null,this.errorEmitted=!1,this.emitClose=!S||S.emitClose!==!1,this.autoDestroy=!S||S.autoDestroy!==!1,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=S&&S.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,S&&S.encoding&&(this.decoder=new B(S.encoding),this.encoding=S.encoding)}function O(S){if(!(this instanceof O))return new O(S);const I=this instanceof or();this._readableState=new N(S,this,I),S&&(typeof S.read=="function"&&(this._read=S.read),typeof S.destroy=="function"&&(this._destroy=S.destroy),typeof S.construct=="function"&&(this._construct=S.construct),S.signal&&!I&&M(S.signal,this)),y.call(this,S),R.construct(this,()=>{this._readableState.needReadable&&pe(this,this._readableState)})}O.prototype.destroy=R.destroy,O.prototype._undestroy=R.undestroy,O.prototype._destroy=function(S,I){I(S)},O.prototype[m.captureRejectionSymbol]=function(S){this.destroy(S)},O.prototype.push=function(S,I){return X(this,S,I,!1)},O.prototype.unshift=function(S,I){return X(this,S,I,!0)};function X(S,I,he,le){E("readableAddChunk",I);const ye=S._readableState;let je;if(ye.objectMode||(typeof I=="string"?(he=he||ye.defaultEncoding,ye.encoding!==he&&(le&&ye.encoding?I=G.from(I,he).toString(ye.encoding):(I=G.from(I,he),he=""))):I instanceof G?he="":y._isUint8Array(I)?(I=y._uint8ArrayToBuffer(I),he=""):I!=null&&(je=new te("chunk",["string","Buffer","Uint8Array"],I))),je)D(S,je);else if(I===null)ye.reading=!1,ge(S,ye);else if(ye.objectMode||I&&I.length>0)if(le)if(ye.endEmitted)D(S,new _);else{if(ye.destroyed||ye.errored)return!1;ie(S,ye,I,!0)}else if(ye.ended)D(S,new Z);else{if(ye.destroyed||ye.errored)return!1;ye.reading=!1,ye.decoder&&!he?(I=ye.decoder.write(I),ye.objectMode||I.length!==0?ie(S,ye,I,!1):pe(S,ye)):ie(S,ye,I,!1)}else le||(ye.reading=!1,pe(S,ye));return!ye.ended&&(ye.length<ye.highWaterMark||ye.length===0)}function ie(S,I,he,le){I.flowing&&I.length===0&&!I.sync&&S.listenerCount("data")>0?(I.multiAwaitDrain?I.awaitDrainWriters.clear():I.awaitDrainWriters=null,I.dataEmitted=!0,S.emit("data",he)):(I.length+=I.objectMode?1:he.length,le?I.buffer.unshift(he):I.buffer.push(he),I.needReadable&&Se(S)),pe(S,I)}O.prototype.isPaused=function(){const S=this._readableState;return S[b]===!0||S.flowing===!1},O.prototype.setEncoding=function(S){const I=new B(S);this._readableState.decoder=I,this._readableState.encoding=this._readableState.decoder.encoding;const he=this._readableState.buffer;let le="";for(const ye of he)le+=I.write(ye);return he.clear(),le!==""&&he.push(le),this._readableState.length=le.length,this};const ne=1073741824;function ae(S){if(S>ne)throw new P("size","<= 1GiB",S);return S--,S|=S>>>1,S|=S>>>2,S|=S>>>4,S|=S>>>8,S|=S>>>16,S++,S}function de(S,I){return S<=0||I.length===0&&I.ended?0:I.objectMode?1:n(S)?I.flowing&&I.length?I.buffer.first().length:I.length:S<=I.length?S:I.ended?I.length:0}O.prototype.read=function(S){E("read",S),S===void 0?S=NaN:r(S)||(S=i(S,10));const I=this._readableState,he=S;if(S>I.highWaterMark&&(I.highWaterMark=ae(S)),S!==0&&(I.emittedReadable=!1),S===0&&I.needReadable&&((I.highWaterMark!==0?I.length>=I.highWaterMark:I.length>0)||I.ended))return E("read: emitReadable",I.length,I.ended),I.length===0&&I.ended?Ne(this):Se(this),null;if(S=de(S,I),S===0&&I.ended)return I.length===0&&Ne(this),null;let le=I.needReadable;if(E("need readable",le),(I.length===0||I.length-S<I.highWaterMark)&&(le=!0,E("length less than watermark",le)),I.ended||I.reading||I.destroyed||I.errored||!I.constructed)le=!1,E("reading, ended or constructing",le);else if(le){E("do read"),I.reading=!0,I.sync=!0,I.length===0&&(I.needReadable=!0);try{this._read(I.highWaterMark)}catch(je){D(this,je)}I.sync=!1,I.reading||(S=de(he,I))}let ye;return S>0?ye=Ie(S,I):ye=null,ye===null?(I.needReadable=I.length<=I.highWaterMark,S=0):(I.length-=S,I.multiAwaitDrain?I.awaitDrainWriters.clear():I.awaitDrainWriters=null),I.length===0&&(I.ended||(I.needReadable=!0),he!==S&&I.ended&&Ne(this)),ye!==null&&!I.errorEmitted&&!I.closeEmitted&&(I.dataEmitted=!0,this.emit("data",ye)),ye};function ge(S,I){if(E("onEofChunk"),!I.ended){if(I.decoder){const he=I.decoder.end();he&&he.length&&(I.buffer.push(he),I.length+=I.objectMode?1:he.length)}I.ended=!0,I.sync?Se(S):(I.needReadable=!1,I.emittedReadable=!0,_e(S))}}function Se(S){const I=S._readableState;E("emitReadable",I.needReadable,I.emittedReadable),I.needReadable=!1,I.emittedReadable||(E("emitReadable",I.flowing),I.emittedReadable=!0,e.nextTick(_e,S))}function _e(S){const I=S._readableState;E("emitReadable_",I.destroyed,I.length,I.ended),!I.destroyed&&!I.errored&&(I.length||I.ended)&&(S.emit("readable"),I.emittedReadable=!1),I.needReadable=!I.flowing&&!I.ended&&I.length<=I.highWaterMark,ce(S)}function pe(S,I){!I.readingMore&&I.constructed&&(I.readingMore=!0,e.nextTick(Oe,S,I))}function Oe(S,I){for(;!I.reading&&!I.ended&&(I.length<I.highWaterMark||I.flowing&&I.length===0);){const he=I.length;if(E("maybeReadMore read 0"),S.read(0),he===I.length)break}I.readingMore=!1}O.prototype._read=function(S){throw new W("_read()")},O.prototype.pipe=function(S,I){const he=this,le=this._readableState;le.pipes.length===1&&(le.multiAwaitDrain||(le.multiAwaitDrain=!0,le.awaitDrainWriters=new u(le.awaitDrainWriters?[le.awaitDrainWriters]:[]))),le.pipes.push(S),E("pipe count=%d opts=%j",le.pipes.length,I);const je=(!I||I.end!==!1)&&S!==e.stdout&&S!==e.stderr?oe:Y;le.endEmitted?e.nextTick(je):he.once("end",je),S.on("unpipe",w);function w(Q,g){E("onunpipe"),Q===he&&g&&g.hasUnpiped===!1&&(g.hasUnpiped=!0,F())}function oe(){E("onend"),S.end()}let ue,we=!1;function F(){E("cleanup"),S.removeListener("close",Ae),S.removeListener("finish",a),ue&&S.removeListener("drain",ue),S.removeListener("error",fe),S.removeListener("unpipe",w),he.removeListener("end",oe),he.removeListener("end",Y),he.removeListener("data",d),we=!0,ue&&le.awaitDrainWriters&&(!S._writableState||S._writableState.needDrain)&&ue()}function re(){we||(le.pipes.length===1&&le.pipes[0]===S?(E("false write response, pause",0),le.awaitDrainWriters=S,le.multiAwaitDrain=!1):le.pipes.length>1&&le.pipes.includes(S)&&(E("false write response, pause",le.awaitDrainWriters.size),le.awaitDrainWriters.add(S)),he.pause()),ue||(ue=Pe(he,S),S.on("drain",ue))}he.on("data",d);function d(Q){E("ondata");const g=S.write(Q);E("dest.write",g),g===!1&&re()}function fe(Q){if(E("onerror",Q),Y(),S.removeListener("error",fe),S.listenerCount("error")===0){const g=S._writableState||S._readableState;g&&!g.errorEmitted?D(S,Q):S.emit("error",Q)}}v(S,"error",fe);function Ae(){S.removeListener("finish",a),Y()}S.once("close",Ae);function a(){E("onfinish"),S.removeListener("close",Ae),Y()}S.once("finish",a);function Y(){E("unpipe"),he.unpipe(S)}return S.emit("pipe",he),S.writableNeedDrain===!0?le.flowing&&re():le.flowing||(E("pipe resume"),he.resume()),S};function Pe(S,I){return function(){const le=S._readableState;le.awaitDrainWriters===I?(E("pipeOnDrain",1),le.awaitDrainWriters=null):le.multiAwaitDrain&&(E("pipeOnDrain",le.awaitDrainWriters.size),le.awaitDrainWriters.delete(I)),(!le.awaitDrainWriters||le.awaitDrainWriters.size===0)&&S.listenerCount("data")&&S.resume()}}O.prototype.unpipe=function(S){const I=this._readableState,he={hasUnpiped:!1};if(I.pipes.length===0)return this;if(!S){const ye=I.pipes;I.pipes=[],this.pause();for(let je=0;je<ye.length;je++)ye[je].emit("unpipe",this,{hasUnpiped:!1});return this}const le=t(I.pipes,S);return le===-1?this:(I.pipes.splice(le,1),I.pipes.length===0&&this.pause(),S.emit("unpipe",this,he),this)},O.prototype.on=function(S,I){const he=y.prototype.on.call(this,S,I),le=this._readableState;return S==="data"?(le.readableListening=this.listenerCount("readable")>0,le.flowing!==!1&&this.resume()):S==="readable"&&!le.endEmitted&&!le.readableListening&&(le.readableListening=le.needReadable=!0,le.flowing=!1,le.emittedReadable=!1,E("on readable",le.length,le.reading),le.length?Se(this):le.reading||e.nextTick(T,this)),he},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(S,I){const he=y.prototype.removeListener.call(this,S,I);return S==="readable"&&e.nextTick(Te,this),he},O.prototype.off=O.prototype.removeListener,O.prototype.removeAllListeners=function(S){const I=y.prototype.removeAllListeners.apply(this,arguments);return(S==="readable"||S===void 0)&&e.nextTick(Te,this),I};function Te(S){const I=S._readableState;I.readableListening=S.listenerCount("readable")>0,I.resumeScheduled&&I[b]===!1?I.flowing=!0:S.listenerCount("data")>0?S.resume():I.readableListening||(I.flowing=null)}function T(S){E("readable nexttick read 0"),S.read(0)}O.prototype.resume=function(){const S=this._readableState;return S.flowing||(E("resume"),S.flowing=!S.readableListening,C(this,S)),S[b]=!1,this};function C(S,I){I.resumeScheduled||(I.resumeScheduled=!0,e.nextTick(K,S,I))}function K(S,I){E("resume",I.reading),I.reading||S.read(0),I.resumeScheduled=!1,S.emit("resume"),ce(S),I.flowing&&!I.reading&&S.read(0)}O.prototype.pause=function(){return E("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(E("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[b]=!0,this};function ce(S){const I=S._readableState;for(E("flow",I.flowing);I.flowing&&S.read()!==null;);}O.prototype.wrap=function(S){let I=!1;S.on("data",le=>{!this.push(le)&&S.pause&&(I=!0,S.pause())}),S.on("end",()=>{this.push(null)}),S.on("error",le=>{D(this,le)}),S.on("close",()=>{this.destroy()}),S.on("destroy",()=>{this.destroy()}),this._read=()=>{I&&S.resume&&(I=!1,S.resume())};const he=s(S);for(let le=1;le<he.length;le++){const ye=he[le];this[ye]===void 0&&typeof S[ye]=="function"&&(this[ye]=S[ye].bind(S))}return this},O.prototype[c]=function(){return se(this)},O.prototype.iterator=function(S){return S!==void 0&&p(S,"options"),se(this,S)};function se(S,I){typeof S.read!="function"&&(S=O.wrap(S,{objectMode:!0}));const he=be(S,I);return he.stream=S,he}async function*be(S,I){let he=L;function le(w){this===S?(he(),he=L):he=w}S.on("readable",le);let ye;const je=j(S,{writable:!1},w=>{ye=w?U(ye,w):null,he(),he=L});try{for(;;){const w=S.destroyed?null:S.read();if(w!==null)yield w;else{if(ye)throw ye;if(ye===null)return;await new l(le)}}}catch(w){throw ye=U(ye,w),ye}finally{(ye||(I==null?void 0:I.destroyOnReturn)!==!1)&&(ye===void 0||S._readableState.autoDestroy)?R.destroyer(S,null):(S.off("readable",le),je())}}o(O.prototype,{readable:{__proto__:null,get(){const S=this._readableState;return!!S&&S.readable!==!1&&!S.destroyed&&!S.errorEmitted&&!S.endEmitted},set(S){this._readableState&&(this._readableState.readable=!!S)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(S){this._readableState&&(this._readableState.flowing=S)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(S){this._readableState&&(this._readableState.destroyed=S)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),o(N.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[b]!==!1},set(S){this[b]=!!S}}}),O._fromList=Ie;function Ie(S,I){if(I.length===0)return null;let he;return I.objectMode?he=I.buffer.shift():!S||S>=I.length?(I.decoder?he=I.buffer.join(""):I.buffer.length===1?he=I.buffer.first():he=I.buffer.concat(I.length),I.buffer.clear()):he=I.buffer.consume(S,I.decoder),he}function Ne(S){const I=S._readableState;E("endReadable",I.endEmitted),I.endEmitted||(I.ended=!0,e.nextTick(He,I,S))}function He(S,I){if(E("endReadableNT",S.endEmitted,S.length),!S.errored&&!S.closeEmitted&&!S.endEmitted&&S.length===0){if(S.endEmitted=!0,I.emit("end"),I.writable&&I.allowHalfOpen===!1)e.nextTick(Ue,I);else if(S.autoDestroy){const he=I._writableState;(!he||he.autoDestroy&&(he.finished||he.writable===!1))&&I.destroy()}}}function Ue(S){S.writable&&!S.writableEnded&&!S.destroyed&&S.end()}O.from=function(S,I){return V(O,S,I)};let De;function tt(){return De===void 0&&(De={}),De}return O.fromWeb=function(S,I){return tt().newStreamReadableFromReadableStream(S,I)},O.toWeb=function(S,I){return tt().newReadableStreamFromStreamReadable(S,I)},O.wrap=function(S,I){var he,le;return new O({objectMode:(he=(le=S.readableObjectMode)!==null&&le!==void 0?le:S.objectMode)!==null&&he!==void 0?he:!0,...I,destroy(ye,je){R.destroyer(S,ye),je(ye)}}).wrap(S)},yo}var wo,el;function gu(){if(el)return wo;el=1;const e=x.browserExports,{ArrayPrototypeSlice:t,Error:r,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:i,ObjectDefineProperties:o,ObjectSetPrototypeOf:s,StringPrototypeToLowerCase:f,Symbol:l,SymbolHasInstance:u}=it;wo=B,B.WritableState=p;const{EventEmitter:c}=x.eventsExports,h=js.Stream,{Buffer:m}=x.bufferPolyfill,y=nn,{addAbortSignal:v}=Ai,{getHighWaterMark:G,getDefaultHighWaterMark:M}=Ms,{ERR_INVALID_ARG_TYPE:j,ERR_METHOD_NOT_IMPLEMENTED:E,ERR_MULTIPLE_CALLBACK:z,ERR_STREAM_CANNOT_PIPE:R,ERR_STREAM_DESTROYED:q,ERR_STREAM_ALREADY_FINISHED:k,ERR_STREAM_NULL_VALUES:U,ERR_STREAM_WRITE_AFTER_END:te,ERR_UNKNOWN_ENCODING:W}=Et.codes,{errorOrDestroy:P}=y;s(B.prototype,h.prototype),s(B,h);function Z(){}const _=l("kOnFinished");function p(T,C,K){typeof K!="boolean"&&(K=C instanceof or()),this.objectMode=!!(T&&T.objectMode),K&&(this.objectMode=this.objectMode||!!(T&&T.writableObjectMode)),this.highWaterMark=T?G(this,T,"writableHighWaterMark",K):M(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ce=!!(T&&T.decodeStrings===!1);this.decodeStrings=!ce,this.defaultEncoding=T&&T.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=O.bind(void 0,C),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,b(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!T||T.emitClose!==!1,this.autoDestroy=!T||T.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[_]=[]}function b(T){T.buffered=[],T.bufferedIndex=0,T.allBuffers=!0,T.allNoop=!0}p.prototype.getBuffer=function(){return t(this.buffered,this.bufferedIndex)},i(p.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function B(T){const C=this instanceof or();if(!C&&!n(B,this))return new B(T);this._writableState=new p(T,this,C),T&&(typeof T.write=="function"&&(this._write=T.write),typeof T.writev=="function"&&(this._writev=T.writev),typeof T.destroy=="function"&&(this._destroy=T.destroy),typeof T.final=="function"&&(this._final=T.final),typeof T.construct=="function"&&(this._construct=T.construct),T.signal&&v(T.signal,this)),h.call(this,T),y.construct(this,()=>{const K=this._writableState;K.writing||ae(this,K),_e(this,K)})}i(B,u,{__proto__:null,value:function(T){return n(this,T)?!0:this!==B?!1:T&&T._writableState instanceof p}}),B.prototype.pipe=function(){P(this,new R)};function V(T,C,K,ce){const se=T._writableState;if(typeof K=="function")ce=K,K=se.defaultEncoding;else{if(!K)K=se.defaultEncoding;else if(K!=="buffer"&&!m.isEncoding(K))throw new W(K);typeof ce!="function"&&(ce=Z)}if(C===null)throw new U;if(!se.objectMode)if(typeof C=="string")se.decodeStrings!==!1&&(C=m.from(C,K),K="buffer");else if(C instanceof m)K="buffer";else if(h._isUint8Array(C))C=h._uint8ArrayToBuffer(C),K="buffer";else throw new j("chunk",["string","Buffer","Uint8Array"],C);let be;return se.ending?be=new te:se.destroyed&&(be=new q("write")),be?(e.nextTick(ce,be),P(T,be,!0),be):(se.pendingcb++,L(T,se,C,K,ce))}B.prototype.write=function(T,C,K){return V(this,T,C,K)===!0},B.prototype.cork=function(){this._writableState.corked++},B.prototype.uncork=function(){const T=this._writableState;T.corked&&(T.corked--,T.writing||ae(this,T))},B.prototype.setDefaultEncoding=function(C){if(typeof C=="string"&&(C=f(C)),!m.isEncoding(C))throw new W(C);return this._writableState.defaultEncoding=C,this};function L(T,C,K,ce,se){const be=C.objectMode?1:K.length;C.length+=be;const Ie=C.length<C.highWaterMark;return Ie||(C.needDrain=!0),C.writing||C.corked||C.errored||!C.constructed?(C.buffered.push({chunk:K,encoding:ce,callback:se}),C.allBuffers&&ce!=="buffer"&&(C.allBuffers=!1),C.allNoop&&se!==Z&&(C.allNoop=!1)):(C.writelen=be,C.writecb=se,C.writing=!0,C.sync=!0,T._write(K,ce,C.onwrite),C.sync=!1),Ie&&!C.errored&&!C.destroyed}function D(T,C,K,ce,se,be,Ie){C.writelen=ce,C.writecb=Ie,C.writing=!0,C.sync=!0,C.destroyed?C.onwrite(new q("write")):K?T._writev(se,C.onwrite):T._write(se,be,C.onwrite),C.sync=!1}function N(T,C,K,ce){--C.pendingcb,ce(K),ne(C),P(T,K)}function O(T,C){const K=T._writableState,ce=K.sync,se=K.writecb;if(typeof se!="function"){P(T,new z);return}K.writing=!1,K.writecb=null,K.length-=K.writelen,K.writelen=0,C?(C.stack,K.errored||(K.errored=C),T._readableState&&!T._readableState.errored&&(T._readableState.errored=C),ce?e.nextTick(N,T,K,C,se):N(T,K,C,se)):(K.buffered.length>K.bufferedIndex&&ae(T,K),ce?K.afterWriteTickInfo!==null&&K.afterWriteTickInfo.cb===se?K.afterWriteTickInfo.count++:(K.afterWriteTickInfo={count:1,cb:se,stream:T,state:K},e.nextTick(X,K.afterWriteTickInfo)):ie(T,K,1,se))}function X({stream:T,state:C,count:K,cb:ce}){return C.afterWriteTickInfo=null,ie(T,C,K,ce)}function ie(T,C,K,ce){for(!C.ending&&!T.destroyed&&C.length===0&&C.needDrain&&(C.needDrain=!1,T.emit("drain"));K-- >0;)C.pendingcb--,ce();C.destroyed&&ne(C),_e(T,C)}function ne(T){if(T.writing)return;for(let se=T.bufferedIndex;se<T.buffered.length;++se){var C;const{chunk:be,callback:Ie}=T.buffered[se],Ne=T.objectMode?1:be.length;T.length-=Ne,Ie((C=T.errored)!==null&&C!==void 0?C:new q("write"))}const K=T[_].splice(0);for(let se=0;se<K.length;se++){var ce;K[se]((ce=T.errored)!==null&&ce!==void 0?ce:new q("end"))}b(T)}function ae(T,C){if(C.corked||C.bufferProcessing||C.destroyed||!C.constructed)return;const{buffered:K,bufferedIndex:ce,objectMode:se}=C,be=K.length-ce;if(!be)return;let Ie=ce;if(C.bufferProcessing=!0,be>1&&T._writev){C.pendingcb-=be-1;const Ne=C.allNoop?Z:Ue=>{for(let De=Ie;De<K.length;++De)K[De].callback(Ue)},He=C.allNoop&&Ie===0?K:t(K,Ie);He.allBuffers=C.allBuffers,D(T,C,!0,C.length,He,"",Ne),b(C)}else{do{const{chunk:Ne,encoding:He,callback:Ue}=K[Ie];K[Ie++]=null;const De=se?1:Ne.length;D(T,C,!1,De,Ne,He,Ue)}while(Ie<K.length&&!C.writing);Ie===K.length?b(C):Ie>256?(K.splice(0,Ie),C.bufferedIndex=0):C.bufferedIndex=Ie}C.bufferProcessing=!1}B.prototype._write=function(T,C,K){if(this._writev)this._writev([{chunk:T,encoding:C}],K);else throw new E("_write()")},B.prototype._writev=null,B.prototype.end=function(T,C,K){const ce=this._writableState;typeof T=="function"?(K=T,T=null,C=null):typeof C=="function"&&(K=C,C=null);let se;if(T!=null){const be=V(this,T,C);be instanceof r&&(se=be)}return ce.corked&&(ce.corked=1,this.uncork()),se||(!ce.errored&&!ce.ending?(ce.ending=!0,_e(this,ce,!0),ce.ended=!0):ce.finished?se=new k("end"):ce.destroyed&&(se=new q("end"))),typeof K=="function"&&(se||ce.finished?e.nextTick(K,se):ce[_].push(K)),this};function de(T){return T.ending&&!T.destroyed&&T.constructed&&T.length===0&&!T.errored&&T.buffered.length===0&&!T.finished&&!T.writing&&!T.errorEmitted&&!T.closeEmitted}function ge(T,C){let K=!1;function ce(se){if(K){P(T,se??z());return}if(K=!0,C.pendingcb--,se){const be=C[_].splice(0);for(let Ie=0;Ie<be.length;Ie++)be[Ie](se);P(T,se,C.sync)}else de(C)&&(C.prefinished=!0,T.emit("prefinish"),C.pendingcb++,e.nextTick(pe,T,C))}C.sync=!0,C.pendingcb++;try{T._final(ce)}catch(se){ce(se)}C.sync=!1}function Se(T,C){!C.prefinished&&!C.finalCalled&&(typeof T._final=="function"&&!C.destroyed?(C.finalCalled=!0,ge(T,C)):(C.prefinished=!0,T.emit("prefinish")))}function _e(T,C,K){de(C)&&(Se(T,C),C.pendingcb===0&&(K?(C.pendingcb++,e.nextTick((ce,se)=>{de(se)?pe(ce,se):se.pendingcb--},T,C)):de(C)&&(C.pendingcb++,pe(T,C))))}function pe(T,C){C.pendingcb--,C.finished=!0;const K=C[_].splice(0);for(let ce=0;ce<K.length;ce++)K[ce]();if(T.emit("finish"),C.autoDestroy){const ce=T._readableState;(!ce||ce.autoDestroy&&(ce.endEmitted||ce.readable===!1))&&T.destroy()}}o(B.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(T){this._writableState&&(this._writableState.destroyed=T)}},writable:{__proto__:null,get(){const T=this._writableState;return!!T&&T.writable!==!1&&!T.destroyed&&!T.errored&&!T.ending&&!T.ended},set(T){this._writableState&&(this._writableState.writable=!!T)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const T=this._writableState;return T?!T.destroyed&&!T.ending&&T.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const Oe=y.destroy;B.prototype.destroy=function(T,C){const K=this._writableState;return!K.destroyed&&(K.bufferedIndex<K.buffered.length||K[_].length)&&e.nextTick(ne,K),Oe.call(this,T,C),this},B.prototype._undestroy=y.undestroy,B.prototype._destroy=function(T,C){C(T)},B.prototype[c.captureRejectionSymbol]=function(T){this.destroy(T)};let Pe;function Te(){return Pe===void 0&&(Pe={}),Pe}return B.fromWeb=function(T,C){return Te().newStreamWritableFromWritableStream(T,C)},B.toWeb=function(T){return Te().newWritableStreamFromStreamWritable(T)},wo}var mo,tl;function e0(){if(tl)return mo;tl=1;const e=x.browserExports,t=x.bufferPolyfill,{isReadable:r,isWritable:n,isIterable:i,isNodeStream:o,isReadableNodeStream:s,isWritableNodeStream:f,isDuplexNodeStream:l}=fr,u=yr,{AbortError:c,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:m}}=Et,{destroyer:y}=nn,v=or(),G=Ii(),{createDeferredPromise:M}=lr,j=hu,E=globalThis.Blob||t.Blob,z=typeof E<"u"?function(P){return P instanceof E}:function(P){return!1},R=globalThis.AbortController||Ns().AbortController,{FunctionPrototypeCall:q}=it;class k extends v{constructor(P){super(P),(P==null?void 0:P.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(P==null?void 0:P.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}mo=function W(P,Z){if(l(P))return P;if(s(P))return te({readable:P});if(f(P))return te({writable:P});if(o(P))return te({writable:!1,readable:!1});if(typeof P=="function"){const{value:p,write:b,final:B,destroy:V}=U(P);if(i(p))return j(k,p,{objectMode:!0,write:b,final:B,destroy:V});const L=p==null?void 0:p.then;if(typeof L=="function"){let D;const N=q(L,p,O=>{if(O!=null)throw new m("nully","body",O)},O=>{y(D,O)});return D=new k({objectMode:!0,readable:!1,write:b,final(O){B(async()=>{try{await N,e.nextTick(O,null)}catch(X){e.nextTick(O,X)}})},destroy:V})}throw new m("Iterable, AsyncIterable or AsyncFunction",Z,p)}if(z(P))return W(P.arrayBuffer());if(i(P))return j(k,P,{objectMode:!0,writable:!1});if(typeof(P==null?void 0:P.writable)=="object"||typeof(P==null?void 0:P.readable)=="object"){const p=P!=null&&P.readable?s(P==null?void 0:P.readable)?P==null?void 0:P.readable:W(P.readable):void 0,b=P!=null&&P.writable?f(P==null?void 0:P.writable)?P==null?void 0:P.writable:W(P.writable):void 0;return te({readable:p,writable:b})}const _=P==null?void 0:P.then;if(typeof _=="function"){let p;return q(_,P,b=>{b!=null&&p.push(b),p.push(null)},b=>{y(p,b)}),p=new k({objectMode:!0,writable:!1,read(){}})}throw new h(Z,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],P)};function U(W){let{promise:P,resolve:Z}=M();const _=new R,p=_.signal;return{value:W(async function*(){for(;;){const B=P;P=null;const{chunk:V,done:L,cb:D}=await B;if(e.nextTick(D),L)return;if(p.aborted)throw new c(void 0,{cause:p.reason});({promise:P,resolve:Z}=M()),yield V}}(),{signal:p}),write(B,V,L){const D=Z;Z=null,D({chunk:B,done:!1,cb:L})},final(B){const V=Z;Z=null,V({done:!0,cb:B})},destroy(B,V){_.abort(),V(B)}}}function te(W){const P=W.readable&&typeof W.readable.read!="function"?G.wrap(W.readable):W.readable,Z=W.writable;let _=!!r(P),p=!!n(Z),b,B,V,L,D;function N(O){const X=L;L=null,X?X(O):O&&D.destroy(O)}return D=new k({readableObjectMode:!!(P!=null&&P.readableObjectMode),writableObjectMode:!!(Z!=null&&Z.writableObjectMode),readable:_,writable:p}),p&&(u(Z,O=>{p=!1,O&&y(P,O),N(O)}),D._write=function(O,X,ie){Z.write(O,X)?ie():b=ie},D._final=function(O){Z.end(),B=O},Z.on("drain",function(){if(b){const O=b;b=null,O()}}),Z.on("finish",function(){if(B){const O=B;B=null,O()}})),_&&(u(P,O=>{_=!1,O&&y(P,O),N(O)}),P.on("readable",function(){if(V){const O=V;V=null,O()}}),P.on("end",function(){D.push(null)}),D._read=function(){for(;;){const O=P.read();if(O===null){V=D._read;return}if(!D.push(O))return}}),D._destroy=function(O,X){!O&&L!==null&&(O=new c),V=null,b=null,B=null,L===null?X(O):(L=X,y(Z,O),y(P,O))},D}return mo}var Eo,rl;function or(){if(rl)return Eo;rl=1;const{ObjectDefineProperties:e,ObjectGetOwnPropertyDescriptor:t,ObjectKeys:r,ObjectSetPrototypeOf:n}=it;Eo=s;const i=Ii(),o=gu();n(s.prototype,i.prototype),n(s,i);{const c=r(o.prototype);for(let h=0;h<c.length;h++){const m=c[h];s.prototype[m]||(s.prototype[m]=o.prototype[m])}}function s(c){if(!(this instanceof s))return new s(c);i.call(this,c),o.call(this,c),c?(this.allowHalfOpen=c.allowHalfOpen!==!1,c.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),c.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}e(s.prototype,{writable:{__proto__:null,...t(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...t(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...t(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...t(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...t(o.prototype,"writableLength")},writableFinished:{__proto__:null,...t(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...t(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...t(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...t(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(c){this._readableState&&this._writableState&&(this._readableState.destroyed=c,this._writableState.destroyed=c)}}});let f;function l(){return f===void 0&&(f={}),f}s.fromWeb=function(c,h){return l().newStreamDuplexFromReadableWritablePair(c,h)},s.toWeb=function(c){return l().newReadableWritablePairFromDuplex(c)};let u;return s.from=function(c){return u||(u=e0()),u(c,"body")},Eo}const{ObjectSetPrototypeOf:_u,Symbol:t0}=it;var bu=sr;const{ERR_METHOD_NOT_IMPLEMENTED:r0}=Et.codes,Us=or(),{getHighWaterMark:n0}=Ms;_u(sr.prototype,Us.prototype);_u(sr,Us);const En=t0("kCallback");function sr(e){if(!(this instanceof sr))return new sr(e);const t=e?n0(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),Us.call(this,e),this._readableState.sync=!1,this[En]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",i0)}function _s(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,r)=>{if(t){e?e(t):this.destroy(t);return}r!=null&&this.push(r),this.push(null),e&&e()}):(this.push(null),e&&e())}function i0(){this._final!==_s&&_s.call(this)}sr.prototype._final=_s;sr.prototype._transform=function(e,t,r){throw new r0("_transform()")};sr.prototype._write=function(e,t,r){const n=this._readableState,i=this._writableState,o=n.length;this._transform(e,t,(s,f)=>{if(s){r(s);return}f!=null&&this.push(f),i.ended||o===n.length||n.length<n.highWaterMark?r():this[En]=r})};sr.prototype._read=function(){if(this[En]){const e=this[En];this[En]=null,e()}};const{ObjectSetPrototypeOf:pu}=it;var yu=Zr;const Fs=bu;pu(Zr.prototype,Fs.prototype);pu(Zr,Fs);function Zr(e){if(!(this instanceof Zr))return new Zr(e);Fs.call(this,e)}Zr.prototype._transform=function(e,t,r){r(null,e)};const mn=x.browserExports,{ArrayIsArray:o0,Promise:s0,SymbolAsyncIterator:a0}=it,ai=yr,{once:l0}=lr,f0=nn,nl=or(),{aggregateTwoErrors:u0,codes:{ERR_INVALID_ARG_TYPE:bs,ERR_INVALID_RETURN_VALUE:vo,ERR_MISSING_ARGS:c0,ERR_STREAM_DESTROYED:d0,ERR_STREAM_PREMATURE_CLOSE:h0},AbortError:g0}=Et,{validateFunction:_0,validateAbortSignal:b0}=yi,{isIterable:Sr,isReadable:So,isReadableNodeStream:ri,isNodeStream:il,isTransformStream:Hr,isWebStream:p0,isReadableStream:Ro,isReadableEnded:y0}=fr,w0=globalThis.AbortController||Ns().AbortController;let Ao,Io;function ol(e,t,r){let n=!1;e.on("close",()=>{n=!0});const i=ai(e,{readable:t,writable:r},o=>{n=!o});return{destroy:o=>{n||(n=!0,f0.destroyer(e,o||new d0("pipe")))},cleanup:i}}function m0(e){return _0(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function To(e){if(Sr(e))return e;if(ri(e))return E0(e);throw new bs("val",["Readable","Iterable","AsyncIterable"],e)}async function*E0(e){Io||(Io=Ii()),yield*Io.prototype[a0].call(e)}async function Vn(e,t,r,{end:n}){let i,o=null;const s=u=>{if(u&&(i=u),o){const c=o;o=null,c()}},f=()=>new s0((u,c)=>{i?c(i):o=()=>{i?c(i):u()}});t.on("drain",s);const l=ai(t,{readable:!1},s);try{t.writableNeedDrain&&await f();for await(const u of e)t.write(u)||await f();n&&t.end(),await f(),r()}catch(u){r(i!==u?u0(i,u):u)}finally{l(),t.off("drain",s)}}async function Oo(e,t,r,{end:n}){Hr(t)&&(t=t.writable);const i=t.getWriter();try{for await(const o of e)await i.ready,i.write(o).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(o){try{await i.abort(o),r(o)}catch(s){r(s)}}}function v0(...e){return wu(e,l0(m0(e)))}function wu(e,t,r){if(e.length===1&&o0(e[0])&&(e=e[0]),e.length<2)throw new c0("streams");const n=new w0,i=n.signal,o=r==null?void 0:r.signal,s=[];b0(o,"options.signal");function f(){y(new g0)}o==null||o.addEventListener("abort",f);let l,u;const c=[];let h=0;function m(j){y(j,--h===0)}function y(j,E){if(j&&(!l||l.code==="ERR_STREAM_PREMATURE_CLOSE")&&(l=j),!(!l&&!E)){for(;c.length;)c.shift()(l);o==null||o.removeEventListener("abort",f),n.abort(),E&&(l||s.forEach(z=>z()),mn.nextTick(t,l,u))}}let v;for(let j=0;j<e.length;j++){const E=e[j],z=j<e.length-1,R=j>0,q=z||(r==null?void 0:r.end)!==!1,k=j===e.length-1;if(il(E)){let U=function(te){te&&te.name!=="AbortError"&&te.code!=="ERR_STREAM_PREMATURE_CLOSE"&&m(te)};if(q){const{destroy:te,cleanup:W}=ol(E,z,R);c.push(te),So(E)&&k&&s.push(W)}E.on("error",U),So(E)&&k&&s.push(()=>{E.removeListener("error",U)})}if(j===0)if(typeof E=="function"){if(v=E({signal:i}),!Sr(v))throw new vo("Iterable, AsyncIterable or Stream","source",v)}else Sr(E)||ri(E)||Hr(E)?v=E:v=nl.from(E);else if(typeof E=="function"){if(Hr(v)){var G;v=To((G=v)===null||G===void 0?void 0:G.readable)}else v=To(v);if(v=E(v,{signal:i}),z){if(!Sr(v,!0))throw new vo("AsyncIterable",`transform[${j-1}]`,v)}else{var M;Ao||(Ao=yu);const U=new Ao({objectMode:!0}),te=(M=v)===null||M===void 0?void 0:M.then;if(typeof te=="function")h++,te.call(v,Z=>{u=Z,Z!=null&&U.write(Z),q&&U.end(),mn.nextTick(m)},Z=>{U.destroy(Z),mn.nextTick(m,Z)});else if(Sr(v,!0))h++,Vn(v,U,m,{end:q});else if(Ro(v)||Hr(v)){const Z=v.readable||v;h++,Vn(Z,U,m,{end:q})}else throw new vo("AsyncIterable or Promise","destination",v);v=U;const{destroy:W,cleanup:P}=ol(v,!1,!0);c.push(W),k&&s.push(P)}}else if(il(E)){if(ri(v)){h+=2;const U=S0(v,E,m,{end:q});So(E)&&k&&s.push(U)}else if(Hr(v)||Ro(v)){const U=v.readable||v;h++,Vn(U,E,m,{end:q})}else if(Sr(v))h++,Vn(v,E,m,{end:q});else throw new bs("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);v=E}else if(p0(E)){if(ri(v))h++,Oo(To(v),E,m,{end:q});else if(Ro(v)||Sr(v))h++,Oo(v,E,m,{end:q});else if(Hr(v))h++,Oo(v.readable,E,m,{end:q});else throw new bs("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);v=E}else v=nl.from(E)}return(i!=null&&i.aborted||o!=null&&o.aborted)&&mn.nextTick(f),v}function S0(e,t,r,{end:n}){let i=!1;if(t.on("close",()=>{i||r(new h0)}),e.pipe(t,{end:!1}),n){let o=function(){i=!0,t.end()};y0(e)?mn.nextTick(o):e.once("end",o)}else r();return ai(e,{readable:!0,writable:!1},o=>{const s=e._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&s&&s.ended&&!s.errored&&!s.errorEmitted?e.once("end",r).once("error",r):r(o)}),ai(t,{readable:!1,writable:!0},r)}var Hs={pipelineImpl:wu,pipeline:v0};const{pipeline:R0}=Hs,qn=or(),{destroyer:A0}=nn,{isNodeStream:Gn,isReadable:sl,isWritable:al,isWebStream:Po,isTransformStream:Er,isWritableStream:ll,isReadableStream:fl}=fr,{AbortError:I0,codes:{ERR_INVALID_ARG_VALUE:ul,ERR_MISSING_ARGS:T0}}=Et,O0=yr;var mu=function(...t){if(t.length===0)throw new T0("streams");if(t.length===1)return qn.from(t[0]);const r=[...t];if(typeof t[0]=="function"&&(t[0]=qn.from(t[0])),typeof t[t.length-1]=="function"){const y=t.length-1;t[y]=qn.from(t[y])}for(let y=0;y<t.length;++y)if(!(!Gn(t[y])&&!Po(t[y]))){if(y<t.length-1&&!(sl(t[y])||fl(t[y])||Er(t[y])))throw new ul(`streams[${y}]`,r[y],"must be readable");if(y>0&&!(al(t[y])||ll(t[y])||Er(t[y])))throw new ul(`streams[${y}]`,r[y],"must be writable")}let n,i,o,s,f;function l(y){const v=s;s=null,v?v(y):y?f.destroy(y):!m&&!h&&f.destroy()}const u=t[0],c=R0(t,l),h=!!(al(u)||ll(u)||Er(u)),m=!!(sl(c)||fl(c)||Er(c));if(f=new qn({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(c!=null&&c.writableObjectMode),writable:h,readable:m}),h){if(Gn(u))f._write=function(v,G,M){u.write(v,G)?M():n=M},f._final=function(v){u.end(),i=v},u.on("drain",function(){if(n){const v=n;n=null,v()}});else if(Po(u)){const G=(Er(u)?u.writable:u).getWriter();f._write=async function(M,j,E){try{await G.ready,G.write(M).catch(()=>{}),E()}catch(z){E(z)}},f._final=async function(M){try{await G.ready,G.close().catch(()=>{}),i=M}catch(j){M(j)}}}const y=Er(c)?c.readable:c;O0(y,()=>{if(i){const v=i;i=null,v()}})}if(m){if(Gn(c))c.on("readable",function(){if(o){const y=o;o=null,y()}}),c.on("end",function(){f.push(null)}),f._read=function(){for(;;){const y=c.read();if(y===null){o=f._read;return}if(!f.push(y))return}};else if(Po(c)){const v=(Er(c)?c.readable:c).getReader();f._read=async function(){for(;;)try{const{value:G,done:M}=await v.read();if(!f.push(G))return;if(M){f.push(null);return}}catch{return}}}}return f._destroy=function(y,v){!y&&s!==null&&(y=new I0),o=null,n=null,i=null,s===null?v(y):(s=v,Gn(c)&&A0(c,y))},f};const Eu=globalThis.AbortController||Ns().AbortController,{codes:{ERR_INVALID_ARG_VALUE:P0,ERR_INVALID_ARG_TYPE:Nn,ERR_MISSING_ARGS:C0,ERR_OUT_OF_RANGE:L0},AbortError:Yt}=Et,{validateAbortSignal:$r,validateInteger:N0,validateObject:xr}=yi,B0=it.Symbol("kWeak"),{finished:$0}=yr,x0=mu,{addAbortSignalNoValidate:k0}=Ai,{isWritable:D0,isNodeStream:j0}=fr,{ArrayPrototypePush:M0,MathFloor:U0,Number:F0,NumberIsNaN:H0,Promise:cl,PromiseReject:dl,PromisePrototypeThen:z0,Symbol:vu}=it,li=vu("kEmpty"),hl=vu("kEof");function W0(e,t){if(t!=null&&xr(t,"options"),(t==null?void 0:t.signal)!=null&&$r(t.signal,"options.signal"),j0(e)&&!D0(e))throw new P0("stream",e,"must be writable");const r=x0(this,e);return t!=null&&t.signal&&k0(t.signal,r),r}function Ti(e,t){if(typeof e!="function")throw new Nn("fn",["Function","AsyncFunction"],e);t!=null&&xr(t,"options"),(t==null?void 0:t.signal)!=null&&$r(t.signal,"options.signal");let r=1;return(t==null?void 0:t.concurrency)!=null&&(r=U0(t.concurrency)),N0(r,"concurrency",1),(async function*(){var i,o;const s=new Eu,f=this,l=[],u=s.signal,c={signal:u},h=()=>s.abort();t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted&&h(),t==null||(o=t.signal)===null||o===void 0||o.addEventListener("abort",h);let m,y,v=!1;function G(){v=!0}async function M(){try{for await(let z of f){var j;if(v)return;if(u.aborted)throw new Yt;try{z=e(z,c)}catch(R){z=dl(R)}z!==li&&(typeof((j=z)===null||j===void 0?void 0:j.catch)=="function"&&z.catch(G),l.push(z),m&&(m(),m=null),!v&&l.length&&l.length>=r&&await new cl(R=>{y=R}))}l.push(hl)}catch(z){const R=dl(z);z0(R,void 0,G),l.push(R)}finally{var E;v=!0,m&&(m(),m=null),t==null||(E=t.signal)===null||E===void 0||E.removeEventListener("abort",h)}}M();try{for(;;){for(;l.length>0;){const j=await l[0];if(j===hl)return;if(u.aborted)throw new Yt;j!==li&&(yield j),l.shift(),y&&(y(),y=null)}await new cl(j=>{m=j})}}finally{s.abort(),v=!0,y&&(y(),y=null)}}).call(this)}function V0(e=void 0){return e!=null&&xr(e,"options"),(e==null?void 0:e.signal)!=null&&$r(e.signal,"options.signal"),(async function*(){let r=0;for await(const i of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Yt({cause:e.signal.reason});yield[r++,i]}}).call(this)}async function Su(e,t=void 0){for await(const r of zs.call(this,e,t))return!0;return!1}async function q0(e,t=void 0){if(typeof e!="function")throw new Nn("fn",["Function","AsyncFunction"],e);return!await Su.call(this,async(...r)=>!await e(...r),t)}async function G0(e,t){for await(const r of zs.call(this,e,t))return r}async function Z0(e,t){if(typeof e!="function")throw new Nn("fn",["Function","AsyncFunction"],e);async function r(n,i){return await e(n,i),li}for await(const n of Ti.call(this,r,t));}function zs(e,t){if(typeof e!="function")throw new Nn("fn",["Function","AsyncFunction"],e);async function r(n,i){return await e(n,i)?n:li}return Ti.call(this,r,t)}class K0 extends C0{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function J0(e,t,r){var n;if(typeof e!="function")throw new Nn("reducer",["Function","AsyncFunction"],e);r!=null&&xr(r,"options"),(r==null?void 0:r.signal)!=null&&$r(r.signal,"options.signal");let i=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){const u=new Yt(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await $0(this.destroy(u)),u}const o=new Eu,s=o.signal;if(r!=null&&r.signal){const u={once:!0,[B0]:this};r.signal.addEventListener("abort",()=>o.abort(),u)}let f=!1;try{for await(const u of this){var l;if(f=!0,r!=null&&(l=r.signal)!==null&&l!==void 0&&l.aborted)throw new Yt;i?t=await e(t,u,{signal:s}):(t=u,i=!0)}if(!f&&!i)throw new K0}finally{o.abort()}return t}async function X0(e){e!=null&&xr(e,"options"),(e==null?void 0:e.signal)!=null&&$r(e.signal,"options.signal");const t=[];for await(const n of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Yt(void 0,{cause:e.signal.reason});M0(t,n)}return t}function Y0(e,t){const r=Ti.call(this,e,t);return(async function*(){for await(const i of r)yield*i}).call(this)}function Ru(e){if(e=F0(e),H0(e))return 0;if(e<0)throw new L0("number",">= 0",e);return e}function Q0(e,t=void 0){return t!=null&&xr(t,"options"),(t==null?void 0:t.signal)!=null&&$r(t.signal,"options.signal"),e=Ru(e),(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Yt;for await(const o of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new Yt;e--<=0&&(yield o)}}).call(this)}function e_(e,t=void 0){return t!=null&&xr(t,"options"),(t==null?void 0:t.signal)!=null&&$r(t.signal,"options.signal"),e=Ru(e),(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Yt;for await(const o of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new Yt;if(e-- >0)yield o;else return}}).call(this)}Ls.streamReturningOperators={asIndexedPairs:V0,drop:Q0,filter:zs,flatMap:Y0,map:Ti,take:e_,compose:W0};Ls.promiseReturningOperators={every:q0,forEach:Z0,reduce:J0,toArray:X0,some:Su,find:G0};var Co,gl;function Au(){if(gl)return Co;gl=1;const{ArrayPrototypePop:e,Promise:t}=it,{isIterable:r,isNodeStream:n,isWebStream:i}=fr,{pipelineImpl:o}=Hs,{finished:s}=yr;Iu();function f(...l){return new t((u,c)=>{let h,m;const y=l[l.length-1];if(y&&typeof y=="object"&&!n(y)&&!r(y)&&!i(y)){const v=e(l);h=v.signal,m=v.end}o(l,(v,G)=>{v?c(v):u(G)},{signal:h,end:m})})}return Co={finished:s,pipeline:f},Co}var _l;function Iu(){if(_l)return go.exports;_l=1;const{Buffer:e}=x.bufferPolyfill,{ObjectDefineProperty:t,ObjectKeys:r,ReflectApply:n}=it,{promisify:{custom:i}}=lr,{streamReturningOperators:o,promiseReturningOperators:s}=Ls,{codes:{ERR_ILLEGAL_CONSTRUCTOR:f}}=Et,l=mu,{pipeline:u}=Hs,{destroyer:c}=nn,h=yr,m=Au(),y=fr,v=go.exports=js.Stream;v.isDisturbed=y.isDisturbed,v.isErrored=y.isErrored,v.isReadable=y.isReadable,v.Readable=Ii();for(const M of r(o)){let E=function(...z){if(new.target)throw f();return v.Readable.from(n(j,this,z))};const j=o[M];t(E,"name",{__proto__:null,value:j.name}),t(E,"length",{__proto__:null,value:j.length}),t(v.Readable.prototype,M,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}for(const M of r(s)){let E=function(...z){if(new.target)throw f();return n(j,this,z)};const j=s[M];t(E,"name",{__proto__:null,value:j.name}),t(E,"length",{__proto__:null,value:j.length}),t(v.Readable.prototype,M,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}v.Writable=gu(),v.Duplex=or(),v.Transform=bu,v.PassThrough=yu,v.pipeline=u;const{addAbortSignal:G}=Ai;return v.addAbortSignal=G,v.finished=h,v.destroy=c,v.compose=l,t(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return m}}),t(u,i,{__proto__:null,enumerable:!0,get(){return m.pipeline}}),t(h,i,{__proto__:null,enumerable:!0,get(){return m.finished}}),v.Stream=v,v._isUint8Array=function(j){return j instanceof Uint8Array},v._uint8ArrayToBuffer=function(j){return e.from(j.buffer,j.byteOffset,j.byteLength)},go.exports}(function(e){const t=Iu(),r=Au(),n=t.Readable.destroy;e.exports=t.Readable,e.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,e.exports._isUint8Array=t._isUint8Array,e.exports.isDisturbed=t.isDisturbed,e.exports.isErrored=t.isErrored,e.exports.isReadable=t.isReadable,e.exports.Readable=t.Readable,e.exports.Writable=t.Writable,e.exports.Duplex=t.Duplex,e.exports.Transform=t.Transform,e.exports.PassThrough=t.PassThrough,e.exports.addAbortSignal=t.addAbortSignal,e.exports.finished=t.finished,e.exports.destroy=t.destroy,e.exports.destroy=n,e.exports.pipeline=t.pipeline,e.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return r}}),e.exports.Stream=t.Stream,e.exports.default=e.exports})(Yd);var t_={},Cr={},Ws={},ut={};Object.defineProperty(ut,"__esModule",{value:!0});ut.assertExhaustive=ut.assertStruct=ut.assert=ut.AssertionError=void 0;const r_=Br;function n_(e){return typeof e=="object"&&e!==null&&"message"in e}function i_(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function o_(e){const t=n_(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function Tu(e,t){return i_(e)?new e({message:t}):e({message:t})}class Vs extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}ut.AssertionError=Vs;function s_(e,t="Assertion failed.",r=Vs){if(!e)throw t instanceof Error?t:Tu(r,t)}ut.assert=s_;function a_(e,t,r="Assertion failed",n=Vs){try{(0,r_.assert)(e,t)}catch(i){throw Tu(n,`${r}: ${o_(i)}.`)}}ut.assertStruct=a_;function l_(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}ut.assertExhaustive=l_;var Bn={};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.base64=void 0;const f_=Br,u_=ut,c_=(e,t={})=>{var r,n;const i=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,o=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let s;o==="base64"?s=String.raw`[A-Za-z0-9+\/]`:((0,u_.assert)(o==="base64url"),s=String.raw`[-_A-Za-z0-9]`);let f;return i?f=new RegExp(`^(?:${s}{4})*(?:${s}{3}=|${s}{2}==)?$`,"u"):f=new RegExp(`^(?:${s}{4})*(?:${s}{2,3}|${s}{3}=|${s}{2}==)?$`,"u"),(0,f_.pattern)(e,f)};Bn.base64=c_;var Me={},$n={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=Br,r=ut;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(u){return(0,t.is)(u,e.HexStruct)}e.isHexString=n;function i(u){return(0,t.is)(u,e.StrictHexStruct)}e.isStrictHexString=i;function o(u){(0,r.assert)(n(u),"Value must be a hexadecimal string.")}e.assertIsHexString=o;function s(u){(0,r.assert)(i(u),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=s;function f(u){return u.startsWith("0x")?u:u.startsWith("0X")?`0x${u.substring(2)}`:`0x${u}`}e.add0x=f;function l(u){return u.startsWith("0x")||u.startsWith("0X")?u.substring(2):u}e.remove0x=l})($n);Object.defineProperty(Me,"__esModule",{value:!0});Me.createDataView=Me.concatBytes=Me.valueToBytes=Me.stringToBytes=Me.numberToBytes=Me.signedBigIntToBytes=Me.bigIntToBytes=Me.hexToBytes=Me.bytesToString=Me.bytesToNumber=Me.bytesToSignedBigInt=Me.bytesToBigInt=Me.bytesToHex=Me.assertIsBytes=Me.isBytes=void 0;const St=ut,ps=$n,bl=48,pl=58,yl=87;function d_(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const h_=d_();function qs(e){return e instanceof Uint8Array}Me.isBytes=qs;function on(e){(0,St.assert)(qs(e),"Value must be a Uint8Array.")}Me.assertIsBytes=on;function Ou(e){if(on(e),e.length===0)return"0x";const t=h_(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,ps.add0x)(r.join(""))}Me.bytesToHex=Ou;function Pu(e){on(e);const t=Ou(e);return BigInt(t)}Me.bytesToBigInt=Pu;function g_(e){on(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}Me.bytesToSignedBigInt=g_;function __(e){on(e);const t=Pu(e);return(0,St.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}Me.bytesToNumber=__;function b_(e){return on(e),new TextDecoder().decode(e)}Me.bytesToString=b_;function Oi(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,ps.assertIsHexString)(e);const r=(0,ps.remove0x)(e).toLowerCase(),n=r.length%2===0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let o=0;o<i.length;o++){const s=n.charCodeAt(o*2),f=n.charCodeAt(o*2+1),l=s-(s<pl?bl:yl),u=f-(f<pl?bl:yl);i[o]=l*16+u}return i}Me.hexToBytes=Oi;function Cu(e){(0,St.assert)(typeof e=="bigint","Value must be a bigint."),(0,St.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return Oi(t)}Me.bigIntToBytes=Cu;function p_(e,t){(0,St.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function y_(e,t){(0,St.assert)(typeof e=="bigint","Value must be a bigint."),(0,St.assert)(typeof t=="number","Byte length must be a number."),(0,St.assert)(t>0,"Byte length must be greater than 0."),(0,St.assert)(p_(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let i=0;i<n.length;i++)n[i]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}Me.signedBigIntToBytes=y_;function Lu(e){(0,St.assert)(typeof e=="number","Value must be a number."),(0,St.assert)(e>=0,"Value must be a non-negative number."),(0,St.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return Oi(t)}Me.numberToBytes=Lu;function Nu(e){return(0,St.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}Me.stringToBytes=Nu;function Bu(e){if(typeof e=="bigint")return Cu(e);if(typeof e=="number")return Lu(e);if(typeof e=="string")return e.startsWith("0x")?Oi(e):Nu(e);if(qs(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}Me.valueToBytes=Bu;function w_(e){const t=new Array(e.length);let r=0;for(let i=0;i<e.length;i++){const o=Bu(e[i]);t[i]=o,r+=o.length}const n=new Uint8Array(r);for(let i=0,o=0;i<t.length;i++)n.set(t[i],o),o+=t[i].length;return n}Me.concatBytes=w_;function m_(e){if(typeof x.dist.Buffer<"u"&&e instanceof x.dist.Buffer){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}Me.createDataView=m_;var Pi={};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.ChecksumStruct=void 0;const wl=Br,E_=Bn;Pi.ChecksumStruct=(0,wl.size)((0,E_.base64)((0,wl.string)(),{paddingRequired:!0}),44,44);var qt={};Object.defineProperty(qt,"__esModule",{value:!0});qt.createHex=qt.createBytes=qt.createBigInt=qt.createNumber=void 0;const Xe=Br,v_=ut,$u=Me,Ci=$n,xu=(0,Xe.union)([(0,Xe.number)(),(0,Xe.bigint)(),(0,Xe.string)(),Ci.StrictHexStruct]),S_=(0,Xe.coerce)((0,Xe.number)(),xu,Number),R_=(0,Xe.coerce)((0,Xe.bigint)(),xu,BigInt);(0,Xe.union)([Ci.StrictHexStruct,(0,Xe.instance)(Uint8Array)]);const A_=(0,Xe.coerce)((0,Xe.instance)(Uint8Array),(0,Xe.union)([Ci.StrictHexStruct]),$u.hexToBytes),I_=(0,Xe.coerce)(Ci.StrictHexStruct,(0,Xe.instance)(Uint8Array),$u.bytesToHex);function T_(e){try{const t=(0,Xe.create)(e,S_);return(0,v_.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof Xe.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}qt.createNumber=T_;function O_(e){try{return(0,Xe.create)(e,R_)}catch(t){throw t instanceof Xe.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}qt.createBigInt=O_;function P_(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,Xe.create)(e,A_)}catch(t){throw t instanceof Xe.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}qt.createBytes=P_;function C_(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,Xe.create)(e,I_)}catch(t){throw t instanceof Xe.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}qt.createHex=C_;var Kr={},ku=x.commonjsGlobal&&x.commonjsGlobal.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},bt=x.commonjsGlobal&&x.commonjsGlobal.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},xt,zt;Object.defineProperty(Kr,"__esModule",{value:!0});Kr.FrozenSet=Kr.FrozenMap=void 0;class Gs{constructor(t){xt.set(this,void 0),ku(this,xt,new Map(t),"f"),Object.freeze(this)}get size(){return bt(this,xt,"f").size}[(xt=new WeakMap,Symbol.iterator)](){return bt(this,xt,"f")[Symbol.iterator]()}entries(){return bt(this,xt,"f").entries()}forEach(t,r){return bt(this,xt,"f").forEach((n,i,o)=>t.call(r,n,i,this))}get(t){return bt(this,xt,"f").get(t)}has(t){return bt(this,xt,"f").has(t)}keys(){return bt(this,xt,"f").keys()}values(){return bt(this,xt,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}Kr.FrozenMap=Gs;class Zs{constructor(t){zt.set(this,void 0),ku(this,zt,new Set(t),"f"),Object.freeze(this)}get size(){return bt(this,zt,"f").size}[(zt=new WeakMap,Symbol.iterator)](){return bt(this,zt,"f")[Symbol.iterator]()}entries(){return bt(this,zt,"f").entries()}forEach(t,r){return bt(this,zt,"f").forEach((n,i,o)=>t.call(r,n,i,this))}has(t){return bt(this,zt,"f").has(t)}keys(){return bt(this,zt,"f").keys()}values(){return bt(this,zt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}Kr.FrozenSet=Zs;Object.freeze(Gs);Object.freeze(Gs.prototype);Object.freeze(Zs);Object.freeze(Zs.prototype);var Du={};Object.defineProperty(Du,"__esModule",{value:!0});var ju={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=Br,r=ut,n=()=>(0,t.define)("finite number",q=>(0,t.is)(q,(0,t.number)())&&Number.isFinite(q));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(q,k)=>{function U(te,W){const Z=[...W.validator(te,k)];return Z.length>0?Z:!0}try{const te=U(q,e.UnsafeJsonStruct);return te!==!0?te:U(JSON.parse(JSON.stringify(q)),e.UnsafeJsonStruct)}catch(te){return te instanceof RangeError?"Circular reference detected":!1}});function i(q){return(0,t.is)(q,e.JsonStruct)}e.isValidJson=i;function o(q){(0,r.assertStruct)(q,e.JsonStruct,"Invalid JSON value");const k=JSON.stringify(q);return new TextEncoder().encode(k).byteLength}e.getJsonSize=o,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function s(q){return(0,t.is)(q,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=s;function f(q,k){(0,r.assertStruct)(q,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",k)}e.assertIsJsonRpcNotification=f;function l(q){return(0,t.is)(q,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=l;function u(q,k){(0,r.assertStruct)(q,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",k)}e.assertIsJsonRpcRequest=u,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function c(q){return(0,t.is)(q,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=c;function h(q,k){(0,r.assertStruct)(q,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",k)}e.assertIsPendingJsonRpcResponse=h;function m(q){return(0,t.is)(q,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=m;function y(q,k){(0,r.assertStruct)(q,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",k)}e.assertIsJsonRpcResponse=y;function v(q){return(0,t.is)(q,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=v;function G(q,k){(0,r.assertStruct)(q,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",k)}e.assertIsJsonRpcSuccess=G;function M(q){return(0,t.is)(q,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=M;function j(q,k){(0,r.assertStruct)(q,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",k)}e.assertIsJsonRpcFailure=j;function E(q){return(0,t.is)(q,e.JsonRpcErrorStruct)}e.isJsonRpcError=E;function z(q,k){(0,r.assertStruct)(q,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",k)}e.assertIsJsonRpcError=z;function R(q){const{permitEmptyString:k,permitFractions:U,permitNull:te}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},q);return P=>!!(typeof P=="number"&&(U||Number.isInteger(P))||typeof P=="string"&&(k||P.length>0)||te&&P===null)}e.getJsonRpcIdValidator=R})(ju);var Mu={};Object.defineProperty(Mu,"__esModule",{value:!0});var Jr={},L_=x.commonjsGlobal&&x.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.createModuleLogger=Jr.createProjectLogger=void 0;const N_=L_(Gd),B_=(0,N_.default)("metamask");function $_(e){return B_.extend(e)}Jr.createProjectLogger=$_;function x_(e,t){return e.extend(t)}Jr.createModuleLogger=x_;var Uu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(u){return Array.isArray(u)&&u.length>0}e.isNonEmptyArray=t;function r(u){return u==null}e.isNullOrUndefined=r;function n(u){return!!u&&typeof u=="object"&&!Array.isArray(u)}e.isObject=n;const i=(u,c)=>Object.hasOwnProperty.call(u,c);e.hasProperty=i,function(u){u[u.Null=4]="Null",u[u.Comma=1]="Comma",u[u.Wrapper=1]="Wrapper",u[u.True=4]="True",u[u.False=5]="False",u[u.Quote=1]="Quote",u[u.Colon=1]="Colon",u[u.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function o(u){if(typeof u!="object"||u===null)return!1;try{let c=u;for(;Object.getPrototypeOf(c)!==null;)c=Object.getPrototypeOf(c);return Object.getPrototypeOf(u)===c}catch{return!1}}e.isPlainObject=o;function s(u){return u.charCodeAt(0)<=127}e.isASCII=s;function f(u){var c;return u.split("").reduce((m,y)=>s(y)?m+1:m+2,0)+((c=u.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&c!==void 0?c:[]).length}e.calculateStringSize=f;function l(u){return u.toString().length}e.calculateNumberSize=l})(Uu);var Gt={};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.hexToBigInt=Gt.hexToNumber=Gt.bigIntToHex=Gt.numberToHex=void 0;const Vr=ut,Tn=$n,k_=e=>((0,Vr.assert)(typeof e=="number","Value must be a number."),(0,Vr.assert)(e>=0,"Value must be a non-negative number."),(0,Vr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Tn.add0x)(e.toString(16)));Gt.numberToHex=k_;const D_=e=>((0,Vr.assert)(typeof e=="bigint","Value must be a bigint."),(0,Vr.assert)(e>=0,"Value must be a non-negative bigint."),(0,Tn.add0x)(e.toString(16)));Gt.bigIntToHex=D_;const j_=e=>{(0,Tn.assertIsHexString)(e);const t=parseInt(e,16);return(0,Vr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Gt.hexToNumber=j_;const M_=e=>((0,Tn.assertIsHexString)(e),BigInt((0,Tn.add0x)(e)));Gt.hexToBigInt=M_;var Fu={};Object.defineProperty(Fu,"__esModule",{value:!0});var Hu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(o){o[o.Millisecond=1]="Millisecond",o[o.Second=1e3]="Second",o[o.Minute=6e4]="Minute",o[o.Hour=36e5]="Hour",o[o.Day=864e5]="Day",o[o.Week=6048e5]="Week",o[o.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=o=>Number.isInteger(o)&&o>=0,r=(o,s)=>{if(!t(o))throw new Error(`"${s}" must be a non-negative integer. Received: "${o}".`)};function n(o,s){return r(o,"count"),o*s}e.inMilliseconds=n;function i(o){return r(o,"timestamp"),Date.now()-o}e.timeSince=i})(Hu);var zu={};Object.defineProperty(zu,"__esModule",{value:!0});var Wu={},ys={exports:{}};const U_="2.0.0",Vu=256,F_=Number.MAX_SAFE_INTEGER||9007199254740991,H_=16,z_=Vu-6,W_=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Li={MAX_LENGTH:Vu,MAX_SAFE_COMPONENT_LENGTH:H_,MAX_SAFE_BUILD_LENGTH:z_,MAX_SAFE_INTEGER:F_,RELEASE_TYPES:W_,SEMVER_SPEC_VERSION:U_,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const V_=typeof x.dist.process=="object"&&x.dist.process.env&&x.dist.process.env.NODE_DEBUG&&/\bsemver\b/i.test(x.dist.process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Ni=V_;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Li,o=Ni;t=e.exports={};const s=t.re=[],f=t.safeRe=[],l=t.src=[],u=t.t={};let c=0;const h="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",i],[h,n]],y=G=>{for(const[M,j]of m)G=G.split(`${M}*`).join(`${M}{0,${j}}`).split(`${M}+`).join(`${M}{1,${j}}`);return G},v=(G,M,j)=>{const E=y(M),z=c++;o(G,z,M),u[G]=z,l[z]=M,s[z]=new RegExp(M,j?"g":void 0),f[z]=new RegExp(E,j?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","\\d+"),v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),v("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),v("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),v("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),v("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),v("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),v("BUILDIDENTIFIER",`${h}+`),v("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),v("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),v("FULL",`^${l[u.FULLPLAIN]}$`),v("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),v("LOOSE",`^${l[u.LOOSEPLAIN]}$`),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),v("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),v("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),v("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),v("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),v("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),v("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),v("COERCERTL",l[u.COERCE],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",v("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),v("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),v("LONECARET","(?:\\^)"),v("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",v("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),v("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),v("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),v("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),v("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),v("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ys,ys.exports);var xn=ys.exports;const q_=Object.freeze({loose:!0}),G_=Object.freeze({}),Z_=e=>e?typeof e!="object"?q_:e:G_;var Ks=Z_;const ml=/^[0-9]+$/,qu=(e,t)=>{const r=ml.test(e),n=ml.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},K_=(e,t)=>qu(t,e);var Gu={compareIdentifiers:qu,rcompareIdentifiers:K_};const Zn=Ni,{MAX_LENGTH:El,MAX_SAFE_INTEGER:Kn}=Li,{safeRe:vl,t:Sl}=xn,J_=Ks,{compareIdentifiers:jr}=Gu;let X_=class Wt{constructor(t,r){if(r=J_(r),t instanceof Wt){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>El)throw new TypeError(`version is longer than ${El} characters`);Zn("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?vl[Sl.LOOSE]:vl[Sl.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Kn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Kn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Kn||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const o=+i;if(o>=0&&o<Kn)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Zn("SemVer.compare",this.version,this.options,t),!(t instanceof Wt)){if(typeof t=="string"&&t===this.version)return 0;t=new Wt(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof Wt||(t=new Wt(t,this.options)),jr(this.major,t.major)||jr(this.minor,t.minor)||jr(this.patch,t.patch)}comparePre(t){if(t instanceof Wt||(t=new Wt(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=t.prerelease[r];if(Zn("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return jr(n,i)}while(++r)}compareBuild(t){t instanceof Wt||(t=new Wt(t,this.options));let r=0;do{const n=this.build[r],i=t.build[r];if(Zn("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return jr(n,i)}while(++r)}inc(t,r,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),jr(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var yt=X_;const Rl=yt,Y_=(e,t,r=!1)=>{if(e instanceof Rl)return e;try{return new Rl(e,t)}catch(n){if(!r)return null;throw n}};var sn=Y_;const Q_=sn,eb=(e,t)=>{const r=Q_(e,t);return r?r.version:null};var tb=eb;const rb=sn,nb=(e,t)=>{const r=rb(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var ib=nb;const Al=yt,ob=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new Al(e instanceof Al?e.version:e,r).inc(t,n,i).version}catch{return null}};var sb=ob;const Il=sn,ab=(e,t)=>{const r=Il(e,null,!0),n=Il(t,null,!0),i=r.compare(n);if(i===0)return null;const o=i>0,s=o?r:n,f=o?n:r,l=!!s.prerelease.length;if(!!f.prerelease.length&&!l)return!f.patch&&!f.minor?"major":s.patch?"patch":s.minor?"minor":"major";const c=l?"pre":"";return r.major!==n.major?c+"major":r.minor!==n.minor?c+"minor":r.patch!==n.patch?c+"patch":"prerelease"};var lb=ab;const fb=yt,ub=(e,t)=>new fb(e,t).major;var cb=ub;const db=yt,hb=(e,t)=>new db(e,t).minor;var gb=hb;const _b=yt,bb=(e,t)=>new _b(e,t).patch;var pb=bb;const yb=sn,wb=(e,t)=>{const r=yb(e,t);return r&&r.prerelease.length?r.prerelease:null};var mb=wb;const Tl=yt,Eb=(e,t,r)=>new Tl(e,r).compare(new Tl(t,r));var Ft=Eb;const vb=Ft,Sb=(e,t,r)=>vb(t,e,r);var Rb=Sb;const Ab=Ft,Ib=(e,t)=>Ab(e,t,!0);var Tb=Ib;const Ol=yt,Ob=(e,t,r)=>{const n=new Ol(e,r),i=new Ol(t,r);return n.compare(i)||n.compareBuild(i)};var Js=Ob;const Pb=Js,Cb=(e,t)=>e.sort((r,n)=>Pb(r,n,t));var Lb=Cb;const Nb=Js,Bb=(e,t)=>e.sort((r,n)=>Nb(n,r,t));var $b=Bb;const xb=Ft,kb=(e,t,r)=>xb(e,t,r)>0;var Bi=kb;const Db=Ft,jb=(e,t,r)=>Db(e,t,r)<0;var Xs=jb;const Mb=Ft,Ub=(e,t,r)=>Mb(e,t,r)===0;var Zu=Ub;const Fb=Ft,Hb=(e,t,r)=>Fb(e,t,r)!==0;var Ku=Hb;const zb=Ft,Wb=(e,t,r)=>zb(e,t,r)>=0;var Ys=Wb;const Vb=Ft,qb=(e,t,r)=>Vb(e,t,r)<=0;var Qs=qb;const Gb=Zu,Zb=Ku,Kb=Bi,Jb=Ys,Xb=Xs,Yb=Qs,Qb=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return Gb(e,r,n);case"!=":return Zb(e,r,n);case">":return Kb(e,r,n);case">=":return Jb(e,r,n);case"<":return Xb(e,r,n);case"<=":return Yb(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var Ju=Qb;const ep=yt,tp=sn,{safeRe:Jn,t:Xn}=xn,rp=(e,t)=>{if(e instanceof ep)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(Jn[Xn.COERCE]);else{let n;for(;(n=Jn[Xn.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),Jn[Xn.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;Jn[Xn.COERCERTL].lastIndex=-1}return r===null?null:tp(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};var np=rp,Lo,Pl;function ip(){return Pl||(Pl=1,Lo=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Lo}var op=Fe;Fe.Node=Lr;Fe.create=Fe;function Fe(e){var t=this;if(t instanceof Fe||(t=new Fe),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);return t}Fe.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t};Fe.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};Fe.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};Fe.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)ap(this,arguments[e]);return this.length};Fe.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)lp(this,arguments[e]);return this.length};Fe.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};Fe.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};Fe.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;r!==null;n++)e.call(t,r.value,n,this),r=r.next};Fe.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;r!==null;n--)e.call(t,r.value,n,this),r=r.prev};Fe.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++)r=r.next;if(t===e&&r!==null)return r.value};Fe.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++)r=r.prev;if(t===e&&r!==null)return r.value};Fe.prototype.map=function(e,t){t=t||this;for(var r=new Fe,n=this.head;n!==null;)r.push(e.call(t,n.value,this)),n=n.next;return r};Fe.prototype.mapReverse=function(e,t){t=t||this;for(var r=new Fe,n=this.tail;n!==null;)r.push(e.call(t,n.value,this)),n=n.prev;return r};Fe.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=e(r,n.value,i),n=n.next;return r};Fe.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=e(r,n.value,i),n=n.prev;return r};Fe.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;r!==null;t++)e[t]=r.value,r=r.next;return e};Fe.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;r!==null;t++)e[t]=r.value,r=r.prev;return e};Fe.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new Fe;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=0,i=this.head;i!==null&&n<e;n++)i=i.next;for(;i!==null&&n<t;n++,i=i.next)r.push(i.value);return r};Fe.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new Fe;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=this.length,i=this.tail;i!==null&&n>t;n--)i=i.prev;for(;i!==null&&n>e;n--,i=i.prev)r.push(i.value);return r};Fe.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;i!==null&&n<e;n++)i=i.next;for(var o=[],n=0;i&&n<t;n++)o.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var n=0;n<r.length;n++)i=sp(this,i,r[n]);return o};Fe.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};function sp(e,t,r){var n=t===e.head?new Lr(r,null,t,e):new Lr(r,t,t.next,e);return n.next===null&&(e.tail=n),n.prev===null&&(e.head=n),e.length++,n}function ap(e,t){e.tail=new Lr(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function lp(e,t){e.head=new Lr(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function Lr(e,t,r,n){if(!(this instanceof Lr))return new Lr(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{ip()(Fe)}catch{}const fp=op,Rr=Symbol("max"),nr=Symbol("length"),Mr=Symbol("lengthCalculator"),vn=Symbol("allowStale"),Ir=Symbol("maxAge"),er=Symbol("dispose"),Cl=Symbol("noDisposeOnSet"),st=Symbol("lruList"),Dt=Symbol("cache"),Xu=Symbol("updateAgeOnGet"),No=()=>1;class up{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[Rr]=t.max||1/0;const r=t.length||No;if(this[Mr]=typeof r!="function"?No:r,this[vn]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[Ir]=t.maxAge||0,this[er]=t.dispose,this[Cl]=t.noDisposeOnSet||!1,this[Xu]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[Rr]=t||1/0,dn(this)}get max(){return this[Rr]}set allowStale(t){this[vn]=!!t}get allowStale(){return this[vn]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[Ir]=t,dn(this)}get maxAge(){return this[Ir]}set lengthCalculator(t){typeof t!="function"&&(t=No),t!==this[Mr]&&(this[Mr]=t,this[nr]=0,this[st].forEach(r=>{r.length=this[Mr](r.value,r.key),this[nr]+=r.length})),dn(this)}get lengthCalculator(){return this[Mr]}get length(){return this[nr]}get itemCount(){return this[st].length}rforEach(t,r){r=r||this;for(let n=this[st].tail;n!==null;){const i=n.prev;Ll(this,t,n,r),n=i}}forEach(t,r){r=r||this;for(let n=this[st].head;n!==null;){const i=n.next;Ll(this,t,n,r),n=i}}keys(){return this[st].toArray().map(t=>t.key)}values(){return this[st].toArray().map(t=>t.value)}reset(){this[er]&&this[st]&&this[st].length&&this[st].forEach(t=>this[er](t.key,t.value)),this[Dt]=new Map,this[st]=new fp,this[nr]=0}dump(){return this[st].map(t=>fi(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[st]}set(t,r,n){if(n=n||this[Ir],n&&typeof n!="number")throw new TypeError("maxAge must be a number");const i=n?Date.now():0,o=this[Mr](r,t);if(this[Dt].has(t)){if(o>this[Rr])return qr(this,this[Dt].get(t)),!1;const l=this[Dt].get(t).value;return this[er]&&(this[Cl]||this[er](t,l.value)),l.now=i,l.maxAge=n,l.value=r,this[nr]+=o-l.length,l.length=o,this.get(t),dn(this),!0}const s=new cp(t,r,o,i,n);return s.length>this[Rr]?(this[er]&&this[er](t,r),!1):(this[nr]+=s.length,this[st].unshift(s),this[Dt].set(t,this[st].head),dn(this),!0)}has(t){if(!this[Dt].has(t))return!1;const r=this[Dt].get(t).value;return!fi(this,r)}get(t){return Bo(this,t,!0)}peek(t){return Bo(this,t,!1)}pop(){const t=this[st].tail;return t?(qr(this,t),t.value):null}del(t){qr(this,this[Dt].get(t))}load(t){this.reset();const r=Date.now();for(let n=t.length-1;n>=0;n--){const i=t[n],o=i.e||0;if(o===0)this.set(i.k,i.v);else{const s=o-r;s>0&&this.set(i.k,i.v,s)}}}prune(){this[Dt].forEach((t,r)=>Bo(this,r,!1))}}const Bo=(e,t,r)=>{const n=e[Dt].get(t);if(n){const i=n.value;if(fi(e,i)){if(qr(e,n),!e[vn])return}else r&&(e[Xu]&&(n.value.now=Date.now()),e[st].unshiftNode(n));return i.value}},fi=(e,t)=>{if(!t||!t.maxAge&&!e[Ir])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[Ir]&&r>e[Ir]},dn=e=>{if(e[nr]>e[Rr])for(let t=e[st].tail;e[nr]>e[Rr]&&t!==null;){const r=t.prev;qr(e,t),t=r}},qr=(e,t)=>{if(t){const r=t.value;e[er]&&e[er](r.key,r.value),e[nr]-=r.length,e[Dt].delete(r.key),e[st].removeNode(t)}};class cp{constructor(t,r,n,i,o){this.key=t,this.value=r,this.length=n,this.now=i,this.maxAge=o||0}}const Ll=(e,t,r,n)=>{let i=r.value;fi(e,i)&&(qr(e,r),e[vn]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};var dp=up,$o,Nl;function Ht(){if(Nl)return $o;Nl=1;class e{constructor(b,B){if(B=n(B),b instanceof e)return b.loose===!!B.loose&&b.includePrerelease===!!B.includePrerelease?b:new e(b.raw,B);if(b instanceof i)return this.raw=b.value,this.set=[[b]],this.format(),this;if(this.options=B,this.loose=!!B.loose,this.includePrerelease=!!B.includePrerelease,this.raw=b.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(V=>this.parseRange(V.trim())).filter(V=>V.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const V=this.set[0];if(this.set=this.set.filter(L=>!v(L[0])),this.set.length===0)this.set=[V];else if(this.set.length>1){for(const L of this.set)if(L.length===1&&G(L[0])){this.set=[L];break}}}this.format()}format(){return this.range=this.set.map(b=>b.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(b){const V=((this.options.includePrerelease&&m)|(this.options.loose&&y))+":"+b,L=r.get(V);if(L)return L;const D=this.options.loose,N=D?f[l.HYPHENRANGELOOSE]:f[l.HYPHENRANGE];b=b.replace(N,Z(this.options.includePrerelease)),o("hyphen replace",b),b=b.replace(f[l.COMPARATORTRIM],u),o("comparator trim",b),b=b.replace(f[l.TILDETRIM],c),o("tilde trim",b),b=b.replace(f[l.CARETTRIM],h),o("caret trim",b);let O=b.split(" ").map(ae=>j(ae,this.options)).join(" ").split(/\s+/).map(ae=>P(ae,this.options));D&&(O=O.filter(ae=>(o("loose invalid filter",ae,this.options),!!ae.match(f[l.COMPARATORLOOSE])))),o("range list",O);const X=new Map,ie=O.map(ae=>new i(ae,this.options));for(const ae of ie){if(v(ae))return[ae];X.set(ae.value,ae)}X.size>1&&X.has("")&&X.delete("");const ne=[...X.values()];return r.set(V,ne),ne}intersects(b,B){if(!(b instanceof e))throw new TypeError("a Range is required");return this.set.some(V=>M(V,B)&&b.set.some(L=>M(L,B)&&V.every(D=>L.every(N=>D.intersects(N,B)))))}test(b){if(!b)return!1;if(typeof b=="string")try{b=new s(b,this.options)}catch{return!1}for(let B=0;B<this.set.length;B++)if(_(this.set[B],b,this.options))return!0;return!1}}$o=e;const t=dp,r=new t({max:1e3}),n=Ks,i=$i(),o=Ni,s=yt,{safeRe:f,t:l,comparatorTrimReplace:u,tildeTrimReplace:c,caretTrimReplace:h}=xn,{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:y}=Li,v=p=>p.value==="<0.0.0-0",G=p=>p.value==="",M=(p,b)=>{let B=!0;const V=p.slice();let L=V.pop();for(;B&&V.length;)B=V.every(D=>L.intersects(D,b)),L=V.pop();return B},j=(p,b)=>(o("comp",p,b),p=q(p,b),o("caret",p),p=z(p,b),o("tildes",p),p=U(p,b),o("xrange",p),p=W(p,b),o("stars",p),p),E=p=>!p||p.toLowerCase()==="x"||p==="*",z=(p,b)=>p.trim().split(/\s+/).map(B=>R(B,b)).join(" "),R=(p,b)=>{const B=b.loose?f[l.TILDELOOSE]:f[l.TILDE];return p.replace(B,(V,L,D,N,O)=>{o("tilde",p,V,L,D,N,O);let X;return E(L)?X="":E(D)?X=`>=${L}.0.0 <${+L+1}.0.0-0`:E(N)?X=`>=${L}.${D}.0 <${L}.${+D+1}.0-0`:O?(o("replaceTilde pr",O),X=`>=${L}.${D}.${N}-${O} <${L}.${+D+1}.0-0`):X=`>=${L}.${D}.${N} <${L}.${+D+1}.0-0`,o("tilde return",X),X})},q=(p,b)=>p.trim().split(/\s+/).map(B=>k(B,b)).join(" "),k=(p,b)=>{o("caret",p,b);const B=b.loose?f[l.CARETLOOSE]:f[l.CARET],V=b.includePrerelease?"-0":"";return p.replace(B,(L,D,N,O,X)=>{o("caret",p,L,D,N,O,X);let ie;return E(D)?ie="":E(N)?ie=`>=${D}.0.0${V} <${+D+1}.0.0-0`:E(O)?D==="0"?ie=`>=${D}.${N}.0${V} <${D}.${+N+1}.0-0`:ie=`>=${D}.${N}.0${V} <${+D+1}.0.0-0`:X?(o("replaceCaret pr",X),D==="0"?N==="0"?ie=`>=${D}.${N}.${O}-${X} <${D}.${N}.${+O+1}-0`:ie=`>=${D}.${N}.${O}-${X} <${D}.${+N+1}.0-0`:ie=`>=${D}.${N}.${O}-${X} <${+D+1}.0.0-0`):(o("no pr"),D==="0"?N==="0"?ie=`>=${D}.${N}.${O}${V} <${D}.${N}.${+O+1}-0`:ie=`>=${D}.${N}.${O}${V} <${D}.${+N+1}.0-0`:ie=`>=${D}.${N}.${O} <${+D+1}.0.0-0`),o("caret return",ie),ie})},U=(p,b)=>(o("replaceXRanges",p,b),p.split(/\s+/).map(B=>te(B,b)).join(" ")),te=(p,b)=>{p=p.trim();const B=b.loose?f[l.XRANGELOOSE]:f[l.XRANGE];return p.replace(B,(V,L,D,N,O,X)=>{o("xRange",p,V,L,D,N,O,X);const ie=E(D),ne=ie||E(N),ae=ne||E(O),de=ae;return L==="="&&de&&(L=""),X=b.includePrerelease?"-0":"",ie?L===">"||L==="<"?V="<0.0.0-0":V="*":L&&de?(ne&&(N=0),O=0,L===">"?(L=">=",ne?(D=+D+1,N=0,O=0):(N=+N+1,O=0)):L==="<="&&(L="<",ne?D=+D+1:N=+N+1),L==="<"&&(X="-0"),V=`${L+D}.${N}.${O}${X}`):ne?V=`>=${D}.0.0${X} <${+D+1}.0.0-0`:ae&&(V=`>=${D}.${N}.0${X} <${D}.${+N+1}.0-0`),o("xRange return",V),V})},W=(p,b)=>(o("replaceStars",p,b),p.trim().replace(f[l.STAR],"")),P=(p,b)=>(o("replaceGTE0",p,b),p.trim().replace(f[b.includePrerelease?l.GTE0PRE:l.GTE0],"")),Z=p=>(b,B,V,L,D,N,O,X,ie,ne,ae,de,ge)=>(E(V)?B="":E(L)?B=`>=${V}.0.0${p?"-0":""}`:E(D)?B=`>=${V}.${L}.0${p?"-0":""}`:N?B=`>=${B}`:B=`>=${B}${p?"-0":""}`,E(ie)?X="":E(ne)?X=`<${+ie+1}.0.0-0`:E(ae)?X=`<${ie}.${+ne+1}.0-0`:de?X=`<=${ie}.${ne}.${ae}-${de}`:p?X=`<${ie}.${ne}.${+ae+1}-0`:X=`<=${X}`,`${B} ${X}`.trim()),_=(p,b,B)=>{for(let V=0;V<p.length;V++)if(!p[V].test(b))return!1;if(b.prerelease.length&&!B.includePrerelease){for(let V=0;V<p.length;V++)if(o(p[V].semver),p[V].semver!==i.ANY&&p[V].semver.prerelease.length>0){const L=p[V].semver;if(L.major===b.major&&L.minor===b.minor&&L.patch===b.patch)return!0}return!1}return!0};return $o}var xo,Bl;function $i(){if(Bl)return xo;Bl=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,h){if(h=r(h),c instanceof t){if(c.loose===!!h.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),s("comparator",c,h),this.options=h,this.loose=!!h.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(c){const h=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],m=c.match(h);if(!m)throw new TypeError(`Invalid comparator: ${c}`);this.operator=m[1]!==void 0?m[1]:"",this.operator==="="&&(this.operator=""),m[2]?this.semver=new f(m[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(s("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new f(c,this.options)}catch{return!1}return o(c,this.operator,this.semver,this.options)}intersects(c,h){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(c.value,h).test(this.value):c.operator===""?c.value===""?!0:new l(this.value,h).test(c.semver):(h=r(h),h.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!h.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||o(this.semver,"<",c.semver,h)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||o(this.semver,">",c.semver,h)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}xo=t;const r=Ks,{safeRe:n,t:i}=xn,o=Ju,s=Ni,f=yt,l=Ht();return xo}const hp=Ht(),gp=(e,t,r)=>{try{t=new hp(t,r)}catch{return!1}return t.test(e)};var xi=gp;const _p=Ht(),bp=(e,t)=>new _p(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var pp=bp;const yp=yt,wp=Ht(),mp=(e,t,r)=>{let n=null,i=null,o=null;try{o=new wp(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new yp(n,r))}),n};var Ep=mp;const vp=yt,Sp=Ht(),Rp=(e,t,r)=>{let n=null,i=null,o=null;try{o=new Sp(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new vp(n,r))}),n};var Ap=Rp;const ko=yt,Ip=Ht(),$l=Bi,Tp=(e,t)=>{e=new Ip(e,t);let r=new ko("0.0.0");if(e.test(r)||(r=new ko("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){const i=e.set[n];let o=null;i.forEach(s=>{const f=new ko(s.semver.version);switch(s.operator){case">":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case"":case">=":(!o||$l(f,o))&&(o=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||$l(r,o))&&(r=o)}return r&&e.test(r)?r:null};var Op=Tp;const Pp=Ht(),Cp=(e,t)=>{try{return new Pp(e,t).range||"*"}catch{return null}};var Lp=Cp;const Np=yt,Yu=$i(),{ANY:Bp}=Yu,$p=Ht(),xp=xi,xl=Bi,kl=Xs,kp=Qs,Dp=Ys,jp=(e,t,r,n)=>{e=new Np(e,n),t=new $p(t,n);let i,o,s,f,l;switch(r){case">":i=xl,o=kp,s=kl,f=">",l=">=";break;case"<":i=kl,o=Dp,s=xl,f="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(xp(e,t,n))return!1;for(let u=0;u<t.set.length;++u){const c=t.set[u];let h=null,m=null;if(c.forEach(y=>{y.semver===Bp&&(y=new Yu(">=0.0.0")),h=h||y,m=m||y,i(y.semver,h.semver,n)?h=y:s(y.semver,m.semver,n)&&(m=y)}),h.operator===f||h.operator===l||(!m.operator||m.operator===f)&&o(e,m.semver))return!1;if(m.operator===l&&s(e,m.semver))return!1}return!0};var ea=jp;const Mp=ea,Up=(e,t,r)=>Mp(e,t,">",r);var Fp=Up;const Hp=ea,zp=(e,t,r)=>Hp(e,t,"<",r);var Wp=zp;const Dl=Ht(),Vp=(e,t,r)=>(e=new Dl(e,r),t=new Dl(t,r),e.intersects(t,r));var qp=Vp;const Gp=xi,Zp=Ft;var Kp=(e,t,r)=>{const n=[];let i=null,o=null;const s=e.sort((c,h)=>Zp(c,h,r));for(const c of s)Gp(c,t,r)?(o=c,i||(i=c)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);const f=[];for(const[c,h]of n)c===h?f.push(c):!h&&c===s[0]?f.push("*"):h?c===s[0]?f.push(`<=${h}`):f.push(`${c} - ${h}`):f.push(`>=${c}`);const l=f.join(" || "),u=typeof t.raw=="string"?t.raw:String(t);return l.length<u.length?l:t};const jl=Ht(),ta=$i(),{ANY:Do}=ta,hn=xi,ra=Ft,Jp=(e,t,r={})=>{if(e===t)return!0;e=new jl(e,r),t=new jl(t,r);let n=!1;e:for(const i of e.set){for(const o of t.set){const s=Yp(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},Xp=[new ta(">=0.0.0-0")],Ml=[new ta(">=0.0.0")],Yp=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Do){if(t.length===1&&t[0].semver===Do)return!0;r.includePrerelease?e=Xp:e=Ml}if(t.length===1&&t[0].semver===Do){if(r.includePrerelease)return!0;t=Ml}const n=new Set;let i,o;for(const y of e)y.operator===">"||y.operator===">="?i=Ul(i,y,r):y.operator==="<"||y.operator==="<="?o=Fl(o,y,r):n.add(y.semver);if(n.size>1)return null;let s;if(i&&o){if(s=ra(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(const y of n){if(i&&!hn(y,String(i),r)||o&&!hn(y,String(o),r))return null;for(const v of t)if(!hn(y,String(v),r))return!1;return!0}let f,l,u,c,h=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,m=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;h&&h.prerelease.length===1&&o.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(const y of t){if(c=c||y.operator===">"||y.operator===">=",u=u||y.operator==="<"||y.operator==="<=",i){if(m&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===m.major&&y.semver.minor===m.minor&&y.semver.patch===m.patch&&(m=!1),y.operator===">"||y.operator===">="){if(f=Ul(i,y,r),f===y&&f!==i)return!1}else if(i.operator===">="&&!hn(i.semver,String(y),r))return!1}if(o){if(h&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===h.major&&y.semver.minor===h.minor&&y.semver.patch===h.patch&&(h=!1),y.operator==="<"||y.operator==="<="){if(l=Fl(o,y,r),l===y&&l!==o)return!1}else if(o.operator==="<="&&!hn(o.semver,String(y),r))return!1}if(!y.operator&&(o||i)&&s!==0)return!1}return!(i&&u&&!o&&s!==0||o&&c&&!i&&s!==0||m||h)},Ul=(e,t,r)=>{if(!e)return t;const n=ra(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Fl=(e,t,r)=>{if(!e)return t;const n=ra(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var Qp=Jp;const jo=xn,Hl=Li,ey=yt,zl=Gu,ty=sn,ry=tb,ny=ib,iy=sb,oy=lb,sy=cb,ay=gb,ly=pb,fy=mb,uy=Ft,cy=Rb,dy=Tb,hy=Js,gy=Lb,_y=$b,by=Bi,py=Xs,yy=Zu,wy=Ku,my=Ys,Ey=Qs,vy=Ju,Sy=np,Ry=$i(),Ay=Ht(),Iy=xi,Ty=pp,Oy=Ep,Py=Ap,Cy=Op,Ly=Lp,Ny=ea,By=Fp,$y=Wp,xy=qp,ky=Kp,Dy=Qp;var jy={parse:ty,valid:ry,clean:ny,inc:iy,diff:oy,major:sy,minor:ay,patch:ly,prerelease:fy,compare:uy,rcompare:cy,compareLoose:dy,compareBuild:hy,sort:gy,rsort:_y,gt:by,lt:py,eq:yy,neq:wy,gte:my,lte:Ey,cmp:vy,coerce:Sy,Comparator:Ry,Range:Ay,satisfies:Iy,toComparators:Ty,maxSatisfying:Oy,minSatisfying:Py,minVersion:Cy,validRange:Ly,outside:Ny,gtr:By,ltr:$y,intersects:xy,simplifyRange:ky,subset:Dy,SemVer:ey,re:jo.re,src:jo.src,tokens:jo.t,SEMVER_SPEC_VERSION:Hl.SEMVER_SPEC_VERSION,RELEASE_TYPES:Hl.RELEASE_TYPES,compareIdentifiers:zl.compareIdentifiers,rcompareIdentifiers:zl.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=jy,r=Br,n=ut;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",h=>(0,t.valid)(h)===null?`Expected SemVer version, got "${h}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",h=>(0,t.validRange)(h)===null?`Expected SemVer range, got "${h}"`:!0);function i(h){return(0,r.is)(h,e.VersionStruct)}e.isValidSemVerVersion=i;function o(h){return(0,r.is)(h,e.VersionRangeStruct)}e.isValidSemVerRange=o;function s(h){(0,n.assertStruct)(h,e.VersionStruct)}e.assertIsSemVerVersion=s;function f(h){(0,n.assertStruct)(h,e.VersionRangeStruct)}e.assertIsSemVerRange=f;function l(h,m){return(0,t.gt)(h,m)}e.gtVersion=l;function u(h,m){return(0,t.gtr)(h,m)}e.gtRange=u;function c(h,m){return(0,t.satisfies)(h,m,{includePrerelease:!0})}e.satisfiesVersionRange=c})(Wu);(function(e){var t=x.commonjsGlobal&&x.commonjsGlobal.__createBinding||(Object.create?function(n,i,o,s){s===void 0&&(s=o);var f=Object.getOwnPropertyDescriptor(i,o);(!f||("get"in f?!i.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,s,f)}:function(n,i,o,s){s===void 0&&(s=o),n[s]=i[o]}),r=x.commonjsGlobal&&x.commonjsGlobal.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(ut,e),r(Bn,e),r(Me,e),r(Pi,e),r(qt,e),r(Kr,e),r(Du,e),r($n,e),r(ju,e),r(Mu,e),r(Jr,e),r(Uu,e),r(Gt,e),r(Fu,e),r(Hu,e),r(zu,e),r(Wu,e)})(Ws);var ki={},pr={};Object.defineProperty(pr,"__esModule",{value:!0});pr.errorValues=pr.errorCodes=void 0;pr.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};pr.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeCause=e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Ws,r=pr,n=r.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",o={code:n,message:s(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function s(y,v=i){if(f(y)){const G=y.toString();if((0,t.hasProperty)(r.errorValues,G))return r.errorValues[G].message;if(c(y))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return v}e.getMessageFromCode=s;function f(y){return Number.isInteger(y)}e.isValidCode=f;function l(y,{fallbackError:v=o,shouldIncludeStack:G=!0}={}){if(!(0,t.isJsonRpcError)(v))throw new Error("Must provide fallback error with integer number code and string message.");const M=u(y,v);return G||delete M.stack,M}e.serializeError=l;function u(y,v){if(y&&typeof y=="object"&&"serialize"in y&&typeof y.serialize=="function")return y.serialize();if((0,t.isJsonRpcError)(y))return y;const G=h(y);return{...v,data:{cause:G}}}function c(y){return y>=-32099&&y<=-32e3}function h(y){return Array.isArray(y)?y.map(v=>(0,t.isValidJson)(v)?v:(0,t.isObject)(v)?m(v):null):(0,t.isObject)(y)?m(y):(0,t.isValidJson)(y)?y:null}e.serializeCause=h;function m(y){return Object.getOwnPropertyNames(y).reduce((v,G)=>{const M=y[G];return(0,t.isValidJson)(M)&&(v[G]=M),v},{})}})(ki);var My=x.commonjsGlobal&&x.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.EthereumProviderError=Cr.JsonRpcError=void 0;const Uy=Ws,Fy=My(Os),Hy=ki;class Qu extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a non-empty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data,(0,Uy.isPlainObject)(this.data)&&(t.data.cause=(0,Hy.serializeCause)(this.data.cause))),this.stack&&(t.stack=this.stack),t}toString(){return(0,Fy.default)(this.serialize(),Vy,2)}}Cr.JsonRpcError=Qu;class zy extends Qu{constructor(t,r,n){if(!Wy(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}Cr.EthereumProviderError=zy;function Wy(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function Vy(e,t){if(t!=="[Circular]")return t}var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.providerErrors=Xr.rpcErrors=void 0;const na=Cr,gt=pr,ec=ki;Xr.rpcErrors={parse:e=>It(gt.errorCodes.rpc.parse,e),invalidRequest:e=>It(gt.errorCodes.rpc.invalidRequest,e),invalidParams:e=>It(gt.errorCodes.rpc.invalidParams,e),methodNotFound:e=>It(gt.errorCodes.rpc.methodNotFound,e),internal:e=>It(gt.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return It(t,e)},invalidInput:e=>It(gt.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>It(gt.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>It(gt.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>It(gt.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>It(gt.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>It(gt.errorCodes.rpc.limitExceeded,e)};Xr.providerErrors={userRejectedRequest:e=>gn(gt.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>gn(gt.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>gn(gt.errorCodes.provider.unsupportedMethod,e),disconnected:e=>gn(gt.errorCodes.provider.disconnected,e),chainDisconnected:e=>gn(gt.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new na.EthereumProviderError(t,r,n)}};function It(e,t){const[r,n]=tc(t);return new na.JsonRpcError(e,r??(0,ec.getMessageFromCode)(e),n)}function gn(e,t){const[r,n]=tc(t);return new na.EthereumProviderError(e,r??(0,ec.getMessageFromCode)(e),n)}function tc(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t??void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorCodes=e.providerErrors=e.rpcErrors=e.getMessageFromCode=e.serializeError=e.serializeCause=e.EthereumProviderError=e.JsonRpcError=void 0;var t=Cr;Object.defineProperty(e,"JsonRpcError",{enumerable:!0,get:function(){return t.JsonRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});var r=ki;Object.defineProperty(e,"serializeCause",{enumerable:!0,get:function(){return r.serializeCause}}),Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});var n=Xr;Object.defineProperty(e,"rpcErrors",{enumerable:!0,get:function(){return n.rpcErrors}}),Object.defineProperty(e,"providerErrors",{enumerable:!0,get:function(){return n.providerErrors}});var i=pr;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(t_);var ia={exports:{}},qy=rc;function rc(e,t){if(e&&t)return rc(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){r[n]=e[n]}),r;function r(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var o=e.apply(this,n),s=n[n.length-1];return typeof o=="function"&&o!==s&&Object.keys(s).forEach(function(f){o[f]=s[f]}),o}}var nc=qy;ia.exports=nc(ni);ia.exports.strict=nc(ic);ni.proto=ni(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return ni(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return ic(this)},configurable:!0})});function ni(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function ic(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}var oa=ia.exports;const Gy=x.getDefaultExportFromCjs(oa);var Zy=oa,Ky=function(){},Jy=function(e){return e.setHeader&&typeof e.abort=="function"},Xy=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},oc=function(e,t,r){if(typeof t=="function")return oc(e,null,t);t||(t={}),r=Zy(r||Ky);var n=e._writableState,i=e._readableState,o=t.readable||t.readable!==!1&&e.readable,s=t.writable||t.writable!==!1&&e.writable,f=!1,l=function(){e.writable||u()},u=function(){s=!1,o||r.call(e)},c=function(){o=!1,s||r.call(e)},h=function(M){r.call(e,M?new Error("exited with error code: "+M):null)},m=function(M){r.call(e,M)},y=function(){x.dist.process.nextTick(v)},v=function(){if(!f){if(o&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"));if(s&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"))}},G=function(){e.req.on("finish",u)};return Jy(e)?(e.on("complete",u),e.on("abort",y),e.req?G():e.on("request",G)):s&&!n&&(e.on("end",l),e.on("close",l)),Xy(e)&&e.on("exit",h),e.on("end",c),e.on("finish",u),t.error!==!1&&e.on("error",m),e.on("close",y),function(){f=!0,e.removeListener("complete",u),e.removeListener("abort",y),e.removeListener("request",G),e.req&&e.req.removeListener("finish",u),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",u),e.removeListener("exit",h),e.removeListener("end",c),e.removeListener("error",m),e.removeListener("close",y)}},sc=oc;const Wl=x.getDefaultExportFromCjs(sc);var Yy=oa,Qy=sc,Mo=x.require$$2,On=function(){},ew=/^v?\.0/.test(x.dist.process.version),Di=function(e){return typeof e=="function"},tw=function(e){return!ew||!Mo?!1:(e instanceof(Mo.ReadStream||On)||e instanceof(Mo.WriteStream||On))&&Di(e.close)},rw=function(e){return e.setHeader&&Di(e.abort)},nw=function(e,t,r,n){n=Yy(n);var i=!1;e.on("close",function(){i=!0}),Qy(e,{readable:t,writable:r},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,tw(e))return e.close(On);if(rw(e))return e.abort();if(Di(e.destroy))return e.destroy();n(s||new Error("stream was destroyed"))}}},Vl=function(e){e()},iw=function(e,t){return e.pipe(t)},ow=function(){var e=Array.prototype.slice.call(arguments),t=Di(e[e.length-1]||On)&&e.pop()||On;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var r,n=e.map(function(i,o){var s=o<e.length-1,f=o>0;return nw(i,s,f,function(l){r||(r=l),l&&n.forEach(Vl),!s&&(n.forEach(Vl),t(r))})});return e.reduce(iw)},sw=ow;const ql=x.getDefaultExportFromCjs(sw);var aw={},ji={},Mi={},ac={},Yr={},Ui={},at={};Object.defineProperty(at,"__esModule",{value:!0});at.output=at.exists=at.hash=at.bytes=at.bool=at.number=void 0;function ui(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}at.number=ui;function lc(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}at.bool=lc;function sa(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}at.bytes=sa;function fc(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ui(e.outputLen),ui(e.blockLen)}at.hash=fc;function uc(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}at.exists=uc;function cc(e,t){sa(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}at.output=cc;const lw={number:ui,bool:lc,bytes:sa,hash:fc,exists:uc,output:cc};at.default=lw;var ar={},Fi={};Object.defineProperty(Fi,"__esModule",{value:!0});Fi.crypto=void 0;Fi.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;(function(e){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.isLE=e.rotr=e.createView=e.u32=e.u8=void 0;const t=Fi,r=k=>k instanceof Uint8Array,n=k=>new Uint8Array(k.buffer,k.byteOffset,k.byteLength);e.u8=n;const i=k=>new Uint32Array(k.buffer,k.byteOffset,Math.floor(k.byteLength/4));e.u32=i;const o=k=>new DataView(k.buffer,k.byteOffset,k.byteLength);e.createView=o;const s=(k,U)=>k<<32-U|k>>>U;if(e.rotr=s,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!e.isLE)throw new Error("Non little-endian hardware is not supported");const f=Array.from({length:256},(k,U)=>U.toString(16).padStart(2,"0"));function l(k){if(!r(k))throw new Error("Uint8Array expected");let U="";for(let te=0;te<k.length;te++)U+=f[k[te]];return U}e.bytesToHex=l;function u(k){if(typeof k!="string")throw new Error("hex string expected, got "+typeof k);const U=k.length;if(U%2)throw new Error("padded hex string expected, got unpadded hex of length "+U);const te=new Uint8Array(U/2);for(let W=0;W<te.length;W++){const P=W*2,Z=k.slice(P,P+2),_=Number.parseInt(Z,16);if(Number.isNaN(_)||_<0)throw new Error("Invalid byte sequence");te[W]=_}return te}e.hexToBytes=u;const c=async()=>{};e.nextTick=c;async function h(k,U,te){let W=Date.now();for(let P=0;P<k;P++){te(P);const Z=Date.now()-W;Z>=0&&Z<U||(await(0,e.nextTick)(),W+=Z)}}e.asyncLoop=h;function m(k){if(typeof k!="string")throw new Error(`utf8ToBytes expected string, got ${typeof k}`);return new Uint8Array(new TextEncoder().encode(k))}e.utf8ToBytes=m;function y(k){if(typeof k=="string"&&(k=m(k)),!r(k))throw new Error(`expected Uint8Array, got ${typeof k}`);return k}e.toBytes=y;function v(...k){const U=new Uint8Array(k.reduce((W,P)=>W+P.length,0));let te=0;return k.forEach(W=>{if(!r(W))throw new Error("Uint8Array expected");U.set(W,te),te+=W.length}),U}e.concatBytes=v;class G{clone(){return this._cloneInto()}}e.Hash=G;const M=k=>Object.prototype.toString.call(k)==="[object Object]"&&k.constructor===Object;function j(k,U){if(U!==void 0&&(typeof U!="object"||!M(U)))throw new Error("Options should be object or undefined");return Object.assign(k,U)}e.checkOpts=j;function E(k){const U=W=>k().update(y(W)).digest(),te=k();return U.outputLen=te.outputLen,U.blockLen=te.blockLen,U.create=()=>k(),U}e.wrapConstructor=E;function z(k){const U=(W,P)=>k(P).update(y(W)).digest(),te=k({});return U.outputLen=te.outputLen,U.blockLen=te.blockLen,U.create=W=>k(W),U}e.wrapConstructorWithOpts=z;function R(k){const U=(W,P)=>k(P).update(y(W)).digest(),te=k({});return U.outputLen=te.outputLen,U.blockLen=te.blockLen,U.create=W=>k(W),U}e.wrapXOFConstructorWithOpts=R;function q(k=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(k));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=q})(ar);Object.defineProperty(Ui,"__esModule",{value:!0});Ui.SHA2=void 0;const Uo=at,_n=ar;function fw(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),f=Number(r&o),l=n?4:0,u=n?0:4;e.setUint32(t+l,s,n),e.setUint32(t+u,f,n)}class uw extends _n.Hash{constructor(t,r,n,i){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,_n.createView)(this.buffer)}update(t){Uo.default.exists(this);const{view:r,buffer:n,blockLen:i}=this;t=(0,_n.toBytes)(t);const o=t.length;for(let s=0;s<o;){const f=Math.min(i-this.pos,o-s);if(f===i){const l=(0,_n.createView)(t);for(;i<=o-s;s+=i)this.process(l,s);continue}n.set(t.subarray(s,s+f),this.pos),this.pos+=f,s+=f,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Uo.default.exists(this),Uo.default.output(t,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:o}=this;let{pos:s}=this;r[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(n,0),s=0);for(let h=s;h<i;h++)r[h]=0;fw(n,i-8,BigInt(this.length*8),o),this.process(n,0);const f=(0,_n.createView)(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,c=this.get();if(u>c.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<u;h++)f.setUint32(4*h,c[h],o)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:o,destroyed:s,pos:f}=this;return t.length=i,t.pos=f,t.finished=o,t.destroyed=s,i%r&&t.buffer.set(n),t}}Ui.SHA2=uw;Object.defineProperty(Yr,"__esModule",{value:!0});Yr.sha224=Yr.sha256=void 0;const cw=Ui,Ot=ar,dw=(e,t,r)=>e&t^~e&r,hw=(e,t,r)=>e&t^e&r^t&r,gw=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ur=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),cr=new Uint32Array(64);class dc extends cw.SHA2{constructor(){super(64,32,8,!1),this.A=ur[0]|0,this.B=ur[1]|0,this.C=ur[2]|0,this.D=ur[3]|0,this.E=ur[4]|0,this.F=ur[5]|0,this.G=ur[6]|0,this.H=ur[7]|0}get(){const{A:t,B:r,C:n,D:i,E:o,F:s,G:f,H:l}=this;return[t,r,n,i,o,s,f,l]}set(t,r,n,i,o,s,f,l){this.A=t|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=f|0,this.H=l|0}process(t,r){for(let h=0;h<16;h++,r+=4)cr[h]=t.getUint32(r,!1);for(let h=16;h<64;h++){const m=cr[h-15],y=cr[h-2],v=(0,Ot.rotr)(m,7)^(0,Ot.rotr)(m,18)^m>>>3,G=(0,Ot.rotr)(y,17)^(0,Ot.rotr)(y,19)^y>>>10;cr[h]=G+cr[h-7]+v+cr[h-16]|0}let{A:n,B:i,C:o,D:s,E:f,F:l,G:u,H:c}=this;for(let h=0;h<64;h++){const m=(0,Ot.rotr)(f,6)^(0,Ot.rotr)(f,11)^(0,Ot.rotr)(f,25),y=c+m+dw(f,l,u)+gw[h]+cr[h]|0,G=((0,Ot.rotr)(n,2)^(0,Ot.rotr)(n,13)^(0,Ot.rotr)(n,22))+hw(n,i,o)|0;c=u,u=l,l=f,f=s+y|0,s=o,o=i,i=n,n=y+G|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,f=f+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(n,i,o,s,f,l,u,c)}roundClean(){cr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class _w extends dc{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}Yr.sha256=(0,Ot.wrapConstructor)(()=>new dc);Yr.sha224=(0,Ot.wrapConstructor)(()=>new _w);var Le={},Ce={};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.validateObject=Ce.createHmacDrbg=Ce.bitMask=Ce.bitSet=Ce.bitGet=Ce.bitLen=Ce.utf8ToBytes=Ce.equalBytes=Ce.concatBytes=Ce.ensureBytes=Ce.numberToVarBytesBE=Ce.numberToBytesLE=Ce.numberToBytesBE=Ce.bytesToNumberLE=Ce.bytesToNumberBE=Ce.hexToBytes=Ce.hexToNumber=Ce.numberToHexUnpadded=Ce.bytesToHex=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const hc=BigInt(0),Hi=BigInt(1),bw=BigInt(2),zi=e=>e instanceof Uint8Array,pw=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function aa(e){if(!zi(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=pw[e[r]];return t}Ce.bytesToHex=aa;function gc(e){const t=e.toString(16);return t.length&1?`0${t}`:t}Ce.numberToHexUnpadded=gc;function la(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}Ce.hexToNumber=la;function Wi(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let n=0;n<r.length;n++){const i=n*2,o=e.slice(i,i+2),s=Number.parseInt(o,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");r[n]=s}return r}Ce.hexToBytes=Wi;function yw(e){return la(aa(e))}Ce.bytesToNumberBE=yw;function ww(e){if(!zi(e))throw new Error("Uint8Array expected");return la(aa(Uint8Array.from(e).reverse()))}Ce.bytesToNumberLE=ww;function _c(e,t){return Wi(e.toString(16).padStart(t*2,"0"))}Ce.numberToBytesBE=_c;function mw(e,t){return _c(e,t).reverse()}Ce.numberToBytesLE=mw;function Ew(e){return Wi(gc(e))}Ce.numberToVarBytesBE=Ew;function vw(e,t,r){let n;if(typeof t=="string")try{n=Wi(t)}catch(o){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${o}`)}else if(zi(t))n=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(`${e} expected ${r} bytes, got ${i}`);return n}Ce.ensureBytes=vw;function bc(...e){const t=new Uint8Array(e.reduce((n,i)=>n+i.length,0));let r=0;return e.forEach(n=>{if(!zi(n))throw new Error("Uint8Array expected");t.set(n,r),r+=n.length}),t}Ce.concatBytes=bc;function Sw(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}Ce.equalBytes=Sw;function Rw(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}Ce.utf8ToBytes=Rw;function Aw(e){let t;for(t=0;e>hc;e>>=Hi,t+=1);return t}Ce.bitLen=Aw;function Iw(e,t){return e>>BigInt(t)&Hi}Ce.bitGet=Iw;const Tw=(e,t,r)=>e|(r?Hi:hc)<<BigInt(t);Ce.bitSet=Tw;const Ow=e=>(bw<<BigInt(e-1))-Hi;Ce.bitMask=Ow;const Fo=e=>new Uint8Array(e),Gl=e=>Uint8Array.from(e);function Pw(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=Fo(e),i=Fo(e),o=0;const s=()=>{n.fill(1),i.fill(0),o=0},f=(...h)=>r(i,n,...h),l=(h=Fo())=>{i=f(Gl([0]),h),n=f(),h.length!==0&&(i=f(Gl([1]),h),n=f())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let h=0;const m=[];for(;h<t;){n=f();const y=n.slice();m.push(y),h+=n.length}return bc(...m)};return(h,m)=>{s(),l(h);let y;for(;!(y=m(u()));)l();return s(),y}}Ce.createHmacDrbg=Pw;const Cw={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Lw(e,t,r={}){const n=(i,o,s)=>{const f=Cw[o];if(typeof f!="function")throw new Error(`Invalid validator "${o}", expected function`);const l=e[i];if(!(s&&l===void 0)&&!f(l,e))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${o}`)};for(const[i,o]of Object.entries(t))n(i,o,!1);for(const[i,o]of Object.entries(r))n(i,o,!0);return e}Ce.validateObject=Lw;Object.defineProperty(Le,"__esModule",{value:!0});Le.hashToPrivateScalar=Le.FpSqrtEven=Le.FpSqrtOdd=Le.Field=Le.nLength=Le.FpIsSquare=Le.FpDiv=Le.FpInvertBatch=Le.FpPow=Le.validateField=Le.isNegativeLE=Le.FpSqrt=Le.tonelliShanks=Le.invert=Le.pow2=Le.pow=Le.mod=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ir=Ce,lt=BigInt(0),Je=BigInt(1),gr=BigInt(2),Nw=BigInt(3),ws=BigInt(4),Zl=BigInt(5),Kl=BigInt(8);BigInt(9);BigInt(16);function Pt(e,t){const r=e%t;return r>=lt?r:t+r}Le.mod=Pt;function pc(e,t,r){if(r<=lt||t<lt)throw new Error("Expected power/modulo > 0");if(r===Je)return lt;let n=Je;for(;t>lt;)t&Je&&(n=n*e%r),e=e*e%r,t>>=Je;return n}Le.pow=pc;function Bw(e,t,r){let n=e;for(;t-- >lt;)n*=n,n%=r;return n}Le.pow2=Bw;function ci(e,t){if(e===lt||t<=lt)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Pt(e,t),n=t,i=lt,o=Je;for(;r!==lt;){const f=n/r,l=n%r,u=i-o*f;n=r,r=l,i=o,o=u}if(n!==Je)throw new Error("invert: does not exist");return Pt(i,t)}Le.invert=ci;function yc(e){const t=(e-Je)/gr;let r,n,i;for(r=e-Je,n=0;r%gr===lt;r/=gr,n++);for(i=gr;i<e&&pc(i,t,e)!==e-Je;i++);if(n===1){const s=(e+Je)/ws;return function(l,u){const c=l.pow(u,s);if(!l.eql(l.sqr(c),u))throw new Error("Cannot find square root");return c}}const o=(r+Je)/gr;return function(f,l){if(f.pow(l,t)===f.neg(f.ONE))throw new Error("Cannot find square root");let u=n,c=f.pow(f.mul(f.ONE,i),r),h=f.pow(l,o),m=f.pow(l,r);for(;!f.eql(m,f.ONE);){if(f.eql(m,f.ZERO))return f.ZERO;let y=1;for(let G=f.sqr(m);y<u&&!f.eql(G,f.ONE);y++)G=f.sqr(G);const v=f.pow(c,Je<<BigInt(u-y-1));c=f.sqr(v),h=f.mul(h,v),m=f.mul(m,c),u=y}return h}}Le.tonelliShanks=yc;function wc(e){if(e%ws===Nw){const t=(e+Je)/ws;return function(n,i){const o=n.pow(i,t);if(!n.eql(n.sqr(o),i))throw new Error("Cannot find square root");return o}}if(e%Kl===Zl){const t=(e-Zl)/Kl;return function(n,i){const o=n.mul(i,gr),s=n.pow(o,t),f=n.mul(i,s),l=n.mul(n.mul(f,gr),s),u=n.mul(f,n.sub(l,n.ONE));if(!n.eql(n.sqr(u),i))throw new Error("Cannot find square root");return u}}return yc(e)}Le.FpSqrt=wc;const $w=(e,t)=>(Pt(e,t)&Je)===Je;Le.isNegativeLE=$w;const xw=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function kw(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=xw.reduce((n,i)=>(n[i]="function",n),t);return(0,ir.validateObject)(e,r)}Le.validateField=kw;function mc(e,t,r){if(r<lt)throw new Error("Expected power > 0");if(r===lt)return e.ONE;if(r===Je)return t;let n=e.ONE,i=t;for(;r>lt;)r&Je&&(n=e.mul(n,i)),i=e.sqr(i),r>>=Je;return n}Le.FpPow=mc;function Ec(e,t){const r=new Array(t.length),n=t.reduce((o,s,f)=>e.is0(s)?o:(r[f]=o,e.mul(o,s)),e.ONE),i=e.inv(n);return t.reduceRight((o,s,f)=>e.is0(s)?o:(r[f]=e.mul(o,r[f]),e.mul(o,s)),i),r}Le.FpInvertBatch=Ec;function Dw(e,t,r){return e.mul(t,typeof r=="bigint"?ci(r,e.ORDER):e.inv(r))}Le.FpDiv=Dw;function jw(e){const t=(e.ORDER-Je)/gr;return r=>{const n=e.pow(r,t);return e.eql(n,e.ZERO)||e.eql(n,e.ONE)}}Le.FpIsSquare=jw;function fa(e,t){const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}Le.nLength=fa;function Mw(e,t,r=!1,n={}){if(e<=lt)throw new Error(`Expected Fp ORDER > 0, got ${e}`);const{nBitLength:i,nByteLength:o}=fa(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=wc(e),f=Object.freeze({ORDER:e,BITS:i,BYTES:o,MASK:(0,ir.bitMask)(i),ZERO:lt,ONE:Je,create:l=>Pt(l,e),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return lt<=l&&l<e},is0:l=>l===lt,isOdd:l=>(l&Je)===Je,neg:l=>Pt(-l,e),eql:(l,u)=>l===u,sqr:l=>Pt(l*l,e),add:(l,u)=>Pt(l+u,e),sub:(l,u)=>Pt(l-u,e),mul:(l,u)=>Pt(l*u,e),pow:(l,u)=>mc(f,l,u),div:(l,u)=>Pt(l*ci(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>ci(l,e),sqrt:n.sqrt||(l=>s(f,l)),invertBatch:l=>Ec(f,l),cmov:(l,u,c)=>c?u:l,toBytes:l=>r?(0,ir.numberToBytesLE)(l,o):(0,ir.numberToBytesBE)(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return r?(0,ir.bytesToNumberLE)(l):(0,ir.bytesToNumberBE)(l)}});return Object.freeze(f)}Le.Field=Mw;function Uw(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)}Le.FpSqrtOdd=Uw;function Fw(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r}Le.FpSqrtEven=Fw;function Hw(e,t,r=!1){e=(0,ir.ensureBytes)("privateHash",e);const n=e.length,i=fa(t).nByteLength+8;if(i<24||n<i||n>1024)throw new Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${n}`);const o=r?(0,ir.bytesToNumberLE)(e):(0,ir.bytesToNumberBE)(e);return Pt(o,t-Je)+Je}Le.hashToPrivateScalar=Hw;var ua={},Qr={};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.validateBasic=Qr.wNAF=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Jl=Le,zw=Ce,Ww=BigInt(0),Ho=BigInt(1);function Vw(e,t){const r=(i,o)=>{const s=o.negate();return i?s:o},n=i=>{const o=Math.ceil(t/i)+1,s=2**(i-1);return{windows:o,windowSize:s}};return{constTimeNegate:r,unsafeLadder(i,o){let s=e.ZERO,f=i;for(;o>Ww;)o&Ho&&(s=s.add(f)),f=f.double(),o>>=Ho;return s},precomputeWindow(i,o){const{windows:s,windowSize:f}=n(o),l=[];let u=i,c=u;for(let h=0;h<s;h++){c=u,l.push(c);for(let m=1;m<f;m++)c=c.add(u),l.push(c);u=c.double()}return l},wNAF(i,o,s){const{windows:f,windowSize:l}=n(i);let u=e.ZERO,c=e.BASE;const h=BigInt(2**i-1),m=2**i,y=BigInt(i);for(let v=0;v<f;v++){const G=v*l;let M=Number(s&h);s>>=y,M>l&&(M-=m,s+=Ho);const j=G,E=G+Math.abs(M)-1,z=v%2!==0,R=M<0;M===0?c=c.add(r(z,o[j])):u=u.add(r(R,o[E]))}return{p:u,f:c}},wNAFCached(i,o,s,f){const l=i._WINDOW_SIZE||1;let u=o.get(i);return u||(u=this.precomputeWindow(i,l),l!==1&&o.set(i,f(u))),this.wNAF(l,u,s)}}}Qr.wNAF=Vw;function qw(e){return(0,Jl.validateField)(e.Fp),(0,zw.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,Jl.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}Qr.validateBasic=qw;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mapToCurveSimpleSWU=e.SWUFpSqrtRatio=e.weierstrass=e.weierstrassPoints=e.DER=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=Le,r=Ce,n=Ce,i=Qr;function o(E){const z=(0,i.validateBasic)(E);r.validateObject(z,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:R,Fp:q,a:k}=z;if(R){if(!q.eql(k,q.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof R!="object"||typeof R.beta!="bigint"||typeof R.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...z})}const{bytesToNumberBE:s,hexToBytes:f}=r;e.DER={Err:class extends Error{constructor(z=""){super(z)}},_parseInt(E){const{Err:z}=e.DER;if(E.length<2||E[0]!==2)throw new z("Invalid signature integer tag");const R=E[1],q=E.subarray(2,R+2);if(!R||q.length!==R)throw new z("Invalid signature integer: wrong length");if(q[0]&128)throw new z("Invalid signature integer: negative");if(q[0]===0&&!(q[1]&128))throw new z("Invalid signature integer: unnecessary leading zero");return{d:s(q),l:E.subarray(R+2)}},toSig(E){const{Err:z}=e.DER,R=typeof E=="string"?f(E):E;if(!(R instanceof Uint8Array))throw new Error("ui8a expected");let q=R.length;if(q<2||R[0]!=48)throw new z("Invalid signature tag");if(R[1]!==q-2)throw new z("Invalid signature: incorrect length");const{d:k,l:U}=e.DER._parseInt(R.subarray(2)),{d:te,l:W}=e.DER._parseInt(U);if(W.length)throw new z("Invalid signature: left bytes after parsing");return{r:k,s:te}},hexFromSig(E){const z=Z=>Number.parseInt(Z[0],16)&8?"00"+Z:Z,R=Z=>{const _=Z.toString(16);return _.length&1?`0${_}`:_},q=z(R(E.s)),k=z(R(E.r)),U=q.length/2,te=k.length/2,W=R(U),P=R(te);return`30${R(te+U+4)}02${P}${k}02${W}${q}`}};const l=BigInt(0),u=BigInt(1),c=BigInt(2),h=BigInt(3),m=BigInt(4);function y(E){const z=o(E),{Fp:R}=z,q=z.toBytes||((V,L,D)=>{const N=L.toAffine();return r.concatBytes(Uint8Array.from([4]),R.toBytes(N.x),R.toBytes(N.y))}),k=z.fromBytes||(V=>{const L=V.subarray(1),D=R.fromBytes(L.subarray(0,R.BYTES)),N=R.fromBytes(L.subarray(R.BYTES,2*R.BYTES));return{x:D,y:N}});function U(V){const{a:L,b:D}=z,N=R.sqr(V),O=R.mul(N,V);return R.add(R.add(O,R.mul(V,L)),D)}if(!R.eql(R.sqr(z.Gy),U(z.Gx)))throw new Error("bad generator point: equation left != right");function te(V){return typeof V=="bigint"&&l<V&&V<z.n}function W(V){if(!te(V))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function P(V){const{allowedPrivateKeyLengths:L,nByteLength:D,wrapPrivateKey:N,n:O}=z;if(L&&typeof V!="bigint"){if(V instanceof Uint8Array&&(V=r.bytesToHex(V)),typeof V!="string"||!L.includes(V.length))throw new Error("Invalid key");V=V.padStart(D*2,"0")}let X;try{X=typeof V=="bigint"?V:r.bytesToNumberBE((0,n.ensureBytes)("private key",V,D))}catch{throw new Error(`private key must be ${D} bytes, hex or bigint, not ${typeof V}`)}return N&&(X=t.mod(X,O)),W(X),X}const Z=new Map;function _(V){if(!(V instanceof p))throw new Error("ProjectivePoint expected")}class p{constructor(L,D,N){if(this.px=L,this.py=D,this.pz=N,L==null||!R.isValid(L))throw new Error("x required");if(D==null||!R.isValid(D))throw new Error("y required");if(N==null||!R.isValid(N))throw new Error("z required")}static fromAffine(L){const{x:D,y:N}=L||{};if(!L||!R.isValid(D)||!R.isValid(N))throw new Error("invalid affine point");if(L instanceof p)throw new Error("projective point not allowed");const O=X=>R.eql(X,R.ZERO);return O(D)&&O(N)?p.ZERO:new p(D,N,R.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(L){const D=R.invertBatch(L.map(N=>N.pz));return L.map((N,O)=>N.toAffine(D[O])).map(p.fromAffine)}static fromHex(L){const D=p.fromAffine(k((0,n.ensureBytes)("pointHex",L)));return D.assertValidity(),D}static fromPrivateKey(L){return p.BASE.multiply(P(L))}_setWindowSize(L){this._WINDOW_SIZE=L,Z.delete(this)}assertValidity(){if(this.is0()){if(z.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:L,y:D}=this.toAffine();if(!R.isValid(L)||!R.isValid(D))throw new Error("bad point: x or y not FE");const N=R.sqr(D),O=U(L);if(!R.eql(N,O))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:L}=this.toAffine();if(R.isOdd)return!R.isOdd(L);throw new Error("Field doesn't support isOdd")}equals(L){_(L);const{px:D,py:N,pz:O}=this,{px:X,py:ie,pz:ne}=L,ae=R.eql(R.mul(D,ne),R.mul(X,O)),de=R.eql(R.mul(N,ne),R.mul(ie,O));return ae&&de}negate(){return new p(this.px,R.neg(this.py),this.pz)}double(){const{a:L,b:D}=z,N=R.mul(D,h),{px:O,py:X,pz:ie}=this;let ne=R.ZERO,ae=R.ZERO,de=R.ZERO,ge=R.mul(O,O),Se=R.mul(X,X),_e=R.mul(ie,ie),pe=R.mul(O,X);return pe=R.add(pe,pe),de=R.mul(O,ie),de=R.add(de,de),ne=R.mul(L,de),ae=R.mul(N,_e),ae=R.add(ne,ae),ne=R.sub(Se,ae),ae=R.add(Se,ae),ae=R.mul(ne,ae),ne=R.mul(pe,ne),de=R.mul(N,de),_e=R.mul(L,_e),pe=R.sub(ge,_e),pe=R.mul(L,pe),pe=R.add(pe,de),de=R.add(ge,ge),ge=R.add(de,ge),ge=R.add(ge,_e),ge=R.mul(ge,pe),ae=R.add(ae,ge),_e=R.mul(X,ie),_e=R.add(_e,_e),ge=R.mul(_e,pe),ne=R.sub(ne,ge),de=R.mul(_e,Se),de=R.add(de,de),de=R.add(de,de),new p(ne,ae,de)}add(L){_(L);const{px:D,py:N,pz:O}=this,{px:X,py:ie,pz:ne}=L;let ae=R.ZERO,de=R.ZERO,ge=R.ZERO;const Se=z.a,_e=R.mul(z.b,h);let pe=R.mul(D,X),Oe=R.mul(N,ie),Pe=R.mul(O,ne),Te=R.add(D,N),T=R.add(X,ie);Te=R.mul(Te,T),T=R.add(pe,Oe),Te=R.sub(Te,T),T=R.add(D,O);let C=R.add(X,ne);return T=R.mul(T,C),C=R.add(pe,Pe),T=R.sub(T,C),C=R.add(N,O),ae=R.add(ie,ne),C=R.mul(C,ae),ae=R.add(Oe,Pe),C=R.sub(C,ae),ge=R.mul(Se,T),ae=R.mul(_e,Pe),ge=R.add(ae,ge),ae=R.sub(Oe,ge),ge=R.add(Oe,ge),de=R.mul(ae,ge),Oe=R.add(pe,pe),Oe=R.add(Oe,pe),Pe=R.mul(Se,Pe),T=R.mul(_e,T),Oe=R.add(Oe,Pe),Pe=R.sub(pe,Pe),Pe=R.mul(Se,Pe),T=R.add(T,Pe),pe=R.mul(Oe,T),de=R.add(de,pe),pe=R.mul(C,T),ae=R.mul(Te,ae),ae=R.sub(ae,pe),pe=R.mul(Te,Oe),ge=R.mul(C,ge),ge=R.add(ge,pe),new p(ae,de,ge)}subtract(L){return this.add(L.negate())}is0(){return this.equals(p.ZERO)}wNAF(L){return B.wNAFCached(this,Z,L,D=>{const N=R.invertBatch(D.map(O=>O.pz));return D.map((O,X)=>O.toAffine(N[X])).map(p.fromAffine)})}multiplyUnsafe(L){const D=p.ZERO;if(L===l)return D;if(W(L),L===u)return this;const{endo:N}=z;if(!N)return B.unsafeLadder(this,L);let{k1neg:O,k1:X,k2neg:ie,k2:ne}=N.splitScalar(L),ae=D,de=D,ge=this;for(;X>l||ne>l;)X&u&&(ae=ae.add(ge)),ne&u&&(de=de.add(ge)),ge=ge.double(),X>>=u,ne>>=u;return O&&(ae=ae.negate()),ie&&(de=de.negate()),de=new p(R.mul(de.px,N.beta),de.py,de.pz),ae.add(de)}multiply(L){W(L);let D=L,N,O;const{endo:X}=z;if(X){const{k1neg:ie,k1:ne,k2neg:ae,k2:de}=X.splitScalar(D);let{p:ge,f:Se}=this.wNAF(ne),{p:_e,f:pe}=this.wNAF(de);ge=B.constTimeNegate(ie,ge),_e=B.constTimeNegate(ae,_e),_e=new p(R.mul(_e.px,X.beta),_e.py,_e.pz),N=ge.add(_e),O=Se.add(pe)}else{const{p:ie,f:ne}=this.wNAF(D);N=ie,O=ne}return p.normalizeZ([N,O])[0]}multiplyAndAddUnsafe(L,D,N){const O=p.BASE,X=(ne,ae)=>ae===l||ae===u||!ne.equals(O)?ne.multiplyUnsafe(ae):ne.multiply(ae),ie=X(this,D).add(X(L,N));return ie.is0()?void 0:ie}toAffine(L){const{px:D,py:N,pz:O}=this,X=this.is0();L==null&&(L=X?R.ONE:R.inv(O));const ie=R.mul(D,L),ne=R.mul(N,L),ae=R.mul(O,L);if(X)return{x:R.ZERO,y:R.ZERO};if(!R.eql(ae,R.ONE))throw new Error("invZ was invalid");return{x:ie,y:ne}}isTorsionFree(){const{h:L,isTorsionFree:D}=z;if(L===u)return!0;if(D)return D(p,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:L,clearCofactor:D}=z;return L===u?this:D?D(p,this):this.multiplyUnsafe(z.h)}toRawBytes(L=!0){return this.assertValidity(),q(p,this,L)}toHex(L=!0){return r.bytesToHex(this.toRawBytes(L))}}p.BASE=new p(z.Gx,z.Gy,R.ONE),p.ZERO=new p(R.ZERO,R.ONE,R.ZERO);const b=z.nBitLength,B=(0,i.wNAF)(p,z.endo?Math.ceil(b/2):b);return{CURVE:z,ProjectivePoint:p,normPrivateKeyToScalar:P,weierstrassEquation:U,isWithinCurveOrder:te}}e.weierstrassPoints=y;function v(E){const z=(0,i.validateBasic)(E);return r.validateObject(z,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...z})}function G(E){const z=v(E),{Fp:R,n:q}=z,k=R.BYTES+1,U=2*R.BYTES+1;function te(T){return l<T&&T<R.ORDER}function W(T){return t.mod(T,q)}function P(T){return t.invert(T,q)}const{ProjectivePoint:Z,normPrivateKeyToScalar:_,weierstrassEquation:p,isWithinCurveOrder:b}=y({...z,toBytes(T,C,K){const ce=C.toAffine(),se=R.toBytes(ce.x),be=r.concatBytes;return K?be(Uint8Array.from([C.hasEvenY()?2:3]),se):be(Uint8Array.from([4]),se,R.toBytes(ce.y))},fromBytes(T){const C=T.length,K=T[0],ce=T.subarray(1);if(C===k&&(K===2||K===3)){const se=r.bytesToNumberBE(ce);if(!te(se))throw new Error("Point is not on curve");const be=p(se);let Ie=R.sqrt(be);const Ne=(Ie&u)===u;return(K&1)===1!==Ne&&(Ie=R.neg(Ie)),{x:se,y:Ie}}else if(C===U&&K===4){const se=R.fromBytes(ce.subarray(0,R.BYTES)),be=R.fromBytes(ce.subarray(R.BYTES,2*R.BYTES));return{x:se,y:be}}else throw new Error(`Point of length ${C} was invalid. Expected ${k} compressed bytes or ${U} uncompressed bytes`)}}),B=T=>r.bytesToHex(r.numberToBytesBE(T,z.nByteLength));function V(T){const C=q>>u;return T>C}function L(T){return V(T)?W(-T):T}const D=(T,C,K)=>r.bytesToNumberBE(T.slice(C,K));class N{constructor(C,K,ce){this.r=C,this.s=K,this.recovery=ce,this.assertValidity()}static fromCompact(C){const K=z.nByteLength;return C=(0,n.ensureBytes)("compactSignature",C,K*2),new N(D(C,0,K),D(C,K,2*K))}static fromDER(C){const{r:K,s:ce}=e.DER.toSig((0,n.ensureBytes)("DER",C));return new N(K,ce)}assertValidity(){if(!b(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!b(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(C){return new N(this.r,this.s,C)}recoverPublicKey(C){const{r:K,s:ce,recovery:se}=this,be=de((0,n.ensureBytes)("msgHash",C));if(se==null||![0,1,2,3].includes(se))throw new Error("recovery id invalid");const Ie=se===2||se===3?K+z.n:K;if(Ie>=R.ORDER)throw new Error("recovery id 2 or 3 invalid");const Ne=se&1?"03":"02",He=Z.fromHex(Ne+B(Ie)),Ue=P(Ie),De=W(-be*Ue),tt=W(ce*Ue),S=Z.BASE.multiplyAndAddUnsafe(He,De,tt);if(!S)throw new Error("point at infinify");return S.assertValidity(),S}hasHighS(){return V(this.s)}normalizeS(){return this.hasHighS()?new N(this.r,W(-this.s),this.recovery):this}toDERRawBytes(){return r.hexToBytes(this.toDERHex())}toDERHex(){return e.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return r.hexToBytes(this.toCompactHex())}toCompactHex(){return B(this.r)+B(this.s)}}const O={isValidPrivateKey(T){try{return _(T),!0}catch{return!1}},normPrivateKeyToScalar:_,randomPrivateKey:()=>{const T=z.randomBytes(R.BYTES+8),C=t.hashToPrivateScalar(T,q);return r.numberToBytesBE(C,z.nByteLength)},precompute(T=8,C=Z.BASE){return C._setWindowSize(T),C.multiply(BigInt(3)),C}};function X(T,C=!0){return Z.fromPrivateKey(T).toRawBytes(C)}function ie(T){const C=T instanceof Uint8Array,K=typeof T=="string",ce=(C||K)&&T.length;return C?ce===k||ce===U:K?ce===2*k||ce===2*U:T instanceof Z}function ne(T,C,K=!0){if(ie(T))throw new Error("first arg must be private key");if(!ie(C))throw new Error("second arg must be public key");return Z.fromHex(C).multiply(_(T)).toRawBytes(K)}const ae=z.bits2int||function(T){const C=r.bytesToNumberBE(T),K=T.length*8-z.nBitLength;return K>0?C>>BigInt(K):C},de=z.bits2int_modN||function(T){return W(ae(T))},ge=r.bitMask(z.nBitLength);function Se(T){if(typeof T!="bigint")throw new Error("bigint expected");if(!(l<=T&&T<ge))throw new Error(`bigint expected < 2^${z.nBitLength}`);return r.numberToBytesBE(T,z.nByteLength)}function _e(T,C,K=pe){if(["recovered","canonical"].some(he=>he in K))throw new Error("sign() legacy options not supported");const{hash:ce,randomBytes:se}=z;let{lowS:be,prehash:Ie,extraEntropy:Ne}=K;be==null&&(be=!0),T=(0,n.ensureBytes)("msgHash",T),Ie&&(T=(0,n.ensureBytes)("prehashed msgHash",ce(T)));const He=de(T),Ue=_(C),De=[Se(Ue),Se(He)];if(Ne!=null){const he=Ne===!0?se(R.BYTES):Ne;De.push((0,n.ensureBytes)("extraEntropy",he,R.BYTES))}const tt=r.concatBytes(...De),S=He;function I(he){const le=ae(he);if(!b(le))return;const ye=P(le),je=Z.BASE.multiply(le).toAffine(),w=W(je.x);if(w===l)return;const oe=W(ye*W(S+w*Ue));if(oe===l)return;let ue=(je.x===w?0:2)|Number(je.y&u),we=oe;return be&&V(oe)&&(we=L(oe),ue^=1),new N(w,we,ue)}return{seed:tt,k2sig:I}}const pe={lowS:z.lowS,prehash:!1},Oe={lowS:z.lowS,prehash:!1};function Pe(T,C,K=pe){const{seed:ce,k2sig:se}=_e(T,C,K),be=z;return r.createHmacDrbg(be.hash.outputLen,be.nByteLength,be.hmac)(ce,se)}Z.BASE._setWindowSize(8);function Te(T,C,K,ce=Oe){var je;const se=T;if(C=(0,n.ensureBytes)("msgHash",C),K=(0,n.ensureBytes)("publicKey",K),"strict"in ce)throw new Error("options.strict was renamed to lowS");const{lowS:be,prehash:Ie}=ce;let Ne,He;try{if(typeof se=="string"||se instanceof Uint8Array)try{Ne=N.fromDER(se)}catch(w){if(!(w instanceof e.DER.Err))throw w;Ne=N.fromCompact(se)}else if(typeof se=="object"&&typeof se.r=="bigint"&&typeof se.s=="bigint"){const{r:w,s:oe}=se;Ne=new N(w,oe)}else throw new Error("PARSE");He=Z.fromHex(K)}catch(w){if(w.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(be&&Ne.hasHighS())return!1;Ie&&(C=z.hash(C));const{r:Ue,s:De}=Ne,tt=de(C),S=P(De),I=W(tt*S),he=W(Ue*S),le=(je=Z.BASE.multiplyAndAddUnsafe(He,I,he))==null?void 0:je.toAffine();return le?W(le.x)===Ue:!1}return{CURVE:z,getPublicKey:X,getSharedSecret:ne,sign:Pe,verify:Te,ProjectivePoint:Z,Signature:N,utils:O}}e.weierstrass=G;function M(E,z){const R=E.ORDER;let q=l;for(let V=R-u;V%c===l;V/=c)q+=u;const k=q,U=c<<k-u-u,te=U*c,W=(R-u)/te,P=(W-u)/c,Z=te-u,_=U,p=E.pow(z,W),b=E.pow(z,(W+u)/c);let B=(V,L)=>{let D=p,N=E.pow(L,Z),O=E.sqr(N);O=E.mul(O,L);let X=E.mul(V,O);X=E.pow(X,P),X=E.mul(X,N),N=E.mul(X,L),O=E.mul(X,V);let ie=E.mul(O,N);X=E.pow(ie,_);let ne=E.eql(X,E.ONE);N=E.mul(O,b),X=E.mul(ie,D),O=E.cmov(N,O,ne),ie=E.cmov(X,ie,ne);for(let ae=k;ae>u;ae--){let de=ae-c;de=c<<de-u;let ge=E.pow(ie,de);const Se=E.eql(ge,E.ONE);N=E.mul(O,D),D=E.mul(D,D),ge=E.mul(ie,D),O=E.cmov(N,O,Se),ie=E.cmov(ge,ie,Se)}return{isValid:ne,value:O}};if(E.ORDER%m===h){const V=(E.ORDER-h)/m,L=E.sqrt(E.neg(z));B=(D,N)=>{let O=E.sqr(N);const X=E.mul(D,N);O=E.mul(O,X);let ie=E.pow(O,V);ie=E.mul(ie,X);const ne=E.mul(ie,L),ae=E.mul(E.sqr(ie),N),de=E.eql(ae,D);let ge=E.cmov(ne,ie,de);return{isValid:de,value:ge}}}return B}e.SWUFpSqrtRatio=M;function j(E,z){if(t.validateField(E),!E.isValid(z.A)||!E.isValid(z.B)||!E.isValid(z.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const R=M(E,z.Z);if(!E.isOdd)throw new Error("Fp.isOdd is not implemented!");return q=>{let k,U,te,W,P,Z,_,p;k=E.sqr(q),k=E.mul(k,z.Z),U=E.sqr(k),U=E.add(U,k),te=E.add(U,E.ONE),te=E.mul(te,z.B),W=E.cmov(z.Z,E.neg(U),!E.eql(U,E.ZERO)),W=E.mul(W,z.A),U=E.sqr(te),Z=E.sqr(W),P=E.mul(Z,z.A),U=E.add(U,P),U=E.mul(U,te),Z=E.mul(Z,W),P=E.mul(Z,z.B),U=E.add(U,P),_=E.mul(k,te);const{isValid:b,value:B}=R(U,Z);p=E.mul(k,q),p=E.mul(p,B),_=E.cmov(_,te,b),p=E.cmov(p,B,b);const V=E.isOdd(q)===E.isOdd(p);return p=E.cmov(E.neg(p),p,V),_=E.div(_,W),{x:_,y:p}}}e.mapToCurveSimpleSWU=j})(ua);var Ct={};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.createHasher=Ct.isogenyMap=Ct.hash_to_field=Ct.expand_message_xof=Ct.expand_message_xmd=void 0;const Gw=Le,jt=Ce;function Zw(e){if(e instanceof Uint8Array)return e;if(typeof e=="string")return(0,jt.utf8ToBytes)(e);throw new Error("DST must be Uint8Array or string")}const Kw=jt.bytesToNumberBE;function hr(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=e&255,e>>>=8;return new Uint8Array(r)}function Jw(e,t){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function Pn(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected")}function ca(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function vc(e,t,r,n){Pn(e),Pn(t),ca(r),t.length>255&&(t=n((0,jt.concatBytes)((0,jt.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:i,blockLen:o}=n,s=Math.ceil(r/i);if(s>255)throw new Error("Invalid xmd length");const f=(0,jt.concatBytes)(t,hr(t.length,1)),l=hr(0,o),u=hr(r,2),c=new Array(s),h=n((0,jt.concatBytes)(l,e,u,hr(0,1),f));c[0]=n((0,jt.concatBytes)(h,hr(1,1),f));for(let y=1;y<=s;y++){const v=[Jw(h,c[y-1]),hr(y+1,1),f];c[y]=n((0,jt.concatBytes)(...v))}return(0,jt.concatBytes)(...c).slice(0,r)}Ct.expand_message_xmd=vc;function Sc(e,t,r,n,i){if(Pn(e),Pn(t),ca(r),t.length>255){const o=Math.ceil(2*n/8);t=i.create({dkLen:o}).update((0,jt.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:r}).update(e).update(hr(r,2)).update(t).update(hr(t.length,1)).digest()}Ct.expand_message_xof=Sc;function ms(e,t,r){(0,jt.validateObject)(r,{DST:"string",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:n,k:i,m:o,hash:s,expand:f,DST:l}=r;Pn(e),ca(t);const u=Zw(l),c=n.toString(2).length,h=Math.ceil((c+i)/8),m=t*o*h;let y;if(f==="xmd")y=vc(e,u,m,s);else if(f==="xof")y=Sc(e,u,m,i,s);else if(f==="_internal_pass")y=e;else throw new Error('expand must be "xmd" or "xof"');const v=new Array(t);for(let G=0;G<t;G++){const M=new Array(o);for(let j=0;j<o;j++){const E=h*(j+G*o),z=y.subarray(E,E+h);M[j]=(0,Gw.mod)(Kw(z),n)}v[G]=M}return v}Ct.hash_to_field=ms;function Xw(e,t){const r=t.map(n=>Array.from(n).reverse());return(n,i)=>{const[o,s,f,l]=r.map(u=>u.reduce((c,h)=>e.add(e.mul(c,n),h)));return n=e.div(o,s),i=e.mul(i,e.div(f,l)),{x:n,y:i}}}Ct.isogenyMap=Xw;function Yw(e,t,r){if(typeof t!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(n,i){const o=ms(n,2,{...r,DST:r.DST,...i}),s=e.fromAffine(t(o[0])),f=e.fromAffine(t(o[1])),l=s.add(f).clearCofactor();return l.assertValidity(),l},encodeToCurve(n,i){const o=ms(n,1,{...r,DST:r.encodeDST,...i}),s=e.fromAffine(t(o[0])).clearCofactor();return s.assertValidity(),s}}}Ct.createHasher=Yw;var en={},Rc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const t=at,r=ar;class n extends r.Hash{constructor(s,f){super(),this.finished=!1,this.destroyed=!1,t.default.hash(s);const l=(0,r.toBytes)(f);if(this.iHash=s.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const u=this.blockLen,c=new Uint8Array(u);c.set(l.length>u?s.create().update(l).digest():l);for(let h=0;h<c.length;h++)c[h]^=54;this.iHash.update(c),this.oHash=s.create();for(let h=0;h<c.length;h++)c[h]^=106;this.oHash.update(c),c.fill(0)}update(s){return t.default.exists(this),this.iHash.update(s),this}digestInto(s){t.default.exists(this),t.default.bytes(s,this.outputLen),this.finished=!0,this.iHash.digestInto(s),this.oHash.update(s),this.oHash.digestInto(s),this.destroy()}digest(){const s=new Uint8Array(this.oHash.outputLen);return this.digestInto(s),s}_cloneInto(s){s||(s=Object.create(Object.getPrototypeOf(this),{}));const{oHash:f,iHash:l,finished:u,destroyed:c,blockLen:h,outputLen:m}=this;return s=s,s.finished=u,s.destroyed=c,s.blockLen=h,s.outputLen=m,s.oHash=f._cloneInto(s.oHash),s.iHash=l._cloneInto(s.iHash),s}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=n;const i=(o,s,f)=>new n(o,s).update(f).digest();e.hmac=i,e.hmac.create=(o,s)=>new n(o,s)})(Rc);Object.defineProperty(en,"__esModule",{value:!0});en.createCurve=en.getHash=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Qw=Rc,Xl=ar,em=ua;function Ac(e){return{hash:e,hmac:(t,...r)=>(0,Qw.hmac)(e,t,(0,Xl.concatBytes)(...r)),randomBytes:Xl.randomBytes}}en.getHash=Ac;function tm(e,t){const r=n=>(0,em.weierstrass)({...e,...Ac(n)});return Object.freeze({...r(t),create:r})}en.createCurve=tm;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.schnorr=e.secp256k1=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=Yr,r=ar,n=Le,i=ua,o=Ce,s=Ct,f=en,l=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),u=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),c=BigInt(1),h=BigInt(2),m=(N,O)=>(N+O/h)/O;function y(N){const O=l,X=BigInt(3),ie=BigInt(6),ne=BigInt(11),ae=BigInt(22),de=BigInt(23),ge=BigInt(44),Se=BigInt(88),_e=N*N*N%O,pe=_e*_e*N%O,Oe=(0,n.pow2)(pe,X,O)*pe%O,Pe=(0,n.pow2)(Oe,X,O)*pe%O,Te=(0,n.pow2)(Pe,h,O)*_e%O,T=(0,n.pow2)(Te,ne,O)*Te%O,C=(0,n.pow2)(T,ae,O)*T%O,K=(0,n.pow2)(C,ge,O)*C%O,ce=(0,n.pow2)(K,Se,O)*K%O,se=(0,n.pow2)(ce,ge,O)*C%O,be=(0,n.pow2)(se,X,O)*pe%O,Ie=(0,n.pow2)(be,de,O)*T%O,Ne=(0,n.pow2)(Ie,ie,O)*_e%O,He=(0,n.pow2)(Ne,h,O);if(!v.eql(v.sqr(He),N))throw new Error("Cannot find square root");return He}const v=(0,n.Field)(l,void 0,void 0,{sqrt:y});e.secp256k1=(0,f.createCurve)({a:BigInt(0),b:BigInt(7),Fp:v,n:u,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:N=>{const O=u,X=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),ie=-c*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),ne=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),ae=X,de=BigInt("0x100000000000000000000000000000000"),ge=m(ae*N,O),Se=m(-ie*N,O);let _e=(0,n.mod)(N-ge*X-Se*ne,O),pe=(0,n.mod)(-ge*ie-Se*ae,O);const Oe=_e>de,Pe=pe>de;if(Oe&&(_e=O-_e),Pe&&(pe=O-pe),_e>de||pe>de)throw new Error("splitScalar: Endomorphism failed, k="+N);return{k1neg:Oe,k1:_e,k2neg:Pe,k2:pe}}}},t.sha256);const G=BigInt(0),M=N=>typeof N=="bigint"&&G<N&&N<l,j=N=>typeof N=="bigint"&&G<N&&N<u,E={};function z(N,...O){let X=E[N];if(X===void 0){const ie=(0,t.sha256)(Uint8Array.from(N,ne=>ne.charCodeAt(0)));X=(0,o.concatBytes)(ie,ie),E[N]=X}return(0,t.sha256)((0,o.concatBytes)(X,...O))}const R=N=>N.toRawBytes(!0).slice(1),q=N=>(0,o.numberToBytesBE)(N,32),k=N=>(0,n.mod)(N,l),U=N=>(0,n.mod)(N,u),te=e.secp256k1.ProjectivePoint,W=(N,O,X)=>te.BASE.multiplyAndAddUnsafe(N,O,X);function P(N){let O=e.secp256k1.utils.normPrivateKeyToScalar(N),X=te.fromPrivateKey(O);return{scalar:X.hasEvenY()?O:U(-O),bytes:R(X)}}function Z(N){if(!M(N))throw new Error("bad x: need 0 < x < p");const O=k(N*N),X=k(O*N+BigInt(7));let ie=y(X);ie%h!==G&&(ie=k(-ie));const ne=new te(N,ie,c);return ne.assertValidity(),ne}function _(...N){return U((0,o.bytesToNumberBE)(z("BIP0340/challenge",...N)))}function p(N){return P(N).bytes}function b(N,O,X=(0,r.randomBytes)(32)){const ie=(0,o.ensureBytes)("message",N),{bytes:ne,scalar:ae}=P(O),de=(0,o.ensureBytes)("auxRand",X,32),ge=q(ae^(0,o.bytesToNumberBE)(z("BIP0340/aux",de))),Se=z("BIP0340/nonce",ge,ne,ie),_e=U((0,o.bytesToNumberBE)(Se));if(_e===G)throw new Error("sign failed: k is zero");const{bytes:pe,scalar:Oe}=P(_e),Pe=_(pe,ne,ie),Te=new Uint8Array(64);if(Te.set(pe,0),Te.set(q(U(Oe+Pe*ae)),32),!B(Te,ie,ne))throw new Error("sign: Invalid signature produced");return Te}function B(N,O,X){const ie=(0,o.ensureBytes)("signature",N,64),ne=(0,o.ensureBytes)("message",O),ae=(0,o.ensureBytes)("publicKey",X,32);try{const de=Z((0,o.bytesToNumberBE)(ae)),ge=(0,o.bytesToNumberBE)(ie.subarray(0,32));if(!M(ge))return!1;const Se=(0,o.bytesToNumberBE)(ie.subarray(32,64));if(!j(Se))return!1;const _e=_(q(ge),R(de),ne),pe=W(de,Se,U(-_e));return!(!pe||!pe.hasEvenY()||pe.toAffine().x!==ge)}catch{return!1}}e.schnorr={getPublicKey:p,sign:b,verify:B,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:Z,pointToBytes:R,numberToBytesBE:o.numberToBytesBE,bytesToNumberBE:o.bytesToNumberBE,taggedHash:z,mod:n.mod}};const V=(0,s.isogenyMap)(v,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(N=>N.map(O=>BigInt(O)))),L=(0,i.mapToCurveSimpleSWU)(v,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:v.create(BigInt("-11"))}),D=(0,s.createHasher)(e.secp256k1.ProjectivePoint,N=>{const{x:O,y:X}=L(v.create(N[0]));return V(O,X)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:v.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256});e.hashToCurve=D.hashToCurve,e.encodeToCurve=D.encodeToCurve})(ac);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=void 0;var t=ac;Object.defineProperty(e,"secp256k1",{enumerable:!0,get:function(){return t.secp256k1}})})(Mi);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_WITHDRAWALS_PER_PAYLOAD=e.RLP_EMPTY_STRING=e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.SECP256K1_ORDER_DIV_2=e.SECP256K1_ORDER=e.MAX_INTEGER_BIGINT=e.MAX_INTEGER=e.MAX_UINT64=void 0;const t=x.bufferPolyfill,r=Mi;e.MAX_UINT64=BigInt("0xffffffffffffffff"),e.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),e.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),e.SECP256K1_ORDER=r.secp256k1.CURVE.n,e.SECP256K1_ORDER_DIV_2=r.secp256k1.CURVE.n/BigInt(2),e.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=t.Buffer.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=t.Buffer.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=t.Buffer.from(e.KECCAK256_RLP_S,"hex"),e.RLP_EMPTY_STRING=t.Buffer.from([128]),e.MAX_WITHDRAWALS_PER_PAYLOAD=16})(ji);var Vi={};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.GWEI_TO_WEI=void 0;Vi.GWEI_TO_WEI=BigInt(1e9);var da={},Zt={};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.RLP=Zt.utils=Zt.decode=Zt.encode=void 0;function ha(e){if(Array.isArray(e)){const r=[];let n=0;for(let i=0;i<e.length;i++){const o=ha(e[i]);r.push(o),n+=o.length}return vs(Ql(n,192),...r)}const t=Lc(e);return t.length===1&&t[0]<128?t:vs(Ql(t.length,128),t)}Zt.encode=ha;function Ur(e,t,r){if(r>e.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,r)}function Yl(e){if(e[0]===0)throw new Error("invalid RLP: extra zeros");return Oc(Tc(e))}function Ql(e,t){if(e<56)return Uint8Array.from([e+t]);const r=Ss(e),n=r.length/2,i=Ss(t+55+n);return Uint8Array.from(di(i+r))}function Ic(e,t=!1){if(typeof e>"u"||e===null||e.length===0)return Uint8Array.from([]);const r=Lc(e),n=Es(r);if(t)return n;if(n.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return n.data}Zt.decode=Ic;function Es(e){let t,r,n,i,o;const s=[],f=e[0];if(f<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(f<=183){if(t=f-127,f===128?n=Uint8Array.from([]):n=Ur(e,1,t),t===2&&n[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:n,remainder:e.slice(t)}}else if(f<=191){if(r=f-182,e.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(t=Yl(Ur(e,1,r)),t<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return n=Ur(e,r,t+r),{data:n,remainder:e.slice(t+r)}}else if(f<=247){for(t=f-191,i=Ur(e,1,t);i.length;)o=Es(i),s.push(o.data),i=o.remainder;return{data:s,remainder:e.slice(t)}}else{if(r=f-246,t=Yl(Ur(e,1,r)),t<56)throw new Error("invalid RLP: encoded list too short");const l=r+t;if(l>e.length)throw new Error("invalid RLP: total length is larger than the data");for(i=Ur(e,r,l);i.length;)o=Es(i),s.push(o.data),i=o.remainder;return{data:s,remainder:e.slice(l)}}}const rm=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Tc(e){let t="";for(let r=0;r<e.length;r++)t+=rm[e[r]];return t}function Oc(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw new Error("Invalid byte sequence");return t}function di(e){if(typeof e!="string")throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=r*2;t[r]=Oc(e.slice(n,n+2))}return t}function vs(...e){if(e.length===1)return e[0];const t=e.reduce((n,i)=>n+i.length,0),r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){const o=e[n];r.set(o,i),i+=o.length}return r}function Pc(e){return new TextEncoder().encode(e)}function Ss(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?`0${t}`:t}function nm(e){return e.length%2?`0${e}`:e}function Cc(e){return e.length>=2&&e[0]==="0"&&e[1]==="x"}function im(e){return typeof e!="string"?e:Cc(e)?e.slice(2):e}function Lc(e){if(e instanceof Uint8Array)return e;if(typeof e=="string")return Cc(e)?di(nm(im(e))):Pc(e);if(typeof e=="number"||typeof e=="bigint")return e?di(Ss(e)):Uint8Array.from([]);if(e==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}Zt.utils={bytesToHex:Tc,concatBytes:vs,hexToBytes:di,utf8ToBytes:Pc};Zt.RLP={encode:ha,decode:Ic};var Mt={},Ve={},Nc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.add=e.toBig=e.split=e.fromBig=void 0;const t=BigInt(2**32-1),r=BigInt(32);function n(P,Z=!1){return Z?{h:Number(P&t),l:Number(P>>r&t)}:{h:Number(P>>r&t)|0,l:Number(P&t)|0}}e.fromBig=n;function i(P,Z=!1){let _=new Uint32Array(P.length),p=new Uint32Array(P.length);for(let b=0;b<P.length;b++){const{h:B,l:V}=n(P[b],Z);[_[b],p[b]]=[B,V]}return[_,p]}e.split=i;const o=(P,Z)=>BigInt(P>>>0)<<r|BigInt(Z>>>0);e.toBig=o;const s=(P,Z,_)=>P>>>_,f=(P,Z,_)=>P<<32-_|Z>>>_,l=(P,Z,_)=>P>>>_|Z<<32-_,u=(P,Z,_)=>P<<32-_|Z>>>_,c=(P,Z,_)=>P<<64-_|Z>>>_-32,h=(P,Z,_)=>P>>>_-32|Z<<64-_,m=(P,Z)=>Z,y=(P,Z)=>P,v=(P,Z,_)=>P<<_|Z>>>32-_,G=(P,Z,_)=>Z<<_|P>>>32-_,M=(P,Z,_)=>Z<<_-32|P>>>64-_,j=(P,Z,_)=>P<<_-32|Z>>>64-_;function E(P,Z,_,p){const b=(Z>>>0)+(p>>>0);return{h:P+_+(b/2**32|0)|0,l:b|0}}e.add=E;const z=(P,Z,_)=>(P>>>0)+(Z>>>0)+(_>>>0),R=(P,Z,_,p)=>Z+_+p+(P/2**32|0)|0,q=(P,Z,_,p)=>(P>>>0)+(Z>>>0)+(_>>>0)+(p>>>0),k=(P,Z,_,p,b)=>Z+_+p+b+(P/2**32|0)|0,U=(P,Z,_,p,b)=>(P>>>0)+(Z>>>0)+(_>>>0)+(p>>>0)+(b>>>0),te=(P,Z,_,p,b,B)=>Z+_+p+b+B+(P/2**32|0)|0,W={fromBig:n,split:i,toBig:e.toBig,shrSH:s,shrSL:f,rotrSH:l,rotrSL:u,rotrBH:c,rotrBL:h,rotr32H:m,rotr32L:y,rotlSH:v,rotlSL:G,rotlBH:M,rotlBL:j,add:E,add3L:z,add3H:R,add4L:q,add4H:k,add5H:te,add5L:U};e.default=W})(Nc);Object.defineProperty(Ve,"__esModule",{value:!0});Ve.shake256=Ve.shake128=Ve.keccak_512=Ve.keccak_384=Ve.keccak_256=Ve.keccak_224=Ve.sha3_512=Ve.sha3_384=Ve.sha3_256=Ve.sha3_224=Ve.Keccak=Ve.keccakP=void 0;const Fr=at,Cn=Nc,Sn=ar,[Bc,$c,xc]=[[],[],[]],om=BigInt(0),bn=BigInt(1),sm=BigInt(2),am=BigInt(7),lm=BigInt(256),fm=BigInt(113);for(let e=0,t=bn,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Bc.push(2*(5*n+r)),$c.push((e+1)*(e+2)/2%64);let i=om;for(let o=0;o<7;o++)t=(t<<bn^(t>>am)*fm)%lm,t&sm&&(i^=bn<<(bn<<BigInt(o))-bn);xc.push(i)}const[um,cm]=Cn.default.split(xc,!0),ef=(e,t,r)=>r>32?Cn.default.rotlBH(e,t,r):Cn.default.rotlSH(e,t,r),tf=(e,t,r)=>r>32?Cn.default.rotlBL(e,t,r):Cn.default.rotlSL(e,t,r);function kc(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let s=0;s<10;s++)r[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){const f=(s+8)%10,l=(s+2)%10,u=r[l],c=r[l+1],h=ef(u,c,1)^r[f],m=tf(u,c,1)^r[f+1];for(let y=0;y<50;y+=10)e[s+y]^=h,e[s+y+1]^=m}let i=e[2],o=e[3];for(let s=0;s<24;s++){const f=$c[s],l=ef(i,o,f),u=tf(i,o,f),c=Bc[s];i=e[c],o=e[c+1],e[c]=l,e[c+1]=u}for(let s=0;s<50;s+=10){for(let f=0;f<10;f++)r[f]=e[s+f];for(let f=0;f<10;f++)e[s+f]^=~r[(f+2)%10]&r[(f+4)%10]}e[0]^=um[n],e[1]^=cm[n]}r.fill(0)}Ve.keccakP=kc;class kn extends Sn.Hash{constructor(t,r,n,i=!1,o=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Fr.default.number(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,Sn.u32)(this.state)}keccak(){kc(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){Fr.default.exists(this);const{blockLen:r,state:n}=this;t=(0,Sn.toBytes)(t);const i=t.length;for(let o=0;o<i;){const s=Math.min(r-this.pos,i-o);for(let f=0;f<s;f++)n[this.pos++]^=t[o++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:r,pos:n,blockLen:i}=this;t[n]^=r,r&128&&n===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){Fr.default.exists(this,!1),Fr.default.bytes(t),this.finish();const r=this.state,{blockLen:n}=this;for(let i=0,o=t.length;i<o;){this.posOut>=n&&this.keccak();const s=Math.min(n-this.posOut,o-i);t.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Fr.default.number(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Fr.default.output(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:r,suffix:n,outputLen:i,rounds:o,enableXOF:s}=this;return t||(t=new kn(r,n,i,s,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=n,t.outputLen=i,t.enableXOF=s,t.destroyed=this.destroyed,t}}Ve.Keccak=kn;const wr=(e,t,r)=>(0,Sn.wrapConstructor)(()=>new kn(t,e,r));Ve.sha3_224=wr(6,144,224/8);Ve.sha3_256=wr(6,136,256/8);Ve.sha3_384=wr(6,104,384/8);Ve.sha3_512=wr(6,72,512/8);Ve.keccak_224=wr(1,144,224/8);Ve.keccak_256=wr(1,136,256/8);Ve.keccak_384=wr(1,104,384/8);Ve.keccak_512=wr(1,72,512/8);const Dc=(e,t,r)=>(0,Sn.wrapXOFConstructorWithOpts)((n={})=>new kn(t,e,n.dkLen===void 0?r:n.dkLen,!0));Ve.shake128=Dc(31,168,128/8);Ve.shake256=Dc(31,136,256/8);var hi={exports:{}};hi.exports;(function(e,t){var r=x.commonjsGlobal&&x.commonjsGlobal.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=t.wrapHash=t.equalsBytes=t.hexToBytes=t.bytesToUtf8=t.utf8ToBytes=t.createView=t.concatBytes=t.toHex=t.bytesToHex=t.assertBytes=t.assertBool=void 0;const n=r(at),i=ar,o=n.default.bool;t.assertBool=o;const s=n.default.bytes;t.assertBytes=s;var f=ar;Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return f.bytesToHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return f.bytesToHex}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return f.concatBytes}}),Object.defineProperty(t,"createView",{enumerable:!0,get:function(){return f.createView}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return f.utf8ToBytes}});function l(m){if(!(m instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof m}`);return new TextDecoder().decode(m)}t.bytesToUtf8=l;function u(m){const y=m.startsWith("0x")?m.substring(2):m;return(0,i.hexToBytes)(y)}t.hexToBytes=u;function c(m,y){if(m.length!==y.length)return!1;for(let v=0;v<m.length;v++)if(m[v]!==y[v])return!1;return!0}t.equalsBytes=c;function h(m){return y=>(n.default.bytes(y),m(y))}t.wrapHash=h,t.crypto=(()=>{const m=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,y=typeof x.commonjsRequire=="function"&&x.commonjsRequire.bind(e);return{node:y&&!m?y("crypto"):void 0,web:m}})()})(hi,hi.exports);var jc=hi.exports;Object.defineProperty(Mt,"__esModule",{value:!0});Mt.keccak512=Mt.keccak384=Mt.keccak256=Mt.keccak224=void 0;const Ln=Ve,qi=jc;Mt.keccak224=(0,qi.wrapHash)(Ln.keccak_224);Mt.keccak256=(()=>{const e=(0,qi.wrapHash)(Ln.keccak_256);return e.create=Ln.keccak_256.create,e})();Mt.keccak384=(0,qi.wrapHash)(Ln.keccak_384);Mt.keccak512=(0,qi.wrapHash)(Ln.keccak_512);var kr={},Lt={},qe={};Object.defineProperty(qe,"__esModule",{value:!0});qe.isHexString=qe.getKeys=qe.fromAscii=qe.fromUtf8=qe.toAscii=qe.arrayContainsArray=qe.getBinarySize=qe.padToEven=qe.stripHexPrefix=qe.isHexPrefixed=void 0;function Mc(e){if(typeof e!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof e}`);return e[0]==="0"&&e[1]==="x"}qe.isHexPrefixed=Mc;const dm=e=>{if(typeof e!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof e}`);return Mc(e)?e.slice(2):e};qe.stripHexPrefix=dm;function Uc(e){let t=e;if(typeof t!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof t}`);return t.length%2&&(t=`0${t}`),t}qe.padToEven=Uc;function hm(e){if(typeof e!="string")throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof e}`);return x.dist.Buffer.byteLength(e,"utf8")}qe.getBinarySize=hm;function gm(e,t,r){if(Array.isArray(e)!==!0)throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(Array.isArray(t)!==!0)throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof t}'`);return t[r===!0?"some":"every"](n=>e.indexOf(n)>=0)}qe.arrayContainsArray=gm;function _m(e){let t="",r=0;const n=e.length;for(e.substring(0,2)==="0x"&&(r=2);r<n;r+=2){const i=parseInt(e.substr(r,2),16);t+=String.fromCharCode(i)}return t}qe.toAscii=_m;function bm(e){const t=x.dist.Buffer.from(e,"utf8");return`0x${Uc(t.toString("hex")).replace(/^0+|0+$/g,"")}`}qe.fromUtf8=bm;function pm(e){let t="";for(let r=0;r<e.length;r++){const i=e.charCodeAt(r).toString(16);t+=i.length<2?`0${i}`:i}return`0x${t}`}qe.fromAscii=pm;function ym(e,t,r){if(!Array.isArray(e))throw new Error(`[getKeys] method expects input 'params' to be an array, got ${typeof e}`);if(typeof t!="string")throw new Error(`[getKeys] method expects input 'key' to be type 'string', got ${typeof e}`);const n=[];for(let i=0;i<e.length;i++){let o=e[i][t];if(r===!0&&!o)o="";else if(typeof o!="string")throw new Error(`invalid abi - expected type 'string', received ${typeof o}`);n.push(o)}return n}qe.getKeys=ym;function wm(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||typeof t<"u"&&t>0&&e.length!==2+2*t)}qe.isHexString=wm;Object.defineProperty(Lt,"__esModule",{value:!0});Lt.assertIsString=Lt.assertIsArray=Lt.assertIsBuffer=Lt.assertIsHexString=void 0;const mm=qe,Em=function(e){if(!(0,mm.isHexString)(e)){const t=`This method only supports 0x-prefixed hex strings but input was: ${e}`;throw new Error(t)}};Lt.assertIsHexString=Em;const vm=function(e){if(!x.dist.Buffer.isBuffer(e)){const t=`This method only supports Buffer but input was: ${e}`;throw new Error(t)}};Lt.assertIsBuffer=vm;const Sm=function(e){if(!Array.isArray(e)){const t=`This method only supports number arrays but input was: ${e}`;throw new Error(t)}};Lt.assertIsArray=Sm;const Rm=function(e){if(typeof e!="string"){const t=`This method only supports strings but input was: ${e}`;throw new Error(t)}};Lt.assertIsString=Rm;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.intToUnpaddedBuffer=e.bigIntToUnpaddedBuffer=e.bigIntToHex=e.bufArrToArr=e.arrToBufArr=e.validateNoLeadingZeroes=e.baToJSON=e.toUtf8=e.short=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToInt=e.bigIntToBuffer=e.bufferToBigInt=e.bufferToHex=e.toBuffer=e.unpadHexString=e.unpadArray=e.unpadBuffer=e.setLengthRight=e.setLengthLeft=e.zeros=e.intToBuffer=e.intToHex=void 0;const t=Lt,r=qe,n=function(b){if(!Number.isSafeInteger(b)||b<0)throw new Error(`Received an invalid integer type: ${b}`);return`0x${b.toString(16)}`};e.intToHex=n;const i=function(b){const B=(0,e.intToHex)(b);return x.dist.Buffer.from((0,r.padToEven)(B.slice(2)),"hex")};e.intToBuffer=i;const o=function(b){return x.dist.Buffer.allocUnsafe(b).fill(0)};e.zeros=o;const s=function(b,B,V){const L=(0,e.zeros)(B);return V?b.length<B?(b.copy(L),L):b.slice(0,B):b.length<B?(b.copy(L,B-b.length),L):b.slice(-B)},f=function(b,B){return(0,t.assertIsBuffer)(b),s(b,B,!1)};e.setLengthLeft=f;const l=function(b,B){return(0,t.assertIsBuffer)(b),s(b,B,!0)};e.setLengthRight=l;const u=function(b){let B=b[0];for(;b.length>0&&B.toString()==="0";)b=b.slice(1),B=b[0];return b},c=function(b){return(0,t.assertIsBuffer)(b),u(b)};e.unpadBuffer=c;const h=function(b){return(0,t.assertIsArray)(b),u(b)};e.unpadArray=h;const m=function(b){return(0,t.assertIsHexString)(b),b=(0,r.stripHexPrefix)(b),"0x"+u(b)};e.unpadHexString=m;const y=function(b){if(b==null)return x.dist.Buffer.allocUnsafe(0);if(x.dist.Buffer.isBuffer(b)||Array.isArray(b)||b instanceof Uint8Array)return x.dist.Buffer.from(b);if(typeof b=="string"){if(!(0,r.isHexString)(b))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${b}`);return x.dist.Buffer.from((0,r.padToEven)((0,r.stripHexPrefix)(b)),"hex")}if(typeof b=="number")return(0,e.intToBuffer)(b);if(typeof b=="bigint"){if(b<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${b}`);let B=b.toString(16);return B.length%2&&(B="0"+B),x.dist.Buffer.from(B,"hex")}if(b.toArray)return x.dist.Buffer.from(b.toArray());if(b.toBuffer)return x.dist.Buffer.from(b.toBuffer());throw new Error("invalid type")};e.toBuffer=y;const v=function(b){return b=(0,e.toBuffer)(b),"0x"+b.toString("hex")};e.bufferToHex=v;function G(b){const B=(0,e.bufferToHex)(b);return BigInt(B==="0x"?0:B)}e.bufferToBigInt=G;function M(b){return(0,e.toBuffer)("0x"+b.toString(16))}e.bigIntToBuffer=M;const j=function(b){const B=Number(G(b));if(!Number.isSafeInteger(B))throw new Error("Number exceeds 53 bits");return B};e.bufferToInt=j;const E=function(b){return BigInt.asIntN(256,G(b))};e.fromSigned=E;const z=function(b){return M(BigInt.asUintN(256,b))};e.toUnsigned=z;const R=function(b){return typeof b!="string"||(0,r.isHexPrefixed)(b)?b:"0x"+b};e.addHexPrefix=R;function q(b,B=50){const V=x.dist.Buffer.isBuffer(b)?b.toString("hex"):b;return V.length<=B?V:V.slice(0,B)+"…"}e.short=q;const k=function(b){const B=/^(00)+|(00)+$/g;if(b=(0,r.stripHexPrefix)(b),b.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return x.dist.Buffer.from(b.replace(B,""),"hex").toString("utf8")};e.toUtf8=k;const U=function(b){if(x.dist.Buffer.isBuffer(b))return`0x${b.toString("hex")}`;if(b instanceof Array){const B=[];for(let V=0;V<b.length;V++)B.push((0,e.baToJSON)(b[V]));return B}};e.baToJSON=U;const te=function(b){for(const[B,V]of Object.entries(b))if(V!==void 0&&V.length>0&&V[0]===0)throw new Error(`${B} cannot have leading zeroes, received: ${V.toString("hex")}`)};e.validateNoLeadingZeroes=te;function W(b){return Array.isArray(b)?b.map(B=>W(B)):x.dist.Buffer.from(b)}e.arrToBufArr=W;function P(b){return Array.isArray(b)?b.map(B=>P(B)):Uint8Array.from(b??[])}e.bufArrToArr=P;const Z=b=>"0x"+b.toString(16);e.bigIntToHex=Z;function _(b){return(0,e.unpadBuffer)(M(b))}e.bigIntToUnpaddedBuffer=_;function p(b){return(0,e.unpadBuffer)((0,e.intToBuffer)(b))}e.intToUnpaddedBuffer=p})(kr);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.accountBodyToRLP=e.accountBodyToSlim=e.accountBodyFromSlim=e.isZeroAddress=e.zeroAddress=e.importPublic=e.privateToAddress=e.privateToPublic=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isValidAddress=e.Account=void 0;const t=Zt,r=Mt,n=Mi,i=jc,o=kr,s=ji,f=Lt,l=qe,u=BigInt(0);class c{constructor(p=u,b=u,B=s.KECCAK256_RLP,V=s.KECCAK256_NULL){this.nonce=p,this.balance=b,this.storageRoot=B,this.codeHash=V,this._validate()}static fromAccountData(p){const{nonce:b,balance:B,storageRoot:V,codeHash:L}=p;return new c(b!==void 0?(0,o.bufferToBigInt)((0,o.toBuffer)(b)):void 0,B!==void 0?(0,o.bufferToBigInt)((0,o.toBuffer)(B)):void 0,V!==void 0?(0,o.toBuffer)(V):void 0,L!==void 0?(0,o.toBuffer)(L):void 0)}static fromRlpSerializedAccount(p){const b=(0,o.arrToBufArr)(t.RLP.decode(Uint8Array.from(p)));if(!Array.isArray(b))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(b)}static fromValuesArray(p){const[b,B,V,L]=p;return new c((0,o.bufferToBigInt)(b),(0,o.bufferToBigInt)(B),V,L)}_validate(){if(this.nonce<u)throw new Error("nonce must be greater than zero");if(this.balance<u)throw new Error("balance must be greater than zero");if(this.storageRoot.length!==32)throw new Error("storageRoot must have a length of 32");if(this.codeHash.length!==32)throw new Error("codeHash must have a length of 32")}raw(){return[(0,o.bigIntToUnpaddedBuffer)(this.nonce),(0,o.bigIntToUnpaddedBuffer)(this.balance),this.storageRoot,this.codeHash]}serialize(){return x.dist.Buffer.from(t.RLP.encode((0,o.bufArrToArr)(this.raw())))}isContract(){return!this.codeHash.equals(s.KECCAK256_NULL)}isEmpty(){return this.balance===u&&this.nonce===u&&this.codeHash.equals(s.KECCAK256_NULL)}}e.Account=c;const h=function(_){try{(0,f.assertIsString)(_)}catch{return!1}return/^0x[0-9a-fA-F]{40}$/.test(_)};e.isValidAddress=h;const m=function(_,p){(0,f.assertIsHexString)(_);const b=(0,l.stripHexPrefix)(_).toLowerCase();let B="";p!==void 0&&(B=(0,o.bufferToBigInt)((0,o.toBuffer)(p)).toString()+"0x");const V=x.dist.Buffer.from(B+b,"utf8"),L=(0,i.bytesToHex)((0,r.keccak256)(V));let D="0x";for(let N=0;N<b.length;N++)parseInt(L[N],16)>=8?D+=b[N].toUpperCase():D+=b[N];return D};e.toChecksumAddress=m;const y=function(_,p){return(0,e.isValidAddress)(_)&&(0,e.toChecksumAddress)(_,p)===_};e.isValidChecksumAddress=y;const v=function(_,p){return(0,f.assertIsBuffer)(_),(0,f.assertIsBuffer)(p),(0,o.bufferToBigInt)(p)===BigInt(0)?x.dist.Buffer.from((0,r.keccak256)(t.RLP.encode((0,o.bufArrToArr)([_,null])))).slice(-20):x.dist.Buffer.from((0,r.keccak256)(t.RLP.encode((0,o.bufArrToArr)([_,p])))).slice(-20)};e.generateAddress=v;const G=function(_,p,b){if((0,f.assertIsBuffer)(_),(0,f.assertIsBuffer)(p),(0,f.assertIsBuffer)(b),_.length!==20)throw new Error("Expected from to be of length 20");if(p.length!==32)throw new Error("Expected salt to be of length 32");const B=(0,r.keccak256)(x.dist.Buffer.concat([x.dist.Buffer.from("ff","hex"),_,p,(0,r.keccak256)(b)]));return(0,o.toBuffer)(B).slice(-20)};e.generateAddress2=G;const M=function(_){return n.secp256k1.utils.isValidPrivateKey(_)};e.isValidPrivate=M;const j=function(_,p=!1){if((0,f.assertIsBuffer)(_),_.length===64)try{return n.secp256k1.ProjectivePoint.fromHex(x.dist.Buffer.concat([x.dist.Buffer.from([4]),_])),!0}catch{return!1}if(!p)return!1;try{return n.secp256k1.ProjectivePoint.fromHex(_),!0}catch{return!1}};e.isValidPublic=j;const E=function(_,p=!1){if((0,f.assertIsBuffer)(_),p&&_.length!==64&&(_=x.dist.Buffer.from(n.secp256k1.ProjectivePoint.fromHex(_).toRawBytes(!1).slice(1))),_.length!==64)throw new Error("Expected pubKey to be of length 64");return x.dist.Buffer.from((0,r.keccak256)(_)).slice(-20)};e.pubToAddress=E,e.publicToAddress=e.pubToAddress;const z=function(_){return(0,f.assertIsBuffer)(_),x.dist.Buffer.from(n.secp256k1.ProjectivePoint.fromPrivateKey(_).toRawBytes(!1).slice(1))};e.privateToPublic=z;const R=function(_){return(0,e.publicToAddress)((0,e.privateToPublic)(_))};e.privateToAddress=R;const q=function(_){return(0,f.assertIsBuffer)(_),_.length!==64&&(_=x.dist.Buffer.from(n.secp256k1.ProjectivePoint.fromHex(_).toRawBytes(!1).slice(1))),_};e.importPublic=q;const k=function(){const p=(0,o.zeros)(20);return(0,o.bufferToHex)(p)};e.zeroAddress=k;const U=function(_){try{(0,f.assertIsString)(_)}catch{return!1}return(0,e.zeroAddress)()===_};e.isZeroAddress=U;function te(_){const[p,b,B,V]=_;return[p,b,(0,o.arrToBufArr)(B).length===0?s.KECCAK256_RLP:B,(0,o.arrToBufArr)(V).length===0?s.KECCAK256_NULL:V]}e.accountBodyFromSlim=te;const W=new Uint8Array(0);function P(_){const[p,b,B,V]=_;return[p,b,(0,o.arrToBufArr)(B).equals(s.KECCAK256_RLP)?W:B,(0,o.arrToBufArr)(V).equals(s.KECCAK256_NULL)?W:V]}e.accountBodyToSlim=P;function Z(_,p=!0){const b=p?te(_):_;return(0,o.arrToBufArr)(t.RLP.encode(b))}e.accountBodyToRLP=Z})(da);var Dn={};Object.defineProperty(Dn,"__esModule",{value:!0});Dn.Address=void 0;const pn=da,Yn=kr;class tr{constructor(t){if(t.length!==20)throw new Error("Invalid address length");this.buf=t}static zero(){return new tr((0,Yn.zeros)(20))}static fromString(t){if(!(0,pn.isValidAddress)(t))throw new Error("Invalid address");return new tr((0,Yn.toBuffer)(t))}static fromPublicKey(t){if(!x.dist.Buffer.isBuffer(t))throw new Error("Public key should be Buffer");const r=(0,pn.pubToAddress)(t);return new tr(r)}static fromPrivateKey(t){if(!x.dist.Buffer.isBuffer(t))throw new Error("Private key should be Buffer");const r=(0,pn.privateToAddress)(t);return new tr(r)}static generate(t,r){if(typeof r!="bigint")throw new Error("Expected nonce to be a bigint");return new tr((0,pn.generateAddress)(t.buf,(0,Yn.bigIntToBuffer)(r)))}static generate2(t,r,n){if(!x.dist.Buffer.isBuffer(r))throw new Error("Expected salt to be a Buffer");if(!x.dist.Buffer.isBuffer(n))throw new Error("Expected initCode to be a Buffer");return new tr((0,pn.generateAddress2)(t.buf,r,n))}equals(t){return this.buf.equals(t.buf)}isZero(){return this.equals(tr.zero())}isPrecompileOrSystemAddress(){const t=(0,Yn.bufferToBigInt)(this.buf),r=BigInt(0),n=BigInt("0xffff");return t>=r&&t<=n}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return x.dist.Buffer.from(this.buf)}}Dn.Address=tr;var Gi={},ga={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toType=e.TypeOutput=void 0;const t=kr,r=qe;var n;(function(o){o[o.Number=0]="Number",o[o.BigInt=1]="BigInt",o[o.Buffer=2]="Buffer",o[o.PrefixedHexString=3]="PrefixedHexString"})(n=e.TypeOutput||(e.TypeOutput={}));function i(o,s){if(o===null)return null;if(o===void 0)return;if(typeof o=="string"&&!(0,r.isHexString)(o))throw new Error(`A string must be provided with a 0x-prefix, given: ${o}`);if(typeof o=="number"&&!Number.isSafeInteger(o))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const f=(0,t.toBuffer)(o);switch(s){case n.Buffer:return f;case n.BigInt:return(0,t.bufferToBigInt)(f);case n.Number:{const l=(0,t.bufferToBigInt)(f);if(l>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(l)}case n.PrefixedHexString:return(0,t.bufferToHex)(f);default:throw new Error("unknown outputType")}}e.toType=i})(ga);Object.defineProperty(Gi,"__esModule",{value:!0});Gi.Withdrawal=void 0;const rf=Dn,zo=kr,Qe=ga;class Rn{constructor(t,r,n,i){this.index=t,this.validatorIndex=r,this.address=n,this.amount=i}static fromWithdrawalData(t){const{index:r,validatorIndex:n,address:i,amount:o}=t,s=(0,Qe.toType)(r,Qe.TypeOutput.BigInt),f=(0,Qe.toType)(n,Qe.TypeOutput.BigInt),l=new rf.Address((0,Qe.toType)(i,Qe.TypeOutput.Buffer)),u=(0,Qe.toType)(o,Qe.TypeOutput.BigInt);return new Rn(s,f,l,u)}static fromValuesArray(t){if(t.length!==4)throw Error(`Invalid withdrawalArray length expected=4 actual=${t.length}`);const[r,n,i,o]=t;return Rn.fromWithdrawalData({index:r,validatorIndex:n,address:i,amount:o})}static toBufferArray(t){const{index:r,validatorIndex:n,address:i,amount:o}=t,s=(0,Qe.toType)(r,Qe.TypeOutput.BigInt)===BigInt(0)?x.dist.Buffer.alloc(0):(0,Qe.toType)(r,Qe.TypeOutput.Buffer),f=(0,Qe.toType)(n,Qe.TypeOutput.BigInt)===BigInt(0)?x.dist.Buffer.alloc(0):(0,Qe.toType)(n,Qe.TypeOutput.Buffer);let l;i instanceof rf.Address?l=i.buf:l=(0,Qe.toType)(i,Qe.TypeOutput.Buffer);const u=(0,Qe.toType)(o,Qe.TypeOutput.BigInt)===BigInt(0)?x.dist.Buffer.alloc(0):(0,Qe.toType)(o,Qe.TypeOutput.Buffer);return[s,f,l,u]}raw(){return Rn.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,zo.bigIntToHex)(this.index),validatorIndex:(0,zo.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,zo.bigIntToHex)(this.amount)}}}Gi.Withdrawal=Rn;var _t={};Object.defineProperty(_t,"__esModule",{value:!0});_t.hashPersonalMessage=_t.isValidSignature=_t.fromRpcSig=_t.toCompactSig=_t.toRpcSig=_t.ecrecover=_t.ecsign=void 0;const Am=Mt,Fc=Mi,mt=kr,Wo=ji,Im=Lt;function Tm(e,t,r){const n=Fc.secp256k1.sign(e,t),i=n.toCompactRawBytes(),o=x.dist.Buffer.from(i.slice(0,32)),s=x.dist.Buffer.from(i.slice(32,64)),f=r===void 0?BigInt(n.recovery+27):BigInt(n.recovery+35)+BigInt(r)*BigInt(2);return{r:o,s,v:f}}_t.ecsign=Tm;function Zi(e,t){return e===BigInt(0)||e===BigInt(1)?e:t===void 0?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function Ki(e){return e===BigInt(0)||e===BigInt(1)}const Om=function(e,t,r,n,i){const o=x.dist.Buffer.concat([(0,mt.setLengthLeft)(r,32),(0,mt.setLengthLeft)(n,32)],64),s=Zi(t,i);if(!Ki(s))throw new Error("Invalid signature v value");const l=Fc.secp256k1.Signature.fromCompact(o).addRecoveryBit(Number(s)).recoverPublicKey(e);return x.dist.Buffer.from(l.toRawBytes(!1).slice(1))};_t.ecrecover=Om;const Pm=function(e,t,r,n){const i=Zi(e,n);if(!Ki(i))throw new Error("Invalid signature v value");return(0,mt.bufferToHex)(x.dist.Buffer.concat([(0,mt.setLengthLeft)(t,32),(0,mt.setLengthLeft)(r,32),(0,mt.toBuffer)(e)]))};_t.toRpcSig=Pm;const Cm=function(e,t,r,n){const i=Zi(e,n);if(!Ki(i))throw new Error("Invalid signature v value");let o=r;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(o=x.dist.Buffer.from(r),o[0]|=128),(0,mt.bufferToHex)(x.dist.Buffer.concat([(0,mt.setLengthLeft)(t,32),(0,mt.setLengthLeft)(o,32)]))};_t.toCompactSig=Cm;const Lm=function(e){const t=(0,mt.toBuffer)(e);let r,n,i;if(t.length>=65)r=t.slice(0,32),n=t.slice(32,64),i=(0,mt.bufferToBigInt)(t.slice(64));else if(t.length===64)r=t.slice(0,32),n=t.slice(32,64),i=BigInt((0,mt.bufferToInt)(t.slice(32,33))>>7),n[0]&=127;else throw new Error("Invalid signature length");return i<27&&(i=i+BigInt(27)),{v:i,r,s:n}};_t.fromRpcSig=Lm;const Nm=function(e,t,r,n=!0,i){if(t.length!==32||r.length!==32||!Ki(Zi(e,i)))return!1;const o=(0,mt.bufferToBigInt)(t),s=(0,mt.bufferToBigInt)(r);return!(o===BigInt(0)||o>=Wo.SECP256K1_ORDER||s===BigInt(0)||s>=Wo.SECP256K1_ORDER||n&&s>=Wo.SECP256K1_ORDER_DIV_2)};_t.isValidSignature=Nm;const Bm=function(e){(0,Im.assertIsBuffer)(e);const t=x.dist.Buffer.from(`Ethereum Signed Message:
3
3
  ${e.length}`,"utf-8");return x.dist.Buffer.from((0,Am.keccak256)(x.dist.Buffer.concat([t,e])))};_t.hashPersonalMessage=Bm;var Hc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.compactBytesToNibbles=e.bytesToNibbles=e.nibblesToCompactBytes=e.nibblesToBytes=e.hasTerminator=void 0;const t=s=>s.length>0&&s[s.length-1]===16;e.hasTerminator=t;const r=(s,f)=>{for(let l=0,u=0;u<s.length;l+=1,u+=2)f[l]=s[u]<<4|s[u+1]};e.nibblesToBytes=r;const n=s=>{let f=0;(0,e.hasTerminator)(s)&&(f=1,s=s.subarray(0,s.length-1));const l=new Uint8Array(s.length/2+1);return l[0]=f<<5,(s.length&1)===1&&(l[0]|=16,l[0]|=s[0],s=s.subarray(1)),(0,e.nibblesToBytes)(s,l.subarray(1)),l};e.nibblesToCompactBytes=n;const i=s=>{const f=s.length*2+1,l=new Uint8Array(f);for(let u=0;u<s.length;u++){const c=s[u];l[u*2]=c/16,l[u*2+1]=c%16}return l[f-1]=16,l};e.bytesToNibbles=i;const o=s=>{if(s.length===0)return s;let f=(0,e.bytesToNibbles)(s);f[0]<2&&(f=f.subarray(0,f.length-1));const l=2-(f[0]&1);return f.subarray(l)};e.compactBytesToNibbles=o})(Hc);var Ji={};Object.defineProperty(Ji,"__esModule",{value:!0});Ji.AsyncEventEmitter=void 0;const $m=x.eventsExports;async function xm(e,t,r){let n;for await(const i of t)try{i.length<2?i.call(e,r):await new Promise((o,s)=>{i.call(e,r,f=>{f?s(f):o()})})}catch(o){n=o}if(n)throw n}class km extends $m.EventEmitter{emit(t,...r){let[n,i]=r;const o=this;let s=o._events[t]??[];return i===void 0&&typeof n=="function"&&(i=n,n=void 0),(t==="newListener"||t==="removeListener")&&(n={event:n,fn:i},i=void 0),s=Array.isArray(s)?s:[s],xm(o,s.slice(),n).then(i).catch(i),o.listenerCount(t)>0}once(t,r){const n=this;let i;if(typeof r!="function")throw new TypeError("listener must be a function");return r.length>=2?i=function(o,s){n.removeListener(t,i),r(o,s)}:i=function(o){n.removeListener(t,i),r(o,i)},n.on(t,i),n}first(t,r){let n=this._events[t]??[];if(typeof r!="function")throw new TypeError("listener must be a function");return Array.isArray(n)||(this._events[t]=n=[n]),n.unshift(r),this}before(t,r,n){return this.beforeOrAfter(t,r,n)}after(t,r,n){return this.beforeOrAfter(t,r,n,"after")}beforeOrAfter(t,r,n,i){let o=this._events[t]??[],s,f;const l=i==="after"?1:0;if(typeof n!="function")throw new TypeError("listener must be a function");if(typeof r!="function")throw new TypeError("target must be a function");for(Array.isArray(o)||(this._events[t]=o=[o]),f=o.length,s=o.length;s--;)if(o[s]===r){f=s+l;break}return o.splice(f,0,n),this}on(t,r){return super.on(t,r)}addListener(t,r){return super.addListener(t,r)}prependListener(t,r){return super.prependListener(t,r)}prependOnceListener(t,r){return super.prependOnceListener(t,r)}removeAllListeners(t){return super.removeAllListeners(t)}removeListener(t,r){return super.removeListener(t,r)}eventNames(){return super.eventNames()}listeners(t){return super.listeners(t)}listenerCount(t){return super.listenerCount(t)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(t){return super.setMaxListeners(t)}}Ji.AsyncEventEmitter=km;var Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.Lock=void 0;class Dm{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise(t=>this.promiseResolverQueue.push(t))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(this.permits===1&&this.promiseResolverQueue.length>0){this.permits-=1;const t=this.promiseResolverQueue.shift();t&&t(!0)}}}Xi.Lock=Dm;var tn={},Nr={},Vo={},qo={},Go,nf;function jm(){if(nf)return Go;nf=1;function e(){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 Go=e,Go}var kt={},Zo={},of;function Yi(){return of||(of=1,function(e){var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function r(o,s){return Object.prototype.hasOwnProperty.call(o,s)}e.assign=function(o){for(var s=Array.prototype.slice.call(arguments,1);s.length;){var f=s.shift();if(f){if(typeof f!="object")throw new TypeError(f+"must be non-object");for(var l in f)r(f,l)&&(o[l]=f[l])}}return o},e.shrinkBuf=function(o,s){return o.length===s?o:o.subarray?o.subarray(0,s):(o.length=s,o)};var n={arraySet:function(o,s,f,l,u){if(s.subarray&&o.subarray){o.set(s.subarray(f,f+l),u);return}for(var c=0;c<l;c++)o[u+c]=s[f+c]},flattenChunks:function(o){var s,f,l,u,c,h;for(l=0,s=0,f=o.length;s<f;s++)l+=o[s].length;for(h=new Uint8Array(l),u=0,s=0,f=o.length;s<f;s++)c=o[s],h.set(c,u),u+=c.length;return h}},i={arraySet:function(o,s,f,l,u){for(var c=0;c<l;c++)o[u+c]=s[f+c]},flattenChunks:function(o){return[].concat.apply([],o)}};e.setTyped=function(o){o?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)}(Zo)),Zo}var vr={},sf;function Mm(){if(sf)return vr;sf=1;var e=Yi(),t=4,r=0,n=1,i=2;function o(w){for(var oe=w.length;--oe>=0;)w[oe]=0}var s=0,f=1,l=2,u=3,c=258,h=29,m=256,y=m+1+h,v=30,G=19,M=2*y+1,j=15,E=16,z=7,R=256,q=16,k=17,U=18,te=[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],W=[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],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],_=512,p=new Array((y+2)*2);o(p);var b=new Array(v*2);o(b);var B=new Array(_);o(B);var V=new Array(c-u+1);o(V);var L=new Array(h);o(L);var D=new Array(v);o(D);function N(w,oe,ue,we,F){this.static_tree=w,this.extra_bits=oe,this.extra_base=ue,this.elems=we,this.max_length=F,this.has_stree=w&&w.length}var O,X,ie;function ne(w,oe){this.dyn_tree=w,this.max_code=0,this.stat_desc=oe}function ae(w){return w<256?B[w]:B[256+(w>>>7)]}function de(w,oe){w.pending_buf[w.pending++]=oe&255,w.pending_buf[w.pending++]=oe>>>8&255}function ge(w,oe,ue){w.bi_valid>E-ue?(w.bi_buf|=oe<<w.bi_valid&65535,de(w,w.bi_buf),w.bi_buf=oe>>E-w.bi_valid,w.bi_valid+=ue-E):(w.bi_buf|=oe<<w.bi_valid&65535,w.bi_valid+=ue)}function Se(w,oe,ue){ge(w,ue[oe*2],ue[oe*2+1])}function _e(w,oe){var ue=0;do ue|=w&1,w>>>=1,ue<<=1;while(--oe>0);return ue>>>1}function pe(w){w.bi_valid===16?(de(w,w.bi_buf),w.bi_buf=0,w.bi_valid=0):w.bi_valid>=8&&(w.pending_buf[w.pending++]=w.bi_buf&255,w.bi_buf>>=8,w.bi_valid-=8)}function Oe(w,oe){var ue=oe.dyn_tree,we=oe.max_code,F=oe.stat_desc.static_tree,re=oe.stat_desc.has_stree,d=oe.stat_desc.extra_bits,fe=oe.stat_desc.extra_base,Ae=oe.stat_desc.max_length,a,Y,Q,g,$,J,Re=0;for(g=0;g<=j;g++)w.bl_count[g]=0;for(ue[w.heap[w.heap_max]*2+1]=0,a=w.heap_max+1;a<M;a++)Y=w.heap[a],g=ue[ue[Y*2+1]*2+1]+1,g>Ae&&(g=Ae,Re++),ue[Y*2+1]=g,!(Y>we)&&(w.bl_count[g]++,$=0,Y>=fe&&($=d[Y-fe]),J=ue[Y*2],w.opt_len+=J*(g+$),re&&(w.static_len+=J*(F[Y*2+1]+$)));if(Re!==0){do{for(g=Ae-1;w.bl_count[g]===0;)g--;w.bl_count[g]--,w.bl_count[g+1]+=2,w.bl_count[Ae]--,Re-=2}while(Re>0);for(g=Ae;g!==0;g--)for(Y=w.bl_count[g];Y!==0;)Q=w.heap[--a],!(Q>we)&&(ue[Q*2+1]!==g&&(w.opt_len+=(g-ue[Q*2+1])*ue[Q*2],ue[Q*2+1]=g),Y--)}}function Pe(w,oe,ue){var we=new Array(j+1),F=0,re,d;for(re=1;re<=j;re++)we[re]=F=F+ue[re-1]<<1;for(d=0;d<=oe;d++){var fe=w[d*2+1];fe!==0&&(w[d*2]=_e(we[fe]++,fe))}}function Te(){var w,oe,ue,we,F,re=new Array(j+1);for(ue=0,we=0;we<h-1;we++)for(L[we]=ue,w=0;w<1<<te[we];w++)V[ue++]=we;for(V[ue-1]=we,F=0,we=0;we<16;we++)for(D[we]=F,w=0;w<1<<W[we];w++)B[F++]=we;for(F>>=7;we<v;we++)for(D[we]=F<<7,w=0;w<1<<W[we]-7;w++)B[256+F++]=we;for(oe=0;oe<=j;oe++)re[oe]=0;for(w=0;w<=143;)p[w*2+1]=8,w++,re[8]++;for(;w<=255;)p[w*2+1]=9,w++,re[9]++;for(;w<=279;)p[w*2+1]=7,w++,re[7]++;for(;w<=287;)p[w*2+1]=8,w++,re[8]++;for(Pe(p,y+1,re),w=0;w<v;w++)b[w*2+1]=5,b[w*2]=_e(w,5);O=new N(p,te,m+1,y,j),X=new N(b,W,0,v,j),ie=new N(new Array(0),P,0,G,z)}function T(w){var oe;for(oe=0;oe<y;oe++)w.dyn_ltree[oe*2]=0;for(oe=0;oe<v;oe++)w.dyn_dtree[oe*2]=0;for(oe=0;oe<G;oe++)w.bl_tree[oe*2]=0;w.dyn_ltree[R*2]=1,w.opt_len=w.static_len=0,w.last_lit=w.matches=0}function C(w){w.bi_valid>8?de(w,w.bi_buf):w.bi_valid>0&&(w.pending_buf[w.pending++]=w.bi_buf),w.bi_buf=0,w.bi_valid=0}function K(w,oe,ue,we){C(w),we&&(de(w,ue),de(w,~ue)),e.arraySet(w.pending_buf,w.window,oe,ue,w.pending),w.pending+=ue}function ce(w,oe,ue,we){var F=oe*2,re=ue*2;return w[F]<w[re]||w[F]===w[re]&&we[oe]<=we[ue]}function se(w,oe,ue){for(var we=w.heap[ue],F=ue<<1;F<=w.heap_len&&(F<w.heap_len&&ce(oe,w.heap[F+1],w.heap[F],w.depth)&&F++,!ce(oe,we,w.heap[F],w.depth));)w.heap[ue]=w.heap[F],ue=F,F<<=1;w.heap[ue]=we}function be(w,oe,ue){var we,F,re=0,d,fe;if(w.last_lit!==0)do we=w.pending_buf[w.d_buf+re*2]<<8|w.pending_buf[w.d_buf+re*2+1],F=w.pending_buf[w.l_buf+re],re++,we===0?Se(w,F,oe):(d=V[F],Se(w,d+m+1,oe),fe=te[d],fe!==0&&(F-=L[d],ge(w,F,fe)),we--,d=ae(we),Se(w,d,ue),fe=W[d],fe!==0&&(we-=D[d],ge(w,we,fe)));while(re<w.last_lit);Se(w,R,oe)}function Ie(w,oe){var ue=oe.dyn_tree,we=oe.stat_desc.static_tree,F=oe.stat_desc.has_stree,re=oe.stat_desc.elems,d,fe,Ae=-1,a;for(w.heap_len=0,w.heap_max=M,d=0;d<re;d++)ue[d*2]!==0?(w.heap[++w.heap_len]=Ae=d,w.depth[d]=0):ue[d*2+1]=0;for(;w.heap_len<2;)a=w.heap[++w.heap_len]=Ae<2?++Ae:0,ue[a*2]=1,w.depth[a]=0,w.opt_len--,F&&(w.static_len-=we[a*2+1]);for(oe.max_code=Ae,d=w.heap_len>>1;d>=1;d--)se(w,ue,d);a=re;do d=w.heap[1],w.heap[1]=w.heap[w.heap_len--],se(w,ue,1),fe=w.heap[1],w.heap[--w.heap_max]=d,w.heap[--w.heap_max]=fe,ue[a*2]=ue[d*2]+ue[fe*2],w.depth[a]=(w.depth[d]>=w.depth[fe]?w.depth[d]:w.depth[fe])+1,ue[d*2+1]=ue[fe*2+1]=a,w.heap[1]=a++,se(w,ue,1);while(w.heap_len>=2);w.heap[--w.heap_max]=w.heap[1],Oe(w,oe),Pe(ue,Ae,w.bl_count)}function Ne(w,oe,ue){var we,F=-1,re,d=oe[0*2+1],fe=0,Ae=7,a=4;for(d===0&&(Ae=138,a=3),oe[(ue+1)*2+1]=65535,we=0;we<=ue;we++)re=d,d=oe[(we+1)*2+1],!(++fe<Ae&&re===d)&&(fe<a?w.bl_tree[re*2]+=fe:re!==0?(re!==F&&w.bl_tree[re*2]++,w.bl_tree[q*2]++):fe<=10?w.bl_tree[k*2]++:w.bl_tree[U*2]++,fe=0,F=re,d===0?(Ae=138,a=3):re===d?(Ae=6,a=3):(Ae=7,a=4))}function He(w,oe,ue){var we,F=-1,re,d=oe[0*2+1],fe=0,Ae=7,a=4;for(d===0&&(Ae=138,a=3),we=0;we<=ue;we++)if(re=d,d=oe[(we+1)*2+1],!(++fe<Ae&&re===d)){if(fe<a)do Se(w,re,w.bl_tree);while(--fe!==0);else re!==0?(re!==F&&(Se(w,re,w.bl_tree),fe--),Se(w,q,w.bl_tree),ge(w,fe-3,2)):fe<=10?(Se(w,k,w.bl_tree),ge(w,fe-3,3)):(Se(w,U,w.bl_tree),ge(w,fe-11,7));fe=0,F=re,d===0?(Ae=138,a=3):re===d?(Ae=6,a=3):(Ae=7,a=4)}}function Ue(w){var oe;for(Ne(w,w.dyn_ltree,w.l_desc.max_code),Ne(w,w.dyn_dtree,w.d_desc.max_code),Ie(w,w.bl_desc),oe=G-1;oe>=3&&w.bl_tree[Z[oe]*2+1]===0;oe--);return w.opt_len+=3*(oe+1)+5+5+4,oe}function De(w,oe,ue,we){var F;for(ge(w,oe-257,5),ge(w,ue-1,5),ge(w,we-4,4),F=0;F<we;F++)ge(w,w.bl_tree[Z[F]*2+1],3);He(w,w.dyn_ltree,oe-1),He(w,w.dyn_dtree,ue-1)}function tt(w){var oe=4093624447,ue;for(ue=0;ue<=31;ue++,oe>>>=1)if(oe&1&&w.dyn_ltree[ue*2]!==0)return r;if(w.dyn_ltree[9*2]!==0||w.dyn_ltree[10*2]!==0||w.dyn_ltree[13*2]!==0)return n;for(ue=32;ue<m;ue++)if(w.dyn_ltree[ue*2]!==0)return n;return r}var S=!1;function I(w){S||(Te(),S=!0),w.l_desc=new ne(w.dyn_ltree,O),w.d_desc=new ne(w.dyn_dtree,X),w.bl_desc=new ne(w.bl_tree,ie),w.bi_buf=0,w.bi_valid=0,T(w)}function he(w,oe,ue,we){ge(w,(s<<1)+(we?1:0),3),K(w,oe,ue,!0)}function le(w){ge(w,f<<1,3),Se(w,R,p),pe(w)}function ye(w,oe,ue,we){var F,re,d=0;w.level>0?(w.strm.data_type===i&&(w.strm.data_type=tt(w)),Ie(w,w.l_desc),Ie(w,w.d_desc),d=Ue(w),F=w.opt_len+3+7>>>3,re=w.static_len+3+7>>>3,re<=F&&(F=re)):F=re=ue+5,ue+4<=F&&oe!==-1?he(w,oe,ue,we):w.strategy===t||re===F?(ge(w,(f<<1)+(we?1:0),3),be(w,p,b)):(ge(w,(l<<1)+(we?1:0),3),De(w,w.l_desc.max_code+1,w.d_desc.max_code+1,d+1),be(w,w.dyn_ltree,w.dyn_dtree)),T(w),we&&C(w)}function je(w,oe,ue){return w.pending_buf[w.d_buf+w.last_lit*2]=oe>>>8&255,w.pending_buf[w.d_buf+w.last_lit*2+1]=oe&255,w.pending_buf[w.l_buf+w.last_lit]=ue&255,w.last_lit++,oe===0?w.dyn_ltree[ue*2]++:(w.matches++,oe--,w.dyn_ltree[(V[ue]+m+1)*2]++,w.dyn_dtree[ae(oe)*2]++),w.last_lit===w.lit_bufsize-1}return vr._tr_init=I,vr._tr_stored_block=he,vr._tr_flush_block=ye,vr._tr_tally=je,vr._tr_align=le,vr}var Ko,af;function zc(){if(af)return Ko;af=1;function e(t,r,n,i){for(var o=t&65535|0,s=t>>>16&65535|0,f=0;n!==0;){f=n>2e3?2e3:n,n-=f;do o=o+r[i++]|0,s=s+o|0;while(--f);o%=65521,s%=65521}return o|s<<16|0}return Ko=e,Ko}var Jo,lf;function Wc(){if(lf)return Jo;lf=1;function e(){for(var n,i=[],o=0;o<256;o++){n=o;for(var s=0;s<8;s++)n=n&1?3988292384^n>>>1:n>>>1;i[o]=n}return i}var t=e();function r(n,i,o,s){var f=t,l=s+o;n^=-1;for(var u=s;u<l;u++)n=n>>>8^f[(n^i[u])&255];return n^-1}return Jo=r,Jo}var Xo,ff;function Um(){return ff||(ff=1,Xo={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"}),Xo}var uf;function Fm(){if(uf)return kt;uf=1;var e=Yi(),t=Mm(),r=zc(),n=Wc(),i=Um(),o=0,s=1,f=3,l=4,u=5,c=0,h=1,m=-2,y=-3,v=-5,G=-1,M=1,j=2,E=3,z=4,R=0,q=2,k=8,U=9,te=15,W=8,P=29,Z=256,_=Z+1+P,p=30,b=19,B=2*_+1,V=15,L=3,D=258,N=D+L+1,O=32,X=42,ie=69,ne=73,ae=91,de=103,ge=113,Se=666,_e=1,pe=2,Oe=3,Pe=4,Te=3;function T(a,Y){return a.msg=i[Y],Y}function C(a){return(a<<1)-(a>4?9:0)}function K(a){for(var Y=a.length;--Y>=0;)a[Y]=0}function ce(a){var Y=a.state,Q=Y.pending;Q>a.avail_out&&(Q=a.avail_out),Q!==0&&(e.arraySet(a.output,Y.pending_buf,Y.pending_out,Q,a.next_out),a.next_out+=Q,Y.pending_out+=Q,a.total_out+=Q,a.avail_out-=Q,Y.pending-=Q,Y.pending===0&&(Y.pending_out=0))}function se(a,Y){t._tr_flush_block(a,a.block_start>=0?a.block_start:-1,a.strstart-a.block_start,Y),a.block_start=a.strstart,ce(a.strm)}function be(a,Y){a.pending_buf[a.pending++]=Y}function Ie(a,Y){a.pending_buf[a.pending++]=Y>>>8&255,a.pending_buf[a.pending++]=Y&255}function Ne(a,Y,Q,g){var $=a.avail_in;return $>g&&($=g),$===0?0:(a.avail_in-=$,e.arraySet(Y,a.input,a.next_in,$,Q),a.state.wrap===1?a.adler=r(a.adler,Y,$,Q):a.state.wrap===2&&(a.adler=n(a.adler,Y,$,Q)),a.next_in+=$,a.total_in+=$,$)}function He(a,Y){var Q=a.max_chain_length,g=a.strstart,$,J,Re=a.prev_length,me=a.nice_match,Ee=a.strstart>a.w_size-N?a.strstart-(a.w_size-N):0,Be=a.window,rt=a.w_mask,Ge=a.prev,$e=a.strstart+D,et=Be[g+Re-1],ot=Be[g+Re];a.prev_length>=a.good_match&&(Q>>=2),me>a.lookahead&&(me=a.lookahead);do if($=Y,!(Be[$+Re]!==ot||Be[$+Re-1]!==et||Be[$]!==Be[g]||Be[++$]!==Be[g+1])){g+=2,$++;do;while(Be[++g]===Be[++$]&&Be[++g]===Be[++$]&&Be[++g]===Be[++$]&&Be[++g]===Be[++$]&&Be[++g]===Be[++$]&&Be[++g]===Be[++$]&&Be[++g]===Be[++$]&&Be[++g]===Be[++$]&&g<$e);if(J=D-($e-g),g=$e-D,J>Re){if(a.match_start=Y,Re=J,J>=me)break;et=Be[g+Re-1],ot=Be[g+Re]}}while((Y=Ge[Y&rt])>Ee&&--Q!==0);return Re<=a.lookahead?Re:a.lookahead}function Ue(a){var Y=a.w_size,Q,g,$,J,Re;do{if(J=a.window_size-a.lookahead-a.strstart,a.strstart>=Y+(Y-N)){e.arraySet(a.window,a.window,Y,Y,0),a.match_start-=Y,a.strstart-=Y,a.block_start-=Y,g=a.hash_size,Q=g;do $=a.head[--Q],a.head[Q]=$>=Y?$-Y:0;while(--g);g=Y,Q=g;do $=a.prev[--Q],a.prev[Q]=$>=Y?$-Y:0;while(--g);J+=Y}if(a.strm.avail_in===0)break;if(g=Ne(a.strm,a.window,a.strstart+a.lookahead,J),a.lookahead+=g,a.lookahead+a.insert>=L)for(Re=a.strstart-a.insert,a.ins_h=a.window[Re],a.ins_h=(a.ins_h<<a.hash_shift^a.window[Re+1])&a.hash_mask;a.insert&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[Re+L-1])&a.hash_mask,a.prev[Re&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=Re,Re++,a.insert--,!(a.lookahead+a.insert<L)););}while(a.lookahead<N&&a.strm.avail_in!==0)}function De(a,Y){var Q=65535;for(Q>a.pending_buf_size-5&&(Q=a.pending_buf_size-5);;){if(a.lookahead<=1){if(Ue(a),a.lookahead===0&&Y===o)return _e;if(a.lookahead===0)break}a.strstart+=a.lookahead,a.lookahead=0;var g=a.block_start+Q;if((a.strstart===0||a.strstart>=g)&&(a.lookahead=a.strstart-g,a.strstart=g,se(a,!1),a.strm.avail_out===0)||a.strstart-a.block_start>=a.w_size-N&&(se(a,!1),a.strm.avail_out===0))return _e}return a.insert=0,Y===l?(se(a,!0),a.strm.avail_out===0?Oe:Pe):(a.strstart>a.block_start&&(se(a,!1),a.strm.avail_out===0),_e)}function tt(a,Y){for(var Q,g;;){if(a.lookahead<N){if(Ue(a),a.lookahead<N&&Y===o)return _e;if(a.lookahead===0)break}if(Q=0,a.lookahead>=L&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+L-1])&a.hash_mask,Q=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),Q!==0&&a.strstart-Q<=a.w_size-N&&(a.match_length=He(a,Q)),a.match_length>=L)if(g=t._tr_tally(a,a.strstart-a.match_start,a.match_length-L),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&a.lookahead>=L){a.match_length--;do a.strstart++,a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+L-1])&a.hash_mask,Q=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart;while(--a.match_length!==0);a.strstart++}else a.strstart+=a.match_length,a.match_length=0,a.ins_h=a.window[a.strstart],a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+1])&a.hash_mask;else g=t._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++;if(g&&(se(a,!1),a.strm.avail_out===0))return _e}return a.insert=a.strstart<L-1?a.strstart:L-1,Y===l?(se(a,!0),a.strm.avail_out===0?Oe:Pe):a.last_lit&&(se(a,!1),a.strm.avail_out===0)?_e:pe}function S(a,Y){for(var Q,g,$;;){if(a.lookahead<N){if(Ue(a),a.lookahead<N&&Y===o)return _e;if(a.lookahead===0)break}if(Q=0,a.lookahead>=L&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+L-1])&a.hash_mask,Q=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),a.prev_length=a.match_length,a.prev_match=a.match_start,a.match_length=L-1,Q!==0&&a.prev_length<a.max_lazy_match&&a.strstart-Q<=a.w_size-N&&(a.match_length=He(a,Q),a.match_length<=5&&(a.strategy===M||a.match_length===L&&a.strstart-a.match_start>4096)&&(a.match_length=L-1)),a.prev_length>=L&&a.match_length<=a.prev_length){$=a.strstart+a.lookahead-L,g=t._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-L),a.lookahead-=a.prev_length-1,a.prev_length-=2;do++a.strstart<=$&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+L-1])&a.hash_mask,Q=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(--a.prev_length!==0);if(a.match_available=0,a.match_length=L-1,a.strstart++,g&&(se(a,!1),a.strm.avail_out===0))return _e}else if(a.match_available){if(g=t._tr_tally(a,0,a.window[a.strstart-1]),g&&se(a,!1),a.strstart++,a.lookahead--,a.strm.avail_out===0)return _e}else a.match_available=1,a.strstart++,a.lookahead--}return a.match_available&&(g=t._tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0),a.insert=a.strstart<L-1?a.strstart:L-1,Y===l?(se(a,!0),a.strm.avail_out===0?Oe:Pe):a.last_lit&&(se(a,!1),a.strm.avail_out===0)?_e:pe}function I(a,Y){for(var Q,g,$,J,Re=a.window;;){if(a.lookahead<=D){if(Ue(a),a.lookahead<=D&&Y===o)return _e;if(a.lookahead===0)break}if(a.match_length=0,a.lookahead>=L&&a.strstart>0&&($=a.strstart-1,g=Re[$],g===Re[++$]&&g===Re[++$]&&g===Re[++$])){J=a.strstart+D;do;while(g===Re[++$]&&g===Re[++$]&&g===Re[++$]&&g===Re[++$]&&g===Re[++$]&&g===Re[++$]&&g===Re[++$]&&g===Re[++$]&&$<J);a.match_length=D-(J-$),a.match_length>a.lookahead&&(a.match_length=a.lookahead)}if(a.match_length>=L?(Q=t._tr_tally(a,1,a.match_length-L),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(Q=t._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++),Q&&(se(a,!1),a.strm.avail_out===0))return _e}return a.insert=0,Y===l?(se(a,!0),a.strm.avail_out===0?Oe:Pe):a.last_lit&&(se(a,!1),a.strm.avail_out===0)?_e:pe}function he(a,Y){for(var Q;;){if(a.lookahead===0&&(Ue(a),a.lookahead===0)){if(Y===o)return _e;break}if(a.match_length=0,Q=t._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++,Q&&(se(a,!1),a.strm.avail_out===0))return _e}return a.insert=0,Y===l?(se(a,!0),a.strm.avail_out===0?Oe:Pe):a.last_lit&&(se(a,!1),a.strm.avail_out===0)?_e:pe}function le(a,Y,Q,g,$){this.good_length=a,this.max_lazy=Y,this.nice_length=Q,this.max_chain=g,this.func=$}var ye;ye=[new le(0,0,0,0,De),new le(4,4,8,4,tt),new le(4,5,16,8,tt),new le(4,6,32,32,tt),new le(4,4,16,16,S),new le(8,16,32,32,S),new le(8,16,128,128,S),new le(8,32,128,256,S),new le(32,128,258,1024,S),new le(32,258,258,4096,S)];function je(a){a.window_size=2*a.w_size,K(a.head),a.max_lazy_match=ye[a.level].max_lazy,a.good_match=ye[a.level].good_length,a.nice_match=ye[a.level].nice_length,a.max_chain_length=ye[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=L-1,a.match_available=0,a.ins_h=0}function w(){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=k,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 e.Buf16(B*2),this.dyn_dtree=new e.Buf16((2*p+1)*2),this.bl_tree=new e.Buf16((2*b+1)*2),K(this.dyn_ltree),K(this.dyn_dtree),K(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new e.Buf16(V+1),this.heap=new e.Buf16(2*_+1),K(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new e.Buf16(2*_+1),K(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 oe(a){var Y;return!a||!a.state?T(a,m):(a.total_in=a.total_out=0,a.data_type=q,Y=a.state,Y.pending=0,Y.pending_out=0,Y.wrap<0&&(Y.wrap=-Y.wrap),Y.status=Y.wrap?X:ge,a.adler=Y.wrap===2?0:1,Y.last_flush=o,t._tr_init(Y),c)}function ue(a){var Y=oe(a);return Y===c&&je(a.state),Y}function we(a,Y){return!a||!a.state||a.state.wrap!==2?m:(a.state.gzhead=Y,c)}function F(a,Y,Q,g,$,J){if(!a)return m;var Re=1;if(Y===G&&(Y=6),g<0?(Re=0,g=-g):g>15&&(Re=2,g-=16),$<1||$>U||Q!==k||g<8||g>15||Y<0||Y>9||J<0||J>z)return T(a,m);g===8&&(g=9);var me=new w;return a.state=me,me.strm=a,me.wrap=Re,me.gzhead=null,me.w_bits=g,me.w_size=1<<me.w_bits,me.w_mask=me.w_size-1,me.hash_bits=$+7,me.hash_size=1<<me.hash_bits,me.hash_mask=me.hash_size-1,me.hash_shift=~~((me.hash_bits+L-1)/L),me.window=new e.Buf8(me.w_size*2),me.head=new e.Buf16(me.hash_size),me.prev=new e.Buf16(me.w_size),me.lit_bufsize=1<<$+6,me.pending_buf_size=me.lit_bufsize*4,me.pending_buf=new e.Buf8(me.pending_buf_size),me.d_buf=1*me.lit_bufsize,me.l_buf=3*me.lit_bufsize,me.level=Y,me.strategy=J,me.method=Q,ue(a)}function re(a,Y){return F(a,Y,k,te,W,R)}function d(a,Y){var Q,g,$,J;if(!a||!a.state||Y>u||Y<0)return a?T(a,m):m;if(g=a.state,!a.output||!a.input&&a.avail_in!==0||g.status===Se&&Y!==l)return T(a,a.avail_out===0?v:m);if(g.strm=a,Q=g.last_flush,g.last_flush=Y,g.status===X)if(g.wrap===2)a.adler=0,be(g,31),be(g,139),be(g,8),g.gzhead?(be(g,(g.gzhead.text?1:0)+(g.gzhead.hcrc?2:0)+(g.gzhead.extra?4:0)+(g.gzhead.name?8:0)+(g.gzhead.comment?16:0)),be(g,g.gzhead.time&255),be(g,g.gzhead.time>>8&255),be(g,g.gzhead.time>>16&255),be(g,g.gzhead.time>>24&255),be(g,g.level===9?2:g.strategy>=j||g.level<2?4:0),be(g,g.gzhead.os&255),g.gzhead.extra&&g.gzhead.extra.length&&(be(g,g.gzhead.extra.length&255),be(g,g.gzhead.extra.length>>8&255)),g.gzhead.hcrc&&(a.adler=n(a.adler,g.pending_buf,g.pending,0)),g.gzindex=0,g.status=ie):(be(g,0),be(g,0),be(g,0),be(g,0),be(g,0),be(g,g.level===9?2:g.strategy>=j||g.level<2?4:0),be(g,Te),g.status=ge);else{var Re=k+(g.w_bits-8<<4)<<8,me=-1;g.strategy>=j||g.level<2?me=0:g.level<6?me=1:g.level===6?me=2:me=3,Re|=me<<6,g.strstart!==0&&(Re|=O),Re+=31-Re%31,g.status=ge,Ie(g,Re),g.strstart!==0&&(Ie(g,a.adler>>>16),Ie(g,a.adler&65535)),a.adler=1}if(g.status===ie)if(g.gzhead.extra){for($=g.pending;g.gzindex<(g.gzhead.extra.length&65535)&&!(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>$&&(a.adler=n(a.adler,g.pending_buf,g.pending-$,$)),ce(a),$=g.pending,g.pending===g.pending_buf_size));)be(g,g.gzhead.extra[g.gzindex]&255),g.gzindex++;g.gzhead.hcrc&&g.pending>$&&(a.adler=n(a.adler,g.pending_buf,g.pending-$,$)),g.gzindex===g.gzhead.extra.length&&(g.gzindex=0,g.status=ne)}else g.status=ne;if(g.status===ne)if(g.gzhead.name){$=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>$&&(a.adler=n(a.adler,g.pending_buf,g.pending-$,$)),ce(a),$=g.pending,g.pending===g.pending_buf_size)){J=1;break}g.gzindex<g.gzhead.name.length?J=g.gzhead.name.charCodeAt(g.gzindex++)&255:J=0,be(g,J)}while(J!==0);g.gzhead.hcrc&&g.pending>$&&(a.adler=n(a.adler,g.pending_buf,g.pending-$,$)),J===0&&(g.gzindex=0,g.status=ae)}else g.status=ae;if(g.status===ae)if(g.gzhead.comment){$=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>$&&(a.adler=n(a.adler,g.pending_buf,g.pending-$,$)),ce(a),$=g.pending,g.pending===g.pending_buf_size)){J=1;break}g.gzindex<g.gzhead.comment.length?J=g.gzhead.comment.charCodeAt(g.gzindex++)&255:J=0,be(g,J)}while(J!==0);g.gzhead.hcrc&&g.pending>$&&(a.adler=n(a.adler,g.pending_buf,g.pending-$,$)),J===0&&(g.status=de)}else g.status=de;if(g.status===de&&(g.gzhead.hcrc?(g.pending+2>g.pending_buf_size&&ce(a),g.pending+2<=g.pending_buf_size&&(be(g,a.adler&255),be(g,a.adler>>8&255),a.adler=0,g.status=ge)):g.status=ge),g.pending!==0){if(ce(a),a.avail_out===0)return g.last_flush=-1,c}else if(a.avail_in===0&&C(Y)<=C(Q)&&Y!==l)return T(a,v);if(g.status===Se&&a.avail_in!==0)return T(a,v);if(a.avail_in!==0||g.lookahead!==0||Y!==o&&g.status!==Se){var Ee=g.strategy===j?he(g,Y):g.strategy===E?I(g,Y):ye[g.level].func(g,Y);if((Ee===Oe||Ee===Pe)&&(g.status=Se),Ee===_e||Ee===Oe)return a.avail_out===0&&(g.last_flush=-1),c;if(Ee===pe&&(Y===s?t._tr_align(g):Y!==u&&(t._tr_stored_block(g,0,0,!1),Y===f&&(K(g.head),g.lookahead===0&&(g.strstart=0,g.block_start=0,g.insert=0))),ce(a),a.avail_out===0))return g.last_flush=-1,c}return Y!==l?c:g.wrap<=0?h:(g.wrap===2?(be(g,a.adler&255),be(g,a.adler>>8&255),be(g,a.adler>>16&255),be(g,a.adler>>24&255),be(g,a.total_in&255),be(g,a.total_in>>8&255),be(g,a.total_in>>16&255),be(g,a.total_in>>24&255)):(Ie(g,a.adler>>>16),Ie(g,a.adler&65535)),ce(a),g.wrap>0&&(g.wrap=-g.wrap),g.pending!==0?c:h)}function fe(a){var Y;return!a||!a.state?m:(Y=a.state.status,Y!==X&&Y!==ie&&Y!==ne&&Y!==ae&&Y!==de&&Y!==ge&&Y!==Se?T(a,m):(a.state=null,Y===ge?T(a,y):c))}function Ae(a,Y){var Q=Y.length,g,$,J,Re,me,Ee,Be,rt;if(!a||!a.state||(g=a.state,Re=g.wrap,Re===2||Re===1&&g.status!==X||g.lookahead))return m;for(Re===1&&(a.adler=r(a.adler,Y,Q,0)),g.wrap=0,Q>=g.w_size&&(Re===0&&(K(g.head),g.strstart=0,g.block_start=0,g.insert=0),rt=new e.Buf8(g.w_size),e.arraySet(rt,Y,Q-g.w_size,g.w_size,0),Y=rt,Q=g.w_size),me=a.avail_in,Ee=a.next_in,Be=a.input,a.avail_in=Q,a.next_in=0,a.input=Y,Ue(g);g.lookahead>=L;){$=g.strstart,J=g.lookahead-(L-1);do g.ins_h=(g.ins_h<<g.hash_shift^g.window[$+L-1])&g.hash_mask,g.prev[$&g.w_mask]=g.head[g.ins_h],g.head[g.ins_h]=$,$++;while(--J);g.strstart=$,g.lookahead=L-1,Ue(g)}return g.strstart+=g.lookahead,g.block_start=g.strstart,g.insert=g.lookahead,g.lookahead=0,g.match_length=g.prev_length=L-1,g.match_available=0,a.next_in=Ee,a.input=Be,a.avail_in=me,g.wrap=Re,c}return kt.deflateInit=re,kt.deflateInit2=F,kt.deflateReset=ue,kt.deflateResetKeep=oe,kt.deflateSetHeader=we,kt.deflate=d,kt.deflateEnd=fe,kt.deflateSetDictionary=Ae,kt.deflateInfo="pako deflate (from Nodeca project)",kt}var Tt={},Yo,cf;function Hm(){if(cf)return Yo;cf=1;var e=30,t=12;return Yo=function(n,i){var o,s,f,l,u,c,h,m,y,v,G,M,j,E,z,R,q,k,U,te,W,P,Z,_,p;o=n.state,s=n.next_in,_=n.input,f=s+(n.avail_in-5),l=n.next_out,p=n.output,u=l-(i-n.avail_out),c=l+(n.avail_out-257),h=o.dmax,m=o.wsize,y=o.whave,v=o.wnext,G=o.window,M=o.hold,j=o.bits,E=o.lencode,z=o.distcode,R=(1<<o.lenbits)-1,q=(1<<o.distbits)-1;e:do{j<15&&(M+=_[s++]<<j,j+=8,M+=_[s++]<<j,j+=8),k=E[M&R];t:for(;;){if(U=k>>>24,M>>>=U,j-=U,U=k>>>16&255,U===0)p[l++]=k&65535;else if(U&16){te=k&65535,U&=15,U&&(j<U&&(M+=_[s++]<<j,j+=8),te+=M&(1<<U)-1,M>>>=U,j-=U),j<15&&(M+=_[s++]<<j,j+=8,M+=_[s++]<<j,j+=8),k=z[M&q];r:for(;;){if(U=k>>>24,M>>>=U,j-=U,U=k>>>16&255,U&16){if(W=k&65535,U&=15,j<U&&(M+=_[s++]<<j,j+=8,j<U&&(M+=_[s++]<<j,j+=8)),W+=M&(1<<U)-1,W>h){n.msg="invalid distance too far back",o.mode=e;break e}if(M>>>=U,j-=U,U=l-u,W>U){if(U=W-U,U>y&&o.sane){n.msg="invalid distance too far back",o.mode=e;break e}if(P=0,Z=G,v===0){if(P+=m-U,U<te){te-=U;do p[l++]=G[P++];while(--U);P=l-W,Z=p}}else if(v<U){if(P+=m+v-U,U-=v,U<te){te-=U;do p[l++]=G[P++];while(--U);if(P=0,v<te){U=v,te-=U;do p[l++]=G[P++];while(--U);P=l-W,Z=p}}}else if(P+=v-U,U<te){te-=U;do p[l++]=G[P++];while(--U);P=l-W,Z=p}for(;te>2;)p[l++]=Z[P++],p[l++]=Z[P++],p[l++]=Z[P++],te-=3;te&&(p[l++]=Z[P++],te>1&&(p[l++]=Z[P++]))}else{P=l-W;do p[l++]=p[P++],p[l++]=p[P++],p[l++]=p[P++],te-=3;while(te>2);te&&(p[l++]=p[P++],te>1&&(p[l++]=p[P++]))}}else if(U&64){n.msg="invalid distance code",o.mode=e;break e}else{k=z[(k&65535)+(M&(1<<U)-1)];continue r}break}}else if(U&64)if(U&32){o.mode=t;break e}else{n.msg="invalid literal/length code",o.mode=e;break e}else{k=E[(k&65535)+(M&(1<<U)-1)];continue t}break}}while(s<f&&l<c);te=j>>3,s-=te,j-=te<<3,M&=(1<<j)-1,n.next_in=s,n.next_out=l,n.avail_in=s<f?5+(f-s):5-(s-f),n.avail_out=l<c?257+(c-l):257-(l-c),o.hold=M,o.bits=j},Yo}var Qo,df;function zm(){if(df)return Qo;df=1;var e=Yi(),t=15,r=852,n=592,i=0,o=1,s=2,f=[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],l=[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],u=[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],c=[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 Qo=function(m,y,v,G,M,j,E,z){var R=z.bits,q=0,k=0,U=0,te=0,W=0,P=0,Z=0,_=0,p=0,b=0,B,V,L,D,N,O=null,X=0,ie,ne=new e.Buf16(t+1),ae=new e.Buf16(t+1),de=null,ge=0,Se,_e,pe;for(q=0;q<=t;q++)ne[q]=0;for(k=0;k<G;k++)ne[y[v+k]]++;for(W=R,te=t;te>=1&&ne[te]===0;te--);if(W>te&&(W=te),te===0)return M[j++]=1<<24|64<<16|0,M[j++]=1<<24|64<<16|0,z.bits=1,0;for(U=1;U<te&&ne[U]===0;U++);for(W<U&&(W=U),_=1,q=1;q<=t;q++)if(_<<=1,_-=ne[q],_<0)return-1;if(_>0&&(m===i||te!==1))return-1;for(ae[1]=0,q=1;q<t;q++)ae[q+1]=ae[q]+ne[q];for(k=0;k<G;k++)y[v+k]!==0&&(E[ae[y[v+k]]++]=k);if(m===i?(O=de=E,ie=19):m===o?(O=f,X-=257,de=l,ge-=257,ie=256):(O=u,de=c,ie=-1),b=0,k=0,q=U,N=j,P=W,Z=0,L=-1,p=1<<W,D=p-1,m===o&&p>r||m===s&&p>n)return 1;for(;;){Se=q-Z,E[k]<ie?(_e=0,pe=E[k]):E[k]>ie?(_e=de[ge+E[k]],pe=O[X+E[k]]):(_e=96,pe=0),B=1<<q-Z,V=1<<P,U=V;do V-=B,M[N+(b>>Z)+V]=Se<<24|_e<<16|pe|0;while(V!==0);for(B=1<<q-1;b&B;)B>>=1;if(B!==0?(b&=B-1,b+=B):b=0,k++,--ne[q]===0){if(q===te)break;q=y[v+E[k]]}if(q>W&&(b&D)!==L){for(Z===0&&(Z=W),N+=U,P=q-Z,_=1<<P;P+Z<te&&(_-=ne[P+Z],!(_<=0));)P++,_<<=1;if(p+=1<<P,m===o&&p>r||m===s&&p>n)return 1;L=b&D,M[L]=W<<24|P<<16|N-j|0}}return b!==0&&(M[N+b]=q-Z<<24|64<<16|0),z.bits=W,0},Qo}var hf;function Wm(){if(hf)return Tt;hf=1;var e=Yi(),t=zc(),r=Wc(),n=Hm(),i=zm(),o=0,s=1,f=2,l=4,u=5,c=6,h=0,m=1,y=2,v=-2,G=-3,M=-4,j=-5,E=8,z=1,R=2,q=3,k=4,U=5,te=6,W=7,P=8,Z=9,_=10,p=11,b=12,B=13,V=14,L=15,D=16,N=17,O=18,X=19,ie=20,ne=21,ae=22,de=23,ge=24,Se=25,_e=26,pe=27,Oe=28,Pe=29,Te=30,T=31,C=32,K=852,ce=592,se=15,be=se;function Ie(F){return(F>>>24&255)+(F>>>8&65280)+((F&65280)<<8)+((F&255)<<24)}function Ne(){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 e.Buf16(320),this.work=new e.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function He(F){var re;return!F||!F.state?v:(re=F.state,F.total_in=F.total_out=re.total=0,F.msg="",re.wrap&&(F.adler=re.wrap&1),re.mode=z,re.last=0,re.havedict=0,re.dmax=32768,re.head=null,re.hold=0,re.bits=0,re.lencode=re.lendyn=new e.Buf32(K),re.distcode=re.distdyn=new e.Buf32(ce),re.sane=1,re.back=-1,h)}function Ue(F){var re;return!F||!F.state?v:(re=F.state,re.wsize=0,re.whave=0,re.wnext=0,He(F))}function De(F,re){var d,fe;return!F||!F.state||(fe=F.state,re<0?(d=0,re=-re):(d=(re>>4)+1,re<48&&(re&=15)),re&&(re<8||re>15))?v:(fe.window!==null&&fe.wbits!==re&&(fe.window=null),fe.wrap=d,fe.wbits=re,Ue(F))}function tt(F,re){var d,fe;return F?(fe=new Ne,F.state=fe,fe.window=null,d=De(F,re),d!==h&&(F.state=null),d):v}function S(F){return tt(F,be)}var I=!0,he,le;function ye(F){if(I){var re;for(he=new e.Buf32(512),le=new e.Buf32(32),re=0;re<144;)F.lens[re++]=8;for(;re<256;)F.lens[re++]=9;for(;re<280;)F.lens[re++]=7;for(;re<288;)F.lens[re++]=8;for(i(s,F.lens,0,288,he,0,F.work,{bits:9}),re=0;re<32;)F.lens[re++]=5;i(f,F.lens,0,32,le,0,F.work,{bits:5}),I=!1}F.lencode=he,F.lenbits=9,F.distcode=le,F.distbits=5}function je(F,re,d,fe){var Ae,a=F.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new e.Buf8(a.wsize)),fe>=a.wsize?(e.arraySet(a.window,re,d-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(Ae=a.wsize-a.wnext,Ae>fe&&(Ae=fe),e.arraySet(a.window,re,d-fe,Ae,a.wnext),fe-=Ae,fe?(e.arraySet(a.window,re,d-fe,fe,0),a.wnext=fe,a.whave=a.wsize):(a.wnext+=Ae,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=Ae))),0}function w(F,re){var d,fe,Ae,a,Y,Q,g,$,J,Re,me,Ee,Be,rt,Ge=0,$e,et,ot,dt,Bt,Dr,Ye,wt,nt=new e.Buf8(4),$t,ft,Mn=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!F||!F.state||!F.output||!F.input&&F.avail_in!==0)return v;d=F.state,d.mode===b&&(d.mode=B),Y=F.next_out,Ae=F.output,g=F.avail_out,a=F.next_in,fe=F.input,Q=F.avail_in,$=d.hold,J=d.bits,Re=Q,me=g,wt=h;e:for(;;)switch(d.mode){case z:if(d.wrap===0){d.mode=B;break}for(;J<16;){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}if(d.wrap&2&&$===35615){d.check=0,nt[0]=$&255,nt[1]=$>>>8&255,d.check=r(d.check,nt,2,0),$=0,J=0,d.mode=R;break}if(d.flags=0,d.head&&(d.head.done=!1),!(d.wrap&1)||((($&255)<<8)+($>>8))%31){F.msg="incorrect header check",d.mode=Te;break}if(($&15)!==E){F.msg="unknown compression method",d.mode=Te;break}if($>>>=4,J-=4,Ye=($&15)+8,d.wbits===0)d.wbits=Ye;else if(Ye>d.wbits){F.msg="invalid window size",d.mode=Te;break}d.dmax=1<<Ye,F.adler=d.check=1,d.mode=$&512?_:b,$=0,J=0;break;case R:for(;J<16;){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}if(d.flags=$,(d.flags&255)!==E){F.msg="unknown compression method",d.mode=Te;break}if(d.flags&57344){F.msg="unknown header flags set",d.mode=Te;break}d.head&&(d.head.text=$>>8&1),d.flags&512&&(nt[0]=$&255,nt[1]=$>>>8&255,d.check=r(d.check,nt,2,0)),$=0,J=0,d.mode=q;case q:for(;J<32;){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}d.head&&(d.head.time=$),d.flags&512&&(nt[0]=$&255,nt[1]=$>>>8&255,nt[2]=$>>>16&255,nt[3]=$>>>24&255,d.check=r(d.check,nt,4,0)),$=0,J=0,d.mode=k;case k:for(;J<16;){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}d.head&&(d.head.xflags=$&255,d.head.os=$>>8),d.flags&512&&(nt[0]=$&255,nt[1]=$>>>8&255,d.check=r(d.check,nt,2,0)),$=0,J=0,d.mode=U;case U:if(d.flags&1024){for(;J<16;){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}d.length=$,d.head&&(d.head.extra_len=$),d.flags&512&&(nt[0]=$&255,nt[1]=$>>>8&255,d.check=r(d.check,nt,2,0)),$=0,J=0}else d.head&&(d.head.extra=null);d.mode=te;case te:if(d.flags&1024&&(Ee=d.length,Ee>Q&&(Ee=Q),Ee&&(d.head&&(Ye=d.head.extra_len-d.length,d.head.extra||(d.head.extra=new Array(d.head.extra_len)),e.arraySet(d.head.extra,fe,a,Ee,Ye)),d.flags&512&&(d.check=r(d.check,fe,Ee,a)),Q-=Ee,a+=Ee,d.length-=Ee),d.length))break e;d.length=0,d.mode=W;case W:if(d.flags&2048){if(Q===0)break e;Ee=0;do Ye=fe[a+Ee++],d.head&&Ye&&d.length<65536&&(d.head.name+=String.fromCharCode(Ye));while(Ye&&Ee<Q);if(d.flags&512&&(d.check=r(d.check,fe,Ee,a)),Q-=Ee,a+=Ee,Ye)break e}else d.head&&(d.head.name=null);d.length=0,d.mode=P;case P:if(d.flags&4096){if(Q===0)break e;Ee=0;do Ye=fe[a+Ee++],d.head&&Ye&&d.length<65536&&(d.head.comment+=String.fromCharCode(Ye));while(Ye&&Ee<Q);if(d.flags&512&&(d.check=r(d.check,fe,Ee,a)),Q-=Ee,a+=Ee,Ye)break e}else d.head&&(d.head.comment=null);d.mode=Z;case Z:if(d.flags&512){for(;J<16;){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}if($!==(d.check&65535)){F.msg="header crc mismatch",d.mode=Te;break}$=0,J=0}d.head&&(d.head.hcrc=d.flags>>9&1,d.head.done=!0),F.adler=d.check=0,d.mode=b;break;case _:for(;J<32;){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}F.adler=d.check=Ie($),$=0,J=0,d.mode=p;case p:if(d.havedict===0)return F.next_out=Y,F.avail_out=g,F.next_in=a,F.avail_in=Q,d.hold=$,d.bits=J,y;F.adler=d.check=1,d.mode=b;case b:if(re===u||re===c)break e;case B:if(d.last){$>>>=J&7,J-=J&7,d.mode=pe;break}for(;J<3;){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}switch(d.last=$&1,$>>>=1,J-=1,$&3){case 0:d.mode=V;break;case 1:if(ye(d),d.mode=ie,re===c){$>>>=2,J-=2;break e}break;case 2:d.mode=N;break;case 3:F.msg="invalid block type",d.mode=Te}$>>>=2,J-=2;break;case V:for($>>>=J&7,J-=J&7;J<32;){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}if(($&65535)!==($>>>16^65535)){F.msg="invalid stored block lengths",d.mode=Te;break}if(d.length=$&65535,$=0,J=0,d.mode=L,re===c)break e;case L:d.mode=D;case D:if(Ee=d.length,Ee){if(Ee>Q&&(Ee=Q),Ee>g&&(Ee=g),Ee===0)break e;e.arraySet(Ae,fe,a,Ee,Y),Q-=Ee,a+=Ee,g-=Ee,Y+=Ee,d.length-=Ee;break}d.mode=b;break;case N:for(;J<14;){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}if(d.nlen=($&31)+257,$>>>=5,J-=5,d.ndist=($&31)+1,$>>>=5,J-=5,d.ncode=($&15)+4,$>>>=4,J-=4,d.nlen>286||d.ndist>30){F.msg="too many length or distance symbols",d.mode=Te;break}d.have=0,d.mode=O;case O:for(;d.have<d.ncode;){for(;J<3;){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}d.lens[Mn[d.have++]]=$&7,$>>>=3,J-=3}for(;d.have<19;)d.lens[Mn[d.have++]]=0;if(d.lencode=d.lendyn,d.lenbits=7,$t={bits:d.lenbits},wt=i(o,d.lens,0,19,d.lencode,0,d.work,$t),d.lenbits=$t.bits,wt){F.msg="invalid code lengths set",d.mode=Te;break}d.have=0,d.mode=X;case X:for(;d.have<d.nlen+d.ndist;){for(;Ge=d.lencode[$&(1<<d.lenbits)-1],$e=Ge>>>24,et=Ge>>>16&255,ot=Ge&65535,!($e<=J);){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}if(ot<16)$>>>=$e,J-=$e,d.lens[d.have++]=ot;else{if(ot===16){for(ft=$e+2;J<ft;){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}if($>>>=$e,J-=$e,d.have===0){F.msg="invalid bit length repeat",d.mode=Te;break}Ye=d.lens[d.have-1],Ee=3+($&3),$>>>=2,J-=2}else if(ot===17){for(ft=$e+3;J<ft;){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}$>>>=$e,J-=$e,Ye=0,Ee=3+($&7),$>>>=3,J-=3}else{for(ft=$e+7;J<ft;){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}$>>>=$e,J-=$e,Ye=0,Ee=11+($&127),$>>>=7,J-=7}if(d.have+Ee>d.nlen+d.ndist){F.msg="invalid bit length repeat",d.mode=Te;break}for(;Ee--;)d.lens[d.have++]=Ye}}if(d.mode===Te)break;if(d.lens[256]===0){F.msg="invalid code -- missing end-of-block",d.mode=Te;break}if(d.lenbits=9,$t={bits:d.lenbits},wt=i(s,d.lens,0,d.nlen,d.lencode,0,d.work,$t),d.lenbits=$t.bits,wt){F.msg="invalid literal/lengths set",d.mode=Te;break}if(d.distbits=6,d.distcode=d.distdyn,$t={bits:d.distbits},wt=i(f,d.lens,d.nlen,d.ndist,d.distcode,0,d.work,$t),d.distbits=$t.bits,wt){F.msg="invalid distances set",d.mode=Te;break}if(d.mode=ie,re===c)break e;case ie:d.mode=ne;case ne:if(Q>=6&&g>=258){F.next_out=Y,F.avail_out=g,F.next_in=a,F.avail_in=Q,d.hold=$,d.bits=J,n(F,me),Y=F.next_out,Ae=F.output,g=F.avail_out,a=F.next_in,fe=F.input,Q=F.avail_in,$=d.hold,J=d.bits,d.mode===b&&(d.back=-1);break}for(d.back=0;Ge=d.lencode[$&(1<<d.lenbits)-1],$e=Ge>>>24,et=Ge>>>16&255,ot=Ge&65535,!($e<=J);){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}if(et&&!(et&240)){for(dt=$e,Bt=et,Dr=ot;Ge=d.lencode[Dr+(($&(1<<dt+Bt)-1)>>dt)],$e=Ge>>>24,et=Ge>>>16&255,ot=Ge&65535,!(dt+$e<=J);){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}$>>>=dt,J-=dt,d.back+=dt}if($>>>=$e,J-=$e,d.back+=$e,d.length=ot,et===0){d.mode=_e;break}if(et&32){d.back=-1,d.mode=b;break}if(et&64){F.msg="invalid literal/length code",d.mode=Te;break}d.extra=et&15,d.mode=ae;case ae:if(d.extra){for(ft=d.extra;J<ft;){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}d.length+=$&(1<<d.extra)-1,$>>>=d.extra,J-=d.extra,d.back+=d.extra}d.was=d.length,d.mode=de;case de:for(;Ge=d.distcode[$&(1<<d.distbits)-1],$e=Ge>>>24,et=Ge>>>16&255,ot=Ge&65535,!($e<=J);){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}if(!(et&240)){for(dt=$e,Bt=et,Dr=ot;Ge=d.distcode[Dr+(($&(1<<dt+Bt)-1)>>dt)],$e=Ge>>>24,et=Ge>>>16&255,ot=Ge&65535,!(dt+$e<=J);){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}$>>>=dt,J-=dt,d.back+=dt}if($>>>=$e,J-=$e,d.back+=$e,et&64){F.msg="invalid distance code",d.mode=Te;break}d.offset=ot,d.extra=et&15,d.mode=ge;case ge:if(d.extra){for(ft=d.extra;J<ft;){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}d.offset+=$&(1<<d.extra)-1,$>>>=d.extra,J-=d.extra,d.back+=d.extra}if(d.offset>d.dmax){F.msg="invalid distance too far back",d.mode=Te;break}d.mode=Se;case Se:if(g===0)break e;if(Ee=me-g,d.offset>Ee){if(Ee=d.offset-Ee,Ee>d.whave&&d.sane){F.msg="invalid distance too far back",d.mode=Te;break}Ee>d.wnext?(Ee-=d.wnext,Be=d.wsize-Ee):Be=d.wnext-Ee,Ee>d.length&&(Ee=d.length),rt=d.window}else rt=Ae,Be=Y-d.offset,Ee=d.length;Ee>g&&(Ee=g),g-=Ee,d.length-=Ee;do Ae[Y++]=rt[Be++];while(--Ee);d.length===0&&(d.mode=ne);break;case _e:if(g===0)break e;Ae[Y++]=d.length,g--,d.mode=ne;break;case pe:if(d.wrap){for(;J<32;){if(Q===0)break e;Q--,$|=fe[a++]<<J,J+=8}if(me-=g,F.total_out+=me,d.total+=me,me&&(F.adler=d.check=d.flags?r(d.check,Ae,me,Y-me):t(d.check,Ae,me,Y-me)),me=g,(d.flags?$:Ie($))!==d.check){F.msg="incorrect data check",d.mode=Te;break}$=0,J=0}d.mode=Oe;case Oe:if(d.wrap&&d.flags){for(;J<32;){if(Q===0)break e;Q--,$+=fe[a++]<<J,J+=8}if($!==(d.total&4294967295)){F.msg="incorrect length check",d.mode=Te;break}$=0,J=0}d.mode=Pe;case Pe:wt=m;break e;case Te:wt=G;break e;case T:return M;case C:default:return v}return F.next_out=Y,F.avail_out=g,F.next_in=a,F.avail_in=Q,d.hold=$,d.bits=J,(d.wsize||me!==F.avail_out&&d.mode<Te&&(d.mode<pe||re!==l))&&je(F,F.output,F.next_out,me-F.avail_out),Re-=F.avail_in,me-=F.avail_out,F.total_in+=Re,F.total_out+=me,d.total+=me,d.wrap&&me&&(F.adler=d.check=d.flags?r(d.check,Ae,me,F.next_out-me):t(d.check,Ae,me,F.next_out-me)),F.data_type=d.bits+(d.last?64:0)+(d.mode===b?128:0)+(d.mode===ie||d.mode===L?256:0),(Re===0&&me===0||re===l)&&wt===h&&(wt=j),wt}function oe(F){if(!F||!F.state)return v;var re=F.state;return re.window&&(re.window=null),F.state=null,h}function ue(F,re){var d;return!F||!F.state||(d=F.state,!(d.wrap&2))?v:(d.head=re,re.done=!1,h)}function we(F,re){var d=re.length,fe,Ae,a;return!F||!F.state||(fe=F.state,fe.wrap!==0&&fe.mode!==p)?v:fe.mode===p&&(Ae=1,Ae=t(Ae,re,d,0),Ae!==fe.check)?G:(a=je(F,re,d,d),a?(fe.mode=T,M):(fe.havedict=1,h))}return Tt.inflateReset=Ue,Tt.inflateReset2=De,Tt.inflateResetKeep=He,Tt.inflateInit=S,Tt.inflateInit2=tt,Tt.inflate=w,Tt.inflateEnd=oe,Tt.inflateGetHeader=ue,Tt.inflateSetDictionary=we,Tt.inflateInfo="pako inflate (from Nodeca project)",Tt}var es,gf;function Vm(){return gf||(gf=1,es={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}),es}var _f;function qm(){return _f||(_f=1,function(e){var t=x.requireAssert(),r=jm(),n=Fm(),i=Wm(),o=Vm();for(var s in o)e[s]=o[s];e.NONE=0,e.DEFLATE=1,e.INFLATE=2,e.GZIP=3,e.GUNZIP=4,e.DEFLATERAW=5,e.INFLATERAW=6,e.UNZIP=7;var f=31,l=139;function u(c){if(typeof c!="number"||c<e.DEFLATE||c>e.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=c,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}u.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,t(this.init_done,"close before init"),t(this.mode<=e.UNZIP),this.mode===e.DEFLATE||this.mode===e.GZIP||this.mode===e.DEFLATERAW?n.deflateEnd(this.strm):(this.mode===e.INFLATE||this.mode===e.GUNZIP||this.mode===e.INFLATERAW||this.mode===e.UNZIP)&&i.inflateEnd(this.strm),this.mode=e.NONE,this.dictionary=null},u.prototype.write=function(c,h,m,y,v,G,M){return this._write(!0,c,h,m,y,v,G,M)},u.prototype.writeSync=function(c,h,m,y,v,G,M){return this._write(!1,c,h,m,y,v,G,M)},u.prototype._write=function(c,h,m,y,v,G,M,j){if(t.equal(arguments.length,8),t(this.init_done,"write before init"),t(this.mode!==e.NONE,"already finalized"),t.equal(!1,this.write_in_progress,"write already in progress"),t.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,t.equal(!1,h===void 0,"must provide flush value"),this.write_in_progress=!0,h!==e.Z_NO_FLUSH&&h!==e.Z_PARTIAL_FLUSH&&h!==e.Z_SYNC_FLUSH&&h!==e.Z_FULL_FLUSH&&h!==e.Z_FINISH&&h!==e.Z_BLOCK)throw new Error("Invalid flush value");if(m==null&&(m=x.dist.Buffer.alloc(0),v=0,y=0),this.strm.avail_in=v,this.strm.input=m,this.strm.next_in=y,this.strm.avail_out=j,this.strm.output=G,this.strm.next_out=M,this.flush=h,!c)return this._process(),this._checkError()?this._afterSync():void 0;var E=this;return x.dist.process.nextTick(function(){E._process(),E._after()}),this},u.prototype._afterSync=function(){var c=this.strm.avail_out,h=this.strm.avail_in;return this.write_in_progress=!1,[h,c]},u.prototype._process=function(){var c=null;switch(this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=n.deflate(this.strm,this.flush);break;case e.UNZIP:switch(this.strm.avail_in>0&&(c=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(c===null)break;if(this.strm.input[c]===f){if(this.gzip_id_bytes_read=1,c++,this.strm.avail_in===1)break}else{this.mode=e.INFLATE;break}case 1:if(c===null)break;this.strm.input[c]===l?(this.gzip_id_bytes_read=2,this.mode=e.GUNZIP):this.mode=e.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:for(this.err=i.inflate(this.strm,this.flush),this.err===e.Z_NEED_DICT&&this.dictionary&&(this.err=i.inflateSetDictionary(this.strm,this.dictionary),this.err===e.Z_OK?this.err=i.inflate(this.strm,this.flush):this.err===e.Z_DATA_ERROR&&(this.err=e.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===e.GUNZIP&&this.err===e.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=i.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},u.prototype._checkError=function(){switch(this.err){case e.Z_OK:case e.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===e.Z_FINISH)return this._error("unexpected end of file"),!1;break;case e.Z_STREAM_END:break;case e.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},u.prototype._after=function(){if(this._checkError()){var c=this.strm.avail_out,h=this.strm.avail_in;this.write_in_progress=!1,this.callback(h,c),this.pending_close&&this.close()}},u.prototype._error=function(c){this.strm.msg&&(c=this.strm.msg),this.onerror(c,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},u.prototype.init=function(c,h,m,y,v){t(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),t(c>=8&&c<=15,"invalid windowBits"),t(h>=-1&&h<=9,"invalid compression level"),t(m>=1&&m<=9,"invalid memlevel"),t(y===e.Z_FILTERED||y===e.Z_HUFFMAN_ONLY||y===e.Z_RLE||y===e.Z_FIXED||y===e.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(h,c,m,y,v),this._setDictionary()},u.prototype.params=function(){throw new Error("deflateParams Not supported")},u.prototype.reset=function(){this._reset(),this._setDictionary()},u.prototype._init=function(c,h,m,y,v){switch(this.level=c,this.windowBits=h,this.memLevel=m,this.strategy=y,this.flush=e.Z_NO_FLUSH,this.err=e.Z_OK,(this.mode===e.GZIP||this.mode===e.GUNZIP)&&(this.windowBits+=16),this.mode===e.UNZIP&&(this.windowBits+=32),(this.mode===e.DEFLATERAW||this.mode===e.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new r,this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=n.deflateInit2(this.strm,this.level,e.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:case e.UNZIP:this.err=i.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==e.Z_OK&&this._error("Init error"),this.dictionary=v,this.write_in_progress=!1,this.init_done=!0},u.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:this.err=n.deflateSetDictionary(this.strm,this.dictionary);break}this.err!==e.Z_OK&&this._error("Failed to set dictionary")}},u.prototype._reset=function(){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:case e.GZIP:this.err=n.deflateReset(this.strm);break;case e.INFLATE:case e.INFLATERAW:case e.GUNZIP:this.err=i.inflateReset(this.strm);break}this.err!==e.Z_OK&&this._error("Failed to reset stream")},e.Zlib=u}(qo)),qo}var bf;function Gm(){return bf||(bf=1,function(e){var t=x.bufferPolyfill.Buffer,r=x.requireStreamBrowserify().Transform,n=qm(),i=x.util,o=x.requireAssert().ok,s=x.bufferPolyfill.kMaxLength,f="Cannot create final Buffer. It would be larger than 0x"+s.toString(16)+" bytes";n.Z_MIN_WINDOWBITS=8,n.Z_MAX_WINDOWBITS=15,n.Z_DEFAULT_WINDOWBITS=15,n.Z_MIN_CHUNK=64,n.Z_MAX_CHUNK=1/0,n.Z_DEFAULT_CHUNK=16*1024,n.Z_MIN_MEMLEVEL=1,n.Z_MAX_MEMLEVEL=9,n.Z_DEFAULT_MEMLEVEL=8,n.Z_MIN_LEVEL=-1,n.Z_MAX_LEVEL=9,n.Z_DEFAULT_LEVEL=n.Z_DEFAULT_COMPRESSION;for(var l=Object.keys(n),u=0;u<l.length;u++){var c=l[u];c.match(/^Z/)&&Object.defineProperty(e,c,{enumerable:!0,value:n[c],writable:!1})}for(var h={Z_OK:n.Z_OK,Z_STREAM_END:n.Z_STREAM_END,Z_NEED_DICT:n.Z_NEED_DICT,Z_ERRNO:n.Z_ERRNO,Z_STREAM_ERROR:n.Z_STREAM_ERROR,Z_DATA_ERROR:n.Z_DATA_ERROR,Z_MEM_ERROR:n.Z_MEM_ERROR,Z_BUF_ERROR:n.Z_BUF_ERROR,Z_VERSION_ERROR:n.Z_VERSION_ERROR},m=Object.keys(h),y=0;y<m.length;y++){var v=m[y];h[h[v]]=v}Object.defineProperty(e,"codes",{enumerable:!0,value:Object.freeze(h),writable:!1}),e.Deflate=j,e.Inflate=E,e.Gzip=z,e.Gunzip=R,e.DeflateRaw=q,e.InflateRaw=k,e.Unzip=U,e.createDeflate=function(_){return new j(_)},e.createInflate=function(_){return new E(_)},e.createDeflateRaw=function(_){return new q(_)},e.createInflateRaw=function(_){return new k(_)},e.createGzip=function(_){return new z(_)},e.createGunzip=function(_){return new R(_)},e.createUnzip=function(_){return new U(_)},e.deflate=function(_,p,b){return typeof p=="function"&&(b=p,p={}),G(new j(p),_,b)},e.deflateSync=function(_,p){return M(new j(p),_)},e.gzip=function(_,p,b){return typeof p=="function"&&(b=p,p={}),G(new z(p),_,b)},e.gzipSync=function(_,p){return M(new z(p),_)},e.deflateRaw=function(_,p,b){return typeof p=="function"&&(b=p,p={}),G(new q(p),_,b)},e.deflateRawSync=function(_,p){return M(new q(p),_)},e.unzip=function(_,p,b){return typeof p=="function"&&(b=p,p={}),G(new U(p),_,b)},e.unzipSync=function(_,p){return M(new U(p),_)},e.inflate=function(_,p,b){return typeof p=="function"&&(b=p,p={}),G(new E(p),_,b)},e.inflateSync=function(_,p){return M(new E(p),_)},e.gunzip=function(_,p,b){return typeof p=="function"&&(b=p,p={}),G(new R(p),_,b)},e.gunzipSync=function(_,p){return M(new R(p),_)},e.inflateRaw=function(_,p,b){return typeof p=="function"&&(b=p,p={}),G(new k(p),_,b)},e.inflateRawSync=function(_,p){return M(new k(p),_)};function G(_,p,b){var B=[],V=0;_.on("error",D),_.on("end",N),_.end(p),L();function L(){for(var O;(O=_.read())!==null;)B.push(O),V+=O.length;_.once("readable",L)}function D(O){_.removeListener("end",N),_.removeListener("readable",L),b(O)}function N(){var O,X=null;V>=s?X=new RangeError(f):O=t.concat(B,V),B=[],_.close(),b(X,O)}}function M(_,p){if(typeof p=="string"&&(p=t.from(p)),!t.isBuffer(p))throw new TypeError("Not a string or buffer");var b=_._finishFlushFlag;return _._processChunk(p,b)}function j(_){if(!(this instanceof j))return new j(_);W.call(this,_,n.DEFLATE)}function E(_){if(!(this instanceof E))return new E(_);W.call(this,_,n.INFLATE)}function z(_){if(!(this instanceof z))return new z(_);W.call(this,_,n.GZIP)}function R(_){if(!(this instanceof R))return new R(_);W.call(this,_,n.GUNZIP)}function q(_){if(!(this instanceof q))return new q(_);W.call(this,_,n.DEFLATERAW)}function k(_){if(!(this instanceof k))return new k(_);W.call(this,_,n.INFLATERAW)}function U(_){if(!(this instanceof U))return new U(_);W.call(this,_,n.UNZIP)}function te(_){return _===n.Z_NO_FLUSH||_===n.Z_PARTIAL_FLUSH||_===n.Z_SYNC_FLUSH||_===n.Z_FULL_FLUSH||_===n.Z_FINISH||_===n.Z_BLOCK}function W(_,p){var b=this;if(this._opts=_=_||{},this._chunkSize=_.chunkSize||e.Z_DEFAULT_CHUNK,r.call(this,_),_.flush&&!te(_.flush))throw new Error("Invalid flush flag: "+_.flush);if(_.finishFlush&&!te(_.finishFlush))throw new Error("Invalid flush flag: "+_.finishFlush);if(this._flushFlag=_.flush||n.Z_NO_FLUSH,this._finishFlushFlag=typeof _.finishFlush<"u"?_.finishFlush:n.Z_FINISH,_.chunkSize&&(_.chunkSize<e.Z_MIN_CHUNK||_.chunkSize>e.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+_.chunkSize);if(_.windowBits&&(_.windowBits<e.Z_MIN_WINDOWBITS||_.windowBits>e.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+_.windowBits);if(_.level&&(_.level<e.Z_MIN_LEVEL||_.level>e.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+_.level);if(_.memLevel&&(_.memLevel<e.Z_MIN_MEMLEVEL||_.memLevel>e.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+_.memLevel);if(_.strategy&&_.strategy!=e.Z_FILTERED&&_.strategy!=e.Z_HUFFMAN_ONLY&&_.strategy!=e.Z_RLE&&_.strategy!=e.Z_FIXED&&_.strategy!=e.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+_.strategy);if(_.dictionary&&!t.isBuffer(_.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new n.Zlib(p);var B=this;this._hadError=!1,this._handle.onerror=function(D,N){P(B),B._hadError=!0;var O=new Error(D);O.errno=N,O.code=e.codes[N],B.emit("error",O)};var V=e.Z_DEFAULT_COMPRESSION;typeof _.level=="number"&&(V=_.level);var L=e.Z_DEFAULT_STRATEGY;typeof _.strategy=="number"&&(L=_.strategy),this._handle.init(_.windowBits||e.Z_DEFAULT_WINDOWBITS,V,_.memLevel||e.Z_DEFAULT_MEMLEVEL,L,_.dictionary),this._buffer=t.allocUnsafe(this._chunkSize),this._offset=0,this._level=V,this._strategy=L,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!b._handle},configurable:!0,enumerable:!0})}i.inherits(W,r),W.prototype.params=function(_,p,b){if(_<e.Z_MIN_LEVEL||_>e.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+_);if(p!=e.Z_FILTERED&&p!=e.Z_HUFFMAN_ONLY&&p!=e.Z_RLE&&p!=e.Z_FIXED&&p!=e.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+p);if(this._level!==_||this._strategy!==p){var B=this;this.flush(n.Z_SYNC_FLUSH,function(){o(B._handle,"zlib binding closed"),B._handle.params(_,p),B._hadError||(B._level=_,B._strategy=p,b&&b())})}else x.dist.process.nextTick(b)},W.prototype.reset=function(){return o(this._handle,"zlib binding closed"),this._handle.reset()},W.prototype._flush=function(_){this._transform(t.alloc(0),"",_)},W.prototype.flush=function(_,p){var b=this,B=this._writableState;(typeof _=="function"||_===void 0&&!p)&&(p=_,_=n.Z_FULL_FLUSH),B.ended?p&&x.dist.process.nextTick(p):B.ending?p&&this.once("end",p):B.needDrain?p&&this.once("drain",function(){return b.flush(_,p)}):(this._flushFlag=_,this.write(t.alloc(0),"",p))},W.prototype.close=function(_){P(this,_),x.dist.process.nextTick(Z,this)};function P(_,p){p&&x.dist.process.nextTick(p),_._handle&&(_._handle.close(),_._handle=null)}function Z(_){_.emit("close")}W.prototype._transform=function(_,p,b){var B,V=this._writableState,L=V.ending||V.ended,D=L&&(!_||V.length===_.length);if(_!==null&&!t.isBuffer(_))return b(new Error("invalid input"));if(!this._handle)return b(new Error("zlib binding closed"));D?B=this._finishFlushFlag:(B=this._flushFlag,_.length>=V.length&&(this._flushFlag=this._opts.flush||n.Z_NO_FLUSH)),this._processChunk(_,B,b)},W.prototype._processChunk=function(_,p,b){var B=_&&_.length,V=this._chunkSize-this._offset,L=0,D=this,N=typeof b=="function";if(!N){var O=[],X=0,ie;this.on("error",function(Se){ie=Se}),o(this._handle,"zlib binding closed");do var ne=this._handle.writeSync(p,_,L,B,this._buffer,this._offset,V);while(!this._hadError&&ge(ne[0],ne[1]));if(this._hadError)throw ie;if(X>=s)throw P(this),new RangeError(f);var ae=t.concat(O,X);return P(this),ae}o(this._handle,"zlib binding closed");var de=this._handle.write(p,_,L,B,this._buffer,this._offset,V);de.buffer=_,de.callback=ge;function ge(Se,_e){if(this&&(this.buffer=null,this.callback=null),!D._hadError){var pe=V-_e;if(o(pe>=0,"have should not go down"),pe>0){var Oe=D._buffer.slice(D._offset,D._offset+pe);D._offset+=pe,N?D.push(Oe):(O.push(Oe),X+=Oe.length)}if((_e===0||D._offset>=D._chunkSize)&&(V=D._chunkSize,D._offset=0,D._buffer=t.allocUnsafe(D._chunkSize)),_e===0){if(L+=B-Se,B=Se,!N)return!0;var Pe=D._handle.write(p,_,L,B,D._buffer,D._offset,D._chunkSize);Pe.callback=ge,Pe.buffer=_;return}if(!N)return!1;b()}}},i.inherits(j,W),i.inherits(E,W),i.inherits(z,W),i.inherits(R,W),i.inherits(q,W),i.inherits(k,W),i.inherits(U,W)}(Vo)),Vo}Object.defineProperty(Nr,"__esModule",{value:!0});Nr.InvalidStatusCodeError=Nr.InvalidCertError=void 0;const Vc=Object.freeze({redirect:!0,expectStatusCode:200,headers:{},full:!1,keepAlive:!0,cors:!1,referrer:!1,sslAllowSelfSigned:!1,_redirectCount:0});class Rs extends Error{constructor(t,r){super(t),this.fingerprint256=r}}Nr.InvalidCertError=Rs;class _a extends Error{constructor(t){super(`Request Failed. Status Code: ${t}`),this.statusCode=t}}Nr.InvalidStatusCodeError=_a;function qc(e,t){if(!t||t==="text"||t==="json")try{let r=new TextDecoder("utf8",{fatal:!0}).decode(e);if(t==="text")return r;try{return JSON.parse(r)}catch(n){if(t==="json")throw n;return r}}catch(r){if(t==="text"||t==="json")throw r}return e}let pf={};function As(e,t){var m;let r={...Vc,...t};const n=co.streamHttp,i=co.httpsBrowserifyExports,o=Gm(),{promisify:s}=x.util,{resolve:f}=co.urlExports,l=!!/^https/.test(e);let u={method:r.method||"GET",headers:{"Accept-Encoding":"gzip, deflate, br"}};const c=y=>y.replace(/:| /g,"").toLowerCase();if(r.keepAlive){const y={keepAlive:!0,keepAliveMsecs:3e4,maxFreeSockets:1024,maxCachedSessions:1024},v=[l,l&&((m=r.sslPinnedCertificates)==null?void 0:m.map(G=>c(G)).sort())].join();u.agent=pf[v]||(pf[v]=new(l?i:n).Agent(y))}r.type==="json"&&(u.headers["Content-Type"]="application/json"),r.data&&(r.method||(u.method="POST"),u.body=r.type==="json"?JSON.stringify(r.data):r.data),u.headers={...u.headers,...r.headers},r.sslAllowSelfSigned&&(u.rejectUnauthorized=!1);const h=async y=>{const v=y.statusCode;if(r.redirect&&300<=v&&v<400&&y.headers.location){if(r._redirectCount==10)throw new Error("Request failed. Too much redirects.");return r._redirectCount+=1,await As(f(e,y.headers.location),r)}if(r.expectStatusCode&&v!==r.expectStatusCode)throw y.resume(),new _a(v);let G=[];for await(const z of y)G.push(z);let M=x.dist.Buffer.concat(G);const j=y.headers["content-encoding"];j==="br"&&(M=await s(o.brotliDecompress)(M)),(j==="gzip"||j==="deflate")&&(M=await s(o.unzip)(M));const E=qc(M,r.type);return r.full?{headers:y.headers,status:v,body:E}:E};return new Promise((y,v)=>{var z;const G=async R=>{if(R&&R.code==="DEPTH_ZERO_SELF_SIGNED_CERT")try{await As(e,{...r,sslAllowSelfSigned:!0,sslPinnedCertificates:[]})}catch(q){q&&q.fingerprint256&&(R=new Rs(`Self-signed SSL certificate: ${q.fingerprint256}`,q.fingerprint256))}v(R)},M=(l?i:n).request(e,u,R=>{R.on("error",G),(async()=>{try{y(await h(R))}catch(q){v(q)}})()});M.on("error",G);const j=(z=r.sslPinnedCertificates)==null?void 0:z.map(R=>c(R)),E=R=>{var k;const q=c(((k=R.getPeerCertificate())==null?void 0:k.fingerprint256)||"");if(!(!q&&R.isSessionReused())&&!j.includes(q))return M.emit("error",new Rs(`Invalid SSL certificate: ${q} Expected: ${j}`,q)),M.abort()};r.sslPinnedCertificates&&M.on("socket",R=>{R.listeners("secureConnect").map(k=>(k.name||"").replace("bound ","")).includes("mfetchSecureConnect")||R.on("secureConnect",E.bind(null,R))}),r.keepAlive&&M.setNoDelay(!0),u.body&&M.write(u.body),M.end()})}const Zm=new Set(["Accept","Accept-Language","Content-Language","Content-Type"].map(e=>e.toLowerCase())),Km=new Set(["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"].map(e=>e.toLowerCase()));async function Jm(e,t){let r={...Vc,...t};const n=new Headers;r.type==="json"&&n.set("Content-Type","application/json");let i=new URL(e);if(i.username){const l=btoa(`${i.username}:${i.password}`);n.set("Authorization",`Basic ${l}`),i.username="",i.password=""}e=""+i;for(let l in r.headers){const u=l.toLowerCase();(Zm.has(u)||r.cors&&!Km.has(u))&&n.set(l,r.headers[l])}let o={headers:n,redirect:r.redirect?"follow":"manual"};r.referrer||(o.referrerPolicy="no-referrer"),r.cors&&(o.mode="cors"),r.data&&(r.method||(o.method="POST"),o.body=r.type==="json"?JSON.stringify(r.data):r.data);const s=await fetch(e,o);if(r.expectStatusCode&&s.status!==r.expectStatusCode)throw new _a(s.status);const f=qc(new Uint8Array(await s.arrayBuffer()),r.type);return r.full?{headers:Object.fromEntries(s.headers.entries()),status:s.status,body:f}:f}const Xm=!!(typeof x.dist.process=="object"&&x.dist.process.versions&&x.dist.process.versions.node&&x.dist.process.versions.v8);function Ym(e,t){return(Xm?As:Jm)(e,t)}Nr.default=Ym;Object.defineProperty(tn,"__esModule",{value:!0});tn.getProvider=tn.fetchFromProvider=void 0;const Qm=Nr,eE=async(e,t)=>(await(0,Qm.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:t.method,params:t.params,jsonrpc:"2.0",id:1}})).result;tn.fetchFromProvider=eE;const tE=e=>{var t;if(typeof e=="string")return e;if(((t=e==null?void 0:e.connection)==null?void 0:t.url)!==void 0)return e.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")};tn.getProvider=tE;(function(e){var t=x.commonjsGlobal&&x.commonjsGlobal.__createBinding||(Object.create?function(i,o,s,f){f===void 0&&(f=s);var l=Object.getOwnPropertyDescriptor(o,s);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(i,f,l)}:function(i,o,s,f){f===void 0&&(f=s),i[f]=o[s]}),r=x.commonjsGlobal&&x.commonjsGlobal.__exportStar||function(i,o){for(var s in i)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&t(o,i,s)};Object.defineProperty(e,"__esModule",{value:!0}),e.toAscii=e.stripHexPrefix=e.padToEven=e.isHexString=e.isHexPrefixed=e.getKeys=e.getBinarySize=e.fromUtf8=e.fromAscii=e.arrayContainsArray=void 0,r(ji,e),r(Vi,e),r(da,e),r(Dn,e),r(Gi,e),r(_t,e),r(kr,e),r(ga,e),r(Hc,e),r(Ji,e);var n=qe;Object.defineProperty(e,"arrayContainsArray",{enumerable:!0,get:function(){return n.arrayContainsArray}}),Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return n.fromAscii}}),Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return n.fromUtf8}}),Object.defineProperty(e,"getBinarySize",{enumerable:!0,get:function(){return n.getBinarySize}}),Object.defineProperty(e,"getKeys",{enumerable:!0,get:function(){return n.getKeys}}),Object.defineProperty(e,"isHexPrefixed",{enumerable:!0,get:function(){return n.isHexPrefixed}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return n.isHexString}}),Object.defineProperty(e,"padToEven",{enumerable:!0,get:function(){return n.padToEven}}),Object.defineProperty(e,"stripHexPrefix",{enumerable:!0,get:function(){return n.stripHexPrefix}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return n.toAscii}}),r(Xi,e),r(tn,e)})(aw);var Gc={exports:{}};(function(e){(function(t,r){e.exports?e.exports=r():t.log=r()})(x.commonjsGlobal,function(){var t=function(){},r="undefined",n=typeof window!==r&&typeof window.navigator!==r&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function o(G,M){var j=G[M];if(typeof j.bind=="function")return j.bind(G);try{return Function.prototype.bind.call(j,G)}catch{return function(){return Function.prototype.apply.apply(j,[G,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function f(G){return G==="debug"&&(G="log"),typeof console===r?!1:G==="trace"&&n?s:console[G]!==void 0?o(console,G):console.log!==void 0?o(console,"log"):t}function l(G,M){for(var j=0;j<i.length;j++){var E=i[j];this[E]=j<G?t:this.methodFactory(E,G,M)}this.log=this.debug}function u(G,M,j){return function(){typeof console!==r&&(l.call(this,M,j),this[G].apply(this,arguments))}}function c(G,M,j){return f(G)||u.apply(this,arguments)}function h(G,M,j){var E=this,z;M=M??"WARN";var R="loglevel";typeof G=="string"?R+=":"+G:typeof G=="symbol"&&(R=void 0);function q(W){var P=(i[W]||"silent").toUpperCase();if(!(typeof window===r||!R)){try{window.localStorage[R]=P;return}catch{}try{window.document.cookie=encodeURIComponent(R)+"="+P+";"}catch{}}}function k(){var W;if(!(typeof window===r||!R)){try{W=window.localStorage[R]}catch{}if(typeof W===r)try{var P=window.document.cookie,Z=P.indexOf(encodeURIComponent(R)+"=");Z!==-1&&(W=/^([^;]+)/.exec(P.slice(Z))[1])}catch{}return E.levels[W]===void 0&&(W=void 0),W}}function U(){if(!(typeof window===r||!R)){try{window.localStorage.removeItem(R);return}catch{}try{window.document.cookie=encodeURIComponent(R)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}E.name=G,E.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},E.methodFactory=j||c,E.getLevel=function(){return z},E.setLevel=function(W,P){if(typeof W=="string"&&E.levels[W.toUpperCase()]!==void 0&&(W=E.levels[W.toUpperCase()]),typeof W=="number"&&W>=0&&W<=E.levels.SILENT){if(z=W,P!==!1&&q(W),l.call(E,W,G),typeof console===r&&W<E.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+W},E.setDefaultLevel=function(W){M=W,k()||E.setLevel(W,!1)},E.resetLevel=function(){E.setLevel(M,!1),U()},E.enableAll=function(W){E.setLevel(E.levels.TRACE,W)},E.disableAll=function(W){E.setLevel(E.levels.SILENT,W)};var te=k();te==null&&(te=M),E.setLevel(te,!1)}var m=new h,y={};m.getLogger=function(M){if(typeof M!="symbol"&&typeof M!="string"||M==="")throw new TypeError("You must supply a name when creating a logger.");var j=y[M];return j||(j=y[M]=new h(M,m.getLevel(),m.methodFactory)),j};var v=typeof window!==r?window.log:void 0;return m.noConflict=function(){return typeof window!==r&&window.log===m&&(window.log=v),m},m.getLoggers=function(){return y},m.default=m,m})})(Gc);var Zc=Gc.exports;const gi=x.getDefaultExportFromCjs(Zc);var _i={exports:{}};_i.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",i=800,o=16,s=9007199254740991,f="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",h="[object Date]",m="[object Error]",y="[object Function]",v="[object GeneratorFunction]",G="[object Map]",M="[object Number]",j="[object Null]",E="[object Object]",z="[object Proxy]",R="[object RegExp]",q="[object Set]",k="[object String]",U="[object Undefined]",te="[object WeakMap]",W="[object ArrayBuffer]",P="[object DataView]",Z="[object Float32Array]",_="[object Float64Array]",p="[object Int8Array]",b="[object Int16Array]",B="[object Int32Array]",V="[object Uint8Array]",L="[object Uint8ClampedArray]",D="[object Uint16Array]",N="[object Uint32Array]",O=/[\\^$.*+?()[\]{}|]/g,X=/^\[object .+?Constructor\]$/,ie=/^(?:0|[1-9]\d*)$/,ne={};ne[Z]=ne[_]=ne[p]=ne[b]=ne[B]=ne[V]=ne[L]=ne[D]=ne[N]=!0,ne[f]=ne[l]=ne[W]=ne[c]=ne[P]=ne[h]=ne[m]=ne[y]=ne[G]=ne[M]=ne[E]=ne[R]=ne[q]=ne[k]=ne[te]=!1;var ae=typeof x.commonjsGlobal=="object"&&x.commonjsGlobal&&x.commonjsGlobal.Object===Object&&x.commonjsGlobal,de=typeof self=="object"&&self&&self.Object===Object&&self,ge=ae||de||Function("return this")(),Se=t&&!t.nodeType&&t,_e=Se&&!0&&e&&!e.nodeType&&e,pe=_e&&_e.exports===Se,Oe=pe&&ae.process,Pe=function(){try{var A=_e&&_e.require&&_e.require("util").types;return A||Oe&&Oe.binding&&Oe.binding("util")}catch{}}(),Te=Pe&&Pe.isTypedArray;function T(A,H,ee){switch(ee.length){case 0:return A.call(H);case 1:return A.call(H,ee[0]);case 2:return A.call(H,ee[0],ee[1]);case 3:return A.call(H,ee[0],ee[1],ee[2])}return A.apply(H,ee)}function C(A,H){for(var ee=-1,ve=Array(A);++ee<A;)ve[ee]=H(ee);return ve}function K(A){return function(H){return A(H)}}function ce(A,H){return A==null?void 0:A[H]}function se(A,H){return function(ee){return A(H(ee))}}var be=Array.prototype,Ie=Function.prototype,Ne=Object.prototype,He=ge["__core-js_shared__"],Ue=Ie.toString,De=Ne.hasOwnProperty,tt=function(){var A=/[^.]+$/.exec(He&&He.keys&&He.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""}(),S=Ne.toString,I=Ue.call(Object),he=RegExp("^"+Ue.call(De).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),le=pe?ge.Buffer:void 0,ye=ge.Symbol,je=ge.Uint8Array,w=le?le.allocUnsafe:void 0,oe=se(Object.getPrototypeOf,Object),ue=Object.create,we=Ne.propertyIsEnumerable,F=be.splice,re=ye?ye.toStringTag:void 0,d=function(){try{var A=no(Object,"defineProperty");return A({},"",{}),A}catch{}}(),fe=le?le.isBuffer:void 0,Ae=Math.max,a=Date.now,Y=no(ge,"Map"),Q=no(Object,"create"),g=function(){function A(){}return function(H){if(!mr(H))return{};if(ue)return ue(H);A.prototype=H;var ee=new A;return A.prototype=void 0,ee}}();function $(A){var H=-1,ee=A==null?0:A.length;for(this.clear();++H<ee;){var ve=A[H];this.set(ve[0],ve[1])}}function J(){this.__data__=Q?Q(null):{},this.size=0}function Re(A){var H=this.has(A)&&delete this.__data__[A];return this.size-=H?1:0,H}function me(A){var H=this.__data__;if(Q){var ee=H[A];return ee===n?void 0:ee}return De.call(H,A)?H[A]:void 0}function Ee(A){var H=this.__data__;return Q?H[A]!==void 0:De.call(H,A)}function Be(A,H){var ee=this.__data__;return this.size+=this.has(A)?0:1,ee[A]=Q&&H===void 0?n:H,this}$.prototype.clear=J,$.prototype.delete=Re,$.prototype.get=me,$.prototype.has=Ee,$.prototype.set=Be;function rt(A){var H=-1,ee=A==null?0:A.length;for(this.clear();++H<ee;){var ve=A[H];this.set(ve[0],ve[1])}}function Ge(){this.__data__=[],this.size=0}function $e(A){var H=this.__data__,ee=Un(H,A);if(ee<0)return!1;var ve=H.length-1;return ee==ve?H.pop():F.call(H,ee,1),--this.size,!0}function et(A){var H=this.__data__,ee=Un(H,A);return ee<0?void 0:H[ee][1]}function ot(A){return Un(this.__data__,A)>-1}function dt(A,H){var ee=this.__data__,ve=Un(ee,A);return ve<0?(++this.size,ee.push([A,H])):ee[ve][1]=H,this}rt.prototype.clear=Ge,rt.prototype.delete=$e,rt.prototype.get=et,rt.prototype.has=ot,rt.prototype.set=dt;function Bt(A){var H=-1,ee=A==null?0:A.length;for(this.clear();++H<ee;){var ve=A[H];this.set(ve[0],ve[1])}}function Dr(){this.size=0,this.__data__={hash:new $,map:new(Y||rt),string:new $}}function Ye(A){var H=Hn(this,A).delete(A);return this.size-=H?1:0,H}function wt(A){return Hn(this,A).get(A)}function nt(A){return Hn(this,A).has(A)}function $t(A,H){var ee=Hn(this,A),ve=ee.size;return ee.set(A,H),this.size+=ee.size==ve?0:1,this}Bt.prototype.clear=Dr,Bt.prototype.delete=Ye,Bt.prototype.get=wt,Bt.prototype.has=nt,Bt.prototype.set=$t;function ft(A){var H=this.__data__=new rt(A);this.size=H.size}function Mn(){this.__data__=new rt,this.size=0}function rd(A){var H=this.__data__,ee=H.delete(A);return this.size=H.size,ee}function nd(A){return this.__data__.get(A)}function id(A){return this.__data__.has(A)}function od(A,H){var ee=this.__data__;if(ee instanceof rt){var ve=ee.__data__;if(!Y||ve.length<r-1)return ve.push([A,H]),this.size=++ee.size,this;ee=this.__data__=new Bt(ve)}return ee.set(A,H),this.size=ee.size,this}ft.prototype.clear=Mn,ft.prototype.delete=rd,ft.prototype.get=nd,ft.prototype.has=id,ft.prototype.set=od;function sd(A,H){var ee=so(A),ve=!ee&&oo(A),ke=!ee&&!ve&&Ra(A),ze=!ee&&!ve&&!ke&&Ia(A),Ze=ee||ve||ke||ze,xe=Ze?C(A.length,String):[],Ke=xe.length;for(var Rt in A)(H||De.call(A,Rt))&&!(Ze&&(Rt=="length"||ke&&(Rt=="offset"||Rt=="parent")||ze&&(Rt=="buffer"||Rt=="byteLength"||Rt=="byteOffset")||va(Rt,Ke)))&&xe.push(Rt);return xe}function to(A,H,ee){(ee!==void 0&&!zn(A[H],ee)||ee===void 0&&!(H in A))&&ro(A,H,ee)}function ad(A,H,ee){var ve=A[H];(!(De.call(A,H)&&zn(ve,ee))||ee===void 0&&!(H in A))&&ro(A,H,ee)}function Un(A,H){for(var ee=A.length;ee--;)if(zn(A[ee][0],H))return ee;return-1}function ro(A,H,ee){H=="__proto__"&&d?d(A,H,{configurable:!0,enumerable:!0,value:ee,writable:!0}):A[H]=ee}var ld=Ed();function Fn(A){return A==null?A===void 0?U:j:re&&re in Object(A)?vd(A):Od(A)}function ma(A){return ln(A)&&Fn(A)==f}function fd(A){if(!mr(A)||Id(A))return!1;var H=lo(A)?he:X;return H.test(Nd(A))}function ud(A){return ln(A)&&Aa(A.length)&&!!ne[Fn(A)]}function cd(A){if(!mr(A))return Td(A);var H=Sa(A),ee=[];for(var ve in A)ve=="constructor"&&(H||!De.call(A,ve))||ee.push(ve);return ee}function Ea(A,H,ee,ve,ke){A!==H&&ld(H,function(ze,Ze){if(ke||(ke=new ft),mr(ze))dd(A,H,Ze,ee,Ea,ve,ke);else{var xe=ve?ve(io(A,Ze),ze,Ze+"",A,H,ke):void 0;xe===void 0&&(xe=ze),to(A,Ze,xe)}},Ta)}function dd(A,H,ee,ve,ke,ze,Ze){var xe=io(A,ee),Ke=io(H,ee),Rt=Ze.get(Ke);if(Rt){to(A,ee,Rt);return}var vt=ze?ze(xe,Ke,ee+"",A,H,Ze):void 0,fn=vt===void 0;if(fn){var fo=so(Ke),uo=!fo&&Ra(Ke),Pa=!fo&&!uo&&Ia(Ke);vt=Ke,fo||uo||Pa?so(xe)?vt=xe:Bd(xe)?vt=yd(xe):uo?(fn=!1,vt=_d(Ke,!0)):Pa?(fn=!1,vt=pd(Ke,!0)):vt=[]:$d(Ke)||oo(Ke)?(vt=xe,oo(xe)?vt=xd(xe):(!mr(xe)||lo(xe))&&(vt=Sd(Ke))):fn=!1}fn&&(Ze.set(Ke,vt),ke(vt,Ke,ve,ze,Ze),Ze.delete(Ke)),to(A,ee,vt)}function hd(A,H){return Cd(Pd(A,H,Oa),A+"")}var gd=d?function(A,H){return d(A,"toString",{configurable:!0,enumerable:!1,value:Dd(H),writable:!0})}:Oa;function _d(A,H){if(H)return A.slice();var ee=A.length,ve=w?w(ee):new A.constructor(ee);return A.copy(ve),ve}function bd(A){var H=new A.constructor(A.byteLength);return new je(H).set(new je(A)),H}function pd(A,H){var ee=H?bd(A.buffer):A.buffer;return new A.constructor(ee,A.byteOffset,A.length)}function yd(A,H){var ee=-1,ve=A.length;for(H||(H=Array(ve));++ee<ve;)H[ee]=A[ee];return H}function wd(A,H,ee,ve){var ke=!ee;ee||(ee={});for(var ze=-1,Ze=H.length;++ze<Ze;){var xe=H[ze],Ke=ve?ve(ee[xe],A[xe],xe,ee,A):void 0;Ke===void 0&&(Ke=A[xe]),ke?ro(ee,xe,Ke):ad(ee,xe,Ke)}return ee}function md(A){return hd(function(H,ee){var ve=-1,ke=ee.length,ze=ke>1?ee[ke-1]:void 0,Ze=ke>2?ee[2]:void 0;for(ze=A.length>3&&typeof ze=="function"?(ke--,ze):void 0,Ze&&Rd(ee[0],ee[1],Ze)&&(ze=ke<3?void 0:ze,ke=1),H=Object(H);++ve<ke;){var xe=ee[ve];xe&&A(H,xe,ve,ze)}return H})}function Ed(A){return function(H,ee,ve){for(var ke=-1,ze=Object(H),Ze=ve(H),xe=Ze.length;xe--;){var Ke=Ze[A?xe:++ke];if(ee(ze[Ke],Ke,ze)===!1)break}return H}}function Hn(A,H){var ee=A.__data__;return Ad(H)?ee[typeof H=="string"?"string":"hash"]:ee.map}function no(A,H){var ee=ce(A,H);return fd(ee)?ee:void 0}function vd(A){var H=De.call(A,re),ee=A[re];try{A[re]=void 0;var ve=!0}catch{}var ke=S.call(A);return ve&&(H?A[re]=ee:delete A[re]),ke}function Sd(A){return typeof A.constructor=="function"&&!Sa(A)?g(oe(A)):{}}function va(A,H){var ee=typeof A;return H=H??s,!!H&&(ee=="number"||ee!="symbol"&&ie.test(A))&&A>-1&&A%1==0&&A<H}function Rd(A,H,ee){if(!mr(ee))return!1;var ve=typeof H;return(ve=="number"?ao(ee)&&va(H,ee.length):ve=="string"&&H in ee)?zn(ee[H],A):!1}function Ad(A){var H=typeof A;return H=="string"||H=="number"||H=="symbol"||H=="boolean"?A!=="__proto__":A===null}function Id(A){return!!tt&&tt in A}function Sa(A){var H=A&&A.constructor,ee=typeof H=="function"&&H.prototype||Ne;return A===ee}function Td(A){var H=[];if(A!=null)for(var ee in Object(A))H.push(ee);return H}function Od(A){return S.call(A)}function Pd(A,H,ee){return H=Ae(H===void 0?A.length-1:H,0),function(){for(var ve=arguments,ke=-1,ze=Ae(ve.length-H,0),Ze=Array(ze);++ke<ze;)Ze[ke]=ve[H+ke];ke=-1;for(var xe=Array(H+1);++ke<H;)xe[ke]=ve[ke];return xe[H]=ee(Ze),T(A,this,xe)}}function io(A,H){if(!(H==="constructor"&&typeof A[H]=="function")&&H!="__proto__")return A[H]}var Cd=Ld(gd);function Ld(A){var H=0,ee=0;return function(){var ve=a(),ke=o-(ve-ee);if(ee=ve,ke>0){if(++H>=i)return arguments[0]}else H=0;return A.apply(void 0,arguments)}}function Nd(A){if(A!=null){try{return Ue.call(A)}catch{}try{return A+""}catch{}}return""}function zn(A,H){return A===H||A!==A&&H!==H}var oo=ma(function(){return arguments}())?ma:function(A){return ln(A)&&De.call(A,"callee")&&!we.call(A,"callee")},so=Array.isArray;function ao(A){return A!=null&&Aa(A.length)&&!lo(A)}function Bd(A){return ln(A)&&ao(A)}var Ra=fe||jd;function lo(A){if(!mr(A))return!1;var H=Fn(A);return H==y||H==v||H==u||H==z}function Aa(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=s}function mr(A){var H=typeof A;return A!=null&&(H=="object"||H=="function")}function ln(A){return A!=null&&typeof A=="object"}function $d(A){if(!ln(A)||Fn(A)!=E)return!1;var H=oe(A);if(H===null)return!0;var ee=De.call(H,"constructor")&&H.constructor;return typeof ee=="function"&&ee instanceof ee&&Ue.call(ee)==I}var Ia=Te?K(Te):ud;function xd(A){return wd(A,Ta(A))}function Ta(A){return ao(A)?sd(A,!0):cd(A)}var kd=md(function(A,H,ee){Ea(A,H,ee)});function Dd(A){return function(){return A}}function Oa(A){return A}function jd(){return!1}e.exports=kd})(_i,_i.exports);_i.exports;const rE=gi.getLogger("http-helpers");rE.setLevel(Zc.levels.INFO);zd();const yn={IFRAME_STATUS:"iframe_status",CREATE_WINDOW:"create_window",CLOSE_WINDOW:"close_window",USER_LOGGED_IN:"user_logged_in",USER_LOGGED_OUT:"user_logged_out"},Vt={LOGOUT:"logout",WALLET_INSTANCE_ID:"wallet_instance_id",USER_INFO:"user_info",SET_PROVIDER:"set_provider",TOPUP:"topup",IFRAME_STATUS:"iframe_status",OPENED_WINDOW:"opened_window",CLOSED_WINDOW:"closed_window",GET_PROVIDER_STATE:"get_provider_state",LOGIN_WITH_PRIVATE_KEY:"login_with_private_key"},nE={GET_PROVIDER_STATE:"wallet_get_provider_state"},ts={ACCOUNTS_CHANGED:"wallet_accounts_changed",CHAIN_CHANGED:"wallet_chain_changed",UNLOCK_STATE_CHANGED:"wallet_unlock_state_changed"};function iE(e){return function(r,n,i){i(o=>{n.error&&gi.warn(`Error in RPC response:
4
4
  `,n),!r.isTorusInternal&&(gi.info(`RPC (${e.origin}):`,r,"->",n),o())})}}var yf;(function(e){e.approved="approved",e.cancelled="cancelled",e.confirmed="confirmed",e.failed="failed",e.finalized="finalized",e.processed="processed",e.rejected="rejected",e.signed="signed",e.submitted="submitted",e.unapproved="unapproved",e.dropped="dropped",e.expired="expired"})(yf||(yf={}));var oE=x.requireBrowser();const sE=x.getDefaultExportFromCjs(oE);var aE={exports:{}},ba={},pa={};Object.defineProperty(pa,"__esModule",{value:!0});function lE(e){var t=4,r=e.length,n=r%t;if(!n)return e;var i=r,o=t-n,s=r+o,f=x.dist.Buffer.alloc(s);for(f.write(e);o--;)f.write("=",i++);return f.toString()}pa.default=lE;Object.defineProperty(ba,"__esModule",{value:!0});var fE=pa;function Kc(e,t){return t===void 0&&(t="utf8"),x.dist.Buffer.isBuffer(e)?Is(e.toString("base64")):Is(x.dist.Buffer.from(e,t).toString("base64"))}function uE(e,t){return t===void 0&&(t="utf8"),x.dist.Buffer.from(ya(e),"base64").toString(t)}function ya(e){return e=e.toString(),fE.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function Is(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function cE(e){return x.dist.Buffer.from(ya(e),"base64")}var an=Kc;an.encode=Kc;an.decode=uE;an.toBase64=ya;an.fromBase64=Is;an.toBuffer=cE;ba.default=an;(function(e){e.exports=ba.default,e.exports.default=e.exports})(aE);const dE=()=>sE(32).toString("hex");function Qn(){}const wf="SYN",rs="ACK",mf="BRK";class Ef extends x.readableBrowserExports.Duplex{constructor(t){let{name:r,target:n,targetWindow:i=window,targetOrigin:o="*"}=t;if(super({objectMode:!0}),x._defineProperty(this,"_init",void 0),x._defineProperty(this,"_haveSyn",void 0),x._defineProperty(this,"_name",void 0),x._defineProperty(this,"_target",void 0),x._defineProperty(this,"_targetWindow",void 0),x._defineProperty(this,"_targetOrigin",void 0),x._defineProperty(this,"_onMessage",void 0),x._defineProperty(this,"_synIntervalId",void 0),!r||!n)throw new Error("Invalid input.");this._init=!1,this._haveSyn=!1,this._name=r,this._target=n,this._targetWindow=i,this._targetOrigin=o,this._onMessage=this.onMessage.bind(this),this._synIntervalId=null,window.addEventListener("message",this._onMessage,!1),this._handShake()}_break(){this.cork(),this._write(mf,null,Qn),this._haveSyn=!1,this._init=!1}_handShake(){this._write(wf,null,Qn),this.cork()}_onData(t){if(!this._init)t===wf?(this._haveSyn=!0,this._write(rs,null,Qn)):t===rs&&(this._init=!0,this._haveSyn||this._write(rs,null,Qn),this.uncork());else if(t===mf)this._break();else try{this.push(t)}catch(r){this.emit("error",r)}}_postMessage(t){const r=this._targetOrigin;this._targetWindow.postMessage({target:this._target,data:t},r)}onMessage(t){const r=t.data;this._targetOrigin!=="*"&&t.origin!==this._targetOrigin||t.source!==this._targetWindow||typeof r!="object"||r.target!==this._name||!r.data||this._onData(r.data)}_read(){}_write(t,r,n){this._postMessage(t),n()}_destroy(){window.removeEventListener("message",this._onMessage,!1)}}function vf(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function hE(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}class Qi extends x.eventsExports.EventEmitter{emit(t){let r=t==="error";const n=this._events;if(n!==void 0)r=r&&n.error===void 0;else if(!r)return!1;for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];if(r){let l;if(o.length>0&&([l]=o),l instanceof Error)throw l;const u=new Error(`Unhandled error.${l?` (${l.message})`:""}`);throw u.context=l,u}const f=n[t];if(f===void 0)return!1;if(typeof f=="function")vf(f,this,o);else{const l=f.length,u=hE(f);for(let c=0;c<l;c+=1)vf(u[c],this,o)}return!0}}class wn extends Error{constructor(t){let{code:r,message:n,data:i}=t;if(!Number.isInteger(r))throw new Error("code must be an integer");if(!n||typeof n!="string")throw new Error("message must be string");super(n),x._defineProperty(this,"code",void 0),x._defineProperty(this,"data",void 0),this.code=r,i!==void 0&&(this.data=i)}toString(){return Ud({code:this.code,message:this.message,data:this.data,stack:this.stack})}}const Ts=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return(n,i)=>{n||i.error?t(n||i.error):!r||Array.isArray(i)?e(i):e(i.result)}};function gE(){const e={};function t(){return!1}const r=new Qi;function n(l){const u=e[l.id];if(!u)throw new Error(`StreamMiddleware - Unknown response id "${l.id}"`);delete e[l.id],Object.assign(u.res,l),setTimeout(u.end)}function i(l){r.emit("notification",l)}function o(l,u,c){let h;try{!l.id?i(l):n(l)}catch(m){h=m}c(h)}const s=new x.readableBrowserExports.Duplex({objectMode:!0,read:t,write:o});return{events:r,middleware:(l,u,c,h)=>{s.push(l),e[l.id]={req:l,res:u,next:c,end:h}},stream:s}}function _E(){return(e,t,r,n)=>{const i=e.id,o=dE();e.id=o,t.id=o,r(s=>{e.id=i,t.id=i,s()})}}function Sf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function bE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Sf(Object(r),!0).forEach(function(n){x._defineProperty(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}class rr extends Qi{constructor(){super(),x._defineProperty(this,"_middleware",void 0),this._middleware=[]}static async _runAllMiddleware(t,r,n){const i=[];let o=null,s=!1;for(const f of n)if([o,s]=await rr._runMiddleware(t,r,f,i),s)break;return[o,s,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(o=>{const s=l=>{const u=l||r.error;u&&(r.error=Ut.serializeError(u)),o([u,!0])},f=l=>{r.error?s(r.error):(l&&(typeof l!="function"&&s(new wn({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),i.push(l)),o([null,!1]))};try{n(t,r,f,s)}catch(l){s(l)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((n,i)=>{r(o=>o?i(o):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new wn({code:-32603,message:"Response has no error or result for request"});if(!n)throw new wn({code:-32603,message:"Nothing ended request"})}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,i)=>{try{const[o,s,f]=await rr._runAllMiddleware(t,r,this._middleware);return s?(await rr._runReturnHandlers(f),i(o)):n(async l=>{try{await rr._runReturnHandlers(f)}catch(u){return l(u)}return l()})}catch(o){return i(o)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,i)=>{r(i)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const s=new wn({code:-32603,message:"request must be plain object"});return r(s,{id:void 0,jsonrpc:"2.0",error:s})}if(typeof t.method!="string"){const s=new wn({code:-32603,message:"method must be string"});return r(s,{id:t.id,jsonrpc:"2.0",error:s})}const n=bE({},t),i={id:n.id,jsonrpc:n.jsonrpc};let o=null;try{await this._processRequest(n,i)}catch(s){o=s}return o&&(delete i.result,i.error||(i.error=Ut.serializeError(o))),r(o,i)}async _processRequest(t,r){const[n,i,o]=await rr._runAllMiddleware(t,r,this._middleware);if(rr._checkForCompletion(t,r,i),await rr._runReturnHandlers(o),n)throw n}}class pE extends x.readableBrowserExports.Duplex{constructor(t){let{parent:r,name:n}=t;super({objectMode:!0}),x._defineProperty(this,"_parent",void 0),x._defineProperty(this,"_name",void 0),this._parent=r,this._name=n}_read(){}_write(t,r,n){this._parent.push({name:this._name,data:t}),n()}}function Rf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Af(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rf(Object(r),!0).forEach(function(n){x._defineProperty(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const If=Symbol("IGNORE_SUBSTREAM");class yE extends x.readableBrowserExports.Duplex{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(Af(Af({},t),{},{objectMode:!0})),x._defineProperty(this,"_substreams",void 0),x._defineProperty(this,"getStream",void 0),this._substreams={}}createStream(t){if(!t)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[t])throw new Error(`ObjectMultiplex - Substream for name "${t}" already exists`);const r=new pE({parent:this,name:t});return this._substreams[t]=r,wE(this,n=>r.destroy(n||void 0)),r}ignoreStream(t){if(!t)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[t])throw new Error(`ObjectMultiplex - Substream for name "${t}" already exists`);this._substreams[t]=If}_read(){}_write(t,r,n){const{name:i,data:o}=t;if(!i)return window.console.warn(`ObjectMultiplex - malformed chunk without name "${t}"`),n();const s=this._substreams[i];return s?(s!==If&&s.push(o),n()):(window.console.warn(`ObjectMultiplex - orphaned data for stream "${i}"`),n())}}function wE(e,t){const r=Gy(t);Wl(e,{readable:!1},r),Wl(e,{writable:!1},r)}const Xt=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";Xt.writable=e=>Xt(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";Xt.readable=e=>Xt(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";Xt.duplex=e=>Xt.writable(e)&&Xt.readable(e);Xt.transform=e=>Xt.duplex(e)&&typeof e._transform=="function";var mE=Xt,EE=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var s=o[i];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r};const vE=x.getDefaultExportFromCjs(EE);var SE="0.3.4",Kt={errors:{disconnected:()=>"Torus: Lost connection to Torus.",permanentlyDisconnected:()=>"Torus: Disconnected from iframe. Page reload required.",unsupportedSync:e=>`Torus: The Torus Ethereum provider does not support synchronous methods like ${e} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidOptions:e=>`Invalid options. Received: { maxEventListeners: ${e}}`,invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:e=>`'args.logger' must include required method '${e}'.`},info:{connected:e=>`Torus: Connected to chain with ID "${e}".`},warnings:{}};const Jc={PRODUCTION:"production",DEVELOPMENT:"development",TESTING:"testing"},zr={BOTTOM_LEFT:"bottom-left",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",TOP_RIGHT:"top-right"},ii={GOOGLE:"google",FACEBOOK:"facebook",REDDIT:"reddit",DISCORD:"discord",TWITCH:"twitch",APPLE:"apple",LINE:"line",GITHUB:"github",KAKAO:"kakao",LINKEDIN:"linkedin",TWITTER:"twitter",WEIBO:"weibo",WECHAT:"wechat",EMAIL_PASSWORDLESS:"email_passwordless"},RE={en:{embed:{continue:"Continue",actionRequired:"Authorization required",pendingAction:"Click continue to proceed with your request in a popup",cookiesRequired:"Cookies Required",enableCookies:"Please enable cookies in your browser preferences to access Torus",clickHere:"More Info"}},de:{embed:{continue:"Fortsetzen",actionRequired:"Autorisierung erforderlich",pendingAction:"Klicken Sie in einem Popup auf Weiter, um mit Ihrer Anfrage fortzufahren",cookiesRequired:"Cookies benötigt",enableCookies:"Bitte aktivieren Sie Cookies in Ihren Browsereinstellungen, um auf Torus zuzugreifen",clickHere:"Mehr Info"}},ja:{embed:{continue:"継続する",actionRequired:"認証が必要です",pendingAction:"続行をクリックして、ポップアップでリクエストを続行します",cookiesRequired:"必要なクッキー",enableCookies:"Torusにアクセスするには、ブラウザの設定でCookieを有効にしてください。",clickHere:"詳しくは"}},ko:{embed:{continue:"계속하다",actionRequired:"승인 필요",pendingAction:"팝업에서 요청을 진행하려면 계속을 클릭하십시오.",cookiesRequired:"쿠키 필요",enableCookies:"브라우저 환경 설정에서 쿠키를 활성화하여 Torus에 액세스하십시오.",clickHere:"더 많은 정보"}},zh:{embed:{continue:"继续",actionRequired:"需要授权",pendingAction:"单击继续以在弹出窗口中继续您的请求",cookiesRequired:"必填Cookie",enableCookies:"请在您的浏览器首选项中启用cookie以访问Torus。",clickHere:"更多信息"}}};var wa={supportedVerifierList:[ii.GOOGLE,ii.REDDIT,ii.DISCORD],api:"https://api.tor.us",translations:RE,prodTorusUrl:"",localStorageKeyPrefix:"torus-"},We=gi.getLogger("solana-embed");function AE(){return(e,t,r)=>{(typeof e.method!="string"||!e.method)&&(t.error=Ut.ethErrors.rpc.invalidRequest({message:"The request 'method' must be a non-empty string.",data:e})),r(n=>{const{error:i}=t;return i&&We.error(`Torus - RPC Error: ${i.message}`,i),n()})}}function IE(e,t,r){let n=`Torus: Lost connection to "${e}".`;t!=null&&t.stack&&(n+=`