UNPKG

@kaiachain/web3js-ext

Version:
2 lines 1.04 MB
/*! For license information please see web3js-ext.bundle.js.LICENSE.txt */
(()=>{var e={220:(e,t,n)=>{"use strict";var r=n(8490),i=n(7011),a=i.assert,o=i.cachedProperty,s=i.parseBytes;function u(e,t){this.eddsa=e,"object"!=typeof t&&(t=s(t)),Array.isArray(t)&&(a(t.length===2*e.encodingLength,"Signature has invalid size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),a(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof r&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}o(u,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),o(u,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),o(u,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),o(u,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},228:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,r,a,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,a||e,o),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function o(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,o=new Array(a);i<a;i++)o[i]=r[i].fn;return o},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,a,o){var s=n?n+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,a),!0;case 6:return l.fn.call(l.context,t,r,i,a,o),!0}for(c=1,u=new Array(d-1);c<d;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var h,f=l.length;for(c=0;c<f;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),d){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,r);break;case 4:l[c].fn.call(l[c].context,t,r,i);break;default:if(!u)for(h=1,u=new Array(d-1);h<d;h++)u[h-1]=arguments[h];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(e,t,n){return a(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return a(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var a=n?n+e:e;if(!this._events[a])return this;if(!t)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||o(this,a);else{for(var u=0,c=[],l=s.length;u<l;u++)(s[u].fn!==t||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[a]=1===c.length?c[0]:c:o(this,a)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&o(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s},370:(e,t,n)=>{"use strict";var r=n(8490),i=n(6698),a=n(6677),o=n(7011);function s(e){a.call(this,"mont",e),this.a=new r(e.a,16).toRed(this.red),this.b=new r(e.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,n){a.BasePoint.call(this,e,"projective"),null===t&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(t,16),this.z=new r(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,a),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,n=t.redSqr(),r=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t);return 0===r.redSqrt().redSqr().cmp(r)},i(u,a.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),n=e.redSub(t),r=e.redMul(t),i=n.redMul(t.redAdd(this.curve.a24.redMul(n)));return this.curve.point(r,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var n=this.x.redAdd(this.z),r=this.x.redSub(this.z),i=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(n),o=i.redMul(r),s=t.z.redMul(a.redAdd(o).redSqr()),u=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),n=this,r=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var a=i.length-1;a>=0;a--)0===i[a]?(n=n.diffAdd(r,this),r=r.dbl()):(r=n.diffAdd(r,this),n=n.dbl());return r},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},480:(e,t,n)=>{"use strict";var r,i=t,a=n(7952),o=n(894),s=n(7011).assert;function u(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var n=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:n}),n}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=n(4011)}catch(e){r=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},493:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(1527))&&r.__esModule?r:{default:r};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}t.default=function(){return function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.apiClient=t||i.default.instance},[{key:"accountCreated",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'account' when calling accountCreated");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHash' when calling accountCreated");var i={method:"kaia_accountCreated",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/kaia/account/accountCreated","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"accounts",value:function(e,t){e=e||{};return this.apiClient.callApi("/kaia/account/accounts","POST",null,null,null,null,{method:"kaia_accounts",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"blockNumber",value:function(e,t){e=e||{};return this.apiClient.callApi("/kaia/block/blockNumber","POST",null,null,null,null,{method:"kaia_blockNumber",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"call",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'callObject' when calling call");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHash' when calling call");var i={method:"kaia_call",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/kaia/transaction/call","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"chainID",value:function(e,t){e=e||{};return this.apiClient.callApi("/kaia/configuration/chainID","POST",null,null,null,null,{method:"kaia_chainID",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"clientVersion",value:function(e,t){e=e||{};return this.apiClient.callApi("/kaia/configuration/clientVersion","POST",null,null,null,null,{method:"kaia_clientVersion",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"createAccessList",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'callObject' when calling createAccessList");var r=0,i={method:"kaia_createAccessList",id:1,jsonrpc:"2.0",params:[]};i.params.push(e);var a=t.blockParameter||t[r++]||"latest";if(null==a)throw new Error("Missing the required parameter 'blockParameter' when calling createAccessList");return i.params.push(a),this.apiClient.callApi("/kaia/createAccessList","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,n)}},{key:"decodeAccountKey",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'encodedAccountKey' when calling decodeAccountKey");var r={method:"kaia_decodeAccountKey",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/account/decodeAccountKey","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"encodeAccountKey",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'object' when calling encodeAccountKey");var r={method:"kaia_encodeAccountKey",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/account/encodeAccountKey","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"estimateComputationCost",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'callObject' when calling estimateComputationCost");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHash' when calling estimateComputationCost");var i={method:"kaia_estimateComputationCost",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/kaia/transaction/estimateComputationCost","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"estimateGas",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'callObject' when calling estimateGas");var r=0,i={method:"kaia_estimateGas",id:1,jsonrpc:"2.0",params:[]};i.params.push(e);var a=t.blockNumberOrHashOrTag||t[r++]||"latest";if(null==a)throw new Error("Missing the required parameter 'blockNumberOrHashOrTag' when calling estimateGas");return i.params.push(a),this.apiClient.callApi("/kaia/transaction/estimateGas","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,n)}},{key:"feeHistory",value:function(e,t,n,r,i){if(r=r||{},null==e)throw new Error("Missing the required parameter 'blockCount' when calling feeHistory");if(null==t)throw new Error("Missing the required parameter 'lastBlock' when calling feeHistory");if(null==n)throw new Error("Missing the required parameter 'rewardPercentiles' when calling feeHistory");var a={method:"kaia_feeHistory",id:1,jsonrpc:"2.0",params:[]};return a.params.push(e),a.params.push(t),a.params.push(n),this.apiClient.callApi("/kaia/gas/feeHistory","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,i)}},{key:"forkStatus",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'number' when calling forkStatus");var r={method:"kaia_forkStatus",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/configuration/forkStatus","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"gasPrice",value:function(e,t){e=e||{};return this.apiClient.callApi("/kaia/configuration/gasPrice","POST",null,null,null,null,{method:"kaia_gasPrice",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"getAccount",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'address' when calling getAccount");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHashOrTag' when calling getAccount");var i={method:"kaia_getAccount",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/kaia/account/getAccount","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getAccountKey",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'address' when calling getAccountKey");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHashOrTag' when calling getAccountKey");var i={method:"kaia_getAccountKey",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/kaia/account/getAccountKey","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getBalance",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'address' when calling getBalance");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHash' when calling getBalance");var i={method:"kaia_getBalance",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/kaia/account/getBalance","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getBlockByHash",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'hashOfBlock' when calling getBlockByHash");if(null==t)throw new Error("Missing the required parameter 'returnTransactionObject' when calling getBlockByHash");var i={method:"kaia_getBlockByHash",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/kaia/block/getBlockByHash","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getBlockByNumber",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getBlockByNumber");if(null==t)throw new Error("Missing the required parameter '_boolean' when calling getBlockByNumber");var i={method:"kaia_getBlockByNumber",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/kaia/block/getBlockByNumber","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getBlockReceipts",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hashOfBlock' when calling getBlockReceipts");var r={method:"kaia_getBlockReceipts",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/block/getBlockReceipts","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getBlockTransactionCountByHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hashOfBlock' when calling getBlockTransactionCountByHash");var r={method:"kaia_getBlockTransactionCountByHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/block/getBlockTransactionCountByHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getBlockTransactionCountByNumber",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getBlockTransactionCountByNumber");var r={method:"kaia_getBlockTransactionCountByNumber",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/block/getBlockTransactionCountByNumber","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getBlockWithConsensusInfoByHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockHash' when calling getBlockWithConsensusInfoByHash");var r={method:"kaia_getBlockWithConsensusInfoByHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/block/getBlockWithConsensusInfoByHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getBlockWithConsensusInfoByNumber",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getBlockWithConsensusInfoByNumber");var r={method:"kaia_getBlockWithConsensusInfoByNumber",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/block/getBlockWithConsensusInfoByNumber","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getBlockWithConsensusInfoByNumberRange",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'blockHashOrBlockNumber' when calling getBlockWithConsensusInfoByNumberRange");if(null==t)throw new Error("Missing the required parameter 'range' when calling getBlockWithConsensusInfoByNumberRange");var i={method:"kaia_getBlockWithConsensusInfoByNumberRange",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/kaia/block/getBlockWithConsensusInfoByNumberRange","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getChainConfig",value:function(e,t){var n=0,r={method:"kaia_getChainConfig",id:1,jsonrpc:"2.0",params:[]},i=(e=e||{}).blockNumberOrTag||e[n++]||"latest";if(null==i)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getChainConfig");return r.params.push(i),this.apiClient.callApi("/kaia/configuration/getChainConfig","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,t)}},{key:"getCode",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'account' when calling getCode");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHashOrTag' when calling getCode");var i={method:"kaia_getCode",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/kaia/account/getCode","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getCommittee",value:function(e,t){var n=0,r={method:"kaia_getCommittee",id:1,jsonrpc:"2.0",params:[]},i=(e=e||{}).blockNumberOrTag||e[n++]||"latest";if(null==i)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getCommittee");return r.params.push(i),this.apiClient.callApi("/kaia/block/getCommittee","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,t)}},{key:"getCommitteeSize",value:function(e,t){var n=0,r={method:"kaia_getCommitteeSize",id:1,jsonrpc:"2.0",params:[]},i=(e=e||{}).blockNumberOrTag||e[n++]||"latest";if(null==i)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getCommitteeSize");return r.params.push(i),this.apiClient.callApi("/kaia/block/getCommitteeSize","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,t)}},{key:"getCouncil",value:function(e,t){var n=0,r={method:"kaia_getCouncil",id:1,jsonrpc:"2.0",params:[]},i=(e=e||{}).blockNumberOrTag||e[n++]||"latest";if(null==i)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getCouncil");return r.params.push(i),this.apiClient.callApi("/kaia/block/getCouncil","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,t)}},{key:"getCouncilSize",value:function(e,t){var n=0,r={method:"kaia_getCouncilSize",id:1,jsonrpc:"2.0",params:[]},i=(e=e||{}).blockNumberOrTag||e[n++]||"latest";if(null==i)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getCouncilSize");return r.params.push(i),this.apiClient.callApi("/kaia/block/getCouncilSize","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,t)}},{key:"getDecodedAnchoringTransactionByHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hashOfTransaction' when calling getDecodedAnchoringTransactionByHash");var r={method:"kaia_getDecodedAnchoringTransactionByHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/transaction/getDecodedAnchoringTransactionByHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getFilterChanges",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'QUANTITY' when calling getFilterChanges");var r={method:"kaia_getFilterChanges",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/filter/getFilterChanges","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getFilterLogs",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'QUANTITY' when calling getFilterLogs");var r={method:"kaia_getFilterLogs",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/filter/getFilterLogs","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getHeaderByHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hashOfBlock' when calling getHeaderByHash");var r={method:"kaia_getHeaderByHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/block/getHeaderByHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getHeaderByNumber",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getHeaderByNumber");var r={method:"kaia_getHeaderByNumber",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/block/getHeaderByNumber","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getLogs",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'filterOptions' when calling getLogs");var r={method:"kaia_getLogs",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/filter/getLogs","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getParams",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumber' when calling getParams");var r={method:"kaia_getParams",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/configuration/getParams","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getProof",value:function(e,t,n,r,i){if(r=r||{},null==e)throw new Error("Missing the required parameter 'account' when calling getProof");if(null==t)throw new Error("Missing the required parameter 'keys' when calling getProof");if(null==n)throw new Error("Missing the required parameter 'blockNumber' when calling getProof");var a={method:"kaia_getProof",id:1,jsonrpc:"2.0",params:[]};return a.params.push(e),a.params.push(t),a.params.push(n),this.apiClient.callApi("/kaia/miscellaneous/getProof","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,i)}},{key:"getRawTransactionByBlockHashAndIndex",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'blockHash' when calling getRawTransactionByBlockHashAndIndex");if(null==t)throw new Error("Missing the required parameter 'index' when calling getRawTransactionByBlockHashAndIndex");var i={method:"kaia_getRawTransactionByBlockHashAndIndex",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/kaia/getRawTransactionByBlockHashAndIndex","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getRawTransactionByBlockNumberAndIndex",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrHashOrTag' when calling getRawTransactionByBlockNumberAndIndex");if(null==t)throw new Error("Missing the required parameter 'transactionIndex' when calling getRawTransactionByBlockNumberAndIndex");var i={method:"kaia_getRawTransactionByBlockNumberAndIndex",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/kaia/getRawTransactionByBlockNumberAndIndex","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getRawTransactionByHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hash' when calling getRawTransactionByHash");var r={method:"kaia_getRawTransactionByHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/getRawTransactionByHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getRewards",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getRewards");var r={method:"kaia_getRewards",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/block/getRewards","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getStakingInfo",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getStakingInfo");var r={method:"kaia_getStakingInfo",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/miscellaneous/getStakingInfo","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getStorageAt",value:function(e,t,n,r,i){if(r=r||{},null==e)throw new Error("Missing the required parameter 'storageAddress' when calling getStorageAt");if(null==t)throw new Error("Missing the required parameter 'position' when calling getStorageAt");if(null==n)throw new Error("Missing the required parameter 'blockNumberOrHash' when calling getStorageAt");var a={method:"kaia_getStorageAt",id:1,jsonrpc:"2.0",params:[]};return a.params.push(e),a.params.push(t),a.params.push(n),this.apiClient.callApi("/kaia/block/getStorageAt","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,i)}},{key:"getTotalSupply",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumber' when calling getTotalSupply");var r={method:"kaia_getTotalSupply",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/miscellaneous/getTotalSupply","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getTransactionByBlockHashAndIndex",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'blockHash' when calling getTransactionByBlockHashAndIndex");if(null==t)throw new Error("Missing the required parameter 'transactionIndexPosition' when calling getTransactionByBlockHashAndIndex");var i={method:"kaia_getTransactionByBlockHashAndIndex",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/kaia/transaction/getTransactionByBlockHashAndIndex","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getTransactionByBlockNumberAndIndex",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getTransactionByBlockNumberAndIndex");if(null==t)throw new Error("Missing the required parameter 'transactionIndex' when calling getTransactionByBlockNumberAndIndex");var i={method:"kaia_getTransactionByBlockNumberAndIndex",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/kaia/transaction/getTransactionByBlockNumberAndIndex","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getTransactionByHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'transactionHash' when calling getTransactionByHash");var r={method:"kaia_getTransactionByHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/transaction/getTransactionByHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getTransactionBySenderTxHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'transactionHash' when calling getTransactionBySenderTxHash");var r={method:"kaia_getTransactionBySenderTxHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/transaction/getTransactionBySenderTxHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getTransactionCount",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'address' when calling getTransactionCount");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHashOrTag' when calling getTransactionCount");var i={method:"kaia_getTransactionCount",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/kaia/account/getTransactionCount","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getTransactionReceipt",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'transactionHash' when calling getTransactionReceipt");var r={method:"kaia_getTransactionReceipt",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/transaction/getTransactionReceipt","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getTransactionReceiptBySenderTxHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hash' when calling getTransactionReceiptBySenderTxHash");var r={method:"kaia_getTransactionReceiptBySenderTxHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/transaction/getTransactionReceiptBySenderTxHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"isContractAccount",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'address' when calling isContractAccount");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHashOrTag' when calling isContractAccount");var i={method:"kaia_isContractAccount",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/kaia/account/isContractAccount","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"isParallelDBWrite",value:function(e,t){e=e||{};return this.apiClient.callApi("/kaia/configuration/isParallelDBWrite","POST",null,null,null,null,{method:"kaia_isParallelDBWrite",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"isSenderTxHashIndexingEnabled",value:function(e,t){e=e||{};return this.apiClient.callApi("/kaia/configuration/isSenderTxHashIndexingEnabled","POST",null,null,null,null,{method:"kaia_isSenderTxHashIndexingEnabled",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"lowerBoundGasPrice",value:function(e,t){e=e||{};return this.apiClient.callApi("/kaia/gas/lowerBoundGasPrice","POST",null,null,null,null,{method:"kaia_lowerBoundGasPrice",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"maxPriorityFeePerGas",value:function(e,t){e=e||{};return this.apiClient.callApi("/kaia/gas/maxPriorityFeePerGas","POST",null,null,null,null,{method:"kaia_maxPriorityFeePerGas",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"newBlockFilter",value:function(e,t){e=e||{};return this.apiClient.callApi("/kaia/filter/newBlockFilter","POST",null,null,null,null,{method:"kaia_newBlockFilter",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"newFilter",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'filterOptions' when calling newFilter");var r={method:"kaia_newFilter",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/filter/newFilter","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"newPendingTransactionFilter",value:function(e,t){e=e||{};return this.apiClient.callApi("/kaia/filter/newPendingTransactionFilter","POST",null,null,null,null,{method:"kaia_newPendingTransactionFilter",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"nodeAddress",value:function(e,t){e=e||{};return this.apiClient.callApi("/kaia/miscellaneous/nodeAddress","POST",null,null,null,null,{method:"kaia_nodeAddress",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"pendingTransactions",value:function(e,t){e=e||{};return this.apiClient.callApi("/kaia/transaction/pendingTransactions","POST",null,null,null,null,{method:"kaia_pendingTransactions",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"protocolVersion",value:function(e,t){e=e||{};return this.apiClient.callApi("/kaia/configuration/protocolVersion","POST",null,null,null,null,{method:"kaia_protocolVersion",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"recoverFromMessage",value:function(e,t,n,r,i){if(r=r||{},null==e)throw new Error("Missing the required parameter 'address' when calling recoverFromMessage");if(null==t)throw new Error("Missing the required parameter 'message' when calling recoverFromMessage");if(null==n)throw new Error("Missing the required parameter 'signature' when calling recoverFromMessage");var a=0,o={method:"kaia_recoverFromMessage",id:1,jsonrpc:"2.0",params:[]};o.params.push(e),o.params.push(t),o.params.push(n);var s=r.blockNumberOrTag||r[a++]||"latest";if(null==s)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling recoverFromMessage");return o.params.push(s),this.apiClient.callApi("/kaia/miscellaneous/recoverFromMessage","POST",null,null,null,null,o,[],["application/json"],["application/json"],"object",null,i)}},{key:"recoverFromTransaction",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'rlpEncodedTransaction' when calling recoverFromTransaction");var r=0,i={method:"kaia_recoverFromTransaction",id:1,jsonrpc:"2.0",params:[]};i.params.push(e);var a=t.blockNumberOrTag||t[r++]||"latest";if(null==a)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling recoverFromTransaction");return i.params.push(a),this.apiClient.callApi("/kaia/miscellaneous/recoverFromTransaction","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,n)}},{key:"resend",value:function(e,t,n,r,i){if(r=r||{},null==e)throw new Error("Missing the required parameter 'sendArgs' when calling resend");if(null==t)throw new Error("Missing the required parameter 'gasPrice' when calling resend");if(null==n)throw new Error("Missing the required parameter 'gasLimit' when calling resend");var a={method:"kaia_resend",id:1,jsonrpc:"2.0",params:[]};return a.params.push(e),a.params.push(t),a.params.push(n),this.apiClient.callApi("/kaia/resend","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,i)}},{key:"rewardbase",value:function(e,t){e=e||{};return this.apiClient.callApi("/kaia/configuration/rewardbase","POST",null,null,null,null,{method:"kaia_rewardbase",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"sendRawTransaction",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'singedTransactionData' when calling sendRawTransaction");var r={method:"kaia_sendRawTransaction",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/transaction/sendRawTransaction","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"sendTransaction",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'kaiatnTransactionTypes' when calling sendTransaction");var r={method:"kaia_sendTransaction",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/transaction/sendTransaction","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"sendTransactionAsFeePayer",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'kaiatnTransactionTypes' when calling sendTransactionAsFeePayer");var r={method:"kaia_sendTransactionAsFeePayer",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/transaction/sendTransactionAsFeePayer","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"sha3",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'data' when calling sha3");var r={method:"kaia_sha3",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/miscellaneous/sha3","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"sign",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'account' when calling sign");if(null==t)throw new Error("Missing the required parameter 'message' when calling sign");var i={method:"kaia_sign",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/kaia/account/sign","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"signTransaction",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'transactionData' when calling signTransaction");var r={method:"kaia_signTransaction",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/transaction/signTransaction","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"signTransactionAsFeePayer",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'transactionData' when calling signTransactionAsFeePayer");var r={method:"kaia_signTransactionAsFeePayer",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/transaction/signTransactionAsFeePayer","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"subscribe",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'notificationType' when calling subscribe");var r={method:"kaia_subscribe",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/filter/subscribe","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"syncing",value:function(e,t){e=e||{};return this.apiClient.callApi("/kaia/block/syncing","POST",null,null,null,null,{method:"kaia_syncing",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"uninstallFilter",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'filter' when calling uninstallFilter");var r={method:"kaia_uninstallFilter",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/filter/uninstallFilter","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"unsubscribe",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'subscriptionId' when calling unsubscribe");var r={method:"kaia_unsubscribe",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/kaia/filter/unsubscribe","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"upperBoundGasPrice",value:function(e,t){e=e||{};return this.apiClient.callApi("/kaia/gas/upperBoundGasPrice","POST",null,null,null,null,{method:"kaia_upperBoundGasPrice",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}}])}()},609:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(1527))&&r.__esModule?r:{default:r};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}t.default=function(){return function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.apiClient=t||i.default.instance},[{key:"content",value:function(e,t){e=e||{};return this.apiClient.callApi("/txpool/content","POST",null,null,null,null,{method:"txpool_content",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"inspect",value:function(e,t){e=e||{};return this.apiClient.callApi("/txpool/inspect","POST",null,null,null,null,{method:"txpool_inspect",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"status",value:function(e,t){e=e||{};return this.apiClient.callApi("/txpool/status","POST",null,null,null,null,{method:"txpool_status",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}}])}()},894:(e,t,n)=>{"use strict";var r=t;r.base=n(6677),r.short=n(9188),r.mont=n(370),r.edwards=n(1298)},1176:(e,t,n)=>{var r;!function(){"use strict";var i="input is invalid type",a="object"==typeof window,o=a?window:{};o.JS_SHA3_NO_WINDOW&&(a=!1);var s=!a&&"object"==typeof self;!o.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?o=n.g:s&&(o=self);var u=!o.JS_SHA3_NO_COMMON_JS&&e.exports,c=n.amdO,l=!o.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),h=[4,1024,262144,67108864],f=[0,8,16,24],p=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],m=[224,256,384,512],g=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],b={128:168,256:136};!o.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!o.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var v=function(e,t,n){return function(r){return new O(e,t,e).update(r)[n]()}},w=function(e,t,n){return function(r,i){return new O(e,t,i).update(r)[n]()}},A=function(e,t,n){return function(t,r,i,a){return E["cshake"+e].update(t,r,i,a)[n]()}},x=function(e,t,n){return function(t,r,i,a){return E["kmac"+e].update(t,r,i,a)[n]()}},k=function(e,t,n,r){for(var i=0;i<y.length;++i){var a=y[i];e[a]=t(n,r,a)}return e},_=function(e,t){var n=v(e,t,"hex");return n.create=function(){return new O(e,t,e)},n.update=function(e){return n.create().update(e)},k(n,v,e,t)},P=[{name:"keccak",padding:[1,256,65536,16777216],bits:m,createMethod:_},{name:"sha3",padding:[6,1536,393216,100663296],bits:m,createMethod:_},{name:"shake",padding:[31,7936,2031616,520093696],bits:g,createMethod:function(e,t){var n=w(e,t,"hex");return n.create=function(n){return new O(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},k(n,w,e,t)}},{name:"cshake",padding:h,bits:g,createMethod:function(e,t){var n=b[e],r=A(e,0,"hex");return r.create=function(r,i,a){return i||a?new O(e,t,r).bytepad([i,a],n):E["shake"+e].create(r)},r.update=function(e,t,n,i){return r.create(t,n,i).update(e)},k(r,A,e,t)}},{name:"kmac",padding:h,bits:g,createMethod:function(e,t){var n=b[e],r=x(e,0,"hex");return r.create=function(r,i,a){return new R(e,t,i).bytepad(["KMAC",a],n).bytepad([r],n)},r.update=function(e,t,n,i){return r.create(e,n,i).update(t)},k(r,x,e,t)}}],E={},S=[],T=0;T<P.length;++T)for(var M=P[T],I=M.bits,j=0;j<I.length;++j){var C=M.name+"_"+I[j];if(S.push(C),E[C]=M.createMethod(I[j],M.padding),"sha3"!==M.name){var B=M.name+I[j];S.push(B),E[B]=E[C]}}function O(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function R(e,t,n){O.call(this,e,t,n)}O.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(i);if(null===e)throw new Error(i);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw new Error(i);t=!0}for(var r,a,o=this.blocks,s=this.byteCount,u=e.length,c=this.blockCount,d=0,h=this.s;d<u;){if(this.reset)for(this.reset=!1,o[0]=this.block,r=1;r<c+1;++r)o[r]=0;if(t)for(r=this.start;d<u&&r<s;++d)o[r>>2]|=e[d]<<f[3&r++];else for(r=this.start;d<u&&r<s;++d)(a=e.charCodeAt(d))<128?o[r>>2]|=a<<f[3&r++]:a<2048?(o[r>>2]|=(192|a>>6)<<f[3&r++],o[r>>2]|=(128|63&a)<<f[3&r++]):a<55296||a>=57344?(o[r>>2]|=(224|a>>12)<<f[3&r++],o[r>>2]|=(128|a>>6&63)<<f[3&r++],o[r>>2]|=(128|63&a)<<f[3&r++]):(a=65536+((1023&a)<<10|1023&e.charCodeAt(++d)),o[r>>2]|=(240|a>>18)<<f[3&r++],o[r>>2]|=(128|a>>12&63)<<f[3&r++],o[r>>2]|=(128|a>>6&63)<<f[3&r++],o[r>>2]|=(128|63&a)<<f[3&r++]);if(this.lastByteIndex=r,r>=s){for(this.start=r-s,this.block=o[c],r=0;r<c;++r)h[r]^=o[r];N(h),this.reset=!0}else this.start=r}return this},O.prototype.encode=function(e,t){var n=255&e,r=1,i=[n];for(n=255&(e>>=8);n>0;)i.unshift(n),n=255&(e>>=8),++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},O.prototype.encodeString=function(e){var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(i);if(null===e)throw new Error(i);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw new Error(i);t=!0}var r=0,a=e.length;if(t)r=a;else for(var o=0;o<e.length;++o){var s=e.charCodeAt(o);s<128?r+=1:s<2048?r+=2:s<55296||s>=57344?r+=3:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++o)),r+=4)}return r+=this.encode(8*r),this.update(e),r},O.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r<e.length;++r)n+=this.encodeString(e[r]);var i=t-n%t,a=[];return a.length=i,this.update(a),this},O.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,n=this.blockCount,r=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t<n+1;++t)e[t]=0;for(e[n-1]|=2147483648,t=0;t<n;++t)r[t]^=e[t];N(r)}},O.prototype.toString=O.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,a=0,o=0,s="";o<r;){for(a=0;a<t&&o<r;++a,++o)e=n[a],s+=d[e>>4&15]+d[15&e]+d[e>>12&15]+d[e>>8&15]+d[e>>20&15]+d[e>>16&15]+d[e>>28&15]+d[e>>24&15];o%t===0&&(N(n),a=0)}return i&&(e=n[a],s+=d[e>>4&15]+d[15&e],i>1&&(s+=d[e>>12&15]+d[e>>8&15]),i>2&&(s+=d[e>>20&15]+d[e>>16&15])),s},O.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,a=0,o=0,s=this.outputBits>>3;e=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);o<r;){for(a=0;a<t&&o<r;++a,++o)u[o]=n[a];o%t===0&&N(n)}return i&&(u[a]=n[a],e=e.slice(0,s)),e},O.prototype.buffer=O.prototype.arrayBuffer,O.prototype.digest=O.prototype.array=function(){this.finalize();for(var e,t,n=this.blockCount,r=this.s,i=this.outputBlocks,a=this.extraBytes,o=0,s=0,u=[];s<i;){for(o=0;o<n&&s<i;++o,++s)e=s<<2,t=r[o],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%n===0&&N(r)}return a&&(e=s<<2,t=r[o],u[e]=255&t,a>1&&(u[e+1]=t>>8&255),a>2&&(u[e+2]=t>>16&255)),u},R.prototype=new O,R.prototype.finalize=function(){return this.encode(this.outputBits,!0),O.prototype.finalize.call(this)};var N=function(e){var t,n,r,i,a,o,s,u,c,l,d,h,f,m,g,y,b,v,w,A,x,k,_,P,E,S,T,M,I,j,C,B,O,R,N,F,L,H,q,D,U,z,G,V,W,K,Z,Q,$,J,Y,X,ee,te,ne,re,ie,ae,oe,se,ue,ce,le;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(o<<1|s>>>31),n=(f=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|o>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(u<<1|c>>>31),n=a^(c<<1|u>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=o^(l<<1|d>>>31),n=s^(d<<1|l>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=u^(h<<1|f>>>31),n=c^(f<<1|h>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=l^(i<<1|a>>>31),n=d^(a<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,m=e[0],g=e[1],K=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,z=e[40]<<18|e[41]>>>14,G=e[41]<<18|e[40]>>>14,R=e[2]<<1|e[3]>>>31,N=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,Q=e[22]<<10|e[23]>>>22,$=e[23]<<10|e[22]>>>22,j=e[33]<<13|e[32]>>>19,C=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,L=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,J=e[34]<<15|e[35]>>>17,Y=e[35]<<15|e[34]>>>17,B=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,P=e[6]<<28|e[7]>>>4,E=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,H=e[26]<<25|e[27]>>>7,q=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,x=e[37]<<21|e[36]>>>11,X=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,W=e[9]<<27|e[8]>>>5,S=e[18]<<20|e[19]>>>12,T=e[19]<<20|e[18]>>>12,ae=e[29]<<7|e[28]>>>25,oe=e[28]<<7|e[29]>>>25,D=e[38]<<8|e[39]>>>24,U=e[39]<<8|e[38]>>>24,k=e[48]<<14|e[49]>>>18,_=e[49]<<14|e[48]>>>18,e[0]=m^~y&v,e[1]=g^~b&w,e[10]=P^~S&M,e[11]=E^~T&I,e[20]=R^~F&H,e[21]=N^~L&q,e[30]=V^~K&Q,e[31]=W^~Z&$,e[40]=te^~re&ae,e[41]=ne^~ie&oe,e[2]=y^~v&A,e[3]=b^~w&x,e[12]=S^~M&j,e[13]=T^~I&C,e[22]=F^~H&D,e[23]=L^~q&U,e[32]=K^~Q&J,e[33]=Z^~$&Y,e[42]=re^~ae&se,e[43]=ie^~oe&ue,e[4]=v^~A&k,e[5]=w^~x&_,e[14]=M^~j&B,e[15]=I^~C&O,e[24]=H^~D&z,e[25]=q^~U&G,e[34]=Q^~J&X,e[35]=$^~Y&ee,e[44]=ae^~se&ce,e[45]=oe^~ue&le,e[6]=A^~k&m,e[7]=x^~_&g,e[16]=j^~B&P,e[17]=C^~O&E,e[26]=D^~z&R,e[27]=U^~G&N,e[36]=J^~X&V,e[37]=Y^~ee&W,e[46]=se^~ce&te,e[47]=ue^~le&ne,e[8]=k^~m&y,e[9]=_^~g&b,e[18]=B^~P&S,e[19]=O^~E&T,e[28]=z^~R&F,e[29]=G^~N&L,e[38]=X^~V&K,e[39]=ee^~W&Z,e[48]=ce^~te&re,e[49]=le^~ne&ie,e[0]^=p[r],e[1]^=p[r+1]};if(u)e.exports=E;else{for(T=0;T<S.length;++T)o[S[T]]=E[S[T]];c&&(void 0===(r=function(){return E}.call(t,n,t,e))||(e.exports=r))}}()},1200:(e,t,n)=>{"use strict";var r=n(8490),i=n(7011).assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=a,a.fromPublic=function(e,t,n){return t instanceof a?t:new a(e,{pub:t,pubEnc:n})},a.fromPrivate=function(e,t,n){return t instanceof a?t:new a(e,{priv:t,privEnc:n})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new r(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},a.prototype.sign=function(e,t,n){return this.ec.sign(e,this,t,n)},a.prototype.verify=function(e,t,n){return this.ec.verify(e,t,this,void 0,n)},a.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},1298:(e,t,n)=>{"use strict";var r=n(7011),i=n(8490),a=n(6698),o=n(6677),s=r.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,o.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,n,r,a){o.BasePoint.call(this,e,"projective"),null===t&&null===n&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(n,16),this.z=r?new i(r,16):this.curve.one,this.t=a&&new i(a,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}a(u,o),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,n,r){return this.point(e,t,n,r)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=this.c2.redSub(this.a.redMul(n)),a=this.one.redSub(this.c2.redMul(this.d).redMul(n)),o=r.redMul(a.redInvm()),s=o.redSqrt();if(0!==s.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),r=n.redSub(this.c2),a=n.redMul(this.d).redMul(this.c2).redSub(this.a),o=r.redMul(a.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=o.redSqrt();if(0!==s.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),n=e.y.redSqr(),r=t.redMul(this.a).redAdd(n),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(n)));return 0===r.cmp(i)},a(c,o.BasePoint),u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},u.prototype.point=function(e,t,n,r){return new c(this,e,t,n,r)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var r=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=r.redAdd(t),o=a.redSub(n),s=r.redSub(t),u=i.redMul(o),c=a.redMul(s),l=i.redMul(s),d=o.redMul(a);return this.curve.point(u,c,d,l)},c.prototype._projDbl=function(){var e,t,n,r,i,a,o=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(r=this.curve._mulA(s)).redAdd(u);this.zOne?(e=o.redSub(s).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(r.redSub(u)),n=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),a=c.redSub(i).redISub(i),e=o.redSub(s).redISub(u).redMul(a),t=c.redMul(r.redSub(u)),n=c.redMul(a))}else r=s.redAdd(u),i=this.curve._mulC(this.z).redSqr(),a=r.redSub(i).redSub(i),e=this.curve._mulC(o.redISub(r)).redMul(a),t=this.curve._mulC(r).redMul(s.redISub(u)),n=r.redMul(a);return this.curve.point(e,t,n)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),a=n.redSub(t),o=i.redSub(r),s=i.redAdd(r),u=n.redAdd(t),c=a.redMul(o),l=s.redMul(u),d=a.redMul(u),h=o.redMul(s);return this.curve.point(c,l,h,d)},c.prototype._projAdd=function(e){var t,n,r=this.z.redMul(e.z),i=r.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),u=i.redSub(s),c=i.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),d=r.redMul(u).redMul(l);return this.curve.twisted?(t=r.redMul(c).redMul(o.redSub(this.curve._mulA(a))),n=u.redMul(c)):(t=r.redMul(c).redMul(o.redSub(a)),n=this.curve._mulC(u).redMul(c)),this.curve.point(d,t,n)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},c.prototype.jmulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var n=e.clone(),r=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},1380:e=>{"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function n(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"].forEach(function(e){n.prototype[e]=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this._defaults.push({fn:e,args:n}),this}}),n.prototype._setDefaults=function(e){this._defaults.forEach(function(n){var r;e[n.fn].apply(e,function(e){if(Array.isArray(e))return t(e)}(r=n.args)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(r)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())})},e.exports=n},1527:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(5734)),i=a(n(5017));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http://localhost:8551";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.basePath=t.replace(/\/+$/,""),this.authentications={},this.defaultHeaders={"User-Agent":"OpenAPI-Generator/2.0.0/Javascript"},this.timeout=6e4,this.cache=!0,this.enableCookies=!1,"undefined"==typeof window&&(this.agent=new r.default.agent),this.requestAgent=null,this.plugins=null}return t=e,a=[{key:"paramToString",value:function(t){return null==t||null==t?"":t instanceof Date?t.toJSON():e.canBeJsonified(t)?JSON.stringify(t):t.toString()}},{key:"buildUrl",value:function(e,t,n){var r=this;e.match(/^\//)||(e="/"+e);var i=this.basePath+e;return null!=n&&(i=n+e),i.replace(/\{([\w-\.]+)\}/g,function(e,n){var i;return i=t.hasOwnProperty(n)?r.paramToString(t[n]):e,encodeURIComponent(i)})}},{key:"isJsonMime",value:function(e){return Boolean(null!=e&&e.match(/^application\/json(;.*)?$/i))}},{key:"jsonPreferredMime",value:function(e){for(var t=0;t<e.length;t++)if(this.isJsonMime(e[t]))return e[t];return e[0]}},{key:"isFileParam",value:function(e){var t;try{t=n(4283)}catch(e){}return!!(t&&t.ReadStream&&e instanceof t.ReadStream)||"function"==typeof Buffer&&e instanceof Buffer||"function"==typeof Blob&&e instanceof Blob||"function"==typeof File&&e instanceof File}},{key:"normalizeParams",value:function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)&&null!=e[n]&&null!=e[n]){var r=e[n];this.isFileParam(r)||Array.isArray(r)?t[n]=r:t[n]=this.paramToString(r)}return t}},{key:"buildCollectionParam",value:function(e,t){if(null==e)return null;switch(t){case"csv":return e.map(this.paramToString,this).join(",");case"ssv":return e.map(this.paramToString,this).join(" ");case"tsv":return e.map(this.paramToString,this).join("\t");case"pipes":return e.map(this.paramToString,this).join("|");case"multi":return e.map(this.paramToString,this);case"passthrough":return e;default:throw new Error("Unknown collection format: "+t)}}},{key:"applyAuthToRequest",value:function(e,t){var n=this;t.forEach(function(t){var r=n.authentications[t];switch(r.type){case"basic":(r.username||r.password)&&e.auth(r.username||"",r.password||"");break;case"bearer":if(r.accessToken){var i="function"==typeof r.accessToken?r.accessToken():r.accessToken;e.set({Authorization:"Bearer "+i})}break;case"apiKey":if(r.apiKey){var a={};r.apiKeyPrefix?a[r.name]=r.apiKeyPrefix+" "+r.apiKey:a[r.name]=r.apiKey,"header"===r.in?e.set(a):e.query(a)}break;case"oauth2":r.accessToken&&e.set({Authorization:"Bearer "+r.accessToken});break;default:throw new Error("Unknown authentication type: "+r.type)}})}},{key:"deserialize",value:function(e,t){var n;if(null==e||null==t||204==e.status)return null;var r=e.body;return(null==r||"object"===o(r)&&void 0===r.length&&!Object.keys(r).length)&&(r=e.text),null!==(n=r)&&void 0!==n&&n.error?r.error:r.result}},{key:"callApi",value:function(e,t,n,a,o,s,u,c,l,d,h,f,p){var m=this,g=this.buildUrl(e,n,f),y=(0,r.default)(t,g);if(null!==this.plugins)for(var b in this.plugins)this.plugins.hasOwnProperty(b)&&y.use(this.plugins[b]);this.applyAuthToRequest(y,c),"GET"===t.toUpperCase()&&!1===this.cache&&(a._=(new Date).getTime()),y.query(this.normalizeParams(a)),y.set(this.defaultHeaders).set(this.normalizeParams(o)),this.requestAgent&&y.agent(this.requestAgent),y.timeout(this.timeout);var v=this.jsonPreferredMime(l);if(v&&"multipart/form-data"!=v&&y.type(v),"application/x-www-form-urlencoded"===v)y.send(i.default.stringify(this.normalizeParams(s)));else if("multipart/form-data"==v){var w=this.normalizeParams(s);for(var A in w)if(w.hasOwnProperty(A)){var x=w[A];this.isFileParam(x)?y.attach(A,x):Array.isArray(x)&&x.length&&this.isFileParam(x[0])?x.forEach(function(e){return y.attach(A,e)}):y.field(A,x)}}else null!=u&&(y.header["Content-Type"]||y.type("application/json"),y.send(u));var k=this.jsonPreferredMime(d);return k&&y.accept(k),"Blob"===h?y.responseType("blob"):"String"===h&&y.responseType("text"),this.enableCookies&&("undefined"==typeof window?this.agent._attachCookies(y):y.withCredentials()),y.end(function(e,t){if(p){var n=null;if(!e)try{n=m.deserialize(t,h),m.enableCookies&&"undefined"==typeof window&&m.agent._saveCookies(t)}catch(t){e=t}p(e,n,t)}}),y}},{key:"hostSettings",value:function(){return[{url:"http://localhost:8551",description:"No description provided"},{url:"https://public-en-kairos.node.kaia.io",description:"No description provided"},{url:"https://public-en.node.kaia.io",description:"No description provided"}]}},{key:"getBasePathFromSettings",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.hostSettings();if(e<0||e>=n.length)throw new Error("Invalid index "+e+" when selecting the host settings. Must be less than "+n.length);var r=n[e],i=r.url;for(var a in r.variables)if(a in t){var o=r.variables[a];if("enum_values"in o&&!o.enum_values.includes(t[a]))throw new Error("The variable `"+a+"` in the host URL has invalid value "+t[a]+". Must be "+r.variables[a].enum_values+".");i=i.replace("{"+a+"}",t[a])}else i=i.replace("{"+a+"}",r.variables[a].default_value);return i}}],u=[{key:"canBeJsonified",value:function(e){if("string"!=typeof e&&"object"!==o(e))return!1;try{var t=e.toString();return"[object Object]"===t||"[object Array]"===t}catch(e){return!1}}},{key:"parseDate",value:function(e){return isNaN(e)?new Date(e.replace(/(\d)(T)(\d)/i,"$1 $3")):new Date(+e)}},{key:"convertToType",value:function(t,n){if(null==t)return t;switch(n){case"Boolean":return Boolean(t);case"Integer":return parseInt(t,10);case"Number":return parseFloat(t);case"String":return String(t);case"Date":return e.parseDate(String(t));case"Blob":return t;default:if(n===Object)return t;if("function"==typeof n.constructFromObject)return n.constructFromObject(t);if(Array.isArray(n)){var r=n[0];return t.map(function(t){return e.convertToType(t,r)})}if("object"===o(n)){var i,a;for(var s in n)if(n.hasOwnProperty(s)){i=s,a=n[s];break}var u={};for(var s in t)if(t.hasOwnProperty(s)){var c=e.convertToType(s,i),l=e.convertToType(t[s],a);u[c]=l}return u}return t}}},{key:"constructFromObject",value:function(t,n,r){if(Array.isArray(t))for(var i=0;i<t.length;i++)t.hasOwnProperty(i)&&(n[i]=e.convertToType(t[i],r));else for(var a in t)t.hasOwnProperty(a)&&(n[a]=e.convertToType(t[a],r))}}],a&&s(t.prototype,a),u&&s(t,u),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,a,u}();c.CollectionFormatEnum={CSV:",",SSV:" ",TSV:"\t",PIPES:"|",MULTI:"multi"},c.instance=new c,t.default=c},1636:e=>{"use strict";e.exports={rE:"6.6.1"}},1911:(e,t,n)=>{"use strict";var r=n(7426),i=n(7766);function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}r.inherits(a,i),e.exports=a,a.blockSize=1024,a.outSize=384,a.hmacStrength=192,a.padLength=128,a.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")}},1948:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=n(5125);function a(e){if(e)return function(e){for(var t in a.prototype)Object.prototype.hasOwnProperty.call(a.prototype,t)&&(e[t]=a.prototype[t]);return e}(e)}e.exports=a,a.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},a.prototype.parse=function(e){return this._parser=e,this},a.prototype.responseType=function(e){return this._responseType=e,this},a.prototype.serialize=function(e){return this._serializer=e,this},a.prototype.timeout=function(e){if(!e||"object"!==r(e))return this._timeout=e,this._responseTimeout=0,this._uploadTimeout=0,this;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))switch(t){case"deadline":this._timeout=e.deadline;break;case"response":this._responseTimeout=e.response;break;case"upload":this._uploadTimeout=e.upload;break;default:console.warn("Unknown timeout option",t)}return this},a.prototype.retry=function(e,t){return 0!==arguments.length&&!0!==e||(e=1),e<=0&&(e=0),this._maxRetries=e,this._retries=0,this._retryCallback=t,this};var o=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];a.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var n=this._retryCallback(e,t);if(!0===n)return!0;if(!1===n)return!1}catch(e){console.error(e)}if(t&&t.status&&t.status>=500&&501!==t.status)return!0;if(e){if(e.code&&o.includes(e.code))return!0;if(e.timeout&&"ECONNABORTED"===e.code)return!0;if(e.crossDomain)return!0}return!1},a.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},a.prototype.then=function(e,t){var n=this;if(!this._fullfilledPromise){var r=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(e,t){r.on("abort",function(){if(!(n._maxRetries&&n._maxRetries>n._retries))if(n.timedout&&n.timedoutError)t(n.timedoutError);else{var e=new Error("Aborted");e.code="ABORTED",e.status=n.status,e.method=n.method,e.url=n.url,t(e)}}),r.end(function(n,r){n?t(n):e(r)})})}return this._fullfilledPromise.then(e,t)},a.prototype.catch=function(e){return this.then(void 0,e)},a.prototype.use=function(e){return e(this),this},a.prototype.ok=function(e){if("function"!=typeof e)throw new Error("Callback required");return this._okCallback=e,this},a.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},a.prototype.get=function(e){return this._header[e.toLowerCase()]},a.prototype.getHeader=a.prototype.get,a.prototype.set=function(e,t){if(i(e)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},a.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},a.prototype.field=function(e,t){if(null==e)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(i(e)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.field(n,e[n]);return this}if(Array.isArray(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.field(e,t[r]);return this}if(null==t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=String(t)),this._getFormData().append(e,t),this},a.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},a.prototype._auth=function(e,t,n,r){switch(n.type){case"basic":this.set("Authorization","Basic ".concat(r("".concat(e,":").concat(t))));break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization","Bearer ".concat(e))}return this},a.prototype.withCredentials=function(e){return void 0===e&&(e=!0),this._withCredentials=e,this},a.prototype.redirects=function(e){return this._maxRedirects=e,this},a.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw new TypeError("Invalid argument");return this._maxResponseSize=e,this},a.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},a.prototype.send=function(e){var t=i(e),n=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(t&&i(this._data))for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this._data[r]=e[r]);else"string"==typeof e?(n||this.type("form"),n=this._header["content-type"],this._data="application/x-www-form-urlencoded"===n?this._data?"".concat(this._data,"&").concat(e):e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)||n||this.type("json"),this},a.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},a.prototype._finalizeQueryString=function(){var e=this._query.join("&");if(e&&(this.url+=(this.url.includes("?")?"&":"?")+e),this._query.length=0,this._sort){var t=this.url.indexOf("?");if(t>=0){var n=this.url.slice(t+1).split("&");"function"==typeof this._sort?n.sort(this._sort):n.sort(),this.url=this.url.slice(0,t)+"?"+n.join("&")}}},a.prototype._appendQueryString=function(){console.warn("Unsupported")},a.prototype._timeoutError=function(e,t,n){if(!this._aborted){var r=new Error("".concat(e+t,"ms exceeded"));r.timeout=t,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.timedoutError=r,this.abort(),this.callback(r)}},a.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}},2028:(e,t,n)=>{var r,i=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o="\\ud800-\\udfff",s="\\u0300-\\u036f\\ufe20-\\ufe23",u="\\u20d0-\\u20f0",c="\\u2700-\\u27bf",l="a-z\\xdf-\\xf6\\xf8-\\xff",d="A-Z\\xc0-\\xd6\\xd8-\\xde",h="\\ufe0e\\ufe0f",f="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",p="["+o+"]",m="["+f+"]",g="["+s+u+"]",y="\\d+",b="["+c+"]",v="["+l+"]",w="[^"+o+f+y+c+l+d+"]",A="\\ud83c[\\udffb-\\udfff]",x="[^"+o+"]",k="(?:\\ud83c[\\udde6-\\uddff]){2}",_="[\\ud800-\\udbff][\\udc00-\\udfff]",P="["+d+"]",E="\\u200d",S="(?:"+v+"|"+w+")",T="(?:"+P+"|"+w+")",M="(?:['’](?:d|ll|m|re|s|t|ve))?",I="(?:['’](?:D|LL|M|RE|S|T|VE))?",j="(?:"+g+"|"+A+")?",C="["+h+"]?",B=C+j+"(?:"+E+"(?:"+[x,k,_].join("|")+")"+C+j+")*",O="(?:"+[b,k,_].join("|")+")"+B,R="(?:"+[x+g+"?",g,k,_,p].join("|")+")",N=RegExp("['’]","g"),F=RegExp(g,"g"),L=RegExp(A+"(?="+A+")|"+R+B,"g"),H=RegExp([P+"?"+v+"+"+M+"(?="+[m,P,"$"].join("|")+")",T+"+"+I+"(?="+[m,P+S,"$"].join("|")+")",P+"?"+S+"+"+M,P+"+"+I,y,O].join("|"),"g"),q=RegExp("["+E+o+s+u+h+"]"),D=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,U="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,z="object"==typeof self&&self&&self.Object===Object&&self,G=U||z||Function("return this")(),V=(r={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"ss"},function(e){return null==r?void 0:r[e]});function W(e){return q.test(e)}var K=Object.prototype.toString,Z=G.Symbol,Q=Z?Z.prototype:void 0,$=Q?Q.toString:void 0;function J(e){return null==e?"":function(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==K.call(e)}(e))return $?$.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}var Y,X=(Y=function(e,t,n){return t=t.toLowerCase(),e+(n?ee(J(t).toLowerCase()):t)},function(e){return function(e,t,n){for(var r=-1,i=e?e.length:0;++r<i;)n=t(n,e[r],r,e);return n}(function(e,t){return e=J(e),void 0===t?function(e){return D.test(e)}(e)?function(e){return e.match(H)||[]}(e):function(e){return e.match(i)||[]}(e):e.match(t)||[]}(function(e){return(e=J(e))&&e.replace(a,V).replace(F,"")}(e).replace(N,"")),Y,"")}),ee=function(e){var t,n,r,i,a=W(e=J(e))?function(e){return W(e)?function(e){return e.match(L)||[]}(e):function(e){return e.split("")}(e)}(e):void 0,o=a?a[0]:e.charAt(0),s=a?(t=a,n=1,i=t.length,r=void 0===r?i:r,!n&&r>=i?t:function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}(t,n,r)).join(""):e.slice(1);return o.toUpperCase()+s};e.exports=X},2287:(e,t,n)=>{"use strict";var r=n(7426),i=n(6166),a=n(6225),o=n(3349),s=r.sum32,u=r.sum32_4,c=r.sum32_5,l=a.ch32,d=a.maj32,h=a.s0_256,f=a.s1_256,p=a.g0_256,m=a.g1_256,g=i.BlockHash,y=[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];function b(){if(!(this instanceof b))return new b;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}r.inherits(b,g),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=u(m(n[r-2]),n[r-7],p(n[r-15]),n[r-16]);var i=this.h[0],a=this.h[1],g=this.h[2],y=this.h[3],b=this.h[4],v=this.h[5],w=this.h[6],A=this.h[7];for(o(this.k.length===n.length),r=0;r<n.length;r++){var x=c(A,f(b),l(b,v,w),this.k[r],n[r]),k=s(h(i),d(i,a,g));A=w,w=v,v=b,b=s(y,x),y=g,g=a,a=i,i=s(x,k)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],a),this.h[2]=s(this.h[2],g),this.h[3]=s(this.h[3],y),this.h[4]=s(this.h[4],b),this.h[5]=s(this.h[5],v),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],A)},b.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},2472:(e,t,n)=>{"use strict";Object.defineProperty(t,"y6",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"__",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"He",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"Ks",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"yO",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"tN",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"Zg",{enumerable:!0,get:function(){return c.default}});l(n(1527));var r=l(n(3822)),i=l(n(7462)),a=l(n(3283)),o=(l(n(493)),l(n(4328))),s=(l(n(5839)),l(n(3618))),u=l(n(7855)),c=(l(n(3378)),l(n(609)));function l(e){return e&&e.__esModule?e:{default:e}}},2543:function(e,t,n){var r;e=n.nmd(e),function(){var i,a="Expected a function",o="__lodash_hash_undefined__",s="__lodash_placeholder__",u=32,c=128,l=1/0,d=9007199254740991,h=NaN,f=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",u],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",y="[object Boolean]",b="[object Date]",v="[object Error]",w="[object Function]",A="[object GeneratorFunction]",x="[object Map]",k="[object Number]",_="[object Object]",P="[object Promise]",E="[object RegExp]",S="[object Set]",T="[object String]",M="[object Symbol]",I="[object WeakMap]",j="[object ArrayBuffer]",C="[object DataView]",B="[object Float32Array]",O="[object Float64Array]",R="[object Int8Array]",N="[object Int16Array]",F="[object Int32Array]",L="[object Uint8Array]",H="[object Uint8ClampedArray]",q="[object Uint16Array]",D="[object Uint32Array]",U=/\b__p \+= '';/g,z=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,V=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,K=RegExp(V.source),Z=RegExp(W.source),Q=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,ie=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,fe=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,be=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,we=/['\n\r\u2028\u2029\\]/g,Ae="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ke="\\u2700-\\u27bf",_e="a-z\\xdf-\\xf6\\xf8-\\xff",Pe="A-Z\\xc0-\\xd6\\xd8-\\xde",Ee="\\ufe0e\\ufe0f",Se="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Te="["+Ae+"]",Me="["+Se+"]",Ie="["+xe+"]",je="\\d+",Ce="["+ke+"]",Be="["+_e+"]",Oe="[^"+Ae+Se+je+ke+_e+Pe+"]",Re="\\ud83c[\\udffb-\\udfff]",Ne="[^"+Ae+"]",Fe="(?:\\ud83c[\\udde6-\\uddff]){2}",Le="[\\ud800-\\udbff][\\udc00-\\udfff]",He="["+Pe+"]",qe="\\u200d",De="(?:"+Be+"|"+Oe+")",Ue="(?:"+He+"|"+Oe+")",ze="(?:['’](?:d|ll|m|re|s|t|ve))?",Ge="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ve="(?:"+Ie+"|"+Re+")?",We="["+Ee+"]?",Ke=We+Ve+"(?:"+qe+"(?:"+[Ne,Fe,Le].join("|")+")"+We+Ve+")*",Ze="(?:"+[Ce,Fe,Le].join("|")+")"+Ke,Qe="(?:"+[Ne+Ie+"?",Ie,Fe,Le,Te].join("|")+")",$e=RegExp("['’]","g"),Je=RegExp(Ie,"g"),Ye=RegExp(Re+"(?="+Re+")|"+Qe+Ke,"g"),Xe=RegExp([He+"?"+Be+"+"+ze+"(?="+[Me,He,"$"].join("|")+")",Ue+"+"+Ge+"(?="+[Me,He+De,"$"].join("|")+")",He+"?"+De+"+"+ze,He+"+"+Ge,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",je,Ze].join("|"),"g"),et=RegExp("["+qe+Ae+xe+Ee+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,it={};it[B]=it[O]=it[R]=it[N]=it[F]=it[L]=it[H]=it[q]=it[D]=!0,it[m]=it[g]=it[j]=it[y]=it[C]=it[b]=it[v]=it[w]=it[x]=it[k]=it[_]=it[E]=it[S]=it[T]=it[I]=!1;var at={};at[m]=at[g]=at[j]=at[C]=at[y]=at[b]=at[B]=at[O]=at[R]=at[N]=at[F]=at[x]=at[k]=at[_]=at[E]=at[S]=at[T]=at[M]=at[L]=at[H]=at[q]=at[D]=!0,at[v]=at[w]=at[I]=!1;var ot={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,ut=parseInt,ct="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,lt="object"==typeof self&&self&&self.Object===Object&&self,dt=ct||lt||Function("return this")(),ht=t&&!t.nodeType&&t,ft=ht&&e&&!e.nodeType&&e,pt=ft&&ft.exports===ht,mt=pt&&ct.process,gt=function(){try{return ft&&ft.require&&ft.require("util").types||mt&&mt.binding&&mt.binding("util")}catch(e){}}(),yt=gt&&gt.isArrayBuffer,bt=gt&&gt.isDate,vt=gt&&gt.isMap,wt=gt&&gt.isRegExp,At=gt&&gt.isSet,xt=gt&&gt.isTypedArray;function kt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function _t(e,t,n,r){for(var i=-1,a=null==e?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function Pt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Et(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function St(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Tt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function Mt(e,t){return!(null==e||!e.length)&&Ht(e,t,0)>-1}function It(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function jt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Ct(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Bt(e,t,n,r){var i=-1,a=null==e?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function Ot(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Rt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Nt=zt("length");function Ft(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function Lt(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function Ht(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Lt(e,Dt,n)}function qt(e,t,n,r){for(var i=n-1,a=e.length;++i<a;)if(r(e[i],t))return i;return-1}function Dt(e){return e!=e}function Ut(e,t){var n=null==e?0:e.length;return n?Wt(e,t)/n:h}function zt(e){return function(t){return null==t?i:t[e]}}function Gt(e){return function(t){return null==e?i:e[t]}}function Vt(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function Wt(e,t){for(var n,r=-1,a=e.length;++r<a;){var o=t(e[r]);o!==i&&(n=n===i?o:n+o)}return n}function Kt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Zt(e){return e?e.slice(0,hn(e)+1).replace(re,""):e}function Qt(e){return function(t){return e(t)}}function $t(e,t){return jt(t,function(t){return e[t]})}function Jt(e,t){return e.has(t)}function Yt(e,t){for(var n=-1,r=e.length;++n<r&&Ht(t,e[n],0)>-1;);return n}function Xt(e,t){for(var n=e.length;n--&&Ht(t,e[n],0)>-1;);return n}var en=Gt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tn=Gt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function nn(e){return"\\"+ot[e]}function rn(e){return et.test(e)}function an(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function on(e,t){return function(n){return e(t(n))}}function sn(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n];o!==t&&o!==s||(e[n]=s,a[i++]=n)}return a}function un(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function cn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function ln(e){return rn(e)?function(e){for(var t=Ye.lastIndex=0;Ye.test(e);)++t;return t}(e):Nt(e)}function dn(e){return rn(e)?function(e){return e.match(Ye)||[]}(e):function(e){return e.split("")}(e)}function hn(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var fn=Gt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),pn=function e(t){var n,r=(t=null==t?dt:pn.defaults(dt.Object(),t,pn.pick(dt,nt))).Array,ie=t.Date,Ae=t.Error,xe=t.Function,ke=t.Math,_e=t.Object,Pe=t.RegExp,Ee=t.String,Se=t.TypeError,Te=r.prototype,Me=xe.prototype,Ie=_e.prototype,je=t["__core-js_shared__"],Ce=Me.toString,Be=Ie.hasOwnProperty,Oe=0,Re=(n=/[^.]+$/.exec(je&&je.keys&&je.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ne=Ie.toString,Fe=Ce.call(_e),Le=dt._,He=Pe("^"+Ce.call(Be).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qe=pt?t.Buffer:i,De=t.Symbol,Ue=t.Uint8Array,ze=qe?qe.allocUnsafe:i,Ge=on(_e.getPrototypeOf,_e),Ve=_e.create,We=Ie.propertyIsEnumerable,Ke=Te.splice,Ze=De?De.isConcatSpreadable:i,Qe=De?De.iterator:i,Ye=De?De.toStringTag:i,et=function(){try{var e=ua(_e,"defineProperty");return e({},"",{}),e}catch(e){}}(),ot=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ct=ie&&ie.now!==dt.Date.now&&ie.now,lt=t.setTimeout!==dt.setTimeout&&t.setTimeout,ht=ke.ceil,ft=ke.floor,mt=_e.getOwnPropertySymbols,gt=qe?qe.isBuffer:i,Nt=t.isFinite,Gt=Te.join,mn=on(_e.keys,_e),gn=ke.max,yn=ke.min,bn=ie.now,vn=t.parseInt,wn=ke.random,An=Te.reverse,xn=ua(t,"DataView"),kn=ua(t,"Map"),_n=ua(t,"Promise"),Pn=ua(t,"Set"),En=ua(t,"WeakMap"),Sn=ua(_e,"create"),Tn=En&&new En,Mn={},In=Na(xn),jn=Na(kn),Cn=Na(_n),Bn=Na(Pn),On=Na(En),Rn=De?De.prototype:i,Nn=Rn?Rn.valueOf:i,Fn=Rn?Rn.toString:i;function Ln(e){if(es(e)&&!zo(e)&&!(e instanceof Un)){if(e instanceof Dn)return e;if(Be.call(e,"__wrapped__"))return Fa(e)}return new Dn(e)}var Hn=function(){function e(){}return function(t){if(!Xo(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function qn(){}function Dn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Un(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function zn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Vn;++t<n;)this.add(e[t])}function Kn(e){var t=this.__data__=new Gn(e);this.size=t.size}function Zn(e,t){var n=zo(e),r=!n&&Uo(e),i=!n&&!r&&Ko(e),a=!n&&!r&&!i&&us(e),o=n||r||i||a,s=o?Kt(e.length,Ee):[],u=s.length;for(var c in e)!t&&!Be.call(e,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ma(c,u))||s.push(c);return s}function Qn(e){var t=e.length;return t?e[Vr(0,t-1)]:i}function $n(e,t){return ja(Ei(e),ar(t,0,e.length))}function Jn(e){return ja(Ei(e))}function Yn(e,t,n){(n!==i&&!Ho(e[t],n)||n===i&&!(t in e))&&rr(e,t,n)}function Xn(e,t,n){var r=e[t];Be.call(e,t)&&Ho(r,n)&&(n!==i||t in e)||rr(e,t,n)}function er(e,t){for(var n=e.length;n--;)if(Ho(e[n][0],t))return n;return-1}function tr(e,t,n,r){return lr(e,function(e,i,a){t(r,e,n(e),a)}),r}function nr(e,t){return e&&Si(t,Is(t),e)}function rr(e,t,n){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ir(e,t){for(var n=-1,a=t.length,o=r(a),s=null==e;++n<a;)o[n]=s?i:Ps(e,t[n]);return o}function ar(e,t,n){return e==e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function or(e,t,n,r,a,o){var s,u=1&t,c=2&t,l=4&t;if(n&&(s=a?n(e,r,a,o):n(e)),s!==i)return s;if(!Xo(e))return e;var d=zo(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Be.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!u)return Ei(e,s)}else{var h=da(e),f=h==w||h==A;if(Ko(e))return wi(e,u);if(h==_||h==m||f&&!a){if(s=c||f?{}:fa(e),!u)return c?function(e,t){return Si(e,la(e),t)}(e,function(e,t){return e&&Si(t,js(t),e)}(s,e)):function(e,t){return Si(e,ca(e),t)}(e,nr(s,e))}else{if(!at[h])return a?e:{};s=function(e,t,n){var r,i=e.constructor;switch(t){case j:return Ai(e);case y:case b:return new i(+e);case C:return function(e,t){var n=t?Ai(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case B:case O:case R:case N:case F:case L:case H:case q:case D:return xi(e,n);case x:return new i;case k:case T:return new i(e);case E:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case S:return new i;case M:return r=e,Nn?_e(Nn.call(r)):{}}}(e,h,u)}}o||(o=new Kn);var p=o.get(e);if(p)return p;o.set(e,s),as(e)?e.forEach(function(r){s.add(or(r,t,n,r,e,o))}):ts(e)&&e.forEach(function(r,i){s.set(i,or(r,t,n,i,e,o))});var g=d?i:(l?c?ta:ea:c?js:Is)(e);return Pt(g||e,function(r,i){g&&(r=e[i=r]),Xn(s,i,or(r,t,n,i,e,o))}),s}function sr(e,t,n){var r=n.length;if(null==e)return!r;for(e=_e(e);r--;){var a=n[r],o=t[a],s=e[a];if(s===i&&!(a in e)||!o(s))return!1}return!0}function ur(e,t,n){if("function"!=typeof e)throw new Se(a);return Sa(function(){e.apply(i,n)},t)}function cr(e,t,n,r){var i=-1,a=Mt,o=!0,s=e.length,u=[],c=t.length;if(!s)return u;n&&(t=jt(t,Qt(n))),r?(a=It,o=!1):t.length>=200&&(a=Jt,o=!1,t=new Wn(t));e:for(;++i<s;){var l=e[i],d=null==n?l:n(l);if(l=r||0!==l?l:0,o&&d==d){for(var h=c;h--;)if(t[h]===d)continue e;u.push(l)}else a(t,d,r)||u.push(l)}return u}Ln.templateSettings={escape:Q,evaluate:$,interpolate:J,variable:"",imports:{_:Ln}},Ln.prototype=qn.prototype,Ln.prototype.constructor=Ln,Dn.prototype=Hn(qn.prototype),Dn.prototype.constructor=Dn,Un.prototype=Hn(qn.prototype),Un.prototype.constructor=Un,zn.prototype.clear=function(){this.__data__=Sn?Sn(null):{},this.size=0},zn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},zn.prototype.get=function(e){var t=this.__data__;if(Sn){var n=t[e];return n===o?i:n}return Be.call(t,e)?t[e]:i},zn.prototype.has=function(e){var t=this.__data__;return Sn?t[e]!==i:Be.call(t,e)},zn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Sn&&t===i?o:t,this},Gn.prototype.clear=function(){this.__data__=[],this.size=0},Gn.prototype.delete=function(e){var t=this.__data__,n=er(t,e);return!(n<0||(n==t.length-1?t.pop():Ke.call(t,n,1),--this.size,0))},Gn.prototype.get=function(e){var t=this.__data__,n=er(t,e);return n<0?i:t[n][1]},Gn.prototype.has=function(e){return er(this.__data__,e)>-1},Gn.prototype.set=function(e,t){var n=this.__data__,r=er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Vn.prototype.clear=function(){this.size=0,this.__data__={hash:new zn,map:new(kn||Gn),string:new zn}},Vn.prototype.delete=function(e){var t=oa(this,e).delete(e);return this.size-=t?1:0,t},Vn.prototype.get=function(e){return oa(this,e).get(e)},Vn.prototype.has=function(e){return oa(this,e).has(e)},Vn.prototype.set=function(e,t){var n=oa(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Wn.prototype.add=Wn.prototype.push=function(e){return this.__data__.set(e,o),this},Wn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.clear=function(){this.__data__=new Gn,this.size=0},Kn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Kn.prototype.get=function(e){return this.__data__.get(e)},Kn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Gn){var r=n.__data__;if(!kn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Vn(r)}return n.set(e,t),this.size=n.size,this};var lr=Ii(br),dr=Ii(vr,!0);function hr(e,t){var n=!0;return lr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function fr(e,t,n){for(var r=-1,a=e.length;++r<a;){var o=e[r],s=t(o);if(null!=s&&(u===i?s==s&&!ss(s):n(s,u)))var u=s,c=o}return c}function pr(e,t){var n=[];return lr(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function mr(e,t,n,r,i){var a=-1,o=e.length;for(n||(n=pa),i||(i=[]);++a<o;){var s=e[a];t>0&&n(s)?t>1?mr(s,t-1,n,r,i):Ct(i,s):r||(i[i.length]=s)}return i}var gr=ji(),yr=ji(!0);function br(e,t){return e&&gr(e,t,Is)}function vr(e,t){return e&&yr(e,t,Is)}function wr(e,t){return Tt(t,function(t){return $o(e[t])})}function Ar(e,t){for(var n=0,r=(t=gi(t,e)).length;null!=e&&n<r;)e=e[Ra(t[n++])];return n&&n==r?e:i}function xr(e,t,n){var r=t(e);return zo(e)?r:Ct(r,n(e))}function kr(e){return null==e?e===i?"[object Undefined]":"[object Null]":Ye&&Ye in _e(e)?function(e){var t=Be.call(e,Ye),n=e[Ye];try{e[Ye]=i;var r=!0}catch(e){}var a=Ne.call(e);return r&&(t?e[Ye]=n:delete e[Ye]),a}(e):function(e){return Ne.call(e)}(e)}function _r(e,t){return e>t}function Pr(e,t){return null!=e&&Be.call(e,t)}function Er(e,t){return null!=e&&t in _e(e)}function Sr(e,t,n){for(var a=n?It:Mt,o=e[0].length,s=e.length,u=s,c=r(s),l=1/0,d=[];u--;){var h=e[u];u&&t&&(h=jt(h,Qt(t))),l=yn(h.length,l),c[u]=!n&&(t||o>=120&&h.length>=120)?new Wn(u&&h):i}h=e[0];var f=-1,p=c[0];e:for(;++f<o&&d.length<l;){var m=h[f],g=t?t(m):m;if(m=n||0!==m?m:0,!(p?Jt(p,g):a(d,g,n))){for(u=s;--u;){var y=c[u];if(!(y?Jt(y,g):a(e[u],g,n)))continue e}p&&p.push(g),d.push(m)}}return d}function Tr(e,t,n){var r=null==(e=_a(e,t=gi(t,e)))?e:e[Ra(Za(t))];return null==r?i:kt(r,e,n)}function Mr(e){return es(e)&&kr(e)==m}function Ir(e,t,n,r,a){return e===t||(null==e||null==t||!es(e)&&!es(t)?e!=e&&t!=t:function(e,t,n,r,a,o){var s=zo(e),u=zo(t),c=s?g:da(e),l=u?g:da(t),d=(c=c==m?_:c)==_,h=(l=l==m?_:l)==_,f=c==l;if(f&&Ko(e)){if(!Ko(t))return!1;s=!0,d=!1}if(f&&!d)return o||(o=new Kn),s||us(e)?Yi(e,t,n,r,a,o):function(e,t,n,r,i,a,o){switch(n){case C:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case j:return!(e.byteLength!=t.byteLength||!a(new Ue(e),new Ue(t)));case y:case b:case k:return Ho(+e,+t);case v:return e.name==t.name&&e.message==t.message;case E:case T:return e==t+"";case x:var s=an;case S:var u=1&r;if(s||(s=un),e.size!=t.size&&!u)return!1;var c=o.get(e);if(c)return c==t;r|=2,o.set(e,t);var l=Yi(s(e),s(t),r,i,a,o);return o.delete(e),l;case M:if(Nn)return Nn.call(e)==Nn.call(t)}return!1}(e,t,c,n,r,a,o);if(!(1&n)){var p=d&&Be.call(e,"__wrapped__"),w=h&&Be.call(t,"__wrapped__");if(p||w){var A=p?e.value():e,P=w?t.value():t;return o||(o=new Kn),a(A,P,n,r,o)}}return!!f&&(o||(o=new Kn),function(e,t,n,r,a,o){var s=1&n,u=ea(e),c=u.length;if(c!=ea(t).length&&!s)return!1;for(var l=c;l--;){var d=u[l];if(!(s?d in t:Be.call(t,d)))return!1}var h=o.get(e),f=o.get(t);if(h&&f)return h==t&&f==e;var p=!0;o.set(e,t),o.set(t,e);for(var m=s;++l<c;){var g=e[d=u[l]],y=t[d];if(r)var b=s?r(y,g,d,t,e,o):r(g,y,d,e,t,o);if(!(b===i?g===y||a(g,y,n,r,o):b)){p=!1;break}m||(m="constructor"==d)}if(p&&!m){var v=e.constructor,w=t.constructor;v==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof w&&w instanceof w||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,n,r,a,o))}(e,t,n,r,Ir,a))}function jr(e,t,n,r){var a=n.length,o=a,s=!r;if(null==e)return!o;for(e=_e(e);a--;){var u=n[a];if(s&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a<o;){var c=(u=n[a])[0],l=e[c],d=u[1];if(s&&u[2]){if(l===i&&!(c in e))return!1}else{var h=new Kn;if(r)var f=r(l,d,c,e,t,h);if(!(f===i?Ir(d,l,3,r,h):f))return!1}}return!0}function Cr(e){return!(!Xo(e)||(t=e,Re&&Re in t))&&($o(e)?He:me).test(Na(e));var t}function Br(e){return"function"==typeof e?e:null==e?nu:"object"==typeof e?zo(e)?Lr(e[0],e[1]):Fr(e):du(e)}function Or(e){if(!wa(e))return mn(e);var t=[];for(var n in _e(e))Be.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Rr(e,t){return e<t}function Nr(e,t){var n=-1,i=Vo(e)?r(e.length):[];return lr(e,function(e,r,a){i[++n]=t(e,r,a)}),i}function Fr(e){var t=sa(e);return 1==t.length&&t[0][2]?xa(t[0][0],t[0][1]):function(n){return n===e||jr(n,e,t)}}function Lr(e,t){return ya(e)&&Aa(t)?xa(Ra(e),t):function(n){var r=Ps(n,e);return r===i&&r===t?Es(n,e):Ir(t,r,3)}}function Hr(e,t,n,r,a){e!==t&&gr(t,function(o,s){if(a||(a=new Kn),Xo(o))!function(e,t,n,r,a,o,s){var u=Pa(e,n),c=Pa(t,n),l=s.get(c);if(l)Yn(e,n,l);else{var d=o?o(u,c,n+"",e,t,s):i,h=d===i;if(h){var f=zo(c),p=!f&&Ko(c),m=!f&&!p&&us(c);d=c,f||p||m?zo(u)?d=u:Wo(u)?d=Ei(u):p?(h=!1,d=wi(c,!0)):m?(h=!1,d=xi(c,!0)):d=[]:rs(c)||Uo(c)?(d=u,Uo(u)?d=gs(u):Xo(u)&&!$o(u)||(d=fa(c))):h=!1}h&&(s.set(c,d),a(d,c,r,o,s),s.delete(c)),Yn(e,n,d)}}(e,t,s,n,Hr,r,a);else{var u=r?r(Pa(e,s),o,s+"",e,t,a):i;u===i&&(u=o),Yn(e,s,u)}},js)}function qr(e,t){var n=e.length;if(n)return ma(t+=t<0?n:0,n)?e[t]:i}function Dr(e,t,n){t=t.length?jt(t,function(e){return zo(e)?function(t){return Ar(t,1===e.length?e[0]:e)}:e}):[nu];var r=-1;t=jt(t,Qt(aa()));var i=Nr(e,function(e,n,i){var a=jt(t,function(t){return t(e)});return{criteria:a,index:++r,value:e}});return function(e){var t=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var u=ki(i[r],a[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});t--;)e[t]=e[t].value;return e}(i)}function Ur(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=Ar(e,o);n(s,o)&&$r(a,gi(o,e),s)}return a}function zr(e,t,n,r){var i=r?qt:Ht,a=-1,o=t.length,s=e;for(e===t&&(t=Ei(t)),n&&(s=jt(e,Qt(n)));++a<o;)for(var u=0,c=t[a],l=n?n(c):c;(u=i(s,l,u,r))>-1;)s!==e&&Ke.call(s,u,1),Ke.call(e,u,1);return e}function Gr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;ma(i)?Ke.call(e,i,1):ui(e,i)}}return e}function Vr(e,t){return e+ft(wn()*(t-e+1))}function Wr(e,t){var n="";if(!e||t<1||t>d)return n;do{t%2&&(n+=e),(t=ft(t/2))&&(e+=e)}while(t);return n}function Kr(e,t){return Ta(ka(e,t,nu),e+"")}function Zr(e){return Qn(Hs(e))}function Qr(e,t){var n=Hs(e);return ja(n,ar(t,0,n.length))}function $r(e,t,n,r){if(!Xo(e))return e;for(var a=-1,o=(t=gi(t,e)).length,s=o-1,u=e;null!=u&&++a<o;){var c=Ra(t[a]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(a!=s){var d=u[c];(l=r?r(d,c,u):i)===i&&(l=Xo(d)?d:ma(t[a+1])?[]:{})}Xn(u,c,l),u=u[c]}return e}var Jr=Tn?function(e,t){return Tn.set(e,t),e}:nu,Yr=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:Xs(t),writable:!0})}:nu;function Xr(e){return ja(Hs(e))}function ei(e,t,n){var i=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var o=r(a);++i<a;)o[i]=e[i+t];return o}function ti(e,t){var n;return lr(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function ni(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var a=r+i>>>1,o=e[a];null!==o&&!ss(o)&&(n?o<=t:o<t)?r=a+1:i=a}return i}return ri(e,t,nu,n)}function ri(e,t,n,r){var a=0,o=null==e?0:e.length;if(0===o)return 0;for(var s=(t=n(t))!=t,u=null===t,c=ss(t),l=t===i;a<o;){var d=ft((a+o)/2),h=n(e[d]),f=h!==i,p=null===h,m=h==h,g=ss(h);if(s)var y=r||m;else y=l?m&&(r||f):u?m&&f&&(r||!p):c?m&&f&&!p&&(r||!g):!p&&!g&&(r?h<=t:h<t);y?a=d+1:o=d}return yn(o,4294967294)}function ii(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n],s=t?t(o):o;if(!n||!Ho(s,u)){var u=s;a[i++]=0===o?0:o}}return a}function ai(e){return"number"==typeof e?e:ss(e)?h:+e}function oi(e){if("string"==typeof e)return e;if(zo(e))return jt(e,oi)+"";if(ss(e))return Fn?Fn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function si(e,t,n){var r=-1,i=Mt,a=e.length,o=!0,s=[],u=s;if(n)o=!1,i=It;else if(a>=200){var c=t?null:Wi(e);if(c)return un(c);o=!1,i=Jt,u=new Wn}else u=t?[]:s;e:for(;++r<a;){var l=e[r],d=t?t(l):l;if(l=n||0!==l?l:0,o&&d==d){for(var h=u.length;h--;)if(u[h]===d)continue e;t&&u.push(d),s.push(l)}else i(u,d,n)||(u!==s&&u.push(d),s.push(l))}return s}function ui(e,t){return null==(e=_a(e,t=gi(t,e)))||delete e[Ra(Za(t))]}function ci(e,t,n,r){return $r(e,t,n(Ar(e,t)),r)}function li(e,t,n,r){for(var i=e.length,a=r?i:-1;(r?a--:++a<i)&&t(e[a],a,e););return n?ei(e,r?0:a,r?a+1:i):ei(e,r?a+1:0,r?i:a)}function di(e,t){var n=e;return n instanceof Un&&(n=n.value()),Bt(t,function(e,t){return t.func.apply(t.thisArg,Ct([e],t.args))},n)}function hi(e,t,n){var i=e.length;if(i<2)return i?si(e[0]):[];for(var a=-1,o=r(i);++a<i;)for(var s=e[a],u=-1;++u<i;)u!=a&&(o[a]=cr(o[a]||s,e[u],t,n));return si(mr(o,1),t,n)}function fi(e,t,n){for(var r=-1,a=e.length,o=t.length,s={};++r<a;){var u=r<o?t[r]:i;n(s,e[r],u)}return s}function pi(e){return Wo(e)?e:[]}function mi(e){return"function"==typeof e?e:nu}function gi(e,t){return zo(e)?e:ya(e,t)?[e]:Oa(ys(e))}var yi=Kr;function bi(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:ei(e,t,n)}var vi=ot||function(e){return dt.clearTimeout(e)};function wi(e,t){if(t)return e.slice();var n=e.length,r=ze?ze(n):new e.constructor(n);return e.copy(r),r}function Ai(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function xi(e,t){var n=t?Ai(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function ki(e,t){if(e!==t){var n=e!==i,r=null===e,a=e==e,o=ss(e),s=t!==i,u=null===t,c=t==t,l=ss(t);if(!u&&!l&&!o&&e>t||o&&s&&c&&!u&&!l||r&&s&&c||!n&&c||!a)return 1;if(!r&&!o&&!l&&e<t||l&&n&&a&&!r&&!o||u&&n&&a||!s&&a||!c)return-1}return 0}function _i(e,t,n,i){for(var a=-1,o=e.length,s=n.length,u=-1,c=t.length,l=gn(o-s,0),d=r(c+l),h=!i;++u<c;)d[u]=t[u];for(;++a<s;)(h||a<o)&&(d[n[a]]=e[a]);for(;l--;)d[u++]=e[a++];return d}function Pi(e,t,n,i){for(var a=-1,o=e.length,s=-1,u=n.length,c=-1,l=t.length,d=gn(o-u,0),h=r(d+l),f=!i;++a<d;)h[a]=e[a];for(var p=a;++c<l;)h[p+c]=t[c];for(;++s<u;)(f||a<o)&&(h[p+n[s]]=e[a++]);return h}function Ei(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function Si(e,t,n,r){var a=!n;n||(n={});for(var o=-1,s=t.length;++o<s;){var u=t[o],c=r?r(n[u],e[u],u,n,e):i;c===i&&(c=e[u]),a?rr(n,u,c):Xn(n,u,c)}return n}function Ti(e,t){return function(n,r){var i=zo(n)?_t:tr,a=t?t():{};return i(n,e,aa(r,2),a)}}function Mi(e){return Kr(function(t,n){var r=-1,a=n.length,o=a>1?n[a-1]:i,s=a>2?n[2]:i;for(o=e.length>3&&"function"==typeof o?(a--,o):i,s&&ga(n[0],n[1],s)&&(o=a<3?i:o,a=1),t=_e(t);++r<a;){var u=n[r];u&&e(t,u,r,o)}return t})}function Ii(e,t){return function(n,r){if(null==n)return n;if(!Vo(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=_e(n);(t?a--:++a<i)&&!1!==r(o[a],a,o););return n}}function ji(e){return function(t,n,r){for(var i=-1,a=_e(t),o=r(t),s=o.length;s--;){var u=o[e?s:++i];if(!1===n(a[u],u,a))break}return t}}function Ci(e){return function(t){var n=rn(t=ys(t))?dn(t):i,r=n?n[0]:t.charAt(0),a=n?bi(n,1).join(""):t.slice(1);return r[e]()+a}}function Bi(e){return function(t){return Bt($s(Us(t).replace($e,"")),e,"")}}function Oi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Hn(e.prototype),r=e.apply(n,t);return Xo(r)?r:n}}function Ri(e){return function(t,n,r){var a=_e(t);if(!Vo(t)){var o=aa(n,3);t=Is(t),n=function(e){return o(a[e],e,a)}}var s=e(t,n,r);return s>-1?a[o?t[s]:s]:i}}function Ni(e){return Xi(function(t){var n=t.length,r=n,o=Dn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new Se(a);if(o&&!u&&"wrapper"==ra(s))var u=new Dn([],!0)}for(r=u?r:n;++r<n;){var c=ra(s=t[r]),l="wrapper"==c?na(s):i;u=l&&ba(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?u[ra(l[0])].apply(u,l[3]):1==s.length&&ba(s)?u[c]():u.thru(s)}return function(){var e=arguments,r=e[0];if(u&&1==e.length&&zo(r))return u.plant(r).value();for(var i=0,a=n?t[i].apply(this,e):r;++i<n;)a=t[i].call(this,a);return a}})}function Fi(e,t,n,a,o,s,u,l,d,h){var f=t&c,p=1&t,m=2&t,g=24&t,y=512&t,b=m?i:Oi(e);return function c(){for(var v=arguments.length,w=r(v),A=v;A--;)w[A]=arguments[A];if(g)var x=ia(c),k=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(w,x);if(a&&(w=_i(w,a,o,g)),s&&(w=Pi(w,s,u,g)),v-=k,g&&v<h){var _=sn(w,x);return Gi(e,t,Fi,c.placeholder,n,w,_,l,d,h-v)}var P=p?n:this,E=m?P[e]:e;return v=w.length,l?w=function(e,t){for(var n=e.length,r=yn(t.length,n),a=Ei(e);r--;){var o=t[r];e[r]=ma(o,n)?a[o]:i}return e}(w,l):y&&v>1&&w.reverse(),f&&d<v&&(w.length=d),this&&this!==dt&&this instanceof c&&(E=b||Oi(E)),E.apply(P,w)}}function Li(e,t){return function(n,r){return function(e,t,n,r){return br(e,function(e,i,a){t(r,n(e),i,a)}),r}(n,e,t(r),{})}}function Hi(e,t){return function(n,r){var a;if(n===i&&r===i)return t;if(n!==i&&(a=n),r!==i){if(a===i)return r;"string"==typeof n||"string"==typeof r?(n=oi(n),r=oi(r)):(n=ai(n),r=ai(r)),a=e(n,r)}return a}}function qi(e){return Xi(function(t){return t=jt(t,Qt(aa())),Kr(function(n){var r=this;return e(t,function(e){return kt(e,r,n)})})})}function Di(e,t){var n=(t=t===i?" ":oi(t)).length;if(n<2)return n?Wr(t,e):t;var r=Wr(t,ht(e/ln(t)));return rn(t)?bi(dn(r),0,e).join(""):r.slice(0,e)}function Ui(e){return function(t,n,a){return a&&"number"!=typeof a&&ga(t,n,a)&&(n=a=i),t=hs(t),n===i?(n=t,t=0):n=hs(n),function(e,t,n,i){for(var a=-1,o=gn(ht((t-e)/(n||1)),0),s=r(o);o--;)s[i?o:++a]=e,e+=n;return s}(t,n,a=a===i?t<n?1:-1:hs(a),e)}}function zi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ms(t),n=ms(n)),e(t,n)}}function Gi(e,t,n,r,a,o,s,c,l,d){var h=8&t;t|=h?u:64,4&(t&=~(h?64:u))||(t&=-4);var f=[e,t,a,h?o:i,h?s:i,h?i:o,h?i:s,c,l,d],p=n.apply(i,f);return ba(e)&&Ea(p,f),p.placeholder=r,Ma(p,e,t)}function Vi(e){var t=ke[e];return function(e,n){if(e=ms(e),(n=null==n?0:yn(fs(n),292))&&Nt(e)){var r=(ys(e)+"e").split("e");return+((r=(ys(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Wi=Pn&&1/un(new Pn([,-0]))[1]==l?function(e){return new Pn(e)}:su;function Ki(e){return function(t){var n=da(t);return n==x?an(t):n==S?cn(t):function(e,t){return jt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Zi(e,t,n,o,l,d,h,f){var p=2&t;if(!p&&"function"!=typeof e)throw new Se(a);var m=o?o.length:0;if(m||(t&=-97,o=l=i),h=h===i?h:gn(fs(h),0),f=f===i?f:fs(f),m-=l?l.length:0,64&t){var g=o,y=l;o=l=i}var b=p?i:na(e),v=[e,t,n,o,l,g,y,d,h,f];if(b&&function(e,t){var n=e[1],r=t[1],i=n|r,a=i<131,o=r==c&&8==n||r==c&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!a&&!o)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var u=t[3];if(u){var l=e[3];e[3]=l?_i(l,u,t[4]):u,e[4]=l?sn(e[3],s):t[4]}(u=t[5])&&(l=e[5],e[5]=l?Pi(l,u,t[6]):u,e[6]=l?sn(e[5],s):t[6]),(u=t[7])&&(e[7]=u),r&c&&(e[8]=null==e[8]?t[8]:yn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(v,b),e=v[0],t=v[1],n=v[2],o=v[3],l=v[4],!(f=v[9]=v[9]===i?p?0:e.length:gn(v[9]-m,0))&&24&t&&(t&=-25),t&&1!=t)w=8==t||16==t?function(e,t,n){var a=Oi(e);return function o(){for(var s=arguments.length,u=r(s),c=s,l=ia(o);c--;)u[c]=arguments[c];var d=s<3&&u[0]!==l&&u[s-1]!==l?[]:sn(u,l);return(s-=d.length)<n?Gi(e,t,Fi,o.placeholder,i,u,d,i,i,n-s):kt(this&&this!==dt&&this instanceof o?a:e,this,u)}}(e,t,f):t!=u&&33!=t||l.length?Fi.apply(i,v):function(e,t,n,i){var a=1&t,o=Oi(e);return function t(){for(var s=-1,u=arguments.length,c=-1,l=i.length,d=r(l+u),h=this&&this!==dt&&this instanceof t?o:e;++c<l;)d[c]=i[c];for(;u--;)d[c++]=arguments[++s];return kt(h,a?n:this,d)}}(e,t,n,o);else var w=function(e,t,n){var r=1&t,i=Oi(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,n);return Ma((b?Jr:Ea)(w,v),e,t)}function Qi(e,t,n,r){return e===i||Ho(e,Ie[n])&&!Be.call(r,n)?t:e}function $i(e,t,n,r,a,o){return Xo(e)&&Xo(t)&&(o.set(t,e),Hr(e,t,i,$i,o),o.delete(t)),e}function Ji(e){return rs(e)?i:e}function Yi(e,t,n,r,a,o){var s=1&n,u=e.length,c=t.length;if(u!=c&&!(s&&c>u))return!1;var l=o.get(e),d=o.get(t);if(l&&d)return l==t&&d==e;var h=-1,f=!0,p=2&n?new Wn:i;for(o.set(e,t),o.set(t,e);++h<u;){var m=e[h],g=t[h];if(r)var y=s?r(g,m,h,t,e,o):r(m,g,h,e,t,o);if(y!==i){if(y)continue;f=!1;break}if(p){if(!Rt(t,function(e,t){if(!Jt(p,t)&&(m===e||a(m,e,n,r,o)))return p.push(t)})){f=!1;break}}else if(m!==g&&!a(m,g,n,r,o)){f=!1;break}}return o.delete(e),o.delete(t),f}function Xi(e){return Ta(ka(e,i,za),e+"")}function ea(e){return xr(e,Is,ca)}function ta(e){return xr(e,js,la)}var na=Tn?function(e){return Tn.get(e)}:su;function ra(e){for(var t=e.name+"",n=Mn[t],r=Be.call(Mn,t)?n.length:0;r--;){var i=n[r],a=i.func;if(null==a||a==e)return i.name}return t}function ia(e){return(Be.call(Ln,"placeholder")?Ln:e).placeholder}function aa(){var e=Ln.iteratee||ru;return e=e===ru?Br:e,arguments.length?e(arguments[0],arguments[1]):e}function oa(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function sa(e){for(var t=Is(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Aa(i)]}return t}function ua(e,t){var n=function(e,t){return null==e?i:e[t]}(e,t);return Cr(n)?n:i}var ca=mt?function(e){return null==e?[]:(e=_e(e),Tt(mt(e),function(t){return We.call(e,t)}))}:pu,la=mt?function(e){for(var t=[];e;)Ct(t,ca(e)),e=Ge(e);return t}:pu,da=kr;function ha(e,t,n){for(var r=-1,i=(t=gi(t,e)).length,a=!1;++r<i;){var o=Ra(t[r]);if(!(a=null!=e&&n(e,o)))break;e=e[o]}return a||++r!=i?a:!!(i=null==e?0:e.length)&&Yo(i)&&ma(o,i)&&(zo(e)||Uo(e))}function fa(e){return"function"!=typeof e.constructor||wa(e)?{}:Hn(Ge(e))}function pa(e){return zo(e)||Uo(e)||!!(Ze&&e&&e[Ze])}function ma(e,t){var n=typeof e;return!!(t=null==t?d:t)&&("number"==n||"symbol"!=n&&ye.test(e))&&e>-1&&e%1==0&&e<t}function ga(e,t,n){if(!Xo(n))return!1;var r=typeof t;return!!("number"==r?Vo(n)&&ma(t,n.length):"string"==r&&t in n)&&Ho(n[t],e)}function ya(e,t){if(zo(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ss(e))||X.test(e)||!Y.test(e)||null!=t&&e in _e(t)}function ba(e){var t=ra(e),n=Ln[t];if("function"!=typeof n||!(t in Un.prototype))return!1;if(e===n)return!0;var r=na(n);return!!r&&e===r[0]}(xn&&da(new xn(new ArrayBuffer(1)))!=C||kn&&da(new kn)!=x||_n&&da(_n.resolve())!=P||Pn&&da(new Pn)!=S||En&&da(new En)!=I)&&(da=function(e){var t=kr(e),n=t==_?e.constructor:i,r=n?Na(n):"";if(r)switch(r){case In:return C;case jn:return x;case Cn:return P;case Bn:return S;case On:return I}return t});var va=je?$o:mu;function wa(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ie)}function Aa(e){return e==e&&!Xo(e)}function xa(e,t){return function(n){return null!=n&&n[e]===t&&(t!==i||e in _e(n))}}function ka(e,t,n){return t=gn(t===i?e.length-1:t,0),function(){for(var i=arguments,a=-1,o=gn(i.length-t,0),s=r(o);++a<o;)s[a]=i[t+a];a=-1;for(var u=r(t+1);++a<t;)u[a]=i[a];return u[t]=n(s),kt(e,this,u)}}function _a(e,t){return t.length<2?e:Ar(e,ei(t,0,-1))}function Pa(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ea=Ia(Jr),Sa=lt||function(e,t){return dt.setTimeout(e,t)},Ta=Ia(Yr);function Ma(e,t,n){var r=t+"";return Ta(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Pt(p,function(n){var r="_."+n[0];t&n[1]&&!Mt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(se):[]}(r),n)))}function Ia(e){var t=0,n=0;return function(){var r=bn(),a=16-(r-n);if(n=r,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function ja(e,t){var n=-1,r=e.length,a=r-1;for(t=t===i?r:t;++n<t;){var o=Vr(n,a),s=e[o];e[o]=e[n],e[n]=s}return e.length=t,e}var Ca,Ba,Oa=(Ca=Bo(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,function(e,n,r,i){t.push(r?i.replace(le,"$1"):n||e)}),t},function(e){return 500===Ba.size&&Ba.clear(),e}),Ba=Ca.cache,Ca);function Ra(e){if("string"==typeof e||ss(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Na(e){if(null!=e){try{return Ce.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Fa(e){if(e instanceof Un)return e.clone();var t=new Dn(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var La=Kr(function(e,t){return Wo(e)?cr(e,mr(t,1,Wo,!0)):[]}),Ha=Kr(function(e,t){var n=Za(t);return Wo(n)&&(n=i),Wo(e)?cr(e,mr(t,1,Wo,!0),aa(n,2)):[]}),qa=Kr(function(e,t){var n=Za(t);return Wo(n)&&(n=i),Wo(e)?cr(e,mr(t,1,Wo,!0),i,n):[]});function Da(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:fs(n);return i<0&&(i=gn(r+i,0)),Lt(e,aa(t,3),i)}function Ua(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var a=r-1;return n!==i&&(a=fs(n),a=n<0?gn(r+a,0):yn(a,r-1)),Lt(e,aa(t,3),a,!0)}function za(e){return null!=e&&e.length?mr(e,1):[]}function Ga(e){return e&&e.length?e[0]:i}var Va=Kr(function(e){var t=jt(e,pi);return t.length&&t[0]===e[0]?Sr(t):[]}),Wa=Kr(function(e){var t=Za(e),n=jt(e,pi);return t===Za(n)?t=i:n.pop(),n.length&&n[0]===e[0]?Sr(n,aa(t,2)):[]}),Ka=Kr(function(e){var t=Za(e),n=jt(e,pi);return(t="function"==typeof t?t:i)&&n.pop(),n.length&&n[0]===e[0]?Sr(n,i,t):[]});function Za(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Qa=Kr($a);function $a(e,t){return e&&e.length&&t&&t.length?zr(e,t):e}var Ja=Xi(function(e,t){var n=null==e?0:e.length,r=ir(e,t);return Gr(e,jt(t,function(e){return ma(e,n)?+e:e}).sort(ki)),r});function Ya(e){return null==e?e:An.call(e)}var Xa=Kr(function(e){return si(mr(e,1,Wo,!0))}),eo=Kr(function(e){var t=Za(e);return Wo(t)&&(t=i),si(mr(e,1,Wo,!0),aa(t,2))}),to=Kr(function(e){var t=Za(e);return t="function"==typeof t?t:i,si(mr(e,1,Wo,!0),i,t)});function no(e){if(!e||!e.length)return[];var t=0;return e=Tt(e,function(e){if(Wo(e))return t=gn(e.length,t),!0}),Kt(t,function(t){return jt(e,zt(t))})}function ro(e,t){if(!e||!e.length)return[];var n=no(e);return null==t?n:jt(n,function(e){return kt(t,i,e)})}var io=Kr(function(e,t){return Wo(e)?cr(e,t):[]}),ao=Kr(function(e){return hi(Tt(e,Wo))}),oo=Kr(function(e){var t=Za(e);return Wo(t)&&(t=i),hi(Tt(e,Wo),aa(t,2))}),so=Kr(function(e){var t=Za(e);return t="function"==typeof t?t:i,hi(Tt(e,Wo),i,t)}),uo=Kr(no),co=Kr(function(e){var t=e.length,n=t>1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,ro(e,n)});function lo(e){var t=Ln(e);return t.__chain__=!0,t}function ho(e,t){return t(e)}var fo=Xi(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,a=function(t){return ir(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Un&&ma(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ho,args:[a],thisArg:i}),new Dn(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(i),e})):this.thru(a)}),po=Ti(function(e,t,n){Be.call(e,n)?++e[n]:rr(e,n,1)}),mo=Ri(Da),go=Ri(Ua);function yo(e,t){return(zo(e)?Pt:lr)(e,aa(t,3))}function bo(e,t){return(zo(e)?Et:dr)(e,aa(t,3))}var vo=Ti(function(e,t,n){Be.call(e,n)?e[n].push(t):rr(e,n,[t])}),wo=Kr(function(e,t,n){var i=-1,a="function"==typeof t,o=Vo(e)?r(e.length):[];return lr(e,function(e){o[++i]=a?kt(t,e,n):Tr(e,t,n)}),o}),Ao=Ti(function(e,t,n){rr(e,n,t)});function xo(e,t){return(zo(e)?jt:Nr)(e,aa(t,3))}var ko=Ti(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),_o=Kr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ga(e,t[0],t[1])?t=[]:n>2&&ga(t[0],t[1],t[2])&&(t=[t[0]]),Dr(e,mr(t,1),[])}),Po=ct||function(){return dt.Date.now()};function Eo(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Zi(e,c,i,i,i,i,t)}function So(e,t){var n;if("function"!=typeof t)throw new Se(a);return e=fs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var To=Kr(function(e,t,n){var r=1;if(n.length){var i=sn(n,ia(To));r|=u}return Zi(e,r,t,n,i)}),Mo=Kr(function(e,t,n){var r=3;if(n.length){var i=sn(n,ia(Mo));r|=u}return Zi(t,r,e,n,i)});function Io(e,t,n){var r,o,s,u,c,l,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Se(a);function m(t){var n=r,a=o;return r=o=i,d=t,u=e.apply(a,n)}function g(e){var n=e-l;return l===i||n>=t||n<0||f&&e-d>=s}function y(){var e=Po();if(g(e))return b(e);c=Sa(y,function(e){var n=t-(e-l);return f?yn(n,s-(e-d)):n}(e))}function b(e){return c=i,p&&r?m(e):(r=o=i,u)}function v(){var e=Po(),n=g(e);if(r=arguments,o=this,l=e,n){if(c===i)return function(e){return d=e,c=Sa(y,t),h?m(e):u}(l);if(f)return vi(c),c=Sa(y,t),m(l)}return c===i&&(c=Sa(y,t)),u}return t=ms(t)||0,Xo(n)&&(h=!!n.leading,s=(f="maxWait"in n)?gn(ms(n.maxWait)||0,t):s,p="trailing"in n?!!n.trailing:p),v.cancel=function(){c!==i&&vi(c),d=0,r=l=o=c=i},v.flush=function(){return c===i?u:b(Po())},v}var jo=Kr(function(e,t){return ur(e,1,t)}),Co=Kr(function(e,t,n){return ur(e,ms(t)||0,n)});function Bo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Se(a);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Bo.Cache||Vn),n}function Oo(e){if("function"!=typeof e)throw new Se(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Bo.Cache=Vn;var Ro=yi(function(e,t){var n=(t=1==t.length&&zo(t[0])?jt(t[0],Qt(aa())):jt(mr(t,1),Qt(aa()))).length;return Kr(function(r){for(var i=-1,a=yn(r.length,n);++i<a;)r[i]=t[i].call(this,r[i]);return kt(e,this,r)})}),No=Kr(function(e,t){var n=sn(t,ia(No));return Zi(e,u,i,t,n)}),Fo=Kr(function(e,t){var n=sn(t,ia(Fo));return Zi(e,64,i,t,n)}),Lo=Xi(function(e,t){return Zi(e,256,i,i,i,t)});function Ho(e,t){return e===t||e!=e&&t!=t}var qo=zi(_r),Do=zi(function(e,t){return e>=t}),Uo=Mr(function(){return arguments}())?Mr:function(e){return es(e)&&Be.call(e,"callee")&&!We.call(e,"callee")},zo=r.isArray,Go=yt?Qt(yt):function(e){return es(e)&&kr(e)==j};function Vo(e){return null!=e&&Yo(e.length)&&!$o(e)}function Wo(e){return es(e)&&Vo(e)}var Ko=gt||mu,Zo=bt?Qt(bt):function(e){return es(e)&&kr(e)==b};function Qo(e){if(!es(e))return!1;var t=kr(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!rs(e)}function $o(e){if(!Xo(e))return!1;var t=kr(e);return t==w||t==A||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Jo(e){return"number"==typeof e&&e==fs(e)}function Yo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function Xo(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function es(e){return null!=e&&"object"==typeof e}var ts=vt?Qt(vt):function(e){return es(e)&&da(e)==x};function ns(e){return"number"==typeof e||es(e)&&kr(e)==k}function rs(e){if(!es(e)||kr(e)!=_)return!1;var t=Ge(e);if(null===t)return!0;var n=Be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ce.call(n)==Fe}var is=wt?Qt(wt):function(e){return es(e)&&kr(e)==E},as=At?Qt(At):function(e){return es(e)&&da(e)==S};function os(e){return"string"==typeof e||!zo(e)&&es(e)&&kr(e)==T}function ss(e){return"symbol"==typeof e||es(e)&&kr(e)==M}var us=xt?Qt(xt):function(e){return es(e)&&Yo(e.length)&&!!it[kr(e)]},cs=zi(Rr),ls=zi(function(e,t){return e<=t});function ds(e){if(!e)return[];if(Vo(e))return os(e)?dn(e):Ei(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=da(e);return(t==x?an:t==S?un:Hs)(e)}function hs(e){return e?(e=ms(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fs(e){var t=hs(e),n=t%1;return t==t?n?t-n:t:0}function ps(e){return e?ar(fs(e),0,f):0}function ms(e){if("number"==typeof e)return e;if(ss(e))return h;if(Xo(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Xo(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Zt(e);var n=pe.test(e);return n||ge.test(e)?ut(e.slice(2),n?2:8):fe.test(e)?h:+e}function gs(e){return Si(e,js(e))}function ys(e){return null==e?"":oi(e)}var bs=Mi(function(e,t){if(wa(t)||Vo(t))Si(t,Is(t),e);else for(var n in t)Be.call(t,n)&&Xn(e,n,t[n])}),vs=Mi(function(e,t){Si(t,js(t),e)}),ws=Mi(function(e,t,n,r){Si(t,js(t),e,r)}),As=Mi(function(e,t,n,r){Si(t,Is(t),e,r)}),xs=Xi(ir),ks=Kr(function(e,t){e=_e(e);var n=-1,r=t.length,a=r>2?t[2]:i;for(a&&ga(t[0],t[1],a)&&(r=1);++n<r;)for(var o=t[n],s=js(o),u=-1,c=s.length;++u<c;){var l=s[u],d=e[l];(d===i||Ho(d,Ie[l])&&!Be.call(e,l))&&(e[l]=o[l])}return e}),_s=Kr(function(e){return e.push(i,$i),kt(Bs,i,e)});function Ps(e,t,n){var r=null==e?i:Ar(e,t);return r===i?n:r}function Es(e,t){return null!=e&&ha(e,t,Er)}var Ss=Li(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=n},Xs(nu)),Ts=Li(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),Be.call(e,t)?e[t].push(n):e[t]=[n]},aa),Ms=Kr(Tr);function Is(e){return Vo(e)?Zn(e):Or(e)}function js(e){return Vo(e)?Zn(e,!0):function(e){if(!Xo(e))return function(e){var t=[];if(null!=e)for(var n in _e(e))t.push(n);return t}(e);var t=wa(e),n=[];for(var r in e)("constructor"!=r||!t&&Be.call(e,r))&&n.push(r);return n}(e)}var Cs=Mi(function(e,t,n){Hr(e,t,n)}),Bs=Mi(function(e,t,n,r){Hr(e,t,n,r)}),Os=Xi(function(e,t){var n={};if(null==e)return n;var r=!1;t=jt(t,function(t){return t=gi(t,e),r||(r=t.length>1),t}),Si(e,ta(e),n),r&&(n=or(n,7,Ji));for(var i=t.length;i--;)ui(n,t[i]);return n}),Rs=Xi(function(e,t){return null==e?{}:function(e,t){return Ur(e,t,function(t,n){return Es(e,n)})}(e,t)});function Ns(e,t){if(null==e)return{};var n=jt(ta(e),function(e){return[e]});return t=aa(t),Ur(e,n,function(e,n){return t(e,n[0])})}var Fs=Ki(Is),Ls=Ki(js);function Hs(e){return null==e?[]:$t(e,Is(e))}var qs=Bi(function(e,t,n){return t=t.toLowerCase(),e+(n?Ds(t):t)});function Ds(e){return Qs(ys(e).toLowerCase())}function Us(e){return(e=ys(e))&&e.replace(be,en).replace(Je,"")}var zs=Bi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Gs=Bi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Vs=Ci("toLowerCase"),Ws=Bi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ks=Bi(function(e,t,n){return e+(n?" ":"")+Qs(t)}),Zs=Bi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Qs=Ci("toUpperCase");function $s(e,t,n){return e=ys(e),(t=n?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match(Xe)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var Js=Kr(function(e,t){try{return kt(e,i,t)}catch(e){return Qo(e)?e:new Ae(e)}}),Ys=Xi(function(e,t){return Pt(t,function(t){t=Ra(t),rr(e,t,To(e[t],e))}),e});function Xs(e){return function(){return e}}var eu=Ni(),tu=Ni(!0);function nu(e){return e}function ru(e){return Br("function"==typeof e?e:or(e,1))}var iu=Kr(function(e,t){return function(n){return Tr(n,e,t)}}),au=Kr(function(e,t){return function(n){return Tr(e,n,t)}});function ou(e,t,n){var r=Is(t),i=wr(t,r);null!=n||Xo(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=wr(t,Is(t)));var a=!(Xo(n)&&"chain"in n&&!n.chain),o=$o(e);return Pt(i,function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__);return(n.__actions__=Ei(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Ct([this.value()],arguments))})}),e}function su(){}var uu=qi(jt),cu=qi(St),lu=qi(Rt);function du(e){return ya(e)?zt(Ra(e)):function(e){return function(t){return Ar(t,e)}}(e)}var hu=Ui(),fu=Ui(!0);function pu(){return[]}function mu(){return!1}var gu,yu=Hi(function(e,t){return e+t},0),bu=Vi("ceil"),vu=Hi(function(e,t){return e/t},1),wu=Vi("floor"),Au=Hi(function(e,t){return e*t},1),xu=Vi("round"),ku=Hi(function(e,t){return e-t},0);return Ln.after=function(e,t){if("function"!=typeof t)throw new Se(a);return e=fs(e),function(){if(--e<1)return t.apply(this,arguments)}},Ln.ary=Eo,Ln.assign=bs,Ln.assignIn=vs,Ln.assignInWith=ws,Ln.assignWith=As,Ln.at=xs,Ln.before=So,Ln.bind=To,Ln.bindAll=Ys,Ln.bindKey=Mo,Ln.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return zo(e)?e:[e]},Ln.chain=lo,Ln.chunk=function(e,t,n){t=(n?ga(e,t,n):t===i)?1:gn(fs(t),0);var a=null==e?0:e.length;if(!a||t<1)return[];for(var o=0,s=0,u=r(ht(a/t));o<a;)u[s++]=ei(e,o,o+=t);return u},Ln.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i},Ln.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Ct(zo(n)?Ei(n):[n],mr(t,1))},Ln.cond=function(e){var t=null==e?0:e.length,n=aa();return e=t?jt(e,function(e){if("function"!=typeof e[1])throw new Se(a);return[n(e[0]),e[1]]}):[],Kr(function(n){for(var r=-1;++r<t;){var i=e[r];if(kt(i[0],this,n))return kt(i[1],this,n)}})},Ln.conforms=function(e){return function(e){var t=Is(e);return function(n){return sr(n,e,t)}}(or(e,1))},Ln.constant=Xs,Ln.countBy=po,Ln.create=function(e,t){var n=Hn(e);return null==t?n:nr(n,t)},Ln.curry=function e(t,n,r){var a=Zi(t,8,i,i,i,i,i,n=r?i:n);return a.placeholder=e.placeholder,a},Ln.curryRight=function e(t,n,r){var a=Zi(t,16,i,i,i,i,i,n=r?i:n);return a.placeholder=e.placeholder,a},Ln.debounce=Io,Ln.defaults=ks,Ln.defaultsDeep=_s,Ln.defer=jo,Ln.delay=Co,Ln.difference=La,Ln.differenceBy=Ha,Ln.differenceWith=qa,Ln.drop=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=n||t===i?1:fs(t))<0?0:t,r):[]},Ln.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,0,(t=r-(t=n||t===i?1:fs(t)))<0?0:t):[]},Ln.dropRightWhile=function(e,t){return e&&e.length?li(e,aa(t,3),!0,!0):[]},Ln.dropWhile=function(e,t){return e&&e.length?li(e,aa(t,3),!0):[]},Ln.fill=function(e,t,n,r){var a=null==e?0:e.length;return a?(n&&"number"!=typeof n&&ga(e,t,n)&&(n=0,r=a),function(e,t,n,r){var a=e.length;for((n=fs(n))<0&&(n=-n>a?0:a+n),(r=r===i||r>a?a:fs(r))<0&&(r+=a),r=n>r?0:ps(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Ln.filter=function(e,t){return(zo(e)?Tt:pr)(e,aa(t,3))},Ln.flatMap=function(e,t){return mr(xo(e,t),1)},Ln.flatMapDeep=function(e,t){return mr(xo(e,t),l)},Ln.flatMapDepth=function(e,t,n){return n=n===i?1:fs(n),mr(xo(e,t),n)},Ln.flatten=za,Ln.flattenDeep=function(e){return null!=e&&e.length?mr(e,l):[]},Ln.flattenDepth=function(e,t){return null!=e&&e.length?mr(e,t=t===i?1:fs(t)):[]},Ln.flip=function(e){return Zi(e,512)},Ln.flow=eu,Ln.flowRight=tu,Ln.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Ln.functions=function(e){return null==e?[]:wr(e,Is(e))},Ln.functionsIn=function(e){return null==e?[]:wr(e,js(e))},Ln.groupBy=vo,Ln.initial=function(e){return null!=e&&e.length?ei(e,0,-1):[]},Ln.intersection=Va,Ln.intersectionBy=Wa,Ln.intersectionWith=Ka,Ln.invert=Ss,Ln.invertBy=Ts,Ln.invokeMap=wo,Ln.iteratee=ru,Ln.keyBy=Ao,Ln.keys=Is,Ln.keysIn=js,Ln.map=xo,Ln.mapKeys=function(e,t){var n={};return t=aa(t,3),br(e,function(e,r,i){rr(n,t(e,r,i),e)}),n},Ln.mapValues=function(e,t){var n={};return t=aa(t,3),br(e,function(e,r,i){rr(n,r,t(e,r,i))}),n},Ln.matches=function(e){return Fr(or(e,1))},Ln.matchesProperty=function(e,t){return Lr(e,or(t,1))},Ln.memoize=Bo,Ln.merge=Cs,Ln.mergeWith=Bs,Ln.method=iu,Ln.methodOf=au,Ln.mixin=ou,Ln.negate=Oo,Ln.nthArg=function(e){return e=fs(e),Kr(function(t){return qr(t,e)})},Ln.omit=Os,Ln.omitBy=function(e,t){return Ns(e,Oo(aa(t)))},Ln.once=function(e){return So(2,e)},Ln.orderBy=function(e,t,n,r){return null==e?[]:(zo(t)||(t=null==t?[]:[t]),zo(n=r?i:n)||(n=null==n?[]:[n]),Dr(e,t,n))},Ln.over=uu,Ln.overArgs=Ro,Ln.overEvery=cu,Ln.overSome=lu,Ln.partial=No,Ln.partialRight=Fo,Ln.partition=ko,Ln.pick=Rs,Ln.pickBy=Ns,Ln.property=du,Ln.propertyOf=function(e){return function(t){return null==e?i:Ar(e,t)}},Ln.pull=Qa,Ln.pullAll=$a,Ln.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?zr(e,t,aa(n,2)):e},Ln.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?zr(e,t,i,n):e},Ln.pullAt=Ja,Ln.range=hu,Ln.rangeRight=fu,Ln.rearg=Lo,Ln.reject=function(e,t){return(zo(e)?Tt:pr)(e,Oo(aa(t,3)))},Ln.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],a=e.length;for(t=aa(t,3);++r<a;){var o=e[r];t(o,r,e)&&(n.push(o),i.push(r))}return Gr(e,i),n},Ln.rest=function(e,t){if("function"!=typeof e)throw new Se(a);return Kr(e,t=t===i?t:fs(t))},Ln.reverse=Ya,Ln.sampleSize=function(e,t,n){return t=(n?ga(e,t,n):t===i)?1:fs(t),(zo(e)?$n:Qr)(e,t)},Ln.set=function(e,t,n){return null==e?e:$r(e,t,n)},Ln.setWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:$r(e,t,n,r)},Ln.shuffle=function(e){return(zo(e)?Jn:Xr)(e)},Ln.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&ga(e,t,n)?(t=0,n=r):(t=null==t?0:fs(t),n=n===i?r:fs(n)),ei(e,t,n)):[]},Ln.sortBy=_o,Ln.sortedUniq=function(e){return e&&e.length?ii(e):[]},Ln.sortedUniqBy=function(e,t){return e&&e.length?ii(e,aa(t,2)):[]},Ln.split=function(e,t,n){return n&&"number"!=typeof n&&ga(e,t,n)&&(t=n=i),(n=n===i?f:n>>>0)?(e=ys(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=oi(t))&&rn(e)?bi(dn(e),0,n):e.split(t,n):[]},Ln.spread=function(e,t){if("function"!=typeof e)throw new Se(a);return t=null==t?0:gn(fs(t),0),Kr(function(n){var r=n[t],i=bi(n,0,t);return r&&Ct(i,r),kt(e,this,i)})},Ln.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Ln.take=function(e,t,n){return e&&e.length?ei(e,0,(t=n||t===i?1:fs(t))<0?0:t):[]},Ln.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=r-(t=n||t===i?1:fs(t)))<0?0:t,r):[]},Ln.takeRightWhile=function(e,t){return e&&e.length?li(e,aa(t,3),!1,!0):[]},Ln.takeWhile=function(e,t){return e&&e.length?li(e,aa(t,3)):[]},Ln.tap=function(e,t){return t(e),e},Ln.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Se(a);return Xo(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Io(e,t,{leading:r,maxWait:t,trailing:i})},Ln.thru=ho,Ln.toArray=ds,Ln.toPairs=Fs,Ln.toPairsIn=Ls,Ln.toPath=function(e){return zo(e)?jt(e,Ra):ss(e)?[e]:Ei(Oa(ys(e)))},Ln.toPlainObject=gs,Ln.transform=function(e,t,n){var r=zo(e),i=r||Ko(e)||us(e);if(t=aa(t,4),null==n){var a=e&&e.constructor;n=i?r?new a:[]:Xo(e)&&$o(a)?Hn(Ge(e)):{}}return(i?Pt:br)(e,function(e,r,i){return t(n,e,r,i)}),n},Ln.unary=function(e){return Eo(e,1)},Ln.union=Xa,Ln.unionBy=eo,Ln.unionWith=to,Ln.uniq=function(e){return e&&e.length?si(e):[]},Ln.uniqBy=function(e,t){return e&&e.length?si(e,aa(t,2)):[]},Ln.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?si(e,i,t):[]},Ln.unset=function(e,t){return null==e||ui(e,t)},Ln.unzip=no,Ln.unzipWith=ro,Ln.update=function(e,t,n){return null==e?e:ci(e,t,mi(n))},Ln.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ci(e,t,mi(n),r)},Ln.values=Hs,Ln.valuesIn=function(e){return null==e?[]:$t(e,js(e))},Ln.without=io,Ln.words=$s,Ln.wrap=function(e,t){return No(mi(t),e)},Ln.xor=ao,Ln.xorBy=oo,Ln.xorWith=so,Ln.zip=uo,Ln.zipObject=function(e,t){return fi(e||[],t||[],Xn)},Ln.zipObjectDeep=function(e,t){return fi(e||[],t||[],$r)},Ln.zipWith=co,Ln.entries=Fs,Ln.entriesIn=Ls,Ln.extend=vs,Ln.extendWith=ws,ou(Ln,Ln),Ln.add=yu,Ln.attempt=Js,Ln.camelCase=qs,Ln.capitalize=Ds,Ln.ceil=bu,Ln.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ms(n))==n?n:0),t!==i&&(t=(t=ms(t))==t?t:0),ar(ms(e),t,n)},Ln.clone=function(e){return or(e,4)},Ln.cloneDeep=function(e){return or(e,5)},Ln.cloneDeepWith=function(e,t){return or(e,5,t="function"==typeof t?t:i)},Ln.cloneWith=function(e,t){return or(e,4,t="function"==typeof t?t:i)},Ln.conformsTo=function(e,t){return null==t||sr(e,t,Is(t))},Ln.deburr=Us,Ln.defaultTo=function(e,t){return null==e||e!=e?t:e},Ln.divide=vu,Ln.endsWith=function(e,t,n){e=ys(e),t=oi(t);var r=e.length,a=n=n===i?r:ar(fs(n),0,r);return(n-=t.length)>=0&&e.slice(n,a)==t},Ln.eq=Ho,Ln.escape=function(e){return(e=ys(e))&&Z.test(e)?e.replace(W,tn):e},Ln.escapeRegExp=function(e){return(e=ys(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Ln.every=function(e,t,n){var r=zo(e)?St:hr;return n&&ga(e,t,n)&&(t=i),r(e,aa(t,3))},Ln.find=mo,Ln.findIndex=Da,Ln.findKey=function(e,t){return Ft(e,aa(t,3),br)},Ln.findLast=go,Ln.findLastIndex=Ua,Ln.findLastKey=function(e,t){return Ft(e,aa(t,3),vr)},Ln.floor=wu,Ln.forEach=yo,Ln.forEachRight=bo,Ln.forIn=function(e,t){return null==e?e:gr(e,aa(t,3),js)},Ln.forInRight=function(e,t){return null==e?e:yr(e,aa(t,3),js)},Ln.forOwn=function(e,t){return e&&br(e,aa(t,3))},Ln.forOwnRight=function(e,t){return e&&vr(e,aa(t,3))},Ln.get=Ps,Ln.gt=qo,Ln.gte=Do,Ln.has=function(e,t){return null!=e&&ha(e,t,Pr)},Ln.hasIn=Es,Ln.head=Ga,Ln.identity=nu,Ln.includes=function(e,t,n,r){e=Vo(e)?e:Hs(e),n=n&&!r?fs(n):0;var i=e.length;return n<0&&(n=gn(i+n,0)),os(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ht(e,t,n)>-1},Ln.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:fs(n);return i<0&&(i=gn(r+i,0)),Ht(e,t,i)},Ln.inRange=function(e,t,n){return t=hs(t),n===i?(n=t,t=0):n=hs(n),function(e,t,n){return e>=yn(t,n)&&e<gn(t,n)}(e=ms(e),t,n)},Ln.invoke=Ms,Ln.isArguments=Uo,Ln.isArray=zo,Ln.isArrayBuffer=Go,Ln.isArrayLike=Vo,Ln.isArrayLikeObject=Wo,Ln.isBoolean=function(e){return!0===e||!1===e||es(e)&&kr(e)==y},Ln.isBuffer=Ko,Ln.isDate=Zo,Ln.isElement=function(e){return es(e)&&1===e.nodeType&&!rs(e)},Ln.isEmpty=function(e){if(null==e)return!0;if(Vo(e)&&(zo(e)||"string"==typeof e||"function"==typeof e.splice||Ko(e)||us(e)||Uo(e)))return!e.length;var t=da(e);if(t==x||t==S)return!e.size;if(wa(e))return!Or(e).length;for(var n in e)if(Be.call(e,n))return!1;return!0},Ln.isEqual=function(e,t){return Ir(e,t)},Ln.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:i)?n(e,t):i;return r===i?Ir(e,t,i,n):!!r},Ln.isError=Qo,Ln.isFinite=function(e){return"number"==typeof e&&Nt(e)},Ln.isFunction=$o,Ln.isInteger=Jo,Ln.isLength=Yo,Ln.isMap=ts,Ln.isMatch=function(e,t){return e===t||jr(e,t,sa(t))},Ln.isMatchWith=function(e,t,n){return n="function"==typeof n?n:i,jr(e,t,sa(t),n)},Ln.isNaN=function(e){return ns(e)&&e!=+e},Ln.isNative=function(e){if(va(e))throw new Ae("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Cr(e)},Ln.isNil=function(e){return null==e},Ln.isNull=function(e){return null===e},Ln.isNumber=ns,Ln.isObject=Xo,Ln.isObjectLike=es,Ln.isPlainObject=rs,Ln.isRegExp=is,Ln.isSafeInteger=function(e){return Jo(e)&&e>=-9007199254740991&&e<=d},Ln.isSet=as,Ln.isString=os,Ln.isSymbol=ss,Ln.isTypedArray=us,Ln.isUndefined=function(e){return e===i},Ln.isWeakMap=function(e){return es(e)&&da(e)==I},Ln.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==kr(e)},Ln.join=function(e,t){return null==e?"":Gt.call(e,t)},Ln.kebabCase=zs,Ln.last=Za,Ln.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var a=r;return n!==i&&(a=(a=fs(n))<0?gn(r+a,0):yn(a,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,a):Lt(e,Dt,a,!0)},Ln.lowerCase=Gs,Ln.lowerFirst=Vs,Ln.lt=cs,Ln.lte=ls,Ln.max=function(e){return e&&e.length?fr(e,nu,_r):i},Ln.maxBy=function(e,t){return e&&e.length?fr(e,aa(t,2),_r):i},Ln.mean=function(e){return Ut(e,nu)},Ln.meanBy=function(e,t){return Ut(e,aa(t,2))},Ln.min=function(e){return e&&e.length?fr(e,nu,Rr):i},Ln.minBy=function(e,t){return e&&e.length?fr(e,aa(t,2),Rr):i},Ln.stubArray=pu,Ln.stubFalse=mu,Ln.stubObject=function(){return{}},Ln.stubString=function(){return""},Ln.stubTrue=function(){return!0},Ln.multiply=Au,Ln.nth=function(e,t){return e&&e.length?qr(e,fs(t)):i},Ln.noConflict=function(){return dt._===this&&(dt._=Le),this},Ln.noop=su,Ln.now=Po,Ln.pad=function(e,t,n){e=ys(e);var r=(t=fs(t))?ln(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Di(ft(i),n)+e+Di(ht(i),n)},Ln.padEnd=function(e,t,n){e=ys(e);var r=(t=fs(t))?ln(e):0;return t&&r<t?e+Di(t-r,n):e},Ln.padStart=function(e,t,n){e=ys(e);var r=(t=fs(t))?ln(e):0;return t&&r<t?Di(t-r,n)+e:e},Ln.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),vn(ys(e).replace(re,""),t||0)},Ln.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ga(e,t,n)&&(t=n=i),n===i&&("boolean"==typeof t?(n=t,t=i):"boolean"==typeof e&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=hs(e),t===i?(t=e,e=0):t=hs(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var a=wn();return yn(e+a*(t-e+st("1e-"+((a+"").length-1))),t)}return Vr(e,t)},Ln.reduce=function(e,t,n){var r=zo(e)?Bt:Vt,i=arguments.length<3;return r(e,aa(t,4),n,i,lr)},Ln.reduceRight=function(e,t,n){var r=zo(e)?Ot:Vt,i=arguments.length<3;return r(e,aa(t,4),n,i,dr)},Ln.repeat=function(e,t,n){return t=(n?ga(e,t,n):t===i)?1:fs(t),Wr(ys(e),t)},Ln.replace=function(){var e=arguments,t=ys(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Ln.result=function(e,t,n){var r=-1,a=(t=gi(t,e)).length;for(a||(a=1,e=i);++r<a;){var o=null==e?i:e[Ra(t[r])];o===i&&(r=a,o=n),e=$o(o)?o.call(e):o}return e},Ln.round=xu,Ln.runInContext=e,Ln.sample=function(e){return(zo(e)?Qn:Zr)(e)},Ln.size=function(e){if(null==e)return 0;if(Vo(e))return os(e)?ln(e):e.length;var t=da(e);return t==x||t==S?e.size:Or(e).length},Ln.snakeCase=Ws,Ln.some=function(e,t,n){var r=zo(e)?Rt:ti;return n&&ga(e,t,n)&&(t=i),r(e,aa(t,3))},Ln.sortedIndex=function(e,t){return ni(e,t)},Ln.sortedIndexBy=function(e,t,n){return ri(e,t,aa(n,2))},Ln.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ni(e,t);if(r<n&&Ho(e[r],t))return r}return-1},Ln.sortedLastIndex=function(e,t){return ni(e,t,!0)},Ln.sortedLastIndexBy=function(e,t,n){return ri(e,t,aa(n,2),!0)},Ln.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ni(e,t,!0)-1;if(Ho(e[n],t))return n}return-1},Ln.startCase=Ks,Ln.startsWith=function(e,t,n){return e=ys(e),n=null==n?0:ar(fs(n),0,e.length),t=oi(t),e.slice(n,n+t.length)==t},Ln.subtract=ku,Ln.sum=function(e){return e&&e.length?Wt(e,nu):0},Ln.sumBy=function(e,t){return e&&e.length?Wt(e,aa(t,2)):0},Ln.template=function(e,t,n){var r=Ln.templateSettings;n&&ga(e,t,n)&&(t=i),e=ys(e),t=ws({},t,r,Qi);var a,o,s=ws({},t.imports,r.imports,Qi),u=Is(s),c=$t(s,u),l=0,d=t.interpolate||ve,h="__p += '",f=Pe((t.escape||ve).source+"|"+d.source+"|"+(d===J?de:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),p="//# sourceURL="+(Be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rt+"]")+"\n";e.replace(f,function(t,n,r,i,s,u){return r||(r=i),h+=e.slice(l,u).replace(we,nn),n&&(a=!0,h+="' +\n__e("+n+") +\n'"),s&&(o=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+t.length,t}),h+="';\n";var m=Be.call(t,"variable")&&t.variable;if(m){if(ce.test(m))throw new Ae("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(o?h.replace(U,""):h).replace(z,"$1").replace(G,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=Js(function(){return xe(u,p+"return "+h).apply(i,c)});if(g.source=h,Qo(g))throw g;return g},Ln.times=function(e,t){if((e=fs(e))<1||e>d)return[];var n=f,r=yn(e,f);t=aa(t),e-=f;for(var i=Kt(r,t);++n<e;)t(n);return i},Ln.toFinite=hs,Ln.toInteger=fs,Ln.toLength=ps,Ln.toLower=function(e){return ys(e).toLowerCase()},Ln.toNumber=ms,Ln.toSafeInteger=function(e){return e?ar(fs(e),-9007199254740991,d):0===e?e:0},Ln.toString=ys,Ln.toUpper=function(e){return ys(e).toUpperCase()},Ln.trim=function(e,t,n){if((e=ys(e))&&(n||t===i))return Zt(e);if(!e||!(t=oi(t)))return e;var r=dn(e),a=dn(t);return bi(r,Yt(r,a),Xt(r,a)+1).join("")},Ln.trimEnd=function(e,t,n){if((e=ys(e))&&(n||t===i))return e.slice(0,hn(e)+1);if(!e||!(t=oi(t)))return e;var r=dn(e);return bi(r,0,Xt(r,dn(t))+1).join("")},Ln.trimStart=function(e,t,n){if((e=ys(e))&&(n||t===i))return e.replace(re,"");if(!e||!(t=oi(t)))return e;var r=dn(e);return bi(r,Yt(r,dn(t))).join("")},Ln.truncate=function(e,t){var n=30,r="...";if(Xo(t)){var a="separator"in t?t.separator:a;n="length"in t?fs(t.length):n,r="omission"in t?oi(t.omission):r}var o=(e=ys(e)).length;if(rn(e)){var s=dn(e);o=s.length}if(n>=o)return e;var u=n-ln(r);if(u<1)return r;var c=s?bi(s,0,u).join(""):e.slice(0,u);if(a===i)return c+r;if(s&&(u+=c.length-u),is(a)){if(e.slice(u).search(a)){var l,d=c;for(a.global||(a=Pe(a.source,ys(he.exec(a))+"g")),a.lastIndex=0;l=a.exec(d);)var h=l.index;c=c.slice(0,h===i?u:h)}}else if(e.indexOf(oi(a),u)!=u){var f=c.lastIndexOf(a);f>-1&&(c=c.slice(0,f))}return c+r},Ln.unescape=function(e){return(e=ys(e))&&K.test(e)?e.replace(V,fn):e},Ln.uniqueId=function(e){var t=++Oe;return ys(e)+t},Ln.upperCase=Zs,Ln.upperFirst=Qs,Ln.each=yo,Ln.eachRight=bo,Ln.first=Ga,ou(Ln,(gu={},br(Ln,function(e,t){Be.call(Ln.prototype,t)||(gu[t]=e)}),gu),{chain:!1}),Ln.VERSION="4.17.21",Pt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Ln[e].placeholder=Ln}),Pt(["drop","take"],function(e,t){Un.prototype[e]=function(n){n=n===i?1:gn(fs(n),0);var r=this.__filtered__&&!t?new Un(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,f),type:e+(r.__dir__<0?"Right":"")}),r},Un.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),Pt(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Un.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:aa(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),Pt(["head","last"],function(e,t){var n="take"+(t?"Right":"");Un.prototype[e]=function(){return this[n](1).value()[0]}}),Pt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Un.prototype[e]=function(){return this.__filtered__?new Un(this):this[n](1)}}),Un.prototype.compact=function(){return this.filter(nu)},Un.prototype.find=function(e){return this.filter(e).head()},Un.prototype.findLast=function(e){return this.reverse().find(e)},Un.prototype.invokeMap=Kr(function(e,t){return"function"==typeof e?new Un(this):this.map(function(n){return Tr(n,e,t)})}),Un.prototype.reject=function(e){return this.filter(Oo(aa(e)))},Un.prototype.slice=function(e,t){e=fs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Un(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=fs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Un.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Un.prototype.toArray=function(){return this.take(f)},br(Un.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),a=Ln[r?"take"+("last"==t?"Right":""):t],o=r||/^find/.test(t);a&&(Ln.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,u=t instanceof Un,c=s[0],l=u||zo(t),d=function(e){var t=a.apply(Ln,Ct([e],s));return r&&h?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=this.__chain__,f=!!this.__actions__.length,p=o&&!h,m=u&&!f;if(!o&&l){t=m?t:new Un(this);var g=e.apply(t,s);return g.__actions__.push({func:ho,args:[d],thisArg:i}),new Dn(g,h)}return p&&m?e.apply(this,s):(g=this.thru(d),p?r?g.value()[0]:g.value():g)})}),Pt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Te[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Ln.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(zo(i)?i:[],e)}return this[n](function(n){return t.apply(zo(n)?n:[],e)})}}),br(Un.prototype,function(e,t){var n=Ln[t];if(n){var r=n.name+"";Be.call(Mn,r)||(Mn[r]=[]),Mn[r].push({name:t,func:n})}}),Mn[Fi(i,2).name]=[{name:"wrapper",func:i}],Un.prototype.clone=function(){var e=new Un(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Un.prototype.reverse=function(){if(this.__filtered__){var e=new Un(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Un.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=zo(e),r=t<0,i=n?e.length:0,a=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var a=n[r],o=a.size;switch(a.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=yn(t,e+o);break;case"takeRight":e=gn(e,t-o)}}return{start:e,end:t}}(0,i,this.__views__),o=a.start,s=a.end,u=s-o,c=r?s:o-1,l=this.__iteratees__,d=l.length,h=0,f=yn(u,this.__takeCount__);if(!n||!r&&i==u&&f==u)return di(e,this.__actions__);var p=[];e:for(;u--&&h<f;){for(var m=-1,g=e[c+=t];++m<d;){var y=l[m],b=y.iteratee,v=y.type,w=b(g);if(2==v)g=w;else if(!w){if(1==v)continue e;break e}}p[h++]=g}return p},Ln.prototype.at=fo,Ln.prototype.chain=function(){return lo(this)},Ln.prototype.commit=function(){return new Dn(this.value(),this.__chain__)},Ln.prototype.next=function(){this.__values__===i&&(this.__values__=ds(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Ln.prototype.plant=function(e){for(var t,n=this;n instanceof qn;){var r=Fa(n);r.__index__=0,r.__values__=i,t?a.__wrapped__=r:t=r;var a=r;n=n.__wrapped__}return a.__wrapped__=e,t},Ln.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Un){var t=e;return this.__actions__.length&&(t=new Un(this)),(t=t.reverse()).__actions__.push({func:ho,args:[Ya],thisArg:i}),new Dn(t,this.__chain__)}return this.thru(Ya)},Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=function(){return di(this.__wrapped__,this.__actions__)},Ln.prototype.first=Ln.prototype.head,Qe&&(Ln.prototype[Qe]=function(){return this}),Ln}();dt._=pn,(r=function(){return pn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},2566:(e,t)=>{var n;n=function(e){e.version="1.2.2";var t=function(){for(var e=0,t=new Array(256),n=0;256!=n;++n)e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=n)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1,t[n]=e;return"undefined"!=typeof Int32Array?new Int32Array(t):t}(),n=function(e){var t=0,n=0,r=0,i="undefined"!=typeof Int32Array?new Int32Array(4096):new Array(4096);for(r=0;256!=r;++r)i[r]=e[r];for(r=0;256!=r;++r)for(n=e[r],t=256+r;t<4096;t+=256)n=i[t]=n>>>8^e[255&n];var a=[];for(r=1;16!=r;++r)a[r-1]="undefined"!=typeof Int32Array?i.subarray(256*r,256*r+256):i.slice(256*r,256*r+256);return a}(t),r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],u=n[5],c=n[6],l=n[7],d=n[8],h=n[9],f=n[10],p=n[11],m=n[12],g=n[13],y=n[14];e.table=t,e.bstr=function(e,n){for(var r=-1^n,i=0,a=e.length;i<a;)r=r>>>8^t[255&(r^e.charCodeAt(i++))];return~r},e.buf=function(e,n){for(var b=-1^n,v=e.length-15,w=0;w<v;)b=y[e[w++]^255&b]^g[e[w++]^b>>8&255]^m[e[w++]^b>>16&255]^p[e[w++]^b>>>24]^f[e[w++]]^h[e[w++]]^d[e[w++]]^l[e[w++]]^c[e[w++]]^u[e[w++]]^s[e[w++]]^o[e[w++]]^a[e[w++]]^i[e[w++]]^r[e[w++]]^t[e[w++]];for(v+=15;w<v;)b=b>>>8^t[255&(b^e[w++])];return~b},e.str=function(e,n){for(var r=-1^n,i=0,a=e.length,o=0,s=0;i<a;)(o=e.charCodeAt(i++))<128?r=r>>>8^t[255&(r^o)]:o<2048?r=(r=r>>>8^t[255&(r^(192|o>>6&31))])>>>8^t[255&(r^(128|63&o))]:o>=55296&&o<57344?(o=64+(1023&o),s=1023&e.charCodeAt(i++),r=(r=(r=(r=r>>>8^t[255&(r^(240|o>>8&7))])>>>8^t[255&(r^(128|o>>2&63))])>>>8^t[255&(r^(128|s>>6&15|(3&o)<<4))])>>>8^t[255&(r^(128|63&s))]):r=(r=(r=r>>>8^t[255&(r^(224|o>>12&15))])>>>8^t[255&(r^(128|o>>6&63))])>>>8^t[255&(r^(128|63&o))];return~r}},"undefined"==typeof DO_NOT_EXPORT_CRC?n(t):n({})},2723:(e,t,n)=>{"use strict";var r=n(7952),i=n(4367),a=n(3349);function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),n=i.toArray(e.nonce,e.nonceEnc||"hex"),r=i.toArray(e.pers,e.persEnc||"hex");a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}e.exports=o,o.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},o.prototype._hmac=function(){return new r.hmac(this.hash,this.K)},o.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},o.prototype.reseed=function(e,t,n,r){"string"!=typeof t&&(r=n,n=t,t=null),e=i.toArray(e,t),n=i.toArray(n,r),a(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},o.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(r=n,n=t,t=null),n&&(n=i.toArray(n,r||"hex"),this._update(n));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var o=a.slice(0,e);return this._update(n),this._reseed++,i.encode(o,t)}},2791:function(e,t,n){!function(e){"use strict";if(!e.setImmediate){var t,n,r,i,a,o=1,s={},u=!1,c=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,"[object process]"==={}.toString.call(e.process)?t=function(e){process.nextTick(function(){h(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(i="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(i)&&h(+t.data.slice(i.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),t=function(t){e.postMessage(i+t,"*")}):e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){h(e.data)},t=function(e){r.port2.postMessage(e)}):c&&"onreadystatechange"in c.createElement("script")?(n=c.documentElement,t=function(e){var t=c.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):t=function(e){setTimeout(h,0,e)},l.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var n=new Array(arguments.length-1),r=0;r<n.length;r++)n[r]=arguments[r+1];var i={callback:e,args:n};return s[o]=i,t(o),o++},l.clearImmediate=d}function d(e){delete s[e]}function h(e){if(u)setTimeout(h,0,e);else{var t=s[e];if(t){u=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{d(e),u=!1}}}}}("undefined"==typeof self?void 0===n.g?this:n.g:self)},3048:(e,t)=>{"use strict";t.type=function(e){return e.split(/ *; */).shift()},t.params=function(e){return e.split(/ *; */).reduce(function(e,t){var n=t.split(/ *= */),r=n.shift(),i=n.shift();return r&&i&&(e[r]=i),e},{})},t.parseLinks=function(e){return e.split(/ *, */).reduce(function(e,t){var n=t.split(/ *; */),r=n[0].slice(1,-1);return e[n[1].split(/ *= */)[1].slice(1,-1)]=r,e},{})},t.cleanHeader=function(e,t){return delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e}},3283:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(1527))&&r.__esModule?r:{default:r};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}t.default=function(){return function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.apiClient=t||i.default.instance},[{key:"getChainConfig",value:function(e,t){e=e||{};return this.apiClient.callApi("/governance/getChainConfig","POST",null,null,null,null,{method:"governance_getChainConfig",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"getParams",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumber' when calling getParams");var r={method:"governance_getParams",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/governance/getParams","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getRewardsAccumulated",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'firstBlock' when calling getRewardsAccumulated");if(null==t)throw new Error("Missing the required parameter 'lastBlock' when calling getRewardsAccumulated");var i={method:"governance_getRewardsAccumulated",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/governance/getRewardsAccumulated","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"idxCache",value:function(e,t){e=e||{};return this.apiClient.callApi("/governance/idxCache","POST",null,null,null,null,{method:"governance_idxCache",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"idxCacheFromDb",value:function(e,t){e=e||{};return this.apiClient.callApi("/governance/idxCacheFromDb","POST",null,null,null,null,{method:"governance_idxCacheFromDb",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"itemCacheFromDb",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumber' when calling itemCacheFromDb");var r={method:"governance_itemCacheFromDb",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/governance/itemCacheFromDb","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"myVotes",value:function(e,t){e=e||{};return this.apiClient.callApi("/governance/myVotes","POST",null,null,null,null,{method:"governance_myVotes",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"myVotingPower",value:function(e,t){e=e||{};return this.apiClient.callApi("/governance/myVotingPower","POST",null,null,null,null,{method:"governance_myVotingPower",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"pendingChanges",value:function(e,t){e=e||{};return this.apiClient.callApi("/governance/pendingChanges","POST",null,null,null,null,{method:"governance_pendingChanges",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"showTally",value:function(e,t){e=e||{};return this.apiClient.callApi("/governance/showTally","POST",null,null,null,null,{method:"governance_showTally",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"totalVotingPower",value:function(e,t){e=e||{};return this.apiClient.callApi("/governance/totalVotingPower","POST",null,null,null,null,{method:"governance_totalVotingPower",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"vote",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'key' when calling vote");if(null==t)throw new Error("Missing the required parameter 'value' when calling vote");var i={method:"governance_vote",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/governance/vote","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"votes",value:function(e,t){e=e||{};return this.apiClient.callApi("/governance/votes","POST",null,null,null,null,{method:"governance_votes",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}}])}()},3349:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}},3378:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(1527))&&r.__esModule?r:{default:r};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}t.default=function(){return function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.apiClient=t||i.default.instance},[{key:"anchoring",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'enable' when calling anchoring");var r={method:"subbridge_anchoring",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/subbridge/anchoring","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"childOperator",value:function(e,t){e=e||{};return this.apiClient.callApi("/subbridge/childOperator","POST",null,null,null,null,{method:"subbridge_childOperator",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"childOperatorBalance",value:function(e,t){e=e||{};return this.apiClient.callApi("/subbridge/childOperatorBalance","POST",null,null,null,null,{method:"subbridge_childOperatorBalance",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"childOperatorNonce",value:function(e,t){e=e||{};return this.apiClient.callApi("/subbridge/childOperatorNonce","POST",null,null,null,null,{method:"subbridge_childOperatorNonce",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"convertRequestTxHashToHandleTxHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hash' when calling convertRequestTxHashToHandleTxHash");var r={method:"subbridge_convertRequestTxHashToHandleTxHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/subbridge/convertRequestTxHashToHandleTxHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"deployBridge",value:function(e,t){e=e||{};return this.apiClient.callApi("/subbridge/deployBridge","POST",null,null,null,null,{method:"subbridge_deployBridge",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"deregisterBridge",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'childAccount' when calling deregisterBridge");if(null==t)throw new Error("Missing the required parameter 'parentAccount' when calling deregisterBridge");var i={method:"subbridge_deregisterBridge",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/subbridge/deregisterBridge","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"deregisterToken",value:function(e,t,n,r,i,a){if(i=i||{},null==e)throw new Error("Missing the required parameter 'childAccount' when calling deregisterToken");if(null==t)throw new Error("Missing the required parameter 'parentAccount' when calling deregisterToken");if(null==n)throw new Error("Missing the required parameter 'tokenChildAccount' when calling deregisterToken");if(null==r)throw new Error("Missing the required parameter 'tokenParentAccount' when calling deregisterToken");var o={method:"subbridge_deregisterToken",id:1,jsonrpc:"2.0",params:[]};return o.params.push(e),o.params.push(t),o.params.push(n),o.params.push(r),this.apiClient.callApi("/subbridge/deregisterToken","POST",null,null,null,null,o,[],["application/json"],["application/json"],"object",null,a)}},{key:"getBridgeInformation",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'account' when calling getBridgeInformation");var r={method:"subbridge_getBridgeInformation",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/subbridge/getBridgeInFormation","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getReceiptFromParentChain",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockHash' when calling getReceiptFromParentChain");var r={method:"subbridge_getReceiptFromParentChain",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/subbridge/getReceiptFromParentChain","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"latestAnchoredBlockNumber",value:function(e,t){e=e||{};return this.apiClient.callApi("/subbridge/latestAnchoredBlockNumber","POST",null,null,null,null,{method:"subbridge_latestAnchoredBlockNumber",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"listBridge",value:function(e,t){e=e||{};return this.apiClient.callApi("/subbridge/listBridge","POST",null,null,null,null,{method:"subbridge_listBridge",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"parentOperator",value:function(e,t){e=e||{};return this.apiClient.callApi("/subbridge/parentOperator","POST",null,null,null,null,{method:"subbridge_parentOperator",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"parentOperatorBalance",value:function(e,t){e=e||{};return this.apiClient.callApi("/subbridge/parentOperatorBalance","POST",null,null,null,null,{method:"subbridge_parentOperatorBalance",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"parentOperatorNonce",value:function(e,t){e=e||{};return this.apiClient.callApi("/subbridge/parentOperatorNonce","POST",null,null,null,null,{method:"subbridge_parentOperatorNonce",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"registerBridge",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'childAccount' when calling registerBridge");if(null==t)throw new Error("Missing the required parameter 'parentAccount' when calling registerBridge");var i={method:"subbridge_registerBridge",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/subbridge/registerBridge","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"registerToken",value:function(e,t,n,r,i,a){if(i=i||{},null==e)throw new Error("Missing the required parameter 'childAccount' when calling registerToken");if(null==t)throw new Error("Missing the required parameter 'parentAccount' when calling registerToken");if(null==n)throw new Error("Missing the required parameter 'tokenChildAccount' when calling registerToken");if(null==r)throw new Error("Missing the required parameter 'tokenParentAccount' when calling registerToken");var o={method:"subbridge_registerToken",id:1,jsonrpc:"2.0",params:[]};return o.params.push(e),o.params.push(t),o.params.push(n),o.params.push(r),this.apiClient.callApi("/subbridge/registerToken","POST",null,null,null,null,o,[],["application/json"],["application/json"],"object",null,a)}},{key:"sendChainTxslimit",value:function(e,t){e=e||{};return this.apiClient.callApi("/subbridge/sendChainTxslimit","POST",null,null,null,null,{method:"subbridge_sendChainTxslimit",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"subscribeBridge",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'childAccount' when calling subscribeBridge");if(null==t)throw new Error("Missing the required parameter 'parentAccount' when calling subscribeBridge");var i={method:"subbridge_subscribeBridge",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/subbridge/subscribeBridge","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"txPending",value:function(e,t){e=e||{};return this.apiClient.callApi("/subbridge/txPending","POST",null,null,null,null,{method:"subbridge_txPending",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"txPendingCount",value:function(e,t){e=e||{};return this.apiClient.callApi("/subbridge/txPendingCount","POST",null,null,null,null,{method:"subbridge_txPendingCount",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"unsubscribeBridge",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'childAccount' when calling unsubscribeBridge");if(null==t)throw new Error("Missing the required parameter 'parentAccount' when calling unsubscribeBridge");var i={method:"subbridge_unsubscribeBridge",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/subbridge/unsubscribeBridge","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}}])}()},3618:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(1527))&&r.__esModule?r:{default:r};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}t.default=function(){return function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.apiClient=t||i.default.instance},[{key:"listening",value:function(e,t){e=e||{};return this.apiClient.callApi("/net/listening","POST",null,null,null,null,{method:"net_listening",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"networkID",value:function(e,t){e=e||{};return this.apiClient.callApi("/net/networkID","POST",null,null,null,null,{method:"net_networkID",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"peerCount",value:function(e,t){e=e||{};return this.apiClient.callApi("/net/peerCount","POST",null,null,null,null,{method:"net_peerCount",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"peerCountByType",value:function(e,t){e=e||{};return this.apiClient.callApi("/net/peerCountByType","POST",null,null,null,null,{method:"net_peerCountByType",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"version",value:function(e,t){e=e||{};return this.apiClient.callApi("/net/version","POST",null,null,null,null,{method:"net_version",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}}])}()},3776:()=>{},3822:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(1527))&&r.__esModule?r:{default:r};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}t.default=function(){return function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.apiClient=t||i.default.instance},[{key:"addPeer",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'url' when calling addPeer");var r={method:"admin_addPeer",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/admin/addPeer","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"datadir",value:function(e,t){e=e||{};return this.apiClient.callApi("/admin/datadir","POST",null,null,null,null,{method:"admin_datadir",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"exportChain",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'fileName' when calling exportChain");var r=0,i={method:"admin_exportChain",id:1,jsonrpc:"2.0",params:[]};i.params.push(e);var a,o=null;if(o="latest",null==(a=t.firstBlock||t[r++]||o))throw new Error("Missing the required parameter 'firstBlock' when calling exportChain");if(i.params.push(a),o=null,o="latest",null==(a=t.lastBlock||t[r++]||o))throw new Error("Missing the required parameter 'lastBlock' when calling exportChain");return i.params.push(a),this.apiClient.callApi("/admin/exportChain","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,n)}},{key:"getSpamThrottlerCandidateList",value:function(e,t){e=e||{};return this.apiClient.callApi("/admin/getSpamThrottlerCandidateList","POST",null,null,null,null,{method:"admin_getSpamThrottlerCandidateList",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"getSpamThrottlerThrottleList",value:function(e,t){e=e||{};return this.apiClient.callApi("/admin/getSpamThrottlerThrottleList","POST",null,null,null,null,{method:"admin_getSpamThrottlerThrottleList",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"getSpamThrottlerWhiteList",value:function(e,t){e=e||{};return this.apiClient.callApi("/admin/getSpamThrottlerWhiteList","POST",null,null,null,null,{method:"admin_getSpamThrottlerWhiteList",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"importChain",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'fileName' when calling importChain");var r={method:"admin_importChain",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/admin/importChain","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"importChainFromString",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockRlp' when calling importChainFromString");var r={method:"admin_importChainFromString",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/admin/importChainFromString","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"nodeConfig",value:function(e,t){e=e||{};return this.apiClient.callApi("/admin/nodeConfig","POST",null,null,null,null,{method:"admin_nodeConfig",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"nodeInfo",value:function(e,t){e=e||{};return this.apiClient.callApi("/admin/nodeInfo","POST",null,null,null,null,{method:"admin_nodeInfo",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"peers",value:function(e,t){e=e||{};return this.apiClient.callApi("/admin/peers","POST",null,null,null,null,{method:"admin_peers",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"removePeer",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'url' when calling removePeer");var r={method:"admin_removePeer",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/admin/removePeer","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"saveTrieNodeCacheToDisk",value:function(e,t){e=e||{};return this.apiClient.callApi("/admin/saveTrieNodeCacheToDisk","POST",null,null,null,null,{method:"admin_saveTrieNodeCacheToDisk",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"setMaxSubscriptionPerWSConn",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'limit' when calling setMaxSubscriptionPerWSConn");var r={method:"admin_setMaxSubscriptionPerWSConn",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/admin/setMaxSubscriptionPerWSConn","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"setSpamThrottlerWhiteList",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'addresses' when calling setSpamThrottlerWhiteList");var r={method:"admin_setSpamThrottlerWhiteList",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/admin/setSpamThrottlerWhiteList","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"spamThrottlerConfig",value:function(e,t){e=e||{};return this.apiClient.callApi("/admin/spamThrottlerConfig","POST",null,null,null,null,{method:"admin_spamThrottlerConfig",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"startHTTP",value:function(e,t){var n,r=0,i={method:"admin_startHTTP",id:1,jsonrpc:"2.0",params:[]},a=null;if(null==(n=(e=e||{}).host||e[r++]||a))throw new Error("Missing the required parameter 'host' when calling startHTTP");if(i.params.push(n),a=null,null==(n=e.port||e[r++]||a))throw new Error("Missing the required parameter 'port' when calling startHTTP");if(i.params.push(n),a=null,null==(n=e.cors||e[r++]||a))throw new Error("Missing the required parameter 'cors' when calling startHTTP");if(i.params.push(n),a=null,null==(n=e.apis||e[r++]||a))throw new Error("Missing the required parameter 'apis' when calling startHTTP");return i.params.push(n),this.apiClient.callApi("/admin/startHTTP","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,t)}},{key:"startSpamThrottler",value:function(e,t){e=e||{};return this.apiClient.callApi("/admin/startSpamThrottler","POST",null,null,null,null,{method:"admin_startSpamThrottler",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"startStateMigration",value:function(e,t){e=e||{};return this.apiClient.callApi("/admin/startStateMigration","POST",null,null,null,null,{method:"admin_startStateMigration",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"startWS",value:function(e,t){var n,r=0,i={method:"admin_startWS",id:1,jsonrpc:"2.0",params:[]},a=null;if(null==(n=(e=e||{}).host||e[r++]||a))throw new Error("Missing the required parameter 'host' when calling startWS");if(i.params.push(n),a=null,null==(n=e.port||e[r++]||a))throw new Error("Missing the required parameter 'port' when calling startWS");if(i.params.push(n),a=null,null==(n=e.cors||e[r++]||a))throw new Error("Missing the required parameter 'cors' when calling startWS");if(i.params.push(n),a=null,null==(n=e.apis||e[r++]||a))throw new Error("Missing the required parameter 'apis' when calling startWS");return i.params.push(n),this.apiClient.callApi("/admin/startWS","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,t)}},{key:"stateMigrationStatus",value:function(e,t){e=e||{};return this.apiClient.callApi("/admin/stateMigrationStatus","POST",null,null,null,null,{method:"admin_stateMigrationStatus",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"stopHTTP",value:function(e,t){e=e||{};return this.apiClient.callApi("/admin/stopHTTP","POST",null,null,null,null,{method:"admin_stopHTTP",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"stopSpamThrottler",value:function(e,t){e=e||{};return this.apiClient.callApi("/admin/stopSpamThrottler","POST",null,null,null,null,{method:"admin_stopSpamThrottler",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"stopStateMigration",value:function(e,t){e=e||{};return this.apiClient.callApi("/admin/stopStateMigration","POST",null,null,null,null,{method:"admin_stopStateMigration",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"stopWS",value:function(e,t){e=e||{};return this.apiClient.callApi("/admin/stopWS","POST",null,null,null,null,{method:"admin_stopWS",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}}])}()},3917:(e,t,n)=>{"use strict";var r=n(7426),i=n(6166),a=n(6225),o=r.rotl32,s=r.sum32,u=r.sum32_5,c=a.ft_1,l=i.BlockHash,d=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}r.inherits(h,l),e.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=o(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);var i=this.h[0],a=this.h[1],l=this.h[2],h=this.h[3],f=this.h[4];for(r=0;r<n.length;r++){var p=~~(r/20),m=u(o(i,5),c(p,a,l,h),f,n[r],d[p]);f=h,h=l,l=o(a,30),a=i,i=m}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],a),this.h[2]=s(this.h[2],l),this.h[3]=s(this.h[3],h),this.h[4]=s(this.h[4],f)},h.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},4011:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},4283:()=>{},4328:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(1527))&&r.__esModule?r:{default:r};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}t.default=function(){return function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.apiClient=t||i.default.instance},[{key:"accountCreated",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'account' when calling accountCreated");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHash' when calling accountCreated");var i={method:"klay_accountCreated",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/account/accountCreated","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"accounts",value:function(e,t){e=e||{};return this.apiClient.callApi("/klay/account/accounts","POST",null,null,null,null,{method:"klay_accounts",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"blockNumber",value:function(e,t){e=e||{};return this.apiClient.callApi("/klay/block/blockNumber","POST",null,null,null,null,{method:"klay_blockNumber",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"call",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'callObject' when calling call");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHash' when calling call");var i={method:"klay_call",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/transaction/call","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"chainID",value:function(e,t){e=e||{};return this.apiClient.callApi("/klay/configuration/chainID","POST",null,null,null,null,{method:"klay_chainID",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"clientVersion",value:function(e,t){e=e||{};return this.apiClient.callApi("/klay/configuration/clientVersion","POST",null,null,null,null,{method:"klay_clientVersion",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"createAccessList",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'callObject' when calling createAccessList");var r=0,i={method:"klay_createAccessList",id:1,jsonrpc:"2.0",params:[]};i.params.push(e);var a=t.blockParameter||t[r++]||"latest";if(null==a)throw new Error("Missing the required parameter 'blockParameter' when calling createAccessList");return i.params.push(a),this.apiClient.callApi("/klay/createAccessList","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,n)}},{key:"decodeAccountKey",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'encodedAccountKey' when calling decodeAccountKey");var r={method:"klay_decodeAccountKey",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/account/decodeAccountKey","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"encodeAccountKey",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'object' when calling encodeAccountKey");var r={method:"klay_encodeAccountKey",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/account/encodeAccountKey","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"estimateComputationCost",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'callObject' when calling estimateComputationCost");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHash' when calling estimateComputationCost");var i={method:"klay_estimateComputationCost",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/transaction/estimateComputationCost","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"estimateGas",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'callObject' when calling estimateGas");var r=0,i={method:"klay_estimateGas",id:1,jsonrpc:"2.0",params:[]};i.params.push(e);var a=t.blockNumberOrHashOrTag||t[r++]||"latest";if(null==a)throw new Error("Missing the required parameter 'blockNumberOrHashOrTag' when calling estimateGas");return i.params.push(a),this.apiClient.callApi("/klay/transaction/estimateGas","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,n)}},{key:"feeHistory",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'blockCount' when calling feeHistory");if(null==t)throw new Error("Missing the required parameter 'lastBlock' when calling feeHistory");var i=0,a={method:"klay_feeHistory",id:1,jsonrpc:"2.0",params:[]};a.params.push(e),a.params.push(t);var o=n.rewardPercentiles||n[i++]||null;if(null==o)throw new Error("Missing the required parameter 'rewardPercentiles' when calling feeHistory");return a.params.push(o),this.apiClient.callApi("/klay/gas/feeHistory","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,r)}},{key:"forkStatus",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'number' when calling forkStatus");var r={method:"klay_forkStatus",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/configuration/forkStatus","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"gasPrice",value:function(e,t){e=e||{};return this.apiClient.callApi("/klay/gas/gasPrice","POST",null,null,null,null,{method:"klay_gasPrice",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"getAccount",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'address' when calling getAccount");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHashOrTag' when calling getAccount");var i={method:"klay_getAccount",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/account/getAccount","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getAccountKey",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'address' when calling getAccountKey");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHashOrTag' when calling getAccountKey");var i={method:"klay_getAccountKey",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/account/getAccountKey","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getActiveAddressFromRegistry",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'name' when calling getActiveAddressFromRegistry");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHashOrTag' when calling getActiveAddressFromRegistry");var i={method:"klay_getActiveAddressFromRegistry",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/miscellaneous/getActiveAddressFromRegistry","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getAllRecordsFromRegistry",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'name' when calling getAllRecordsFromRegistry");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHashOrTag' when calling getAllRecordsFromRegistry");var i={method:"klay_getAllRecordsFromRegistry",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/miscellaneous/getAllRecordsFromRegistry","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getBalance",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'address' when calling getBalance");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHash' when calling getBalance");var i={method:"klay_getBalance",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/account/getBalance","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getBlockByHash",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'hashOfBlock' when calling getBlockByHash");if(null==t)throw new Error("Missing the required parameter 'returnTransactionObject' when calling getBlockByHash");var i={method:"klay_getBlockByHash",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/block/getBlockByHash","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getBlockByNumber",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getBlockByNumber");if(null==t)throw new Error("Missing the required parameter '_boolean' when calling getBlockByNumber");var i={method:"klay_getBlockByNumber",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/block/getBlockByNumber","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getBlockReceipts",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hashOfBlock' when calling getBlockReceipts");var r={method:"klay_getBlockReceipts",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/block/getBlockReceipts","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getBlockTransactionCountByHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hashOfBlock' when calling getBlockTransactionCountByHash");var r={method:"klay_getBlockTransactionCountByHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/block/getBlockTransactionCountByHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getBlockTransactionCountByNumber",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getBlockTransactionCountByNumber");var r={method:"klay_getBlockTransactionCountByNumber",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/block/getBlockTransactionCountByNumber","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getBlockWithConsensusInfoByHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockHash' when calling getBlockWithConsensusInfoByHash");var r={method:"klay_getBlockWithConsensusInfoByHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/block/getBlockWithConsensusInfoByHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getBlockWithConsensusInfoByNumber",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getBlockWithConsensusInfoByNumber");var r={method:"klay_getBlockWithConsensusInfoByNumber",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/block/getBlockWithConsensusInfoByNumber","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getBlockWithConsensusInfoByNumberRange",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'blockHashOrBlockNumber' when calling getBlockWithConsensusInfoByNumberRange");if(null==t)throw new Error("Missing the required parameter 'range' when calling getBlockWithConsensusInfoByNumberRange");var i={method:"klay_getBlockWithConsensusInfoByNumberRange",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/block/getBlockWithConsensusInfoByNumberRange","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getBlsInfos",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumber' when calling getBlsInfos");var r={method:"klay_getBlsInfos",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/miscellaneous/getBlsInfos","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getChainConfig",value:function(e,t){var n=0,r={method:"klay_getChainConfig",id:1,jsonrpc:"2.0",params:[]},i=(e=e||{}).blockNumberOrTag||e[n++]||"latest";if(null==i)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getChainConfig");return r.params.push(i),this.apiClient.callApi("/klay/configuration/getChainConfig","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,t)}},{key:"getCode",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'account' when calling getCode");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHashOrTag' when calling getCode");var i={method:"klay_getCode",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/account/getCode","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getCommittee",value:function(e,t){var n=0,r={method:"klay_getCommittee",id:1,jsonrpc:"2.0",params:[]},i=(e=e||{}).blockNumberOrTag||e[n++]||"latest";if(null==i)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getCommittee");return r.params.push(i),this.apiClient.callApi("/klay/block/getCommittee","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,t)}},{key:"getCommitteeSize",value:function(e,t){var n=0,r={method:"klay_getCommitteeSize",id:1,jsonrpc:"2.0",params:[]},i=(e=e||{}).blockNumberOrTag||e[n++]||"latest";if(null==i)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getCommitteeSize");return r.params.push(i),this.apiClient.callApi("/klay/block/getCommitteeSize","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,t)}},{key:"getCouncil",value:function(e,t){var n=0,r={method:"klay_getCouncil",id:1,jsonrpc:"2.0",params:[]},i=(e=e||{}).blockNumberOrTag||e[n++]||"latest";if(null==i)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getCouncil");return r.params.push(i),this.apiClient.callApi("/klay/block/getCouncil","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,t)}},{key:"getCouncilSize",value:function(e,t){var n=0,r={method:"klay_getCouncilSize",id:1,jsonrpc:"2.0",params:[]},i=(e=e||{}).blockNumberOrTag||e[n++]||"latest";if(null==i)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getCouncilSize");return r.params.push(i),this.apiClient.callApi("/klay/block/getCouncilSize","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,t)}},{key:"getDecodedAnchoringTransactionByHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hashOfTransaction' when calling getDecodedAnchoringTransactionByHash");var r={method:"klay_getDecodedAnchoringTransactionByHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/transaction/getDecodedAnchoringTransactionByHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getFilterChanges",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'QUANTITY' when calling getFilterChanges");var r={method:"klay_getFilterChanges",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/filter/getFilterChanges","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getFilterLogs",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'QUANTITY' when calling getFilterLogs");var r={method:"klay_getFilterLogs",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/filter/getFilterLogs","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getHeaderByHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hashOfBlock' when calling getHeaderByHash");var r={method:"klay_getHeaderByHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/block/getHeaderByHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getHeaderByNumber",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getHeaderByNumber");var r={method:"klay_getHeaderByNumber",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/block/getHeaderByNumber","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getLogs",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'filterOptions' when calling getLogs");var r={method:"klay_getLogs",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/filter/getLogs","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getParams",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumber' when calling getParams");var r={method:"klay_getParams",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/configuration/getParams","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getProof",value:function(e,t,n,r,i){if(r=r||{},null==e)throw new Error("Missing the required parameter 'account' when calling getProof");if(null==t)throw new Error("Missing the required parameter 'keys' when calling getProof");if(null==n)throw new Error("Missing the required parameter 'blockNumber' when calling getProof");var a={method:"klay_getProof",id:1,jsonrpc:"2.0",params:[]};return a.params.push(e),a.params.push(t),a.params.push(n),this.apiClient.callApi("/klay/miscellaneous/getProof","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,i)}},{key:"getRawTransactionByBlockHashAndIndex",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'blockHash' when calling getRawTransactionByBlockHashAndIndex");if(null==t)throw new Error("Missing the required parameter 'index' when calling getRawTransactionByBlockHashAndIndex");var i={method:"klay_getRawTransactionByBlockHashAndIndex",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/getRawTransactionByBlockHashAndIndex","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getRawTransactionByBlockNumberAndIndex",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrHashOrTag' when calling getRawTransactionByBlockNumberAndIndex");if(null==t)throw new Error("Missing the required parameter 'transactionIndex' when calling getRawTransactionByBlockNumberAndIndex");var i={method:"klay_getRawTransactionByBlockNumberAndIndex",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/getRawTransactionByBlockNumberAndIndex","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getRawTransactionByHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hash' when calling getRawTransactionByHash");var r={method:"klay_getRawTransactionByHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/getRawTransactionByHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getRewards",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getRewards");var r={method:"klay_getRewards",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/block/getRewards","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getStakingInfo",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getStakingInfo");var r={method:"klay_getStakingInfo",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/miscellaneous/getStakingInfo","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getStorageAt",value:function(e,t,n,r,i){if(r=r||{},null==e)throw new Error("Missing the required parameter 'storageAddress' when calling getStorageAt");if(null==t)throw new Error("Missing the required parameter 'position' when calling getStorageAt");if(null==n)throw new Error("Missing the required parameter 'blockNumberOrHash' when calling getStorageAt");var a={method:"klay_getStorageAt",id:1,jsonrpc:"2.0",params:[]};return a.params.push(e),a.params.push(t),a.params.push(n),this.apiClient.callApi("/klay/block/getStorageAt","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,i)}},{key:"getTotalSupply",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumber' when calling getTotalSupply");var r={method:"klay_getTotalSupply",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/miscellaneous/getTotalSupply","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getTransactionByBlockHashAndIndex",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'blockHash' when calling getTransactionByBlockHashAndIndex");if(null==t)throw new Error("Missing the required parameter 'transactionIndexPosition' when calling getTransactionByBlockHashAndIndex");var i={method:"klay_getTransactionByBlockHashAndIndex",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/transaction/getTransactionByBlockHashAndIndex","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getTransactionByBlockNumberAndIndex",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling getTransactionByBlockNumberAndIndex");if(null==t)throw new Error("Missing the required parameter 'transactionIndex' when calling getTransactionByBlockNumberAndIndex");var i={method:"klay_getTransactionByBlockNumberAndIndex",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/transaction/getTransactionByBlockNumberAndIndex","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getTransactionByHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'transactionHash' when calling getTransactionByHash");var r={method:"klay_getTransactionByHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/transaction/getTransactionByHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getTransactionBySenderTxHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'transactionHash' when calling getTransactionBySenderTxHash");var r={method:"klay_getTransactionBySenderTxHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/transaction/getTransactionBySenderTxHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getTransactionCount",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'address' when calling getTransactionCount");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHashOrTag' when calling getTransactionCount");var i={method:"klay_getTransactionCount",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/account/getTransactionCount","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"getTransactionReceipt",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'transactionHash' when calling getTransactionReceipt");var r={method:"klay_getTransactionReceipt",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/transaction/getTransactionReceipt","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getTransactionReceiptBySenderTxHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hash' when calling getTransactionReceiptBySenderTxHash");var r={method:"klay_getTransactionReceiptBySenderTxHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/transaction/getTransactionReceiptBySenderTxHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"isContractAccount",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'address' when calling isContractAccount");if(null==t)throw new Error("Missing the required parameter 'blockNumberOrHashOrTag' when calling isContractAccount");var i={method:"klay_isContractAccount",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/account/isContractAccount","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"isParallelDBWrite",value:function(e,t){e=e||{};return this.apiClient.callApi("/klay/configuration/isParallelDBWrite","POST",null,null,null,null,{method:"klay_isParallelDBWrite",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"isSenderTxHashIndexingEnabled",value:function(e,t){e=e||{};return this.apiClient.callApi("/klay/configuration/isSenderTxHashIndexingEnabled","POST",null,null,null,null,{method:"klay_isSenderTxHashIndexingEnabled",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"lowerBoundGasPrice",value:function(e,t){e=e||{};return this.apiClient.callApi("/klay/gas/lowerBoundGasPrice","POST",null,null,null,null,{method:"klay_lowerBoundGasPrice",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"maxPriorityFeePerGas",value:function(e,t){e=e||{};return this.apiClient.callApi("/klay/gas/maxPriorityFeePerGas","POST",null,null,null,null,{method:"klay_maxPriorityFeePerGas",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"newBlockFilter",value:function(e,t){e=e||{};return this.apiClient.callApi("/klay/filter/newBlockFilter","POST",null,null,null,null,{method:"klay_newBlockFilter",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"newFilter",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'filterOptions' when calling newFilter");var r={method:"klay_newFilter",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/filter/newFilter","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"newPendingTransactionFilter",value:function(e,t){e=e||{};return this.apiClient.callApi("/klay/filter/newPendingTransactionFilter","POST",null,null,null,null,{method:"klay_newPendingTransactionFilter",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"nodeAddress",value:function(e,t){e=e||{};return this.apiClient.callApi("/klay/miscellaneous/nodeAddress","POST",null,null,null,null,{method:"klay_nodeAddress",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"pendingTransactions",value:function(e,t){e=e||{};return this.apiClient.callApi("/klay/transaction/pendingTransactions","POST",null,null,null,null,{method:"klay_pendingTransactions",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"protocolVersion",value:function(e,t){e=e||{};return this.apiClient.callApi("/klay/configuration/protocolVersion","POST",null,null,null,null,{method:"klay_protocolVersion",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"recoverFromMessage",value:function(e,t,n,r,i){if(r=r||{},null==e)throw new Error("Missing the required parameter 'address' when calling recoverFromMessage");if(null==t)throw new Error("Missing the required parameter 'message' when calling recoverFromMessage");if(null==n)throw new Error("Missing the required parameter 'signature' when calling recoverFromMessage");var a=0,o={method:"klay_recoverFromMessage",id:1,jsonrpc:"2.0",params:[]};o.params.push(e),o.params.push(t),o.params.push(n);var s=r.blockNumberOrTag||r[a++]||"latest";if(null==s)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling recoverFromMessage");return o.params.push(s),this.apiClient.callApi("/klay/miscellaneous/recoverFromMessage","POST",null,null,null,null,o,[],["application/json"],["application/json"],"object",null,i)}},{key:"recoverFromTransaction",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'rlpEncodedTransaction' when calling recoverFromTransaction");var r=0,i={method:"klay_recoverFromTransaction",id:1,jsonrpc:"2.0",params:[]};i.params.push(e);var a=t.blockNumberOrTag||t[r++]||"latest";if(null==a)throw new Error("Missing the required parameter 'blockNumberOrTag' when calling recoverFromTransaction");return i.params.push(a),this.apiClient.callApi("/klay/miscellaneous/recoverFromTransaction","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,n)}},{key:"resend",value:function(e,t,n,r,i){if(r=r||{},null==e)throw new Error("Missing the required parameter 'sendArgs' when calling resend");if(null==t)throw new Error("Missing the required parameter 'gasPrice' when calling resend");if(null==n)throw new Error("Missing the required parameter 'gasLimit' when calling resend");var a={method:"klay_resend",id:1,jsonrpc:"2.0",params:[]};return a.params.push(e),a.params.push(t),a.params.push(n),this.apiClient.callApi("/klay/resend","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,i)}},{key:"rewardbase",value:function(e,t){e=e||{};return this.apiClient.callApi("/klay/configuration/rewardbase","POST",null,null,null,null,{method:"klay_rewardbase",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"sendRawTransaction",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'singedTransactionData' when calling sendRawTransaction");var r={method:"klay_sendRawTransaction",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/transaction/sendRawTransaction","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"sendTransaction",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'klaytnTransactionTypes' when calling sendTransaction");var r={method:"klay_sendTransaction",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/transaction/sendTransaction","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"sendTransactionAsFeePayer",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'klaytnTransactionTypes' when calling sendTransactionAsFeePayer");var r={method:"klay_sendTransactionAsFeePayer",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/transaction/sendTransactionAsFeePayer","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"sha3",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'data' when calling sha3");var r={method:"klay_sha3",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/miscellaneous/sha3","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"sign",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'account' when calling sign");if(null==t)throw new Error("Missing the required parameter 'message' when calling sign");var i={method:"klay_sign",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/klay/account/sign","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"signTransaction",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'transactionData' when calling signTransaction");var r={method:"klay_signTransaction",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/transaction/signTransaction","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"signTransactionAsFeePayer",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'transactionData' when calling signTransactionAsFeePayer");var r={method:"klay_signTransactionAsFeePayer",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/transaction/signTransactionAsFeePayer","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"subscribe",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'notificationType' when calling subscribe");var r={method:"klay_subscribe",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/filter/subscribe","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"syncing",value:function(e,t){e=e||{};return this.apiClient.callApi("/klay/block/syncing","POST",null,null,null,null,{method:"klay_syncing",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"uninstallFilter",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'filter' when calling uninstallFilter");var r={method:"klay_uninstallFilter",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/filter/uninstallFilter","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"unsubscribe",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'subscriptionId' when calling unsubscribe");var r={method:"klay_unsubscribe",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/klay/filter/unsubscribe","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"upperBoundGasPrice",value:function(e,t){e=e||{};return this.apiClient.callApi("/klay/gas/upperBoundGasPrice","POST",null,null,null,null,{method:"klay_upperBoundGasPrice",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}}])}()},4367:(e,t)=>{"use strict";var n=t;function r(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",n=0;n<e.length;n++)t+=r(e[n].toString(16));return t}n.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"!=typeof e){for(var r=0;r<e.length;r++)n[r]=0|e[r];return n}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),r=0;r<e.length;r+=2)n.push(parseInt(e[r]+e[r+1],16));else for(r=0;r<e.length;r++){var i=e.charCodeAt(r),a=i>>8,o=255&i;a?n.push(a,o):n.push(o)}return n},n.zero2=r,n.toHex=i,n.encode=function(e,t){return"hex"===t?i(e):e}},4945:(e,t,n)=>{var r="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==n.g&&n.g,i=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==n.g&&n.g||{},i="URLSearchParams"in r,a="Symbol"in r&&"iterator"in Symbol,o="FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in r,u="ArrayBuffer"in r;if(u)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function d(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return a&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function m(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function g(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function y(e){var t=new FileReader,n=g(t);return t.readAsArrayBuffer(e),n}function b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u&&o&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=m(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return m(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(o)return this.blob().then(y);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,n,r,i,a=m(this);if(a)return a;if(this._bodyBlob)return e=this._bodyBlob,n=g(t=new FileReader),i=(r=/charset=([A-Za-z0-9_-]+)/.exec(e.type))?r[1]:"utf-8",t.readAsText(e,i),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s&&(this.formData=function(){return this.text().then(x)}),this.json=function(){return this.text().then(JSON.parse)},this}p.prototype.append=function(e,t){e=d(e),t=h(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},p.prototype.delete=function(e){delete this.map[d(e)]},p.prototype.get=function(e){return e=d(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(d(e))},p.prototype.set=function(e,t){this.map[d(e)]=h(t)},p.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},p.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),f(e)},p.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),f(e)},p.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),f(e)},a&&(p.prototype[Symbol.iterator]=p.prototype.entries);var w=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function A(e,t){if(!(this instanceof A))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,i,a=(t=t||{}).body;if(e instanceof A){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,a||null==e._bodyInit||(a=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(i=(n=t.method||this.method||"GET").toUpperCase(),w.indexOf(i)>-1?i:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in r)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(a),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function x(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function k(e,t){if(!(this instanceof k))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})},v.call(A.prototype),v.call(k.prototype),k.prototype.clone=function(){return new k(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},k.error=function(){var e=new k(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var _=[301,302,303,307,308];k.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new k(null,{status:t,headers:{location:e}})},t.DOMException=r.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function P(e,n){return new Promise(function(i,a){var s=new A(e,n);if(s.signal&&s.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function l(){c.abort()}if(c.onload=function(){var e,t,n={statusText:c.statusText,headers:(e=c.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();try{t.append(r,i)}catch(e){console.warn("Response "+e.message)}}}),t)};0===s.url.indexOf("file://")&&(c.status<200||c.status>599)?n.status=200:n.status=c.status,n.url="responseURL"in c?c.responseURL:n.headers.get("X-Request-URL");var r="response"in c?c.response:c.responseText;setTimeout(function(){i(new k(r,n))},0)},c.onerror=function(){setTimeout(function(){a(new TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){a(new TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){a(new t.DOMException("Aborted","AbortError"))},0)},c.open(s.method,function(e){try{return""===e&&r.location.href?r.location.href:e}catch(t){return e}}(s.url),!0),"include"===s.credentials?c.withCredentials=!0:"omit"===s.credentials&&(c.withCredentials=!1),"responseType"in c&&(o?c.responseType="blob":u&&(c.responseType="arraybuffer")),n&&"object"==typeof n.headers&&!(n.headers instanceof p||r.Headers&&n.headers instanceof r.Headers)){var f=[];Object.getOwnPropertyNames(n.headers).forEach(function(e){f.push(d(e)),c.setRequestHeader(e,h(n.headers[e]))}),s.headers.forEach(function(e,t){-1===f.indexOf(t)&&c.setRequestHeader(t,e)})}else s.headers.forEach(function(e,t){c.setRequestHeader(t,e)});s.signal&&(s.signal.addEventListener("abort",l),c.onreadystatechange=function(){4===c.readyState&&s.signal.removeEventListener("abort",l)}),c.send(void 0===s._bodyInit?null:s._bodyInit)})}P.polyfill=!0,r.fetch||(r.fetch=P,r.Headers=p,r.Request=A,r.Response=k),t.Headers=p,t.Request=A,t.Response=k,t.fetch=P}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var a=r.fetch?r:i;(t=a.fetch).default=a.fetch,t.fetch=a.fetch,t.Headers=a.Headers,t.Request=a.Request,t.Response=a.Response,e.exports=t},5017:()=>{},5037:(e,t,n)=>{var r;function i(e){this.rand=e}if(e.exports=function(e){return r||(r=new i(null)),r.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n<t.length;n++)t[n]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var a=n(3776);if("function"!=typeof a.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return a.randomBytes(e)}}catch(e){}},5125:e=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}e.exports=function(e){return null!==e&&"object"===t(e)}},5734:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i;"undefined"!=typeof window?i=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),i=void 0):i=self;var a=n(5971),o=n(8463),s=n(1948),u=n(5125),c=n(9450),l=n(1380);function d(){}e.exports=function(e,n){return"function"==typeof n?new t.Request("GET",e).end(n):1===arguments.length?new t.Request("GET",e):new t.Request(e,n)};var h=t=e.exports;t.Request=v,h.getXHR=function(){if(i.XMLHttpRequest&&(!i.location||"file:"!==i.location.protocol||!i.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw new Error("Browser-only version of superagent could not find XHR")};var f="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};function p(e){if(!u(e))return e;var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&m(t,n,e[n]);return t.join("&")}function m(e,t,n){if(void 0!==n)if(null!==n)if(Array.isArray(n))n.forEach(function(n){m(e,t,n)});else if(u(n))for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&m(e,"".concat(t,"[").concat(r,"]"),n[r]);else e.push(encodeURI(t)+"="+encodeURIComponent(n));else e.push(encodeURI(t))}function g(e){for(var t,n,r={},i=e.split("&"),a=0,o=i.length;a<o;++a)-1===(n=(t=i[a]).indexOf("="))?r[decodeURIComponent(t)]="":r[decodeURIComponent(t.slice(0,n))]=decodeURIComponent(t.slice(n+1));return r}function y(e){return/[/+]json($|[^-\w])/.test(e)}function b(e){this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.headers=function(e){for(var t,n,r,i,a=e.split(/\r?\n/),o={},s=0,u=a.length;s<u;++s)-1!==(t=(n=a[s]).indexOf(":"))&&(r=n.slice(0,t).toLowerCase(),i=f(n.slice(t+1)),o[r]=i);return o}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&e._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function v(e,t){var n=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e,t=null,r=null;try{r=new b(n)}catch(e){return(t=new Error("Parser is unable to parse the response")).parse=!0,t.original=e,n.xhr?(t.rawResponse=void 0===n.xhr.responseType?n.xhr.responseText:n.xhr.response,t.status=n.xhr.status?n.xhr.status:null,t.statusCode=t.status):(t.rawResponse=null,t.status=null),n.callback(t)}n.emit("response",r);try{n._isResponseOK(r)||(e=new Error(r.statusText||r.text||"Unsuccessful HTTP response"))}catch(t){e=t}e?(e.original=t,e.response=r,e.status=r.status,n.callback(e,r)):n.callback(null,r)})}function w(e,t,n){var r=h("DELETE",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}h.serializeObject=p,h.parseString=g,h.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},h.serialize={"application/x-www-form-urlencoded":p,"application/json":o},h.parse={"application/x-www-form-urlencoded":g,"application/json":JSON.parse},c(b.prototype),b.prototype._parseBody=function(e){var t=h.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&y(this.type)&&(t=h.parse["application/json"]),t&&e&&(e.length>0||e instanceof Object)?t(e):null)},b.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,r="cannot ".concat(t," ").concat(n," (").concat(this.status,")"),i=new Error(r);return i.status=this.status,i.method=t,i.url=n,i},h.Response=b,a(v.prototype),s(v.prototype),v.prototype.type=function(e){return this.set("Content-Type",h.types[e]||e),this},v.prototype.accept=function(e){return this.set("Accept",h.types[e]||e),this},v.prototype.auth=function(e,t,n){return 1===arguments.length&&(t=""),"object"===r(t)&&null!==t&&(n=t,t=""),n||(n={type:"function"==typeof btoa?"basic":"auto"}),this._auth(e,t,n,function(e){if("function"==typeof btoa)return btoa(e);throw new Error("Cannot use basic auth, btoa is not a function")})},v.prototype.query=function(e){return"string"!=typeof e&&(e=p(e)),e&&this._query.push(e),this},v.prototype.attach=function(e,t,n){if(t){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,n||t.name)}return this},v.prototype._getFormData=function(){return this._formData||(this._formData=new i.FormData),this._formData},v.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();var n=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),n(e,t)},v.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},v.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},v.prototype.ca=v.prototype.agent,v.prototype.buffer=v.prototype.ca,v.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},v.prototype.pipe=v.prototype.write,v.prototype._isHost=function(e){return e&&"object"===r(e)&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},v.prototype.end=function(e){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||d,this._finalizeQueryString(),this._end()},v.prototype._setUploadTimeout=function(){var e=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout(function(){e._timeoutError("Upload timeout of ",e._uploadTimeout,"ETIMEDOUT")},this._uploadTimeout))},v.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var e=this;this.xhr=h.getXHR();var t=this.xhr,n=this._formData||this._data;this._setTimeouts(),t.onreadystatechange=function(){var n=t.readyState;if(n>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4===n){var r;try{r=t.status}catch(e){r=0}if(!r){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var r=function(t,n){n.total>0&&(n.percent=n.loaded/n.total*100,100===n.percent&&clearTimeout(e._uploadTimeoutTimer)),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{t.addEventListener("progress",r.bind(null,"download")),t.upload&&t.upload.addEventListener("progress",r.bind(null,"upload"))}catch(e){}t.upload&&this._setUploadTimeout();try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof n&&!this._isHost(n)){var i=this._header["content-type"],a=this._serializer||h.serialize[i?i.split(";")[0]:""];!a&&y(i)&&(a=h.serialize["application/json"]),a&&(n=a(n))}for(var o in this.header)null!==this.header[o]&&Object.prototype.hasOwnProperty.call(this.header,o)&&t.setRequestHeader(o,this.header[o]);this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0===n?null:n)},h.agent=function(){return new l},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(e){l.prototype[e.toLowerCase()]=function(t,n){var r=new h.Request(e,t);return this._setDefaults(r),n&&r.end(n),r}}),l.prototype.del=l.prototype.delete,h.get=function(e,t,n){var r=h("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},h.head=function(e,t,n){var r=h("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},h.options=function(e,t,n){var r=h("OPTIONS",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},h.del=w,h.delete=w,h.patch=function(e,t,n){var r=h("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},h.post=function(e,t,n){var r=h("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},h.put=function(e,t,n){var r=h("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}},5839:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(1527))&&r.__esModule?r:{default:r};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}t.default=function(){return function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.apiClient=t||i.default.instance},[{key:"convertChildChainBlockHashToParentChainTxHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockHash' when calling convertChildChainBlockHashToParentChainTxHash");var r={method:"mainbridge_convertChildChainBlockHashToParentChainTxHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/mainbridge/convertChildChainBlockHashToParentChainTxHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getChildChainIndexingEnabled",value:function(e,t){e=e||{};return this.apiClient.callApi("/mainbridge/getChildChainIndexingEnabled","POST",null,null,null,null,{method:"mainbridge_getChildChainIndexingEnabled",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}}])}()},5971:e=>{function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i<r.length;i++)if((n=r[i])===t||n.fn===t){r.splice(i,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}},6166:(e,t,n)=>{"use strict";var r=n(7426),i=n(3349);function a(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=a,a.prototype.update=function(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},a.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},a.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,r=new Array(n+this.padLength);r[0]=128;for(var i=1;i<n;i++)r[i]=0;if(e<<=3,"big"===this.endian){for(var a=8;a<this.padLength;a++)r[i++]=0;r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=e>>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,a=8;a<this.padLength;a++)r[i++]=0;return r}},6225:(e,t,n)=>{"use strict";var r=n(7426).rotr32;function i(e,t,n){return e&t^~e&n}function a(e,t,n){return e&t^e&n^t&n}function o(e,t,n){return e^t^n}t.ft_1=function(e,t,n,r){return 0===e?i(t,n,r):1===e||3===e?o(t,n,r):2===e?a(t,n,r):void 0},t.ch32=i,t.maj32=a,t.p32=o,t.s0_256=function(e){return r(e,2)^r(e,13)^r(e,22)},t.s1_256=function(e){return r(e,6)^r(e,11)^r(e,25)},t.g0_256=function(e){return r(e,7)^r(e,18)^e>>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},6229:(e,t,n)=>{"use strict";t.sha1=n(3917),t.sha224=n(7714),t.sha256=n(2287),t.sha384=n(1911),t.sha512=n(7766)},6661:(e,t,n)=>{"use strict";var r=n(7011),i=r.assert,a=r.parseBytes,o=r.cachedProperty;function s(e,t){this.eddsa=e,this._secret=a(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=a(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},o(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),o(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),o(s,"privBytes",function(){var e=this.eddsa,t=this.hash(),n=e.encodingLength-1,r=t.slice(0,e.encodingLength);return r[0]&=248,r[n]&=127,r[n]|=64,r}),o(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),o(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),o(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),r.encode(this.secret(),e)},s.prototype.getPublic=function(e){return r.encode(this.pubBytes(),e)},e.exports=s},6677:(e,t,n)=>{"use strict";var r=n(8490),i=n(7011),a=i.getNAF,o=i.getJSF,s=i.assert;function u(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var n=e._getDoubles(),r=a(t,1,this._bitLength),i=(1<<n.step+1)-(n.step%2==0?2:1);i/=3;var o,u,c=[];for(o=0;o<r.length;o+=n.step){u=0;for(var l=o+n.step-1;l>=o;l--)u=(u<<1)+r[l];c.push(u)}for(var d=this.jpoint(null,null,null),h=this.jpoint(null,null,null),f=i;f>0;f--){for(o=0;o<c.length;o++)(u=c[o])===f?h=h.mixedAdd(n.points[o]):u===-f&&(h=h.mixedAdd(n.points[o].neg()));d=d.add(h)}return d.toP()},u.prototype._wnafMul=function(e,t){var n=4,r=e._getNAFPoints(n);n=r.wnd;for(var i=r.points,o=a(t,n,this._bitLength),u=this.jpoint(null,null,null),c=o.length-1;c>=0;c--){for(var l=0;c>=0&&0===o[c];c--)l++;if(c>=0&&l++,u=u.dblp(l),c<0)break;var d=o[c];s(0!==d),u="affine"===e.type?d>0?u.mixedAdd(i[d-1>>1]):u.mixedAdd(i[-d-1>>1].neg()):d>0?u.add(i[d-1>>1]):u.add(i[-d-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,n,r,i){var s,u,c,l=this._wnafT1,d=this._wnafT2,h=this._wnafT3,f=0;for(s=0;s<r;s++){var p=(c=t[s])._getNAFPoints(e);l[s]=p.wnd,d[s]=p.points}for(s=r-1;s>=1;s-=2){var m=s-1,g=s;if(1===l[m]&&1===l[g]){var y=[t[m],null,null,t[g]];0===t[m].y.cmp(t[g].y)?(y[1]=t[m].add(t[g]),y[2]=t[m].toJ().mixedAdd(t[g].neg())):0===t[m].y.cmp(t[g].y.redNeg())?(y[1]=t[m].toJ().mixedAdd(t[g]),y[2]=t[m].add(t[g].neg())):(y[1]=t[m].toJ().mixedAdd(t[g]),y[2]=t[m].toJ().mixedAdd(t[g].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=o(n[m],n[g]);for(f=Math.max(v[0].length,f),h[m]=new Array(f),h[g]=new Array(f),u=0;u<f;u++){var w=0|v[0][u],A=0|v[1][u];h[m][u]=b[3*(w+1)+(A+1)],h[g][u]=0,d[m]=y}}else h[m]=a(n[m],l[m],this._bitLength),h[g]=a(n[g],l[g],this._bitLength),f=Math.max(h[m].length,f),f=Math.max(h[g].length,f)}var x=this.jpoint(null,null,null),k=this._wnafT4;for(s=f;s>=0;s--){for(var _=0;s>=0;){var P=!0;for(u=0;u<r;u++)k[u]=0|h[u][s],0!==k[u]&&(P=!1);if(!P)break;_++,s--}if(s>=0&&_++,x=x.dblp(_),s<0)break;for(u=0;u<r;u++){var E=k[u];0!==E&&(E>0?c=d[u][E-1>>1]:E<0&&(c=d[u][-E-1>>1].neg()),x="affine"===c.type?x.mixedAdd(c):x.add(c))}}for(s=0;s<r;s++)d[s]=null;return i?x:x.toP()},u.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var n=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*n)return 6===e[0]?s(e[e.length-1]%2==0):7===e[0]&&s(e[e.length-1]%2==1),this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));if((2===e[0]||3===e[0])&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),3===e[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(e){return this.encode(e,!0)},c.prototype._encode=function(e){var t=this.curve.p.byteLength(),n=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",t))},c.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},c.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},c.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i<t;i+=e){for(var a=0;a<e;a++)r=r.dbl();n.push(r)}return{step:e,points:n}},c.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],n=(1<<e)-1,r=1===n?null:this.dbl(),i=1;i<n;i++)t[i]=t[i-1].add(r);return{wnd:e,points:t}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(e){for(var t=this,n=0;n<e;n++)t=t.dbl();return t}},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},6729:(e,t,n)=>{"use strict";var r=t;r.version=n(1636).rE,r.utils=n(7011),r.rand=n(5037),r.curve=n(894),r.curves=n(480),r.ec=n(7447),r.eddsa=n(8650)},6784:(e,t,n)=>{"use strict";var r=n(7426),i=n(6166),a=r.rotl32,o=r.sum32,s=r.sum32_3,u=r.sum32_4,c=i.BlockHash;function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function d(e,t,n,r){return e<=15?t^n^r:e<=31?t&n|~t&r:e<=47?(t|~n)^r:e<=63?t&r|n&~r:t^(n|~r)}function h(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function f(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}r.inherits(l,c),t.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(e,t){for(var n=this.h[0],r=this.h[1],i=this.h[2],c=this.h[3],l=this.h[4],b=n,v=r,w=i,A=c,x=l,k=0;k<80;k++){var _=o(a(u(n,d(k,r,i,c),e[p[k]+t],h(k)),g[k]),l);n=l,l=c,c=a(i,10),i=r,r=_,_=o(a(u(b,d(79-k,v,w,A),e[m[k]+t],f(k)),y[k]),x),b=x,x=A,A=a(w,10),w=v,v=_}_=s(this.h[1],i,A),this.h[1]=s(this.h[2],c,x),this.h[2]=s(this.h[3],l,b),this.h[3]=s(this.h[4],n,v),this.h[4]=s(this.h[0],r,w),this.h[0]=_},l.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h,"little"):r.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],y=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},7011:(e,t,n)=>{"use strict";var r=t,i=n(8490),a=n(3349),o=n(4367);r.assert=a,r.toArray=o.toArray,r.zero2=o.zero2,r.toHex=o.toHex,r.encode=o.encode,r.getNAF=function(e,t,n){var r,i=new Array(Math.max(e.bitLength(),n)+1);for(r=0;r<i.length;r+=1)i[r]=0;var a=1<<t+1,o=e.clone();for(r=0;r<i.length;r++){var s,u=o.andln(a-1);o.isOdd()?(s=u>(a>>1)-1?(a>>1)-u:u,o.isubn(s)):s=0,i[r]=s,o.iushrn(1)}return i},r.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,i=0,a=0;e.cmpn(-i)>0||t.cmpn(-a)>0;){var o,s,u=e.andln(3)+i&3,c=t.andln(3)+a&3;3===u&&(u=-1),3===c&&(c=-1),o=1&u?3!=(r=e.andln(7)+i&7)&&5!==r||2!==c?u:-u:0,n[0].push(o),s=1&c?3!=(r=t.andln(7)+a&7)&&5!==r||2!==u?c:-c:0,n[1].push(s),2*i===o+1&&(i=1-i),2*a===s+1&&(a=1-a),e.iushrn(1),t.iushrn(1)}return n},r.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new i(e,"hex","le")}},7426:(e,t,n)=>{"use strict";var r=n(3349),i=n(6698);function a(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)n.push(parseInt(e[i]+e[i+1],16))}else for(var r=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?n[r++]=o:o<2048?(n[r++]=o>>6|192,n[r++]=63&o|128):a(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128)}else for(i=0;i<e.length;i++)n[i]=0|e[i];return n},t.toHex=function(e){for(var t="",n=0;n<e.length;n++)t+=s(e[n].toString(16));return t},t.htonl=o,t.toHex32=function(e,t){for(var n="",r=0;r<e.length;r++){var i=e[r];"little"===t&&(i=o(i)),n+=u(i.toString(16))}return n},t.zero2=s,t.zero8=u,t.join32=function(e,t,n,i){var a=n-t;r(a%4==0);for(var o=new Array(a/4),s=0,u=t;s<o.length;s++,u+=4){var c;c="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],o[s]=c>>>0}return o},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r<e.length;r++,i+=4){var a=e[r];"big"===t?(n[i]=a>>>24,n[i+1]=a>>>16&255,n[i+2]=a>>>8&255,n[i+3]=255&a):(n[i+3]=a>>>24,n[i+2]=a>>>16&255,n[i+1]=a>>>8&255,n[i]=255&a)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,i){return e+t+n+r+i>>>0},t.sum64=function(e,t,n,r){var i=e[t],a=r+e[t+1]>>>0,o=(a<r?1:0)+n+i;e[t]=o>>>0,e[t+1]=a},t.sum64_hi=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,i,a,o,s){var u=0,c=t;return u+=(c=c+r>>>0)<t?1:0,u+=(c=c+a>>>0)<a?1:0,e+n+i+o+(u+=(c=c+s>>>0)<s?1:0)>>>0},t.sum64_4_lo=function(e,t,n,r,i,a,o,s){return t+r+a+s>>>0},t.sum64_5_hi=function(e,t,n,r,i,a,o,s,u,c){var l=0,d=t;return l+=(d=d+r>>>0)<t?1:0,l+=(d=d+a>>>0)<a?1:0,l+=(d=d+s>>>0)<s?1:0,e+n+i+o+u+(l+=(d=d+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,n,r,i,a,o,s,u,c){return t+r+a+s+c>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},7447:(e,t,n)=>{"use strict";var r=n(8490),i=n(2723),a=n(7011),o=n(480),s=n(5037),u=a.assert,c=n(1200),l=n(8545);function d(e){if(!(this instanceof d))return new d(e);"string"==typeof e&&(u(Object.prototype.hasOwnProperty.call(o,e),"Unknown curve "+e),e=o[e]),e instanceof o.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=d,d.prototype.keyPair=function(e){return new c(this,e)},d.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},d.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},d.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),a=this.n.sub(new r(2));;){var o=new r(t.generate(n));if(!(o.cmp(a)>0))return o.iaddn(1),this.keyFromPrivate(o)}},d.prototype._truncateToN=function(e,t,n){var i;if(r.isBN(e)||"number"==typeof e)i=(e=new r(e,16)).byteLength();else if("object"==typeof e)i=e.length,e=new r(e,16);else{var a=e.toString();i=a.length+1>>>1,e=new r(a,16)}"number"!=typeof n&&(n=8*i);var o=n-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},d.prototype.sign=function(e,t,n,a){if("object"==typeof n&&(a=n,n=null),a||(a={}),"string"!=typeof e&&"number"!=typeof e&&!r.isBN(e)){u("object"==typeof e&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),u(e.length>>>0===e.length);for(var o=0;o<e.length;o++)u((255&e[o])===e[o])}t=this.keyFromPrivate(t,n),e=this._truncateToN(e,!1,a.msgBitLength),u(!e.isNeg(),"Can not sign a negative message");var s=this.n.byteLength(),c=t.getPrivate().toArray("be",s),d=e.toArray("be",s);u(new r(d).eq(e),"Can not sign message");for(var h=new i({hash:this.hash,entropy:c,nonce:d,pers:a.pers,persEnc:a.persEnc||"utf8"}),f=this.n.sub(new r(1)),p=0;;p++){var m=a.k?a.k(p):new r(h.generate(this.n.byteLength()));if(!((m=this._truncateToN(m,!0)).cmpn(1)<=0||m.cmp(f)>=0)){var g=this.g.mul(m);if(!g.isInfinity()){var y=g.getX(),b=y.umod(this.n);if(0!==b.cmpn(0)){var v=m.invm(this.n).mul(b.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var w=(g.getY().isOdd()?1:0)|(0!==y.cmp(b)?2:0);return a.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),w^=1),new l({r:b,s:v,recoveryParam:w})}}}}}},d.prototype.verify=function(e,t,n,r,i){i||(i={}),e=this._truncateToN(e,!1,i.msgBitLength),n=this.keyFromPublic(n,r);var a=(t=new l(t,"hex")).r,o=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,u=o.invm(this.n),c=u.mul(e).umod(this.n),d=u.mul(a).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,n.getPublic(),d)).isInfinity()&&s.eqXToP(a):!(s=this.g.mulAdd(c,n.getPublic(),d)).isInfinity()&&0===s.getX().umod(this.n).cmp(a)},d.prototype.recoverPubKey=function(e,t,n,i){u((3&n)===n,"The recovery param is more than two bits"),t=new l(t,i);var a=this.n,o=new r(e),s=t.r,c=t.s,d=1&n,h=n>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),d):this.curve.pointFromX(s,d);var f=t.r.invm(a),p=a.sub(o).mul(f).umod(a),m=c.mul(f).umod(a);return this.g.mulAdd(p,s,m)},d.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new l(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(n))return i}throw new Error("Unable to find valid recovery factor")}},7462:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(1527))&&r.__esModule?r:{default:r};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}t.default=function(){return function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.apiClient=t||i.default.instance},[{key:"backtraceAt",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'location' when calling backtraceAt");var r={method:"debug_backtraceAt",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/logging/backtraceAt","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"blockProfile",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'file' when calling blockProfile");if(null==t)throw new Error("Missing the required parameter 'seconds' when calling blockProfile");var i={method:"debug_blockProfile",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/debug/profiling/blockProfile","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"chaindbCompact",value:function(e,t){e=e||{};return this.apiClient.callApi("/debug/chaindbCompact","POST",null,null,null,null,{method:"debug_chaindbCompact",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"chaindbProperty",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'string' when calling chaindbProperty");var r={method:"debug_chaindbProperty",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/chaindbProperty","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"cpuProfile",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'file' when calling cpuProfile");if(null==t)throw new Error("Missing the required parameter 'seconds' when calling cpuProfile");var i={method:"debug_cpuProfile",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/debug/profiling/cpuProfile","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"dumpBlock",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrHash' when calling dumpBlock");var r={method:"debug_dumpBlock",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/blockchainInspection/dumpBlock","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"dumpStateTrie",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'number' when calling dumpStateTrie");var r={method:"debug_dumpStateTrie",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/blockchainInspection/dumpStateTrie","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"freeOSMemory",value:function(e,t){e=e||{};return this.apiClient.callApi("/debug/runtimeDebugging/freeOSMemory","POST",null,null,null,null,{method:"debug_freeOSMemory",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"gcStats",value:function(e,t){e=e||{};return this.apiClient.callApi("/debug/runtimeDebugging/gcStats","POST",null,null,null,null,{method:"debug_gcStats",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"getBadBlocks",value:function(e,t){e=e||{};return this.apiClient.callApi("/debug/blockchainInspection/getBadBlocks","POST",null,null,null,null,{method:"debug_getBadBlocks",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"getBlockRlp",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrHash' when calling getBlockRlp");var r={method:"debug_getBlockRlp",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/blockchainInspection/getBlockRlp","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"getModifiedAccountsByHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'startBlockHash' when calling getModifiedAccountsByHash");var r=0,i={method:"debug_getModifiedAccountsByHash",id:1,jsonrpc:"2.0",params:[]};i.params.push(e);var a=t.endBlockHash||t[r++]||"latest";if(null==a)throw new Error("Missing the required parameter 'endBlockHash' when calling getModifiedAccountsByHash");return i.params.push(a),this.apiClient.callApi("/debug/blockchainInspection/getModifiedAccountsByHash","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,n)}},{key:"getModifiedAccountsByNumber",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'startBlockNum' when calling getModifiedAccountsByNumber");var r=0,i={method:"debug_getModifiedAccountsByNumber",id:1,jsonrpc:"2.0",params:[]};i.params.push(e);var a=t.endBlockNum||t[r++]||"latest";if(null==a)throw new Error("Missing the required parameter 'endBlockNum' when calling getModifiedAccountsByNumber");return i.params.push(a),this.apiClient.callApi("/debug/blockchainInspection/getModifiedAccountsByNumber","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,n)}},{key:"getModifiedStorageNodesByNumber",value:function(e,t,n,r,i){if(r=r||{},null==e)throw new Error("Missing the required parameter 'address' when calling getModifiedStorageNodesByNumber");if(null==t)throw new Error("Missing the required parameter 'startBlockNum' when calling getModifiedStorageNodesByNumber");if(null==n)throw new Error("Missing the required parameter 'endBlockNum' when calling getModifiedStorageNodesByNumber");var a={method:"debug_getModifiedStorageNodesByNumber",id:1,jsonrpc:"2.0",params:[]};return a.params.push(e),a.params.push(t),a.params.push(n),this.apiClient.callApi("/debug/getModifiedStorageNodesByNumber","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,i)}},{key:"goTrace",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'file' when calling goTrace");if(null==t)throw new Error("Missing the required parameter 'seconds' when calling goTrace");var i={method:"debug_goTrace",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/debug/runtimeTracing/goTrace","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"isPProfRunning",value:function(e,t){e=e||{};return this.apiClient.callApi("/debug/profiling/isPProfRunning","POST",null,null,null,null,{method:"debug_isPProfRunning",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"memStats",value:function(e,t){e=e||{};return this.apiClient.callApi("/debug/runtimeDebugging/memStats","POST",null,null,null,null,{method:"debug_memStats",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"metrics",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'raw' when calling metrics");var r={method:"debug_metrics",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/runtimeDebugging/metrics","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"mutexProfile",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'file' when calling mutexProfile");if(null==t)throw new Error("Missing the required parameter 'seconds' when calling mutexProfile");var i={method:"debug_mutexProfile",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/debug/profiling/mutexProfile","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"preimage",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hash' when calling preimage");var r={method:"debug_preimage",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/blockchainInspection/preimage","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"printBlock",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumberOrHash' when calling printBlock");var r={method:"debug_printBlock",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/blockchainInspection/printBlock","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"seedHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockNumber' when calling seedHash");var r={method:"debug_seedHash",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/seedHash","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"setBlockProfileRate",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'rate' when calling setBlockProfileRate");var r={method:"debug_setBlockProfileRate",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/profiling/setBlockProfileRate","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"setGCPercent",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'percent' when calling setGCPercent");var r={method:"debug_setGCPercent",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/runtimeDebugging/setGCPercent","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"setHead",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'number' when calling setHead");var r={method:"debug_setHead",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/blockchainInspection/setHead","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"setMutexProfileFraction",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'rate' when calling setMutexProfileFraction");var r={method:"debug_setMutexProfileFraction",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/setMutexProfileFraction","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"setVMLogTarget",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'target' when calling setVMLogTarget");var r={method:"debug_setVMLogTarget",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/logging/setVMLogTarget","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"stacks",value:function(e,t){e=e||{};return this.apiClient.callApi("/debug/runtimeDebugging/stacks","POST",null,null,null,null,{method:"debug_stacks",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"standardTraceBadBlockToFile",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hash' when calling standardTraceBadBlockToFile");var r,i=0,a={method:"debug_standardTraceBadBlockToFile",id:1,jsonrpc:"2.0",params:[]};a.params.push(e),r={};var o=t.options||t[i++]||r;if(null==o)throw new Error("Missing the required parameter 'options' when calling standardTraceBadBlockToFile");return a.params.push(o),this.apiClient.callApi("/debug/vMStandardTracing/standardTraceBadBlockToFile","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,n)}},{key:"standardTraceBlockToFile",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hash' when calling standardTraceBlockToFile");var r,i=0,a={method:"debug_standardTraceBlockToFile",id:1,jsonrpc:"2.0",params:[]};a.params.push(e),r={};var o=t.options||t[i++]||r;if(null==o)throw new Error("Missing the required parameter 'options' when calling standardTraceBlockToFile");return a.params.push(o),this.apiClient.callApi("/debug/vMStandardTracing/standardTraceBlockToFile","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,n)}},{key:"startCPUProfile",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'file' when calling startCPUProfile");var r={method:"debug_startCPUProfile",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/profiling/startCPUProfile","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"startCollectingTrieStats",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'address' when calling startCollectingTrieStats");var r={method:"debug_startCollectingTrieStats",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/blockchainInspection/startCollectingTrieStats","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"startContractWarmUp",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'address' when calling startContractWarmUp");var r={method:"debug_startContractWarmUp",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/blockchainInspection/startContractWarmUp","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"startGoTrace",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'file' when calling startGoTrace");var r={method:"debug_startGoTrace",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/runtimeTracing/startGoTrace","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"startPProf",value:function(e,t){var n,r=0,i={method:"debug_startPProf",id:1,jsonrpc:"2.0",params:[]},a=null;if(null==(n=(e=e||{}).address||e[r++]||a))throw new Error("Missing the required parameter 'address' when calling startPProf");if(i.params.push(n),a=null,null==(n=e.port||e[r++]||a))throw new Error("Missing the required parameter 'port' when calling startPProf");return i.params.push(n),this.apiClient.callApi("/debug/profiling/startPProf","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,t)}},{key:"startWarmUp",value:function(e,t){e=e||{};return this.apiClient.callApi("/debug/blockchainInspection/startWarmUp","POST",null,null,null,null,{method:"debug_startWarmUp",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"stopCPUProfile",value:function(e,t){e=e||{};return this.apiClient.callApi("/debug/profiling/stopCPUProfile","POST",null,null,null,null,{method:"debug_stopCPUProfile",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"stopGoTrace",value:function(e,t){e=e||{};return this.apiClient.callApi("/debug/runtimeTracing/stopGoTrace","POST",null,null,null,null,{method:"debug_stopGoTrace",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"stopPProf",value:function(e,t){e=e||{};return this.apiClient.callApi("/debug/profiling/stopPProf","POST",null,null,null,null,{method:"debug_stopPProf",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"stopWarmUp",value:function(e,t){e=e||{};return this.apiClient.callApi("/debug/blockchainInspection/stopWarmUp","POST",null,null,null,null,{method:"debug_stopWarmUp",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"storageRangeAt",value:function(e,t,n,r,i,a,o){if(a=a||{},null==e)throw new Error("Missing the required parameter 'blockHash' when calling storageRangeAt");if(null==t)throw new Error("Missing the required parameter 'txIndex' when calling storageRangeAt");if(null==n)throw new Error("Missing the required parameter 'address' when calling storageRangeAt");if(null==r)throw new Error("Missing the required parameter 'keyStart' when calling storageRangeAt");if(null==i)throw new Error("Missing the required parameter 'maxResult' when calling storageRangeAt");var s={method:"debug_storageRangeAt",id:1,jsonrpc:"2.0",params:[]};return s.params.push(e),s.params.push(t),s.params.push(n),s.params.push(r),s.params.push(i),this.apiClient.callApi("/debug/storageRangeAt","POST",null,null,null,null,s,[],["application/json"],["application/json"],"object",null,o)}},{key:"traceBadBlock",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hash' when calling traceBadBlock");var r,i=0,a={method:"debug_traceBadBlock",id:1,jsonrpc:"2.0",params:[]};a.params.push(e),r={};var o=t.options||t[i++]||r;if(null==o)throw new Error("Missing the required parameter 'options' when calling traceBadBlock");return a.params.push(o),this.apiClient.callApi("/debug/vMTracing/traceBadBlock","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,n)}},{key:"traceBlock",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'blockRlp' when calling traceBlock");var r,i=0,a={method:"debug_traceBlock",id:1,jsonrpc:"2.0",params:[]};a.params.push(e),r={};var o=t.options||t[i++]||r;if(null==o)throw new Error("Missing the required parameter 'options' when calling traceBlock");return a.params.push(o),this.apiClient.callApi("/debug/vMTracing/traceBlock","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,n)}},{key:"traceBlockByHash",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'hash' when calling traceBlockByHash");var r,i=0,a={method:"debug_traceBlockByHash",id:1,jsonrpc:"2.0",params:[]};a.params.push(e),r={};var o=t.options||t[i++]||r;if(null==o)throw new Error("Missing the required parameter 'options' when calling traceBlockByHash");return a.params.push(o),this.apiClient.callApi("/debug/vMTracing/traceBlockByHash","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,n)}},{key:"traceBlockByNumber",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'number' when calling traceBlockByNumber");var r,i=0,a={method:"debug_traceBlockByNumber",id:1,jsonrpc:"2.0",params:[]};a.params.push(e),r={};var o=t.options||t[i++]||r;if(null==o)throw new Error("Missing the required parameter 'options' when calling traceBlockByNumber");return a.params.push(o),this.apiClient.callApi("/debug/vMTracing/traceBlockByNumber","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,n)}},{key:"traceBlockByNumberRange",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'startBlock' when calling traceBlockByNumberRange");if(null==t)throw new Error("Missing the required parameter 'endBlock' when calling traceBlockByNumberRange");var i,a=0,o={method:"debug_traceBlockByNumberRange",id:1,jsonrpc:"2.0",params:[]};o.params.push(e),o.params.push(t),i={};var s=n.options||n[a++]||i;if(null==s)throw new Error("Missing the required parameter 'options' when calling traceBlockByNumberRange");return o.params.push(s),this.apiClient.callApi("/debug/vMTracing/traceBlockByNumberRange","POST",null,null,null,null,o,[],["application/json"],["application/json"],"object",null,r)}},{key:"traceBlockFromFile",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'fileName' when calling traceBlockFromFile");var r,i=0,a={method:"debug_traceBlockFromFile",id:1,jsonrpc:"2.0",params:[]};a.params.push(e),r={};var o=t.options||t[i++]||r;if(null==o)throw new Error("Missing the required parameter 'options' when calling traceBlockFromFile");return a.params.push(o),this.apiClient.callApi("/debug/vMTracing/traceBlockFromFile","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,n)}},{key:"traceCall",value:function(e,t,n,r,i){if(r=r||{},null==e)throw new Error("Missing the required parameter 'tracerCallObject' when calling traceCall");if(null==t)throw new Error("Missing the required parameter 'blockNumber' when calling traceCall");if(null==n)throw new Error("Missing the required parameter 'traceObject' when calling traceCall");var a={method:"debug_traceCall",id:1,jsonrpc:"2.0",params:[]};return a.params.push(e),a.params.push(t),a.params.push(n),this.apiClient.callApi("/debug/vMTracing/traceCall","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,i)}},{key:"traceChain",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'startBlockNumber' when calling traceChain");if(null==t)throw new Error("Missing the required parameter 'number' when calling traceChain");var i,a=0,o={method:"debug_traceChain",id:1,jsonrpc:"2.0",params:[]};o.params.push(e),o.params.push(t),i={};var s=n.options||n[a++]||i;if(null==s)throw new Error("Missing the required parameter 'options' when calling traceChain");return o.params.push(s),this.apiClient.callApi("/debug/vMTracing/traceChain","POST",null,null,null,null,o,[],["application/json"],["application/json"],"object",null,r)}},{key:"traceTransaction",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'txHash' when calling traceTransaction");var r,i=0,a={method:"debug_traceTransaction",id:1,jsonrpc:"2.0",params:[]};a.params.push(e),r={};var o=t.options||t[i++]||r;if(null==o)throw new Error("Missing the required parameter 'options' when calling traceTransaction");return a.params.push(o),this.apiClient.callApi("/debug/vMTracing/traceTransaction","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,n)}},{key:"verbosity",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'level' when calling verbosity");var r={method:"debug_verbosity",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/logging/verbosity","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"verbosityByID",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'id' when calling verbosityByID");if(null==t)throw new Error("Missing the required parameter 'level' when calling verbosityByID");var i={method:"debug_verbosityByID",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/debug/logging/verbosityByID","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"verbosityByName",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'name' when calling verbosityByName");if(null==t)throw new Error("Missing the required parameter 'level' when calling verbosityByName");var i={method:"debug_verbosityByName",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/debug/logging/verbosityByName","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"vmodule",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'module' when calling vmodule");var r={method:"debug_vmodule",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/logging/vmodule","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"writeBlockProfile",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'file' when calling writeBlockProfile");var r={method:"debug_writeBlockProfile",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/profiling/writeBlockProfile","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"writeMemProfile",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'file' when calling writeMemProfile");var r={method:"debug_writeMemProfile",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/profiling/writeMemProfile","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"writeMutexProfile",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'file' when calling writeMutexProfile");var r={method:"debug_writeMutexProfile",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/debug/profiling/writeMutexProfile","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}}])}()},7714:(e,t,n)=>{"use strict";var r=n(7426),i=n(2287);function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}r.inherits(a,i),e.exports=a,a.blockSize=512,a.outSize=224,a.hmacStrength=192,a.padLength=64,a.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")}},7766:(e,t,n)=>{"use strict";var r=n(7426),i=n(6166),a=n(3349),o=r.rotr64_hi,s=r.rotr64_lo,u=r.shr64_hi,c=r.shr64_lo,l=r.sum64,d=r.sum64_hi,h=r.sum64_lo,f=r.sum64_4_hi,p=r.sum64_4_lo,m=r.sum64_5_hi,g=r.sum64_5_lo,y=i.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;y.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function w(e,t,n,r,i){var a=e&n^~e&i;return a<0&&(a+=4294967296),a}function A(e,t,n,r,i,a){var o=t&r^~t&a;return o<0&&(o+=4294967296),o}function x(e,t,n,r,i){var a=e&n^e&i^n&i;return a<0&&(a+=4294967296),a}function k(e,t,n,r,i,a){var o=t&r^t&a^r&a;return o<0&&(o+=4294967296),o}function _(e,t){var n=o(e,t,28)^o(t,e,2)^o(t,e,7);return n<0&&(n+=4294967296),n}function P(e,t){var n=s(e,t,28)^s(t,e,2)^s(t,e,7);return n<0&&(n+=4294967296),n}function E(e,t){var n=o(e,t,14)^o(e,t,18)^o(t,e,9);return n<0&&(n+=4294967296),n}function S(e,t){var n=s(e,t,14)^s(e,t,18)^s(t,e,9);return n<0&&(n+=4294967296),n}function T(e,t){var n=o(e,t,1)^o(e,t,8)^u(e,t,7);return n<0&&(n+=4294967296),n}function M(e,t){var n=s(e,t,1)^s(e,t,8)^c(e,t,7);return n<0&&(n+=4294967296),n}function I(e,t){var n=o(e,t,19)^o(t,e,29)^u(e,t,6);return n<0&&(n+=4294967296),n}function j(e,t){var n=s(e,t,19)^s(t,e,29)^c(e,t,6);return n<0&&(n+=4294967296),n}r.inherits(v,y),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var n=this.W,r=0;r<32;r++)n[r]=e[t+r];for(;r<n.length;r+=2){var i=I(n[r-4],n[r-3]),a=j(n[r-4],n[r-3]),o=n[r-14],s=n[r-13],u=T(n[r-30],n[r-29]),c=M(n[r-30],n[r-29]),l=n[r-32],d=n[r-31];n[r]=f(i,a,o,s,u,c,l,d),n[r+1]=p(i,a,o,s,u,c,l,d)}},v.prototype._update=function(e,t){this._prepareBlock(e,t);var n=this.W,r=this.h[0],i=this.h[1],o=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],f=this.h[6],p=this.h[7],y=this.h[8],b=this.h[9],v=this.h[10],T=this.h[11],M=this.h[12],I=this.h[13],j=this.h[14],C=this.h[15];a(this.k.length===n.length);for(var B=0;B<n.length;B+=2){var O=j,R=C,N=E(y,b),F=S(y,b),L=w(y,0,v,0,M),H=A(0,b,0,T,0,I),q=this.k[B],D=this.k[B+1],U=n[B],z=n[B+1],G=m(O,R,N,F,L,H,q,D,U,z),V=g(O,R,N,F,L,H,q,D,U,z);O=_(r,i),R=P(r,i),N=x(r,0,o,0,u),F=k(0,i,0,s,0,c);var W=d(O,R,N,F),K=h(O,R,N,F);j=M,C=I,M=v,I=T,v=y,T=b,y=d(f,p,G,V),b=h(p,p,G,V),f=u,p=c,u=o,c=s,o=r,s=i,r=d(G,V,W,K),i=h(G,V,W,K)}l(this.h,0,r,i),l(this.h,2,o,s),l(this.h,4,u,c),l(this.h,6,f,p),l(this.h,8,y,b),l(this.h,10,v,T),l(this.h,12,M,I),l(this.h,14,j,C)},v.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},7790:()=>{},7855:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=(r=n(1527))&&r.__esModule?r:{default:r};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}t.default=function(){return function(e,t){return t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.apiClient=t||i.default.instance},[{key:"deriveAccount",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'URL' when calling deriveAccount");if(null==t)throw new Error("Missing the required parameter 'path' when calling deriveAccount");var i=0,a={method:"personal_deriveAccount",id:1,jsonrpc:"2.0",params:[]};a.params.push(e),a.params.push(t);var o=n.pin||n[i++]||null;if(null==o)throw new Error("Missing the required parameter 'pin' when calling deriveAccount");return a.params.push(o),this.apiClient.callApi("/personal/deriveAccount","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,r)}},{key:"ecRecover",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'message' when calling ecRecover");if(null==t)throw new Error("Missing the required parameter 'signature' when calling ecRecover");var i={method:"personal_ecRecover",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/personal/ecRecover","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"importRawKey",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'keydata' when calling importRawKey");if(null==t)throw new Error("Missing the required parameter 'passphrase' when calling importRawKey");var i={method:"personal_importRawKey",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/personal/importRawKey","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"listAccounts",value:function(e,t){e=e||{};return this.apiClient.callApi("/personal/listAccounts","POST",null,null,null,null,{method:"personal_listAccounts",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"listWallets",value:function(e,t){e=e||{};return this.apiClient.callApi("/personal/listWallets","POST",null,null,null,null,{method:"personal_listWallets",id:1,jsonrpc:"2.0",params:[]},[],["application/json"],["application/json"],"object",null,t)}},{key:"lockAccount",value:function(e,t,n){if(t=t||{},null==e)throw new Error("Missing the required parameter 'address' when calling lockAccount");var r={method:"personal_lockAccount",id:1,jsonrpc:"2.0",params:[]};return r.params.push(e),this.apiClient.callApi("/personal/lockAccount","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,n)}},{key:"newAccount",value:function(e,t){var n=0,r={method:"personal_newAccount",id:1,jsonrpc:"2.0",params:[]},i=(e=e||{}).passphrase||e[n++]||null;if(null==i)throw new Error("Missing the required parameter 'passphrase' when calling newAccount");return r.params.push(i),this.apiClient.callApi("/personal/newAccount","POST",null,null,null,null,r,[],["application/json"],["application/json"],"object",null,t)}},{key:"openWallet",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'URL' when calling openWallet");if(null==t)throw new Error("Missing the required parameter 'passphrase' when calling openWallet");var i={method:"personal_openWallet",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/personal/openWallet","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"replaceRawKey",value:function(e,t,n,r,i){if(r=r||{},null==e)throw new Error("Missing the required parameter 'keydata' when calling replaceRawKey");if(null==t)throw new Error("Missing the required parameter 'oldPassphrase' when calling replaceRawKey");if(null==n)throw new Error("Missing the required parameter 'newPassphrase' when calling replaceRawKey");var a={method:"personal_replaceRawKey",id:1,jsonrpc:"2.0",params:[]};return a.params.push(e),a.params.push(t),a.params.push(n),this.apiClient.callApi("/personal/replaceRawKey","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,i)}},{key:"sendAccountUpdate",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'tx' when calling sendAccountUpdate");if(null==t)throw new Error("Missing the required parameter 'passphrase' when calling sendAccountUpdate");var i={method:"personal_sendAccountUpdate",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/personal/sendAccountUpdate","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"sendValueTransfer",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'tx' when calling sendValueTransfer");if(null==t)throw new Error("Missing the required parameter 'passphrase' when calling sendValueTransfer");var i={method:"personal_sendValueTransfer",id:1,jsonrpc:"2.0",params:[]};return i.params.push(e),i.params.push(t),this.apiClient.callApi("/personal/sendValueTransfer","POST",null,null,null,null,i,[],["application/json"],["application/json"],"object",null,r)}},{key:"unlockAccount",value:function(e,t,n,r){if(n=n||{},null==e)throw new Error("Missing the required parameter 'address' when calling unlockAccount");if(null==t)throw new Error("Missing the required parameter 'passphrase' when calling unlockAccount");var i=0,a={method:"personal_unlockAccount",id:1,jsonrpc:"2.0",params:[]};a.params.push(e),a.params.push(t);var o=n.duration||n[i++]||null;if(null==o)throw new Error("Missing the required parameter 'duration' when calling unlockAccount");return a.params.push(o),this.apiClient.callApi("/personal/unlockAccount","POST",null,null,null,null,a,[],["application/json"],["application/json"],"object",null,r)}}])}()},7952:(e,t,n)=>{var r=t;r.utils=n(7426),r.common=n(6166),r.sha=n(6229),r.ripemd=n(6784),r.hmac=n(8948),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},8203:(e,t)=>{"use strict";function n(e,t,n){if(n>e.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,n)}function r(e){if(0===e[0])throw new Error("invalid RLP: extra zeros");return s(function(e){let t="";for(let n=0;n<e.length;n++)t+=o[e[n]];return t}(e))}function i(e,t){if(e<56)return Uint8Array.from([e+t]);const n=l(e),r=l(t+55+n.length/2);return Uint8Array.from(u(r+n))}function a(e){let t,i,o,s,u;const c=[],l=e[0];if(l<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(l<=183){if(t=l-127,o=128===l?Uint8Array.from([]):n(e,1,t),2===t&&o[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:o,remainder:e.slice(t)}}if(l<=191){if(i=l-182,e.length-1<i)throw new Error("invalid RLP: not enough bytes for string length");if(t=r(n(e,1,i)),t<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return o=n(e,i,t+i),{data:o,remainder:e.slice(t+i)}}if(l<=247){for(t=l-191,s=n(e,1,t);s.length;)u=a(s),c.push(u.data),s=u.remainder;return{data:c,remainder:e.slice(t)}}{if(i=l-246,t=r(n(e,1,i)),t<56)throw new Error("invalid RLP: encoded list too short");const o=i+t;if(o>e.length)throw new Error("invalid RLP: total length is larger than the data");for(s=n(e,i,o);s.length;)u=a(s),c.push(u.data),s=u.remainder;return{data:c,remainder:e.slice(o)}}}t.Tj=void 0;const o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function s(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw new Error("Invalid byte sequence");return t}function u(e){if("string"!=typeof e)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 n=0;n<t.length;n++){const r=2*n;t[n]=s(e.slice(r,r+2))}return t}function c(...e){if(1===e.length)return e[0];const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n}function l(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 d(e){return e.length>=2&&"0"===e[0]&&"x"===e[1]}function h(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return d(e)?u((n="string"!=typeof(r=e)?r:d(r)?r.slice(2):r).length%2?`0${n}`:n):(t=e,(new TextEncoder).encode(t));var t,n,r;if("number"==typeof e||"bigint"==typeof e)return e?u(l(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}t.Tj={encode:function e(t){if(Array.isArray(t)){const n=[];let r=0;for(let i=0;i<t.length;i++){const a=e(t[i]);n.push(a),r+=a.length}return c(i(r,192),...n)}const n=h(t);return 1===n.length&&n[0]<128?n:c(i(n.length,128),n)},decode:function(e,t=!1){if(null==e||0===e.length)return Uint8Array.from([]);const n=a(h(e));if(t)return n;if(0!==n.remainder.length)throw new Error("invalid RLP: remainder must be zero");return n.data}}},8258:(e,t,n)=>{var r,i=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o="\\ud800-\\udfff",s="\\u2700-\\u27bf",u="a-z\\xdf-\\xf6\\xf8-\\xff",c="A-Z\\xc0-\\xd6\\xd8-\\xde",l="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",d="["+l+"]",h="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",f="\\d+",p="["+s+"]",m="["+u+"]",g="[^"+o+l+f+s+u+c+"]",y="(?:\\ud83c[\\udde6-\\uddff]){2}",b="[\\ud800-\\udbff][\\udc00-\\udfff]",v="["+c+"]",w="(?:"+m+"|"+g+")",A="(?:"+v+"|"+g+")",x="(?:['’](?:d|ll|m|re|s|t|ve))?",k="(?:['’](?:D|LL|M|RE|S|T|VE))?",_="(?:"+h+"|\\ud83c[\\udffb-\\udfff])?",P="[\\ufe0e\\ufe0f]?",E=P+_+"(?:\\u200d(?:"+["[^"+o+"]",y,b].join("|")+")"+P+_+")*",S="(?:"+[p,y,b].join("|")+")"+E,T=RegExp("['’]","g"),M=RegExp(h,"g"),I=RegExp([v+"?"+m+"+"+x+"(?="+[d,v,"$"].join("|")+")",A+"+"+k+"(?="+[d,v+w,"$"].join("|")+")",v+"?"+w+"+"+x,v+"+"+k,f,S].join("|"),"g"),j=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,C="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,B="object"==typeof self&&self&&self.Object===Object&&self,O=C||B||Function("return this")(),R=(r={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"ss"},function(e){return null==r?void 0:r[e]}),N=Object.prototype.toString,F=O.Symbol,L=F?F.prototype:void 0,H=L?L.toString:void 0;function q(e){return null==e?"":function(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==N.call(e)}(e))return H?H.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}var D,U=(D=function(e,t,n){return e+(n?"_":"")+t.toLowerCase()},function(e){return function(e,t,n){for(var r=-1,i=e?e.length:0;++r<i;)n=t(n,e[r],r,e);return n}(function(e,t){return e=q(e),void 0===t?function(e){return j.test(e)}(e)?function(e){return e.match(I)||[]}(e):function(e){return e.match(i)||[]}(e):e.match(t)||[]}(function(e){return(e=q(e))&&e.replace(a,R).replace(M,"")}(e).replace(T,"")),D,"")});e.exports=U},8463:e=>{e.exports=o,o.default=o,o.stable=l,o.stableStringify=l;var t="[...]",n="[Circular]",r=[],i=[];function a(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function o(e,t,n,o){var s;void 0===o&&(o=a()),u(e,"",0,[],void 0,0,o);try{s=0===i.length?JSON.stringify(e,t,n):JSON.stringify(e,h(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function s(e,t,n,a){var o=Object.getOwnPropertyDescriptor(a,n);void 0!==o.get?o.configurable?(Object.defineProperty(a,n,{value:e}),r.push([a,n,t,o])):i.push([t,n,e]):(a[n]=e,r.push([a,n,t]))}function u(e,r,i,a,o,c,l){var d;if(c+=1,"object"==typeof e&&null!==e){for(d=0;d<a.length;d++)if(a[d]===e)return void s(n,e,r,o);if(void 0!==l.depthLimit&&c>l.depthLimit)return void s(t,e,r,o);if(void 0!==l.edgesLimit&&i+1>l.edgesLimit)return void s(t,e,r,o);if(a.push(e),Array.isArray(e))for(d=0;d<e.length;d++)u(e[d],d,d,a,e,c,l);else{var h=Object.keys(e);for(d=0;d<h.length;d++){var f=h[d];u(e[f],f,d,a,e,c,l)}}a.pop()}}function c(e,t){return e<t?-1:e>t?1:0}function l(e,t,n,o){void 0===o&&(o=a());var s,u=d(e,"",0,[],void 0,0,o)||e;try{s=0===i.length?JSON.stringify(u,t,n):JSON.stringify(u,h(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function d(e,i,a,o,u,l,h){var f;if(l+=1,"object"==typeof e&&null!==e){for(f=0;f<o.length;f++)if(o[f]===e)return void s(n,e,i,u);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==h.depthLimit&&l>h.depthLimit)return void s(t,e,i,u);if(void 0!==h.edgesLimit&&a+1>h.edgesLimit)return void s(t,e,i,u);if(o.push(e),Array.isArray(e))for(f=0;f<e.length;f++)d(e[f],f,f,o,e,l,h);else{var p={},m=Object.keys(e).sort(c);for(f=0;f<m.length;f++){var g=m[f];d(e[g],g,f,o,e,l,h),p[g]=e[g]}if(void 0===u)return p;r.push([u,i,e]),u[i]=p}o.pop()}}function h(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(i.length>0)for(var r=0;r<i.length;r++){var a=i[r];if(a[1]===t&&a[0]===n){n=a[2],i.splice(r,1);break}}return e.call(this,t,n)}}},8490:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function a(e,t,n){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:n(9368).Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,r){for(var i=0,a=Math.min(e.length,n),o=t;o<a;o++){var s=e.charCodeAt(o)-48;i*=r,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,n):(this._parseBase(e,t,i),"le"===n&&this._initArray(this.toArray(),t,n)))},a.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},a.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===n)for(i=e.length-1,a=0;i>=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===n)for(i=0,a=0;i<e.length;i+=3)o=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,a=0,o=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)i=u(e,t,r)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)i=u(e,t,r)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,u=0,l=n;l<s;l+=r)u=c(e,l,l+r,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var d=1;for(u=c(e,l,e.length,t),l=0;l<o;l++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,u=o/67108864|0;n.words[0]=s;for(var c=1;c<r;c++){for(var l=u>>>26,d=67108863&u,h=Math.min(c,t.length-1),f=Math.max(0,c-e.length+1);f<=h;f++){var p=c-f|0;l+=(o=(i=0|e.words[p])*(a=0|t.words[f])+d)/67108864|0,d=67108863&o}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n.strip()}a.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],u=(16777215&(s<<i|a)).toString(16);a=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),n=0!==a||o!==this.length-1?l[6-u.length]+u+n:u+n}for(0!==a&&(n=a.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=d[e],f=h[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);n=(p=p.idivn(f)).isZero()?m+n:l[c-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0"),this.strip();var o,s,u="le"===t,c=new e(a),l=this.clone();if(u){for(s=0;!l.isZero();s++)o=l.andln(255),l.iushrn(8),c[s]=o;for(;s<a;s++)c[s]=0}else{for(s=0;s<a-i;s++)c[s]=0;for(s=0;!l.isZero();s++)o=l.andln(255),l.iushrn(8),c[a-s-1]=o}return c},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 8191&t||(n+=13,t>>>=13),127&t||(n+=7,t>>>=7),15&t||(n+=4,t>>>=4),3&t||(n+=2,t>>>=2),1&t||n++,n},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},a.prototype.ior=function(e){return r(0===(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return r(0===(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this.strip()},a.prototype.ixor=function(e){return r(0===(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},a.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a<r.length;a++)t=(0|n.words[a])+(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<n.length;a++)t=(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var a=0,o=0;o<r.length;o++)a=(t=(0|n.words[o])-(0|r.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<n.length;o++)a=(t=(0|n.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<n.length&&n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this.length=Math.max(this.length,o),n!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,n){var r,i,a,o=e.words,s=t.words,u=n.words,c=0,l=0|o[0],d=8191&l,h=l>>>13,f=0|o[1],p=8191&f,m=f>>>13,g=0|o[2],y=8191&g,b=g>>>13,v=0|o[3],w=8191&v,A=v>>>13,x=0|o[4],k=8191&x,_=x>>>13,P=0|o[5],E=8191&P,S=P>>>13,T=0|o[6],M=8191&T,I=T>>>13,j=0|o[7],C=8191&j,B=j>>>13,O=0|o[8],R=8191&O,N=O>>>13,F=0|o[9],L=8191&F,H=F>>>13,q=0|s[0],D=8191&q,U=q>>>13,z=0|s[1],G=8191&z,V=z>>>13,W=0|s[2],K=8191&W,Z=W>>>13,Q=0|s[3],$=8191&Q,J=Q>>>13,Y=0|s[4],X=8191&Y,ee=Y>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,fe=0|s[9],pe=8191&fe,me=fe>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(c+(r=Math.imul(d,D))|0)+((8191&(i=(i=Math.imul(d,U))+Math.imul(h,D)|0))<<13)|0;c=((a=Math.imul(h,U))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,D),i=(i=Math.imul(p,U))+Math.imul(m,D)|0,a=Math.imul(m,U);var ye=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(h,G)|0))<<13)|0;c=((a=a+Math.imul(h,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,D),i=(i=Math.imul(y,U))+Math.imul(b,D)|0,a=Math.imul(b,U),r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,G)|0,a=a+Math.imul(m,V)|0;var be=(c+(r=r+Math.imul(d,K)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(h,K)|0))<<13)|0;c=((a=a+Math.imul(h,Z)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,D),i=(i=Math.imul(w,U))+Math.imul(A,D)|0,a=Math.imul(A,U),r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(b,G)|0,a=a+Math.imul(b,V)|0,r=r+Math.imul(p,K)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,Z)|0;var ve=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,J)|0)+Math.imul(h,$)|0))<<13)|0;c=((a=a+Math.imul(h,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(k,D),i=(i=Math.imul(k,U))+Math.imul(_,D)|0,a=Math.imul(_,U),r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(A,G)|0,a=a+Math.imul(A,V)|0,r=r+Math.imul(y,K)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,Z)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,J)|0;var we=(c+(r=r+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,X)|0))<<13)|0;c=((a=a+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(E,D),i=(i=Math.imul(E,U))+Math.imul(S,D)|0,a=Math.imul(S,U),r=r+Math.imul(k,G)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(_,G)|0,a=a+Math.imul(_,V)|0,r=r+Math.imul(w,K)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,Z)|0,r=r+Math.imul(y,$)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,J)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,X)|0,a=a+Math.imul(m,ee)|0;var Ae=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((a=a+Math.imul(h,re)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(M,D),i=(i=Math.imul(M,U))+Math.imul(I,D)|0,a=Math.imul(I,U),r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(S,G)|0,a=a+Math.imul(S,V)|0,r=r+Math.imul(k,K)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(_,K)|0,a=a+Math.imul(_,Z)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,J)|0,r=r+Math.imul(y,X)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,X)|0,a=a+Math.imul(b,ee)|0,r=r+Math.imul(p,ne)|0,i=(i=i+Math.imul(p,re)|0)+Math.imul(m,ne)|0,a=a+Math.imul(m,re)|0;var xe=(c+(r=r+Math.imul(d,ae)|0)|0)+((8191&(i=(i=i+Math.imul(d,oe)|0)+Math.imul(h,ae)|0))<<13)|0;c=((a=a+Math.imul(h,oe)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(C,D),i=(i=Math.imul(C,U))+Math.imul(B,D)|0,a=Math.imul(B,U),r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(I,G)|0,a=a+Math.imul(I,V)|0,r=r+Math.imul(E,K)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,Z)|0,r=r+Math.imul(k,$)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,J)|0,r=r+Math.imul(w,X)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,X)|0,a=a+Math.imul(A,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(b,ne)|0,a=a+Math.imul(b,re)|0,r=r+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var ke=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((a=a+Math.imul(h,ce)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,D),i=(i=Math.imul(R,U))+Math.imul(N,D)|0,a=Math.imul(N,U),r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(B,G)|0,a=a+Math.imul(B,V)|0,r=r+Math.imul(M,K)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(I,K)|0,a=a+Math.imul(I,Z)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,J)|0,r=r+Math.imul(k,X)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(_,X)|0,a=a+Math.imul(_,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(A,ne)|0,a=a+Math.imul(A,re)|0,r=r+Math.imul(y,ae)|0,i=(i=i+Math.imul(y,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,r=r+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,a=a+Math.imul(m,ce)|0;var _e=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((a=a+Math.imul(h,he)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(L,D),i=(i=Math.imul(L,U))+Math.imul(H,D)|0,a=Math.imul(H,U),r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(N,G)|0,a=a+Math.imul(N,V)|0,r=r+Math.imul(C,K)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,K)|0,a=a+Math.imul(B,Z)|0,r=r+Math.imul(M,$)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,J)|0,r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,X)|0,a=a+Math.imul(S,ee)|0,r=r+Math.imul(k,ne)|0,i=(i=i+Math.imul(k,re)|0)+Math.imul(_,ne)|0,a=a+Math.imul(_,re)|0,r=r+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,r=r+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,a=a+Math.imul(b,ce)|0,r=r+Math.imul(p,de)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,de)|0,a=a+Math.imul(m,he)|0;var Pe=(c+(r=r+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(h,pe)|0))<<13)|0;c=((a=a+Math.imul(h,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(L,G),i=(i=Math.imul(L,V))+Math.imul(H,G)|0,a=Math.imul(H,V),r=r+Math.imul(R,K)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,Z)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(B,$)|0,a=a+Math.imul(B,J)|0,r=r+Math.imul(M,X)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(I,X)|0,a=a+Math.imul(I,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(S,ne)|0,a=a+Math.imul(S,re)|0,r=r+Math.imul(k,ae)|0,i=(i=i+Math.imul(k,oe)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(A,ue)|0,a=a+Math.imul(A,ce)|0,r=r+Math.imul(y,de)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(b,de)|0,a=a+Math.imul(b,he)|0;var Ee=(c+(r=r+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((a=a+Math.imul(m,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(L,K),i=(i=Math.imul(L,Z))+Math.imul(H,K)|0,a=Math.imul(H,Z),r=r+Math.imul(R,$)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(N,$)|0,a=a+Math.imul(N,J)|0,r=r+Math.imul(C,X)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,X)|0,a=a+Math.imul(B,ee)|0,r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(I,ne)|0,a=a+Math.imul(I,re)|0,r=r+Math.imul(E,ae)|0,i=(i=i+Math.imul(E,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,r=r+Math.imul(k,ue)|0,i=(i=i+Math.imul(k,ce)|0)+Math.imul(_,ue)|0,a=a+Math.imul(_,ce)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(A,de)|0,a=a+Math.imul(A,he)|0;var Se=(c+(r=r+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;c=((a=a+Math.imul(b,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,$),i=(i=Math.imul(L,J))+Math.imul(H,$)|0,a=Math.imul(H,J),r=r+Math.imul(R,X)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,X)|0,a=a+Math.imul(N,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(B,ne)|0,a=a+Math.imul(B,re)|0,r=r+Math.imul(M,ae)|0,i=(i=i+Math.imul(M,oe)|0)+Math.imul(I,ae)|0,a=a+Math.imul(I,oe)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(S,ue)|0,a=a+Math.imul(S,ce)|0,r=r+Math.imul(k,de)|0,i=(i=i+Math.imul(k,he)|0)+Math.imul(_,de)|0,a=a+Math.imul(_,he)|0;var Te=(c+(r=r+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;c=((a=a+Math.imul(A,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(L,X),i=(i=Math.imul(L,ee))+Math.imul(H,X)|0,a=Math.imul(H,ee),r=r+Math.imul(R,ne)|0,i=(i=i+Math.imul(R,re)|0)+Math.imul(N,ne)|0,a=a+Math.imul(N,re)|0,r=r+Math.imul(C,ae)|0,i=(i=i+Math.imul(C,oe)|0)+Math.imul(B,ae)|0,a=a+Math.imul(B,oe)|0,r=r+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,ce)|0)+Math.imul(I,ue)|0,a=a+Math.imul(I,ce)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(S,de)|0,a=a+Math.imul(S,he)|0;var Me=(c+(r=r+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,me)|0)+Math.imul(_,pe)|0))<<13)|0;c=((a=a+Math.imul(_,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(L,ne),i=(i=Math.imul(L,re))+Math.imul(H,ne)|0,a=Math.imul(H,re),r=r+Math.imul(R,ae)|0,i=(i=i+Math.imul(R,oe)|0)+Math.imul(N,ae)|0,a=a+Math.imul(N,oe)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,ue)|0,a=a+Math.imul(B,ce)|0,r=r+Math.imul(M,de)|0,i=(i=i+Math.imul(M,he)|0)+Math.imul(I,de)|0,a=a+Math.imul(I,he)|0;var Ie=(c+(r=r+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;c=((a=a+Math.imul(S,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(L,ae),i=(i=Math.imul(L,oe))+Math.imul(H,ae)|0,a=Math.imul(H,oe),r=r+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(N,ue)|0,a=a+Math.imul(N,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,de)|0,a=a+Math.imul(B,he)|0;var je=(c+(r=r+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,me)|0)+Math.imul(I,pe)|0))<<13)|0;c=((a=a+Math.imul(I,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(L,ue),i=(i=Math.imul(L,ce))+Math.imul(H,ue)|0,a=Math.imul(H,ce),r=r+Math.imul(R,de)|0,i=(i=i+Math.imul(R,he)|0)+Math.imul(N,de)|0,a=a+Math.imul(N,he)|0;var Ce=(c+(r=r+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(B,pe)|0))<<13)|0;c=((a=a+Math.imul(B,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(L,de),i=(i=Math.imul(L,he))+Math.imul(H,de)|0,a=Math.imul(H,he);var Be=(c+(r=r+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(N,pe)|0))<<13)|0;c=((a=a+Math.imul(N,me)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863;var Oe=(c+(r=Math.imul(L,pe))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(H,pe)|0))<<13)|0;return c=((a=Math.imul(H,me))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=we,u[5]=Ae,u[6]=xe,u[7]=ke,u[8]=_e,u[9]=Pe,u[10]=Ee,u[11]=Se,u[12]=Te,u[13]=Me,u[14]=Ie,u[15]=je,u[16]=Ce,u[17]=Be,u[18]=Oe,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){return(new g).mulp(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=f),a.prototype.mulTo=function(e,t){var n,r=this.length+e.length;return n=10===this.length&&10===e.length?p(this,e,t):r<63?f(this,e,t):r<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a<n.length-1;a++){var o=i;i=0;for(var s=67108863&r,u=Math.min(a,t.length-1),c=Math.max(0,a-e.length+1);c<=u;c++){var l=a-c,d=(0|e.words[l])*(0|t.words[c]),h=67108863&d;s=67108863&(h=h+s|0),i+=(o=(o=o+(d/67108864|0)|0)+(h>>>26)|0)>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return 0!==r?n.words[a]=r:n.length--,n.strip()}(this,e,t):m(this,e,t),n},g.prototype.makeRBT=function(e){for(var t=new Array(e),n=a.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},g.prototype.revBin=function(e,t,n){if(0===e||e===n-1)return e;for(var r=0,i=0;i<t;i++)r|=(1&e)<<t-i-1,e>>=1;return r},g.prototype.permute=function(e,t,n,r,i,a){for(var o=0;o<a;o++)r[o]=t[e[o]],i[o]=n[e[o]]},g.prototype.transform=function(e,t,n,r,i,a){this.permute(a,e,t,n,r,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),l=0;l<i;l+=s)for(var d=u,h=c,f=0;f<o;f++){var p=n[l+f],m=r[l+f],g=n[l+f+o],y=r[l+f+o],b=d*g-h*y;y=d*y+h*g,g=b,n[l+f]=p+g,r[l+f]=m+y,n[l+f+o]=p-g,r[l+f+o]=m-y,f!==s&&(b=u*d-c*h,h=u*h+c*d,d=b)}},g.prototype.guessLen13b=function(e,t){var n=1|Math.max(t,e),r=1&n,i=0;for(n=n/2|0;n;n>>>=1)i++;return 1<<i+1+r},g.prototype.conjugate=function(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var i=e[r];e[r]=e[n-r-1],e[n-r-1]=i,i=t[r],t[r]=-t[n-r-1],t[n-r-1]=-i}},g.prototype.normalize13b=function(e,t){for(var n=0,r=0;r<t/2;r++){var i=8192*Math.round(e[2*r+1]/t)+Math.round(e[2*r]/t)+n;e[r]=67108863&i,n=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,n,i){for(var a=0,o=0;o<t;o++)a+=0|e[o],n[2*o]=8191&a,a>>>=13,n[2*o+1]=8191&a,a>>>=13;for(o=2*t;o<i;++o)n[o]=0;r(0===a),r(!(-8192&a))},g.prototype.stub=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=0;return t},g.prototype.mulp=function(e,t,n){var r=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(r),a=this.stub(r),o=new Array(r),s=new Array(r),u=new Array(r),c=new Array(r),l=new Array(r),d=new Array(r),h=n.words;h.length=r,this.convert13b(e.words,e.length,o,r),this.convert13b(t.words,t.length,c,r),this.transform(o,a,s,u,r,i),this.transform(c,a,l,d,r,i);for(var f=0;f<r;f++){var p=s[f]*l[f]-u[f]*d[f];u[f]=s[f]*d[f]+u[f]*l[f],s[f]=p}return this.conjugate(s,u,r),this.transform(s,u,h,a,r,i),this.conjugate(h,a,r),this.normalize13b(h,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),m(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var i=(0|this.words[n])*e,a=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=a>>>26,this.words[n]=67108863&a}return 0!==t&&(this.words[n]=t,this.length++),this.length=0===e?1:this.length,this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=(e.words[r]&1<<i)>>>i}return t}(e);if(0===t.length)return new a(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var i=n.sqr();r<t.length;r++,i=i.sqr())0!==t[r]&&(n=n.mul(i));return n},a.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,a=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&a,u=(0|this.words[t])-s<<n;this.words[t]=u|o,o=s>>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,n){var i;r("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,u=n;if(i-=o,i=Math.max(0,i),u){for(var c=0;c<o;c++)u.words[c]=this.words[c];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-a|d>>>a,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n||!(this.words[n]&i))},a.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,n){var i,a,o=e.length+n;this._expand(o);var s=0;for(i=0;i<e.length;i++){a=(0|this.words[i+n])+s;var u=(0|e.words[i])*t;s=((a-=67108863&u)>>26)-(u/67108864|0),this.words[i+n]=67108863&a}for(;i<this.length-n;i++)s=(a=(0|this.words[i+n])+s)>>26,this.words[i+n]=67108863&a;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i<this.length;i++)s=(a=-(0|this.words[i])+s)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,o=0|i.words[i.length-1];0!=(n=26-this._countBits(o))&&(i=i.ushln(n),r.iushln(n),o=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=r.clone()._ishlnsubmul(i,1,u);0===l.negative&&(r=l,s&&(s.words[u]=1));for(var d=u-1;d>=0;d--){var h=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(h=Math.min(h/o|0,67108863),r._ishlnsubmul(i,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},a.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},a.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),u=new a(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;0===(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(l),o.isub(d)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;0===(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),o.isub(u)):(n.isub(t),s.isub(i),u.isub(o))}return{a:s,b:u,gcd:n.iushln(c)}},a.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new a(1),s=new a(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,h=1;0===(n.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s)):(n.isub(t),s.isub(o))}return(i=0===t.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return!(1&this.words[0])},a.prototype.isOdd=function(){return!(1&~this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var a=i,o=n;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new k(e)},a.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function _(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},i(v,b),v.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&n,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(o&n)<<4|a>>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,b),i(A,b),i(x,b),x.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,i=67108863&r;r>>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return y[e]=t,t},k.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},k.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new a(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);r(!i.isZero());var s=new a(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new a(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=o;0!==f.cmp(s);){for(var m=f,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g<p);var y=this.pow(d,new a(1).iushln(p-g-1));h=h.redMul(y),d=y.redSqr(),f=f.redMul(d),p=g}return h},k.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},k.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new a(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var i=n[0],o=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),r=t.length-1;r>=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==o?(o<<=1,o|=d,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[o]),s=0,o=0)):s=0}u=26}return i},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new _(e)},i(_,k),_.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},_.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},_.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},_.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},_.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},8545:(e,t,n)=>{"use strict";var r=n(8490),i=n(7011),a=i.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(a(e.r&&e.s,"Signature without r or s"),this.r=new r(e.r,16),this.s=new r(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;if(0===e[t.place])return!1;for(var i=0,a=0,o=t.place;a<r;a++,o++)i<<=8,i|=e[o],i>>>=0;return!(i<=127)&&(t.place=o,i)}function c(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t<n;)t++;return 0===t?e:e.slice(t)}function l(e,t){if(t<128)e.push(t);else{var n=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}e.exports=o,o.prototype._importDER=function(e,t){e=i.toArray(e,t);var n=new s;if(48!==e[n.place++])return!1;var a=u(e,n);if(!1===a)return!1;if(a+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var o=u(e,n);if(!1===o)return!1;if(128&e[n.place])return!1;var c=e.slice(n.place,o+n.place);if(n.place+=o,2!==e[n.place++])return!1;var l=u(e,n);if(!1===l)return!1;if(e.length!==l+n.place)return!1;if(128&e[n.place])return!1;var d=e.slice(n.place,l+n.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new r(c),this.s=new r(d),this.recoveryParam=null,!0},o.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=c(t),n=c(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];l(r,t.length),(r=r.concat(t)).push(2),l(r,n.length);var a=r.concat(n),o=[48];return l(o,a.length),o=o.concat(a),i.encode(o,e)}},8650:(e,t,n)=>{"use strict";var r=n(7952),i=n(480),a=n(7011),o=a.assert,s=a.parseBytes,u=n(6661),c=n(220);function l(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=r.sha512}e.exports=l,l.prototype.sign=function(e,t){e=s(e);var n=this.keyFromSecret(t),r=this.hashInt(n.messagePrefix(),e),i=this.g.mul(r),a=this.encodePoint(i),o=this.hashInt(a,n.pubBytes(),e).mul(n.priv()),u=r.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:a})},l.prototype.verify=function(e,t,n){if(e=s(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var r=this.keyFromPublic(n),i=this.hashInt(t.Rencoded(),r.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(r.pub().mul(i)).eq(a)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return a.intFromLE(e.digest()).umod(this.curve.n)},l.prototype.keyFromPublic=function(e){return u.fromPublic(this,e)},l.prototype.keyFromSecret=function(e){return u.fromSecret(this,e)},l.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},l.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},l.prototype.decodePoint=function(e){var t=(e=a.parseBytes(e)).length-1,n=e.slice(0,t).concat(-129&e[t]),r=!!(128&e[t]),i=a.intFromLE(n);return this.curve.pointFromY(i,r)},l.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},l.prototype.decodeInt=function(e){return a.intFromLE(e)},l.prototype.isPoint=function(e){return e instanceof this.pointClass}},8948:(e,t,n)=>{"use strict";var r=n(7426),i=n(3349);function a(e,t,n){if(!(this instanceof a))return new a(e,t,n);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(t,n))}e.exports=a,a.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},a.prototype.update=function(e,t){return this.inner.update(e,t),this},a.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},9188:(e,t,n)=>{"use strict";var r=n(7011),i=n(8490),a=n(6698),o=n(6677),s=r.assert;function u(e){o.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,n,r){o.BasePoint.call(this,e,"affine"),null===t&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(n,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,n,r){o.BasePoint.call(this,e,"jacobian"),null===t&&null===n&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(n,16),this.z=new i(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(u,o),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,n;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);t=(t=r[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red)}if(e.lambda)n=new i(e.lambda,16);else{var a=this._getEndoRoots(this.n);0===this.g.mul(a[0]).x.cmp(this.g.x.redMul(t))?n=a[0]:(n=a[1],s(0===this.g.mul(n).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:n,basis:e.basis?e.basis.map(function(e){return{a:new i(e.a,16),b:new i(e.b,16)}}):this._getEndoBasis(n)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),n=new i(2).toRed(t).redInvm(),r=n.redNeg(),a=new i(3).toRed(t).redNeg().redSqrt().redMul(n);return[r.redAdd(a).fromRed(),r.redSub(a).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,n,r,a,o,s,u,c,l,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,f=this.n.clone(),p=new i(1),m=new i(0),g=new i(0),y=new i(1),b=0;0!==h.cmpn(0);){var v=f.div(h);c=f.sub(v.mul(h)),l=g.sub(v.mul(p));var w=y.sub(v.mul(m));if(!r&&c.cmp(d)<0)t=u.neg(),n=p,r=c.neg(),a=l;else if(r&&2===++b)break;u=c,f=h,h=c,g=p,p=l,y=m,m=w}o=c.neg(),s=l;var A=r.sqr().add(a.sqr());return o.sqr().add(s.sqr()).cmp(A)>=0&&(o=t,s=n),r.negative&&(r=r.neg(),a=a.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:r,b:a},{a:o,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),o=i.mul(n.a),s=a.mul(r.a),u=i.mul(n.b),c=a.mul(r.b);return{k1:e.sub(o).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var a=r.fromRed().isOdd();return(t&&!a||!t&&a)&&(r=r.redNeg()),this.point(e,r)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,a=0;a<e.length;a++){var o=this._endoSplit(t[a]),s=e[a],u=s._getBeta();o.k1.negative&&(o.k1.ineg(),s=s.neg(!0)),o.k2.negative&&(o.k2.ineg(),u=u.neg(!0)),r[2*a]=s,r[2*a+1]=u,i[2*a]=o.k1,i[2*a+1]=o.k2}for(var c=this._wnafMulAdd(1,r,i,2*a,n),l=0;l<2*a;l++)r[l]=null,i[l]=null;return c},a(c,o.BasePoint),u.prototype.point=function(e,t,n){return new c(this,e,t,n)},u.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,r=function(e){return n.point(e.x.redMul(n.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(r)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(r)}}}return t}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(e,t,n){"string"==typeof t&&(t=JSON.parse(t));var r=e.point(t[0],t[1],n);if(!t[2])return r;function i(t){return e.point(t[0],t[1],n)}var a=t[2];return r.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[r].concat(a.doubles.points.map(i))},naf:a.naf&&{wnd:a.naf.wnd,points:[r].concat(a.naf.points.map(i))}},r},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),a=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},c.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(l,o.BasePoint),u.prototype.jpoint=function(e,t,n){return new l(this,e,t,n)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(n.redMul(this.z)),s=r.redSub(i),u=a.redSub(o);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),d=r.redMul(c),h=u.redSqr().redIAdd(l).redISub(d).redISub(d),f=u.redMul(d.redISub(h)).redISub(a.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,f,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),o=n.redSub(r),s=i.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=o.redSqr(),c=u.redMul(o),l=n.redMul(u),d=s.redSqr().redIAdd(c).redISub(l).redISub(l),h=s.redMul(l.redISub(d)).redISub(i.redMul(c)),f=this.z.redMul(o);return this.curve.jpoint(d,h,f)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t<e;t++)n=n.dbl();return n}var r=this.curve.a,i=this.curve.tinv,a=this.x,o=this.y,s=this.z,u=s.redSqr().redSqr(),c=o.redAdd(o);for(t=0;t<e;t++){var l=a.redSqr(),d=c.redSqr(),h=d.redSqr(),f=l.redAdd(l).redIAdd(l).redIAdd(r.redMul(u)),p=a.redMul(d),m=f.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),y=f.redMul(g);y=y.redIAdd(y).redISub(h);var b=c.redMul(s);t+1<e&&(u=u.redMul(h)),a=m,s=b,c=y}return this.curve.jpoint(a,c.redMul(i),s)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},l.prototype._zeroDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(r).redISub(a);o=o.redIAdd(o);var s=r.redAdd(r).redIAdd(r),u=s.redSqr().redISub(o).redISub(o),c=a.redIAdd(a);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=s.redMul(o.redISub(u)).redISub(c),n=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),h=d.redSqr(),f=this.x.redAdd(d).redSqr().redISub(l).redISub(h);f=f.redIAdd(f);var p=l.redAdd(l).redIAdd(l),m=p.redSqr(),g=h.redIAdd(h);g=(g=g.redIAdd(g)).redIAdd(g),e=m.redISub(f).redISub(f),t=p.redMul(f.redISub(e)).redISub(g),n=(n=this.y.redMul(this.z)).redIAdd(n)}return this.curve.jpoint(e,t,n)},l.prototype._threeDbl=function(){var e,t,n;if(this.zOne){var r=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(r).redISub(a);o=o.redIAdd(o);var s=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),u=s.redSqr().redISub(o).redISub(o);e=u;var c=a.redIAdd(a);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(o.redISub(u)).redISub(c),n=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),h=this.x.redMul(d),f=this.x.redSub(l).redMul(this.x.redAdd(l));f=f.redAdd(f).redIAdd(f);var p=h.redIAdd(h),m=(p=p.redIAdd(p)).redAdd(p);e=f.redSqr().redISub(m),n=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var g=d.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=f.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,n)},l.prototype._dbl=function(){var e=this.curve.a,t=this.x,n=this.y,r=this.z,i=r.redSqr().redSqr(),a=t.redSqr(),o=n.redSqr(),s=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(o),l=s.redSqr().redISub(c.redAdd(c)),d=c.redISub(l),h=o.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=s.redMul(d).redISub(h),p=n.redAdd(n).redMul(r);return this.curve.jpoint(l,f,p)},l.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr(),r=t.redSqr(),i=e.redAdd(e).redIAdd(e),a=i.redSqr(),o=this.x.redAdd(t).redSqr().redISub(e).redISub(r),s=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(a)).redSqr(),u=r.redIAdd(r);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(o).redSqr().redISub(a).redISub(s).redISub(u),l=t.redMul(c);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(s).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var h=this.y.redMul(c.redMul(u.redISub(c)).redISub(o.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=this.z.redAdd(o).redSqr().redISub(n).redISub(s);return this.curve.jpoint(d,h,f)},l.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},l.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),n=e.z.redSqr();if(0!==this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0))return!1;var r=t.redMul(this.z),i=n.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(r)).cmpn(0)},l.prototype.eqXToP=function(e){var t=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(n))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(t);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},9368:()=>{},9404:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function a(e,t,n){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:n(7790).Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,i){for(var a=0,o=0,s=Math.min(e.length,n),u=t;u<s;u++){var c=e.charCodeAt(u)-48;a*=i,o=c>=49?c-49+10:c>=17?c-17+10:c,r(c>=0&&o<i,"Invalid character"),a+=o}return a}function l(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,n):(this._parseBase(e,t,i),"le"===n&&this._initArray(this.toArray(),t,n)))},a.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},a.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===n)for(i=e.length-1,a=0;i>=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===n)for(i=0,a=0;i<e.length;i+=3)o=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this._strip()},a.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,a=0,o=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)i=u(e,t,r)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)i=u(e,t,r)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this._strip()},a.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,u=0,l=n;l<s;l+=r)u=c(e,l,l+r,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var d=1;for(u=c(e,l,e.length,t),l=0;l<o;l++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype._move=function(e){l(e,this)},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(e){a.prototype.inspect=d}else a.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function m(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,u=o/67108864|0;n.words[0]=s;for(var c=1;c<r;c++){for(var l=u>>>26,d=67108863&u,h=Math.min(c,t.length-1),f=Math.max(0,c-e.length+1);f<=h;f++){var p=c-f|0;l+=(o=(i=0|e.words[p])*(a=0|t.words[f])+d)/67108864|0,d=67108863&o}n.words[c]=0|d,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}a.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],u=(16777215&(s<<i|a)).toString(16);a=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),n=0!==a||o!==this.length-1?h[6-u.length]+u+n:u+n}for(0!==a&&(n=a.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],l=p[e];n="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modrn(l).toString(e);n=(d=d.idivn(l)).isZero()?m+n:h[c-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16,2)},o&&(a.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,a);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,i),o},a.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|r;e[n++]=255&o,n<e.length&&(e[n++]=o>>8&255),n<e.length&&(e[n++]=o>>16&255),6===a?(n<e.length&&(e[n++]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n<e.length)for(e[n++]=r;n<e.length;)e[n++]=0},a.prototype._toArrayLikeBE=function(e,t){for(var n=e.length-1,r=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|r;e[n--]=255&o,n>=0&&(e[n--]=o>>8&255),n>=0&&(e[n--]=o>>16&255),6===a?(n>=0&&(e[n--]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 8191&t||(n+=13,t>>>=13),127&t||(n+=7,t>>>=7),15&t||(n+=4,t>>>=4),3&t||(n+=2,t>>>=2),1&t||n++,n},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},a.prototype.ior=function(e){return r(0===(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this._strip()},a.prototype.iand=function(e){return r(0===(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this._strip()},a.prototype.ixor=function(e){return r(0===(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this._strip()},a.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a<r.length;a++)t=(0|n.words[a])+(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<n.length;a++)t=(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var a=0,o=0;o<r.length;o++)a=(t=(0|n.words[o])-(0|r.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<n.length;o++)a=(t=(0|n.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<n.length&&n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this.length=Math.max(this.length,o),n!==this&&(this.negative=1),this._strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var g=function(e,t,n){var r,i,a,o=e.words,s=t.words,u=n.words,c=0,l=0|o[0],d=8191&l,h=l>>>13,f=0|o[1],p=8191&f,m=f>>>13,g=0|o[2],y=8191&g,b=g>>>13,v=0|o[3],w=8191&v,A=v>>>13,x=0|o[4],k=8191&x,_=x>>>13,P=0|o[5],E=8191&P,S=P>>>13,T=0|o[6],M=8191&T,I=T>>>13,j=0|o[7],C=8191&j,B=j>>>13,O=0|o[8],R=8191&O,N=O>>>13,F=0|o[9],L=8191&F,H=F>>>13,q=0|s[0],D=8191&q,U=q>>>13,z=0|s[1],G=8191&z,V=z>>>13,W=0|s[2],K=8191&W,Z=W>>>13,Q=0|s[3],$=8191&Q,J=Q>>>13,Y=0|s[4],X=8191&Y,ee=Y>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,he=le>>>13,fe=0|s[9],pe=8191&fe,me=fe>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(c+(r=Math.imul(d,D))|0)+((8191&(i=(i=Math.imul(d,U))+Math.imul(h,D)|0))<<13)|0;c=((a=Math.imul(h,U))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,D),i=(i=Math.imul(p,U))+Math.imul(m,D)|0,a=Math.imul(m,U);var ye=(c+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(h,G)|0))<<13)|0;c=((a=a+Math.imul(h,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,D),i=(i=Math.imul(y,U))+Math.imul(b,D)|0,a=Math.imul(b,U),r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,G)|0,a=a+Math.imul(m,V)|0;var be=(c+(r=r+Math.imul(d,K)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(h,K)|0))<<13)|0;c=((a=a+Math.imul(h,Z)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(w,D),i=(i=Math.imul(w,U))+Math.imul(A,D)|0,a=Math.imul(A,U),r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(b,G)|0,a=a+Math.imul(b,V)|0,r=r+Math.imul(p,K)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,Z)|0;var ve=(c+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,J)|0)+Math.imul(h,$)|0))<<13)|0;c=((a=a+Math.imul(h,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(k,D),i=(i=Math.imul(k,U))+Math.imul(_,D)|0,a=Math.imul(_,U),r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(A,G)|0,a=a+Math.imul(A,V)|0,r=r+Math.imul(y,K)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(b,K)|0,a=a+Math.imul(b,Z)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,J)|0;var we=(c+(r=r+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,X)|0))<<13)|0;c=((a=a+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(E,D),i=(i=Math.imul(E,U))+Math.imul(S,D)|0,a=Math.imul(S,U),r=r+Math.imul(k,G)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(_,G)|0,a=a+Math.imul(_,V)|0,r=r+Math.imul(w,K)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,Z)|0,r=r+Math.imul(y,$)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,J)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,X)|0,a=a+Math.imul(m,ee)|0;var Ae=(c+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((a=a+Math.imul(h,re)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(M,D),i=(i=Math.imul(M,U))+Math.imul(I,D)|0,a=Math.imul(I,U),r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(S,G)|0,a=a+Math.imul(S,V)|0,r=r+Math.imul(k,K)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(_,K)|0,a=a+Math.imul(_,Z)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,J)|0,r=r+Math.imul(y,X)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,X)|0,a=a+Math.imul(b,ee)|0,r=r+Math.imul(p,ne)|0,i=(i=i+Math.imul(p,re)|0)+Math.imul(m,ne)|0,a=a+Math.imul(m,re)|0;var xe=(c+(r=r+Math.imul(d,ae)|0)|0)+((8191&(i=(i=i+Math.imul(d,oe)|0)+Math.imul(h,ae)|0))<<13)|0;c=((a=a+Math.imul(h,oe)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(C,D),i=(i=Math.imul(C,U))+Math.imul(B,D)|0,a=Math.imul(B,U),r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(I,G)|0,a=a+Math.imul(I,V)|0,r=r+Math.imul(E,K)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(S,K)|0,a=a+Math.imul(S,Z)|0,r=r+Math.imul(k,$)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,J)|0,r=r+Math.imul(w,X)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,X)|0,a=a+Math.imul(A,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(b,ne)|0,a=a+Math.imul(b,re)|0,r=r+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var ke=(c+(r=r+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((a=a+Math.imul(h,ce)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,D),i=(i=Math.imul(R,U))+Math.imul(N,D)|0,a=Math.imul(N,U),r=r+Math.imul(C,G)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(B,G)|0,a=a+Math.imul(B,V)|0,r=r+Math.imul(M,K)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(I,K)|0,a=a+Math.imul(I,Z)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,J)|0,r=r+Math.imul(k,X)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(_,X)|0,a=a+Math.imul(_,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(A,ne)|0,a=a+Math.imul(A,re)|0,r=r+Math.imul(y,ae)|0,i=(i=i+Math.imul(y,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,r=r+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,a=a+Math.imul(m,ce)|0;var _e=(c+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((a=a+Math.imul(h,he)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(L,D),i=(i=Math.imul(L,U))+Math.imul(H,D)|0,a=Math.imul(H,U),r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(N,G)|0,a=a+Math.imul(N,V)|0,r=r+Math.imul(C,K)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(B,K)|0,a=a+Math.imul(B,Z)|0,r=r+Math.imul(M,$)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,J)|0,r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,X)|0,a=a+Math.imul(S,ee)|0,r=r+Math.imul(k,ne)|0,i=(i=i+Math.imul(k,re)|0)+Math.imul(_,ne)|0,a=a+Math.imul(_,re)|0,r=r+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,r=r+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(b,ue)|0,a=a+Math.imul(b,ce)|0,r=r+Math.imul(p,de)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,de)|0,a=a+Math.imul(m,he)|0;var Pe=(c+(r=r+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(h,pe)|0))<<13)|0;c=((a=a+Math.imul(h,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(L,G),i=(i=Math.imul(L,V))+Math.imul(H,G)|0,a=Math.imul(H,V),r=r+Math.imul(R,K)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(N,K)|0,a=a+Math.imul(N,Z)|0,r=r+Math.imul(C,$)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(B,$)|0,a=a+Math.imul(B,J)|0,r=r+Math.imul(M,X)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(I,X)|0,a=a+Math.imul(I,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(S,ne)|0,a=a+Math.imul(S,re)|0,r=r+Math.imul(k,ae)|0,i=(i=i+Math.imul(k,oe)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(A,ue)|0,a=a+Math.imul(A,ce)|0,r=r+Math.imul(y,de)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(b,de)|0,a=a+Math.imul(b,he)|0;var Ee=(c+(r=r+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((a=a+Math.imul(m,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(L,K),i=(i=Math.imul(L,Z))+Math.imul(H,K)|0,a=Math.imul(H,Z),r=r+Math.imul(R,$)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(N,$)|0,a=a+Math.imul(N,J)|0,r=r+Math.imul(C,X)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(B,X)|0,a=a+Math.imul(B,ee)|0,r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(I,ne)|0,a=a+Math.imul(I,re)|0,r=r+Math.imul(E,ae)|0,i=(i=i+Math.imul(E,oe)|0)+Math.imul(S,ae)|0,a=a+Math.imul(S,oe)|0,r=r+Math.imul(k,ue)|0,i=(i=i+Math.imul(k,ce)|0)+Math.imul(_,ue)|0,a=a+Math.imul(_,ce)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(A,de)|0,a=a+Math.imul(A,he)|0;var Se=(c+(r=r+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;c=((a=a+Math.imul(b,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,$),i=(i=Math.imul(L,J))+Math.imul(H,$)|0,a=Math.imul(H,J),r=r+Math.imul(R,X)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(N,X)|0,a=a+Math.imul(N,ee)|0,r=r+Math.imul(C,ne)|0,i=(i=i+Math.imul(C,re)|0)+Math.imul(B,ne)|0,a=a+Math.imul(B,re)|0,r=r+Math.imul(M,ae)|0,i=(i=i+Math.imul(M,oe)|0)+Math.imul(I,ae)|0,a=a+Math.imul(I,oe)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(S,ue)|0,a=a+Math.imul(S,ce)|0,r=r+Math.imul(k,de)|0,i=(i=i+Math.imul(k,he)|0)+Math.imul(_,de)|0,a=a+Math.imul(_,he)|0;var Te=(c+(r=r+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;c=((a=a+Math.imul(A,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(L,X),i=(i=Math.imul(L,ee))+Math.imul(H,X)|0,a=Math.imul(H,ee),r=r+Math.imul(R,ne)|0,i=(i=i+Math.imul(R,re)|0)+Math.imul(N,ne)|0,a=a+Math.imul(N,re)|0,r=r+Math.imul(C,ae)|0,i=(i=i+Math.imul(C,oe)|0)+Math.imul(B,ae)|0,a=a+Math.imul(B,oe)|0,r=r+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,ce)|0)+Math.imul(I,ue)|0,a=a+Math.imul(I,ce)|0,r=r+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(S,de)|0,a=a+Math.imul(S,he)|0;var Me=(c+(r=r+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,me)|0)+Math.imul(_,pe)|0))<<13)|0;c=((a=a+Math.imul(_,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(L,ne),i=(i=Math.imul(L,re))+Math.imul(H,ne)|0,a=Math.imul(H,re),r=r+Math.imul(R,ae)|0,i=(i=i+Math.imul(R,oe)|0)+Math.imul(N,ae)|0,a=a+Math.imul(N,oe)|0,r=r+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(B,ue)|0,a=a+Math.imul(B,ce)|0,r=r+Math.imul(M,de)|0,i=(i=i+Math.imul(M,he)|0)+Math.imul(I,de)|0,a=a+Math.imul(I,he)|0;var Ie=(c+(r=r+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;c=((a=a+Math.imul(S,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(L,ae),i=(i=Math.imul(L,oe))+Math.imul(H,ae)|0,a=Math.imul(H,oe),r=r+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(N,ue)|0,a=a+Math.imul(N,ce)|0,r=r+Math.imul(C,de)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(B,de)|0,a=a+Math.imul(B,he)|0;var je=(c+(r=r+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,me)|0)+Math.imul(I,pe)|0))<<13)|0;c=((a=a+Math.imul(I,me)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,r=Math.imul(L,ue),i=(i=Math.imul(L,ce))+Math.imul(H,ue)|0,a=Math.imul(H,ce),r=r+Math.imul(R,de)|0,i=(i=i+Math.imul(R,he)|0)+Math.imul(N,de)|0,a=a+Math.imul(N,he)|0;var Ce=(c+(r=r+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(B,pe)|0))<<13)|0;c=((a=a+Math.imul(B,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(L,de),i=(i=Math.imul(L,he))+Math.imul(H,de)|0,a=Math.imul(H,he);var Be=(c+(r=r+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(N,pe)|0))<<13)|0;c=((a=a+Math.imul(N,me)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863;var Oe=(c+(r=Math.imul(L,pe))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(H,pe)|0))<<13)|0;return c=((a=Math.imul(H,me))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=we,u[5]=Ae,u[6]=xe,u[7]=ke,u[8]=_e,u[9]=Pe,u[10]=Ee,u[11]=Se,u[12]=Te,u[13]=Me,u[14]=Ie,u[15]=je,u[16]=Ce,u[17]=Be,u[18]=Oe,0!==c&&(u[19]=c,n.length++),n};function y(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a<n.length-1;a++){var o=i;i=0;for(var s=67108863&r,u=Math.min(a,t.length-1),c=Math.max(0,a-e.length+1);c<=u;c++){var l=a-c,d=(0|e.words[l])*(0|t.words[c]),h=67108863&d;s=67108863&(h=h+s|0),i+=(o=(o=o+(d/67108864|0)|0)+(h>>>26)|0)>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return 0!==r?n.words[a]=r:n.length--,n._strip()}function b(e,t,n){return y(e,t,n)}function v(e,t){this.x=e,this.y=t}Math.imul||(g=m),a.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):n<63?m(this,e,t):n<1024?y(this,e,t):b(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),n=a.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},v.prototype.revBin=function(e,t,n){if(0===e||e===n-1)return e;for(var r=0,i=0;i<t;i++)r|=(1&e)<<t-i-1,e>>=1;return r},v.prototype.permute=function(e,t,n,r,i,a){for(var o=0;o<a;o++)r[o]=t[e[o]],i[o]=n[e[o]]},v.prototype.transform=function(e,t,n,r,i,a){this.permute(a,e,t,n,r,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),l=0;l<i;l+=s)for(var d=u,h=c,f=0;f<o;f++){var p=n[l+f],m=r[l+f],g=n[l+f+o],y=r[l+f+o],b=d*g-h*y;y=d*y+h*g,g=b,n[l+f]=p+g,r[l+f]=m+y,n[l+f+o]=p-g,r[l+f+o]=m-y,f!==s&&(b=u*d-c*h,h=u*h+c*d,d=b)}},v.prototype.guessLen13b=function(e,t){var n=1|Math.max(t,e),r=1&n,i=0;for(n=n/2|0;n;n>>>=1)i++;return 1<<i+1+r},v.prototype.conjugate=function(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var i=e[r];e[r]=e[n-r-1],e[n-r-1]=i,i=t[r],t[r]=-t[n-r-1],t[n-r-1]=-i}},v.prototype.normalize13b=function(e,t){for(var n=0,r=0;r<t/2;r++){var i=8192*Math.round(e[2*r+1]/t)+Math.round(e[2*r]/t)+n;e[r]=67108863&i,n=i<67108864?0:i/67108864|0}return e},v.prototype.convert13b=function(e,t,n,i){for(var a=0,o=0;o<t;o++)a+=0|e[o],n[2*o]=8191&a,a>>>=13,n[2*o+1]=8191&a,a>>>=13;for(o=2*t;o<i;++o)n[o]=0;r(0===a),r(!(-8192&a))},v.prototype.stub=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=0;return t},v.prototype.mulp=function(e,t,n){var r=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(r),a=this.stub(r),o=new Array(r),s=new Array(r),u=new Array(r),c=new Array(r),l=new Array(r),d=new Array(r),h=n.words;h.length=r,this.convert13b(e.words,e.length,o,r),this.convert13b(t.words,t.length,c,r),this.transform(o,a,s,u,r,i),this.transform(c,a,l,d,r,i);for(var f=0;f<r;f++){var p=s[f]*l[f]-u[f]*d[f];u[f]=s[f]*d[f]+u[f]*l[f],s[f]=p}return this.conjugate(s,u,r),this.transform(s,u,h,a,r,i),this.conjugate(h,a,r),this.normalize13b(h,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n._strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),b(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var n=0,i=0;i<this.length;i++){var a=(0|this.words[i])*e,o=(67108863&a)+(67108863&n);n>>=26,n+=a/67108864|0,n+=o>>>26,this.words[i]=67108863&o}return 0!==n&&(this.words[i]=n,this.length++),this.length=0===e?1:this.length,t?this.ineg():this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=e.words[r]>>>i&1}return t}(e);if(0===t.length)return new a(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var i=n.sqr();r<t.length;r++,i=i.sqr())0!==t[r]&&(n=n.mul(i));return n},a.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,a=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&a,u=(0|this.words[t])-s<<n;this.words[t]=u|o,o=s>>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},a.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,n){var i;r("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,u=n;if(i-=o,i=Math.max(0,i),u){for(var c=0;c<o;c++)u.words[c]=this.words[c];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-a|d>>>a,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n||!(this.words[n]&i))},a.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,n){var i,a,o=e.length+n;this._expand(o);var s=0;for(i=0;i<e.length;i++){a=(0|this.words[i+n])+s;var u=(0|e.words[i])*t;s=((a-=67108863&u)>>26)-(u/67108864|0),this.words[i+n]=67108863&a}for(;i<this.length-n;i++)s=(a=(0|this.words[i+n])+s)>>26,this.words[i+n]=67108863&a;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i<this.length;i++)s=(a=-(0|this.words[i])+s)>>26,this.words[i]=67108863&a;return this.negative=1,this._strip()},a.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,o=0|i.words[i.length-1];0!=(n=26-this._countBits(o))&&(i=i.ushln(n),r.iushln(n),o=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=r.clone()._ishlnsubmul(i,1,u);0===l.negative&&(r=l,s&&(s.words[u]=1));for(var d=u-1;d>=0;d--){var h=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(h=Math.min(h/o|0,67108863),r._ishlnsubmul(i,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=h)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},a.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(n*i+(0|this.words[a]))%e;return t?-i:i},a.prototype.modn=function(e){return this.modrn(e)},a.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var a=(0|this.words[i])+67108864*n;this.words[i]=a/e|0,n=a%e}return this._strip(),t?this.ineg():this},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),u=new a(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;0===(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(l),o.isub(d)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;0===(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),o.isub(u)):(n.isub(t),s.isub(i),u.isub(o))}return{a:s,b:u,gcd:n.iushln(c)}},a.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new a(1),s=new a(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,h=1;0===(n.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s)):(n.isub(t),s.isub(o))}return(i=0===t.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return!(1&this.words[0])},a.prototype.isOdd=function(){return!(1&~this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var a=i,o=n;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new E(e)},a.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function A(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){A.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){A.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}A.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},A.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},A.prototype.split=function(e,t){e.iushrn(this.n,0,t)},A.prototype.imulK=function(e){return e.imul(this.k)},i(x,A),x.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&n,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(o&n)<<4|a>>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(k,A),i(_,A),i(P,A),P.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,i=67108863&r;r>>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new x;else if("p224"===e)t=new k;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new P}return w[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},E.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new a(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);r(!i.isZero());var s=new a(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new a(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=o;0!==f.cmp(s);){for(var m=f,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g<p);var y=this.pow(d,new a(1).iushln(p-g-1));h=h.redMul(y),d=y.redSqr(),f=f.redMul(d),p=g}return h},E.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},E.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new a(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var i=n[0],o=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),r=t.length-1;r>=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var d=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==o?(o<<=1,o|=d,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[o]),s=0,o=0)):s=0}u=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new S(e)},i(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},9450:(e,t,n)=>{"use strict";var r=n(3048);function i(e){if(e)return function(e){for(var t in i.prototype)Object.prototype.hasOwnProperty.call(i.prototype,t)&&(e[t]=i.prototype[t]);return e}(e)}e.exports=i,i.prototype.get=function(e){return this.header[e.toLowerCase()]},i.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=r.type(t);var n=r.params(t);for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(this[i]=n[i]);this.links={};try{e.link&&(this.links=r.parseLinks(e.link))}catch(e){}},i.prototype._setStatusProperties=function(e){var t=e/100|0;this.statusCode=e,this.status=this.statusCode,this.statusType=t,this.info=1===t,this.ok=2===t,this.redirect=3===t,this.clientError=4===t,this.serverError=5===t,this.error=(4===t||5===t)&&this.toError(),this.created=201===e,this.accepted=202===e,this.noContent=204===e,this.badRequest=400===e,this.unauthorized=401===e,this.notAcceptable=406===e,this.forbidden=403===e,this.notFound=404===e,this.unprocessableEntity=422===e}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.amdO={},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};(()=>{"use strict";n.r(r),n.d(r,{AccountKey:()=>ir,AccountKeyFactory:()=>dr,AccountKeyFail:()=>ur,AccountKeyLegacy:()=>or,AccountKeyNil:()=>ar,AccountKeyPublic:()=>sr,AccountKeyRoleBased:()=>lr,AccountKeyType:()=>Ae,AccountKeyWeightedMultiSig:()=>cr,CodeFormatEVM:()=>je,FieldError:()=>Hn,FieldSet:()=>nr,FieldSetFactory:()=>rr,FieldTypeAccountKey:()=>tr,FieldTypeAccountKeyList:()=>er,FieldTypeAddress:()=>qn,FieldTypeBool:()=>Kn,FieldTypeBytes:()=>Dn,FieldTypeCompressedPubKey:()=>Yn,FieldTypeNumberBits:()=>Un,FieldTypeSignatureTuples:()=>Zn,FieldTypeUint256:()=>Wn,FieldTypeUint32:()=>Gn,FieldTypeUint64:()=>Vn,FieldTypeUint8:()=>zn,FieldTypeWeightedPublicKeys:()=>Xn,HexStr:()=>se,JsonRpcClient:()=>De,KaiaWeb3:()=>Ak,KlaytnTx:()=>Ma,KlaytnTxFactory:()=>Za,KlaytnWeb3:()=>Ak,RLP:()=>oe,TxType:()=>we,TxTypeAccountUpdate:()=>qa,TxTypeCancel:()=>Da,TxTypeFeeDelegatedAccountUpdate:()=>Oa,TxTypeFeeDelegatedAccountUpdateWithRatio:()=>Wa,TxTypeFeeDelegatedCancel:()=>Ra,TxTypeFeeDelegatedCancelWithRatio:()=>Ka,TxTypeFeeDelegatedSmartContractDeploy:()=>Ca,TxTypeFeeDelegatedSmartContractDeployWithRatio:()=>Ga,TxTypeFeeDelegatedSmartContractExecution:()=>Ba,TxTypeFeeDelegatedSmartContractExecutionWithRatio:()=>Va,TxTypeFeeDelegatedValueTransfer:()=>Ia,TxTypeFeeDelegatedValueTransferMemo:()=>ja,TxTypeFeeDelegatedValueTransferMemoWithRatio:()=>za,TxTypeFeeDelegatedValueTransferWithRatio:()=>Ua,TxTypeSmartContractDeploy:()=>La,TxTypeSmartContractExecution:()=>Ha,TxTypeValueTransfer:()=>Na,TxTypeValueTransferMemo:()=>Fa,Web3:()=>Ak,asyncOpenApi:()=>Ge,formatKaia:()=>Rn,formatKaiaUnits:()=>Bn,formatKlay:()=>Sn,formatKlayUnits:()=>Pn,formatUnits:()=>jn,fromKei:()=>Fn,fromPeb:()=>Mn,getChainIdFromSignatureTuples:()=>Le,getCompressedPublicKey:()=>Ne,getKaikasTxType:()=>ke,getPublicKeyFromPrivate:()=>Re,getRpcTxObject:()=>an,getSignatureTuple:()=>Fe,getTypePrefix:()=>ue,isBasicTxType:()=>Pe,isEmbeddableAccountKeyType:()=>Ie,isFeeDelegationTxType:()=>Ee,isFeePayerSigTxType:()=>Te,isKIP3Json:()=>qe,isKlaytnAccountKeyType:()=>Me,isKlaytnTxType:()=>_e,isPartialFeeDelegationTxType:()=>Se,parseAccountKey:()=>hr,parseKaia:()=>Nn,parseKaiaUnits:()=>On,parseKlay:()=>Tn,parseKlayUnits:()=>En,parseTransaction:()=>Qa,parseTxType:()=>xe,parseUnits:()=>Cn,promisifyApi:()=>ze,promisifyMethod:()=>Ue,splitKeystoreKIP3:()=>He,toKei:()=>Ln,toPeb:()=>In,v6:()=>t});var e={};n.r(e),n.d(e,{OG:()=>pi,My:()=>ai,Ph:()=>ui,lX:()=>ci,Id:()=>fi,fg:()=>yi,qj:()=>hi,aT:()=>si,lq:()=>li,z:()=>di,Q5:()=>vi});var t={};n.r(t),n.d(t,{parseKaia:()=>$a,parseKaiaUnits:()=>Ja,parseUnits:()=>Ya});var i={};n.r(i),n.d(i,{BRAND:()=>ed,DIRTY:()=>Nc,EMPTY_PATH:()=>Cc,INVALID:()=>Rc,NEVER:()=>Kd,OK:()=>Fc,ParseStatus:()=>Oc,Schema:()=>Wc,ZodAny:()=>Pl,ZodArray:()=>Ml,ZodBigInt:()=>vl,ZodBoolean:()=>wl,ZodBranded:()=>td,ZodCatch:()=>Yl,ZodDate:()=>Al,ZodDefault:()=>Jl,ZodDiscriminatedUnion:()=>Ol,ZodEffects:()=>Zl,ZodEnum:()=>Vl,ZodError:()=>Ec,ZodFirstPartyTypeKind:()=>sd,ZodFunction:()=>Dl,ZodIntersection:()=>Nl,ZodIssueCode:()=>_c,ZodLazy:()=>Ul,ZodLiteral:()=>zl,ZodMap:()=>Hl,ZodNaN:()=>Xl,ZodNativeEnum:()=>Wl,ZodNever:()=>Sl,ZodNull:()=>_l,ZodNullable:()=>$l,ZodNumber:()=>bl,ZodObject:()=>jl,ZodOptional:()=>Ql,ZodParsedType:()=>xc,ZodPipeline:()=>nd,ZodPromise:()=>Kl,ZodReadonly:()=>rd,ZodRecord:()=>Ll,ZodSchema:()=>Wc,ZodSet:()=>ql,ZodString:()=>gl,ZodSymbol:()=>xl,ZodTransformer:()=>Zl,ZodTuple:()=>Fl,ZodType:()=>Wc,ZodUndefined:()=>kl,ZodUnion:()=>Cl,ZodUnknown:()=>El,ZodVoid:()=>Tl,addIssueToContext:()=>Bc,any:()=>bd,array:()=>xd,bigint:()=>hd,boolean:()=>fd,coerce:()=>Wd,custom:()=>ad,date:()=>pd,datetimeRegex:()=>hl,defaultErrorMap:()=>Sc,discriminatedUnion:()=>Ed,effect:()=>Ld,enum:()=>Rd,function:()=>Cd,getErrorMap:()=>Ic,getParsedType:()=>kc,instanceof:()=>ud,intersection:()=>Sd,isAborted:()=>Lc,isAsync:()=>Dc,isDirty:()=>Hc,isValid:()=>qc,late:()=>od,lazy:()=>Bd,literal:()=>Od,makeIssue:()=>jc,map:()=>Id,nan:()=>dd,nativeEnum:()=>Nd,never:()=>wd,null:()=>yd,nullable:()=>qd,number:()=>ld,object:()=>kd,objectUtil:()=>Ac,oboolean:()=>Vd,onumber:()=>Gd,optional:()=>Hd,ostring:()=>zd,pipeline:()=>Ud,preprocess:()=>Dd,promise:()=>Fd,quotelessJson:()=>Pc,record:()=>Md,set:()=>jd,setErrorMap:()=>Mc,strictObject:()=>_d,string:()=>cd,symbol:()=>md,transformer:()=>Ld,tuple:()=>Td,undefined:()=>gd,union:()=>Pd,unknown:()=>vd,util:()=>wc,void:()=>Ad});var a={};n.r(a),n.d(a,{abiSchemaToJsonSchema:()=>sh,codePointToInt:()=>dh,ensureIfUint8Array:()=>vh,ethAbiToJsonSchema:()=>uh,fetchArrayElement:()=>ch,hexToNumber:()=>hh,hexToUint8Array:()=>bh,numberToHex:()=>fh,padLeft:()=>ph,parseBaseType:()=>ah,transformJsonDataToAbiFormat:()=>lh,uint8ArrayToHexString:()=>mh});var o={};n.r(o),n.d(o,{isBatchRequest:()=>jp,isBatchResponse:()=>Ep,isResponseRpcError:()=>vp,isResponseWithError:()=>Ap,isResponseWithNotification:()=>xp,isResponseWithResult:()=>wp,isSubscriptionResult:()=>kp,isValidResponse:()=>Pp,setRequestIdStart:()=>Tp,toBatchPayload:()=>Ip,toPayload:()=>Mp,validateResponse:()=>_p});var s={};n.r(s),n.d(s,{ChunkResponseParser:()=>Rp,Eip1193Provider:()=>Fp,EventEmitter:()=>xf,SocketProvider:()=>qp,Web3DeferredPromise:()=>Op,asciiToHex:()=>cf,bytesToHex:()=>Zh,bytesToUint8Array:()=>Wh,checkAddressCheckSum:()=>Pf,compareBlockNumbers:()=>Bf,convert:()=>Qf,convertScalarValue:()=>Kf,encodePacked:()=>ap,ethUnitMap:()=>Gh,format:()=>$f,fromAscii:()=>lf,fromDecimal:()=>Xh,fromTwosComplement:()=>zf,fromUtf8:()=>nf,fromWei:()=>gf,getStorageSlotNumForLongString:()=>up,hexToAscii:()=>df,hexToBytes:()=>Qh,hexToNumber:()=>$h,hexToNumberString:()=>ef,hexToString:()=>uf,hexToUtf8:()=>af,isAddress:()=>Ef,isBatchRequest:()=>jp,isBatchResponse:()=>Ep,isBloom:()=>Sf,isContractAddressInBloom:()=>If,isContractInitOptions:()=>Of,isDataFormat:()=>Vf,isHex:()=>_f,isHexStrict:()=>kf,isInBloom:()=>Tf,isNullish:()=>Rf,isPromise:()=>hp,isResponseRpcError:()=>vp,isResponseWithError:()=>Ap,isResponseWithNotification:()=>xp,isResponseWithResult:()=>wp,isSubscriptionResult:()=>kp,isTopic:()=>jf,isTopicInBloom:()=>Cf,isUint8Array:()=>Dh,isUserEthereumAddressInBloom:()=>Mf,isValidResponse:()=>Pp,jsonRpc:()=>o,keccak256:()=>Yf,keccak256Wrapper:()=>Yf,leftPad:()=>Df,mergeDeep:()=>Ff,numberToHex:()=>Yh,padLeft:()=>Lf,padRight:()=>Hf,pollTillDefined:()=>mp,pollTillDefinedAndReturnIntervalId:()=>pp,processSolidityEncodePackedArgs:()=>ip,randomBytes:()=>cp,randomHex:()=>lp,rejectIfConditionAtInterval:()=>yp,rejectIfTimeout:()=>gp,rightPad:()=>qf,setRequestIdStart:()=>Tp,sha3:()=>Xf,sha3Raw:()=>ep,soliditySha3:()=>op,soliditySha3Raw:()=>sp,stringToHex:()=>rf,toAscii:()=>hf,toBatchPayload:()=>Ip,toBigInt:()=>mf,toBool:()=>vf,toChecksumAddress:()=>bf,toDecimal:()=>Jh,toHex:()=>ff,toNumber:()=>pf,toPayload:()=>Mp,toTwosComplement:()=>Uf,toUtf8:()=>of,toWei:()=>yf,uint8ArrayConcat:()=>Uh,uint8ArrayEquals:()=>zh,utf8ToBytes:()=>sf,utf8ToHex:()=>tf,uuidV4:()=>bp,validateResponse:()=>_p,waitWithTimeout:()=>fp});var u={};n.r(u),n.d(u,{DO:()=>Hm,OG:()=>Ym,My:()=>Dm,Ph:()=>Wm,lX:()=>Km,Id:()=>Jm,fg:()=>tg,qj:()=>$m,aT:()=>Vm,aY:()=>Lm,lq:()=>Zm,z:()=>Qm,Q5:()=>rg});var c={};n.r(c),n.d(c,{secp256k1:()=>Ng});let l=!1,d=!1;const h={debug:1,default:2,info:2,warning:3,error:4,off:5};let f=h.default,p=null;const m=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}}),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var g,y;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(g||(g={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(y||(y={}));const b="0123456789abcdef";class v{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==h[n]&&this.throwArgumentError("invalid log level name","logLevel",e),f>h[n]||console.log.apply(console,t)}debug(...e){this._log(v.levels.DEBUG,e)}info(...e){this._log(v.levels.INFO,e)}warn(...e){this._log(v.levels.WARNING,e)}makeError(e,t,n){if(d)return this.makeError("censored error",t,{});t||(t=v.errors.UNKNOWN_ERROR),n||(n={});const r=[];Object.keys(n).forEach(e=>{const t=n[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e<t.length;e++)n+=b[t[e]>>4],n+=b[15&t[e]];r.push(e+"=Uint8Array(0x"+n+")")}else r.push(e+"="+JSON.stringify(t))}catch(t){r.push(e+"="+JSON.stringify(n[e].toString()))}}),r.push(`code=${t}`),r.push(`version=${this.version}`);const i=e;let a="";switch(t){case y.NUMERIC_FAULT:{a="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":a+="-"+t;break;case"negative-power":case"negative-width":a+="-unsupported";break;case"unbound-bitwise-result":a+="-unbound-result"}break}case y.CALL_EXCEPTION:case y.INSUFFICIENT_FUNDS:case y.MISSING_NEW:case y.NONCE_EXPIRED:case y.REPLACEMENT_UNDERPRICED:case y.TRANSACTION_REPLACED:case y.UNPREDICTABLE_GAS_LIMIT:a=t}a&&(e+=" [ See: https://links.ethers.org/v5-errors-"+a+" ]"),r.length&&(e+=" ("+r.join(", ")+")");const o=new Error(e);return o.reason=i,o.code=t,Object.keys(n).forEach(function(e){o[e]=n[e]}),o}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(e,t,n){return this.throwError(e,v.errors.INVALID_ARGUMENT,{argument:t,value:n})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),m&&this.throwError("platform missing String.prototype.normalize",v.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:m})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,v.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,v.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,n){n=n?": "+n:"",e<t&&this.throwError("missing argument"+n,v.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+n,v.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",v.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",v.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",v.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return p||(p=new v("logger/5.8.0")),p}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",v.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),l){if(!e)return;this.globalLogger().throwError("error censorship permanent",v.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}d=!!e,l=!!t}static setLogLevel(e){const t=h[e.toLowerCase()];null!=t?f=t:v.globalLogger().warn("invalid log level - "+e)}static from(e){return new v(e)}}v.errors=y,v.levels=g;const w=new v("bytes/5.8.0");function A(e){return!!e.toHexString}function x(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return x(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function k(e){return S(e)&&!(e.length%2)||P(e)}function _(e){return"number"==typeof e&&e==e&&e%1==0}function P(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!_(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const n=e[t];if(!_(n)||n<0||n>=256)return!1}return!0}function E(e,t){if(t||(t={}),"number"==typeof e){w.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),x(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),A(e)&&(e=e.toHexString()),S(e)){let n=e.substring(2);n.length%2&&("left"===t.hexPad?n="0"+n:"right"===t.hexPad?n+="0":w.throwArgumentError("hex data is odd-length","value",e));const r=[];for(let e=0;e<n.length;e+=2)r.push(parseInt(n.substring(e,e+2),16));return x(new Uint8Array(r))}return P(e)?x(new Uint8Array(e)):w.throwArgumentError("invalid arrayify value","value",e)}function S(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}const T="0123456789abcdef";function M(e,t){if(t||(t={}),"number"==typeof e){w.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=T[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),A(e))return e.toHexString();if(S(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":w.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(P(e)){let t="0x";for(let n=0;n<e.length;n++){let r=e[n];t+=T[(240&r)>>4]+T[15&r]}return t}return w.throwArgumentError("invalid hexlify value","value",e)}function I(e){const t=function(e){"string"!=typeof e&&(e=M(e)),S(e)||w.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}(M(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function j(e,t){for("string"!=typeof e?e=M(e):S(e)||w.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&w.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function C(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(k(e)){let n=E(e);64===n.length?(t.v=27+(n[32]>>7),n[32]&=127,t.r=M(n.slice(0,32)),t.s=M(n.slice(32,64))):65===n.length?(t.r=M(n.slice(0,32)),t.s=M(n.slice(32,64)),t.v=n[64]):w.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:w.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(n[32]|=128),t._vs=M(n.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const n=function(e,t){(e=E(e)).length>t&&w.throwArgumentError("value out of range","value",arguments[0]);const n=new Uint8Array(t);return n.set(e,t-e.length),x(n)}(E(t._vs),32);t._vs=M(n);const r=n[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=r:t.recoveryParam!==r&&w.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),n[0]&=127;const i=M(n);null==t.s?t.s=i:t.s!==i&&w.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?w.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const n=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==n&&w.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&S(t.r)?t.r=j(t.r,32):w.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&S(t.s)?t.s=j(t.s,32):w.throwArgumentError("signature missing or invalid s","signature",e);const n=E(t.s);n[0]>=128&&w.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(n[0]|=128);const r=M(n);t._vs&&(S(t._vs)||w.throwArgumentError("signature invalid _vs","signature",e),t._vs=j(t._vs,32)),null==t._vs?t._vs=r:t._vs!==r&&w.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}var B=n(9404);const O="bignumber/5.8.0";var R=n.n(B)().BN;const N=new v(O),F={},L=9007199254740991;let H=!1;class q{constructor(e,t){e!==F&&N.throwError("cannot call constructor directly; use BigNumber.from",v.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return U(z(this).fromTwos(e))}toTwos(e){return U(z(this).toTwos(e))}abs(){return"-"===this._hex[0]?q.from(this._hex.substring(1)):this}add(e){return U(z(this).add(z(e)))}sub(e){return U(z(this).sub(z(e)))}div(e){return q.from(e).isZero()&&G("division-by-zero","div"),U(z(this).div(z(e)))}mul(e){return U(z(this).mul(z(e)))}mod(e){const t=z(e);return t.isNeg()&&G("division-by-zero","mod"),U(z(this).umod(t))}pow(e){const t=z(e);return t.isNeg()&&G("negative-power","pow"),U(z(this).pow(t))}and(e){const t=z(e);return(this.isNegative()||t.isNeg())&&G("unbound-bitwise-result","and"),U(z(this).and(t))}or(e){const t=z(e);return(this.isNegative()||t.isNeg())&&G("unbound-bitwise-result","or"),U(z(this).or(t))}xor(e){const t=z(e);return(this.isNegative()||t.isNeg())&&G("unbound-bitwise-result","xor"),U(z(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&G("negative-width","mask"),U(z(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&G("negative-width","shl"),U(z(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&G("negative-width","shr"),U(z(this).shrn(e))}eq(e){return z(this).eq(z(e))}lt(e){return z(this).lt(z(e))}lte(e){return z(this).lte(z(e))}gt(e){return z(this).gt(z(e))}gte(e){return z(this).gte(z(e))}isNegative(){return"-"===this._hex[0]}isZero(){return z(this).isZero()}toNumber(){try{return z(this).toNumber()}catch(e){G("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return N.throwError("this platform does not support BigInt",v.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?H||(H=!0,N.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?N.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",v.errors.UNEXPECTED_ARGUMENT,{}):N.throwError("BigNumber.toString does not accept parameters",v.errors.UNEXPECTED_ARGUMENT,{})),z(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof q)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new q(F,D(e)):e.match(/^-?[0-9]+$/)?new q(F,D(new R(e))):N.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&G("underflow","BigNumber.from",e),(e>=L||e<=-L)&&G("overflow","BigNumber.from",e),q.from(String(e));const t=e;if("bigint"==typeof t)return q.from(t.toString());if(P(t))return q.from(M(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return q.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(S(e)||"-"===e[0]&&S(e.substring(1))))return q.from(e)}return N.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function D(e){if("string"!=typeof e)return D(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&N.throwArgumentError("invalid hex","value",e),"0x00"===(e=D(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function U(e){return q.from(D(e))}function z(e){const t=q.from(e).toHexString();return"-"===t[0]?new R("-"+t.substring(3),16):new R(t.substring(2),16)}function G(e,t,n){const r={fault:e,operation:t};return null!=n&&(r.value=n),N.throwError(e,v.errors.NUMERIC_FAULT,r)}var V=n(1176),W=n.n(V);function K(e){return"0x"+W().keccak_256(E(e))}const Z=new v("address/5.8.0");function Q(e){S(e,20)||Z.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let e=0;e<40;e++)n[e]=t[e].charCodeAt(0);const r=E(K(n));for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&r[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const $={};for(let e=0;e<10;e++)$[String(e)]=String(e);for(let e=0;e<26;e++)$[String.fromCharCode(65+e)]=String(10+e);const J=Math.floor((Y=9007199254740991,Math.log10?Math.log10(Y):Math.log(Y)/Math.LN10));var Y;function X(e){let t=null;if("string"!=typeof e&&Z.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=Q(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&Z.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map(e=>$[e]).join("");for(;t.length>=J;){let e=t.substring(0,J);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}(e)&&Z.throwArgumentError("bad icap checksum","address",e),n=e.substring(4),t=new R(n,36).toString(16);t.length<40;)t="0"+t;t=Q("0x"+t)}else Z.throwArgumentError("invalid address","address",e);var n;return t}const ee=new v("rlp/5.8.0");function te(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function ne(e,t,n){let r=0;for(let i=0;i<n;i++)r=256*r+e[t+i];return r}function re(e){if(Array.isArray(e)){let t=[];if(e.forEach(function(e){t=t.concat(re(e))}),t.length<=55)return t.unshift(192+t.length),t;const n=te(t.length);return n.unshift(247+n.length),n.concat(t)}k(e)||ee.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call(E(e));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const n=te(t.length);return n.unshift(183+n.length),n.concat(t)}function ie(e,t,n,r){const i=[];for(;n<t+1+r;){const a=ae(e,n);i.push(a.result),(n+=a.consumed)>t+1+r&&ee.throwError("child data too short",v.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:i}}function ae(e,t){if(0===e.length&&ee.throwError("data too short",v.errors.BUFFER_OVERRUN,{}),e[t]>=248){const n=e[t]-247;t+1+n>e.length&&ee.throwError("data short segment too short",v.errors.BUFFER_OVERRUN,{});const r=ne(e,t+1,n);return t+1+n+r>e.length&&ee.throwError("data long segment too short",v.errors.BUFFER_OVERRUN,{}),ie(e,t,t+1+n,n+r)}if(e[t]>=192){const n=e[t]-192;return t+1+n>e.length&&ee.throwError("data array too short",v.errors.BUFFER_OVERRUN,{}),ie(e,t,t+1,n)}if(e[t]>=184){const n=e[t]-183;t+1+n>e.length&&ee.throwError("data array too short",v.errors.BUFFER_OVERRUN,{});const r=ne(e,t+1,n);return t+1+n+r>e.length&&ee.throwError("data array too short",v.errors.BUFFER_OVERRUN,{}),{consumed:1+n+r,result:M(e.slice(t+1+n,t+1+n+r))}}if(e[t]>=128){const n=e[t]-128;return t+1+n>e.length&&ee.throwError("data too short",v.errors.BUFFER_OVERRUN,{}),{consumed:1+n,result:M(e.slice(t+1,t+1+n))}}return{consumed:1,result:M(e[t])}}const oe={encode:function(e){return M(re(e))},decode:function(e){const t=E(e),n=ae(t,0);return n.consumed!==t.length&&ee.throwArgumentError("invalid rlp data","data",e),n.result}},se={toNumber:e=>q.from(e).toNumber(),fromNumber:e=>q.from(e).toHexString(),from:e=>M(e),concat:(...e)=>M(function(e){const t=e.map(e=>E(e)),n=t.reduce((e,t)=>e+t.length,0),r=new Uint8Array(n);return t.reduce((e,t)=>(r.set(t,e),e+t.length),0),x(r)}(e)),isHex:(e,t)=>S(e,t),stripZeros:e=>M(function(e){let t=E(e);if(0===t.length)return t;let n=0;for(;n<t.length&&0===t[n];)n++;return n&&(t=t.slice(n)),t}(e)),zeroPad:(e,t)=>j(e,t),withHexPrefix:e=>e.replace(/^(0x)?/,"0x"),stripHexPrefix:e=>e.replace(/^(0x)?/,""),toAddress:e=>e&&"0x"!=e?X(e):"0x0000000000000000000000000000000000000000",toBoolean(e){if("0x"==e)return!1;if("0x01"==e)return!0;throw new Error(`Invalid RLP boolean: '${e}'`)}};function ue(e){if(!se.isHex(e))throw new Error("Not an RLP encoded string");if(e.length<4)throw new Error("RLP encoded string too short");return se.toNumber(e.substring(0,4))}const ce=e=>"string"==typeof e,le=e=>Array.isArray(e),de=e=>"function"==typeof e,he=e=>"number"==typeof e,fe=(e,t)=>"object"==typeof e&&void 0!==e[t],pe=(e,t)=>"object"==typeof e&&void 0!==e[t]?e[t]:void 0;var me=n(8258),ge=n(2028);const ye=e=>me(e),be=e=>ge(e),ve=e=>e.charAt(0).toUpperCase()+e.slice(1);var we,Ae;function xe(e){if(null==e&&(e=0),"bigint"==typeof e&&(e=Number(e)),he(e))return e;if(ce(e)&&e.length>0){if(se.isHex(e))return se.toNumber(e);let t=e;if(t.startsWith("TxType")&&(t=t.substring(6)),t=ve(be(t)),fe(we,t))return pe(we,t)}throw new Error(`Unrecognized tx type '${e}'. Expected a number.'`)}function ke(e){const t=xe(e);if(_e(t)){const e=we[t];return ye(e).toUpperCase()}return t}function _e(e){return!!e&&e in we}function Pe(e){return!!e&&e in we&&!(3&e)}function Ee(e){return!!e&&e in we&&1==(3&e)}function Se(e){return!!e&&e in we&&2==(3&e)}function Te(e){return Ee(e)||Se(e)}function Me(e){return!!e&&e in Ae}function Ie(e){return!!e&&e in Ae&&e!=Ae.RoleBased}!function(e){e[e.ValueTransfer=8]="ValueTransfer",e[e.ValueTransferMemo=16]="ValueTransferMemo",e[e.AccountUpdate=32]="AccountUpdate",e[e.SmartContractDeploy=40]="SmartContractDeploy",e[e.SmartContractExecution=48]="SmartContractExecution",e[e.Cancel=56]="Cancel",e[e.FeeDelegatedValueTransfer=9]="FeeDelegatedValueTransfer",e[e.FeeDelegatedValueTransferMemo=17]="FeeDelegatedValueTransferMemo",e[e.FeeDelegatedAccountUpdate=33]="FeeDelegatedAccountUpdate",e[e.FeeDelegatedSmartContractDeploy=41]="FeeDelegatedSmartContractDeploy",e[e.FeeDelegatedSmartContractExecution=49]="FeeDelegatedSmartContractExecution",e[e.FeeDelegatedCancel=57]="FeeDelegatedCancel",e[e.FeeDelegatedValueTransferWithRatio=10]="FeeDelegatedValueTransferWithRatio",e[e.FeeDelegatedValueTransferMemoWithRatio=18]="FeeDelegatedValueTransferMemoWithRatio",e[e.FeeDelegatedAccountUpdateWithRatio=34]="FeeDelegatedAccountUpdateWithRatio",e[e.FeeDelegatedSmartContractDeployWithRatio=42]="FeeDelegatedSmartContractDeployWithRatio",e[e.FeeDelegatedSmartContractExecutionWithRatio=50]="FeeDelegatedSmartContractExecutionWithRatio",e[e.FeeDelegatedCancelWithRatio=58]="FeeDelegatedCancelWithRatio"}(we||(we={})),function(e){e[e.Nil=0]="Nil",e[e.Legacy=1]="Legacy",e[e.Public=2]="Public",e[e.Fail=3]="Fail",e[e.WeightedMultiSig=4]="WeightedMultiSig",e[e.RoleBased=5]="RoleBased"}(Ae||(Ae={}));const je=0;var Ce=n(6729);const{ec:Be}=Ce,Oe=new Be("secp256k1");function Re(e){return Ne(Oe.keyFromPrivate(se.stripHexPrefix(e),"hex").getPublic(!0,"hex"))}function Ne(e){if(e instanceof Uint8Array&&(e=se.from(e)),ce(e)){const t=se.from(se.withHexPrefix(e));if(se.isHex(t,33)||se.isHex(t,65)){const e=se.stripHexPrefix(t);return"0x"+Oe.keyFromPublic(e,"hex").getPublic(!0,"hex")}}if(ce(e.x)&&ce(e.y))return e.x=se.stripHexPrefix(e.x),e.y=se.stripHexPrefix(e.y),"0x"+Oe.keyFromPublic(e).getPublic(!0,"hex");throw new Error("Public key must be a hex string of 33 or 65 bytes, or an { x, y } object")}function Fe(e){let t;if(le(e)){if(3!=e.length)throw new Error("Signature tuple must have 3 elements [v,r,s]");t=C({v:se.toNumber(e[0]),r:e[1],s:e[2]})}else t=C(e);return[se.fromNumber(t.v),se.stripZeros(t.r),se.stripZeros(t.s)]}function Le(e){if(!le(e)||0==e.length)return;const t=e[0];if(!le(t)||3!=t.length)return;const n=t[0];if(!se.isHex(n))return;const r=se.toNumber(n);return r>=35?(r+r%2-36)/2:void 0}function He(e,t=!0){const n=JSON.parse(e),r=n.keyring;if(!le(r))throw new Error("Invalid KIP-3 JSON wallet");let i=[];return i=Array.isArray(r[0])?r.flat(2):r.flat(1),i.map(e=>{const r={version:3,crypto:e,address:n.address,id:n.id};return t&&delete r.address,JSON.stringify(r)})}function qe(e){let t=null;try{t=JSON.parse(e)}catch{return!1}return he(t.version)&&4==t.version&&le(t.keyring)}class De{send;constructor(e){this.send=e}callApi(e,t,n,r,i,a,o,s,u,c,l,d,h){this.send(o.method,o.params).then(e=>h(null,e)).catch(e=>h(e,null))}}function Ue(e,t,n){return async function(...r){if(r.length<n)throw new Error(`API ${String(t)} expects ${n} or more arguments, got ${r.length}`);const i=r.slice(0,n),a=r.slice(n);return new Promise((n,r)=>{e[t](...i,a,(e,t)=>{e?r(e):n(t)})})}}function ze(e){const t={},n=Reflect.getPrototypeOf(e);if(!n)throw new Error("Cannot promisify OpenApi object");const r=Reflect.ownKeys(n);for(const i of r){if("constructor"==i)continue;const r=Reflect.get(n,i);if(!de(r))continue;if(r.length<2)continue;const a=r.length-2;t[i]=Ue(e,i,a)}return t}function Ge(e,t){return ze(new t(new De(e)))}function Ve(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function We(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}`)}function Ke(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")}function Ze(e,t){We(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const Qe=BigInt(2**32-1),$e=BigInt(32);function Je(e,t=!1){return t?{h:Number(e&Qe),l:Number(e>>$e&Qe)}:{h:0|Number(e>>$e&Qe),l:0|Number(e&Qe)}}function Ye(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:a,l:o}=Je(e[i],t);[n[i],r[i]]=[a,o]}return[n,r]}const Xe=(e,t,n)=>e<<n|t>>>32-n,et=(e,t,n)=>t<<n|e>>>32-n,tt=(e,t,n)=>t<<n-32|e>>>64-n,nt=(e,t,n)=>e<<n-32|t>>>64-n,rt={fromBig:Je,split:Ye,toBig:(e,t)=>BigInt(e>>>0)<<$e|BigInt(t>>>0),shrSH:(e,t,n)=>e>>>n,shrSL:(e,t,n)=>e<<32-n|t>>>n,rotrSH:(e,t,n)=>e>>>n|t<<32-n,rotrSL:(e,t,n)=>e<<32-n|t>>>n,rotrBH:(e,t,n)=>e<<64-n|t>>>n-32,rotrBL:(e,t,n)=>e>>>n-32|t<<64-n,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:Xe,rotlSL:et,rotlBH:tt,rotlBL:nt,add:function(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:0|i}},add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,add5H:(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0,add5L:(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0)},it="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,at=e=>e instanceof Uint8Array,ot=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),st=(e,t)=>e<<32-t|e>>>t;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function ut(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!at(e))throw new Error("expected Uint8Array, got "+typeof e);return e}class ct{clone(){return this._cloneInto()}}function lt(e){const t=t=>e().update(ut(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function dt(e=32){if(it&&"function"==typeof it.getRandomValues)return it.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const[ht,ft,pt]=[[],[],[]],mt=BigInt(0),gt=BigInt(1),yt=BigInt(2),bt=BigInt(7),vt=BigInt(256),wt=BigInt(113);for(let e=0,t=gt,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],ht.push(2*(5*r+n)),ft.push((e+1)*(e+2)/2%64);let i=mt;for(let e=0;e<7;e++)t=(t<<gt^(t>>bt)*wt)%vt,t&yt&&(i^=gt<<(gt<<BigInt(e))-gt);pt.push(i)}const[At,xt]=Ye(pt,!0),kt=(e,t,n)=>n>32?tt(e,t,n):Xe(e,t,n),_t=(e,t,n)=>n>32?nt(e,t,n):et(e,t,n);class Pt extends ct{constructor(e,t,n,r=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Ve(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var a;this.state=new Uint8Array(200),this.state32=(a=this.state,new Uint32Array(a.buffer,a.byteOffset,Math.floor(a.byteLength/4)))}keccak(){!function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,i=(t+2)%10,a=n[i],o=n[i+1],s=kt(a,o,1)^n[r],u=_t(a,o,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=s,e[t+n+1]^=u}let t=e[2],i=e[3];for(let n=0;n<24;n++){const r=ft[n],a=kt(t,i,r),o=_t(t,i,r),s=ht[n];t=e[s],i=e[s+1],e[s]=a,e[s+1]=o}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=At[r],e[1]^=xt[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Ke(this);const{blockLen:t,state:n}=this,r=(e=ut(e)).length;for(let i=0;i<r;){const a=Math.min(t-this.pos,r-i);for(let t=0;t<a;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,128&t&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){Ke(this,!1),We(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();const a=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+a),r),this.posOut+=a,r+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Ve(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Ze(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:a}=this;return e||(e=new Pt(t,n,r,a,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=a,e.destroyed=this.destroyed,e}}const Et=((e,t,n)=>lt(()=>new Pt(t,e,n)))(1,136,32),St="6.14.4";function Tt(e,t,n){const r=t.split("|").map(e=>e.trim());for(let n=0;n<r.length;n++)switch(t){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof e===t)return}const i=new Error(`invalid value for type ${t}`);throw i.code="INVALID_ARGUMENT",i.argument=`value.${n}`,i.value=e,i}function Mt(e,t,n){for(let r in t){let i=t[r];const a=n?n[r]:null;a&&Tt(i,a,r),Object.defineProperty(e,r,{enumerable:!0,value:i,writable:!1})}}function It(e,t){if(null==e)return"null";if(null==t&&(t=new Set),"object"==typeof e){if(t.has(e))return"[Circular]";t.add(e)}if(Array.isArray(e))return"[ "+e.map(e=>It(e,t)).join(", ")+" ]";if(e instanceof Uint8Array){const t="0123456789abcdef";let n="0x";for(let r=0;r<e.length;r++)n+=t[e[r]>>4],n+=t[15&e[r]];return n}if("object"==typeof e&&"function"==typeof e.toJSON)return It(e.toJSON(),t);switch(typeof e){case"boolean":case"number":case"symbol":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const n=Object.keys(e);return n.sort(),"{ "+n.map(n=>`${It(n,t)}: ${It(e[n],t)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function jt(e,t,n,r){if(!e)throw function(e,t,n){let r,i=e;{const r=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${It(n)}`);for(const e in n){if("shortMessage"===e)continue;const t=n[e];r.push(e+"="+It(t))}}r.push(`code=${t}`),r.push(`version=${St}`),r.length&&(e+=" ("+r.join(", ")+")")}switch(t){case"INVALID_ARGUMENT":r=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":r=new RangeError(e);break;default:r=new Error(e)}return Mt(r,{code:t}),n&&Object.assign(r,n),null==r.shortMessage&&Mt(r,{shortMessage:i}),r}(t,n,r)}function Ct(e,t,n,r){jt(e,t,"INVALID_ARGUMENT",{argument:n,value:r})}function Bt(e,t,n){if(e instanceof Uint8Array)return n?new Uint8Array(e):e;if("string"==typeof e&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const t=new Uint8Array((e.length-2)/2);let n=2;for(let r=0;r<t.length;r++)t[r]=parseInt(e.substring(n,n+2),16),n+=2;return t}Ct(!1,"invalid BytesLike value",t||"value",e)}function Ot(e,t){return Bt(e,t,!1)}function Rt(e,t){return Bt(e,t,!0)}function Nt(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||"number"==typeof t&&e.length!==2+2*t||!0===t&&e.length%2!=0)}function Ft(e){return Nt(e,!0)||e instanceof Uint8Array}["NFD","NFC","NFKD","NFKC"].reduce((e,t)=>{try{if("test"!=="test".normalize(t))throw new Error("bad");if("NFD"===t){if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken")}e.push(t)}catch(e){}return e},[]);const Lt="0123456789abcdef";function Ht(e){const t=Ot(e);let n="0x";for(let e=0;e<t.length;e++){const r=t[e];n+=Lt[(240&r)>>4]+Lt[15&r]}return n}function qt(e){return"0x"+e.map(e=>Ht(e).substring(2)).join("")}function Dt(e){return Nt(e,!0)?(e.length-2)/2:Ot(e).length}function Ut(e,t){return function(e,t,n){const r=Ot(e);jt(t>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:t,offset:t+1});const i=new Uint8Array(t);return i.fill(0),n?i.set(r,t-r.length):i.set(r,0),Ht(i)}(e,t,!0)}let zt=!1;const Gt=function(e){return Et(e)};let Vt=Gt;function Wt(e){const t=Ot(e,"data");return Ht(Vt(t))}Wt._=Gt,Wt.lock=function(){zt=!0},Wt.register=function(e){if(zt)throw new TypeError("keccak256 is locked");Vt=e},Object.freeze(Wt);const Kt=BigInt(0),Zt=BigInt(36);function Qt(e){const t=(e=e.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let e=0;e<40;e++)n[e]=t[e].charCodeAt(0);const r=Ot(Wt(n));for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&r[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const $t={};for(let e=0;e<10;e++)$t[String(e)]=String(e);for(let e=0;e<26;e++)$t[String.fromCharCode(65+e)]=String(10+e);const Jt=15;const Yt=function(){const e={};for(let t=0;t<36;t++)e["0123456789abcdefghijklmnopqrstuvwxyz"[t]]=BigInt(t);return e}();function Xt(e){if(Ct("string"==typeof e,"invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const t=Qt(e);return Ct(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===e,"bad address checksum","address",e),t}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){Ct(e.substring(2,4)===function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map(e=>$t[e]).join("");for(;t.length>=Jt;){let e=t.substring(0,Jt);t=parseInt(e,10)%97+t.substring(e.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}(e),"bad icap checksum","address",e);let t=function(e){e=e.toLowerCase();let t=Kt;for(let n=0;n<e.length;n++)t=t*Zt+Yt[e[n]];return t}(e.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return Qt("0x"+t)}Ct(!1,"invalid address","address",e)}function en(e,t){return{address:Xt(e),storageKeys:t.map((e,t)=>(Ct(Nt(e,32),"invalid slot",`storageKeys[${t}]`,e),e.toLowerCase()))}}function tn(e){if(Array.isArray(e))return e.map((t,n)=>Array.isArray(t)?(Ct(2===t.length,"invalid slot set",`value[${n}]`,t),en(t[0],t[1])):(Ct(null!=t&&"object"==typeof t,"invalid address-slot set","value",e),en(t.address,t.storageKeys)));Ct(null!=e&&"object"==typeof e,"invalid access list","value",e);const t=Object.keys(e).map(t=>{const n=e[t].reduce((e,t)=>(e[t]=!0,e),{});return en(t,Object.keys(n).sort())});return t.sort((e,t)=>e.address.localeCompare(t.address)),t}const nn=["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"],rn=["from","to","data","input"];function an(e){const t={};let n;return nn.forEach(r=>{fe(e,r)&&(n="0x"==e[r]?I("0x"):I(q.from(e[r])),"gasLimit"==r?t.gas=n:t[r]=n)}),rn.forEach(n=>{fe(e,n)&&(t[n]=M(e[n]),"to"!==n&&"from"!==n||"0x"!==e[n]||(t[n]="0x0000000000000000000000000000000000000000"))}),e.accessList&&(t.accessList=tn(e.accessList)),t}const on=new v(O),sn={},un=q.from(0),cn=q.from(-1);function ln(e,t,n,r){const i={fault:t,operation:n};return void 0!==r&&(i.value=r),on.throwError(e,v.errors.NUMERIC_FAULT,i)}let dn="0";for(;dn.length<256;)dn+=dn;function hn(e){if("number"!=typeof e)try{e=q.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+dn.substring(0,e):on.throwArgumentError("invalid decimal size","decimals",e)}function fn(e,t){null==t&&(t=0);const n=hn(t),r=(e=q.from(e)).lt(un);r&&(e=e.mul(cn));let i=e.mod(n).toString();for(;i.length<n.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=e.div(n).toString();return e=1===n.length?a:a+"."+i,r&&(e="-"+e),e}function pn(e,t){null==t&&(t=0);const n=hn(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||on.throwArgumentError("invalid decimal value","value",e);const r="-"===e.substring(0,1);r&&(e=e.substring(1)),"."===e&&on.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&on.throwArgumentError("too many decimal points","value",e);let a=i[0],o=i[1];for(a||(a="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>n.length-1&&ln("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length<n.length-1;)o+="0";const s=q.from(a),u=q.from(o);let c=s.mul(n).add(u);return r&&(c=c.mul(cn)),c}class mn{constructor(e,t,n,r){e!==sn&&on.throwError("cannot use FixedFormat constructor; use FixedFormat.from",v.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=n,this.decimals=r,this.name=(t?"":"u")+"fixed"+String(n)+"x"+String(r),this._multiplier=hn(r),Object.freeze(this)}static from(e){if(e instanceof mn)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,n=128,r=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const i=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||on.throwArgumentError("invalid fixed format","format",e),t="u"!==i[1],n=parseInt(i[2]),r=parseInt(i[3])}else if(e){const i=(t,n,r)=>null==e[t]?r:(typeof e[t]!==n&&on.throwArgumentError("invalid fixed format ("+t+" not "+n+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),n=i("width","number",n),r=i("decimals","number",r)}return n%8&&on.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&on.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new mn(sn,t,n,r)}}class gn{constructor(e,t,n,r){e!==sn&&on.throwError("cannot use FixedNumber constructor; use FixedNumber.from",v.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&on.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=pn(this._value,this.format.decimals),n=pn(e._value,e.format.decimals);return gn.fromValue(t.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=pn(this._value,this.format.decimals),n=pn(e._value,e.format.decimals);return gn.fromValue(t.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=pn(this._value,this.format.decimals),n=pn(e._value,e.format.decimals);return gn.fromValue(t.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=pn(this._value,this.format.decimals),n=pn(e._value,e.format.decimals);return gn.fromValue(t.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=gn.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(t=t.subUnsafe(yn.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=gn.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(t=t.addUnsafe(yn.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&on.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const n=gn.from("1"+dn.substring(0,e),this.format),r=bn.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){return null==e?this._hex:(e%8&&on.throwArgumentError("invalid byte width","width",e),j(q.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8))}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return gn.fromString(this._value,e)}static fromValue(e,t,n){return null!=n||null==t||function(e){return null!=e&&(q.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||S(e)||"bigint"==typeof e||P(e))}(t)||(n=t,t=null),null==t&&(t=0),null==n&&(n="fixed"),gn.fromString(fn(e,t),mn.from(n))}static fromString(e,t){null==t&&(t="fixed");const n=mn.from(t),r=pn(e,n.decimals);!n.signed&&r.lt(un)&&ln("unsigned value cannot be negative","overflow","value",e);let i=null;n.signed?i=r.toTwos(n.width).toHexString():(i=r.toHexString(),i=j(i,n.width/8));const a=fn(r,n.decimals);return new gn(sn,i,a,n)}static fromBytes(e,t){null==t&&(t="fixed");const n=mn.from(t);if(E(e).length>n.width/8)throw new Error("overflow");let r=q.from(e);n.signed&&(r=r.fromTwos(n.width));const i=r.toTwos((n.signed?0:1)+n.width).toHexString(),a=fn(r,n.decimals);return new gn(sn,i,a,n)}static from(e,t){if("string"==typeof e)return gn.fromString(e,t);if(P(e))return gn.fromBytes(e,t);try{return gn.fromValue(e,0,t)}catch(e){if(e.code!==v.errors.INVALID_ARGUMENT)throw e}return on.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const yn=gn.from(1),bn=gn.from("0.5"),vn=new v("units/5.8.0"),wn=["wei","kwei","mwei","gwei","szabo","finney","ether"];function An(e,t){if("string"==typeof t){const e=wn.indexOf(t);-1!==e&&(t=3*e)}return fn(e,null!=t?t:18)}function xn(e,t){if("string"!=typeof e&&vn.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=wn.indexOf(t);-1!==e&&(t=3*e)}return pn(e,null!=t?t:18)}const kn={peb:0,kpeb:3,mpeb:6,ston:9,gpeb:9,uklay:12,mklay:15,klay:18,kklay:21,Mklay:24,gklay:27,tklay:30,kei:0,gkei:9,kaia:18};function _n(e){if(ce(e)){const t=e.toLowerCase();return"mklay"==t&&"m"==e[0]?15:"mklay"==t&&"M"==e[0]?24:t in kn?kn[t]:void 0}}function Pn(e,t){const n=_n(t);return n?An(e,n):(ce(t)&&(t=t.toLowerCase()),An(e,t))}function En(e,t){const n=_n(t);return n?xn(e,n):(ce(t)&&(t=t.toLowerCase()),xn(e,t))}function Sn(e){return Pn(e,18)}function Tn(e){return En(e,18)}function Mn(e,t){return Pn(e,t)}function In(e,t){return En(e,t).toString()}const jn=Pn,Cn=En,Bn=Pn,On=En,Rn=Sn,Nn=Tn;function Fn(e,t){return Pn(e,t)}function Ln(e,t){return En(e,t).toString()}class Hn extends Error{constructor(e,t,n){super(`Cannot assign value '${n}' to field '${t}' of type '${e.constructor.name}'`),this.name="FieldError"}}const qn=new class{canonicalize(e){return"0x"===e?"0x":X(e)}emptyValue(){return"0x"}},Dn=new class{canonicalize(e){return se.from(e)}emptyValue(){return"0x"}};class Un{maxBits;maxBN;constructor(e){e||(e=256),this.maxBits=e,this.maxBN=q.from(2).pow(e)}canonicalize(e){"0x"===e&&(e=0);const t=q.from(e);if(t.gte(this.maxBN))throw new Error(`Number exceeds ${this.maxBits} bits`);return t.isZero()?"0x":t.toHexString()}emptyValue(){return"0x"}}const zn=new Un(8),Gn=new Un(32),Vn=new Un(64),Wn=new Un(256),Kn=new class{canonicalize(e){return"0x01"===e||"0x"===e?e:e?"0x01":"0x"}emptyValue(){return"0x"}},Zn=new class{canonicalize(e){return e.map(Fe)}emptyValue(){return[]}},Qn=({key:e,keys:t,type:n,threshold:r})=>{if(le(t))switch(Number(n)){case Ae.WeightedMultiSig:return oe.encode([se.from(r),t.map(e=>(e=>{if(le(e)&&2==e.length){const t=e;return[se.fromNumber(t[0]),Ne(t[1])]}if(fe(e,"weight")&&fe(e,"key")){const t=e;return[se.fromNumber(t.weight),Ne(t.key)]}throw new Error("Malformed WeightedPublicKeys")})(e))]);case Ae.RoleBased:return oe.encode(t.map(({key:e,keys:t,type:n,threshold:r})=>$n(n,Qn({type:n,key:e,keys:t,threshold:r}))))}else switch(Number(n)){case Ae.Fail:return"0x03c0";case Ae.Legacy:return"0x01c0";case Ae.Nil:return"0x80";case Ae.Public:return oe.encode(Ne(e))}throw new Error("Invalid account key type")},$n=(e,t)=>{switch(e){case Ae.RoleBased:return se.concat(se.from(Ae.RoleBased),t);case Ae.WeightedMultiSig:return se.concat(se.from(Ae.WeightedMultiSig),t);case Ae.Public:return se.concat(se.from(Ae.Public),t)}return t},Jn=e=>{switch(se.toNumber(e.substring(0,4))){case Ae.RoleBased:{const t=oe.decode("0x"+e.substring(4));return{type:Ae.RoleBased,keys:t.map(e=>Jn(e))}}case Ae.WeightedMultiSig:{const[t,n]=oe.decode("0x"+e.substring(4));return{type:Ae.WeightedMultiSig,threshold:Number(t),keys:n.map(([e,t])=>({weight:Number(e),key:t}))}}case Ae.Public:return{type:Ae.Public,key:oe.decode("0x"+String(e).substring(4))};case Ae.Nil:return{type:Ae.Nil,key:"0x80"};case Ae.Legacy:return{type:Ae.Legacy,key:"0x03c0"};case Ae.Fail:return{type:Ae.Fail,key:"0x03c0"}}throw new Error("Parse Account Key from RLP errors: Invalid Account key type!")},Yn=new class{canonicalize(e){return e}emptyValue(){return"0x000000000000000000000000000000000000000000000000000000000000000000"}},Xn=new class{canonicalize(e){if(!le(e))throw new Error("Malformed WeightedPublicKeys");return e.map(e=>le(e)&&2==e.length?{weight:e[0],key:Ne(e[1])}:{weight:e.weight,key:Ne(e.key)})}emptyValue(){return[]}},er=new class{canonicalize(e){if(!le(e))throw new Error("Malformed RoleBasedKeys");return e.map(e=>{let t=(n=e,JSON.parse(JSON.stringify(n)));var n;if(ce(t)&&se.isHex(t)&&(t=Jn(t)),"object"==typeof t&&fe(t,"type")&&Ie(Number(t?.type)))return t;throw new Error(`AccountKeyType ${t?.type} cannot be inside an AccountKeyRoleBased`)})}emptyValue(){return[]}},tr=new class{canonicalize(e){if(ce(e)&&se.isHex(e))return e;{const t=Qn(e);return $n(e.type,t)}}emptyValue(){return"0x80"}};class nr{static type=-1;static typeName;static fieldTypes;type=-1;typeName="";fieldTypes={};fields={};constructor(){this.type=this._static.type,this.typeName=this._static.typeName,this.fieldTypes=this._static.fieldTypes}get _static(){return this.constructor}setFields(e){this.fields={},Object.keys(this.fieldTypes).forEach(t=>{const n=this.fieldTypes[t];if(void 0!==e[t])try{this.fields[t]=n.canonicalize(e[t])}catch(n){throw new Error(`Cannot set field '${t}' to '${JSON.stringify(e[t])}': ${n}`)}else this.fields[t]=null})}setFieldsFromArray(e,t){this.fields={};for(let n=0;n<t.length;n++){const r=e[n],i=this.fieldTypes[r];if(!i)throw new Error(`Unknown field '${r}' for '${this.typeName}' (type ${this.type})`);try{this.fields[r]=i.canonicalize(t[n])}catch(e){throw new Error(`Cannot set field '${r}' to '${JSON.stringify(t[n])}': ${e}`)}}}getField(e){const t=this.fields[e];if(null==t)throw new Error(`Missing field '${e}' for '${this.typeName}' (type ${this.type})`);return t}getFields(e){return e.map(e=>this.getField(e))}toObject(){return this.fields}throwTypeError(e){throw new Error(`${e} for '${this.typeName}' (type ${se.fromNumber(this.type)})`)}}class rr{registry={};requiredFields;constructor(e){this.requiredFields=e||[]}add(e){const t=e.type,n=e.fieldTypes;if(-1===t)throw new Error("Cannot register TypedFields: Missing type");if(this.registry[t])throw new Error(`Cannot register TypedFields: type ${t} already registered`);if(!n)throw new Error("Cannot register TypedFields: Missing fieldTypes");for(const e of this.requiredFields)if(!n[e])throw new Error(`Cannot register TypedFields: Missing required field '${e}'`);this.registry[t]=e}has(e){return se.isHex(e)?!!this.registry[se.toNumber(e)]:!!this.registry[e]}lookup(e){if(!this.has(e))throw new Error(`Unsupported type '${se.fromNumber(e)}'`);return se.isHex(e)?this.registry[se.toNumber(e)]:this.registry[e]}fromObject(e){const t=new(this.lookup(e?.type));return t.setFields(e),t}}class ir extends nr{}class ar extends ir{static type=Ae.Nil;static typeName="AccountKeyNil";static fieldTypes={type:zn};toRLP(){return Qn({type:Ae.Nil})}setFieldsFromRLP(e){"0x80"!==e&&this.throwTypeError(`Invalid RLP string '${e}'`),this.setFields({type:Ae.Nil})}}class or extends ir{static type=Ae.Legacy;static typeName="AccountKeyLegacy";static fieldTypes={type:zn};toRLP(){return Qn({type:Ae.Legacy})}setFieldsFromRLP(e){"0x01c0"!==e&&this.throwTypeError(`Invalid RLP string '${e}'`),this.setFields({type:Ae.Legacy})}}class sr extends ir{static type=Ae.Public;static typeName="AccountKeyPublic";static fieldTypes={type:zn,key:Yn};toRLP(){const e=Qn({key:this.getField("key"),type:Ae.Public});return $n(Ae.Public,e)}setFieldsFromRLP(e){const{type:t,key:n}=Jn(e);t!==this.type&&this.throwTypeError(`Invalid type '${t}`),this.setFields({type:t,key:n})}}class ur extends ir{static type=Ae.Fail;static typeName="AccountKeyFail";static fieldTypes={type:zn};toRLP(){return Qn({type:Ae.Fail})}setFieldsFromRLP(e){"0x03c0"!==e&&this.throwTypeError(`Invalid RLP string '${e}'`),this.setFields({type:Ae.Fail})}}class cr extends ir{static type=Ae.WeightedMultiSig;static typeName="AccountKeyWeightedMultiSig";static fieldTypes={type:zn,threshold:Gn,keys:Xn};toRLP(){const[e,t]=this.getFields(["threshold","keys"]),n=Qn({threshold:e,keys:t,type:Ae.WeightedMultiSig});return $n(Ae.WeightedMultiSig,n)}setFieldsFromRLP(e){const{type:t,keys:n,threshold:r}=Jn(e);t!==this.type&&this.throwTypeError(`Invalid type '${t}`),this.setFields({type:t,threshold:r,keys:n})}}class lr extends ir{static type=Ae.RoleBased;static typeName="AccountKeyRoleBased";static fieldTypes={type:zn,keys:er};toRLP(){const e=this.getField("keys"),t=Qn({type:Ae.RoleBased,keys:e});return $n(Ae.RoleBased,t)}setFieldsFromRLP(e){const{type:t,keys:n}=Jn(e);t!==this.type&&this.throwTypeError(`Invalid type '${t}`),this.setFields({type:t,keys:n})}}class dr extends rr{constructor(){super(["type"]),this.add(ar),this.add(or),this.add(sr),this.add(ur),this.add(cr),this.add(lr)}_fromObject(e){return e.type==Ae.WeightedMultiSig&&e.weightedPublicKeys&&(e.keys=e.weightedPublicKeys),super.fromObject(e)}static fromObject(e){return(new dr)._fromObject(e)}_fromRLP(e){if("0x80"==e)return this.fromObject({type:Ae.Nil});const t=ue(e);if(!Me(t))throw new Error("Not a Klaytn account key");const n=new(this.lookup(t));return n.setFieldsFromRLP(e),n}static fromRLP(e){return(new dr)._fromRLP(e)}}function hr(e){const t=dr.fromRLP(e),n=t.toObject();if(t.type==Ae.Nil||t.type==Ae.Legacy||t.type==Ae.Fail)return{type:t.type};if(t.type==Ae.Public)return{type:t.type,key:n.key};if(t.type==Ae.WeightedMultiSig)return{type:t.type,threshold:se.toNumber(n.threshold),keys:t.getField("keys")};if(t.type==Ae.RoleBased)return{type:t.type,keys:t.getField("keys")};throw new Error(`Unknown AccountKeyType ${t.type}`)}const fr="0x0000000000000000000000000000000000000000";class pr extends ct{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ot(this.buffer)}update(e){Ke(this);const{view:t,buffer:n,blockLen:r}=this,i=(e=ut(e)).length;for(let a=0;a<i;){const o=Math.min(r-this.pos,i-a);if(o===r){const t=ot(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Ke(this),Ze(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:i}=this;let{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;!function(e,t,n,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),u=r?4:0,c=r?0:4;e.setUint32(t+u,o,r),e.setUint32(t+c,s,r)}(n,r-8,BigInt(8*this.length),i),this.process(n,0);const o=ot(e),s=this.outputLen;if(s%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=s/4,c=this.get();if(u>c.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<u;e++)o.setUint32(4*e,c[e],i)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.length=r,e.pos=o,e.finished=i,e.destroyed=a,r%t&&e.buffer.set(n),e}}const mr=(e,t,n)=>e&t^~e&n,gr=(e,t,n)=>e&t^e&n^t&n,yr=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]),br=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),vr=new Uint32Array(64);class wr extends pr{constructor(){super(64,32,8,!1),this.A=0|br[0],this.B=0|br[1],this.C=0|br[2],this.D=0|br[3],this.E=0|br[4],this.F=0|br[5],this.G=0|br[6],this.H=0|br[7]}get(){const{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|i,this.F=0|a,this.G=0|o,this.H=0|s}process(e,t){for(let n=0;n<16;n++,t+=4)vr[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=vr[e-15],n=vr[e-2],r=st(t,7)^st(t,18)^t>>>3,i=st(n,17)^st(n,19)^n>>>10;vr[e]=i+vr[e-7]+r+vr[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:u,H:c}=this;for(let e=0;e<64;e++){const t=c+(st(o,6)^st(o,11)^st(o,25))+mr(o,s,u)+yr[e]+vr[e]|0,l=(st(n,2)^st(n,13)^st(n,22))+gr(n,r,i)|0;c=u,u=s,s=o,o=a+t|0,a=i,i=r,r=n,n=t+l|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(n,r,i,a,o,s,u,c)}roundClean(){vr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Ar=lt(()=>new wr),[xr,kr]=(()=>rt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),_r=new Uint32Array(80),Pr=new Uint32Array(80);class Er extends pr{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:u,El:c,Fh:l,Fl:d,Gh:h,Gl:f,Hh:p,Hl:m}=this;return[e,t,n,r,i,a,o,s,u,c,l,d,h,f,p,m]}set(e,t,n,r,i,a,o,s,u,c,l,d,h,f,p,m){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|a,this.Dh=0|o,this.Dl=0|s,this.Eh=0|u,this.El=0|c,this.Fh=0|l,this.Fl=0|d,this.Gh=0|h,this.Gl=0|f,this.Hh=0|p,this.Hl=0|m}process(e,t){for(let n=0;n<16;n++,t+=4)_r[n]=e.getUint32(t),Pr[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|_r[e-15],n=0|Pr[e-15],r=rt.rotrSH(t,n,1)^rt.rotrSH(t,n,8)^rt.shrSH(t,n,7),i=rt.rotrSL(t,n,1)^rt.rotrSL(t,n,8)^rt.shrSL(t,n,7),a=0|_r[e-2],o=0|Pr[e-2],s=rt.rotrSH(a,o,19)^rt.rotrBH(a,o,61)^rt.shrSH(a,o,6),u=rt.rotrSL(a,o,19)^rt.rotrBL(a,o,61)^rt.shrSL(a,o,6),c=rt.add4L(i,u,Pr[e-7],Pr[e-16]),l=rt.add4H(c,r,s,_r[e-7],_r[e-16]);_r[e]=0|l,Pr[e]=0|c}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:u,Dl:c,Eh:l,El:d,Fh:h,Fl:f,Gh:p,Gl:m,Hh:g,Hl:y}=this;for(let e=0;e<80;e++){const t=rt.rotrSH(l,d,14)^rt.rotrSH(l,d,18)^rt.rotrBH(l,d,41),b=rt.rotrSL(l,d,14)^rt.rotrSL(l,d,18)^rt.rotrBL(l,d,41),v=l&h^~l&p,w=d&f^~d&m,A=rt.add5L(y,b,w,kr[e],Pr[e]),x=rt.add5H(A,g,t,v,xr[e],_r[e]),k=0|A,_=rt.rotrSH(n,r,28)^rt.rotrBH(n,r,34)^rt.rotrBH(n,r,39),P=rt.rotrSL(n,r,28)^rt.rotrBL(n,r,34)^rt.rotrBL(n,r,39),E=n&i^n&o^i&o,S=r&a^r&s^a&s;g=0|p,y=0|m,p=0|h,m=0|f,h=0|l,f=0|d,({h:l,l:d}=rt.add(0|u,0|c,0|x,0|k)),u=0|o,c=0|s,o=0|i,s=0|a,i=0|n,a=0|r;const T=rt.add3L(k,P,S);n=rt.add3H(T,x,_,E),r=0|T}({h:n,l:r}=rt.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l:a}=rt.add(0|this.Bh,0|this.Bl,0|i,0|a)),({h:o,l:s}=rt.add(0|this.Ch,0|this.Cl,0|o,0|s)),({h:u,l:c}=rt.add(0|this.Dh,0|this.Dl,0|u,0|c)),({h:l,l:d}=rt.add(0|this.Eh,0|this.El,0|l,0|d)),({h,l:f}=rt.add(0|this.Fh,0|this.Fl,0|h,0|f)),({h:p,l:m}=rt.add(0|this.Gh,0|this.Gl,0|p,0|m)),({h:g,l:y}=rt.add(0|this.Hh,0|this.Hl,0|g,0|y)),this.set(n,r,i,a,o,s,u,c,l,d,h,f,p,m,g,y)}roundClean(){_r.fill(0),Pr.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Sr=lt(()=>new Er),Tr=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();function Mr(e){switch(e){case"sha256":return Ar.create();case"sha512":return Sr.create()}Ct(!1,"invalid hashing algorithm name","algorithm",e)}Tr.crypto||Tr.msCrypto;const Ir=function(e){return Mr("sha256").update(e).digest()},jr=function(e){return Mr("sha512").update(e).digest()};let Cr=Ir,Br=jr,Or=!1,Rr=!1;function Nr(e){const t=Ot(e,"data");return Ht(Cr(t))}function Fr(e){const t=Ot(e,"data");return Ht(Br(t))}Nr._=Ir,Nr.lock=function(){Or=!0},Nr.register=function(e){if(Or)throw new Error("sha256 is locked");Cr=e},Object.freeze(Nr),Fr._=jr,Fr.lock=function(){Rr=!0},Fr.register=function(e){if(Rr)throw new Error("sha512 is locked");Br=e},Object.freeze(Nr);const Lr="0x0000000000000000000000000000000000000000000000000000000000000000",Hr=BigInt(0),qr=(BigInt(1),9007199254740991);function Dr(e,t){switch(typeof e){case"bigint":return e;case"number":return Ct(Number.isInteger(e),"underflow",t||"value",e),Ct(e>=-qr&&e<=qr,"overflow",t||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(n){Ct(!1,`invalid BigNumberish string: ${n.message}`,t||"value",e)}}Ct(!1,"invalid BigNumberish value",t||"value",e)}function Ur(e,t){const n=Dr(e,t);return jt(n>=Hr,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),n}function zr(e,t){switch(typeof e){case"bigint":return Ct(e>=-qr&&e<=qr,"overflow",t||"value",e),Number(e);case"number":return Ct(Number.isInteger(e),"underflow",t||"value",e),Ct(e>=-qr&&e<=qr,"overflow",t||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return zr(BigInt(e),t)}catch(n){Ct(!1,`invalid numeric string: ${n.message}`,t||"value",e)}}Ct(!1,"invalid numeric value",t||"value",e)}function Gr(e,t){let n=Ur(e,"value").toString(16);if(null==t)n.length%2&&(n="0"+n);else{const r=zr(t,"width");for(jt(2*r>=n.length,`value exceeds width (${r} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});n.length<2*r;)n="0"+n}return"0x"+n}function Vr(e){const t=Ur(e,"value");if(t===Hr)return new Uint8Array([]);let n=t.toString(16);n.length%2&&(n="0"+n);const r=new Uint8Array(n.length/2);for(let e=0;e<r.length;e++){const t=2*e;r[e]=parseInt(n.substring(t,t+2),16)}return r}const Wr=BigInt(0),Kr=BigInt(1),Zr=BigInt(2),Qr=BigInt(27),$r=BigInt(28),Jr=BigInt(35),Yr={};function Xr(e){return Ut(Vr(e),32)}class ei{#e;#t;#n;#r;get r(){return this.#e}set r(e){Ct(32===Dt(e),"invalid r","value",e),this.#e=Ht(e)}get s(){return this.#t}set s(e){Ct(32===Dt(e),"invalid s","value",e);const t=Ht(e);Ct(parseInt(t.substring(0,3))<8,"non-canonical s","value",t),this.#t=t}get v(){return this.#n}set v(e){const t=zr(e,"value");Ct(27===t||28===t,"invalid v","v",e),this.#n=t}get networkV(){return this.#r}get legacyChainId(){const e=this.networkV;return null==e?null:ei.getChainId(e)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const e=Ot(this.s);return this.yParity&&(e[0]|=128),Ht(e)}get compactSerialized(){return qt([this.r,this.yParityAndS])}get serialized(){return qt([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,t,n,r){!function(e,t,n){if(null==n&&(n=""),e!==t){let e=n,t="new";n&&(e+=".",t+=" "+n),jt(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:t})}}(e,Yr,"Signature"),this.#e=t,this.#t=n,this.#n=r,this.#r=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new ei(Yr,this.r,this.s,this.v);return this.networkV&&(e.#r=this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:null!=e?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const t=Dr(e,"v");return t==Qr||t==$r?Wr:(Ct(t>=Jr,"invalid EIP-155 v","v",e),(t-Jr)/Zr)}static getChainIdV(e,t){return Dr(e)*Zr+BigInt(35+t-27)}static getNormalizedV(e){const t=Dr(e);return t===Wr||t===Qr?27:t===Kr||t===$r?28:(Ct(t>=Jr,"invalid v","v",e),t&Kr?27:28)}static from(e){function t(t,n){Ct(t,n,"signature",e)}if(null==e)return new ei(Yr,Lr,Lr,27);if("string"==typeof e){const n=Ot(e,"signature");if(64===n.length){const e=Ht(n.slice(0,32)),t=n.slice(32,64),r=128&t[0]?28:27;return t[0]&=127,new ei(Yr,e,Ht(t),r)}if(65===n.length){const e=Ht(n.slice(0,32)),r=n.slice(32,64);t(!(128&r[0]),"non-canonical s");const i=ei.getNormalizedV(n[64]);return new ei(Yr,e,Ht(r),i)}t(!1,"invalid raw signature length")}if(e instanceof ei)return e.clone();const n=e.r;t(null!=n,"missing r");const r=Xr(n),i=function(e,n){if(null!=e)return Xr(e);if(null!=n){t(Nt(n,32),"invalid yParityAndS");const e=Ot(n);return e[0]&=127,Ht(e)}t(!1,"missing s")}(e.s,e.yParityAndS);t(!(128&Ot(i)[0]),"non-canonical s");const{networkV:a,v:o}=function(e,n,r){if(null!=e){const t=Dr(e);return{networkV:t>=Jr?t:void 0,v:ei.getNormalizedV(t)}}if(null!=n)return t(Nt(n,32),"invalid yParityAndS"),{v:128&Ot(n)[0]?28:27};if(null!=r){switch(zr(r,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),s=new ei(Yr,r,i,o);return a&&(s.#r=a),t(null==e.yParity||zr(e.yParity,"sig.yParity")===s.yParity,"yParity mismatch"),t(null==e.yParityAndS||e.yParityAndS===s.yParityAndS,"yParityAndS mismatch"),s}}BigInt(0);const ti=BigInt(1),ni=BigInt(2),ri=e=>e instanceof Uint8Array,ii=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ai(e){if(!ri(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n<e.length;n++)t+=ii[e[n]];return t}function oi(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}function si(e){if("string"!=typeof e)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 n=new Uint8Array(t/2);for(let t=0;t<n.length;t++){const r=2*t,i=e.slice(r,r+2),a=Number.parseInt(i,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");n[t]=a}return n}function ui(e){return oi(ai(e))}function ci(e){if(!ri(e))throw new Error("Uint8Array expected");return oi(ai(Uint8Array.from(e).reverse()))}function li(e,t){return si(e.toString(16).padStart(2*t,"0"))}function di(e,t){return li(e,t).reverse()}function hi(e,t,n){let r;if("string"==typeof t)try{r=si(t)}catch(n){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${n}`)}else{if(!ri(t))throw new Error(`${e} must be hex string or Uint8Array`);r=Uint8Array.from(t)}const i=r.length;if("number"==typeof n&&i!==n)throw new Error(`${e} expected ${n} bytes, got ${i}`);return r}function fi(...e){const t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));let n=0;return e.forEach(e=>{if(!ri(e))throw new Error("Uint8Array expected");t.set(e,n),n+=e.length}),t}const pi=e=>(ni<<BigInt(e-1))-ti,mi=e=>new Uint8Array(e),gi=e=>Uint8Array.from(e);function yi(e,t,n){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");let r=mi(e),i=mi(e),a=0;const o=()=>{r.fill(1),i.fill(0),a=0},s=(...e)=>n(i,r,...e),u=(e=mi())=>{i=s(gi([0]),e),r=s(),0!==e.length&&(i=s(gi([1]),e),r=s())},c=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e<t;){r=s();const t=r.slice();n.push(t),e+=r.length}return fi(...n)};return(e,t)=>{let n;for(o(),u(e);!(n=t(c()));)u();return o(),n}}const bi={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function vi(e,t,n={}){const r=(t,n,r)=>{const i=bi[n];if("function"!=typeof i)throw new Error(`Invalid validator "${n}", expected function`);const a=e[t];if(!(r&&void 0===a||i(a,e)))throw new Error(`Invalid param ${String(t)}=${a} (${typeof a}), expected ${n}`)};for(const[e,n]of Object.entries(t))r(e,n,!1);for(const[e,t]of Object.entries(n))r(e,t,!0);return e}const wi=BigInt(0),Ai=BigInt(1),xi=BigInt(2),ki=BigInt(3),_i=BigInt(4),Pi=BigInt(5),Ei=BigInt(8);function Si(e,t){const n=e%t;return n>=wi?n:t+n}function Ti(e,t,n){if(n<=wi||t<wi)throw new Error("Expected power/modulo > 0");if(n===Ai)return wi;let r=Ai;for(;t>wi;)t&Ai&&(r=r*e%n),e=e*e%n,t>>=Ai;return r}function Mi(e,t,n){let r=e;for(;t-- >wi;)r*=r,r%=n;return r}function Ii(e,t){if(e===wi||t<=wi)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=Si(e,t),r=t,i=wi,a=Ai,o=Ai,s=wi;for(;n!==wi;){const e=r/n,t=r%n,u=i-o*e,c=a-s*e;r=n,n=t,i=o,a=s,o=u,s=c}if(r!==Ai)throw new Error("invert: does not exist");return Si(i,t)}BigInt(9),BigInt(16);const ji=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ci(e,t){const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function Bi(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Oi(e){const t=Bi(e);return t+Math.ceil(t/2)}class Ri extends ct{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");Ve(e.outputLen),Ve(e.blockLen)}(e);const n=ut(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),i.fill(0)}update(e){return Ke(this),this.iHash.update(e),this}digestInto(e){Ke(this),We(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Ni=(e,t,n)=>new Ri(e,t).update(n).digest();Ni.create=(e,t)=>new Ri(e,t);const Fi=BigInt(0),Li=BigInt(1);function Hi(e){return vi(e.Fp,ji.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),vi(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ci(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const{Ph:qi,aT:Di}=e,Ui={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:t}=Ui;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(128&r[0])throw new t("Invalid signature integer: negative");if(0===r[0]&&!(128&r[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:qi(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Ui,n="string"==typeof e?Di(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||48!=n[0])throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:i,l:a}=Ui._parseInt(n.subarray(2)),{d:o,l:s}=Ui._parseInt(a);if(s.length)throw new t("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,n=e=>{const t=e.toString(16);return 1&t.length?`0${t}`:t},r=t(n(e.s)),i=t(n(e.r)),a=r.length/2,o=i.length/2,s=n(a),u=n(o);return`30${n(o+a+4)}02${u}${i}02${s}${r}`}},zi=BigInt(0),Gi=BigInt(1),Vi=(BigInt(2),BigInt(3));function Wi(e){const t=function(e){const t=Hi(e);return vi(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:n,n:r}=t,i=n.BYTES+1,a=2*n.BYTES+1;function o(e){return Si(e,r)}function s(e){return Ii(e,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:l,isWithinCurveOrder:d}=function(e){const t=function(e){const t=Hi(e);vi(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=t;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof n||"bigint"!=typeof n.beta||"function"!=typeof n.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:n}=t,r=t.toBytes||((e,t,r)=>{const i=t.toAffine();return fi(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),i=t.fromBytes||(e=>{const t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function a(e){const{a:r,b:i}=t,a=n.sqr(e),o=n.mul(a,e);return n.add(n.add(o,n.mul(e,r)),i)}if(!n.eql(n.sqr(t.Gy),a(t.Gx)))throw new Error("bad generator point: equation left != right");function o(e){return"bigint"==typeof e&&zi<e&&e<t.n}function s(e){if(!o(e))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function u(e){const{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:i,n:a}=t;if(n&&"bigint"!=typeof e){if(e instanceof Uint8Array&&(e=ai(e)),"string"!=typeof e||!n.includes(e.length))throw new Error("Invalid key");e=e.padStart(2*r,"0")}let o;try{o="bigint"==typeof e?e:ui(hi("private key",e,r))}catch(t){throw new Error(`private key must be ${r} bytes, hex or bigint, not ${typeof e}`)}return i&&(o=Si(o,a)),s(o),o}const c=new Map;function l(e){if(!(e instanceof d))throw new Error("ProjectivePoint expected")}class d{constructor(e,t,r){if(this.px=e,this.py=t,this.pz=r,null==e||!n.isValid(e))throw new Error("x required");if(null==t||!n.isValid(t))throw new Error("y required");if(null==r||!n.isValid(r))throw new Error("z required")}static fromAffine(e){const{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw new Error("invalid affine point");if(e instanceof d)throw new Error("projective point not allowed");const i=e=>n.eql(e,n.ZERO);return i(t)&&i(r)?d.ZERO:new d(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=n.invertBatch(e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(d.fromAffine)}static fromHex(e){const t=d.fromAffine(i(hi("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return d.BASE.multiply(u(e))}_setWindowSize(e){this._WINDOW_SIZE=e,c.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:r}=this.toAffine();if(!n.isValid(e)||!n.isValid(r))throw new Error("bad point: x or y not FE");const i=n.sqr(r),o=a(e);if(!n.eql(i,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:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){l(e);const{px:t,py:r,pz:i}=this,{px:a,py:o,pz:s}=e,u=n.eql(n.mul(t,s),n.mul(a,i)),c=n.eql(n.mul(r,s),n.mul(o,i));return u&&c}negate(){return new d(this.px,n.neg(this.py),this.pz)}double(){const{a:e,b:r}=t,i=n.mul(r,Vi),{px:a,py:o,pz:s}=this;let u=n.ZERO,c=n.ZERO,l=n.ZERO,h=n.mul(a,a),f=n.mul(o,o),p=n.mul(s,s),m=n.mul(a,o);return m=n.add(m,m),l=n.mul(a,s),l=n.add(l,l),u=n.mul(e,l),c=n.mul(i,p),c=n.add(u,c),u=n.sub(f,c),c=n.add(f,c),c=n.mul(u,c),u=n.mul(m,u),l=n.mul(i,l),p=n.mul(e,p),m=n.sub(h,p),m=n.mul(e,m),m=n.add(m,l),l=n.add(h,h),h=n.add(l,h),h=n.add(h,p),h=n.mul(h,m),c=n.add(c,h),p=n.mul(o,s),p=n.add(p,p),h=n.mul(p,m),u=n.sub(u,h),l=n.mul(p,f),l=n.add(l,l),l=n.add(l,l),new d(u,c,l)}add(e){l(e);const{px:r,py:i,pz:a}=this,{px:o,py:s,pz:u}=e;let c=n.ZERO,h=n.ZERO,f=n.ZERO;const p=t.a,m=n.mul(t.b,Vi);let g=n.mul(r,o),y=n.mul(i,s),b=n.mul(a,u),v=n.add(r,i),w=n.add(o,s);v=n.mul(v,w),w=n.add(g,y),v=n.sub(v,w),w=n.add(r,a);let A=n.add(o,u);return w=n.mul(w,A),A=n.add(g,b),w=n.sub(w,A),A=n.add(i,a),c=n.add(s,u),A=n.mul(A,c),c=n.add(y,b),A=n.sub(A,c),f=n.mul(p,w),c=n.mul(m,b),f=n.add(c,f),c=n.sub(y,f),f=n.add(y,f),h=n.mul(c,f),y=n.add(g,g),y=n.add(y,g),b=n.mul(p,b),w=n.mul(m,w),y=n.add(y,b),b=n.sub(g,b),b=n.mul(p,b),w=n.add(w,b),g=n.mul(y,w),h=n.add(h,g),g=n.mul(A,w),c=n.mul(v,c),c=n.sub(c,g),g=n.mul(v,y),f=n.mul(A,f),f=n.add(f,g),new d(c,h,f)}subtract(e){return this.add(e.negate())}is0(){return this.equals(d.ZERO)}wNAF(e){return f.wNAFCached(this,c,e,e=>{const t=n.invertBatch(e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(d.fromAffine)})}multiplyUnsafe(e){const r=d.ZERO;if(e===zi)return r;if(s(e),e===Gi)return this;const{endo:i}=t;if(!i)return f.unsafeLadder(this,e);let{k1neg:a,k1:o,k2neg:u,k2:c}=i.splitScalar(e),l=r,h=r,p=this;for(;o>zi||c>zi;)o&Gi&&(l=l.add(p)),c&Gi&&(h=h.add(p)),p=p.double(),o>>=Gi,c>>=Gi;return a&&(l=l.negate()),u&&(h=h.negate()),h=new d(n.mul(h.px,i.beta),h.py,h.pz),l.add(h)}multiply(e){s(e);let r,i,a=e;const{endo:o}=t;if(o){const{k1neg:e,k1:t,k2neg:s,k2:u}=o.splitScalar(a);let{p:c,f:l}=this.wNAF(t),{p:h,f:p}=this.wNAF(u);c=f.constTimeNegate(e,c),h=f.constTimeNegate(s,h),h=new d(n.mul(h.px,o.beta),h.py,h.pz),r=c.add(h),i=l.add(p)}else{const{p:e,f:t}=this.wNAF(a);r=e,i=t}return d.normalizeZ([r,i])[0]}multiplyAndAddUnsafe(e,t,n){const r=d.BASE,i=(e,t)=>t!==zi&&t!==Gi&&e.equals(r)?e.multiply(t):e.multiplyUnsafe(t),a=i(this,t).add(i(e,n));return a.is0()?void 0:a}toAffine(e){const{px:t,py:r,pz:i}=this,a=this.is0();null==e&&(e=a?n.ONE:n.inv(i));const o=n.mul(t,e),s=n.mul(r,e),u=n.mul(i,e);if(a)return{x:n.ZERO,y:n.ZERO};if(!n.eql(u,n.ONE))throw new Error("invZ was invalid");return{x:o,y:s}}isTorsionFree(){const{h:e,isTorsionFree:n}=t;if(e===Gi)return!0;if(n)return n(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:n}=t;return e===Gi?this:n?n(d,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),r(d,this,e)}toHex(e=!0){return ai(this.toRawBytes(e))}}d.BASE=new d(t.Gx,t.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);const h=t.nBitLength,f=function(e,t){const n=(e,t)=>{const n=t.negate();return e?n:t},r=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:n,unsafeLadder(t,n){let r=e.ZERO,i=t;for(;n>Fi;)n&Li&&(r=r.add(i)),i=i.double(),n>>=Li;return r},precomputeWindow(e,t){const{windows:n,windowSize:i}=r(t),a=[];let o=e,s=o;for(let e=0;e<n;e++){s=o,a.push(s);for(let e=1;e<i;e++)s=s.add(o),a.push(s);o=s.double()}return a},wNAF(t,i,a){const{windows:o,windowSize:s}=r(t);let u=e.ZERO,c=e.BASE;const l=BigInt(2**t-1),d=2**t,h=BigInt(t);for(let e=0;e<o;e++){const t=e*s;let r=Number(a&l);a>>=h,r>s&&(r-=d,a+=Li);const o=t,f=t+Math.abs(r)-1,p=e%2!=0,m=r<0;0===r?c=c.add(n(p,i[o])):u=u.add(n(m,i[f]))}return{p:u,f:c}},wNAFCached(e,t,n,r){const i=e._WINDOW_SIZE||1;let a=t.get(e);return a||(a=this.precomputeWindow(e,i),1!==i&&t.set(e,r(a))),this.wNAF(i,a,n)}}}(d,t.endo?Math.ceil(h/2):h);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:u,weierstrassEquation:a,isWithinCurveOrder:o}}({...t,toBytes(e,t,r){const i=t.toAffine(),a=n.toBytes(i.x),o=fi;return r?o(Uint8Array.from([t.hasEvenY()?2:3]),a):o(Uint8Array.from([4]),a,n.toBytes(i.y))},fromBytes(e){const t=e.length,r=e[0],o=e.subarray(1);if(t!==i||2!==r&&3!==r){if(t===a&&4===r)return{x:n.fromBytes(o.subarray(0,n.BYTES)),y:n.fromBytes(o.subarray(n.BYTES,2*n.BYTES))};throw new Error(`Point of length ${t} was invalid. Expected ${i} compressed bytes or ${a} uncompressed bytes`)}{const e=ui(o);if(!(zi<(s=e)&&s<n.ORDER))throw new Error("Point is not on curve");const t=l(e);let i=n.sqrt(t);return!(1&~r)!=((i&Gi)===Gi)&&(i=n.neg(i)),{x:e,y:i}}var s}}),h=e=>ai(li(e,t.nByteLength));function f(e){return e>r>>Gi}const p=(e,t,n)=>ui(e.slice(t,n));class m{constructor(e,t,n){this.r=e,this.s=t,this.recovery=n,this.assertValidity()}static fromCompact(e){const n=t.nByteLength;return e=hi("compactSignature",e,2*n),new m(p(e,0,n),p(e,n,2*n))}static fromDER(e){const{r:t,s:n}=Ui.toSig(hi("DER",e));return new m(t,n)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new m(this.r,this.s,e)}recoverPublicKey(e){const{r,s:i,recovery:a}=this,c=v(hi("msgHash",e));if(null==a||![0,1,2,3].includes(a))throw new Error("recovery id invalid");const l=2===a||3===a?r+t.n:r;if(l>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const d=1&a?"03":"02",f=u.fromHex(d+h(l)),p=s(l),m=o(-c*p),g=o(i*p),y=u.BASE.multiplyAndAddUnsafe(f,m,g);if(!y)throw new Error("point at infinify");return y.assertValidity(),y}hasHighS(){return f(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return si(this.toDERHex())}toDERHex(){return Ui.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return si(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const g={isValidPrivateKey(e){try{return c(e),!0}catch(e){return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const e=Oi(t.n);return function(e,t,n=!1){const r=e.length,i=Bi(t),a=Oi(t);if(r<16||r<a||r>1024)throw new Error(`expected ${a}-1024 bytes of input, got ${r}`);const o=Si(n?ui(e):ci(e),t-Ai)+Ai;return n?di(o,i):li(o,i)}(t.randomBytes(e),t.n)},precompute:(e=8,t=u.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function y(e){const t=e instanceof Uint8Array,n="string"==typeof e,r=(t||n)&&e.length;return t?r===i||r===a:n?r===2*i||r===2*a:e instanceof u}const b=t.bits2int||function(e){const n=ui(e),r=8*e.length-t.nBitLength;return r>0?n>>BigInt(r):n},v=t.bits2int_modN||function(e){return o(b(e))},w=pi(t.nBitLength);function A(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(zi<=e&&e<w))throw new Error(`bigint expected < 2^${t.nBitLength}`);return li(e,t.nByteLength)}const x={lowS:t.lowS,prehash:!1},k={lowS:t.lowS,prehash:!1};return u.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return u.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,n=!0){if(y(e))throw new Error("first arg must be private key");if(!y(t))throw new Error("second arg must be public key");return u.fromHex(t).multiply(c(e)).toRawBytes(n)},sign:function(e,r,i=x){const{seed:a,k2sig:l}=function(e,r,i=x){if(["recovered","canonical"].some(e=>e in i))throw new Error("sign() legacy options not supported");const{hash:a,randomBytes:l}=t;let{lowS:h,prehash:p,extraEntropy:g}=i;null==h&&(h=!0),e=hi("msgHash",e),p&&(e=hi("prehashed msgHash",a(e)));const y=v(e),w=c(r),k=[A(w),A(y)];if(null!=g){const e=!0===g?l(n.BYTES):g;k.push(hi("extraEntropy",e))}const _=fi(...k),P=y;return{seed:_,k2sig:function(e){const t=b(e);if(!d(t))return;const n=s(t),r=u.BASE.multiply(t).toAffine(),i=o(r.x);if(i===zi)return;const a=o(n*o(P+i*w));if(a===zi)return;let c=(r.x===i?0:2)|Number(r.y&Gi),l=a;return h&&f(a)&&(l=function(e){return f(e)?o(-e):e}(a),c^=1),new m(i,l,c)}}}(e,r,i),h=t;return yi(h.hash.outputLen,h.nByteLength,h.hmac)(a,l)},verify:function(e,n,r,i=k){const a=e;if(n=hi("msgHash",n),r=hi("publicKey",r),"strict"in i)throw new Error("options.strict was renamed to lowS");const{lowS:c,prehash:l}=i;let d,h;try{if("string"==typeof a||a instanceof Uint8Array)try{d=m.fromDER(a)}catch(e){if(!(e instanceof Ui.Err))throw e;d=m.fromCompact(a)}else{if("object"!=typeof a||"bigint"!=typeof a.r||"bigint"!=typeof a.s)throw new Error("PARSE");{const{r:e,s:t}=a;d=new m(e,t)}}h=u.fromHex(r)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(c&&d.hasHighS())return!1;l&&(n=t.hash(n));const{r:f,s:p}=d,g=v(n),y=s(p),b=o(g*y),w=o(f*y),A=u.BASE.multiplyAndAddUnsafe(h,b,w)?.toAffine();return!!A&&o(A.x)===f},ProjectivePoint:u,Signature:m,utils:g}}function Ki(e){return{hash:e,hmac:(t,...n)=>Ni(e,t,function(...e){const t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));let n=0;return e.forEach(e=>{if(!at(e))throw new Error("Uint8Array expected");t.set(e,n),n+=e.length}),t}(...n)),randomBytes:dt}}BigInt(4);const Zi=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Qi=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),$i=BigInt(1),Ji=BigInt(2),Yi=(e,t)=>(e+t/Ji)/t;const Xi=function(e,t,n=!1,r={}){if(e<=wi)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:i,nByteLength:a}=Ci(e,t);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=function(e){if(e%_i===ki){const t=(e+Ai)/_i;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}if(e%Ei===Pi){const t=(e-Pi)/Ei;return function(e,n){const r=e.mul(n,xi),i=e.pow(r,t),a=e.mul(n,i),o=e.mul(e.mul(a,xi),i),s=e.mul(a,e.sub(o,e.ONE));if(!e.eql(e.sqr(s),n))throw new Error("Cannot find square root");return s}}return function(e){const t=(e-Ai)/xi;let n,r,i;for(n=e-Ai,r=0;n%xi===wi;n/=xi,r++);for(i=xi;i<e&&Ti(i,t,e)!==e-Ai;i++);if(1===r){const t=(e+Ai)/_i;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}const a=(n+Ai)/xi;return function(e,o){if(e.pow(o,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let s=r,u=e.pow(e.mul(e.ONE,i),n),c=e.pow(o,a),l=e.pow(o,n);for(;!e.eql(l,e.ONE);){if(e.eql(l,e.ZERO))return e.ZERO;let t=1;for(let n=e.sqr(l);t<s&&!e.eql(n,e.ONE);t++)n=e.sqr(n);const n=e.pow(u,Ai<<BigInt(s-t-1));u=e.sqr(n),c=e.mul(c,n),l=e.mul(l,u),s=t}return c}}(e)}(e),s=Object.freeze({ORDER:e,BITS:i,BYTES:a,MASK:pi(i),ZERO:wi,ONE:Ai,create:t=>Si(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("Invalid field element: expected bigint, got "+typeof t);return wi<=t&&t<e},is0:e=>e===wi,isOdd:e=>(e&Ai)===Ai,neg:t=>Si(-t,e),eql:(e,t)=>e===t,sqr:t=>Si(t*t,e),add:(t,n)=>Si(t+n,e),sub:(t,n)=>Si(t-n,e),mul:(t,n)=>Si(t*n,e),pow:(e,t)=>function(e,t,n){if(n<wi)throw new Error("Expected power > 0");if(n===wi)return e.ONE;if(n===Ai)return t;let r=e.ONE,i=t;for(;n>wi;)n&Ai&&(r=e.mul(r,i)),i=e.sqr(i),n>>=Ai;return r}(s,e,t),div:(t,n)=>Si(t*Ii(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Ii(t,e),sqrt:r.sqrt||(e=>o(s,e)),invertBatch:e=>function(e,t){const n=new Array(t.length),r=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),i=e.inv(r);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),i),n}(s,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?di(e,a):li(e,a),fromBytes:e=>{if(e.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${e.length}`);return n?ci(e):ui(e)}});return Object.freeze(s)}(Zi,void 0,void 0,{sqrt:function(e){const t=Zi,n=BigInt(3),r=BigInt(6),i=BigInt(11),a=BigInt(22),o=BigInt(23),s=BigInt(44),u=BigInt(88),c=e*e*e%t,l=c*c*e%t,d=Mi(l,n,t)*l%t,h=Mi(d,n,t)*l%t,f=Mi(h,Ji,t)*c%t,p=Mi(f,i,t)*f%t,m=Mi(p,a,t)*p%t,g=Mi(m,s,t)*m%t,y=Mi(g,u,t)*g%t,b=Mi(y,s,t)*m%t,v=Mi(b,n,t)*l%t,w=Mi(v,o,t)*p%t,A=Mi(w,r,t)*c%t,x=Mi(A,Ji,t);if(!Xi.eql(Xi.sqr(x),e))throw new Error("Cannot find square root");return x}}),ea=function(e,t){const n=t=>Wi({...e,...Ki(t)});return Object.freeze({...n(t),create:n})}({a:BigInt(0),b:BigInt(7),Fp:Xi,n:Qi,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Qi,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-$i*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),s=Yi(a*e,t),u=Yi(-r*e,t);let c=Si(e-s*n-u*i,t),l=Si(-s*r-u*a,t);const d=c>o,h=l>o;if(d&&(c=t-c),h&&(l=t-l),c>o||l>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:c,k2neg:h,k2:l}}}},Ar);BigInt(0),ea.ProjectivePoint;class ta{#i;constructor(e){Ct(32===Dt(e),"invalid private key","privateKey","[REDACTED]"),this.#i=Ht(e)}get privateKey(){return this.#i}get publicKey(){return ta.computePublicKey(this.#i)}get compressedPublicKey(){return ta.computePublicKey(this.#i,!0)}sign(e){Ct(32===Dt(e),"invalid digest length","digest",e);const t=ea.sign(Rt(e),Rt(this.#i),{lowS:!0});return ei.from({r:Gr(t.r,32),s:Gr(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){const t=ta.computePublicKey(e);return Ht(ea.getSharedSecret(Rt(this.#i),Ot(t),!1))}static computePublicKey(e,t){let n=Ot(e,"key");if(32===n.length)return Ht(ea.getPublicKey(n,!!t));if(64===n.length){const e=new Uint8Array(65);e[0]=4,e.set(n,1),n=e}return Ht(ea.ProjectivePoint.fromHex(n).toRawBytes(t))}static recoverPublicKey(e,t){Ct(32===Dt(e),"invalid digest length","digest",e);const n=ei.from(t);let r=ea.Signature.fromCompact(Rt(qt([n.r,n.s])));r=r.addRecoveryBit(n.yParity);const i=r.recoverPublicKey(Rt(e));return Ct(null!=i,"invalid signature for digest","signature",t),"0x"+i.toHex(!1)}static addPoints(e,t,n){const r=ea.ProjectivePoint.fromHex(ta.computePublicKey(e).substring(2)),i=ea.ProjectivePoint.fromHex(ta.computePublicKey(t).substring(2));return"0x"+r.add(i).toHex(!!n)}}function na(e){let t=e.toString(16);for(;t.length<2;)t="0"+t;return"0x"+t}function ra(e,t,n){let r=0;for(let i=0;i<n;i++)r=256*r+e[t+i];return r}function ia(e,t,n,r){const i=[];for(;n<t+1+r;){const a=aa(e,n);i.push(a.result),jt((n+=a.consumed)<=t+1+r,"child data too short","BUFFER_OVERRUN",{buffer:e,length:r,offset:t})}return{consumed:1+r,result:i}}function aa(e,t){jt(0!==e.length,"data too short","BUFFER_OVERRUN",{buffer:e,length:0,offset:1});const n=t=>{jt(t<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:t})};if(e[t]>=248){const r=e[t]-247;n(t+1+r);const i=ra(e,t+1,r);return n(t+1+r+i),ia(e,t,t+1+r,r+i)}if(e[t]>=192){const r=e[t]-192;return n(t+1+r),ia(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;n(t+1+r);const i=ra(e,t+1,r);return n(t+1+r+i),{consumed:1+r+i,result:Ht(e.slice(t+1+r,t+1+r+i))}}if(e[t]>=128){const r=e[t]-128;return n(t+1+r),{consumed:1+r,result:Ht(e.slice(t+1,t+1+r))}}return{consumed:1,result:na(e[t])}}function oa(e){const t=Ot(e,"data"),n=aa(t,0);return Ct(n.consumed===t.length,"unexpected junk after rlp payload","data",e),n.result}function sa(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function ua(e){if(Array.isArray(e)){let t=[];if(e.forEach(function(e){t=t.concat(ua(e))}),t.length<=55)return t.unshift(192+t.length),t;const n=sa(t.length);return n.unshift(247+n.length),n.concat(t)}const t=Array.prototype.slice.call(Ot(e,"object"));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const n=sa(t.length);return n.unshift(183+n.length),n.concat(t)}const ca="0123456789abcdef";function la(e){let t="0x";for(const n of ua(e))t+=ca[n>>4],t+=ca[15&n];return t}const da=BigInt(0),ha=BigInt(2),fa=BigInt(27),pa=BigInt(28),ma=BigInt(35),ga=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),ya=131072;function ba(e,t){let n=e.toString(16);for(;n.length<2;)n="0"+n;return n+=Nr(t).substring(4),"0x"+n}function va(e){return"0x"===e?null:Xt(e)}function wa(e,t){try{return tn(e)}catch(n){Ct(!1,n.message,t,e)}}function Aa(e,t){try{if(!Array.isArray(e))throw new Error("authorizationList: invalid array");const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(!Array.isArray(r))throw new Error(`authorization[${n}]: invalid array`);if(6!==r.length)throw new Error(`authorization[${n}]: wrong length`);if(!r[1])throw new Error(`authorization[${n}]: null address`);t.push({address:va(r[1]),nonce:ka(r[2],"nonce"),chainId:ka(r[0],"chainId"),signature:ei.from({yParity:xa(r[3],"yParity"),r:Ut(r[4],32),s:Ut(r[5],32)})})}return t}catch(n){Ct(!1,n.message,t,e)}}function xa(e,t){return"0x"===e?0:zr(e,t)}function ka(e,t){if("0x"===e)return da;const n=Dr(e,t);return Ct(n<=ga,"value exceeds uint size",t,n),n}function _a(e,t){const n=Dr(e,"value"),r=Vr(n);return Ct(r.length<=32,"value too large",`tx.${t}`,n),r}function Pa(e){return tn(e).map(e=>[e.address,e.storageKeys])}function Ea(e,t){Ct(Array.isArray(e),`invalid ${t}`,"value",e);for(let t=0;t<e.length;t++)Ct(Nt(e[t],32),"invalid ${ param } hash",`value[${t}]`,e[t]);return e}function Sa(e,t){let n;try{if(n=xa(t[0],"yParity"),0!==n&&1!==n)throw new Error("bad yParity")}catch(e){Ct(!1,"invalid yParity","yParity",t[0])}const r=Ut(t[1],32),i=Ut(t[2],32),a=ei.from({r,s:i,yParity:n});e.signature=a}class Ta{#a;#o;#s;#u;#c;#l;#d;#h;#f;#p;#m;#g;#y;#b;#v;#w;#A;get type(){return this.#a}set type(e){switch(e){case null:this.#a=null;break;case 0:case"legacy":this.#a=0;break;case 1:case"berlin":case"eip-2930":this.#a=1;break;case 2:case"london":case"eip-1559":this.#a=2;break;case 3:case"cancun":case"eip-4844":this.#a=3;break;case 4:case"pectra":case"eip-7702":this.#a=4;break;default:Ct(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const e=this.#o;return null==e&&3===this.type?fr:e}set to(e){this.#o=null==e?null:Xt(e)}get nonce(){return this.#u}set nonce(e){this.#u=zr(e,"value")}get gasLimit(){return this.#c}set gasLimit(e){this.#c=Dr(e)}get gasPrice(){const e=this.#l;return null!=e||0!==this.type&&1!==this.type?e:da}set gasPrice(e){this.#l=null==e?null:Dr(e,"gasPrice")}get maxPriorityFeePerGas(){const e=this.#d;return null==e?2===this.type||3===this.type?da:null:e}set maxPriorityFeePerGas(e){this.#d=null==e?null:Dr(e,"maxPriorityFeePerGas")}get maxFeePerGas(){const e=this.#h;return null==e?2===this.type||3===this.type?da:null:e}set maxFeePerGas(e){this.#h=null==e?null:Dr(e,"maxFeePerGas")}get data(){return this.#s}set data(e){this.#s=Ht(e)}get value(){return this.#f}set value(e){this.#f=Dr(e,"value")}get chainId(){return this.#p}set chainId(e){this.#p=Dr(e)}get signature(){return this.#m||null}set signature(e){this.#m=null==e?null:ei.from(e)}get accessList(){const e=this.#g||null;return null==e?1===this.type||2===this.type||3===this.type?[]:null:e}set accessList(e){this.#g=null==e?null:tn(e)}get authorizationList(){const e=this.#A||null;return null==e&&4===this.type?[]:e}set authorizationList(e){this.#A=null==e?null:e.map(e=>{return{address:Xt((t=e).address),nonce:Dr(null!=t.nonce?t.nonce:0),chainId:Dr(null!=t.chainId?t.chainId:0),signature:ei.from(t.signature)};var t})}get maxFeePerBlobGas(){const e=this.#y;return null==e&&3===this.type?da:e}set maxFeePerBlobGas(e){this.#y=null==e?null:Dr(e,"maxFeePerBlobGas")}get blobVersionedHashes(){let e=this.#b;return null==e&&3===this.type?[]:e}set blobVersionedHashes(e){if(null!=e){Ct(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let t=0;t<e.length;t++)Ct(Nt(e[t],32),"invalid blobVersionedHash",`value[${t}]`,e[t])}this.#b=e}get blobs(){return null==this.#w?null:this.#w.map(e=>Object.assign({},e))}set blobs(e){if(null==e)return void(this.#w=null);const t=[],n=[];for(let r=0;r<e.length;r++){const i=e[r];if(Ft(i)){jt(this.#v,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let e=Ot(i);if(Ct(e.length<=ya,"blob is too large",`blobs[${r}]`,i),e.length!==ya){const t=new Uint8Array(ya);t.set(e),e=t}const a=this.#v.blobToKzgCommitment(e),o=Ht(this.#v.computeBlobKzgProof(e,a));t.push({data:Ht(e),commitment:Ht(a),proof:o}),n.push(ba(1,a))}else{const e=Ht(i.commitment);t.push({data:Ht(i.data),commitment:e,proof:Ht(i.proof)}),n.push(ba(1,e))}}this.#w=t,this.#b=n}get kzg(){return this.#v}set kzg(e){this.#v=null==e?null:function(e){return{blobToKzgCommitment:t=>{if("computeBlobProof"in e){if("blobToKzgCommitment"in e&&"function"==typeof e.blobToKzgCommitment)return Ot(e.blobToKzgCommitment(Ht(t)))}else if("blobToKzgCommitment"in e&&"function"==typeof e.blobToKzgCommitment)return Ot(e.blobToKzgCommitment(t));if("blobToKZGCommitment"in e&&"function"==typeof e.blobToKZGCommitment)return Ot(e.blobToKZGCommitment(Ht(t)));Ct(!1,"unsupported KZG library","kzg",e)},computeBlobKzgProof:(t,n)=>"computeBlobProof"in e&&"function"==typeof e.computeBlobProof?Ot(e.computeBlobProof(Ht(t),Ht(n))):"computeBlobKzgProof"in e&&"function"==typeof e.computeBlobKzgProof?e.computeBlobKzgProof(t,n):"computeBlobKZGProof"in e&&"function"==typeof e.computeBlobKZGProof?Ot(e.computeBlobKZGProof(Ht(t),Ht(n))):void Ct(!1,"unsupported KZG library","kzg",e)}}(e)}constructor(){this.#a=null,this.#o=null,this.#u=0,this.#c=da,this.#l=null,this.#d=null,this.#h=null,this.#s="0x",this.#f=da,this.#p=da,this.#m=null,this.#g=null,this.#y=null,this.#b=null,this.#v=null,this.#w=null,this.#A=null}get hash(){return null==this.signature?null:Wt(this.#x(!0,!1))}get unsignedHash(){return Wt(this.unsignedSerialized)}get from(){return null==this.signature?null:(e=this.unsignedHash,t=this.signature,function(e){let t;return t="string"==typeof e?ta.computePublicKey(e,!1):e.publicKey,Xt(Wt("0x"+t.substring(4)).substring(26))}(ta.recoverPublicKey(e,t)));var e,t}get fromPublicKey(){return null==this.signature?null:ta.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return null!=this.signature}#x(e,t){jt(!e||null!=this.signature,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const n=e?this.signature:null;switch(this.inferType()){case 0:return function(e,t){const n=[_a(e.nonce,"nonce"),_a(e.gasPrice||0,"gasPrice"),_a(e.gasLimit,"gasLimit"),e.to||"0x",_a(e.value,"value"),e.data];let r=da;if(e.chainId!=da)r=Dr(e.chainId,"tx.chainId"),Ct(!t||null==t.networkV||t.legacyChainId===r,"tx.chainId/sig.v mismatch","sig",t);else if(e.signature){const t=e.signature.legacyChainId;null!=t&&(r=t)}if(!t)return r!==da&&(n.push(Vr(r)),n.push("0x"),n.push("0x")),la(n);let i=BigInt(27+t.yParity);return r!==da?i=ei.getChainIdV(r,t.v):BigInt(t.v)!==i&&Ct(!1,"tx.chainId/sig.v mismatch","sig",t),n.push(Vr(i)),n.push(Vr(t.r)),n.push(Vr(t.s)),la(n)}(this,n);case 1:return function(e,t){const n=[_a(e.chainId,"chainId"),_a(e.nonce,"nonce"),_a(e.gasPrice||0,"gasPrice"),_a(e.gasLimit,"gasLimit"),e.to||"0x",_a(e.value,"value"),e.data,Pa(e.accessList||[])];return t&&(n.push(_a(t.yParity,"recoveryParam")),n.push(Vr(t.r)),n.push(Vr(t.s))),qt(["0x01",la(n)])}(this,n);case 2:return function(e,t){const n=[_a(e.chainId,"chainId"),_a(e.nonce,"nonce"),_a(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),_a(e.maxFeePerGas||0,"maxFeePerGas"),_a(e.gasLimit,"gasLimit"),e.to||"0x",_a(e.value,"value"),e.data,Pa(e.accessList||[])];return t&&(n.push(_a(t.yParity,"yParity")),n.push(Vr(t.r)),n.push(Vr(t.s))),qt(["0x02",la(n)])}(this,n);case 3:return function(e,t,n){const r=[_a(e.chainId,"chainId"),_a(e.nonce,"nonce"),_a(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),_a(e.maxFeePerGas||0,"maxFeePerGas"),_a(e.gasLimit,"gasLimit"),e.to||fr,_a(e.value,"value"),e.data,Pa(e.accessList||[]),_a(e.maxFeePerBlobGas||0,"maxFeePerBlobGas"),Ea(e.blobVersionedHashes||[],"blobVersionedHashes")];return t&&(r.push(_a(t.yParity,"yParity")),r.push(Vr(t.r)),r.push(Vr(t.s)),n)?qt(["0x03",la([r,n.map(e=>e.data),n.map(e=>e.commitment),n.map(e=>e.proof)])]):qt(["0x03",la(r)])}(this,n,t?this.blobs:null);case 4:return function(e,t){const n=[_a(e.chainId,"chainId"),_a(e.nonce,"nonce"),_a(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),_a(e.maxFeePerGas||0,"maxFeePerGas"),_a(e.gasLimit,"gasLimit"),e.to||"0x",_a(e.value,"value"),e.data,Pa(e.accessList||[]),(r=e.authorizationList||[],r.map(e=>[_a(e.chainId,"chainId"),e.address,_a(e.nonce,"nonce"),_a(e.signature.yParity,"yParity"),Vr(e.signature.r),Vr(e.signature.s)]))];var r;return t&&(n.push(_a(t.yParity,"yParity")),n.push(Vr(t.r)),n.push(Vr(t.s))),qt(["0x04",la(n)])}(this,n)}jt(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#x(!0,!0)}get unsignedSerialized(){return this.#x(!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=null!=this.gasPrice,t=null!=this.maxFeePerGas||null!=this.maxPriorityFeePerGas,n=null!=this.accessList,r=null!=this.#y||this.#b;null!=this.maxFeePerGas&&null!=this.maxPriorityFeePerGas&&jt(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),jt(!t||0!==this.type&&1!==this.type,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),jt(0!==this.type||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return null!=this.type?i.push(this.type):this.authorizationList&&this.authorizationList.length?i.push(4):t?i.push(2):e?(i.push(1),n||i.push(0)):n?(i.push(1),i.push(2)):(r&&this.to||(i.push(0),i.push(1),i.push(2)),i.push(3)),i.sort(),i}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}clone(){return Ta.from(this)}toJSON(){const e=e=>null==e?null:e.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(null==e)return new Ta;if("string"==typeof e){const t=Ot(e);if(t[0]>=127)return Ta.from(function(e){const t=oa(e);Ct(Array.isArray(t)&&(9===t.length||6===t.length),"invalid field count for legacy transaction","data",e);const n={type:0,nonce:xa(t[0],"nonce"),gasPrice:ka(t[1],"gasPrice"),gasLimit:ka(t[2],"gasLimit"),to:va(t[3]),value:ka(t[4],"value"),data:Ht(t[5]),chainId:da};if(6===t.length)return n;const r=ka(t[6],"v"),i=ka(t[7],"r"),a=ka(t[8],"s");if(i===da&&a===da)n.chainId=r;else{let e=(r-ma)/ha;e<da&&(e=da),n.chainId=e,Ct(e!==da||r===fa||r===pa,"non-canonical legacy v","v",t[6]),n.signature=ei.from({r:Ut(t[7],32),s:Ut(t[8],32),v:r})}return n}(t));switch(t[0]){case 1:return Ta.from(function(e){const t=oa(Ot(e).slice(1));Ct(Array.isArray(t)&&(8===t.length||11===t.length),"invalid field count for transaction type: 1","data",Ht(e));const n={type:1,chainId:ka(t[0],"chainId"),nonce:xa(t[1],"nonce"),gasPrice:ka(t[2],"gasPrice"),gasLimit:ka(t[3],"gasLimit"),to:va(t[4]),value:ka(t[5],"value"),data:Ht(t[6]),accessList:wa(t[7],"accessList")};return 8===t.length||Sa(n,t.slice(8)),n}(t));case 2:return Ta.from(function(e){const t=oa(Ot(e).slice(1));Ct(Array.isArray(t)&&(9===t.length||12===t.length),"invalid field count for transaction type: 2","data",Ht(e));const n={type:2,chainId:ka(t[0],"chainId"),nonce:xa(t[1],"nonce"),maxPriorityFeePerGas:ka(t[2],"maxPriorityFeePerGas"),maxFeePerGas:ka(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:ka(t[4],"gasLimit"),to:va(t[5]),value:ka(t[6],"value"),data:Ht(t[7]),accessList:wa(t[8],"accessList")};return 9===t.length||Sa(n,t.slice(9)),n}(t));case 3:return Ta.from(function(e){let t=oa(Ot(e).slice(1)),n="3",r=null;if(4===t.length&&Array.isArray(t[0])){n="3 (network format)";const e=t[1],i=t[2],a=t[3];Ct(Array.isArray(e),"invalid network format: blobs not an array","fields[1]",e),Ct(Array.isArray(i),"invalid network format: commitments not an array","fields[2]",i),Ct(Array.isArray(a),"invalid network format: proofs not an array","fields[3]",a),Ct(e.length===i.length,"invalid network format: blobs/commitments length mismatch","fields",t),Ct(e.length===a.length,"invalid network format: blobs/proofs length mismatch","fields",t),r=[];for(let n=0;n<t[1].length;n++)r.push({data:e[n],commitment:i[n],proof:a[n]});t=t[0]}Ct(Array.isArray(t)&&(11===t.length||14===t.length),`invalid field count for transaction type: ${n}`,"data",Ht(e));const i={type:3,chainId:ka(t[0],"chainId"),nonce:xa(t[1],"nonce"),maxPriorityFeePerGas:ka(t[2],"maxPriorityFeePerGas"),maxFeePerGas:ka(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:ka(t[4],"gasLimit"),to:va(t[5]),value:ka(t[6],"value"),data:Ht(t[7]),accessList:wa(t[8],"accessList"),maxFeePerBlobGas:ka(t[9],"maxFeePerBlobGas"),blobVersionedHashes:t[10]};r&&(i.blobs=r),Ct(null!=i.to,`invalid address for transaction type: ${n}`,"data",e),Ct(Array.isArray(i.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",e);for(let t=0;t<i.blobVersionedHashes.length;t++)Ct(Nt(i.blobVersionedHashes[t],32),`invalid blobVersionedHash at index ${t}: must be length 32`,"data",e);return 11===t.length||Sa(i,t.slice(11)),i}(t));case 4:return Ta.from(function(e){const t=oa(Ot(e).slice(1));Ct(Array.isArray(t)&&(10===t.length||13===t.length),"invalid field count for transaction type: 4","data",Ht(e));const n={type:4,chainId:ka(t[0],"chainId"),nonce:xa(t[1],"nonce"),maxPriorityFeePerGas:ka(t[2],"maxPriorityFeePerGas"),maxFeePerGas:ka(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:ka(t[4],"gasLimit"),to:va(t[5]),value:ka(t[6],"value"),data:Ht(t[7]),accessList:wa(t[8],"accessList"),authorizationList:Aa(t[9],"authorizationList")};return 10===t.length||Sa(n,t.slice(10)),n}(t))}jt(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const t=new Ta;return null!=e.type&&(t.type=e.type),null!=e.to&&(t.to=e.to),null!=e.nonce&&(t.nonce=e.nonce),null!=e.gasLimit&&(t.gasLimit=e.gasLimit),null!=e.gasPrice&&(t.gasPrice=e.gasPrice),null!=e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),null!=e.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null!=e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=e.maxFeePerBlobGas),null!=e.data&&(t.data=e.data),null!=e.value&&(t.value=e.value),null!=e.chainId&&(t.chainId=e.chainId),null!=e.signature&&(t.signature=ei.from(e.signature)),null!=e.accessList&&(t.accessList=e.accessList),null!=e.authorizationList&&(t.authorizationList=e.authorizationList),null!=e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes),null!=e.kzg&&(t.kzg=e.kzg),null!=e.blobs&&(t.blobs=e.blobs),null!=e.hash&&(Ct(t.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),Ct(t.hash===e.hash,"hash mismatch","tx",e)),null!=e.from&&(Ct(t.isSigned(),"unsigned transaction cannot define '.from'","tx",e),Ct(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}}class Ma extends nr{sigFeePayerRLP(){Te(this.type)?this.throwTypeError("sigFeePayerRLP not implemented"):this.throwTypeError("sigFeePayerRLP not defined")}senderTxHashRLP(){if(!Te(this.type))return this.txHashRLP();this.throwTypeError("senderTxHashRLP not implemented")}addSenderSig(e){const t=Fe(e);this.fields.txSignatures||=[],this.fields.txSignatures.push(t)}addFeePayerSig(e){const t=Fe(e);this.fields.feePayerSignatures||=[],this.fields.feePayerSignatures.push(t)}encodeNestedRLP(e,t){const n=this.getFields(e),r=this.getFields(t);return oe.encode([oe.encode(n),...r,"0x","0x"])}encodeTypePrefixedRLP(e){const t=this.getFields(e);return se.concat(this.getField("type"),oe.encode(t))}decodeTypePrefixedRLP(e,t){const n=se.toNumber(e.substring(0,4));n!==this.type&&this.throwTypeError(`Invalid type '${n}`);const r="0x"+String(e).substring(4),i=["type",...t],a=[this.type,...oe.decode(r)];this.setFieldsFromArray(i,a)}decodeTypePrefixedVarlenRLP(e,...t){const n=oe.decode("0x"+e.substring(4)).length;for(let r=0;r<t.length;r++){const i=t[r];if(n==i.length)return void this.decodeTypePrefixedRLP(e,i)}this.throwTypeError(`Invalid RLP string '${e}'`)}}class Ia extends Ma{static type=we.FeeDelegatedValueTransfer;static typeName="TxTypeFeeDelegatedValueTransfer";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,to:qn,value:Wn,from:qn,chainId:Vn,txSignatures:Zn,feePayer:qn,feePayerSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","to","value","from","txSignatures"],["nonce","gasPrice","gasLimit","to","value","from","txSignatures","feePayer","feePayerSignatures"])}}class ja extends Ma{static type=we.FeeDelegatedValueTransferMemo;static typeName="TxTypeFeeDelegatedValueTransferMemo";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,to:qn,value:Wn,from:qn,data:Dn,chainId:Vn,txSignatures:Zn,feePayer:qn,feePayerSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures"],["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures","feePayer","feePayerSignatures"])}}class Ca extends Ma{static type=we.FeeDelegatedSmartContractDeploy;static typeName="TxTypeFeeDelegatedSmartContractDeploy";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,to:qn,value:Wn,from:qn,data:Dn,humanReadable:Kn,codeFormat:zn,chainId:Vn,txSignatures:Zn,feePayer:qn,feePayerSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat","txSignatures"],["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat","txSignatures","feePayer","feePayerSignatures"])}}class Ba extends Ma{static type=we.FeeDelegatedSmartContractExecution;static typeName="TxTypeFeeDelegatedSmartContractExecution";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,to:qn,value:Wn,from:qn,data:Dn,chainId:Vn,txSignatures:Zn,feePayer:qn,feePayerSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures"],["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures","feePayer","feePayerSignatures"])}}class Oa extends Ma{static type=we.FeeDelegatedAccountUpdate;static typeName="TxTypeFeeDelegatedAccountUpdate";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,from:qn,key:tr,chainId:Vn,txSignatures:Zn,feePayer:qn,feePayerSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from","key"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from","key"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","key","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","key","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","from","key","txSignatures"],["nonce","gasPrice","gasLimit","from","key","txSignatures","feePayer","feePayerSignatures"])}}class Ra extends Ma{static type=we.FeeDelegatedCancel;static typeName="TxTypeFeeDelegatedCancel";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,from:qn,chainId:Vn,txSignatures:Zn,feePayer:qn,feePayerSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","from","txSignatures"],["nonce","gasPrice","gasLimit","from","txSignatures","feePayer","feePayerSignatures"])}}class Na extends Ma{static type=we.ValueTransfer;static typeName="TxTypeValueTransfer";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,to:qn,value:Wn,from:qn,chainId:Vn,txSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from"],["chainId"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","txSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedRLP(e,["nonce","gasPrice","gasLimit","to","value","from","txSignatures"])}}class Fa extends Ma{static type=we.ValueTransferMemo;static typeName="TxTypeValueTransferMemo";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,to:qn,value:Wn,from:qn,data:Dn,chainId:Vn,txSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data"],["chainId"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures"])}}class La extends Ma{static type=we.SmartContractDeploy;static typeName="TxTypeSmartContractDeploy";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,to:qn,value:Wn,from:qn,data:Dn,humanReadable:Kn,codeFormat:zn,chainId:Vn,txSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat"],["chainId"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat","txSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","codeFormat","txSignatures"])}}class Ha extends Ma{static type=we.SmartContractExecution;static typeName="TxTypeSmartContractExecution";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,to:qn,value:Wn,from:qn,data:Dn,chainId:Vn,txSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data"],["chainId"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","txSignatures"])}}class qa extends Ma{static type=we.AccountUpdate;static typeName="TxTypeAccountUpdate";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,from:qn,key:tr,chainId:Vn,txSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from","key"],["chainId"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","key","txSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedRLP(e,["nonce","gasPrice","gasLimit","from","key","txSignatures"])}}class Da extends Ma{static type=we.Cancel;static typeName="TxTypeCancel";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,from:qn,chainId:Vn,txSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from"],["chainId"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","txSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedRLP(e,["nonce","gasPrice","gasLimit","from","txSignatures"])}}class Ua extends Ma{static type=we.FeeDelegatedValueTransferWithRatio;static typeName="TxTypeFeeDelegatedValueTransferWithRatio";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,to:qn,value:Wn,from:qn,feeRatio:zn,chainId:Vn,txSignatures:Zn,feePayer:qn,feePayerSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","feeRatio"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","feeRatio"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","feeRatio","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","feeRatio","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","to","value","from","feeRatio","txSignatures"],["nonce","gasPrice","gasLimit","to","value","from","feeRatio","txSignatures","feePayer","feePayerSignatures"])}}class za extends Ma{static type=we.FeeDelegatedValueTransferMemoWithRatio;static typeName="TxTypeFeeDelegatedValueTransferMemoWithRatio";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,to:qn,value:Wn,from:qn,data:Dn,feeRatio:zn,chainId:Vn,txSignatures:Zn,feePayer:qn,feePayerSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","feeRatio"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","feeRatio"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","feeRatio","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","feeRatio","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","feeRatio","txSignatures"],["nonce","gasPrice","gasLimit","to","value","from","data","feeRatio","txSignatures","feePayer","feePayerSignatures"])}}class Ga extends Ma{static type=we.FeeDelegatedSmartContractDeployWithRatio;static typeName="TxTypeFeeDelegatedSmartContractDeployWithRatio";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,to:qn,value:Wn,from:qn,data:Dn,humanReadable:Kn,feeRatio:zn,codeFormat:zn,chainId:Vn,txSignatures:Zn,feePayer:qn,feePayerSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","feeRatio","codeFormat"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","feeRatio","codeFormat"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","feeRatio","codeFormat","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","feeRatio","codeFormat","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","feeRatio","codeFormat","txSignatures"],["nonce","gasPrice","gasLimit","to","value","from","data","humanReadable","feeRatio","codeFormat","txSignatures","feePayer","feePayerSignatures"])}}class Va extends Ma{static type=we.FeeDelegatedSmartContractExecutionWithRatio;static typeName="TxTypeFeeDelegatedSmartContractExecutionWithRatio";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,to:qn,value:Wn,from:qn,data:Dn,feeRatio:zn,chainId:Vn,txSignatures:Zn,feePayer:qn,feePayerSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","feeRatio"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","to","value","from","data","feeRatio"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","feeRatio","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","to","value","from","data","feeRatio","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","to","value","from","data","feeRatio","txSignatures"],["nonce","gasPrice","gasLimit","to","value","from","data","feeRatio","txSignatures","feePayer","feePayerSignatures"])}}class Wa extends Ma{static type=we.FeeDelegatedAccountUpdateWithRatio;static typeName="TxTypeFeeDelegatedAccountUpdateWithRatio";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,from:qn,key:tr,feeRatio:zn,chainId:Vn,txSignatures:Zn,feePayer:qn,feePayerSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from","key","feeRatio"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from","key","feeRatio"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","key","feeRatio","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","key","feeRatio","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","from","key","feeRatio","txSignatures"],["nonce","gasPrice","gasLimit","from","key","feeRatio","txSignatures","feePayer","feePayerSignatures"])}}class Ka extends Ma{static type=we.FeeDelegatedCancelWithRatio;static typeName="TxTypeFeeDelegatedCancelWithRatio";static fieldTypes={type:zn,nonce:Vn,gasPrice:Wn,gasLimit:Vn,from:qn,feeRatio:zn,chainId:Vn,txSignatures:Zn,feePayer:qn,feePayerSignatures:Zn};sigRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from","feeRatio"],["chainId"])}sigFeePayerRLP(){return this.encodeNestedRLP(["type","nonce","gasPrice","gasLimit","from","feeRatio"],["feePayer","chainId"])}senderTxHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","feeRatio","txSignatures"])}txHashRLP(){return this.encodeTypePrefixedRLP(["nonce","gasPrice","gasLimit","from","feeRatio","txSignatures","feePayer","feePayerSignatures"])}setFieldsFromRLP(e){this.decodeTypePrefixedVarlenRLP(e,["nonce","gasPrice","gasLimit","from","feeRatio","txSignatures"],["nonce","gasPrice","gasLimit","from","feeRatio","txSignatures","feePayer","feePayerSignatures"])}}const Za=new class extends rr{constructor(){super(["type","chainId","txSignatures"]),this.add(Na),this.add(Fa),this.add(La),this.add(Ha),this.add(qa),this.add(Da),this.add(Ia),this.add(ja),this.add(Ca),this.add(Ba),this.add(Oa),this.add(Ra),this.add(Ua),this.add(za),this.add(Ga),this.add(Va),this.add(Wa),this.add(Ka)}fromObject(e){return e.input&&(e.data=e.input),se.fromNumber(e.type)!=se.fromNumber(we.SmartContractDeploy)&&se.fromNumber(e.type)!=se.fromNumber(we.FeeDelegatedSmartContractDeploy)&&se.fromNumber(e.type)!=se.fromNumber(we.FeeDelegatedSmartContractDeployWithRatio)||(e.to="0x"),super.fromObject(e)}fromRLP(e){const t=ue(e);if(!_e(t))throw new Error("Not a Klaytn raw transaction");const n=new(this.lookup(t));return n.setFieldsFromRLP(e),n}};function Qa(e){if(!_e(ue(e))){const t=Ta.from(e),n={from:t.from??void 0,to:t.to??void 0,nonce:t.nonce,data:t.data,r:t.signature?.r,s:t.signature?.s,v:t.signature?.v??void 0,hash:t.hash??void 0,accessList:t.accessList??void 0,chainId:Number(t.chainId),type:t?.type,gasLimit:I(t.gasLimit),gasPrice:t.gasPrice?I(t.gasPrice):void 0,value:I(t.value),maxPriorityFeePerGas:t.maxPriorityFeePerGas?I(t.maxPriorityFeePerGas):void 0,maxFeePerGas:t.maxFeePerGas?I(t.maxFeePerGas):void 0};return"number"==typeof n.v&&(n.v=27===n.v?0:1),Object.entries(n).forEach(([e,t])=>{void 0===t&&delete n[e]}),n}{const t=Za.fromRLP(e).toObject();try{const n={hash:K(e),to:t.to?se.toAddress(t.to):void 0,from:t.from?se.toAddress(t.from):void 0,nonce:se.toNumber(t.nonce),gasLimit:I(t.gasLimit),gasPrice:I(t.gasPrice),data:t.data??"0x",value:I(t.value??0),chainId:t.chainId?se.toNumber(t.chainId):void 0,type:t.type?se.toNumber(t.type):null,accessList:t.accessList,key:t.key,humanReadable:t.humanReadable?se.toBoolean(t.humanReadable):void 0,codeFormat:t.codeFormat?se.toNumber(t.codeFormat):void 0,feePayer:t.feePayer?se.toAddress(t.feePayer):void 0,txSignatures:t.txSignatures,feePayerSignatures:t.feePayerSignatures,feeRatio:t.feeRatio?se.toNumber(t.feeRatio):void 0};return Object.entries(n).forEach(([e,t])=>{void 0===t&&delete n[e]}),n}catch(e){return t}}}function $a(e){return Nn(e).toBigInt()}function Ja(e,t){return On(e,t).toBigInt()}function Ya(e,t){return Cn(e,t).toBigInt()}var Xa,eo,to=n(2472);!function(e){e.NUMBER="NUMBER_NUMBER",e.HEX="NUMBER_HEX",e.STR="NUMBER_STR",e.BIGINT="NUMBER_BIGINT"}(Xa||(Xa={})),function(e){e.HEX="BYTES_HEX",e.UINT8ARRAY="BYTES_UINT8ARRAY"}(eo||(eo={}));const no={number:Xa.BIGINT,bytes:eo.HEX},ro={number:Xa.HEX,bytes:eo.HEX};var io,ao,oo;(oo=io||(io={})).EARLIEST="earliest",oo.LATEST="latest",oo.PENDING="pending",oo.SAFE="safe",oo.FINALIZED="finalized",oo.COMMITTED="committed",function(e){e.chainstart="chainstart",e.frontier="frontier",e.homestead="homestead",e.dao="dao",e.tangerineWhistle="tangerineWhistle",e.spuriousDragon="spuriousDragon",e.byzantium="byzantium",e.constantinople="constantinople",e.petersburg="petersburg",e.istanbul="istanbul",e.muirGlacier="muirGlacier",e.berlin="berlin",e.london="london",e.altair="altair",e.arrowGlacier="arrowGlacier",e.grayGlacier="grayGlacier",e.bellatrix="bellatrix",e.merge="merge",e.capella="capella",e.shanghai="shanghai"}(ao||(ao={}));const so=Object.getPrototypeOf(Uint8Array);var uo=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};const co=Symbol.for("web3/base-provider");class lo{static isWeb3Provider(e){return e instanceof lo||Boolean(e&&e[co])}get[co](){return!0}send(e,t){this.request(e).then(e=>{t(null,e)}).catch(e=>{t(e)})}sendAsync(e){return uo(this,void 0,void 0,function*(){return this.request(e)})}asEIP1193Provider(){const e=Object.create(this),t=e.request;return e.request=function(e){return uo(this,void 0,void 0,function*(){return(yield t(e)).result})},e.asEIP1193Provider=void 0,e}}class ho extends Array{constructor(e){super(),this._accountProvider=e}}const fo=4001,po=4100,mo=4200,go=4900,yo=4901,bo=-32700,vo=-32600,wo=-32601,Ao=-32602,xo=-32603,ko=-32e3,_o=-32001,Po=-32002,Eo=-32003,So=-32004,To=-32005,Mo=-32006;class Io extends Error{get innerError(){return this.cause instanceof jo?this.cause.errors:this.cause}set innerError(e){Array.isArray(e)?this.cause=new jo(e):this.cause=e}constructor(e,t){super(e),Array.isArray(t)?this.cause=new jo(t):this.cause=t,this.name=this.constructor.name,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(new.target.constructor):this.stack=(new Error).stack}static convertToString(e,t=!1){if(null==e)return"undefined";const n=JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t);return t&&["bigint","string"].includes(typeof e)?n.replace(/['\\"]+/g,""):n}toJSON(){return{name:this.name,code:this.code,message:this.message,cause:this.cause,innerError:this.cause}}}class jo extends Io{constructor(e){super(`Multiple errors occurred: [${e.map(e=>e.message).join("], [")}]`),this.code=208,this.errors=e}}class Co extends Io{constructor(e,t){super(`Invalid value given "${Io.convertToString(e,!0)}". Error: ${t}.`),this.name=this.constructor.name}}class Bo extends Io{constructor(){super("Private key must be 32 bytes."),this.code=701}}class Oo extends Io{constructor(){super("Invalid Private Key, Not a valid string or uint8Array"),this.code=702}}class Ro extends Io{constructor(e){super(`"${e}"`),this.code=802}}class No extends Io{constructor(){super("Invalid key derivation function"),this.code=703}}class Fo extends Io{constructor(){super("Key derivation failed - possibly wrong password"),this.code=704}}class Lo extends Io{constructor(){super("Unsupported key store version"),this.code=705}}class Ho extends Io{constructor(){super("Password cannot be empty"),this.code=706}}class qo extends Io{constructor(){super("Initialization vector must be 16 bytes"),this.code=707}}class Do extends Io{constructor(){super("c > 1000, pbkdf2 is less secure with less iterations"),this.code=709}}class Uo extends Io{constructor(e,t){super(e),this.code=500,t&&(this.errorCode=t.code,this.errorReason=t.reason)}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{errorCode:this.errorCode,errorReason:this.errorReason})}}class zo extends Uo{constructor(e){super("Connection not open",e),this.code=503}}class Go extends Uo{constructor(e){super(`Maximum number of reconnect attempts reached! (${e})`),this.code=505}}class Vo extends Uo{constructor(){super("CONNECTION ERROR: Provider started to reconnect before the response got received!"),this.code=506}}class Wo extends Uo{constructor(e){super(`Request already sent with following id: ${e}`),this.code=507}}class Ko extends Io{constructor(e,t){super(e),this.code=300,this.receipt=t}}class Zo extends Io{constructor(e,t){super(`The resolver at ${e} does not implement requested method: "${t}".`),this.address=e,this.name=t,this.code=301}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{address:this.address,name:this.name})}}class Qo extends Ko{constructor(e){if(super(e.message||"Error"),this.name="name"in e&&e.name||this.constructor.name,this.stack="stack"in e&&e.stack||void 0,this.code=e.code,"object"==typeof e.data){let t;t=e.data&&"originalError"in e.data?e.data.originalError:e.data,this.data=t.data,this.cause=new Qo(t)}else this.data=e.data}setDecodedProperties(e,t,n){this.errorName=e,this.errorSignature=t,this.errorArgs=n}toJSON(){let e=Object.assign(Object.assign({},super.toJSON()),{data:this.data});return this.errorName&&(e=Object.assign(Object.assign({},e),{errorName:this.errorName,errorSignature:this.errorSignature,errorArgs:this.errorArgs})),e}}class $o extends Ko{constructor(e){super("Error happened while trying to execute a function inside a smart contract"),this.code=310,this.cause=new Qo(e)}}class Jo extends Co{constructor(e){var t,n;super(`data: ${null!==(t=e.data)&&void 0!==t?t:"undefined"}, input: ${null!==(n=e.input)&&void 0!==n?n:"undefined"}`,'You can\'t have "data" and "input" as properties of a contract at the same time, please use either "data" or "input" instead.'),this.code=311}}class Yo extends Io{constructor(e){super(`ENS is not supported on network ${e}`),this.code=902}}class Xo extends Io{constructor(){super("Network not synced"),this.code=903}}class es extends Io{constructor(e){super(`Invalid parameters passed. "${void 0!==e?e:""}"`),this.hint=e,this.code=207}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{hint:this.hint})}}class ts extends Io{constructor(){super(...arguments),this.code=201}}class ns extends Io{constructor(){super("The method you're trying to call is not implemented."),this.code=202}}class rs extends Io{constructor(){super(...arguments),this.code=203}}class is extends Io{constructor(){super(...arguments),this.code=204}}class as extends Io{constructor(e,t){super(e),this.code=205,this.props=null!=t?t:{}}}class os extends Io{constructor(e){super(`A plugin with the namespace: ${e} has already been registered.`),this.code=206}}class ss extends Io{constructor(){super(...arguments),this.code=600}}class us extends Io{constructor(e){super(`Client URL "${e}" is invalid.`),this.code=602}}class cs extends Io{constructor(){super(...arguments),this.code=603}}class ls extends Io{constructor(){super(...arguments),this.code=604}}class ds extends Co{constructor(){super(...arguments),this.code=801}}class hs extends Io{constructor(e,t){super(e),this.receipt=t,this.code=400}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{receipt:this.receipt})}}class fs extends Io{constructor(e,t,n,r){super("Transaction has been reverted by the EVM"+(void 0===n?"":`:\n ${Io.convertToString(n)}`)),this.reason=e,this.signature=t,this.receipt=n,this.data=r,this.code=402}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reason:this.reason,signature:this.signature,receipt:this.receipt,data:this.data})}}class ps extends fs{constructor(e,t,n,r,i,a,o){super(e),this.reason=e,this.customErrorName=t,this.customErrorDecodedSignature=n,this.customErrorArguments=r,this.signature=i,this.receipt=a,this.data=o,this.code=438}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reason:this.reason,customErrorName:this.customErrorName,customErrorDecodedSignature:this.customErrorDecodedSignature,customErrorArguments:this.customErrorArguments,signature:this.signature,receipt:this.receipt,data:this.data})}}class ms extends hs{constructor(e){super("Transaction has been reverted by the EVM"+(void 0===e?"":`:\n ${Io.convertToString(e)}`),e),this.code=405}}class gs extends hs{constructor(){super("Raw transaction undefined"),this.code=407}}class ys extends hs{constructor(){super("Transaction not found"),this.code=430}}class bs extends Co{constructor(e){super(e,"invalid transaction with invalid sender"),this.code=408}}class vs extends Co{constructor(e){super(e,"invalid transaction with invalid receiver"),this.code=437}}class ws extends Co{constructor(){super("MissingCustomChainError","If tx.common is provided it must have tx.common.customChain"),this.code=410}}class As extends Co{constructor(){super("MissingCustomChainIdError","If tx.common is provided it must have tx.common.customChain and tx.common.customChain.chainId"),this.code=411}}class xs extends Co{constructor(e){super(JSON.stringify(e),"Chain Id doesnt match in tx.chainId tx.common.customChain.chainId"),this.code=412}}class ks extends Co{constructor(e){super(JSON.stringify(e),"Chain doesnt match in tx.chain tx.common.basechain"),this.code=435}}class _s extends Co{constructor(e){super(JSON.stringify(e),"hardfork doesnt match in tx.hardfork tx.common.hardfork"),this.code=436}}class Ps extends Co{constructor(){super("CommonOrChainAndHardforkError","Please provide the common object or the chain and hardfork property but not all together."),this.code=413}}class Es extends Co{constructor(e){var t,n;super("MissingChainOrHardforkError",`When specifying chain and hardfork, both values must be defined. Received "chain": ${null!==(t=e.chain)&&void 0!==t?t:"undefined"}, "hardfork": ${null!==(n=e.hardfork)&&void 0!==n?n:"undefined"}`),this.code=414}}class Ss extends Io{constructor(){super('Missing properties in transaction, either define "gas" and "gasPrice" for type 0 transactions or "gas", "maxPriorityFeePerGas" and "maxFeePerGas" for type 2 transactions'),this.code=440}}class Ts extends Co{constructor(e){var t,n,r,i;super(`gas: ${null!==(t=e.gas)&&void 0!==t?t:"undefined"}, gasPrice: ${null!==(n=e.gasPrice)&&void 0!==n?n:"undefined"}, maxPriorityFeePerGas: ${null!==(r=e.maxPriorityFeePerGas)&&void 0!==r?r:"undefined"}, maxFeePerGas: ${null!==(i=e.maxFeePerGas)&&void 0!==i?i:"undefined"}`,'"gas" is missing'),this.code=415,this.cause=new Ss}}class Ms extends Io{constructor(){super('Missing properties in transaction, either define "gas" and "gasPrice" for type 0 transactions or "gas", "maxPriorityFeePerGas" and "maxFeePerGas" for type 2 transactions, not both'),this.code=441}}class Is extends Co{constructor(e){var t,n,r,i;super(`gas: ${null!==(t=e.gas)&&void 0!==t?t:"undefined"}, gasPrice: ${null!==(n=e.gasPrice)&&void 0!==n?n:"undefined"}, maxPriorityFeePerGas: ${null!==(r=e.maxPriorityFeePerGas)&&void 0!==r?r:"undefined"}, maxFeePerGas: ${null!==(i=e.maxFeePerGas)&&void 0!==i?i:"undefined"}`,"transaction must specify legacy or fee market gas properties, not both"),this.code=434,this.cause=new Ms}}class js extends Co{constructor(e){var t,n;super(`gas: ${null!==(t=e.gas)&&void 0!==t?t:"undefined"}, gasPrice: ${null!==(n=e.gasPrice)&&void 0!==n?n:"undefined"}`,"Gas or gasPrice is lower than 0"),this.code=416}}class Cs extends Co{constructor(e){var t,n;super(`maxPriorityFeePerGas: ${null!==(t=e.maxPriorityFeePerGas)&&void 0!==t?t:"undefined"}, maxFeePerGas: ${null!==(n=e.maxFeePerGas)&&void 0!==n?n:"undefined"}`,"maxPriorityFeePerGas or maxFeePerGas is lower than 0"),this.code=417}}class Bs extends Co{constructor(e){super(e,"eip-1559 transactions don't support gasPrice"),this.code=418}}class Os extends Co{constructor(e){var t,n;super(`maxPriorityFeePerGas: ${null!==(t=e.maxPriorityFeePerGas)&&void 0!==t?t:"undefined"}, maxFeePerGas: ${null!==(n=e.maxFeePerGas)&&void 0!==n?n:"undefined"}`,"pre-eip-1559 transaction don't support maxFeePerGas/maxPriorityFeePerGas"),this.code=419}}class Rs extends Co{constructor(e){super(e,"invalid transaction object"),this.code=420}}class Ns extends Co{constructor(e){var t,n;super(`nonce: ${null!==(t=e.nonce)&&void 0!==t?t:"undefined"}, chainId: ${null!==(n=e.chainId)&&void 0!==n?n:"undefined"}`,"Nonce or chainId is lower than 0"),this.code=421}}class Fs extends Co{constructor(){super("UnableToPopulateNonceError","unable to populate nonce, no from address available"),this.code=422}}class Ls extends Co{constructor(){super("Eip1559NotSupportedError","Network doesn't support eip-1559"),this.code=423}}class Hs extends Co{constructor(e){super(e,"unsupported transaction type"),this.code=424}}class qs extends Co{constructor(e){var t,n;super(`data: ${null!==(t=e.data)&&void 0!==t?t:"undefined"}, input: ${null!==(n=e.input)&&void 0!==n?n:"undefined"}`,'You can\'t have "data" and "input" as properties of transactions at the same time, please use either "data" or "input" instead.'),this.code=425}}class Ds extends Io{constructor(e){super(`The connected Ethereum Node did not respond within ${e.numberOfSeconds} seconds, please make sure your transaction was properly sent and you are connected to a healthy Node. Be aware that transaction might still be pending or mined!\n\tTransaction Hash: ${e.transactionHash?e.transactionHash.toString():"not available"}`),this.code=431}}function Us(e){return`Please make sure your transaction was properly sent and there are no previous pending transaction for the same account. However, be aware that it might still be mined!\n\tTransaction Hash: ${e?e.toString():"not available"}`}class zs extends Io{constructor(e){super(`Transaction was not mined within ${e.numberOfSeconds} seconds. ${Us(e.transactionHash)}`),this.code=426}}class Gs extends Io{constructor(e){super(`Transaction started at ${e.starterBlockNumber} but was not mined within ${e.numberOfBlocks} blocks. ${Us(e.transactionHash)}`),this.code=432}}class Vs extends Co{constructor(e){var t,n;super(`receipt: ${JSON.stringify(e.receipt)}, blockHash: ${null===(t=e.blockHash)||void 0===t?void 0:t.toString()}, transactionHash: ${null===(n=e.transactionHash)||void 0===n?void 0:n.toString()}`,"Receipt missing or blockHash null"),this.code=427}}class Ws extends Co{constructor(e){super(`receipt: ${JSON.stringify(e.receipt)}`,"Receipt missing block number"),this.code=428}}class Ks extends Io{constructor(e){super(`Invalid signature. "${e}"`),this.code=433}}class Zs extends Co{constructor(){super("LocalWalletNotAvailableError","Attempted to index account in local wallet, but no wallet is available"),this.code=429}}class Qs extends Io{constructor(e,t){const n=[];e.forEach(e=>n.push(e.keyword)),super(`The following properties are invalid for the transaction type ${t}: ${n.join(", ")}`),this.code=439}}class $s extends Co{constructor(e){super(e,"can not parse as byte data"),this.code=1002}}class Js extends Co{constructor(e){super(e,"can not parse as number data"),this.code=1003}}class Ys extends Co{constructor(e){super(e,"invalid ethereum address"),this.code=1005}}class Xs extends Co{constructor(e){super(e,"not a valid string"),this.code=1001}}class eu extends Co{constructor(e){super(e,"invalid unit"),this.code=1004}}class tu extends Co{constructor(e){super(e,"not a valid unit. Must be a positive integer"),this.code=1015}}class nu extends Co{constructor(e){super(e,"can not be converted to hex"),this.code=1006}}class ru extends Co{constructor(e){super(e,"value greater than the nibble width"),this.code=1014}}class iu extends Co{constructor(e){super(e,"not a valid boolean."),this.code=1008}}class au extends Co{constructor(e){super(e,"not a valid unsigned integer."),this.code=1009}}class ou extends Co{constructor(e){super(e,"invalid size given."),this.code=1010}}class su extends Co{constructor(e){super(e,"value is larger than size."),this.code=1011}}class uu extends Co{constructor(e){super(e,"invalid string given"),this.code=1012}}const cu=e=>(e=>!(Array.isArray(e)||"2.0"!==e.jsonrpc||!e||void 0!==e.result&&null!==e.result||!("error"in e)||"number"!=typeof e.id&&"string"!=typeof e.id))(e)?e.error.message:"";class lu extends Io{constructor(e,t,n,r){var i;let a;super(null!=t?t:`Returned error: ${Array.isArray(e)?e.map(e=>cu(e)).join(","):cu(e)}`),this.code=100,t||(this.data=Array.isArray(e)?e.map(e=>{var t;return null===(t=e.error)||void 0===t?void 0:t.data}):null===(i=null==e?void 0:e.error)||void 0===i?void 0:i.data),this.statusCode=r,this.request=n,"error"in e?a=e.error:e instanceof Array&&(a=e.filter(e=>e.error).map(e=>e.error)),Array.isArray(a)&&a.length>0?this.cause=new jo(a):this.cause=a}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{data:this.data,request:this.request,statusCode:this.statusCode})}}class du extends lu{constructor(e,t){let n;super(e,void 0,t),this.code=101,"error"in e?n=e.error:e instanceof Array&&(n=e.map(e=>e.error)),Array.isArray(n)?this.cause=new jo(n):this.cause=n}}class hu extends Io{constructor(e,t){super(`Web3Config hardfork doesnt match in defaultHardfork ${e} and common.hardfork ${t}`),this.code=1101}}class fu extends Io{constructor(e,t){super(`Web3Config chain doesnt match in defaultHardfork ${e} and common.hardfork ${t}`),this.code=1101}}const pu="An Rpc error has occured with a code of *code*",mu={[bo]:{message:"Parse error",description:"Invalid JSON"},[vo]:{message:"Invalid request",description:"JSON is not a valid request object\t"},[wo]:{message:"Method not found",description:"Method does not exist\t"},[Ao]:{message:"Invalid params",description:"Invalid method parameters"},[xo]:{message:"Internal error",description:"Internal JSON-RPC error"},[ko]:{message:"Invalid input",description:"Missing or invalid parameters"},[_o]:{message:"Resource not found",description:"Requested resource not found"},[Po]:{message:"Resource unavailable",description:"Requested resource not available"},[Eo]:{message:"Transaction rejected",description:"Transaction creation failed"},[So]:{message:"Method not supported",description:"Method is not implemented"},[To]:{message:"Limit exceeded",description:"Request exceeds defined limit"},[Mo]:{message:"JSON-RPC version not supported",description:"Version of JSON-RPC protocol is not supported"},[fo]:{name:"User Rejected Request",message:"The user rejected the request."},[po]:{name:"Unauthorized",message:"The requested method and/or account has not been authorized by the user."},[mo]:{name:"Unsupported Method",message:"The Provider does not support the requested method."},[go]:{name:"Disconnected",message:"The Provider is disconnected from all chains."},[yo]:{name:"Chain Disconnected",message:"The Provider is not connected to the requested chain."},"0-999":{name:"",message:"Not used."},1e3:{name:"Normal Closure",message:"The connection successfully completed the purpose for which it was created."},1001:{name:"Going Away",message:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{name:"Protocol error",message:"The endpoint is terminating the connection due to a protocol error."},1003:{name:"Unsupported Data",message:"The connection is being terminated because the endpoint received data of a type it cannot accept. (For example, a text-only endpoint received binary data.)"},1004:{name:"Reserved",message:"Reserved. A meaning might be defined in the future."},1005:{name:"No Status Rcvd",message:"Reserved. Indicates that no status code was provided even though one was expected."},1006:{name:"Abnormal Closure",message:"Reserved. Indicates that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{name:"Invalid frame payload data",message:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{name:"Policy Violation",message:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{name:"Message Too Big",message:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{name:"Mandatory Ext.",message:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{name:"Internal Error",message:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{name:"Service Restart",message:"The server is terminating the connection because it is restarting."},1013:{name:"Try Again Later",message:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{name:"Bad Gateway",message:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{name:"TLS handshake",message:"Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},"1016-2999":{name:"",message:"For definition by future revisions of the WebSocket Protocol specification, and for definition by extension specifications."},"3000-3999":{name:"",message:"For use by libraries, frameworks, and applications. These status codes are registered directly with IANA. The interpretation of these codes is undefined by the WebSocket protocol."},"4000-4999":{name:"",message:"For private use, and thus can't be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by the WebSocket protocol."}};class gu extends Io{constructor(e,t){super(null!=t?t:pu.replace("*code*",e.error.code.toString())),this.code=e.error.code,this.id=e.id,this.jsonrpc=e.jsonrpc,this.jsonRpcError=e.error}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{error:this.jsonRpcError,id:this.id,jsonRpc:this.jsonrpc})}}class yu extends Io{constructor(e,t){var n,r,i,a;if(e)if(null===(n=mu[e])||void 0===n?void 0:n.message)super(mu[e].message);else{const t=Object.keys(mu).find(t=>"string"==typeof t&&e>=parseInt(t.split("-")[0],10)&&e<=parseInt(t.split("-")[1],10));super(null!==(i=null===(r=mu[null!=t?t:""])||void 0===r?void 0:r.message)&&void 0!==i?i:pu.replace("*code*",null!==(a=null==e?void 0:e.toString())&&void 0!==a?a:'""'))}else super();this.code=e,this.data=t}}const bu=new Map;bu.set(bo,{error:class extends gu{constructor(e){super(e,mu[-32700].message),this.code=bo}}}),bu.set(vo,{error:class extends gu{constructor(e){super(e,mu[-32600].message),this.code=vo}}}),bu.set(wo,{error:class extends gu{constructor(e){super(e,mu[-32601].message),this.code=wo}}}),bu.set(Ao,{error:class extends gu{constructor(e){super(e,mu[-32602].message),this.code=Ao}}}),bu.set(xo,{error:class extends gu{constructor(e){super(e,mu[-32603].message),this.code=xo}}}),bu.set(ko,{error:class extends gu{constructor(e){super(e,mu[-32e3].message),this.code=ko}}}),bu.set(So,{error:class extends gu{constructor(e){super(e,mu[-32004].message),this.code=So}}}),bu.set(Po,{error:class extends gu{constructor(e){super(e,mu[-32002].message),this.code=Po}}}),bu.set(Eo,{error:class extends gu{constructor(e){super(e,mu[-32003].message),this.code=Eo}}}),bu.set(_o,{error:class extends gu{constructor(e){super(e,mu[-32001].message),this.code=_o}}}),bu.set(Mo,{error:class extends gu{constructor(e){super(e,mu[-32006].message),this.code=Mo}}}),bu.set(To,{error:class extends gu{constructor(e){super(e,mu[-32005].message),this.code=To}}});class vu extends Io{constructor(e){super(`Format for the type ${e} is unsupported`),this.type=e,this.code=1200}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type})}}function wu(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function Au(e,...t){if(!((n=e)instanceof Uint8Array||null!=n&&"object"==typeof n&&"Uint8Array"===n.constructor.name))throw new Error("Uint8Array expected");var n;if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function xu(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");wu(e.outputLen),wu(e.blockLen)}function ku(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")}function _u(e,t){Au(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const Pu={number:wu,bool:function(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)},bytes:Au,hash:xu,exists:ku,output:_u},Eu=BigInt(2**32-1),Su=BigInt(32);function Tu(e,t=!1){return t?{h:Number(e&Eu),l:Number(e>>Su&Eu)}:{h:0|Number(e>>Su&Eu),l:0|Number(e&Eu)}}function Mu(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:a,l:o}=Tu(e[i],t);[n[i],r[i]]=[a,o]}return[n,r]}const Iu=(e,t,n)=>e<<n|t>>>32-n,ju=(e,t,n)=>t<<n|e>>>32-n,Cu=(e,t,n)=>t<<n-32|e>>>64-n,Bu=(e,t,n)=>e<<n-32|t>>>64-n,Ou={fromBig:Tu,split:Mu,toBig:(e,t)=>BigInt(e>>>0)<<Su|BigInt(t>>>0),shrSH:(e,t,n)=>e>>>n,shrSL:(e,t,n)=>e<<32-n|t>>>n,rotrSH:(e,t,n)=>e>>>n|t<<32-n,rotrSL:(e,t,n)=>e<<32-n|t>>>n,rotrBH:(e,t,n)=>e<<64-n|t>>>n-32,rotrBL:(e,t,n)=>e>>>n-32|t<<64-n,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:Iu,rotlSL:ju,rotlBH:Cu,rotlBL:Bu,add:function(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:0|i}},add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,add5H:(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0,add5L:(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0)},Ru="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,Nu=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Fu=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Lu=(e,t)=>e<<32-t|e>>>t,Hu=(e,t)=>e<<t|e>>>32-t>>>0,qu=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],Du=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function Uu(e){for(let t=0;t<e.length;t++)e[t]=Du(e[t])}function zu(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function Gu(e){return"string"==typeof e&&(e=zu(e)),Au(e),e}function Vu(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];Au(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n}class Wu{clone(){return this._cloneInto()}}const Ku={}.toString;function Zu(e,t){if(void 0!==t&&"[object Object]"!==Ku.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)}function Qu(e){const t=t=>e().update(Gu(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function $u(e=32){if(Ru&&"function"==typeof Ru.getRandomValues)return Ru.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const Ju=[],Yu=[],Xu=[],ec=BigInt(0),tc=BigInt(1),nc=BigInt(2),rc=BigInt(7),ic=BigInt(256),ac=BigInt(113);for(let e=0,t=tc,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Ju.push(2*(5*r+n)),Yu.push((e+1)*(e+2)/2%64);let i=ec;for(let e=0;e<7;e++)t=(t<<tc^(t>>rc)*ac)%ic,t&nc&&(i^=tc<<(tc<<BigInt(e))-tc);Xu.push(i)}const[oc,sc]=Mu(Xu,!0),uc=(e,t,n)=>n>32?Cu(e,t,n):Iu(e,t,n),cc=(e,t,n)=>n>32?Bu(e,t,n):ju(e,t,n);class lc extends Wu{constructor(e,t,n,r=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,wu(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Nu(this.state)}keccak(){qu||Uu(this.state32),function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,i=(t+2)%10,a=n[i],o=n[i+1],s=uc(a,o,1)^n[r],u=cc(a,o,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=s,e[t+n+1]^=u}let t=e[2],i=e[3];for(let n=0;n<24;n++){const r=Yu[n],a=uc(t,i,r),o=cc(t,i,r),s=Ju[n];t=e[s],i=e[s+1],e[s]=a,e[s+1]=o}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=oc[r],e[1]^=sc[r]}n.fill(0)}(this.state32,this.rounds),qu||Uu(this.state32),this.posOut=0,this.pos=0}update(e){ku(this);const{blockLen:t,state:n}=this,r=(e=Gu(e)).length;for(let i=0;i<r;){const a=Math.min(t-this.pos,r-i);for(let t=0;t<a;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,128&t&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){ku(this,!1),Au(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();const a=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+a),r),this.posOut+=a,r+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return wu(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(_u(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:a}=this;return e||(e=new lc(t,n,r,a,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=a,e.destroyed=this.destroyed,e}}const dc=(e,t,n)=>Qu(()=>new lc(t,e,n)),hc=dc(1,144,28),fc=dc(1,136,32),pc=dc(1,104,48),mc=dc(1,72,64),gc=(Pu.bool,Pu.bytes);function yc(e){if(!(e instanceof Uint8Array))throw new TypeError("bytesToUtf8 expected Uint8Array, got "+typeof e);return(new TextDecoder).decode(e)}function bc(e){return t=>(Pu.bytes(t),e(t))}(()=>{const e="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,t="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);t&&!e&&t("crypto")})(),bc(hc);const vc=(()=>{const e=bc(fc);return e.create=fc.create,e})();var wc,Ac;bc(pc),bc(mc),function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(wc||(wc={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Ac||(Ac={}));const xc=wc.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),kc=e=>{switch(typeof e){case"undefined":return xc.undefined;case"string":return xc.string;case"number":return Number.isNaN(e)?xc.nan:xc.number;case"boolean":return xc.boolean;case"function":return xc.function;case"bigint":return xc.bigint;case"symbol":return xc.symbol;case"object":return Array.isArray(e)?xc.array:null===e?xc.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?xc.promise:"undefined"!=typeof Map&&e instanceof Map?xc.map:"undefined"!=typeof Set&&e instanceof Set?xc.set:"undefined"!=typeof Date&&e instanceof Date?xc.date:xc.object;default:return xc.unknown}},_c=wc.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Pc=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Ec extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){const n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof Ec))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,wc.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Ec.create=e=>new Ec(e);const Sc=(e,t)=>{let n;switch(e.code){case _c.invalid_type:n=e.received===xc.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case _c.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,wc.jsonStringifyReplacer)}`;break;case _c.unrecognized_keys:n=`Unrecognized key(s) in object: ${wc.joinValues(e.keys,", ")}`;break;case _c.invalid_union:n="Invalid input";break;case _c.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${wc.joinValues(e.options)}`;break;case _c.invalid_enum_value:n=`Invalid enum value. Expected ${wc.joinValues(e.options)}, received '${e.received}'`;break;case _c.invalid_arguments:n="Invalid function arguments";break;case _c.invalid_return_type:n="Invalid function return type";break;case _c.invalid_date:n="Invalid date";break;case _c.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:wc.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case _c.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case _c.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case _c.custom:n="Invalid input";break;case _c.invalid_intersection_types:n="Intersection results could not be merged";break;case _c.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case _c.not_finite:n="Number must be finite";break;default:n=t.defaultError,wc.assertNever(e)}return{message:n}};let Tc=Sc;function Mc(e){Tc=e}function Ic(){return Tc}const jc=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(void 0!==i.message)return{...i,path:a,message:i.message};let s="";const u=r.filter(e=>!!e).slice().reverse();for(const e of u)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}},Cc=[];function Bc(e,t){const n=Ic(),r=jc({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Sc?void 0:Sc].filter(e=>!!e)});e.common.issues.push(r)}class Oc{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return Rc;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t){const t=await e.key,r=await e.value;n.push({key:t,value:r})}return Oc.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:i}=r;if("aborted"===t.status)return Rc;if("aborted"===i.status)return Rc;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"===t.value||void 0===i.value&&!r.alwaysSet||(n[t.value]=i.value)}return{status:e.value,value:n}}}const Rc=Object.freeze({status:"aborted"}),Nc=e=>({status:"dirty",value:e}),Fc=e=>({status:"valid",value:e}),Lc=e=>"aborted"===e.status,Hc=e=>"dirty"===e.status,qc=e=>"valid"===e.status,Dc=e=>"undefined"!=typeof Promise&&e instanceof Promise;var Uc;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(Uc||(Uc={}));class zc{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Gc=(e,t)=>{if(qc(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Ec(e.common.issues);return this._error=t,this._error}}};function Vc(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{const{message:a}=e;return"invalid_enum_value"===t.code?{message:a??i.defaultError}:void 0===i.data?{message:a??r??i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:a??n??i.defaultError}},description:i}}class Wc{get description(){return this._def.description}_getType(e){return kc(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:kc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Oc,ctx:{common:e.parent.common,data:e.data,parsedType:kc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Dc(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kc(e)},r=this._parseSync({data:e,path:n.path,parent:n});return Gc(n,r)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kc(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return qc(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>qc(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kc(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(Dc(r)?r:Promise.resolve(r));return Gc(n,i)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,r)=>{const i=e(t),a=()=>r.addIssue({code:_c.custom,...n(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(e=>!!e||(a(),!1)):!!i||(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1))}_refinement(e){return new Zl({schema:this,typeName:sd.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Ql.create(this,this._def)}nullable(){return $l.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ml.create(this)}promise(){return Kl.create(this,this._def)}or(e){return Cl.create([this,e],this._def)}and(e){return Nl.create(this,e,this._def)}transform(e){return new Zl({...Vc(this._def),schema:this,typeName:sd.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Jl({...Vc(this._def),innerType:this,defaultValue:t,typeName:sd.ZodDefault})}brand(){return new td({typeName:sd.ZodBranded,type:this,...Vc(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Yl({...Vc(this._def),innerType:this,catchValue:t,typeName:sd.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return nd.create(this,e)}readonly(){return rd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Kc=/^c[^\s-]{8,}$/i,Zc=/^[0-9a-z]+$/,Qc=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$c=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Jc=/^[a-z0-9_-]{21}$/i,Yc=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Xc=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,el=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let tl;const nl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,il=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,al=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ol=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sl=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ul="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",cl=new RegExp(`^${ul}$`);function ll(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function dl(e){return new RegExp(`^${ll(e)}$`)}function hl(e){let t=`${ul}T${ll(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function fl(e,t){return!("v4"!==t&&t||!nl.test(e))||!("v6"!==t&&t||!il.test(e))}function pl(e,t){if(!Yc.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!("object"!=typeof i||null===i||"typ"in i&&"JWT"!==i?.typ||!i.alg||t&&i.alg!==t)}catch{return!1}}function ml(e,t){return!("v4"!==t&&t||!rl.test(e))||!("v6"!==t&&t||!al.test(e))}class gl extends Wc{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==xc.string){const t=this._getOrReturnCtx(e);return Bc(t,{code:_c.invalid_type,expected:xc.string,received:t.parsedType}),Rc}const t=new Oc;let n;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),Bc(n,{code:_c.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("max"===r.kind)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),Bc(n,{code:_c.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?Bc(n,{code:_c.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):a&&Bc(n,{code:_c.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)el.test(e.data)||(n=this._getOrReturnCtx(e,n),Bc(n,{validation:"email",code:_c.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)tl||(tl=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),tl.test(e.data)||(n=this._getOrReturnCtx(e,n),Bc(n,{validation:"emoji",code:_c.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)$c.test(e.data)||(n=this._getOrReturnCtx(e,n),Bc(n,{validation:"uuid",code:_c.invalid_string,message:r.message}),t.dirty());else if("nanoid"===r.kind)Jc.test(e.data)||(n=this._getOrReturnCtx(e,n),Bc(n,{validation:"nanoid",code:_c.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)Kc.test(e.data)||(n=this._getOrReturnCtx(e,n),Bc(n,{validation:"cuid",code:_c.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)Zc.test(e.data)||(n=this._getOrReturnCtx(e,n),Bc(n,{validation:"cuid2",code:_c.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)Qc.test(e.data)||(n=this._getOrReturnCtx(e,n),Bc(n,{validation:"ulid",code:_c.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),Bc(n,{validation:"url",code:_c.invalid_string,message:r.message}),t.dirty()}else"regex"===r.kind?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),Bc(n,{validation:"regex",code:_c.invalid_string,message:r.message}),t.dirty())):"trim"===r.kind?e.data=e.data.trim():"includes"===r.kind?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),Bc(n,{code:_c.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):"toLowerCase"===r.kind?e.data=e.data.toLowerCase():"toUpperCase"===r.kind?e.data=e.data.toUpperCase():"startsWith"===r.kind?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),Bc(n,{code:_c.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):"endsWith"===r.kind?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),Bc(n,{code:_c.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):"datetime"===r.kind?hl(r).test(e.data)||(n=this._getOrReturnCtx(e,n),Bc(n,{code:_c.invalid_string,validation:"datetime",message:r.message}),t.dirty()):"date"===r.kind?cl.test(e.data)||(n=this._getOrReturnCtx(e,n),Bc(n,{code:_c.invalid_string,validation:"date",message:r.message}),t.dirty()):"time"===r.kind?dl(r).test(e.data)||(n=this._getOrReturnCtx(e,n),Bc(n,{code:_c.invalid_string,validation:"time",message:r.message}),t.dirty()):"duration"===r.kind?Xc.test(e.data)||(n=this._getOrReturnCtx(e,n),Bc(n,{validation:"duration",code:_c.invalid_string,message:r.message}),t.dirty()):"ip"===r.kind?fl(e.data,r.version)||(n=this._getOrReturnCtx(e,n),Bc(n,{validation:"ip",code:_c.invalid_string,message:r.message}),t.dirty()):"jwt"===r.kind?pl(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),Bc(n,{validation:"jwt",code:_c.invalid_string,message:r.message}),t.dirty()):"cidr"===r.kind?ml(e.data,r.version)||(n=this._getOrReturnCtx(e,n),Bc(n,{validation:"cidr",code:_c.invalid_string,message:r.message}),t.dirty()):"base64"===r.kind?ol.test(e.data)||(n=this._getOrReturnCtx(e,n),Bc(n,{validation:"base64",code:_c.invalid_string,message:r.message}),t.dirty()):"base64url"===r.kind?sl.test(e.data)||(n=this._getOrReturnCtx(e,n),Bc(n,{validation:"base64url",code:_c.invalid_string,message:r.message}),t.dirty()):wc.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:_c.invalid_string,...Uc.errToObj(n)})}_addCheck(e){return new gl({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Uc.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Uc.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Uc.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Uc.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Uc.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Uc.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Uc.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Uc.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Uc.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Uc.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Uc.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Uc.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Uc.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Uc.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...Uc.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Uc.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Uc.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...Uc.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Uc.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Uc.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Uc.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Uc.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Uc.errToObj(t)})}nonempty(e){return this.min(1,Uc.errToObj(e))}trim(){return new gl({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new gl({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new gl({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function yl(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}gl.create=e=>new gl({checks:[],typeName:sd.ZodString,coerce:e?.coerce??!1,...Vc(e)});class bl extends Wc{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==xc.number){const t=this._getOrReturnCtx(e);return Bc(t,{code:_c.invalid_type,expected:xc.number,received:t.parsedType}),Rc}let t;const n=new Oc;for(const r of this._def.checks)"int"===r.kind?wc.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Bc(t,{code:_c.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Bc(t,{code:_c.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Bc(t,{code:_c.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"multipleOf"===r.kind?0!==yl(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),Bc(t,{code:_c.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Bc(t,{code:_c.not_finite,message:r.message}),n.dirty()):wc.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Uc.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Uc.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Uc.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Uc.toString(t))}setLimit(e,t,n,r){return new bl({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Uc.toString(r)}]})}_addCheck(e){return new bl({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Uc.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Uc.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Uc.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Uc.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Uc.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Uc.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Uc.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Uc.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Uc.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&wc.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}bl.create=e=>new bl({checks:[],typeName:sd.ZodNumber,coerce:e?.coerce||!1,...Vc(e)});class vl extends Wc{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==xc.bigint)return this._getInvalidInput(e);let t;const n=new Oc;for(const r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Bc(t,{code:_c.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Bc(t,{code:_c.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Bc(t,{code:_c.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):wc.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return Bc(t,{code:_c.invalid_type,expected:xc.bigint,received:t.parsedType}),Rc}gte(e,t){return this.setLimit("min",e,!0,Uc.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Uc.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Uc.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Uc.toString(t))}setLimit(e,t,n,r){return new vl({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Uc.toString(r)}]})}_addCheck(e){return new vl({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Uc.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Uc.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Uc.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Uc.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Uc.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}vl.create=e=>new vl({checks:[],typeName:sd.ZodBigInt,coerce:e?.coerce??!1,...Vc(e)});class wl extends Wc{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==xc.boolean){const t=this._getOrReturnCtx(e);return Bc(t,{code:_c.invalid_type,expected:xc.boolean,received:t.parsedType}),Rc}return Fc(e.data)}}wl.create=e=>new wl({typeName:sd.ZodBoolean,coerce:e?.coerce||!1,...Vc(e)});class Al extends Wc{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==xc.date){const t=this._getOrReturnCtx(e);return Bc(t,{code:_c.invalid_type,expected:xc.date,received:t.parsedType}),Rc}if(Number.isNaN(e.data.getTime()))return Bc(this._getOrReturnCtx(e),{code:_c.invalid_date}),Rc;const t=new Oc;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Bc(n,{code:_c.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),Bc(n,{code:_c.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):wc.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Al({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Uc.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Uc.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}Al.create=e=>new Al({checks:[],coerce:e?.coerce||!1,typeName:sd.ZodDate,...Vc(e)});class xl extends Wc{_parse(e){if(this._getType(e)!==xc.symbol){const t=this._getOrReturnCtx(e);return Bc(t,{code:_c.invalid_type,expected:xc.symbol,received:t.parsedType}),Rc}return Fc(e.data)}}xl.create=e=>new xl({typeName:sd.ZodSymbol,...Vc(e)});class kl extends Wc{_parse(e){if(this._getType(e)!==xc.undefined){const t=this._getOrReturnCtx(e);return Bc(t,{code:_c.invalid_type,expected:xc.undefined,received:t.parsedType}),Rc}return Fc(e.data)}}kl.create=e=>new kl({typeName:sd.ZodUndefined,...Vc(e)});class _l extends Wc{_parse(e){if(this._getType(e)!==xc.null){const t=this._getOrReturnCtx(e);return Bc(t,{code:_c.invalid_type,expected:xc.null,received:t.parsedType}),Rc}return Fc(e.data)}}_l.create=e=>new _l({typeName:sd.ZodNull,...Vc(e)});class Pl extends Wc{constructor(){super(...arguments),this._any=!0}_parse(e){return Fc(e.data)}}Pl.create=e=>new Pl({typeName:sd.ZodAny,...Vc(e)});class El extends Wc{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Fc(e.data)}}El.create=e=>new El({typeName:sd.ZodUnknown,...Vc(e)});class Sl extends Wc{_parse(e){const t=this._getOrReturnCtx(e);return Bc(t,{code:_c.invalid_type,expected:xc.never,received:t.parsedType}),Rc}}Sl.create=e=>new Sl({typeName:sd.ZodNever,...Vc(e)});class Tl extends Wc{_parse(e){if(this._getType(e)!==xc.undefined){const t=this._getOrReturnCtx(e);return Bc(t,{code:_c.invalid_type,expected:xc.void,received:t.parsedType}),Rc}return Fc(e.data)}}Tl.create=e=>new Tl({typeName:sd.ZodVoid,...Vc(e)});class Ml extends Wc{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==xc.array)return Bc(t,{code:_c.invalid_type,expected:xc.array,received:t.parsedType}),Rc;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Bc(t,{code:e?_c.too_big:_c.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(Bc(t,{code:_c.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(Bc(t,{code:_c.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new zc(t,e,t.path,n)))).then(e=>Oc.mergeArray(n,e));const i=[...t.data].map((e,n)=>r.type._parseSync(new zc(t,e,t.path,n)));return Oc.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new Ml({...this._def,minLength:{value:e,message:Uc.toString(t)}})}max(e,t){return new Ml({...this._def,maxLength:{value:e,message:Uc.toString(t)}})}length(e,t){return new Ml({...this._def,exactLength:{value:e,message:Uc.toString(t)}})}nonempty(e){return this.min(1,e)}}function Il(e){if(e instanceof jl){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ql.create(Il(r))}return new jl({...e._def,shape:()=>t})}return e instanceof Ml?new Ml({...e._def,type:Il(e.element)}):e instanceof Ql?Ql.create(Il(e.unwrap())):e instanceof $l?$l.create(Il(e.unwrap())):e instanceof Fl?Fl.create(e.items.map(e=>Il(e))):e}Ml.create=(e,t)=>new Ml({type:e,minLength:null,maxLength:null,exactLength:null,typeName:sd.ZodArray,...Vc(t)});class jl extends Wc{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=wc.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==xc.object){const t=this._getOrReturnCtx(e);return Bc(t,{code:_c.invalid_type,expected:xc.object,received:t.parsedType}),Rc}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Sl&&"strip"===this._def.unknownKeys))for(const e in n.data)i.includes(e)||a.push(e);const o=[];for(const e of i){const t=r[e],i=n.data[e];o.push({key:{status:"valid",value:e},value:t._parse(new zc(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Sl){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of a)o.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)a.length>0&&(Bc(n,{code:_c.unrecognized_keys,keys:a}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of a){const r=n.data[t];o.push({key:{status:"valid",value:t},value:e._parse(new zc(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of o){const n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>Oc.mergeObjectSync(t,e)):Oc.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return Uc.errToObj,new jl({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{const r=this._def.errorMap?.(t,n).message??n.defaultError;return"unrecognized_keys"===t.code?{message:Uc.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new jl({...this._def,unknownKeys:"strip"})}passthrough(){return new jl({...this._def,unknownKeys:"passthrough"})}extend(e){return new jl({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new jl({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:sd.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new jl({...this._def,catchall:e})}pick(e){const t={};for(const n of wc.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new jl({...this._def,shape:()=>t})}omit(e){const t={};for(const n of wc.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new jl({...this._def,shape:()=>t})}deepPartial(){return Il(this)}partial(e){const t={};for(const n of wc.objectKeys(this.shape)){const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}return new jl({...this._def,shape:()=>t})}required(e){const t={};for(const n of wc.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Ql;)e=e._def.innerType;t[n]=e}return new jl({...this._def,shape:()=>t})}keyof(){return Gl(wc.objectKeys(this.shape))}}jl.create=(e,t)=>new jl({shape:()=>e,unknownKeys:"strip",catchall:Sl.create(),typeName:sd.ZodObject,...Vc(t)}),jl.strictCreate=(e,t)=>new jl({shape:()=>e,unknownKeys:"strict",catchall:Sl.create(),typeName:sd.ZodObject,...Vc(t)}),jl.lazycreate=(e,t)=>new jl({shape:e,unknownKeys:"strip",catchall:Sl.create(),typeName:sd.ZodObject,...Vc(t)});class Cl extends Wc{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map(async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map(e=>new Ec(e.ctx.common.issues));return Bc(t,{code:_c.invalid_union,unionErrors:n}),Rc});{let e;const r=[];for(const i of n){const n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=r.map(e=>new Ec(e));return Bc(t,{code:_c.invalid_union,unionErrors:i}),Rc}}get options(){return this._def.options}}Cl.create=(e,t)=>new Cl({options:e,typeName:sd.ZodUnion,...Vc(t)});const Bl=e=>e instanceof Ul?Bl(e.schema):e instanceof Zl?Bl(e.innerType()):e instanceof zl?[e.value]:e instanceof Vl?e.options:e instanceof Wl?wc.objectValues(e.enum):e instanceof Jl?Bl(e._def.innerType):e instanceof kl?[void 0]:e instanceof _l?[null]:e instanceof Ql?[void 0,...Bl(e.unwrap())]:e instanceof $l?[null,...Bl(e.unwrap())]:e instanceof td||e instanceof rd?Bl(e.unwrap()):e instanceof Yl?Bl(e._def.innerType):[];class Ol extends Wc{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==xc.object)return Bc(t,{code:_c.invalid_type,expected:xc.object,received:t.parsedType}),Rc;const n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(Bc(t,{code:_c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Rc)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=Bl(n.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new Ol({typeName:sd.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...Vc(n)})}}function Rl(e,t){const n=kc(e),r=kc(t);if(e===t)return{valid:!0,data:e};if(n===xc.object&&r===xc.object){const n=wc.objectKeys(t),r=wc.objectKeys(e).filter(e=>-1!==n.indexOf(e)),i={...e,...t};for(const n of r){const r=Rl(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===xc.array&&r===xc.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const i=Rl(e[r],t[r]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===xc.date&&r===xc.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class Nl extends Wc{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Lc(e)||Lc(r))return Rc;const i=Rl(e.value,r.value);return i.valid?((Hc(e)||Hc(r))&&t.dirty(),{status:t.value,value:i.data}):(Bc(n,{code:_c.invalid_intersection_types}),Rc)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Nl.create=(e,t,n)=>new Nl({left:e,right:t,typeName:sd.ZodIntersection,...Vc(n)});class Fl extends Wc{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==xc.array)return Bc(n,{code:_c.invalid_type,expected:xc.array,received:n.parsedType}),Rc;if(n.data.length<this._def.items.length)return Bc(n,{code:_c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Rc;!this._def.rest&&n.data.length>this._def.items.length&&(Bc(n,{code:_c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new zc(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>Oc.mergeArray(t,e)):Oc.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Fl({...this._def,rest:e})}}Fl.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fl({items:e,typeName:sd.ZodTuple,rest:null,...Vc(t)})};class Ll extends Wc{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==xc.object)return Bc(n,{code:_c.invalid_type,expected:xc.object,received:n.parsedType}),Rc;const r=[],i=this._def.keyType,a=this._def.valueType;for(const e in n.data)r.push({key:i._parse(new zc(n,e,n.path,e)),value:a._parse(new zc(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?Oc.mergeObjectAsync(t,r):Oc.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Ll(t instanceof Wc?{keyType:e,valueType:t,typeName:sd.ZodRecord,...Vc(n)}:{keyType:gl.create(),valueType:e,typeName:sd.ZodRecord,...Vc(t)})}}class Hl extends Wc{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==xc.map)return Bc(n,{code:_c.invalid_type,expected:xc.map,received:n.parsedType}),Rc;const r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new zc(n,e,n.path,[a,"key"])),value:i._parse(new zc(n,t,n.path,[a,"value"]))}));if(n.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const n of a){const r=await n.key,i=await n.value;if("aborted"===r.status||"aborted"===i.status)return Rc;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{const e=new Map;for(const n of a){const r=n.key,i=n.value;if("aborted"===r.status||"aborted"===i.status)return Rc;"dirty"!==r.status&&"dirty"!==i.status||t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}Hl.create=(e,t,n)=>new Hl({valueType:t,keyType:e,typeName:sd.ZodMap,...Vc(n)});class ql extends Wc{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==xc.set)return Bc(n,{code:_c.invalid_type,expected:xc.set,received:n.parsedType}),Rc;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(Bc(n,{code:_c.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(Bc(n,{code:_c.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function a(e){const n=new Set;for(const r of e){if("aborted"===r.status)return Rc;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const o=[...n.data.values()].map((e,t)=>i._parse(new zc(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(e,t){return new ql({...this._def,minSize:{value:e,message:Uc.toString(t)}})}max(e,t){return new ql({...this._def,maxSize:{value:e,message:Uc.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ql.create=(e,t)=>new ql({valueType:e,minSize:null,maxSize:null,typeName:sd.ZodSet,...Vc(t)});class Dl extends Wc{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==xc.function)return Bc(t,{code:_c.invalid_type,expected:xc.function,received:t.parsedType}),Rc;function n(e,n){return jc({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ic(),Sc].filter(e=>!!e),issueData:{code:_c.invalid_arguments,argumentsError:n}})}function r(e,n){return jc({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ic(),Sc].filter(e=>!!e),issueData:{code:_c.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof Kl){const e=this;return Fc(async function(...t){const o=new Ec([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),u=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(u,i).catch(e=>{throw o.addIssue(r(u,e)),o})})}{const e=this;return Fc(function(...t){const o=e._def.args.safeParse(t,i);if(!o.success)throw new Ec([n(t,o.error)]);const s=Reflect.apply(a,this,o.data),u=e._def.returns.safeParse(s,i);if(!u.success)throw new Ec([r(s,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Dl({...this._def,args:Fl.create(e).rest(El.create())})}returns(e){return new Dl({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Dl({args:e||Fl.create([]).rest(El.create()),returns:t||El.create(),typeName:sd.ZodFunction,...Vc(n)})}}class Ul extends Wc{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Ul.create=(e,t)=>new Ul({getter:e,typeName:sd.ZodLazy,...Vc(t)});class zl extends Wc{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Bc(t,{received:t.data,code:_c.invalid_literal,expected:this._def.value}),Rc}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Gl(e,t){return new Vl({values:e,typeName:sd.ZodEnum,...Vc(t)})}zl.create=(e,t)=>new zl({value:e,typeName:sd.ZodLiteral,...Vc(t)});class Vl extends Wc{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Bc(t,{expected:wc.joinValues(n),received:t.parsedType,code:_c.invalid_type}),Rc}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Bc(t,{received:t.data,code:_c.invalid_enum_value,options:n}),Rc}return Fc(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Vl.create(e,{...this._def,...t})}exclude(e,t=this._def){return Vl.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}Vl.create=Gl;class Wl extends Wc{_parse(e){const t=wc.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==xc.string&&n.parsedType!==xc.number){const e=wc.objectValues(t);return Bc(n,{expected:wc.joinValues(e),received:n.parsedType,code:_c.invalid_type}),Rc}if(this._cache||(this._cache=new Set(wc.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=wc.objectValues(t);return Bc(n,{received:n.data,code:_c.invalid_enum_value,options:e}),Rc}return Fc(e.data)}get enum(){return this._def.values}}Wl.create=(e,t)=>new Wl({values:e,typeName:sd.ZodNativeEnum,...Vc(t)});class Kl extends Wc{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==xc.promise&&!1===t.common.async)return Bc(t,{code:_c.invalid_type,expected:xc.promise,received:t.parsedType}),Rc;const n=t.parsedType===xc.promise?t.data:Promise.resolve(t.data);return Fc(n.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Kl.create=(e,t)=>new Kl({type:e,typeName:sd.ZodPromise,...Vc(t)});class Zl extends Wc{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===sd.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{Bc(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===r.type){const e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return Rc;const r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?Rc:"dirty"===r.status||"dirty"===t.value?Nc(r.value):r});{if("aborted"===t.value)return Rc;const r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?Rc:"dirty"===r.status||"dirty"===t.value?Nc(r.value):r}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?Rc:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>"aborted"===n.status?Rc:("dirty"===n.status&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!qc(e))return Rc;const a=r.transform(e.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>qc(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):Rc)}wc.assertNever(r)}}Zl.create=(e,t,n)=>new Zl({schema:e,typeName:sd.ZodEffects,effect:t,...Vc(n)}),Zl.createWithPreprocess=(e,t,n)=>new Zl({schema:t,effect:{type:"preprocess",transform:e},typeName:sd.ZodEffects,...Vc(n)});class Ql extends Wc{_parse(e){return this._getType(e)===xc.undefined?Fc(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ql.create=(e,t)=>new Ql({innerType:e,typeName:sd.ZodOptional,...Vc(t)});class $l extends Wc{_parse(e){return this._getType(e)===xc.null?Fc(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}$l.create=(e,t)=>new $l({innerType:e,typeName:sd.ZodNullable,...Vc(t)});class Jl extends Wc{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===xc.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Jl.create=(e,t)=>new Jl({innerType:e,typeName:sd.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...Vc(t)});class Yl extends Wc{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Dc(r)?r.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new Ec(n.common.issues)},input:n.data})})):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new Ec(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Yl.create=(e,t)=>new Yl({innerType:e,typeName:sd.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...Vc(t)});class Xl extends Wc{_parse(e){if(this._getType(e)!==xc.nan){const t=this._getOrReturnCtx(e);return Bc(t,{code:_c.invalid_type,expected:xc.nan,received:t.parsedType}),Rc}return{status:"valid",value:e.data}}}Xl.create=e=>new Xl({typeName:sd.ZodNaN,...Vc(e)});const ed=Symbol("zod_brand");class td extends Wc{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class nd extends Wc{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Rc:"dirty"===e.status?(t.dirty(),Nc(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Rc:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new nd({in:e,out:t,typeName:sd.ZodPipeline})}}class rd extends Wc{_parse(e){const t=this._def.innerType._parse(e),n=e=>(qc(e)&&(e.value=Object.freeze(e.value)),e);return Dc(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}}function id(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function ad(e,t={},n){return e?Pl.create().superRefine((r,i)=>{const a=e(r);if(a instanceof Promise)return a.then(e=>{if(!e){const e=id(t,r),a=e.fatal??n??!0;i.addIssue({code:"custom",...e,fatal:a})}});if(!a){const e=id(t,r),a=e.fatal??n??!0;i.addIssue({code:"custom",...e,fatal:a})}}):Pl.create()}rd.create=(e,t)=>new rd({innerType:e,typeName:sd.ZodReadonly,...Vc(t)});const od={object:jl.lazycreate};var sd;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(sd||(sd={}));const ud=(e,t={message:`Input not instance of ${e.name}`})=>ad(t=>t instanceof e,t),cd=gl.create,ld=bl.create,dd=Xl.create,hd=vl.create,fd=wl.create,pd=Al.create,md=xl.create,gd=kl.create,yd=_l.create,bd=Pl.create,vd=El.create,wd=Sl.create,Ad=Tl.create,xd=Ml.create,kd=jl.create,_d=jl.strictCreate,Pd=Cl.create,Ed=Ol.create,Sd=Nl.create,Td=Fl.create,Md=Ll.create,Id=Hl.create,jd=ql.create,Cd=Dl.create,Bd=Ul.create,Od=zl.create,Rd=Vl.create,Nd=Wl.create,Fd=Kl.create,Ld=Zl.create,Hd=Ql.create,qd=$l.create,Dd=Zl.createWithPreprocess,Ud=nd.create,zd=()=>cd().optional(),Gd=()=>ld().optional(),Vd=()=>fd().optional(),Wd={string:e=>gl.create({...e,coerce:!0}),number:e=>bl.create({...e,coerce:!0}),boolean:e=>wl.create({...e,coerce:!0}),bigint:e=>vl.create({...e,coerce:!0}),date:e=>Al.create({...e,coerce:!0})},Kd=Rc,Zd=e=>e.message?e.message:"unspecified error";class Qd extends Io{constructor(e){super(),this.code=1100,this.errors=e,super.message=`Web3 validator found ${e.length} error[s]:\n${this._compileErrors().join("\n")}`}_compileErrors(){return this.errors.map(Zd)}}const $d=["bool","int","uint","bytes","string","address","tuple"],Jd=e=>"object"==typeof e&&"type"in e&&"name"in e,Yd=e=>"string"==typeof e,Xd=e=>"string"==typeof e&&/^((-)?0x[0-9a-f]+|(0x))$/i.test(e);function eh(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||void 0!==t&&t>0&&e.length!==2+2*t)}const th=e=>"number"==typeof e||"bigint"==typeof e||"string"==typeof e&&/^((-0x|0x|-)?[0-9a-f]+|(0x))$/i.test(e);function nh(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof e);return e.startsWith("0x")}const rh=function(e){for(const[t,n]of Object.entries(e))if(void 0!==n&&n.length>0&&0===n[0])throw new Error(`${t} cannot have leading zeroes, received: ${n.toString()}`)},ih=["hex","number","blockNumber","blockNumberOrTag","filter","bloom"],ah=e=>{let t,n=e.replace(/ /,""),r=!1,i=[];if(e.includes("[")&&(n=n.slice(0,n.indexOf("[")),i=[...e.matchAll(/(?:\[(\d*)\])/g)].map(e=>parseInt(e[1],10)).map(e=>Number.isNaN(e)?-1:e),r=i.length>0),$d.includes(n))return{baseType:n,isArray:r,baseTypeSize:t,arraySizes:i};if(n.startsWith("int"))t=parseInt(n.substring(3),10),n="int";else if(n.startsWith("uint"))t=parseInt(e.substring(4),10),n="uint";else{if(!n.startsWith("bytes"))return{baseType:void 0,isArray:!1,baseTypeSize:void 0,arraySizes:i};t=parseInt(n.substring(5),10),n="bytes"}return{baseType:n,isArray:r,baseTypeSize:t,arraySizes:i}},oh=(e,t={})=>{if(Object.keys(t).includes("type"))throw new Qd([{keyword:"eth",message:'Either "eth" or "type" can be presented in schema',params:{eth:e},instancePath:"",schemaPath:""}]);const{baseType:n,baseTypeSize:r}=ah(e);if(!n&&!ih.includes(e))throw new Qd([{keyword:"eth",message:`Eth data type "${e}" is not valid`,params:{eth:e},instancePath:"",schemaPath:""}]);if(n){if("tuple"===n)throw new Error('"tuple" type is not implemented directly.');return{format:`${n}${null!=r?r:""}`,required:!0}}return e?{format:e,required:!0}:{}},sh=(e,t="/0")=>{const n={type:"array",items:[],maxItems:e.length,minItems:e.length};for(const[r,i]of e.entries()){let e,a,o=[];Jd(i)?(e=i.type,a=i.name||`${t}/${r}`,o=i.components):"string"==typeof i?(e=i,a=`${t}/${r}`):Array.isArray(i)&&(i[0]&&"string"==typeof i[0]&&i[0].startsWith("tuple")&&!Array.isArray(i[0])&&i[1]&&Array.isArray(i[1])?(e=i[0],a=`${t}/${r}`,o=i[1]):(e="tuple",a=`${t}/${r}`,o=i));const{baseType:s,isArray:u,arraySizes:c}=ah(e);let l,d=n;for(let e=c.length-1;e>0;e-=1)l={type:"array",$id:a,items:[],maxItems:c[e],minItems:c[e]},c[e]<0&&(delete l.maxItems,delete l.minItems),Array.isArray(d.items)?0===d.items.length?d.items=[l]:d.items.push(l):d.items=[d.items,l],d=l;if("tuple"!==s||u)if("tuple"===s&&u){const e=c[0],t=Object.assign({type:"array",$id:a,items:sh(o,a)},e>=0&&{minItems:e,maxItems:e});d.items.push(t)}else if(u){const t=c[0],n=Object.assign({type:"array",$id:a,items:oh(e)},t>=0&&{minItems:t,maxItems:t});d.items.push(n)}else Array.isArray(d.items),d.items.push(Object.assign({$id:a},oh(e)));else{const e=sh(o,a);e.$id=a,d.items.push(e)}d=n}return n},uh=e=>sh(e),ch=(e,t)=>1===t?e:ch(e[0],t-1),lh=(e,t,n)=>{const r=[];for(const[i,a]of e.entries()){let e,o,s=[];Jd(a)?(e=a.type,o=a.name,s=a.components):"string"==typeof a?e=a:Array.isArray(a)&&(a[1]&&Array.isArray(a[1])?(e=a[0],s=a[1]):(e="tuple",s=a));const{baseType:u,isArray:c,arraySizes:l}=ah(e),d=Array.isArray(t)?t[i]:t[o];if("tuple"!==u||c)if("tuple"===u&&c){const e=[];for(const t of d)if(l.length>1){const r=ch(t,l.length-1),i=[];for(const e of r)i.push(lh(s,e,n));e.push(i)}else e.push(lh(s,t,n));r.push(e)}else r.push(d);else r.push(lh(s,d,n))}return(n=null!=n?n:[]).push(...r),n},dh=e=>{if(e>=48&&e<=57)return e-48;if(e>=65&&e<=70)return e-55;if(e>=97&&e<=102)return e-87;throw new Error(`Invalid code point: ${e}`)},hh=e=>{if(!Xd(e))throw new Error("Invalid hex string");const[t,n]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],r=BigInt(n);return r>Number.MAX_SAFE_INTEGER?t?-r:r:r<Number.MIN_SAFE_INTEGER?r:t?-1*Number(r):Number(r)},fh=e=>{if(("number"==typeof e||"bigint"==typeof e)&&e<0)return`-0x${e.toString(16).slice(1)}`;if(("number"==typeof e||"bigint"==typeof e)&&e>=0)return`0x${e.toString(16)}`;if("string"==typeof e&&Xd(e)){const[t,n]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e];return`${t?"-":""}0x${n.split(/^(-)?0(x|X)/).slice(-1)[0].replace(/^0+/,"").toLowerCase()}`}if("string"==typeof e&&!Xd(e))return fh(BigInt(e));throw new Js(e)},ph=(e,t,n="0")=>{if("string"==typeof e&&!Xd(e))return e.padStart(t,n);const r="string"==typeof e&&Xd(e)?e:fh(e),[i,a]=r.startsWith("-")?["-0x",r.slice(3)]:["0x",r.slice(2)];return`${i}${a.padStart(t,n)}`};function mh(e){let t="0x";for(const n of e){const e=n.toString(16);t+=1===e.length?`0${e}`:e}return t}const gh={zero:48,nine:57,A:65,F:70,a:97,f:102};function yh(e){return e>=gh.zero&&e<=gh.nine?e-gh.zero:e>=gh.A&&e<=gh.F?e-(gh.A-10):e>=gh.a&&e<=gh.f?e-(gh.a-10):void 0}function bh(e){let t=0;if(!e.startsWith("0")||"x"!==e[1]&&"X"!==e[1]||(t=2),e.length%2!=0)throw new $s(`hex string has odd length: ${e}`);const n=(e.length-t)/2,r=new Uint8Array(n);for(let i=0,a=t;i<n;i+=1){const t=yh(e.charCodeAt(a++)),n=yh(e.charCodeAt(a++));if(void 0===t||void 0===n)throw new $s(`Invalid byte sequence ("${e[a-2]}${e[a-1]}" in "${e}").`);r[i]=16*t+n}return r}function vh(e){var t;return e instanceof Uint8Array||"Uint8Array"!==(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)?e:Uint8Array.from(e)}const wh=e=>{var t,n;return e instanceof Uint8Array||"Uint8Array"===(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)||"Buffer"===(null===(n=null==e?void 0:e.constructor)||void 0===n?void 0:n.name)},Ah=(e,t={abiType:"bytes"})=>{if("string"!=typeof e&&!Array.isArray(e)&&!wh(e))return!1;if("string"==typeof e&&Xd(e)&&e.startsWith("-"))return!1;if("string"==typeof e&&!Xd(e))return!1;let n;if("string"==typeof e){if(e.length%2!=0)return!1;n=bh(e)}else if(Array.isArray(e)){if(e.some(e=>e<0||e>255||!Number.isInteger(e)))return!1;n=new Uint8Array(e)}else n=e;if(null==t?void 0:t.abiType){const{baseTypeSize:e}=ah(t.abiType);return!e||n.length===e}return!(null==t?void 0:t.size)||n.length===(null==t?void 0:t.size)},xh=e=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(e))return!1;const t=e.slice(2),n=zu(t.toLowerCase()),r=mh(vc(vh(n))).slice(2);for(let e=0;e<40;e+=1)if(parseInt(r[e],16)>7&&t[e].toUpperCase()!==t[e]||parseInt(r[e],16)<=7&&t[e].toLowerCase()!==t[e])return!1;return!0},kh=(e,t=!0)=>{if("string"!=typeof e&&!wh(e))return!1;let n;return n=wh(e)?mh(e):"string"!=typeof e||Xd(e)||e.toLowerCase().startsWith("0x")?e:`0x${e}`,!!/^(0x)?[0-9a-f]{40}$/i.test(n)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(n)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(n))||!t||xh(n))},_h=(e,t)=>{if(t===BigInt(0))return BigInt(1);let n=e;for(let r=1;r<t;r+=1)n*=e;return n},Ph=(e,t={abiType:"uint"})=>{if(!["number","string","bigint"].includes(typeof e)||"string"==typeof e&&0===e.length)return!1;let n;if(null==t?void 0:t.abiType){const{baseTypeSize:e}=ah(t.abiType);e&&(n=e)}else t.bitSize&&(n=t.bitSize);const r=_h(BigInt(2),BigInt(null!=n?n:256))-BigInt(1);try{const t="string"==typeof e&&Xd(e)?BigInt(hh(e)):BigInt(e);return t>=0&&t<=r}catch(e){return!1}},Eh=(e,t={abiType:"int"})=>{if(!["number","string","bigint"].includes(typeof e))return!1;if("number"==typeof e&&e>Number.MAX_SAFE_INTEGER)return!1;let n;if(null==t?void 0:t.abiType){const{baseTypeSize:e,baseType:r}=ah(t.abiType);if("int"!==r)return!1;e&&(n=e)}else t.bitSize&&(n=t.bitSize);const r=_h(BigInt(2),BigInt((null!=n?n:256)-1)),i=BigInt(-1)*_h(BigInt(2),BigInt((null!=n?n:256)-1));try{const t="string"==typeof e&&Xd(e)?BigInt(hh(e)):BigInt(e);return t>=i&&t<=r}catch(e){return!1}},Sh=e=>!!Eh(e)||!("string"!=typeof e||!/[0-9.]/.test(e)||e.indexOf(".")!==e.lastIndexOf("."))||"number"==typeof e,Th=e=>Ph(e),Mh=e=>Object.values(io).includes(e),Ih=e=>Mh(e)||Th(e),jh=e=>!("string"!=typeof e||!/^(0x)?[0-9a-f]{512}$/i.test(e)||!/^(0x)?[0-9a-f]{512}$/.test(e)&&!/^(0x)?[0-9A-F]{512}$/.test(e)),Ch=(e,t)=>{if("string"==typeof t&&!Xd(t))return!1;if(!jh(e))return!1;const n="string"==typeof t?bh(t):t,r=mh(vc(n)).slice(2);for(let t=0;t<12;t+=4){const n=(parseInt(r.slice(t,t+2),16)<<8)+parseInt(r.slice(t+2,t+4),16)&2047,i=1<<n%4;if((dh(e.charCodeAt(e.length-1-Math.floor(n/4)))&i)!==i)return!1}return!0},Bh=e=>null==e,Oh=e=>!("object"!=typeof e||Bh(e)||Array.isArray(e)||e instanceof so),Rh=e=>!("string"!=typeof e||!/^(0x)?[0-9a-f]{64}$/i.test(e)||!/^(0x)?[0-9a-f]{64}$/.test(e)&&!/^(0x)?[0-9A-F]{64}$/.test(e)),Nh={address:e=>kh(e),bloom:e=>jh(e),blockNumber:e=>Th(e),blockTag:e=>Mh(e),blockNumberOrTag:e=>Ih(e),bool:e=>{return!!["number","string","boolean"].includes(typeof(t=e))&&("boolean"==typeof t||("string"!=typeof t||Xd(t)?"string"==typeof t&&Xd(t)?"0x1"===t||"0x0"===t:1===t||0===t:"1"===t||"0"===t));var t},bytes:e=>Ah(e),filter:e=>(e=>{const t=["fromBlock","toBlock","address","topics","blockHash"];if(Bh(e)||"object"!=typeof e)return!1;if(!Object.keys(e).every(e=>t.includes(e)))return!1;if(!Bh(e.fromBlock)&&!Ih(e.fromBlock)||!Bh(e.toBlock)&&!Ih(e.toBlock))return!1;if(!Bh(e.address))if(Array.isArray(e.address)){if(!e.address.every(e=>kh(e)))return!1}else if(!kh(e.address))return!1;return!(!Bh(e.topics)&&!e.topics.every(e=>!!Bh(e)||(Array.isArray(e)?e.every(e=>Rh(e)):!!Rh(e))))})(e),hex:e=>Xd(e),uint:e=>Ph(e),int:e=>Eh(e),number:e=>Sh(e),string:e=>Yd(e)};for(let e=8;e<=256;e+=8)Nh[`int${e}`]=t=>Eh(t,{bitSize:e}),Nh[`uint${e}`]=t=>Ph(t,{bitSize:e});for(let e=1;e<=32;e+=1)Nh[`bytes${e}`]=t=>Ah(t,{size:e});Nh.bytes256=Nh.bytes;const Fh=Nh,Lh=e=>{if((!(null==e?void 0:e.type)||"object"===(null==e?void 0:e.type))&&(null==e?void 0:e.properties)){const t={};for(const n of Object.keys(e.properties)){const r=Lh(e.properties[n]);r&&(t[n]=r)}return Array.isArray(e.required)?kd(t).partial().required(e.required.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:!0}),{})):kd(t).partial()}if("array"===(null==e?void 0:e.type)&&(null==e?void 0:e.items)){if(Array.isArray(e.items)&&e.items.length>1&&void 0!==e.maxItems&&new Set(e.items.map(e=>e.$id)).size===e.items.length){const t=[];for(const n of e.items){const e=Lh(n);e&&t.push(e)}return Td(t)}const t=Array.isArray(e.items)?e.items[0]:e.items;let n=xd(Lh(t));return n=void 0!==e.minItems?n.min(e.minItems):n,n=void 0!==e.maxItems?n.max(e.maxItems):n,n}if(e.oneOf&&Array.isArray(e.oneOf))return Pd(e.oneOf.map(e=>Lh(e)));if(null==e?void 0:e.format){if(!Fh[e.format])throw new vu(e.format);return bd().refine(Fh[e.format],t=>({params:{value:t,format:e.format}}))}return(null==e?void 0:e.type)&&"object"!==(null==e?void 0:e.type)&&"function"==typeof i[String(e.type)]?i[String(e.type)]():kd({data:bd()}).partial()};class Hh{static factory(){return Hh.validatorInstance||(Hh.validatorInstance=new Hh),Hh.validatorInstance}validate(e,t,n){var r,i;const a=Lh(e).safeParse(t);if(!a.success){const e=this.convertErrors(null!==(i=null===(r=a.error)||void 0===r?void 0:r.issues)&&void 0!==i?i:[]);if(e){if(null==n?void 0:n.silent)return e;throw new Qd(e)}}}convertErrors(e){if(e&&Array.isArray(e)&&e.length>0)return e.map(e=>{var t;let n,r,i,a;a=e.path.join("/");const o=String(e.path[e.path.length-1]),s=e.path.join("/");if(e.code===_c.too_big)r="maxItems",a=`${s}/maxItems`,i={limit:e.maximum},n=`must NOT have more than ${e.maximum} items`;else if(e.code===_c.too_small)r="minItems",a=`${s}/minItems`,i={limit:e.minimum},n=`must NOT have fewer than ${e.minimum} items`;else if(e.code===_c.custom){const{value:r,format:o}=null!==(t=e.params)&&void 0!==t?t:{};n=void 0===r?`value at "/${a}" is required`:`value "${"object"==typeof r?JSON.stringify(r):r}" at "/${a}" must pass "${o}" validation`,i={value:r}}return{keyword:null!=r?r:o,instancePath:s?`/${s}`:"",schemaPath:a?`#${a}`:"#",params:null!=i?i:{value:e.message},message:null!=n?n:e.message}})}}const qh=new class{constructor(){this._validator=Hh.factory()}validateJSONSchema(e,t,n){return this._validator.validate(e,t,n)}validate(e,t,n={silent:!1}){var r,i;const a=uh(e);if(!Array.isArray(a.items)||0!==(null===(r=a.items)||void 0===r?void 0:r.length)||0!==t.length){if(Array.isArray(a.items)&&0===(null===(i=a.items)||void 0===i?void 0:i.length)&&0!==t.length)throw new Qd([{instancePath:"/0",schemaPath:"/",keyword:"required",message:"empty schema against data can not be validated",params:t}]);return this._validator.validate(a,t,n)}}};function Dh(e){var t,n;return e instanceof Uint8Array||"Uint8Array"===(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)||"Buffer"===(null===(n=null==e?void 0:e.constructor)||void 0===n?void 0:n.name)}function Uh(...e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}function zh(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n+=1)if(e[n]!==t[n])return!1;return!0}const Gh={noether:BigInt(0),wei:BigInt(1),kwei:BigInt(1e3),Kwei:BigInt(1e3),babbage:BigInt(1e3),femtoether:BigInt(1e3),mwei:BigInt(1e6),Mwei:BigInt(1e6),lovelace:BigInt(1e6),picoether:BigInt(1e6),gwei:BigInt(1e9),Gwei:BigInt(1e9),shannon:BigInt(1e9),nanoether:BigInt(1e9),nano:BigInt(1e9),szabo:BigInt(1e12),microether:BigInt(1e12),micro:BigInt(1e12),finney:BigInt(1e15),milliether:BigInt(1e15),milli:BigInt(1e15),ether:BigInt("1000000000000000000"),kether:BigInt("1000000000000000000000"),grand:BigInt("1000000000000000000000"),mether:BigInt("1000000000000000000000000"),gether:BigInt("1000000000000000000000000000"),tether:BigInt("1000000000000000000000000000000")},Vh="Warning: Using type `number` with values that are large or contain many decimals may cause loss of precision, it is recommended to use type `string` or `BigInt` when using conversion methods",Wh=e=>{if(qh.validate(["bytes"],[e]),Dh(e))return e;if(Array.isArray(e))return new Uint8Array(e);if("string"==typeof e)return bh(e);throw new $s(e)},{uint8ArrayToHexString:Kh}=a,Zh=e=>Kh(Wh(e)),Qh=e=>"string"==typeof e&&"0x"!==e.slice(0,2).toLowerCase()?Wh(`0x${e}`):Wh(e),$h=e=>(qh.validate(["hex"],[e]),hh(e)),Jh=$h,Yh=(e,t)=>{"bigint"!=typeof e&&qh.validate(["int"],[e]);let n=fh(e);return t&&(n.startsWith("-")||n.length%2!=1?n.length%2==0&&n.startsWith("-")&&(n="-0x0".concat(n.slice(3))):n="0x0".concat(n.slice(2))),n},Xh=Yh,ef=e=>$h(e).toString(),tf=e=>{qh.validate(["string"],[e]);let t=e.replace(/^(?:\u0000)/,"");return t=t.replace(/(?:\u0000)$/,""),Zh((new TextEncoder).encode(t))},nf=tf,rf=tf,af=e=>yc(Qh(e)),of=e=>"string"==typeof e?af(e):(qh.validate(["bytes"],[e]),yc(e)),sf=zu,uf=af,cf=e=>{qh.validate(["string"],[e]);let t="";for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n).toString(16);t+=r.length%2!=0?`0${r}`:r}return`0x${t}`},lf=cf,df=e=>new TextDecoder("ascii").decode(Qh(e)),hf=df,ff=(e,t)=>{if("string"==typeof e&&kh(e))return t?"address":`0x${e.toLowerCase().replace(/^0x/i,"")}`;if("boolean"==typeof e)return t?"bool":e?"0x01":"0x00";if("number"==typeof e)return t?e<0?"int256":"uint256":Yh(e);if("bigint"==typeof e)return t?"bigint":Yh(e);if(Dh(e))return t?"bytes":Zh(e);if("object"==typeof e&&e)return t?"string":tf(JSON.stringify(e));if("string"==typeof e){if(e.startsWith("-0x")||e.startsWith("-0X"))return t?"int256":Yh(e);if(Xd(e))return t?"bytes":e;if(th(e)&&!Eh(e)&&!Ph(e))return t?"bytes":`0x${e}`;if(th(e)&&!Eh(e)&&Ph(e))return t?"uint":Yh(e);if(!Number.isFinite(e))return t?"string":tf(e)}throw new nu(e)},pf=e=>{if("number"==typeof e)return e>1e20?(console.warn(Vh),BigInt(e)):e;if("bigint"==typeof e)return e>=Number.MIN_SAFE_INTEGER&&e<=Number.MAX_SAFE_INTEGER?Number(e):e;if("string"==typeof e&&Xd(e))return $h(e);try{return pf(BigInt(e))}catch(t){throw new Js(e)}},mf=e=>{if("number"==typeof e)return BigInt(e);if("bigint"==typeof e)return e;if("string"==typeof e&&th(e))return e.startsWith("-")?-BigInt(e.substring(1)):BigInt(e);throw new Js(e)},gf=(e,t)=>{let n;if("string"==typeof t){if(n=Gh[t],!n)throw new eu(t)}else{if(t<0||!Number.isInteger(t))throw new tu(t);n=_h(BigInt(10),BigInt(t))}const r=String(pf(e)),i=n.toString().length-1;if(i<=0)return r.toString();const a=r.padStart(i,"0"),o=a.slice(0,-i),s=a.slice(-i).replace(/\.?0+$/,"");return""===o?s?`0.${s}`:"0":""===s?o:`${o}.${s}`.slice(0,o.length+i+1)},yf=(e,t)=>{let n;if(qh.validate(["number"],[e]),"string"==typeof t){if(n=Gh[t],!n)throw new eu(t)}else{if(t<0||!Number.isInteger(t))throw new tu(t);n=_h(BigInt(10),BigInt(t))}let r=e;"number"==typeof r&&(r<1e-15&&console.warn(Vh),r>1e20?(console.warn(Vh),r=BigInt(r)):r=r.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20}));const[i,a]=String("string"!=typeof r||Xd(r)?pf(r):r).split(".").concat(""),o=BigInt(`${i}${a}`)*n,s=a.length;return 0===s?o.toString():o.toString().slice(0,-s)},bf=e=>{if(!kh(e,!1))throw new Ys(e);const t=e.toLowerCase().replace(/^0x/i,""),n=mh(vc(vh(sf(t))));if(Bh(n)||"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"===n)return"";let r="0x";const i=n.replace(/^0x/i,"");for(let e=0;e<t.length;e+=1)parseInt(i[e],16)>7?r+=t[e].toUpperCase():r+=t[e];return r},vf=e=>{if("boolean"==typeof e)return e;if("number"==typeof e&&(0===e||1===e))return Boolean(e);if("bigint"==typeof e&&(e===BigInt(0)||e===BigInt(1)))return Boolean(e);if("string"==typeof e&&!Xd(e)&&("1"===e||"0"===e||"false"===e||"true"===e))return"true"===e||"false"!==e&&Boolean(Number(e));if("string"==typeof e&&Xd(e)&&("0x1"===e||"0x0"===e))return Boolean(pf(e));throw new iu(e)};var wf=n(228);const Af=wf;class xf extends Af{constructor(){super(...arguments),this.maxListeners=Number.MAX_SAFE_INTEGER}setMaxListeners(e){return this.maxListeners=e,this}getMaxListeners(){return this.maxListeners}}const kf=Xd,_f=th,Pf=xh,Ef=kh,Sf=jh,Tf=Ch,Mf=(e,t)=>{if(!jh(e))return!1;if(!kh(t))return!1;const n=ph(t,64);return Ch(e,n)},If=(e,t)=>!!jh(e)&&!!kh(t)&&Ch(e,t),jf=Rh,Cf=(e,t)=>!!jh(e)&&!!Rh(t)&&Ch(e,t),Bf=(e,t)=>{const n="string"==typeof e&&Mh(e),r="string"==typeof t&&Mh(t);if(e===t||("earliest"===e||0===e)&&("earliest"===t||0===t))return 0;if("earliest"===e)return-1;if("earliest"===t)return 1;if(n&&r){const n={[io.EARLIEST]:1,[io.FINALIZED]:2,[io.SAFE]:3,[io.LATEST]:4,[io.PENDING]:5};return n[e]<n[t]?-1:1}if(n&&!r||!n&&r)throw new uu("Cannot compare blocktag with provided non-blocktag input.");const i=BigInt(e),a=BigInt(t);return i<a?-1:i===a?0:1},Of=e=>"object"==typeof e&&!Bh(e)&&0!==Object.keys(e).length&&["input","data","from","gas","gasPrice","gasLimit","address","jsonInterface","syncWithContext","dataInputFill"].some(t=>t in e),Rf=Bh,Nf=e=>!("object"!=typeof e||Bh(e)||Array.isArray(e)||e instanceof so),Ff=(e,...t)=>{if(!Nf(e))return e;const n=Object.assign({},e);for(const e of t)for(const t in e)Nf(e[t])?(n[t]||(n[t]={}),n[t]=Ff(n[t],e[t])):!Bh(e[t])&&Object.hasOwnProperty.call(e,t)&&(Array.isArray(e[t])||e[t]instanceof so?n[t]=e[t].slice(0):n[t]=e[t]);return n},Lf=(e,t,n="0")=>"string"==typeof e?Xd(e)?ph(e,t,n):e.padStart(t,n):(qh.validate(["int"],[e]),ph(e,t,n)),Hf=(e,t,n="0")=>{if("string"==typeof e&&!Xd(e))return e.padEnd(t,n);const r="string"==typeof e&&Xd(e)?e:Yh(e),i=r.startsWith("-")?3:2;return qh.validate([r.startsWith("-")?"int":"uint"],[e]),r.padEnd(t+i,n)},qf=Hf,Df=Lf,Uf=(e,t=64)=>{qh.validate(["int"],[e]);const n=pf(e);if(n>=0)return Lf(ff(n),t);const r=_h(BigInt(2),BigInt(4*t));if(-n>=r)throw new ru(`value: ${e}, nibbleWidth: ${t}`);const i=BigInt(n);return Lf(Yh(i+r),t)},zf=(e,t=64)=>{qh.validate(["int"],[e]);const n=pf(e);if(n<0)return n;const r=Math.ceil(Math.log(Number(n))/Math.log(2));if(r>4*t)throw new ru(`value: "${e}", nibbleWidth: "${t}"`);if(4*t!==r)return n;const i=_h(BigInt(2),BigInt(t)*BigInt(4));return pf(BigInt(n)-i)},{parseBaseType:Gf}=a,Vf=e=>"object"==typeof e&&!Bh(e)&&"number"in e&&"bytes"in e,Wf=(e,t,n=[])=>{let r,i=Object.assign({},e);for(const e of t){if(i.oneOf&&r){const e=r,t=n.find(([t])=>t===e);t&&t[0]===r&&(i=i.oneOf[t[1]])}if(!i.properties&&!i.items)return;i.properties?i=i.properties[e]:i.items&&i.items.properties?i=i.items.properties[e]:i.items&&Oh(i.items)?i=i.items:i.items&&Array.isArray(i.items)&&(i=i.items[parseInt(e,10)]),i&&e&&(r=e)}return i},Kf=(e,t,n)=>{try{const{baseType:r,baseTypeSize:i}=Gf(t);if("int"===r||"uint"===r)switch(n.number){case Xa.NUMBER:return Number(mf(e));case Xa.HEX:return Yh(mf(e));case Xa.STR:return mf(e).toString();case Xa.BIGINT:return mf(e);default:throw new ts(`Invalid format: ${String(n.number)}`)}if("bytes"===r){let t;switch(i?"string"==typeof e?t=Lf(e,2*i):Dh(e)&&(t=Uh(new Uint8Array(i-e.length),e)):t=e,n.bytes){case eo.HEX:return Zh(Wh(t));case eo.UINT8ARRAY:return Wh(t);default:throw new ts(`Invalid format: ${String(n.bytes)}`)}}if("string"===r)return String(e)}catch(t){return e}return e},Zf=({value:e,schemaProp:t,schema:n,object:r,key:i,dataPath:a,format:o,oneOfPath:s=[]})=>{var u,c;if(Array.isArray(e)){let l=t;if(void 0!==(null==t?void 0:t.oneOf)&&t.oneOf.forEach((n,r)=>{var a,o;!Array.isArray(null==t?void 0:t.items)&&("object"==typeof e[0]&&"object"===(null===(a=null==n?void 0:n.items)||void 0===a?void 0:a.type)||"string"==typeof e[0]&&"object"!==(null===(o=null==n?void 0:n.items)||void 0===o?void 0:o.type))&&(l=n,s.push([i,r]))}),Bh(null==l?void 0:l.items))return delete r[i],a.pop(),!0;if(Oh(l.items)&&!Bh(l.items.format)){for(let t=0;t<e.length;t+=1)r[i][t]=Kf(e[t],null===(u=null==l?void 0:l.items)||void 0===u?void 0:u.format,o);return a.pop(),!0}if(!Array.isArray(null==l?void 0:l.items)&&"object"===(null===(c=null==l?void 0:l.items)||void 0===c?void 0:c.type)){for(const t of e)Qf(t,n,a,o,s);return a.pop(),!0}if(Array.isArray(null==l?void 0:l.items)){for(let t=0;t<e.length;t+=1)r[i][t]=Kf(e[t],l.items[t].format,o);return a.pop(),!0}}return!1},Qf=(e,t,n,r,i=[])=>{var a;if(!Oh(e)&&!Array.isArray(e))return Kf(e,null==t?void 0:t.format,r);const o=e;if(Array.isArray(o)&&"array"===(null==t?void 0:t.type)&&"object"===(null===(a=null==t?void 0:t.items)||void 0===a?void 0:a.type))Zf({value:o,schemaProp:t,schema:t,object:o,key:"",dataPath:n,format:r,oneOfPath:i});else for(const[e,a]of Object.entries(o)){n.push(e);let s=Wf(t,n,i);if(Bh(s))delete o[e],n.pop();else if(Oh(a))Qf(a,t,n,r,i),n.pop();else if(!Zf({value:a,schemaProp:s,schema:t,object:o,key:e,dataPath:n,format:r,oneOfPath:i})){if(void 0===(null==s?void 0:s.format)&&void 0!==(null==s?void 0:s.oneOf))for(const[e,t]of s.oneOf.entries())if(void 0!==(null==t?void 0:t.format)){s=t;break}o[e]=Kf(a,s.format,r),n.pop()}}return o},$f=(e,t,n=no)=>{let r;r=Oh(t)?Ff({},t):Array.isArray(t)?[...t]:t;const i=Oh(e)?e:uh(e);if(!i.properties&&!i.items&&!i.format)throw new ts("Invalid json schema for formatting");return Qf(r,i,[],n)},Jf="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",Yf=e=>{let t;return t="bigint"==typeof e||"number"==typeof e?zu(e.toString()):Array.isArray(e)?new Uint8Array(e):"string"!=typeof e||Xd(e)?Wh(e):zu(e),Zh(vc(vh(t)))},Xf=e=>{let t;t="string"==typeof e?e.startsWith("0x")&&Xd(e)?Qh(e):zu(e):e;const n=Yf(t);return n===Jf?void 0:n},ep=e=>{const t=Xf(e);return Bh(t)?Jf:t},tp=(e,t)=>{const n=/^(\d+).*$/.exec(e.slice(t));return n?parseInt(n[1],10):0},np=e=>e.toString(2).length,rp=(e,t)=>{const n=t.toString();if("string"===e){if("string"==typeof t)return tf(t);throw new Xs(t)}if("bool"===e||"boolean"===e){if("boolean"==typeof t)return t?"01":"00";throw new iu(t)}if("address"===e){if(!kh(n))throw new Ys(n);return n}const r=(e=>e.startsWith("int[")?`int256${e.slice(3)}`:"int"===e?"int256":e.startsWith("uint[")?`uint256'${e.slice(4)}`:"uint"===e?"uint256":e)(e);if(e.startsWith("uint")){const e=tp(r,4);if(e%8||e<8||e>256)throw new ou(n);const t=pf(n);if(np(t)>e)throw new su(n);if(t<BigInt(0))throw new au(n);return e?Df(t.toString(16),e/8*2):t.toString(16)}if(e.startsWith("int")){const t=tp(r,3);if(t%8||t<8||t>256)throw new ou(e);const i=pf(n);if(np(i)>t)throw new su(n);return i<BigInt(0)?Uf(i.toString(),t/8*2):t?Df(i.toString(16),t/4):i.toString(16)}if("bytes"===r){if(n.replace(/^0x/i,"").length%2!=0)throw new $s(n);return n}if(e.startsWith("bytes")){if(n.replace(/^0x/i,"").length%2!=0)throw new $s(n);const t=tp(e,5);if(!t||t<1||t>64||t<n.replace(/^0x/i,"").length/2)throw new $s(n);return qf(n,2*t)}return""},ip=e=>{const[t,n]=(e=>{if(Array.isArray(e))throw new Error("Autodetection of array types is not supported.");let t,n;if("object"==typeof e&&("t"in e||"type"in e)&&("v"in e||"value"in e))t="t"in e?e.t:e.type,n="v"in e?e.v:e.value,t="bigint"===t.toLowerCase()?"int":t;else{if("bigint"==typeof e)return["int",e];t=ff(e,!0),n=ff(e),t.startsWith("int")||t.startsWith("uint")||(t="bytes")}return!t.startsWith("int")&&!t.startsWith("uint")||"string"!=typeof n||/^(-)?0x/i.test(n)||(n=mf(n)),[t,n]})(e);return Array.isArray(n)?n.map(e=>rp(t,e).replace("0x","")).join(""):rp(t,n).replace("0x","")},ap=(...e)=>`0x${e.map(ip).join("").toLowerCase()}`,op=(...e)=>Xf(ap(...e)),sp=(...e)=>ep(ap(...e)),up=e=>Xf(`0x${("number"==typeof e?e.toString():e).padStart(64,"0")}`),cp=e=>function(e){return $u(e)}(e),lp=e=>Zh(cp(e));var dp=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};function hp(e){return("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}function fp(e,t,n){return dp(this,void 0,void 0,function*(){let r;const i=yield Promise.race([e instanceof Promise?e:e(),new Promise((e,i)=>{r=setTimeout(()=>n?i(n):e(void 0),t)})]);if(r&&clearTimeout(r),i instanceof Error)throw i;return i})}function pp(e,t){let n;return[new Promise((r,i)=>{n=setInterval(function a(){return(()=>{dp(this,void 0,void 0,function*(){try{const i=yield fp(e,t);Bh(i)||(clearInterval(n),r(i))}catch(e){clearInterval(n),i(e)}})})(),a}(),t)}),n]}function mp(e,t){return dp(this,void 0,void 0,function*(){return pp(e,t)[0]})}function gp(e,t){let n;const r=new Promise((r,i)=>{n=setTimeout(()=>{i(t)},e)});return[n,r]}function yp(e,t){let n;const r=new Promise((r,i)=>{n=setInterval(()=>{(()=>{dp(this,void 0,void 0,function*(){const t=yield e();t&&(clearInterval(n),i(t))})})()},t)});return[n,r]}const bp=()=>{const e=cp(16);e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=Zh(e);return[t.substring(2,10),t.substring(10,14),t.substring(14,18),t.substring(18,22),t.substring(22,34)].join("-")},vp=e=>{const t=e.error.code;return bu.has(t)||t>=-32099&&t<=-32e3},wp=e=>!Array.isArray(e)&&!!e&&"2.0"===e.jsonrpc&&"result"in e&&Bh(e.error)&&("number"==typeof e.id||"string"==typeof e.id),Ap=e=>!Array.isArray(e)&&"2.0"===e.jsonrpc&&!!e&&Bh(e.result)&&"error"in e&&("number"==typeof e.id||"string"==typeof e.id),xp=e=>!(Array.isArray(e)||!e||"2.0"!==e.jsonrpc||Bh(e.params)||Bh(e.method)),kp=e=>!Array.isArray(e)&&!!e&&"2.0"===e.jsonrpc&&"id"in e&&"result"in e,_p=e=>wp(e)||Ap(e),Pp=e=>Array.isArray(e)?e.every(_p):_p(e),Ep=e=>Array.isArray(e)&&e.length>0&&Pp(e);let Sp;const Tp=e=>{Sp=e},Mp=e=>{var t,n,r,i;return void 0!==Sp&&(Sp+=1),{jsonrpc:null!==(t=e.jsonrpc)&&void 0!==t?t:"2.0",id:null!==(r=null!==(n=e.id)&&void 0!==n?n:Sp)&&void 0!==r?r:bp(),method:e.method,params:null!==(i=e.params)&&void 0!==i?i:void 0}},Ip=e=>e.map(e=>Mp(e)),jp=e=>Array.isArray(e)&&e.length>0;var Cp,Bp=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};class Op{constructor({timeout:e,eagerStart:t,timeoutMessage:n}={timeout:0,eagerStart:!1,timeoutMessage:"DeferredPromise timed out"}){this[Cp]="Promise",this._state="pending",this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t}),this._timeoutMessage=n,this._timeoutInterval=e,t&&this.startTimer()}get state(){return this._state}then(e,t){return Bp(this,void 0,void 0,function*(){return this._promise.then(e,t)})}catch(e){return Bp(this,void 0,void 0,function*(){return this._promise.catch(e)})}finally(e){return Bp(this,void 0,void 0,function*(){return this._promise.finally(e)})}resolve(e){this._resolve(e),this._state="fulfilled",this._clearTimeout()}reject(e){this._reject(e),this._state="rejected",this._clearTimeout()}startTimer(){this._timeoutInterval&&this._timeoutInterval>0&&(this._timeoutId=setTimeout(this._checkTimeout.bind(this),this._timeoutInterval))}_checkTimeout(){"pending"===this._state&&this._timeoutId&&this.reject(new rs(this._timeoutMessage))}_clearTimeout(){this._timeoutId&&clearTimeout(this._timeoutId)}}Cp=Symbol.toStringTag;class Rp{constructor(e,t){this.eventEmitter=e,this.autoReconnect=t,this.chunkTimeout=15e3}clearQueues(){"function"==typeof this._clearQueues&&this._clearQueues()}onError(e){this._clearQueues=e}parseResponse(e){const t=[];return e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach(e=>{let n,r=e;this.lastChunk&&(r=this.lastChunk+r);try{n=JSON.parse(r)}catch(e){return this.lastChunk=r,this.lastChunkTimeout&&clearTimeout(this.lastChunkTimeout),void(this.lastChunkTimeout=setTimeout(()=>{this.autoReconnect||(this.clearQueues(),this.eventEmitter.emit("error",new du({id:1,jsonrpc:"2.0",error:{code:2,message:"Chunk timeout"}})))},this.chunkTimeout))}clearTimeout(this.lastChunkTimeout),this.lastChunk=void 0,n&&t.push(n)}),t}}var Np=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};class Fp extends lo{constructor(){super(...arguments),this._eventEmitter=new wf,this._chainId="",this._accounts=[]}_getChainId(){return Np(this,void 0,void 0,function*(){var e;const t=yield this.request(Mp({method:"eth_chainId",params:[]}));return null!==(e=null==t?void 0:t.result)&&void 0!==e?e:""})}_getAccounts(){return Np(this,void 0,void 0,function*(){var e;const t=yield this.request(Mp({method:"eth_accounts",params:[]}));return null!==(e=null==t?void 0:t.result)&&void 0!==e?e:[]})}_onConnect(){Promise.all([this._getChainId().then(e=>{e!==this._chainId&&(this._chainId=e,this._eventEmitter.emit("chainChanged",this._chainId))}).catch(e=>{console.error(e)}),this._getAccounts().then(e=>{this._accounts.length===e.length&&e.every(t=>e.includes(t))||(this._accounts=e,this._onAccountsChanged())}).catch(e=>{console.error(e)})]).then(()=>this._eventEmitter.emit("connect",{chainId:this._chainId})).catch(e=>{console.error(e)})}_onDisconnect(e,t){this._eventEmitter.emit("disconnect",new yu(e,t))}_onAccountsChanged(){this._eventEmitter.emit("accountsChanged",this._accounts)}}var Lp=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};const Hp={autoReconnect:!0,delay:5e3,maxAttempts:5};class qp extends Fp{get SocketConnection(){return this._socketConnection}constructor(e,t,n){if(super(),this._connectionStatus="connecting",this._onMessageHandler=this._onMessage.bind(this),this._onOpenHandler=this._onConnect.bind(this),this._onCloseHandler=this._onCloseEvent.bind(this),this._onErrorHandler=this._onError.bind(this),!this._validateProviderPath(e))throw new us(e);this._socketPath=e,this._socketOptions=t,this._reconnectOptions=Object.assign(Object.assign({},Hp),null!=n?n:{}),this._pendingRequestsQueue=new Map,this._sentRequestsQueue=new Map,this._init(),this.connect(),this.chunkResponseParser=new Rp(this._eventEmitter,this._reconnectOptions.autoReconnect),this.chunkResponseParser.onError(()=>{this._clearQueues()}),this.isReconnecting=!1}_init(){this._reconnectAttempts=0}connect(){try{this._openSocketConnection(),this._connectionStatus="connecting",this._addSocketListeners()}catch(e){if(!this.isReconnecting)throw this._connectionStatus="disconnected",e&&e.message?new Uo(`Error while connecting to ${this._socketPath}. Reason: ${e.message}`):new us(this._socketPath);setImmediate(()=>{this._reconnect()})}}_validateProviderPath(e){return!!e}getPendingRequestQueueSize(){return this._pendingRequestsQueue.size}getSentRequestsQueueSize(){return this._sentRequestsQueue.size}supportsSubscriptions(){return!0}on(e,t){this._eventEmitter.on(e,t)}once(e,t){this._eventEmitter.once(e,t)}removeListener(e,t){this._eventEmitter.removeListener(e,t)}_onDisconnect(e,t){this._connectionStatus="disconnected",super._onDisconnect(e,t)}disconnect(e,t){const n=null!=e?e:1e3;this._removeSocketListeners(),"disconnected"!==this.getStatus()&&this._closeSocketConnection(n,t),this._onDisconnect(n,t)}safeDisconnect(e,t){return Lp(this,arguments,void 0,function*(e,t,n=!1,r=1e3){let i=0;yield(()=>Lp(this,void 0,void 0,function*(){return new Promise(e=>{const t=setInterval(()=>{n&&i>=5&&this.clearQueues(),0===this.getPendingRequestQueueSize()&&0===this.getSentRequestsQueueSize()&&(clearInterval(t),e(!0)),i+=1},r)})}))(),this.disconnect(e,t)})}removeAllListeners(e){this._eventEmitter.removeAllListeners(e)}_onError(e){this.isReconnecting?this._reconnect():this._eventEmitter.emit("error",e)}reset(){this._sentRequestsQueue.clear(),this._pendingRequestsQueue.clear(),this._init(),this._removeSocketListeners(),this._addSocketListeners()}_reconnect(){this.isReconnecting||(this.isReconnecting=!0,this._sentRequestsQueue.size>0&&this._sentRequestsQueue.forEach((e,t)=>{e.deferredPromise.reject(new Vo),this._sentRequestsQueue.delete(t)}),this._reconnectAttempts<this._reconnectOptions.maxAttempts?(this._reconnectAttempts+=1,setTimeout(()=>{this._removeSocketListeners(),this.connect(),this.isReconnecting=!1},this._reconnectOptions.delay)):(this.isReconnecting=!1,this._clearQueues(),this._removeSocketListeners(),this._eventEmitter.emit("error",new Go(this._reconnectOptions.maxAttempts))))}request(e){return Lp(this,void 0,void 0,function*(){if(Rf(this._socketConnection))throw new Error("Connection is undefined");"disconnected"===this.getStatus()&&this.connect();const t=jp(e)?e[0].id:e.id;if(!t)throw new ls("Request Id not defined");if(this._sentRequestsQueue.has(t))throw new Wo(t);const n=new Op;n.catch(e=>{this._eventEmitter.emit("error",e)});const r={payload:e,deferredPromise:n};if("connecting"===this.getStatus())return this._pendingRequestsQueue.set(t,r),r.deferredPromise;this._sentRequestsQueue.set(t,r);try{this._sendToSocket(r.payload)}catch(e){this._sentRequestsQueue.delete(t),this._eventEmitter.emit("error",e)}return n})}_onConnect(){this._connectionStatus="connected",this._reconnectAttempts=0,super._onConnect(),this._sendPendingRequests()}_sendPendingRequests(){for(const[e,t]of this._pendingRequestsQueue.entries())try{this._sendToSocket(t.payload),this._pendingRequestsQueue.delete(e),this._sentRequestsQueue.set(e,t)}catch(t){this._pendingRequestsQueue.delete(e),this._eventEmitter.emit("error",t)}}_onMessage(e){const t=this._parseResponses(e);if(!Rf(t)&&0!==t.length)for(const e of t){if(xp(e)&&e.method.endsWith("_subscription"))return void this._eventEmitter.emit("message",e);const t=Ep(e)?e[0].id:e.id,n=this._sentRequestsQueue.get(t);if(!n)return;(Ep(e)||wp(e)||Ap(e))&&(this._eventEmitter.emit("message",e),n.deferredPromise.resolve(e)),this._sentRequestsQueue.delete(t)}}clearQueues(e){this._clearQueues(e)}_clearQueues(e){this._pendingRequestsQueue.size>0&&this._pendingRequestsQueue.forEach((t,n)=>{t.deferredPromise.reject(new zo(e)),this._pendingRequestsQueue.delete(n)}),this._sentRequestsQueue.size>0&&this._sentRequestsQueue.forEach((t,n)=>{t.deferredPromise.reject(new zo(e)),this._sentRequestsQueue.delete(n)}),this._removeSocketListeners()}}class Dp{constructor(){this._emitter=new xf}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}emit(e,t){this._emitter.emit(e,t)}listenerCount(e){return this._emitter.listenerCount(e)}listeners(e){return this._emitter.listeners(e)}eventNames(){return this._emitter.eventNames()}removeAllListeners(){return this._emitter.removeAllListeners()}setMaxListenerWarningThreshold(e){this._emitter.setMaxListeners(e)}getMaxListeners(){return this._emitter.getMaxListeners()}}var Up;!function(e){e.CONFIG_CHANGE="CONFIG_CHANGE"}(Up||(Up={}));class zp extends Dp{constructor(e){super(),this.config={handleRevert:!1,defaultAccount:void 0,defaultBlock:"latest",transactionBlockTimeout:50,transactionConfirmationBlocks:24,transactionPollingInterval:1e3,transactionPollingTimeout:75e4,transactionReceiptPollingInterval:void 0,transactionSendTimeout:75e4,transactionConfirmationPollingInterval:void 0,blockHeaderTimeout:10,maxListenersWarningThreshold:100,contractDataInputFill:"data",defaultNetworkId:void 0,defaultChain:"mainnet",defaultHardfork:"london",defaultCommon:void 0,defaultTransactionType:"0x2",defaultMaxPriorityFeePerGas:ff(25e8),enableExperimentalFeatures:{useSubscriptionWhenCheckingBlockTimeout:!1,useRpcCallSpecification:!1},transactionBuilder:void 0,transactionTypeParser:void 0,customTransactionSchema:void 0,defaultReturnFormat:no,ignoreGasPricing:!1},this.setConfig(null!=e?e:{})}setConfig(e){const t=Object.keys(e);for(const n of t)this._triggerConfigChange(n,e[n]),Rf(e[n])||"number"!=typeof e[n]||"maxListenersWarningThreshold"!==n||this.setMaxListenerWarningThreshold(Number(e[n]));Object.assign(this.config,e)}get handleRevert(){return this.config.handleRevert}set handleRevert(e){this._triggerConfigChange("handleRevert",e),this.config.handleRevert=e}get contractDataInputFill(){return this.config.contractDataInputFill}set contractDataInputFill(e){this._triggerConfigChange("contractDataInputFill",e),this.config.contractDataInputFill=e}get defaultAccount(){return this.config.defaultAccount}set defaultAccount(e){this._triggerConfigChange("defaultAccount",e),this.config.defaultAccount=e}get defaultBlock(){return this.config.defaultBlock}set defaultBlock(e){this._triggerConfigChange("defaultBlock",e),this.config.defaultBlock=e}get transactionSendTimeout(){return this.config.transactionSendTimeout}set transactionSendTimeout(e){this._triggerConfigChange("transactionSendTimeout",e),this.config.transactionSendTimeout=e}get transactionBlockTimeout(){return this.config.transactionBlockTimeout}set transactionBlockTimeout(e){this._triggerConfigChange("transactionBlockTimeout",e),this.config.transactionBlockTimeout=e}get transactionConfirmationBlocks(){return this.config.transactionConfirmationBlocks}set transactionConfirmationBlocks(e){this._triggerConfigChange("transactionConfirmationBlocks",e),this.config.transactionConfirmationBlocks=e}get transactionPollingInterval(){return this.config.transactionPollingInterval}set transactionPollingInterval(e){this._triggerConfigChange("transactionPollingInterval",e),this.config.transactionPollingInterval=e,this.transactionReceiptPollingInterval=e,this.transactionConfirmationPollingInterval=e}get transactionPollingTimeout(){return this.config.transactionPollingTimeout}set transactionPollingTimeout(e){this._triggerConfigChange("transactionPollingTimeout",e),this.config.transactionPollingTimeout=e}get transactionReceiptPollingInterval(){return this.config.transactionReceiptPollingInterval}set transactionReceiptPollingInterval(e){this._triggerConfigChange("transactionReceiptPollingInterval",e),this.config.transactionReceiptPollingInterval=e}get transactionConfirmationPollingInterval(){return this.config.transactionConfirmationPollingInterval}set transactionConfirmationPollingInterval(e){this._triggerConfigChange("transactionConfirmationPollingInterval",e),this.config.transactionConfirmationPollingInterval=e}get blockHeaderTimeout(){return this.config.blockHeaderTimeout}set blockHeaderTimeout(e){this._triggerConfigChange("blockHeaderTimeout",e),this.config.blockHeaderTimeout=e}get enableExperimentalFeatures(){return this.config.enableExperimentalFeatures}set enableExperimentalFeatures(e){this._triggerConfigChange("enableExperimentalFeatures",e),this.config.enableExperimentalFeatures=e}get maxListenersWarningThreshold(){return this.config.maxListenersWarningThreshold}set maxListenersWarningThreshold(e){this._triggerConfigChange("maxListenersWarningThreshold",e),this.setMaxListenerWarningThreshold(e),this.config.maxListenersWarningThreshold=e}get defaultReturnFormat(){return this.config.defaultReturnFormat}set defaultReturnFormat(e){this._triggerConfigChange("defaultReturnFormat",e),this.config.defaultReturnFormat=e}get defaultNetworkId(){return this.config.defaultNetworkId}set defaultNetworkId(e){this._triggerConfigChange("defaultNetworkId",e),this.config.defaultNetworkId=e}get defaultChain(){return this.config.defaultChain}set defaultChain(e){if(!Rf(this.config.defaultCommon)&&!Rf(this.config.defaultCommon.baseChain)&&e!==this.config.defaultCommon.baseChain)throw new fu(this.config.defaultChain,e);this._triggerConfigChange("defaultChain",e),this.config.defaultChain=e}get defaultHardfork(){return this.config.defaultHardfork}set defaultHardfork(e){if(!Rf(this.config.defaultCommon)&&!Rf(this.config.defaultCommon.hardfork)&&e!==this.config.defaultCommon.hardfork)throw new hu(this.config.defaultCommon.hardfork,e);this._triggerConfigChange("defaultHardfork",e),this.config.defaultHardfork=e}get defaultCommon(){return this.config.defaultCommon}set defaultCommon(e){if(!Rf(this.config.defaultHardfork)&&!Rf(e)&&!Rf(e.hardfork)&&this.config.defaultHardfork!==e.hardfork)throw new hu(this.config.defaultHardfork,e.hardfork);if(!Rf(this.config.defaultChain)&&!Rf(e)&&!Rf(e.baseChain)&&this.config.defaultChain!==e.baseChain)throw new fu(this.config.defaultChain,e.baseChain);this._triggerConfigChange("defaultCommon",e),this.config.defaultCommon=e}get ignoreGasPricing(){return this.config.ignoreGasPricing}set ignoreGasPricing(e){this._triggerConfigChange("ignoreGasPricing",e),this.config.ignoreGasPricing=e}get defaultTransactionType(){return this.config.defaultTransactionType}set defaultTransactionType(e){this._triggerConfigChange("defaultTransactionType",e),this.config.defaultTransactionType=e}get defaultMaxPriorityFeePerGas(){return this.config.defaultMaxPriorityFeePerGas}set defaultMaxPriorityFeePerGas(e){this._triggerConfigChange("defaultMaxPriorityFeePerGas",e),this.config.defaultMaxPriorityFeePerGas=e}get transactionBuilder(){return this.config.transactionBuilder}set transactionBuilder(e){this._triggerConfigChange("transactionBuilder",e),this.config.transactionBuilder=e}get transactionTypeParser(){return this.config.transactionTypeParser}set transactionTypeParser(e){this._triggerConfigChange("transactionTypeParser",e),this.config.transactionTypeParser=e}get customTransactionSchema(){return this.config.customTransactionSchema}set customTransactionSchema(e){this._triggerConfigChange("customTransactionSchema",e),this.config.customTransactionSchema=e}_triggerConfigChange(e,t){this.emit(Up.CONFIG_CHANGE,{name:e,oldValue:this.config[e],newValue:t})}}var Gp=n(4945);class Vp extends lo{constructor(e,t){if(super(),!Vp.validateClientUrl(e))throw new us(e);this.clientUrl=e,this.httpProviderOptions=t}static validateClientUrl(e){return"string"==typeof e&&/^http(s)?:\/\//i.test(e)}getStatus(){throw new ns}supportsSubscriptions(){return!1}request(e,t){var n,r,i,a,o;return r=this,i=void 0,o=function*(){const r=Object.assign(Object.assign({},null===(n=this.httpProviderOptions)||void 0===n?void 0:n.providerOptions),t),i=yield Gp(this.clientUrl,Object.assign(Object.assign({},r),{method:"POST",headers:Object.assign(Object.assign({},r.headers),{"Content-Type":"application/json"}),body:JSON.stringify(e)}));if(!i.ok)throw new lu(yield i.json(),void 0,void 0,i.status);return yield i.json()},new((a=void 0)||(a=Promise))(function(e,t){function n(e){try{u(o.next(e))}catch(e){t(e)}}function s(e){try{u(o.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof a?r:new a(function(e){e(r)})).then(n,s)}u((o=o.apply(r,i||[])).next())})}on(){throw new ns}removeListener(){throw new ns}once(){throw new ns}removeAllListeners(){throw new ns}connect(){throw new ns}disconnect(){throw new ns}reset(){throw new ns}reconnect(){throw new ns}}var Wp=null;"undefined"!=typeof WebSocket?Wp=WebSocket:"undefined"!=typeof MozWebSocket?Wp=MozWebSocket:void 0!==n.g?Wp=n.g.WebSocket||n.g.MozWebSocket:"undefined"!=typeof window?Wp=window.WebSocket||window.MozWebSocket:"undefined"!=typeof self&&(Wp=self.WebSocket||self.MozWebSocket);const Kp=Wp;class Zp extends qp{constructor(e,t,n){super(e,t,n)}_validateProviderPath(e){return"string"==typeof e&&/^ws(s)?:\/\//i.test(e)}getStatus(){if(this._socketConnection&&!Rf(this._socketConnection))switch(this._socketConnection.readyState){case this._socketConnection.CONNECTING:return"connecting";case this._socketConnection.OPEN:return"connected";default:return"disconnected"}return"disconnected"}_openSocketConnection(){this._socketConnection=new Kp(this._socketPath,void 0,this._socketOptions&&0===Object.keys(this._socketOptions).length?void 0:this._socketOptions)}_closeSocketConnection(e,t){var n;null===(n=this._socketConnection)||void 0===n||n.close(e,t)}_sendToSocket(e){var t;if("disconnected"===this.getStatus())throw new zo;null===(t=this._socketConnection)||void 0===t||t.send(JSON.stringify(e))}_parseResponses(e){return this.chunkResponseParser.parseResponse(e.data)}_addSocketListeners(){var e,t,n,r;null===(e=this._socketConnection)||void 0===e||e.addEventListener("open",this._onOpenHandler),null===(t=this._socketConnection)||void 0===t||t.addEventListener("message",this._onMessageHandler),null===(n=this._socketConnection)||void 0===n||n.addEventListener("close",e=>this._onCloseHandler(e)),null===(r=this._socketConnection)||void 0===r||r.addEventListener("error",this._onErrorHandler)}_removeSocketListeners(){var e,t,n;null===(e=this._socketConnection)||void 0===e||e.removeEventListener("message",this._onMessageHandler),null===(t=this._socketConnection)||void 0===t||t.removeEventListener("open",this._onOpenHandler),null===(n=this._socketConnection)||void 0===n||n.removeEventListener("close",this._onCloseHandler)}_onCloseEvent(e){var t;!this._reconnectOptions.autoReconnect||[1e3,1001].includes(e.code)&&e.wasClean?(this._clearQueues(e),this._removeSocketListeners(),this._onDisconnect(e.code,e.reason),null===(t=this._socketConnection)||void 0===t||t.removeEventListener("error",this._onErrorHandler)):this._reconnect()}}const Qp=e=>lo.isWeb3Provider(e),$p=e=>"string"!=typeof e&&"request"in e&&"Function"===e.request.constructor.name,Jp=e=>"string"!=typeof e&&"request"in e&&"AsyncFunction"===e.request.constructor.name,Yp=e=>"string"!=typeof e&&"send"in e,Xp=e=>"string"!=typeof e&&"sendAsync"in e,em=e=>e&&(Qp(e)||Jp(e)||$p(e)||Xp(e)||Yp(e));var tm,nm=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};!function(e){e.PROVIDER_CHANGED="PROVIDER_CHANGED",e.BEFORE_PROVIDER_CHANGE="BEFORE_PROVIDER_CHANGE"}(tm||(tm={}));const rm={HttpProvider:Vp,WebsocketProvider:Zp};class im extends Dp{constructor(e,t,n){super(),Rf(e)||this.setProvider(e),this.useRpcCallSpecification=t,Rf(n)||(this.middleware=n)}static get providers(){return rm}get provider(){return this._provider}get providers(){return rm}setProvider(e){let t;if(e&&"string"==typeof e&&this.providers)if(/^http(s)?:\/\//i.test(e))t=new this.providers.HttpProvider(e);else{if(!/^ws(s)?:\/\//i.test(e))throw new ss(`Can't autodetect provider for "${e}"`);t=new this.providers.WebsocketProvider(e)}else t=Rf(e)?void 0:e;return this.emit(tm.BEFORE_PROVIDER_CHANGE,this._provider),this._provider=t,this.emit(tm.PROVIDER_CHANGED,this._provider),!0}setMiddleware(e){this.middleware=e}send(e){return nm(this,void 0,void 0,function*(){const t=Object.assign({},e);let n=yield this._sendRequest(t);if(Rf(this.middleware)||(n=yield this.middleware.processResponse(n)),wp(n))return n.result;throw new lu(n)})}sendBatch(e){return nm(this,void 0,void 0,function*(){return yield this._sendRequest(e)})}_sendRequest(e){return nm(this,void 0,void 0,function*(){const{provider:t}=this;if(Rf(t))throw new ss("Provider not available. Use `.setProvider` or `.provider=` to initialize the provider.");let n=jp(e)?Ip(e):Mp(e);if(Rf(this.middleware)||(n=yield this.middleware.processRequest(n)),Qp(t)){let e;try{e=yield t.request(n)}catch(t){e=t}return this._processJsonRpcResponse(n,e,{legacy:!1,error:!1})}if(Jp(t))return t.request(n).then(e=>this._processJsonRpcResponse(n,e,{legacy:!0,error:!1})).catch(e=>this._processJsonRpcResponse(n,e,{legacy:!0,error:!0}));if($p(t))return new Promise((e,r)=>{const i=e=>{r(this._processJsonRpcResponse(n,e,{legacy:!0,error:!0}))},a=t=>e(this._processJsonRpcResponse(n,t,{legacy:!0,error:!1})),o=t.request(n,(e,t)=>e?i(e):a(t));hp(o)&&o.then(a).catch(e=>{try{const t=this._processJsonRpcResponse(n,e,{legacy:!0,error:!0});r(t)}catch(e){r(e)}})});if(Yp(t))return new Promise((e,r)=>{t.send(n,(t,i)=>{if(t)return r(this._processJsonRpcResponse(n,t,{legacy:!0,error:!0}));if(Rf(i))throw new lu({},'Got a "nullish" response from provider.');return e(this._processJsonRpcResponse(n,i,{legacy:!0,error:!1}))})});if(Xp(t))return t.sendAsync(n).then(e=>this._processJsonRpcResponse(n,e,{legacy:!0,error:!1})).catch(e=>this._processJsonRpcResponse(n,e,{legacy:!0,error:!0}));throw new ss("Provider does not have a request or send method to use.")})}_processJsonRpcResponse(e,t,{legacy:n,error:r}){if(Rf(t))return this._buildResponse(e,null,r);if(Ap(t)){if(this.useRpcCallSpecification&&vp(t)){const e=t;if(bu.get(e.error.code))throw new(0,bu.get(e.error.code).error)(e);throw new gu(e)}if(!im._isReverted(t))throw new du(t,e)}if(wp(t))return t;if(t instanceof Error)throw im._isReverted(t),t;if(!n&&jp(e)&&Ep(t))return t;if(n&&!r&&jp(e))return t;if(n&&r&&jp(e))throw t;if(n&&!Ap(t)&&!wp(t))return this._buildResponse(e,t,r);if(jp(e)&&!Array.isArray(t))throw new lu(t,"Got normal response for a batch request.");if(!jp(e)&&Array.isArray(t))throw new lu(t,"Got batch response for a normal request.");throw new lu(t,"Invalid response")}static _isReverted(e){let t;if(Ap(e)?t=e.error:e instanceof Error&&(t=e),null==t?void 0:t.message.includes("revert"))throw new $o(t);return!1}_buildResponse(e,t,n){const r={jsonrpc:"2.0",id:jp(e)?e[0].id:"id"in e?e.id:null};return n?Object.assign(Object.assign({},r),{error:t}):Object.assign(Object.assign({},r),{result:t})}}var am=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};class om{constructor(e,t,n=!1){this.requestManager=e,this.registeredSubscriptions=t,this.tolerateUnlinkedSubscription=n,this._subscriptions=new Map,this.requestManager.on(tm.BEFORE_PROVIDER_CHANGE,()=>am(this,void 0,void 0,function*(){yield this.unsubscribe()})),this.requestManager.on(tm.PROVIDER_CHANGED,()=>{this.clear(),this.listenToProviderEvents()}),this.listenToProviderEvents()}listenToProviderEvents(){const e=this.requestManager.provider;this.requestManager.provider&&("function"!=typeof(null==e?void 0:e.supportsSubscriptions)||(null==e?void 0:e.supportsSubscriptions()))&&"function"==typeof this.requestManager.provider.on&&("function"==typeof this.requestManager.provider.request?this.requestManager.provider.on("message",e=>this.messageListener(e)):e.on("data",e=>this.messageListener(e)))}messageListener(e){var t,n,r;if(!e)throw new cs("Should not call messageListener with no data. Type was");const i=(null===(t=e.params)||void 0===t?void 0:t.subscription)||(null===(n=e.data)||void 0===n?void 0:n.subscription)||(null===(r=e.id)||void 0===r?void 0:r.toString(16));if(i){const t=this._subscriptions.get(i);null==t||t.processSubscriptionData(e)}}subscribe(e,t){return am(this,arguments,void 0,function*(e,t,n=no){const r=this.registeredSubscriptions[e];if(!r)throw new cs("Invalid subscription type");const i=new r(null!=t?t:void 0,{subscriptionManager:this,returnFormat:n});return yield this.addSubscription(i),i})}get subscriptions(){return this._subscriptions}addSubscription(e){return am(this,void 0,void 0,function*(){if(!this.requestManager.provider)throw new ss("Provider not available");if(!this.supportsSubscriptions())throw new cs("The current provider does not support subscriptions");if(e.id&&this._subscriptions.has(e.id))throw new cs(`Subscription with id "${e.id}" already exists`);if(yield e.sendSubscriptionRequest(),Rf(e.id))throw new cs("Subscription is not subscribed yet.");return this._subscriptions.set(e.id,e),e.id})}removeSubscription(e){return am(this,void 0,void 0,function*(){const{id:t}=e;if(Rf(t))throw new cs("Subscription is not subscribed yet. Or, had already been unsubscribed but not through the Subscription Manager.");if(!this._subscriptions.has(t)&&!this.tolerateUnlinkedSubscription)throw new cs(`Subscription with id "${t.toString()}" does not exists`);return yield e.sendUnsubscribeRequest(),this._subscriptions.delete(t),t})}unsubscribe(e){return am(this,void 0,void 0,function*(){const t=[];for(const[n,r]of this.subscriptions.entries())(!e||"function"==typeof e&&e({id:n,sub:r}))&&t.push(this.removeSubscription(r));return Promise.all(t)})}clear(){this._subscriptions.clear()}supportsSubscriptions(){return!Rf(this.requestManager.provider)&&((e=this.requestManager.provider)&&"supportsSubscriptions"in e?e.supportsSubscriptions():!(!e||"string"==typeof e||!("on"in e)));var e}}var sm=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};class um extends Dp{constructor(e,t){var n;super(),this.args=e;const{requestManager:r}=t,{subscriptionManager:i}=t;this._subscriptionManager=r?new om(r,{},!0):i,this._returnFormat=null!==(n=null==t?void 0:t.returnFormat)&&void 0!==n?n:no}get id(){return this._id}get lastBlock(){return this._lastBlock}subscribe(){return sm(this,void 0,void 0,function*(){return this._subscriptionManager.addSubscription(this)})}processSubscriptionData(e){var t,n;(null==e?void 0:e.data)?this._processSubscriptionResult(null!==(n=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.result)&&void 0!==n?n:null==e?void 0:e.data):e&&xp(e)&&this._processSubscriptionResult(null==e?void 0:e.params.result)}sendSubscriptionRequest(){return sm(this,void 0,void 0,function*(){return this._id=yield this._subscriptionManager.requestManager.send({method:"eth_subscribe",params:this._buildSubscriptionParams()}),this.emit("connected",this._id),this._id})}get returnFormat(){return this._returnFormat}get subscriptionManager(){return this._subscriptionManager}resubscribe(){return sm(this,void 0,void 0,function*(){yield this.unsubscribe(),yield this.subscribe()})}unsubscribe(){return sm(this,void 0,void 0,function*(){this.id&&(yield this._subscriptionManager.removeSubscription(this))})}sendUnsubscribeRequest(){return sm(this,void 0,void 0,function*(){yield this._subscriptionManager.requestManager.send({method:"eth_unsubscribe",params:[this.id]}),this._id=void 0})}formatSubscriptionResult(e){return e}_processSubscriptionResult(e){this.emit("data",this.formatSubscriptionResult(e))}_processSubscriptionError(e){this.emit("error",e)}_buildSubscriptionParams(){throw new Error("Implement in the child class")}}var cm=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};class lm extends ho{constructor(){super(...arguments),this._addressMap=new Map,this._defaultKeyName="web3js_wallet"}static getStorage(){let e;try{e=window.localStorage;const t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch(t){return!t||22!==t.code&&1014!==t.code&&"QuotaExceededError"!==t.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==t.name||Bh(e)||0===e.length?void 0:e}}create(e){for(let t=0;t<e;t+=1)this.add(this._accountProvider.create());return this}add(e){var t;if("string"==typeof e)return this.add(this._accountProvider.privateKeyToAccount(e));let n=this.length;return this.get(e.address)&&(console.warn(`Account ${e.address.toLowerCase()} already exists.`),n=null!==(t=this._addressMap.get(e.address.toLowerCase()))&&void 0!==t?t:n),this._addressMap.set(e.address.toLowerCase(),n),this[n]=e,this}get(e){if("string"==typeof e){const t=this._addressMap.get(e.toLowerCase());return Bh(t)?void 0:this[t]}return this[e]}remove(e){if("string"==typeof e){const t=this._addressMap.get(e.toLowerCase());return!Bh(t)&&(this._addressMap.delete(e.toLowerCase()),this.splice(t,1),!0)}return!!this[e]&&(this.splice(e,1),!0)}clear(){return this._addressMap.clear(),this.length=0,this}encrypt(e,t){return cm(this,void 0,void 0,function*(){return Promise.all(this.map(n=>cm(this,void 0,void 0,function*(){return n.encrypt(e,t)})))})}decrypt(e,t,n){return cm(this,void 0,void 0,function*(){const r=yield Promise.all(e.map(e=>cm(this,void 0,void 0,function*(){return this._accountProvider.decrypt(e,t,n)})));for(const e of r)this.add(e);return this})}save(e,t){return cm(this,void 0,void 0,function*(){const n=lm.getStorage();if(!n)throw new Error("Local storage not available.");return n.setItem(null!=t?t:this._defaultKeyName,JSON.stringify(yield this.encrypt(e))),!0})}load(e,t){return cm(this,void 0,void 0,function*(){const n=lm.getStorage();if(!n)throw new Error("Local storage not available.");const r=n.getItem(null!=t?t:this._defaultKeyName);return r&&(yield this.decrypt(JSON.parse(r)||[],e)),this})}}const dm={web:Ru};function hm(e,t,n){if(!n.startsWith("aes-"))throw new Error(`AES submodule doesn't support mode ${n}`);if(16!==t.length)throw new Error("AES: wrong IV length");if(n.startsWith("aes-128")&&16!==e.length||n.startsWith("aes-256")&&32!==e.length)throw new Error("AES: wrong key length")}async function fm(e,t,n){if(!dm.web)throw new Error("Browser crypto not available.");let r;if(["aes-128-cbc","aes-256-cbc"].includes(e)&&(r="cbc"),["aes-128-ctr","aes-256-ctr"].includes(e)&&(r="ctr"),!r)throw new Error("AES: unsupported mode");return[await dm.web.subtle.importKey("raw",t,{name:`AES-${r.toUpperCase()}`,length:8*t.length},!0,["encrypt","decrypt"]),{name:`aes-${r}`,iv:n,counter:n,length:128}]}async function pm(e,t,n,r="aes-128-ctr",i=!0){if(hm(t,n,r),dm.web){const[a,o]=await fm(r,t,n),s=await dm.web.subtle.encrypt(o,a,e);let u=new Uint8Array(s);return i||"aes-cbc"!==o.name||e.length%16||(u=u.slice(0,-16)),u}if(dm.node){const a=dm.node.createCipheriv(r,t,n);return a.setAutoPadding(i),Vu(a.update(e),a.final())}throw new Error("The environment doesn't have AES module")}class mm extends Wu{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,xu(e);const n=Gu(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),i.fill(0)}update(e){return ku(this),this.iHash.update(e),this}digestInto(e){ku(this),Au(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const gm=(e,t,n)=>new mm(e,t).update(n).digest();function ym(e,t,n,r){const{c:i,dkLen:a,DK:o,PRF:s,PRFSalt:u}=function(e,t,n,r){xu(e);const i=Zu({dkLen:32,asyncTick:10},r),{c:a,dkLen:o,asyncTick:s}=i;if(wu(a),wu(o),wu(s),a<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const u=Gu(t),c=Gu(n),l=new Uint8Array(o),d=gm.create(e,u),h=d._cloneInto().update(c);return{c:a,dkLen:o,asyncTick:s,DK:l,PRF:d,PRFSalt:h}}(e,t,n,r);let c;const l=new Uint8Array(4),d=Fu(l),h=new Uint8Array(s.outputLen);for(let e=1,t=0;t<a;e++,t+=s.outputLen){const n=o.subarray(t,t+s.outputLen);d.setInt32(0,e,!1),(c=u._cloneInto(c)).update(l).digestInto(h),n.set(h.subarray(0,n.length));for(let e=1;e<i;e++){s._cloneInto(c).update(h).digestInto(h);for(let e=0;e<n.length;e++)n[e]^=h[e]}}return function(e,t,n,r,i){return e.destroy(),t.destroy(),r&&r.destroy(),i.fill(0),n}(s,u,o,c,h)}gm.create=(e,t)=>new mm(e,t);const bm=(e,t,n)=>e&t^~e&n,vm=(e,t,n)=>e&t^e&n^t&n;class wm extends Wu{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Fu(this.buffer)}update(e){ku(this);const{view:t,buffer:n,blockLen:r}=this,i=(e=Gu(e)).length;for(let a=0;a<i;){const o=Math.min(r-this.pos,i-a);if(o===r){const t=Fu(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){ku(this),_u(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:i}=this;let{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;!function(e,t,n,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),u=r?4:0,c=r?0:4;e.setUint32(t+u,o,r),e.setUint32(t+c,s,r)}(n,r-8,BigInt(8*this.length),i),this.process(n,0);const o=Fu(e),s=this.outputLen;if(s%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=s/4,c=this.get();if(u>c.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<u;e++)o.setUint32(4*e,c[e],i)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.length=r,e.pos=o,e.finished=i,e.destroyed=a,r%t&&e.buffer.set(n),e}}const Am=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),xm=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),km=new Uint32Array(64);class _m extends wm{constructor(){super(64,32,8,!1),this.A=0|xm[0],this.B=0|xm[1],this.C=0|xm[2],this.D=0|xm[3],this.E=0|xm[4],this.F=0|xm[5],this.G=0|xm[6],this.H=0|xm[7]}get(){const{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|i,this.F=0|a,this.G=0|o,this.H=0|s}process(e,t){for(let n=0;n<16;n++,t+=4)km[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=km[e-15],n=km[e-2],r=Lu(t,7)^Lu(t,18)^t>>>3,i=Lu(n,17)^Lu(n,19)^n>>>10;km[e]=i+km[e-7]+r+km[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:u,H:c}=this;for(let e=0;e<64;e++){const t=c+(Lu(o,6)^Lu(o,11)^Lu(o,25))+bm(o,s,u)+Am[e]+km[e]|0,l=(Lu(n,2)^Lu(n,13)^Lu(n,22))+vm(n,r,i)|0;c=u,u=s,s=o,o=a+t|0,a=i,i=r,r=n,n=t+l|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(n,r,i,a,o,s,u,c)}roundClean(){km.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Pm=Qu(()=>new _m),[Em,Sm]=(()=>Ou.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),Tm=new Uint32Array(80),Mm=new Uint32Array(80);class Im extends wm{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:u,El:c,Fh:l,Fl:d,Gh:h,Gl:f,Hh:p,Hl:m}=this;return[e,t,n,r,i,a,o,s,u,c,l,d,h,f,p,m]}set(e,t,n,r,i,a,o,s,u,c,l,d,h,f,p,m){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|a,this.Dh=0|o,this.Dl=0|s,this.Eh=0|u,this.El=0|c,this.Fh=0|l,this.Fl=0|d,this.Gh=0|h,this.Gl=0|f,this.Hh=0|p,this.Hl=0|m}process(e,t){for(let n=0;n<16;n++,t+=4)Tm[n]=e.getUint32(t),Mm[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|Tm[e-15],n=0|Mm[e-15],r=Ou.rotrSH(t,n,1)^Ou.rotrSH(t,n,8)^Ou.shrSH(t,n,7),i=Ou.rotrSL(t,n,1)^Ou.rotrSL(t,n,8)^Ou.shrSL(t,n,7),a=0|Tm[e-2],o=0|Mm[e-2],s=Ou.rotrSH(a,o,19)^Ou.rotrBH(a,o,61)^Ou.shrSH(a,o,6),u=Ou.rotrSL(a,o,19)^Ou.rotrBL(a,o,61)^Ou.shrSL(a,o,6),c=Ou.add4L(i,u,Mm[e-7],Mm[e-16]),l=Ou.add4H(c,r,s,Tm[e-7],Tm[e-16]);Tm[e]=0|l,Mm[e]=0|c}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:u,Dl:c,Eh:l,El:d,Fh:h,Fl:f,Gh:p,Gl:m,Hh:g,Hl:y}=this;for(let e=0;e<80;e++){const t=Ou.rotrSH(l,d,14)^Ou.rotrSH(l,d,18)^Ou.rotrBH(l,d,41),b=Ou.rotrSL(l,d,14)^Ou.rotrSL(l,d,18)^Ou.rotrBL(l,d,41),v=l&h^~l&p,w=d&f^~d&m,A=Ou.add5L(y,b,w,Sm[e],Mm[e]),x=Ou.add5H(A,g,t,v,Em[e],Tm[e]),k=0|A,_=Ou.rotrSH(n,r,28)^Ou.rotrBH(n,r,34)^Ou.rotrBH(n,r,39),P=Ou.rotrSL(n,r,28)^Ou.rotrBL(n,r,34)^Ou.rotrBL(n,r,39),E=n&i^n&o^i&o,S=r&a^r&s^a&s;g=0|p,y=0|m,p=0|h,m=0|f,h=0|l,f=0|d,({h:l,l:d}=Ou.add(0|u,0|c,0|x,0|k)),u=0|o,c=0|s,o=0|i,s=0|a,i=0|n,a=0|r;const T=Ou.add3L(k,P,S);n=Ou.add3H(T,x,_,E),r=0|T}({h:n,l:r}=Ou.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l:a}=Ou.add(0|this.Bh,0|this.Bl,0|i,0|a)),({h:o,l:s}=Ou.add(0|this.Ch,0|this.Cl,0|o,0|s)),({h:u,l:c}=Ou.add(0|this.Dh,0|this.Dl,0|u,0|c)),({h:l,l:d}=Ou.add(0|this.Eh,0|this.El,0|l,0|d)),({h,l:f}=Ou.add(0|this.Fh,0|this.Fl,0|h,0|f)),({h:p,l:m}=Ou.add(0|this.Gh,0|this.Gl,0|p,0|m)),({h:g,l:y}=Ou.add(0|this.Hh,0|this.Hl,0|g,0|y)),this.set(n,r,i,a,o,s,u,c,l,d,h,f,p,m,g,y)}roundClean(){Tm.fill(0),Mm.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const jm=Qu(()=>new Im);function Cm(e,t,n,r,i){if(!["sha256","sha512"].includes(i))throw new Error("Only sha256 and sha512 are supported");return gc(e),gc(t),ym("sha256"===i?Pm:jm,e,t,{c:n,dkLen:r})}function Bm(e,t,n,r,i,a){let o=e[t++]^n[r++],s=e[t++]^n[r++],u=e[t++]^n[r++],c=e[t++]^n[r++],l=e[t++]^n[r++],d=e[t++]^n[r++],h=e[t++]^n[r++],f=e[t++]^n[r++],p=e[t++]^n[r++],m=e[t++]^n[r++],g=e[t++]^n[r++],y=e[t++]^n[r++],b=e[t++]^n[r++],v=e[t++]^n[r++],w=e[t++]^n[r++],A=e[t++]^n[r++],x=o,k=s,_=u,P=c,E=l,S=d,T=h,M=f,I=p,j=m,C=g,B=y,O=b,R=v,N=w,F=A;for(let e=0;e<8;e+=2)E^=Hu(x+O|0,7),I^=Hu(E+x|0,9),O^=Hu(I+E|0,13),x^=Hu(O+I|0,18),j^=Hu(S+k|0,7),R^=Hu(j+S|0,9),k^=Hu(R+j|0,13),S^=Hu(k+R|0,18),N^=Hu(C+T|0,7),_^=Hu(N+C|0,9),T^=Hu(_+N|0,13),C^=Hu(T+_|0,18),P^=Hu(F+B|0,7),M^=Hu(P+F|0,9),B^=Hu(M+P|0,13),F^=Hu(B+M|0,18),k^=Hu(x+P|0,7),_^=Hu(k+x|0,9),P^=Hu(_+k|0,13),x^=Hu(P+_|0,18),T^=Hu(S+E|0,7),M^=Hu(T+S|0,9),E^=Hu(M+T|0,13),S^=Hu(E+M|0,18),B^=Hu(C+j|0,7),I^=Hu(B+C|0,9),j^=Hu(I+B|0,13),C^=Hu(j+I|0,18),O^=Hu(F+N|0,7),R^=Hu(O+F|0,9),N^=Hu(R+O|0,13),F^=Hu(N+R|0,18);i[a++]=o+x|0,i[a++]=s+k|0,i[a++]=u+_|0,i[a++]=c+P|0,i[a++]=l+E|0,i[a++]=d+S|0,i[a++]=h+T|0,i[a++]=f+M|0,i[a++]=p+I|0,i[a++]=m+j|0,i[a++]=g+C|0,i[a++]=y+B|0,i[a++]=b+O|0,i[a++]=v+R|0,i[a++]=w+N|0,i[a++]=A+F|0}function Om(e,t,n,r,i){let a=r+0,o=r+16*i;for(let r=0;r<16;r++)n[o+r]=e[t+16*(2*i-1)+r];for(let r=0;r<i;r++,a+=16,t+=16)Bm(n,o,e,t,n,a),r>0&&(o+=16),Bm(n,a,e,t+=16,n,o)}function Rm(e,t,n,r,i,a,o){return gc(e),gc(t),function(e,t,n){const{N:r,r:i,p:a,dkLen:o,blockSize32:s,V:u,B32:c,B:l,tmp:d,blockMixCb:h}=function(e,t,n){const r=Zu({dkLen:32,asyncTick:10,maxmem:1073742848},n),{N:i,r:a,p:o,dkLen:s,asyncTick:u,maxmem:c,onProgress:l}=r;if(wu(i),wu(a),wu(o),wu(s),wu(u),wu(c),void 0!==l&&"function"!=typeof l)throw new Error("progressCb should be function");const d=128*a,h=d/4;if(i<=1||i&i-1||i>=2**(d/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>137438953440/d)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(s<0||s>137438953440)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const f=d*(i+o);if(f>c)throw new Error(`Scrypt: parameters too large, ${f} (128 * r * (N + p)) > ${c} (maxmem)`);const p=ym(Pm,e,t,{c:1,dkLen:d*o}),m=Nu(p),g=Nu(new Uint8Array(d*i)),y=Nu(new Uint8Array(d));let b=()=>{};if(l){const e=2*i*o,t=Math.max(Math.floor(e/1e4),1);let n=0;b=()=>{n++,!l||n%t&&n!==e||l(n/e)}}return{N:i,r:a,p:o,dkLen:s,blockSize32:h,V:g,B32:m,B:p,tmp:y,blockMixCb:b,asyncTick:u}}(e,t,n);qu||Uu(c);for(let e=0;e<a;e++){const t=s*e;for(let e=0;e<s;e++)u[e]=c[t+e];for(let e=0,t=0;e<r-1;e++)Om(u,t,u,t+=s,i),h();Om(u,(r-1)*s,c,t,i),h();for(let e=0;e<r;e++){const e=c[t+s-16]%r;for(let n=0;n<s;n++)d[n]=c[t+n]^u[e*s+n];Om(d,0,c,t,i),h()}}return qu||Uu(c),function(e,t,n,r,i){const a=ym(Pm,e,n,{c:1,dkLen:t});return n.fill(0),r.fill(0),i.fill(0),a}(e,o,l,u,d)}(e,t,{N:n,r:i,p:r,dkLen:a,onProgress:o})}const Nm=BigInt(1),Fm=BigInt(2);function Lm(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function Hm(e){if(!Lm(e))throw new Error("Uint8Array expected")}const qm=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Dm(e){Hm(e);let t="";for(let n=0;n<e.length;n++)t+=qm[e[n]];return t}function Um(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}const zm={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function Gm(e){return e>=zm._0&&e<=zm._9?e-zm._0:e>=zm._A&&e<=zm._F?e-(zm._A-10):e>=zm._a&&e<=zm._f?e-(zm._a-10):void 0}function Vm(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){const n=Gm(e.charCodeAt(i)),a=Gm(e.charCodeAt(i+1));if(void 0===n||void 0===a){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}r[t]=16*n+a}return r}function Wm(e){return Um(Dm(e))}function Km(e){return Hm(e),Um(Dm(Uint8Array.from(e).reverse()))}function Zm(e,t){return Vm(e.toString(16).padStart(2*t,"0"))}function Qm(e,t){return Zm(e,t).reverse()}function $m(e,t,n){let r;if("string"==typeof t)try{r=Vm(t)}catch(n){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${n}`)}else{if(!Lm(t))throw new Error(`${e} must be hex string or Uint8Array`);r=Uint8Array.from(t)}const i=r.length;if("number"==typeof n&&i!==n)throw new Error(`${e} expected ${n} bytes, got ${i}`);return r}function Jm(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];Hm(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n}const Ym=e=>(Fm<<BigInt(e-1))-Nm,Xm=e=>new Uint8Array(e),eg=e=>Uint8Array.from(e);function tg(e,t,n){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");let r=Xm(e),i=Xm(e),a=0;const o=()=>{r.fill(1),i.fill(0),a=0},s=(...e)=>n(i,r,...e),u=(e=Xm())=>{i=s(eg([0]),e),r=s(),0!==e.length&&(i=s(eg([1]),e),r=s())},c=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e<t;){r=s();const t=r.slice();n.push(t),e+=r.length}return Jm(...n)};return(e,t)=>{let n;for(o(),u(e);!(n=t(c()));)u();return o(),n}}const ng={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||Lm(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function rg(e,t,n={}){const r=(t,n,r)=>{const i=ng[n];if("function"!=typeof i)throw new Error(`Invalid validator "${n}", expected function`);const a=e[t];if(!(r&&void 0===a||i(a,e)))throw new Error(`Invalid param ${String(t)}=${a} (${typeof a}), expected ${n}`)};for(const[e,n]of Object.entries(t))r(e,n,!1);for(const[e,t]of Object.entries(n))r(e,t,!0);return e}const ig=BigInt(0),ag=BigInt(1),og=BigInt(2),sg=BigInt(3),ug=BigInt(4),cg=BigInt(5),lg=BigInt(8);function dg(e,t){const n=e%t;return n>=ig?n:t+n}function hg(e,t,n){if(n<=ig||t<ig)throw new Error("Expected power/modulo > 0");if(n===ag)return ig;let r=ag;for(;t>ig;)t&ag&&(r=r*e%n),e=e*e%n,t>>=ag;return r}function fg(e,t,n){let r=e;for(;t-- >ig;)r*=r,r%=n;return r}function pg(e,t){if(e===ig||t<=ig)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=dg(e,t),r=t,i=ig,a=ag,o=ag,s=ig;for(;n!==ig;){const e=r/n,t=r%n,u=i-o*e,c=a-s*e;r=n,n=t,i=o,a=s,o=u,s=c}if(r!==ag)throw new Error("invert: does not exist");return dg(i,t)}BigInt(9),BigInt(16);const mg=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function gg(e,t){const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function yg(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function bg(e){const t=yg(e);return t+Math.ceil(t/2)}const vg=BigInt(0),wg=BigInt(1);function Ag(e){return rg(e.Fp,mg.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),rg(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...gg(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const{Ph:xg,aT:kg}=u,_g={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:t}=_g;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(128&r[0])throw new t("Invalid signature integer: negative");if(0===r[0]&&!(128&r[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:xg(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=_g,n="string"==typeof e?kg(e):e;Hm(n);let r=n.length;if(r<2||48!=n[0])throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:i,l:a}=_g._parseInt(n.subarray(2)),{d:o,l:s}=_g._parseInt(a);if(s.length)throw new t("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,n=e=>{const t=e.toString(16);return 1&t.length?`0${t}`:t},r=t(n(e.s)),i=t(n(e.r)),a=r.length/2,o=i.length/2,s=n(a),u=n(o);return`30${n(o+a+4)}02${u}${i}02${s}${r}`}},Pg=BigInt(0),Eg=BigInt(1),Sg=(BigInt(2),BigInt(3));function Tg(e){const t=function(e){const t=Ag(e);return rg(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:n,n:r}=t,i=n.BYTES+1,a=2*n.BYTES+1;function o(e){return dg(e,r)}function s(e){return pg(e,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:l,isWithinCurveOrder:d}=function(e){const t=function(e){const t=Ag(e);rg(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=t;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof n||"bigint"!=typeof n.beta||"function"!=typeof n.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:n}=t,r=t.toBytes||((e,t,r)=>{const i=t.toAffine();return Jm(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),i=t.fromBytes||(e=>{const t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function a(e){const{a:r,b:i}=t,a=n.sqr(e),o=n.mul(a,e);return n.add(n.add(o,n.mul(e,r)),i)}if(!n.eql(n.sqr(t.Gy),a(t.Gx)))throw new Error("bad generator point: equation left != right");function o(e){return"bigint"==typeof e&&Pg<e&&e<t.n}function s(e){if(!o(e))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function u(e){const{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:i,n:a}=t;if(n&&"bigint"!=typeof e){if(Lm(e)&&(e=Dm(e)),"string"!=typeof e||!n.includes(e.length))throw new Error("Invalid key");e=e.padStart(2*r,"0")}let o;try{o="bigint"==typeof e?e:Wm($m("private key",e,r))}catch(t){throw new Error(`private key must be ${r} bytes, hex or bigint, not ${typeof e}`)}return i&&(o=dg(o,a)),s(o),o}const c=new Map;function l(e){if(!(e instanceof d))throw new Error("ProjectivePoint expected")}class d{constructor(e,t,r){if(this.px=e,this.py=t,this.pz=r,null==e||!n.isValid(e))throw new Error("x required");if(null==t||!n.isValid(t))throw new Error("y required");if(null==r||!n.isValid(r))throw new Error("z required")}static fromAffine(e){const{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw new Error("invalid affine point");if(e instanceof d)throw new Error("projective point not allowed");const i=e=>n.eql(e,n.ZERO);return i(t)&&i(r)?d.ZERO:new d(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=n.invertBatch(e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(d.fromAffine)}static fromHex(e){const t=d.fromAffine(i($m("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return d.BASE.multiply(u(e))}_setWindowSize(e){this._WINDOW_SIZE=e,c.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:r}=this.toAffine();if(!n.isValid(e)||!n.isValid(r))throw new Error("bad point: x or y not FE");const i=n.sqr(r),o=a(e);if(!n.eql(i,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:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){l(e);const{px:t,py:r,pz:i}=this,{px:a,py:o,pz:s}=e,u=n.eql(n.mul(t,s),n.mul(a,i)),c=n.eql(n.mul(r,s),n.mul(o,i));return u&&c}negate(){return new d(this.px,n.neg(this.py),this.pz)}double(){const{a:e,b:r}=t,i=n.mul(r,Sg),{px:a,py:o,pz:s}=this;let u=n.ZERO,c=n.ZERO,l=n.ZERO,h=n.mul(a,a),f=n.mul(o,o),p=n.mul(s,s),m=n.mul(a,o);return m=n.add(m,m),l=n.mul(a,s),l=n.add(l,l),u=n.mul(e,l),c=n.mul(i,p),c=n.add(u,c),u=n.sub(f,c),c=n.add(f,c),c=n.mul(u,c),u=n.mul(m,u),l=n.mul(i,l),p=n.mul(e,p),m=n.sub(h,p),m=n.mul(e,m),m=n.add(m,l),l=n.add(h,h),h=n.add(l,h),h=n.add(h,p),h=n.mul(h,m),c=n.add(c,h),p=n.mul(o,s),p=n.add(p,p),h=n.mul(p,m),u=n.sub(u,h),l=n.mul(p,f),l=n.add(l,l),l=n.add(l,l),new d(u,c,l)}add(e){l(e);const{px:r,py:i,pz:a}=this,{px:o,py:s,pz:u}=e;let c=n.ZERO,h=n.ZERO,f=n.ZERO;const p=t.a,m=n.mul(t.b,Sg);let g=n.mul(r,o),y=n.mul(i,s),b=n.mul(a,u),v=n.add(r,i),w=n.add(o,s);v=n.mul(v,w),w=n.add(g,y),v=n.sub(v,w),w=n.add(r,a);let A=n.add(o,u);return w=n.mul(w,A),A=n.add(g,b),w=n.sub(w,A),A=n.add(i,a),c=n.add(s,u),A=n.mul(A,c),c=n.add(y,b),A=n.sub(A,c),f=n.mul(p,w),c=n.mul(m,b),f=n.add(c,f),c=n.sub(y,f),f=n.add(y,f),h=n.mul(c,f),y=n.add(g,g),y=n.add(y,g),b=n.mul(p,b),w=n.mul(m,w),y=n.add(y,b),b=n.sub(g,b),b=n.mul(p,b),w=n.add(w,b),g=n.mul(y,w),h=n.add(h,g),g=n.mul(A,w),c=n.mul(v,c),c=n.sub(c,g),g=n.mul(v,y),f=n.mul(A,f),f=n.add(f,g),new d(c,h,f)}subtract(e){return this.add(e.negate())}is0(){return this.equals(d.ZERO)}wNAF(e){return f.wNAFCached(this,c,e,e=>{const t=n.invertBatch(e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(d.fromAffine)})}multiplyUnsafe(e){const r=d.ZERO;if(e===Pg)return r;if(s(e),e===Eg)return this;const{endo:i}=t;if(!i)return f.unsafeLadder(this,e);let{k1neg:a,k1:o,k2neg:u,k2:c}=i.splitScalar(e),l=r,h=r,p=this;for(;o>Pg||c>Pg;)o&Eg&&(l=l.add(p)),c&Eg&&(h=h.add(p)),p=p.double(),o>>=Eg,c>>=Eg;return a&&(l=l.negate()),u&&(h=h.negate()),h=new d(n.mul(h.px,i.beta),h.py,h.pz),l.add(h)}multiply(e){s(e);let r,i,a=e;const{endo:o}=t;if(o){const{k1neg:e,k1:t,k2neg:s,k2:u}=o.splitScalar(a);let{p:c,f:l}=this.wNAF(t),{p:h,f:p}=this.wNAF(u);c=f.constTimeNegate(e,c),h=f.constTimeNegate(s,h),h=new d(n.mul(h.px,o.beta),h.py,h.pz),r=c.add(h),i=l.add(p)}else{const{p:e,f:t}=this.wNAF(a);r=e,i=t}return d.normalizeZ([r,i])[0]}multiplyAndAddUnsafe(e,t,n){const r=d.BASE,i=(e,t)=>t!==Pg&&t!==Eg&&e.equals(r)?e.multiply(t):e.multiplyUnsafe(t),a=i(this,t).add(i(e,n));return a.is0()?void 0:a}toAffine(e){const{px:t,py:r,pz:i}=this,a=this.is0();null==e&&(e=a?n.ONE:n.inv(i));const o=n.mul(t,e),s=n.mul(r,e),u=n.mul(i,e);if(a)return{x:n.ZERO,y:n.ZERO};if(!n.eql(u,n.ONE))throw new Error("invZ was invalid");return{x:o,y:s}}isTorsionFree(){const{h:e,isTorsionFree:n}=t;if(e===Eg)return!0;if(n)return n(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:n}=t;return e===Eg?this:n?n(d,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),r(d,this,e)}toHex(e=!0){return Dm(this.toRawBytes(e))}}d.BASE=new d(t.Gx,t.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);const h=t.nBitLength,f=function(e,t){const n=(e,t)=>{const n=t.negate();return e?n:t},r=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:n,unsafeLadder(t,n){let r=e.ZERO,i=t;for(;n>vg;)n&wg&&(r=r.add(i)),i=i.double(),n>>=wg;return r},precomputeWindow(e,t){const{windows:n,windowSize:i}=r(t),a=[];let o=e,s=o;for(let e=0;e<n;e++){s=o,a.push(s);for(let e=1;e<i;e++)s=s.add(o),a.push(s);o=s.double()}return a},wNAF(t,i,a){const{windows:o,windowSize:s}=r(t);let u=e.ZERO,c=e.BASE;const l=BigInt(2**t-1),d=2**t,h=BigInt(t);for(let e=0;e<o;e++){const t=e*s;let r=Number(a&l);a>>=h,r>s&&(r-=d,a+=wg);const o=t,f=t+Math.abs(r)-1,p=e%2!=0,m=r<0;0===r?c=c.add(n(p,i[o])):u=u.add(n(m,i[f]))}return{p:u,f:c}},wNAFCached(e,t,n,r){const i=e._WINDOW_SIZE||1;let a=t.get(e);return a||(a=this.precomputeWindow(e,i),1!==i&&t.set(e,r(a))),this.wNAF(i,a,n)}}}(d,t.endo?Math.ceil(h/2):h);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:u,weierstrassEquation:a,isWithinCurveOrder:o}}({...t,toBytes(e,t,r){const i=t.toAffine(),a=n.toBytes(i.x),o=Jm;return r?o(Uint8Array.from([t.hasEvenY()?2:3]),a):o(Uint8Array.from([4]),a,n.toBytes(i.y))},fromBytes(e){const t=e.length,r=e[0],o=e.subarray(1);if(t!==i||2!==r&&3!==r){if(t===a&&4===r)return{x:n.fromBytes(o.subarray(0,n.BYTES)),y:n.fromBytes(o.subarray(n.BYTES,2*n.BYTES))};throw new Error(`Point of length ${t} was invalid. Expected ${i} compressed bytes or ${a} uncompressed bytes`)}{const e=Wm(o);if(!(Pg<(s=e)&&s<n.ORDER))throw new Error("Point is not on curve");const t=l(e);let i;try{i=n.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("Point is not on curve"+t)}return!(1&~r)!=((i&Eg)===Eg)&&(i=n.neg(i)),{x:e,y:i}}var s}}),h=e=>Dm(Zm(e,t.nByteLength));function f(e){return e>r>>Eg}const p=(e,t,n)=>Wm(e.slice(t,n));class m{constructor(e,t,n){this.r=e,this.s=t,this.recovery=n,this.assertValidity()}static fromCompact(e){const n=t.nByteLength;return e=$m("compactSignature",e,2*n),new m(p(e,0,n),p(e,n,2*n))}static fromDER(e){const{r:t,s:n}=_g.toSig($m("DER",e));return new m(t,n)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new m(this.r,this.s,e)}recoverPublicKey(e){const{r,s:i,recovery:a}=this,c=v($m("msgHash",e));if(null==a||![0,1,2,3].includes(a))throw new Error("recovery id invalid");const l=2===a||3===a?r+t.n:r;if(l>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const d=1&a?"03":"02",f=u.fromHex(d+h(l)),p=s(l),m=o(-c*p),g=o(i*p),y=u.BASE.multiplyAndAddUnsafe(f,m,g);if(!y)throw new Error("point at infinify");return y.assertValidity(),y}hasHighS(){return f(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return Vm(this.toDERHex())}toDERHex(){return _g.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Vm(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const g={isValidPrivateKey(e){try{return c(e),!0}catch(e){return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const e=bg(t.n);return function(e,t,n=!1){const r=e.length,i=yg(t),a=bg(t);if(r<16||r<a||r>1024)throw new Error(`expected ${a}-1024 bytes of input, got ${r}`);const o=dg(n?Wm(e):Km(e),t-ag)+ag;return n?Qm(o,i):Zm(o,i)}(t.randomBytes(e),t.n)},precompute:(e=8,t=u.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function y(e){const t=Lm(e),n="string"==typeof e,r=(t||n)&&e.length;return t?r===i||r===a:n?r===2*i||r===2*a:e instanceof u}const b=t.bits2int||function(e){const n=Wm(e),r=8*e.length-t.nBitLength;return r>0?n>>BigInt(r):n},v=t.bits2int_modN||function(e){return o(b(e))},w=Ym(t.nBitLength);function A(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(Pg<=e&&e<w))throw new Error(`bigint expected < 2^${t.nBitLength}`);return Zm(e,t.nByteLength)}const x={lowS:t.lowS,prehash:!1},k={lowS:t.lowS,prehash:!1};return u.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return u.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,n=!0){if(y(e))throw new Error("first arg must be private key");if(!y(t))throw new Error("second arg must be public key");return u.fromHex(t).multiply(c(e)).toRawBytes(n)},sign:function(e,r,i=x){const{seed:a,k2sig:l}=function(e,r,i=x){if(["recovered","canonical"].some(e=>e in i))throw new Error("sign() legacy options not supported");const{hash:a,randomBytes:l}=t;let{lowS:h,prehash:p,extraEntropy:g}=i;null==h&&(h=!0),e=$m("msgHash",e),p&&(e=$m("prehashed msgHash",a(e)));const y=v(e),w=c(r),k=[A(w),A(y)];if(null!=g&&!1!==g){const e=!0===g?l(n.BYTES):g;k.push($m("extraEntropy",e))}const _=Jm(...k),P=y;return{seed:_,k2sig:function(e){const t=b(e);if(!d(t))return;const n=s(t),r=u.BASE.multiply(t).toAffine(),i=o(r.x);if(i===Pg)return;const a=o(n*o(P+i*w));if(a===Pg)return;let c=(r.x===i?0:2)|Number(r.y&Eg),l=a;return h&&f(a)&&(l=function(e){return f(e)?o(-e):e}(a),c^=1),new m(i,l,c)}}}(e,r,i),h=t;return tg(h.hash.outputLen,h.nByteLength,h.hmac)(a,l)},verify:function(e,n,r,i=k){const a=e;if(n=$m("msgHash",n),r=$m("publicKey",r),"strict"in i)throw new Error("options.strict was renamed to lowS");const{lowS:c,prehash:l}=i;let d,h;try{if("string"==typeof a||Lm(a))try{d=m.fromDER(a)}catch(e){if(!(e instanceof _g.Err))throw e;d=m.fromCompact(a)}else{if("object"!=typeof a||"bigint"!=typeof a.r||"bigint"!=typeof a.s)throw new Error("PARSE");{const{r:e,s:t}=a;d=new m(e,t)}}h=u.fromHex(r)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(c&&d.hasHighS())return!1;l&&(n=t.hash(n));const{r:f,s:p}=d,g=v(n),y=s(p),b=o(g*y),w=o(f*y),A=u.BASE.multiplyAndAddUnsafe(h,b,w)?.toAffine();return!!A&&o(A.x)===f},ProjectivePoint:u,Signature:m,utils:g}}function Mg(e){return{hash:e,hmac:(t,...n)=>gm(e,t,Vu(...n)),randomBytes:$u}}BigInt(4);const Ig=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),jg=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Cg=BigInt(1),Bg=BigInt(2),Og=(e,t)=>(e+t/Bg)/t;const Rg=function(e,t,n=!1,r={}){if(e<=ig)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:i,nByteLength:a}=gg(e,t);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=function(e){if(e%ug===sg){const t=(e+ag)/ug;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}if(e%lg===cg){const t=(e-cg)/lg;return function(e,n){const r=e.mul(n,og),i=e.pow(r,t),a=e.mul(n,i),o=e.mul(e.mul(a,og),i),s=e.mul(a,e.sub(o,e.ONE));if(!e.eql(e.sqr(s),n))throw new Error("Cannot find square root");return s}}return function(e){const t=(e-ag)/og;let n,r,i;for(n=e-ag,r=0;n%og===ig;n/=og,r++);for(i=og;i<e&&hg(i,t,e)!==e-ag;i++);if(1===r){const t=(e+ag)/ug;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}const a=(n+ag)/og;return function(e,o){if(e.pow(o,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let s=r,u=e.pow(e.mul(e.ONE,i),n),c=e.pow(o,a),l=e.pow(o,n);for(;!e.eql(l,e.ONE);){if(e.eql(l,e.ZERO))return e.ZERO;let t=1;for(let n=e.sqr(l);t<s&&!e.eql(n,e.ONE);t++)n=e.sqr(n);const n=e.pow(u,ag<<BigInt(s-t-1));u=e.sqr(n),c=e.mul(c,n),l=e.mul(l,u),s=t}return c}}(e)}(e),s=Object.freeze({ORDER:e,BITS:i,BYTES:a,MASK:Ym(i),ZERO:ig,ONE:ag,create:t=>dg(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("Invalid field element: expected bigint, got "+typeof t);return ig<=t&&t<e},is0:e=>e===ig,isOdd:e=>(e&ag)===ag,neg:t=>dg(-t,e),eql:(e,t)=>e===t,sqr:t=>dg(t*t,e),add:(t,n)=>dg(t+n,e),sub:(t,n)=>dg(t-n,e),mul:(t,n)=>dg(t*n,e),pow:(e,t)=>function(e,t,n){if(n<ig)throw new Error("Expected power > 0");if(n===ig)return e.ONE;if(n===ag)return t;let r=e.ONE,i=t;for(;n>ig;)n&ag&&(r=e.mul(r,i)),i=e.sqr(i),n>>=ag;return r}(s,e,t),div:(t,n)=>dg(t*pg(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>pg(t,e),sqrt:r.sqrt||(e=>o(s,e)),invertBatch:e=>function(e,t){const n=new Array(t.length),r=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),i=e.inv(r);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),i),n}(s,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?Qm(e,a):Zm(e,a),fromBytes:e=>{if(e.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${e.length}`);return n?Km(e):Wm(e)}});return Object.freeze(s)}(Ig,void 0,void 0,{sqrt:function(e){const t=Ig,n=BigInt(3),r=BigInt(6),i=BigInt(11),a=BigInt(22),o=BigInt(23),s=BigInt(44),u=BigInt(88),c=e*e*e%t,l=c*c*e%t,d=fg(l,n,t)*l%t,h=fg(d,n,t)*l%t,f=fg(h,Bg,t)*c%t,p=fg(f,i,t)*f%t,m=fg(p,a,t)*p%t,g=fg(m,s,t)*m%t,y=fg(g,u,t)*g%t,b=fg(y,s,t)*m%t,v=fg(b,n,t)*l%t,w=fg(v,o,t)*p%t,A=fg(w,r,t)*c%t,x=fg(A,Bg,t);if(!Rg.eql(Rg.sqr(x),e))throw new Error("Cannot find square root");return x}}),Ng=function(e,t){const n=t=>Tg({...e,...Mg(t)});return Object.freeze({...n(t),create:n})}({a:BigInt(0),b:BigInt(7),Fp:Rg,n:jg,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=jg,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Cg*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),s=Og(a*e,t),u=Og(-r*e,t);let c=dg(e-s*n-u*i,t),l=dg(-s*r-u*a,t);const d=c>o,h=l>o;if(d&&(c=t-c),h&&(l=t-l),c>o||l>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:c,k2neg:h,k2:l}}}},Pm);var Fg;BigInt(0),Ng.ProjectivePoint;const Lg=null!==(Fg=Ng)&&void 0!==Fg?Fg:c,Hg=BigInt("0xffffffffffffffff"),qg=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Dg=Lg.CURVE.n/BigInt(2),Ug={type:"object",required:["crypto","id","version","address"],properties:{crypto:{type:"object",required:["cipher","ciphertext","cipherparams","kdf","kdfparams","mac"],properties:{cipher:{type:"string"},ciphertext:{type:"string"},cipherparams:{type:"object"},kdf:{type:"string"},kdfparams:{type:"object"},salt:{type:"string"},mac:{type:"string"}}},id:{type:"string"},version:{type:"number"},address:{type:"string"}}};var zg,Gg,Vg,Wg,Kg,Zg;!function(e){e[e.Mainnet=1]="Mainnet",e[e.Goerli=5]="Goerli",e[e.Sepolia=11155111]="Sepolia"}(zg||(zg={})),function(e){e.Chainstart="chainstart",e.Homestead="homestead",e.Dao="dao",e.TangerineWhistle="tangerineWhistle",e.SpuriousDragon="spuriousDragon",e.Byzantium="byzantium",e.Constantinople="constantinople",e.Petersburg="petersburg",e.Istanbul="istanbul",e.MuirGlacier="muirGlacier",e.Berlin="berlin",e.London="london",e.ArrowGlacier="arrowGlacier",e.GrayGlacier="grayGlacier",e.MergeForkIdTransition="mergeForkIdTransition",e.Merge="merge",e.Shanghai="shanghai",e.ShardingForkDev="shardingFork"}(Gg||(Gg={})),function(e){e.ProofOfStake="pos",e.ProofOfWork="pow",e.ProofOfAuthority="poa"}(Vg||(Vg={})),function(e){e.Ethash="ethash",e.Clique="clique",e.Casper="casper"}(Wg||(Wg={})),function(e){e.PolygonMainnet="polygon-mainnet",e.PolygonMumbai="polygon-mumbai",e.ArbitrumRinkebyTestnet="arbitrum-rinkeby-testnet",e.ArbitrumOne="arbitrum-one",e.xDaiChain="x-dai-chain",e.OptimisticKovan="optimistic-kovan",e.OptimisticEthereum="optimistic-ethereum"}(Kg||(Kg={})),function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Uint8Array=2]="Uint8Array",e[e.PrefixedHexString=3]="PrefixedHexString"}(Zg||(Zg={}));const Qg=e=>{if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof e);return nh(e)?e.slice(2):e},$g=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`};function Jg(e){let t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received "+typeof t);return t.length%2&&(t=`0${t}`),t}const Yg=function(e){var t;if(null==e)return new Uint8Array;if(e instanceof Uint8Array)return e;if("Uint8Array"===(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name))return Uint8Array.from(e);if(Array.isArray(e))return Uint8Array.from(e);if("string"==typeof e){if(!eh(e))throw new Error(`Cannot convert string to Uint8Array. only supports 0x-prefixed hex strings and this string was given: ${e}`);return Qh(Jg(Qg(e)))}if("number"==typeof e)return Yg(Yh(e));if("bigint"==typeof e){if(e<BigInt(0))throw new Error(`Cannot convert negative bigint to Uint8Array. Given: ${e}`);let t=e.toString(16);return t.length%2&&(t=`0${t}`),Yg(`0x${t}`)}if(e.toArray)return Uint8Array.from(e.toArray());throw new Error("invalid type")};function Xg(e){const t=Zh(e);return"0x"===t?BigInt(0):BigInt(t)}const ey=function(e){return new Uint8Array(e).fill(0)};function ty(e){if(!Dh(e))throw new Error(`This method only supports Uint8Array but input was: ${e}`)}const ny=function(e,t){return ty(e),function(e,t){const n=ey(t);return e.length<t?(n.set(e,t-e.length),n):e.subarray(-t)}(e,t)},ry=function(e){return ty(e),function(e){let t=e[0];for(;e.length>0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e}(e)},iy=e=>`0x${e.toString(16)}`;function ay(e){return ry(Yg(`0x${e.toString(16)}`))}const oy=function(e,t,n,r,i){const a=function(e,t){return e===BigInt(0)||e===BigInt(1)?e:void 0===t?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}(t,i);if(!function(e){return e===BigInt(0)||e===BigInt(1)}(a))throw new Error("Invalid signature v value");return new Lg.Signature(Xg(n),Xg(r)).addRecoveryBit(Number(a)).recoverPublicKey(e).toRawBytes(!1).slice(1)};function sy(e,t){if(null===e)return null;if(void 0===e)return;if("string"==typeof e&&!eh(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const n=Yg(e);switch(t){case Zg.Uint8Array:return n;case Zg.BigInt:return Xg(n);case Zg.Number:{const e=Xg(n);if(e>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(e)}case Zg.PrefixedHexString:return Zh(n);default:throw new Error("unknown outputType")}}var uy=n(8203),cy=n(2566);const ly={name:"goerli",chainId:5,networkId:5,defaultHardfork:"merge",consensus:{type:"poa",algorithm:"clique",clique:{period:15,epoch:3e4}},comment:"Cross-client PoA test network",url:"https://github.com/goerli/testnet",genesis:{timestamp:"0x5c51a607",gasLimit:10485760,difficulty:1,nonce:"0x0000000000000000",extraData:"0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},hardforks:[{name:"chainstart",block:0,forkHash:"0xa3f5ab08"},{name:"homestead",block:0,forkHash:"0xa3f5ab08"},{name:"tangerineWhistle",block:0,forkHash:"0xa3f5ab08"},{name:"spuriousDragon",block:0,forkHash:"0xa3f5ab08"},{name:"byzantium",block:0,forkHash:"0xa3f5ab08"},{name:"constantinople",block:0,forkHash:"0xa3f5ab08"},{name:"petersburg",block:0,forkHash:"0xa3f5ab08"},{name:"istanbul",block:1561651,forkHash:"0xc25efa5c"},{name:"berlin",block:4460644,forkHash:"0x757a1c47"},{name:"london",block:5062605,forkHash:"0xb8c6299d"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://goerli.etherscan.io/block/7382818",name:"merge",ttd:"10790000",block:7382819,forkHash:"0xb8c6299d"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,forkHash:null}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net"]},dy={name:"mainnet",chainId:1,networkId:1,defaultHardfork:"merge",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"The Ethereum main chain",url:"https://ethstats.net/",genesis:{gasLimit:5e3,difficulty:17179869184,nonce:"0x0000000000000042",extraData:"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfc64ec04"},{name:"homestead",block:115e4,forkHash:"0x97c2c34c"},{name:"dao",block:192e4,forkHash:"0x91d1f948"},{name:"tangerineWhistle",block:2463e3,forkHash:"0x7a64da13"},{name:"spuriousDragon",block:2675e3,forkHash:"0x3edd5b10"},{name:"byzantium",block:437e4,forkHash:"0xa00bc324"},{name:"constantinople",block:728e4,forkHash:"0x668db0af"},{name:"petersburg",block:728e4,forkHash:"0x668db0af"},{name:"istanbul",block:9069e3,forkHash:"0x879d6e30"},{name:"muirGlacier",block:92e5,forkHash:"0xe029e991"},{name:"berlin",block:12244e3,forkHash:"0x0eb440f6"},{name:"london",block:12965e3,forkHash:"0xb715077d"},{name:"arrowGlacier",block:13773e3,forkHash:"0x20c327fc"},{name:"grayGlacier",block:1505e4,forkHash:"0xf0afd0e3"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://etherscan.io/block/15537393",name:"merge",ttd:"58750000000000000000000",block:15537394,forkHash:"0xf0afd0e3"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,forkHash:null}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.mainnet.ethdisco.net"]},hy={name:"sepolia",chainId:11155111,networkId:11155111,defaultHardfork:"merge",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"PoW test network to replace Ropsten",url:"https://github.com/ethereum/go-ethereum/pull/23730",genesis:{timestamp:"0x6159af19",gasLimit:3e7,difficulty:131072,nonce:"0x0000000000000000",extraData:"0x5365706f6c69612c20417468656e732c204174746963612c2047726565636521"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfe3366e7"},{name:"homestead",block:0,forkHash:"0xfe3366e7"},{name:"tangerineWhistle",block:0,forkHash:"0xfe3366e7"},{name:"spuriousDragon",block:0,forkHash:"0xfe3366e7"},{name:"byzantium",block:0,forkHash:"0xfe3366e7"},{name:"constantinople",block:0,forkHash:"0xfe3366e7"},{name:"petersburg",block:0,forkHash:"0xfe3366e7"},{name:"istanbul",block:0,forkHash:"0xfe3366e7"},{name:"muirGlacier",block:0,forkHash:"0xfe3366e7"},{name:"berlin",block:0,forkHash:"0xfe3366e7"},{name:"london",block:0,forkHash:"0xfe3366e7"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://sepolia.etherscan.io/block/1450408",name:"merge",ttd:"17000000000000000",block:1450409,forkHash:"0xfe3366e7"},{name:"mergeForkIdTransition",block:1735371,forkHash:"0xb96cbd13"},{name:"shanghai",block:null,timestamp:"1677557088",forkHash:"0xf7f9bc08"}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.sepolia.ethdisco.net"]},fy={1153:{name:"EIP-1153",number:1153,comment:"Transient Storage",url:"https://eips.ethereum.org/EIPS/eip-1153",status:"Review",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{tstore:{v:100,d:"Base fee of the TSTORE opcode"},tload:{v:100,d:"Base fee of the TLOAD opcode"}},vm:{},pow:{}},1559:{name:"EIP-1559",number:1559,comment:"Fee market change for ETH 1.0 chain",url:"https://eips.ethereum.org/EIPS/eip-1559",status:"Final",minimumHardfork:"berlin",requiredEIPs:[2930],gasConfig:{baseFeeMaxChangeDenominator:{v:8,d:"Maximum base fee change denominator"},elasticityMultiplier:{v:2,d:"Maximum block gas target elasticity"},initialBaseFee:{v:1e9,d:"Initial base fee on first EIP1559 block"}},gasPrices:{},vm:{},pow:{}},2315:{name:"EIP-2315",number:2315,comment:"Simple subroutines for the EVM",url:"https://eips.ethereum.org/EIPS/eip-2315",status:"Draft",minimumHardfork:"istanbul",gasConfig:{},gasPrices:{beginsub:{v:2,d:"Base fee of the BEGINSUB opcode"},returnsub:{v:5,d:"Base fee of the RETURNSUB opcode"},jumpsub:{v:10,d:"Base fee of the JUMPSUB opcode"}},vm:{},pow:{}},2537:{name:"EIP-2537",number:2537,comment:"BLS12-381 precompiles",url:"https://eips.ethereum.org/EIPS/eip-2537",status:"Draft",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{Bls12381G1AddGas:{v:600,d:"Gas cost of a single BLS12-381 G1 addition precompile-call"},Bls12381G1MulGas:{v:12e3,d:"Gas cost of a single BLS12-381 G1 multiplication precompile-call"},Bls12381G2AddGas:{v:4500,d:"Gas cost of a single BLS12-381 G2 addition precompile-call"},Bls12381G2MulGas:{v:55e3,d:"Gas cost of a single BLS12-381 G2 multiplication precompile-call"},Bls12381PairingBaseGas:{v:115e3,d:"Base gas cost of BLS12-381 pairing check"},Bls12381PairingPerPairGas:{v:23e3,d:"Per-pair gas cost of BLS12-381 pairing check"},Bls12381MapG1Gas:{v:5500,d:"Gas cost of BLS12-381 map field element to G1"},Bls12381MapG2Gas:{v:11e4,d:"Gas cost of BLS12-381 map field element to G2"},Bls12381MultiExpGasDiscount:{v:[[1,1200],[2,888],[3,764],[4,641],[5,594],[6,547],[7,500],[8,453],[9,438],[10,423],[11,408],[12,394],[13,379],[14,364],[15,349],[16,334],[17,330],[18,326],[19,322],[20,318],[21,314],[22,310],[23,306],[24,302],[25,298],[26,294],[27,289],[28,285],[29,281],[30,277],[31,273],[32,269],[33,268],[34,266],[35,265],[36,263],[37,262],[38,260],[39,259],[40,257],[41,256],[42,254],[43,253],[44,251],[45,250],[46,248],[47,247],[48,245],[49,244],[50,242],[51,241],[52,239],[53,238],[54,236],[55,235],[56,233],[57,232],[58,231],[59,229],[60,228],[61,226],[62,225],[63,223],[64,222],[65,221],[66,220],[67,219],[68,219],[69,218],[70,217],[71,216],[72,216],[73,215],[74,214],[75,213],[76,213],[77,212],[78,211],[79,211],[80,210],[81,209],[82,208],[83,208],[84,207],[85,206],[86,205],[87,205],[88,204],[89,203],[90,202],[91,202],[92,201],[93,200],[94,199],[95,199],[96,198],[97,197],[98,196],[99,196],[100,195],[101,194],[102,193],[103,193],[104,192],[105,191],[106,191],[107,190],[108,189],[109,188],[110,188],[111,187],[112,186],[113,185],[114,185],[115,184],[116,183],[117,182],[118,182],[119,181],[120,180],[121,179],[122,179],[123,178],[124,177],[125,176],[126,176],[127,175],[128,174]],d:"Discount gas costs of calls to the MultiExp precompiles with `k` (point, scalar) pair"}},vm:{},pow:{}},2565:{name:"EIP-2565",number:2565,comment:"ModExp gas cost",url:"https://eips.ethereum.org/EIPS/eip-2565",status:"Final",minimumHardfork:"byzantium",gasConfig:{},gasPrices:{modexpGquaddivisor:{v:3,d:"Gquaddivisor from modexp precompile for gas calculation"}},vm:{},pow:{}},2718:{name:"EIP-2718",comment:"Typed Transaction Envelope",url:"https://eips.ethereum.org/EIPS/eip-2718",status:"Final",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{},vm:{},pow:{}},2929:{name:"EIP-2929",comment:"Gas cost increases for state access opcodes",url:"https://eips.ethereum.org/EIPS/eip-2929",status:"Final",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{coldsload:{v:2100,d:"Gas cost of the first read of storage from a given location (per transaction)"},coldaccountaccess:{v:2600,d:"Gas cost of the first read of a given address (per transaction)"},warmstorageread:{v:100,d:"Gas cost of reading storage locations which have already loaded 'cold'"},sstoreCleanGasEIP2200:{v:2900,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreNoopGasEIP2200:{v:100,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:100,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitRefundEIP2200:{v:19900,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanRefundEIP2200:{v:4900,d:"Once per SSTORE operation for resetting to the original non-zero value"},call:{v:0,d:"Base fee of the CALL opcode"},callcode:{v:0,d:"Base fee of the CALLCODE opcode"},delegatecall:{v:0,d:"Base fee of the DELEGATECALL opcode"},staticcall:{v:0,d:"Base fee of the STATICCALL opcode"},balance:{v:0,d:"Base fee of the BALANCE opcode"},extcodesize:{v:0,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:0,d:"Base fee of the EXTCODECOPY opcode"},extcodehash:{v:0,d:"Base fee of the EXTCODEHASH opcode"},sload:{v:0,d:"Base fee of the SLOAD opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"}},vm:{},pow:{}},2930:{name:"EIP-2930",comment:"Optional access lists",url:"https://eips.ethereum.org/EIPS/eip-2930",status:"Final",minimumHardfork:"istanbul",requiredEIPs:[2718,2929],gasConfig:{},gasPrices:{accessListStorageKeyCost:{v:1900,d:"Gas cost per storage key in an Access List transaction"},accessListAddressCost:{v:2400,d:"Gas cost per storage key in an Access List transaction"}},vm:{},pow:{}},3198:{name:"EIP-3198",number:3198,comment:"BASEFEE opcode",url:"https://eips.ethereum.org/EIPS/eip-3198",status:"Final",minimumHardfork:"london",gasConfig:{},gasPrices:{basefee:{v:2,d:"Gas cost of the BASEFEE opcode"}},vm:{},pow:{}},3529:{name:"EIP-3529",comment:"Reduction in refunds",url:"https://eips.ethereum.org/EIPS/eip-3529",status:"Final",minimumHardfork:"berlin",requiredEIPs:[2929],gasConfig:{maxRefundQuotient:{v:5,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{selfdestructRefund:{v:0,d:"Refunded following a selfdestruct operation"},sstoreClearRefundEIP2200:{v:4800,d:"Once per SSTORE operation for clearing an originally existing storage slot"}},vm:{},pow:{}},3540:{name:"EIP-3540",number:3540,comment:"EVM Object Format (EOF) v1",url:"https://eips.ethereum.org/EIPS/eip-3540",status:"Review",minimumHardfork:"london",requiredEIPs:[3541],gasConfig:{},gasPrices:{},vm:{},pow:{}},3541:{name:"EIP-3541",comment:"Reject new contracts starting with the 0xEF byte",url:"https://eips.ethereum.org/EIPS/eip-3541",status:"Final",minimumHardfork:"berlin",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},3554:{name:"EIP-3554",comment:"Reduction in refunds",url:"Difficulty Bomb Delay to December 1st 2021",status:"Final",minimumHardfork:"muirGlacier",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:95e5,d:"the amount of blocks to delay the difficulty bomb with"}}},3607:{name:"EIP-3607",number:3607,comment:"Reject transactions from senders with deployed code",url:"https://eips.ethereum.org/EIPS/eip-3607",status:"Final",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},3651:{name:"EIP-3651",number:3198,comment:"Warm COINBASE",url:"https://eips.ethereum.org/EIPS/eip-3651",status:"Review",minimumHardfork:"london",requiredEIPs:[2929],gasConfig:{},gasPrices:{},vm:{},pow:{}},3670:{name:"EIP-3670",number:3670,comment:"EOF - Code Validation",url:"https://eips.ethereum.org/EIPS/eip-3670",status:"Review",minimumHardfork:"london",requiredEIPs:[3540],gasConfig:{},gasPrices:{},vm:{},pow:{}},3675:{name:"EIP-3675",number:3675,comment:"Upgrade consensus to Proof-of-Stake",url:"https://eips.ethereum.org/EIPS/eip-3675",status:"Final",minimumHardfork:"london",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},3855:{name:"EIP-3855",number:3855,comment:"PUSH0 instruction",url:"https://eips.ethereum.org/EIPS/eip-3855",status:"Review",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{push0:{v:2,d:"Base fee of the PUSH0 opcode"}},vm:{},pow:{}},3860:{name:"EIP-3860",number:3860,comment:"Limit and meter initcode",url:"https://eips.ethereum.org/EIPS/eip-3860",status:"Review",minimumHardfork:"spuriousDragon",requiredEIPs:[],gasConfig:{},gasPrices:{initCodeWordCost:{v:2,d:"Gas to pay for each word (32 bytes) of initcode when creating a contract"}},vm:{maxInitCodeSize:{v:49152,d:"Maximum length of initialization code when creating a contract"}},pow:{}},4345:{name:"EIP-4345",number:4345,comment:"Difficulty Bomb Delay to June 2022",url:"https://eips.ethereum.org/EIPS/eip-4345",status:"Final",minimumHardfork:"london",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:107e5,d:"the amount of blocks to delay the difficulty bomb with"}}},4399:{name:"EIP-4399",number:4399,comment:"Supplant DIFFICULTY opcode with PREVRANDAO",url:"https://eips.ethereum.org/EIPS/eip-4399",status:"Review",minimumHardfork:"london",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}},5133:{name:"EIP-5133",number:5133,comment:"Delaying Difficulty Bomb to mid-September 2022",url:"https://eips.ethereum.org/EIPS/eip-5133",status:"Draft",minimumHardfork:"grayGlacier",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:114e5,d:"the amount of blocks to delay the difficulty bomb with"}}}},py={chainstart:{name:"chainstart",comment:"Start of the Ethereum main chain",url:"",status:"",gasConfig:{minGasLimit:{v:5e3,d:"Minimum the gas limit may ever be"},gasLimitBoundDivisor:{v:1024,d:"The bound divisor of the gas limit, used in update calculations"},maxRefundQuotient:{v:2,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{base:{v:2,d:"Gas base cost, used e.g. for ChainID opcode (Istanbul)"},tierStep:{v:[0,2,3,5,8,10,20],d:"Once per operation, for a selection of them"},exp:{v:10,d:"Base fee of the EXP opcode"},expByte:{v:10,d:"Times ceil(log256(exponent)) for the EXP instruction"},sha3:{v:30,d:"Base fee of the SHA3 opcode"},sha3Word:{v:6,d:"Once per word of the SHA3 operation's data"},sload:{v:50,d:"Base fee of the SLOAD opcode"},sstoreSet:{v:2e4,d:"Once per SSTORE operation if the zeroness changes from zero"},sstoreReset:{v:5e3,d:"Once per SSTORE operation if the zeroness does not change from zero"},sstoreRefund:{v:15e3,d:"Once per SSTORE operation if the zeroness changes to zero"},jumpdest:{v:1,d:"Base fee of the JUMPDEST opcode"},log:{v:375,d:"Base fee of the LOG opcode"},logData:{v:8,d:"Per byte in a LOG* operation's data"},logTopic:{v:375,d:"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas"},create:{v:32e3,d:"Base fee of the CREATE opcode"},call:{v:40,d:"Base fee of the CALL opcode"},callStipend:{v:2300,d:"Free gas given at beginning of call"},callValueTransfer:{v:9e3,d:"Paid for CALL when the value transfor is non-zero"},callNewAccount:{v:25e3,d:"Paid for CALL when the destination address didn't exist prior"},selfdestructRefund:{v:24e3,d:"Refunded following a selfdestruct operation"},memory:{v:3,d:"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL"},quadCoeffDiv:{v:512,d:"Divisor for the quadratic particle of the memory cost equation"},createData:{v:200,d:""},tx:{v:21e3,d:"Per transaction. NOTE: Not payable on data of calls between transactions"},txCreation:{v:32e3,d:"The cost of creating a contract via tx"},txDataZero:{v:4,d:"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions"},txDataNonZero:{v:68,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},copy:{v:3,d:"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added"},ecRecover:{v:3e3,d:""},sha256:{v:60,d:""},sha256Word:{v:12,d:""},ripemd160:{v:600,d:""},ripemd160Word:{v:120,d:""},identity:{v:15,d:""},identityWord:{v:3,d:""},stop:{v:0,d:"Base fee of the STOP opcode"},add:{v:3,d:"Base fee of the ADD opcode"},mul:{v:5,d:"Base fee of the MUL opcode"},sub:{v:3,d:"Base fee of the SUB opcode"},div:{v:5,d:"Base fee of the DIV opcode"},sdiv:{v:5,d:"Base fee of the SDIV opcode"},mod:{v:5,d:"Base fee of the MOD opcode"},smod:{v:5,d:"Base fee of the SMOD opcode"},addmod:{v:8,d:"Base fee of the ADDMOD opcode"},mulmod:{v:8,d:"Base fee of the MULMOD opcode"},signextend:{v:5,d:"Base fee of the SIGNEXTEND opcode"},lt:{v:3,d:"Base fee of the LT opcode"},gt:{v:3,d:"Base fee of the GT opcode"},slt:{v:3,d:"Base fee of the SLT opcode"},sgt:{v:3,d:"Base fee of the SGT opcode"},eq:{v:3,d:"Base fee of the EQ opcode"},iszero:{v:3,d:"Base fee of the ISZERO opcode"},and:{v:3,d:"Base fee of the AND opcode"},or:{v:3,d:"Base fee of the OR opcode"},xor:{v:3,d:"Base fee of the XOR opcode"},not:{v:3,d:"Base fee of the NOT opcode"},byte:{v:3,d:"Base fee of the BYTE opcode"},address:{v:2,d:"Base fee of the ADDRESS opcode"},balance:{v:20,d:"Base fee of the BALANCE opcode"},origin:{v:2,d:"Base fee of the ORIGIN opcode"},caller:{v:2,d:"Base fee of the CALLER opcode"},callvalue:{v:2,d:"Base fee of the CALLVALUE opcode"},calldataload:{v:3,d:"Base fee of the CALLDATALOAD opcode"},calldatasize:{v:2,d:"Base fee of the CALLDATASIZE opcode"},calldatacopy:{v:3,d:"Base fee of the CALLDATACOPY opcode"},codesize:{v:2,d:"Base fee of the CODESIZE opcode"},codecopy:{v:3,d:"Base fee of the CODECOPY opcode"},gasprice:{v:2,d:"Base fee of the GASPRICE opcode"},extcodesize:{v:20,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:20,d:"Base fee of the EXTCODECOPY opcode"},blockhash:{v:20,d:"Base fee of the BLOCKHASH opcode"},coinbase:{v:2,d:"Base fee of the COINBASE opcode"},timestamp:{v:2,d:"Base fee of the TIMESTAMP opcode"},number:{v:2,d:"Base fee of the NUMBER opcode"},difficulty:{v:2,d:"Base fee of the DIFFICULTY opcode"},gaslimit:{v:2,d:"Base fee of the GASLIMIT opcode"},pop:{v:2,d:"Base fee of the POP opcode"},mload:{v:3,d:"Base fee of the MLOAD opcode"},mstore:{v:3,d:"Base fee of the MSTORE opcode"},mstore8:{v:3,d:"Base fee of the MSTORE8 opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"},jump:{v:8,d:"Base fee of the JUMP opcode"},jumpi:{v:10,d:"Base fee of the JUMPI opcode"},pc:{v:2,d:"Base fee of the PC opcode"},msize:{v:2,d:"Base fee of the MSIZE opcode"},gas:{v:2,d:"Base fee of the GAS opcode"},push:{v:3,d:"Base fee of the PUSH opcode"},dup:{v:3,d:"Base fee of the DUP opcode"},swap:{v:3,d:"Base fee of the SWAP opcode"},callcode:{v:40,d:"Base fee of the CALLCODE opcode"},return:{v:0,d:"Base fee of the RETURN opcode"},invalid:{v:0,d:"Base fee of the INVALID opcode"},selfdestruct:{v:0,d:"Base fee of the SELFDESTRUCT opcode"}},vm:{stackLimit:{v:1024,d:"Maximum size of VM stack allowed"},callCreateDepth:{v:1024,d:"Maximum depth of call/create stack"},maxExtraDataSize:{v:32,d:"Maximum size extra data may be after Genesis"}},pow:{minimumDifficulty:{v:131072,d:"The minimum that the difficulty may ever be"},difficultyBoundDivisor:{v:2048,d:"The bound divisor of the difficulty, used in the update calculations"},durationLimit:{v:13,d:"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not"},epochDuration:{v:3e4,d:"Duration between proof-of-work epochs"},timebombPeriod:{v:1e5,d:"Exponential difficulty timebomb period"},minerReward:{v:"5000000000000000000",d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:0,d:"the amount of blocks to delay the difficulty bomb with"}}},homestead:{name:"homestead",comment:"Homestead hardfork with protocol and network changes",url:"https://eips.ethereum.org/EIPS/eip-606",status:"Final",gasConfig:{},gasPrices:{delegatecall:{v:40,d:"Base fee of the DELEGATECALL opcode"}},vm:{},pow:{}},dao:{name:"dao",comment:"DAO rescue hardfork",url:"https://eips.ethereum.org/EIPS/eip-779",status:"Final",gasConfig:{},gasPrices:{},vm:{},pow:{}},tangerineWhistle:{name:"tangerineWhistle",comment:"Hardfork with gas cost changes for IO-heavy operations",url:"https://eips.ethereum.org/EIPS/eip-608",status:"Final",gasConfig:{},gasPrices:{sload:{v:200,d:"Once per SLOAD operation"},call:{v:700,d:"Once per CALL operation & message call transaction"},extcodesize:{v:700,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:700,d:"Base fee of the EXTCODECOPY opcode"},balance:{v:400,d:"Base fee of the BALANCE opcode"},delegatecall:{v:700,d:"Base fee of the DELEGATECALL opcode"},callcode:{v:700,d:"Base fee of the CALLCODE opcode"},selfdestruct:{v:5e3,d:"Base fee of the SELFDESTRUCT opcode"}},vm:{},pow:{}},spuriousDragon:{name:"spuriousDragon",comment:"HF with EIPs for simple replay attack protection, EXP cost increase, state trie clearing, contract code size limit",url:"https://eips.ethereum.org/EIPS/eip-607",status:"Final",gasConfig:{},gasPrices:{expByte:{v:50,d:"Times ceil(log256(exponent)) for the EXP instruction"}},vm:{maxCodeSize:{v:24576,d:"Maximum length of contract code"}},pow:{}},byzantium:{name:"byzantium",comment:"Hardfork with new precompiles, instructions and other protocol changes",url:"https://eips.ethereum.org/EIPS/eip-609",status:"Final",gasConfig:{},gasPrices:{modexpGquaddivisor:{v:20,d:"Gquaddivisor from modexp precompile for gas calculation"},ecAdd:{v:500,d:"Gas costs for curve addition precompile"},ecMul:{v:4e4,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:1e5,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:8e4,d:"Gas costs regarding curve pairing precompile input length"},revert:{v:0,d:"Base fee of the REVERT opcode"},staticcall:{v:700,d:"Base fee of the STATICCALL opcode"},returndatasize:{v:2,d:"Base fee of the RETURNDATASIZE opcode"},returndatacopy:{v:3,d:"Base fee of the RETURNDATACOPY opcode"}},vm:{},pow:{minerReward:{v:"3000000000000000000",d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:3e6,d:"the amount of blocks to delay the difficulty bomb with"}}},constantinople:{name:"constantinople",comment:"Postponed hardfork including EIP-1283 (SSTORE gas metering changes)",url:"https://eips.ethereum.org/EIPS/eip-1013",status:"Final",gasConfig:{},gasPrices:{netSstoreNoopGas:{v:200,d:"Once per SSTORE operation if the value doesn't change"},netSstoreInitGas:{v:2e4,d:"Once per SSTORE operation from clean zero"},netSstoreCleanGas:{v:5e3,d:"Once per SSTORE operation from clean non-zero"},netSstoreDirtyGas:{v:200,d:"Once per SSTORE operation from dirty"},netSstoreClearRefund:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},netSstoreResetRefund:{v:4800,d:"Once per SSTORE operation for resetting to the original non-zero value"},netSstoreResetClearRefund:{v:19800,d:"Once per SSTORE operation for resetting to the original zero value"},shl:{v:3,d:"Base fee of the SHL opcode"},shr:{v:3,d:"Base fee of the SHR opcode"},sar:{v:3,d:"Base fee of the SAR opcode"},extcodehash:{v:400,d:"Base fee of the EXTCODEHASH opcode"},create2:{v:32e3,d:"Base fee of the CREATE2 opcode"}},vm:{},pow:{minerReward:{v:"2000000000000000000",d:"The amount a miner gets rewarded for mining a block"},difficultyBombDelay:{v:5e6,d:"the amount of blocks to delay the difficulty bomb with"}}},petersburg:{name:"petersburg",comment:"Aka constantinopleFix, removes EIP-1283, activate together with or after constantinople",url:"https://eips.ethereum.org/EIPS/eip-1716",status:"Final",gasConfig:{},gasPrices:{netSstoreNoopGas:{v:null,d:"Removed along EIP-1283"},netSstoreInitGas:{v:null,d:"Removed along EIP-1283"},netSstoreCleanGas:{v:null,d:"Removed along EIP-1283"},netSstoreDirtyGas:{v:null,d:"Removed along EIP-1283"},netSstoreClearRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetClearRefund:{v:null,d:"Removed along EIP-1283"}},vm:{},pow:{}},istanbul:{name:"istanbul",comment:"HF targeted for December 2019 following the Constantinople/Petersburg HF",url:"https://eips.ethereum.org/EIPS/eip-1679",status:"Final",gasConfig:{},gasPrices:{blake2Round:{v:1,d:"Gas cost per round for the Blake2 F precompile"},ecAdd:{v:150,d:"Gas costs for curve addition precompile"},ecMul:{v:6e3,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:45e3,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:34e3,d:"Gas costs regarding curve pairing precompile input length"},txDataNonZero:{v:16,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},sstoreSentryGasEIP2200:{v:2300,d:"Minimum gas required to be present for an SSTORE call, not consumed"},sstoreNoopGasEIP2200:{v:800,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:800,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitGasEIP2200:{v:2e4,d:"Once per SSTORE operation from clean zero to non-zero"},sstoreInitRefundEIP2200:{v:19200,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanGasEIP2200:{v:5e3,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreCleanRefundEIP2200:{v:4200,d:"Once per SSTORE operation for resetting to the original non-zero value"},sstoreClearRefundEIP2200:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},balance:{v:700,d:"Base fee of the BALANCE opcode"},extcodehash:{v:700,d:"Base fee of the EXTCODEHASH opcode"},chainid:{v:2,d:"Base fee of the CHAINID opcode"},selfbalance:{v:5,d:"Base fee of the SELFBALANCE opcode"},sload:{v:800,d:"Base fee of the SLOAD opcode"}},vm:{},pow:{}},muirGlacier:{name:"muirGlacier",comment:"HF to delay the difficulty bomb",url:"https://eips.ethereum.org/EIPS/eip-2384",status:"Final",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:9e6,d:"the amount of blocks to delay the difficulty bomb with"}}},berlin:{name:"berlin",comment:"HF targeted for July 2020 following the Muir Glacier HF",url:"https://eips.ethereum.org/EIPS/eip-2070",status:"Final",eips:[2565,2929,2718,2930]},london:{name:"london",comment:"HF targeted for July 2021 following the Berlin fork",url:"https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/mainnet-upgrades/london.md",status:"Final",eips:[1559,3198,3529,3541]},shanghai:{name:"shanghai",comment:"Next feature hardfork after the merge hardfork having withdrawals, warm coinbase, push0, limit/meter initcode",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md",status:"Final",eips:[3651,3855,3860,4895]},arrowGlacier:{name:"arrowGlacier",comment:"HF to delay the difficulty bomb",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md",status:"Final",eips:[4345],gasConfig:{},gasPrices:{},vm:{},pow:{}},grayGlacier:{name:"grayGlacier",comment:"Delaying the difficulty bomb to Mid September 2022",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/gray-glacier.md",status:"Draft",eips:[5133],gasConfig:{},gasPrices:{},vm:{},pow:{}},mergeForkIdTransition:{name:"mergeForkIdTransition",comment:"Pre-merge hardfork to fork off non-upgraded clients",url:"https://eips.ethereum.org/EIPS/eip-3675",status:"Draft",eips:[]},merge:{name:"merge",comment:"Hardfork to upgrade the consensus mechanism to Proof-of-Stake",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/merge.md",status:"Final",consensus:{type:"pos",algorithm:"casper",casper:{}},eips:[3675,4399]}},{buf:my}=cy;class gy extends xf{static custom(e,t={}){var n;const r=null!==(n=t.baseChain)&&void 0!==n?n:"mainnet",i=Object.assign({},gy._getChainParams(r));if(i.name="custom-chain","string"!=typeof e)return new gy(Object.assign({chain:Object.assign(Object.assign({},i),e)},t));if(e===Kg.PolygonMainnet)return gy.custom({name:Kg.PolygonMainnet,chainId:137,networkId:137},t);if(e===Kg.PolygonMumbai)return gy.custom({name:Kg.PolygonMumbai,chainId:80001,networkId:80001},t);if(e===Kg.ArbitrumRinkebyTestnet)return gy.custom({name:Kg.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611},t);if(e===Kg.ArbitrumOne)return gy.custom({name:Kg.ArbitrumOne,chainId:42161,networkId:42161},t);if(e===Kg.xDaiChain)return gy.custom({name:Kg.xDaiChain,chainId:100,networkId:100},t);if(e===Kg.OptimisticKovan)return gy.custom({name:Kg.OptimisticKovan,chainId:69,networkId:69},Object.assign({hardfork:Gg.Berlin},t));if(e===Kg.OptimisticEthereum)return gy.custom({name:Kg.OptimisticEthereum,chainId:10,networkId:10},Object.assign({hardfork:Gg.Berlin},t));throw new Error(`Custom chain ${e} not supported`)}static fromGethGenesis(e,{chain:t,eips:n,genesisHash:r,hardfork:i,mergeForkIdPostMerge:a}){var o;const s=function(e,t,n){try{if(["config","difficulty","gasLimit","alloc"].some(t=>!(t in e)))throw new Error("Invalid format, expected geth genesis fields missing");return void 0!==t&&(e.name=t),function(e,t=!0){var n,r;const{name:i,config:a,difficulty:o,mixHash:s,gasLimit:u,coinbase:c,baseFeePerGas:l}=e;let{extraData:d,timestamp:h,nonce:f}=e;const p=Number(h),{chainId:m}=a;if(""===d&&(d="0x"),nh(h)||(h=$g(parseInt(h))),18!==f.length&&(f=function(e){return e&&"0x0"!==e?nh(e)?`0x${Qg(e).padStart(16,"0")}`:`0x${e.padStart(16,"0")}`:"0x0000000000000000"}(f)),a.eip155Block!==a.eip158Block)throw new Error("EIP155 block number must equal EIP 158 block number since both are part of SpuriousDragon hardfork and the client only supports activating the full hardfork");const g={name:i,chainId:m,networkId:m,genesis:{timestamp:h,gasLimit:parseInt(u),difficulty:parseInt(o),nonce:f,extraData:d,mixHash:s,coinbase:c,baseFeePerGas:l},hardfork:void 0,hardforks:[],bootstrapNodes:[],consensus:void 0!==a.clique?{type:"poa",algorithm:"clique",clique:{period:null!==(n=a.clique.period)&&void 0!==n?n:a.clique.blockperiodseconds,epoch:null!==(r=a.clique.epoch)&&void 0!==r?r:a.clique.epochlength}}:{type:"pow",algorithm:"ethash",ethash:{}}},y={[Gg.Homestead]:{name:"homesteadBlock"},[Gg.Dao]:{name:"daoForkBlock"},[Gg.TangerineWhistle]:{name:"eip150Block"},[Gg.SpuriousDragon]:{name:"eip155Block"},[Gg.Byzantium]:{name:"byzantiumBlock"},[Gg.Constantinople]:{name:"constantinopleBlock"},[Gg.Petersburg]:{name:"petersburgBlock"},[Gg.Istanbul]:{name:"istanbulBlock"},[Gg.MuirGlacier]:{name:"muirGlacierBlock"},[Gg.Berlin]:{name:"berlinBlock"},[Gg.London]:{name:"londonBlock"},[Gg.MergeForkIdTransition]:{name:"mergeForkBlock",postMerge:t},[Gg.Shanghai]:{name:"shanghaiTime",postMerge:!0,isTimestamp:!0},[Gg.ShardingForkDev]:{name:"shardingForkTime",postMerge:!0,isTimestamp:!0}},b=Object.keys(y).reduce((e,t)=>(e[y[t].name]=t,e),{}),v=Object.keys(a).filter(e=>void 0!==b[e]&&void 0!==a[e]&&null!==a[e]);if(g.hardforks=v.map(e=>({name:b[e],block:!0===y[b[e]].isTimestamp||"number"!=typeof a[e]?null:a[e],timestamp:!0===y[b[e]].isTimestamp&&"number"==typeof a[e]?a[e]:void 0})).filter(e=>null!==e.block||void 0!==e.timestamp),g.hardforks.sort((e,t)=>{var n,r;return(null!==(n=e.block)&&void 0!==n?n:1/0)-(null!==(r=t.block)&&void 0!==r?r:1/0)}),g.hardforks.sort((e,t)=>{var n,r;return(null!==(n=e.timestamp)&&void 0!==n?n:p)-(null!==(r=t.timestamp)&&void 0!==r?r:p)}),void 0!==a.terminalTotalDifficulty){const e={name:Gg.Merge,ttd:a.terminalTotalDifficulty,block:null},t=g.hardforks.findIndex(e=>{var t;return!0===(null===(t=y[e.name])||void 0===t?void 0:t.postMerge)});-1!==t?g.hardforks.splice(t,0,e):g.hardforks.push(e)}const w=g.hardforks.length>0?g.hardforks.slice(-1)[0]:void 0;return g.hardfork=null==w?void 0:w.name,g.hardforks.unshift({name:Gg.Chainstart,block:0}),g}(e,n)}catch(e){throw new Error(`Error parsing parameters file: ${e.message}`)}}(e,t,a),u=new gy({chain:null!==(o=s.name)&&void 0!==o?o:"custom",customChains:[s],eips:n,hardfork:null!=i?i:s.hardfork});return void 0!==r&&u.setForkHashes(r),u}static isSupportedChainId(e){const t=this._getInitializedChains();return Boolean(t.names[e.toString()])}static _getChainParams(e,t){let n=e;const r=this._getInitializedChains(t);if("number"==typeof n||"bigint"==typeof n){if(n=n.toString(),r.names[n])return r[r.names[n]];throw new Error(`Chain with ID ${n} not supported`)}if(void 0!==r[n])return r[n];throw new Error(`Chain with name ${n} not supported`)}constructor(e){var t,n;super(),this._eips=[],this._customChains=null!==(t=e.customChains)&&void 0!==t?t:[],this._chainParams=this.setChain(e.chain),this.DEFAULT_HARDFORK=null!==(n=this._chainParams.defaultHardfork)&&void 0!==n?n:Gg.Merge,this.HARDFORK_CHANGES=this.hardforks().map(e=>[e.name,py[e.name]]),this._hardfork=this.DEFAULT_HARDFORK,void 0!==e.hardfork&&this.setHardfork(e.hardfork),e.eips&&this.setEIPs(e.eips)}setChain(e){if("number"==typeof e||"bigint"==typeof e||"string"==typeof e)this._chainParams=gy._getChainParams(e,this._customChains);else{if("object"!=typeof e)throw new Error("Wrong input format");{if(this._customChains.length>0)throw new Error("Chain must be a string, number, or bigint when initialized with customChains passed in");const t=["networkId","genesis","hardforks","bootstrapNodes"];for(const n of t)if(!(n in e))throw new Error(`Missing required chain parameter: ${n}`);this._chainParams=e}}for(const e of this.hardforks())if(void 0===e.block)throw new Error("Hardfork cannot have undefined block number");return this._chainParams}setHardfork(e){let t=!1;for(const n of this.HARDFORK_CHANGES)n[0]===e&&(this._hardfork!==e&&(this._hardfork=e,this.emit("hardforkChanged",e)),t=!0);if(!t)throw new Error(`Hardfork with name ${e} not supported`)}getHardforkByBlockNumber(e,t,n){const r=sy(e,Zg.BigInt),i=sy(t,Zg.BigInt),a=sy(n,Zg.Number),o=this.hardforks().filter(e=>null!==e.block||null!==e.ttd&&void 0!==e.ttd||void 0!==e.timestamp),s=o.findIndex(e=>null!==e.ttd&&void 0!==e.ttd);if(o.slice(s+1).findIndex(e=>null!==e.ttd&&void 0!==e.ttd)>=0)throw Error("More than one merge hardforks found with ttd specified");let u=o.findIndex(e=>null!==e.block&&e.block>r||void 0!==a&&Number(e.timestamp)>a);if(-1===u)u=o.length;else if(0===u)throw Error("Must have at least one hardfork at block 0");if(void 0===a&&(u-=o.slice(0,u).reverse().findIndex(e=>null!==e.block||void 0!==e.ttd)),u-=1,null===o[u].block&&void 0===o[u].timestamp)(null==i||BigInt(o[u].ttd)>i)&&(u-=1);else if(s>=0&&null!=i){if(u>=s&&BigInt(o[s].ttd)>i)throw Error("Maximum HF determined by total difficulty is lower than the block number HF");if(u<s&&BigInt(o[s].ttd)<=i)throw Error("HF determined by block number is lower than the minimum total difficulty HF")}const c=u;for(;u<o.length-1&&o[u].block===o[u+1].block&&o[u].timestamp===o[u+1].timestamp;u+=1);if(a){const e=o.slice(0,c).reduce((e,t)=>{var n;return Math.max(Number(null!==(n=t.timestamp)&&void 0!==n?n:"0"),e)},0);if(e>a)throw Error("Maximum HF determined by timestamp is lower than the block number/ttd HF");const t=o.slice(u+1).reduce((e,t)=>{var n;return Math.min(Number(null!==(n=t.timestamp)&&void 0!==n?n:a),e)},a);if(t<a)throw Error("Maximum HF determined by block number/ttd is lower than timestamp HF")}return o[u].name}setHardforkByBlockNumber(e,t,n){const r=this.getHardforkByBlockNumber(e,t,n);return this.setHardfork(r),r}_getHardfork(e){const t=this.hardforks();for(const n of t)if(n.name===e)return n;return null}setEIPs(e=[]){for(const t of e){if(!(t in fy))throw new Error(`${t} not supported`);const n=this.gteHardfork(fy[t].minimumHardfork);if(!n)throw new Error(`${t} cannot be activated on hardfork ${this.hardfork()}, minimumHardfork: ${n}`);if(void 0!==fy[t].requiredEIPs)for(const n of fy[t].requiredEIPs)if(!e.includes(n)&&!this.isActivatedEIP(n))throw new Error(`${t} requires EIP ${n}, but is not included in the EIP list`)}this._eips=e}param(e,t){let n;for(const r of this._eips)if(n=this.paramByEIP(e,t,r),void 0!==n)return n;return this.paramByHardfork(e,t,this._hardfork)}paramByHardfork(e,t,n){let r=null;for(const i of this.HARDFORK_CHANGES){if("eips"in i[1]){const n=i[1].eips;for(const i of n){const n=this.paramByEIP(e,t,i);r="bigint"==typeof n?n:r}}else{if(void 0===i[1][e])throw new Error(`Topic ${e} not defined`);void 0!==i[1][e][t]&&(r=i[1][e][t].v)}if(i[0]===n)break}return BigInt(null!=r?r:0)}paramByEIP(e,t,n){if(!(n in fy))throw new Error(`${n} not supported`);const r=fy[n];if(!(e in r))throw new Error(`Topic ${e} not defined`);if(void 0===r[e][t])return;const i=r[e][t].v;return BigInt(i)}paramByBlock(e,t,n,r,i){const a=this.getHardforkByBlockNumber(n,r,i);return this.paramByHardfork(e,t,a)}isActivatedEIP(e){if(this.eips().includes(e))return!0;for(const t of this.HARDFORK_CHANGES){const n=t[1];if(this.gteHardfork(n.name)&&"eips"in n&&n.eips.includes(e))return!0}return!1}hardforkIsActiveOnBlock(e,t){const n=sy(t,Zg.BigInt),r=null!=e?e:this._hardfork,i=this.hardforkBlock(r);return"bigint"==typeof i&&i!==BigInt(0)&&n>=i}activeOnBlock(e){return this.hardforkIsActiveOnBlock(null,e)}hardforkGteHardfork(e,t){const n=null!=e?e:this._hardfork,r=this.hardforks();let i=-1,a=-1,o=0;for(const e of r)e.name===n&&(i=o),e.name===t&&(a=o),o+=1;return i>=a&&-1!==a}gteHardfork(e){return this.hardforkGteHardfork(null,e)}hardforkBlock(e){var t;const n=null!=e?e:this._hardfork,r=null===(t=this._getHardfork(n))||void 0===t?void 0:t.block;return null==r?null:BigInt(r)}hardforkTimestamp(e){var t;const n=null!=e?e:this._hardfork,r=null===(t=this._getHardfork(n))||void 0===t?void 0:t.timestamp;return null==r?null:BigInt(r)}eipBlock(e){for(const t of this.HARDFORK_CHANGES){const n=t[1];if("eips"in n&&n.eips.includes(e))return this.hardforkBlock("number"==typeof t[0]?String(t[0]):t[0])}return null}hardforkTTD(e){var t;const n=null!=e?e:this._hardfork,r=null===(t=this._getHardfork(n))||void 0===t?void 0:t.ttd;return null==r?null:BigInt(r)}isHardforkBlock(e,t){const n=sy(e,Zg.BigInt),r=null!=t?t:this._hardfork,i=this.hardforkBlock(r);return"bigint"==typeof i&&i!==BigInt(0)&&i===n}nextHardforkBlockOrTimestamp(e){var t,n,r;const i=null!==(t=e)&&void 0!==t?t:this._hardfork,a=this.hardforks();let o=a.findIndex(e=>e.name===i);if(i===Gg.Merge&&(o-=1),o<0)return null;let s=null!==(n=a[o].timestamp)&&void 0!==n?n:a[o].block;s=null!=s?Number(s):null;const u=a.slice(o+1).find(e=>{var t;let n=null!==(t=e.timestamp)&&void 0!==t?t:e.block;return n=null!=n?Number(n):null,e.name!==Gg.Merge&&null!=n&&n!==s});if(void 0===u)return null;const c=null!==(r=u.timestamp)&&void 0!==r?r:u.block;return null==c?null:BigInt(c)}nextHardforkBlock(e){var t;const n=null!==(t=e)&&void 0!==t?t:this._hardfork;let r=this.hardforkBlock(n);if(null===r&&n===Gg.Merge){const e=this.hardforks(),t=e.findIndex(e=>null!==e.ttd&&void 0!==e.ttd);if(t<0)throw Error("Merge hardfork should have been found");r=this.hardforkBlock(e[t-1].name)}return null===r?null:this.hardforks().reduce((e,t)=>{const n=BigInt(null===t.block||void 0!==t.ttd&&null!==t.ttd?0:t.block);return n>r&&null===e?n:e},null)}isNextHardforkBlock(e,t){const n=sy(e,Zg.BigInt),r=null!=t?t:this._hardfork,i=this.nextHardforkBlock(r);return null!==i&&i===n}_calcForkHash(e,t){let n=new Uint8Array,r=0;for(const t of this.hardforks()){const{block:i,timestamp:a,name:o}=t;let s=null!=a?a:i;if(s=null!==s?Number(s):null,"number"==typeof s&&0!==s&&s!==r&&o!==Gg.Merge&&(n=Uh(n,Qh(s.toString(16).padStart(16,"0"))),r=s),t.name===e)break}const i=Uh(t,n);return Zh(function(e){const t=$g(e);return Qh(`0x${Jg(t.slice(2))}`)}(my(i)>>>0))}forkHash(e,t){const n=null!=e?e:this._hardfork,r=this._getHardfork(n);if(null===r||null===(null==r?void 0:r.block)&&void 0===(null==r?void 0:r.timestamp)&&void 0===(null==r?void 0:r.ttd))throw new Error("No fork hash calculation possible for future hardfork");if(null!==(null==r?void 0:r.forkHash)&&void 0!==(null==r?void 0:r.forkHash))return r.forkHash;if(!t)throw new Error("genesisHash required for forkHash calculation");return this._calcForkHash(n,t)}hardforkForForkHash(e){const t=this.hardforks().filter(t=>t.forkHash===e);return t.length>=1?t[t.length-1]:null}setForkHashes(e){var t;for(const n of this.hardforks()){const r=null!==(t=n.timestamp)&&void 0!==t?t:n.block;null!==n.forkHash&&void 0!==n.forkHash||null==r&&void 0===n.ttd||(n.forkHash=this.forkHash(n.name,e))}}genesis(){return this._chainParams.genesis}hardforks(){return this._chainParams.hardforks}bootstrapNodes(){return this._chainParams.bootstrapNodes}dnsNetworks(){return this._chainParams.dnsNetworks}hardfork(){return this._hardfork}chainId(){return BigInt(this._chainParams.chainId)}chainName(){return this._chainParams.name}networkId(){return BigInt(this._chainParams.networkId)}eips(){return this._eips}consensusType(){const e=this.hardfork();let t;for(const n of this.HARDFORK_CHANGES)if("consensus"in n[1]&&(t=n[1].consensus.type),n[0]===e)break;return null!=t?t:this._chainParams.consensus.type}consensusAlgorithm(){const e=this.hardfork();let t;for(const n of this.HARDFORK_CHANGES)if("consensus"in n[1]&&(t=n[1].consensus.algorithm),n[0]===e)break;return null!=t?t:this._chainParams.consensus.algorithm}consensusConfig(){var e;const t=this.hardfork();let n;for(const e of this.HARDFORK_CHANGES)if("consensus"in e[1]&&(n=e[1].consensus[e[1].consensus.algorithm]),e[0]===t)break;return null!==(e=null!=n?n:this._chainParams.consensus[this.consensusAlgorithm()])&&void 0!==e?e:{}}copy(){const e=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return e.removeAllListeners(),e}static _getInitializedChains(e){const t={};for(const[e,n]of Object.entries(zg))t[n]=e.toLowerCase();const n={mainnet:dy,goerli:ly,sepolia:hy};if(e)for(const r of e){const{name:e}=r;t[r.chainId.toString()]=e,n[e]=r}return n.names=t,n}}var yy;!function(e){e[e.EIP155ReplayProtection=155]="EIP155ReplayProtection",e[e.EIP1559FeeMarket=1559]="EIP1559FeeMarket",e[e.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",e[e.EIP2930AccessLists=2930]="EIP2930AccessLists"}(yy||(yy={}));class by{constructor(e){if(20!==e.length)throw new Error("Invalid address length");this.buf=e}static zero(){return new by(ey(20))}equals(e){return zh(this.buf,e.buf)}isZero(){return this.equals(by.zero())}toString(){return Zh(this.buf)}toArray(){return this.buf}static publicToAddress(e,t=!1){let n=e;if(ty(n),t&&64!==n.length&&(n=Lg.ProjectivePoint.fromHex(n).toRawBytes(!1).slice(1)),64!==n.length)throw new Error("Expected pubKey to be of length 64");return vc(n).slice(-20)}}const vy=e=>{let t,n;if(function(e){if(0===e.length)return!0;const t=e[0];return!!Array.isArray(t)}(e)){n=null!=e?e:[];const r=[];for(let e=0;e<n.length;e+=1){const t=n[e],i=Zh(t[0]),a=[];for(let e=0;e<t[1].length;e+=1)a.push(Zh(t[1][e]));const o={address:i,storageKeys:a};r.push(o)}t=r}else{t=e;const r=[];for(let t=0;t<e.length;t+=1){const n=e[t],i=Yg(n.address),a=[];for(let e=0;e<n.storageKeys.length;e+=1)a.push(Yg(n.storageKeys[e]));r.push([i,a])}n=r}return{AccessListJSON:t,accessList:n}},wy=e=>{for(let t=0;t<e.length;t+=1){const n=e[t],r=n[0],i=n[1];if(void 0!==n[2])throw new Error("Access list item cannot have 3 elements. It can only have an address, and an array of storage slots.");if(20!==r.length)throw new Error("Invalid EIP-2930 transaction: address length should be 20 bytes");for(let e=0;e<i.length;e+=1)if(32!==i[e].length)throw new Error("Invalid EIP-2930 transaction: storage slot length should be 32 bytes")}},Ay=e=>{const t=[];for(let n=0;n<e.length;n+=1){const r=e[n],i={address:Zh(ny(r[0],20)),storageKeys:[]},a=r&&r[1];for(let e=0;e<a.length;e+=1){const t=a[e];i.storageKeys.push(Zh(ny(t,32)))}t.push(i)}return t},xy=(e,t)=>{const n=t.param("gasPrices","accessListStorageKeyCost"),r=t.param("gasPrices","accessListAddressCost");let i=0;for(let t=0;t<e.length;t+=1)i+=e[t][1].length;return e.length*Number(r)+i*Number(n)};class ky{constructor(e,t){var n,r;this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=zg.Mainnet,this.DEFAULT_HARDFORK=Gg.Merge;const{nonce:i,gasLimit:a,to:o,value:s,data:u,v:c,r:l,s:d,type:h}=e;this._type=Number(Xg(Yg(h))),this.txOptions=t;const f=Yg(""===o?"0x":o),p=Yg(""===c?"0x":c),m=Yg(""===l?"0x":l),g=Yg(""===d?"0x":d);this.nonce=Xg(Yg(""===i?"0x":i)),this.gasLimit=Xg(Yg(""===a?"0x":a)),this.to=f.length>0?new by(f):void 0,this.value=Xg(Yg(""===s?"0x":s)),this.data=Yg(""===u?"0x":u),this.v=p.length>0?Xg(p):void 0,this.r=m.length>0?Xg(m):void 0,this.s=g.length>0?Xg(g):void 0,this._validateCannotExceedMaxInteger({value:this.value,r:this.r,s:this.s}),this._validateCannotExceedMaxInteger({gasLimit:this.gasLimit},64),this._validateCannotExceedMaxInteger({nonce:this.nonce},64,!0);const y=void 0===this.to||null===this.to,b=null!==(n=t.allowUnlimitedInitCodeSize)&&void 0!==n&&n,v=null!==(r=t.common)&&void 0!==r?r:this._getCommon();y&&v.isActivatedEIP(3860)&&!b&&((e,t)=>{const n=e.param("vm","maxInitCodeSize");if(n&&BigInt(t)>n)throw new Error(`the initcode size of this transaction is too large: it is ${t} while the max is ${e.param("vm","maxInitCodeSize")}`)})(v,this.data.length)}get type(){return this._type}supports(e){return this.activeCapabilities.includes(e)}validate(e=!1){const t=[];return this.getBaseFee()>this.gasLimit&&t.push(`gasLimit is too low. given ${this.gasLimit}, need at least ${this.getBaseFee()}`),this.isSigned()&&!this.verifySignature()&&t.push("Invalid Signature"),e?t:0===t.length}_validateYParity(){const{v:e}=this;if(void 0!==e&&e!==BigInt(0)&&e!==BigInt(1)){const e=this._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(e)}}_validateHighS(){const{s:e}=this;if(this.common.gteHardfork("homestead")&&void 0!==e&&e>Dg){const e=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(e)}}getBaseFee(){const e=this.common.param("gasPrices","tx");let t=this.getDataFee();if(e&&(t+=e),this.common.gteHardfork("homestead")&&this.toCreationAddress()){const e=this.common.param("gasPrices","txCreation");e&&(t+=e)}return t}getDataFee(){const e=this.common.param("gasPrices","txDataZero"),t=this.common.param("gasPrices","txDataNonZero");let n=BigInt(0);for(let r=0;r<this.data.length;r+=1)0===this.data[r]?n+=e:n+=t;if((void 0===this.to||null===this.to)&&this.common.isActivatedEIP(3860)){const e=BigInt(Math.ceil(this.data.length/32));n+=this.common.param("gasPrices","initCodeWordCost")*e}return n}toCreationAddress(){return void 0===this.to||0===this.to.buf.length}isSigned(){const{v:e,r:t,s:n}=this;return void 0!==e&&void 0!==t&&void 0!==n}verifySignature(){try{const e=this.getSenderPublicKey();return 0!==ry(e).length}catch(e){return!1}}getSenderAddress(){return new by(by.publicToAddress(this.getSenderPublicKey()))}sign(e){if(32!==e.length){const e=this._errorMsg("Private key must be 32 bytes in length.");throw new Error(e)}let t=!1;0===this.type&&this.common.gteHardfork("spuriousDragon")&&!this.supports(yy.EIP155ReplayProtection)&&(this.activeCapabilities.push(yy.EIP155ReplayProtection),t=!0);const n=this.getMessageToSign(!0),{v:r,r:i,s:a}=this._ecsign(n,e),o=this._processSignature(r,i,a);if(t){const e=this.activeCapabilities.indexOf(yy.EIP155ReplayProtection);e>-1&&this.activeCapabilities.splice(e,1)}return o}_getCommon(e,t){var n,r,i,a;if(void 0!==t){const n=Xg(Yg(t));if(e){if(e.chainId()!==n){const e=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(e)}return e.copy()}return gy.isSupportedChainId(n)?new gy({chain:n,hardfork:this.DEFAULT_HARDFORK}):gy.custom({name:"custom-chain",networkId:n,chainId:n},{baseChain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})}if((null==e?void 0:e.copy)&&"function"==typeof(null==e?void 0:e.copy))return e.copy();if(e){const t="function"==typeof e.hardfork?e.hardfork():e.hardfork;return gy.custom({name:"custom-chain",networkId:e.networkId?e.networkId():null!==(r=BigInt(null===(n=e.customChain)||void 0===n?void 0:n.networkId))&&void 0!==r?r:void 0,chainId:e.chainId?e.chainId():null!==(a=BigInt(null===(i=e.customChain)||void 0===i?void 0:i.chainId))&&void 0!==a?a:void 0},{baseChain:this.DEFAULT_CHAIN,hardfork:t||this.DEFAULT_HARDFORK})}return new gy({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})}_validateCannotExceedMaxInteger(e,t=256,n=!1){for(const[r,i]of Object.entries(e))switch(t){case 64:if(n){if(void 0!==i&&i>=Hg){const e=this._errorMsg(`${r} cannot equal or exceed MAX_UINT64 (2^64-1), given ${i}`);throw new Error(e)}}else if(void 0!==i&&i>Hg){const e=this._errorMsg(`${r} cannot exceed MAX_UINT64 (2^64-1), given ${i}`);throw new Error(e)}break;case 256:if(n){if(void 0!==i&&i>=qg){const e=this._errorMsg(`${r} cannot equal or exceed MAX_INTEGER (2^256-1), given ${i}`);throw new Error(e)}}else if(void 0!==i&&i>qg){const e=this._errorMsg(`${r} cannot exceed MAX_INTEGER (2^256-1), given ${i}`);throw new Error(e)}break;default:{const e=this._errorMsg("unimplemented bits value");throw new Error(e)}}}static _validateNotArray(e){const t=["nonce","gasPrice","gasLimit","to","value","data","v","r","s","type","baseFee","maxFeePerGas","chainId"];for(const[n,r]of Object.entries(e))if(t.includes(n)&&Array.isArray(r))throw new Error(`${n} cannot be an array`)}_getSharedErrorPostfix(){let e="";try{e=this.isSigned()?Zh(this.hash()):"not available (unsigned)"}catch(t){e="error"}let t="";try{t=this.isSigned().toString()}catch(t){e="error"}let n="";try{n=this.common.hardfork()}catch(e){n="error"}let r=`tx type=${this.type} hash=${e} nonce=${this.nonce} value=${this.value} `;return r+=`signed=${t} hf=${n}`,r}_ecsign(e,t,n){const r=Lg.sign(e,t),i=r.toCompactRawBytes();return{r:i.subarray(0,32),s:i.subarray(32,64),v:void 0===n?BigInt(r.recovery+27):BigInt(r.recovery+35)+BigInt(n)*BigInt(2)}}static fromSerializedTx(e,t={}){}static fromTxData(e,t={}){}}const _y=Qh(2..toString(16).padStart(2,"0"));class Py extends ky{static fromTxData(e,t={}){return new Py(e,t)}static fromSerializedTx(e,t={}){if(!zh(e.subarray(0,1),_y))throw new Error(`Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: 2, received: ${Zh(e.subarray(0,1))}`);const n=uy.Tj.decode(e.subarray(1));if(!Array.isArray(n))throw new Error("Invalid serialized tx input: must be array");return Py.fromValuesArray(n,t)}static fromValuesArray(e,t={}){if(9!==e.length&&12!==e.length)throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");const[n,r,i,a,o,s,u,c,l,d,h,f]=e;return this._validateNotArray({chainId:n,v:d}),rh({nonce:r,maxPriorityFeePerGas:i,maxFeePerGas:a,gasLimit:o,value:u,v:d,r:h,s:f}),new Py({chainId:Xg(n),nonce:r,maxPriorityFeePerGas:i,maxFeePerGas:a,gasLimit:o,to:s,value:u,data:c,accessList:null!=l?l:[],v:void 0!==d?Xg(d):void 0,r:h,s:f},t)}constructor(e,t={}){var n;super(Object.assign(Object.assign({},e),{type:2}),t),this.DEFAULT_HARDFORK="london";const{chainId:r,accessList:i,maxFeePerGas:a,maxPriorityFeePerGas:o}=e;if(this.common=this._getCommon(t.common,r),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(1559))throw new Error("EIP-1559 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([1559,2718,2930]);const s=vy(null!=i?i:[]);if(this.accessList=s.accessList,this.AccessListJSON=s.AccessListJSON,wy(this.accessList),this.maxFeePerGas=Xg(Yg(""===a?"0x":a)),this.maxPriorityFeePerGas=Xg(Yg(""===o?"0x":o)),this._validateCannotExceedMaxInteger({maxFeePerGas:this.maxFeePerGas,maxPriorityFeePerGas:this.maxPriorityFeePerGas}),ky._validateNotArray(e),this.gasLimit*this.maxFeePerGas>qg){const e=this._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)");throw new Error(e)}if(this.maxFeePerGas<this.maxPriorityFeePerGas){const e=this._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error(e)}this._validateYParity(),this._validateHighS(),(null===(n=null==t?void 0:t.freeze)||void 0===n||n)&&Object.freeze(this)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let e=super.getDataFee();return e+=BigInt(xy(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:e,hardfork:this.common.hardfork()}),e}getUpfrontCost(e=BigInt(0)){const t=this.maxPriorityFeePerGas,n=this.maxFeePerGas-e,r=(t<n?t:n)+e;return this.gasLimit*r+this.value}raw(){return[ay(this.chainId),ay(this.nonce),ay(this.maxPriorityFeePerGas),ay(this.maxFeePerGas),ay(this.gasLimit),void 0!==this.to?this.to.buf:Uint8Array.from([]),ay(this.value),this.data,this.accessList,void 0!==this.v?ay(this.v):Uint8Array.from([]),void 0!==this.r?ay(this.r):Uint8Array.from([]),void 0!==this.s?ay(this.s):Uint8Array.from([])]}serialize(){const e=this.raw();return Uh(_y,uy.Tj.encode(e))}getMessageToSign(e=!0){const t=this.raw().slice(0,9),n=Uh(_y,uy.Tj.encode(t));return e?vc(n):n}hash(){if(!this.isSigned()){const e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=vc(this.serialize())),this.cache.hash):vc(this.serialize())}getMessageToVerifySignature(){return this.getMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const e=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(e)}const e=this.getMessageToVerifySignature(),{v:t,r:n,s:r}=this;this._validateHighS();try{return oy(e,t+BigInt(27),ay(n),ay(r))}catch(e){const t=this._errorMsg("Invalid Signature");throw new Error(t)}}_processSignature(e,t,n){const r=Object.assign(Object.assign({},this.txOptions),{common:this.common});return Py.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:e-BigInt(27),r:Xg(t),s:Xg(n)},r)}toJSON(){const e=Ay(this.accessList);return{chainId:iy(this.chainId),nonce:iy(this.nonce),maxPriorityFeePerGas:iy(this.maxPriorityFeePerGas),maxFeePerGas:iy(this.maxFeePerGas),gasLimit:iy(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:iy(this.value),data:Zh(this.data),accessList:e,v:void 0!==this.v?iy(this.v):void 0,r:void 0!==this.r?iy(this.r):void 0,s:void 0!==this.s?iy(this.s):void 0}}errorStr(){let e=this._getSharedErrorPostfix();return e+=` maxFeePerGas=${this.maxFeePerGas} maxPriorityFeePerGas=${this.maxPriorityFeePerGas}`,e}_errorMsg(e){return`${e} (${this.errorStr()})`}}const Ey=Qh(1..toString(16).padStart(2,"0"));class Sy extends ky{static fromTxData(e,t={}){return new Sy(e,t)}static fromSerializedTx(e,t={}){if(!zh(e.subarray(0,1),Ey))throw new Error(`Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: 1, received: ${Zh(e.subarray(0,1))}`);const n=uy.Tj.decode(Uint8Array.from(e.subarray(1)));if(!Array.isArray(n))throw new Error("Invalid serialized tx input: must be array");return Sy.fromValuesArray(n,t)}static fromValuesArray(e,t={}){if(8!==e.length&&11!==e.length)throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");const[n,r,i,a,o,s,u,c,l,d,h]=e;return this._validateNotArray({chainId:n,v:l}),rh({nonce:r,gasPrice:i,gasLimit:a,value:s,v:l,r:d,s:h}),new Sy({chainId:Xg(n),nonce:r,gasPrice:i,gasLimit:a,to:o,value:s,data:u,accessList:null!=c?c:[],v:void 0!==l?Xg(l):void 0,r:d,s:h},t)}constructor(e,t={}){var n;super(Object.assign(Object.assign({},e),{type:1}),t),this.DEFAULT_HARDFORK="berlin";const{chainId:r,accessList:i,gasPrice:a}=e;if(this.common=this._getCommon(t.common,r),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(2930))throw new Error("EIP-2930 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([2718,2930]);const o=vy(null!=i?i:[]);if(this.accessList=o.accessList,this.AccessListJSON=o.AccessListJSON,wy(this.accessList),this.gasPrice=Xg(Yg(""===a?"0x":a)),this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),ky._validateNotArray(e),this.gasPrice*this.gasLimit>qg){const e=this._errorMsg("gasLimit * gasPrice cannot exceed MAX_INTEGER");throw new Error(e)}this._validateYParity(),this._validateHighS(),(null===(n=null==t?void 0:t.freeze)||void 0===n||n)&&Object.freeze(this)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let e=super.getDataFee();return e+=BigInt(xy(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:e,hardfork:this.common.hardfork()}),e}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}raw(){return[ay(this.chainId),ay(this.nonce),ay(this.gasPrice),ay(this.gasLimit),void 0!==this.to?this.to.buf:Uint8Array.from([]),ay(this.value),this.data,this.accessList,void 0!==this.v?ay(this.v):Uint8Array.from([]),void 0!==this.r?ay(this.r):Uint8Array.from([]),void 0!==this.s?ay(this.s):Uint8Array.from([])]}serialize(){const e=this.raw();return Uh(Ey,uy.Tj.encode(e))}getMessageToSign(e=!0){const t=this.raw().slice(0,8),n=Uh(Ey,uy.Tj.encode(t));return e?vc(n):n}hash(){if(!this.isSigned()){const e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=vc(this.serialize())),this.cache.hash):vc(this.serialize())}getMessageToVerifySignature(){return this.getMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const e=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(e)}const e=this.getMessageToVerifySignature(),{v:t,r:n,s:r}=this;this._validateHighS();try{return oy(e,t+BigInt(27),ay(n),ay(r))}catch(e){const t=this._errorMsg("Invalid Signature");throw new Error(t)}}_processSignature(e,t,n){const r=Object.assign(Object.assign({},this.txOptions),{common:this.common});return Sy.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:e-BigInt(27),r:Xg(t),s:Xg(n)},r)}toJSON(){const e=Ay(this.accessList);return{chainId:iy(this.chainId),nonce:iy(this.nonce),gasPrice:iy(this.gasPrice),gasLimit:iy(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:iy(this.value),data:Zh(this.data),accessList:e,v:void 0!==this.v?iy(this.v):void 0,r:void 0!==this.r?iy(this.r):void 0,s:void 0!==this.s?iy(this.s):void 0}}errorStr(){var e,t;let n=this._getSharedErrorPostfix();return n+=` gasPrice=${this.gasPrice} accessListCount=${null!==(t=null===(e=this.accessList)||void 0===e?void 0:e.length)&&void 0!==t?t:0}`,n}_errorMsg(e){return`${e} (${this.errorStr()})`}}function Ty(e,t){const n=Number(e),r=2*Number(t);return n===r+35||n===r+36}class My extends ky{static fromTxData(e,t={}){return new My(e,t)}static fromSerializedTx(e,t={}){const n=uy.Tj.decode(e);if(!Array.isArray(n))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(n,t)}static fromValuesArray(e,t={}){if(6!==e.length&&9!==e.length)throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");const[n,r,i,a,o,s,u,c,l]=e;return rh({nonce:n,gasPrice:r,gasLimit:i,value:o,v:u,r:c,s:l}),new My({nonce:n,gasPrice:r,gasLimit:i,to:a,value:o,data:s,v:u,r:c,s:l},t)}constructor(e,t={}){var n;if(super(Object.assign(Object.assign({},e),{type:0}),t),this.common=this._validateTxV(this.v,t.common),this.gasPrice=Xg(Yg(""===e.gasPrice?"0x":e.gasPrice)),this.gasPrice*this.gasLimit>qg){const e=this._errorMsg("gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)");throw new Error(e)}this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),ky._validateNotArray(e),this.common.gteHardfork("spuriousDragon")&&(this.isSigned()?Ty(this.v,this.common.chainId())&&this.activeCapabilities.push(yy.EIP155ReplayProtection):this.activeCapabilities.push(yy.EIP155ReplayProtection)),(null===(n=null==t?void 0:t.freeze)||void 0===n||n)&&Object.freeze(this)}raw(){return[ay(this.nonce),ay(this.gasPrice),ay(this.gasLimit),void 0!==this.to?this.to.buf:Uint8Array.from([]),ay(this.value),this.data,void 0!==this.v?ay(this.v):Uint8Array.from([]),void 0!==this.r?ay(this.r):Uint8Array.from([]),void 0!==this.s?ay(this.s):Uint8Array.from([])]}serialize(){return uy.Tj.encode(this.raw())}_getMessageToSign(){const e=[ay(this.nonce),ay(this.gasPrice),ay(this.gasLimit),void 0!==this.to?this.to.buf:Uint8Array.from([]),ay(this.value),this.data];return this.supports(yy.EIP155ReplayProtection)&&(e.push(Yg(this.common.chainId())),e.push(ry(Yg(0))),e.push(ry(Yg(0)))),e}getMessageToSign(e=!0){const t=this._getMessageToSign();return e?vc(uy.Tj.encode(t)):t}getDataFee(){return this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork()?this.cache.dataFee.value:(Object.isFrozen(this)&&(this.cache.dataFee={value:super.getDataFee(),hardfork:this.common.hardfork()}),super.getDataFee())}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}hash(){if(!this.isSigned()){const e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=vc(uy.Tj.encode(this.raw()))),this.cache.hash):vc(uy.Tj.encode(this.raw()))}getMessageToVerifySignature(){if(!this.isSigned()){const e=this._errorMsg("This transaction is not signed");throw new Error(e)}const e=this._getMessageToSign();return vc(uy.Tj.encode(e))}getSenderPublicKey(){const e=this.getMessageToVerifySignature(),{v:t,r:n,s:r}=this;this._validateHighS();try{return oy(e,t,ay(n),ay(r),this.supports(yy.EIP155ReplayProtection)?this.common.chainId():void 0)}catch(e){const t=this._errorMsg("Invalid Signature");throw new Error(t)}}_processSignature(e,t,n){let r=e;this.supports(yy.EIP155ReplayProtection)&&(r+=this.common.chainId()*BigInt(2)+BigInt(8));const i=Object.assign(Object.assign({},this.txOptions),{common:this.common});return My.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:r,r:Xg(t),s:Xg(n)},i)}toJSON(){return{nonce:iy(this.nonce),gasPrice:iy(this.gasPrice),gasLimit:iy(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:iy(this.value),data:Zh(this.data),v:void 0!==this.v?iy(this.v):void 0,r:void 0!==this.r?iy(this.r):void 0,s:void 0!==this.s?iy(this.s):void 0}}_validateTxV(e,t){let n;const r=void 0!==e?Number(e):void 0;if(void 0!==r&&r<37&&27!==r&&28!==r)throw new Error(`Legacy txs need either v = 27/28 or v >= 37 (EIP-155 replay protection), got v = ${r}`);if(void 0!==r&&0!==r&&(!t||t.gteHardfork("spuriousDragon"))&&27!==r&&28!==r)if(t){if(!Ty(BigInt(r),t.chainId()))throw new Error(`Incompatible EIP155-based V ${r} and chain id ${t.chainId()}. See the Common parameter of the Transaction constructor to set the chain id.`)}else{let e;e=(r-35)%2==0?35:36,n=BigInt(r-e)/BigInt(2)}return this._getCommon(t,n)}errorStr(){let e=this._getSharedErrorPostfix();return e+=` gasPrice=${this.gasPrice}`,e}_errorMsg(e){return`${e} (${this.errorStr()})`}}const Iy=new Map;class jy{constructor(){}static typeToInt(e){return Number(Xg(Yg(e)))}static registerTransactionType(e,t){const n=jy.typeToInt(e);Iy.set(n,t)}static fromTxData(e,t={}){if(!("type"in e)||void 0===e.type)return My.fromTxData(e,t);const n=jy.typeToInt(e.type);if(0===n)return My.fromTxData(e,t);if(1===n)return Sy.fromTxData(e,t);if(2===n)return Py.fromTxData(e,t);const r=Iy.get(n);if(null==r?void 0:r.fromTxData)return r.fromTxData(e,t);throw new Error(`Tx instantiation with type ${n} not supported`)}static fromSerializedData(e,t={}){if(!(e[0]<=127))return My.fromSerializedTx(e,t);switch(e[0]){case 1:return Sy.fromSerializedTx(e,t);case 2:return Py.fromSerializedTx(e,t);default:{const n=Iy.get(Number(e[0]));if(null==n?void 0:n.fromSerializedTx)return n.fromSerializedTx(e,t);throw new Error(`TypedTransaction with ID ${e[0]} unknown`)}}}static fromBlockBodyData(e,t={}){if(Dh(e))return this.fromSerializedData(e,t);if(Array.isArray(e))return My.fromValuesArray(e,t);throw new Error("Cannot decode transaction: unknown type input")}}var Cy=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};const By=(e,t)=>{let n;if(!t&&"string"==typeof e&&Xd(e)&&66!==e.length)throw new Bo;try{n=Dh(e)?e:Wh(e)}catch(e){throw new Oo}if(!t&&32!==n.byteLength)throw new Bo;return n},Oy=(e,t=!1)=>{const n=Xd(e)?e:tf(e),r=Qh(n),i=Qh(nf(`Ethereum Signed Message:\n${r.byteLength}`)),a=t?r:Uh(i,r);return ep(a)},Ry=(e,t)=>{const n=Oy(e),{messageHash:r,v:i,r:a,s:o,signature:s}=((e,t)=>{const n=By(t),r=Lg.sign(e.substring(2),n),i=r.toCompactRawBytes(),a=r.r.toString(16).padStart(64,"0"),o=r.s.toString(16).padStart(64,"0"),s=r.recovery+27;return{messageHash:e,v:Yh(s),r:`0x${a}`,s:`0x${o}`,signature:`${Zh(i)}${s.toString(16)}`}})(n,t);return{message:e,messageHash:r,v:i,r:a,s:o,signature:s}},Ny=(e,t)=>Cy(void 0,void 0,void 0,function*(){const n=e.sign(Qh(t));if(Bh(n.v)||Bh(n.r)||Bh(n.s))throw new Ks("Signer Error");const r=n.validate(!0);if(r.length>0){let e="Signer Error ";for(const t of r)e+=`${e} ${t}.`;throw new Ks(e)}const i=Zh(n.serialize()),a=ep(i);return{messageHash:Zh(n.getMessageToSign(!0)),v:`0x${n.v.toString(16)}`,r:`0x${n.r.toString(16).padStart(64,"0")}`,s:`0x${n.s.toString(16).padStart(64,"0")}`,rawTransaction:i,transactionHash:Zh(a)}}),Fy=e=>{if(Bh(e))throw new gs;const t=jy.fromSerializedData(Qh(e));return bf(t.getSenderAddress().toString())},Ly=(e,t,n,r,i)=>{if("object"==typeof e){const t=`${e.r}${e.s.slice(2)}${e.v.slice(2)}`;return Ly(e.messageHash,t,n)}if("string"==typeof t&&"string"==typeof n&&!Bh(r)){const a=`${n}${r.slice(2)}${t.slice(2)}`;return Ly(e,a,i)}if(Bh(t))throw new Ro("signature string undefined");const a=n?e:Oy(e);let o=parseInt(t.substring(130),16);o>26&&(o-=27);const s=Lg.Signature.fromCompact(t.slice(2,130)).addRecoveryBit(o).recoverPublicKey(a.replace("0x","")).toRawBytes(!1),u=ep(s.subarray(1));return bf(`0x${u.slice(-40)}`)},Hy=e=>{const t=By(e),n=Lg.getPublicKey(t,!1),r=ep(n.slice(1)).slice(-40);return bf(`0x${r}`)},qy=(e,t)=>{const n=By(e);return`0x${Zh(Lg.getPublicKey(n,t)).slice(4)}`},Dy=(e,t,n)=>Cy(void 0,void 0,void 0,function*(){var r,i,a,o,s,u,c;const l=By(e);let d;if(d=(null==n?void 0:n.salt)?"string"==typeof n.salt?Qh(n.salt):n.salt:cp(32),!Yd(t)&&!Dh(t))throw new Ho;const h="string"==typeof t?Qh(tf(t)):t;let f;if(null==n?void 0:n.iv){if(f="string"==typeof n.iv?Qh(n.iv):n.iv,16!==f.length)throw new qo}else f=cp(16);const p=null!==(r=null==n?void 0:n.kdf)&&void 0!==r?r:"scrypt";let m,g;if("pbkdf2"===p){if(g={dklen:null!==(i=null==n?void 0:n.dklen)&&void 0!==i?i:32,salt:Zh(d).replace("0x",""),c:null!==(a=null==n?void 0:n.c)&&void 0!==a?a:262144,prf:"hmac-sha256"},g.c<1e3)throw new Do;m=Cm(h,d,g.c,g.dklen,"sha256")}else{if("scrypt"!==p)throw new No;g={n:null!==(o=null==n?void 0:n.n)&&void 0!==o?o:8192,r:null!==(s=null==n?void 0:n.r)&&void 0!==s?s:8,p:null!==(u=null==n?void 0:n.p)&&void 0!==u?u:1,dklen:null!==(c=null==n?void 0:n.dklen)&&void 0!==c?c:32,salt:Zh(d).replace("0x","")},m=Rm(h,d,g.n,g.p,g.r,g.dklen)}const y=yield pm(l,m.slice(0,16),f,"aes-128-ctr"),b=Zh(y).slice(2),v=ep(Uh(m.slice(16,32),y)).replace("0x","");return{version:3,id:bp(),address:Hy(l).toLowerCase().replace("0x",""),crypto:{ciphertext:b,cipherparams:{iv:Zh(f).replace("0x","")},cipher:"aes-128-ctr",kdf:p,kdfparams:g,mac:v}}}),Uy=(e,t)=>{const n=By(e,t);return{address:Hy(n),privateKey:Zh(n),signTransaction:e=>{throw new Ks("Do not have network access to sign the transaction")},sign:e=>Ry("string"==typeof e?e:JSON.stringify(e),n),encrypt:(e,t)=>Cy(void 0,void 0,void 0,function*(){return Dy(n,e,t)})}},zy=()=>{const e=Lg.utils.randomPrivateKey();return Uy(`${Zh(e)}`)},Gy=(e,t,n)=>Cy(void 0,void 0,void 0,function*(){const r="object"==typeof e?e:JSON.parse(n?e.toLowerCase():e);if(qh.validateJSONSchema(Ug,r),3!==r.version)throw new Lo;const i="string"==typeof t?Qh(tf(t)):t;let a;if(qh.validate(["bytes"],[i]),"scrypt"===r.crypto.kdf){const e=r.crypto.kdfparams;a=Rm(i,"string"==typeof e.salt?Qh(e.salt):e.salt,e.n,e.p,e.r,e.dklen)}else{if("pbkdf2"!==r.crypto.kdf)throw new No;{const e=r.crypto.kdfparams;a=Cm(i,"string"==typeof e.salt?Qh(e.salt):e.salt,e.c,e.dklen,"sha256")}}const o=Qh(r.crypto.ciphertext);if(ep(Uh(a.slice(16,32),o)).replace("0x","")!==r.crypto.mac)throw new Fo;const s=yield async function(e,t,n,r="aes-128-ctr",i=!0){if(hm(t,n,r),dm.web){const[a,o]=await fm(r,t,n);if(!i&&"aes-cbc"===o.name){const i=await async function(e,t,n,r){const i=e.slice(-16);for(let e=0;e<16;e++)i[e]^=16^n[e];return(await pm(i,t,n,r)).slice(0,16)}(e,t,n,r);e=Vu(e,i)}const s=await dm.web.subtle.decrypt(o,a,e),u=new Uint8Array(s);if("aes-cbc"===o.name&&!function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(await pm(u,t,n,r),e))throw new Error("AES: wrong padding");return u}if(dm.node){const a=dm.node.createDecipheriv(r,t,n);return a.setAutoPadding(i),Vu(a.update(e),a.final())}throw new Error("The environment doesn't have AES module")}(Qh(r.crypto.ciphertext),a.slice(0,16),Qh(r.crypto.cipherparams.iv));return Uy(s)});var Vy=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};class Wy{constructor(e){this._requestManager=e,this._requests=new Map}get requests(){return[...this._requests.values()].map(e=>e.payload)}add(e){const t=Mp(e),n=new Op;return this._requests.set(t.id,{payload:t,promise:n}),n}execute(e){return Vy(this,void 0,void 0,function*(){var t;if(0===this.requests.length)return Promise.resolve([]);const n=new Op({timeout:null!==(t=null==e?void 0:e.timeout)&&void 0!==t?t:1e3,eagerStart:!0,timeoutMessage:"Batch request timeout"});return this._processBatchRequest(n).catch(e=>n.reject(e)),n.catch(e=>{e instanceof rs&&this._abortAllRequests("Batch request timeout"),n.reject(e)}),n})}_processBatchRequest(e){return Vy(this,void 0,void 0,function*(){var t,n;const r=yield this._requestManager.sendBatch([...this._requests.values()].map(e=>e.payload));if(r.length!==this._requests.size)throw this._abortAllRequests("Invalid batch response"),new lu(r,`Batch request size mismatch the results size. Requests: ${this._requests.size}, Responses: ${r.length}`);const i=this.requests.map(e=>e.id).map(Number).sort((e,t)=>e-t),a=r.map(e=>e.id).map(Number).sort((e,t)=>e-t);if(JSON.stringify(i)!==JSON.stringify(a))throw this._abortAllRequests("Invalid batch response"),new lu(r,`Batch request mismatch the results. Requests: [${i.join()}], Responses: [${a.join()}]`);for(const e of r)wp(e)?null===(t=this._requests.get(e.id))||void 0===t||t.promise.resolve(e.result):Ap(e)&&(null===(n=this._requests.get(e.id))||void 0===n||n.promise.reject(e.error));e.resolve(r)})}_abortAllRequests(e){for(const{promise:t}of this._requests.values())t.reject(new is(e))}}class Ky extends zp{constructor(e){var t;if(super(),this.providers=im.providers,Rf(e)||"string"==typeof e&&""!==e.trim()||em(e))return this._requestManager=new im(e),void(this._subscriptionManager=new om(this._requestManager,{}));const{config:n,provider:r,requestManager:i,subscriptionManager:a,registeredSubscriptions:o,accountProvider:s,wallet:u,requestManagerMiddleware:c}=e;this.setConfig(null!=n?n:{}),this._requestManager=null!=i?i:new im(r,null===(t=null==n?void 0:n.enableExperimentalFeatures)||void 0===t?void 0:t.useSubscriptionWhenCheckingBlockTimeout,c),this._subscriptionManager=a||new om(this.requestManager,null!=o?o:{}),s&&(this._accountProvider=s),u&&(this._wallet=u)}get requestManager(){return this._requestManager}get subscriptionManager(){return this._subscriptionManager}get wallet(){return this._wallet}get accountProvider(){return this._accountProvider}static fromContextObject(...e){return new this(...e.reverse())}getContextObject(){var e;return{config:this.config,provider:this.provider,requestManager:this.requestManager,subscriptionManager:this.subscriptionManager,registeredSubscriptions:null===(e=this.subscriptionManager)||void 0===e?void 0:e.registeredSubscriptions,providers:this.providers,wallet:this.wallet,accountProvider:this.accountProvider}}use(e,...t){const n=new e(...[...t,this.getContextObject()]);return this.on(Up.CONFIG_CHANGE,e=>{n.setConfig({[e.name]:e.newValue})}),this[e.name]=n,n}link(e){this.setConfig(e.config),this._requestManager=e.requestManager,this.provider=e.provider,this._subscriptionManager=e.subscriptionManager,this._wallet=e.wallet,this._accountProvider=e._accountProvider,e.on(Up.CONFIG_CHANGE,e=>{this.setConfig({[e.name]:e.newValue})})}registerPlugin(e){if(void 0!==this[e.pluginNamespace])throw new os(e.pluginNamespace);const t={[e.pluginNamespace]:e};t[e.pluginNamespace].link(this),Object.assign(this,t)}get provider(){return this.currentProvider}set provider(e){this.requestManager.setProvider(e)}get currentProvider(){return this.requestManager.provider}set currentProvider(e){this.requestManager.setProvider(e)}get givenProvider(){return Ky.givenProvider}setProvider(e){return this.provider=e,!0}setRequestManagerMiddleware(e){this.requestManager.setMiddleware(e)}get BatchRequest(){return Wy.bind(void 0,this._requestManager)}extend(e){var t;return e.property&&!this[e.property]&&(this[e.property]={}),null===(t=e.methods)||void 0===t||t.forEach(t=>{const n=(...e)=>{return n=this,r=void 0,a=function*(){return this.requestManager.send({method:t.call,params:e})},new((i=void 0)||(i=Promise))(function(e,t){function o(e){try{u(a.next(e))}catch(e){t(e)}}function s(e){try{u(a.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i(function(e){e(n)})).then(o,s)}u((a=a.apply(n,r||[])).next())});var n,r,i,a};e.property?this[e.property][t.name]=n:this[t.name]=n}),this}}Ky.providers=im.providers;class Zy{constructor(e){if(this.toAddress=()=>{if(this.isDirect()){const e=this._iban.slice(4),t=Zy._parseInt(e,36),n=Df(t,40);return bf(n)}throw new Error("Iban is indirect and cannot be converted. Must be length of 34 or 35")},!Zy.isIndirect(e)&&!Zy.isDirect(e))throw new Error("Invalid IBAN was provided");this._iban=e}static isDirect(e){return 34===e.length||35===e.length}isDirect(){return Zy.isDirect(this._iban)}static isIndirect(e){return 20===e.length}isIndirect(){return Zy.isIndirect(this._iban)}static isValid(e){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(e)&&1===Zy._mod9710(Zy._iso13616Prepare(e))}isValid(){return Zy.isValid(this._iban)}static fromBban(e){const t=`0${(98-this._mod9710(this._iso13616Prepare(`XE00${e}`))).toString()}`.slice(-2);return new Zy(`XE${t}${e}`)}static createIndirect(e){return Zy.fromBban(`ETH${e.institution}${e.identifier}`)}static fromAddress(e){if(!kh(e))throw new Ys(e);const t=BigInt($h(e)).toString(36),n=Df(t,15);return Zy.fromBban(n.toUpperCase())}static toIban(e){return Zy.fromAddress(e).toString()}client(){return this.isIndirect()?this._iban.slice(11):""}checksum(){return this._iban.slice(2,4)}institution(){return this.isIndirect()?this._iban.slice(7,11):""}toString(){return this._iban}}Zy._iso13616Prepare=e=>{const t="A".charCodeAt(0),n="Z".charCodeAt(0),r=e.toUpperCase();return`${r.slice(4)}${r.slice(0,4)}`.split("").map(e=>{const r=e.charCodeAt(0);return r>=t&&r<=n?r-t+10:e}).join("")},Zy._parseInt=(e,t)=>[...e].reduce((e,n)=>BigInt(parseInt(n,t))+BigInt(t)*e,BigInt(0)),Zy._mod9710=e=>{let t,n=e;for(;n.length>2;)t=n.slice(0,9),n=`${(parseInt(t,10)%97).toString()}${n.slice(t.length)}`;return parseInt(n,10)%97},Zy.toAddress=e=>new Zy(e).toAddress();var Qy,$y=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};class Jy extends Dp{constructor(e){super(),this[Qy]="Promise",this._promise=new Promise(e)}then(e,t){return $y(this,void 0,void 0,function*(){return this._promise.then(e,t)})}catch(e){return $y(this,void 0,void 0,function*(){return this._promise.catch(e)})}finally(e){return $y(this,void 0,void 0,function*(){return this._promise.finally(e)})}on(e,t){return super.on(e,t),this}once(e,t){return super.once(e,t),this}}Qy=Symbol.toStringTag,n(2791);var Yy=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};function Xy(e){return Yy(this,void 0,void 0,function*(){return e.send({method:"eth_syncing",params:[]})})}function eb(e,t){return Yy(this,void 0,void 0,function*(){return e.send({method:"eth_sendTransaction",params:[t]})})}function tb(e,t){return Yy(this,void 0,void 0,function*(){return qh.validate(["hex"],[t]),e.send({method:"eth_sendRawTransaction",params:[t]})})}function nb(e,t,n){return Yy(this,void 0,void 0,function*(){return qh.validate(["blockNumberOrTag","bool"],[t,n]),e.send({method:"eth_getBlockByNumber",params:[t,n]})})}var rb=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})},ib=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};const ab={type:"object",properties:{accessList:{type:"null"},maxFeePerGas:{type:"null"},maxPriorityFeePerGas:{type:"null"}}},ob={type:"object",properties:{maxFeePerGas:{type:"null"},maxPriorityFeePerGas:{type:"null"}}},sb={type:"object",properties:{gasPrice:{type:"null"}}},ub=(e,t,n)=>{try{qh.validateJSONSchema(e,t)}catch(e){if(e instanceof Qd)throw new Qs(e.errors,n);throw e}},cb=e=>{var t,n;const r=e;if(!Bh(r.type)){let e;switch(r.type){case"0x0":e=ab;break;case"0x1":e=ob;break;case"0x2":e=sb;break;default:return $f({format:"uint"},r.type,ro)}return ub(e,r,r.type),$f({format:"uint"},r.type,ro)}if(!Bh(r.maxFeePerGas)||!Bh(r.maxPriorityFeePerGas))return ub(sb,r,"0x2"),"0x2";if(!Bh(r.accessList))return ub(ob,r,"0x1"),"0x1";const i=null!==(t=r.hardfork)&&void 0!==t?t:null===(n=r.common)||void 0===n?void 0:n.hardfork;if(!Bh(i)){const e=Object.keys(ao).indexOf(i);if(e>=Object.keys(ao).indexOf("london"))return Bh(r.gasPrice)?"0x2":"0x0";if(e===Object.keys(ao).indexOf("berlin"))return"0x0"}return Bh(r.gasPrice)?void 0:(ub(ab,r,"0x0"),"0x0")},lb=(e,t)=>{var n;return(null!==(n=null==t?void 0:t.transactionTypeParser)&&void 0!==n?n:cb)(e)},db={type:"array",items:Object.assign({},{type:"object",properties:{address:{format:"address"},storageKeys:{type:"array",items:{format:"bytes32"}}}})},hb={type:"object",properties:{accessList:Object.assign({},db),gasUsed:{type:"string"}}},fb={type:"string",enum:["goerli","kovan","mainnet","rinkeby","ropsten","sepolia"]},pb={type:"string",enum:["arrowGlacier","berlin","byzantium","chainstart","constantinople","dao","homestead","istanbul","london","merge","muirGlacier","petersburg","shanghai","spuriousDragon","tangerineWhistle"]},mb={type:"object",properties:{from:{format:"address"},to:{oneOf:[{format:"address"},{type:"null"}]},value:{format:"uint"},gas:{format:"uint"},gasPrice:{format:"uint"},effectiveGasPrice:{format:"uint"},type:{format:"uint"},maxFeePerGas:{format:"uint"},maxPriorityFeePerGas:{format:"uint"},accessList:Object.assign({},db),data:{format:"bytes"},input:{format:"bytes"},nonce:{format:"uint"},chain:Object.assign({},fb),hardfork:Object.assign({},pb),chainId:{format:"uint"},networkId:{format:"uint"},common:{type:"object",properties:{customChain:Object.assign({},{type:"object",properties:{name:{format:"string"},networkId:{format:"uint"},chainId:{format:"uint"}}}),baseChain:Object.assign({},fb),hardfork:Object.assign({},pb)}},gasLimit:{format:"uint"},v:{format:"uint"},r:{format:"bytes32"},s:{format:"bytes32"}}},gb={type:"object",properties:Object.assign(Object.assign({},mb.properties),{blockHash:{format:"bytes32"},blockNumber:{format:"uint"},hash:{format:"bytes32"},transactionIndex:{format:"uint"},from:{format:"address"},to:{oneOf:[{format:"address"},{type:"null"}]},value:{format:"uint"},gas:{format:"uint"},gasPrice:{format:"uint"},effectiveGasPrice:{format:"uint"},type:{format:"uint"},maxFeePerGas:{format:"uint"},maxPriorityFeePerGas:{format:"uint"},accessList:Object.assign({},db),data:{format:"bytes"},input:{format:"bytes"},nonce:{format:"uint"},gasLimit:{format:"uint"},v:{format:"uint"},r:{format:"bytes32"},s:{format:"bytes32"}})},yb={type:"object",properties:{index:{format:"uint"},validatorIndex:{format:"uint"},address:{format:"address"},amount:{format:"uint"}}},bb={type:"object",properties:{baseFeePerGas:{format:"uint"},blobGasUsed:{format:"uint"},difficulty:{format:"uint"},excessBlobGas:{format:"uint"},extraData:{format:"bytes"},gasLimit:{format:"uint"},gasUsed:{format:"uint"},hash:{format:"bytes32"},logsBloom:{format:"bytes256"},miner:{format:"bytes"},mixHash:{format:"bytes32"},nonce:{format:"uint"},number:{format:"uint"},parentBeaconBlockRoot:{format:"bytes32"},parentHash:{format:"bytes32"},receiptsRoot:{format:"bytes32"},sha3Uncles:{format:"bytes32"},size:{format:"uint"},stateRoot:{format:"bytes32"},timestamp:{format:"uint"},totalDifficulty:{format:"uint"},transactions:{oneOf:[{type:"array",items:Object.assign({},gb)},{type:"array",items:{format:"bytes32"}}]},transactionsRoot:{format:"bytes32"},uncles:{type:"array",items:{format:"bytes32"}},withdrawals:{type:"array",items:Object.assign({},yb)},withdrawalsRoot:{format:"bytes32"}}},vb={type:"object",properties:{author:{format:"bytes32"},excessDataGas:{format:"uint"},baseFeePerGas:{format:"uint"},blobGasUsed:{format:"uint"},difficulty:{format:"uint"},excessBlobGas:{format:"uint"},extraData:{format:"bytes"},gasLimit:{format:"uint"},gasUsed:{format:"uint"},hash:{format:"bytes32"},logsBloom:{format:"bytes256"},miner:{format:"bytes"},mixHash:{format:"bytes32"},nonce:{format:"uint"},number:{format:"uint"},parentBeaconBlockRoot:{format:"bytes32"},parentHash:{format:"bytes32"},receiptsRoot:{format:"bytes32"},sha3Uncles:{format:"bytes32"},size:{format:"uint"},stateRoot:{format:"bytes32"},timestamp:{format:"uint"},totalDifficulty:{format:"uint"},transactions:{type:"array",items:{format:"bytes32"}},transactionsRoot:{format:"bytes32"},uncles:{type:"array",items:{format:"bytes32"}},withdrawals:{type:"array",items:Object.assign({},yb)},withdrawalsRoot:{format:"bytes32"}}},wb={type:"object",properties:{removed:{format:"bool"},logIndex:{format:"uint"},transactionIndex:{format:"uint"},transactionHash:{format:"bytes32"},blockHash:{format:"bytes32"},blockNumber:{format:"uint"},address:{format:"address"},data:{format:"bytes"},topics:{type:"array",items:{format:"bytes32"}}}},Ab={type:"object",properties:{startingBlock:{format:"string"},currentBlock:{format:"string"},highestBlock:{format:"string"},knownStates:{format:"string"},pulledStates:{format:"string"}}},xb={type:"object",properties:{transactionHash:{format:"bytes32"},transactionIndex:{format:"uint"},blockHash:{format:"bytes32"},blockNumber:{format:"uint"},from:{format:"address"},to:{format:"address"},cumulativeGasUsed:{format:"uint"},gasUsed:{format:"uint"},effectiveGasPrice:{format:"uint"},contractAddress:{format:"address"},logs:{type:"array",items:Object.assign({},wb)},logsBloom:{format:"bytes"},root:{format:"bytes"},status:{format:"uint"},type:{format:"uint"}}},kb={type:"object",properties:{messageHash:{format:"bytes"},r:{format:"bytes32"},s:{format:"bytes32"},v:{format:"bytes"},message:{format:"bytes"},signature:{format:"bytes"}}},_b={type:"object",properties:{oldestBlock:{format:"uint"},baseFeePerGas:{type:"array",items:{format:"uint"}},reward:{type:"array",items:{type:"array",items:{format:"uint"}}},gasUsedRatio:{type:"array",items:{type:"number"}}}},Pb={type:"object",properties:{balance:{format:"uint"},codeHash:{format:"bytes32"},nonce:{format:"uint"},storageHash:{format:"bytes32"},accountProof:{type:"array",items:{format:"bytes32"}},storageProof:{type:"array",items:Object.assign({},{type:"object",properties:{key:{format:"bytes32"},value:{format:"uint"},proof:{type:"array",items:{format:"bytes32"}}}})}}};function Eb(e,t=no,n={transactionSchema:gb,fillInputAndData:!1}){var r,i;let a=Ff({},e);if(Bh(null==e?void 0:e.common)||(a.common=Object.assign({},e.common),Bh(null===(r=e.common)||void 0===r?void 0:r.customChain)||(a.common.customChain=Object.assign({},e.common.customChain))),a=$f(null!==(i=n.transactionSchema)&&void 0!==i?i:gb,a,t),!Bh(a.data)&&!Bh(a.input)&&ff(a.data)!==ff(a.input))throw new qs({data:Zh(a.data),input:Zh(a.input)});return n.fillInputAndData&&(Bh(a.data)?Bh(a.input)||(a.data=a.input):a.input=a.data),Bh(a.gasLimit)||(a.gas=a.gasLimit,delete a.gasLimit),a}var Sb=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};function Tb(e,t){return Sb(this,void 0,void 0,function*(){const n=yield function(e){return rb(this,void 0,void 0,function*(){return e.send({method:"net_version",params:[]})})}(e.requestManager);return $f({format:"uint"},n,t)})}const Mb=e=>Sb(void 0,void 0,void 0,function*(){return function(e){return rb(this,void 0,void 0,function*(){return e.send({method:"net_listening",params:[]})})}(e.requestManager)});var Ib=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};class jb extends Ky{getId(e=this.defaultReturnFormat){return Ib(this,void 0,void 0,function*(){return Tb(this,e)})}getPeerCount(e=this.defaultReturnFormat){return Ib(this,void 0,void 0,function*(){return function(e,t){return Sb(this,void 0,void 0,function*(){const n=yield function(e){return rb(this,void 0,void 0,function*(){return e.send({method:"net_peerCount",params:[]})})}(e.requestManager);return $f({format:"uint"},n,t)})}(this,e)})}isListening(){return Ib(this,void 0,void 0,function*(){return Mb(this)})}}const Cb="ALLEVENTS",Bb={name:Cb,signature:"",type:"event",inputs:[]},Ob={bytes:eo.HEX,number:Xa.NUMBER};var Rb=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};function Nb(e,t,n){return Rb(this,void 0,void 0,function*(){const r=Hb(e,t);if(!Bh(r)){if(r.startsWith("-"))throw new Hs(r);if(Number(r)<0||Number(r)>127)throw new Hs(r);if(Bh(e.gasPrice)&&("0x0"===r||"0x1"===r))return{gasPrice:yield uw(t,n),maxPriorityFeePerGas:void 0,maxFeePerGas:void 0};if("0x2"===r)return Object.assign({gasPrice:void 0},yield function(e,t,n){return Rb(this,void 0,void 0,function*(){var r,i,a,o;const s=yield lw(t,t.defaultBlock,!1,ro);if(Bh(s.baseFeePerGas))throw new Ls;let u;if(Bh(e.gasPrice)&&BigInt(s.baseFeePerGas)===BigInt(0)&&(u=yield uw(t,n)),!Bh(e.gasPrice)||!Bh(u)){const t=$f({format:"uint"},null!==(r=e.gasPrice)&&void 0!==r?r:u,n);return{maxPriorityFeePerGas:t,maxFeePerGas:t}}return{maxPriorityFeePerGas:$f({format:"uint"},null!==(i=e.maxPriorityFeePerGas)&&void 0!==i?i:t.defaultMaxPriorityFeePerGas,n),maxFeePerGas:$f({format:"uint"},null!==(a=e.maxFeePerGas)&&void 0!==a?a:BigInt(s.baseFeePerGas)*BigInt(2)+BigInt(null!==(o=e.maxPriorityFeePerGas)&&void 0!==o?o:t.defaultMaxPriorityFeePerGas),n)}})}(e,t,n))}})}var Fb=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};const Lb=(e,t,n,r)=>{if(void 0!==n&&e in n&&void 0!==n[e]){if("string"==typeof n[e]&&kh(n[e]))return n[e];if(!Xd(n[e])&&Sh(n[e])){if(t.wallet){const r=t.wallet.get($f({format:"uint"},n[e],Ob));if(!Bh(r))return r.address;throw new Zs}throw new Zs}throw"from"===e?new bs(n.from):new vs(n.to)}if("from"===e){if(!Bh(r))return Hy(r);if(!Bh(t.defaultAccount))return t.defaultAccount}},Hb=(e,t)=>{const n=lb(e,t);return Bh(n)?Bh(t.defaultTransactionType)?void 0:$f({format:"uint"},t.defaultTransactionType,ro):n};function qb(e){return Fb(this,void 0,void 0,function*(){var t,n;let r=$f(mb,e.transaction,e.web3Context.defaultReturnFormat);if(Bh(r.from)&&(r.from=Lb("from",e.web3Context,void 0,e.privateKey)),Bh(r.nonce)&&(r.nonce=yield((e,t,...n)=>Fb(void 0,[e,t,...n],void 0,function*(e,t,n=e.defaultReturnFormat){if(Bh(t))throw new Fs;return hw(e,t,e.defaultBlock,n)}))(e.web3Context,r.from,ro)),Bh(r.value)&&(r.value="0x0"),Bh(r.data))Bh(r.input)?r.input="0x":r.input.startsWith("0x")||(r.input=`0x${r.input}`);else{if(!Bh(r.input)&&r.data!==r.input)throw new qs({data:Zh(r.data),input:Zh(r.input)});r.data.startsWith("0x")||(r.data=`0x${r.data}`)}if(Bh(r.common)){if(e.web3Context.defaultCommon){const t=e.web3Context.defaultCommon,n=t.customChain.chainId,i=t.customChain.networkId,a=t.customChain.name;r.common=Object.assign(Object.assign({},t),{customChain:{chainId:n,networkId:i,name:a}})}Bh(r.chain)&&(r.chain=e.web3Context.defaultChain),Bh(r.hardfork)&&(r.hardfork=e.web3Context.defaultHardfork)}if(Bh(r.chainId)&&Bh(null===(t=r.common)||void 0===t?void 0:t.customChain.chainId)&&(r.chainId=yield vw(e.web3Context,ro)),Bh(r.networkId)&&(r.networkId=null!==(n=e.web3Context.defaultNetworkId)&&void 0!==n?n:yield Tb(e.web3Context,ro)),Bh(r.gasLimit)&&!Bh(r.gas)&&(r.gasLimit=r.gas),r.type=Hb(r,e.web3Context),!Bh(r.accessList)||"0x1"!==r.type&&"0x2"!==r.type||(r.accessList=[]),e.fillGasPrice&&(r=Object.assign(Object.assign({},r),yield Nb(r,e.web3Context,ro))),Bh(r.gas)&&Bh(r.gasLimit)&&e.fillGasLimit){const t=yield yw(e.web3Context,r,"latest",ro);r=Object.assign(Object.assign({},r),{gas:$f({format:"uint"},t,ro)})}return r})}var Db=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};function Ub(e,t,n){const r=e.transactionPollingInterval,[i,a]=yp(()=>Db(this,void 0,void 0,function*(){let r;try{r=yield cw(e,Ob)}catch(e){return void console.warn("An error happen while trying to get the block number",e)}const i=r-t;if(i>=e.transactionBlockTimeout)return new Gs({starterBlockNumber:t,numberOfBlocks:i,transactionHash:n})}),r);return[a,{clean:()=>{clearInterval(i)}}]}function zb(e,t){return Db(this,void 0,void 0,function*(){var n,r;const{provider:i}=e.requestManager;let a;const o=yield cw(e,Ob);return a=(null===(r=(n=i).supportsSubscriptions)||void 0===r?void 0:r.call(n))&&e.enableExperimentalFeatures.useSubscriptionWhenCheckingBlockTimeout?yield function(e,t,n){return Db(this,void 0,void 0,function*(){var r;let i,a,o=!0;function s(r,i){i&&console.warn("error happened at subscription. So revert to polling...",i),a.clean(),o=!1;const[s,u]=Ub(e,t,n);a.clean=u.clean,s.catch(e=>r(e))}try{i=yield null===(r=e.subscriptionManager)||void 0===r?void 0:r.subscribe("newHeads"),a={clean:()=>{var t;i.id&&(null===(t=e.subscriptionManager)||void 0===t||t.removeSubscription(i).then(()=>{}).catch(()=>{}))}}}catch(r){return Ub(e,t,n)}return[new Promise((r,a)=>{try{i.on("data",r=>{if(o=!1,!(null==r?void 0:r.number))return;const i=Number(BigInt(r.number)-BigInt(t));i>=e.transactionBlockTimeout&&a(new Gs({starterBlockNumber:t,numberOfBlocks:i,transactionHash:n}))}),i.on("error",e=>{s(a,e)})}catch(e){s(a,e)}setTimeout(()=>{o&&s(a)},1e3*e.blockHeaderTimeout)}),a]})}(e,o,t):Ub(e,o,t),a})}function Gb(e,t,n){return r=this,i=void 0,o=function*(){const[r,i]=gp(e.transactionSendTimeout,new Ds({numberOfSeconds:e.transactionSendTimeout/1e3,transactionHash:n})),[a,o]=yield zb(e,n);try{return yield Promise.race([t(),i,a])}finally{clearTimeout(r),o.clean()}},new((a=void 0)||(a=Promise))(function(e,t){function n(e){try{u(o.next(e))}catch(e){t(e)}}function s(e){try{u(o.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof a?r:new a(function(e){e(r)})).then(n,s)}u((o=o.apply(r,i||[])).next())});var r,i,a,o}var Vb=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};function Wb(e,t,n,r){return Vb(this,void 0,void 0,function*(){var i;const a=null!==(i=e.transactionReceiptPollingInterval)&&void 0!==i?i:e.transactionPollingInterval,[o,s]=pp(()=>Vb(this,void 0,void 0,function*(){try{return(null!=r?r:dw)(e,t,n)}catch(e){return void console.warn("An error happen while trying to get the transaction receipt",e)}}),a),[u,c]=gp(e.transactionPollingTimeout,new zs({numberOfSeconds:e.transactionPollingTimeout/1e3,transactionHash:t})),[l,d]=yield zb(e,t);try{return yield Promise.race([o,c,l])}finally{u&&clearTimeout(u),s&&clearInterval(s),d.clean()}})}const Kb=({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,customTransactionReceiptSchema:r,returnFormat:i})=>{var a;let o=1;const s=setInterval(()=>{var a,u,c,l;a=void 0,u=void 0,l=function*(){if(o>=e.transactionConfirmationBlocks)return void clearInterval(s);const a=yield nb(e.requestManager,Yh(BigInt(t.blockNumber)+BigInt(o)),!1);(null==a?void 0:a.hash)&&(o+=1,n.emit("confirmation",{confirmations:$f({format:"uint"},o,i),receipt:$f(null!=r?r:xb,t,i),latestBlockHash:$f({format:"bytes32"},a.hash,i)}))},new((c=void 0)||(c=Promise))(function(e,t){function n(e){try{i(l.next(e))}catch(e){t(e)}}function r(e){try{i(l.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof c?i:new c(function(e){e(i)})).then(n,r)}i((l=l.apply(a,u||[])).next())})},null!==(a=e.transactionReceiptPollingInterval)&&void 0!==a?a:e.transactionPollingInterval)};var Zb=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};const Qb=e=>!Rf(e)&&"object"==typeof e&&!Rf(e.type)&&"error"===e.type,$b=e=>!Rf(e)&&"object"==typeof e&&!Rf(e.type)&&"event"===e.type,Jb=e=>!Rf(e)&&"object"==typeof e&&!Rf(e.type)&&"function"===e.type,Yb=e=>e.includes("[]")?{type:"tuple[]",name:e.slice(0,-2)}:{type:"tuple",name:e},Xb=e=>{const t=[];for(const n of Object.keys(e)){const r=e[n];"object"==typeof r?t.push(Object.assign(Object.assign({},Yb(n)),{components:Xb(r)})):t.push({name:n,type:e[n]})}return t},ev=(e,t)=>{const n=[];return t.forEach(t=>{if("object"==typeof t.components){if(!t.type.startsWith("tuple"))throw new as(`Invalid value given "${t.type}". Error: components found but type is not tuple.`);const r=t.type.indexOf("["),i=r>=0?t.type.substring(r):"",a=ev(e,t.components);Array.isArray(a)&&e?n.push(`tuple(${a.join(",")})${i}`):e?n.push(`(${a.join()})`):n.push(`(${a.join(",")})${i}`)}else n.push(t.type)}),n},tv=e=>{var t,n,r,i;return Qb(e)||$b(e)||Jb(e)?(null===(t=e.name)||void 0===t?void 0:t.includes("("))?e.name:`${null!==(n=e.name)&&void 0!==n?n:""}(${ev(!1,null!==(r=e.inputs)&&void 0!==r?r:[]).join(",")})`:`(${ev(!1,null!==(i=e.inputs)&&void 0!==i?i:[]).join(",")})`},nv=e=>{if("string"!=typeof e&&!$b(e))throw new as("Invalid parameter value in encodeEventSignature");let t;return t=!e||"function"!=typeof e&&"object"!=typeof e?e:tv(e),ep(t)};function rv(e,t){const n=e.exec(t);return n?.groups}var iv=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,av=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,ov=/^\(.+?\).*?$/,sv=Object.defineProperty,uv=(e,t,n)=>(((e,t,n)=>{t in e?sv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),cv=class extends Error{constructor(e,t={}){const n=t.cause instanceof cv?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof cv&&t.cause.docsPath||t.docsPath;super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...r?[`Docs: https://abitype.dev${r}`]:[],...n?[`Details: ${n}`]:[],"Version: abitype@0.7.1"].join("\n")),uv(this,"details"),uv(this,"docsPath"),uv(this,"metaMessages"),uv(this,"shortMessage"),uv(this,"name","AbiTypeError"),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.shortMessage=e}},lv=/^struct (?<name>[a-zA-Z0-9_]+) \{(?<properties>.*?)\}$/;function dv(e){return lv.test(e)}function hv(e){return rv(lv,e)}var fv=new Set(["memory","indexed","storage","calldata"]),pv=new Set(["calldata","memory","storage"]),mv=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]),gv=/^(?<type>[a-zA-Z0-9_]+?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z0-9_]+))?$/,yv=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z0-9_]+))?$/,bv=/^u?int$/;function vv(e,t){const n=function(e,t){return t?`${t}:${e}`:e}(e,t?.type);if(mv.has(n))return mv.get(n);const r=ov.test(e),i=rv(r?yv:gv,e);if(!i)throw new cv("Invalid ABI parameter.",{details:e});if(i.name&&function(e){return"address"===e||"bool"===e||"function"===e||"string"===e||"tuple"===e||iv.test(e)||av.test(e)||xv.test(e)}(i.name))throw new cv("Invalid ABI parameter.",{details:e,metaMessages:[`"${i.name}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]});const a=i.name?{name:i.name}:{},o="indexed"===i.modifier?{indexed:!0}:{},s=t?.structs??{};let u,c={};if(r){u="tuple";const e=wv(i.type),t=[],n=e.length;for(let r=0;r<n;r++)t.push(vv(e[r],{structs:s}));c={components:t}}else if(i.type in s)u="tuple",c={components:s[i.type]};else if(bv.test(i.type))u=`${i.type}256`;else if(u=i.type,"struct"!==t?.type&&!Av(u))throw new cv("Unknown type.",{metaMessages:[`Type "${u}" is not a valid ABI type.`]});if(i.modifier){if(!t?.modifiers?.has?.(i.modifier))throw new cv("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${i.modifier}" not allowed${t?.type?` in "${t.type}" type`:""}.`]});if(pv.has(i.modifier)&&!function(e,t){return t||"bytes"===e||"string"===e||"tuple"===e}(u,!!i.array))throw new cv("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${i.modifier}" not allowed${t?.type?` in "${t.type}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${i.modifier}" was given.`]})}const l={type:`${u}${i.array??""}`,...a,...o,...c};return mv.set(n,l),l}function wv(e,t=[],n="",r=0){if(""===e){if(""===n)return t;if(0!==r)throw new cv("Unbalanced parentheses.",{metaMessages:[`"${n.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`});return[...t,n.trim()]}const i=e.length;for(let a=0;a<i;a++){const i=e[a],o=e.slice(a+1);switch(i){case",":return 0===r?wv(o,[...t,n.trim()]):wv(o,t,`${n}${i}`,r);case"(":return wv(o,t,`${n}${i}`,r+1);case")":return wv(o,t,`${n}${i}`,r-1);default:return wv(o,t,`${n}${i}`,r)}}return[]}function Av(e){return"address"===e||"bool"===e||"function"===e||"string"===e||iv.test(e)||av.test(e)}var xv=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;var kv=/^(?<type>[a-zA-Z0-9_]+?)(?<array>(?:\[\d*?\])+?)?$/;function _v(e,t,n=new Set){const r=[],i=e.length;for(let a=0;a<i;a++){const i=e[a];if(ov.test(i.type))r.push(i);else{const e=rv(kv,i.type);if(!e?.type)throw new cv("Invalid ABI parameter.",{details:JSON.stringify(i,null,2),metaMessages:["ABI parameter type is invalid."]});const{array:a,type:o}=e;if(o in t){if(n.has(o))throw new cv("Circular reference detected.",{metaMessages:[`Struct "${o}" is a circular reference.`]});r.push({...i,type:`tuple${a??""}`,components:_v(t[o]??[],t,new Set([...n,o]))})}else{if(!Av(o))throw new cv("Unknown type.",{metaMessages:[`Type "${o}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]});r.push(i)}}}return r}const Pv=32;function Ev(e=0){var t;if(void 0!==(null===(t=globalThis.Buffer)||void 0===t?void 0:t.alloc)){const t=globalThis.Buffer.alloc(e);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return new Uint8Array(e)}function Sv(e){var t,n;return Object.assign(Object.assign({},e),{name:null!==(t=e.name)&&void 0!==t?t:"",components:null===(n=e.components)||void 0===n?void 0:n.map(e=>Sv(e))})}function Tv(e){return e.map(e=>{var t,n,r;if(!Rf(n=e)&&"object"==typeof n&&!Rf(n.type)&&"string"==typeof n.type)return e;if("string"==typeof e)return Sv(function(e){let t;if("string"==typeof e)t=vv(e,{modifiers:fv});else{const n=function(e){const t={},n=e.length;for(let r=0;r<n;r++){const n=e[r];if(!dv(n))continue;const i=hv(n);if(!i)throw new cv("Invalid struct signature.",{details:n});const a=i.properties.split(";"),o=[],s=a.length;for(let e=0;e<s;e++){const t=a[e].trim();if(!t)continue;const n=vv(t,{type:"struct"});o.push(n)}if(!o.length)throw new cv("Invalid struct signature.",{details:n,metaMessages:["No properties exist."]});t[i.name]=o}const r={},i=Object.entries(t),a=i.length;for(let e=0;e<a;e++){const[n,a]=i[e];r[n]=_v(a,t)}return r}(e),r=e.length;for(let i=0;i<r;i++){const r=e[i];if(!dv(r)){t=vv(r,{modifiers:fv,structs:n});break}}}if(!t)throw new cv("Failed to parse ABI parameter.",{details:`parseAbiParameter(${JSON.stringify(e,null,2)})`,docsPath:"/api/human.html#parseabiparameter-1"});return t}(e.replace(/tuple/,"")));if("object"==typeof(r=e)&&void 0===r.components&&void 0===r.name){const n=Object.keys(e)[0],r=Yb(n);return r.name=null!==(t=r.name)&&void 0!==t?t:"",Object.assign(Object.assign({},r),{components:Xb(e[n])})}throw new as("Invalid abi")})}function Mv(e){const t=e.type.lastIndexOf("["),n=e.type.substring(0,t),r=e.type.substring(t);let i=-1;if("[]"!==r&&(i=Number(r.slice(1,-1)),isNaN(i)))throw new as("Invalid fixed array size",{size:r});return{param:{type:n,name:"",components:e.components},size:i}}function Iv(e){var t,n;return!("string"!==e.type&&"bytes"!==e.type&&!e.type.endsWith("[]"))||("tuple"===e.type?null!==(n=null===(t=e.components)||void 0===t?void 0:t.some(Iv))&&void 0!==n&&n:!!e.type.endsWith("]")&&Iv(Mv(e).param))}const jv=new Map;let Cv=BigInt(256);for(let e=8;e<=256;e+=8)jv.set(`uint${e}`,{min:BigInt(0),max:Cv-BigInt(1)}),jv.set(`int${e}`,{min:-Cv/BigInt(2),max:Cv/BigInt(2)-BigInt(1)}),Cv*=BigInt(256);jv.set("int",jv.get("int256")),jv.set("uint",jv.get("uint256"));const Bv=BigInt(1)<<BigInt(256);function Ov(e,t=32){let n;return n=e<0?(Bv+e).toString(16):e.toString(16),n=Lf(n,2*t),bh(n)}function Rv(e,t){let n;try{n=mf(t)}catch(n){throw new as("provided input is not number value",{type:e.type,value:t,name:e.name})}const r=jv.get(e.type);if(!r)throw new as("provided abi contains invalid number datatype",{type:e.type});if(n<r.min)throw new as("provided input is less then minimum for given type",{type:e.type,value:t,name:e.name,minimum:r.min.toString()});if(n>r.max)throw new as("provided input is greater then maximum for given type",{type:e.type,value:t,name:e.name,maximum:r.max.toString()});return{dynamic:!1,encoded:Ov(n)}}function Nv(e,t){if(t.length<Pv)throw new as("Not enough bytes left to decode",{param:e,bytesLeft:t.length});const n=t.subarray(0,Pv),r=jv.get(e.type);if(!r)throw new as("provided abi contains invalid number datatype",{type:e.type});const i=function(e,t){const n=mh(e),r=BigInt(n);return r<=t?r:r-Bv}(n,r.max);if(i<r.min)throw new as("decoded value is less then minimum for given type",{type:e.type,value:i,name:e.name,minimum:r.min.toString()});if(i>r.max)throw new as("decoded value is greater then maximum for given type",{type:e.type,value:i,name:e.name,maximum:r.max.toString()});return{result:i,encoded:t.subarray(Pv),consumed:Pv}}function Fv(e,t){if("string"==typeof t&&t.length%2!=0&&(t+="0"),!Ah(t))throw new as("provided input is not valid bytes value",{type:e.type,value:t,name:e.name});const n=Wh(t),[,r]=e.type.split("bytes");if(r){if(Number(r)>32||Number(r)<1)throw new as("invalid bytes type. Static byte type can have between 1 and 32 bytes",{type:e.type});if(Number(r)<n.length)throw new as("provided input size is different than type size",{type:e.type,value:t,name:e.name});const i=Ev(Pv);return i.set(n),{dynamic:!1,encoded:i}}const i=Math.ceil(n.length/Pv),a=Ev(Pv+i*Pv);return a.set(Rv({type:"uint32",name:""},n.length).encoded),a.set(n,Pv),{dynamic:!0,encoded:a}}function Lv(e,t){const[,n]=e.type.split("bytes");let r=Number(n),i=t,a=1,o=0;if(!r){const e=Nv({type:"uint32",name:""},i);r=Number(e.result),o+=e.consumed,i=e.encoded,a=Math.ceil(r/Pv)}if(r>t.length)throw new as("there is not enough data to decode",{type:e.type,encoded:t,size:r});return{result:Zh(i.subarray(0,r)),encoded:i.subarray(a*Pv),consumed:o+a*Pv}}function Hv(e){let t=0,n=0;const r=[],i=[];for(const n of e)n.dynamic?t+=Pv:t+=n.encoded.length;for(const a of e)a.dynamic?(r.push(Rv({type:"uint256",name:""},t+n)),i.push(a),n+=a.encoded.length):r.push(a);return Uh(...r.map(e=>e.encoded),...i.map(e=>e.encoded))}function qv(e,t){if("string"===e.type)return function(e,t){if("string"!=typeof t)throw new as("invalid input, should be string",{input:t});return Fv({type:"bytes",name:""},sf(t))}(0,t);if("bool"===e.type)return function(e,t){let n;try{n=vf(t)}catch(n){if(n instanceof iu)throw new as("provided input is not valid boolean value",{type:e.type,value:t,name:e.name})}return Rv({type:"uint8",name:""},Number(n))}(e,t);if("address"===e.type)return function(e,t){if("string"!=typeof t)throw new as("address type expects string as input type",{value:t,name:e.name,type:e.type});let n=t.toLowerCase();if(n.startsWith("0x")||(n=`0x${n}`),!kh(n))throw new as("provided input is not valid address",{value:t,name:e.name,type:e.type});const r=bh(n),i=Ev(Pv);return i.set(r,12),{dynamic:!1,encoded:i}}(e,t);if("tuple"===e.type)return Uv(e,t);if(e.type.endsWith("]"))return function(e,t){if(!Array.isArray(t))throw new as("Expected value to be array",{abi:e,values:t});const{size:n,param:r}=Mv(e),i=t.map(e=>qv(r,e)),a=-1===n,o=i.length>0&&i[0].dynamic;if(!a&&t.length!==n)throw new as("Given arguments count doesn't match array length",{arrayLength:n,argumentsLength:t.length});if(a||o){const e=Hv(i);if(a){const t=Rv({type:"uint256",name:""},i.length).encoded;return{dynamic:!0,encoded:i.length>0?Uh(t,e):t}}return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:Uh(...i.map(e=>e.encoded))}}(e,t);if(e.type.startsWith("bytes"))return Fv(e,t);if(e.type.startsWith("uint")||e.type.startsWith("int"))return Rv(e,t);throw new as("Unsupported",{param:e,value:t})}function Dv(e,t){if("string"===e.type)return function(e,t){const n=Lv({type:"bytes",name:""},t);return{result:af(n.result),encoded:n.encoded,consumed:n.consumed}}(0,t);if("bool"===e.type)return function(e,t){const n=Nv({type:"uint8",name:""},t);if(n.result>1||n.result<0)throw new as("Invalid boolean value encoded",{boolBytes:t.subarray(0,Pv),numberResult:n});return{result:n.result===BigInt(1),encoded:n.encoded,consumed:Pv}}(0,t);if("address"===e.type)return function(e,t){const n=t.subarray(12,Pv);if(20!==n.length)throw new as("Invalid decoding input, not enough bytes to decode address",{bytes:t});const r=mh(n);return{result:bf(r),encoded:t.subarray(Pv),consumed:Pv}}(0,t);if("tuple"===e.type)return zv(e,t);if(e.type.endsWith("]"))return function(e,t){let{size:n,param:r}=Mv(e),i=0;const a=[];let o=t;if(-1===n){const e=Nv({type:"uint32",name:""},t);n=Number(e.result),i=e.consumed,o=e.encoded}if(Iv(r)){for(let e=0;e<n;e+=1){const t=Nv({type:"uint32",name:""},o.subarray(e*Pv));i+=t.consumed;const n=Dv(r,o.subarray(Number(t.result)));i+=n.consumed,a.push(n.result)}return{result:a,encoded:o.subarray(i),consumed:i}}for(let e=0;e<n;e+=1){const e=Dv(r,t.subarray(i));i+=e.consumed,a.push(e.result)}return{result:a,encoded:t.subarray(i),consumed:i}}(e,t);if(e.type.startsWith("bytes"))return Lv(e,t);if(e.type.startsWith("uint")||e.type.startsWith("int"))return Nv(e,t);throw new as("Unsupported",{param:e,bytes:t})}function Uv(e,t){var n,r,i;let a=!1;if(!Array.isArray(t)&&"object"!=typeof t)throw new as("param must be either Array or Object",{param:e,input:t});const o=t,s=[];for(let u=0;u<(null!==(r=null===(n=e.components)||void 0===n?void 0:n.length)&&void 0!==r?r:0);u+=1){const n=e.components[u];let r;if(Array.isArray(o)){if(u>=o.length)throw new as("input param length missmatch",{param:e,input:t});r=qv(n,o[u])}else{const a=o[null!==(i=n.name)&&void 0!==i?i:""];if(null==a)throw new as("missing input defined in abi",{param:e,input:t,paramName:n.name});r=qv(n,a)}r.dynamic&&(a=!0),s.push(r)}return a?{dynamic:!0,encoded:Hv(s)}:{dynamic:!1,encoded:Uh(...s.map(e=>e.encoded))}}function zv(e,t){const n={__length__:0};let r=0;if(!e.components)return{result:n,encoded:t,consumed:r};let i=0;for(const[a,o]of e.components.entries()){let e;if(Iv(o)){const n=Nv({type:"uint32",name:""},t.subarray(r));e=Dv(o,t.subarray(Number(n.result))),r+=n.consumed,i+=e.consumed}else e=Dv(o,t.subarray(r)),r+=e.consumed;n.__length__+=1,n[a]=e.result,o.name&&""!==o.name&&(n[o.name]=e.result)}return{encoded:t.subarray(r+i),result:n,consumed:r+i}}function Gv(e){const t=[];return e.forEach(e=>{if(Array.isArray(e)){const n=Gv(e);t.push({type:"tuple",components:n,name:""})}else t.push({type:ff(e,!0)})}),t}function Vv(e,t){if((null==e?void 0:e.length)!==t.length)throw new as("Invalid number of values received for given ABI",{expected:null==e?void 0:e.length,received:t.length});return mh(Uv({type:"tuple",name:"",components:Tv(e)},t).encoded)}const Wv=(e,t)=>Vv([e],[t]),Kv=(e,t,n)=>{try{if(e.length>0&&(!t||"0x"===t||"0X"===t))throw new as("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");return function(e,t){return zv({type:"tuple",name:"",components:Tv(e)},bh(t)).result}(e,`0x${t.replace(/0x/i,"")}`)}catch(e){throw new as(`Parameter decoding error: ${e.message}`,{internalErr:e})}},Zv=(e,t)=>Kv(e,t),Qv=(e,t)=>Zv([e],t)[0],$v=e=>{if("string"!=typeof e&&!Jb(e))throw new as("Invalid parameter value in encodeFunctionSignature");let t;return t=!e||"function"!=typeof e&&"object"!=typeof e?e:tv(e),ep(t).slice(0,10)},Jv=(e,t,n=!0)=>{const r=n&&t&&t.length>=10&&t.startsWith("0x")?t.slice(10):t;if(!e.inputs)throw new Ko("No inputs found in the ABI");const i=Zv([...e.inputs],r);return Object.assign(Object.assign({},i),{__method__:tv(e)})},Yv=["bool","string","int","uint","address","fixed","ufixed"],Xv=(e,t,n)=>{const r=Array.isArray(n)?n:[n],i={},a={};for(const[t,n]of e.entries())n.indexed?i[t]=n:a[t]=n;const o=t?Kv(Object.values(a),t):{__length__:0},s=r.length-Object.keys(i).length,u=Object.values(i).map((e,t)=>{return Yv.some(t=>e.type.startsWith(t))?(n=e.type,i=r[t+s],"string"===n?i:Qv(n,i)):r[t+s];var n,i}),c={__length__:0};let l=0,d=0;for(const[t,n]of e.entries())c[t]="string"===n.type?"":void 0,i[t]&&(c[t]=u[l],l+=1),a[t]&&(c[t]=o[String(d)],d+=1),n.name&&(c[n.name]=c[t]),c.__length__+=1;return c},ew=(e,t)=>{if(null==t?void 0:t.data){let n,r,i;try{const a=t.data.slice(0,10),o=e.find(e=>(e=>{if("string"!=typeof e&&!Qb(e))throw new as("Invalid parameter value in encodeErrorSignature");let t;return t=!e||"function"!=typeof e&&"object"!=typeof e?e:tv(e),ep(t)})(e).startsWith(a));(null==o?void 0:o.inputs)?(n=o.name,r=tv(o),i=Zv([...o.inputs],t.data.substring(10))):t.data.startsWith("0x08c379a0")?(n="Error",r="Error(string)",i=Zv([{name:"message",type:"string"}],t.data.substring(10))):t.data.startsWith("0x4e487b71")?(n="Panic",r="Panic(uint256)",i=Zv([{name:"code",type:"uint256"}],t.data.substring(10))):console.error("No matching error abi found for error data",t.data)}catch(e){console.error(e)}n&&t.setDecodedProperties(n,r,i)}};const tw=(e,t)=>{var n,r,i,a,o;if(e instanceof $o&&e.cause instanceof Qo){if(void 0!==t){const i=t.filter(e=>Qb(e));return ew(i,e.cause),{reason:e.cause.message,signature:null===(n=e.cause.data)||void 0===n?void 0:n.slice(0,10),data:null===(r=e.cause.data)||void 0===r?void 0:r.substring(10),customErrorName:e.cause.errorName,customErrorDecodedSignature:e.cause.errorSignature,customErrorArguments:e.cause.errorArgs}}return{reason:e.cause.message,signature:null===(i=e.cause.data)||void 0===i?void 0:i.slice(0,10),data:null===(a=e.cause.data)||void 0===a?void 0:a.substring(10)}}if(e instanceof du&&!Array.isArray(null===(o=e.cause)||void 0===o?void 0:o.errors)&&void 0!==e.cause)return e.cause.message;throw e};function nw(e,t,n){return r=this,i=arguments,o=function*(e,t,n,r=e.defaultReturnFormat){try{return void(yield gw(e,t,e.defaultBlock,r))}catch(e){return tw(e,n)}},new((a=void 0)||(a=Promise))(function(e,t){function n(e){try{u(o.next(e))}catch(e){t(e)}}function s(e){try{u(o.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof a?r:new a(function(e){e(r)})).then(n,s)}u((o=o.apply(r,i||[])).next())});var r,i,a,o}function rw(e,t,n,r,i,a){return o=this,s=void 0,c=function*(){let o,s=a;if(void 0===s&&(void 0!==r?s=tw(r):e.handleRevert&&void 0!==t&&(s=yield nw(e,t,i))),void 0===s)o=new ms(n);else if("string"==typeof s)o=new fs(s,void 0,n);else if(void 0!==s.customErrorName&&void 0!==s.customErrorDecodedSignature&&void 0!==s.customErrorArguments){const e=s;o=new ps(e.reason,e.customErrorName,e.customErrorDecodedSignature,e.customErrorArguments,e.signature,n,e.data)}else o=new fs(s.reason,s.signature,n,s.data);return o},new((u=void 0)||(u=Promise))(function(e,t){function n(e){try{i(c.next(e))}catch(e){t(e)}}function r(e){try{i(c.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof u?i:new u(function(e){e(i)})).then(n,r)}i((c=c.apply(o,s||[])).next())});var o,s,u,c}const iw=(e,t,n,r=no)=>{var i,a,o,s,u,c;let l=Object.assign({},e);const d=$f(wb,t,r);if([Cb,"allEvents"].includes(l.name)){l=n.find(e=>e.signature===t.topics[0])||{anonymous:!0}}if(l.inputs=null!==(a=null!==(i=l.inputs)&&void 0!==i?i:e.inputs)&&void 0!==a?a:[],!l.anonymous){let e=0;(null!==(o=l.inputs)&&void 0!==o?o:[]).forEach(t=>{t.indexed&&(e+=1)}),e>0&&(null==t?void 0:t.topics)&&(null==t?void 0:t.topics.length)!==e+1&&(l=Object.assign(Object.assign({},l),{anonymous:!0,inputs:[]}))}const h=l.anonymous?t.topics:(null!==(s=t.topics)&&void 0!==s?s:[]).slice(1);return Object.assign(Object.assign({},d),{returnValues:Xv([...null!==(u=l.inputs)&&void 0!==u?u:[]],t.data,h),event:l.name,signature:!l.anonymous&&(null===(c=t.topics)||void 0===c?void 0:c.length)>0&&t.topics[0]?t.topics[0]:void 0,raw:{data:t.data,topics:t.topics}})};var aw=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};class ow{constructor({options:e,web3Context:t,promiEvent:n,returnFormat:r}){this.options={checkRevertBeforeSending:!0},this.options=e,this.web3Context=t,this.promiEvent=n,this.returnFormat=r}getReceiptWithEvents(e){var t,n;const r=Object.assign({},null!=e?e:{});if((null===(t=this.options)||void 0===t?void 0:t.contractAbi)&&r.logs&&r.logs.length>0){r.events={};for(const e of r.logs){const t=iw(Bb,e,null===(n=this.options)||void 0===n?void 0:n.contractAbi,this.returnFormat);t.event&&(r.events[t.event]=t)}}return r}checkRevertBeforeSending(e){return aw(this,void 0,void 0,function*(){if(!1!==this.options.checkRevertBeforeSending){let t=e;Bh(e.data)&&Bh(e.input)&&Bh(e.gas)&&(t=Object.assign(Object.assign({},e),{gas:21e3}));const n=yield nw(this.web3Context,t,this.options.contractAbi);if(void 0!==n)throw yield rw(this.web3Context,e,void 0,void 0,this.options.contractAbi,n)}})}emitSending(e){this.promiEvent.listenerCount("sending")>0&&this.promiEvent.emit("sending",e)}populateGasPrice(e){return aw(this,arguments,void 0,function*({transactionFormatted:e,transaction:t}){var n;let r=e;return this.web3Context.config.ignoreGasPricing||(null===(n=this.options)||void 0===n?void 0:n.ignoreGasPricing)||!Bh(e.gasPrice)||!Bh(t.maxPriorityFeePerGas)&&!Bh(t.maxFeePerGas)||(r=Object.assign(Object.assign({},e),yield Nb(e,this.web3Context,ro))),r})}signAndSend(e){return aw(this,arguments,void 0,function*({wallet:e,tx:t}){if(e){const n=yield e.signTransaction(t);return Gb(this.web3Context,()=>aw(this,void 0,void 0,function*(){return tb(this.web3Context.requestManager,n.rawTransaction)}),n.transactionHash)}return Gb(this.web3Context,()=>aw(this,void 0,void 0,function*(){return eb(this.web3Context.requestManager,t)}))})}emitSent(e){this.promiEvent.listenerCount("sent")>0&&this.promiEvent.emit("sent",e)}emitTransactionHash(e){this.promiEvent.listenerCount("transactionHash")>0&&this.promiEvent.emit("transactionHash",e)}emitReceipt(e){this.promiEvent.listenerCount("receipt")>0&&this.promiEvent.emit("receipt",e)}handleError(e){return aw(this,arguments,void 0,function*({error:e,tx:t}){var n;let r=e;return r instanceof $o&&this.web3Context.handleRevert&&(r=yield rw(this.web3Context,t,void 0,void 0,null===(n=this.options)||void 0===n?void 0:n.contractAbi)),(r instanceof du||r instanceof $o||r instanceof ps||r instanceof ms||r instanceof fs||r instanceof zs)&&this.promiEvent.listenerCount("error")>0&&this.promiEvent.emit("error",r),r})}emitConfirmation({receipt:e,transactionHash:t,customTransactionReceiptSchema:n}){this.promiEvent.listenerCount("confirmation")>0&&function(e,t,n,r,i,a){if(Bh(n)||Bh(n.blockHash))throw new Vs({receipt:n,blockHash:$f({format:"bytes32"},null==n?void 0:n.blockHash,i),transactionHash:$f({format:"bytes32"},r,i)});if(!n.blockNumber)throw new Ws({receipt:n});t.emit("confirmation",{confirmations:$f({format:"uint"},1,i),receipt:$f(null!=a?a:xb,n,i),latestBlockHash:$f({format:"bytes32"},n.blockHash,i)});const o=e.requestManager.provider;o&&"supportsSubscriptions"in o&&o.supportsSubscriptions()?(({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,customTransactionReceiptSchema:r,returnFormat:i})=>{let a,o=!0;setImmediate(()=>{var s;null===(s=e.subscriptionManager)||void 0===s||s.subscribe("newHeads").then(s=>{s.on("data",u=>Zb(void 0,void 0,void 0,function*(){var c;if(o=!1,!(null==u?void 0:u.number)||a===(null==u?void 0:u.parentHash))return;a=null==u?void 0:u.parentHash;const l=BigInt(u.number)-BigInt(t.blockNumber)+BigInt(1);n.emit("confirmation",{confirmations:$f({format:"uint"},l,i),receipt:$f(null!=r?r:xb,t,i),latestBlockHash:$f({format:"bytes32"},u.parentHash,i)}),l>=e.transactionConfirmationBlocks&&(yield null===(c=e.subscriptionManager)||void 0===c?void 0:c.removeSubscription(s))})),s.on("error",()=>Zb(void 0,void 0,void 0,function*(){var a;yield null===(a=e.subscriptionManager)||void 0===a?void 0:a.removeSubscription(s),o=!1,Kb({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,customTransactionReceiptSchema:r,returnFormat:i})}))}).catch(()=>{o=!1,Kb({web3Context:e,transactionReceipt:t,customTransactionReceiptSchema:r,transactionPromiEvent:n,returnFormat:i})})}),setTimeout(()=>{o&&Kb({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,returnFormat:i})},1e3*e.blockHeaderTimeout)})({web3Context:e,transactionReceipt:n,transactionPromiEvent:t,customTransactionReceiptSchema:a,returnFormat:i}):Kb({web3Context:e,transactionReceipt:n,transactionPromiEvent:t,customTransactionReceiptSchema:a,returnFormat:i})}(this.web3Context,this.promiEvent,e,t,this.returnFormat,n)}handleResolve(e){return aw(this,arguments,void 0,function*({receipt:e,tx:t}){var n,r,i;if(null===(n=this.options)||void 0===n?void 0:n.transactionResolver)return null===(r=this.options)||void 0===r?void 0:r.transactionResolver(e);if(e.status===BigInt(0)){const n=yield rw(this.web3Context,t,e,void 0,null===(i=this.options)||void 0===i?void 0:i.contractAbi);throw this.promiEvent.listenerCount("error")>0&&this.promiEvent.emit("error",n),n}return e})}}var sw=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};function uw(e,t){return sw(this,void 0,void 0,function*(){const n=yield function(e){return Yy(this,void 0,void 0,function*(){return e.send({method:"eth_gasPrice",params:[]})})}(e.requestManager);return $f({format:"uint"},n,null!=t?t:e.defaultReturnFormat)})}function cw(e,t){return sw(this,void 0,void 0,function*(){const n=yield function(e){return Yy(this,void 0,void 0,function*(){return e.send({method:"eth_blockNumber",params:[]})})}(e.requestManager);return $f({format:"uint"},n,null!=t?t:e.defaultReturnFormat)})}function lw(e){return sw(this,arguments,void 0,function*(e,t=e.defaultBlock,n=!1,r){var i;let a;if(Ah(t)){const r=$f({format:"bytes32"},t,ro);a=yield function(e,t,n){return Yy(this,void 0,void 0,function*(){return qh.validate(["bytes32","bool"],[t,n]),e.send({method:"eth_getBlockByHash",params:[t,n]})})}(e.requestManager,r,n)}else{const r=Mh(t)?t:$f({format:"uint"},t,ro);a=yield nb(e.requestManager,r,n)}const o=$f(bb,a,null!=r?r:e.defaultReturnFormat);return Bh(o)?o:Object.assign(Object.assign({},o),{transactions:null!==(i=o.transactions)&&void 0!==i?i:[]})})}function dw(e,t,n){return sw(this,void 0,void 0,function*(){const r=$f({format:"bytes32"},t,no);let i;try{i=yield function(e,t){return Yy(this,void 0,void 0,function*(){return qh.validate(["bytes32"],[t]),e.send({method:"eth_getTransactionReceipt",params:[t]})})}(e.requestManager,r)}catch(e){if("object"!=typeof e||Bh(e)||!("message"in e)||"transaction indexing is in progress"!==e.message)throw e;console.warn("Transaction indexing is in progress.")}return Bh(i)?i:$f(xb,i,null!=n?n:e.defaultReturnFormat)})}function hw(e,t){return sw(this,arguments,void 0,function*(e,t,n=e.defaultBlock,r){const i=Mh(n)?n:$f({format:"uint"},n,ro),a=yield function(e,t,n){return Yy(this,void 0,void 0,function*(){return qh.validate(["address","blockNumberOrTag"],[t,n]),e.send({method:"eth_getTransactionCount",params:[t,n]})})}(e.requestManager,t,i);return $f({format:"uint"},a,null!=r?r:e.defaultReturnFormat)})}function fw(e,t,n,r={checkRevertBeforeSending:!0},i){const a=new Jy((o,s)=>{setImmediate(()=>{(()=>{sw(this,void 0,void 0,function*(){const u=new ow({web3Context:e,promiEvent:a,options:r,returnFormat:n});let c=Object.assign({},t);Bh(i)||(c=yield i.processTransaction(c));let l=Eb(Object.assign(Object.assign({},c),{from:Lb("from",e,c),to:Lb("to",e,c)}),ro,{transactionSchema:e.config.customTransactionSchema});try{let t;l=yield u.populateGasPrice({transaction:c,transactionFormatted:l}),yield u.checkRevertBeforeSending(l),u.emitSending(l),e.wallet&&!Bh(l.from)&&(t=e.wallet.get(l.from));const r=yield u.signAndSend({wallet:t,tx:l}),i=$f({format:"bytes32"},r,null!=n?n:e.defaultReturnFormat);u.emitSent(l),u.emitTransactionHash(i);const a=yield Wb(e,r,null!=n?n:e.defaultReturnFormat),s=u.getReceiptWithEvents($f(xb,a,null!=n?n:e.defaultReturnFormat));u.emitReceipt(s),o(yield u.handleResolve({receipt:s,tx:l})),u.emitConfirmation({receipt:s,transactionHash:r})}catch(e){s(yield u.handleError({error:e,tx:l}))}})})()})});return a}function pw(e,t,n,r={checkRevertBeforeSending:!0}){const i=new Jy((a,o)=>{setImmediate(()=>{(()=>{sw(this,void 0,void 0,function*(){const s=new ow({web3Context:e,promiEvent:i,options:r,returnFormat:n}),u=$f({format:"bytes"},t,ro),c=jy.fromSerializedData(Wh(Qh(u))),l=Object.assign(Object.assign({},c.toJSON()),{from:c.getSenderAddress().toString()});try{const{v:t,r,s:i}=l,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(l,["v","r","s"]);yield s.checkRevertBeforeSending(o),s.emitSending(u);const c=yield Gb(e,()=>sw(this,void 0,void 0,function*(){return tb(e.requestManager,u)}));s.emitSent(u);const d=$f({format:"bytes32"},c,null!=n?n:e.defaultReturnFormat);s.emitTransactionHash(d);const h=yield Wb(e,c,null!=n?n:e.defaultReturnFormat),f=s.getReceiptWithEvents($f(xb,h,null!=n?n:e.defaultReturnFormat));s.emitReceipt(f),a(yield s.handleResolve({receipt:f,tx:l})),s.emitConfirmation({receipt:f,transactionHash:c})}catch(e){o(yield s.handleError({error:e,tx:l}))}})})()})});return i}function mw(e,t){return sw(this,arguments,void 0,function*(e,t,n=e.defaultReturnFormat){const r=yield function(e,t){return Yy(this,void 0,void 0,function*(){return e.send({method:"eth_signTransaction",params:[t]})})}(e.requestManager,Eb(t,ro,{transactionSchema:e.config.customTransactionSchema}));return Yd(r)?function(e,t,n={fillInputAndData:!1}){return{raw:$f({format:"bytes"},e,t),tx:Eb(Object.assign(Object.assign({},jy.fromSerializedData(Qh(e)).toJSON()),{hash:Zh(Yf(Qh(e))),type:(r=Qh(e),r[0]>127?"0x0":ff(r[0]))}),t,{fillInputAndData:n.fillInputAndData,transactionSchema:n.transactionSchema})};var r}(r,n,{fillInputAndData:!0}):{raw:$f({format:"bytes"},r.raw,n),tx:Eb(r.tx,n,{transactionSchema:e.config.customTransactionSchema,fillInputAndData:!0})}})}function gw(e,t){return sw(this,arguments,void 0,function*(e,t,n=e.defaultBlock,r=e.defaultReturnFormat){const i=Mh(n)?n:$f({format:"uint"},n,ro),a=yield function(e,t,n){return Yy(this,void 0,void 0,function*(){return qh.validate(["blockNumberOrTag"],[n]),e.send({method:"eth_call",params:[t,n]})})}(e.requestManager,Eb(t,ro,{transactionSchema:e.config.customTransactionSchema}),i);return $f({format:"bytes"},a,r)})}function yw(e,t){return sw(this,arguments,void 0,function*(e,t,n=e.defaultBlock,r){const i=Eb(t,ro,{transactionSchema:e.config.customTransactionSchema}),a=Mh(n)?n:$f({format:"uint"},n,ro),o=yield function(e,t,n){return Yy(this,void 0,void 0,function*(){return qh.validate(["blockNumberOrTag"],[n]),e.send({method:"eth_estimateGas",params:[t,n]})})}(e.requestManager,i,a);return $f({format:"uint"},o,null!=r?r:e.defaultReturnFormat)})}function bw(e,t,n){return sw(this,void 0,void 0,function*(){let{toBlock:r,fromBlock:i}=t;Bh(r)||"number"!=typeof r&&"bigint"!=typeof r||(r=Yh(r)),Bh(i)||"number"!=typeof i&&"bigint"!=typeof i||(i=Yh(i));const a=Object.assign(Object.assign({},t),{fromBlock:i,toBlock:r}),o=yield function(e,t){return Yy(this,void 0,void 0,function*(){return qh.validate(["filter"],[t]),e.send({method:"eth_getLogs",params:[t]})})}(e.requestManager,a);return o.map(t=>"string"==typeof t?t:$f(wb,t,null!=n?n:e.defaultReturnFormat))})}function vw(e,t){return sw(this,void 0,void 0,function*(){const n=yield function(e){return Yy(this,void 0,void 0,function*(){return e.send({method:"eth_chainId",params:[]})})}(e.requestManager);return $f({format:"uint"},n,null!=t?t:e.defaultReturnFormat)})}function ww(e,t){return sw(this,arguments,void 0,function*(e,t,n=e.defaultBlock,r){const i=Mh(n)?n:$f({format:"uint"},n,ro),a=yield function(e,t,n){return Yy(this,void 0,void 0,function*(){return qh.validate(["blockNumberOrTag"],[n]),e.send({method:"eth_createAccessList",params:[t,n]})})}(e.requestManager,Eb(t,ro,{transactionSchema:e.config.customTransactionSchema}),i);return $f(hb,a,null!=r?r:e.defaultReturnFormat)})}var Aw=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};class xw extends um{_buildSubscriptionParams(){return["logs",this.args]}formatSubscriptionResult(e){return $f(wb,e,super.returnFormat)}}class kw extends um{_buildSubscriptionParams(){return["newPendingTransactions"]}formatSubscriptionResult(e){return $f({format:"string"},e,super.returnFormat)}}class _w extends um{_buildSubscriptionParams(){return["newHeads"]}formatSubscriptionResult(e){return $f(vb,e,super.returnFormat)}}class Pw extends um{_buildSubscriptionParams(){return["syncing"]}_processSubscriptionResult(e){if("boolean"==typeof e)this.emit("changed",e);else{const t=Object.fromEntries(Object.entries((null==e?void 0:e.status)||e).map(([e,t])=>[e.charAt(0).toLowerCase()+e.substring(1),t]));this.emit("changed",e.syncing),this.emit("data",$f(Ab,t,super.returnFormat))}}}var Ew=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};const Sw={logs:xw,newPendingTransactions:kw,newHeads:_w,syncing:Pw,pendingTransactions:kw,newBlockHeaders:_w};class Tw extends Ky{constructor(e){"string"==typeof e||em(e)?super({provider:e,registeredSubscriptions:Sw}):e.registeredSubscriptions?super(e):(super(Object.assign(Object.assign({},e),{registeredSubscriptions:Sw})),this.getFeeData=this.calculateFeeData)}setTransactionMiddleware(e){this.transactionMiddleware=e}getTransactionMiddleware(){return this.transactionMiddleware}getProtocolVersion(){return Ew(this,void 0,void 0,function*(){return function(e){return Yy(this,void 0,void 0,function*(){return e.send({method:"eth_protocolVersion",params:[]})})}(this.requestManager)})}isSyncing(){return Ew(this,void 0,void 0,function*(){return Xy(this.requestManager)})}getCoinbase(){return Ew(this,void 0,void 0,function*(){return function(e){return Yy(this,void 0,void 0,function*(){return e.send({method:"eth_coinbase",params:[]})})}(this.requestManager)})}isMining(){return Ew(this,void 0,void 0,function*(){return function(e){return Yy(this,void 0,void 0,function*(){return e.send({method:"eth_mining",params:[]})})}(this.requestManager)})}getHashrate(e){return Ew(this,void 0,void 0,function*(){var t;return void 0===e&&(e=null!==(t=this.defaultReturnFormat)&&void 0!==t?t:no),this.getHashRate(e)})}getHashRate(){return Ew(this,arguments,void 0,function*(e=this.defaultReturnFormat){return function(e,t){return sw(this,void 0,void 0,function*(){const n=yield function(e){return Yy(this,void 0,void 0,function*(){return e.send({method:"eth_hashrate",params:[]})})}(e.requestManager);return $f({format:"uint"},n,null!=t?t:e.defaultReturnFormat)})}(this,e)})}getGasPrice(){return Ew(this,arguments,void 0,function*(e=this.defaultReturnFormat){return uw(this,e)})}getMaxPriorityFeePerGas(){return Ew(this,arguments,void 0,function*(e=this.defaultReturnFormat){return function(e,t){return sw(this,void 0,void 0,function*(){const n=yield function(e){return Yy(this,void 0,void 0,function*(){return e.send({method:"eth_maxPriorityFeePerGas",params:[]})})}(e.requestManager);return $f({format:"uint"},n,null!=t?t:e.defaultReturnFormat)})}(this,e)})}calculateFeeData(){return Ew(this,arguments,void 0,function*(e=BigInt(2),t=Gh.Gwei){var n;const r=yield this.getBlock(void 0,!1),i=null!==(n=null==r?void 0:r.baseFeePerGas)&&void 0!==n?n:void 0;let a,o,s;try{a=yield this.getGasPrice()}catch(e){}try{o=yield this.getMaxPriorityFeePerGas()}catch(e){}if(i){let n;o=null!=o?o:t,n="number"==typeof e?BigInt(Math.floor(1e3*e))/BigInt(1e3):e,s=i*n+o}return{gasPrice:a,maxFeePerGas:s,maxPriorityFeePerGas:o,baseFeePerGas:i}})}getAccounts(){return Ew(this,void 0,void 0,function*(){var e;return(null!==(e=yield function(e){return Yy(this,void 0,void 0,function*(){return e.send({method:"eth_accounts",params:[]})})}(this.requestManager))&&void 0!==e?e:[]).map(e=>bf(e))})}getBlockNumber(){return Ew(this,arguments,void 0,function*(e=this.defaultReturnFormat){return cw(this,e)})}getBalance(e){return Ew(this,arguments,void 0,function*(e,t=this.defaultBlock,n=this.defaultReturnFormat){return function(e,t){return sw(this,arguments,void 0,function*(e,t,n=e.defaultBlock,r){const i=Mh(n)?n:$f({format:"uint"},n,ro),a=yield function(e,t,n){return Yy(this,void 0,void 0,function*(){return qh.validate(["address","blockNumberOrTag"],[t,n]),e.send({method:"eth_getBalance",params:[t,n]})})}(e.requestManager,t,i);return $f({format:"uint"},a,null!=r?r:e.defaultReturnFormat)})}(this,e,t,n)})}getStorageAt(e,t){return Ew(this,arguments,void 0,function*(e,t,n=this.defaultBlock,r=this.defaultReturnFormat){return function(e,t,n){return sw(this,arguments,void 0,function*(e,t,n,r=e.defaultBlock,i){const a=$f({format:"uint"},n,ro),o=Mh(r)?r:$f({format:"uint"},r,ro),s=yield function(e,t,n,r){return Yy(this,void 0,void 0,function*(){return qh.validate(["address","hex","blockNumberOrTag"],[t,n,r]),e.send({method:"eth_getStorageAt",params:[t,n,r]})})}(e.requestManager,t,a,o);return $f({format:"bytes"},s,null!=i?i:e.defaultReturnFormat)})}(this,e,t,n,r)})}getCode(e){return Ew(this,arguments,void 0,function*(e,t=this.defaultBlock,n=this.defaultReturnFormat){return function(e,t){return sw(this,arguments,void 0,function*(e,t,n=e.defaultBlock,r){const i=Mh(n)?n:$f({format:"uint"},n,ro),a=yield function(e,t,n){return Yy(this,void 0,void 0,function*(){return qh.validate(["address","blockNumberOrTag"],[t,n]),e.send({method:"eth_getCode",params:[t,n]})})}(e.requestManager,t,i);return $f({format:"bytes"},a,null!=r?r:e.defaultReturnFormat)})}(this,e,t,n)})}getBlock(){return Ew(this,arguments,void 0,function*(e=this.defaultBlock,t=!1,n=this.defaultReturnFormat){return lw(this,e,t,n)})}getBlockTransactionCount(){return Ew(this,arguments,void 0,function*(e=this.defaultBlock,t=this.defaultReturnFormat){return function(e){return sw(this,arguments,void 0,function*(e,t=e.defaultBlock,n){let r;if(Ah(t)){const n=$f({format:"bytes32"},t,ro);r=yield function(e,t){return Yy(this,void 0,void 0,function*(){return qh.validate(["bytes32"],[t]),e.send({method:"eth_getBlockTransactionCountByHash",params:[t]})})}(e.requestManager,n)}else{const n=Mh(t)?t:$f({format:"uint"},t,ro);r=yield function(e,t){return Yy(this,void 0,void 0,function*(){return qh.validate(["blockNumberOrTag"],[t]),e.send({method:"eth_getBlockTransactionCountByNumber",params:[t]})})}(e.requestManager,n)}return $f({format:"uint"},r,null!=n?n:e.defaultReturnFormat)})}(this,e,t)})}getBlockUncleCount(){return Ew(this,arguments,void 0,function*(e=this.defaultBlock,t=this.defaultReturnFormat){return function(e){return sw(this,arguments,void 0,function*(e,t=e.defaultBlock,n){let r;if(Ah(t)){const n=$f({format:"bytes32"},t,ro);r=yield function(e,t){return Yy(this,void 0,void 0,function*(){return qh.validate(["bytes32"],[t]),e.send({method:"eth_getUncleCountByBlockHash",params:[t]})})}(e.requestManager,n)}else{const n=Mh(t)?t:$f({format:"uint"},t,ro);r=yield function(e,t){return Yy(this,void 0,void 0,function*(){return qh.validate(["blockNumberOrTag"],[t]),e.send({method:"eth_getUncleCountByBlockNumber",params:[t]})})}(e.requestManager,n)}return $f({format:"uint"},r,null!=n?n:e.defaultReturnFormat)})}(this,e,t)})}getUncle(){return Ew(this,arguments,void 0,function*(e=this.defaultBlock,t,n=this.defaultReturnFormat){return function(e){return sw(this,arguments,void 0,function*(e,t=e.defaultBlock,n,r){const i=$f({format:"uint"},n,ro);let a;if(Ah(t)){const n=$f({format:"bytes32"},t,ro);a=yield function(e,t,n){return Yy(this,void 0,void 0,function*(){return qh.validate(["bytes32","hex"],[t,n]),e.send({method:"eth_getUncleByBlockHashAndIndex",params:[t,n]})})}(e.requestManager,n,i)}else{const n=Mh(t)?t:$f({format:"uint"},t,ro);a=yield function(e,t,n){return Yy(this,void 0,void 0,function*(){return qh.validate(["blockNumberOrTag","hex"],[t,n]),e.send({method:"eth_getUncleByBlockNumberAndIndex",params:[t,n]})})}(e.requestManager,n,i)}return $f(bb,a,null!=r?r:e.defaultReturnFormat)})}(this,e,t,n)})}getTransaction(e){return Ew(this,arguments,void 0,function*(e,t=this.defaultReturnFormat){const n=yield function(e,t){return sw(this,arguments,void 0,function*(e,t,n=e.defaultReturnFormat){const r=$f({format:"bytes32"},t,no),i=yield function(e,t){return Yy(this,void 0,void 0,function*(){return qh.validate(["bytes32"],[t]),e.send({method:"eth_getTransactionByHash",params:[t]})})}(e.requestManager,r);return Bh(i)?i:Eb(i,n,{transactionSchema:e.config.customTransactionSchema,fillInputAndData:!0})})}(this,e,t);if(!n)throw new ys;return n})}getPendingTransactions(){return Ew(this,arguments,void 0,function*(e=this.defaultReturnFormat){return function(e,t){return sw(this,void 0,void 0,function*(){return(yield function(e){return Yy(this,void 0,void 0,function*(){return e.send({method:"eth_pendingTransactions",params:[]})})}(e.requestManager)).map(n=>Eb(n,null!=t?t:e.defaultReturnFormat,{transactionSchema:e.config.customTransactionSchema,fillInputAndData:!0}))})}(this,e)})}getTransactionFromBlock(){return Ew(this,arguments,void 0,function*(e=this.defaultBlock,t,n=this.defaultReturnFormat){return function(e){return sw(this,arguments,void 0,function*(e,t=e.defaultBlock,n,r){const i=$f({format:"uint"},n,ro);let a;if(Ah(t)){const n=$f({format:"bytes32"},t,ro);a=yield function(e,t,n){return Yy(this,void 0,void 0,function*(){return qh.validate(["bytes32","hex"],[t,n]),e.send({method:"eth_getTransactionByBlockHashAndIndex",params:[t,n]})})}(e.requestManager,n,i)}else{const n=Mh(t)?t:$f({format:"uint"},t,ro);a=yield function(e,t,n){return Yy(this,void 0,void 0,function*(){return qh.validate(["blockNumberOrTag","hex"],[t,n]),e.send({method:"eth_getTransactionByBlockNumberAndIndex",params:[t,n]})})}(e.requestManager,n,i)}return Bh(a)?a:Eb(a,null!=r?r:e.defaultReturnFormat,{transactionSchema:e.config.customTransactionSchema,fillInputAndData:!0})})}(this,e,t,n)})}getTransactionReceipt(e){return Ew(this,arguments,void 0,function*(e,t=this.defaultReturnFormat){const n=yield dw(this,e,t);if(!n)throw new ys;return n})}getTransactionCount(e){return Ew(this,arguments,void 0,function*(e,t=this.defaultBlock,n=this.defaultReturnFormat){return hw(this,e,t,n)})}sendTransaction(e,t=this.defaultReturnFormat,n){return fw(this,e,t,n,this.transactionMiddleware)}sendSignedTransaction(e,t=this.defaultReturnFormat,n){return pw(this,e,t,n)}sign(e,t){return Ew(this,arguments,void 0,function*(e,t,n=this.defaultReturnFormat){return function(e,t,n){return sw(this,arguments,void 0,function*(e,t,n,r=e.defaultReturnFormat){var i;const a=$f({format:"bytes"},t,no);if(null===(i=e.wallet)||void 0===i?void 0:i.get(n)){const t=e.wallet.get(n).sign(a);return $f(kb,t,r)}if("number"==typeof n)throw new ds(t,'RPC method "eth_sign" does not support index signatures');const o=yield function(e,t,n){return Yy(this,void 0,void 0,function*(){return qh.validate(["address","hex"],[t,n]),e.send({method:"eth_sign",params:[t,n]})})}(e.requestManager,n,a);return $f({format:"bytes"},o,r)})}(this,e,t,n)})}signTransaction(e){return Ew(this,arguments,void 0,function*(e,t=this.defaultReturnFormat){return mw(this,e,t)})}call(e){return Ew(this,arguments,void 0,function*(e,t=this.defaultBlock,n=this.defaultReturnFormat){return gw(this,e,t,n)})}estimateGas(e){return Ew(this,arguments,void 0,function*(e,t=this.defaultBlock,n=this.defaultReturnFormat){return yw(this,e,t,n)})}getPastLogs(e){return Ew(this,arguments,void 0,function*(e,t=this.defaultReturnFormat){return bw(this,e,t)})}getWork(){return Ew(this,void 0,void 0,function*(){return function(e){return Yy(this,void 0,void 0,function*(){return e.send({method:"eth_getWork",params:[]})})}(this.requestManager)})}submitWork(e,t,n){return Ew(this,void 0,void 0,function*(){return function(e,t,n,r){return Yy(this,void 0,void 0,function*(){return qh.validate(["bytes8","bytes32","bytes32"],[t,n,r]),e.send({method:"eth_submitWork",params:[t,n,r]})})}(this.requestManager,e,t,n)})}requestAccounts(){return Ew(this,void 0,void 0,function*(){return function(e){return Yy(this,void 0,void 0,function*(){return e.send({method:"eth_requestAccounts",params:[]})})}(this.requestManager)})}getChainId(){return Ew(this,arguments,void 0,function*(e=this.defaultReturnFormat){return vw(this,e)})}getNodeInfo(){return Ew(this,void 0,void 0,function*(){return function(e){return Yy(this,void 0,void 0,function*(){return e.send({method:"web3_clientVersion",params:[]})})}(this.requestManager)})}getProof(e,t){return Ew(this,arguments,void 0,function*(e,t,n=this.defaultBlock,r=this.defaultReturnFormat){return function(e,t,n){return sw(this,arguments,void 0,function*(e,t,n,r=e.defaultBlock,i){const a=n.map(e=>$f({format:"bytes"},e,ro)),o=Mh(r)?r:$f({format:"uint"},r,ro),s=yield function(e,t,n,r){return Yy(this,void 0,void 0,function*(){return qh.validate(["address","bytes32[]","blockNumberOrTag"],[t,n,r]),e.send({method:"eth_getProof",params:[t,n,r]})})}(e.requestManager,t,a,o);return $f(Pb,s,null!=i?i:e.defaultReturnFormat)})}(this,e,t,n,r)})}getFeeHistory(e){return Ew(this,arguments,void 0,function*(e,t=this.defaultBlock,n,r=this.defaultReturnFormat){return function(e,t){return sw(this,arguments,void 0,function*(e,t,n=e.defaultBlock,r,i){const a=$f({format:"uint"},t,ro),o=Mh(n)?n:$f({format:"uint"},n,ro),s=$f({type:"array",items:{format:"uint"}},r,Ob),u=yield function(e,t,n,r){return Yy(this,void 0,void 0,function*(){qh.validate(["hex","blockNumberOrTag"],[t,n]);for(const e of r)qh.validate(["number"],[e]);return e.send({method:"eth_feeHistory",params:[t,n,r]})})}(e.requestManager,a,o,s);return $f(_b,u,null!=i?i:e.defaultReturnFormat)})}(this,e,t,n,r)})}createAccessList(e){return Ew(this,arguments,void 0,function*(e,t=this.defaultBlock,n=this.defaultReturnFormat){return ww(this,e,t,n)})}signTypedData(e,t,n,r){return Ew(this,void 0,void 0,function*(){var i;return void 0===n&&(n=!1),void 0===r&&(r=null!==(i=this.defaultReturnFormat)&&void 0!==i?i:no),function(e,t,n,r,i){return sw(this,void 0,void 0,function*(){const a=yield function(e,t,n,r=!1){return Yy(this,void 0,void 0,function*(){return qh.validate(["address"],[t]),e.send({method:"eth_signTypedData"+(r?"":"_v4"),params:[t,n]})})}(e.requestManager,t,n,r);return $f({format:"bytes"},a,null!=i?i:e.defaultReturnFormat)})}(this,e,t,n,r)})}subscribe(e,t,n){return Ew(this,void 0,void 0,function*(){var r,i;void 0===n&&(n=null!==(r=this.defaultReturnFormat)&&void 0!==r?r:no);const a=yield null===(i=this.subscriptionManager)||void 0===i?void 0:i.subscribe(e,t,n);return a instanceof xw&&"logs"===e&&"object"==typeof t&&!Rf(t.fromBlock)&&Number.isFinite(Number(t.fromBlock))&&setImmediate(()=>{this.getPastLogs(t).then(e=>{for(const t of e)a._processSubscriptionResult(t)}).catch(e=>{a._processSubscriptionError(e)})}),a})}static shouldClearSubscription({sub:e}){return!(e instanceof Pw)}clearSubscriptions(e=!1){var t;return null===(t=this.subscriptionManager)||void 0===t?void 0:t.unsubscribe(e?Tw.shouldClearSubscription:void 0)}createNewPendingTransactionFilter(){return Ew(this,arguments,void 0,function*(e=this.defaultReturnFormat){return function(e,t){return Aw(this,void 0,void 0,function*(){const n=yield function(e){return Yy(this,void 0,void 0,function*(){return e.send({method:"eth_newPendingTransactionFilter",params:[]})})}(e.requestManager);return $f({format:"uint"},n,null!=t?t:e.defaultReturnFormat)})}(this,e)})}createNewFilter(e){return Ew(this,arguments,void 0,function*(e,t=this.defaultReturnFormat){return function(e,t,n){return Aw(this,void 0,void 0,function*(){let{toBlock:r,fromBlock:i}=t;Bh(r)||"number"!=typeof r&&"bigint"!=typeof r||(r=Yh(r)),Bh(i)||"number"!=typeof i&&"bigint"!=typeof i||(i=Yh(i));const a=Object.assign(Object.assign({},t),{fromBlock:i,toBlock:r}),o=yield function(e,t){return Yy(this,void 0,void 0,function*(){return qh.validate(["filter"],[t]),e.send({method:"eth_newFilter",params:[t]})})}(e.requestManager,a);return $f({format:"uint"},o,null!=n?n:e.defaultReturnFormat)})}(this,e,t)})}createNewBlockFilter(){return Ew(this,arguments,void 0,function*(e=this.defaultReturnFormat){return function(e,t){return Aw(this,void 0,void 0,function*(){const n=yield function(e){return Yy(this,void 0,void 0,function*(){return e.send({method:"eth_newBlockFilter",params:[]})})}(e.requestManager);return $f({format:"uint"},n,null!=t?t:e.defaultReturnFormat)})}(this,e)})}uninstallFilter(e){return Ew(this,void 0,void 0,function*(){return function(e,t){return Aw(this,void 0,void 0,function*(){const n=yield function(e,t){return Yy(this,void 0,void 0,function*(){return qh.validate(["hex"],[t]),e.send({method:"eth_uninstallFilter",params:[t]})})}(e.requestManager,Yh(t));return n})}(this,e)})}getFilterChanges(e){return Ew(this,arguments,void 0,function*(e,t=this.defaultReturnFormat){return function(e,t,n){return Aw(this,void 0,void 0,function*(){const r=yield function(e,t){return Yy(this,void 0,void 0,function*(){return qh.validate(["hex"],[t]),e.send({method:"eth_getFilterChanges",params:[t]})})}(e.requestManager,Yh(t));return r.map(t=>"string"==typeof t?t:$f(wb,t,null!=n?n:e.defaultReturnFormat))})}(this,e,t)})}getFilterLogs(e){return Ew(this,arguments,void 0,function*(e,t=this.defaultReturnFormat){return function(e,t,n){return Aw(this,void 0,void 0,function*(){const r=yield function(e,t){return Yy(this,void 0,void 0,function*(){return qh.validate(["hex"],[t]),e.send({method:"eth_getFilterLogs",params:[t]})})}(e.requestManager,Yh(t));return r.map(t=>"string"==typeof t?t:$f(wb,t,null!=n?n:e.defaultReturnFormat))})}(this,e,t)})}}const Mw=e=>{if(Bh(e.gas)||!Ph(e.gas)||Bh(e.gasPrice)||!Ph(e.gasPrice))throw new js({gas:e.gas,gasPrice:e.gasPrice});if(!Bh(e.maxFeePerGas)||!Bh(e.maxPriorityFeePerGas))throw new Os({maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas})},Iw=e=>{if(!Bh(e.gasPrice)&&"0x2"===e.type)throw new Bs(e.gasPrice);if("0x0"===e.type||"0x1"===e.type)throw new Os({maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas});if(Bh(e.maxFeePerGas)||!Ph(e.maxFeePerGas)||Bh(e.maxPriorityFeePerGas)||!Ph(e.maxPriorityFeePerGas))throw new Cs({maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas})};const jw=(e,t,n,...r)=>{return i=void 0,a=[e,t,n,...r],s=function*(e,t,n,r=!1,i=!0){const a=yield(o={transaction:e,web3Context:t,privateKey:n,fillGasPrice:r,fillGasLimit:i},Fb(void 0,void 0,void 0,function*(){var e;return(null!==(e=o.web3Context.transactionBuilder)&&void 0!==e?e:qb)(Object.assign(Object.assign({},o),{transaction:o.transaction}))}));var o;const s=Eb(a,ro,{transactionSchema:t.config.customTransactionSchema});return((e,t,n={transactionSchema:void 0})=>{if(!Bh(t))return void t(e);if("object"!=typeof e||Bh(e))throw new Rs(e);(e=>{if(!Bh(e.common)){if(Bh(e.common.customChain))throw new ws;if(Bh(e.common.customChain.chainId))throw new As;if(!Bh(e.chainId)&&e.chainId!==e.common.customChain.chainId)throw new xs({txChainId:e.chainId,customChainId:e.common.customChain.chainId})}})(e),(e=>{if(!Bh(e.common)&&!Bh(e.chain)&&!Bh(e.hardfork))throw new Ps;if(!Bh(e.chain)&&Bh(e.hardfork)||!Bh(e.hardfork)&&Bh(e.chain))throw new Es({chain:e.chain,hardfork:e.hardfork})})(e),(e=>{if(!Bh(e.common)&&!Bh(e.common.baseChain)&&!Bh(e.chain)&&e.chain!==e.common.baseChain)throw new ks({txChain:e.chain,baseChain:e.common.baseChain})})(e),(e=>{if(!Bh(e.common)&&!Bh(e.common.hardfork)&&!Bh(e.hardfork)&&e.hardfork!==e.common.hardfork)throw new _s({txHardfork:e.hardfork,commonHardfork:e.common.hardfork})})(e);const r=Eb(e,ro,{transactionSchema:n.transactionSchema});if((e=>{const t=!Bh(e.gas)||!Bh(e.gasLimit),n=t&&!Bh(e.gasPrice),r=t&&!Bh(e.maxPriorityFeePerGas)&&!Bh(e.maxFeePerGas);if(!n&&!r)throw new Ts({gas:e.gas,gasPrice:e.gasPrice,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas});if(n&&r)throw new Is({gas:e.gas,gasPrice:e.gasPrice,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas});(n?Mw:Iw)(e),(!Bh(e.type)&&e.type>"0x1"?Iw:Mw)(e)})(r),Bh(r.nonce)||Bh(r.chainId)||r.nonce.startsWith("-")||r.chainId.startsWith("-"))throw new Ns({nonce:e.nonce,chainId:e.chainId})})(s,void 0,{transactionSchema:t.config.customTransactionSchema}),jy.fromTxData((e=>{var t,n;return Object.assign(Object.assign({},e),{nonce:e.nonce,gasPrice:e.gasPrice,gasLimit:null!==(t=e.gasLimit)&&void 0!==t?t:e.gas,to:e.to,value:e.value,data:null!==(n=e.data)&&void 0!==n?n:e.input,type:e.type,chainId:e.chainId,accessList:e.accessList,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas})})(s),((e,t)=>{var n,r,i,a,o,s,u,c,l,d,h,f,p,m,g,y,b,v;let w;if((Bh(e.chain)||Bh(e.hardfork))&&Bh(e.common))t.defaultCommon?(w=Object.assign({},t.defaultCommon),Bh(w.hardfork)&&(w.hardfork=null!==(n=e.hardfork)&&void 0!==n?n:t.defaultHardfork),Bh(w.baseChain)&&(w.baseChain=t.defaultChain)):w=gy.custom({name:"custom-network",chainId:pf(e.chainId),networkId:Bh(e.networkId)?void 0:pf(e.networkId),defaultHardfork:null!==(r=e.hardfork)&&void 0!==r?r:t.defaultHardfork},{baseChain:t.defaultChain});else{const n=null!==(s=null!==(o=null===(a=null===(i=null==e?void 0:e.common)||void 0===i?void 0:i.customChain)||void 0===a?void 0:a.name)&&void 0!==o?o:e.chain)&&void 0!==s?s:"custom-network",r=pf(null!==(l=null===(c=null===(u=null==e?void 0:e.common)||void 0===u?void 0:u.customChain)||void 0===c?void 0:c.chainId)&&void 0!==l?l:null==e?void 0:e.chainId),A=pf(null!==(f=null===(h=null===(d=null==e?void 0:e.common)||void 0===d?void 0:d.customChain)||void 0===h?void 0:h.networkId)&&void 0!==f?f:null==e?void 0:e.networkId),x=null!==(g=null!==(m=null===(p=null==e?void 0:e.common)||void 0===p?void 0:p.hardfork)&&void 0!==m?m:null==e?void 0:e.hardfork)&&void 0!==g?g:t.defaultHardfork,k=null!==(v=null!==(b=null===(y=e.common)||void 0===y?void 0:y.baseChain)&&void 0!==b?b:e.chain)&&void 0!==v?v:t.defaultChain;r&&A&&n&&(w=gy.custom({name:n,chainId:r,networkId:A,defaultHardfork:x},{baseChain:k}))}return{common:w}})(s,t))},new((o=void 0)||(o=Promise))(function(e,t){function n(e){try{u(s.next(e))}catch(e){t(e)}}function r(e){try{u(s.throw(e))}catch(e){t(e)}}function u(t){var i;t.done?e(t.value):(i=t.value,i instanceof o?i:new o(function(e){e(i)})).then(n,r)}u((s=s.apply(i,a||[])).next())});var i,a,o,s},Cw=({address:e},t,n)=>{var r,i;const a=null==n?void 0:n.topics,o=null!==(r=null==n?void 0:n.filter)&&void 0!==r?r:{},s={};if(Rf(null==n?void 0:n.fromBlock)||(s.fromBlock=$f(bb.properties.number,null==n?void 0:n.fromBlock,{number:Xa.HEX,bytes:eo.HEX})),Rf(null==n?void 0:n.toBlock)||(s.toBlock=$f(bb.properties.number,null==n?void 0:n.toBlock,{number:Xa.HEX,bytes:eo.HEX})),a&&Array.isArray(a))s.topics=[...a];else if(s.topics=[],!t||t.anonymous||[Cb,"allEvents"].includes(t.name)||s.topics.push(null!==(i=t.signature)&&void 0!==i?i:nv(tv(t))),![Cb,"allEvents"].includes(t.name)&&t.inputs)for(const e of t.inputs){if(!e.indexed)continue;const t=o[e.name];t?Array.isArray(t)?s.topics.push(t.map(t=>Wv(e.type,t))):"string"===e.type?s.topics.push(Yf(t)):s.topics.push(Wv(e.type,t)):s.topics.push(null)}return s.topics.length||delete s.topics,e&&(s.address=e.toLowerCase()),s},Bw=(e,t,n)=>{const r=Array.isArray(e.inputs)?e.inputs.length:0;if(e.inputs&&r!==t.length)throw new Ko(`The number of arguments is not matching the methods required number. You need to pass ${r} arguments.`);let i;if(i=e.inputs?Vv(Array.isArray(e.inputs)?e.inputs:[],t).replace("0x",""):function(e){try{return mh(Uv({type:"tuple",name:"",components:Gv(e)},e).encoded)}catch(t){throw new as("Could not infer types from given params",{params:e})}}(t).replace("0x",""),!Rf(a=e)&&"object"==typeof a&&!Rf(a.type)&&"constructor"===a.type){if(!n)throw new Ko("The contract has no contract data option set. This is necessary to append the constructor parameters.");return n.startsWith("0x")?`${n}${i}`:`0x${n}${i}`}var a;return`${$v(e)}${i}`};class Ow extends um{constructor(e,t){super(e,t),this.address=e.address,this.topics=e.topics,this.abi=e.abi,this.jsonInterface=e.jsonInterface}_buildSubscriptionParams(){return["logs",{address:this.address,topics:this.topics}]}formatSubscriptionResult(e){return iw(this.abi,e,this.jsonInterface,super.returnFormat)}}Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const Rw=(e,t,n,r)=>{var i,a;const o={};return Rf(e.data)&&"both"!==r||(o.data=Bw(t,n,null!==(i=e.data)&&void 0!==i?i:e.input)),Rf(e.input)&&"both"!==r||(o.input=Bw(t,n,null!==(a=e.input)&&void 0!==a?a:e.data)),Rf(o.input)&&Rf(o.data)&&(o[r]=Bw(t,n)),{data:o.data,input:o.input}},Nw=({abi:e,params:t,options:n,contractOptions:r})=>{var i,a,o;if(!(null!==(o=null!==(a=null!==(i=null==n?void 0:n.input)&&void 0!==i?i:null==n?void 0:n.data)&&void 0!==a?a:r.input)&&void 0!==o?o:r.data)&&!(null==n?void 0:n.to)&&!r.address)throw new Ko("Contract address not specified");if(!(null==n?void 0:n.from)&&!r.from)throw new Ko('Contract "from" address not specified');let s=Ff({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const u=Rw(s,e,t,null==n?void 0:n.dataInputFill);return s=Object.assign(Object.assign({},s),{data:u.data,input:u.input}),s},Fw=e=>"object"==typeof e&&!Rf(e)&&0!==Object.keys(e).length&&!Of(e);class Lw{_contractMethodDeploySend(e){const t={transactionResolver:e=>{if(e.status===BigInt(0))throw new Ko("code couldn't be stored",e);const t=this.parent.clone();return t.options.address=e.contractAddress,t},contractAbi:this.parent.options.jsonInterface,checkRevertBeforeSending:!1};return Bh(this.parent.getTransactionMiddleware())?fw(this.parent,e,this.parent.defaultReturnFormat,t):fw(this.parent,e,this.parent.defaultReturnFormat,t,this.parent.getTransactionMiddleware())}constructor(e,t){this.parent=e,this.deployOptions=t;const{args:n,abi:r,contractOptions:i,deployData:a}=this.calculateDeployParams();this.args=n,this.constructorAbi=r,this.contractOptions=i,this.deployData=a}send(e){const t=Object.assign({},e),n=this.populateTransaction(t);return this._contractMethodDeploySend(n)}populateTransaction(e){var t,n;const r=Object.assign(Object.assign({},this.contractOptions),{from:null!==(n=null!==(t=this.contractOptions.from)&&void 0!==t?t:this.parent.defaultAccount)&&void 0!==n?n:void 0}),i=Nw({abi:this.constructorAbi,params:this.args,options:Object.assign(Object.assign({},e),{dataInputFill:this.parent.contractDataInputFill}),contractOptions:r});return i.dataInputFill&&delete i.dataInputFill,i}calculateDeployParams(){var e,t,n,r,i,a;let o=this.parent.options.jsonInterface.find(e=>"constructor"===e.type);o||(o={type:"constructor",stateMutability:""});const s=$f({format:"bytes"},null!==(t=null===(e=this.deployOptions)||void 0===e?void 0:e.input)&&void 0!==t?t:this.parent.options.input,no),u=$f({format:"bytes"},null!==(r=null===(n=this.deployOptions)||void 0===n?void 0:n.data)&&void 0!==r?r:this.parent.options.data,no);if(!(s&&"0x"!==s.trim()||u&&"0x"!==u.trim()))throw new Ko("contract creation without any data provided.");return{args:null!==(a=null===(i=this.deployOptions)||void 0===i?void 0:i.arguments)&&void 0!==a?a:[],abi:o,contractOptions:Object.assign(Object.assign({},this.parent.options),{input:s,data:u}),deployData:null!=s?s:u}}estimateGas(e){return t=this,n=arguments,i=function*(e,t=this.parent.defaultReturnFormat){const n=Object.assign({},e);return this.parent.contractMethodEstimateGas({abi:this.constructorAbi,params:this.args,returnFormat:t,options:n,contractOptions:this.contractOptions})},new((r=void 0)||(r=Promise))(function(e,a){function o(e){try{u(i.next(e))}catch(e){a(e)}}function s(e){try{u(i.throw(e))}catch(e){a(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(e){e(n)})).then(o,s)}u((i=i.apply(t,n||[])).next())});var t,n,r,i}encodeABI(){return Bw(this.constructorAbi,this.args,$f({format:"bytes"},this.deployData,this.parent.defaultReturnFormat))}decodeData(e){return Object.assign(Object.assign({},Jv(this.constructorAbi,e.replace(this.deployData,""),!1)),{__method__:this.constructorAbi.type})}}class Hw extends om{constructor(e,t){super(e.requestManager,e.registeredSubscriptions),this.parentContract=t}subscribe(e,t){const n=Object.create(null,{subscribe:{get:()=>super.subscribe}});return r=this,i=arguments,o=function*(e,t,r=no){return n.subscribe.call(this,e,null!=t?t:this.parentContract.options,r)},new((a=void 0)||(a=Promise))(function(e,t){function n(e){try{u(o.next(e))}catch(e){t(e)}}function s(e){try{u(o.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof a?r:new a(function(e){e(r)})).then(n,s)}u((o=o.apply(r,i||[])).next())});var r,i,a,o}}var qw=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};const Dw={logs:Ow,newHeads:_w,newBlockHeaders:_w};class Uw extends Ky{get subscriptionManager(){return this._subscriptionManager}constructor(e,t,n,r,i){var a,o,s;const u=Of(t)?t:Of(n)?n:void 0;let c,l;if(c=Fw(t)?t:Fw(n)?n:r,l="object"==typeof t&&"provider"in t?t.provider:"object"==typeof n&&"provider"in n?n.provider:"object"==typeof r&&"provider"in r?r.provider:Uw.givenProvider,super(Object.assign(Object.assign({},c),{provider:l,registeredSubscriptions:Dw})),this.syncWithContext=!1,this._functions={},this._subscriptionManager=new Hw(super.subscriptionManager,this),(null==c?void 0:c.wallet)&&(this._wallet=c.wallet),(null==c?void 0:c.accountProvider)&&(this._accountProvider=c.accountProvider),!Bh(u)&&!Bh(u.data)&&!Bh(u.input)&&"both"!==this.config.contractDataInputFill)throw new Jo({data:u.data,input:u.input});this._overloadedMethodAbis=new Map;const d=Vf(r)?r:Vf(n)?n:null!=i?i:this.defaultReturnFormat,h="string"==typeof t?t:void 0;this.config.contractDataInputFill=null!==(a=null==u?void 0:u.dataInputFill)&&void 0!==a?a:this.config.contractDataInputFill,this._parseAndSetJsonInterface(e,d),this.defaultReturnFormat!==d&&(this.defaultReturnFormat=d),Bh(h)||this._parseAndSetAddress(h,d),this.options={address:h,jsonInterface:this._jsonInterface,gas:null!==(o=null==u?void 0:u.gas)&&void 0!==o?o:null==u?void 0:u.gasLimit,gasPrice:null==u?void 0:u.gasPrice,from:null==u?void 0:u.from,input:null==u?void 0:u.input,data:null==u?void 0:u.data},this.syncWithContext=null!==(s=null==u?void 0:u.syncWithContext)&&void 0!==s&&s,c instanceof Ky&&this.subscribeToContextEvents(c),Object.defineProperty(this.options,"address",{set:e=>this._parseAndSetAddress(e,d),get:()=>this._address}),Object.defineProperty(this.options,"jsonInterface",{set:e=>this._parseAndSetJsonInterface(e,d),get:()=>this._jsonInterface}),c instanceof Ky&&c.on(Up.CONFIG_CHANGE,e=>{this.setConfig({[e.name]:e.newValue})})}setTransactionMiddleware(e){this.transactionMiddleware=e}getTransactionMiddleware(){return this.transactionMiddleware}get events(){return this._events}get methods(){return this._methods}clone(){let e;return e=this.options.address?new Uw([...this._jsonInterface,...this._errorsInterface],this.options.address,{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this.config.contractDataInputFill},this.getContextObject()):new Uw([...this._jsonInterface,...this._errorsInterface],{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this.config.contractDataInputFill},this.getContextObject()),this.context&&e.subscribeToContextEvents(this.context),e}deploy(e){return new Lw(this,e)}getPastEvents(e,t,n){return qw(this,void 0,void 0,function*(){var r;const i="string"==typeof e?e:Cb,a="string"==typeof e||Vf(e)?Vf(t)?{}:t:e,o=Vf(e)?e:Vf(t)?t:null!=n?n:this.defaultReturnFormat,s="allEvents"===i||i===Cb?Bb:this._jsonInterface.find(e=>"name"in e&&e.name===i);if(!s)throw new Ko(`Event ${String(i)} not found.`);const{fromBlock:u,toBlock:c,topics:l,address:d}=Cw(this.options,s,null!=a?a:{}),h=yield bw(this,{fromBlock:u,toBlock:c,topics:l,address:d},o),f=h?h.map(e=>"string"==typeof e?e:iw(s,e,this._jsonInterface,o)):[],p=null!==(r=null==a?void 0:a.filter)&&void 0!==r?r:{},m=Object.keys(p);return m.length>0?f.filter(e=>"string"==typeof e||m.every(t=>{var n;if(Array.isArray(p[t]))return p[t].some(n=>String(e.returnValues[t]).toUpperCase()===String(n).toUpperCase());const r=null===(n=s.inputs)||void 0===n?void 0:n.filter(e=>e.name===t)[0];return!(!(null==r?void 0:r.indexed)||"string"!==r.type||Yf(p[t])!==String(e.returnValues[t]))||String(e.returnValues[t]).toUpperCase()===String(p[t]).toUpperCase()})):f})}_parseAndSetAddress(e,t=this.defaultReturnFormat){this._address=e?bf($f({format:"address"},e,t)):e}decodeMethodData(e){const t=e.slice(0,10),n=this._jsonInterface.filter(e=>"error"!==e.type).find(e=>t===$v(tv(e)));if(!n)throw new Ko(`The ABI for the provided method signature ${t} was not found.`);return Jv(n,e)}_parseAndSetJsonInterface(e,t=this.defaultReturnFormat){var n,r;this._functions={},this._methods={},this._events={};let i=[];const a=e.filter(e=>"error"!==e.type),o=e.filter(e=>Qb(e));for(const e of a){const a=Object.assign(Object.assign({},e),{signature:""});if(Jb(a)){const e=tv(a),t=$v(e);a.methodNameWithInputs=e,a.signature=t,a.constant="view"===a.stateMutability||"pure"===a.stateMutability||a.constant,a.payable="payable"===a.stateMutability||a.payable,this._overloadedMethodAbis.set(a.name,[...null!==(n=this._overloadedMethodAbis.get(a.name))&&void 0!==n?n:[],a]);const i=null!==(r=this._overloadedMethodAbis.get(a.name))&&void 0!==r?r:[],s=this._createContractMethod(i,o),u=this._createContractMethod(i,o,!0);this._functions[e]={signature:t,method:u},this._methods[a.name]=s,this._methods[e]=u,this._methods[t]=u}else if($b(a)){const e=tv(a),n=nv(e),r=this._createContractEvent(a,t);a.signature=n,e in this._events&&"bound"!==a.name||(this._events[e]=r),this._events[a.name]=r,this._events[n]=r}i=[...i,a]}this._events.allEvents=this._createContractEvent(Bb,t),this._jsonInterface=[...i],this._errorsInterface=o}_getAbiParams(e,t){var n;try{return lh(null!==(n=e.inputs)&&void 0!==n?n:[],t)}catch(t){throw new Ko(`Invalid parameters for method ${e.name}: ${t.message}`)}}_createContractMethod(e,t,n=!1){const r=e[e.length-1];return(...e)=>{var i,a,o;let s;const u=null!==(a=n?null===(i=this._overloadedMethodAbis.get(r.name))||void 0===i?void 0:i.filter(e=>e.signature===r.signature):this._overloadedMethodAbis.get(r.name))&&void 0!==a?a:[];let c=u[0];const l=t,d=u.filter(t=>{var n;return(null!==(n=t.inputs)&&void 0!==n?n:[]).length===e.length});if(1===u.length||0===d.length)s=this._getAbiParams(c,e),qh.validate(null!==(o=r.inputs)&&void 0!==o?o:[],s);else{const t=[],n=[];for(const r of d)try{s=this._getAbiParams(r,e),qh.validate(r.inputs,s),n.push(r)}catch(e){t.push(e)}if(1===n.length?[c]=n:n.length>1&&([c]=n,console.warn(`Multiple methods found that is compatible with the given inputs.\n\tFound ${n.length} compatible methods: ${JSON.stringify(n.map(e=>`${e.methodNameWithInputs} (signature: ${e.signature})`))} \n\tThe first one will be used: ${c.methodNameWithInputs}`)),t.length===d.length)throw new Qd(t)}const h={arguments:s,call:(e,t)=>qw(this,void 0,void 0,function*(){return this._contractMethodCall(c,s,l,e,t)}),send:e=>this._contractMethodSend(c,s,l,e),populateTransaction:(t,n)=>{var i,a;let o=null!=n?n:this.options;o=Object.assign(Object.assign({},o),{input:void 0,from:null!==(a=null!==(i=null==o?void 0:o.from)&&void 0!==i?i:this.defaultAccount)&&void 0!==a?a:void 0});const s=Nw({abi:r,params:e,options:Object.assign(Object.assign({},t),{dataInputFill:this.config.contractDataInputFill}),contractOptions:o});return s.dataInputFill&&delete s.dataInputFill,s},estimateGas:(e,...t)=>qw(this,[e,...t],void 0,function*(e,t=this.defaultReturnFormat){return this.contractMethodEstimateGas({abi:c,params:s,returnFormat:t,options:e})}),encodeABI:()=>Bw(c,s),decodeData:e=>Jv(c,e),createAccessList:(e,t)=>qw(this,void 0,void 0,function*(){return this._contractMethodCreateAccessList(c,s,l,e,t)})};return c.stateMutability,h}}_contractMethodCall(e,t,n,r,i){return qw(this,void 0,void 0,function*(){var a;const o=(({abi:e,params:t,options:n,contractOptions:r})=>{if(!(null==n?void 0:n.to)&&!r.address)throw new Ko("Contract address not specified");let i=Ff({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const a=Rw(i,e,t,null==n?void 0:n.dataInputFill);return i=Object.assign(Object.assign({},i),{data:a.data,input:a.input}),i})({abi:e,params:t,options:Object.assign(Object.assign({},r),{dataInputFill:this.config.contractDataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:null!==(a=this.options.from)&&void 0!==a?a:this.config.defaultAccount})});try{const t=yield gw(this,o,i,this.defaultReturnFormat);return((e,t)=>{if("constructor"===e.type)return t;if(!t)return null;const n=t.length>=2?t.slice(2):t;if(!e.outputs)return null;const r=Zv([...e.outputs],n);return 1===r.__length__?r[0]:r})(e,t)}catch(e){throw e instanceof $o&&ew(n,e.cause),e}})}_contractMethodCreateAccessList(e,t,n,r,i){return qw(this,void 0,void 0,function*(){var a;const o=(({abi:e,params:t,options:n,contractOptions:r})=>{if(!(null==n?void 0:n.to)&&!r.address)throw new Ko("Contract address not specified");if(!(null==n?void 0:n.from)&&!r.from)throw new Ko('Contract "from" address not specified');let i=Ff({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,data:r.data},n);const a=Rw(i,e,t,null==n?void 0:n.dataInputFill);return i=Object.assign(Object.assign({},i),{data:a.data,input:a.input}),i})({abi:e,params:t,options:Object.assign(Object.assign({},r),{dataInputFill:this.config.contractDataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:null!==(a=this.options.from)&&void 0!==a?a:this.config.defaultAccount})});try{return ww(this,o,i,this.defaultReturnFormat)}catch(e){throw e instanceof $o&&ew(n,e.cause),e}})}_contractMethodSend(e,t,n,r,i){var a,o;let s=null!=i?i:this.options;s=Object.assign(Object.assign({},s),{input:void 0,from:null!==(o=null!==(a=s.from)&&void 0!==a?a:this.defaultAccount)&&void 0!==o?o:void 0});const u=Nw({abi:e,params:t,options:Object.assign(Object.assign({},r),{dataInputFill:this.config.contractDataInputFill}),contractOptions:s}),c=Bh(this.transactionMiddleware)?fw(this,u,this.defaultReturnFormat,{checkRevertBeforeSending:!1,contractAbi:this._jsonInterface}):fw(this,u,this.defaultReturnFormat,{checkRevertBeforeSending:!1,contractAbi:this._jsonInterface},this.transactionMiddleware);return c.on("error",e=>{e instanceof $o&&ew(n,e.cause)}),c}contractMethodEstimateGas(e){return qw(this,arguments,void 0,function*({abi:e,params:t,returnFormat:n,options:r,contractOptions:i}){const a=(({abi:e,params:t,options:n,contractOptions:r})=>{let i=Ff({to:r.address,gas:r.gas,gasPrice:r.gasPrice,from:r.from,input:r.input,data:r.data},n);const a=Rw(i,e,t,null==n?void 0:n.dataInputFill);return i=Object.assign(Object.assign({},i),{data:a.data,input:a.input}),i})({abi:e,params:t,options:Object.assign(Object.assign({},r),{dataInputFill:this.config.contractDataInputFill}),contractOptions:null!=i?i:this.options});return yw(this,a,io.LATEST,null!=n?n:this.defaultReturnFormat)})}_createContractEvent(e,t=this.defaultReturnFormat){return(...n)=>{var r;const{topics:i,fromBlock:a}=Cw(this.options,e,n[0]),o=new Ow({address:this.options.address,topics:i,abi:e,jsonInterface:this._jsonInterface},{subscriptionManager:this.subscriptionManager,returnFormat:t});return Bh(a)||this.getPastEvents(e.name,{fromBlock:a,topics:i},t).then(e=>{e&&e.forEach(e=>o.emit("data",e))}).catch(e=>{o.emit("error",new cs("Failed to get past events.",e))}),null===(r=this.subscriptionManager)||void 0===r||r.addSubscription(o).catch(e=>{o.emit("error",new cs("Failed to subscribe.",e))}),o}}subscribeToContextEvents(e){const t=this;this.context=e,t.syncWithContext&&e.on(Up.CONFIG_CHANGE,e=>{t.setConfig({[e.name]:e.newValue})})}}const zw=Uw,Gw={addr:"0x3b3b57de",name:"0x691f3431",abi:"0x2203ab56",pubkey:"0xc8690233",text:"0x59d1d43c",contenthash:"0xbc1c58d1"},Vw={main:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",goerli:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},Ww={"0x1":"main","0x5":"goerli"},Kw=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"label",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"NewOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"resolver",type:"address"}],name:"NewResolver",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"recordExists",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"resolver",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"ttl",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"}],Zw=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"a",type:"address"}],name:"AddrChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"coinType",type:"uint256"},{indexed:!1,internalType:"bytes",name:"newAddress",type:"bytes"}],name:"AddressChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"hash",type:"bytes"}],name:"ContenthashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"},{indexed:!1,internalType:"bytes",name:"record",type:"bytes"}],name:"DNSRecordChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"}],name:"DNSRecordDeleted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"}],name:"DNSZoneCleared",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"lastzonehash",type:"bytes"},{indexed:!1,internalType:"bytes",name:"zonehash",type:"bytes"}],name:"DNSZonehashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes4",name:"interfaceID",type:"bytes4"},{indexed:!1,internalType:"address",name:"implementer",type:"address"}],name:"InterfaceChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"name",type:"string"}],name:"NameChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"x",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"y",type:"bytes32"}],name:"PubkeyChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"string",name:"indexedKey",type:"string"},{indexed:!1,internalType:"string",name:"key",type:"string"}],name:"TextChanged",type:"event"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentTypes",type:"uint256"}],name:"ABI",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"addr",outputs:[{internalType:"address payable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"}],name:"addr",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"contenthash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"uint16",name:"resource",type:"uint16"}],name:"dnsRecord",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"}],name:"hasDNSRecords",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"interfaceImplementer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"pubkey",outputs:[{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"}],name:"text",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"zonehash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"a",type:"address"}],name:"setAddr",outputs:[],stateMutability:"nonpayable",type:"function"}],Qw=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]);function $w(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function n(){return e[t++]<<8|e[t++]}let r=n(),i=1,a=[0,1];for(let e=1;e<r;e++)a.push(i+=n());let o=n(),s=t;t+=o;let u=0,c=0;function l(){return 0==u&&(c=c<<8|e[t++],u=8),c>>--u&1}const d=2**31,h=d>>>1,f=h>>1,p=d-1;let m=0;for(let e=0;e<31;e++)m=m<<1|l();let g=[],y=0,b=d;for(;;){let e=Math.floor(((m-y+1)*i-1)/b),t=0,n=r;for(;n-t>1;){let r=t+n>>>1;e<a[r]?n=r:t=r}if(0==t)break;g.push(t);let o=y+Math.floor(b*a[t]/i),s=y+Math.floor(b*a[t+1]/i)-1;for(;0==((o^s)&h);)m=m<<1&p|l(),o=o<<1&p,s=s<<1&p|1;for(;o&~s&f;)m=m&h|m<<1&p>>>1|l(),o=o<<1^h,s=(s^h)<<1|h|1;y=o,b=1+s-o}let v=r-4;return g.map(t=>{switch(t-v){case 3:return v+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return v+256+(e[s++]<<8|e[s++]);case 1:return v+e[s++];default:return t-1}})}(function(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((e,n)=>t[e.charCodeAt(0)]=n);let n=e.length,r=new Uint8Array(6*n>>3);for(let i=0,a=0,o=0,s=0;i<n;i++)s=s<<6|t[e.charCodeAt(i)],o+=6,o>=8&&(r[a++]=s>>(o-=8));return r}(e)))}function Jw(e){return 1&e?~e>>1:e>>1}function Yw(e,t){let n=Array(e);for(let r=0,i=0;r<e;r++)n[r]=i+=Jw(t());return n}function Xw(e,t=0){let n=[];for(;;){let r=e(),i=e();if(!i)break;t+=r;for(let e=0;e<i;e++)n.push(t+e);t+=i+1}return n}function eA(e){return nA(()=>{let t=Xw(e);if(t.length)return t})}function tA(e){let t=[];for(;;){let n=e();if(0==n)break;t.push(iA(n,e))}for(;;){let n=e()-1;if(n<0)break;t.push(aA(n,e))}return t.flat()}function nA(e){let t=[];for(;;){let n=e(t.length);if(!n)break;t.push(n)}return t}function rA(e,t,n){let r=Array(e).fill().map(()=>[]);for(let i=0;i<t;i++)Yw(e,n).forEach((e,t)=>r[t].push(e));return r}function iA(e,t){let n=1+t(),r=t(),i=nA(t);return rA(i.length,1+e,t).flatMap((e,t)=>{let[a,...o]=e;return Array(i[t]).fill().map((e,t)=>{let i=t*r;return[a+t*n,o.map(e=>e+i)]})})}function aA(e,t){return rA(1+t(),1+e,t).map(e=>[e[0],e.slice(1)])}function oA(e){return`{${function(e){return e.toString(16).toUpperCase().padStart(2,"0")}(e)}}`}function sA(e){let t=e.length;if(t<4096)return String.fromCodePoint(...e);let n=[];for(let r=0;r<t;)n.push(String.fromCodePoint(...e.slice(r,r+=4096)));return n.join("")}function uA(e,t){let n=e.length,r=n-t.length;for(let i=0;0==r&&i<n;i++)r=e[i]-t[i];return r}const cA=44032,lA=4352,dA=4449,hA=4519;function fA(e){return e>>24&255}function pA(e){return 16777215&e}let mA,gA,yA,bA;function vA(e){return e>=cA&&e<55204}function wA(e,t){if(e>=lA&&e<4371&&t>=dA&&t<4470)return cA+588*(e-lA)+28*(t-dA);if(vA(e)&&t>hA&&t<4547&&(e-cA)%28==0)return e+(t-hA);{let n=bA.get(e);return n&&(n=n.get(t),n)?n:-1}}function AA(e){mA||function(){let e=$w("AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g");mA=new Map(eA(e).flatMap((e,t)=>e.map(e=>[e,t+1<<24]))),gA=new Set(Xw(e)),yA=new Map,bA=new Map;for(let[t,n]of tA(e)){if(!gA.has(t)&&2==n.length){let[e,r]=n,i=bA.get(e);i||(i=new Map,bA.set(e,i)),i.set(r,t)}yA.set(t,n.reverse())}}();let t=[],n=[],r=!1;function i(e){let n=mA.get(e);n&&(r=!0,e|=n),t.push(e)}for(let r of e)for(;;){if(r<128)t.push(r);else if(vA(r)){let e=r-cA,t=e%588/28|0,n=e%28;i(lA+(e/588|0)),i(dA+t),n>0&&i(hA+n)}else{let e=yA.get(r);e?n.push(...e):i(r)}if(!n.length)break;r=n.pop()}if(r&&t.length>1){let e=fA(t[0]);for(let n=1;n<t.length;n++){let r=fA(t[n]);if(0==r||e<=r){e=r;continue}let i=n-1;for(;;){let n=t[i+1];if(t[i+1]=t[i],t[i]=n,!i)break;if(e=fA(t[--i]),e<=r)break}e=fA(t[n])}}return t}function xA(e){return AA(e).map(pA)}function kA(e){return function(e){let t=[],n=[],r=-1,i=0;for(let a of e){let e=fA(a),o=pA(a);if(-1==r)0==e?r=o:t.push(o);else if(i>0&&i>=e)0==e?(t.push(r,...n),n.length=0,r=o):n.push(o),i=e;else{let a=wA(r,o);a>=0?r=a:0==i&&0==e?(t.push(r),r=o):(n.push(o),i=e)}}return r>=0&&t.push(r,...n),t}(AA(e))}const _A=e=>Array.from(e);function PA(e,t){return e.P.has(t)||e.Q.has(t)}class EA extends Array{get is_emoji(){return!0}}let SA,TA,MA,IA,jA,CA,BA,OA,RA,NA,FA,LA;function HA(){if(SA)return;let e=$w("AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI");const t=()=>Xw(e),n=()=>new Set(t()),r=(e,t)=>t.forEach(t=>e.add(t));SA=new Map(tA(e)),TA=n(),MA=t(),IA=new Set(t().map(e=>MA[e])),MA=new Set(MA),jA=n(),CA=n();let i=eA(e),a=e();const o=()=>{let e=new Set;return t().forEach(t=>r(e,i[t])),r(e,t()),e};BA=nA(t=>{let n=nA(e).map(e=>e+96);if(n.length){let r=t>=a;return n[0]-=32,n=sA(n),r&&(n=`Restricted[${n}]`),{N:n,P:o(),Q:o(),M:!e(),R:r}}}),OA=n(),RA=new Map;let s=t().concat(_A(OA)).sort((e,t)=>e-t);s.forEach((t,n)=>{let r=e(),i=s[n]=r?s[n-r]:{V:[],M:new Map};i.V.push(t),OA.has(t)||RA.set(t,i)});for(let{V:e,M:t}of new Set(RA.values())){let n=[];for(let t of e){let e=BA.filter(e=>PA(e,t)),i=n.find(({G:t})=>e.some(e=>t.has(e)));i||(i={G:new Set,V:[]},n.push(i)),i.V.push(t),r(i.G,e)}let i=n.flatMap(e=>_A(e.G));for(let{G:e,V:r}of n){let n=new Set(i.filter(t=>!e.has(t)));for(let e of r)t.set(e,n)}}NA=new Set;let u=new Set;const c=e=>NA.has(e)?u.add(e):NA.add(e);for(let e of BA){for(let t of e.P)c(t);for(let t of e.Q)c(t)}for(let e of NA)RA.has(e)||u.has(e)||RA.set(e,1);r(NA,xA(NA)),FA=function(e){let t=[],n=Xw(e);return function e({S:n,B:r},i,a){if(!(4&n&&a===i[i.length-1])){2&n&&(a=i[i.length-1]),1&n&&t.push(i);for(let t of r)for(let n of t.Q)e(t,[...i,n],a)}}(function t(r){return{S:e(),B:nA(()=>{let r=Xw(e).map(e=>n[e]);if(r.length)return t(r)}),Q:r}}([]),[]),t}(e).map(e=>EA.from(e)).sort(uA),LA=new Map;for(let e of FA){let t=[LA];for(let n of e){let e=t.map(e=>{let t=e.get(n);return t||(t=new Map,e.set(n,t)),t});65039===n?t.push(...e):t=e}for(let n of t)n.V=e}}function qA(e){return(zA(e)?"":`${DA(UA([e]))} `)+oA(e)}function DA(e){return`"${e}"‎`}function UA(e,t=1/0,n=oA){let r=[];var i;i=e[0],HA(),MA.has(i)&&r.push("◌"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let a=0,o=e.length;for(let t=0;t<o;t++){let i=e[t];zA(i)&&(r.push(sA(e.slice(a,t))),r.push(n(i)),a=t+1)}return r.push(sA(e.slice(a,o))),r.join("")}function zA(e){return HA(),jA.has(e)}function GA(e,t,n){if(!e)return[];HA();let r=0;return e.split(".").map(e=>{let i=function(e){let t=[];for(let n=0,r=e.length;n<r;){let r=e.codePointAt(n);n+=r<65536?1:2,t.push(r)}return t}(e),a={input:i,offset:r};r+=i.length+1;try{let e,r=a.tokens=function(e,t,n){let r=[],i=[];for(e=e.slice().reverse();e.length;){let a=QA(e);if(a)i.length&&(r.push(t(i)),i=[]),r.push(n(a));else{let t=e.pop();if(NA.has(t))i.push(t);else{let e=SA.get(t);if(e)i.push(...e);else if(!TA.has(t))throw VA(t)}}}return i.length&&r.push(t(i)),r}(i,t,n),o=r.length;if(!o)throw new Error("empty label");let s=a.output=r.flat();if(function(e){for(let t=e.lastIndexOf(95);t>0;)if(95!==e[--t])throw new Error("underscore allowed only at start")}(s),!(a.emoji=o>1||r[0].is_emoji)&&s.every(e=>e<128))!function(e){if(e.length>=4&&45==e[2]&&45==e[3])throw new Error(`invalid label extension: "${sA(e.slice(0,4))}"`)}(s),e="ASCII";else{let t=r.flatMap(e=>e.is_emoji?[]:e);if(t.length){if(MA.has(s[0]))throw KA("leading combining mark");for(let e=1;e<o;e++){let t=r[e];if(!t.is_emoji&&MA.has(t[0]))throw KA(`emoji + combining mark: "${sA(r[e-1])} + ${UA([t[0]])}"`)}!function(e){let t=e[0],n=Qw.get(t);if(n)throw KA(`leading ${n}`);let r=e.length,i=-1;for(let a=1;a<r;a++){t=e[a];let r=Qw.get(t);if(r){if(i==a)throw KA(`${n} + ${r}`);i=a+1,n=r}}if(i==r)throw KA(`trailing ${n}`)}(s);let n=_A(new Set(t)),[i]=function(e){let t=BA;for(let n of e){let e=t.filter(e=>PA(e,n));if(!e.length)throw BA.some(e=>PA(e,n))?WA(t[0],n):VA(n);if(t=e,1==e.length)break}return t}(n);!function(e,t){for(let n of t)if(!PA(e,n))throw WA(e,n);if(e.M){let e=xA(t);for(let t=1,n=e.length;t<n;t++)if(IA.has(e[t])){let r=t+1;for(let i;r<n&&IA.has(i=e[r]);r++)for(let n=t;n<r;n++)if(e[n]==i)throw new Error(`duplicate non-spacing marks: ${qA(i)}`);if(r-t>4)throw new Error(`excessive non-spacing marks: ${DA(UA(e.slice(t-1,r)))} (${r-t}/4)`);t=r}}}(i,t),function(e,t){let n,r=[];for(let e of t){let t=RA.get(e);if(1===t)return;if(t){let r=t.M.get(e);if(n=n?n.filter(e=>r.has(e)):_A(r),!n.length)return}else r.push(e)}if(n)for(let t of n)if(r.every(e=>PA(t,e)))throw new Error(`whole-script confusable: ${e.N}/${t.N}`)}(i,n),e=i.N}else e="Emoji"}a.type=e}catch(e){a.error=e}return a})}function VA(e){return new Error(`disallowed character: ${qA(e)}`)}function WA(e,t){let n=qA(t),r=BA.find(e=>e.P.has(t));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${e.N} + ${n}`)}function KA(e){return new Error(`illegal placement: ${e}`)}function ZA(e){return e.filter(e=>65039!=e)}function QA(e,t){let n,r=LA,i=e.length;for(;i&&(r=r.get(e[--i]),r);){let{V:a}=r;a&&(n=a,t&&t.push(...e.slice(i).reverse()),e.length=i)}return n}const $A=e=>function(e){return function(e){return e.map(({input:t,error:n,output:r})=>{if(n){let r=n.message;throw new Error(1==e.length?r:`Invalid label ${DA(UA(t,63))}: ${r}`)}return sA(r)}).join(".")}(GA(e,kA,ZA))}(e),JA=e=>{let t="";for(let e=0;e<32;e+=1)t+="00";if(e){const n=$A(e).split(".");for(let e=n.length-1;e>=0;e-=1){const r=ep(n[e]).slice(2);t=ep(`0x${t}${r}`).slice(2)}}return`0x${t}`};var YA=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};class XA{constructor(e,t){this.contract=new Uw(Kw,null!=t?t:Vw.main,e),this.context=e}getOwner(e){return YA(this,void 0,void 0,function*(){try{return this.contract.methods.owner(JA(e)).call()}catch(e){throw new Error}})}getTTL(e){return YA(this,void 0,void 0,function*(){try{return this.contract.methods.ttl(JA(e)).call()}catch(e){throw new Error}})}recordExists(e){return YA(this,void 0,void 0,function*(){try{return this.contract.methods.recordExists(JA(e)).call()}catch(e){throw new Error}})}getResolver(e){return YA(this,void 0,void 0,function*(){try{return this.contract.methods.resolver(JA(e)).call().then(e=>{if("string"==typeof e)return new Uw(Zw,e,this.context);throw new Error})}catch(e){throw new Error}})}get events(){return this.contract.events}}var ex=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};class tx{constructor(e){this.registry=e}getResolverContractAdapter(e){return ex(this,void 0,void 0,function*(){return this.registry.getResolver(e)})}checkInterfaceSupport(e,t){var n,r;return ex(this,void 0,void 0,function*(){if(Rf(Gw[t]))throw new Zo(null!==(n=e.options.address)&&void 0!==n?n:"",t);if(!(yield e.methods.supportsInterface(Gw[t]).call()))throw new Zo(null!==(r=e.options.address)&&void 0!==r?r:"",t)})}supportsInterface(e,t){var n;return ex(this,void 0,void 0,function*(){const r=yield this.getResolverContractAdapter(e);let i=t;if(!Xd(i)){if(i=null!==(n=Xf(t))&&void 0!==n?n:"",""===t)throw new Error("Invalid interface Id");i=i.slice(0,10)}return r.methods.supportsInterface(i).call()})}getAddress(e,t=60){return ex(this,void 0,void 0,function*(){const n=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(n,"addr"),n.methods.addr(JA(e),t).call()})}getPubkey(e){return ex(this,void 0,void 0,function*(){const t=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(t,"pubkey"),t.methods.pubkey(JA(e)).call()})}getContenthash(e){return ex(this,void 0,void 0,function*(){const t=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(t,"contenthash"),t.methods.contenthash(JA(e)).call()})}setAddress(e,t,n){return ex(this,void 0,void 0,function*(){const r=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(r,"addr"),r.methods.setAddr(JA(e),t).send(n)})}getText(e,t){return ex(this,void 0,void 0,function*(){const n=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(n,"text"),n.methods.text(JA(e),t).call()})}getName(e,t=!0){return ex(this,void 0,void 0,function*(){const n=`${e.toLowerCase().substring(2)}.addr.reverse`,r=yield this.getResolverContractAdapter(n);return t&&(yield this.checkInterfaceSupport(r,"name")),r.methods.name(JA(n)).call()})}}var nx=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};class rx extends Ky{constructor(e,t){super(null!=t?t:""),this.registryAddress=null!=e?e:Vw.main,this._registry=new XA(this.getContextObject(),e),this._resolver=new tx(this._registry)}getResolver(e){return nx(this,void 0,void 0,function*(){return this._registry.getResolver(e)})}recordExists(e){return nx(this,void 0,void 0,function*(){return this._registry.recordExists(e)})}getTTL(e){return nx(this,void 0,void 0,function*(){return this._registry.getTTL(e)})}getOwner(e){return nx(this,void 0,void 0,function*(){return this._registry.getOwner(e)})}getAddress(e,t=60){return nx(this,void 0,void 0,function*(){return this._resolver.getAddress(e,t)})}getText(e,t){return nx(this,void 0,void 0,function*(){return kh(e)?this._resolver.getText(yield this._resolver.getName(e,!1),t):this._resolver.getText(e,t)})}getName(e,t=!0){return nx(this,void 0,void 0,function*(){return this._resolver.getName(e,t)})}getPubkey(e){return nx(this,void 0,void 0,function*(){return this._resolver.getPubkey(e)})}getContenthash(e){return nx(this,void 0,void 0,function*(){return this._resolver.getContenthash(e)})}checkNetwork(){return nx(this,void 0,void 0,function*(){const e=Date.now()/1e3;if(!this._lastSyncCheck||e-this._lastSyncCheck>3600){const n=yield(t=this,sw(void 0,void 0,void 0,function*(){return Xy(t.requestManager)}));if("boolean"!=typeof n||n)throw new Xo;this._lastSyncCheck=e}var t;if(this._detectedAddress)return this._detectedAddress;const n=yield Tb(this,Object.assign(Object.assign({},this.defaultReturnFormat),{number:Xa.HEX})),r=Vw[Ww[n]];if(void 0===r)throw new Yo(n);return this._detectedAddress=r,this._detectedAddress})}supportsInterface(e,t){return nx(this,void 0,void 0,function*(){return this._resolver.supportsInterface(e,t)})}get events(){return this._registry.events}setAddress(e,t,n){return nx(this,void 0,void 0,function*(){return this._resolver.setAddress(e,t,n)})}}var ix=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};var ax,ox,sx=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};class ux extends Ky{getAccounts(){return sx(this,void 0,void 0,function*(){return e=this.requestManager,ix(void 0,void 0,void 0,function*(){const t=yield(e=>ib(void 0,void 0,void 0,function*(){return e.send({method:"personal_listAccounts",params:[]})}))(e);return t.map(bf)});var e})}newAccount(e){return sx(this,void 0,void 0,function*(){return((e,t)=>ix(void 0,void 0,void 0,function*(){qh.validate(["string"],[t]);const n=yield((e,t)=>ib(void 0,void 0,void 0,function*(){return e.send({method:"personal_newAccount",params:[t]})}))(e,t);return bf(n)}))(this.requestManager,e)})}unlockAccount(e,t,n){return sx(this,void 0,void 0,function*(){return((e,t,n,r)=>ix(void 0,void 0,void 0,function*(){return qh.validate(["address","string","uint"],[t,n,r]),((e,t,n,r)=>ib(void 0,void 0,void 0,function*(){return e.send({method:"personal_unlockAccount",params:[t,n,r]})}))(e,t,n,r)}))(this.requestManager,e,t,n)})}lockAccount(e){return sx(this,void 0,void 0,function*(){return((e,t)=>ix(void 0,void 0,void 0,function*(){return qh.validate(["address"],[t]),((e,t)=>ib(void 0,void 0,void 0,function*(){return e.send({method:"personal_lockAccount",params:[t]})}))(e,t)}))(this.requestManager,e)})}importRawKey(e,t){return sx(this,void 0,void 0,function*(){return((e,t,n)=>ix(void 0,void 0,void 0,function*(){return qh.validate(["string","string"],[t,n]),((e,t,n)=>ib(void 0,void 0,void 0,function*(){return e.send({method:"personal_importRawKey",params:[t,n]})}))(e,t,n)}))(this.requestManager,e,t)})}sendTransaction(e,t){return sx(this,void 0,void 0,function*(){return((e,t,n,r)=>ix(void 0,void 0,void 0,function*(){const i=Eb(t,ro,{transactionSchema:null==r?void 0:r.customTransactionSchema});return((e,t,n)=>ib(void 0,void 0,void 0,function*(){return e.send({method:"personal_sendTransaction",params:[t,n]})}))(e,i,n)}))(this.requestManager,e,t,this.config)})}signTransaction(e,t){return sx(this,void 0,void 0,function*(){return((e,t,n,r)=>ix(void 0,void 0,void 0,function*(){const i=Eb(t,ro,{transactionSchema:null==r?void 0:r.customTransactionSchema});return((e,t,n)=>ib(void 0,void 0,void 0,function*(){return e.send({method:"personal_signTransaction",params:[t,n]})}))(e,i,n)}))(this.requestManager,e,t,this.config)})}sign(e,t,n){return sx(this,void 0,void 0,function*(){return((e,t,n,r)=>ix(void 0,void 0,void 0,function*(){qh.validate(["string","address","string"],[t,n,r]);const i=Xd(t)?t:tf(t);return((e,t,n,r)=>ib(void 0,void 0,void 0,function*(){return e.send({method:"personal_sign",params:[t,n,r]})}))(e,i,n,r)}))(this.requestManager,e,t,n)})}ecRecover(e,t){return sx(this,void 0,void 0,function*(){return((e,t,n)=>ix(void 0,void 0,void 0,function*(){qh.validate(["string","string"],[t,n]);const r=Xd(t)?t:tf(t);return((e,t,n)=>ib(void 0,void 0,void 0,function*(){return e.send({method:"personal_ecRecover",params:[t,n]})}))(e,r,n)}))(this.requestManager,e,t)})}}!function(e){e.HTTPS="https",e.WebSocket="wss"}(ax||(ax={})),function(e){e.ETH_MAINNET="eth_mainnet",e.ETH_SEPOLIA="eth_sepolia",e.ETH_HOLESKY="eth_holesky",e.POLYGON_MAINNET="polygon_mainnet",e.POLYGON_AMOY="polygon_amoy",e.AVALANCHE_C_MAINNET="avalanche_c_mainnet",e.AVALANCHE_P_MAINNET="avalanche_p_mainnet",e.AVALANCHE_X_MAINNET="avalanche_x_mainnet",e.ARBITRUM_MAINNET="arbitrum_mainnet",e.ARBITRUM_SEPOLIA="arbitrum_sepolia",e.BASE_MAINNET="base_mainnet",e.BASE_SEPOLIA="base_sepolia",e.OPTIMISM_MAINNET="optimism_mainnet",e.OPTIMISM_SEPOLIA="optimism_sepolia",e.FANTOM_MAINNET="fantom_mainnet",e.FANTOM_TESTNET="fantom_testnet",e.DYMENSION_MAINNET="dymension_mainnet",e.DYMENSION_TESTNET="dymension_testnet",e.BNB_MAINNET="bnb_mainnet",e.BNB_TESTNET="bnb_testnet",e.BSC_MAINNET="bsc_mainnet",e.BSC_TESTNET="bsc_testnet",e.ARBITRUM_ONE="arbitrum_one",e.ARBITRUM_NOVA="arbitrum_nova",e.AVALANCHE_FUJI_C="avalanche_fuji_c",e.AVALANCHE_FUJI_P="avalanche_fuji_p",e.AVALANCHE_FUJI_X="avalanche_fuji_x",e.BLAST_MAINNET="blast_mainnet",e.OPBNB_MAINNET="opbnb_mainnet",e.OPBNB_TESTNET="opbnb_testnet",e.GNOSIS_MAINNET="gnosis_mainnet",e.GNOSIS_CHIADO="gnosis_chiado",e.PULSECHAIN_MAINNET="pulsechain_mainnet",e.PULSECHAIN_TESTNET="pulsechain_testnet",e.KAVA_MAINNET="kava_mainnet",e.CRONOS_MAINNET="cronos_mainnet",e.MANTLE_MAINNET="mantle_mainnet",e.CHILIZ_MAINNET="chiliz_mainnet",e.CHILIZ_SPICY="chiliz_spicy",e.MOONBEAM_MAINNET="moonbeam_mainnet",e.TAIKO_MAINNET="taiko_mainnet",e.TAIKO_HEKLA="taiko_hekla",e.LINEA_MAINNET="linea_mainnet",e.LINEA_SEPOLIA="linea_sepolia",e.BAHAMUT_MAINNET="bahamut_mainnet",e.SCROLL_MAINNET="scroll_mainnet",e.SCROLL_SEPOLIA="scroll_sepolia",e.TRON_MAINNET="tron_mainnet",e.SYSCOIN_MAINNET="syscoin_mainnet",e.SYSCOIN_TANENBAUM="syscoin_tanenbaum",e.MOONRIVER_MAINNET="moonriver_mainnet",e.HAQQ_MAINNET="haqq_mainnet",e.EVMOS_MAINNET="evmos_mainnet",e.EVMOS_TESTNET="evmos_testnet",e.BERACHAIN_TESTNET="berachain_testnet"}(ox||(ox={}));class cx extends Io{constructor(e){super("You've reach the rate limit of free RPC calls from our Partner Quick Nodes. There are two options you can either create a paid Quick Nodes account and get 20% off for 2 months using WEB3JS referral code, or use Free public RPC endpoint.",e),this.code=1300}}class lx extends Io{constructor(e){super(`Invalid provider config options given for ${e}`),this.code=1301}}class dx extends Fp{constructor(e,t,n,r,i){if(super(),void 0!==i&&t===ax.HTTPS&&!("providerOptions"in i))throw new lx("HTTP Provider");if(void 0!==i&&t===ax.WebSocket&&!("socketOptions"in i)&&!("reconnectOptions"in i))throw new lx("Websocket Provider");this.transport=t,t===ax.HTTPS?this.provider=new Vp(this.getRPCURL(e,t,n,r),i):t===ax.WebSocket&&(this.provider=new Zp(this.getRPCURL(e,t,n,r),null==i?void 0:i.socketOptions,null==i?void 0:i.reconnectOptions))}request(e,t){return n=this,r=void 0,a=function*(){return this.transport===ax.HTTPS?yield this.provider.request(e,t):this.provider.request(e)},new((i=void 0)||(i=Promise))(function(e,t){function o(e){try{u(a.next(e))}catch(e){t(e)}}function s(e){try{u(a.throw(e))}catch(e){t(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i(function(e){e(n)})).then(o,s)}u((a=a.apply(n,r||[])).next())});var n,r,i,a}getStatus(){return this.provider.getStatus()}supportsSubscriptions(){return this.provider.supportsSubscriptions()}once(e,t){var n;(null===(n=this.provider)||void 0===n?void 0:n.once)&&this.provider.once(e,t)}removeAllListeners(e){var t;(null===(t=this.provider)||void 0===t?void 0:t.removeAllListeners)&&this.provider.removeAllListeners(e)}connect(){var e;(null===(e=this.provider)||void 0===e?void 0:e.connect)&&this.provider.connect()}disconnect(e,t){var n;(null===(n=this.provider)||void 0===n?void 0:n.disconnect)&&this.provider.disconnect(e,t)}reset(){var e;(null===(e=this.provider)||void 0===e?void 0:e.reset)&&this.provider.reset()}on(e,t){this.provider&&this.provider.on(e,t)}removeListener(e,t){this.provider&&this.provider.removeListener(e,t)}}const hx=e=>void 0!==e&&e.trim().length>0,fx=[ox.DYMENSION_MAINNET,ox.DYMENSION_TESTNET,ox.KAVA_MAINNET,ox.CRONOS_MAINNET,ox.POLYGON_MAINNET];class px extends dx{constructor(e=ox.ETH_MAINNET,t=ax.HTTPS,n="",r){super(e,t,"",n,r)}getRPCURL(e,t,n,r){if(!px.networkHostMap[e])throw new Error("Network info not avalible.");const i=`${px.networkHostMap[e]}.publicnode.com`,a=void 0!==(o=r)&&o.trim().length>0?r:i;var o;return fx.includes(e)&&t===ax.WebSocket?`${t}://${a}/websocket`:`${t}://${a}`}}px.networkHostMap={[ox.POLYGON_AMOY]:"polygon-amoy-bor-rpc",[ox.DYMENSION_MAINNET]:"dymension-evm-rpc",[ox.DYMENSION_TESTNET]:"dymension-testnet-evm-rpc",[ox.BLAST_MAINNET]:"blast-rpc",[ox.GNOSIS_MAINNET]:"gnosis-rpc",[ox.PULSECHAIN_MAINNET]:"pulsechain-rpc",[ox.PULSECHAIN_TESTNET]:"pulsechain-testnet-rpc",[ox.KAVA_MAINNET]:"kava-evm-rpc",[ox.CRONOS_MAINNET]:"cronos-evm-rpc",[ox.MANTLE_MAINNET]:"mantle-rpc",[ox.TAIKO_MAINNET]:"taiko-rpc",[ox.TAIKO_HEKLA]:"taiko-hekla-rpc",[ox.LINEA_MAINNET]:"linea-rpc",[ox.LINEA_SEPOLIA]:"linea-sepolia-rpc",[ox.SCROLL_MAINNET]:"scroll-rpc",[ox.SCROLL_SEPOLIA]:"scroll-sepolia-rpc",[ox.SYSCOIN_MAINNET]:"syscoin-evm-rpc",[ox.SYSCOIN_TANENBAUM]:"syscoin-tanenbaum-evm-rpc",[ox.HAQQ_MAINNET]:"haqq-evm-rpc",[ox.EVMOS_MAINNET]:"evmos-evm-rpc",[ox.EVMOS_TESTNET]:"evmos-testnet-evm-rpc",[ox.BERACHAIN_TESTNET]:"berachain-testnet-evm-rpc",[ox.ETH_MAINNET]:"ethereum-rpc",[ox.ETH_SEPOLIA]:"ethereum-sepolia-rpc",[ox.ETH_HOLESKY]:"ethereum-holesky-rpc",[ox.BSC_MAINNET]:"bsc-rpc",[ox.BSC_TESTNET]:"bsc-testnet-rpc",[ox.POLYGON_MAINNET]:"polygon-bor-rpc",[ox.BASE_MAINNET]:"base-rpc",[ox.BASE_SEPOLIA]:"base-sepolia-rpc",[ox.ARBITRUM_ONE]:"arbitrum-one-rpc",[ox.ARBITRUM_NOVA]:"arbitrum-nova-rpc",[ox.ARBITRUM_SEPOLIA]:"arbitrum-sepolia-rpc",[ox.AVALANCHE_C_MAINNET]:"avalanche-c-chain-rpc",[ox.AVALANCHE_P_MAINNET]:"avalanche-p-chain-rpc",[ox.AVALANCHE_X_MAINNET]:"avalanche-x-chain-rpc",[ox.AVALANCHE_FUJI_C]:"avalanche-fuji-c-chain-rpc",[ox.AVALANCHE_FUJI_P]:"avalanche-fuji-p-chain-rpc",[ox.AVALANCHE_FUJI_X]:"avalanche-fuji-x-chain-rpc",[ox.OPTIMISM_MAINNET]:"optimism-rpc",[ox.OPTIMISM_SEPOLIA]:"optimism-sepolia-rpc",[ox.FANTOM_MAINNET]:"fantom-rpc",[ox.FANTOM_TESTNET]:"fantom-testnet-rpc",[ox.OPBNB_MAINNET]:"opbnb-rpc",[ox.OPBNB_TESTNET]:"opbnb-testnet-rpc",[ox.GNOSIS_CHIADO]:"gnosis-chiado-rpc",[ox.CHILIZ_MAINNET]:"chiliz-rpc",[ox.CHILIZ_SPICY]:"chiliz-spicy-rpc",[ox.MOONBEAM_MAINNET]:"moonbeam-rpc",[ox.BAHAMUT_MAINNET]:"bahamut-rpc",[ox.TRON_MAINNET]:"tron-evm-rpc",[ox.MOONRIVER_MAINNET]:"moonriver-rpc"};const mx=new class extends dx{constructor(e=ox.ETH_MAINNET,t=ax.HTTPS,n="",r="",i){super(e,t,n,r,i)}request(e,t){const n=Object.create(null,{request:{get:()=>super.request}});return r=this,i=void 0,o=function*(){try{return yield n.request.call(this,e,t)}catch(e){if(e instanceof lu&&429===e.statusCode)throw new cx(e);throw e}},new((a=void 0)||(a=Promise))(function(e,t){function n(e){try{u(o.next(e))}catch(e){t(e)}}function s(e){try{u(o.throw(e))}catch(e){t(e)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof a?r:new a(function(e){e(r)})).then(n,s)}u((o=o.apply(r,i||[])).next())});var r,i,a,o}getRPCURL(e,t,n,r){let i="",a="";switch(e){case ox.ETH_MAINNET:i=hx(r)?r:"powerful-holy-bush.quiknode.pro",a=hx(n)?n:"3240624a343867035925ff7561eb60dfdba2a668";break;case ox.ETH_SEPOLIA:i=hx(r)?r:"dimensional-fabled-glitter.ethereum-sepolia.quiknode.pro",a=hx(n)?n:"382a3b5a4b938f2d6e8686c19af4b22921fde2cd";break;case ox.ETH_HOLESKY:i=hx(r)?r:"yolo-morning-card.ethereum-holesky.quiknode.pro",a=hx(n)?n:"481ebe70638c4dcf176af617a16d02ab866b9af9";break;case ox.ARBITRUM_MAINNET:i=hx(r)?r:"autumn-divine-dinghy.arbitrum-mainnet.quiknode.pro",a=hx(n)?n:"a5d7bfbf60b5ae9ce3628e53d69ef50d529e9a8c";break;case ox.ARBITRUM_SEPOLIA:i=hx(r)?r:"few-patient-pond.arbitrum-sepolia.quiknode.pro",a=hx(n)?n:"3be985450970628c860b959c65cd2642dcafe53c";break;case ox.BNB_MAINNET:i=hx(r)?r:"purple-empty-reel.bsc.quiknode.pro",a=hx(n)?n:"ebf6c532961e21f092ff2facce1ec4c89c540158";break;case ox.BNB_TESTNET:i=hx(r)?r:"floral-rough-scion.bsc-testnet.quiknode.pro",a=hx(n)?n:"5b297e5acff5f81f4c37ebf6f235f7299b6f9d28";break;case ox.POLYGON_MAINNET:i=hx(r)?r:"small-chaotic-moon.matic.quiknode.pro",a=hx(n)?n:"847569f8a017e84d985e10d0f44365d965a951f1";break;case ox.POLYGON_AMOY:i=hx(r)?r:"prettiest-side-shape.matic-amoy.quiknode.pro",a=hx(n)?n:"79a9476eea661d4f82de614db1d8a895b14b881c";break;default:throw new Error("Network info not avalible.")}return`${t}://${i}/${a}`}},gx={encodeEventSignature:nv,encodeFunctionCall:(e,t)=>{var n;if(!Jb(e))throw new as("Invalid parameter value in encodeFunctionCall");return`${$v(e)}${Vv(null!==(n=e.inputs)&&void 0!==n?n:[],null!=t?t:[]).replace("0x","")}`},encodeFunctionSignature:$v,encodeParameter:Wv,encodeParameters:Vv,decodeParameter:Qv,decodeParameters:Zv,decodeLog:Xv};var yx,bx=function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())})};!function(e){e.eip6963announceProvider="eip6963:announceProvider",e.eip6963requestProvider="eip6963:requestProvider"}(yx||(yx={}));const vx=new Map,wx="web3:providersMapUpdated";class Ax extends Ky{constructor(e=mx){var t;(Rf(e)||"string"==typeof e&&""===e.trim()||"string"!=typeof e&&!em(e)&&!e.provider)&&console.warn("NOTE: web3.js is running without provider. You need to pass a provider in order to interact with the network!");let n={};"string"==typeof e||em(e)?n.provider=e:n=e||{},n.registeredSubscriptions=Object.assign(Object.assign({},Sw),null!==(t=n.registeredSubscriptions)&&void 0!==t?t:{}),super(n);const r=(e=>{const t=(t,n)=>bx(void 0,void 0,void 0,function*(){const r=yield jw(t,e),i=$f({format:"bytes"},n,ro);return Ny(r,i)}),n=e=>{const n=Uy(e);return Object.assign(Object.assign({},n),{signTransaction:e=>bx(void 0,void 0,void 0,function*(){return t(e,n.privateKey)})})},r=(e,n,r)=>bx(void 0,void 0,void 0,function*(){var i;const a=yield Gy(e,n,null===(i=null==r?void 0:r.nonStrict)||void 0===i||i);return Object.assign(Object.assign({},a),{signTransaction:e=>bx(void 0,void 0,void 0,function*(){return t(e,a.privateKey)})})}),i=()=>{const e=zy();return Object.assign(Object.assign({},e),{signTransaction:n=>bx(void 0,void 0,void 0,function*(){return t(n,e.privateKey)})})},a=new lm({create:i,privateKeyToAccount:n,decrypt:r});return{signTransaction:t,create:i,privateKeyToAccount:n,decrypt:r,recoverTransaction:Fy,hashMessage:Oy,sign:Ry,recover:Ly,encrypt:Dy,wallet:a,privateKeyToAddress:Hy,parseAndValidatePrivateKey:By,privateKeyToPublicKey:qy}})(this);this._wallet=r.wallet,this._accountProvider=r,this.utils=s;const i=this,a=i.use(Tw);this.eth=Object.assign(a,{ens:i.use(rx,Vw.main),Iban:Zy,net:i.use(jb),personal:i.use(ux),Contract:class extends zw{constructor(e,t,n,r,o){if(Of(t)&&Of(n))throw new es("Should not provide options at both 2nd and 3rd parameters");let s,u,c,l={};if(!Rf(t)&&"object"!=typeof t&&"string"!=typeof t)throw new es;if("string"==typeof t&&(s=t),l=Of(t)?t:Of(n)?n:{},u=t instanceof Ky?t:n instanceof Ky?n:r instanceof Ky?r:i.getContextObject(),o?c=o:Vf(n)?c=n:Vf(r)&&(c=r),super(e,s,l,u,c),super.subscribeToContextEvents(i),!Rf(a)){const e=a.getTransactionMiddleware();Rf(e)||super.setTransactionMiddleware(e)}}},abi:gx,accounts:r})}}Ax.version="4.16.0",Ax.utils=s,Ax.requestEIP6963Providers=()=>{return e=void 0,t=void 0,r=function*(){return new Promise((e,t)=>{"undefined"==typeof window&&t(new Error("window object not available, EIP-6963 is intended to be used within a browser")),window.addEventListener(yx.eip6963announceProvider,t=>{vx.set(t.detail.info.uuid,t.detail);const n=new CustomEvent(wx,{detail:vx});window.dispatchEvent(n),e(vx)}),window.dispatchEvent(new Event(yx.eip6963requestProvider))})},new((n=void 0)||(n=Promise))(function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}u((r=r.apply(e,t||[])).next())});var e,t,n,r},Ax.onNewProviderDiscovered=e=>{if("undefined"==typeof window)throw new Error("window object not available, EIP-6963 is intended to be used within a browser");window.addEventListener(wx,e)},Ax.modules={Web3Eth:Tw,Iban:Zy,Net:jb,ENS:rx,Personal:ux};const xx=Ax;var kx=n(2543),_x=n.n(kx);const Px=(e,t,n,r)=>{if(void 0!==n&&e in n&&void 0!==n[e]){if("string"==typeof n[e]&&kh(n[e]))return n[e];if(!Xd(n[e])&&Sh(n[e])){if(t.wallet){const r=t.wallet.get($f({format:"uint"},n[e],Ob));if(!Bh(r))return r.address;throw new Zs}throw new Zs}throw"from"===e?new bs(n.from):new vs(n.to)}if("from"===e){if(!Bh(r))return Hy(r);if(!Bh(t.defaultAccount))return t.defaultAccount}};class Ex extends Error{constructor(e,t,n){super(t??e.code),this.type=e,void 0!==n&&(this.stack=n)}getMetadata(){return this.type}toObject(){return{type:this.getMetadata(),message:this.message??"",stack:this.stack??"",className:this.constructor.name}}}function Sx(e,t){return new Ex({code:"ETHEREUMJS_DEFAULT_ERROR_CODE"},e,t)}function Tx(e){if(0===e[0])throw Sx("invalid RLP: extra zeros");return function(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw Sx("Invalid byte sequence");return t}(function(e){let t="";for(let n=0;n<e.length;n++)t+=jx[e[n]];return t}(e))}function Mx(e,t,n){if(n>e.length)throw Sx("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,n)}function Ix(e){let t,n,r,i,a;const o=[],s=e[0];if(s<=127)return{data:e.slice(0,1),remainder:e.subarray(1)};if(s<=183){if(t=s-127,r=128===s?Uint8Array.from([]):Mx(e,1,t),2===t&&r[0]<128)throw Sx("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:r,remainder:e.subarray(t)}}if(s<=191){if(n=s-182,e.length-1<n)throw Sx("invalid RLP: not enough bytes for string length");if(t=Tx(Mx(e,1,n)),t<=55)throw Sx("invalid RLP: expected string length to be greater than 55");return r=Mx(e,n,t+n),{data:r,remainder:e.subarray(t+n)}}if(s<=247){for(t=s-191,i=Mx(e,1,t);i.length;)a=Ix(i),o.push(a.data),i=a.remainder;return{data:o,remainder:e.subarray(t)}}{if(n=s-246,t=Tx(Mx(e,1,n)),t<56)throw Sx("invalid RLP: encoded list too short");const r=n+t;if(r>e.length)throw Sx("invalid RLP: total length is larger than the data");for(i=Mx(e,n,r);i.length;)a=Ix(i),o.push(a.data),i=a.remainder;return{data:o,remainder:e.subarray(r)}}}const jx=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const Cx={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function Bx(e){return e>=Cx._0&&e<=Cx._9?e-Cx._0:e>=Cx._A&&e<=Cx._F?e-(Cx._A-10):e>=Cx._a&&e<=Cx._f?e-(Cx._a-10):void 0}function Ox(e){if("0x"===e.slice(0,2)&&(e=e.slice(0,2)),"string"!=typeof e)throw Sx("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw Sx("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){const n=Bx(e.charCodeAt(i)),a=Bx(e.charCodeAt(i+1));if(void 0===n||void 0===a)throw Sx('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);r[t]=16*n+a}return r}function Rx(e){if(e<0)throw Sx("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?`0${t}`:t}function Nx(e){return e.length>=2&&"0"===e[0]&&"x"===e[1]}function Fx(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return Nx(e)?Ox((n="string"!=typeof(r=e)?r:Nx(r)?r.slice(2):r).length%2?`0${n}`:n):(t=e,(new TextEncoder).encode(t));var t,n,r;if("number"==typeof e||"bigint"==typeof e)return e?Ox(Rx(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw Sx("toBytes: received unsupported type "+typeof e)}const Lx=function(e,t=!1){if(null==e||0===e.length)return Uint8Array.from([]);const n=Ix(Fx(e));if(t)return{data:n.data,remainder:n.remainder.slice()};if(0!==n.remainder.length)throw Sx("invalid RLP: remainder must be zero");return n.data},Hx=Ng??c;class qx extends My{get type(){return this._klaytnType}constructor(e,t={}){const n=t.freeze;if(t.freeze=!1,super(e,t),!e.type)throw new Error("Missing 'type' field");this._klaytnType=pf(e.type),this.from=e.from,this.chainId=e.chainId,this.key=e.key,this.feePayer=e.feePayer,this.feePayer_v=e.feePayer_v,this.feePayer_r=e.feePayer_r,this.feePayer_s=e.feePayer_s,this.txSignatures=e.txSignatures,this.feePayerSignatures=e.feePayerSignatures,this.feeRatio=e.feeRatio;const r={type:ff(this.type||0),nonce:ff(this.nonce),gasPrice:ff(this.gasPrice),gasLimit:ff(this.gasLimit),to:this.to?Zh(this.to.toString()):void 0,value:ff(this.value),from:this.from,data:Zh(this.data),input:Zh(this.data),chainId:this.chainId?ff(this.chainId):void 0,humanReadable:!1,codeFormat:0,key:this.key,feePayer:this.feePayer,txSignatures:this.txSignatures,feePayerSignatures:this.feePayerSignatures,feeRatio:this.feeRatio};e.type!=we.SmartContractDeploy&&e.type!=we.FeeDelegatedSmartContractDeploy&&e.type!=we.FeeDelegatedSmartContractDeployWithRatio||(r.to="0x0000000000000000000000000000000000000000"),this.coreKlaytnTx=Za.fromObject(r),this.v&&this.r&&this.s&&this.coreKlaytnTx.addSenderSig({v:Number(this.v),r:Yh(this.r),s:Yh(this.s)}),this.feePayer_v&&this.feePayer_r&&this.feePayer_s&&this.coreKlaytnTx.addFeePayerSig({v:Number(this.feePayer_v),r:Yh(this.feePayer_r),s:Yh(this.feePayer_s)}),this.txOptions.freeze=n,(this.txOptions.freeze??1)&&Object.freeze(this)}getMessageToSign(e=!0){const t=Qh(this.coreKlaytnTx.sigRLP());return e?vc(t):Lx(t)}getMessageToSignAsFeePayer(e=!0){const t=Qh(this.coreKlaytnTx.sigFeePayerRLP());return e?vc(t):Lx(t)}sign(e){if(32!==e.length){const e=this._errorMsg("Private key must be 32 bytes in length.");throw new Error(e)}if(!this.chainId)throw new Error("Missing 'chainId' field");const t=this.getMessageToSign(!0),{r:n,s:r,v:i}=this._eip155sign(t,e,this.chainId);return new qx({...this,type:this.type,v:i,r:mf(Zh(n)),s:mf(Zh(r))},this.txOptions)}signAsFeePayer(e){if(32!==e.length){const e=this._errorMsg("Private key must be 32 bytes in length.");throw new Error(e)}if(!this.chainId)throw new Error("Missing 'chainId' field");const t=this.getMessageToSignAsFeePayer(!0),{v:n,r,s:i}=this._eip155sign(t,e,this.chainId);return new qx({...this,type:this.type,feePayer_v:n,feePayer_r:mf(Zh(r)),feePayer_s:mf(Zh(i))},this.txOptions)}serialize(){return Te(this.type)?Qh(this.coreKlaytnTx.senderTxHashRLP()):Qh(this.coreKlaytnTx.txHashRLP())}serializeAsFeePayer(){return Qh(this.coreKlaytnTx.txHashRLP())}_eip155sign(e,t,n){const r=Hx.sign(e,t),i=r.toCompactRawBytes(),a=i.subarray(0,32),o=i.subarray(32,64),s=r.recovery;return{v:BigInt(s+35)+n*BigInt(2),r:a,s:o}}}function Dx(e){return async(t,n)=>{const r=zx(t),i=Zh(n),a=await Gx(r,e,n);return Ny(a,i)}}function Ux(e){return async(t,n,r)=>{const i=zx(t),a=Zh(n);if(!Te(Kx(i.type)))throw new Error(`signTransactionAsFeePayer not supported for tx type ${i.type}`);return async function(e,t){e.feePayer&&"0x0000000000000000000000000000000000000000"!=e.feePayer||(e.feePayer=t),_x().isArray(e.feePayerSignatures)&&(e.feePayerSignatures=e.feePayerSignatures.filter(e=>!(_x().isArray(e)&&3==e.length&&"0x01"==e[0]&&"0x"==e[1]&&"0x"==e[2])))}(i,r||Hy(n)),async function(e,t){if(!(e instanceof qx))throw new Error("attempted signTransactionAsFeePayer with non-klaytn tx");const n=e.signAsFeePayer(Qh(t));if(Bh(n.feePayer_v)||Bh(n.feePayer_r)||Bh(n.feePayer_s))throw new Ks("Signer Error");const r=n.validate(!0);if(r.length>0){let e="Signer Error ";for(const t of r)e+=`${e} ${t}.`;throw new Ks(e)}const i=Zh(n.serializeAsFeePayer()),a=ep(i);return{messageHash:Zh(n.getMessageToSignAsFeePayer(!0)),v:`0x${n.feePayer_v.toString(16)}`,r:`0x${n.feePayer_r.toString(16).padStart(64,"0")}`,s:`0x${n.feePayer_s.toString(16).padStart(64,"0")}`,rawTransaction:i,transactionHash:Zh(a)}}(await Gx(i,e,n),a)}}function zx(e){return _x().isString(e)?Za.fromRLP(e).toObject():e}async function Gx(e,t,n){const r=!0,i=!0;if(!_e(Kx(e.type)))return await jw(e,t,n,r,i);const a=Bh(e.gasLimit)&&Bh(e.gas),o=function(e){if(e.chainId)return BigInt(e.chainId);const t=Le(e.txSignatures)??Le(e.feePayerSignatures);return t?BigInt(t):void 0}(e),s=function(e){const t={};for(const n in e)-1===Wx.indexOf(n)&&(t[n]=_x().get(e,n),_x().unset(e,n));return Za.has(e.type)&&(t.type=e.type,e.type=0),t}(e=_x().clone(e)),u=Px("from",t,e,n);e.from??(e.from=u);const c=await jw(e,t,n,r,i),l={...c,gasLimit:a?Vx(c.gasLimit):c.gasLimit,from:u,chainId:o??c.common.chainId(),...s},d=c.txOptions;return new qx(l,d)}function Vx(e){return Math.ceil(2.5*Number(e))}const Wx=["value","accessList","common","gas","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","data","input","nonce","chain","hardfork","chainId","networkId","gasLimit","yParity","v","r","s","from","to"];function Kx(e){return"bigint"==typeof e&&(e=Number(e)),null===e?0:xe(e)}async function Zx(e,t,n){_x().isString(e)||(e=JSON.stringify(e));const r=JSON.parse(e).address,i=He(e,!1),a=[];for(const e of i){const i=await Gy(e,t,n?.nonStrict??!0);i.address=bf(r),a.push(i)}return a}function Qx(e,t){const n=Dx(e),r=Ux(e);return{...t,signTransaction:e=>n(e,t.privateKey),signTransactionAsFeePayer:e=>r(e,t.privateKey,t.address)}}function $x(e){const t=Qa(e);if(!_e(Kx(t.type)))return Fy(e);if(!t.from)throw new Error(`missing tx.from in tx type ${t.type}`);return bf(t.from)}class Jx extends lm{async decrypt(e,t,n){const r=e.map(e=>JSON.stringify(e));for(const e of r)if(qe(e))throw new Error("KIP-3 (v4) keystores unsupported in Wallet. Use web3.eth.accounts.decrypt and web3.eth.accounts.decryptList instead.");return super.decrypt(e,t,n)}}const Yx=(e,t)=>{if(e instanceof $o&&e.innerError instanceof Qo){if(void 0!==t){const n=t.filter(e=>Qb(e));return ew(n,e.innerError),{reason:e.innerError.message,signature:e.innerError.data?.slice(0,10),data:e.innerError.data?.substring(10),customErrorName:e.innerError.errorName,customErrorDecodedSignature:e.innerError.errorSignature,customErrorArguments:e.innerError.errorArgs}}return{reason:e.innerError.message,signature:e.innerError.data?.slice(0,10),data:e.innerError.data?.substring(10)}}if(e instanceof du&&!Array.isArray(e.innerError)&&void 0!==e.innerError)return e.innerError.message;throw e};async function Xx(e,t,n,r=no){try{return void await gw(e,t,e.defaultBlock,r)}catch(e){return Yx(e,n)}}async function ek(e,t,n,r,i,a){let o,s=a;if(void 0===s&&(void 0!==r?s=Yx(r):e.handleRevert&&void 0!==t&&(s=await Xx(e,t,i))),void 0===s)o=new ms(n);else if("string"==typeof s)o=new fs(s,void 0,n);else if(void 0!==s.customErrorName&&void 0!==s.customErrorDecodedSignature&&void 0!==s.customErrorArguments){const e=s;o=new ps(e.reason,e.customErrorName,e.customErrorDecodedSignature,e.customErrorArguments,e.signature,n,e.data)}else o=new fs(s.reason,s.signature,n,s.data);return o}async function tk(e,t,n){const r=await lw(t,t.defaultBlock,!1,n);if(Bh(r.baseFeePerGas))throw new Ls;if(!Bh(e.gasPrice)){const t=$f({format:"uint"},e.gasPrice,n);return{maxPriorityFeePerGas:t,maxFeePerGas:t}}return{maxPriorityFeePerGas:$f({format:"uint"},e.maxPriorityFeePerGas??t.defaultMaxPriorityFeePerGas,n),maxFeePerGas:$f({format:"uint"},e.maxFeePerGas??BigInt(r.baseFeePerGas)*BigInt(2)+BigInt(e.maxPriorityFeePerGas??t.defaultMaxPriorityFeePerGas),n)}}async function nk(e,t,n){const r=((e,t)=>{const n=lb(e,t);return Bh(n)?Bh(t.defaultTransactionType)?void 0:$f({format:"uint"},t.defaultTransactionType,ro):n})(e,t);if(!Bh(r)){if(r.startsWith("-"))throw new Hs(r);if(Number(r)<0||Number(r)>127)throw new Hs(r);if(Bh(e.gasPrice)&&("0x0"===r||"0x1"===r))return{gasPrice:await uw(t,n),maxPriorityFeePerGas:void 0,maxFeePerGas:void 0};if("0x2"===r)return{gasPrice:void 0,...await tk(e,t,n)}}}function rk(e,t,n){const r=e.transactionPollingInterval,[i,a]=yp(async()=>{let r;try{r=await cw(e,Ob)}catch(e){return void console.warn("An error happen while trying to get the block number",e)}const i=r-t;if(i>=e.transactionBlockTimeout)return new Gs({starterBlockNumber:t,numberOfBlocks:i,transactionHash:n})},r);return[a,{clean:()=>{clearInterval(i)}}]}async function ik(e,t){const{provider:n}=e.requestManager;let r;const i=await cw(e,Ob);return r=n.supportsSubscriptions?.()&&e.enableExperimentalFeatures.useSubscriptionWhenCheckingBlockTimeout?await async function(e,t,n){let r,i,a=!0;function o(r,o){o&&console.warn("error happened at subscription. So revert to polling...",o),i.clean(),a=!1;const[s,u]=rk(e,t,n);i.clean=u.clean,s.catch(e=>r(e))}try{r=await(e.subscriptionManager?.subscribe("newHeads")),i={clean:()=>{r.id&&e.subscriptionManager?.removeSubscription(r).then(()=>{}).catch(()=>{})}}}catch(r){return rk(e,t,n)}return[new Promise((i,s)=>{try{r.on("data",r=>{if(a=!1,!r?.number)return;const i=Number(BigInt(r.number)-BigInt(t));i>=e.transactionBlockTimeout&&s(new Gs({starterBlockNumber:t,numberOfBlocks:i,transactionHash:n}))}),r.on("error",e=>{o(s,e)})}catch(e){o(s,e)}setTimeout(()=>{a&&o(s)},1e3*e.blockHeaderTimeout)}),i]}(e,i,t):rk(e,i,t),r}async function ak(e,t,n){const[r,i]=gp(e.transactionSendTimeout,new Ds({numberOfSeconds:e.transactionSendTimeout/1e3,transactionHash:n})),[a,o]=await ik(e,n);try{return await Promise.race([t(),i,a])}finally{clearTimeout(r),o.clean()}}const ok=({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,returnFormat:r})=>{let i=1;const a=setInterval(()=>{(async()=>{i>=e.transactionConfirmationBlocks&&clearInterval(a);const o=await nb(e.requestManager,Yh(BigInt(t.blockNumber)+BigInt(i)),!1);o?.hash&&(i+=1,n.emit("confirmation",{confirmations:$f({format:"uint"},i,r),receipt:$f(xb,t,r),latestBlockHash:$f({format:"bytes32"},o.hash,r)}))})()},e.transactionReceiptPollingInterval??e.transactionPollingInterval)};class sk{constructor({options:e,web3Context:t,promiEvent:n,returnFormat:r}){this.options={checkRevertBeforeSending:!0},this.options=e,this.web3Context=t,this.promiEvent=n,this.returnFormat=r}getReceiptWithEvents(e){const t={...e??{}};if(this.options?.contractAbi&&t.logs&&t.logs.length>0){t.events={};for(const e of t.logs){const n=iw(Bb,e,this.options?.contractAbi,this.returnFormat);n.event&&(t.events[n.event]=n)}}return t}async checkRevertBeforeSending(e){if(!1!==this.options.checkRevertBeforeSending){const t=await Xx(this.web3Context,e,this.options.contractAbi);if(void 0!==t)throw await ek(this.web3Context,e,void 0,void 0,this.options.contractAbi,t)}}emitSending(e){this.promiEvent.listenerCount("sending")>0&&this.promiEvent.emit("sending",e)}async populateGasPrice({transactionFormatted:e,transaction:t}){let n=e;return!this.options?.ignoreGasPricing&&Bh(e.gasPrice)&&(Bh(t.maxPriorityFeePerGas)||Bh(t.maxFeePerGas))&&(n={...e,...await nk(e,this.web3Context,ro)}),n}async signAndSend({wallet:e,tx:t}){if(e){const n=await e.signTransaction(t);return ak(this.web3Context,async()=>tb(this.web3Context.requestManager,n.rawTransaction),n.transactionHash)}return ak(this.web3Context,async()=>eb(this.web3Context.requestManager,t))}emitSent(e){this.promiEvent.listenerCount("sent")>0&&this.promiEvent.emit("sent",e)}emitTransactionHash(e){this.promiEvent.listenerCount("transactionHash")>0&&this.promiEvent.emit("transactionHash",e)}emitReceipt(e){this.promiEvent.listenerCount("receipt")>0&&this.promiEvent.emit("receipt",e)}async handleError({error:e,tx:t}){let n=e;return n instanceof $o&&this.web3Context.handleRevert&&(n=await ek(this.web3Context,t,void 0,void 0,this.options?.contractAbi)),(n instanceof du||n instanceof $o||n instanceof ps||n instanceof ms||n instanceof fs)&&this.promiEvent.listenerCount("error")>0&&this.promiEvent.emit("error",n),n}emitConfirmation({receipt:e,transactionHash:t}){this.promiEvent.listenerCount("confirmation")>0&&function(e,t,n,r,i){if(Bh(n)||Bh(n.blockHash))throw new Vs({receipt:n,blockHash:$f({format:"bytes32"},n?.blockHash,i),transactionHash:$f({format:"bytes32"},r,i)});if(!n.blockNumber)throw new Ws({receipt:n});t.emit("confirmation",{confirmations:$f({format:"uint"},1,i),receipt:$f(xb,n,i),latestBlockHash:$f({format:"bytes32"},n.blockHash,i)});const a=e.requestManager.provider;a&&"supportsSubscriptions"in a&&a.supportsSubscriptions()?(({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,returnFormat:r})=>{let i,a=!0;setImmediate(()=>{e.subscriptionManager?.subscribe("newHeads").then(o=>{o.on("data",async s=>{if(a=!1,!s?.number||i===s?.parentHash)return;i=s?.parentHash;const u=BigInt(s.number)-BigInt(t.blockNumber)+BigInt(1);n.emit("confirmation",{confirmations:$f({format:"uint"},u,r),receipt:$f(xb,t,r),latestBlockHash:$f({format:"bytes32"},s.parentHash,r)}),u>=e.transactionConfirmationBlocks&&await(e.subscriptionManager?.removeSubscription(o))}),o.on("error",async()=>{await(e.subscriptionManager?.removeSubscription(o)),a=!1,ok({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,returnFormat:r})})}).catch(()=>{a=!1,ok({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,returnFormat:r})})}),setTimeout(()=>{a&&ok({web3Context:e,transactionReceipt:t,transactionPromiEvent:n,returnFormat:r})},1e3*e.blockHeaderTimeout)})({web3Context:e,transactionReceipt:n,transactionPromiEvent:t,returnFormat:i}):ok({web3Context:e,transactionReceipt:n,transactionPromiEvent:t,returnFormat:i})}(this.web3Context,this.promiEvent,e,t,this.returnFormat)}async handleResolve({receipt:e,tx:t}){if(this.options?.transactionResolver)return this.options?.transactionResolver(e);if(e.status===BigInt(0)){const n=await ek(this.web3Context,t,e,void 0,this.options?.contractAbi);throw this.promiEvent.listenerCount("error")>0&&this.promiEvent.emit("error",n),n}return e}}async function uk(e,t,n){const r=e.transactionReceiptPollingInterval??e.transactionPollingInterval,[i,a]=pp(async()=>{try{return dw(e,t,n)}catch(e){return void console.warn("An error happen while trying to get the transaction receipt",e)}},r),[o,s]=gp(e.transactionPollingTimeout,new zs({numberOfSeconds:e.transactionPollingTimeout/1e3,transactionHash:t})),[u,c]=await ik(e,t);try{return await Promise.race([i,s,u])}finally{o&&clearTimeout(o),a&&clearInterval(a),c.clean()}}function ck(e){if(e instanceof Uint8Array&&(e=Zh(e)),e.length<4||!e.startsWith("0x"))throw new Error(`Invalid signed transaction '${e}'`);return e}function lk(e){const t=Qa(e);return{type:se.fromNumber(t.type||0),to:t.to||"0x",gasPrice:se.fromNumber(t.gasPrice||0),gas:se.fromNumber(t.gasLimit),nonce:se.fromNumber(t.nonce),value:se.fromNumber(t.value),input:t.data||"0x",data:t.data||"0x",chainId:se.fromNumber(t.chainId||0),v:"",r:"",s:""}}function dk(e){return function(t,n=no,r){return function(e,t,n,r={checkRevertBeforeSending:!1}){const i=new Jy((a,o)=>{setImmediate(()=>{(async()=>{const s=new sk({web3Context:e,promiEvent:i,options:r,returnFormat:n}),u=t.map(ck),c=u.map(e=>an(Qa(e)));try{const t=await e.requestManager.send({method:"kaia_sendRawTransactions",params:[u]});for(const e of u)s.emitSent(e);for(const e of t){const t=$f({format:"bytes32"},e,n);s.emitTransactionHash(t)}const r=[];for(let i=0;i<t.length;i++){const a=t[i],o=await uk(e,a,n),u=s.getReceiptWithEvents($f(xb,o,n));s.emitReceipt(u),r.push(await s.handleResolve({receipt:u,tx:c[i]}))}a(r)}catch(e){o(await s.handleError({error:e,tx:c[0]}))}})()})});return i}(e,t,n,r)}}const hk=[{inputs:[{internalType:"address",name:"_wkaia",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"CommissionClaimed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"oldRate",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newRate",type:"uint256"}],name:"CommissionRateUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"proposer",type:"address"},{indexed:!1,internalType:"uint256",name:"amountRepaid",type:"uint256"},{indexed:!0,internalType:"address",name:"user",type:"address"},{indexed:!1,internalType:"uint256",name:"finalUserAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"commission",type:"uint256"}],name:"SwappedForGas",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token",type:"address"},{indexed:!0,internalType:"address",name:"factory",type:"address"},{indexed:!1,internalType:"address",name:"router",type:"address"}],name:"TokenAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token",type:"address"}],name:"TokenRemoved",type:"event"},{inputs:[],name:"WKAIA",outputs:[{internalType:"contract IWKAIA",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"factory",type:"address"},{internalType:"address",name:"router",type:"address"}],name:"addToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"claimCommission",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"commissionRate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"dexAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountOut",type:"uint256"}],name:"getAmountIn",outputs:[{internalType:"uint256",name:"amountIn",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"getDEXInfo",outputs:[{internalType:"address",name:"factory",type:"address"},{internalType:"address",name:"router",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getSupportedTokens",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"isTokenSupported",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"removeToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"minAmountOut",type:"uint256"},{internalType:"uint256",name:"amountRepay",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"}],name:"swapForGas",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_commissionRate",type:"uint256"}],name:"updateCommissionRate",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],fk=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"name",type:"string"},{indexed:!0,internalType:"address",name:"addr",type:"address"},{indexed:!0,internalType:"uint256",name:"activation",type:"uint256"}],name:"Registered",type:"event"},{inputs:[{internalType:"string",name:"name",type:"string"}],name:"getActiveAddr",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getAllNames",outputs:[{internalType:"string[]",name:"",type:"string[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"string",name:"name",type:"string"}],name:"getAllRecords",outputs:[{components:[{internalType:"address",name:"addr",type:"address"},{internalType:"uint256",name:"activation",type:"uint256"}],internalType:"struct IRegistry.Record[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"names",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"string",name:"",type:"string"},{internalType:"uint256",name:"",type:"uint256"}],name:"records",outputs:[{internalType:"address",name:"addr",type:"address"},{internalType:"uint256",name:"activation",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"string",name:"name",type:"string"},{internalType:"address",name:"addr",type:"address"},{internalType:"uint256",name:"activation",type:"uint256"}],name:"register",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],pk=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}],mk="0x"+"f".repeat(64),gk=1e5,yk=5e5;function bk(e,t){const n=BigInt(t);return n*BigInt(21e3)+n*(e?BigInt(gk):BigInt(0))+n*BigInt(yk)}function vk(e,t,n){const r=BigInt(e),i=BigInt(t),a=BigInt(n),o=BigInt(1e4);if(a<0||a>=1e4)throw new Error("Commission rate must be between 0 and 9999 basis points");return i*o/(o-a)+r}async function wk(e,t,n,r){const i=BigInt(n),a=BigInt(r),o=BigInt(1e4),s=i*(o+a)/o,u=await e.methods.getAmountIn(t,s).call();return BigInt(u)}class Ak extends Ky{constructor(e){const t=function(e){let t={};return"string"==typeof e||em(e)?t.provider=e:t=e||{},t}(e);super(t),this._web3=new xx(e),this.utils=this._web3.utils;const n=function(e){const t=Dx(e),n=Ux(e),r=function(e){return function(){const t=zy();return Qx(e,t)}}(e),i=function(e){return function(t,n){const r=Uy(t);return Qx(e,{...r,address:n||r.address})}}(e),a=function(e){return async function(t,n,r){if(_x().isString(t)||(t=JSON.stringify(t)),qe(t)){const i=await Zx(t,n,r);return Qx(e,i[0])}{const i=await Gy(t,n,r?.nonStrict??!0);return Qx(e,i)}}}(e),o=function(e){return async function(t,n,r){if(_x().isString(t)||(t=JSON.stringify(t)),qe(t)){const i=await Zx(t,n,r);return _x().map(i,t=>Qx(e,t))}{const i=await Gy(t,n,r?.nonStrict??!0);return[Qx(e,i)]}}}(e);return{recoverTransaction:$x,hashMessage:Oy,sign:Ry,recover:Ly,encrypt:Dy,create:r,privateKeyToAccount:i,decrypt:a,decryptList:o,signTransaction:t,signTransactionAsFeePayer:n,wallet:new Jx({create:r,privateKeyToAccount:i,decrypt:a})}}(this);var r;this.eth=Object.assign(this._web3.eth,{accounts:n,sendSignedTransactions:dk(this._web3)}),this._accountProvider=n,this._wallet=n.wallet,this.eth.getProtocolVersion=(r=this._web3,async()=>async function(e){try{return e.send({method:"klay_protocolVersion",params:[]})}catch(t){return e.send({method:"eth_protocolVersion",params:[]})}}(r.requestManager)),this.eth.sendTransaction=function(e){return function(t,n=no,r){return function(e,t,n,r={checkRevertBeforeSending:!0}){const i=new Jy((a,o)=>{setImmediate(()=>{(async()=>{const s=new sk({web3Context:e,promiEvent:i,options:r,returnFormat:n}),u={...t,from:Px("from",e,t),to:Px("to",e,t)};if(Bh(u.gasLimit)&&!r.ignoreFillingGasLimit)if(Bh(u.gas)){const t=await yw(e,u,"latest",ro),n=Vx(Number(t));u.gasLimit=$f({format:"uint"},n,ro)}else u.gasLimit=u.gas;const c={...an(u),type:void 0},l={...u,...an(u)};try{let t;await s.checkRevertBeforeSending(c),s.emitSending(l),e.wallet&&!Bh(u.from)&&(t=e.wallet.get(u.from));const r=await async function(e,t,n){if(n){const r=await n.signTransaction(t);let i;return i=_e(Kx(t.type))?"klay_sendRawTransaction":"eth_sendRawTransaction",await ak(e,async()=>e.requestManager.send({method:i,params:[r.rawTransaction]}),r.transactionHash)}{let n;return _e(Kx(t.type))&&(r=e.provider,!Bh(r)&&1==r.isKaikas)&&(t.type=ke(Kx(t.type))),n=_e(Kx(t.type))?"klay_sendTransaction":"eth_sendTransaction",await ak(e,async()=>e.requestManager.send({method:n,params:[t]}))}var r}(e,l,t),i=$f({format:"bytes32"},r,n);s.emitSent(l),s.emitTransactionHash(i);const o=await uk(e,r,n),d=s.getReceiptWithEvents($f(xb,o,n));s.emitReceipt(d),a(await s.handleResolve({receipt:d,tx:c})),s.emitConfirmation({receipt:d,transactionHash:r})}catch(e){o(await s.handleError({error:e,tx:c}))}})()})});return i}(e,t,n,r)}}(this._web3),this.eth.sendSignedTransaction=function(e){return function(t,n=no,r){return function(e,t,n,r={checkRevertBeforeSending:!0}){const i=ck(t);if(!_e($h(i.substring(0,4))))return pw(e,t,n,r);const a=new Jy((i,o)=>{setImmediate(()=>{(async()=>{const s=new sk({web3Context:e,promiEvent:a,options:r,returnFormat:n}),u=ck(t),c=an(Qa(u));try{await s.checkRevertBeforeSending(c),s.emitSending(u);const t=await ak(e,async()=>e.requestManager.send({method:"klay_sendRawTransaction",params:[u]}));s.emitSent(u);const r=$f({format:"bytes32"},t,n);s.emitTransactionHash(r);const a=await uk(e,t,n),o=s.getReceiptWithEvents($f(xb,a,n));s.emitReceipt(o),i(await s.handleResolve({receipt:o,tx:c})),s.emitConfirmation({receipt:o,transactionHash:t})}catch(e){o(await s.handleError({error:e,tx:c}))}})()})});return a}(e,t,n,r)}}(this._web3),this.eth.sendSignedTransactions=dk(this._web3),this.eth.signTransaction=function(e){return function(t,n=no){return async function(e,t,n){if(!_e(Kx(t.type)))return mw(e,t,n);const r={...t,from:Px("from",e,t),to:Px("to",e,t)};if(Bh(r.gasLimit))if(Bh(r.gas)){const t=await yw(e,r,"latest",ro),n=Vx(Number(t));r.gasLimit=$f({format:"uint"},n,ro)}else r.gasLimit=r.gas;const i={...r,...an(r)};var a;a=e.provider,Bh(a)||1!=a.isKaikas||(i.type=ke(i.type));const o=await e.requestManager.send({method:"klay_signTransaction",params:[i]});let s;if("string"==typeof o)s=o;else if("string"==typeof o.rawTransaction)s=o.rawTransaction;else{if("string"!=typeof o.raw)throw new Error(`Unabled to parse signTransaction response: ${JSON.stringify(o)}`);s=o.raw}try{return{raw:s,tx:lk(s)}}catch(e){return{raw:s,tx:{}}}}(e,t,n)}}(this._web3),this.gasless=function(e,t){return{getGaslessSwapRouter:async function(t){return await async function(e,t){let n;if(t)n=t;else{const t=new Uw(fk,"0x0000000000000000000000000000000000000401",e),r=await t.methods.getActiveAddr("GaslessSwapRouter").call();if(!r)throw new Error("GaslessSwapRouter not found in the registry");n=r}return new Uw(hk,n,e)}(e,t)},getApproveTx:async function(n,r,i,a){return await async function(e,t,n,r,i,a){const o=new Uw(pk,r,e).methods.approve(i,mk).encodeABI();return{type:0,from:n,to:r,nonce:await t.getTransactionCount(n),gas:gk,gasPrice:a,value:0n,data:o}}(e,t,n,r,i,a)},getSwapTx:async function(e,n,r,i,a,o,s,u=!1,c=1800){return await async function(e,t,n,r,i,a,o,s,u,c){const l=await e.getBlock("latest");if(!l)throw new Error("Failed to get latest block");const d=l.timestamp+BigInt(c);let h=await e.getTransactionCount(t);u&&(h+=1n);const f=new Uw(hk).methods.swapForGas(n,i,a,o,d).encodeABI();return{type:0,from:t,to:r,nonce:h,gas:yk,gasPrice:s,value:0n,data:f}}(t,e,n,r,i,a,o,s,u,c)},getAmountRepay:bk,getMinAmountOut:vk,getAmountIn:wk}}(this._web3,this.eth);const i=this.makeSendFunction(),{y6:a,__:o,He:s,Ks:u,yO:c,tN:l,Zg:d}=to;this.admin=Ge(i,a),this.debug=Ge(i,o),this.governance=Ge(i,s),this.klay=Ge(i,u),this.kaia=Ge(i,u),this.net=Ge(i,c),this.personal=Ge(i,l),this.txpool=Ge(i,d)}makeSendFunction(){return this.provider?async(e,t)=>{const n=await(this.provider?.request({jsonrpc:"2.0",id:"1",method:e,params:t}));if(n?.error)throw new lu(n);return n?.result}:async(e,t)=>{throw new ss("no provider set")}}}Ak.version=xx.version,Ak.utils=xx.utils,Ak.modules=xx.modules})(),window.web3_ext=r})();