From 3337008c4df383539ef0e94a652340edca612770 Mon Sep 17 00:00:00 2001 From: Jenya476 Date: Fri, 7 Jun 2024 16:32:05 +0300 Subject: [PATCH] Updates --- asset-manifest.json | 6 +++--- index.html | 2 +- static/js/{main.eb0254f2.js => main.6cf217e7.js} | 6 +++--- ...eb0254f2.js.LICENSE.txt => main.6cf217e7.js.LICENSE.txt} | 0 static/js/{main.eb0254f2.js.map => main.6cf217e7.js.map} | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) rename static/js/{main.eb0254f2.js => main.6cf217e7.js} (99%) rename static/js/{main.eb0254f2.js.LICENSE.txt => main.6cf217e7.js.LICENSE.txt} (100%) rename static/js/{main.eb0254f2.js.map => main.6cf217e7.js.map} (71%) diff --git a/asset-manifest.json b/asset-manifest.json index 197910e..97c0def 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,15 +1,15 @@ { "files": { "main.css": "/allbridge-example-react/static/css/main.520ab86f.css", - "main.js": "/allbridge-example-react/static/js/main.eb0254f2.js", + "main.js": "/allbridge-example-react/static/js/main.6cf217e7.js", "static/js/453.809a7fa7.chunk.js": "/allbridge-example-react/static/js/453.809a7fa7.chunk.js", "index.html": "/allbridge-example-react/index.html", "main.520ab86f.css.map": "/allbridge-example-react/static/css/main.520ab86f.css.map", - "main.eb0254f2.js.map": "/allbridge-example-react/static/js/main.eb0254f2.js.map", + "main.6cf217e7.js.map": "/allbridge-example-react/static/js/main.6cf217e7.js.map", "453.809a7fa7.chunk.js.map": "/allbridge-example-react/static/js/453.809a7fa7.chunk.js.map" }, "entrypoints": [ "static/css/main.520ab86f.css", - "static/js/main.eb0254f2.js" + "static/js/main.6cf217e7.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index 86e8600..5bc443a 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Allbridge Core SDK Example
\ No newline at end of file +Allbridge Core SDK Example
\ No newline at end of file diff --git a/static/js/main.eb0254f2.js b/static/js/main.6cf217e7.js similarity index 99% rename from static/js/main.eb0254f2.js rename to static/js/main.6cf217e7.js index 2a9842d..f7467b3 100644 --- a/static/js/main.eb0254f2.js +++ b/static/js/main.6cf217e7.js @@ -1,3 +1,3 @@ -/*! For license information please see main.eb0254f2.js.LICENSE.txt */ -(()=>{var __webpack_modules__={63920:function(e,t,r){"use strict";var n,o,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.chainProperties=t.ChainDecimalsByType=t.ChainType=t.ChainSymbol=void 0,a(r(22168),t),function(e){e.GRL="GRL",e.SPL="SPL",e.HOL="HOL",e.BSC="BSC",e.ETH="ETH",e.BAS="BAS",e.SOL="SOL",e.TRX="TRX",e.POL="POL",e.MUM="MUM",e.AMO="AMO",e.ARB="ARB",e.CEL="CEL",e.AVA="AVA",e.SRB="SRB",e.STLR="STLR",e.OPT="OPT"}(n=t.ChainSymbol||(t.ChainSymbol={})),function(e){e.EVM="EVM",e.SOLANA="SOLANA",e.TRX="TRX",e.SRB="SRB"}(o=t.ChainType||(t.ChainType={})),t.ChainDecimalsByType={EVM:18,SOLANA:9,TRX:6,SRB:7},t.chainProperties={[n.GRL]:{chainSymbol:n.GRL,chainId:"0x5",name:"Goerli",chainType:o.EVM},[n.SPL]:{chainSymbol:n.SPL,chainId:"0xaa36a7",name:"Sepolia",chainType:o.EVM},[n.HOL]:{chainSymbol:n.HOL,chainId:"0x4268",name:"Hole\u0161ky",chainType:o.EVM},[n.BSC]:{chainSymbol:n.BSC,chainId:"0x38",name:"BNB Chain",chainType:o.EVM},[n.ETH]:{chainSymbol:n.ETH,chainId:"0x1",name:"Ethereum",chainType:o.EVM},[n.BAS]:{chainSymbol:n.BAS,chainId:"0x2105",name:"Base",chainType:o.EVM},[n.ARB]:{chainSymbol:n.ARB,chainId:"0xa4b1",name:"Arbitrum",chainType:o.EVM},[n.AVA]:{chainSymbol:n.AVA,chainId:"0xa86a",name:"Avalanche",chainType:o.EVM},[n.CEL]:{chainSymbol:n.CEL,chainId:"0xa4ec",name:"Celo",chainType:o.EVM},[n.POL]:{chainSymbol:n.POL,chainId:"0x89",name:"Polygon",chainType:o.EVM},[n.MUM]:{chainSymbol:n.MUM,chainId:"0x13881",name:"Mumbai",chainType:o.EVM},[n.AMO]:{chainSymbol:n.AMO,chainId:"0x13882",name:"Amoy",chainType:o.EVM},[n.OPT]:{chainSymbol:n.OPT,chainId:"0xa",name:"OP Mainnet",chainType:o.EVM},[n.SOL]:{chainSymbol:n.SOL,name:"Solana",chainType:o.SOLANA},[n.TRX]:{chainSymbol:n.TRX,name:"Tron",chainType:o.TRX},[n.SRB]:{chainSymbol:n.SRB,name:"Stellar",chainType:o.SRB},[n.STLR]:{chainSymbol:n.STLR,name:"Stellar",chainType:o.SRB}}},22168:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},27503:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Messenger=t.MessengerKeyDTO=t.AddressStatus=void 0,function(e){e.OK="OK",e.INVALID="INVALID",e.FORBIDDEN="FORBIDDEN",e.UNINITIALIZED="UNINITIALIZED",e.CONTRACT_ADDRESS="CONTRACT_ADDRESS",e.WRONG_ASSOCIATED_ACCOUNT_OWNER="WRONG_ASSOCIATED_ACCOUNT_OWNER"}(t.AddressStatus||(t.AddressStatus={})),function(e){e.ALLBRIDGE="allbridge",e.WORMHOLE="wormhole",e.CCTP="cctp"}(t.MessengerKeyDTO||(t.MessengerKeyDTO={})),function(e){e[e.ALLBRIDGE=1]="ALLBRIDGE",e[e.WORMHOLE=2]="WORMHOLE",e[e.CCTP=3]="CCTP"}(t.Messenger||(t.Messenger={}))},31112:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorCode=t.TxTooLargeError=t.CCTPDoesNotSupportedError=t.NodeRpcUrlNotInitializedError=t.TimeoutError=t.ArgumentInvalidDecimalsError=t.ExtraGasMaxLimitExceededError=t.InvalidTxError=t.VerifyTxError=t.MethodNotSupportedError=t.InvalidMessengerOptionError=t.InvalidGasFeePaymentOptionError=t.JupiterError=t.InsufficientPoolLiquidityError=t.AmountNotEnoughError=t.InvalidAmountError=t.SdkError=t.SdkRootError=void 0;class r extends Error{constructor(e,t){super(t),this.errorCode=e}}t.SdkRootError=r;t.SdkError=class extends r{constructor(e){super(n.SDK_ERROR,e)}};t.InvalidAmountError=class extends r{constructor(e){super(n.INVALID_AMOUNT_ERROR,e)}};t.AmountNotEnoughError=class extends r{constructor(e){super(n.AMOUNT_NOT_ENOUGH_ERROR,e)}};t.InsufficientPoolLiquidityError=class extends r{constructor(e){super(n.INSUFFICIENT_POOL_LIQUIDITY_ERROR,e)}};t.JupiterError=class extends r{constructor(e){super(n.JUPITER_ERROR,e)}};t.InvalidGasFeePaymentOptionError=class extends r{constructor(e){super(n.INVALID_GAS_FEE_PAYMENT_OPTION_ERROR,e)}};t.InvalidMessengerOptionError=class extends r{constructor(e){super(n.INVALID_MESSENGER_OPTION_ERROR,e)}};t.MethodNotSupportedError=class extends r{constructor(e){super(n.METHOD_NOT_SUPPORTED_ERROR,e)}};t.VerifyTxError=class extends r{constructor(e){super(n.VERIFY_TX_ERROR,e)}};t.InvalidTxError=class extends r{constructor(e){super(n.INVALID_TX_ERROR,e)}};t.ExtraGasMaxLimitExceededError=class extends r{constructor(e){super(n.EXTRA_GAS_MAX_LIMIT_EXCEEDED_ERROR,e)}};t.ArgumentInvalidDecimalsError=class extends r{constructor(e,t,r){super(n.ARGUMENT_INVALID_DECIMALS_ERROR,"Argument '".concat(e,"' decimals '").concat(t,"' cannot be greater than '").concat(r,"'"))}};t.TimeoutError=class extends r{constructor(e){super(n.TIMEOUT_ERROR,e)}};t.NodeRpcUrlNotInitializedError=class extends r{constructor(e){super(n.NODE_RPC_URL_NOT_INITIALIZED_ERROR,"For chain '".concat(e,"' Node RPC URL not initialized"))}};t.CCTPDoesNotSupportedError=class extends r{constructor(e){super(n.CCTP_DOES_NOT_SUPPORTED_ERROR,e)}};var n;t.TxTooLargeError=class extends r{constructor(){super(n.TX_TOO_LARGE,"Transaction too large: try again later or switch to another messenger or pay relayer fee in native gas currency")}},function(e){e.SDK_ERROR="SdkError",e.INVALID_AMOUNT_ERROR="InvalidAmountError",e.AMOUNT_NOT_ENOUGH_ERROR="AmountNotEnoughError",e.INSUFFICIENT_POOL_LIQUIDITY_ERROR="InsufficientPoolLiquidityError",e.JUPITER_ERROR="JupiterError",e.INVALID_GAS_FEE_PAYMENT_OPTION_ERROR="InvalidGasFeePaymentOptionError",e.INVALID_MESSENGER_OPTION_ERROR="InvalidMessengerOptionError",e.METHOD_NOT_SUPPORTED_ERROR="MethodNotSupportedError",e.VERIFY_TX_ERROR="VerifyTxError",e.INVALID_TX_ERROR="InvalidTxError",e.EXTRA_GAS_MAX_LIMIT_EXCEEDED_ERROR="ExtraGasMaxLimitExceededError",e.ARGUMENT_INVALID_DECIMALS_ERROR="ArgumentInvalidDecimalsError",e.TIMEOUT_ERROR="TimeoutError",e.NODE_RPC_URL_NOT_INITIALIZED_ERROR="NodeRpcUrlNotInitializedError",e.CCTP_DOES_NOT_SUPPORTED_ERROR="CCTPDoesNotSupportedError",e.TX_TOO_LARGE="TxTooLargeError"}(n=t.ErrorCode||(t.ErrorCode={}))},78412:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(31112),t)},85392:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.AmountFormat=t.FeePaymentMethod=t.ChainType=t.ChainSymbol=t.AddressStatus=t.Messenger=void 0;var i=r(27503);Object.defineProperty(t,"Messenger",{enumerable:!0,get:function(){return i.Messenger}}),Object.defineProperty(t,"AddressStatus",{enumerable:!0,get:function(){return i.AddressStatus}});var a=r(63920);Object.defineProperty(t,"ChainSymbol",{enumerable:!0,get:function(){return a.ChainSymbol}}),Object.defineProperty(t,"ChainType",{enumerable:!0,get:function(){return a.ChainType}}),o(r(22573),t),o(r(78412),t),function(e){e.WITH_NATIVE_CURRENCY="native",e.WITH_STABLECOIN="stablecoin"}(t.FeePaymentMethod||(t.FeePaymentMethod={})),function(e){e.INT="int",e.FLOAT="float"}(t.AmountFormat||(t.AmountFormat={}))},22573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SolanaAutoTxFee=void 0;var n=r(77756);Object.defineProperty(t,"SolanaAutoTxFee",{enumerable:!0,get:function(){return n.SolanaAutoTxFee}})},77756:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SolanaAutoTxFee=void 0,t.SolanaAutoTxFee="AUTO"},51273:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;var n,o=(n=r(1991))&&n.__esModule?n:{default:n},i=r(88602);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 s(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var n,o=r(88602),i=(n=r(45956))&&n.__esModule?n:{default:n};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 s(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Asset=void 0;var n,o=r(70443),i=(n=r(45956))&&n.__esModule?n:{default:n},a=r(68141),s=r(88602),u=r(97470);function c(e){return c="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},c(e)}function l(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:i.default.Asset;if(this.isNative())return r.assetTypeNative();this.code.length<=4?(e=i.default.AlphaNum4,t="assetTypeCreditAlphanum4"):(e=i.default.AlphaNum12,t="assetTypeCreditAlphanum12");var n=this.code.length<=4?4:12;return new r(t,new e({assetCode:this.code.padEnd(n,"\0"),issuer:a.Keypair.fromPublicKey(this.issuer).xdrAccountId()}))}},{key:"getCode",value:function(){if(void 0!==this.code)return String(this.code)}},{key:"getIssuer",value:function(){if(void 0!==this.issuer)return String(this.issuer)}},{key:"getAssetType",value:function(){switch(this.getRawAssetType()){case i.default.AssetType.assetTypeNative():return"native";case i.default.AssetType.assetTypeCreditAlphanum4():return"credit_alphanum4";case i.default.AssetType.assetTypeCreditAlphanum12():return"credit_alphanum12";default:return"unknown"}}},{key:"getRawAssetType",value:function(){return this.isNative()?i.default.AssetType.assetTypeNative():this.code.length<=4?i.default.AssetType.assetTypeCreditAlphanum4():i.default.AssetType.assetTypeCreditAlphanum12()}},{key:"isNative",value:function(){return!this.issuer}},{key:"equals",value:function(e){return this.code===e.getCode()&&this.issuer===e.getIssuer()}},{key:"toString",value:function(){return this.isNative()?"native":"".concat(this.getCode(),":").concat(this.getIssuer())}}],n=[{key:"native",value:function(){return new e("XLM")}},{key:"fromOperation",value:function(e){var t,r;switch(e.switch()){case i.default.AssetType.assetTypeNative():return this.native();case i.default.AssetType.assetTypeCreditAlphanum4():t=e.alphaNum4();case i.default.AssetType.assetTypeCreditAlphanum12():return t=t||e.alphaNum12(),r=s.StrKey.encodeEd25519PublicKey(t.issuer().ed25519()),new this((0,o.trimEnd)(t.assetCode(),"\0"),r);default:throw new Error("Invalid asset type: ".concat(e.switch().name))}}},{key:"compare",value:function(t,r){if(!t||!(t instanceof e))throw new Error("assetA is invalid");if(!r||!(r instanceof e))throw new Error("assetB is invalid");if(t.equals(r))return 0;var n=t.getRawAssetType().value,o=r.getRawAssetType().value;if(n!==o)return n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.authorizeEntry=p,t.authorizeInvocation=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:s.Networks.FUTURENET,u=i.Keypair.random().rawPublicKey(),l=new o.default.Int64((d=u,d.subarray(0,8).reduce((function(e,t){return e<<8|t}),0))),f=n||e.publicKey();var d;if(!f)throw new Error("authorizeInvocation requires publicKey parameter");return p(new o.default.SorobanAuthorizationEntry({rootInvocation:r,credentials:o.default.SorobanCredentials.sorobanCredentialsAddress(new o.default.SorobanAddressCredentials({address:new c.Address(f).toScAddress(),nonce:l,signatureExpirationLedger:0,signature:o.default.ScVal.scvVec([])}))}),e,t,a)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(68141),a=r(88602),s=r(43504),u=r(97470),c=r(70714),l=r(86655);function f(e){return f="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},f(e)}function d(){d=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:P(e,r,s)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",y="suspendedYield",m="executing",g="completed",v={};function b(){}function w(){}function A(){}var S={};c(S,a,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(M([])));_&&_!==r&&n.call(_,a)&&(S=_);var E=A.prototype=b.prototype=Object.create(S);function x(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,a,s){var u=h(e[o],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==f(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function P(t,r,n){var o=p;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=O(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=h(t,r,n);if("normal"===c.type){if(o=n.done?g:y,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.arg)}}}function O(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=h(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function M(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:M(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function h(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(c){return void r(c)}s.done?t(u):Promise.resolve(u).then(n,o)}function p(e,t,r){return y.apply(this,arguments)}function y(){var e;return e=d().mark((function e(t,r,n){var f,h,p,y,m,g,v,b,w,A=arguments;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f=A.length>3&&void 0!==A[3]?A[3]:s.Networks.FUTURENET,t.credentials().switch().value===o.default.SorobanCredentialsType.sorobanCredentialsAddress().value){e.next=3;break}return e.abrupt("return",t);case 3:if(h=o.default.SorobanAuthorizationEntry.fromXDR(t.toXDR()),(p=h.credentials().address()).signatureExpirationLedger(n),y=(0,u.hash)(Buffer.from(f)),m=o.default.HashIdPreimage.envelopeTypeSorobanAuthorization(new o.default.HashIdPreimageSorobanAuthorization({networkId:y,nonce:p.nonce(),invocation:h.rootInvocation(),signatureExpirationLedger:p.signatureExpirationLedger()})),g=(0,u.hash)(m.toXDR()),"function"!==typeof r){e.next=17;break}return e.t0=Buffer,e.next=13,r(m);case 13:e.t1=e.sent,v=e.t0.from.call(e.t0,e.t1),e.next=18;break;case 17:v=Buffer.from(r.sign(g));case 18:if(b=c.Address.fromScAddress(p.address()).toString(),i.Keypair.fromPublicKey(b).verify(g,v)){e.next=21;break}throw new Error("signature doesn't match payload");case 21:return w=(0,l.nativeToScVal)({public_key:a.StrKey.decodeEd25519PublicKey(b),signature:v},{type:{public_key:["symbol",null],signature:["symbol",null]}}),p.signature(o.default.ScVal.scvVec([w])),e.abrupt("return",h);case 24:case"end":return e.stop()}}),e)})),y=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){h(i,n,o,a,s,"next",e)}function s(e){h(i,n,o,a,s,"throw",e)}a(void 0)}))},y.apply(this,arguments)}},79657:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Claimant=void 0;var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(68141),a=r(88602);function s(e){return s="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},s(e)}function u(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;var n,o=r(70714),i=r(11647),a=(n=r(45956))&&n.__esModule?n:{default:n},s=r(88602);function u(e){return u="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},u(e)}function c(e,t){for(var r=0;r1?t-1:0),n=1;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.humanizeEvents=function(e){return e.map((function(e){return e instanceof o.default.DiagnosticEvent?s(e.event()):s(e)}))};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(88602),a=r(86655);function s(e){return{contractId:null===e.contractId()?"":i.StrKey.encodeContract(e.contractId()),type:e.type().name,topics:e.body().value().topics().map((function(e){return(0,a.scValToNative)(e)})),data:(0,a.scValToNative)(e.body().value().data())}}},78618:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.FeeBumpTransaction=void 0;var o,i=(o=r(45956))&&o.__esModule?o:{default:o},a=r(97470),s=r(20502),u=r(23920),c=r(29522);function l(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var u=a?Object.getOwnPropertyDescriptor(e,s):null;u&&(u.get||u.set)?Object.defineProperty(i,s,u):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(75493)).config((function(e){var t=1024;e.typedef("Value",e.varOpaque()),e.struct("ScpBallot",[["counter",e.lookup("Uint32")],["value",e.lookup("Value")]]),e.enum("ScpStatementType",{scpStPrepare:0,scpStConfirm:1,scpStExternalize:2,scpStNominate:3}),e.struct("ScpNomination",[["quorumSetHash",e.lookup("Hash")],["votes",e.varArray(e.lookup("Value"),2147483647)],["accepted",e.varArray(e.lookup("Value"),2147483647)]]),e.struct("ScpStatementPrepare",[["quorumSetHash",e.lookup("Hash")],["ballot",e.lookup("ScpBallot")],["prepared",e.option(e.lookup("ScpBallot"))],["preparedPrime",e.option(e.lookup("ScpBallot"))],["nC",e.lookup("Uint32")],["nH",e.lookup("Uint32")]]),e.struct("ScpStatementConfirm",[["ballot",e.lookup("ScpBallot")],["nPrepared",e.lookup("Uint32")],["nCommit",e.lookup("Uint32")],["nH",e.lookup("Uint32")],["quorumSetHash",e.lookup("Hash")]]),e.struct("ScpStatementExternalize",[["commit",e.lookup("ScpBallot")],["nH",e.lookup("Uint32")],["commitQuorumSetHash",e.lookup("Hash")]]),e.union("ScpStatementPledges",{switchOn:e.lookup("ScpStatementType"),switchName:"type",switches:[["scpStPrepare","prepare"],["scpStConfirm","confirm"],["scpStExternalize","externalize"],["scpStNominate","nominate"]],arms:{prepare:e.lookup("ScpStatementPrepare"),confirm:e.lookup("ScpStatementConfirm"),externalize:e.lookup("ScpStatementExternalize"),nominate:e.lookup("ScpNomination")}}),e.struct("ScpStatement",[["nodeId",e.lookup("NodeId")],["slotIndex",e.lookup("Uint64")],["pledges",e.lookup("ScpStatementPledges")]]),e.struct("ScpEnvelope",[["statement",e.lookup("ScpStatement")],["signature",e.lookup("Signature")]]),e.struct("ScpQuorumSet",[["threshold",e.lookup("Uint32")],["validators",e.varArray(e.lookup("NodeId"),2147483647)],["innerSets",e.varArray(e.lookup("ScpQuorumSet"),2147483647)]]),e.typedef("Thresholds",e.opaque(4)),e.typedef("String32",e.string(32)),e.typedef("String64",e.string(64)),e.typedef("SequenceNumber",e.lookup("Int64")),e.typedef("DataValue",e.varOpaque(64)),e.typedef("PoolId",e.lookup("Hash")),e.typedef("AssetCode4",e.opaque(4)),e.typedef("AssetCode12",e.opaque(12)),e.enum("AssetType",{assetTypeNative:0,assetTypeCreditAlphanum4:1,assetTypeCreditAlphanum12:2,assetTypePoolShare:3}),e.union("AssetCode",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeCreditAlphanum4","assetCode4"],["assetTypeCreditAlphanum12","assetCode12"]],arms:{assetCode4:e.lookup("AssetCode4"),assetCode12:e.lookup("AssetCode12")}}),e.struct("AlphaNum4",[["assetCode",e.lookup("AssetCode4")],["issuer",e.lookup("AccountId")]]),e.struct("AlphaNum12",[["assetCode",e.lookup("AssetCode12")],["issuer",e.lookup("AccountId")]]),e.union("Asset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12")}}),e.struct("Price",[["n",e.lookup("Int32")],["d",e.lookup("Int32")]]),e.struct("Liabilities",[["buying",e.lookup("Int64")],["selling",e.lookup("Int64")]]),e.enum("ThresholdIndices",{thresholdMasterWeight:0,thresholdLow:1,thresholdMed:2,thresholdHigh:3}),e.enum("LedgerEntryType",{account:0,trustline:1,offer:2,data:3,claimableBalance:4,liquidityPool:5,contractData:6,contractCode:7,configSetting:8,ttl:9}),e.struct("Signer",[["key",e.lookup("SignerKey")],["weight",e.lookup("Uint32")]]),e.enum("AccountFlags",{authRequiredFlag:1,authRevocableFlag:2,authImmutableFlag:4,authClawbackEnabledFlag:8}),e.const("MASK_ACCOUNT_FLAGS",7),e.const("MASK_ACCOUNT_FLAGS_V17",15),e.const("MAX_SIGNERS",20),e.typedef("SponsorshipDescriptor",e.option(e.lookup("AccountId"))),e.struct("AccountEntryExtensionV3",[["ext",e.lookup("ExtensionPoint")],["seqLedger",e.lookup("Uint32")],["seqTime",e.lookup("TimePoint")]]),e.union("AccountEntryExtensionV2Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[3,"v3"]],arms:{v3:e.lookup("AccountEntryExtensionV3")}}),e.struct("AccountEntryExtensionV2",[["numSponsored",e.lookup("Uint32")],["numSponsoring",e.lookup("Uint32")],["signerSponsoringIDs",e.varArray(e.lookup("SponsorshipDescriptor"),e.lookup("MAX_SIGNERS"))],["ext",e.lookup("AccountEntryExtensionV2Ext")]]),e.union("AccountEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[2,"v2"]],arms:{v2:e.lookup("AccountEntryExtensionV2")}}),e.struct("AccountEntryExtensionV1",[["liabilities",e.lookup("Liabilities")],["ext",e.lookup("AccountEntryExtensionV1Ext")]]),e.union("AccountEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("AccountEntryExtensionV1")}}),e.struct("AccountEntry",[["accountId",e.lookup("AccountId")],["balance",e.lookup("Int64")],["seqNum",e.lookup("SequenceNumber")],["numSubEntries",e.lookup("Uint32")],["inflationDest",e.option(e.lookup("AccountId"))],["flags",e.lookup("Uint32")],["homeDomain",e.lookup("String32")],["thresholds",e.lookup("Thresholds")],["signers",e.varArray(e.lookup("Signer"),e.lookup("MAX_SIGNERS"))],["ext",e.lookup("AccountEntryExt")]]),e.enum("TrustLineFlags",{authorizedFlag:1,authorizedToMaintainLiabilitiesFlag:2,trustlineClawbackEnabledFlag:4}),e.const("MASK_TRUSTLINE_FLAGS",1),e.const("MASK_TRUSTLINE_FLAGS_V13",3),e.const("MASK_TRUSTLINE_FLAGS_V17",7),e.enum("LiquidityPoolType",{liquidityPoolConstantProduct:0}),e.union("TrustLineAsset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"],["assetTypePoolShare","liquidityPoolId"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12"),liquidityPoolId:e.lookup("PoolId")}}),e.union("TrustLineEntryExtensionV2Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TrustLineEntryExtensionV2",[["liquidityPoolUseCount",e.lookup("Int32")],["ext",e.lookup("TrustLineEntryExtensionV2Ext")]]),e.union("TrustLineEntryV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[2,"v2"]],arms:{v2:e.lookup("TrustLineEntryExtensionV2")}}),e.struct("TrustLineEntryV1",[["liabilities",e.lookup("Liabilities")],["ext",e.lookup("TrustLineEntryV1Ext")]]),e.union("TrustLineEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("TrustLineEntryV1")}}),e.struct("TrustLineEntry",[["accountId",e.lookup("AccountId")],["asset",e.lookup("TrustLineAsset")],["balance",e.lookup("Int64")],["limit",e.lookup("Int64")],["flags",e.lookup("Uint32")],["ext",e.lookup("TrustLineEntryExt")]]),e.enum("OfferEntryFlags",{passiveFlag:1}),e.const("MASK_OFFERENTRY_FLAGS",1),e.union("OfferEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("OfferEntry",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")],["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")],["flags",e.lookup("Uint32")],["ext",e.lookup("OfferEntryExt")]]),e.union("DataEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("DataEntry",[["accountId",e.lookup("AccountId")],["dataName",e.lookup("String64")],["dataValue",e.lookup("DataValue")],["ext",e.lookup("DataEntryExt")]]),e.enum("ClaimPredicateType",{claimPredicateUnconditional:0,claimPredicateAnd:1,claimPredicateOr:2,claimPredicateNot:3,claimPredicateBeforeAbsoluteTime:4,claimPredicateBeforeRelativeTime:5}),e.union("ClaimPredicate",{switchOn:e.lookup("ClaimPredicateType"),switchName:"type",switches:[["claimPredicateUnconditional",e.void()],["claimPredicateAnd","andPredicates"],["claimPredicateOr","orPredicates"],["claimPredicateNot","notPredicate"],["claimPredicateBeforeAbsoluteTime","absBefore"],["claimPredicateBeforeRelativeTime","relBefore"]],arms:{andPredicates:e.varArray(e.lookup("ClaimPredicate"),2),orPredicates:e.varArray(e.lookup("ClaimPredicate"),2),notPredicate:e.option(e.lookup("ClaimPredicate")),absBefore:e.lookup("Int64"),relBefore:e.lookup("Int64")}}),e.enum("ClaimantType",{claimantTypeV0:0}),e.struct("ClaimantV0",[["destination",e.lookup("AccountId")],["predicate",e.lookup("ClaimPredicate")]]),e.union("Claimant",{switchOn:e.lookup("ClaimantType"),switchName:"type",switches:[["claimantTypeV0","v0"]],arms:{v0:e.lookup("ClaimantV0")}}),e.enum("ClaimableBalanceIdType",{claimableBalanceIdTypeV0:0}),e.union("ClaimableBalanceId",{switchOn:e.lookup("ClaimableBalanceIdType"),switchName:"type",switches:[["claimableBalanceIdTypeV0","v0"]],arms:{v0:e.lookup("Hash")}}),e.enum("ClaimableBalanceFlags",{claimableBalanceClawbackEnabledFlag:1}),e.const("MASK_CLAIMABLE_BALANCE_FLAGS",1),e.union("ClaimableBalanceEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("ClaimableBalanceEntryExtensionV1",[["ext",e.lookup("ClaimableBalanceEntryExtensionV1Ext")],["flags",e.lookup("Uint32")]]),e.union("ClaimableBalanceEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("ClaimableBalanceEntryExtensionV1")}}),e.struct("ClaimableBalanceEntry",[["balanceId",e.lookup("ClaimableBalanceId")],["claimants",e.varArray(e.lookup("Claimant"),10)],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")],["ext",e.lookup("ClaimableBalanceEntryExt")]]),e.struct("LiquidityPoolConstantProductParameters",[["assetA",e.lookup("Asset")],["assetB",e.lookup("Asset")],["fee",e.lookup("Int32")]]),e.struct("LiquidityPoolEntryConstantProduct",[["params",e.lookup("LiquidityPoolConstantProductParameters")],["reserveA",e.lookup("Int64")],["reserveB",e.lookup("Int64")],["totalPoolShares",e.lookup("Int64")],["poolSharesTrustLineCount",e.lookup("Int64")]]),e.union("LiquidityPoolEntryBody",{switchOn:e.lookup("LiquidityPoolType"),switchName:"type",switches:[["liquidityPoolConstantProduct","constantProduct"]],arms:{constantProduct:e.lookup("LiquidityPoolEntryConstantProduct")}}),e.struct("LiquidityPoolEntry",[["liquidityPoolId",e.lookup("PoolId")],["body",e.lookup("LiquidityPoolEntryBody")]]),e.enum("ContractDataDurability",{temporary:0,persistent:1}),e.struct("ContractDataEntry",[["ext",e.lookup("ExtensionPoint")],["contract",e.lookup("ScAddress")],["key",e.lookup("ScVal")],["durability",e.lookup("ContractDataDurability")],["val",e.lookup("ScVal")]]),e.struct("ContractCodeEntry",[["ext",e.lookup("ExtensionPoint")],["hash",e.lookup("Hash")],["code",e.varOpaque()]]),e.struct("TtlEntry",[["keyHash",e.lookup("Hash")],["liveUntilLedgerSeq",e.lookup("Uint32")]]),e.union("LedgerEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerEntryExtensionV1",[["sponsoringId",e.lookup("SponsorshipDescriptor")],["ext",e.lookup("LedgerEntryExtensionV1Ext")]]),e.union("LedgerEntryData",{switchOn:e.lookup("LedgerEntryType"),switchName:"type",switches:[["account","account"],["trustline","trustLine"],["offer","offer"],["data","data"],["claimableBalance","claimableBalance"],["liquidityPool","liquidityPool"],["contractData","contractData"],["contractCode","contractCode"],["configSetting","configSetting"],["ttl","ttl"]],arms:{account:e.lookup("AccountEntry"),trustLine:e.lookup("TrustLineEntry"),offer:e.lookup("OfferEntry"),data:e.lookup("DataEntry"),claimableBalance:e.lookup("ClaimableBalanceEntry"),liquidityPool:e.lookup("LiquidityPoolEntry"),contractData:e.lookup("ContractDataEntry"),contractCode:e.lookup("ContractCodeEntry"),configSetting:e.lookup("ConfigSettingEntry"),ttl:e.lookup("TtlEntry")}}),e.union("LedgerEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("LedgerEntryExtensionV1")}}),e.struct("LedgerEntry",[["lastModifiedLedgerSeq",e.lookup("Uint32")],["data",e.lookup("LedgerEntryData")],["ext",e.lookup("LedgerEntryExt")]]),e.struct("LedgerKeyAccount",[["accountId",e.lookup("AccountId")]]),e.struct("LedgerKeyTrustLine",[["accountId",e.lookup("AccountId")],["asset",e.lookup("TrustLineAsset")]]),e.struct("LedgerKeyOffer",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")]]),e.struct("LedgerKeyData",[["accountId",e.lookup("AccountId")],["dataName",e.lookup("String64")]]),e.struct("LedgerKeyClaimableBalance",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("LedgerKeyLiquidityPool",[["liquidityPoolId",e.lookup("PoolId")]]),e.struct("LedgerKeyContractData",[["contract",e.lookup("ScAddress")],["key",e.lookup("ScVal")],["durability",e.lookup("ContractDataDurability")]]),e.struct("LedgerKeyContractCode",[["hash",e.lookup("Hash")]]),e.struct("LedgerKeyConfigSetting",[["configSettingId",e.lookup("ConfigSettingId")]]),e.struct("LedgerKeyTtl",[["keyHash",e.lookup("Hash")]]),e.union("LedgerKey",{switchOn:e.lookup("LedgerEntryType"),switchName:"type",switches:[["account","account"],["trustline","trustLine"],["offer","offer"],["data","data"],["claimableBalance","claimableBalance"],["liquidityPool","liquidityPool"],["contractData","contractData"],["contractCode","contractCode"],["configSetting","configSetting"],["ttl","ttl"]],arms:{account:e.lookup("LedgerKeyAccount"),trustLine:e.lookup("LedgerKeyTrustLine"),offer:e.lookup("LedgerKeyOffer"),data:e.lookup("LedgerKeyData"),claimableBalance:e.lookup("LedgerKeyClaimableBalance"),liquidityPool:e.lookup("LedgerKeyLiquidityPool"),contractData:e.lookup("LedgerKeyContractData"),contractCode:e.lookup("LedgerKeyContractCode"),configSetting:e.lookup("LedgerKeyConfigSetting"),ttl:e.lookup("LedgerKeyTtl")}}),e.enum("EnvelopeType",{envelopeTypeTxV0:0,envelopeTypeScp:1,envelopeTypeTx:2,envelopeTypeAuth:3,envelopeTypeScpvalue:4,envelopeTypeTxFeeBump:5,envelopeTypeOpId:6,envelopeTypePoolRevokeOpId:7,envelopeTypeContractId:8,envelopeTypeSorobanAuthorization:9}),e.typedef("UpgradeType",e.varOpaque(128)),e.enum("StellarValueType",{stellarValueBasic:0,stellarValueSigned:1}),e.struct("LedgerCloseValueSignature",[["nodeId",e.lookup("NodeId")],["signature",e.lookup("Signature")]]),e.union("StellarValueExt",{switchOn:e.lookup("StellarValueType"),switchName:"v",switches:[["stellarValueBasic",e.void()],["stellarValueSigned","lcValueSignature"]],arms:{lcValueSignature:e.lookup("LedgerCloseValueSignature")}}),e.struct("StellarValue",[["txSetHash",e.lookup("Hash")],["closeTime",e.lookup("TimePoint")],["upgrades",e.varArray(e.lookup("UpgradeType"),6)],["ext",e.lookup("StellarValueExt")]]),e.const("MASK_LEDGER_HEADER_FLAGS",7),e.enum("LedgerHeaderFlags",{disableLiquidityPoolTradingFlag:1,disableLiquidityPoolDepositFlag:2,disableLiquidityPoolWithdrawalFlag:4}),e.union("LedgerHeaderExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerHeaderExtensionV1",[["flags",e.lookup("Uint32")],["ext",e.lookup("LedgerHeaderExtensionV1Ext")]]),e.union("LedgerHeaderExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("LedgerHeaderExtensionV1")}}),e.struct("LedgerHeader",[["ledgerVersion",e.lookup("Uint32")],["previousLedgerHash",e.lookup("Hash")],["scpValue",e.lookup("StellarValue")],["txSetResultHash",e.lookup("Hash")],["bucketListHash",e.lookup("Hash")],["ledgerSeq",e.lookup("Uint32")],["totalCoins",e.lookup("Int64")],["feePool",e.lookup("Int64")],["inflationSeq",e.lookup("Uint32")],["idPool",e.lookup("Uint64")],["baseFee",e.lookup("Uint32")],["baseReserve",e.lookup("Uint32")],["maxTxSetSize",e.lookup("Uint32")],["skipList",e.array(e.lookup("Hash"),4)],["ext",e.lookup("LedgerHeaderExt")]]),e.enum("LedgerUpgradeType",{ledgerUpgradeVersion:1,ledgerUpgradeBaseFee:2,ledgerUpgradeMaxTxSetSize:3,ledgerUpgradeBaseReserve:4,ledgerUpgradeFlags:5,ledgerUpgradeConfig:6,ledgerUpgradeMaxSorobanTxSetSize:7}),e.struct("ConfigUpgradeSetKey",[["contractId",e.lookup("Hash")],["contentHash",e.lookup("Hash")]]),e.union("LedgerUpgrade",{switchOn:e.lookup("LedgerUpgradeType"),switchName:"type",switches:[["ledgerUpgradeVersion","newLedgerVersion"],["ledgerUpgradeBaseFee","newBaseFee"],["ledgerUpgradeMaxTxSetSize","newMaxTxSetSize"],["ledgerUpgradeBaseReserve","newBaseReserve"],["ledgerUpgradeFlags","newFlags"],["ledgerUpgradeConfig","newConfig"],["ledgerUpgradeMaxSorobanTxSetSize","newMaxSorobanTxSetSize"]],arms:{newLedgerVersion:e.lookup("Uint32"),newBaseFee:e.lookup("Uint32"),newMaxTxSetSize:e.lookup("Uint32"),newBaseReserve:e.lookup("Uint32"),newFlags:e.lookup("Uint32"),newConfig:e.lookup("ConfigUpgradeSetKey"),newMaxSorobanTxSetSize:e.lookup("Uint32")}}),e.struct("ConfigUpgradeSet",[["updatedEntry",e.varArray(e.lookup("ConfigSettingEntry"),2147483647)]]),e.enum("BucketEntryType",{metaentry:-1,liveentry:0,deadentry:1,initentry:2}),e.union("BucketMetadataExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("BucketMetadata",[["ledgerVersion",e.lookup("Uint32")],["ext",e.lookup("BucketMetadataExt")]]),e.union("BucketEntry",{switchOn:e.lookup("BucketEntryType"),switchName:"type",switches:[["liveentry","liveEntry"],["initentry","liveEntry"],["deadentry","deadEntry"],["metaentry","metaEntry"]],arms:{liveEntry:e.lookup("LedgerEntry"),deadEntry:e.lookup("LedgerKey"),metaEntry:e.lookup("BucketMetadata")}}),e.enum("TxSetComponentType",{txsetCompTxsMaybeDiscountedFee:0}),e.struct("TxSetComponentTxsMaybeDiscountedFee",[["baseFee",e.option(e.lookup("Int64"))],["txes",e.varArray(e.lookup("TransactionEnvelope"),2147483647)]]),e.union("TxSetComponent",{switchOn:e.lookup("TxSetComponentType"),switchName:"type",switches:[["txsetCompTxsMaybeDiscountedFee","txsMaybeDiscountedFee"]],arms:{txsMaybeDiscountedFee:e.lookup("TxSetComponentTxsMaybeDiscountedFee")}}),e.union("TransactionPhase",{switchOn:e.int(),switchName:"v",switches:[[0,"v0Components"]],arms:{v0Components:e.varArray(e.lookup("TxSetComponent"),2147483647)}}),e.struct("TransactionSet",[["previousLedgerHash",e.lookup("Hash")],["txes",e.varArray(e.lookup("TransactionEnvelope"),2147483647)]]),e.struct("TransactionSetV1",[["previousLedgerHash",e.lookup("Hash")],["phases",e.varArray(e.lookup("TransactionPhase"),2147483647)]]),e.union("GeneralizedTransactionSet",{switchOn:e.int(),switchName:"v",switches:[[1,"v1TxSet"]],arms:{v1TxSet:e.lookup("TransactionSetV1")}}),e.struct("TransactionResultPair",[["transactionHash",e.lookup("Hash")],["result",e.lookup("TransactionResult")]]),e.struct("TransactionResultSet",[["results",e.varArray(e.lookup("TransactionResultPair"),2147483647)]]),e.union("TransactionHistoryEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"generalizedTxSet"]],arms:{generalizedTxSet:e.lookup("GeneralizedTransactionSet")}}),e.struct("TransactionHistoryEntry",[["ledgerSeq",e.lookup("Uint32")],["txSet",e.lookup("TransactionSet")],["ext",e.lookup("TransactionHistoryEntryExt")]]),e.union("TransactionHistoryResultEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionHistoryResultEntry",[["ledgerSeq",e.lookup("Uint32")],["txResultSet",e.lookup("TransactionResultSet")],["ext",e.lookup("TransactionHistoryResultEntryExt")]]),e.union("LedgerHeaderHistoryEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerHeaderHistoryEntry",[["hash",e.lookup("Hash")],["header",e.lookup("LedgerHeader")],["ext",e.lookup("LedgerHeaderHistoryEntryExt")]]),e.struct("LedgerScpMessages",[["ledgerSeq",e.lookup("Uint32")],["messages",e.varArray(e.lookup("ScpEnvelope"),2147483647)]]),e.struct("ScpHistoryEntryV0",[["quorumSets",e.varArray(e.lookup("ScpQuorumSet"),2147483647)],["ledgerMessages",e.lookup("LedgerScpMessages")]]),e.union("ScpHistoryEntry",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("ScpHistoryEntryV0")}}),e.enum("LedgerEntryChangeType",{ledgerEntryCreated:0,ledgerEntryUpdated:1,ledgerEntryRemoved:2,ledgerEntryState:3}),e.union("LedgerEntryChange",{switchOn:e.lookup("LedgerEntryChangeType"),switchName:"type",switches:[["ledgerEntryCreated","created"],["ledgerEntryUpdated","updated"],["ledgerEntryRemoved","removed"],["ledgerEntryState","state"]],arms:{created:e.lookup("LedgerEntry"),updated:e.lookup("LedgerEntry"),removed:e.lookup("LedgerKey"),state:e.lookup("LedgerEntry")}}),e.typedef("LedgerEntryChanges",e.varArray(e.lookup("LedgerEntryChange"),2147483647)),e.struct("OperationMeta",[["changes",e.lookup("LedgerEntryChanges")]]),e.struct("TransactionMetaV1",[["txChanges",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)]]),e.struct("TransactionMetaV2",[["txChangesBefore",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)],["txChangesAfter",e.lookup("LedgerEntryChanges")]]),e.enum("ContractEventType",{system:0,contract:1,diagnostic:2}),e.struct("ContractEventV0",[["topics",e.varArray(e.lookup("ScVal"),2147483647)],["data",e.lookup("ScVal")]]),e.union("ContractEventBody",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("ContractEventV0")}}),e.struct("ContractEvent",[["ext",e.lookup("ExtensionPoint")],["contractId",e.option(e.lookup("Hash"))],["type",e.lookup("ContractEventType")],["body",e.lookup("ContractEventBody")]]),e.struct("DiagnosticEvent",[["inSuccessfulContractCall",e.bool()],["event",e.lookup("ContractEvent")]]),e.struct("SorobanTransactionMeta",[["ext",e.lookup("ExtensionPoint")],["events",e.varArray(e.lookup("ContractEvent"),2147483647)],["returnValue",e.lookup("ScVal")],["diagnosticEvents",e.varArray(e.lookup("DiagnosticEvent"),2147483647)]]),e.struct("TransactionMetaV3",[["ext",e.lookup("ExtensionPoint")],["txChangesBefore",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)],["txChangesAfter",e.lookup("LedgerEntryChanges")],["sorobanMeta",e.option(e.lookup("SorobanTransactionMeta"))]]),e.struct("InvokeHostFunctionSuccessPreImage",[["returnValue",e.lookup("ScVal")],["events",e.varArray(e.lookup("ContractEvent"),2147483647)]]),e.union("TransactionMeta",{switchOn:e.int(),switchName:"v",switches:[[0,"operations"],[1,"v1"],[2,"v2"],[3,"v3"]],arms:{operations:e.varArray(e.lookup("OperationMeta"),2147483647),v1:e.lookup("TransactionMetaV1"),v2:e.lookup("TransactionMetaV2"),v3:e.lookup("TransactionMetaV3")}}),e.struct("TransactionResultMeta",[["result",e.lookup("TransactionResultPair")],["feeProcessing",e.lookup("LedgerEntryChanges")],["txApplyProcessing",e.lookup("TransactionMeta")]]),e.struct("UpgradeEntryMeta",[["upgrade",e.lookup("LedgerUpgrade")],["changes",e.lookup("LedgerEntryChanges")]]),e.struct("LedgerCloseMetaV0",[["ledgerHeader",e.lookup("LedgerHeaderHistoryEntry")],["txSet",e.lookup("TransactionSet")],["txProcessing",e.varArray(e.lookup("TransactionResultMeta"),2147483647)],["upgradesProcessing",e.varArray(e.lookup("UpgradeEntryMeta"),2147483647)],["scpInfo",e.varArray(e.lookup("ScpHistoryEntry"),2147483647)]]),e.struct("LedgerCloseMetaV1",[["ext",e.lookup("ExtensionPoint")],["ledgerHeader",e.lookup("LedgerHeaderHistoryEntry")],["txSet",e.lookup("GeneralizedTransactionSet")],["txProcessing",e.varArray(e.lookup("TransactionResultMeta"),2147483647)],["upgradesProcessing",e.varArray(e.lookup("UpgradeEntryMeta"),2147483647)],["scpInfo",e.varArray(e.lookup("ScpHistoryEntry"),2147483647)],["totalByteSizeOfBucketList",e.lookup("Uint64")],["evictedTemporaryLedgerKeys",e.varArray(e.lookup("LedgerKey"),2147483647)],["evictedPersistentLedgerEntries",e.varArray(e.lookup("LedgerEntry"),2147483647)]]),e.union("LedgerCloseMeta",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"],[1,"v1"]],arms:{v0:e.lookup("LedgerCloseMetaV0"),v1:e.lookup("LedgerCloseMetaV1")}}),e.enum("ErrorCode",{errMisc:0,errData:1,errConf:2,errAuth:3,errLoad:4}),e.struct("Error",[["code",e.lookup("ErrorCode")],["msg",e.string(100)]]),e.struct("SendMore",[["numMessages",e.lookup("Uint32")]]),e.struct("SendMoreExtended",[["numMessages",e.lookup("Uint32")],["numBytes",e.lookup("Uint32")]]),e.struct("AuthCert",[["pubkey",e.lookup("Curve25519Public")],["expiration",e.lookup("Uint64")],["sig",e.lookup("Signature")]]),e.struct("Hello",[["ledgerVersion",e.lookup("Uint32")],["overlayVersion",e.lookup("Uint32")],["overlayMinVersion",e.lookup("Uint32")],["networkId",e.lookup("Hash")],["versionStr",e.string(100)],["listeningPort",e.int()],["peerId",e.lookup("NodeId")],["cert",e.lookup("AuthCert")],["nonce",e.lookup("Uint256")]]),e.const("AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED",200),e.struct("Auth",[["flags",e.int()]]),e.enum("IpAddrType",{iPv4:0,iPv6:1}),e.union("PeerAddressIp",{switchOn:e.lookup("IpAddrType"),switchName:"type",switches:[["iPv4","ipv4"],["iPv6","ipv6"]],arms:{ipv4:e.opaque(4),ipv6:e.opaque(16)}}),e.struct("PeerAddress",[["ip",e.lookup("PeerAddressIp")],["port",e.lookup("Uint32")],["numFailures",e.lookup("Uint32")]]),e.enum("MessageType",{errorMsg:0,auth:2,dontHave:3,getPeers:4,peers:5,getTxSet:6,txSet:7,generalizedTxSet:17,transaction:8,getScpQuorumset:9,scpQuorumset:10,scpMessage:11,getScpState:12,hello:13,surveyRequest:14,surveyResponse:15,sendMore:16,sendMoreExtended:20,floodAdvert:18,floodDemand:19}),e.struct("DontHave",[["type",e.lookup("MessageType")],["reqHash",e.lookup("Uint256")]]),e.enum("SurveyMessageCommandType",{surveyTopology:0}),e.enum("SurveyMessageResponseType",{surveyTopologyResponseV0:0,surveyTopologyResponseV1:1}),e.struct("SurveyRequestMessage",[["surveyorPeerId",e.lookup("NodeId")],["surveyedPeerId",e.lookup("NodeId")],["ledgerNum",e.lookup("Uint32")],["encryptionKey",e.lookup("Curve25519Public")],["commandType",e.lookup("SurveyMessageCommandType")]]),e.struct("SignedSurveyRequestMessage",[["requestSignature",e.lookup("Signature")],["request",e.lookup("SurveyRequestMessage")]]),e.typedef("EncryptedBody",e.varOpaque(64e3)),e.struct("SurveyResponseMessage",[["surveyorPeerId",e.lookup("NodeId")],["surveyedPeerId",e.lookup("NodeId")],["ledgerNum",e.lookup("Uint32")],["commandType",e.lookup("SurveyMessageCommandType")],["encryptedBody",e.lookup("EncryptedBody")]]),e.struct("SignedSurveyResponseMessage",[["responseSignature",e.lookup("Signature")],["response",e.lookup("SurveyResponseMessage")]]),e.struct("PeerStats",[["id",e.lookup("NodeId")],["versionStr",e.string(100)],["messagesRead",e.lookup("Uint64")],["messagesWritten",e.lookup("Uint64")],["bytesRead",e.lookup("Uint64")],["bytesWritten",e.lookup("Uint64")],["secondsConnected",e.lookup("Uint64")],["uniqueFloodBytesRecv",e.lookup("Uint64")],["duplicateFloodBytesRecv",e.lookup("Uint64")],["uniqueFetchBytesRecv",e.lookup("Uint64")],["duplicateFetchBytesRecv",e.lookup("Uint64")],["uniqueFloodMessageRecv",e.lookup("Uint64")],["duplicateFloodMessageRecv",e.lookup("Uint64")],["uniqueFetchMessageRecv",e.lookup("Uint64")],["duplicateFetchMessageRecv",e.lookup("Uint64")]]),e.typedef("PeerStatList",e.varArray(e.lookup("PeerStats"),25)),e.struct("TopologyResponseBodyV0",[["inboundPeers",e.lookup("PeerStatList")],["outboundPeers",e.lookup("PeerStatList")],["totalInboundPeerCount",e.lookup("Uint32")],["totalOutboundPeerCount",e.lookup("Uint32")]]),e.struct("TopologyResponseBodyV1",[["inboundPeers",e.lookup("PeerStatList")],["outboundPeers",e.lookup("PeerStatList")],["totalInboundPeerCount",e.lookup("Uint32")],["totalOutboundPeerCount",e.lookup("Uint32")],["maxInboundPeerCount",e.lookup("Uint32")],["maxOutboundPeerCount",e.lookup("Uint32")]]),e.union("SurveyResponseBody",{switchOn:e.lookup("SurveyMessageResponseType"),switchName:"type",switches:[["surveyTopologyResponseV0","topologyResponseBodyV0"],["surveyTopologyResponseV1","topologyResponseBodyV1"]],arms:{topologyResponseBodyV0:e.lookup("TopologyResponseBodyV0"),topologyResponseBodyV1:e.lookup("TopologyResponseBodyV1")}}),e.const("TX_ADVERT_VECTOR_MAX_SIZE",1e3),e.typedef("TxAdvertVector",e.varArray(e.lookup("Hash"),e.lookup("TX_ADVERT_VECTOR_MAX_SIZE"))),e.struct("FloodAdvert",[["txHashes",e.lookup("TxAdvertVector")]]),e.const("TX_DEMAND_VECTOR_MAX_SIZE",1e3),e.typedef("TxDemandVector",e.varArray(e.lookup("Hash"),e.lookup("TX_DEMAND_VECTOR_MAX_SIZE"))),e.struct("FloodDemand",[["txHashes",e.lookup("TxDemandVector")]]),e.union("StellarMessage",{switchOn:e.lookup("MessageType"),switchName:"type",switches:[["errorMsg","error"],["hello","hello"],["auth","auth"],["dontHave","dontHave"],["getPeers",e.void()],["peers","peers"],["getTxSet","txSetHash"],["txSet","txSet"],["generalizedTxSet","generalizedTxSet"],["transaction","transaction"],["surveyRequest","signedSurveyRequestMessage"],["surveyResponse","signedSurveyResponseMessage"],["getScpQuorumset","qSetHash"],["scpQuorumset","qSet"],["scpMessage","envelope"],["getScpState","getScpLedgerSeq"],["sendMore","sendMoreMessage"],["sendMoreExtended","sendMoreExtendedMessage"],["floodAdvert","floodAdvert"],["floodDemand","floodDemand"]],arms:{error:e.lookup("Error"),hello:e.lookup("Hello"),auth:e.lookup("Auth"),dontHave:e.lookup("DontHave"),peers:e.varArray(e.lookup("PeerAddress"),100),txSetHash:e.lookup("Uint256"),txSet:e.lookup("TransactionSet"),generalizedTxSet:e.lookup("GeneralizedTransactionSet"),transaction:e.lookup("TransactionEnvelope"),signedSurveyRequestMessage:e.lookup("SignedSurveyRequestMessage"),signedSurveyResponseMessage:e.lookup("SignedSurveyResponseMessage"),qSetHash:e.lookup("Uint256"),qSet:e.lookup("ScpQuorumSet"),envelope:e.lookup("ScpEnvelope"),getScpLedgerSeq:e.lookup("Uint32"),sendMoreMessage:e.lookup("SendMore"),sendMoreExtendedMessage:e.lookup("SendMoreExtended"),floodAdvert:e.lookup("FloodAdvert"),floodDemand:e.lookup("FloodDemand")}}),e.struct("AuthenticatedMessageV0",[["sequence",e.lookup("Uint64")],["message",e.lookup("StellarMessage")],["mac",e.lookup("HmacSha256Mac")]]),e.union("AuthenticatedMessage",{switchOn:e.lookup("Uint32"),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("AuthenticatedMessageV0")}}),e.const("MAX_OPS_PER_TX",100),e.union("LiquidityPoolParameters",{switchOn:e.lookup("LiquidityPoolType"),switchName:"type",switches:[["liquidityPoolConstantProduct","constantProduct"]],arms:{constantProduct:e.lookup("LiquidityPoolConstantProductParameters")}}),e.struct("MuxedAccountMed25519",[["id",e.lookup("Uint64")],["ed25519",e.lookup("Uint256")]]),e.union("MuxedAccount",{switchOn:e.lookup("CryptoKeyType"),switchName:"type",switches:[["keyTypeEd25519","ed25519"],["keyTypeMuxedEd25519","med25519"]],arms:{ed25519:e.lookup("Uint256"),med25519:e.lookup("MuxedAccountMed25519")}}),e.struct("DecoratedSignature",[["hint",e.lookup("SignatureHint")],["signature",e.lookup("Signature")]]),e.enum("OperationType",{createAccount:0,payment:1,pathPaymentStrictReceive:2,manageSellOffer:3,createPassiveSellOffer:4,setOptions:5,changeTrust:6,allowTrust:7,accountMerge:8,inflation:9,manageData:10,bumpSequence:11,manageBuyOffer:12,pathPaymentStrictSend:13,createClaimableBalance:14,claimClaimableBalance:15,beginSponsoringFutureReserves:16,endSponsoringFutureReserves:17,revokeSponsorship:18,clawback:19,clawbackClaimableBalance:20,setTrustLineFlags:21,liquidityPoolDeposit:22,liquidityPoolWithdraw:23,invokeHostFunction:24,extendFootprintTtl:25,restoreFootprint:26}),e.struct("CreateAccountOp",[["destination",e.lookup("AccountId")],["startingBalance",e.lookup("Int64")]]),e.struct("PaymentOp",[["destination",e.lookup("MuxedAccount")],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")]]),e.struct("PathPaymentStrictReceiveOp",[["sendAsset",e.lookup("Asset")],["sendMax",e.lookup("Int64")],["destination",e.lookup("MuxedAccount")],["destAsset",e.lookup("Asset")],["destAmount",e.lookup("Int64")],["path",e.varArray(e.lookup("Asset"),5)]]),e.struct("PathPaymentStrictSendOp",[["sendAsset",e.lookup("Asset")],["sendAmount",e.lookup("Int64")],["destination",e.lookup("MuxedAccount")],["destAsset",e.lookup("Asset")],["destMin",e.lookup("Int64")],["path",e.varArray(e.lookup("Asset"),5)]]),e.struct("ManageSellOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")],["offerId",e.lookup("Int64")]]),e.struct("ManageBuyOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["buyAmount",e.lookup("Int64")],["price",e.lookup("Price")],["offerId",e.lookup("Int64")]]),e.struct("CreatePassiveSellOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")]]),e.struct("SetOptionsOp",[["inflationDest",e.option(e.lookup("AccountId"))],["clearFlags",e.option(e.lookup("Uint32"))],["setFlags",e.option(e.lookup("Uint32"))],["masterWeight",e.option(e.lookup("Uint32"))],["lowThreshold",e.option(e.lookup("Uint32"))],["medThreshold",e.option(e.lookup("Uint32"))],["highThreshold",e.option(e.lookup("Uint32"))],["homeDomain",e.option(e.lookup("String32"))],["signer",e.option(e.lookup("Signer"))]]),e.union("ChangeTrustAsset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"],["assetTypePoolShare","liquidityPool"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12"),liquidityPool:e.lookup("LiquidityPoolParameters")}}),e.struct("ChangeTrustOp",[["line",e.lookup("ChangeTrustAsset")],["limit",e.lookup("Int64")]]),e.struct("AllowTrustOp",[["trustor",e.lookup("AccountId")],["asset",e.lookup("AssetCode")],["authorize",e.lookup("Uint32")]]),e.struct("ManageDataOp",[["dataName",e.lookup("String64")],["dataValue",e.option(e.lookup("DataValue"))]]),e.struct("BumpSequenceOp",[["bumpTo",e.lookup("SequenceNumber")]]),e.struct("CreateClaimableBalanceOp",[["asset",e.lookup("Asset")],["amount",e.lookup("Int64")],["claimants",e.varArray(e.lookup("Claimant"),10)]]),e.struct("ClaimClaimableBalanceOp",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("BeginSponsoringFutureReservesOp",[["sponsoredId",e.lookup("AccountId")]]),e.enum("RevokeSponsorshipType",{revokeSponsorshipLedgerEntry:0,revokeSponsorshipSigner:1}),e.struct("RevokeSponsorshipOpSigner",[["accountId",e.lookup("AccountId")],["signerKey",e.lookup("SignerKey")]]),e.union("RevokeSponsorshipOp",{switchOn:e.lookup("RevokeSponsorshipType"),switchName:"type",switches:[["revokeSponsorshipLedgerEntry","ledgerKey"],["revokeSponsorshipSigner","signer"]],arms:{ledgerKey:e.lookup("LedgerKey"),signer:e.lookup("RevokeSponsorshipOpSigner")}}),e.struct("ClawbackOp",[["asset",e.lookup("Asset")],["from",e.lookup("MuxedAccount")],["amount",e.lookup("Int64")]]),e.struct("ClawbackClaimableBalanceOp",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("SetTrustLineFlagsOp",[["trustor",e.lookup("AccountId")],["asset",e.lookup("Asset")],["clearFlags",e.lookup("Uint32")],["setFlags",e.lookup("Uint32")]]),e.const("LIQUIDITY_POOL_FEE_V18",30),e.struct("LiquidityPoolDepositOp",[["liquidityPoolId",e.lookup("PoolId")],["maxAmountA",e.lookup("Int64")],["maxAmountB",e.lookup("Int64")],["minPrice",e.lookup("Price")],["maxPrice",e.lookup("Price")]]),e.struct("LiquidityPoolWithdrawOp",[["liquidityPoolId",e.lookup("PoolId")],["amount",e.lookup("Int64")],["minAmountA",e.lookup("Int64")],["minAmountB",e.lookup("Int64")]]),e.enum("HostFunctionType",{hostFunctionTypeInvokeContract:0,hostFunctionTypeCreateContract:1,hostFunctionTypeUploadContractWasm:2}),e.enum("ContractIdPreimageType",{contractIdPreimageFromAddress:0,contractIdPreimageFromAsset:1}),e.struct("ContractIdPreimageFromAddress",[["address",e.lookup("ScAddress")],["salt",e.lookup("Uint256")]]),e.union("ContractIdPreimage",{switchOn:e.lookup("ContractIdPreimageType"),switchName:"type",switches:[["contractIdPreimageFromAddress","fromAddress"],["contractIdPreimageFromAsset","fromAsset"]],arms:{fromAddress:e.lookup("ContractIdPreimageFromAddress"),fromAsset:e.lookup("Asset")}}),e.struct("CreateContractArgs",[["contractIdPreimage",e.lookup("ContractIdPreimage")],["executable",e.lookup("ContractExecutable")]]),e.struct("InvokeContractArgs",[["contractAddress",e.lookup("ScAddress")],["functionName",e.lookup("ScSymbol")],["args",e.varArray(e.lookup("ScVal"),2147483647)]]),e.union("HostFunction",{switchOn:e.lookup("HostFunctionType"),switchName:"type",switches:[["hostFunctionTypeInvokeContract","invokeContract"],["hostFunctionTypeCreateContract","createContract"],["hostFunctionTypeUploadContractWasm","wasm"]],arms:{invokeContract:e.lookup("InvokeContractArgs"),createContract:e.lookup("CreateContractArgs"),wasm:e.varOpaque()}}),e.enum("SorobanAuthorizedFunctionType",{sorobanAuthorizedFunctionTypeContractFn:0,sorobanAuthorizedFunctionTypeCreateContractHostFn:1}),e.union("SorobanAuthorizedFunction",{switchOn:e.lookup("SorobanAuthorizedFunctionType"),switchName:"type",switches:[["sorobanAuthorizedFunctionTypeContractFn","contractFn"],["sorobanAuthorizedFunctionTypeCreateContractHostFn","createContractHostFn"]],arms:{contractFn:e.lookup("InvokeContractArgs"),createContractHostFn:e.lookup("CreateContractArgs")}}),e.struct("SorobanAuthorizedInvocation",[["function",e.lookup("SorobanAuthorizedFunction")],["subInvocations",e.varArray(e.lookup("SorobanAuthorizedInvocation"),2147483647)]]),e.struct("SorobanAddressCredentials",[["address",e.lookup("ScAddress")],["nonce",e.lookup("Int64")],["signatureExpirationLedger",e.lookup("Uint32")],["signature",e.lookup("ScVal")]]),e.enum("SorobanCredentialsType",{sorobanCredentialsSourceAccount:0,sorobanCredentialsAddress:1}),e.union("SorobanCredentials",{switchOn:e.lookup("SorobanCredentialsType"),switchName:"type",switches:[["sorobanCredentialsSourceAccount",e.void()],["sorobanCredentialsAddress","address"]],arms:{address:e.lookup("SorobanAddressCredentials")}}),e.struct("SorobanAuthorizationEntry",[["credentials",e.lookup("SorobanCredentials")],["rootInvocation",e.lookup("SorobanAuthorizedInvocation")]]),e.struct("InvokeHostFunctionOp",[["hostFunction",e.lookup("HostFunction")],["auth",e.varArray(e.lookup("SorobanAuthorizationEntry"),2147483647)]]),e.struct("ExtendFootprintTtlOp",[["ext",e.lookup("ExtensionPoint")],["extendTo",e.lookup("Uint32")]]),e.struct("RestoreFootprintOp",[["ext",e.lookup("ExtensionPoint")]]),e.union("OperationBody",{switchOn:e.lookup("OperationType"),switchName:"type",switches:[["createAccount","createAccountOp"],["payment","paymentOp"],["pathPaymentStrictReceive","pathPaymentStrictReceiveOp"],["manageSellOffer","manageSellOfferOp"],["createPassiveSellOffer","createPassiveSellOfferOp"],["setOptions","setOptionsOp"],["changeTrust","changeTrustOp"],["allowTrust","allowTrustOp"],["accountMerge","destination"],["inflation",e.void()],["manageData","manageDataOp"],["bumpSequence","bumpSequenceOp"],["manageBuyOffer","manageBuyOfferOp"],["pathPaymentStrictSend","pathPaymentStrictSendOp"],["createClaimableBalance","createClaimableBalanceOp"],["claimClaimableBalance","claimClaimableBalanceOp"],["beginSponsoringFutureReserves","beginSponsoringFutureReservesOp"],["endSponsoringFutureReserves",e.void()],["revokeSponsorship","revokeSponsorshipOp"],["clawback","clawbackOp"],["clawbackClaimableBalance","clawbackClaimableBalanceOp"],["setTrustLineFlags","setTrustLineFlagsOp"],["liquidityPoolDeposit","liquidityPoolDepositOp"],["liquidityPoolWithdraw","liquidityPoolWithdrawOp"],["invokeHostFunction","invokeHostFunctionOp"],["extendFootprintTtl","extendFootprintTtlOp"],["restoreFootprint","restoreFootprintOp"]],arms:{createAccountOp:e.lookup("CreateAccountOp"),paymentOp:e.lookup("PaymentOp"),pathPaymentStrictReceiveOp:e.lookup("PathPaymentStrictReceiveOp"),manageSellOfferOp:e.lookup("ManageSellOfferOp"),createPassiveSellOfferOp:e.lookup("CreatePassiveSellOfferOp"),setOptionsOp:e.lookup("SetOptionsOp"),changeTrustOp:e.lookup("ChangeTrustOp"),allowTrustOp:e.lookup("AllowTrustOp"),destination:e.lookup("MuxedAccount"),manageDataOp:e.lookup("ManageDataOp"),bumpSequenceOp:e.lookup("BumpSequenceOp"),manageBuyOfferOp:e.lookup("ManageBuyOfferOp"),pathPaymentStrictSendOp:e.lookup("PathPaymentStrictSendOp"),createClaimableBalanceOp:e.lookup("CreateClaimableBalanceOp"),claimClaimableBalanceOp:e.lookup("ClaimClaimableBalanceOp"),beginSponsoringFutureReservesOp:e.lookup("BeginSponsoringFutureReservesOp"),revokeSponsorshipOp:e.lookup("RevokeSponsorshipOp"),clawbackOp:e.lookup("ClawbackOp"),clawbackClaimableBalanceOp:e.lookup("ClawbackClaimableBalanceOp"),setTrustLineFlagsOp:e.lookup("SetTrustLineFlagsOp"),liquidityPoolDepositOp:e.lookup("LiquidityPoolDepositOp"),liquidityPoolWithdrawOp:e.lookup("LiquidityPoolWithdrawOp"),invokeHostFunctionOp:e.lookup("InvokeHostFunctionOp"),extendFootprintTtlOp:e.lookup("ExtendFootprintTtlOp"),restoreFootprintOp:e.lookup("RestoreFootprintOp")}}),e.struct("Operation",[["sourceAccount",e.option(e.lookup("MuxedAccount"))],["body",e.lookup("OperationBody")]]),e.struct("HashIdPreimageOperationId",[["sourceAccount",e.lookup("AccountId")],["seqNum",e.lookup("SequenceNumber")],["opNum",e.lookup("Uint32")]]),e.struct("HashIdPreimageRevokeId",[["sourceAccount",e.lookup("AccountId")],["seqNum",e.lookup("SequenceNumber")],["opNum",e.lookup("Uint32")],["liquidityPoolId",e.lookup("PoolId")],["asset",e.lookup("Asset")]]),e.struct("HashIdPreimageContractId",[["networkId",e.lookup("Hash")],["contractIdPreimage",e.lookup("ContractIdPreimage")]]),e.struct("HashIdPreimageSorobanAuthorization",[["networkId",e.lookup("Hash")],["nonce",e.lookup("Int64")],["signatureExpirationLedger",e.lookup("Uint32")],["invocation",e.lookup("SorobanAuthorizedInvocation")]]),e.union("HashIdPreimage",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeOpId","operationId"],["envelopeTypePoolRevokeOpId","revokeId"],["envelopeTypeContractId","contractId"],["envelopeTypeSorobanAuthorization","sorobanAuthorization"]],arms:{operationId:e.lookup("HashIdPreimageOperationId"),revokeId:e.lookup("HashIdPreimageRevokeId"),contractId:e.lookup("HashIdPreimageContractId"),sorobanAuthorization:e.lookup("HashIdPreimageSorobanAuthorization")}}),e.enum("MemoType",{memoNone:0,memoText:1,memoId:2,memoHash:3,memoReturn:4}),e.union("Memo",{switchOn:e.lookup("MemoType"),switchName:"type",switches:[["memoNone",e.void()],["memoText","text"],["memoId","id"],["memoHash","hash"],["memoReturn","retHash"]],arms:{text:e.string(28),id:e.lookup("Uint64"),hash:e.lookup("Hash"),retHash:e.lookup("Hash")}}),e.struct("TimeBounds",[["minTime",e.lookup("TimePoint")],["maxTime",e.lookup("TimePoint")]]),e.struct("LedgerBounds",[["minLedger",e.lookup("Uint32")],["maxLedger",e.lookup("Uint32")]]),e.struct("PreconditionsV2",[["timeBounds",e.option(e.lookup("TimeBounds"))],["ledgerBounds",e.option(e.lookup("LedgerBounds"))],["minSeqNum",e.option(e.lookup("SequenceNumber"))],["minSeqAge",e.lookup("Duration")],["minSeqLedgerGap",e.lookup("Uint32")],["extraSigners",e.varArray(e.lookup("SignerKey"),2)]]),e.enum("PreconditionType",{precondNone:0,precondTime:1,precondV2:2}),e.union("Preconditions",{switchOn:e.lookup("PreconditionType"),switchName:"type",switches:[["precondNone",e.void()],["precondTime","timeBounds"],["precondV2","v2"]],arms:{timeBounds:e.lookup("TimeBounds"),v2:e.lookup("PreconditionsV2")}}),e.struct("LedgerFootprint",[["readOnly",e.varArray(e.lookup("LedgerKey"),2147483647)],["readWrite",e.varArray(e.lookup("LedgerKey"),2147483647)]]),e.struct("SorobanResources",[["footprint",e.lookup("LedgerFootprint")],["instructions",e.lookup("Uint32")],["readBytes",e.lookup("Uint32")],["writeBytes",e.lookup("Uint32")]]),e.struct("SorobanTransactionData",[["ext",e.lookup("ExtensionPoint")],["resources",e.lookup("SorobanResources")],["resourceFee",e.lookup("Int64")]]),e.union("TransactionV0Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionV0",[["sourceAccountEd25519",e.lookup("Uint256")],["fee",e.lookup("Uint32")],["seqNum",e.lookup("SequenceNumber")],["timeBounds",e.option(e.lookup("TimeBounds"))],["memo",e.lookup("Memo")],["operations",e.varArray(e.lookup("Operation"),e.lookup("MAX_OPS_PER_TX"))],["ext",e.lookup("TransactionV0Ext")]]),e.struct("TransactionV0Envelope",[["tx",e.lookup("TransactionV0")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("TransactionExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"sorobanData"]],arms:{sorobanData:e.lookup("SorobanTransactionData")}}),e.struct("Transaction",[["sourceAccount",e.lookup("MuxedAccount")],["fee",e.lookup("Uint32")],["seqNum",e.lookup("SequenceNumber")],["cond",e.lookup("Preconditions")],["memo",e.lookup("Memo")],["operations",e.varArray(e.lookup("Operation"),e.lookup("MAX_OPS_PER_TX"))],["ext",e.lookup("TransactionExt")]]),e.struct("TransactionV1Envelope",[["tx",e.lookup("Transaction")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("FeeBumpTransactionInnerTx",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTx","v1"]],arms:{v1:e.lookup("TransactionV1Envelope")}}),e.union("FeeBumpTransactionExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("FeeBumpTransaction",[["feeSource",e.lookup("MuxedAccount")],["fee",e.lookup("Int64")],["innerTx",e.lookup("FeeBumpTransactionInnerTx")],["ext",e.lookup("FeeBumpTransactionExt")]]),e.struct("FeeBumpTransactionEnvelope",[["tx",e.lookup("FeeBumpTransaction")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("TransactionEnvelope",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTxV0","v0"],["envelopeTypeTx","v1"],["envelopeTypeTxFeeBump","feeBump"]],arms:{v0:e.lookup("TransactionV0Envelope"),v1:e.lookup("TransactionV1Envelope"),feeBump:e.lookup("FeeBumpTransactionEnvelope")}}),e.union("TransactionSignaturePayloadTaggedTransaction",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTx","tx"],["envelopeTypeTxFeeBump","feeBump"]],arms:{tx:e.lookup("Transaction"),feeBump:e.lookup("FeeBumpTransaction")}}),e.struct("TransactionSignaturePayload",[["networkId",e.lookup("Hash")],["taggedTransaction",e.lookup("TransactionSignaturePayloadTaggedTransaction")]]),e.enum("ClaimAtomType",{claimAtomTypeV0:0,claimAtomTypeOrderBook:1,claimAtomTypeLiquidityPool:2}),e.struct("ClaimOfferAtomV0",[["sellerEd25519",e.lookup("Uint256")],["offerId",e.lookup("Int64")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.struct("ClaimOfferAtom",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.struct("ClaimLiquidityAtom",[["liquidityPoolId",e.lookup("PoolId")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.union("ClaimAtom",{switchOn:e.lookup("ClaimAtomType"),switchName:"type",switches:[["claimAtomTypeV0","v0"],["claimAtomTypeOrderBook","orderBook"],["claimAtomTypeLiquidityPool","liquidityPool"]],arms:{v0:e.lookup("ClaimOfferAtomV0"),orderBook:e.lookup("ClaimOfferAtom"),liquidityPool:e.lookup("ClaimLiquidityAtom")}}),e.enum("CreateAccountResultCode",{createAccountSuccess:0,createAccountMalformed:-1,createAccountUnderfunded:-2,createAccountLowReserve:-3,createAccountAlreadyExist:-4}),e.union("CreateAccountResult",{switchOn:e.lookup("CreateAccountResultCode"),switchName:"code",switches:[["createAccountSuccess",e.void()],["createAccountMalformed",e.void()],["createAccountUnderfunded",e.void()],["createAccountLowReserve",e.void()],["createAccountAlreadyExist",e.void()]],arms:{}}),e.enum("PaymentResultCode",{paymentSuccess:0,paymentMalformed:-1,paymentUnderfunded:-2,paymentSrcNoTrust:-3,paymentSrcNotAuthorized:-4,paymentNoDestination:-5,paymentNoTrust:-6,paymentNotAuthorized:-7,paymentLineFull:-8,paymentNoIssuer:-9}),e.union("PaymentResult",{switchOn:e.lookup("PaymentResultCode"),switchName:"code",switches:[["paymentSuccess",e.void()],["paymentMalformed",e.void()],["paymentUnderfunded",e.void()],["paymentSrcNoTrust",e.void()],["paymentSrcNotAuthorized",e.void()],["paymentNoDestination",e.void()],["paymentNoTrust",e.void()],["paymentNotAuthorized",e.void()],["paymentLineFull",e.void()],["paymentNoIssuer",e.void()]],arms:{}}),e.enum("PathPaymentStrictReceiveResultCode",{pathPaymentStrictReceiveSuccess:0,pathPaymentStrictReceiveMalformed:-1,pathPaymentStrictReceiveUnderfunded:-2,pathPaymentStrictReceiveSrcNoTrust:-3,pathPaymentStrictReceiveSrcNotAuthorized:-4,pathPaymentStrictReceiveNoDestination:-5,pathPaymentStrictReceiveNoTrust:-6,pathPaymentStrictReceiveNotAuthorized:-7,pathPaymentStrictReceiveLineFull:-8,pathPaymentStrictReceiveNoIssuer:-9,pathPaymentStrictReceiveTooFewOffers:-10,pathPaymentStrictReceiveOfferCrossSelf:-11,pathPaymentStrictReceiveOverSendmax:-12}),e.struct("SimplePaymentResult",[["destination",e.lookup("AccountId")],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")]]),e.struct("PathPaymentStrictReceiveResultSuccess",[["offers",e.varArray(e.lookup("ClaimAtom"),2147483647)],["last",e.lookup("SimplePaymentResult")]]),e.union("PathPaymentStrictReceiveResult",{switchOn:e.lookup("PathPaymentStrictReceiveResultCode"),switchName:"code",switches:[["pathPaymentStrictReceiveSuccess","success"],["pathPaymentStrictReceiveMalformed",e.void()],["pathPaymentStrictReceiveUnderfunded",e.void()],["pathPaymentStrictReceiveSrcNoTrust",e.void()],["pathPaymentStrictReceiveSrcNotAuthorized",e.void()],["pathPaymentStrictReceiveNoDestination",e.void()],["pathPaymentStrictReceiveNoTrust",e.void()],["pathPaymentStrictReceiveNotAuthorized",e.void()],["pathPaymentStrictReceiveLineFull",e.void()],["pathPaymentStrictReceiveNoIssuer","noIssuer"],["pathPaymentStrictReceiveTooFewOffers",e.void()],["pathPaymentStrictReceiveOfferCrossSelf",e.void()],["pathPaymentStrictReceiveOverSendmax",e.void()]],arms:{success:e.lookup("PathPaymentStrictReceiveResultSuccess"),noIssuer:e.lookup("Asset")}}),e.enum("PathPaymentStrictSendResultCode",{pathPaymentStrictSendSuccess:0,pathPaymentStrictSendMalformed:-1,pathPaymentStrictSendUnderfunded:-2,pathPaymentStrictSendSrcNoTrust:-3,pathPaymentStrictSendSrcNotAuthorized:-4,pathPaymentStrictSendNoDestination:-5,pathPaymentStrictSendNoTrust:-6,pathPaymentStrictSendNotAuthorized:-7,pathPaymentStrictSendLineFull:-8,pathPaymentStrictSendNoIssuer:-9,pathPaymentStrictSendTooFewOffers:-10,pathPaymentStrictSendOfferCrossSelf:-11,pathPaymentStrictSendUnderDestmin:-12}),e.struct("PathPaymentStrictSendResultSuccess",[["offers",e.varArray(e.lookup("ClaimAtom"),2147483647)],["last",e.lookup("SimplePaymentResult")]]),e.union("PathPaymentStrictSendResult",{switchOn:e.lookup("PathPaymentStrictSendResultCode"),switchName:"code",switches:[["pathPaymentStrictSendSuccess","success"],["pathPaymentStrictSendMalformed",e.void()],["pathPaymentStrictSendUnderfunded",e.void()],["pathPaymentStrictSendSrcNoTrust",e.void()],["pathPaymentStrictSendSrcNotAuthorized",e.void()],["pathPaymentStrictSendNoDestination",e.void()],["pathPaymentStrictSendNoTrust",e.void()],["pathPaymentStrictSendNotAuthorized",e.void()],["pathPaymentStrictSendLineFull",e.void()],["pathPaymentStrictSendNoIssuer","noIssuer"],["pathPaymentStrictSendTooFewOffers",e.void()],["pathPaymentStrictSendOfferCrossSelf",e.void()],["pathPaymentStrictSendUnderDestmin",e.void()]],arms:{success:e.lookup("PathPaymentStrictSendResultSuccess"),noIssuer:e.lookup("Asset")}}),e.enum("ManageSellOfferResultCode",{manageSellOfferSuccess:0,manageSellOfferMalformed:-1,manageSellOfferSellNoTrust:-2,manageSellOfferBuyNoTrust:-3,manageSellOfferSellNotAuthorized:-4,manageSellOfferBuyNotAuthorized:-5,manageSellOfferLineFull:-6,manageSellOfferUnderfunded:-7,manageSellOfferCrossSelf:-8,manageSellOfferSellNoIssuer:-9,manageSellOfferBuyNoIssuer:-10,manageSellOfferNotFound:-11,manageSellOfferLowReserve:-12}),e.enum("ManageOfferEffect",{manageOfferCreated:0,manageOfferUpdated:1,manageOfferDeleted:2}),e.union("ManageOfferSuccessResultOffer",{switchOn:e.lookup("ManageOfferEffect"),switchName:"effect",switches:[["manageOfferCreated","offer"],["manageOfferUpdated","offer"],["manageOfferDeleted",e.void()]],arms:{offer:e.lookup("OfferEntry")}}),e.struct("ManageOfferSuccessResult",[["offersClaimed",e.varArray(e.lookup("ClaimAtom"),2147483647)],["offer",e.lookup("ManageOfferSuccessResultOffer")]]),e.union("ManageSellOfferResult",{switchOn:e.lookup("ManageSellOfferResultCode"),switchName:"code",switches:[["manageSellOfferSuccess","success"],["manageSellOfferMalformed",e.void()],["manageSellOfferSellNoTrust",e.void()],["manageSellOfferBuyNoTrust",e.void()],["manageSellOfferSellNotAuthorized",e.void()],["manageSellOfferBuyNotAuthorized",e.void()],["manageSellOfferLineFull",e.void()],["manageSellOfferUnderfunded",e.void()],["manageSellOfferCrossSelf",e.void()],["manageSellOfferSellNoIssuer",e.void()],["manageSellOfferBuyNoIssuer",e.void()],["manageSellOfferNotFound",e.void()],["manageSellOfferLowReserve",e.void()]],arms:{success:e.lookup("ManageOfferSuccessResult")}}),e.enum("ManageBuyOfferResultCode",{manageBuyOfferSuccess:0,manageBuyOfferMalformed:-1,manageBuyOfferSellNoTrust:-2,manageBuyOfferBuyNoTrust:-3,manageBuyOfferSellNotAuthorized:-4,manageBuyOfferBuyNotAuthorized:-5,manageBuyOfferLineFull:-6,manageBuyOfferUnderfunded:-7,manageBuyOfferCrossSelf:-8,manageBuyOfferSellNoIssuer:-9,manageBuyOfferBuyNoIssuer:-10,manageBuyOfferNotFound:-11,manageBuyOfferLowReserve:-12}),e.union("ManageBuyOfferResult",{switchOn:e.lookup("ManageBuyOfferResultCode"),switchName:"code",switches:[["manageBuyOfferSuccess","success"],["manageBuyOfferMalformed",e.void()],["manageBuyOfferSellNoTrust",e.void()],["manageBuyOfferBuyNoTrust",e.void()],["manageBuyOfferSellNotAuthorized",e.void()],["manageBuyOfferBuyNotAuthorized",e.void()],["manageBuyOfferLineFull",e.void()],["manageBuyOfferUnderfunded",e.void()],["manageBuyOfferCrossSelf",e.void()],["manageBuyOfferSellNoIssuer",e.void()],["manageBuyOfferBuyNoIssuer",e.void()],["manageBuyOfferNotFound",e.void()],["manageBuyOfferLowReserve",e.void()]],arms:{success:e.lookup("ManageOfferSuccessResult")}}),e.enum("SetOptionsResultCode",{setOptionsSuccess:0,setOptionsLowReserve:-1,setOptionsTooManySigners:-2,setOptionsBadFlags:-3,setOptionsInvalidInflation:-4,setOptionsCantChange:-5,setOptionsUnknownFlag:-6,setOptionsThresholdOutOfRange:-7,setOptionsBadSigner:-8,setOptionsInvalidHomeDomain:-9,setOptionsAuthRevocableRequired:-10}),e.union("SetOptionsResult",{switchOn:e.lookup("SetOptionsResultCode"),switchName:"code",switches:[["setOptionsSuccess",e.void()],["setOptionsLowReserve",e.void()],["setOptionsTooManySigners",e.void()],["setOptionsBadFlags",e.void()],["setOptionsInvalidInflation",e.void()],["setOptionsCantChange",e.void()],["setOptionsUnknownFlag",e.void()],["setOptionsThresholdOutOfRange",e.void()],["setOptionsBadSigner",e.void()],["setOptionsInvalidHomeDomain",e.void()],["setOptionsAuthRevocableRequired",e.void()]],arms:{}}),e.enum("ChangeTrustResultCode",{changeTrustSuccess:0,changeTrustMalformed:-1,changeTrustNoIssuer:-2,changeTrustInvalidLimit:-3,changeTrustLowReserve:-4,changeTrustSelfNotAllowed:-5,changeTrustTrustLineMissing:-6,changeTrustCannotDelete:-7,changeTrustNotAuthMaintainLiabilities:-8}),e.union("ChangeTrustResult",{switchOn:e.lookup("ChangeTrustResultCode"),switchName:"code",switches:[["changeTrustSuccess",e.void()],["changeTrustMalformed",e.void()],["changeTrustNoIssuer",e.void()],["changeTrustInvalidLimit",e.void()],["changeTrustLowReserve",e.void()],["changeTrustSelfNotAllowed",e.void()],["changeTrustTrustLineMissing",e.void()],["changeTrustCannotDelete",e.void()],["changeTrustNotAuthMaintainLiabilities",e.void()]],arms:{}}),e.enum("AllowTrustResultCode",{allowTrustSuccess:0,allowTrustMalformed:-1,allowTrustNoTrustLine:-2,allowTrustTrustNotRequired:-3,allowTrustCantRevoke:-4,allowTrustSelfNotAllowed:-5,allowTrustLowReserve:-6}),e.union("AllowTrustResult",{switchOn:e.lookup("AllowTrustResultCode"),switchName:"code",switches:[["allowTrustSuccess",e.void()],["allowTrustMalformed",e.void()],["allowTrustNoTrustLine",e.void()],["allowTrustTrustNotRequired",e.void()],["allowTrustCantRevoke",e.void()],["allowTrustSelfNotAllowed",e.void()],["allowTrustLowReserve",e.void()]],arms:{}}),e.enum("AccountMergeResultCode",{accountMergeSuccess:0,accountMergeMalformed:-1,accountMergeNoAccount:-2,accountMergeImmutableSet:-3,accountMergeHasSubEntries:-4,accountMergeSeqnumTooFar:-5,accountMergeDestFull:-6,accountMergeIsSponsor:-7}),e.union("AccountMergeResult",{switchOn:e.lookup("AccountMergeResultCode"),switchName:"code",switches:[["accountMergeSuccess","sourceAccountBalance"],["accountMergeMalformed",e.void()],["accountMergeNoAccount",e.void()],["accountMergeImmutableSet",e.void()],["accountMergeHasSubEntries",e.void()],["accountMergeSeqnumTooFar",e.void()],["accountMergeDestFull",e.void()],["accountMergeIsSponsor",e.void()]],arms:{sourceAccountBalance:e.lookup("Int64")}}),e.enum("InflationResultCode",{inflationSuccess:0,inflationNotTime:-1}),e.struct("InflationPayout",[["destination",e.lookup("AccountId")],["amount",e.lookup("Int64")]]),e.union("InflationResult",{switchOn:e.lookup("InflationResultCode"),switchName:"code",switches:[["inflationSuccess","payouts"],["inflationNotTime",e.void()]],arms:{payouts:e.varArray(e.lookup("InflationPayout"),2147483647)}}),e.enum("ManageDataResultCode",{manageDataSuccess:0,manageDataNotSupportedYet:-1,manageDataNameNotFound:-2,manageDataLowReserve:-3,manageDataInvalidName:-4}),e.union("ManageDataResult",{switchOn:e.lookup("ManageDataResultCode"),switchName:"code",switches:[["manageDataSuccess",e.void()],["manageDataNotSupportedYet",e.void()],["manageDataNameNotFound",e.void()],["manageDataLowReserve",e.void()],["manageDataInvalidName",e.void()]],arms:{}}),e.enum("BumpSequenceResultCode",{bumpSequenceSuccess:0,bumpSequenceBadSeq:-1}),e.union("BumpSequenceResult",{switchOn:e.lookup("BumpSequenceResultCode"),switchName:"code",switches:[["bumpSequenceSuccess",e.void()],["bumpSequenceBadSeq",e.void()]],arms:{}}),e.enum("CreateClaimableBalanceResultCode",{createClaimableBalanceSuccess:0,createClaimableBalanceMalformed:-1,createClaimableBalanceLowReserve:-2,createClaimableBalanceNoTrust:-3,createClaimableBalanceNotAuthorized:-4,createClaimableBalanceUnderfunded:-5}),e.union("CreateClaimableBalanceResult",{switchOn:e.lookup("CreateClaimableBalanceResultCode"),switchName:"code",switches:[["createClaimableBalanceSuccess","balanceId"],["createClaimableBalanceMalformed",e.void()],["createClaimableBalanceLowReserve",e.void()],["createClaimableBalanceNoTrust",e.void()],["createClaimableBalanceNotAuthorized",e.void()],["createClaimableBalanceUnderfunded",e.void()]],arms:{balanceId:e.lookup("ClaimableBalanceId")}}),e.enum("ClaimClaimableBalanceResultCode",{claimClaimableBalanceSuccess:0,claimClaimableBalanceDoesNotExist:-1,claimClaimableBalanceCannotClaim:-2,claimClaimableBalanceLineFull:-3,claimClaimableBalanceNoTrust:-4,claimClaimableBalanceNotAuthorized:-5}),e.union("ClaimClaimableBalanceResult",{switchOn:e.lookup("ClaimClaimableBalanceResultCode"),switchName:"code",switches:[["claimClaimableBalanceSuccess",e.void()],["claimClaimableBalanceDoesNotExist",e.void()],["claimClaimableBalanceCannotClaim",e.void()],["claimClaimableBalanceLineFull",e.void()],["claimClaimableBalanceNoTrust",e.void()],["claimClaimableBalanceNotAuthorized",e.void()]],arms:{}}),e.enum("BeginSponsoringFutureReservesResultCode",{beginSponsoringFutureReservesSuccess:0,beginSponsoringFutureReservesMalformed:-1,beginSponsoringFutureReservesAlreadySponsored:-2,beginSponsoringFutureReservesRecursive:-3}),e.union("BeginSponsoringFutureReservesResult",{switchOn:e.lookup("BeginSponsoringFutureReservesResultCode"),switchName:"code",switches:[["beginSponsoringFutureReservesSuccess",e.void()],["beginSponsoringFutureReservesMalformed",e.void()],["beginSponsoringFutureReservesAlreadySponsored",e.void()],["beginSponsoringFutureReservesRecursive",e.void()]],arms:{}}),e.enum("EndSponsoringFutureReservesResultCode",{endSponsoringFutureReservesSuccess:0,endSponsoringFutureReservesNotSponsored:-1}),e.union("EndSponsoringFutureReservesResult",{switchOn:e.lookup("EndSponsoringFutureReservesResultCode"),switchName:"code",switches:[["endSponsoringFutureReservesSuccess",e.void()],["endSponsoringFutureReservesNotSponsored",e.void()]],arms:{}}),e.enum("RevokeSponsorshipResultCode",{revokeSponsorshipSuccess:0,revokeSponsorshipDoesNotExist:-1,revokeSponsorshipNotSponsor:-2,revokeSponsorshipLowReserve:-3,revokeSponsorshipOnlyTransferable:-4,revokeSponsorshipMalformed:-5}),e.union("RevokeSponsorshipResult",{switchOn:e.lookup("RevokeSponsorshipResultCode"),switchName:"code",switches:[["revokeSponsorshipSuccess",e.void()],["revokeSponsorshipDoesNotExist",e.void()],["revokeSponsorshipNotSponsor",e.void()],["revokeSponsorshipLowReserve",e.void()],["revokeSponsorshipOnlyTransferable",e.void()],["revokeSponsorshipMalformed",e.void()]],arms:{}}),e.enum("ClawbackResultCode",{clawbackSuccess:0,clawbackMalformed:-1,clawbackNotClawbackEnabled:-2,clawbackNoTrust:-3,clawbackUnderfunded:-4}),e.union("ClawbackResult",{switchOn:e.lookup("ClawbackResultCode"),switchName:"code",switches:[["clawbackSuccess",e.void()],["clawbackMalformed",e.void()],["clawbackNotClawbackEnabled",e.void()],["clawbackNoTrust",e.void()],["clawbackUnderfunded",e.void()]],arms:{}}),e.enum("ClawbackClaimableBalanceResultCode",{clawbackClaimableBalanceSuccess:0,clawbackClaimableBalanceDoesNotExist:-1,clawbackClaimableBalanceNotIssuer:-2,clawbackClaimableBalanceNotClawbackEnabled:-3}),e.union("ClawbackClaimableBalanceResult",{switchOn:e.lookup("ClawbackClaimableBalanceResultCode"),switchName:"code",switches:[["clawbackClaimableBalanceSuccess",e.void()],["clawbackClaimableBalanceDoesNotExist",e.void()],["clawbackClaimableBalanceNotIssuer",e.void()],["clawbackClaimableBalanceNotClawbackEnabled",e.void()]],arms:{}}),e.enum("SetTrustLineFlagsResultCode",{setTrustLineFlagsSuccess:0,setTrustLineFlagsMalformed:-1,setTrustLineFlagsNoTrustLine:-2,setTrustLineFlagsCantRevoke:-3,setTrustLineFlagsInvalidState:-4,setTrustLineFlagsLowReserve:-5}),e.union("SetTrustLineFlagsResult",{switchOn:e.lookup("SetTrustLineFlagsResultCode"),switchName:"code",switches:[["setTrustLineFlagsSuccess",e.void()],["setTrustLineFlagsMalformed",e.void()],["setTrustLineFlagsNoTrustLine",e.void()],["setTrustLineFlagsCantRevoke",e.void()],["setTrustLineFlagsInvalidState",e.void()],["setTrustLineFlagsLowReserve",e.void()]],arms:{}}),e.enum("LiquidityPoolDepositResultCode",{liquidityPoolDepositSuccess:0,liquidityPoolDepositMalformed:-1,liquidityPoolDepositNoTrust:-2,liquidityPoolDepositNotAuthorized:-3,liquidityPoolDepositUnderfunded:-4,liquidityPoolDepositLineFull:-5,liquidityPoolDepositBadPrice:-6,liquidityPoolDepositPoolFull:-7}),e.union("LiquidityPoolDepositResult",{switchOn:e.lookup("LiquidityPoolDepositResultCode"),switchName:"code",switches:[["liquidityPoolDepositSuccess",e.void()],["liquidityPoolDepositMalformed",e.void()],["liquidityPoolDepositNoTrust",e.void()],["liquidityPoolDepositNotAuthorized",e.void()],["liquidityPoolDepositUnderfunded",e.void()],["liquidityPoolDepositLineFull",e.void()],["liquidityPoolDepositBadPrice",e.void()],["liquidityPoolDepositPoolFull",e.void()]],arms:{}}),e.enum("LiquidityPoolWithdrawResultCode",{liquidityPoolWithdrawSuccess:0,liquidityPoolWithdrawMalformed:-1,liquidityPoolWithdrawNoTrust:-2,liquidityPoolWithdrawUnderfunded:-3,liquidityPoolWithdrawLineFull:-4,liquidityPoolWithdrawUnderMinimum:-5}),e.union("LiquidityPoolWithdrawResult",{switchOn:e.lookup("LiquidityPoolWithdrawResultCode"),switchName:"code",switches:[["liquidityPoolWithdrawSuccess",e.void()],["liquidityPoolWithdrawMalformed",e.void()],["liquidityPoolWithdrawNoTrust",e.void()],["liquidityPoolWithdrawUnderfunded",e.void()],["liquidityPoolWithdrawLineFull",e.void()],["liquidityPoolWithdrawUnderMinimum",e.void()]],arms:{}}),e.enum("InvokeHostFunctionResultCode",{invokeHostFunctionSuccess:0,invokeHostFunctionMalformed:-1,invokeHostFunctionTrapped:-2,invokeHostFunctionResourceLimitExceeded:-3,invokeHostFunctionEntryArchived:-4,invokeHostFunctionInsufficientRefundableFee:-5}),e.union("InvokeHostFunctionResult",{switchOn:e.lookup("InvokeHostFunctionResultCode"),switchName:"code",switches:[["invokeHostFunctionSuccess","success"],["invokeHostFunctionMalformed",e.void()],["invokeHostFunctionTrapped",e.void()],["invokeHostFunctionResourceLimitExceeded",e.void()],["invokeHostFunctionEntryArchived",e.void()],["invokeHostFunctionInsufficientRefundableFee",e.void()]],arms:{success:e.lookup("Hash")}}),e.enum("ExtendFootprintTtlResultCode",{extendFootprintTtlSuccess:0,extendFootprintTtlMalformed:-1,extendFootprintTtlResourceLimitExceeded:-2,extendFootprintTtlInsufficientRefundableFee:-3}),e.union("ExtendFootprintTtlResult",{switchOn:e.lookup("ExtendFootprintTtlResultCode"),switchName:"code",switches:[["extendFootprintTtlSuccess",e.void()],["extendFootprintTtlMalformed",e.void()],["extendFootprintTtlResourceLimitExceeded",e.void()],["extendFootprintTtlInsufficientRefundableFee",e.void()]],arms:{}}),e.enum("RestoreFootprintResultCode",{restoreFootprintSuccess:0,restoreFootprintMalformed:-1,restoreFootprintResourceLimitExceeded:-2,restoreFootprintInsufficientRefundableFee:-3}),e.union("RestoreFootprintResult",{switchOn:e.lookup("RestoreFootprintResultCode"),switchName:"code",switches:[["restoreFootprintSuccess",e.void()],["restoreFootprintMalformed",e.void()],["restoreFootprintResourceLimitExceeded",e.void()],["restoreFootprintInsufficientRefundableFee",e.void()]],arms:{}}),e.enum("OperationResultCode",{opInner:0,opBadAuth:-1,opNoAccount:-2,opNotSupported:-3,opTooManySubentries:-4,opExceededWorkLimit:-5,opTooManySponsoring:-6}),e.union("OperationResultTr",{switchOn:e.lookup("OperationType"),switchName:"type",switches:[["createAccount","createAccountResult"],["payment","paymentResult"],["pathPaymentStrictReceive","pathPaymentStrictReceiveResult"],["manageSellOffer","manageSellOfferResult"],["createPassiveSellOffer","createPassiveSellOfferResult"],["setOptions","setOptionsResult"],["changeTrust","changeTrustResult"],["allowTrust","allowTrustResult"],["accountMerge","accountMergeResult"],["inflation","inflationResult"],["manageData","manageDataResult"],["bumpSequence","bumpSeqResult"],["manageBuyOffer","manageBuyOfferResult"],["pathPaymentStrictSend","pathPaymentStrictSendResult"],["createClaimableBalance","createClaimableBalanceResult"],["claimClaimableBalance","claimClaimableBalanceResult"],["beginSponsoringFutureReserves","beginSponsoringFutureReservesResult"],["endSponsoringFutureReserves","endSponsoringFutureReservesResult"],["revokeSponsorship","revokeSponsorshipResult"],["clawback","clawbackResult"],["clawbackClaimableBalance","clawbackClaimableBalanceResult"],["setTrustLineFlags","setTrustLineFlagsResult"],["liquidityPoolDeposit","liquidityPoolDepositResult"],["liquidityPoolWithdraw","liquidityPoolWithdrawResult"],["invokeHostFunction","invokeHostFunctionResult"],["extendFootprintTtl","extendFootprintTtlResult"],["restoreFootprint","restoreFootprintResult"]],arms:{createAccountResult:e.lookup("CreateAccountResult"),paymentResult:e.lookup("PaymentResult"),pathPaymentStrictReceiveResult:e.lookup("PathPaymentStrictReceiveResult"),manageSellOfferResult:e.lookup("ManageSellOfferResult"),createPassiveSellOfferResult:e.lookup("ManageSellOfferResult"),setOptionsResult:e.lookup("SetOptionsResult"),changeTrustResult:e.lookup("ChangeTrustResult"),allowTrustResult:e.lookup("AllowTrustResult"),accountMergeResult:e.lookup("AccountMergeResult"),inflationResult:e.lookup("InflationResult"),manageDataResult:e.lookup("ManageDataResult"),bumpSeqResult:e.lookup("BumpSequenceResult"),manageBuyOfferResult:e.lookup("ManageBuyOfferResult"),pathPaymentStrictSendResult:e.lookup("PathPaymentStrictSendResult"),createClaimableBalanceResult:e.lookup("CreateClaimableBalanceResult"),claimClaimableBalanceResult:e.lookup("ClaimClaimableBalanceResult"),beginSponsoringFutureReservesResult:e.lookup("BeginSponsoringFutureReservesResult"),endSponsoringFutureReservesResult:e.lookup("EndSponsoringFutureReservesResult"),revokeSponsorshipResult:e.lookup("RevokeSponsorshipResult"),clawbackResult:e.lookup("ClawbackResult"),clawbackClaimableBalanceResult:e.lookup("ClawbackClaimableBalanceResult"),setTrustLineFlagsResult:e.lookup("SetTrustLineFlagsResult"),liquidityPoolDepositResult:e.lookup("LiquidityPoolDepositResult"),liquidityPoolWithdrawResult:e.lookup("LiquidityPoolWithdrawResult"),invokeHostFunctionResult:e.lookup("InvokeHostFunctionResult"),extendFootprintTtlResult:e.lookup("ExtendFootprintTtlResult"),restoreFootprintResult:e.lookup("RestoreFootprintResult")}}),e.union("OperationResult",{switchOn:e.lookup("OperationResultCode"),switchName:"code",switches:[["opInner","tr"],["opBadAuth",e.void()],["opNoAccount",e.void()],["opNotSupported",e.void()],["opTooManySubentries",e.void()],["opExceededWorkLimit",e.void()],["opTooManySponsoring",e.void()]],arms:{tr:e.lookup("OperationResultTr")}}),e.enum("TransactionResultCode",{txFeeBumpInnerSuccess:1,txSuccess:0,txFailed:-1,txTooEarly:-2,txTooLate:-3,txMissingOperation:-4,txBadSeq:-5,txBadAuth:-6,txInsufficientBalance:-7,txNoAccount:-8,txInsufficientFee:-9,txBadAuthExtra:-10,txInternalError:-11,txNotSupported:-12,txFeeBumpInnerFailed:-13,txBadSponsorship:-14,txBadMinSeqAgeOrGap:-15,txMalformed:-16,txSorobanInvalid:-17}),e.union("InnerTransactionResultResult",{switchOn:e.lookup("TransactionResultCode"),switchName:"code",switches:[["txSuccess","results"],["txFailed","results"],["txTooEarly",e.void()],["txTooLate",e.void()],["txMissingOperation",e.void()],["txBadSeq",e.void()],["txBadAuth",e.void()],["txInsufficientBalance",e.void()],["txNoAccount",e.void()],["txInsufficientFee",e.void()],["txBadAuthExtra",e.void()],["txInternalError",e.void()],["txNotSupported",e.void()],["txBadSponsorship",e.void()],["txBadMinSeqAgeOrGap",e.void()],["txMalformed",e.void()],["txSorobanInvalid",e.void()]],arms:{results:e.varArray(e.lookup("OperationResult"),2147483647)}}),e.union("InnerTransactionResultExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("InnerTransactionResult",[["feeCharged",e.lookup("Int64")],["result",e.lookup("InnerTransactionResultResult")],["ext",e.lookup("InnerTransactionResultExt")]]),e.struct("InnerTransactionResultPair",[["transactionHash",e.lookup("Hash")],["result",e.lookup("InnerTransactionResult")]]),e.union("TransactionResultResult",{switchOn:e.lookup("TransactionResultCode"),switchName:"code",switches:[["txFeeBumpInnerSuccess","innerResultPair"],["txFeeBumpInnerFailed","innerResultPair"],["txSuccess","results"],["txFailed","results"],["txTooEarly",e.void()],["txTooLate",e.void()],["txMissingOperation",e.void()],["txBadSeq",e.void()],["txBadAuth",e.void()],["txInsufficientBalance",e.void()],["txNoAccount",e.void()],["txInsufficientFee",e.void()],["txBadAuthExtra",e.void()],["txInternalError",e.void()],["txNotSupported",e.void()],["txBadSponsorship",e.void()],["txBadMinSeqAgeOrGap",e.void()],["txMalformed",e.void()],["txSorobanInvalid",e.void()]],arms:{innerResultPair:e.lookup("InnerTransactionResultPair"),results:e.varArray(e.lookup("OperationResult"),2147483647)}}),e.union("TransactionResultExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionResult",[["feeCharged",e.lookup("Int64")],["result",e.lookup("TransactionResultResult")],["ext",e.lookup("TransactionResultExt")]]),e.typedef("Hash",e.opaque(32)),e.typedef("Uint256",e.opaque(32)),e.typedef("Uint32",e.uint()),e.typedef("Int32",e.int()),e.typedef("Uint64",e.uhyper()),e.typedef("Int64",e.hyper()),e.typedef("TimePoint",e.lookup("Uint64")),e.typedef("Duration",e.lookup("Uint64")),e.union("ExtensionPoint",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.enum("CryptoKeyType",{keyTypeEd25519:0,keyTypePreAuthTx:1,keyTypeHashX:2,keyTypeEd25519SignedPayload:3,keyTypeMuxedEd25519:256}),e.enum("PublicKeyType",{publicKeyTypeEd25519:0}),e.enum("SignerKeyType",{signerKeyTypeEd25519:0,signerKeyTypePreAuthTx:1,signerKeyTypeHashX:2,signerKeyTypeEd25519SignedPayload:3}),e.union("PublicKey",{switchOn:e.lookup("PublicKeyType"),switchName:"type",switches:[["publicKeyTypeEd25519","ed25519"]],arms:{ed25519:e.lookup("Uint256")}}),e.struct("SignerKeyEd25519SignedPayload",[["ed25519",e.lookup("Uint256")],["payload",e.varOpaque(64)]]),e.union("SignerKey",{switchOn:e.lookup("SignerKeyType"),switchName:"type",switches:[["signerKeyTypeEd25519","ed25519"],["signerKeyTypePreAuthTx","preAuthTx"],["signerKeyTypeHashX","hashX"],["signerKeyTypeEd25519SignedPayload","ed25519SignedPayload"]],arms:{ed25519:e.lookup("Uint256"),preAuthTx:e.lookup("Uint256"),hashX:e.lookup("Uint256"),ed25519SignedPayload:e.lookup("SignerKeyEd25519SignedPayload")}}),e.typedef("Signature",e.varOpaque(64)),e.typedef("SignatureHint",e.opaque(4)),e.typedef("NodeId",e.lookup("PublicKey")),e.typedef("AccountId",e.lookup("PublicKey")),e.struct("Curve25519Secret",[["key",e.opaque(32)]]),e.struct("Curve25519Public",[["key",e.opaque(32)]]),e.struct("HmacSha256Key",[["key",e.opaque(32)]]),e.struct("HmacSha256Mac",[["mac",e.opaque(32)]]),e.enum("ScValType",{scvBool:0,scvVoid:1,scvError:2,scvU32:3,scvI32:4,scvU64:5,scvI64:6,scvTimepoint:7,scvDuration:8,scvU128:9,scvI128:10,scvU256:11,scvI256:12,scvBytes:13,scvString:14,scvSymbol:15,scvVec:16,scvMap:17,scvAddress:18,scvContractInstance:19,scvLedgerKeyContractInstance:20,scvLedgerKeyNonce:21}),e.enum("ScErrorType",{sceContract:0,sceWasmVm:1,sceContext:2,sceStorage:3,sceObject:4,sceCrypto:5,sceEvents:6,sceBudget:7,sceValue:8,sceAuth:9}),e.enum("ScErrorCode",{scecArithDomain:0,scecIndexBounds:1,scecInvalidInput:2,scecMissingValue:3,scecExistingValue:4,scecExceededLimit:5,scecInvalidAction:6,scecInternalError:7,scecUnexpectedType:8,scecUnexpectedSize:9}),e.union("ScError",{switchOn:e.lookup("ScErrorType"),switchName:"type",switches:[["sceContract","contractCode"],["sceWasmVm","code"],["sceContext","code"],["sceStorage","code"],["sceObject","code"],["sceCrypto","code"],["sceEvents","code"],["sceBudget","code"],["sceValue","code"],["sceAuth","code"]],arms:{contractCode:e.lookup("Uint32"),code:e.lookup("ScErrorCode")}}),e.struct("UInt128Parts",[["hi",e.lookup("Uint64")],["lo",e.lookup("Uint64")]]),e.struct("Int128Parts",[["hi",e.lookup("Int64")],["lo",e.lookup("Uint64")]]),e.struct("UInt256Parts",[["hiHi",e.lookup("Uint64")],["hiLo",e.lookup("Uint64")],["loHi",e.lookup("Uint64")],["loLo",e.lookup("Uint64")]]),e.struct("Int256Parts",[["hiHi",e.lookup("Int64")],["hiLo",e.lookup("Uint64")],["loHi",e.lookup("Uint64")],["loLo",e.lookup("Uint64")]]),e.enum("ContractExecutableType",{contractExecutableWasm:0,contractExecutableStellarAsset:1}),e.union("ContractExecutable",{switchOn:e.lookup("ContractExecutableType"),switchName:"type",switches:[["contractExecutableWasm","wasmHash"],["contractExecutableStellarAsset",e.void()]],arms:{wasmHash:e.lookup("Hash")}}),e.enum("ScAddressType",{scAddressTypeAccount:0,scAddressTypeContract:1}),e.union("ScAddress",{switchOn:e.lookup("ScAddressType"),switchName:"type",switches:[["scAddressTypeAccount","accountId"],["scAddressTypeContract","contractId"]],arms:{accountId:e.lookup("AccountId"),contractId:e.lookup("Hash")}}),e.const("SCSYMBOL_LIMIT",32),e.typedef("ScVec",e.varArray(e.lookup("ScVal"),2147483647)),e.typedef("ScMap",e.varArray(e.lookup("ScMapEntry"),2147483647)),e.typedef("ScBytes",e.varOpaque()),e.typedef("ScString",e.string()),e.typedef("ScSymbol",e.string(32)),e.struct("ScNonceKey",[["nonce",e.lookup("Int64")]]),e.struct("ScContractInstance",[["executable",e.lookup("ContractExecutable")],["storage",e.option(e.lookup("ScMap"))]]),e.union("ScVal",{switchOn:e.lookup("ScValType"),switchName:"type",switches:[["scvBool","b"],["scvVoid",e.void()],["scvError","error"],["scvU32","u32"],["scvI32","i32"],["scvU64","u64"],["scvI64","i64"],["scvTimepoint","timepoint"],["scvDuration","duration"],["scvU128","u128"],["scvI128","i128"],["scvU256","u256"],["scvI256","i256"],["scvBytes","bytes"],["scvString","str"],["scvSymbol","sym"],["scvVec","vec"],["scvMap","map"],["scvAddress","address"],["scvLedgerKeyContractInstance",e.void()],["scvLedgerKeyNonce","nonceKey"],["scvContractInstance","instance"]],arms:{b:e.bool(),error:e.lookup("ScError"),u32:e.lookup("Uint32"),i32:e.lookup("Int32"),u64:e.lookup("Uint64"),i64:e.lookup("Int64"),timepoint:e.lookup("TimePoint"),duration:e.lookup("Duration"),u128:e.lookup("UInt128Parts"),i128:e.lookup("Int128Parts"),u256:e.lookup("UInt256Parts"),i256:e.lookup("Int256Parts"),bytes:e.lookup("ScBytes"),str:e.lookup("ScString"),sym:e.lookup("ScSymbol"),vec:e.option(e.lookup("ScVec")),map:e.option(e.lookup("ScMap")),address:e.lookup("ScAddress"),nonceKey:e.lookup("ScNonceKey"),instance:e.lookup("ScContractInstance")}}),e.struct("ScMapEntry",[["key",e.lookup("ScVal")],["val",e.lookup("ScVal")]]),e.enum("ScEnvMetaKind",{scEnvMetaKindInterfaceVersion:0}),e.union("ScEnvMetaEntry",{switchOn:e.lookup("ScEnvMetaKind"),switchName:"kind",switches:[["scEnvMetaKindInterfaceVersion","interfaceVersion"]],arms:{interfaceVersion:e.lookup("Uint64")}}),e.struct("ScMetaV0",[["key",e.string()],["val",e.string()]]),e.enum("ScMetaKind",{scMetaV0:0}),e.union("ScMetaEntry",{switchOn:e.lookup("ScMetaKind"),switchName:"kind",switches:[["scMetaV0","v0"]],arms:{v0:e.lookup("ScMetaV0")}}),e.const("SC_SPEC_DOC_LIMIT",1024),e.enum("ScSpecType",{scSpecTypeVal:0,scSpecTypeBool:1,scSpecTypeVoid:2,scSpecTypeError:3,scSpecTypeU32:4,scSpecTypeI32:5,scSpecTypeU64:6,scSpecTypeI64:7,scSpecTypeTimepoint:8,scSpecTypeDuration:9,scSpecTypeU128:10,scSpecTypeI128:11,scSpecTypeU256:12,scSpecTypeI256:13,scSpecTypeBytes:14,scSpecTypeString:16,scSpecTypeSymbol:17,scSpecTypeAddress:19,scSpecTypeOption:1e3,scSpecTypeResult:1001,scSpecTypeVec:1002,scSpecTypeMap:1004,scSpecTypeTuple:1005,scSpecTypeBytesN:1006,scSpecTypeUdt:2e3}),e.struct("ScSpecTypeOption",[["valueType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeResult",[["okType",e.lookup("ScSpecTypeDef")],["errorType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeVec",[["elementType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeMap",[["keyType",e.lookup("ScSpecTypeDef")],["valueType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeTuple",[["valueTypes",e.varArray(e.lookup("ScSpecTypeDef"),12)]]),e.struct("ScSpecTypeBytesN",[["n",e.lookup("Uint32")]]),e.struct("ScSpecTypeUdt",[["name",e.string(60)]]),e.union("ScSpecTypeDef",{switchOn:e.lookup("ScSpecType"),switchName:"type",switches:[["scSpecTypeVal",e.void()],["scSpecTypeBool",e.void()],["scSpecTypeVoid",e.void()],["scSpecTypeError",e.void()],["scSpecTypeU32",e.void()],["scSpecTypeI32",e.void()],["scSpecTypeU64",e.void()],["scSpecTypeI64",e.void()],["scSpecTypeTimepoint",e.void()],["scSpecTypeDuration",e.void()],["scSpecTypeU128",e.void()],["scSpecTypeI128",e.void()],["scSpecTypeU256",e.void()],["scSpecTypeI256",e.void()],["scSpecTypeBytes",e.void()],["scSpecTypeString",e.void()],["scSpecTypeSymbol",e.void()],["scSpecTypeAddress",e.void()],["scSpecTypeOption","option"],["scSpecTypeResult","result"],["scSpecTypeVec","vec"],["scSpecTypeMap","map"],["scSpecTypeTuple","tuple"],["scSpecTypeBytesN","bytesN"],["scSpecTypeUdt","udt"]],arms:{option:e.lookup("ScSpecTypeOption"),result:e.lookup("ScSpecTypeResult"),vec:e.lookup("ScSpecTypeVec"),map:e.lookup("ScSpecTypeMap"),tuple:e.lookup("ScSpecTypeTuple"),bytesN:e.lookup("ScSpecTypeBytesN"),udt:e.lookup("ScSpecTypeUdt")}}),e.struct("ScSpecUdtStructFieldV0",[["doc",e.string(t)],["name",e.string(30)],["type",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecUdtStructV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["fields",e.varArray(e.lookup("ScSpecUdtStructFieldV0"),40)]]),e.struct("ScSpecUdtUnionCaseVoidV0",[["doc",e.string(t)],["name",e.string(60)]]),e.struct("ScSpecUdtUnionCaseTupleV0",[["doc",e.string(t)],["name",e.string(60)],["type",e.varArray(e.lookup("ScSpecTypeDef"),12)]]),e.enum("ScSpecUdtUnionCaseV0Kind",{scSpecUdtUnionCaseVoidV0:0,scSpecUdtUnionCaseTupleV0:1}),e.union("ScSpecUdtUnionCaseV0",{switchOn:e.lookup("ScSpecUdtUnionCaseV0Kind"),switchName:"kind",switches:[["scSpecUdtUnionCaseVoidV0","voidCase"],["scSpecUdtUnionCaseTupleV0","tupleCase"]],arms:{voidCase:e.lookup("ScSpecUdtUnionCaseVoidV0"),tupleCase:e.lookup("ScSpecUdtUnionCaseTupleV0")}}),e.struct("ScSpecUdtUnionV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtUnionCaseV0"),50)]]),e.struct("ScSpecUdtEnumCaseV0",[["doc",e.string(t)],["name",e.string(60)],["value",e.lookup("Uint32")]]),e.struct("ScSpecUdtEnumV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtEnumCaseV0"),50)]]),e.struct("ScSpecUdtErrorEnumCaseV0",[["doc",e.string(t)],["name",e.string(60)],["value",e.lookup("Uint32")]]),e.struct("ScSpecUdtErrorEnumV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtErrorEnumCaseV0"),50)]]),e.struct("ScSpecFunctionInputV0",[["doc",e.string(t)],["name",e.string(30)],["type",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecFunctionV0",[["doc",e.string(t)],["name",e.lookup("ScSymbol")],["inputs",e.varArray(e.lookup("ScSpecFunctionInputV0"),10)],["outputs",e.varArray(e.lookup("ScSpecTypeDef"),1)]]),e.enum("ScSpecEntryKind",{scSpecEntryFunctionV0:0,scSpecEntryUdtStructV0:1,scSpecEntryUdtUnionV0:2,scSpecEntryUdtEnumV0:3,scSpecEntryUdtErrorEnumV0:4}),e.union("ScSpecEntry",{switchOn:e.lookup("ScSpecEntryKind"),switchName:"kind",switches:[["scSpecEntryFunctionV0","functionV0"],["scSpecEntryUdtStructV0","udtStructV0"],["scSpecEntryUdtUnionV0","udtUnionV0"],["scSpecEntryUdtEnumV0","udtEnumV0"],["scSpecEntryUdtErrorEnumV0","udtErrorEnumV0"]],arms:{functionV0:e.lookup("ScSpecFunctionV0"),udtStructV0:e.lookup("ScSpecUdtStructV0"),udtUnionV0:e.lookup("ScSpecUdtUnionV0"),udtEnumV0:e.lookup("ScSpecUdtEnumV0"),udtErrorEnumV0:e.lookup("ScSpecUdtErrorEnumV0")}}),e.struct("ConfigSettingContractExecutionLanesV0",[["ledgerMaxTxCount",e.lookup("Uint32")]]),e.struct("ConfigSettingContractComputeV0",[["ledgerMaxInstructions",e.lookup("Int64")],["txMaxInstructions",e.lookup("Int64")],["feeRatePerInstructionsIncrement",e.lookup("Int64")],["txMemoryLimit",e.lookup("Uint32")]]),e.struct("ConfigSettingContractLedgerCostV0",[["ledgerMaxReadLedgerEntries",e.lookup("Uint32")],["ledgerMaxReadBytes",e.lookup("Uint32")],["ledgerMaxWriteLedgerEntries",e.lookup("Uint32")],["ledgerMaxWriteBytes",e.lookup("Uint32")],["txMaxReadLedgerEntries",e.lookup("Uint32")],["txMaxReadBytes",e.lookup("Uint32")],["txMaxWriteLedgerEntries",e.lookup("Uint32")],["txMaxWriteBytes",e.lookup("Uint32")],["feeReadLedgerEntry",e.lookup("Int64")],["feeWriteLedgerEntry",e.lookup("Int64")],["feeRead1Kb",e.lookup("Int64")],["bucketListTargetSizeBytes",e.lookup("Int64")],["writeFee1KbBucketListLow",e.lookup("Int64")],["writeFee1KbBucketListHigh",e.lookup("Int64")],["bucketListWriteFeeGrowthFactor",e.lookup("Uint32")]]),e.struct("ConfigSettingContractHistoricalDataV0",[["feeHistorical1Kb",e.lookup("Int64")]]),e.struct("ConfigSettingContractEventsV0",[["txMaxContractEventsSizeBytes",e.lookup("Uint32")],["feeContractEvents1Kb",e.lookup("Int64")]]),e.struct("ConfigSettingContractBandwidthV0",[["ledgerMaxTxsSizeBytes",e.lookup("Uint32")],["txMaxSizeBytes",e.lookup("Uint32")],["feeTxSize1Kb",e.lookup("Int64")]]),e.enum("ContractCostType",{wasmInsnExec:0,memAlloc:1,memCpy:2,memCmp:3,dispatchHostFunction:4,visitObject:5,valSer:6,valDeser:7,computeSha256Hash:8,computeEd25519PubKey:9,verifyEd25519Sig:10,vmInstantiation:11,vmCachedInstantiation:12,invokeVmFunction:13,computeKeccak256Hash:14,computeEcdsaSecp256k1Sig:15,recoverEcdsaSecp256k1Key:16,int256AddSub:17,int256Mul:18,int256Div:19,int256Pow:20,int256Shift:21,chaCha20DrawBytes:22}),e.struct("ContractCostParamEntry",[["ext",e.lookup("ExtensionPoint")],["constTerm",e.lookup("Int64")],["linearTerm",e.lookup("Int64")]]),e.struct("StateArchivalSettings",[["maxEntryTtl",e.lookup("Uint32")],["minTemporaryTtl",e.lookup("Uint32")],["minPersistentTtl",e.lookup("Uint32")],["persistentRentRateDenominator",e.lookup("Int64")],["tempRentRateDenominator",e.lookup("Int64")],["maxEntriesToArchive",e.lookup("Uint32")],["bucketListSizeWindowSampleSize",e.lookup("Uint32")],["evictionScanSize",e.lookup("Uint64")],["startingEvictionScanLevel",e.lookup("Uint32")]]),e.struct("EvictionIterator",[["bucketListLevel",e.lookup("Uint32")],["isCurrBucket",e.bool()],["bucketFileOffset",e.lookup("Uint64")]]),e.const("CONTRACT_COST_COUNT_LIMIT",1024),e.typedef("ContractCostParams",e.varArray(e.lookup("ContractCostParamEntry"),e.lookup("CONTRACT_COST_COUNT_LIMIT"))),e.enum("ConfigSettingId",{configSettingContractMaxSizeBytes:0,configSettingContractComputeV0:1,configSettingContractLedgerCostV0:2,configSettingContractHistoricalDataV0:3,configSettingContractEventsV0:4,configSettingContractBandwidthV0:5,configSettingContractCostParamsCpuInstructions:6,configSettingContractCostParamsMemoryBytes:7,configSettingContractDataKeySizeBytes:8,configSettingContractDataEntrySizeBytes:9,configSettingStateArchival:10,configSettingContractExecutionLanes:11,configSettingBucketlistSizeWindow:12,configSettingEvictionIterator:13}),e.union("ConfigSettingEntry",{switchOn:e.lookup("ConfigSettingId"),switchName:"configSettingId",switches:[["configSettingContractMaxSizeBytes","contractMaxSizeBytes"],["configSettingContractComputeV0","contractCompute"],["configSettingContractLedgerCostV0","contractLedgerCost"],["configSettingContractHistoricalDataV0","contractHistoricalData"],["configSettingContractEventsV0","contractEvents"],["configSettingContractBandwidthV0","contractBandwidth"],["configSettingContractCostParamsCpuInstructions","contractCostParamsCpuInsns"],["configSettingContractCostParamsMemoryBytes","contractCostParamsMemBytes"],["configSettingContractDataKeySizeBytes","contractDataKeySizeBytes"],["configSettingContractDataEntrySizeBytes","contractDataEntrySizeBytes"],["configSettingStateArchival","stateArchivalSettings"],["configSettingContractExecutionLanes","contractExecutionLanes"],["configSettingBucketlistSizeWindow","bucketListSizeWindow"],["configSettingEvictionIterator","evictionIterator"]],arms:{contractMaxSizeBytes:e.lookup("Uint32"),contractCompute:e.lookup("ConfigSettingContractComputeV0"),contractLedgerCost:e.lookup("ConfigSettingContractLedgerCostV0"),contractHistoricalData:e.lookup("ConfigSettingContractHistoricalDataV0"),contractEvents:e.lookup("ConfigSettingContractEventsV0"),contractBandwidth:e.lookup("ConfigSettingContractBandwidthV0"),contractCostParamsCpuInsns:e.lookup("ContractCostParams"),contractCostParamsMemBytes:e.lookup("ContractCostParams"),contractDataKeySizeBytes:e.lookup("Uint32"),contractDataEntrySizeBytes:e.lookup("Uint32"),stateArchivalSettings:e.lookup("StateArchivalSettings"),contractExecutionLanes:e.lookup("ConfigSettingContractExecutionLanesV0"),bucketListSizeWindow:e.varArray(e.lookup("Uint64"),2147483647),evictionIterator:e.lookup("EvictionIterator")}})}));t.default=i},33092:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiquidityPoolFeeV18=void 0,t.getLiquidityPoolId=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("constant_product"!==e)throw new Error("liquidityPoolType is invalid");var r=t.assetA,n=t.assetB,u=t.fee;if(!r||!(r instanceof i.Asset))throw new Error("assetA is invalid");if(!n||!(n instanceof i.Asset))throw new Error("assetB is invalid");if(!u||u!==s)throw new Error("fee is invalid");if(-1!==i.Asset.compare(r,n))throw new Error("Assets are not in lexicographic order");var c=o.default.LiquidityPoolType.liquidityPoolConstantProduct().toXDR(),l=new o.default.LiquidityPoolConstantProductParameters({assetA:r.toXDRObject(),assetB:n.toXDRObject(),fee:u}).toXDR(),f=Buffer.concat([c,l]);return(0,a.hash)(f)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(5934),a=r(97470);var s=t.LiquidityPoolFeeV18=30},97470:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hash=function(e){var t=new n.sha256;return t.update(e,"utf8"),t.digest()};var n=r(20307)},12034:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={xdr:!0,hash:!0,sign:!0,verify:!0,FastSigning:!0,getLiquidityPoolId:!0,LiquidityPoolFeeV18:!0,Keypair:!0,UnsignedHyper:!0,Hyper:!0,TransactionBase:!0,Transaction:!0,FeeBumpTransaction:!0,TransactionBuilder:!0,TimeoutInfinite:!0,BASE_FEE:!0,Asset:!0,LiquidityPoolAsset:!0,LiquidityPoolId:!0,Operation:!0,AuthRequiredFlag:!0,AuthRevocableFlag:!0,AuthImmutableFlag:!0,AuthClawbackEnabledFlag:!0,Account:!0,MuxedAccount:!0,Claimant:!0,Networks:!0,StrKey:!0,SignerKey:!0,Soroban:!0,decodeAddressToMuxedAccount:!0,encodeMuxedAccountToAddress:!0,extractBaseAddress:!0,encodeMuxedAccount:!0,Contract:!0,Address:!0};Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return w.Account}}),Object.defineProperty(t,"Address",{enumerable:!0,get:function(){return O.Address}}),Object.defineProperty(t,"Asset",{enumerable:!0,get:function(){return y.Asset}}),Object.defineProperty(t,"AuthClawbackEnabledFlag",{enumerable:!0,get:function(){return v.AuthClawbackEnabledFlag}}),Object.defineProperty(t,"AuthImmutableFlag",{enumerable:!0,get:function(){return v.AuthImmutableFlag}}),Object.defineProperty(t,"AuthRequiredFlag",{enumerable:!0,get:function(){return v.AuthRequiredFlag}}),Object.defineProperty(t,"AuthRevocableFlag",{enumerable:!0,get:function(){return v.AuthRevocableFlag}}),Object.defineProperty(t,"BASE_FEE",{enumerable:!0,get:function(){return p.BASE_FEE}}),Object.defineProperty(t,"Claimant",{enumerable:!0,get:function(){return S.Claimant}}),Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return P.Contract}}),Object.defineProperty(t,"FastSigning",{enumerable:!0,get:function(){return s.FastSigning}}),Object.defineProperty(t,"FeeBumpTransaction",{enumerable:!0,get:function(){return h.FeeBumpTransaction}}),Object.defineProperty(t,"Hyper",{enumerable:!0,get:function(){return l.Hyper}}),Object.defineProperty(t,"Keypair",{enumerable:!0,get:function(){return c.Keypair}}),Object.defineProperty(t,"LiquidityPoolAsset",{enumerable:!0,get:function(){return m.LiquidityPoolAsset}}),Object.defineProperty(t,"LiquidityPoolFeeV18",{enumerable:!0,get:function(){return u.LiquidityPoolFeeV18}}),Object.defineProperty(t,"LiquidityPoolId",{enumerable:!0,get:function(){return g.LiquidityPoolId}}),Object.defineProperty(t,"MuxedAccount",{enumerable:!0,get:function(){return A.MuxedAccount}}),Object.defineProperty(t,"Networks",{enumerable:!0,get:function(){return k.Networks}}),Object.defineProperty(t,"Operation",{enumerable:!0,get:function(){return v.Operation}}),Object.defineProperty(t,"SignerKey",{enumerable:!0,get:function(){return E.SignerKey}}),Object.defineProperty(t,"Soroban",{enumerable:!0,get:function(){return x.Soroban}}),Object.defineProperty(t,"StrKey",{enumerable:!0,get:function(){return _.StrKey}}),Object.defineProperty(t,"TimeoutInfinite",{enumerable:!0,get:function(){return p.TimeoutInfinite}}),Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return d.Transaction}}),Object.defineProperty(t,"TransactionBase",{enumerable:!0,get:function(){return f.TransactionBase}}),Object.defineProperty(t,"TransactionBuilder",{enumerable:!0,get:function(){return p.TransactionBuilder}}),Object.defineProperty(t,"UnsignedHyper",{enumerable:!0,get:function(){return l.UnsignedHyper}}),Object.defineProperty(t,"decodeAddressToMuxedAccount",{enumerable:!0,get:function(){return T.decodeAddressToMuxedAccount}}),t.default=void 0,Object.defineProperty(t,"encodeMuxedAccount",{enumerable:!0,get:function(){return T.encodeMuxedAccount}}),Object.defineProperty(t,"encodeMuxedAccountToAddress",{enumerable:!0,get:function(){return T.encodeMuxedAccountToAddress}}),Object.defineProperty(t,"extractBaseAddress",{enumerable:!0,get:function(){return T.extractBaseAddress}}),Object.defineProperty(t,"getLiquidityPoolId",{enumerable:!0,get:function(){return u.getLiquidityPoolId}}),Object.defineProperty(t,"hash",{enumerable:!0,get:function(){return a.hash}}),Object.defineProperty(t,"sign",{enumerable:!0,get:function(){return s.sign}}),Object.defineProperty(t,"verify",{enumerable:!0,get:function(){return s.verify}}),Object.defineProperty(t,"xdr",{enumerable:!0,get:function(){return i.default}});var o=L(r(1991)),i=L(r(45956)),a=r(97470),s=r(20749),u=r(33092),c=r(68141),l=r(75493),f=r(23920),d=r(20502),h=r(78618),p=r(62642),y=r(5934),m=r(56188),g=r(88347),v=r(11647),b=r(1102);Object.keys(b).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===b[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return b[e]}}))}));var w=r(51273),A=r(26961),S=r(79657),k=r(43504),_=r(88602),E=r(28295),x=r(74016),T=r(29522),P=r(60526),O=r(70714),R=r(423);Object.keys(R).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===R[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return R[e]}}))}));var I=r(86655);Object.keys(I).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===I[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return I[e]}}))}));var C=r(55625);Object.keys(C).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===C[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return C[e]}}))}));var M=r(56352);Object.keys(M).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===M[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return M[e]}}))}));var B=r(4046);Object.keys(B).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===B[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return B[e]}}))}));var N=r(62034);function L(e){return e&&e.__esModule?e:{default:e}}Object.keys(N).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===N[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return N[e]}}))})),o.default.DEBUG=!0;t.default=e.exports},62034:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildInvocationTree=function e(t){var r=t.function(),a={},s=r.value();switch(r.switch().value){case 0:a.type="execute",a.args={source:o.Address.fromScAddress(s.contractAddress()).toString(),function:s.functionName(),args:s.args().map((function(e){return(0,i.scValToNative)(e)}))};break;case 1:a.type="create",a.args={};var u=[s.executable(),s.contractIdPreimage()],c=u[0],l=u[1];if(!!c.switch().value!==!!l.switch().value)throw new Error("creation function appears invalid: ".concat(JSON.stringify(s)," (should be wasm+address or token+asset)"));switch(c.switch().value){case 0:var f=l.fromAddress();a.args.type="wasm",a.args.wasm={salt:f.salt().toString("hex"),hash:c.wasmHash().toString("hex"),address:o.Address.fromScAddress(f.address()).toString()};break;case 1:a.args.type="sac",a.args.asset=n.Asset.fromOperation(l.fromAsset()).toString();break;default:throw new Error("unknown creation type: ".concat(JSON.stringify(c)))}break;default:throw new Error("unknown invocation type (".concat(r.switch(),"): ").concat(JSON.stringify(r)))}return a.invocations=t.subInvocations().map((function(t){return e(t)})),a},t.walkInvocationTree=function(e,t){a(e,1,t)};var n=r(5934),o=r(70714),i=r(86655);function a(e,t,r,n){!1!==r(e,t,n)&&e.subInvocations().forEach((function(n){return a(n,t+1,r,e)}))}},68141:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Keypair=void 0;var n=u(r(80504)),o=r(20749),i=r(88602),a=r(97470),s=u(r(45956));function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="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},c(e)}function l(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiquidityPoolAsset=void 0;var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(5934),a=r(33092);function s(e){return s="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},s(e)}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiquidityPoolId=void 0;var n,o=(n=r(45956))&&n.__esModule?n:{default:n};function i(e){return i="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},i(e)}function a(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MemoText=t.MemoReturn=t.MemoNone=t.MemoID=t.MemoHash=t.Memo=void 0;var n=r(75493),o=a(r(1991)),i=a(r(45956));function a(e){return e&&e.__esModule?e:{default:e}}function s(e){return s="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},s(e)}function u(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:null;switch(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._type=t,this._value=r,this._type){case l:break;case f:e._validateIdValue(r);break;case d:e._validateTextValue(r);break;case h:case p:e._validateHashValue(r),"string"===typeof r&&(this._value=Buffer.from(r,"hex"));break;default:throw new Error("Invalid memo type")}}var t,r,a;return t=e,a=[{key:"_validateIdValue",value:function(e){var t,r=new Error("Expects a int64 as a string. Got ".concat(e));if("string"!==typeof e)throw r;try{t=new o.default(e)}catch(n){throw r}if(!t.isFinite())throw r;if(t.isNaN())throw r}},{key:"_validateTextValue",value:function(e){if(!i.default.Memo.armTypeForArm("text").isValid(e))throw new Error("Expects string, array or buffer, max 28 bytes")}},{key:"_validateHashValue",value:function(e){var t,r=new Error("Expects a 32 byte hash value or hex encoded string. Got ".concat(e));if(null===e||"undefined"===typeof e)throw r;if("string"===typeof e){if(!/^[0-9A-Fa-f]{64}$/g.test(e))throw r;t=Buffer.from(e,"hex")}else{if(!Buffer.isBuffer(e))throw r;t=Buffer.from(e)}if(!t.length||32!==t.length)throw r}},{key:"none",value:function(){return new e(l)}},{key:"text",value:function(t){return new e(d,t)}},{key:"id",value:function(t){return new e(f,t)}},{key:"hash",value:function(t){return new e(h,t)}},{key:"return",value:function(t){return new e(p,t)}},{key:"fromXDRObject",value:function(t){switch(t.arm()){case"id":return e.id(t.value().toString());case"text":return e.text(t.value());case"hash":return e.hash(t.value());case"retHash":return e.return(t.value())}if("undefined"===typeof t.value())return e.none();throw new Error("Unknown type")}}],(r=[{key:"type",get:function(){return this._type},set:function(e){throw new Error("Memo is immutable")}},{key:"value",get:function(){switch(this._type){case l:return null;case f:case d:return this._value;case h:case p:return Buffer.from(this._value);default:throw new Error("Invalid memo type")}},set:function(e){throw new Error("Memo is immutable")}},{key:"toXDRObject",value:function(){switch(this._type){case l:return i.default.Memo.memoNone();case f:return i.default.Memo.memoId(n.UnsignedHyper.fromString(this._value));case d:return i.default.Memo.memoText(this._value);case h:return i.default.Memo.memoHash(this._value);case p:return i.default.Memo.memoReturn(this._value);default:return null}}}])&&u(t.prototype,r),a&&u(t,a),Object.defineProperty(t,"prototype",{writable:!1}),e}()},26961:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MuxedAccount=void 0;var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(51273),a=r(88602),s=r(29522);function u(e){return u="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},u(e)}function c(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Networks=void 0;t.Networks={PUBLIC:"Public Global Stellar Network ; September 2015",TESTNET:"Test SDF Network ; September 2015",FUTURENET:"Test SDF Future Network ; October 2022",SANDBOX:"Local Sandbox Stellar Network ; September 2022",STANDALONE:"Standalone Network ; February 2017"}},423:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Int128",{enumerable:!0,get:function(){return a.Int128}}),Object.defineProperty(t,"Int256",{enumerable:!0,get:function(){return s.Int256}}),Object.defineProperty(t,"ScInt",{enumerable:!0,get:function(){return u.ScInt}}),Object.defineProperty(t,"Uint128",{enumerable:!0,get:function(){return o.Uint128}}),Object.defineProperty(t,"Uint256",{enumerable:!0,get:function(){return i.Uint256}}),Object.defineProperty(t,"XdrLargeInt",{enumerable:!0,get:function(){return n.XdrLargeInt}}),t.scValToBigInt=function(e){var t=n.XdrLargeInt.getType(e.switch().name);switch(e.switch().name){case"scvU32":case"scvI32":return BigInt(e.value());case"scvU64":case"scvI64":return new n.XdrLargeInt(t,e.value()).toBigInt();case"scvU128":case"scvI128":return new n.XdrLargeInt(t,[e.value().lo(),e.value().hi()]).toBigInt();case"scvU256":case"scvI256":return new n.XdrLargeInt(t,[e.value().loLo(),e.value().loHi(),e.value().hiLo(),e.value().hiHi()]).toBigInt();default:throw TypeError("expected integer type, got ".concat(e.switch()))}};var n=r(49643),o=r(78590),i=r(44050),a=r(77441),s=r(80037),u=r(22775)},77441:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Int128=void 0;var o=r(75493);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Int256=void 0;var o=r(75493);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.ScInt=void 0;var o=r(49643);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Uint128=void 0;var o=r(75493);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Uint256=void 0;var o=r(75493);function i(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XdrLargeInt=void 0;var n,o=r(75493),i=r(78590),a=r(44050),s=r(77441),u=r(80037),c=(n=r(45956))&&n.__esModule?n:{default:n};function l(e){return l="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},l(e)}function f(e,t){for(var r=0;rNumber.MAX_SAFE_INTEGER||e>64n),r=BigInt.asUintN(64,e);return c.default.ScVal.scvI128(new c.default.Int128Parts({hi:new c.default.Int64(t),lo:new c.default.Uint64(r)}))}},{key:"toU128",value:function(){this._sizeCheck(128);var e=this.int.toBigInt();return c.default.ScVal.scvU128(new c.default.UInt128Parts({hi:new c.default.Uint64(BigInt.asUintN(64,e>>64n)),lo:new c.default.Uint64(BigInt.asUintN(64,e))}))}},{key:"toI256",value:function(){var e=this.int.toBigInt(),t=BigInt.asIntN(64,e>>192n),r=BigInt.asUintN(64,e>>128n),n=BigInt.asUintN(64,e>>64n),o=BigInt.asUintN(64,e);return c.default.ScVal.scvI256(new c.default.Int256Parts({hiHi:new c.default.Int64(t),hiLo:new c.default.Uint64(r),loHi:new c.default.Uint64(n),loLo:new c.default.Uint64(o)}))}},{key:"toU256",value:function(){var e=this.int.toBigInt(),t=BigInt.asUintN(64,e>>192n),r=BigInt.asUintN(64,e>>128n),n=BigInt.asUintN(64,e>>64n),o=BigInt.asUintN(64,e);return c.default.ScVal.scvU256(new c.default.UInt256Parts({hiHi:new c.default.Uint64(t),hiLo:new c.default.Uint64(r),loHi:new c.default.Uint64(n),loLo:new c.default.Uint64(o)}))}},{key:"toScVal",value:function(){switch(this.type){case"i64":return this.toI64();case"i128":return this.toI128();case"i256":return this.toI256();case"u64":return this.toU64();case"u128":return this.toU128();case"u256":return this.toU256();default:throw TypeError("invalid type: ".concat(this.type))}}},{key:"valueOf",value:function(){return this.int.valueOf()}},{key:"toString",value:function(){return this.int.toString()}},{key:"toJSON",value:function(){return{value:this.toBigInt().toString(),type:this.type}}},{key:"_sizeCheck",value:function(e){if(this.int.size>e)throw RangeError("value too large for ".concat(e," bits (").concat(this.type,")"))}}])&&f(t.prototype,r),n&&f(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},11647:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Operation=t.AuthRevocableFlag=t.AuthRequiredFlag=t.AuthImmutableFlag=t.AuthClawbackEnabledFlag=void 0;var n=r(75493),o=m(r(1991)),i=r(70443),a=r(32013),s=r(5934),u=r(56188),c=r(79657),l=r(88602),f=r(88347),d=m(r(45956)),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=g(e)&&"function"!=typeof e)return{default:e};var r=y(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(17593)),p=r(29522);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(y=function(e){return e?r:t})(e)}function m(e){return e&&e.__esModule?e:{default:e}}function g(e){return g="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},g(e)}function v(e,t){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];if("string"!==typeof e)return!1;try{t=new o.default(e)}catch(n){return!1}return!(!r&&t.isZero()||t.isNegative()||t.times(w).gt(new o.default("9223372036854775807").toString())||t.decimalPlaces()>7||t.isNaN()||!t.isFinite())}},{key:"constructAmountRequirementsError",value:function(e){return"".concat(e," argument must be of type String, represent a positive number and have at most 7 digits after the decimal")}},{key:"_checkUnsignedIntValue",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("undefined"!==typeof t)switch("string"===typeof t&&(t=parseFloat(t)),!0){case"number"!==typeof t||!Number.isFinite(t)||t%1!==0:throw new Error("".concat(e," value is invalid"));case t<0:throw new Error("".concat(e," value must be unsigned"));case!r||r&&r(t,e):return t;default:throw new Error("".concat(e," value is invalid"))}}},{key:"_toXDRAmount",value:function(e){var t=new o.default(e).times(w);return n.Hyper.fromString(t.toString())}},{key:"_fromXDRAmount",value:function(e){return new o.default(e).div(w).toFixed(7)}},{key:"_fromXDRPrice",value:function(e){return new o.default(e.n()).div(new o.default(e.d())).toString()}},{key:"_toXDRPrice",value:function(e){var t;if(e.n&&e.d)t=new d.default.Price(e);else{var r=(0,a.best_r)(e);t=new d.default.Price({n:parseInt(r[0],10),d:parseInt(r[1],10)})}if(t.n()<0||t.d()<0)throw new Error("price must be positive");return t}}],(r=null)&&v(t.prototype,r),h&&v(t,h),Object.defineProperty(t,"prototype",{writable:!1}),e}());function S(e){return l.StrKey.encodeEd25519PublicKey(e.ed25519())}A.accountMerge=h.accountMerge,A.allowTrust=h.allowTrust,A.bumpSequence=h.bumpSequence,A.changeTrust=h.changeTrust,A.createAccount=h.createAccount,A.createClaimableBalance=h.createClaimableBalance,A.claimClaimableBalance=h.claimClaimableBalance,A.clawbackClaimableBalance=h.clawbackClaimableBalance,A.createPassiveSellOffer=h.createPassiveSellOffer,A.inflation=h.inflation,A.manageData=h.manageData,A.manageSellOffer=h.manageSellOffer,A.manageBuyOffer=h.manageBuyOffer,A.pathPaymentStrictReceive=h.pathPaymentStrictReceive,A.pathPaymentStrictSend=h.pathPaymentStrictSend,A.payment=h.payment,A.setOptions=h.setOptions,A.beginSponsoringFutureReserves=h.beginSponsoringFutureReserves,A.endSponsoringFutureReserves=h.endSponsoringFutureReserves,A.revokeAccountSponsorship=h.revokeAccountSponsorship,A.revokeTrustlineSponsorship=h.revokeTrustlineSponsorship,A.revokeOfferSponsorship=h.revokeOfferSponsorship,A.revokeDataSponsorship=h.revokeDataSponsorship,A.revokeClaimableBalanceSponsorship=h.revokeClaimableBalanceSponsorship,A.revokeLiquidityPoolSponsorship=h.revokeLiquidityPoolSponsorship,A.revokeSignerSponsorship=h.revokeSignerSponsorship,A.clawback=h.clawback,A.setTrustLineFlags=h.setTrustLineFlags,A.liquidityPoolDeposit=h.liquidityPoolDeposit,A.liquidityPoolWithdraw=h.liquidityPoolWithdraw,A.invokeHostFunction=h.invokeHostFunction,A.extendFootprintTtl=h.extendFootprintTtl,A.restoreFootprint=h.restoreFootprint,A.createStellarAssetContract=h.createStellarAssetContract,A.invokeContractFunction=h.invokeContractFunction,A.createCustomContract=h.createCustomContract,A.uploadContractWasm=h.uploadContractWasm},54057:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.accountMerge=function(e){var t={};try{t.body=o.default.OperationBody.accountMerge((0,i.decodeAddressToMuxedAccount)(e.destination))}catch(r){throw new Error("destination is invalid")}return this.setSourceAccount(t,e),new o.default.Operation(t)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(29522)},17197:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.allowTrust=function(e){if(!a.StrKey.isValidEd25519PublicKey(e.trustor))throw new Error("trustor is invalid");var t={};if(t.trustor=i.Keypair.fromPublicKey(e.trustor).xdrAccountId(),e.assetCode.length<=4){var r=e.assetCode.padEnd(4,"\0");t.asset=o.default.AssetCode.assetTypeCreditAlphanum4(r)}else{if(!(e.assetCode.length<=12))throw new Error("Asset code must be 12 characters at max.");var n=e.assetCode.padEnd(12,"\0");t.asset=o.default.AssetCode.assetTypeCreditAlphanum12(n)}"boolean"===typeof e.authorize?e.authorize?t.authorize=o.default.TrustLineFlags.authorizedFlag().value:t.authorize=0:t.authorize=e.authorize;var s=new o.default.AllowTrustOp(t),u={};return u.body=o.default.OperationBody.allowTrust(s),this.setSourceAccount(u,e),new o.default.Operation(u)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(68141),a=r(88602)},85959:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.beginSponsoringFutureReserves=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!i.StrKey.isValidEd25519PublicKey(e.sponsoredId))throw new Error("sponsoredId is invalid");var t=new o.default.BeginSponsoringFutureReservesOp({sponsoredId:a.Keypair.fromPublicKey(e.sponsoredId).xdrAccountId()}),r={};return r.body=o.default.OperationBody.beginSponsoringFutureReserves(t),this.setSourceAccount(r,e),new o.default.Operation(r)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(88602),a=r(68141)},83609:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bumpSequence=function(e){var t={};if("string"!==typeof e.bumpTo)throw new Error("bumpTo must be a string");try{new o.default(e.bumpTo)}catch(s){throw new Error("bumpTo must be a stringified number")}t.bumpTo=n.Hyper.fromString(e.bumpTo);var r=new i.default.BumpSequenceOp(t),a={};return a.body=i.default.OperationBody.bumpSequence(r),this.setSourceAccount(a,e),new i.default.Operation(a)};var n=r(75493),o=a(r(1991)),i=a(r(45956));function a(e){return e&&e.__esModule?e:{default:e}}},57148:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.changeTrust=function(e){var t={};if(e.asset instanceof a.Asset)t.line=e.asset.toChangeTrustXDRObject();else{if(!(e.asset instanceof s.LiquidityPoolAsset))throw new TypeError("asset must be Asset or LiquidityPoolAsset");t.line=e.asset.toXDRObject()}if(void 0!==e.limit&&!this.isValidAmount(e.limit,!0))throw new TypeError(this.constructAmountRequirementsError("limit"));e.limit?t.limit=this._toXDRAmount(e.limit):t.limit=n.Hyper.fromString(new o.default(c).toString());e.source&&(t.source=e.source.masterKeypair);var r=new i.default.ChangeTrustOp(t),u={};return u.body=i.default.OperationBody.changeTrust(r),this.setSourceAccount(u,e),new i.default.Operation(u)};var n=r(75493),o=u(r(1991)),i=u(r(45956)),a=r(5934),s=r(56188);function u(e){return e&&e.__esModule?e:{default:e}}var c="9223372036854775807"},89765:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.claimClaimableBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(e.balanceId);var t={};t.balanceId=o.default.ClaimableBalanceId.fromXDR(e.balanceId,"hex");var r=new o.default.ClaimClaimableBalanceOp(t),n={};return n.body=o.default.OperationBody.claimClaimableBalance(r),this.setSourceAccount(n,e),new o.default.Operation(n)},t.validateClaimableBalanceId=i;var n,o=(n=r(45956))&&n.__esModule?n:{default:n};function i(e){if("string"!==typeof e||72!==e.length)throw new Error("must provide a valid claimable balance id")}},64921:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clawback=function(e){var t={};if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));t.amount=this._toXDRAmount(e.amount),t.asset=e.asset.toXDRObject();try{t.from=(0,i.decodeAddressToMuxedAccount)(e.from)}catch(n){throw new Error("from address is invalid")}var r={body:o.default.OperationBody.clawback(new o.default.ClawbackOp(t))};return this.setSourceAccount(r,e),new o.default.Operation(r)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(29522)},2597:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clawbackClaimableBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.validateClaimableBalanceId)(e.balanceId);var t={balanceId:o.default.ClaimableBalanceId.fromXDR(e.balanceId,"hex")},r={body:o.default.OperationBody.clawbackClaimableBalance(new o.default.ClawbackClaimableBalanceOp(t))};return this.setSourceAccount(r,e),new o.default.Operation(r)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(89765)},63697:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAccount=function(e){if(!a.StrKey.isValidEd25519PublicKey(e.destination))throw new Error("destination is invalid");if(!this.isValidAmount(e.startingBalance,!0))throw new TypeError(this.constructAmountRequirementsError("startingBalance"));var t={};t.destination=i.Keypair.fromPublicKey(e.destination).xdrAccountId(),t.startingBalance=this._toXDRAmount(e.startingBalance);var r=new o.default.CreateAccountOp(t),n={};return n.body=o.default.OperationBody.createAccount(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(68141),a=r(88602)},83837:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createClaimableBalance=function(e){if(!(e.asset instanceof i.Asset))throw new Error("must provide an asset for create claimable balance operation");if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(!Array.isArray(e.claimants)||0===e.claimants.length)throw new Error("must provide at least one claimant");var t={};t.asset=e.asset.toXDRObject(),t.amount=this._toXDRAmount(e.amount),t.claimants=Object.values(e.claimants).map((function(e){return e.toXDRObject()}));var r=new o.default.CreateClaimableBalanceOp(t),n={};return n.body=o.default.OperationBody.createClaimableBalance(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(5934)},71667:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPassiveSellOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price);var r=new o.default.CreatePassiveSellOfferOp(t),n={};return n.body=o.default.OperationBody.createPassiveSellOffer(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n}},58687:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.endSponsoringFutureReserves=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return t.body=o.default.OperationBody.endSponsoringFutureReserves(),this.setSourceAccount(t,e),new o.default.Operation(t)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n}},69370:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendFootprintTtl=function(e){var t;if((null!==(t=e.extendTo)&&void 0!==t?t:-1)<=0)throw new RangeError("extendTo isn't a ledger quantity (uint32)");var r=new o.default.ExtendFootprintTtlOp({ext:new o.default.ExtensionPoint(0),extendTo:e.extendTo}),n={body:o.default.OperationBody.extendFootprintTtl(r)};return this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n}},17593:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"accountMerge",{enumerable:!0,get:function(){return i.accountMerge}}),Object.defineProperty(t,"allowTrust",{enumerable:!0,get:function(){return a.allowTrust}}),Object.defineProperty(t,"beginSponsoringFutureReserves",{enumerable:!0,get:function(){return w.beginSponsoringFutureReserves}}),Object.defineProperty(t,"bumpSequence",{enumerable:!0,get:function(){return s.bumpSequence}}),Object.defineProperty(t,"changeTrust",{enumerable:!0,get:function(){return u.changeTrust}}),Object.defineProperty(t,"claimClaimableBalance",{enumerable:!0,get:function(){return f.claimClaimableBalance}}),Object.defineProperty(t,"clawback",{enumerable:!0,get:function(){return k.clawback}}),Object.defineProperty(t,"clawbackClaimableBalance",{enumerable:!0,get:function(){return d.clawbackClaimableBalance}}),Object.defineProperty(t,"createAccount",{enumerable:!0,get:function(){return c.createAccount}}),Object.defineProperty(t,"createClaimableBalance",{enumerable:!0,get:function(){return l.createClaimableBalance}}),Object.defineProperty(t,"createCustomContract",{enumerable:!0,get:function(){return T.createCustomContract}}),Object.defineProperty(t,"createPassiveSellOffer",{enumerable:!0,get:function(){return o.createPassiveSellOffer}}),Object.defineProperty(t,"createStellarAssetContract",{enumerable:!0,get:function(){return T.createStellarAssetContract}}),Object.defineProperty(t,"endSponsoringFutureReserves",{enumerable:!0,get:function(){return A.endSponsoringFutureReserves}}),Object.defineProperty(t,"extendFootprintTtl",{enumerable:!0,get:function(){return P.extendFootprintTtl}}),Object.defineProperty(t,"inflation",{enumerable:!0,get:function(){return h.inflation}}),Object.defineProperty(t,"invokeContractFunction",{enumerable:!0,get:function(){return T.invokeContractFunction}}),Object.defineProperty(t,"invokeHostFunction",{enumerable:!0,get:function(){return T.invokeHostFunction}}),Object.defineProperty(t,"liquidityPoolDeposit",{enumerable:!0,get:function(){return E.liquidityPoolDeposit}}),Object.defineProperty(t,"liquidityPoolWithdraw",{enumerable:!0,get:function(){return x.liquidityPoolWithdraw}}),Object.defineProperty(t,"manageBuyOffer",{enumerable:!0,get:function(){return y.manageBuyOffer}}),Object.defineProperty(t,"manageData",{enumerable:!0,get:function(){return p.manageData}}),Object.defineProperty(t,"manageSellOffer",{enumerable:!0,get:function(){return n.manageSellOffer}}),Object.defineProperty(t,"pathPaymentStrictReceive",{enumerable:!0,get:function(){return m.pathPaymentStrictReceive}}),Object.defineProperty(t,"pathPaymentStrictSend",{enumerable:!0,get:function(){return g.pathPaymentStrictSend}}),Object.defineProperty(t,"payment",{enumerable:!0,get:function(){return v.payment}}),Object.defineProperty(t,"restoreFootprint",{enumerable:!0,get:function(){return O.restoreFootprint}}),Object.defineProperty(t,"revokeAccountSponsorship",{enumerable:!0,get:function(){return S.revokeAccountSponsorship}}),Object.defineProperty(t,"revokeClaimableBalanceSponsorship",{enumerable:!0,get:function(){return S.revokeClaimableBalanceSponsorship}}),Object.defineProperty(t,"revokeDataSponsorship",{enumerable:!0,get:function(){return S.revokeDataSponsorship}}),Object.defineProperty(t,"revokeLiquidityPoolSponsorship",{enumerable:!0,get:function(){return S.revokeLiquidityPoolSponsorship}}),Object.defineProperty(t,"revokeOfferSponsorship",{enumerable:!0,get:function(){return S.revokeOfferSponsorship}}),Object.defineProperty(t,"revokeSignerSponsorship",{enumerable:!0,get:function(){return S.revokeSignerSponsorship}}),Object.defineProperty(t,"revokeTrustlineSponsorship",{enumerable:!0,get:function(){return S.revokeTrustlineSponsorship}}),Object.defineProperty(t,"setOptions",{enumerable:!0,get:function(){return b.setOptions}}),Object.defineProperty(t,"setTrustLineFlags",{enumerable:!0,get:function(){return _.setTrustLineFlags}}),Object.defineProperty(t,"uploadContractWasm",{enumerable:!0,get:function(){return T.uploadContractWasm}});var n=r(93752),o=r(71667),i=r(54057),a=r(17197),s=r(83609),u=r(57148),c=r(63697),l=r(83837),f=r(89765),d=r(2597),h=r(24787),p=r(23637),y=r(53264),m=r(10921),g=r(34592),v=r(92423),b=r(16048),w=r(85959),A=r(58687),S=r(11912),k=r(64921),_=r(48094),E=r(1519),x=r(59619),T=r(45729),P=r(69370),O=r(74819)},24787:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inflation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return t.body=o.default.OperationBody.inflation(),this.setSourceAccount(t,e),new o.default.Operation(t)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n}},45729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCustomContract=function(e){var t=Buffer.from(e.salt||i.Keypair.random().xdrPublicKey().value());if(!e.wasmHash||32!==e.wasmHash.length)throw new TypeError("expected hash(contract WASM) in 'opts.wasmHash', got ".concat(e.wasmHash));if(32!==t.length)throw new TypeError("expected 32-byte salt in 'opts.salt', got ".concat(e.wasmHash));return this.invokeHostFunction({source:e.source,auth:e.auth,func:o.default.HostFunction.hostFunctionTypeCreateContract(new o.default.CreateContractArgs({executable:o.default.ContractExecutable.contractExecutableWasm(Buffer.from(e.wasmHash)),contractIdPreimage:o.default.ContractIdPreimage.contractIdPreimageFromAddress(new o.default.ContractIdPreimageFromAddress({address:e.address.toScAddress(),salt:t}))}))})},t.createStellarAssetContract=function(e){var t=e.asset;if("string"===typeof t){var r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t.split(":"),2),n=r[0],i=r[1];t=new s.Asset(n,i)}if(!(t instanceof s.Asset))throw new TypeError("expected Asset in 'opts.asset', got ".concat(t));return this.invokeHostFunction({source:e.source,auth:e.auth,func:o.default.HostFunction.hostFunctionTypeCreateContract(new o.default.CreateContractArgs({executable:o.default.ContractExecutable.contractExecutableStellarAsset(),contractIdPreimage:o.default.ContractIdPreimage.contractIdPreimageFromAsset(t.toXDRObject())}))})},t.invokeContractFunction=function(e){var t=new a.Address(e.contract);if("contract"!==t._type)throw new TypeError("expected contract strkey instance, got ".concat(t));return this.invokeHostFunction({source:e.source,auth:e.auth,func:o.default.HostFunction.hostFunctionTypeInvokeContract(new o.default.InvokeContractArgs({contractAddress:t.toScAddress(),functionName:e.function,args:e.args}))})},t.invokeHostFunction=function(e){if(!e.func)throw new TypeError("host function invocation ('func') required (got ".concat(JSON.stringify(e),")"));var t=new o.default.InvokeHostFunctionOp({hostFunction:e.func,auth:e.auth||[]}),r={body:o.default.OperationBody.invokeHostFunction(t)};return this.setSourceAccount(r,e),new o.default.Operation(r)},t.uploadContractWasm=function(e){return this.invokeHostFunction({source:e.source,auth:e.auth,func:o.default.HostFunction.hostFunctionTypeUploadContractWasm(Buffer.from(e.wasm))})};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(68141),a=r(70714),s=r(5934);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.liquidityPoolDeposit=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.liquidityPoolId,r=e.maxAmountA,n=e.maxAmountB,i=e.minPrice,a=e.maxPrice,s={};if(!t)throw new TypeError("liquidityPoolId argument is required");if(s.liquidityPoolId=o.default.PoolId.fromXDR(t,"hex"),!this.isValidAmount(r,!0))throw new TypeError(this.constructAmountRequirementsError("maxAmountA"));if(s.maxAmountA=this._toXDRAmount(r),!this.isValidAmount(n,!0))throw new TypeError(this.constructAmountRequirementsError("maxAmountB"));if(s.maxAmountB=this._toXDRAmount(n),void 0===i)throw new TypeError("minPrice argument is required");if(s.minPrice=this._toXDRPrice(i),void 0===a)throw new TypeError("maxPrice argument is required");s.maxPrice=this._toXDRPrice(a);var u=new o.default.LiquidityPoolDepositOp(s),c={body:o.default.OperationBody.liquidityPoolDeposit(u)};return this.setSourceAccount(c,e),new o.default.Operation(c)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n}},59619:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.liquidityPoolWithdraw=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};if(!e.liquidityPoolId)throw new TypeError("liquidityPoolId argument is required");if(t.liquidityPoolId=o.default.PoolId.fromXDR(e.liquidityPoolId,"hex"),!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),!this.isValidAmount(e.minAmountA,!0))throw new TypeError(this.constructAmountRequirementsError("minAmountA"));if(t.minAmountA=this._toXDRAmount(e.minAmountA),!this.isValidAmount(e.minAmountB,!0))throw new TypeError(this.constructAmountRequirementsError("minAmountB"));t.minAmountB=this._toXDRAmount(e.minAmountB);var r=new o.default.LiquidityPoolWithdrawOp(t),n={body:o.default.OperationBody.liquidityPoolWithdraw(r)};return this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n}},53264:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.manageBuyOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.buyAmount,!0))throw new TypeError(this.constructAmountRequirementsError("buyAmount"));if(t.buyAmount=this._toXDRAmount(e.buyAmount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price),void 0!==e.offerId?e.offerId=e.offerId.toString():e.offerId="0";t.offerId=o.Hyper.fromString(e.offerId);var r=new i.default.ManageBuyOfferOp(t),n={};return n.body=i.default.OperationBody.manageBuyOffer(r),this.setSourceAccount(n,e),new i.default.Operation(n)};var n,o=r(75493),i=(n=r(45956))&&n.__esModule?n:{default:n}},23637:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.manageData=function(e){var t={};if(!("string"===typeof e.name&&e.name.length<=64))throw new Error("name must be a string, up to 64 characters");if(t.dataName=e.name,"string"!==typeof e.value&&!Buffer.isBuffer(e.value)&&null!==e.value)throw new Error("value must be a string, Buffer or null");"string"===typeof e.value?t.dataValue=Buffer.from(e.value):t.dataValue=e.value;if(null!==t.dataValue&&t.dataValue.length>64)throw new Error("value cannot be longer that 64 bytes");var r=new o.default.ManageDataOp(t),n={};return n.body=o.default.OperationBody.manageData(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n}},93752:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.manageSellOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.amount,!0))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price),void 0!==e.offerId?e.offerId=e.offerId.toString():e.offerId="0";t.offerId=o.Hyper.fromString(e.offerId);var r=new i.default.ManageSellOfferOp(t),n={};return n.body=i.default.OperationBody.manageSellOffer(r),this.setSourceAccount(n,e),new i.default.Operation(n)};var n,o=r(75493),i=(n=r(45956))&&n.__esModule?n:{default:n}},10921:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pathPaymentStrictReceive=function(e){switch(!0){case!e.sendAsset:throw new Error("Must specify a send asset");case!this.isValidAmount(e.sendMax):throw new TypeError(this.constructAmountRequirementsError("sendMax"));case!e.destAsset:throw new Error("Must provide a destAsset for a payment operation");case!this.isValidAmount(e.destAmount):throw new TypeError(this.constructAmountRequirementsError("destAmount"))}var t={};t.sendAsset=e.sendAsset.toXDRObject(),t.sendMax=this._toXDRAmount(e.sendMax);try{t.destination=(0,i.decodeAddressToMuxedAccount)(e.destination)}catch(s){throw new Error("destination is invalid")}t.destAsset=e.destAsset.toXDRObject(),t.destAmount=this._toXDRAmount(e.destAmount);var r=e.path?e.path:[];t.path=r.map((function(e){return e.toXDRObject()}));var n=new o.default.PathPaymentStrictReceiveOp(t),a={};return a.body=o.default.OperationBody.pathPaymentStrictReceive(n),this.setSourceAccount(a,e),new o.default.Operation(a)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(29522)},34592:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pathPaymentStrictSend=function(e){switch(!0){case!e.sendAsset:throw new Error("Must specify a send asset");case!this.isValidAmount(e.sendAmount):throw new TypeError(this.constructAmountRequirementsError("sendAmount"));case!e.destAsset:throw new Error("Must provide a destAsset for a payment operation");case!this.isValidAmount(e.destMin):throw new TypeError(this.constructAmountRequirementsError("destMin"))}var t={};t.sendAsset=e.sendAsset.toXDRObject(),t.sendAmount=this._toXDRAmount(e.sendAmount);try{t.destination=(0,i.decodeAddressToMuxedAccount)(e.destination)}catch(s){throw new Error("destination is invalid")}t.destAsset=e.destAsset.toXDRObject(),t.destMin=this._toXDRAmount(e.destMin);var r=e.path?e.path:[];t.path=r.map((function(e){return e.toXDRObject()}));var n=new o.default.PathPaymentStrictSendOp(t),a={};return a.body=o.default.OperationBody.pathPaymentStrictSend(n),this.setSourceAccount(a,e),new o.default.Operation(a)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(29522)},92423:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.payment=function(e){if(!e.asset)throw new Error("Must provide an asset for a payment operation");if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));var t={};try{t.destination=(0,i.decodeAddressToMuxedAccount)(e.destination)}catch(a){throw new Error("destination is invalid")}t.asset=e.asset.toXDRObject(),t.amount=this._toXDRAmount(e.amount);var r=new o.default.PaymentOp(t),n={};return n.body=o.default.OperationBody.payment(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(29522)},74819:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.restoreFootprint=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new o.default.RestoreFootprintOp({ext:new o.default.ExtensionPoint(0)}),r={body:o.default.OperationBody.restoreFootprint(t)};return this.setSourceAccount(r,null!==e&&void 0!==e?e:{}),new o.default.Operation(r)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n}},11912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.revokeAccountSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!i.StrKey.isValidEd25519PublicKey(e.account))throw new Error("account is invalid");var t=o.default.LedgerKey.account(new o.default.LedgerKeyAccount({accountId:a.Keypair.fromPublicKey(e.account).xdrAccountId()})),r=o.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=o.default.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new o.default.Operation(n)},t.revokeClaimableBalanceSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"!==typeof e.balanceId)throw new Error("balanceId is invalid");var t=o.default.LedgerKey.claimableBalance(new o.default.LedgerKeyClaimableBalance({balanceId:o.default.ClaimableBalanceId.fromXDR(e.balanceId,"hex")})),r=o.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=o.default.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new o.default.Operation(n)},t.revokeDataSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!i.StrKey.isValidEd25519PublicKey(e.account))throw new Error("account is invalid");if("string"!==typeof e.name||e.name.length>64)throw new Error("name must be a string, up to 64 characters");var t=o.default.LedgerKey.data(new o.default.LedgerKeyData({accountId:a.Keypair.fromPublicKey(e.account).xdrAccountId(),dataName:e.name})),r=o.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=o.default.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new o.default.Operation(n)},t.revokeLiquidityPoolSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"!==typeof e.liquidityPoolId)throw new Error("liquidityPoolId is invalid");var t=o.default.LedgerKey.liquidityPool(new o.default.LedgerKeyLiquidityPool({liquidityPoolId:o.default.PoolId.fromXDR(e.liquidityPoolId,"hex")})),r=o.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={body:o.default.OperationBody.revokeSponsorship(r)};return this.setSourceAccount(n,e),new o.default.Operation(n)},t.revokeOfferSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!i.StrKey.isValidEd25519PublicKey(e.seller))throw new Error("seller is invalid");if("string"!==typeof e.offerId)throw new Error("offerId is invalid");var t=o.default.LedgerKey.offer(new o.default.LedgerKeyOffer({sellerId:a.Keypair.fromPublicKey(e.seller).xdrAccountId(),offerId:o.default.Int64.fromString(e.offerId)})),r=o.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=o.default.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new o.default.Operation(n)},t.revokeSignerSponsorship=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!i.StrKey.isValidEd25519PublicKey(t.account))throw new Error("account is invalid");if(t.signer.ed25519PublicKey){if(!i.StrKey.isValidEd25519PublicKey(t.signer.ed25519PublicKey))throw new Error("signer.ed25519PublicKey is invalid.");var r=i.StrKey.decodeEd25519PublicKey(t.signer.ed25519PublicKey);e=new o.default.SignerKey.signerKeyTypeEd25519(r)}else if(t.signer.preAuthTx){var n;if(n="string"===typeof t.signer.preAuthTx?Buffer.from(t.signer.preAuthTx,"hex"):t.signer.preAuthTx,!Buffer.isBuffer(n)||32!==n.length)throw new Error("signer.preAuthTx must be 32 bytes Buffer.");e=new o.default.SignerKey.signerKeyTypePreAuthTx(n)}else{if(!t.signer.sha256Hash)throw new Error("signer is invalid");var s;if(s="string"===typeof t.signer.sha256Hash?Buffer.from(t.signer.sha256Hash,"hex"):t.signer.sha256Hash,!Buffer.isBuffer(s)||32!==s.length)throw new Error("signer.sha256Hash must be 32 bytes Buffer.");e=new o.default.SignerKey.signerKeyTypeHashX(s)}var u=new o.default.RevokeSponsorshipOpSigner({accountId:a.Keypair.fromPublicKey(t.account).xdrAccountId(),signerKey:e}),c=o.default.RevokeSponsorshipOp.revokeSponsorshipSigner(u),l={};return l.body=o.default.OperationBody.revokeSponsorship(c),this.setSourceAccount(l,t),new o.default.Operation(l)},t.revokeTrustlineSponsorship=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!i.StrKey.isValidEd25519PublicKey(t.account))throw new Error("account is invalid");if(t.asset instanceof s.Asset)e=t.asset.toTrustLineXDRObject();else{if(!(t.asset instanceof u.LiquidityPoolId))throw new TypeError("asset must be an Asset or LiquidityPoolId");e=t.asset.toXDRObject()}var r=o.default.LedgerKey.trustline(new o.default.LedgerKeyTrustLine({accountId:a.Keypair.fromPublicKey(t.account).xdrAccountId(),asset:e})),n=o.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(r),c={};return c.body=o.default.OperationBody.revokeSponsorship(n),this.setSourceAccount(c,t),new o.default.Operation(c)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(88602),a=r(68141),s=r(5934),u=r(88347)},16048:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setOptions=function(e){var t={};if(e.inflationDest){if(!a.StrKey.isValidEd25519PublicKey(e.inflationDest))throw new Error("inflationDest is invalid");t.inflationDest=i.Keypair.fromPublicKey(e.inflationDest).xdrAccountId()}if(t.clearFlags=this._checkUnsignedIntValue("clearFlags",e.clearFlags),t.setFlags=this._checkUnsignedIntValue("setFlags",e.setFlags),t.masterWeight=this._checkUnsignedIntValue("masterWeight",e.masterWeight,s),t.lowThreshold=this._checkUnsignedIntValue("lowThreshold",e.lowThreshold,s),t.medThreshold=this._checkUnsignedIntValue("medThreshold",e.medThreshold,s),t.highThreshold=this._checkUnsignedIntValue("highThreshold",e.highThreshold,s),void 0!==e.homeDomain&&"string"!==typeof e.homeDomain)throw new TypeError("homeDomain argument must be of type String");if(t.homeDomain=e.homeDomain,e.signer){var r,n=this._checkUnsignedIntValue("signer.weight",e.signer.weight,s),u=0;if(e.signer.ed25519PublicKey){if(!a.StrKey.isValidEd25519PublicKey(e.signer.ed25519PublicKey))throw new Error("signer.ed25519PublicKey is invalid.");var c=a.StrKey.decodeEd25519PublicKey(e.signer.ed25519PublicKey);r=new o.default.SignerKey.signerKeyTypeEd25519(c),u+=1}if(e.signer.preAuthTx){if("string"===typeof e.signer.preAuthTx&&(e.signer.preAuthTx=Buffer.from(e.signer.preAuthTx,"hex")),!Buffer.isBuffer(e.signer.preAuthTx)||32!==e.signer.preAuthTx.length)throw new Error("signer.preAuthTx must be 32 bytes Buffer.");r=new o.default.SignerKey.signerKeyTypePreAuthTx(e.signer.preAuthTx),u+=1}if(e.signer.sha256Hash){if("string"===typeof e.signer.sha256Hash&&(e.signer.sha256Hash=Buffer.from(e.signer.sha256Hash,"hex")),!Buffer.isBuffer(e.signer.sha256Hash)||32!==e.signer.sha256Hash.length)throw new Error("signer.sha256Hash must be 32 bytes Buffer.");r=new o.default.SignerKey.signerKeyTypeHashX(e.signer.sha256Hash),u+=1}if(e.signer.ed25519SignedPayload){if(!a.StrKey.isValidSignedPayload(e.signer.ed25519SignedPayload))throw new Error("signer.ed25519SignedPayload is invalid.");var l=a.StrKey.decodeSignedPayload(e.signer.ed25519SignedPayload),f=o.default.SignerKeyEd25519SignedPayload.fromXDR(l);r=o.default.SignerKey.signerKeyTypeEd25519SignedPayload(f),u+=1}if(1!==u)throw new Error("Signer object must contain exactly one of signer.ed25519PublicKey, signer.sha256Hash, signer.preAuthTx.");t.signer=new o.default.Signer({key:r,weight:n})}var d=new o.default.SetOptionsOp(t),h={};return h.body=o.default.OperationBody.setOptions(d),this.setSourceAccount(h,e),new o.default.Operation(h)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(68141),a=r(88602);function s(e,t){if(e>=0&&e<=255)return!0;throw new Error("".concat(t," value must be between 0 and 255"))}},48094:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setTrustLineFlags=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};if("object"!==a(e.flags)||0===Object.keys(e.flags).length)throw new Error("opts.flags must be a map of boolean flags to modify");var r={authorized:o.default.TrustLineFlags.authorizedFlag(),authorizedToMaintainLiabilities:o.default.TrustLineFlags.authorizedToMaintainLiabilitiesFlag(),clawbackEnabled:o.default.TrustLineFlags.trustlineClawbackEnabledFlag()},n=0,s=0;Object.keys(e.flags).forEach((function(t){if(!Object.prototype.hasOwnProperty.call(r,t))throw new Error("unsupported flag name specified: ".concat(t));var o=e.flags[t],i=r[t].value;!0===o?s|=i:!1===o&&(n|=i)})),t.trustor=i.Keypair.fromPublicKey(e.trustor).xdrAccountId(),t.asset=e.asset.toXDRObject(),t.clearFlags=n,t.setFlags=s;var u={body:o.default.OperationBody.setTrustLineFlags(new o.default.SetTrustLineFlagsOp(t))};return this.setSourceAccount(u,e),new o.default.Operation(u)};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(68141);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)}},86655:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nativeToScVal=function e(t){var r,n,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(l(t)){case"object":if(null===t)return o.default.ScVal.scvVoid();if(t instanceof o.default.ScVal)return t;if(t instanceof i.Address)return t.toScVal();if(t instanceof a.Contract)return t.address().toScVal();if(t instanceof Uint8Array||Buffer.isBuffer(t)){var f,d=Uint8Array.from(t);switch(null!==(f=null===c||void 0===c?void 0:c.type)&&void 0!==f?f:"bytes"){case"bytes":return o.default.ScVal.scvBytes(d);case"symbol":return o.default.ScVal.scvSymbol(d);case"string":return o.default.ScVal.scvString(d);default:throw new TypeError("invalid type (".concat(c.type,") specified for bytes-like value"))}}if(Array.isArray(t)){if(t.length>0&&t.some((function(e){return l(e)!==l(t[0])})))throw new TypeError("array values (".concat(t,") must have the same type (types: ").concat(t.map((function(e){return l(e)})).join(","),")"));return o.default.ScVal.scvVec(t.map((function(t){return e(t,c)})))}var h;if("Object"!==(null!==(r=null===(n=t.constructor)||void 0===n?void 0:n.name)&&void 0!==r?r:""))throw new TypeError("cannot interpret ".concat(null===(h=t.constructor)||void 0===h?void 0:h.name," value as ScVal (").concat(JSON.stringify(t),")"));return o.default.ScVal.scvMap(Object.entries(t).map((function(t){var r,n,i=u(t,2),a=i[0],s=i[1],l=u(null!==(r=(null!==(n=null===c||void 0===c?void 0:c.type)&&void 0!==n?n:{})[a])&&void 0!==r?r:[null,null],2),f=l[0],d=l[1],h=f?{type:f}:{},p=d?{type:d}:{};return new o.default.ScMapEntry({key:e(a,h),val:e(s,p)})})));case"number":case"bigint":switch(null===c||void 0===c?void 0:c.type){case"u32":return o.default.ScVal.scvU32(t);case"i32":return o.default.ScVal.scvI32(t)}return new s.ScInt(t,{type:null===c||void 0===c?void 0:c.type}).toScVal();case"string":var p,y=null!==(p=null===c||void 0===c?void 0:c.type)&&void 0!==p?p:"string";switch(y){case"string":return o.default.ScVal.scvString(t);case"symbol":return o.default.ScVal.scvSymbol(t);case"address":return new i.Address(t).toScVal();default:if(s.XdrLargeInt.isType(y))return new s.XdrLargeInt(y,t).toScVal();throw new TypeError("invalid type (".concat(c.type,") specified for string value"))}case"boolean":return o.default.ScVal.scvBool(t);case"undefined":return o.default.ScVal.scvVoid();case"function":return e(t());default:throw new TypeError("failed to convert typeof ".concat(l(t)," (").concat(t,")"))}},t.scValToNative=function e(t){var r,n;switch(t.switch().value){case o.default.ScValType.scvVoid().value:return null;case o.default.ScValType.scvU64().value:case o.default.ScValType.scvI64().value:return t.value().toBigInt();case o.default.ScValType.scvU128().value:case o.default.ScValType.scvI128().value:case o.default.ScValType.scvU256().value:case o.default.ScValType.scvI256().value:return(0,s.scValToBigInt)(t);case o.default.ScValType.scvVec().value:return(null!==(r=t.vec())&&void 0!==r?r:[]).map(e);case o.default.ScValType.scvAddress().value:return i.Address.fromScVal(t).toString();case o.default.ScValType.scvMap().value:return Object.fromEntries((null!==(n=t.map())&&void 0!==n?n:[]).map((function(t){return[e(t.key()),e(t.val())]})));case o.default.ScValType.scvBool().value:case o.default.ScValType.scvU32().value:case o.default.ScValType.scvI32().value:case o.default.ScValType.scvBytes().value:return t.value();case o.default.ScValType.scvSymbol().value:case o.default.ScValType.scvString().value:var a=t.value();if(Buffer.isBuffer(a)||ArrayBuffer.isView(a))try{return(new TextDecoder).decode(a)}catch(u){return new Uint8Array(a.buffer)}return a;case o.default.ScValType.scvTimepoint().value:case o.default.ScValType.scvDuration().value:return new o.default.Uint64(t.value()).toBigInt();case o.default.ScValType.scvStatus().value:switch(t.value().switch()){case o.default.ScStatusType.sstOk().value:case o.default.ScStatusType.sstUnknownError().value:case o.default.ScStatusType.sstHostValueError().value:case o.default.ScStatusType.sstHostObjectError().value:case o.default.ScStatusType.sstHostFunctionError().value:case o.default.ScStatusType.sstHostStorageError().value:case o.default.ScStatusType.sstHostContextError().value:case o.default.ScStatusType.sstVmError().value:case o.default.ScStatusType.sstContractError().value:case o.default.ScStatusType.sstHostAuthError().value:}default:return t.value()}};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(70714),a=r(60526),s=r(423);function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignerKey=void 0;var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(88602);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 s(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FastSigning=void 0,t.generate=function(e){return n.generate(e)},t.sign=function(e,t){return n.sign(e,t)},t.verify=function(e,t,r){return n.verify(e,t,r)};var n={};t.FastSigning="undefined"===typeof window?function(){var e;try{e=r(98310)}catch(t){return o()}return Object.keys(e).length?(n.generate=function(t){var r=Buffer.alloc(e.crypto_sign_PUBLICKEYBYTES),n=Buffer.alloc(e.crypto_sign_SECRETKEYBYTES);return e.crypto_sign_seed_keypair(r,n,t),r},n.sign=function(t,r){t=Buffer.from(t);var n=Buffer.alloc(e.crypto_sign_BYTES);return e.crypto_sign_detached(n,t,r),n},n.verify=function(t,r,n){t=Buffer.from(t);try{return e.crypto_sign_verify_detached(r,t,n)}catch(o){return!1}},!0):o()}():o();function o(){var e=r(80504);return n.generate=function(t){var r=new Uint8Array(t),n=e.sign.keyPair.fromSeed(r);return Buffer.from(n.publicKey)},n.sign=function(t,r){t=Buffer.from(t),t=new Uint8Array(t.toJSON().data),r=new Uint8Array(r.toJSON().data);var n=e.sign.detached(t,r);return Buffer.from(n)},n.verify=function(t,r,n){return t=Buffer.from(t),t=new Uint8Array(t.toJSON().data),r=new Uint8Array(r.toJSON().data),n=new Uint8Array(n.toJSON().data),e.sign.detached.verify(t,r,n)},!1}},74016:(e,t)=>{"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)}function n(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(r=t>r.length?["0",r.toString().padStart(t,"0")].join("."):[r.slice(0,-t),r.slice(-t)].join(".")),r.replace(/(\.\d*?)0+$/,"$1")}},{key:"parseTokenAmount",value:function(e,t){var r,o=n(e.split(".").slice()),i=o[0],a=o[1];if(o.slice(2).length)throw new Error("Invalid decimal value: ".concat(e));return BigInt(i+(null!==(r=null===a||void 0===a?void 0:a.padEnd(t,"0"))&&void 0!==r?r:"0".repeat(t))).toString()}}],(r=null)&&i(t.prototype,r),o&&i(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}()},56352:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SorobanDataBuilder=void 0;var n,o=(n=r(45956))&&n.__esModule?n:{default:n};function i(e){return i="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},i(e)}function a(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StrKey=void 0,t.decodeCheck=d,t.encodeCheck=h;var n,o=(n=r(47149))&&n.__esModule?n:{default:n},i=r(36960);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 s(e,t){for(var r=0;r165)return!1;break;default:return!1}var r="";try{r=d(e,t)}catch(n){return!1}switch(e){case"ed25519PublicKey":case"ed25519SecretSeed":case"preAuthTx":case"sha256Hash":case"contract":return 32===r.length;case"med25519PublicKey":return 40===r.length;case"signedPayload":return r.length>=40&&r.length<=100;default:return!1}}function d(e,t){if("string"!==typeof t)throw new TypeError("encoded argument must be of type String");var r=o.default.decode(t),n=r[0],a=r.slice(0,-2),s=a.slice(1),u=r.slice(-2);if(t!==o.default.encode(r))throw new Error("invalid encoded string");var l=c[e];if(void 0===l)throw new Error("".concat(e," is not a valid version byte name. ")+"Expected one of ".concat(Object.keys(c).join(", ")));if(n!==l)throw new Error("invalid version byte. expected ".concat(l,", got ").concat(n));var f=p(a);if(!(0,i.verifyChecksum)(f,u))throw new Error("invalid checksum");return Buffer.from(s)}function h(e,t){if(null===t||void 0===t)throw new Error("cannot encode null data");var r=c[e];if(void 0===r)throw new Error("".concat(e," is not a valid version byte name. ")+"Expected one of ".concat(Object.keys(c).join(", ")));t=Buffer.from(t);var n=Buffer.from([r]),i=Buffer.concat([n,t]),a=p(i),s=Buffer.concat([i,a]);return o.default.encode(s)}function p(e){for(var t=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920],r=0,n=0;n>8^e[n]],r&=65535}var o=new Uint8Array(2);return o[0]=255&r,o[1]=r>>8&255,o}},20502:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=void 0;var o,i=(o=r(45956))&&o.__esModule?o:{default:o},a=r(97470),s=r(88602),u=r(11647),c=r(1102),l=r(23920),f=r(29522);function d(e,t){for(var r=0;r=this.operations.length)throw new RangeError("invalid operation index");var t=this.operations[e];try{t=u.Operation.createClaimableBalance(t)}catch(c){throw new TypeError("expected createClaimableBalance, got ".concat(t.type,": ").concat(c))}var r=s.StrKey.decodeEd25519PublicKey((0,f.extractBaseAddress)(this.source)),n=i.default.HashIdPreimage.envelopeTypeOpId(new i.default.HashIdPreimageOperationId({sourceAccount:i.default.AccountId.publicKeyTypeEd25519(r),seqNum:i.default.SequenceNumber.fromString(this.sequence),opNum:e})),o=(0,a.hash)(n.toXDR("raw"));return i.default.ClaimableBalanceId.claimableBalanceIdTypeV0(o).toXDR("hex")}}])&&d(t.prototype,r),n&&d(t,n),Object.defineProperty(t,"prototype",{writable:!1}),l}(l.TransactionBase)},23920:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionBase=void 0;var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(97470),a=r(68141);function s(e){return s="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},s(e)}function u(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!n||"string"!==typeof n)throw new Error("Invalid signature");if(!r||"string"!==typeof r)throw new Error("Invalid publicKey");var i=Buffer.from(n,"base64");try{t=(e=a.Keypair.fromPublicKey(r)).signatureHint()}catch(s){throw new Error("Invalid publicKey")}if(!e.verify(this.hash(),i))throw new Error("Invalid signature");this.signatures.push(new o.default.DecoratedSignature({hint:t,signature:i}))}},{key:"addDecoratedSignature",value:function(e){this.signatures.push(e)}},{key:"signHashX",value:function(e){if("string"===typeof e&&(e=Buffer.from(e,"hex")),e.length>64)throw new Error("preimage cannnot be longer than 64 bytes");var t=e,r=(0,i.hash)(e),n=r.slice(r.length-4);this.signatures.push(new o.default.DecoratedSignature({hint:n,signature:t}))}},{key:"hash",value:function(){return(0,i.hash)(this.signatureBase())}},{key:"signatureBase",value:function(){throw new Error("Implement in subclass")}},{key:"toEnvelope",value:function(){throw new Error("Implement in subclass")}},{key:"toXDR",value:function(){return this.toEnvelope().toXDR().toString("base64")}}],r&&u(t.prototype,r),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},62642:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionBuilder=t.TimeoutInfinite=t.BASE_FEE=void 0,t.isValidDate=E;var n=r(75493),o=y(r(1991)),i=y(r(45956)),a=r(51273),s=r(26961),u=r(29522),c=r(20502),l=r(78618),f=r(56352),d=r(88602),h=r(28295),p=r(1102);function y(e){return e&&e.__esModule?e:{default:e}}function m(e){return m="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},m(e)}function g(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(e,t)}(e)||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.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new Error("must specify source account for the transaction");if(void 0===r.fee)throw new Error("must specify fee for the transaction (in stroops)");this.source=t,this.operations=[],this.baseFee=r.fee,this.timebounds=r.timebounds?w({},r.timebounds):null,this.ledgerbounds=r.ledgerbounds?w({},r.ledgerbounds):null,this.minAccountSequence=r.minAccountSequence||null,this.minAccountSequenceAge=r.minAccountSequenceAge||null,this.minAccountSequenceLedgerGap=r.minAccountSequenceLedgerGap||null,this.extraSigners=r.extraSigners?g(r.extraSigners):null,this.memo=r.memo||p.Memo.none(),this.networkPassphrase=r.networkPassphrase||null,this.sorobanData=r.sorobanData?new f.SorobanDataBuilder(r.sorobanData).build():null}var t,r,y;return t=e,y=[{key:"cloneFrom",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(t instanceof c.Transaction))throw new TypeError("expected a 'Transaction', got: ".concat(t));var n,o=(BigInt(t.sequence)-1n).toString();if(d.StrKey.isValidMed25519PublicKey(t.source))n=s.MuxedAccount.fromAddress(t.source,o);else{if(!d.StrKey.isValidEd25519PublicKey(t.source))throw new TypeError("unsupported tx source account: ".concat(t.source));n=new a.Account(t.source,o)}var i=new e(n,w({fee:(parseInt(t.fee,10)/t.operations.length||_).toString(),memo:t.memo,networkPassphrase:t.networkPassphrase,timebounds:t.timeBounds,ledgerbounds:t.ledgerBounds,minAccountSequence:t.minAccountSequence,minAccountSequenceAge:t.minAccountSequenceAge,minAccountSequenceLedgerGap:t.minAccountSequenceLedgerGap,extraSigners:t.extraSigners},r));return t._tx.operations().forEach((function(e){return i.addOperation(e)})),i}},{key:"buildFeeBumpTransaction",value:function(e,t,r,n){var a=r.operations.length,s=new o.default(r.fee).div(a),c=new o.default(t);if(c.lt(s))throw new Error("Invalid baseFee, it should be at least ".concat(s," stroops."));var f=new o.default(_);if(c.lt(f))throw new Error("Invalid baseFee, it should be at least ".concat(f," stroops."));var d,h=r.toEnvelope();if(h.switch()===i.default.EnvelopeType.envelopeTypeTxV0()){var p=h.v0().tx(),y=new i.default.Transaction({sourceAccount:new i.default.MuxedAccount.keyTypeEd25519(p.sourceAccountEd25519()),fee:p.fee(),seqNum:p.seqNum(),cond:i.default.Preconditions.precondTime(p.timeBounds()),memo:p.memo(),operations:p.operations(),ext:new i.default.TransactionExt(0)});h=new i.default.TransactionEnvelope.envelopeTypeTx(new i.default.TransactionV1Envelope({tx:y,signatures:h.v0().signatures()}))}d="string"===typeof e?(0,u.decodeAddressToMuxedAccount)(e):e.xdrMuxedAccount();var m=new i.default.FeeBumpTransaction({feeSource:d,fee:i.default.Int64.fromString(c.times(a+1).toString()),innerTx:i.default.FeeBumpTransactionInnerTx.envelopeTypeTx(h.v1()),ext:new i.default.FeeBumpTransactionExt(0)}),g=new i.default.FeeBumpTransactionEnvelope({tx:m,signatures:[]}),v=new i.default.TransactionEnvelope.envelopeTypeTxFeeBump(g);return new l.FeeBumpTransaction(v,n)}},{key:"fromXDR",value:function(e,t){return"string"===typeof e&&(e=i.default.TransactionEnvelope.fromXDR(e,"base64")),e.switch()===i.default.EnvelopeType.envelopeTypeTxFeeBump()?new l.FeeBumpTransaction(e,t):new c.Transaction(e,t)}}],(r=[{key:"addOperation",value:function(e){return this.operations.push(e),this}},{key:"clearOperations",value:function(){return this.operations=[],this}},{key:"addMemo",value:function(e){return this.memo=e,this}},{key:"setTimeout",value:function(e){if(null!==this.timebounds&&this.timebounds.maxTime>0)throw new Error("TimeBounds.max_time has been already set - setting timeout would overwrite it.");if(e<0)throw new Error("timeout cannot be negative");if(e>0){var t=Math.floor(Date.now()/1e3)+e;null===this.timebounds?this.timebounds={minTime:0,maxTime:t}:this.timebounds={minTime:this.timebounds.minTime,maxTime:t}}else this.timebounds={minTime:0,maxTime:0};return this}},{key:"setTimebounds",value:function(e,t){if("number"===typeof e&&(e=new Date(1e3*e)),"number"===typeof t&&(t=new Date(1e3*t)),null!==this.timebounds)throw new Error("TimeBounds has been already set - setting timebounds would overwrite it.");var r=Math.floor(e.valueOf()/1e3),n=Math.floor(t.valueOf()/1e3);if(r<0)throw new Error("min_time cannot be negative");if(n<0)throw new Error("max_time cannot be negative");if(n>0&&r>n)throw new Error("min_time cannot be greater than max_time");return this.timebounds={minTime:r,maxTime:n},this}},{key:"setLedgerbounds",value:function(e,t){if(null!==this.ledgerbounds)throw new Error("LedgerBounds has been already set - setting ledgerbounds would overwrite it.");if(e<0)throw new Error("min_ledger cannot be negative");if(t<0)throw new Error("max_ledger cannot be negative");if(t>0&&e>t)throw new Error("min_ledger cannot be greater than max_ledger");return this.ledgerbounds={minLedger:e,maxLedger:t},this}},{key:"setMinAccountSequence",value:function(e){if(null!==this.minAccountSequence)throw new Error("min_account_sequence has been already set - setting min_account_sequence would overwrite it.");return this.minAccountSequence=e,this}},{key:"setMinAccountSequenceAge",value:function(e){if("number"!==typeof e)throw new Error("min_account_sequence_age must be a number");if(null!==this.minAccountSequenceAge)throw new Error("min_account_sequence_age has been already set - setting min_account_sequence_age would overwrite it.");if(e<0)throw new Error("min_account_sequence_age cannot be negative");return this.minAccountSequenceAge=e,this}},{key:"setMinAccountSequenceLedgerGap",value:function(e){if(null!==this.minAccountSequenceLedgerGap)throw new Error("min_account_sequence_ledger_gap has been already set - setting min_account_sequence_ledger_gap would overwrite it.");if(e<0)throw new Error("min_account_sequence_ledger_gap cannot be negative");return this.minAccountSequenceLedgerGap=e,this}},{key:"setExtraSigners",value:function(e){if(!Array.isArray(e))throw new Error("extra_signers must be an array of strings.");if(null!==this.extraSigners)throw new Error("extra_signers has been already set - setting extra_signers would overwrite it.");if(e.length>2)throw new Error("extra_signers cannot be longer than 2 elements.");return this.extraSigners=g(e),this}},{key:"setNetworkPassphrase",value:function(e){return this.networkPassphrase=e,this}},{key:"setSorobanData",value:function(e){return this.sorobanData=new f.SorobanDataBuilder(e).build(),this}},{key:"build",value:function(){var e=new o.default(this.source.sequenceNumber()).plus(1),t={fee:new o.default(this.baseFee).times(this.operations.length).toNumber(),seqNum:i.default.SequenceNumber.fromString(e.toString()),memo:this.memo?this.memo.toXDRObject():null};if(null===this.timebounds||"undefined"===typeof this.timebounds.minTime||"undefined"===typeof this.timebounds.maxTime)throw new Error("TimeBounds has to be set or you must call setTimeout(TimeoutInfinite).");E(this.timebounds.minTime)&&(this.timebounds.minTime=this.timebounds.minTime.getTime()/1e3),E(this.timebounds.maxTime)&&(this.timebounds.maxTime=this.timebounds.maxTime.getTime()/1e3),this.timebounds.minTime=n.UnsignedHyper.fromString(this.timebounds.minTime.toString()),this.timebounds.maxTime=n.UnsignedHyper.fromString(this.timebounds.maxTime.toString());var r=new i.default.TimeBounds(this.timebounds);if(this.hasV2Preconditions()){var a=null;null!==this.ledgerbounds&&(a=new i.default.LedgerBounds(this.ledgerbounds));var s=this.minAccountSequence||"0";s=i.default.SequenceNumber.fromString(s);var l=n.UnsignedHyper.fromString(null!==this.minAccountSequenceAge?this.minAccountSequenceAge.toString():"0"),f=this.minAccountSequenceLedgerGap||0,d=null!==this.extraSigners?this.extraSigners.map(h.SignerKey.decodeAddress):[];t.cond=i.default.Preconditions.precondV2(new i.default.PreconditionsV2({timeBounds:r,ledgerBounds:a,minSeqNum:s,minSeqAge:l,minSeqLedgerGap:f,extraSigners:d}))}else t.cond=i.default.Preconditions.precondTime(r);t.sourceAccount=(0,u.decodeAddressToMuxedAccount)(this.source.accountId()),this.sorobanData?t.ext=new i.default.TransactionExt(1,this.sorobanData):t.ext=new i.default.TransactionExt(0,i.default.Void);var p=new i.default.Transaction(t);p.operations(this.operations);var y=new i.default.TransactionEnvelope.envelopeTypeTx(new i.default.TransactionV1Envelope({tx:p})),m=new c.Transaction(y,this.networkPassphrase);return this.source.incrementSequenceNumber(),m}},{key:"hasV2Preconditions",value:function(){return null!==this.ledgerbounds||null!==this.minAccountSequence||null!==this.minAccountSequenceAge||null!==this.minAccountSequenceLedgerGap||null!==this.extraSigners&&this.extraSigners.length>0}}])&&S(t.prototype,r),y&&S(t,y),Object.defineProperty(t,"prototype",{writable:!1}),e}();function E(e){return e instanceof Date&&!isNaN(e)}},36960:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyChecksum=function(e,t){if(e.length!==t.length)return!1;if(0===e.length)return!0;for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.best_r=function(e){var t,r,n=new o.default(e),s=[[new o.default(0),new o.default(1)],[new o.default(1),new o.default(0)]],u=2;for(;!n.gt(a);){t=n.integerValue(o.default.ROUND_FLOOR),r=n.minus(t);var c=t.times(s[u-1][0]).plus(s[u-2][0]),l=t.times(s[u-1][1]).plus(s[u-2][1]);if(c.gt(a)||l.gt(a))break;if(s.push([c,l]),r.eq(0))break;n=new o.default(1).div(r),u+=1}var f=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(s[s.length-1],2),d=f[0],h=f[1];if(d.isZero()||h.isZero())throw new Error("Couldn't find approximation");return[d.toNumber(),h.toNumber()]};var n,o=(n=r(1991))&&n.__esModule?n:{default:n};function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeAddressToMuxedAccount=a,t.encodeMuxedAccount=function(e,t){if(!i.StrKey.isValidEd25519PublicKey(e))throw new Error("address should be a Stellar account ID (G...)");if("string"!==typeof t)throw new Error("id should be a string representing a number (uint64)");return o.default.MuxedAccount.keyTypeMuxedEd25519(new o.default.MuxedAccountMed25519({id:o.default.Uint64.fromString(t),ed25519:i.StrKey.decodeEd25519PublicKey(e)}))},t.encodeMuxedAccountToAddress=s,t.extractBaseAddress=function(e){if(i.StrKey.isValidEd25519PublicKey(e))return e;if(!i.StrKey.isValidMed25519PublicKey(e))throw new TypeError("expected muxed account (M...), got ".concat(e));var t=a(e);return i.StrKey.encodeEd25519PublicKey(t.med25519().ed25519())};var n,o=(n=r(45956))&&n.__esModule?n:{default:n},i=r(88602);function a(e){return i.StrKey.isValidMed25519PublicKey(e)?function(e){var t=i.StrKey.decodeMed25519PublicKey(e);return o.default.MuxedAccount.keyTypeMuxedEd25519(new o.default.MuxedAccountMed25519({id:o.default.Uint64.fromXDR(t.subarray(-8)),ed25519:t.subarray(0,-8)}))}(e):o.default.MuxedAccount.keyTypeEd25519(i.StrKey.decodeEd25519PublicKey(e))}function s(e){return e.switch().value===o.default.CryptoKeyType.keyTypeMuxedEd25519().value?function(e){if(e.switch()===o.default.CryptoKeyType.keyTypeEd25519())return s(e);var t=e.med25519();return i.StrKey.encodeMed25519PublicKey(Buffer.concat([t.ed25519(),t.id().toXDR("raw")]))}(e):i.StrKey.encodeEd25519PublicKey(e.ed25519())}},70443:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trimEnd=void 0;t.trimEnd=function(e,t){for(var r="number"===typeof e,n=String(e);n.endsWith(t);)n=n.slice(0,-1);return r?Number(n):n}},45956:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(30036))&&n.__esModule?n:{default:n};t.default=o.default},23107:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BaseContract:()=>_r,BigNumber:()=>l.gH,Contract:()=>Er,ContractFactory:()=>xr,FixedNumber:()=>Tr.I3,Signer:()=>$e,VoidSigner:()=>et,Wallet:()=>no,Wordlist:()=>nn,constants:()=>o,errors:()=>d.ErrorCode,ethers:()=>u,getDefaultProvider:()=>ts,logger:()=>As,providers:()=>i,utils:()=>s,version:()=>ws,wordlists:()=>un});var n={};r.r(n),r.d(n,{decode:()=>T,encode:()=>_});var o={};r.r(o),r.d(o,{AddressZero:()=>ao,EtherSymbol:()=>uo,HashZero:()=>so.j,MaxInt256:()=>ie,MaxUint256:()=>ne,MinInt256:()=>oe,NegativeOne:()=>J,One:()=>ee,Two:()=>te,WeiPerEther:()=>re,Zero:()=>$});var i={};r.r(i),r.d(i,{AlchemyProvider:()=>sa,AlchemyWebSocketProvider:()=>aa,AnkrProvider:()=>fa,BaseProvider:()=>Ni,CloudflareProvider:()=>pa,EtherscanProvider:()=>Sa,FallbackProvider:()=>Ua,Formatter:()=>si,InfuraProvider:()=>Ha,InfuraWebSocketProvider:()=>qa,IpcProvider:()=>Fa,JsonRpcBatchProvider:()=>Va,JsonRpcProvider:()=>Xi,JsonRpcSigner:()=>Ki,NodesmithProvider:()=>Wa,PocketProvider:()=>Za,Provider:()=>Xe,Resolver:()=>Ci,StaticJsonRpcProvider:()=>ra,UrlJsonRpcProvider:()=>na,Web3Provider:()=>$a,WebSocketProvider:()=>$i,getDefaultProvider:()=>ts,getNetwork:()=>go,isCommunityResourcable:()=>ui,isCommunityResource:()=>ci,showThrottleMessage:()=>fi});var a={};r.r(a),r.d(a,{decode:()=>vo,encode:()=>bo});var s={};r.r(s),r.d(s,{AbiCoder:()=>Ne,ConstructorFragment:()=>_e,ErrorFragment:()=>Te,EventFragment:()=>we,FormatTypes:()=>ye,Fragment:()=>be,FunctionFragment:()=>Ee,HDNode:()=>bn,Indexed:()=>ze,Interface:()=>Ve,LogDescription:()=>Ue,Logger:()=>d.Logger,ParamType:()=>ge,RLP:()=>n,SigningKey:()=>Vt,SupportedAlgorithm:()=>Zr,TransactionDescription:()=>Fe,TransactionTypes:()=>Xt,UnicodeNormalizationForm:()=>F.dz,Utf8ErrorFuncs:()=>F.d5,Utf8ErrorReason:()=>F._E,_TypedDataEncoder:()=>Wr,_fetchData:()=>ei,_toEscapedUtf8String:()=>F.Wj,accessListify:()=>nr,arrayify:()=>c.arrayify,base58:()=>Xr,base64:()=>a,checkProperties:()=>f.checkProperties,checkResultErrors:()=>y,commify:()=>ys,computeAddress:()=>$t,computeHmac:()=>en,computePublicKey:()=>Wt,concat:()=>c.concat,deepCopy:()=>f.deepCopy,defaultAbiCoder:()=>Le,defaultPath:()=>vn,defineReadOnly:()=>f.defineReadOnly,dnsEncode:()=>Go,entropyToMnemonic:()=>Sn,fetchJson:()=>ti,formatBytes32String:()=>ds.R,formatEther:()=>vs,formatUnits:()=>ms,getAccountPath:()=>_n,getAddress:()=>B,getContractAddress:()=>j,getCreate2Address:()=>U,getIcapAddress:()=>L,getJsonWalletAddress:()=>Jn,getStatic:()=>f.getStatic,hashMessage:()=>Or,hexConcat:()=>c.hexConcat,hexDataLength:()=>c.hexDataLength,hexDataSlice:()=>c.hexDataSlice,hexStripZeros:()=>c.hexStripZeros,hexValue:()=>c.hexValue,hexZeroPad:()=>c.hexZeroPad,hexlify:()=>c.hexlify,id:()=>D,isAddress:()=>N,isBytes:()=>c.isBytes,isBytesLike:()=>c.isBytesLike,isHexString:()=>c.isHexString,isValidMnemonic:()=>kn,isValidName:()=>Ko,joinSignature:()=>c.joinSignature,keccak256:()=>b.keccak256,mnemonicToEntropy:()=>An,mnemonicToSeed:()=>wn,namehash:()=>Wo,nameprep:()=>fs.j9,parseBytes32String:()=>ds.V,parseEther:()=>bs,parseTransaction:()=>cr,parseUnits:()=>gs,poll:()=>ri,randomBytes:()=>Pn,recoverAddress:()=>er,recoverPublicKey:()=>Kt,resolveProperties:()=>f.resolveProperties,ripemd160:()=>Yr,serializeTransaction:()=>sr,sha256:()=>Jr,sha512:()=>$r,shallowCopy:()=>f.shallowCopy,shuffled:()=>ka,solidityKeccak256:()=>cs,solidityPack:()=>us,soliditySha256:()=>ls,splitSignature:()=>c.splitSignature,stripZeros:()=>c.stripZeros,toUtf8Bytes:()=>F.YW,toUtf8CodePoints:()=>F.dg,toUtf8String:()=>F._v,verifyMessage:()=>oo,verifyTypedData:()=>io,zeroPad:()=>c.zeroPad});var u={};r.r(u),r.d(u,{BaseContract:()=>_r,BigNumber:()=>l.gH,Contract:()=>Er,ContractFactory:()=>xr,FixedNumber:()=>Tr.I3,Signer:()=>$e,VoidSigner:()=>et,Wallet:()=>no,Wordlist:()=>nn,constants:()=>o,errors:()=>d.ErrorCode,getDefaultProvider:()=>ts,logger:()=>As,providers:()=>i,utils:()=>s,version:()=>ws,wordlists:()=>un});var c=r(89106),l=r(2776),f=r(3678),d=r(14589);const h="abi/5.7.0",p=new d.Logger(h);function y(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const a=e.slice();a.push(i);try{r(a,n[i])}catch(o){t.push({path:a,error:o})}}};return r([],e),t}class m{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){p.throwArgumentError(e,this.localName,t)}}class g{constructor(e){(0,f.defineReadOnly)(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return(0,c.hexConcat)(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData((0,c.concat)(e._data))}writeBytes(e){let t=(0,c.arrayify)(e);const r=t.length%this.wordSize;return r&&(t=(0,c.concat)([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=(0,c.arrayify)(l.gH.from(e));return t.length>this.wordSize&&p.throwError("value out-of-bounds",d.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,c.concat)([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class v{constructor(e,t,r,n){(0,f.defineReadOnly)(this,"_data",(0,c.arrayify)(e)),(0,f.defineReadOnly)(this,"wordSize",t||32),(0,f.defineReadOnly)(this,"_coerceFunc",r),(0,f.defineReadOnly)(this,"allowLoose",n),this._offset=0}get data(){return(0,c.hexlify)(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):v.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:p.throwError("data out-of-bounds",d.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new v(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return l.gH.from(this.readBytes(this.wordSize))}}var b=r(19547);const w=new d.Logger("rlp/5.7.0");function A(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function S(e,t,r){let n=0;for(let o=0;ot+1+n&&w.throwError("child data too short",d.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:o}}function x(e,t){if(0===e.length&&w.throwError("data too short",d.Logger.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&w.throwError("data short segment too short",d.Logger.errors.BUFFER_OVERRUN,{});const n=S(e,t+1,r);return t+1+r+n>e.length&&w.throwError("data long segment too short",d.Logger.errors.BUFFER_OVERRUN,{}),E(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&w.throwError("data array too short",d.Logger.errors.BUFFER_OVERRUN,{}),E(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&w.throwError("data array too short",d.Logger.errors.BUFFER_OVERRUN,{});const n=S(e,t+1,r);t+1+r+n>e.length&&w.throwError("data array too short",d.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:(0,c.hexlify)(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&w.throwError("data too short",d.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:(0,c.hexlify)(e.slice(t+1,t+1+r))}}return{consumed:1,result:(0,c.hexlify)(e[t])}}function T(e){const t=(0,c.arrayify)(e),r=x(t,0);return r.consumed!==t.length&&w.throwArgumentError("invalid rlp data","data",e),r.result}const P=new d.Logger("address/5.7.0");function O(e){(0,c.isHexString)(e,20)||P.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let o=0;o<40;o++)r[o]=t[o].charCodeAt(0);const n=(0,c.arrayify)((0,b.keccak256)(r));for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&(t[o]=t[o].toUpperCase()),(15&n[o>>1])>=8&&(t[o+1]=t[o+1].toUpperCase());return"0x"+t.join("")}const R={};for(let ks=0;ks<10;ks++)R[String(ks)]=String(ks);for(let ks=0;ks<26;ks++)R[String.fromCharCode(65+ks)]=String(10+ks);const I=Math.floor((C=9007199254740991,Math.log10?Math.log10(C):Math.log(C)/Math.LN10));var C;function M(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>R[e])).join("");for(;t.length>=I;){let e=t.substring(0,I);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function B(e){let t=null;if("string"!==typeof e&&P.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=O(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&P.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)!==M(e)&&P.throwArgumentError("bad icap checksum","address",e),t=(0,l.Os)(e.substring(4));t.length<40;)t="0"+t;t=O("0x"+t)}else P.throwArgumentError("invalid address","address",e);return t}function N(e){try{return B(e),!0}catch(t){}return!1}function L(e){let t=(0,l.ii)(B(e).substring(2)).toUpperCase();for(;t.length<30;)t="0"+t;return"XE"+M("XE00"+t)+t}function j(e){let t=null;try{t=B(e.from)}catch(n){P.throwArgumentError("missing from address","transaction",e)}const r=(0,c.stripZeros)((0,c.arrayify)(l.gH.from(e.nonce).toHexString()));return B((0,c.hexDataSlice)((0,b.keccak256)(_([t,r])),12))}function U(e,t,r){return 32!==(0,c.hexDataLength)(t)&&P.throwArgumentError("salt must be 32 bytes","salt",t),32!==(0,c.hexDataLength)(r)&&P.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),B((0,c.hexDataSlice)((0,b.keccak256)((0,c.concat)(["0xff",B(e),t,r])),12))}var F=r(2614);function D(e){return(0,b.keccak256)((0,F.YW)(e))}class z extends m{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=B(t)}catch(r){this._throwError(r.message,t)}return e.writeValue(t)}decode(e){return B((0,c.hexZeroPad)(e.readValue().toHexString(),20))}}class q extends m{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const H=new d.Logger(h);function V(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"===typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||H.throwError("cannot encode object for signature with missing names",d.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&H.throwError("cannot encode object for signature with duplicate names",d.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else H.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&H.throwArgumentError("types/value length mismatch","tuple",r);let o=new g(e.wordSize),i=new g(e.wordSize),a=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=i.length;e.encode(i,r);let n=o.writeUpdatableValue();a.push((e=>{n(e+t)}))}else e.encode(o,r)})),a.forEach((e=>{e(o.length)}));let s=e.appendWriter(o);return s+=e.appendWriter(i),s}function K(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let o=null;if(t.dynamic){let r=e.readValue(),a=n.subReader(r.toNumber());try{o=t.decode(a)}catch(i){if(i.code===d.Logger.errors.BUFFER_OVERRUN)throw i;o=i,o.baseType=t.name,o.name=t.localName,o.type=t.type}}else try{o=t.decode(e)}catch(i){if(i.code===d.Logger.errors.BUFFER_OVERRUN)throw i;o=i,o.baseType=t.name,o.name=t.localName,o.type=t.type}void 0!=o&&r.push(o)}));const o=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==o[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const i=r[t];i instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw i}}):r[n]=i}));for(let i=0;i{throw e}})}return Object.freeze(r)}class W extends m{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;re._data.length&&H.throwError("insufficient data length",d.Logger.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let n=0;n{e.dynamic&&(r=!0),n.push(e.type)}));super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let o=r.localName;o&&1===t[o]&&("length"===o&&(o="_length"),null==e[o]&&(e[o]=e[n]))})),Object.freeze(e)}encode(e,t){return V(e,this.coders,t)}decode(e){return e.coerce(this.name,K(e,this.coders))}}const ce=new d.Logger(h),le={};let fe={calldata:!0,memory:!0,storage:!0},de={calldata:!0,memory:!0};function he(e,t){if("bytes"===e||"string"===e){if(fe[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&de[t])return!0;return(fe[t]||"payable"===t)&&ce.throwArgumentError("invalid modifier","name",t),!1}function pe(e,t){for(let r in t)(0,f.defineReadOnly)(e,r,t[r])}const ye=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),me=new RegExp(/^(.*)\[([0-9]*)\]$/);class ge{constructor(e,t){e!==le&&ce.throwError("use fromString",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),pe(this,t);let r=this.type.match(me);pe(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:ge.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=ye.sighash),ye[e]||ce.throwArgumentError("invalid format type","format",e),e===ye.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"===typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==ye.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===ye.full?", ":",")+")"):t+=this.type,e!==ye.sighash&&(!0===this.indexed&&(t+=" indexed"),e===ye.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"===typeof e?ge.fromString(e,t):ge.fromObject(e)}static fromObject(e){return ge.isParamType(e)?e:new ge(le,{name:e.name||null,type:Pe(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(ge.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){ce.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function o(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let i={type:"",name:"",state:{allowType:!0}},a=i;for(let s=0;sge.fromString(e,t)))}class be{constructor(e,t){e!==le&&ce.throwError("use a static from method",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),pe(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return be.isFragment(e)?e:"string"===typeof e?be.fromString(e):be.fromObject(e)}static fromObject(e){if(be.isFragment(e))return e;switch(e.type){case"function":return Ee.fromObject(e);case"event":return we.fromObject(e);case"constructor":return _e.fromObject(e);case"error":return Te.fromObject(e);case"fallback":case"receive":return null}return ce.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?we.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Ee.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?_e.fromString(e.trim()):"error"===e.split(" ")[0]?Te.fromString(e.substring(5).trim()):ce.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class we extends be{format(e){if(e||(e=ye.sighash),ye[e]||ce.throwArgumentError("invalid format type","format",e),e===ye.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ye.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ye.full?", ":",")+") ",e!==ye.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"===typeof e?we.fromString(e):we.fromObject(e)}static fromObject(e){if(we.isEventFragment(e))return e;"event"!==e.type&&ce.throwArgumentError("invalid event object","value",e);const t={name:Re(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(ge.fromObject):[],type:"event"};return new we(le,t)}static fromString(e){let t=e.match(Ie);t||ce.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:ce.warn("unknown modifier: "+e)}})),we.fromObject({name:t[1].trim(),anonymous:r,inputs:ve(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function Ae(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&ce.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||ce.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=l.gH.from(r[1]),r[0]):e}function Se(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function ke(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&ce.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&ce.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||ce.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&ce.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&ce.throwArgumentError("unable to determine stateMutability","value",e),t}class _e extends be{format(e){if(e||(e=ye.sighash),ye[e]||ce.throwArgumentError("invalid format type","format",e),e===ye.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===ye.sighash&&ce.throwError("cannot format a constructor for sighash",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===ye.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"===typeof e?_e.fromString(e):_e.fromObject(e)}static fromObject(e){if(_e.isConstructorFragment(e))return e;"constructor"!==e.type&&ce.throwArgumentError("invalid constructor object","value",e);let t=ke(e);t.constant&&ce.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(ge.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?l.gH.from(e.gas):null};return new _e(le,r)}static fromString(e){let t={type:"constructor"},r=(e=Ae(e,t)).match(Ie);return r&&"constructor"===r[1].trim()||ce.throwArgumentError("invalid constructor string","value",e),t.inputs=ve(r[2].trim(),!1),Se(r[3].trim(),t),_e.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Ee extends _e{format(e){if(e||(e=ye.sighash),ye[e]||ce.throwArgumentError("invalid format type","format",e),e===ye.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ye.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ye.full?", ":",")+") ",e!==ye.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"===typeof e?Ee.fromString(e):Ee.fromObject(e)}static fromObject(e){if(Ee.isFunctionFragment(e))return e;"function"!==e.type&&ce.throwArgumentError("invalid function object","value",e);let t=ke(e);const r={type:e.type,name:Re(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(ge.fromObject):[],outputs:e.outputs?e.outputs.map(ge.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?l.gH.from(e.gas):null};return new Ee(le,r)}static fromString(e){let t={type:"function"},r=(e=Ae(e,t)).split(" returns ");r.length>2&&ce.throwArgumentError("invalid function string","value",e);let n=r[0].match(Ie);if(n||ce.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Re(t.name),t.inputs=ve(n[2],!1),Se(n[3].trim(),t),r.length>1){let n=r[1].match(Ie);""==n[1].trim()&&""==n[3].trim()||ce.throwArgumentError("unexpected tokens","value",e),t.outputs=ve(n[2],!1)}else t.outputs=[];return Ee.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function xe(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||ce.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}class Te extends be{format(e){if(e||(e=ye.sighash),ye[e]||ce.throwArgumentError("invalid format type","format",e),e===ye.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ye.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ye.full?", ":",")+") ",t.trim()}static from(e){return"string"===typeof e?Te.fromString(e):Te.fromObject(e)}static fromObject(e){if(Te.isErrorFragment(e))return e;"error"!==e.type&&ce.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Re(e.name),inputs:e.inputs?e.inputs.map(ge.fromObject):[]};return xe(new Te(le,t))}static fromString(e){let t={type:"error"},r=e.match(Ie);return r||ce.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Re(t.name),t.inputs=ve(r[2],!1),xe(Te.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Pe(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Oe=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Re(e){return e&&e.match(Oe)||ce.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}const Ie=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Ce=new d.Logger(h),Me=new RegExp(/^bytes([0-9]*)$/),Be=new RegExp(/^(u?int)([0-9]*)$/);class Ne{constructor(e){(0,f.defineReadOnly)(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new z(e.name);case"bool":return new G(e.name);case"string":return new se(e.name);case"bytes":return new Z(e.name);case"array":return new W(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new ue((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new Y(e.name)}let t=e.type.match(Be);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!==0)&&Ce.throwArgumentError("invalid "+t[1]+" bit length","param",e),new ae(r/8,"int"===t[1],e.name)}if(t=e.type.match(Me),t){let r=parseInt(t[1]);return(0===r||r>32)&&Ce.throwArgumentError("invalid bytes length","param",e),new Q(r,e.name)}return Ce.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new v(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new g(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(ge.from(e))));return new ue(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&Ce.throwError("types/values length mismatch",d.Logger.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(ge.from(e)))),n=new ue(r,"_"),o=this._getWriter();return n.encode(o,t),o.data}decode(e,t,r){const n=e.map((e=>this._getCoder(ge.from(e))));return new ue(n,"_").decode(this._getReader((0,c.arrayify)(t),r))}}const Le=new Ne,je=new d.Logger(h);class Ue extends f.Description{}class Fe extends f.Description{}class De extends f.Description{}class ze extends f.Description{static isIndexed(e){return!(!e||!e._isIndexed)}}const qe={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function He(e,t){const r=new Error("deferred error during ABI decoding triggered accessing ".concat(e));return r.error=t,r}class Ve{constructor(e){let t=[];t="string"===typeof e?JSON.parse(e):e,(0,f.defineReadOnly)(this,"fragments",t.map((e=>be.from(e))).filter((e=>null!=e))),(0,f.defineReadOnly)(this,"_abiCoder",(0,f.getStatic)(new.target,"getAbiCoder")()),(0,f.defineReadOnly)(this,"functions",{}),(0,f.defineReadOnly)(this,"errors",{}),(0,f.defineReadOnly)(this,"events",{}),(0,f.defineReadOnly)(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void je.warn("duplicate definition - constructor"):void(0,f.defineReadOnly)(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?je.warn("duplicate definition - "+r):t[r]=e})),this.deploy||(0,f.defineReadOnly)(this,"deploy",_e.from({payable:!1,type:"constructor"})),(0,f.defineReadOnly)(this,"_isInterface",!0)}format(e){e||(e=ye.full),e===ye.sighash&&je.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===ye.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return Le}static getAddress(e){return B(e)}static getSighash(e){return(0,c.hexDataSlice)(D(e.format()),0,4)}static getEventTopic(e){return D(e.format())}getFunction(e){if((0,c.isHexString)(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];je.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?je.throwArgumentError("no matching function","name",t):r.length>1&&je.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[Ee.fromString(e).format()];return t||je.throwArgumentError("no matching function","signature",e),t}getEvent(e){if((0,c.isHexString)(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];je.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?je.throwArgumentError("no matching event","name",t):r.length>1&&je.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[we.fromString(e).format()];return t||je.throwArgumentError("no matching event","signature",e),t}getError(e){if((0,c.isHexString)(e)){const t=(0,f.getStatic)(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}je.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?je.throwArgumentError("no matching error","name",t):r.length>1&&je.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[Ee.fromString(e).format()];return t||je.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"===typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(r){throw t}}return(0,f.getStatic)(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"===typeof e&&(e=this.getEvent(e)),(0,f.getStatic)(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"===typeof e&&(e=this.getError(e));const r=(0,c.arrayify)(t);return(0,c.hexlify)(r.slice(0,4))!==this.getSighash(e)&&je.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",(0,c.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"===typeof e&&(e=this.getError(e)),(0,c.hexlify)((0,c.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"===typeof e&&(e=this.getFunction(e));const r=(0,c.arrayify)(t);return(0,c.hexlify)(r.slice(0,4))!==this.getSighash(e)&&je.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",(0,c.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"===typeof e&&(e=this.getFunction(e)),(0,c.hexlify)((0,c.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"===typeof e&&(e=this.getFunction(e));let r=(0,c.arrayify)(t),n=null,o="",i=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(u){}break;case 4:{const e=(0,c.hexlify)(r.slice(0,4)),t=qe[e];if(t)i=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.signature,t.reason&&(n=i[0]),"Error"===a?o="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(i[0])):"Panic"===a&&(o="; VM Exception while processing transaction: reverted with panic code ".concat(i[0]));else try{const t=this.getError(e);i=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.format()}catch(u){}break}}return je.throwError("call revert exception"+o,d.Logger.errors.CALL_EXCEPTION,{method:e.format(),data:(0,c.hexlify)(t),errorArgs:i,errorName:a,errorSignature:s,reason:n})}encodeFunctionResult(e,t){return"string"===typeof e&&(e=this.getFunction(e)),(0,c.hexlify)(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"===typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&je.throwError("too many arguments for "+e.format(),d.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?D(t):"bytes"===e.type?(0,b.keccak256)((0,c.hexlify)(t)):("bool"===e.type&&"boolean"===typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=l.gH.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),(0,c.hexZeroPad)((0,c.hexlify)(t),32));for(t.forEach(((t,o)=>{let i=e.inputs[o];i.indexed?null==t?r.push(null):"array"===i.baseType||"tuple"===i.baseType?je.throwArgumentError("filtering with tuples or arrays not supported","contract."+i.name,t):Array.isArray(t)?r.push(t.map((e=>n(i,e)))):r.push(n(i,t)):null!=t&&je.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+i.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"===typeof e&&(e=this.getEvent(e));const r=[],n=[],o=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&je.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,i)=>{const a=t[i];if(e.indexed)if("string"===e.type)r.push(D(a));else if("bytes"===e.type)r.push((0,b.keccak256)(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[a]))}else n.push(e),o.push(a)})),{data:this._abiCoder.encode(n,o),topics:r}}decodeEventLog(e,t,r){if("string"===typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);(0,c.isHexString)(r[0],32)&&r[0].toLowerCase()===t||je.throwError("fragment/topic mismatch",d.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],o=[],i=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(ge.fromObject({type:"bytes32",name:e.name})),i.push(!0)):(n.push(e),i.push(!1)):(o.push(e),i.push(!1))}));let a=null!=r?this._abiCoder.decode(n,(0,c.concat)(r)):null,s=this._abiCoder.decode(o,t,!0),u=[],l=0,f=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)u[t]=new ze({_isIndexed:!0,hash:null});else if(i[t])u[t]=new ze({_isIndexed:!0,hash:a[f++]});else try{u[t]=a[f++]}catch(r){u[t]=r}else try{u[t]=s[l++]}catch(r){u[t]=r}if(e.name&&null==u[e.name]){const r=u[t];r instanceof Error?Object.defineProperty(u,e.name,{enumerable:!0,get:()=>{throw He("property ".concat(JSON.stringify(e.name)),r)}}):u[e.name]=r}}));for(let c=0;c{throw He("index ".concat(c),e)}})}return Object.freeze(u)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new Fe({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:l.gH.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new Ue({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=(0,c.hexlify)(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new De({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}var Ke=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const We=new d.Logger("abstract-provider/5.7.0");class Ge extends f.Description{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class Xe{constructor(){We.checkAbstract(new.target,Xe),(0,f.defineReadOnly)(this,"_isProvider",!0)}getFeeData(){return Ke(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield(0,f.resolveProperties)({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,n=null,o=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,o=l.gH.from("1500000000"),n=e.baseFeePerGas.mul(2).add(o)),{lastBaseFeePerGas:r,maxFeePerGas:n,maxPriorityFeePerGas:o,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}var Ze=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const Qe=new d.Logger("abstract-signer/5.7.0"),Ye=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Je=[d.Logger.errors.INSUFFICIENT_FUNDS,d.Logger.errors.NONCE_EXPIRED,d.Logger.errors.REPLACEMENT_UNDERPRICED];class $e{constructor(){Qe.checkAbstract(new.target,$e),(0,f.defineReadOnly)(this,"_isSigner",!0)}getBalance(e){return Ze(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return Ze(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return Ze(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield(0,f.resolveProperties)(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return Ze(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield(0,f.resolveProperties)(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return Ze(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return Ze(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return Ze(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return Ze(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return Ze(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const r in e)-1===Ye.indexOf(r)&&Qe.throwArgumentError("invalid transaction key: "+r,"transaction",e);const t=(0,f.shallowCopy)(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&Qe.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return Ze(this,void 0,void 0,(function*(){const t=yield(0,f.resolveProperties)(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>Ze(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&Qe.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||Qe.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):Qe.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(r&&Qe.throwError("network does not support EIP-1559",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):Qe.throwError("failed to get consistent fee data",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(Je.indexOf(e.code)>=0)throw e;return Qe.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&Qe.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield(0,f.resolveProperties)(t)}))}_checkProvider(e){this.provider||Qe.throwError("missing provider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class et extends $e{constructor(e,t){super(),(0,f.defineReadOnly)(this,"address",e),(0,f.defineReadOnly)(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{Qe.throwError(e,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new et(this.address,e)}}var tt=r(6373),rt=r.n(tt),nt=r(73697),ot=r.n(nt);"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof r.g?r.g:"undefined"!==typeof self&&self;function it(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}((void 0===t||null===t)&&r.path)}},e(r,r.exports),r.exports}var at=st;function st(e,t){if(!e)throw new Error(t||"Assertion failed")}st.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var ut=it((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r>8,a=255&o;i?r.push(i,a):r.push(a)}return r},r.zero2=n,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}})),ct=it((function(e,t){var r=t;r.assert=at,r.toArray=ut.toArray,r.zero2=ut.zero2,r.toHex=ut.toHex,r.encode=ut.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var o=1<(o>>1)-1?(o>>1)-u:u,i.isubn(s)):s=0,n[a]=s,i.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,o=0,i=0;e.cmpn(-o)>0||t.cmpn(-i)>0;){var a,s,u=e.andln(3)+o&3,c=t.andln(3)+i&3;3===u&&(u=-1),3===c&&(c=-1),a=0===(1&u)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[0].push(a),s=0===(1&c)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*o===a+1&&(o=1-o),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"===typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new(rt())(e,"hex","le")}})),lt=ct.getNAF,ft=ct.getJSF,dt=ct.assert;function ht(e,t){this.type=e,this.p=new(rt())(t.p,16),this.red=t.prime?rt().red(t.prime):rt().mont(this.p),this.zero=new(rt())(0).toRed(this.red),this.one=new(rt())(1).toRed(this.red),this.two=new(rt())(2).toRed(this.red),this.n=t.n&&new(rt())(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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var pt=ht;function yt(e,t){this.curve=e,this.type=t,this.precomputed=null}ht.prototype.point=function(){throw new Error("Not implemented")},ht.prototype.validate=function(){throw new Error("Not implemented")},ht.prototype._fixedNafMul=function(e,t){dt(e.precomputed);var r=e._getDoubles(),n=lt(t,1,this._bitLength),o=(1<=i;u--)a=(a<<1)+n[u];s.push(a)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),f=o;f>0;f--){for(i=0;i=0;s--){for(var u=0;s>=0&&0===i[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var c=i[s];dt(0!==c),a="affine"===e.type?c>0?a.mixedAdd(o[c-1>>1]):a.mixedAdd(o[-c-1>>1].neg()):c>0?a.add(o[c-1>>1]):a.add(o[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},ht.prototype._wnafMulAdd=function(e,t,r,n,o){var i,a,s,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,f=0;for(i=0;i=1;i-=2){var h=i-1,p=i;if(1===u[h]&&1===u[p]){var y=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(y[1]=t[h].add(t[p]),y[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(y[1]=t[h].toJ().mixedAdd(t[p]),y[2]=t[h].add(t[p].neg())):(y[1]=t[h].toJ().mixedAdd(t[p]),y[2]=t[h].toJ().mixedAdd(t[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],g=ft(r[h],r[p]);for(f=Math.max(g[0].length,f),l[h]=new Array(f),l[p]=new Array(f),a=0;a=0;i--){for(var S=0;i>=0;){var k=!0;for(a=0;a=0&&S++,w=w.dblp(S),i<0)break;for(a=0;a0?s=c[a][_-1>>1]:_<0&&(s=c[a][-_-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(i=0;i=Math.ceil((e.bitLength()+1)/t.step)},yt.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,o=0;o=0&&(i=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),i.negative&&(i=i.neg(),a=a.neg()),[{a:n,b:o},{a:i,b:a}]},vt.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],o=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),a=o.mul(r.a),s=i.mul(n.a),u=o.mul(r.b),c=i.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},vt.prototype.pointFromX=function(e,t){(e=new(rt())(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},vt.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(o).cmpn(0)},vt.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,o=this._endoWnafT2,i=0;i":""},wt.prototype.isInfinity=function(){return this.inf},wt.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 r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},wt.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,r=this.x.redSqr(),n=e.redInvm(),o=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=o.redSqr().redISub(this.x.redAdd(this.x)),a=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,a)},wt.prototype.getX=function(){return this.x.fromRed()},wt.prototype.getY=function(){return this.y.fromRed()},wt.prototype.mul=function(e){return e=new(rt())(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)},wt.prototype.mulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},wt.prototype.jmulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)},wt.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))},wt.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},wt.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},mt(At,pt.BasePoint),vt.prototype.jpoint=function(e,t,r){return new At(this,e,t,r)},At.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},At.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},At.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),o=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(o),u=i.redSub(a);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),f=n.redMul(c),d=u.redSqr().redIAdd(l).redISub(f).redISub(f),h=u.redMul(f.redISub(d)).redISub(i.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,p)},At.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),o=this.y,i=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=o.redSub(i);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=r.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),d=s.redMul(l.redISub(f)).redISub(o.redMul(c)),h=this.z.redMul(a);return this.curve.jpoint(f,d,h)},At.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 r=this;for(t=0;t=0)return!1;if(r.redIAdd(o),0===this.x.cmp(r))return!0}},At.prototype.inspect=function(){return this.isInfinity()?"":""},At.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var St=it((function(e,t){var r=t;r.base=pt,r.short=bt,r.mont=null,r.edwards=null})),kt=it((function(e,t){var r,n=t,o=ct.assert;function i(e){"short"===e.type?this.curve=new St.short(e):"edwards"===e.type?this.curve=new St.edwards(e):this.curve=new St.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new i(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=i,a("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:ot().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:ot().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:ot().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:ot().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"]}),a("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:ot().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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ot().sha256,gRed:!1,g:["9"]}),a("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:ot().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(s){r=void 0}a("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:ot().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function _t(e){if(!(this instanceof _t))return new _t(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=ut.toArray(e.entropy,e.entropyEnc||"hex"),r=ut.toArray(e.nonce,e.nonceEnc||"hex"),n=ut.toArray(e.pers,e.persEnc||"hex");at(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Et=_t;_t.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},_t.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(n=r,r=t,t=null),r&&(r=ut.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length"};var Ot=ct.assert;function Rt(e,t){if(e instanceof Rt)return e;this._importDER(e,t)||(Ot(e.r&&e.s,"Signature without r or s"),this.r=new(rt())(e.r,16),this.s=new(rt())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var It=Rt;function Ct(){this.place=0}function Mt(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var o=0,i=0,a=t.place;i>>=0;return!(o<=127)&&(t.place=a,o)}function Bt(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}Rt.prototype._importDER=function(e,t){e=ct.toArray(e,t);var r=new Ct;if(48!==e[r.place++])return!1;var n=Mt(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=Mt(e,r);if(!1===o)return!1;var i=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var a=Mt(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===i[0]){if(!(128&i[1]))return!1;i=i.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new(rt())(i),this.s=new(rt())(s),this.recoveryParam=null,!0},Rt.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=Bt(t),r=Bt(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];Nt(n,t.length),(n=n.concat(t)).push(2),Nt(n,r.length);var o=n.concat(r),i=[48];return Nt(i,o.length),i=i.concat(o),ct.encode(i,e)};var Lt=function(){throw new Error("unsupported")},jt=ct.assert;function Ut(e){if(!(this instanceof Ut))return new Ut(e);"string"===typeof e&&(jt(Object.prototype.hasOwnProperty.call(kt,e),"Unknown curve "+e),e=kt[e]),e instanceof kt.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}var Ft=Ut;Ut.prototype.keyPair=function(e){return new Pt(this,e)},Ut.prototype.keyFromPrivate=function(e,t){return Pt.fromPrivate(this,e,t)},Ut.prototype.keyFromPublic=function(e,t){return Pt.fromPublic(this,e,t)},Ut.prototype.genKeyPair=function(e){e||(e={});for(var t=new Et({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Lt(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(rt())(2));;){var o=new(rt())(t.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},Ut.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Ut.prototype.sign=function(e,t,r,n){"object"===typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new(rt())(e,16));for(var o=this.n.byteLength(),i=t.getPrivate().toArray("be",o),a=e.toArray("be",o),s=new Et({hash:this.hash,entropy:i,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),u=this.n.sub(new(rt())(1)),c=0;;c++){var l=n.k?n.k(c):new(rt())(s.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(u)>=0)){var f=this.g.mul(l);if(!f.isInfinity()){var d=f.getX(),h=d.umod(this.n);if(0!==h.cmpn(0)){var p=l.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var y=(f.getY().isOdd()?1:0)|(0!==d.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),y^=1),new It({r:h,s:p,recoveryParam:y})}}}}}},Ut.prototype.verify=function(e,t,r,n){e=this._truncateToN(new(rt())(e,16)),r=this.keyFromPublic(r,n);var o=(t=new It(t,"hex")).r,i=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;var a,s=i.invm(this.n),u=s.mul(e).umod(this.n),c=s.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),c)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},Ut.prototype.recoverPubKey=function(e,t,r,n){jt((3&r)===r,"The recovery param is more than two bits"),t=new It(t,n);var o=this.n,i=new(rt())(e),a=t.r,s=t.s,u=1&r,c=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(o),f=o.sub(i).mul(l).umod(o),d=s.mul(l).umod(o);return this.g.mulAdd(f,a,d)},Ut.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new It(t,n)).recoveryParam)return t.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(r))return o}throw new Error("Unable to find valid recovery factor")};var Dt=it((function(e,t){var r=t;r.version="6.5.4",r.utils=ct,r.rand=function(){throw new Error("unsupported")},r.curve=St,r.curves=kt,r.ec=Ft,r.eddsa=null})).ec;const zt=new d.Logger("signing-key/5.7.0");let qt=null;function Ht(){return qt||(qt=new Dt("secp256k1")),qt}class Vt{constructor(e){(0,f.defineReadOnly)(this,"curve","secp256k1"),(0,f.defineReadOnly)(this,"privateKey",(0,c.hexlify)(e)),32!==(0,c.hexDataLength)(this.privateKey)&&zt.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=Ht().keyFromPrivate((0,c.arrayify)(this.privateKey));(0,f.defineReadOnly)(this,"publicKey","0x"+t.getPublic(!1,"hex")),(0,f.defineReadOnly)(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),(0,f.defineReadOnly)(this,"_isSigningKey",!0)}_addPoint(e){const t=Ht().keyFromPublic((0,c.arrayify)(this.publicKey)),r=Ht().keyFromPublic((0,c.arrayify)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=Ht().keyFromPrivate((0,c.arrayify)(this.privateKey)),r=(0,c.arrayify)(e);32!==r.length&&zt.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return(0,c.splitSignature)({recoveryParam:n.recoveryParam,r:(0,c.hexZeroPad)("0x"+n.r.toString(16),32),s:(0,c.hexZeroPad)("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=Ht().keyFromPrivate((0,c.arrayify)(this.privateKey)),r=Ht().keyFromPublic((0,c.arrayify)(Wt(e)));return(0,c.hexZeroPad)("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function Kt(e,t){const r=(0,c.splitSignature)(t),n={r:(0,c.arrayify)(r.r),s:(0,c.arrayify)(r.s)};return"0x"+Ht().recoverPubKey((0,c.arrayify)(e),n,r.recoveryParam).encode("hex",!1)}function Wt(e,t){const r=(0,c.arrayify)(e);if(32===r.length){const e=new Vt(r);return t?"0x"+Ht().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?(0,c.hexlify)(r):"0x"+Ht().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+Ht().keyFromPublic(r).getPublic(!0,"hex"):(0,c.hexlify)(r):zt.throwArgumentError("invalid public or private key","key","[REDACTED]")}const Gt=new d.Logger("transactions/5.7.0");var Xt;function Zt(e){return"0x"===e?null:B(e)}function Qt(e){return"0x"===e?$:l.gH.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(Xt||(Xt={}));const Yt=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],Jt={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function $t(e){const t=Wt(e);return B((0,c.hexDataSlice)((0,b.keccak256)((0,c.hexDataSlice)(t,1)),12))}function er(e,t){return $t(Kt((0,c.arrayify)(e),t))}function tr(e,t){const r=(0,c.stripZeros)(l.gH.from(e).toHexString());return r.length>32&&Gt.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function rr(e,t){return{address:B(e),storageKeys:(t||[]).map(((t,r)=>(32!==(0,c.hexDataLength)(t)&&Gt.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(r,"]"),t),t.toLowerCase())))}}function nr(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&Gt.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),rr(e[0],e[1])):rr(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return rr(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function or(e){return nr(e).map((e=>[e.address,e.storageKeys]))}function ir(e,t){if(null!=e.gasPrice){const t=l.gH.from(e.gasPrice),r=l.gH.from(e.maxFeePerGas||0);t.eq(r)||Gt.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[tr(e.chainId||0,"chainId"),tr(e.nonce||0,"nonce"),tr(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),tr(e.maxFeePerGas||0,"maxFeePerGas"),tr(e.gasLimit||0,"gasLimit"),null!=e.to?B(e.to):"0x",tr(e.value||0,"value"),e.data||"0x",or(e.accessList||[])];if(t){const e=(0,c.splitSignature)(t);r.push(tr(e.recoveryParam,"recoveryParam")),r.push((0,c.stripZeros)(e.r)),r.push((0,c.stripZeros)(e.s))}return(0,c.hexConcat)(["0x02",_(r)])}function ar(e,t){const r=[tr(e.chainId||0,"chainId"),tr(e.nonce||0,"nonce"),tr(e.gasPrice||0,"gasPrice"),tr(e.gasLimit||0,"gasLimit"),null!=e.to?B(e.to):"0x",tr(e.value||0,"value"),e.data||"0x",or(e.accessList||[])];if(t){const e=(0,c.splitSignature)(t);r.push(tr(e.recoveryParam,"recoveryParam")),r.push((0,c.stripZeros)(e.r)),r.push((0,c.stripZeros)(e.s))}return(0,c.hexConcat)(["0x01",_(r)])}function sr(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&Gt.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){(0,f.checkProperties)(e,Jt);const r=[];Yt.forEach((function(t){let n=e[t.name]||[];const o={};t.numeric&&(o.hexPad="left"),n=(0,c.arrayify)((0,c.hexlify)(n,o)),t.length&&n.length!==t.length&&n.length>0&&Gt.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=(0,c.stripZeros)(n),n.length>t.maxLength&&Gt.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push((0,c.hexlify)(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!==typeof n&&Gt.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!(0,c.isBytesLike)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push((0,c.hexlify)(n)),r.push("0x"),r.push("0x")),!t)return _(r);const o=(0,c.splitSignature)(t);let i=27+o.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),i+=2*n+8,o.v>28&&o.v!==i&&Gt.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):o.v!==i&&Gt.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push((0,c.hexlify)(i)),r.push((0,c.stripZeros)((0,c.arrayify)(o.r))),r.push((0,c.stripZeros)((0,c.arrayify)(o.s))),_(r)}(e,t);switch(e.type){case 1:return ar(e,t);case 2:return ir(e,t)}return Gt.throwError("unsupported transaction type: ".concat(e.type),d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function ur(e,t,r){try{const r=Qt(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(n){Gt.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,c.hexZeroPad)(t[1],32),e.s=(0,c.hexZeroPad)(t[2],32);try{const t=(0,b.keccak256)(r(e));e.from=er(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(n){}}function cr(e){const t=(0,c.arrayify)(e);if(t[0]>127)return function(e){const t=T(e);9!==t.length&&6!==t.length&&Gt.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:Qt(t[0]).toNumber(),gasPrice:Qt(t[1]),gasLimit:Qt(t[2]),to:Zt(t[3]),value:Qt(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=l.gH.from(t[6]).toNumber()}catch(n){return r}if(r.r=(0,c.hexZeroPad)(t[7],32),r.s=(0,c.hexZeroPad)(t[8],32),l.gH.from(r.r).isZero()&&l.gH.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let o=r.v-27;const i=t.slice(0,6);0!==r.chainId&&(i.push((0,c.hexlify)(r.chainId)),i.push("0x"),i.push("0x"),o-=2*r.chainId+8);const a=(0,b.keccak256)(_(i));try{r.from=er(a,{r:(0,c.hexlify)(r.r),s:(0,c.hexlify)(r.s),recoveryParam:o})}catch(n){}r.hash=(0,b.keccak256)(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=T(e.slice(1));8!==t.length&&11!==t.length&&Gt.throwArgumentError("invalid component count for transaction type: 1","payload",(0,c.hexlify)(e));const r={type:1,chainId:Qt(t[0]).toNumber(),nonce:Qt(t[1]).toNumber(),gasPrice:Qt(t[2]),gasLimit:Qt(t[3]),to:Zt(t[4]),value:Qt(t[5]),data:t[6],accessList:nr(t[7])};return 8===t.length||(r.hash=(0,b.keccak256)(e),ur(r,t.slice(8),ar)),r}(t);case 2:return function(e){const t=T(e.slice(1));9!==t.length&&12!==t.length&&Gt.throwArgumentError("invalid component count for transaction type: 2","payload",(0,c.hexlify)(e));const r=Qt(t[2]),n=Qt(t[3]),o={type:2,chainId:Qt(t[0]).toNumber(),nonce:Qt(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Qt(t[4]),to:Zt(t[5]),value:Qt(t[6]),data:t[7],accessList:nr(t[8])};return 9===t.length||(o.hash=(0,b.keccak256)(e),ur(o,t.slice(9),ir)),o}(t)}return Gt.throwError("unsupported transaction type: ".concat(t[0]),d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var lr=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const fr=new d.Logger("contracts/5.7.0"),dr={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function hr(e,t){return lr(this,void 0,void 0,(function*(){const r=yield t;"string"!==typeof r&&fr.throwArgumentError("invalid address or ENS name","name",r);try{return B(r)}catch(o){}e||fr.throwError("a provider or signer is needed to resolve ENS names",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&fr.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function pr(e,t,r){return lr(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>pr(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield hr(e,t):"tuple"===r.type?yield pr(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>pr(e,t,r.arrayChildren)))):Promise.reject(fr.makeError("invalid value for array",d.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function yr(e,t,r){return lr(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"===typeof r[r.length-1]&&(n=(0,f.shallowCopy)(r.pop())),fr.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=(0,f.resolveProperties)({override:hr(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>lr(this,void 0,void 0,(function*(){return B(e.signer)!==e.override&&fr.throwError("Contract with a Signer cannot override from",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=hr(e.provider,n.from));const o=yield(0,f.resolveProperties)({args:pr(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:(0,f.resolveProperties)(n)||{}}),i=e.interface.encodeFunctionData(t,o.args),a={data:i,to:o.address},s=o.overrides;if(null!=s.nonce&&(a.nonce=l.gH.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=l.gH.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=l.gH.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=l.gH.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=l.gH.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=nr(s.accessList)),null==a.gasLimit&&null!=t.gas){let e=21e3;const r=(0,c.arrayify)(i);for(let t=0;tnull!=n[e]));return u.length&&fr.throwError("cannot override ".concat(u.map((e=>JSON.stringify(e))).join(",")),d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:u}),a}))}function mr(e,t){const r=t.wait.bind(t);t.wait=t=>r(t).then((t=>(t.events=t.logs.map((r=>{let n=(0,f.deepCopy)(r),o=null;try{o=e.interface.parseLog(r)}catch(i){}return o&&(n.args=o.args,n.decode=(t,r)=>e.interface.decodeEventLog(o.eventFragment,t,r),n.event=o.name,n.eventSignature=o.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n})),t)))}function gr(e,t,r){const n=e.signer||e.provider;return function(){for(var o=arguments.length,i=new Array(o),a=0;aArray.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class wr{constructor(e,t){(0,f.defineReadOnly)(this,"tag",e),(0,f.defineReadOnly)(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((r=>!(!t&&r.listener===e)||(t=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const r=e.slice();return setTimeout((()=>{t.listener.apply(this,r)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class Ar extends wr{constructor(){super("error",null)}}class Sr extends wr{constructor(e,t,r,n){const o={address:e};let i=t.getEventTopic(r);n?(i!==n[0]&&fr.throwArgumentError("topic mismatch","topics",n),o.topics=n.slice()):o.topics=[i],super(br(o),o),(0,f.defineReadOnly)(this,"address",e),(0,f.defineReadOnly)(this,"interface",t),(0,f.defineReadOnly)(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=y(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class kr extends wr{constructor(e,t){super("*",{address:e}),(0,f.defineReadOnly)(this,"address",e),(0,f.defineReadOnly)(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(t){}}}class _r{constructor(e,t,r){var n=this;(0,f.defineReadOnly)(this,"interface",(0,f.getStatic)(new.target,"getInterface")(t)),null==r?((0,f.defineReadOnly)(this,"provider",null),(0,f.defineReadOnly)(this,"signer",null)):$e.isSigner(r)?((0,f.defineReadOnly)(this,"provider",r.provider||null),(0,f.defineReadOnly)(this,"signer",r)):Xe.isProvider(r)?((0,f.defineReadOnly)(this,"provider",r),(0,f.defineReadOnly)(this,"signer",null)):fr.throwArgumentError("invalid signer or provider","signerOrProvider",r),(0,f.defineReadOnly)(this,"callStatic",{}),(0,f.defineReadOnly)(this,"estimateGas",{}),(0,f.defineReadOnly)(this,"functions",{}),(0,f.defineReadOnly)(this,"populateTransaction",{}),(0,f.defineReadOnly)(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];(0,f.defineReadOnly)(this.filters,t,(function(){for(var e=arguments.length,t=new Array(e),o=0;o{const r=e[t];1===r.length?(0,f.defineReadOnly)(this.filters,t,this.filters[r[0]]):fr.warn("Duplicate definition of ".concat(t," (").concat(r.join(", "),")"))}))}if((0,f.defineReadOnly)(this,"_runningEvents",{}),(0,f.defineReadOnly)(this,"_wrappedEmits",{}),null==e&&fr.throwArgumentError("invalid contract address or ENS name","addressOrName",e),(0,f.defineReadOnly)(this,"address",e),this.provider)(0,f.defineReadOnly)(this,"resolvedAddress",hr(this.provider,e));else try{(0,f.defineReadOnly)(this,"resolvedAddress",Promise.resolve(B(e)))}catch(a){fr.throwError("provider is required to use ENS name as contract address",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((e=>{}));const o={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])fr.warn("Duplicate ABI entry for ".concat(JSON.stringify(e)));else{i[e]=!0;{const r=t.name;o["%".concat(r)]||(o["%".concat(r)]=[]),o["%".concat(r)].push(e)}null==this[e]&&(0,f.defineReadOnly)(this,e,vr(this,t,!0)),null==this.functions[e]&&(0,f.defineReadOnly)(this.functions,e,vr(this,t,!1)),null==this.callStatic[e]&&(0,f.defineReadOnly)(this.callStatic,e,gr(this,t,!0)),null==this.populateTransaction[e]&&(0,f.defineReadOnly)(this.populateTransaction,e,function(e,t){return function(){for(var r=arguments.length,n=new Array(r),o=0;o{const t=o[e];if(t.length>1)return;e=e.substring(1);const r=t[0];try{null==this[e]&&(0,f.defineReadOnly)(this,e,this[r])}catch(n){}null==this.functions[e]&&(0,f.defineReadOnly)(this.functions,e,this.functions[r]),null==this.callStatic[e]&&(0,f.defineReadOnly)(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&(0,f.defineReadOnly)(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&(0,f.defineReadOnly)(this.estimateGas,e,this.estimateGas[r])}))}static getContractAddress(e){return j(e)}static getInterface(e){return Ve.isInterface(e)?e:new Ve(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&fr.throwError("contract not deployed",d.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||fr.throwError("sending a transactions require a signer",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=(0,f.shallowCopy)(e||{});return["from","to"].forEach((function(e){null!=t[e]&&fr.throwError("cannot override "+e,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"===typeof e&&(e=new et(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&(0,f.defineReadOnly)(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return ze.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"===typeof e){if("error"===e)return this._normalizeRunningEvent(new Ar);if("event"===e)return this._normalizeRunningEvent(new wr("event",null));if("*"===e)return this._normalizeRunningEvent(new kr(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new Sr(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!==typeof t)throw new Error("invalid topic");const r=this.interface.getEvent(t);return this._normalizeRunningEvent(new Sr(this.address,this.interface,r,e.topics))}catch(t){}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new wr(br(r),r))}return this._normalizeRunningEvent(new kr(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){const n=(0,f.deepCopy)(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||fr.throwError("events require a provider or a signer with a provider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{const t=e.getEmit(n);this.emit(e.filter,...t)}catch(o){n.decodeError=o.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r)}}queryFilter(e,t,r){const n=this._getRunningEvent(e),o=(0,f.shallowCopy)(n.filter);return"string"===typeof t&&(0,c.isHexString)(t,32)?(null!=r&&fr.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),o.blockHash=t):(o.fromBlock=null!=t?t:0,o.toBlock=null!=r?r:"latest"),this.provider.getLogs(o).then((e=>e.map((e=>this._wrapEvent(n,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e){if(!this.provider)return!1;const t=this._getRunningEvent(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o0;return this._checkRunningEvents(t),i}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class Er extends _r{}class xr{constructor(e,t,r){let n=null;n="string"===typeof t?t:(0,c.isBytes)(t)?(0,c.hexlify)(t):t&&"string"===typeof t.object?t.object:"!","0x"!==n.substring(0,2)&&(n="0x"+n),(!(0,c.isHexString)(n)||n.length%2)&&fr.throwArgumentError("invalid bytecode","bytecode",t),r&&!$e.isSigner(r)&&fr.throwArgumentError("invalid signer","signer",r),(0,f.defineReadOnly)(this,"bytecode",n),(0,f.defineReadOnly)(this,"interface",(0,f.getStatic)(new.target,"getInterface")(e)),(0,f.defineReadOnly)(this,"signer",r||null)}getDeployTransaction(){let e={};for(var t=arguments.length,r=new Array(t),n=0;n{null!=e[t]&&fr.throwError("cannot override "+t,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.value){l.gH.from(e.value).isZero()||this.interface.deploy.payable||fr.throwError("non-payable constructor cannot override value",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:e.value})}return fr.checkArgumentCount(r.length,this.interface.deploy.inputs.length," in Contract constructor"),e.data=(0,c.hexlify)((0,c.concat)([this.bytecode,this.interface.encodeDeploy(r)])),e}deploy(){for(var e=arguments.length,t=new Array(e),r=0;r256||t[2]&&t[2]!==String(n))&&Cr.throwArgumentError("invalid numeric width","type",e);const o=jr.mask(r?n-1:n),i=r?o.add(Lr).mul(Br):Nr;return function(t){const r=l.gH.from(t);return(r.lt(i)||r.gt(o))&&Cr.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),(0,c.hexZeroPad)(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&Cr.throwArgumentError("invalid bytes width","type",e),function(t){return(0,c.arrayify)(t).length!==r&&Cr.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){const t=(0,c.arrayify)(e),r=t.length%32;return r?(0,c.hexConcat)([t,Mr.slice(r)]):(0,c.hexlify)(t)}(t)}}}switch(e){case"address":return function(e){return(0,c.hexZeroPad)(B(e),32)};case"bool":return function(e){return e?Ur:Fr};case"bytes":return function(e){return(0,b.keccak256)(e)};case"string":return function(e){return D(e)}}return null}function Kr(e,t){return"".concat(e,"(").concat(t.map((e=>{let{name:t,type:r}=e;return r+" "+t})).join(","),")")}class Wr{constructor(e){(0,f.defineReadOnly)(this,"types",Object.freeze((0,f.deepCopy)(e))),(0,f.defineReadOnly)(this,"_encoderCache",{}),(0,f.defineReadOnly)(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const i in e){const n={};e[i].forEach((o=>{n[o.name]&&Cr.throwArgumentError("duplicate variable name ".concat(JSON.stringify(o.name)," in ").concat(JSON.stringify(i)),"types",e),n[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===i&&Cr.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",e);Vr(a)||(r[a]||Cr.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",e),r[a].push(i),t[i][a]=!0)}))}const o=Object.keys(r).filter((e=>0===r[e].length));0===o.length?Cr.throwArgumentError("missing primary type","types",e):o.length>1&&Cr.throwArgumentError("ambiguous primary types or unused types: ".concat(o.map((e=>JSON.stringify(e))).join(", ")),"types",e),(0,f.defineReadOnly)(this,"primaryType",o[0]),function o(i,a){a[i]&&Cr.throwArgumentError("circular type reference to ".concat(JSON.stringify(i)),"types",e),a[i]=!0,Object.keys(t[i]).forEach((e=>{r[e]&&(o(e,a),Object.keys(a).forEach((t=>{n[t][e]=!0})))})),delete a[i]}(this.primaryType,{});for(const i in n){const t=Object.keys(n[i]);t.sort(),this._types[i]=Kr(i,e[i])+t.map((t=>Kr(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=Vr(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&Cr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let o=t.map(r);return this._types[e]&&(o=o.map(b.keccak256)),(0,b.keccak256)((0,c.hexConcat)(o))}}const r=this.types[e];if(r){const t=D(this._types[e]);return e=>{const n=r.map((t=>{let{name:r,type:n}=t;const o=this.getEncoder(n)(e[r]);return this._types[n]?(0,b.keccak256)(o):o}));return n.unshift(t),(0,c.hexConcat)(n)}}return Cr.throwArgumentError("unknown type: ".concat(e),"type",e)}encodeType(e){const t=this._types[e];return t||Cr.throwArgumentError("unknown type: ".concat(JSON.stringify(e)),"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,b.keccak256)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(Vr(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],o=parseInt(n[3]);return o>=0&&t.length!==o&&Cr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const o=this.types[e];return o?o.reduce(((e,n)=>{let{name:o,type:i}=n;return e[o]=this._visit(i,t[o],r),e}),{}):Cr.throwArgumentError("unknown type: ".concat(e),"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Wr(e)}static getPrimaryType(e){return Wr.from(e).primaryType}static hashStruct(e,t,r){return Wr.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=Dr[r];n||Cr.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(r)),"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>zr.indexOf(e.name)-zr.indexOf(t.name))),Wr.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return(0,c.hexConcat)(["0x1901",Wr.hashDomain(e),Wr.from(t).hash(r)])}static hash(e,t,r){return(0,b.keccak256)(Wr.encode(e,t,r))}static resolveNames(e,t,r,n){return Ir(this,void 0,void 0,(function*(){e=(0,f.shallowCopy)(e);const o={};e.verifyingContract&&!(0,c.isHexString)(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const i=Wr.from(t);i.visit(r,((e,t)=>("address"!==e||(0,c.isHexString)(t,20)||(o[t]="0x"),t)));for(const e in o)o[e]=yield n(e);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),r=i.visit(r,((e,t)=>"address"===e&&o[t]?o[t]:t)),{domain:e,value:r}}))}static getPayload(e,t,r){Wr.hashDomain(e);const n={},o=[];zr.forEach((t=>{const r=e[t];null!=r&&(n[t]=Hr[t](r),o.push({name:t,type:Dr[t]}))}));const i=Wr.from(t),a=(0,f.shallowCopy)(t);return a.EIP712Domain?Cr.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):a.EIP712Domain=o,i.encode(r),{types:a,domain:n,primaryType:i.primaryType,message:i.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return(0,c.hexlify)((0,c.arrayify)(t));if(e.match(/^u?int/))return l.gH.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!==typeof t&&Cr.throwArgumentError("invalid string","value",t),t}return Cr.throwArgumentError("unsupported type","type",e)}))}}}class Gr{constructor(e){(0,f.defineReadOnly)(this,"alphabet",e),(0,f.defineReadOnly)(this,"base",e.length),(0,f.defineReadOnly)(this,"_alphabetMap",{}),(0,f.defineReadOnly)(this,"_leader",e.charAt(0));for(let t=0;t0;)r.push(e%this.base),e=e/this.base|0}let n="";for(let o=0;0===t[o]&&o=0;--o)n+=this.alphabet[r[o]];return n}decode(e){if("string"!==typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r>=8;for(;o>0;)t.push(255&o),o>>=8}for(let r=0;e[r]===this._leader&&r>24&255,u[t.length+1]=d>>16&255,u[t.length+2]=d>>8&255,u[t.length+3]=255&d;let h=(0,c.arrayify)(en(o,e,u));i||(i=h.length,f=new Uint8Array(i),a=Math.ceil(n/i),l=n-(a-1)*i),f.set(h);for(let t=1;t=256)throw new Error("Depth too large!");return yn((0,c.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,c.hexlify)(this.depth),this.parentFingerprint,(0,c.hexZeroPad)((0,c.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,c.concat)(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new bn(gn,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(e&~dn));const r=new Uint8Array(37);if(e&dn){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set((0,c.arrayify)(this.privateKey),1),t&&(t+="'")}else r.set((0,c.arrayify)(this.publicKey));for(let c=24;c>=0;c-=8)r[33+(c>>3)]=e>>24-c&255;const n=(0,c.arrayify)(en(Zr.sha512,this.chainCode,r)),o=n.slice(0,32),i=n.slice(32);let a=null,s=null;if(this.privateKey)a=pn(l.gH.from(o).add(this.privateKey).mod(ln));else{s=new Vt((0,c.hexlify)(o))._addPoint(this.publicKey)}let u=t;const f=this.mnemonic;return f&&(u=Object.freeze({phrase:f.phrase,path:t,locale:f.locale||"en"})),new bn(gn,a,s,this.fingerprint,pn(i),e,this.depth+1,u)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let n=0;n=dn)throw new Error("invalid path index - "+e);r=r._derive(dn+t)}else{if(!e.match(/^[0-9]+$/))throw new Error("invalid path component - "+e);{const t=parseInt(e);if(t>=dn)throw new Error("invalid path index - "+e);r=r._derive(t)}}}return r}static _fromSeed(e,t){const r=(0,c.arrayify)(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=(0,c.arrayify)(en(Zr.sha512,fn,r));return new bn(gn,pn(n.slice(0,32)),null,"0x00000000",pn(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=Sn(An(e,r=mn(r)),r),bn._fromSeed(wn(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return bn._fromSeed(e,null)}static fromExtendedKey(e){const t=Xr.decode(e);82===t.length&&yn(t.slice(0,78))===e||cn.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=(0,c.hexlify)(t.slice(5,9)),o=parseInt((0,c.hexlify)(t.slice(9,13)).substring(2),16),i=(0,c.hexlify)(t.slice(13,45)),a=t.slice(45,78);switch((0,c.hexlify)(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new bn(gn,null,(0,c.hexlify)(a),n,i,o,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new bn(gn,(0,c.hexlify)(a.slice(1)),null,n,i,o,r,null)}return cn.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function wn(e,t){t||(t="");const r=(0,F.YW)("mnemonic"+t,F.dz.NFKD);return tn((0,F.YW)(e,F.dz.NFKD),r,2048,64,"sha512")}function An(e,t){t=mn(t),cn.checkNormalize();const r=t.split(e);if(r.length%3!==0)throw new Error("invalid mnemonic");const n=(0,c.arrayify)(new Uint8Array(Math.ceil(11*r.length/8)));let o=0;for(let s=0;s>3]|=1<<7-o%8),o++}const i=32*r.length/3,a=hn(r.length/3);if(((0,c.arrayify)(Jr(n.slice(0,i/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return(0,c.hexlify)(n.slice(0,i/8))}function Sn(e,t){if(t=mn(t),(e=(0,c.arrayify)(e)).length%4!==0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let a=0;a8?(r[r.length-1]<<=8,r[r.length-1]|=e[a],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[a]>>8-n,r.push(e[a]&(1<<8-n)-1),n+=3);const o=e.length/4,i=(0,c.arrayify)(Jr(e))[0]&hn(o);return r[r.length-1]<<=o,r[r.length-1]|=i>>8-o,t.join(r.map((e=>t.getWord(e))))}function kn(e,t){try{return An(e,t),!0}catch(r){}return!1}function _n(e){return("number"!==typeof e||e<0||e>=dn||e%1)&&cn.throwArgumentError("invalid account index","index",e),"m/44'/60'/".concat(e,"'/0/0")}const En=new d.Logger("random/5.7.0");const xn=function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof r.g)return r.g;throw new Error("unable to locate global object")}();let Tn=xn.crypto||xn.msCrypto;function Pn(e){(e<=0||e>1024||e%1||e!=e)&&En.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return Tn.getRandomValues(t),(0,c.arrayify)(t)}Tn&&Tn.getRandomValues||(En.warn("WARNING: Missing strong random number source"),Tn={getRandomValues:function(e){return En.throwError("no secure random source avaialble",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var On=r(63651),Rn=r.n(On),In=r(64874),Cn=r.n(In);function Mn(e){return"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),(0,c.arrayify)(e)}function Bn(e,t){for(e=String(e);e.lengtht)),(0,f.defineReadOnly)(this,"address",$t(this.publicKey)),this.address!==B(e.address)&&ro.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;(0,f.defineReadOnly)(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||vn,locale:t.locale||"en"})));const r=this.mnemonic;$t(bn.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&ro.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,f.defineReadOnly)(this,"_mnemonic",(()=>null))}else{if(Vt.isSigningKey(e))"secp256k1"!==e.curve&&ro.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,f.defineReadOnly)(this,"_signingKey",(()=>e));else{"string"===typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new Vt(e);(0,f.defineReadOnly)(this,"_signingKey",(()=>t))}(0,f.defineReadOnly)(this,"_mnemonic",(()=>null)),(0,f.defineReadOnly)(this,"address",$t(this.publicKey))}var r;t&&!Xe.isProvider(t)&&ro.throwArgumentError("invalid provider","provider",t),(0,f.defineReadOnly)(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new no(this,e)}signTransaction(e){return(0,f.resolveProperties)(e).then((t=>{null!=t.from&&(B(t.from)!==this.address&&ro.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest((0,b.keccak256)(sr(t)));return sr(t,r)}))}signMessage(e){return to(this,void 0,void 0,(function*(){return(0,c.joinSignature)(this._signingKey().signDigest(Or(e)))}))}_signTypedData(e,t,r){return to(this,void 0,void 0,(function*(){const n=yield Wr.resolveNames(e,t,r,(e=>(null==this.provider&&ro.throwError("cannot resolve ENS names without a provider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return(0,c.joinSignature)(this._signingKey().signDigest(Wr.hash(n.domain,t,n.value)))}))}encrypt(e,t,r){if("function"!==typeof t||r||(r=t,t={}),r&&"function"!==typeof r)throw new Error("invalid callback");return t||(t={}),function(e,t,r,n){try{if(B(e.address)!==$t(e.privateKey))throw new Error("address/privateKey mismatch");if(zn(e)){const t=e.mnemonic;if(bn.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||vn).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(g){return Promise.reject(g)}"function"!==typeof r||n||(n=r,r={}),r||(r={});const o=(0,c.arrayify)(e.privateKey),i=Nn(t);let a=null,s=null,u=null;if(zn(e)){const t=e.mnemonic;a=(0,c.arrayify)(An(t.phrase,t.locale||"en")),s=t.path||vn,u=t.locale||"en"}let l=r.client;l||(l="ethers.js");let f=null;f=r.salt?(0,c.arrayify)(r.salt):Pn(32);let d=null;if(r.iv){if(d=(0,c.arrayify)(r.iv),16!==d.length)throw new Error("invalid iv")}else d=Pn(16);let h=null;if(r.uuid){if(h=(0,c.arrayify)(r.uuid),16!==h.length)throw new Error("invalid uuid")}else h=Pn(16);let p=1<<17,y=8,m=1;return r.scrypt&&(r.scrypt.N&&(p=r.scrypt.N),r.scrypt.r&&(y=r.scrypt.r),r.scrypt.p&&(m=r.scrypt.p)),Cn().scrypt(i,f,p,y,m,64,n).then((t=>{const r=(t=(0,c.arrayify)(t)).slice(0,16),n=t.slice(16,32),i=t.slice(32,64),g=new(Rn().Counter)(d),v=new(Rn().ModeOfOperation.ctr)(r,g),w=(0,c.arrayify)(v.encrypt(o)),A=(0,b.keccak256)((0,c.concat)([n,w])),S={address:e.address.substring(2).toLowerCase(),id:jn(h),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,c.hexlify)(d).substring(2)},ciphertext:(0,c.hexlify)(w).substring(2),kdf:"scrypt",kdfparams:{salt:(0,c.hexlify)(f).substring(2),n:p,dklen:32,p:m,r:y},mac:A.substring(2)}};if(a){const e=Pn(16),t=new(Rn().Counter)(e),r=new(Rn().ModeOfOperation.ctr)(i,t),n=(0,c.arrayify)(r.encrypt(a)),o=new Date,f=o.getUTCFullYear()+"-"+Bn(o.getUTCMonth()+1,2)+"-"+Bn(o.getUTCDate(),2)+"T"+Bn(o.getUTCHours(),2)+"-"+Bn(o.getUTCMinutes(),2)+"-"+Bn(o.getUTCSeconds(),2)+".0Z";S["x-ethers"]={client:l,gethFilename:"UTC--"+f+"--"+S.address,mnemonicCounter:(0,c.hexlify)(e).substring(2),mnemonicCiphertext:(0,c.hexlify)(n).substring(2),path:s,locale:u,version:"0.1"}}return JSON.stringify(S)}))}(this,e,t,r)}static createRandom(e){let t=Pn(16);e||(e={}),e.extraEntropy&&(t=(0,c.arrayify)((0,c.hexDataSlice)((0,b.keccak256)((0,c.concat)([t,e.extraEntropy])),0,16)));const r=Sn(t,e.locale);return no.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return $n(e,t,r).then((e=>new no(e)))}static fromEncryptedJsonSync(e,t){return new no(eo(e,t))}static fromMnemonic(e,t,r){return t||(t=vn),new no(bn.fromMnemonic(e,null,r).derivePath(t))}}function oo(e,t){return er(Or(e),t)}function io(e,t,r,n){return er(Wr.hash(e,t,r),n)}const ao="0x0000000000000000000000000000000000000000";var so=r(1953);const uo="\u039e",co=new d.Logger("networks/5.7.1");function lo(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(o){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(o){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(o){}if(t.PocketProvider&&"-"!==r.pocket){const i=["goerli","ropsten","rinkeby","sepolia"];try{const o=new t.PocketProvider(e,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(o){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(o){}if(t.AnkrProvider&&"-"!==r.ankr)try{const o=["ropsten"],i=new t.AnkrProvider(e,r.ankr);i.network&&-1===o.indexOf(i.network.name)&&n.push(i)}catch(o){}if(0===n.length)return null;if(t.FallbackProvider){let o=1;return null!=r.quorum?o=r.quorum:"homestead"===e&&(o=2),new t.FallbackProvider(n,o)}return n[0]};return t.renetwork=function(e){return lo(e)},t}function fo(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return fo(e,t)},r}const ho={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:lo("homestead")},po={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:lo("ropsten")},yo={chainId:63,name:"classicMordor",_defaultProvider:fo("https://www.ethercluster.com/mordor","classicMordor")},mo={unspecified:{chainId:0,name:"unspecified"},homestead:ho,mainnet:ho,morden:{chainId:2,name:"morden"},ropsten:po,testnet:po,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:lo("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:lo("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:lo("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:lo("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:fo("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:yo,classicTestnet:yo,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:fo("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:lo("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:lo("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function go(e){if(null==e)return null;if("number"===typeof e){for(const t in mo){const r=mo[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"===typeof e){const t=mo[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=mo[e.name];if(!t)return"number"!==typeof e.chainId&&co.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&co.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var n;return null==r&&t._defaultProvider&&(r=(n=t._defaultProvider)&&"function"===typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}function vo(e){e=atob(e);const t=[];for(let r=0;r0&&Array.isArray(e)?o(e,t-1):r.push(e)}))};return o(e,t),r}function Ao(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),o=1,i=[0,1];for(let w=1;w>--u&1}const f=Math.pow(2,31),d=f>>>1,h=d>>1,p=f-1;let y=0;for(let w=0;w<31;w++)y=y<<1|l();let m=[],g=0,v=f;for(;;){let e=Math.floor(((y-g+1)*o-1)/v),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e>>1|l(),a=a<<1^d,s=(s^d)<<1|d|1;g=a,v=1+s-a}let b=n-4;return m.map((t=>{switch(t-b){case 3:return b+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return b+256+(e[s++]<<8|e[s++]);case 1:return b+e[s++];default:return t-1}}))}(e))}function So(e){return 1&e?~e>>1:e>>1}function ko(e,t){let r=Array(e);for(let n=0,o=-1;nt[e])):r}function xo(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let o=0;on[t].push(e)));return n}function To(e,t){let r=1+t(),n=t(),o=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return wo(xo(o.length,1+e,t).map(((e,t)=>{const i=e[0],a=e.slice(1);return Array(o[t]).fill(void 0).map(((e,t)=>{let o=t*n;return[i+t*r,a.map((e=>e+o))]}))})))}function Po(e,t){return xo(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const Oo=Ao(vo("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),Ro=new Set(Eo(Oo)),Io=new Set(Eo(Oo)),Co=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(To(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(Po(r,e))}return function(e){const t={};for(let r=0;re-t));return function r(){let n=[];for(;;){let o=Eo(e,t);if(0==o.length)break;n.push({set:new Set(o),node:r()})}n.sort(((e,t)=>t.set.size-e.set.size));let o=e(),i=o%3;o=o/3|0;let a=!!(1&o);return o>>=1,{branches:n,valid:i,fe0f:a,save:1==o,check:2==o}}()}(Oo),Bo=45,No=95;function Lo(e){return(0,F.dg)(e)}function jo(e){return e.filter((e=>65039!=e))}function Uo(e){for(let r of e.split(".")){let e=Lo(r);try{for(let t=e.lastIndexOf(No)-1;t>=0;t--)if(e[t]!==No)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===Bo&&e[3]===Bo)throw new Error("invalid label extension")}catch(t){throw new Error('Invalid label "'.concat(r,'": ').concat(t.message))}}return e}function Fo(e){return Uo(function(e,t){let r=Lo(e).reverse(),n=[];for(;r.length;){let e=Do(r);if(e){n.push(...t(e));continue}let o=r.pop();if(Ro.has(o)){n.push(o);continue}if(Io.has(o))continue;let i=Co[o];if(!i)throw new Error("Disallowed codepoint: 0x".concat(o.toString(16).toUpperCase()));n.push(...i)}return Uo((o=String.fromCodePoint(...n),o.normalize("NFC")));var o}(e,jo))}function Do(e,t){var r;let n,o,i=Mo,a=[],s=e.length;for(t&&(t.length=0);s;){let u=e[--s];if(i=null===(r=i.branches.find((e=>e.set.has(u))))||void 0===r?void 0:r.node,!i)break;if(i.save)o=u;else if(i.check&&u===o)break;a.push(u),i.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),i.valid&&(n=a.slice(),2==i.valid&&n.splice(1,1),t&&t.push(...e.slice(s).reverse()),e.length=s)}return n}const zo=new d.Logger(Rr),qo=new Uint8Array(32);function Ho(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Vo(e){const t=(0,F.YW)(Fo(e)),r=[];if(0===e.length)return r;let n=0;for(let o=0;o=t.length)throw new Error("invalid ENS name; empty component");return r.push(Ho(t.slice(n))),r}function Ko(e){try{return 0!==Vo(e).length}catch(t){}return!1}function Wo(e){"string"!==typeof e&&zo.throwArgumentError("invalid ENS name; not a string","name",e);let t=qo;const r=Vo(e);for(;r.length;)t=(0,b.keccak256)((0,c.concat)([t,(0,b.keccak256)(r.pop())]));return(0,c.hexlify)(t)}function Go(e){return(0,c.hexlify)((0,c.concat)(Vo(e).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}qo.fill(0);var Xo=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};function Zo(e,t){return Xo(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const n=yield fetch(e,r),o=yield n.arrayBuffer(),i={};return n.headers.forEach?n.headers.forEach(((e,t)=>{i[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{i[e.toLowerCase()]=n.headers.get(e)})),{headers:i,statusCode:n.status,statusMessage:n.statusText,body:(0,c.arrayify)(new Uint8Array(o))}}))}var Qo=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const Yo=new d.Logger("web/5.7.1");function Jo(e){return new Promise((t=>{setTimeout(t,e)}))}function $o(e,t){if(null==e)return null;if("string"===typeof e)return e;if((0,c.isBytesLike)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,F._v)(e)}catch(r){}return(0,c.hexlify)(e)}return e}function ei(e,t,r){const n="object"===typeof e&&null!=e.throttleLimit?e.throttleLimit:12;Yo.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const o="object"===typeof e?e.throttleCallback:null,i="object"===typeof e&&"number"===typeof e.throttleSlotInterval?e.throttleSlotInterval:100;Yo.assertArgument(i>0&&i%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",i);const a="object"===typeof e&&!!e.errorPassThrough,s={};let u=null;const c={method:"GET"};let l=!1,h=12e4;if("string"===typeof e)u=e;else if("object"===typeof e){if(null!=e&&null!=e.url||Yo.throwArgumentError("missing URL","connection.url",e),u=e.url,"number"===typeof e.timeout&&e.timeout>0&&(h=e.timeout),e.headers)for(const t in e.headers)s[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(l=!0);if(c.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==u.substring(0,6)&&!0!==e.allowInsecureAuthentication&&Yo.throwError("basic authentication requires a secure https url",d.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+bo((0,F.YW)(t))}}null!=e.skipFetchSetup&&(c.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(c.fetchOptions=(0,f.shallowCopy)(e.fetchOptions))}const p=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),y=u?u.match(p):null;if(y)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":y[1]||"text/plain"},body:y[2]?vo(y[3]):(m=y[3],(0,F.YW)(m.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(w){Yo.throwError("processing response error",d.Logger.errors.SERVER_ERROR,{body:$o(y[1],y[2]),error:w,requestBody:null,requestMethod:"GET",url:u})}var m;t&&(c.method="POST",c.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));const g={};Object.keys(s).forEach((e=>{const t=s[e];g[t.key]=t.value})),c.headers=g;const v=function(){let e=null;return{promise:new Promise((function(t,r){h&&(e=setTimeout((()=>{null!=e&&(e=null,r(Yo.makeError("timeout",d.Logger.errors.TIMEOUT,{requestBody:$o(c.body,g["content-type"]),requestMethod:c.method,timeout:h,url:u})))}),h))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),b=function(){return Qo(this,void 0,void 0,(function*(){for(let e=0;e=300)&&(v.cancel(),Yo.throwError("bad response",d.Logger.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:$o(s,t.headers?t.headers["content-type"]:null),requestBody:$o(c.body,g["content-type"]),requestMethod:c.method,url:u})),r)try{const e=yield r(s,t);return v.cancel(),e}catch(w){if(w.throttleRetry&&e"content-type"===e.toLowerCase())).length||(r.headers=(0,f.shallowCopy)(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return ei(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse((0,F._v)(e))}catch(o){Yo.throwError("invalid JSON",d.Logger.errors.SERVER_ERROR,{body:e,error:o})}return r&&(n=r(n,t)),n}))}function ri(e,t){return t||(t={}),null==(t=(0,f.shallowCopy)(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let o=null,i=!1;const a=()=>!i&&(i=!0,o&&clearTimeout(o),!0);t.timeout&&(o=setTimeout((()=>{a()&&n(new Error("timeout"))}),t.timeout));const s=t.retryLimit;let u=0;!function o(){return e().then((function(e){if(void 0!==e)a()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",o);else if(t.onceBlock)t.onceBlock.once("block",o);else if(!i){if(u++,u>s)return void(a()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));et.ceiling&&(e=t.ceiling),setTimeout(o,e)}return null}),(function(e){a()&&n(e)}))}()}))}var ni=r(72943),oi=r.n(ni);const ii="providers/5.7.2",ai=new d.Logger(ii);class si{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),o=this.data.bind(this),i=this.hash.bind(this),a=this.hex.bind(this),s=this.number.bind(this),u=this.type.bind(this);return e.transaction={hash:i,type:u,accessList:si.allowNull(this.accessList.bind(this),null),blockHash:si.allowNull(i,null),blockNumber:si.allowNull(s,null),transactionIndex:si.allowNull(s,null),confirmations:si.allowNull(s,null),from:t,gasPrice:si.allowNull(r),maxPriorityFeePerGas:si.allowNull(r),maxFeePerGas:si.allowNull(r),gasLimit:r,to:si.allowNull(t,null),value:r,nonce:s,data:o,r:si.allowNull(this.uint256),s:si.allowNull(this.uint256),v:si.allowNull(s),creates:si.allowNull(t,null),raw:si.allowNull(o)},e.transactionRequest={from:si.allowNull(t),nonce:si.allowNull(s),gasLimit:si.allowNull(r),gasPrice:si.allowNull(r),maxPriorityFeePerGas:si.allowNull(r),maxFeePerGas:si.allowNull(r),to:si.allowNull(t),value:si.allowNull(r),data:si.allowNull((e=>this.data(e,!0))),type:si.allowNull(s),accessList:si.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:i,address:t,topics:si.arrayOf(i),data:o,logIndex:s,blockHash:i},e.receipt={to:si.allowNull(this.address,null),from:si.allowNull(this.address,null),contractAddress:si.allowNull(t,null),transactionIndex:s,root:si.allowNull(a),gasUsed:r,logsBloom:si.allowNull(o),blockHash:i,transactionHash:i,logs:si.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:si.allowNull(s,null),cumulativeGasUsed:r,effectiveGasPrice:si.allowNull(r),status:si.allowNull(s),type:u},e.block={hash:si.allowNull(i),parentHash:i,number:s,timestamp:s,nonce:si.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:si.allowNull(t),extraData:o,transactions:si.allowNull(si.arrayOf(i)),baseFeePerGas:si.allowNull(r)},e.blockWithTransactions=(0,f.shallowCopy)(e.block),e.blockWithTransactions.transactions=si.allowNull(si.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:si.allowNull(n,void 0),toBlock:si.allowNull(n,void 0),blockHash:si.allowNull(i,void 0),address:si.allowNull(t,void 0),topics:si.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:si.allowNull(s),blockHash:si.allowNull(i),transactionIndex:s,removed:si.allowNull(this.boolean.bind(this)),address:t,data:si.allowFalsish(o,"0x"),topics:si.arrayOf(i),transactionHash:i,logIndex:s},e}accessList(e){return nr(e||[])}number(e){return"0x"===e?0:l.gH.from(e).toNumber()}type(e){return"0x"===e||null==e?0:l.gH.from(e).toNumber()}bigNumber(e){return l.gH.from(e)}boolean(e){if("boolean"===typeof e)return e;if("string"===typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"===typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),(0,c.isHexString)(e))?e.toLowerCase():ai.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!==0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return B(e)}callAddress(e){if(!(0,c.isHexString)(e,32))return null;const t=B((0,c.hexDataSlice)(e,12));return t===ao?null:t}contractAddress(e){return j(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"===typeof e||(0,c.isHexString)(e))return(0,c.hexValue)(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==(0,c.hexDataLength)(r)?ai.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=l.gH.from(e);try{return t.toNumber()}catch(r){}return null}uint256(e){if(!(0,c.isHexString)(e))throw new Error("invalid uint256");return(0,c.hexZeroPad)(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=si.check(t,e);return n._difficulty=null==r?null:l.gH.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return si.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&l.gH.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=si.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;(0,c.isHexString)(r)&&(r=l.gH.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),(0,c.isHexString)(r)&&(r=l.gH.from(r).toNumber()),"number"!==typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!==typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return cr(e)}receiptLog(e){return si.check(this.formats.receiptLog,e)}receipt(e){const t=si.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=l.gH.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&ai.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):ai.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&ai.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return si.check(this.formats.filter,e)}filterLog(e){return si.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const o in e)try{const n=e[o](t[o]);void 0!==n&&(r[o]=n)}catch(n){throw n.checkKey=o,n.checkValue=t[o],n}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}function ui(e){return e&&"function"===typeof e.isCommunityResource}function ci(e){return ui(e)&&e.isCommunityResource()}let li=!1;function fi(){li||(li=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var di=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const hi=new d.Logger(ii);function pi(e){return null==e?"null":(32!==(0,c.hexDataLength)(e)&&hi.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function yi(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[pi(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return pi(e)})).join("&")}function mi(e){if("string"===typeof e){if(e=e.toLowerCase(),32===(0,c.hexDataLength)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+yi(e);if(Ge.isForkEvent(e))throw hi.warn("not implemented"),new Error("not implemented");if(e&&"object"===typeof e)return"filter:"+(e.address||"*")+":"+yi(e.topics||[])}throw new Error("invalid event - "+e)}function gi(){return(new Date).getTime()}function vi(e){return new Promise((t=>{setTimeout(t,e)}))}const bi=["block","network","pending","poll"];class wi{constructor(e,t,r){(0,f.defineReadOnly)(this,"tag",e),(0,f.defineReadOnly)(this,"listener",t),(0,f.defineReadOnly)(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const o={};return r.length>0&&(o.topics=r),t&&"*"!==t&&(o.address=t),o}pollable(){return this.tag.indexOf(":")>=0||bi.indexOf(this.tag)>=0}}const Ai={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Si(e){return(0,c.hexZeroPad)(l.gH.from(e).toHexString(),32)}function ki(e){return Xr.encode((0,c.concat)([e,(0,c.hexDataSlice)(Jr(Jr(e)),0,4)]))}const _i=new RegExp("^(ipfs)://(.*)$","i"),Ei=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),_i,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function xi(e,t){try{return(0,F._v)(Ti(e,t))}catch(r){}return null}function Ti(e,t){if("0x"===e)return null;const r=l.gH.from((0,c.hexDataSlice)(e,t,t+32)).toNumber(),n=l.gH.from((0,c.hexDataSlice)(e,r,r+32)).toNumber();return(0,c.hexDataSlice)(e,r+32,r+32+n)}function Pi(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):hi.throwArgumentError("unsupported IPFS format","link",e),"https://gateway.ipfs.io/ipfs/".concat(e)}function Oi(e){const t=(0,c.arrayify)(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function Ri(e){if(e.length%32===0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function Ii(e){const t=[];let r=0;for(let n=0;nl.gH.from(e).eq(1))).catch((e=>{if(e.code===d.Logger.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return di(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:(0,c.hexConcat)([e,Wo(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=(0,c.hexConcat)(["0x9061b923",Ii([Go(this.name),r.data])]));try{let e=yield this.provider.call(r);return(0,c.arrayify)(e).length%32===4&&hi.throwError("resolver threw error",d.Logger.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=Ti(e,0)),e}catch(o){if(o.code===d.Logger.errors.CALL_EXCEPTION)return null;throw o}}))}_fetchBytes(e,t){return di(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?Ti(r,0):null}))}_getAddress(e,t){const r=Ai[String(e)];if(null==r&&hi.throwError("unsupported coin type: ".concat(e),d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")")}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=(0,c.arrayify)(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return ki((0,c.concat)([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return ki((0,c.concat)([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=oi().toWords(n.slice(2));return e.unshift(t),oi().encode(r.prefix,e)}}return null}getAddress(e){return di(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===so.j?null:this.provider.formatter.callAddress(e)}catch(n){if(n.code===d.Logger.errors.CALL_EXCEPTION)return null;throw n}const t=yield this._fetchBytes("0xf1cb7e06",Si(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&hi.throwError("invalid or unsupported coin data",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")"),coinType:e,data:t}),r}))}getAvatar(){return di(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;re[t]))}return hi.throwError("invalid or unsupported content hash data",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return di(this,void 0,void 0,(function*(){let t=(0,F.YW)(e);t=(0,c.concat)([Si(64),Si(t.length),t]),t.length%32!==0&&(t=(0,c.concat)([t,(0,c.hexZeroPad)("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",(0,c.hexlify)(t));return null==r||"0x"===r?null:(0,F._v)(r)}))}}let Mi=null,Bi=1;class Ni extends Xe{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),(0,f.defineReadOnly)(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=(0,f.getStatic)(new.target,"getNetwork")(e);t?((0,f.defineReadOnly)(this,"_network",t),this.emit("network",t,null)):hi.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return di(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(e){}null==t&&(t=yield this.detectNetwork()),t||hi.throwError("no network detected",d.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:(0,f.defineReadOnly)(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return ri((()=>this._ready().then((e=>e),(e=>{if(e.code!==d.Logger.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==Mi&&(Mi=new si),Mi}static getNetwork(e){return go(null==e?"homestead":e)}ccipReadFetch(e,t,r){return di(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),o=t.toLowerCase(),i=[];for(let e=0;e=0?null:JSON.stringify({data:o,sender:n}),u=yield ti({url:a,errorPassThrough:!0},s,((e,t)=>(e.status=t.statusCode,e)));if(u.data)return u.data;const c=u.message||"unknown error";if(u.status>=400&&u.status<500)return hi.throwError("response not found during CCIP fetch: ".concat(c),d.Logger.errors.SERVER_ERROR,{url:t,errorMessage:c});i.push(c)}return hi.throwError("error encountered during CCIP fetch: ".concat(i.map((e=>JSON.stringify(e))).join(", ")),d.Logger.errors.SERVER_ERROR,{urls:r,errorMessages:i})}))}_getInternalBlockNumber(e){return di(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(gi()-r.respTime<=e)return r.blockNumber;break}catch(n){if(this._internalBlockNumber===t)break}}const t=gi(),r=(0,f.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((e=>{let{blockNumber:n,networkError:o}=e;if(o)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),o;const i=gi();return n=l.gH.from(n).toNumber(),n{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return di(this,void 0,void 0,(function*(){const e=Bi++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(n){return void this.emit("error",n)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)hi.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(r,")")),this.emit("error",hi.makeError("network block skew detected",d.Logger.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;const o=n.toBlock-this._maxFilterBlockRange;o>n.fromBlock&&(n.fromBlock=o),n.fromBlock<0&&(n.fromBlock=0);const i=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(i)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return di(this,void 0,void 0,(function*(){return hi.throwError("provider does not support network detection",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return di(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield vi(0),this._network;const r=hi.makeError("underlying network changed",d.Logger.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!==typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=gi();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return di(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return di(this,void 0,void 0,(function*(){const o=yield this.getTransactionReceipt(e);return(o?o.confirmations:0)>=t?o:new Promise(((o,i)=>{const a=[];let s=!1;const u=function(){return!!s||(s=!0,a.forEach((e=>{e()})),!1)},c=e=>{e.confirmations{this.removeListener(e,c)})),n){let r=n.startBlock,o=null;const c=a=>di(this,void 0,void 0,(function*(){s||(yield vi(1e3),this.getTransactionCount(n.from).then((l=>di(this,void 0,void 0,(function*(){if(!s){if(l<=n.nonce)r=a;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==o&&(o=r-3,o{s||this.once("block",c)})))}));if(s)return;this.once("block",c),a.push((()=>{this.removeListener("block",c)}))}if("number"===typeof r&&r>0){const e=setTimeout((()=>{u()||i(hi.makeError("timeout exceeded",d.Logger.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return di(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return di(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return l.gH.from(e)}catch(t){return hi.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return di(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,f.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return l.gH.from(n)}catch(o){return hi.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:o})}}))}getTransactionCount(e,t){return di(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,f.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return l.gH.from(n).toNumber()}catch(o){return hi.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:o})}}))}getCode(e,t){return di(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,f.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return(0,c.hexlify)(n)}catch(o){return hi.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:o})}}))}getStorageAt(e,t,r){return di(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield(0,f.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>(0,c.hexValue)(e)))}),o=yield this.perform("getStorageAt",n);try{return(0,c.hexlify)(o)}catch(i){return hi.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:o,error:i})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==(0,c.hexDataLength)(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&hi.throwError("Transaction hash mismatch from Provider.sendTransaction.",d.Logger.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>di(this,void 0,void 0,(function*(){let o;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const i=yield this._waitForTransaction(e.hash,t,n,o);return null==i&&0===t?null:(this._emitted["t:"+e.hash]=i.blockNumber,0===i.status&&hi.throwError("transaction failed",d.Logger.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:i}),i)})),n}sendTransaction(e){return di(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>(0,c.hexlify)(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(o){throw o.transaction=r,o.transactionHash=r.hash,o}}))}_getTransactionRequest(e){return di(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?l.gH.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?(0,c.hexlify)(e):null)))})),this.formatter.transactionRequest(yield(0,f.resolveProperties)(r))}))}_getFilter(e){return di(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield(0,f.resolveProperties)(t))}))}_call(e,t,r){return di(this,void 0,void 0,(function*(){r>=10&&hi.throwError("CCIP read exceeded maximum redirections",d.Logger.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,o=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===o.substring(0,10)&&(0,c.hexDataLength)(o)%32===4)try{const i=(0,c.hexDataSlice)(o,4),a=(0,c.hexDataSlice)(i,0,32);l.gH.from(a).eq(n)||hi.throwError("CCIP Read sender did not match",d.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const s=[],u=l.gH.from((0,c.hexDataSlice)(i,32,64)).toNumber(),f=l.gH.from((0,c.hexDataSlice)(i,u,u+32)).toNumber(),h=(0,c.hexDataSlice)(i,u+32);for(let t=0;tdi(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let n=0;nthis._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return di(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return ri((()=>di(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return di(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return ri((()=>di(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return di(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield(0,f.resolveProperties)({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),si.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return di(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return di(this,void 0,void 0,(function*(){if("number"===typeof(e=yield e)&&e<0){e%1&&hi.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return di(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new Ci(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return di(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||hi.throwError("network does not support ENS",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+Wo(e).substring(2)});return this.formatter.callAddress(t)}catch(n){}return null}))}resolveName(e){return di(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(r){if((0,c.isHexString)(e))throw r}"string"!==typeof e&&hi.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return di(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=xi(yield this.call({to:r,data:"0x691f3431"+Wo(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return di(this,void 0,void 0,(function*(){let t=null;if((0,c.isHexString)(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(r,"getAvatar");if(!o)return null;t=new Ci(this,o,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(n){if(n.code!==d.Logger.errors.CALL_EXCEPTION)throw n}try{const e=xi(yield this.call({to:o,data:"0x691f3431"+Wo(r).substring(2)}),0);t=yield this.getResolver(e)}catch(n){if(n.code!==d.Logger.errors.CALL_EXCEPTION)throw n;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return hi.throwError(e+" not implemented",d.Logger.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new wi(mi(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;ne.tag!==a||(setTimeout((()=>{e.listener.apply(this,r)}),0),o=!0,!e.once||(i.push(e),!1)))),i.forEach((e=>{this._stopEvent(e)})),o}listenerCount(e){if(!e)return this._events.length;let t=mi(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=mi(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,o=mi(e);return this._events=this._events.filter((e=>e.tag!==o||e.listener!=t||(!!n||(n=!0,r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=mi(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var Li=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const ji=new d.Logger(ii),Ui=["call","estimateGas"];function Fi(e,t){if(null==e)return null;if("string"===typeof e.message&&e.message.match("reverted")){const r=(0,c.isHexString)(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"===typeof e){for(const r in e){const n=Fi(e[r],t);if(n)return n}return null}if("string"===typeof e)try{return Fi(JSON.parse(e),t)}catch(r){}return null}function Di(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=Fi(t,!0);if(e)return e.data;ji.throwError("missing revert data in call exception; Transaction reverted without a reason string",d.Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=Fi(t.body,!1);null==r&&(r=Fi(t,!1)),r&&ji.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let o=t.message;throw t.code===d.Logger.errors.SERVER_ERROR&&t.error&&"string"===typeof t.error.message?o=t.error.message:"string"===typeof t.body?o=t.body:"string"===typeof t.responseText&&(o=t.responseText),o=(o||"").toLowerCase(),o.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&ji.throwError("insufficient funds for intrinsic transaction cost",d.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),o.match(/nonce (is )?too low/i)&&ji.throwError("nonce has already been used",d.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),o.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&ji.throwError("replacement fee too low",d.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),o.match(/only replay-protected/i)&&ji.throwError("legacy pre-eip-155 transactions not supported",d.Logger.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),Ui.indexOf(e)>=0&&o.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&ji.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function zi(e){return new Promise((function(t){setTimeout(t,e)}))}function qi(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function Hi(e){return e?e.toLowerCase():e}const Vi={};class Ki extends $e{constructor(e,t,r){if(super(),e!==Vi)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");(0,f.defineReadOnly)(this,"provider",t),null==r&&(r=0),"string"===typeof r?((0,f.defineReadOnly)(this,"_address",this.provider.formatter.address(r)),(0,f.defineReadOnly)(this,"_index",null)):"number"===typeof r?((0,f.defineReadOnly)(this,"_index",r),(0,f.defineReadOnly)(this,"_address",null)):ji.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return ji.throwError("cannot alter JSON-RPC Signer connection",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Wi(Vi,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&ji.throwError("unknown account #"+this._index,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=(0,f.shallowCopy)(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=(0,f.shallowCopy)(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>Li(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&ji.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),(0,f.resolveProperties)({tx:(0,f.resolveProperties)(e),sender:t}).then((t=>{let{tx:r,sender:n}=t;null!=r.from?r.from.toLowerCase()!==n&&ji.throwArgumentError("from address mismatch","transaction",e):r.from=n;const o=this.provider.constructor.hexlifyTransaction(r,{from:!0});return this.provider.send("eth_sendTransaction",[o]).then((e=>e),(e=>("string"===typeof e.message&&e.message.match(/user denied/i)&&ji.throwError("user rejected transaction",d.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:r}),Di("sendTransaction",e,o))))}))}signTransaction(e){return ji.throwError("signing transactions is unsupported",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Li(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield ri((()=>Li(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(n){throw n.transactionHash=r,n}}))}signMessage(e){return Li(this,void 0,void 0,(function*(){const t="string"===typeof e?(0,F.YW)(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[(0,c.hexlify)(t),r.toLowerCase()])}catch(n){throw"string"===typeof n.message&&n.message.match(/user denied/i)&&ji.throwError("user rejected signing",d.Logger.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),n}}))}_legacySignMessage(e){return Li(this,void 0,void 0,(function*(){const t="string"===typeof e?(0,F.YW)(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),(0,c.hexlify)(t)])}catch(n){throw"string"===typeof n.message&&n.message.match(/user denied/i)&&ji.throwError("user rejected signing",d.Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),n}}))}_signTypedData(e,t,r){return Li(this,void 0,void 0,(function*(){const n=yield Wr.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),o=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(Wr.getPayload(n.domain,t,n.value))])}catch(i){throw"string"===typeof i.message&&i.message.match(/user denied/i)&&ji.throwError("user rejected signing",d.Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:n.domain,types:t,value:n.value}}),i}}))}unlock(e){return Li(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class Wi extends Ki{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const Gi={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Xi extends Ni{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=(0,f.getStatic)(this.constructor,"defaultUrl")()),"string"===typeof e?(0,f.defineReadOnly)(this,"connection",Object.freeze({url:e})):(0,f.defineReadOnly)(this,"connection",Object.freeze((0,f.shallowCopy)(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Li(this,void 0,void 0,(function*(){yield zi(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(t){}}if(null!=e){const r=(0,f.getStatic)(this.constructor,"getNetwork");try{return r(l.gH.from(e).toNumber())}catch(t){return ji.throwError("could not detect network",d.Logger.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return ji.throwError("could not detect network",d.Logger.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new Ki(Vi,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,f.deepCopy)(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const o=ti(this.connection,JSON.stringify(r),qi).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=o,setTimeout((()=>{this._cache[e]=null}),0)),o}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Hi(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Hi(t.address),t.blockTag]];case"getCode":return["eth_getCode",[Hi(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Hi(t.address),(0,c.hexZeroPad)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[(0,f.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,f.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=Hi(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return Li(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&l.gH.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=(0,f.shallowCopy)(t)).transaction=(0,f.shallowCopy)(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&ji.throwError(e+" not implemented",d.Logger.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(n){return Di(e,n,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return zi(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=(0,f.shallowCopy)(Gi);if(t)for(const o in t)t[o]&&(r[o]=!0);(0,f.checkProperties)(e,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=(0,c.hexValue)(l.gH.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=(0,c.hexlify)(e[t]))})),e.accessList&&(n.accessList=nr(e.accessList)),n}}let Zi=null;try{if(Zi=WebSocket,null==Zi)throw new Error("inject please")}catch(Ss){const e=new d.Logger(ii);Zi=function(){e.throwError("WebSockets not supported in this environment",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var Qi=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const Yi=new d.Logger(ii);let Ji=1;class $i extends Xi{constructor(e,t){"any"===t&&Yi.throwError("WebSocketProvider does not support 'any' network yet",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),super("string"===typeof e?e:"_websocket",t),this._pollingInterval=-1,this._wsReady=!1,"string"===typeof e?(0,f.defineReadOnly)(this,"_websocket",new Zi(this.connection.url)):(0,f.defineReadOnly)(this,"_websocket",e),(0,f.defineReadOnly)(this,"_requests",{}),(0,f.defineReadOnly)(this,"_subs",{}),(0,f.defineReadOnly)(this,"_subIds",{}),(0,f.defineReadOnly)(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach((e=>{this.websocket.send(this._requests[e].payload)}))},this.websocket.onmessage=e=>{const t=e.data,r=JSON.parse(t);if(null!=r.id){const e=String(r.id),n=this._requests[e];if(delete this._requests[e],void 0!==r.result)n.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(n.payload),response:r.result,provider:this});else{let e=null;r.error?(e=new Error(r.error.message||"unknown error"),(0,f.defineReadOnly)(e,"code",r.error.code||null),(0,f.defineReadOnly)(e,"response",t)):e=new Error("unknown error"),n.callback(e,void 0),this.emit("debug",{action:"response",error:e,request:JSON.parse(n.payload),provider:this})}}else if("eth_subscription"===r.method){const e=this._subs[r.params.subscription];e&&e.processFunc(r.params.result)}else console.warn("this should not happen")};const r=setInterval((()=>{this.emit("poll")}),1e3);r.unref&&r.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){Yi.throwError("cannot reset events block on WebSocketProvider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){Yi.throwError("cannot set polling interval on WebSocketProvider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return Qi(this,void 0,void 0,(function*(){return null}))}set polling(e){e&&Yi.throwError("cannot set polling on WebSocketProvider",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,t){const r=Ji++;return new Promise(((n,o)=>{const i=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(i),provider:this}),this._requests[String(r)]={callback:function(e,t){return e?o(e):n(t)},payload:i},this._wsReady&&this.websocket.send(i)}))}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,t,r){return Qi(this,void 0,void 0,(function*(){let n=this._subIds[e];null==n&&(n=Promise.all(t).then((e=>this.send("eth_subscribe",e))),this._subIds[e]=n);const o=yield n;this._subs[o]={tag:e,processFunc:r}}))}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],(e=>{const t=l.gH.from(e.number).toNumber();this._emitted.block=t,this.emit("block",t)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(e=>{this.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(t=>{null==t.removed&&(t.removed=!1),this.emit(e.filter,this.formatter.filterLog(t))}));break;case"tx":{const t=e=>{const t=e.hash;this.getTransactionReceipt(t).then((e=>{e&&this.emit(t,e)}))};t(e),this._subscribe("tx",["newHeads"],(e=>{this._events.filter((e=>"tx"===e.type)).forEach(t)}));break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}_stopEvent(e){let t=e.tag;if("tx"===e.type){if(this._events.filter((e=>"tx"===e.type)).length)return;t="tx"}else if(this.listenerCount(e.event))return;const r=this._subIds[t];r&&(delete this._subIds[t],r.then((e=>{this._subs[e]&&(delete this._subs[e],this.send("eth_unsubscribe",[e]))})))}destroy(){return Qi(this,void 0,void 0,(function*(){this.websocket.readyState===Zi.CONNECTING&&(yield new Promise((e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}}))),this.websocket.close(1e3)}))}}var ea=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const ta=new d.Logger(ii);class ra extends Xi{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return ea(this,void 0,void 0,(function*(){let t=this.network;return null==t&&(t=yield e.detectNetwork.call(this),t||ta.throwError("no network detected",d.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,f.defineReadOnly)(this,"_network",t),this.emit("network",t,null))),t}))}}class na extends ra{constructor(e,t){ta.checkAbstract(new.target,na),e=(0,f.getStatic)(new.target,"getNetwork")(e),t=(0,f.getStatic)(new.target,"getApiKey")(t);super((0,f.getStatic)(new.target,"getUrl")(e,t),e),"string"===typeof t?(0,f.defineReadOnly)(this,"apiKey",t):null!=t&&Object.keys(t).forEach((e=>{(0,f.defineReadOnly)(this,e,t[e])}))}_startPending(){ta.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return ta.throwError("API provider does not support signing",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,t){return ta.throwError("not implemented; sub-classes must override getUrl",d.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const oa=new d.Logger(ii),ia="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class aa extends $i{constructor(e,t){const r=new sa(e,t);super(r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi."),r.network),(0,f.defineReadOnly)(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===ia}}class sa extends na{static getWebSocketProvider(e,t){return new aa(e,t)}static getApiKey(e){return null==e?ia:(e&&"string"!==typeof e&&oa.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,t){let r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:oa.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:(e,r)=>(t===ia&&fi(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===ia}}const ua=new d.Logger(ii),ca="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function la(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return ua.throwArgumentError("unsupported network","name",e)}class fa extends na{isCommunityResource(){return this.apiKey===ca}static getApiKey(e){return null==e?ca:e}static getUrl(e,t){null==t&&(t=ca);const r={allowGzip:!0,url:"https://"+la(e.name)+t,throttleCallback:(e,r)=>(t.apiKey===ca&&fi(),Promise.resolve(!0))};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}}var da=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const ha=new d.Logger(ii);class pa extends na{static getApiKey(e){return null!=e&&ha.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,t){let r=null;if("homestead"===e.name)r="https://cloudflare-eth.com/";else ha.throwArgumentError("unsupported network","network",arguments[0]);return r}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return da(this,void 0,void 0,(function*(){if("getBlockNumber"===e){return(yield r.perform.call(this,"getBlock",{blockTag:"latest"})).number}return r.perform.call(this,e,t)}))}}var ya=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const ma=new d.Logger(ii);function ga(e){const t={};for(let r in e){if(null==e[r])continue;let n=e[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?(0,c.hexValue)((0,c.hexlify)(n)):"accessList"===r?"["+nr(n).map((e=>'{address:"'.concat(e.address,'",storageKeys:["').concat(e.storageKeys.join('","'),'"]}'))).join(",")+"]":(0,c.hexlify)(n),t[r]=n)}return t}function va(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"string"!==typeof e.message||!e.message.match(/^OK/)){const t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function ba(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){const t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){const t=new Error("invalid response");throw t.result=JSON.stringify(e),t}if(e.error){const t=new Error(e.error.message||"unknown error");throw e.error.code&&(t.code=e.error.code),e.error.data&&(t.data=e.error.data),t}return e.result}function wa(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function Aa(e,t,r){if("call"===e&&t.code===d.Logger.errors.SERVER_ERROR){const e=t.error;if(e&&(e.message.match(/reverted/i)||e.message.match(/VM execution error/i))){let r=e.data;if(r&&(r="0x"+r.replace(/^.*0x/i,"")),(0,c.isHexString)(r))return r;ma.throwError("missing revert data in call exception",d.Logger.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}let n=t.message;throw t.code===d.Logger.errors.SERVER_ERROR&&(t.error&&"string"===typeof t.error.message?n=t.error.message:"string"===typeof t.body?n=t.body:"string"===typeof t.responseText&&(n=t.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&ma.throwError("insufficient funds for intrinsic transaction cost",d.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&ma.throwError("nonce has already been used",d.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),n.match(/another transaction with same nonce/)&&ma.throwError("replacement fee too low",d.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&ma.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}class Sa extends Ni{constructor(e,t){super(e),(0,f.defineReadOnly)(this,"baseUrl",this.getBaseUrl()),(0,f.defineReadOnly)(this,"apiKey",t||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return ma.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,t){const r=Object.keys(t).reduce(((e,r)=>{const n=t[r];return null!=n&&(e+="&".concat(r,"=").concat(n)),e}),""),n=this.apiKey?"&apikey=".concat(this.apiKey):"";return"".concat(this.baseUrl,"/api?module=").concat(e).concat(r).concat(n)}getPostUrl(){return"".concat(this.baseUrl,"/api")}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t}fetch(e,t,r){return ya(this,void 0,void 0,(function*(){const n=r?this.getPostUrl():this.getUrl(e,t),o=r?this.getPostData(e,t):null,i="proxy"===e?ba:va;this.emit("debug",{action:"request",request:n,provider:this});const a={url:n,throttleSlotInterval:1e3,throttleCallback:(e,t)=>(this.isCommunityResource()&&fi(),Promise.resolve(!0))};let s=null;o&&(a.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},s=Object.keys(o).map((e=>"".concat(e,"=").concat(o[e]))).join("&"));const u=yield ti(a,s,i||ba);return this.emit("debug",{action:"response",request:n,response:(0,f.deepCopy)(u),provider:this}),u}))}detectNetwork(){return ya(this,void 0,void 0,(function*(){return this.network}))}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return ya(this,void 0,void 0,(function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((e=>Aa("sendTransaction",e,t.signedTransaction)));case"getBlock":if(t.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash});case"call":{if("latest"!==t.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const e=ga(t.transaction);e.module="proxy",e.action="eth_call";try{return yield this.fetch("proxy",e,!0)}catch(Ss){return Aa("call",Ss,t.transaction)}}case"estimateGas":{const e=ga(t.transaction);e.module="proxy",e.action="eth_estimateGas";try{return yield this.fetch("proxy",e,!0)}catch(Ss){return Aa("estimateGas",Ss,t.transaction)}}case"getLogs":{const e={action:"getLogs"};if(t.filter.fromBlock&&(e.fromBlock=wa(t.filter.fromBlock)),t.filter.toBlock&&(e.toBlock=wa(t.filter.toBlock)),t.filter.address&&(e.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&ma.throwError("unsupported topic count",d.Logger.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length)){const r=t.filter.topics[0];"string"===typeof r&&66===r.length||ma.throwError("unsupported topic format",d.Logger.errors.UNSUPPORTED_OPERATION,{topic0:r}),e.topic0=r}const r=yield this.fetch("logs",e);let n={};for(let t=0;t{["contractAddress","to"].forEach((function(t){""==e[t]&&delete e[t]})),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);const t=this.formatter.transactionResponse(e);return e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),t}))}))}isCommunityResource(){return null==this.apiKey}}function ka(e){for(let t=(e=e.slice()).length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}var _a=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const Ea=new d.Logger(ii);function xa(){return(new Date).getTime()}function Ta(e){let t=null;for(let r=0;rt?null:(n+o)/2}function Oa(e){if(null===e)return"null";if("number"===typeof e||"boolean"===typeof e)return JSON.stringify(e);if("string"===typeof e)return e;if(l.gH.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((e=>Oa(e))));if("object"===typeof e){const t=Object.keys(e);return t.sort(),"{"+t.map((t=>{let r=e[t];return r="function"===typeof r?"[function]":Oa(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}let Ra=1;function Ia(e){let t=null,r=null,n=new Promise((n=>{t=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return n},wait:e=>(n=n.then(e),n)}}const Ca=[d.Logger.errors.CALL_EXCEPTION,d.Logger.errors.INSUFFICIENT_FUNDS,d.Logger.errors.NONCE_EXPIRED,d.Logger.errors.REPLACEMENT_UNDERPRICED,d.Logger.errors.UNPREDICTABLE_GAS_LIMIT],Ma=["address","args","errorArgs","errorSignature","method","transaction"];function Ba(e,t){const r={weight:e.weight};return Object.defineProperty(r,"provider",{get:()=>e.provider}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function Na(e,t,r){let n=Oa;switch(t){case"getBlockNumber":return function(t){const r=t.map((e=>e.result));let n=Pa(t.map((e=>e.result)),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber};case"getGasPrice":return function(e){const t=e.map((e=>e.result));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return Pa(e.map((e=>e.result)))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(e){return null==e?null:((e=(0,f.shallowCopy)(e)).confirmations=-1,Oa(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=(0,f.shallowCopy)(e)).transactions=e.transactions.map((e=>((e=(0,f.shallowCopy)(e)).confirmations=-1,e))),Oa(e))}:function(e){return null==e?null:Oa(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(r){const n={};r.forEach((t=>{const r=e(t.result);n[r]||(n[r]={count:0,result:t.result}),n[r].count++}));const o=Object.keys(n);for(let e=0;e=t)return r.result}}}(n,e.quorum)}function La(e,t){return _a(this,void 0,void 0,(function*(){const r=e.provider;return null!=r.blockNumber&&r.blockNumber>=t||-1===t?r:ri((()=>new Promise(((n,o)=>{setTimeout((function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)}),0)}))),{oncePoll:r})}))}function ja(e,t,r,n){return _a(this,void 0,void 0,(function*(){let o=e.provider;switch(r){case"getBlockNumber":case"getGasPrice":return o[r]();case"getEtherPrice":if(o.getEtherPrice)return o.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&(0,c.isHexString)(n.blockTag)&&(o=yield La(e,t)),o[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&(0,c.isHexString)(n.blockTag)&&(o=yield La(e,t)),o.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&(0,c.isHexString)(n.blockTag)&&(o=yield La(e,t)),o[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&(0,c.isHexString)(n.blockTag)&&(o=yield La(e,t)),"call"===r&&n.blockTag?o[r](n.transaction,n.blockTag):o[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return o[r](n.transactionHash);case"getLogs":{let r=n.filter;return(r.fromBlock&&(0,c.isHexString)(r.fromBlock)||r.toBlock&&(0,c.isHexString)(r.toBlock))&&(o=yield La(e,t)),o.getLogs(r)}}return Ea.throwError("unknown method error",d.Logger.errors.UNKNOWN_ERROR,{method:r,params:n})}))}class Ua extends Ni{constructor(e,t){0===e.length&&Ea.throwArgumentError("missing providers","providers",e);const r=e.map(((e,t)=>{if(Xe.isProvider(e)){const t=ci(e)?2e3:750,r=1;return Object.freeze({provider:e,weight:1,stallTimeout:t,priority:r})}const r=(0,f.shallowCopy)(e);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=ci(e)?2e3:750),null==r.weight&&(r.weight=1);const n=r.weight;return(n%1||n>512||n<1)&&Ea.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(t,"].weight"),n),Object.freeze(r)})),n=r.reduce(((e,t)=>e+t.weight),0);null==t?t=n/2:t>n&&Ea.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);let o=Ta(r.map((e=>e.provider.network)));null==o&&(o=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then(e,t)}),0)}))),super(o),(0,f.defineReadOnly)(this,"providerConfigs",Object.freeze(r)),(0,f.defineReadOnly)(this,"quorum",t),this._highestBlockNumber=-1}detectNetwork(){return _a(this,void 0,void 0,(function*(){return Ta(yield Promise.all(this.providerConfigs.map((e=>e.provider.getNetwork()))))}))}perform(e,t){return _a(this,void 0,void 0,(function*(){if("sendTransaction"===e){const e=yield Promise.all(this.providerConfigs.map((e=>e.provider.sendTransaction(t.signedTransaction).then((e=>e.hash),(e=>e)))));for(let t=0;te.priority-t.priority));const o=this._highestBlockNumber;let i=0,a=!0;for(;;){const s=xa();let u=n.filter((e=>e.runner&&s-e.starte+t.weight),0);for(;u{r.staller=null})),r.runner=ja(r,o,e,t).then((n=>{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:Ba(r,xa()),request:{method:e,params:(0,f.deepCopy)(t)},provider:this})}),(n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:Ba(r,xa()),request:{method:e,params:(0,f.deepCopy)(t)},provider:this})})),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:Ba(r,null),request:{method:e,params:(0,f.deepCopy)(t)},provider:this}),u+=r.weight}const c=[];n.forEach((e=>{!e.done&&e.runner&&(c.push(e.runner),e.staller&&c.push(e.staller.getPromise()))})),c.length&&(yield Promise.race(c));const l=n.filter((e=>e.done&&null==e.error));if(l.length>=this.quorum){const e=r(l);if(void 0!==e)return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),e;a||(yield Ia(100).getPromise()),a=!1}const d=n.reduce(((e,t)=>{if(!t.done||null==t.error)return e;const r=t.error.code;return Ca.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{});if(Object.keys(d).forEach((e=>{const t=d[e];if(t.weight{e.staller&&e.staller.cancel(),e.cancelled=!0}));const r=t.error,o={};Ma.forEach((e=>{null!=r[e]&&(o[e]=r[e])})),Ea.throwError(r.reason||r.message,e,o)})),0===n.filter((e=>!e.done)).length)break}return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),Ea.throwError("failed to meet quorum",d.Logger.errors.SERVER_ERROR,{method:e,params:t,results:n.map((e=>Ba(e))),provider:this})}))}}const Fa=null,Da=new d.Logger(ii),za="84842078b09946638c03157f83405213";class qa extends $i{constructor(e,t){const r=new Ha(e,t),n=r.connection;n.password&&Da.throwError("INFURA WebSocket project secrets unsupported",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});super(n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),e),(0,f.defineReadOnly)(this,"apiKey",r.projectId),(0,f.defineReadOnly)(this,"projectId",r.projectId),(0,f.defineReadOnly)(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===za}}class Ha extends na{static getWebSocketProvider(e,t){return new qa(e,t)}static getApiKey(e){const t={apiKey:za,projectId:za,projectSecret:null};return null==e||("string"===typeof e?t.projectId=e:null!=e.projectSecret?(Da.assertArgument("string"===typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),Da.assertArgument("string"===typeof e.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-goerli":r="optimism-goerli.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":r="arbitrum-goerli.infura.io";break;default:Da.throwError("unsupported network",d.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={allowGzip:!0,url:"https://"+r+"/v3/"+t.projectId,throttleCallback:(e,r)=>(t.projectId===za&&fi(),Promise.resolve(!0))};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}isCommunityResource(){return this.projectId===za}}class Va extends Xi{send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);const n={request:r,resolve:null,reject:null},o=new Promise(((e,t)=>{n.resolve=e,n.reject=t}));return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const e=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const t=e.map((e=>e.request));return this.emit("debug",{action:"requestBatch",request:(0,f.deepCopy)(t),provider:this}),ti(this.connection,JSON.stringify(t)).then((r=>{this.emit("debug",{action:"response",request:t,response:r,provider:this}),e.forEach(((e,t)=>{const n=r[t];if(n.error){const t=new Error(n.error.message);t.code=n.error.code,t.data=n.error.data,e.reject(t)}else e.resolve(n.result)}))}),(r=>{this.emit("debug",{action:"response",error:r,request:t,provider:this}),e.forEach((e=>{e.reject(r)}))}))}),10)),o}}const Ka=new d.Logger(ii);class Wa extends na{static getApiKey(e){return e&&"string"!==typeof e&&Ka.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}static getUrl(e,t){Ka.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(e.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Ka.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}const Ga=new d.Logger(ii),Xa="62e1ad51b37b8e00394bda3b";class Za extends na{static getApiKey(e){const t={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==e?t.applicationId=Xa:"string"===typeof e?t.applicationId=e:null!=e.applicationSecretKey?(t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey):e.applicationId?t.applicationId=e.applicationId:Ga.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:Ga.throwError("unsupported network",d.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={headers:{},url:"https://".concat(r,"/v1/lb/").concat(t.applicationId)};return null!=t.applicationSecretKey&&(n.user="",n.password=t.applicationSecretKey),n}isCommunityResource(){return this.applicationId===Xa}}const Qa=new d.Logger(ii);let Ya=1;function Ja(e,t){const r="Web3LegacyFetcher";return function(e,n){const o={method:e,params:n,id:Ya++,jsonrpc:"2.0"};return new Promise(((e,n)=>{this.emit("debug",{action:"request",fetcher:r,request:(0,f.deepCopy)(o),provider:this}),t(o,((t,i)=>{if(t)return this.emit("debug",{action:"response",fetcher:r,error:t,request:o,provider:this}),n(t);if(this.emit("debug",{action:"response",fetcher:r,request:o,response:i,provider:this}),i.error){const e=new Error(i.error.message);return e.code=i.error.code,e.data=i.error.data,n(e)}e(i.result)}))}))}}class $a extends Xi{constructor(e,t){null==e&&Qa.throwArgumentError("missing provider","provider",e);let r=null,n=null,o=null;"function"===typeof e?(r="unknown:",n=e):(r=e.host||e.path||"",!r&&e.isMetaMask&&(r="metamask"),o=e,e.request?(""===r&&(r="eip-1193:"),n=function(e){return function(t,r){null==r&&(r=[]);const n={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,f.deepCopy)(n),provider:this}),e.request(n).then((e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:e,provider:this}),e}))}}(e)):e.sendAsync?n=Ja(0,e.sendAsync.bind(e)):e.send?n=Ja(0,e.send.bind(e)):Qa.throwArgumentError("unsupported provider","provider",e),r||(r="unknown:")),super(r,t),(0,f.defineReadOnly)(this,"jsonRpcFetchFunc",n),(0,f.defineReadOnly)(this,"provider",o)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}const es=new d.Logger(ii);function ts(e,t){if(null==e&&(e="homestead"),"string"===typeof e){const t=e.match(/^(ws|http)s?:/i);if(t)switch(t[1].toLowerCase()){case"http":case"https":return new Xi(e);case"ws":case"wss":return new $i(e);default:es.throwArgumentError("unsupported URL scheme","network",e)}}const r=go(e);return r&&r._defaultProvider||es.throwError("unsupported getDefaultProvider network",d.Logger.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),r._defaultProvider({FallbackProvider:Ua,AlchemyProvider:sa,AnkrProvider:fa,CloudflareProvider:pa,EtherscanProvider:Sa,InfuraProvider:Ha,JsonRpcProvider:Xi,NodesmithProvider:Wa,PocketProvider:Za,Web3Provider:$a,IpcProvider:Fa},t)}const rs=new RegExp("^bytes([0-9]+)$"),ns=new RegExp("^(u?int)([0-9]*)$"),os=new RegExp("^(.*)\\[([0-9]*)\\]$"),is="0000000000000000000000000000000000000000000000000000000000000000",as=new d.Logger("solidity/5.7.0");function ss(e,t,r){switch(e){case"address":return r?(0,c.zeroPad)(t,32):(0,c.arrayify)(t);case"string":return(0,F.YW)(t);case"bytes":return(0,c.arrayify)(t);case"bool":return t=t?"0x01":"0x00",r?(0,c.zeroPad)(t,32):(0,c.arrayify)(t)}let n=e.match(ns);if(n){let o=parseInt(n[2]||"256");return(n[2]&&String(o)!==n[2]||o%8!==0||0===o||o>256)&&as.throwArgumentError("invalid number type","type",e),r&&(o=256),t=l.gH.from(t).toTwos(o),(0,c.zeroPad)(t,o/8)}if(n=e.match(rs),n){const o=parseInt(n[1]);return(String(o)!==n[1]||0===o||o>32)&&as.throwArgumentError("invalid bytes type","type",e),(0,c.arrayify)(t).byteLength!==o&&as.throwArgumentError("invalid value for ".concat(e),"value",t),r?(0,c.arrayify)((t+is).substring(0,66)):t}if(n=e.match(os),n&&Array.isArray(t)){const r=n[1];parseInt(n[2]||String(t.length))!=t.length&&as.throwArgumentError("invalid array length for ".concat(e),"value",t);const o=[];return t.forEach((function(e){o.push(ss(r,e,!0))})),(0,c.concat)(o)}return as.throwArgumentError("invalid type","type",e)}function us(e,t){e.length!=t.length&&as.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(ss(e,t[n]))})),(0,c.hexlify)((0,c.concat)(r))}function cs(e,t){return(0,b.keccak256)(us(e,t))}function ls(e,t){return Jr(us(e,t))}var fs=r(72680),ds=r(82844);const hs=new d.Logger("units/5.7.0"),ps=["wei","kwei","mwei","gwei","szabo","finney","ether"];function ys(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&hs.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let o="";for(2===t.length&&(o="."+(t[1]||"0"));o.length>2&&"0"===o[o.length-1];)o=o.substring(0,o.length-1);const i=[];for(;r.length;){if(r.length<=3){i.unshift(r);break}{const e=r.length-3;i.unshift(r.substring(e)),r=r.substring(0,e)}}return n+i.join(",")+o}function ms(e,t){if("string"===typeof t){const e=ps.indexOf(t);-1!==e&&(t=3*e)}return(0,Tr.gn)(e,null!=t?t:18)}function gs(e,t){if("string"!==typeof e&&hs.throwArgumentError("value must be a string","value",e),"string"===typeof t){const e=ps.indexOf(t);-1!==e&&(t=3*e)}return(0,Tr.gs)(e,null!=t?t:18)}function vs(e){return ms(e,18)}function bs(e){return gs(e,18)}const ws="ethers/5.7.2",As=new d.Logger(ws);try{const e=window;null==e._ethers&&(e._ethers=u)}catch(Ss){}},89262:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,a){if("function"!==typeof n)throw new TypeError("The listener must be a function");var s=new o(n,i||e,a),u=r?r+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 a(e,t){0===--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,i=n.length,a=new Array(i);o{var r;t=e.exports=J,r="object"===typeof process&&{NODE_ENV:"production",PUBLIC_URL:"/allbridge-example-react",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG&&/\bsemver\b/i.test({NODE_ENV:"production",PUBLIC_URL:"/allbridge-example-react",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var n=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,i=n-6,a=t.re=[],s=t.safeRe=[],u=t.src=[],c=0,l="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",n],[l,i]];function d(e){for(var t=0;t)?=?)";var O=c++;u[O]=u[p]+"|x|X|\\*";var R=c++;u[R]=u[h]+"|x|X|\\*";var I=c++;u[I]="[v=\\s]*("+u[R]+")(?:\\.("+u[R]+")(?:\\.("+u[R]+")(?:"+u[w]+")?"+u[k]+"?)?)?";var C=c++;u[C]="[v=\\s]*("+u[O]+")(?:\\.("+u[O]+")(?:\\.("+u[O]+")(?:"+u[A]+")?"+u[k]+"?)?)?";var M=c++;u[M]="^"+u[P]+"\\s*"+u[I]+"$";var B=c++;u[B]="^"+u[P]+"\\s*"+u[C]+"$";var N=c++;u[N]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var L=c++;u[L]="(?:~>?)";var j=c++;u[j]="(\\s*)"+u[L]+"\\s+",a[j]=new RegExp(u[j],"g"),s[j]=new RegExp(d(u[j]),"g");var U=c++;u[U]="^"+u[L]+u[I]+"$";var F=c++;u[F]="^"+u[L]+u[C]+"$";var D=c++;u[D]="(?:\\^)";var z=c++;u[z]="(\\s*)"+u[D]+"\\s+",a[z]=new RegExp(u[z],"g"),s[z]=new RegExp(d(u[z]),"g");var q=c++;u[q]="^"+u[D]+u[I]+"$";var H=c++;u[H]="^"+u[D]+u[C]+"$";var V=c++;u[V]="^"+u[P]+"\\s*("+x+")$|^$";var K=c++;u[K]="^"+u[P]+"\\s*("+E+")$|^$";var W=c++;u[W]="(\\s*)"+u[P]+"\\s*("+x+"|"+u[I]+")",a[W]=new RegExp(u[W],"g"),s[W]=new RegExp(d(u[W]),"g");var G=c++;u[G]="^\\s*("+u[I]+")\\s+-\\s+("+u[I]+")\\s*$";var X=c++;u[X]="^\\s*("+u[C]+")\\s+-\\s+("+u[C]+")\\s*$";var Z=c++;u[Z]="(<|>)?=?\\s*\\*";for(var Q=0;Q<35;Q++)r(Q,u[Q]),a[Q]||(a[Q]=new RegExp(u[Q]),s[Q]=new RegExp(d(u[Q])));function Y(e,t){if(t&&"object"===typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof J)return e;if("string"!==typeof e)return null;if(e.length>n)return null;if(!(t.loose?s[T]:s[_]).test(e))return null;try{return new J(e,t)}catch(r){return null}}function J(e,t){if(t&&"object"===typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof J){if(e.loose===t.loose)return e;e=e.version}else if("string"!==typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>n)throw new TypeError("version is longer than "+n+" characters");if(!(this instanceof J))return new J(e,t);r("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?s[T]:s[_]);if(!i)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"===typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,r,n){"string"===typeof r&&(n=r,r=void 0);try{return new J(e,r).inc(t,n).version}catch(o){return null}},t.diff=function(e,t){if(oe(e,t))return null;var r=Y(e),n=Y(t),o="";if(r.prerelease.length||n.prerelease.length){o="pre";var i="prerelease"}for(var a in r)if(("major"===a||"minor"===a||"patch"===a)&&r[a]!==n[a])return o+a;return i},t.compareIdentifiers=ee;var $=/^[0-9]+$/;function ee(e,t){var r=$.test(e),n=$.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e0}function ne(e,t,r){return te(e,t,r)<0}function oe(e,t,r){return 0===te(e,t,r)}function ie(e,t,r){return 0!==te(e,t,r)}function ae(e,t,r){return te(e,t,r)>=0}function se(e,t,r){return te(e,t,r)<=0}function ue(e,t,r,n){switch(t){case"===":return"object"===typeof e&&(e=e.version),"object"===typeof r&&(r=r.version),e===r;case"!==":return"object"===typeof e&&(e=e.version),"object"===typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return oe(e,r,n);case"!=":return ie(e,r,n);case">":return re(e,r,n);case">=":return ae(e,r,n);case"<":return ne(e,r,n);case"<=":return se(e,r,n);default:throw new TypeError("Invalid operator: "+t)}}function ce(e,t){if(t&&"object"===typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ce){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof ce))return new ce(e,t);e=e.trim().split(/\s+/).join(" "),r("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===le?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}t.rcompareIdentifiers=function(e,t){return ee(t,e)},t.major=function(e,t){return new J(e,t).major},t.minor=function(e,t){return new J(e,t).minor},t.patch=function(e,t){return new J(e,t).patch},t.compare=te,t.compareLoose=function(e,t){return te(e,t,!0)},t.rcompare=function(e,t,r){return te(t,e,r)},t.sort=function(e,r){return e.sort((function(e,n){return t.compare(e,n,r)}))},t.rsort=function(e,r){return e.sort((function(e,n){return t.rcompare(e,n,r)}))},t.gt=re,t.lt=ne,t.eq=oe,t.neq=ie,t.gte=ae,t.lte=se,t.cmp=ue,t.Comparator=ce;var le={};function fe(e,t){if(t&&"object"===typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof fe)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new fe(e.raw,t);if(e instanceof ce)return new fe(e.value,t);if(!(this instanceof fe))return new fe(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}function de(e){return!e||"x"===e.toLowerCase()||"*"===e}function he(e,t,r,n,o,i,a,s,u,c,l,f,d){return((t=de(r)?"":de(n)?">="+r+".0.0":de(o)?">="+r+"."+n+".0":">="+t)+" "+(s=de(u)?"":de(c)?"<"+(+u+1)+".0.0":de(l)?"<"+u+"."+(+c+1)+".0":f?"<="+u+"."+c+"."+l+"-"+f:"<="+s)).trim()}function pe(e,t,n){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function ye(e,t,r){try{t=new fe(t,r)}catch(n){return!1}return t.test(e)}function me(e,t,r,n){var o,i,a,s,u;switch(e=new J(e,n),t=new fe(t,n),r){case">":o=re,i=se,a=ne,s=">",u=">=";break;case"<":o=ne,i=ae,a=re,s="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ye(e,t,n))return!1;for(var c=0;c=0.0.0")),f=f||e,d=d||e,o(e.semver,f.semver,n)?f=e:a(e.semver,d.semver,n)&&(d=e)})),f.operator===s||f.operator===u)return!1;if((!d.operator||d.operator===s)&&i(e,d.semver))return!1;if(d.operator===u&&a(e,d.semver))return!1}return!0}ce.prototype.parse=function(e){var t=this.options.loose?s[V]:s[K],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=r[1],"="===this.operator&&(this.operator=""),r[2]?this.semver=new J(r[2],this.options.loose):this.semver=le},ce.prototype.toString=function(){return this.value},ce.prototype.test=function(e){return r("Comparator.test",e,this.options.loose),this.semver===le||("string"===typeof e&&(e=new J(e,this.options)),ue(e,this.operator,this.semver,this.options))},ce.prototype.intersects=function(e,t){if(!(e instanceof ce))throw new TypeError("a Comparator is required");var r;if(t&&"object"===typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return r=new fe(e.value,t),ye(this.value,r,t);if(""===e.operator)return r=new fe(this.value,t),ye(e.semver,r,t);var n=(">="===this.operator||">"===this.operator)&&(">="===e.operator||">"===e.operator),o=("<="===this.operator||"<"===this.operator)&&("<="===e.operator||"<"===e.operator),i=this.semver.version===e.semver.version,a=(">="===this.operator||"<="===this.operator)&&(">="===e.operator||"<="===e.operator),s=ue(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),u=ue(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||o||i&&a||s||u},t.Range=fe,fe.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},fe.prototype.toString=function(){return this.range},fe.prototype.parseRange=function(e){var t=this.options.loose,n=t?s[X]:s[G];e=e.replace(n,he),r("hyphen replace",e),e=e.replace(s[W],"$1$2$3"),r("comparator trim",e,s[W]),e=(e=e.replace(s[j],"$1~")).replace(s[z],"$1^");var o=t?s[V]:s[K],i=e.split(" ").map((function(e){return function(e,t){return r("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){r("caret",e,t);var n=t.loose?s[H]:s[q];return e.replace(n,(function(t,n,o,i,a){var s;return r("caret",e,t,n,o,i,a),de(n)?s="":de(o)?s=">="+n+".0.0 <"+(+n+1)+".0.0":de(i)?s="0"===n?">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":">="+n+"."+o+".0 <"+(+n+1)+".0.0":a?(r("replaceCaret pr",a),s="0"===n?"0"===o?">="+n+"."+o+"."+i+"-"+a+" <"+n+"."+o+"."+(+i+1):">="+n+"."+o+"."+i+"-"+a+" <"+n+"."+(+o+1)+".0":">="+n+"."+o+"."+i+"-"+a+" <"+(+n+1)+".0.0"):(r("no pr"),s="0"===n?"0"===o?">="+n+"."+o+"."+i+" <"+n+"."+o+"."+(+i+1):">="+n+"."+o+"."+i+" <"+n+"."+(+o+1)+".0":">="+n+"."+o+"."+i+" <"+(+n+1)+".0.0"),r("caret return",s),s}))}(e,t)})).join(" ")}(e,t),r("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var n=t.loose?s[F]:s[U];return e.replace(n,(function(t,n,o,i,a){var s;return r("tilde",e,t,n,o,i,a),de(n)?s="":de(o)?s=">="+n+".0.0 <"+(+n+1)+".0.0":de(i)?s=">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":a?(r("replaceTilde pr",a),s=">="+n+"."+o+"."+i+"-"+a+" <"+n+"."+(+o+1)+".0"):s=">="+n+"."+o+"."+i+" <"+n+"."+(+o+1)+".0",r("tilde return",s),s}))}(e,t)})).join(" ")}(e,t),r("tildes",e),e=function(e,t){return r("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var n=t.loose?s[B]:s[M];return e.replace(n,(function(t,n,o,i,a,s){r("xRange",e,t,n,o,i,a,s);var u=de(o),c=u||de(i),l=c||de(a);return"="===n&&l&&(n=""),u?t=">"===n||"<"===n?"<0.0.0":"*":n&&l?(c&&(i=0),a=0,">"===n?(n=">=",c?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===n&&(n="<",c?o=+o+1:i=+i+1),t=n+o+"."+i+"."+a):c?t=">="+o+".0.0 <"+(+o+1)+".0.0":l&&(t=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),r("xRange return",t),t}))}(e,t)})).join(" ")}(e,t),r("xrange",e),e=function(e,t){return r("replaceStars",e,t),e.trim().replace(s[Z],"")}(e,t),r("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(i=i.filter((function(e){return!!e.match(o)}))),i=i.map((function(e){return new ce(e,this.options)}),this)},fe.prototype.intersects=function(e,t){if(!(e instanceof fe))throw new TypeError("a Range is required");return this.set.some((function(r){return r.every((function(r){return e.set.some((function(e){return e.every((function(e){return r.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new fe(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},fe.prototype.test=function(e){if(!e)return!1;"string"===typeof e&&(e=new J(e,this.options));for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":r&&!re(r,t)||(r=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(r&&e.test(r))return r;return null},t.validRange=function(e,t){try{return new fe(e,t).range||"*"}catch(r){return null}},t.ltr=function(e,t,r){return me(e,t,"<",r)},t.gtr=function(e,t,r){return me(e,t,">",r)},t.outside=me,t.prerelease=function(e,t){var r=Y(e,t);return r&&r.prerelease.length?r.prerelease:null},t.intersects=function(e,t,r){return e=new fe(e,r),t=new fe(t,r),e.intersects(t)},t.coerce=function(e){if(e instanceof J)return e;if("string"!==typeof e)return null;var t=e.match(s[N]);if(null==t)return null;return Y(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},31752:(e,t,r)=>{var n,o=r(43693).default;self,n=()=>(()=>{var e={6263:function(e){var t;t=()=>(()=>{var e={899:(e,t,r)=>{const n=r(10);e.exports=n},10:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Array:()=>F,Bool:()=>C,Double:()=>R,Enum:()=>H,Float:()=>O,Hyper:()=>E,Int:()=>A,LargeInt:()=>_,Opaque:()=>L,Option:()=>z,Quadruple:()=>I,Reference:()=>V,String:()=>B,Struct:()=>K,Union:()=>G,UnsignedHyper:()=>P,UnsignedInt:()=>T,VarArray:()=>D,VarOpaque:()=>U,Void:()=>q,config:()=>re});class n extends TypeError{constructor(e){super("XDR Write Error: ".concat(e))}}class i extends TypeError{constructor(e){super("XDR Read Error: ".concat(e))}}class a extends TypeError{constructor(e){super("XDR Type Definition Error: ".concat(e))}}class s extends a{constructor(){super("method not implemented, it should be overloaded in the descendant class.")}}var u=r(764).lW;class c{constructor(e){if(o(this,"_buffer",void 0),o(this,"_length",void 0),o(this,"_index",void 0),!u.isBuffer(e)){if(!(e instanceof Array))throw new i("source not specified");e=u.from(e)}this._buffer=e,this._length=e.length,this._index=0}get eof(){return this._index===this._length}advance(e){const t=this._index;if(this._index+=e,this._length0){for(let e=0;e0){const e=this.alloc(r);this._buffer.fill(0,e,this._index)}}writeInt32BE(e){const t=this.alloc(4);this._buffer.writeInt32BE(e,t)}writeUInt32BE(e){const t=this.alloc(4);this._buffer.writeUInt32BE(e,t)}writeBigInt64BE(e){const t=this.alloc(8);this._buffer.writeBigInt64BE(e,t)}writeBigUInt64BE(e){const t=this.alloc(8);this._buffer.writeBigUInt64BE(e,t)}writeFloatBE(e){const t=this.alloc(4);this._buffer.writeFloatBE(e,t)}writeDoubleBE(e){const t=this.alloc(8);this._buffer.writeDoubleBE(e,t)}}o(d,"bufferChunkSize",f);var h=r(764).lW;class p{toXDR(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"raw";if(!this.write)return this.constructor.toXDR(this,e);const t=new d;return this.write(this,t),v(t.finalize(),e)}fromXDR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"raw";if(!this.read)return this.constructor.fromXDR(e,t);const r=new c(b(e,t)),n=this.read(r);return r.ensureInputConsumed(),n}validateXDR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"raw";try{return this.fromXDR(e,t),!0}catch(e){return!1}}static toXDR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"raw";const r=new d;return this.write(e,r),v(r.finalize(),t)}static fromXDR(e){const t=new c(b(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"raw")),r=this.read(t);return t.ensureInputConsumed(),r}static validateXDR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"raw";try{return this.fromXDR(e,t),!0}catch(e){return!1}}}class y extends p{static read(e){throw new s}static write(e,t){throw new s}static isValid(e){return!1}}class m extends p{isValid(e){return!1}}class g extends TypeError{constructor(e){super("Invalid format ".concat(e,', must be one of "raw", "hex", "base64"'))}}function v(e,t){switch(t){case"raw":return e;case"hex":return e.toString("hex");case"base64":return e.toString("base64");default:throw new g(t)}}function b(e,t){switch(t){case"raw":return e;case"hex":return h.from(e,"hex");case"base64":return h.from(e,"base64");default:throw new g(t)}}const w=2147483647;class A extends y{static read(e){return e.readInt32BE()}static write(e,t){if("number"!=typeof e)throw new n("not a number");if((0|e)!==e)throw new n("invalid i32 value");t.writeInt32BE(e)}static isValid(e){return"number"==typeof e&&(0|e)===e&&e>=-2147483648&&e<=w}}function S(e,t,r){if("bigint"!=typeof e)throw new TypeError("Expected bigint 'value', got "+typeof e);const n=t/r;if(1===n)return[e];if(r<32||r>128||2!==n&&4!==n&&8!==n)throw new TypeError("invalid bigint (".concat(e,") and slice size (").concat(t," -> ").concat(r,") combination"));const o=BigInt(r),i=new Array(n);for(let a=0;a>=o;return i}function k(e,t){if(t)return[0n,(1n<=i&&o<=a)return o;throw new TypeError("bigint values [".concat(e,"] for ").concat(function(e,t){return"".concat(t?"u":"i").concat(e)}(t,r)," out of range [").concat(i,", ").concat(a,"]: ").concat(o))}(e,this.size,this.unsigned)}get unsigned(){throw new s}get size(){throw new s}slice(e){return S(this._value,this.size,e)}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}toBigInt(){return BigInt(this._value)}static read(e){const{size:t}=this.prototype;return 64===t?new this(e.readBigUInt64BE()):new this(...Array.from({length:t/64},(()=>e.readBigUInt64BE())).reverse())}static write(e,t){if(e instanceof this)e=e._value;else if("bigint"!=typeof e||e>this.MAX_VALUE||e>32n)}get size(){return 64}get unsigned(){return!1}static fromBits(e,t){return new this(e,t)}}E.defineIntBoundaries();const x=4294967295;class T extends y{static read(e){return e.readUInt32BE()}static write(e,t){if("number"!=typeof e||!(e>=0&&e<=x)||e%1!=0)throw new n("invalid u32 value");t.writeUInt32BE(e)}static isValid(e){return"number"==typeof e&&e%1==0&&e>=0&&e<=x}}T.MAX_VALUE=x,T.MIN_VALUE=0;class P extends _{constructor(){for(var e=arguments.length,t=new Array(e),r=0;r>32n)}get size(){return 64}get unsigned(){return!0}static fromBits(e,t){return new this(e,t)}}P.defineIntBoundaries();class O extends y{static read(e){return e.readFloatBE()}static write(e,t){if("number"!=typeof e)throw new n("not a number");t.writeFloatBE(e)}static isValid(e){return"number"==typeof e}}class R extends y{static read(e){return e.readDoubleBE()}static write(e,t){if("number"!=typeof e)throw new n("not a number");t.writeDoubleBE(e)}static isValid(e){return"number"==typeof e}}class I extends y{static read(){throw new a("quadruple not supported")}static write(){throw new a("quadruple not supported")}static isValid(){return!1}}class C extends y{static read(e){const t=A.read(e);switch(t){case 0:return!1;case 1:return!0;default:throw new i("got ".concat(t," when trying to read a bool"))}}static write(e,t){const r=e?1:0;A.write(r,t)}static isValid(e){return"boolean"==typeof e}}var M=r(764).lW;class B extends m{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T.MAX_VALUE;super(),this._maxLength=e}read(e){const t=T.read(e);if(t>this._maxLength)throw new i("saw ".concat(t," length String, max allowed is ").concat(this._maxLength));return e.read(t)}readString(e){return this.read(e).toString("utf8")}write(e,t){const r="string"==typeof e?M.byteLength(e,"utf8"):e.length;if(r>this._maxLength)throw new n("got ".concat(e.length," bytes, max allowed is ").concat(this._maxLength));T.write(r,t),t.write(e,r)}isValid(e){return"string"==typeof e?M.byteLength(e,"utf8")<=this._maxLength:!!(e instanceof Array||M.isBuffer(e))&&e.length<=this._maxLength}}var N=r(764).lW;class L extends m{constructor(e){super(),this._length=e}read(e){return e.read(this._length)}write(e,t){const{length:r}=e;if(r!==this._length)throw new n("got ".concat(e.length," bytes, expected ").concat(this._length));t.write(e,r)}isValid(e){return N.isBuffer(e)&&e.length===this._length}}var j=r(764).lW;class U extends m{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T.MAX_VALUE;super(),this._maxLength=e}read(e){const t=T.read(e);if(t>this._maxLength)throw new i("saw ".concat(t," length VarOpaque, max allowed is ").concat(this._maxLength));return e.read(t)}write(e,t){const{length:r}=e;if(e.length>this._maxLength)throw new n("got ".concat(e.length," bytes, max allowed is ").concat(this._maxLength));T.write(r,t),t.write(e,r)}isValid(e){return j.isBuffer(e)&&e.length<=this._maxLength}}class F extends m{constructor(e,t){super(),this._childType=e,this._length=t}read(e){const t=new r.g.Array(this._length);for(let r=0;r1&&void 0!==arguments[1]?arguments[1]:T.MAX_VALUE;super(),this._childType=e,this._maxLength=t}read(e){const t=T.read(e);if(t>this._maxLength)throw new i("saw ".concat(t," length VarArray, max allowed is ").concat(this._maxLength));const r=new Array(t);for(let n=0;nthis._maxLength)throw new n("got array of size ".concat(e.length,", max allowed is ").concat(this._maxLength));T.write(e.length,t);for(const r of e)this._childType.write(r,t)}isValid(e){if(!(e instanceof Array)||e.length>this._maxLength)return!1;for(const t of e)if(!this._childType.isValid(t))return!1;return!0}}class z extends y{constructor(e){super(),this._childType=e}read(e){if(C.read(e))return this._childType.read(e)}write(e,t){const r=null!=e;C.write(r,t),r&&this._childType.write(e,t)}isValid(e){return null==e||this._childType.isValid(e)}}class q extends y{static read(){}static write(e){if(void 0!==e)throw new n("trying to write value to a void slot")}static isValid(e){return void 0===e}}class H extends y{constructor(e,t){super(),this.name=e,this.value=t}static read(e){const t=A.read(e),r=this._byValue[t];if(void 0===r)throw new i("unknown ".concat(this.enumName," member for value ").concat(t));return r}static write(e,t){if(!(e instanceof this))throw new n("unknown ".concat(e," is not a ").concat(this.enumName));A.write(e.value,t)}static isValid(e){return e instanceof this}static members(){return this._members}static values(){return Object.values(this._members)}static fromName(e){const t=this._members[e];if(!t)throw new TypeError("".concat(e," is not a member of ").concat(this.enumName));return t}static fromValue(e){const t=this._byValue[e];if(void 0===t)throw new TypeError("".concat(e," is not a value of any member of ").concat(this.enumName));return t}static create(e,t,r){const n=class extends H{};n.enumName=t,e.results[t]=n,n._members={},n._byValue={};for(const[o,i]of Object.entries(r)){const e=new n(o,i);n._members[o]=e,n._byValue[i]=e,n[o]=()=>e}return n}}class V extends y{resolve(){throw new a('"resolve" method should be implemented in the descendant class')}}class K extends y{constructor(e){super(),this._attributes=e||{}}static read(e){const t={};for(const[r,n]of this._fields)t[r]=n.read(e);return new this(t)}static write(e,t){if(!(e instanceof this))throw new n("".concat(e," is not a ").concat(this.structName));for(const[r,n]of this._fields){const o=e._attributes[r];n.write(o,t)}}static isValid(e){return e instanceof this}static create(e,t,r){const n=class extends K{};n.structName=t,e.results[t]=n;const o=new Array(r.length);for(let i=0;i0&&void 0!==arguments[0]?arguments[0]:this._arm;if(this._arm!==q&&this._arm!==e)throw new TypeError("".concat(e," not set"));return this._value}switch(){return this._switch}arm(){return this._arm}armType(){return this._armType}value(){return this._value}static armForSwitch(e){const t=this._switches.get(e);if(void 0!==t)return t;if(this._defaultArm)return this._defaultArm;throw new TypeError("Bad union switch: ".concat(e))}static armTypeForArm(e){return e===q?q:this._arms[e]}static read(e){const t=this._switchOn.read(e),r=this.armForSwitch(t),n=r===q?q:this._arms[r];let o;return o=void 0!==n?n.read(e):r.read(e),new this(t,o)}static write(e,t){if(!(e instanceof this))throw new n("".concat(e," is not a ").concat(this.unionName));this._switchOn.write(e.switch(),t),e.armType().write(e.value(),t)}static isValid(e){return e instanceof this}static create(e,t,r){const n=class extends G{};n.unionName=t,e.results[t]=n,r.switchOn instanceof V?n._switchOn=r.switchOn.resolve(e):n._switchOn=r.switchOn,n._switches=new Map,n._arms={};let o=r.defaultArm;o instanceof V&&(o=o.resolve(e)),n._defaultArm=o;for(const[i,a]of r.switches){const e="string"==typeof i?n._switchOn.fromName(i):i;n._switches.set(e,a)}if(void 0!==n._switchOn.values)for(const i of n._switchOn.values())n[i.name]=function(e){return new n(i,e)},n.prototype[i.name]=function(e){return this.set(i,e)};if(r.arms)for(const[i,a]of Object.entries(r.arms))n._arms[i]=a instanceof V?a.resolve(e):a,a!==q&&(n.prototype[i]=function(){return this.get(i)});return n}}class X extends V{constructor(e){super(),this.name=e}resolve(e){return e.definitions[this.name].resolve(e)}}class Z extends V{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];super(),this.childReference=e,this.length=t,this.variable=r}resolve(e){let t=this.childReference,r=this.length;return t instanceof V&&(t=t.resolve(e)),r instanceof V&&(r=r.resolve(e)),this.variable?new D(t,r):new F(t,r)}}class Q extends V{constructor(e){super(),this.childReference=e,this.name=e.name}resolve(e){let t=this.childReference;return t instanceof V&&(t=t.resolve(e)),new z(t)}}class Y extends V{constructor(e,t){super(),this.sizedType=e,this.length=t}resolve(e){let t=this.length;return t instanceof V&&(t=t.resolve(e)),new this.sizedType(t)}}class J{constructor(e,t,r){this.constructor=e,this.name=t,this.config=r}resolve(e){return this.name in e.results?e.results[this.name]:this.constructor(e,this.name,this.config)}}function $(e,t,r){return r instanceof V&&(r=r.resolve(e)),e.results[t]=r,r}function ee(e,t,r){return e.results[t]=r,r}class te{constructor(e){this._destination=e,this._definitions={}}enum(e,t){const r=new J(H.create,e,t);this.define(e,r)}struct(e,t){const r=new J(K.create,e,t);this.define(e,r)}union(e,t){const r=new J(G.create,e,t);this.define(e,r)}typedef(e,t){const r=new J($,e,t);this.define(e,r)}const(e,t){const r=new J(ee,e,t);this.define(e,r)}void(){return q}bool(){return C}int(){return A}hyper(){return E}uint(){return T}uhyper(){return P}float(){return O}double(){return R}quadruple(){return I}string(e){return new Y(B,e)}opaque(e){return new Y(L,e)}varOpaque(e){return new Y(U,e)}array(e,t){return new Z(e,t)}varArray(e,t){return new Z(e,t,!0)}option(e){return new Q(e)}define(e,t){if(void 0!==this._destination[e])throw new a("".concat(e," is already defined"));this._definitions[e]=t}lookup(e){return new X(e)}resolve(){for(const e of Object.values(this._definitions))e.resolve({definitions:this._definitions,results:this._destination})}}function re(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e){const r=new te(t);e(r),r.resolve()}return t}},742:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],u=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),l=0,f=u>0?a-4:a;for(r=0;r>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,c=n-o;sc?c:s+a));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var o,i,a=[],s=t;s>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},764:(e,t,r)=>{"use strict";const n=r(742),o=r(645),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=u,t.h2=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=s(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const o=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Q(e.length)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),s(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=s(t);for(let n=0;n=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(o)return n?-1:W(e).length;t=(""+t).toLowerCase(),o=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,o){let i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;is&&(r=s-u),i=r;i>=0;i--){let r=!0;for(let n=0;no&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(i=u));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),c=this.slice(n,o),l=e.slice(t,r);for(let u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function P(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;on)&&(r=n);let o="";for(let i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,r,n,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function B(e,t,r,n,o){q(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function N(e,t,r,n,o){q(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function L(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,n,i){return t=+t,r>>>=0,i||L(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||L(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=J((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i=o&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=J((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||C(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||M(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i>>=0,r>>>=0,n||M(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=J((function(e){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=J((function(e){return N(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o>>=0,!n){const n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=J((function(e){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=J((function(e){return N(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function q(e,t,r,n,o,i){if(e>r||e3?0===t||t===BigInt(0)?">= 0".concat(n," and < 2").concat(n," ** ").concat(8*(i+1)).concat(n):">= -(2".concat(n," ** ").concat(8*(i+1)-1).concat(n,") and < 2 ** ").concat(8*(i+1)-1).concat(n):">= ".concat(t).concat(n," and <= ").concat(r).concat(n),new F.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,o,i)}function H(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(typeof t)}),TypeError),D("ERR_OUT_OF_RANGE",(function(e,t,r){let n='The value of "'.concat(e,'" is out of range.'),o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=z(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=z(o)),o+="n"),n+=" It must be ".concat(t,". Received ").concat(o),n}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function W(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function X(e,t,r,n){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function J(e){return"undefined"==typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},645:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<>1,l=-7,f=r?o-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=d,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=d,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+h]=255&s,h+=p,s/=256,o-=8);for(a=a<0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*y}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(899)})(),e.exports=t()},3217:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;var n,o=(n=r(4431))&&n.__esModule?n:{default:n},i=r(8385);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 s(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var n,o=r(8385),i=(n=r(4081))&&n.__esModule?n:{default:n};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 s(e,t){for(var r=0;r{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Asset=void 0;var o,i=r(6006),a=(o=r(4081))&&o.__esModule?o:{default:o},s=r(6437),u=r(8385),c=r(9622);function l(e){return l="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},l(e)}function f(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:a.default.Asset;if(this.isNative())return r.assetTypeNative();this.code.length<=4?(e=a.default.AlphaNum4,t="assetTypeCreditAlphanum4"):(e=a.default.AlphaNum12,t="assetTypeCreditAlphanum12");var n=this.code.length<=4?4:12;return new r(t,new e({assetCode:this.code.padEnd(n,"\0"),issuer:s.Keypair.fromPublicKey(this.issuer).xdrAccountId()}))}},{key:"getCode",value:function(){if(void 0!==this.code)return String(this.code)}},{key:"getIssuer",value:function(){if(void 0!==this.issuer)return String(this.issuer)}},{key:"getAssetType",value:function(){switch(this.getRawAssetType()){case a.default.AssetType.assetTypeNative():return"native";case a.default.AssetType.assetTypeCreditAlphanum4():return"credit_alphanum4";case a.default.AssetType.assetTypeCreditAlphanum12():return"credit_alphanum12";default:return"unknown"}}},{key:"getRawAssetType",value:function(){return this.isNative()?a.default.AssetType.assetTypeNative():this.code.length<=4?a.default.AssetType.assetTypeCreditAlphanum4():a.default.AssetType.assetTypeCreditAlphanum12()}},{key:"isNative",value:function(){return!this.issuer}},{key:"equals",value:function(e){return this.code===e.getCode()&&this.issuer===e.getIssuer()}},{key:"toString",value:function(){return this.isNative()?"native":"".concat(this.getCode(),":").concat(this.getIssuer())}}],o=[{key:"native",value:function(){return new e("XLM")}},{key:"fromOperation",value:function(e){var t,r;switch(e.switch()){case a.default.AssetType.assetTypeNative():return this.native();case a.default.AssetType.assetTypeCreditAlphanum4():t=e.alphaNum4();case a.default.AssetType.assetTypeCreditAlphanum12():return t=t||e.alphaNum12(),r=u.StrKey.encodeEd25519PublicKey(t.issuer().ed25519()),new this((0,i.trimEnd)(t.assetCode(),"\0"),r);default:throw new Error("Invalid asset type: ".concat(e.switch().name))}}},{key:"compare",value:function(t,r){if(!(t&&t instanceof e))throw new Error("assetA is invalid");if(!(r&&r instanceof e))throw new Error("assetB is invalid");if(t.equals(r))return 0;var n=t.getRawAssetType().value,o=r.getRawAssetType().value;if(n!==o)return n{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.authorizeEntry=y,t.authorizeInvocation=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:u.Networks.FUTURENET,s=a.Keypair.random().rawPublicKey(),c=new i.default.Int64(s.subarray(0,8).reduce((function(e,t){return e<<8|t}),0)),f=n||e.publicKey();if(!f)throw new Error("authorizeInvocation requires publicKey parameter");return y(new i.default.SorobanAuthorizationEntry({rootInvocation:r,credentials:i.default.SorobanCredentials.sorobanCredentialsAddress(new i.default.SorobanAddressCredentials({address:new l.Address(f).toScAddress(),nonce:c,signatureExpirationLedger:0,signature:i.default.ScVal.scvVec([])}))}),e,t,o)};var o,i=(o=r(4081))&&o.__esModule?o:{default:o},a=r(6437),s=r(8385),u=r(2844),c=r(9622),l=r(3471),f=r(5567);function d(e){return d="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},d(e)}function h(){h=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:P(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",y="suspendedYield",m="executing",g="completed",v={};function b(){}function w(){}function A(){}var S={};c(S,a,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(M([])));_&&_!==r&&n.call(_,a)&&(S=_);var E=A.prototype=b.prototype=Object.create(S);function x(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==d(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function P(t,r,n){var o=p;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=O(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=f(t,r,n);if("normal"===c.type){if(o=n.done?g:y,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.arg)}}}function O(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function M(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:M(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function p(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function y(e,t,r){return m.apply(this,arguments)}function m(){var e;return e=h().mark((function e(t,r,o){var d,p,y,m,g,v,b,w,A,S=arguments;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d=S.length>3&&void 0!==S[3]?S[3]:u.Networks.FUTURENET,t.credentials().switch().value===i.default.SorobanCredentialsType.sorobanCredentialsAddress().value){e.next=3;break}return e.abrupt("return",t);case 3:if(p=i.default.SorobanAuthorizationEntry.fromXDR(t.toXDR()),(y=p.credentials().address()).signatureExpirationLedger(o),m=(0,c.hash)(n.from(d)),g=i.default.HashIdPreimage.envelopeTypeSorobanAuthorization(new i.default.HashIdPreimageSorobanAuthorization({networkId:m,nonce:y.nonce(),invocation:p.rootInvocation(),signatureExpirationLedger:y.signatureExpirationLedger()})),v=(0,c.hash)(g.toXDR()),"function"!=typeof r){e.next=17;break}return e.t0=n,e.next=13,r(g);case 13:e.t1=e.sent,b=e.t0.from.call(e.t0,e.t1),e.next=18;break;case 17:b=n.from(r.sign(v));case 18:if(w=l.Address.fromScAddress(y.address()).toString(),a.Keypair.fromPublicKey(w).verify(v,b)){e.next=21;break}throw new Error("signature doesn't match payload");case 21:return A=(0,f.nativeToScVal)({public_key:s.StrKey.decodeEd25519PublicKey(w),signature:b},{type:{public_key:["symbol",null],signature:["symbol",null]}}),y.signature(i.default.ScVal.scvVec([A])),e.abrupt("return",p);case 24:case"end":return e.stop()}}),e)})),m=function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){p(i,n,o,a,s,"next",e)}function s(e){p(i,n,o,a,s,"throw",e)}a(void 0)}))},m.apply(this,arguments)}},1842:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Claimant=void 0;var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6437),a=r(8385);function s(e){return s="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},s(e)}function u(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;var n,o=r(3471),i=r(4585),a=(n=r(4081))&&n.__esModule?n:{default:n},s=r(8385);function u(e){return u="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},u(e)}function c(e,t){for(var r=0;r1?t-1:0),n=1;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.humanizeEvents=function(e){return e.map((function(e){return e instanceof o.default.DiagnosticEvent?s(e.event()):s(e)}))};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(8385),a=r(5567);function s(e){return{contractId:null===e.contractId()?"":i.StrKey.encodeContract(e.contractId()),type:e.type().name,topics:e.body().value().topics().map((function(e){return(0,a.scValToNative)(e)})),data:(0,a.scValToNative)(e.body().value().data())}}},1462:(e,t,r)=>{"use strict";var n=r(8764).Buffer;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)}Object.defineProperty(t,"__esModule",{value:!0}),t.FeeBumpTransaction=void 0;var i,a=(i=r(4081))&&i.__esModule?i:{default:i},s=r(9622),u=r(1388),c=r(1065),l=r(6880);function f(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var u=a?Object.getOwnPropertyDescriptor(e,s):null;u&&(u.get||u.set)?Object.defineProperty(i,s,u):i[s]=e[s]}return i.default=e,r&&r.set(e,i),i}(r(6263)).config((function(e){var t=1024;e.typedef("Value",e.varOpaque()),e.struct("ScpBallot",[["counter",e.lookup("Uint32")],["value",e.lookup("Value")]]),e.enum("ScpStatementType",{scpStPrepare:0,scpStConfirm:1,scpStExternalize:2,scpStNominate:3}),e.struct("ScpNomination",[["quorumSetHash",e.lookup("Hash")],["votes",e.varArray(e.lookup("Value"),2147483647)],["accepted",e.varArray(e.lookup("Value"),2147483647)]]),e.struct("ScpStatementPrepare",[["quorumSetHash",e.lookup("Hash")],["ballot",e.lookup("ScpBallot")],["prepared",e.option(e.lookup("ScpBallot"))],["preparedPrime",e.option(e.lookup("ScpBallot"))],["nC",e.lookup("Uint32")],["nH",e.lookup("Uint32")]]),e.struct("ScpStatementConfirm",[["ballot",e.lookup("ScpBallot")],["nPrepared",e.lookup("Uint32")],["nCommit",e.lookup("Uint32")],["nH",e.lookup("Uint32")],["quorumSetHash",e.lookup("Hash")]]),e.struct("ScpStatementExternalize",[["commit",e.lookup("ScpBallot")],["nH",e.lookup("Uint32")],["commitQuorumSetHash",e.lookup("Hash")]]),e.union("ScpStatementPledges",{switchOn:e.lookup("ScpStatementType"),switchName:"type",switches:[["scpStPrepare","prepare"],["scpStConfirm","confirm"],["scpStExternalize","externalize"],["scpStNominate","nominate"]],arms:{prepare:e.lookup("ScpStatementPrepare"),confirm:e.lookup("ScpStatementConfirm"),externalize:e.lookup("ScpStatementExternalize"),nominate:e.lookup("ScpNomination")}}),e.struct("ScpStatement",[["nodeId",e.lookup("NodeId")],["slotIndex",e.lookup("Uint64")],["pledges",e.lookup("ScpStatementPledges")]]),e.struct("ScpEnvelope",[["statement",e.lookup("ScpStatement")],["signature",e.lookup("Signature")]]),e.struct("ScpQuorumSet",[["threshold",e.lookup("Uint32")],["validators",e.varArray(e.lookup("NodeId"),2147483647)],["innerSets",e.varArray(e.lookup("ScpQuorumSet"),2147483647)]]),e.typedef("Thresholds",e.opaque(4)),e.typedef("String32",e.string(32)),e.typedef("String64",e.string(64)),e.typedef("SequenceNumber",e.lookup("Int64")),e.typedef("DataValue",e.varOpaque(64)),e.typedef("PoolId",e.lookup("Hash")),e.typedef("AssetCode4",e.opaque(4)),e.typedef("AssetCode12",e.opaque(12)),e.enum("AssetType",{assetTypeNative:0,assetTypeCreditAlphanum4:1,assetTypeCreditAlphanum12:2,assetTypePoolShare:3}),e.union("AssetCode",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeCreditAlphanum4","assetCode4"],["assetTypeCreditAlphanum12","assetCode12"]],arms:{assetCode4:e.lookup("AssetCode4"),assetCode12:e.lookup("AssetCode12")}}),e.struct("AlphaNum4",[["assetCode",e.lookup("AssetCode4")],["issuer",e.lookup("AccountId")]]),e.struct("AlphaNum12",[["assetCode",e.lookup("AssetCode12")],["issuer",e.lookup("AccountId")]]),e.union("Asset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12")}}),e.struct("Price",[["n",e.lookup("Int32")],["d",e.lookup("Int32")]]),e.struct("Liabilities",[["buying",e.lookup("Int64")],["selling",e.lookup("Int64")]]),e.enum("ThresholdIndices",{thresholdMasterWeight:0,thresholdLow:1,thresholdMed:2,thresholdHigh:3}),e.enum("LedgerEntryType",{account:0,trustline:1,offer:2,data:3,claimableBalance:4,liquidityPool:5,contractData:6,contractCode:7,configSetting:8,ttl:9}),e.struct("Signer",[["key",e.lookup("SignerKey")],["weight",e.lookup("Uint32")]]),e.enum("AccountFlags",{authRequiredFlag:1,authRevocableFlag:2,authImmutableFlag:4,authClawbackEnabledFlag:8}),e.const("MASK_ACCOUNT_FLAGS",7),e.const("MASK_ACCOUNT_FLAGS_V17",15),e.const("MAX_SIGNERS",20),e.typedef("SponsorshipDescriptor",e.option(e.lookup("AccountId"))),e.struct("AccountEntryExtensionV3",[["ext",e.lookup("ExtensionPoint")],["seqLedger",e.lookup("Uint32")],["seqTime",e.lookup("TimePoint")]]),e.union("AccountEntryExtensionV2Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[3,"v3"]],arms:{v3:e.lookup("AccountEntryExtensionV3")}}),e.struct("AccountEntryExtensionV2",[["numSponsored",e.lookup("Uint32")],["numSponsoring",e.lookup("Uint32")],["signerSponsoringIDs",e.varArray(e.lookup("SponsorshipDescriptor"),e.lookup("MAX_SIGNERS"))],["ext",e.lookup("AccountEntryExtensionV2Ext")]]),e.union("AccountEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[2,"v2"]],arms:{v2:e.lookup("AccountEntryExtensionV2")}}),e.struct("AccountEntryExtensionV1",[["liabilities",e.lookup("Liabilities")],["ext",e.lookup("AccountEntryExtensionV1Ext")]]),e.union("AccountEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("AccountEntryExtensionV1")}}),e.struct("AccountEntry",[["accountId",e.lookup("AccountId")],["balance",e.lookup("Int64")],["seqNum",e.lookup("SequenceNumber")],["numSubEntries",e.lookup("Uint32")],["inflationDest",e.option(e.lookup("AccountId"))],["flags",e.lookup("Uint32")],["homeDomain",e.lookup("String32")],["thresholds",e.lookup("Thresholds")],["signers",e.varArray(e.lookup("Signer"),e.lookup("MAX_SIGNERS"))],["ext",e.lookup("AccountEntryExt")]]),e.enum("TrustLineFlags",{authorizedFlag:1,authorizedToMaintainLiabilitiesFlag:2,trustlineClawbackEnabledFlag:4}),e.const("MASK_TRUSTLINE_FLAGS",1),e.const("MASK_TRUSTLINE_FLAGS_V13",3),e.const("MASK_TRUSTLINE_FLAGS_V17",7),e.enum("LiquidityPoolType",{liquidityPoolConstantProduct:0}),e.union("TrustLineAsset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"],["assetTypePoolShare","liquidityPoolId"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12"),liquidityPoolId:e.lookup("PoolId")}}),e.union("TrustLineEntryExtensionV2Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TrustLineEntryExtensionV2",[["liquidityPoolUseCount",e.lookup("Int32")],["ext",e.lookup("TrustLineEntryExtensionV2Ext")]]),e.union("TrustLineEntryV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[2,"v2"]],arms:{v2:e.lookup("TrustLineEntryExtensionV2")}}),e.struct("TrustLineEntryV1",[["liabilities",e.lookup("Liabilities")],["ext",e.lookup("TrustLineEntryV1Ext")]]),e.union("TrustLineEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("TrustLineEntryV1")}}),e.struct("TrustLineEntry",[["accountId",e.lookup("AccountId")],["asset",e.lookup("TrustLineAsset")],["balance",e.lookup("Int64")],["limit",e.lookup("Int64")],["flags",e.lookup("Uint32")],["ext",e.lookup("TrustLineEntryExt")]]),e.enum("OfferEntryFlags",{passiveFlag:1}),e.const("MASK_OFFERENTRY_FLAGS",1),e.union("OfferEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("OfferEntry",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")],["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")],["flags",e.lookup("Uint32")],["ext",e.lookup("OfferEntryExt")]]),e.union("DataEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("DataEntry",[["accountId",e.lookup("AccountId")],["dataName",e.lookup("String64")],["dataValue",e.lookup("DataValue")],["ext",e.lookup("DataEntryExt")]]),e.enum("ClaimPredicateType",{claimPredicateUnconditional:0,claimPredicateAnd:1,claimPredicateOr:2,claimPredicateNot:3,claimPredicateBeforeAbsoluteTime:4,claimPredicateBeforeRelativeTime:5}),e.union("ClaimPredicate",{switchOn:e.lookup("ClaimPredicateType"),switchName:"type",switches:[["claimPredicateUnconditional",e.void()],["claimPredicateAnd","andPredicates"],["claimPredicateOr","orPredicates"],["claimPredicateNot","notPredicate"],["claimPredicateBeforeAbsoluteTime","absBefore"],["claimPredicateBeforeRelativeTime","relBefore"]],arms:{andPredicates:e.varArray(e.lookup("ClaimPredicate"),2),orPredicates:e.varArray(e.lookup("ClaimPredicate"),2),notPredicate:e.option(e.lookup("ClaimPredicate")),absBefore:e.lookup("Int64"),relBefore:e.lookup("Int64")}}),e.enum("ClaimantType",{claimantTypeV0:0}),e.struct("ClaimantV0",[["destination",e.lookup("AccountId")],["predicate",e.lookup("ClaimPredicate")]]),e.union("Claimant",{switchOn:e.lookup("ClaimantType"),switchName:"type",switches:[["claimantTypeV0","v0"]],arms:{v0:e.lookup("ClaimantV0")}}),e.enum("ClaimableBalanceIdType",{claimableBalanceIdTypeV0:0}),e.union("ClaimableBalanceId",{switchOn:e.lookup("ClaimableBalanceIdType"),switchName:"type",switches:[["claimableBalanceIdTypeV0","v0"]],arms:{v0:e.lookup("Hash")}}),e.enum("ClaimableBalanceFlags",{claimableBalanceClawbackEnabledFlag:1}),e.const("MASK_CLAIMABLE_BALANCE_FLAGS",1),e.union("ClaimableBalanceEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("ClaimableBalanceEntryExtensionV1",[["ext",e.lookup("ClaimableBalanceEntryExtensionV1Ext")],["flags",e.lookup("Uint32")]]),e.union("ClaimableBalanceEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("ClaimableBalanceEntryExtensionV1")}}),e.struct("ClaimableBalanceEntry",[["balanceId",e.lookup("ClaimableBalanceId")],["claimants",e.varArray(e.lookup("Claimant"),10)],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")],["ext",e.lookup("ClaimableBalanceEntryExt")]]),e.struct("LiquidityPoolConstantProductParameters",[["assetA",e.lookup("Asset")],["assetB",e.lookup("Asset")],["fee",e.lookup("Int32")]]),e.struct("LiquidityPoolEntryConstantProduct",[["params",e.lookup("LiquidityPoolConstantProductParameters")],["reserveA",e.lookup("Int64")],["reserveB",e.lookup("Int64")],["totalPoolShares",e.lookup("Int64")],["poolSharesTrustLineCount",e.lookup("Int64")]]),e.union("LiquidityPoolEntryBody",{switchOn:e.lookup("LiquidityPoolType"),switchName:"type",switches:[["liquidityPoolConstantProduct","constantProduct"]],arms:{constantProduct:e.lookup("LiquidityPoolEntryConstantProduct")}}),e.struct("LiquidityPoolEntry",[["liquidityPoolId",e.lookup("PoolId")],["body",e.lookup("LiquidityPoolEntryBody")]]),e.enum("ContractDataDurability",{temporary:0,persistent:1}),e.struct("ContractDataEntry",[["ext",e.lookup("ExtensionPoint")],["contract",e.lookup("ScAddress")],["key",e.lookup("ScVal")],["durability",e.lookup("ContractDataDurability")],["val",e.lookup("ScVal")]]),e.struct("ContractCodeEntry",[["ext",e.lookup("ExtensionPoint")],["hash",e.lookup("Hash")],["code",e.varOpaque()]]),e.struct("TtlEntry",[["keyHash",e.lookup("Hash")],["liveUntilLedgerSeq",e.lookup("Uint32")]]),e.union("LedgerEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerEntryExtensionV1",[["sponsoringId",e.lookup("SponsorshipDescriptor")],["ext",e.lookup("LedgerEntryExtensionV1Ext")]]),e.union("LedgerEntryData",{switchOn:e.lookup("LedgerEntryType"),switchName:"type",switches:[["account","account"],["trustline","trustLine"],["offer","offer"],["data","data"],["claimableBalance","claimableBalance"],["liquidityPool","liquidityPool"],["contractData","contractData"],["contractCode","contractCode"],["configSetting","configSetting"],["ttl","ttl"]],arms:{account:e.lookup("AccountEntry"),trustLine:e.lookup("TrustLineEntry"),offer:e.lookup("OfferEntry"),data:e.lookup("DataEntry"),claimableBalance:e.lookup("ClaimableBalanceEntry"),liquidityPool:e.lookup("LiquidityPoolEntry"),contractData:e.lookup("ContractDataEntry"),contractCode:e.lookup("ContractCodeEntry"),configSetting:e.lookup("ConfigSettingEntry"),ttl:e.lookup("TtlEntry")}}),e.union("LedgerEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("LedgerEntryExtensionV1")}}),e.struct("LedgerEntry",[["lastModifiedLedgerSeq",e.lookup("Uint32")],["data",e.lookup("LedgerEntryData")],["ext",e.lookup("LedgerEntryExt")]]),e.struct("LedgerKeyAccount",[["accountId",e.lookup("AccountId")]]),e.struct("LedgerKeyTrustLine",[["accountId",e.lookup("AccountId")],["asset",e.lookup("TrustLineAsset")]]),e.struct("LedgerKeyOffer",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")]]),e.struct("LedgerKeyData",[["accountId",e.lookup("AccountId")],["dataName",e.lookup("String64")]]),e.struct("LedgerKeyClaimableBalance",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("LedgerKeyLiquidityPool",[["liquidityPoolId",e.lookup("PoolId")]]),e.struct("LedgerKeyContractData",[["contract",e.lookup("ScAddress")],["key",e.lookup("ScVal")],["durability",e.lookup("ContractDataDurability")]]),e.struct("LedgerKeyContractCode",[["hash",e.lookup("Hash")]]),e.struct("LedgerKeyConfigSetting",[["configSettingId",e.lookup("ConfigSettingId")]]),e.struct("LedgerKeyTtl",[["keyHash",e.lookup("Hash")]]),e.union("LedgerKey",{switchOn:e.lookup("LedgerEntryType"),switchName:"type",switches:[["account","account"],["trustline","trustLine"],["offer","offer"],["data","data"],["claimableBalance","claimableBalance"],["liquidityPool","liquidityPool"],["contractData","contractData"],["contractCode","contractCode"],["configSetting","configSetting"],["ttl","ttl"]],arms:{account:e.lookup("LedgerKeyAccount"),trustLine:e.lookup("LedgerKeyTrustLine"),offer:e.lookup("LedgerKeyOffer"),data:e.lookup("LedgerKeyData"),claimableBalance:e.lookup("LedgerKeyClaimableBalance"),liquidityPool:e.lookup("LedgerKeyLiquidityPool"),contractData:e.lookup("LedgerKeyContractData"),contractCode:e.lookup("LedgerKeyContractCode"),configSetting:e.lookup("LedgerKeyConfigSetting"),ttl:e.lookup("LedgerKeyTtl")}}),e.enum("EnvelopeType",{envelopeTypeTxV0:0,envelopeTypeScp:1,envelopeTypeTx:2,envelopeTypeAuth:3,envelopeTypeScpvalue:4,envelopeTypeTxFeeBump:5,envelopeTypeOpId:6,envelopeTypePoolRevokeOpId:7,envelopeTypeContractId:8,envelopeTypeSorobanAuthorization:9}),e.typedef("UpgradeType",e.varOpaque(128)),e.enum("StellarValueType",{stellarValueBasic:0,stellarValueSigned:1}),e.struct("LedgerCloseValueSignature",[["nodeId",e.lookup("NodeId")],["signature",e.lookup("Signature")]]),e.union("StellarValueExt",{switchOn:e.lookup("StellarValueType"),switchName:"v",switches:[["stellarValueBasic",e.void()],["stellarValueSigned","lcValueSignature"]],arms:{lcValueSignature:e.lookup("LedgerCloseValueSignature")}}),e.struct("StellarValue",[["txSetHash",e.lookup("Hash")],["closeTime",e.lookup("TimePoint")],["upgrades",e.varArray(e.lookup("UpgradeType"),6)],["ext",e.lookup("StellarValueExt")]]),e.const("MASK_LEDGER_HEADER_FLAGS",7),e.enum("LedgerHeaderFlags",{disableLiquidityPoolTradingFlag:1,disableLiquidityPoolDepositFlag:2,disableLiquidityPoolWithdrawalFlag:4}),e.union("LedgerHeaderExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerHeaderExtensionV1",[["flags",e.lookup("Uint32")],["ext",e.lookup("LedgerHeaderExtensionV1Ext")]]),e.union("LedgerHeaderExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("LedgerHeaderExtensionV1")}}),e.struct("LedgerHeader",[["ledgerVersion",e.lookup("Uint32")],["previousLedgerHash",e.lookup("Hash")],["scpValue",e.lookup("StellarValue")],["txSetResultHash",e.lookup("Hash")],["bucketListHash",e.lookup("Hash")],["ledgerSeq",e.lookup("Uint32")],["totalCoins",e.lookup("Int64")],["feePool",e.lookup("Int64")],["inflationSeq",e.lookup("Uint32")],["idPool",e.lookup("Uint64")],["baseFee",e.lookup("Uint32")],["baseReserve",e.lookup("Uint32")],["maxTxSetSize",e.lookup("Uint32")],["skipList",e.array(e.lookup("Hash"),4)],["ext",e.lookup("LedgerHeaderExt")]]),e.enum("LedgerUpgradeType",{ledgerUpgradeVersion:1,ledgerUpgradeBaseFee:2,ledgerUpgradeMaxTxSetSize:3,ledgerUpgradeBaseReserve:4,ledgerUpgradeFlags:5,ledgerUpgradeConfig:6,ledgerUpgradeMaxSorobanTxSetSize:7}),e.struct("ConfigUpgradeSetKey",[["contractId",e.lookup("Hash")],["contentHash",e.lookup("Hash")]]),e.union("LedgerUpgrade",{switchOn:e.lookup("LedgerUpgradeType"),switchName:"type",switches:[["ledgerUpgradeVersion","newLedgerVersion"],["ledgerUpgradeBaseFee","newBaseFee"],["ledgerUpgradeMaxTxSetSize","newMaxTxSetSize"],["ledgerUpgradeBaseReserve","newBaseReserve"],["ledgerUpgradeFlags","newFlags"],["ledgerUpgradeConfig","newConfig"],["ledgerUpgradeMaxSorobanTxSetSize","newMaxSorobanTxSetSize"]],arms:{newLedgerVersion:e.lookup("Uint32"),newBaseFee:e.lookup("Uint32"),newMaxTxSetSize:e.lookup("Uint32"),newBaseReserve:e.lookup("Uint32"),newFlags:e.lookup("Uint32"),newConfig:e.lookup("ConfigUpgradeSetKey"),newMaxSorobanTxSetSize:e.lookup("Uint32")}}),e.struct("ConfigUpgradeSet",[["updatedEntry",e.varArray(e.lookup("ConfigSettingEntry"),2147483647)]]),e.enum("BucketEntryType",{metaentry:-1,liveentry:0,deadentry:1,initentry:2}),e.union("BucketMetadataExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("BucketMetadata",[["ledgerVersion",e.lookup("Uint32")],["ext",e.lookup("BucketMetadataExt")]]),e.union("BucketEntry",{switchOn:e.lookup("BucketEntryType"),switchName:"type",switches:[["liveentry","liveEntry"],["initentry","liveEntry"],["deadentry","deadEntry"],["metaentry","metaEntry"]],arms:{liveEntry:e.lookup("LedgerEntry"),deadEntry:e.lookup("LedgerKey"),metaEntry:e.lookup("BucketMetadata")}}),e.enum("TxSetComponentType",{txsetCompTxsMaybeDiscountedFee:0}),e.struct("TxSetComponentTxsMaybeDiscountedFee",[["baseFee",e.option(e.lookup("Int64"))],["txes",e.varArray(e.lookup("TransactionEnvelope"),2147483647)]]),e.union("TxSetComponent",{switchOn:e.lookup("TxSetComponentType"),switchName:"type",switches:[["txsetCompTxsMaybeDiscountedFee","txsMaybeDiscountedFee"]],arms:{txsMaybeDiscountedFee:e.lookup("TxSetComponentTxsMaybeDiscountedFee")}}),e.union("TransactionPhase",{switchOn:e.int(),switchName:"v",switches:[[0,"v0Components"]],arms:{v0Components:e.varArray(e.lookup("TxSetComponent"),2147483647)}}),e.struct("TransactionSet",[["previousLedgerHash",e.lookup("Hash")],["txes",e.varArray(e.lookup("TransactionEnvelope"),2147483647)]]),e.struct("TransactionSetV1",[["previousLedgerHash",e.lookup("Hash")],["phases",e.varArray(e.lookup("TransactionPhase"),2147483647)]]),e.union("GeneralizedTransactionSet",{switchOn:e.int(),switchName:"v",switches:[[1,"v1TxSet"]],arms:{v1TxSet:e.lookup("TransactionSetV1")}}),e.struct("TransactionResultPair",[["transactionHash",e.lookup("Hash")],["result",e.lookup("TransactionResult")]]),e.struct("TransactionResultSet",[["results",e.varArray(e.lookup("TransactionResultPair"),2147483647)]]),e.union("TransactionHistoryEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"generalizedTxSet"]],arms:{generalizedTxSet:e.lookup("GeneralizedTransactionSet")}}),e.struct("TransactionHistoryEntry",[["ledgerSeq",e.lookup("Uint32")],["txSet",e.lookup("TransactionSet")],["ext",e.lookup("TransactionHistoryEntryExt")]]),e.union("TransactionHistoryResultEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionHistoryResultEntry",[["ledgerSeq",e.lookup("Uint32")],["txResultSet",e.lookup("TransactionResultSet")],["ext",e.lookup("TransactionHistoryResultEntryExt")]]),e.union("LedgerHeaderHistoryEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerHeaderHistoryEntry",[["hash",e.lookup("Hash")],["header",e.lookup("LedgerHeader")],["ext",e.lookup("LedgerHeaderHistoryEntryExt")]]),e.struct("LedgerScpMessages",[["ledgerSeq",e.lookup("Uint32")],["messages",e.varArray(e.lookup("ScpEnvelope"),2147483647)]]),e.struct("ScpHistoryEntryV0",[["quorumSets",e.varArray(e.lookup("ScpQuorumSet"),2147483647)],["ledgerMessages",e.lookup("LedgerScpMessages")]]),e.union("ScpHistoryEntry",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("ScpHistoryEntryV0")}}),e.enum("LedgerEntryChangeType",{ledgerEntryCreated:0,ledgerEntryUpdated:1,ledgerEntryRemoved:2,ledgerEntryState:3}),e.union("LedgerEntryChange",{switchOn:e.lookup("LedgerEntryChangeType"),switchName:"type",switches:[["ledgerEntryCreated","created"],["ledgerEntryUpdated","updated"],["ledgerEntryRemoved","removed"],["ledgerEntryState","state"]],arms:{created:e.lookup("LedgerEntry"),updated:e.lookup("LedgerEntry"),removed:e.lookup("LedgerKey"),state:e.lookup("LedgerEntry")}}),e.typedef("LedgerEntryChanges",e.varArray(e.lookup("LedgerEntryChange"),2147483647)),e.struct("OperationMeta",[["changes",e.lookup("LedgerEntryChanges")]]),e.struct("TransactionMetaV1",[["txChanges",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)]]),e.struct("TransactionMetaV2",[["txChangesBefore",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)],["txChangesAfter",e.lookup("LedgerEntryChanges")]]),e.enum("ContractEventType",{system:0,contract:1,diagnostic:2}),e.struct("ContractEventV0",[["topics",e.varArray(e.lookup("ScVal"),2147483647)],["data",e.lookup("ScVal")]]),e.union("ContractEventBody",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("ContractEventV0")}}),e.struct("ContractEvent",[["ext",e.lookup("ExtensionPoint")],["contractId",e.option(e.lookup("Hash"))],["type",e.lookup("ContractEventType")],["body",e.lookup("ContractEventBody")]]),e.struct("DiagnosticEvent",[["inSuccessfulContractCall",e.bool()],["event",e.lookup("ContractEvent")]]),e.struct("SorobanTransactionMeta",[["ext",e.lookup("ExtensionPoint")],["events",e.varArray(e.lookup("ContractEvent"),2147483647)],["returnValue",e.lookup("ScVal")],["diagnosticEvents",e.varArray(e.lookup("DiagnosticEvent"),2147483647)]]),e.struct("TransactionMetaV3",[["ext",e.lookup("ExtensionPoint")],["txChangesBefore",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)],["txChangesAfter",e.lookup("LedgerEntryChanges")],["sorobanMeta",e.option(e.lookup("SorobanTransactionMeta"))]]),e.struct("InvokeHostFunctionSuccessPreImage",[["returnValue",e.lookup("ScVal")],["events",e.varArray(e.lookup("ContractEvent"),2147483647)]]),e.union("TransactionMeta",{switchOn:e.int(),switchName:"v",switches:[[0,"operations"],[1,"v1"],[2,"v2"],[3,"v3"]],arms:{operations:e.varArray(e.lookup("OperationMeta"),2147483647),v1:e.lookup("TransactionMetaV1"),v2:e.lookup("TransactionMetaV2"),v3:e.lookup("TransactionMetaV3")}}),e.struct("TransactionResultMeta",[["result",e.lookup("TransactionResultPair")],["feeProcessing",e.lookup("LedgerEntryChanges")],["txApplyProcessing",e.lookup("TransactionMeta")]]),e.struct("UpgradeEntryMeta",[["upgrade",e.lookup("LedgerUpgrade")],["changes",e.lookup("LedgerEntryChanges")]]),e.struct("LedgerCloseMetaV0",[["ledgerHeader",e.lookup("LedgerHeaderHistoryEntry")],["txSet",e.lookup("TransactionSet")],["txProcessing",e.varArray(e.lookup("TransactionResultMeta"),2147483647)],["upgradesProcessing",e.varArray(e.lookup("UpgradeEntryMeta"),2147483647)],["scpInfo",e.varArray(e.lookup("ScpHistoryEntry"),2147483647)]]),e.struct("LedgerCloseMetaV1",[["ext",e.lookup("ExtensionPoint")],["ledgerHeader",e.lookup("LedgerHeaderHistoryEntry")],["txSet",e.lookup("GeneralizedTransactionSet")],["txProcessing",e.varArray(e.lookup("TransactionResultMeta"),2147483647)],["upgradesProcessing",e.varArray(e.lookup("UpgradeEntryMeta"),2147483647)],["scpInfo",e.varArray(e.lookup("ScpHistoryEntry"),2147483647)],["totalByteSizeOfBucketList",e.lookup("Uint64")],["evictedTemporaryLedgerKeys",e.varArray(e.lookup("LedgerKey"),2147483647)],["evictedPersistentLedgerEntries",e.varArray(e.lookup("LedgerEntry"),2147483647)]]),e.union("LedgerCloseMeta",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"],[1,"v1"]],arms:{v0:e.lookup("LedgerCloseMetaV0"),v1:e.lookup("LedgerCloseMetaV1")}}),e.enum("ErrorCode",{errMisc:0,errData:1,errConf:2,errAuth:3,errLoad:4}),e.struct("Error",[["code",e.lookup("ErrorCode")],["msg",e.string(100)]]),e.struct("SendMore",[["numMessages",e.lookup("Uint32")]]),e.struct("SendMoreExtended",[["numMessages",e.lookup("Uint32")],["numBytes",e.lookup("Uint32")]]),e.struct("AuthCert",[["pubkey",e.lookup("Curve25519Public")],["expiration",e.lookup("Uint64")],["sig",e.lookup("Signature")]]),e.struct("Hello",[["ledgerVersion",e.lookup("Uint32")],["overlayVersion",e.lookup("Uint32")],["overlayMinVersion",e.lookup("Uint32")],["networkId",e.lookup("Hash")],["versionStr",e.string(100)],["listeningPort",e.int()],["peerId",e.lookup("NodeId")],["cert",e.lookup("AuthCert")],["nonce",e.lookup("Uint256")]]),e.const("AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED",200),e.struct("Auth",[["flags",e.int()]]),e.enum("IpAddrType",{iPv4:0,iPv6:1}),e.union("PeerAddressIp",{switchOn:e.lookup("IpAddrType"),switchName:"type",switches:[["iPv4","ipv4"],["iPv6","ipv6"]],arms:{ipv4:e.opaque(4),ipv6:e.opaque(16)}}),e.struct("PeerAddress",[["ip",e.lookup("PeerAddressIp")],["port",e.lookup("Uint32")],["numFailures",e.lookup("Uint32")]]),e.enum("MessageType",{errorMsg:0,auth:2,dontHave:3,getPeers:4,peers:5,getTxSet:6,txSet:7,generalizedTxSet:17,transaction:8,getScpQuorumset:9,scpQuorumset:10,scpMessage:11,getScpState:12,hello:13,surveyRequest:14,surveyResponse:15,sendMore:16,sendMoreExtended:20,floodAdvert:18,floodDemand:19}),e.struct("DontHave",[["type",e.lookup("MessageType")],["reqHash",e.lookup("Uint256")]]),e.enum("SurveyMessageCommandType",{surveyTopology:0}),e.enum("SurveyMessageResponseType",{surveyTopologyResponseV0:0,surveyTopologyResponseV1:1}),e.struct("SurveyRequestMessage",[["surveyorPeerId",e.lookup("NodeId")],["surveyedPeerId",e.lookup("NodeId")],["ledgerNum",e.lookup("Uint32")],["encryptionKey",e.lookup("Curve25519Public")],["commandType",e.lookup("SurveyMessageCommandType")]]),e.struct("SignedSurveyRequestMessage",[["requestSignature",e.lookup("Signature")],["request",e.lookup("SurveyRequestMessage")]]),e.typedef("EncryptedBody",e.varOpaque(64e3)),e.struct("SurveyResponseMessage",[["surveyorPeerId",e.lookup("NodeId")],["surveyedPeerId",e.lookup("NodeId")],["ledgerNum",e.lookup("Uint32")],["commandType",e.lookup("SurveyMessageCommandType")],["encryptedBody",e.lookup("EncryptedBody")]]),e.struct("SignedSurveyResponseMessage",[["responseSignature",e.lookup("Signature")],["response",e.lookup("SurveyResponseMessage")]]),e.struct("PeerStats",[["id",e.lookup("NodeId")],["versionStr",e.string(100)],["messagesRead",e.lookup("Uint64")],["messagesWritten",e.lookup("Uint64")],["bytesRead",e.lookup("Uint64")],["bytesWritten",e.lookup("Uint64")],["secondsConnected",e.lookup("Uint64")],["uniqueFloodBytesRecv",e.lookup("Uint64")],["duplicateFloodBytesRecv",e.lookup("Uint64")],["uniqueFetchBytesRecv",e.lookup("Uint64")],["duplicateFetchBytesRecv",e.lookup("Uint64")],["uniqueFloodMessageRecv",e.lookup("Uint64")],["duplicateFloodMessageRecv",e.lookup("Uint64")],["uniqueFetchMessageRecv",e.lookup("Uint64")],["duplicateFetchMessageRecv",e.lookup("Uint64")]]),e.typedef("PeerStatList",e.varArray(e.lookup("PeerStats"),25)),e.struct("TopologyResponseBodyV0",[["inboundPeers",e.lookup("PeerStatList")],["outboundPeers",e.lookup("PeerStatList")],["totalInboundPeerCount",e.lookup("Uint32")],["totalOutboundPeerCount",e.lookup("Uint32")]]),e.struct("TopologyResponseBodyV1",[["inboundPeers",e.lookup("PeerStatList")],["outboundPeers",e.lookup("PeerStatList")],["totalInboundPeerCount",e.lookup("Uint32")],["totalOutboundPeerCount",e.lookup("Uint32")],["maxInboundPeerCount",e.lookup("Uint32")],["maxOutboundPeerCount",e.lookup("Uint32")]]),e.union("SurveyResponseBody",{switchOn:e.lookup("SurveyMessageResponseType"),switchName:"type",switches:[["surveyTopologyResponseV0","topologyResponseBodyV0"],["surveyTopologyResponseV1","topologyResponseBodyV1"]],arms:{topologyResponseBodyV0:e.lookup("TopologyResponseBodyV0"),topologyResponseBodyV1:e.lookup("TopologyResponseBodyV1")}}),e.const("TX_ADVERT_VECTOR_MAX_SIZE",1e3),e.typedef("TxAdvertVector",e.varArray(e.lookup("Hash"),e.lookup("TX_ADVERT_VECTOR_MAX_SIZE"))),e.struct("FloodAdvert",[["txHashes",e.lookup("TxAdvertVector")]]),e.const("TX_DEMAND_VECTOR_MAX_SIZE",1e3),e.typedef("TxDemandVector",e.varArray(e.lookup("Hash"),e.lookup("TX_DEMAND_VECTOR_MAX_SIZE"))),e.struct("FloodDemand",[["txHashes",e.lookup("TxDemandVector")]]),e.union("StellarMessage",{switchOn:e.lookup("MessageType"),switchName:"type",switches:[["errorMsg","error"],["hello","hello"],["auth","auth"],["dontHave","dontHave"],["getPeers",e.void()],["peers","peers"],["getTxSet","txSetHash"],["txSet","txSet"],["generalizedTxSet","generalizedTxSet"],["transaction","transaction"],["surveyRequest","signedSurveyRequestMessage"],["surveyResponse","signedSurveyResponseMessage"],["getScpQuorumset","qSetHash"],["scpQuorumset","qSet"],["scpMessage","envelope"],["getScpState","getScpLedgerSeq"],["sendMore","sendMoreMessage"],["sendMoreExtended","sendMoreExtendedMessage"],["floodAdvert","floodAdvert"],["floodDemand","floodDemand"]],arms:{error:e.lookup("Error"),hello:e.lookup("Hello"),auth:e.lookup("Auth"),dontHave:e.lookup("DontHave"),peers:e.varArray(e.lookup("PeerAddress"),100),txSetHash:e.lookup("Uint256"),txSet:e.lookup("TransactionSet"),generalizedTxSet:e.lookup("GeneralizedTransactionSet"),transaction:e.lookup("TransactionEnvelope"),signedSurveyRequestMessage:e.lookup("SignedSurveyRequestMessage"),signedSurveyResponseMessage:e.lookup("SignedSurveyResponseMessage"),qSetHash:e.lookup("Uint256"),qSet:e.lookup("ScpQuorumSet"),envelope:e.lookup("ScpEnvelope"),getScpLedgerSeq:e.lookup("Uint32"),sendMoreMessage:e.lookup("SendMore"),sendMoreExtendedMessage:e.lookup("SendMoreExtended"),floodAdvert:e.lookup("FloodAdvert"),floodDemand:e.lookup("FloodDemand")}}),e.struct("AuthenticatedMessageV0",[["sequence",e.lookup("Uint64")],["message",e.lookup("StellarMessage")],["mac",e.lookup("HmacSha256Mac")]]),e.union("AuthenticatedMessage",{switchOn:e.lookup("Uint32"),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("AuthenticatedMessageV0")}}),e.const("MAX_OPS_PER_TX",100),e.union("LiquidityPoolParameters",{switchOn:e.lookup("LiquidityPoolType"),switchName:"type",switches:[["liquidityPoolConstantProduct","constantProduct"]],arms:{constantProduct:e.lookup("LiquidityPoolConstantProductParameters")}}),e.struct("MuxedAccountMed25519",[["id",e.lookup("Uint64")],["ed25519",e.lookup("Uint256")]]),e.union("MuxedAccount",{switchOn:e.lookup("CryptoKeyType"),switchName:"type",switches:[["keyTypeEd25519","ed25519"],["keyTypeMuxedEd25519","med25519"]],arms:{ed25519:e.lookup("Uint256"),med25519:e.lookup("MuxedAccountMed25519")}}),e.struct("DecoratedSignature",[["hint",e.lookup("SignatureHint")],["signature",e.lookup("Signature")]]),e.enum("OperationType",{createAccount:0,payment:1,pathPaymentStrictReceive:2,manageSellOffer:3,createPassiveSellOffer:4,setOptions:5,changeTrust:6,allowTrust:7,accountMerge:8,inflation:9,manageData:10,bumpSequence:11,manageBuyOffer:12,pathPaymentStrictSend:13,createClaimableBalance:14,claimClaimableBalance:15,beginSponsoringFutureReserves:16,endSponsoringFutureReserves:17,revokeSponsorship:18,clawback:19,clawbackClaimableBalance:20,setTrustLineFlags:21,liquidityPoolDeposit:22,liquidityPoolWithdraw:23,invokeHostFunction:24,extendFootprintTtl:25,restoreFootprint:26}),e.struct("CreateAccountOp",[["destination",e.lookup("AccountId")],["startingBalance",e.lookup("Int64")]]),e.struct("PaymentOp",[["destination",e.lookup("MuxedAccount")],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")]]),e.struct("PathPaymentStrictReceiveOp",[["sendAsset",e.lookup("Asset")],["sendMax",e.lookup("Int64")],["destination",e.lookup("MuxedAccount")],["destAsset",e.lookup("Asset")],["destAmount",e.lookup("Int64")],["path",e.varArray(e.lookup("Asset"),5)]]),e.struct("PathPaymentStrictSendOp",[["sendAsset",e.lookup("Asset")],["sendAmount",e.lookup("Int64")],["destination",e.lookup("MuxedAccount")],["destAsset",e.lookup("Asset")],["destMin",e.lookup("Int64")],["path",e.varArray(e.lookup("Asset"),5)]]),e.struct("ManageSellOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")],["offerId",e.lookup("Int64")]]),e.struct("ManageBuyOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["buyAmount",e.lookup("Int64")],["price",e.lookup("Price")],["offerId",e.lookup("Int64")]]),e.struct("CreatePassiveSellOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")]]),e.struct("SetOptionsOp",[["inflationDest",e.option(e.lookup("AccountId"))],["clearFlags",e.option(e.lookup("Uint32"))],["setFlags",e.option(e.lookup("Uint32"))],["masterWeight",e.option(e.lookup("Uint32"))],["lowThreshold",e.option(e.lookup("Uint32"))],["medThreshold",e.option(e.lookup("Uint32"))],["highThreshold",e.option(e.lookup("Uint32"))],["homeDomain",e.option(e.lookup("String32"))],["signer",e.option(e.lookup("Signer"))]]),e.union("ChangeTrustAsset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"],["assetTypePoolShare","liquidityPool"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12"),liquidityPool:e.lookup("LiquidityPoolParameters")}}),e.struct("ChangeTrustOp",[["line",e.lookup("ChangeTrustAsset")],["limit",e.lookup("Int64")]]),e.struct("AllowTrustOp",[["trustor",e.lookup("AccountId")],["asset",e.lookup("AssetCode")],["authorize",e.lookup("Uint32")]]),e.struct("ManageDataOp",[["dataName",e.lookup("String64")],["dataValue",e.option(e.lookup("DataValue"))]]),e.struct("BumpSequenceOp",[["bumpTo",e.lookup("SequenceNumber")]]),e.struct("CreateClaimableBalanceOp",[["asset",e.lookup("Asset")],["amount",e.lookup("Int64")],["claimants",e.varArray(e.lookup("Claimant"),10)]]),e.struct("ClaimClaimableBalanceOp",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("BeginSponsoringFutureReservesOp",[["sponsoredId",e.lookup("AccountId")]]),e.enum("RevokeSponsorshipType",{revokeSponsorshipLedgerEntry:0,revokeSponsorshipSigner:1}),e.struct("RevokeSponsorshipOpSigner",[["accountId",e.lookup("AccountId")],["signerKey",e.lookup("SignerKey")]]),e.union("RevokeSponsorshipOp",{switchOn:e.lookup("RevokeSponsorshipType"),switchName:"type",switches:[["revokeSponsorshipLedgerEntry","ledgerKey"],["revokeSponsorshipSigner","signer"]],arms:{ledgerKey:e.lookup("LedgerKey"),signer:e.lookup("RevokeSponsorshipOpSigner")}}),e.struct("ClawbackOp",[["asset",e.lookup("Asset")],["from",e.lookup("MuxedAccount")],["amount",e.lookup("Int64")]]),e.struct("ClawbackClaimableBalanceOp",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("SetTrustLineFlagsOp",[["trustor",e.lookup("AccountId")],["asset",e.lookup("Asset")],["clearFlags",e.lookup("Uint32")],["setFlags",e.lookup("Uint32")]]),e.const("LIQUIDITY_POOL_FEE_V18",30),e.struct("LiquidityPoolDepositOp",[["liquidityPoolId",e.lookup("PoolId")],["maxAmountA",e.lookup("Int64")],["maxAmountB",e.lookup("Int64")],["minPrice",e.lookup("Price")],["maxPrice",e.lookup("Price")]]),e.struct("LiquidityPoolWithdrawOp",[["liquidityPoolId",e.lookup("PoolId")],["amount",e.lookup("Int64")],["minAmountA",e.lookup("Int64")],["minAmountB",e.lookup("Int64")]]),e.enum("HostFunctionType",{hostFunctionTypeInvokeContract:0,hostFunctionTypeCreateContract:1,hostFunctionTypeUploadContractWasm:2}),e.enum("ContractIdPreimageType",{contractIdPreimageFromAddress:0,contractIdPreimageFromAsset:1}),e.struct("ContractIdPreimageFromAddress",[["address",e.lookup("ScAddress")],["salt",e.lookup("Uint256")]]),e.union("ContractIdPreimage",{switchOn:e.lookup("ContractIdPreimageType"),switchName:"type",switches:[["contractIdPreimageFromAddress","fromAddress"],["contractIdPreimageFromAsset","fromAsset"]],arms:{fromAddress:e.lookup("ContractIdPreimageFromAddress"),fromAsset:e.lookup("Asset")}}),e.struct("CreateContractArgs",[["contractIdPreimage",e.lookup("ContractIdPreimage")],["executable",e.lookup("ContractExecutable")]]),e.struct("InvokeContractArgs",[["contractAddress",e.lookup("ScAddress")],["functionName",e.lookup("ScSymbol")],["args",e.varArray(e.lookup("ScVal"),2147483647)]]),e.union("HostFunction",{switchOn:e.lookup("HostFunctionType"),switchName:"type",switches:[["hostFunctionTypeInvokeContract","invokeContract"],["hostFunctionTypeCreateContract","createContract"],["hostFunctionTypeUploadContractWasm","wasm"]],arms:{invokeContract:e.lookup("InvokeContractArgs"),createContract:e.lookup("CreateContractArgs"),wasm:e.varOpaque()}}),e.enum("SorobanAuthorizedFunctionType",{sorobanAuthorizedFunctionTypeContractFn:0,sorobanAuthorizedFunctionTypeCreateContractHostFn:1}),e.union("SorobanAuthorizedFunction",{switchOn:e.lookup("SorobanAuthorizedFunctionType"),switchName:"type",switches:[["sorobanAuthorizedFunctionTypeContractFn","contractFn"],["sorobanAuthorizedFunctionTypeCreateContractHostFn","createContractHostFn"]],arms:{contractFn:e.lookup("InvokeContractArgs"),createContractHostFn:e.lookup("CreateContractArgs")}}),e.struct("SorobanAuthorizedInvocation",[["function",e.lookup("SorobanAuthorizedFunction")],["subInvocations",e.varArray(e.lookup("SorobanAuthorizedInvocation"),2147483647)]]),e.struct("SorobanAddressCredentials",[["address",e.lookup("ScAddress")],["nonce",e.lookup("Int64")],["signatureExpirationLedger",e.lookup("Uint32")],["signature",e.lookup("ScVal")]]),e.enum("SorobanCredentialsType",{sorobanCredentialsSourceAccount:0,sorobanCredentialsAddress:1}),e.union("SorobanCredentials",{switchOn:e.lookup("SorobanCredentialsType"),switchName:"type",switches:[["sorobanCredentialsSourceAccount",e.void()],["sorobanCredentialsAddress","address"]],arms:{address:e.lookup("SorobanAddressCredentials")}}),e.struct("SorobanAuthorizationEntry",[["credentials",e.lookup("SorobanCredentials")],["rootInvocation",e.lookup("SorobanAuthorizedInvocation")]]),e.struct("InvokeHostFunctionOp",[["hostFunction",e.lookup("HostFunction")],["auth",e.varArray(e.lookup("SorobanAuthorizationEntry"),2147483647)]]),e.struct("ExtendFootprintTtlOp",[["ext",e.lookup("ExtensionPoint")],["extendTo",e.lookup("Uint32")]]),e.struct("RestoreFootprintOp",[["ext",e.lookup("ExtensionPoint")]]),e.union("OperationBody",{switchOn:e.lookup("OperationType"),switchName:"type",switches:[["createAccount","createAccountOp"],["payment","paymentOp"],["pathPaymentStrictReceive","pathPaymentStrictReceiveOp"],["manageSellOffer","manageSellOfferOp"],["createPassiveSellOffer","createPassiveSellOfferOp"],["setOptions","setOptionsOp"],["changeTrust","changeTrustOp"],["allowTrust","allowTrustOp"],["accountMerge","destination"],["inflation",e.void()],["manageData","manageDataOp"],["bumpSequence","bumpSequenceOp"],["manageBuyOffer","manageBuyOfferOp"],["pathPaymentStrictSend","pathPaymentStrictSendOp"],["createClaimableBalance","createClaimableBalanceOp"],["claimClaimableBalance","claimClaimableBalanceOp"],["beginSponsoringFutureReserves","beginSponsoringFutureReservesOp"],["endSponsoringFutureReserves",e.void()],["revokeSponsorship","revokeSponsorshipOp"],["clawback","clawbackOp"],["clawbackClaimableBalance","clawbackClaimableBalanceOp"],["setTrustLineFlags","setTrustLineFlagsOp"],["liquidityPoolDeposit","liquidityPoolDepositOp"],["liquidityPoolWithdraw","liquidityPoolWithdrawOp"],["invokeHostFunction","invokeHostFunctionOp"],["extendFootprintTtl","extendFootprintTtlOp"],["restoreFootprint","restoreFootprintOp"]],arms:{createAccountOp:e.lookup("CreateAccountOp"),paymentOp:e.lookup("PaymentOp"),pathPaymentStrictReceiveOp:e.lookup("PathPaymentStrictReceiveOp"),manageSellOfferOp:e.lookup("ManageSellOfferOp"),createPassiveSellOfferOp:e.lookup("CreatePassiveSellOfferOp"),setOptionsOp:e.lookup("SetOptionsOp"),changeTrustOp:e.lookup("ChangeTrustOp"),allowTrustOp:e.lookup("AllowTrustOp"),destination:e.lookup("MuxedAccount"),manageDataOp:e.lookup("ManageDataOp"),bumpSequenceOp:e.lookup("BumpSequenceOp"),manageBuyOfferOp:e.lookup("ManageBuyOfferOp"),pathPaymentStrictSendOp:e.lookup("PathPaymentStrictSendOp"),createClaimableBalanceOp:e.lookup("CreateClaimableBalanceOp"),claimClaimableBalanceOp:e.lookup("ClaimClaimableBalanceOp"),beginSponsoringFutureReservesOp:e.lookup("BeginSponsoringFutureReservesOp"),revokeSponsorshipOp:e.lookup("RevokeSponsorshipOp"),clawbackOp:e.lookup("ClawbackOp"),clawbackClaimableBalanceOp:e.lookup("ClawbackClaimableBalanceOp"),setTrustLineFlagsOp:e.lookup("SetTrustLineFlagsOp"),liquidityPoolDepositOp:e.lookup("LiquidityPoolDepositOp"),liquidityPoolWithdrawOp:e.lookup("LiquidityPoolWithdrawOp"),invokeHostFunctionOp:e.lookup("InvokeHostFunctionOp"),extendFootprintTtlOp:e.lookup("ExtendFootprintTtlOp"),restoreFootprintOp:e.lookup("RestoreFootprintOp")}}),e.struct("Operation",[["sourceAccount",e.option(e.lookup("MuxedAccount"))],["body",e.lookup("OperationBody")]]),e.struct("HashIdPreimageOperationId",[["sourceAccount",e.lookup("AccountId")],["seqNum",e.lookup("SequenceNumber")],["opNum",e.lookup("Uint32")]]),e.struct("HashIdPreimageRevokeId",[["sourceAccount",e.lookup("AccountId")],["seqNum",e.lookup("SequenceNumber")],["opNum",e.lookup("Uint32")],["liquidityPoolId",e.lookup("PoolId")],["asset",e.lookup("Asset")]]),e.struct("HashIdPreimageContractId",[["networkId",e.lookup("Hash")],["contractIdPreimage",e.lookup("ContractIdPreimage")]]),e.struct("HashIdPreimageSorobanAuthorization",[["networkId",e.lookup("Hash")],["nonce",e.lookup("Int64")],["signatureExpirationLedger",e.lookup("Uint32")],["invocation",e.lookup("SorobanAuthorizedInvocation")]]),e.union("HashIdPreimage",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeOpId","operationId"],["envelopeTypePoolRevokeOpId","revokeId"],["envelopeTypeContractId","contractId"],["envelopeTypeSorobanAuthorization","sorobanAuthorization"]],arms:{operationId:e.lookup("HashIdPreimageOperationId"),revokeId:e.lookup("HashIdPreimageRevokeId"),contractId:e.lookup("HashIdPreimageContractId"),sorobanAuthorization:e.lookup("HashIdPreimageSorobanAuthorization")}}),e.enum("MemoType",{memoNone:0,memoText:1,memoId:2,memoHash:3,memoReturn:4}),e.union("Memo",{switchOn:e.lookup("MemoType"),switchName:"type",switches:[["memoNone",e.void()],["memoText","text"],["memoId","id"],["memoHash","hash"],["memoReturn","retHash"]],arms:{text:e.string(28),id:e.lookup("Uint64"),hash:e.lookup("Hash"),retHash:e.lookup("Hash")}}),e.struct("TimeBounds",[["minTime",e.lookup("TimePoint")],["maxTime",e.lookup("TimePoint")]]),e.struct("LedgerBounds",[["minLedger",e.lookup("Uint32")],["maxLedger",e.lookup("Uint32")]]),e.struct("PreconditionsV2",[["timeBounds",e.option(e.lookup("TimeBounds"))],["ledgerBounds",e.option(e.lookup("LedgerBounds"))],["minSeqNum",e.option(e.lookup("SequenceNumber"))],["minSeqAge",e.lookup("Duration")],["minSeqLedgerGap",e.lookup("Uint32")],["extraSigners",e.varArray(e.lookup("SignerKey"),2)]]),e.enum("PreconditionType",{precondNone:0,precondTime:1,precondV2:2}),e.union("Preconditions",{switchOn:e.lookup("PreconditionType"),switchName:"type",switches:[["precondNone",e.void()],["precondTime","timeBounds"],["precondV2","v2"]],arms:{timeBounds:e.lookup("TimeBounds"),v2:e.lookup("PreconditionsV2")}}),e.struct("LedgerFootprint",[["readOnly",e.varArray(e.lookup("LedgerKey"),2147483647)],["readWrite",e.varArray(e.lookup("LedgerKey"),2147483647)]]),e.struct("SorobanResources",[["footprint",e.lookup("LedgerFootprint")],["instructions",e.lookup("Uint32")],["readBytes",e.lookup("Uint32")],["writeBytes",e.lookup("Uint32")]]),e.struct("SorobanTransactionData",[["ext",e.lookup("ExtensionPoint")],["resources",e.lookup("SorobanResources")],["resourceFee",e.lookup("Int64")]]),e.union("TransactionV0Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionV0",[["sourceAccountEd25519",e.lookup("Uint256")],["fee",e.lookup("Uint32")],["seqNum",e.lookup("SequenceNumber")],["timeBounds",e.option(e.lookup("TimeBounds"))],["memo",e.lookup("Memo")],["operations",e.varArray(e.lookup("Operation"),e.lookup("MAX_OPS_PER_TX"))],["ext",e.lookup("TransactionV0Ext")]]),e.struct("TransactionV0Envelope",[["tx",e.lookup("TransactionV0")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("TransactionExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"sorobanData"]],arms:{sorobanData:e.lookup("SorobanTransactionData")}}),e.struct("Transaction",[["sourceAccount",e.lookup("MuxedAccount")],["fee",e.lookup("Uint32")],["seqNum",e.lookup("SequenceNumber")],["cond",e.lookup("Preconditions")],["memo",e.lookup("Memo")],["operations",e.varArray(e.lookup("Operation"),e.lookup("MAX_OPS_PER_TX"))],["ext",e.lookup("TransactionExt")]]),e.struct("TransactionV1Envelope",[["tx",e.lookup("Transaction")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("FeeBumpTransactionInnerTx",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTx","v1"]],arms:{v1:e.lookup("TransactionV1Envelope")}}),e.union("FeeBumpTransactionExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("FeeBumpTransaction",[["feeSource",e.lookup("MuxedAccount")],["fee",e.lookup("Int64")],["innerTx",e.lookup("FeeBumpTransactionInnerTx")],["ext",e.lookup("FeeBumpTransactionExt")]]),e.struct("FeeBumpTransactionEnvelope",[["tx",e.lookup("FeeBumpTransaction")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("TransactionEnvelope",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTxV0","v0"],["envelopeTypeTx","v1"],["envelopeTypeTxFeeBump","feeBump"]],arms:{v0:e.lookup("TransactionV0Envelope"),v1:e.lookup("TransactionV1Envelope"),feeBump:e.lookup("FeeBumpTransactionEnvelope")}}),e.union("TransactionSignaturePayloadTaggedTransaction",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTx","tx"],["envelopeTypeTxFeeBump","feeBump"]],arms:{tx:e.lookup("Transaction"),feeBump:e.lookup("FeeBumpTransaction")}}),e.struct("TransactionSignaturePayload",[["networkId",e.lookup("Hash")],["taggedTransaction",e.lookup("TransactionSignaturePayloadTaggedTransaction")]]),e.enum("ClaimAtomType",{claimAtomTypeV0:0,claimAtomTypeOrderBook:1,claimAtomTypeLiquidityPool:2}),e.struct("ClaimOfferAtomV0",[["sellerEd25519",e.lookup("Uint256")],["offerId",e.lookup("Int64")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.struct("ClaimOfferAtom",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.struct("ClaimLiquidityAtom",[["liquidityPoolId",e.lookup("PoolId")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.union("ClaimAtom",{switchOn:e.lookup("ClaimAtomType"),switchName:"type",switches:[["claimAtomTypeV0","v0"],["claimAtomTypeOrderBook","orderBook"],["claimAtomTypeLiquidityPool","liquidityPool"]],arms:{v0:e.lookup("ClaimOfferAtomV0"),orderBook:e.lookup("ClaimOfferAtom"),liquidityPool:e.lookup("ClaimLiquidityAtom")}}),e.enum("CreateAccountResultCode",{createAccountSuccess:0,createAccountMalformed:-1,createAccountUnderfunded:-2,createAccountLowReserve:-3,createAccountAlreadyExist:-4}),e.union("CreateAccountResult",{switchOn:e.lookup("CreateAccountResultCode"),switchName:"code",switches:[["createAccountSuccess",e.void()],["createAccountMalformed",e.void()],["createAccountUnderfunded",e.void()],["createAccountLowReserve",e.void()],["createAccountAlreadyExist",e.void()]],arms:{}}),e.enum("PaymentResultCode",{paymentSuccess:0,paymentMalformed:-1,paymentUnderfunded:-2,paymentSrcNoTrust:-3,paymentSrcNotAuthorized:-4,paymentNoDestination:-5,paymentNoTrust:-6,paymentNotAuthorized:-7,paymentLineFull:-8,paymentNoIssuer:-9}),e.union("PaymentResult",{switchOn:e.lookup("PaymentResultCode"),switchName:"code",switches:[["paymentSuccess",e.void()],["paymentMalformed",e.void()],["paymentUnderfunded",e.void()],["paymentSrcNoTrust",e.void()],["paymentSrcNotAuthorized",e.void()],["paymentNoDestination",e.void()],["paymentNoTrust",e.void()],["paymentNotAuthorized",e.void()],["paymentLineFull",e.void()],["paymentNoIssuer",e.void()]],arms:{}}),e.enum("PathPaymentStrictReceiveResultCode",{pathPaymentStrictReceiveSuccess:0,pathPaymentStrictReceiveMalformed:-1,pathPaymentStrictReceiveUnderfunded:-2,pathPaymentStrictReceiveSrcNoTrust:-3,pathPaymentStrictReceiveSrcNotAuthorized:-4,pathPaymentStrictReceiveNoDestination:-5,pathPaymentStrictReceiveNoTrust:-6,pathPaymentStrictReceiveNotAuthorized:-7,pathPaymentStrictReceiveLineFull:-8,pathPaymentStrictReceiveNoIssuer:-9,pathPaymentStrictReceiveTooFewOffers:-10,pathPaymentStrictReceiveOfferCrossSelf:-11,pathPaymentStrictReceiveOverSendmax:-12}),e.struct("SimplePaymentResult",[["destination",e.lookup("AccountId")],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")]]),e.struct("PathPaymentStrictReceiveResultSuccess",[["offers",e.varArray(e.lookup("ClaimAtom"),2147483647)],["last",e.lookup("SimplePaymentResult")]]),e.union("PathPaymentStrictReceiveResult",{switchOn:e.lookup("PathPaymentStrictReceiveResultCode"),switchName:"code",switches:[["pathPaymentStrictReceiveSuccess","success"],["pathPaymentStrictReceiveMalformed",e.void()],["pathPaymentStrictReceiveUnderfunded",e.void()],["pathPaymentStrictReceiveSrcNoTrust",e.void()],["pathPaymentStrictReceiveSrcNotAuthorized",e.void()],["pathPaymentStrictReceiveNoDestination",e.void()],["pathPaymentStrictReceiveNoTrust",e.void()],["pathPaymentStrictReceiveNotAuthorized",e.void()],["pathPaymentStrictReceiveLineFull",e.void()],["pathPaymentStrictReceiveNoIssuer","noIssuer"],["pathPaymentStrictReceiveTooFewOffers",e.void()],["pathPaymentStrictReceiveOfferCrossSelf",e.void()],["pathPaymentStrictReceiveOverSendmax",e.void()]],arms:{success:e.lookup("PathPaymentStrictReceiveResultSuccess"),noIssuer:e.lookup("Asset")}}),e.enum("PathPaymentStrictSendResultCode",{pathPaymentStrictSendSuccess:0,pathPaymentStrictSendMalformed:-1,pathPaymentStrictSendUnderfunded:-2,pathPaymentStrictSendSrcNoTrust:-3,pathPaymentStrictSendSrcNotAuthorized:-4,pathPaymentStrictSendNoDestination:-5,pathPaymentStrictSendNoTrust:-6,pathPaymentStrictSendNotAuthorized:-7,pathPaymentStrictSendLineFull:-8,pathPaymentStrictSendNoIssuer:-9,pathPaymentStrictSendTooFewOffers:-10,pathPaymentStrictSendOfferCrossSelf:-11,pathPaymentStrictSendUnderDestmin:-12}),e.struct("PathPaymentStrictSendResultSuccess",[["offers",e.varArray(e.lookup("ClaimAtom"),2147483647)],["last",e.lookup("SimplePaymentResult")]]),e.union("PathPaymentStrictSendResult",{switchOn:e.lookup("PathPaymentStrictSendResultCode"),switchName:"code",switches:[["pathPaymentStrictSendSuccess","success"],["pathPaymentStrictSendMalformed",e.void()],["pathPaymentStrictSendUnderfunded",e.void()],["pathPaymentStrictSendSrcNoTrust",e.void()],["pathPaymentStrictSendSrcNotAuthorized",e.void()],["pathPaymentStrictSendNoDestination",e.void()],["pathPaymentStrictSendNoTrust",e.void()],["pathPaymentStrictSendNotAuthorized",e.void()],["pathPaymentStrictSendLineFull",e.void()],["pathPaymentStrictSendNoIssuer","noIssuer"],["pathPaymentStrictSendTooFewOffers",e.void()],["pathPaymentStrictSendOfferCrossSelf",e.void()],["pathPaymentStrictSendUnderDestmin",e.void()]],arms:{success:e.lookup("PathPaymentStrictSendResultSuccess"),noIssuer:e.lookup("Asset")}}),e.enum("ManageSellOfferResultCode",{manageSellOfferSuccess:0,manageSellOfferMalformed:-1,manageSellOfferSellNoTrust:-2,manageSellOfferBuyNoTrust:-3,manageSellOfferSellNotAuthorized:-4,manageSellOfferBuyNotAuthorized:-5,manageSellOfferLineFull:-6,manageSellOfferUnderfunded:-7,manageSellOfferCrossSelf:-8,manageSellOfferSellNoIssuer:-9,manageSellOfferBuyNoIssuer:-10,manageSellOfferNotFound:-11,manageSellOfferLowReserve:-12}),e.enum("ManageOfferEffect",{manageOfferCreated:0,manageOfferUpdated:1,manageOfferDeleted:2}),e.union("ManageOfferSuccessResultOffer",{switchOn:e.lookup("ManageOfferEffect"),switchName:"effect",switches:[["manageOfferCreated","offer"],["manageOfferUpdated","offer"],["manageOfferDeleted",e.void()]],arms:{offer:e.lookup("OfferEntry")}}),e.struct("ManageOfferSuccessResult",[["offersClaimed",e.varArray(e.lookup("ClaimAtom"),2147483647)],["offer",e.lookup("ManageOfferSuccessResultOffer")]]),e.union("ManageSellOfferResult",{switchOn:e.lookup("ManageSellOfferResultCode"),switchName:"code",switches:[["manageSellOfferSuccess","success"],["manageSellOfferMalformed",e.void()],["manageSellOfferSellNoTrust",e.void()],["manageSellOfferBuyNoTrust",e.void()],["manageSellOfferSellNotAuthorized",e.void()],["manageSellOfferBuyNotAuthorized",e.void()],["manageSellOfferLineFull",e.void()],["manageSellOfferUnderfunded",e.void()],["manageSellOfferCrossSelf",e.void()],["manageSellOfferSellNoIssuer",e.void()],["manageSellOfferBuyNoIssuer",e.void()],["manageSellOfferNotFound",e.void()],["manageSellOfferLowReserve",e.void()]],arms:{success:e.lookup("ManageOfferSuccessResult")}}),e.enum("ManageBuyOfferResultCode",{manageBuyOfferSuccess:0,manageBuyOfferMalformed:-1,manageBuyOfferSellNoTrust:-2,manageBuyOfferBuyNoTrust:-3,manageBuyOfferSellNotAuthorized:-4,manageBuyOfferBuyNotAuthorized:-5,manageBuyOfferLineFull:-6,manageBuyOfferUnderfunded:-7,manageBuyOfferCrossSelf:-8,manageBuyOfferSellNoIssuer:-9,manageBuyOfferBuyNoIssuer:-10,manageBuyOfferNotFound:-11,manageBuyOfferLowReserve:-12}),e.union("ManageBuyOfferResult",{switchOn:e.lookup("ManageBuyOfferResultCode"),switchName:"code",switches:[["manageBuyOfferSuccess","success"],["manageBuyOfferMalformed",e.void()],["manageBuyOfferSellNoTrust",e.void()],["manageBuyOfferBuyNoTrust",e.void()],["manageBuyOfferSellNotAuthorized",e.void()],["manageBuyOfferBuyNotAuthorized",e.void()],["manageBuyOfferLineFull",e.void()],["manageBuyOfferUnderfunded",e.void()],["manageBuyOfferCrossSelf",e.void()],["manageBuyOfferSellNoIssuer",e.void()],["manageBuyOfferBuyNoIssuer",e.void()],["manageBuyOfferNotFound",e.void()],["manageBuyOfferLowReserve",e.void()]],arms:{success:e.lookup("ManageOfferSuccessResult")}}),e.enum("SetOptionsResultCode",{setOptionsSuccess:0,setOptionsLowReserve:-1,setOptionsTooManySigners:-2,setOptionsBadFlags:-3,setOptionsInvalidInflation:-4,setOptionsCantChange:-5,setOptionsUnknownFlag:-6,setOptionsThresholdOutOfRange:-7,setOptionsBadSigner:-8,setOptionsInvalidHomeDomain:-9,setOptionsAuthRevocableRequired:-10}),e.union("SetOptionsResult",{switchOn:e.lookup("SetOptionsResultCode"),switchName:"code",switches:[["setOptionsSuccess",e.void()],["setOptionsLowReserve",e.void()],["setOptionsTooManySigners",e.void()],["setOptionsBadFlags",e.void()],["setOptionsInvalidInflation",e.void()],["setOptionsCantChange",e.void()],["setOptionsUnknownFlag",e.void()],["setOptionsThresholdOutOfRange",e.void()],["setOptionsBadSigner",e.void()],["setOptionsInvalidHomeDomain",e.void()],["setOptionsAuthRevocableRequired",e.void()]],arms:{}}),e.enum("ChangeTrustResultCode",{changeTrustSuccess:0,changeTrustMalformed:-1,changeTrustNoIssuer:-2,changeTrustInvalidLimit:-3,changeTrustLowReserve:-4,changeTrustSelfNotAllowed:-5,changeTrustTrustLineMissing:-6,changeTrustCannotDelete:-7,changeTrustNotAuthMaintainLiabilities:-8}),e.union("ChangeTrustResult",{switchOn:e.lookup("ChangeTrustResultCode"),switchName:"code",switches:[["changeTrustSuccess",e.void()],["changeTrustMalformed",e.void()],["changeTrustNoIssuer",e.void()],["changeTrustInvalidLimit",e.void()],["changeTrustLowReserve",e.void()],["changeTrustSelfNotAllowed",e.void()],["changeTrustTrustLineMissing",e.void()],["changeTrustCannotDelete",e.void()],["changeTrustNotAuthMaintainLiabilities",e.void()]],arms:{}}),e.enum("AllowTrustResultCode",{allowTrustSuccess:0,allowTrustMalformed:-1,allowTrustNoTrustLine:-2,allowTrustTrustNotRequired:-3,allowTrustCantRevoke:-4,allowTrustSelfNotAllowed:-5,allowTrustLowReserve:-6}),e.union("AllowTrustResult",{switchOn:e.lookup("AllowTrustResultCode"),switchName:"code",switches:[["allowTrustSuccess",e.void()],["allowTrustMalformed",e.void()],["allowTrustNoTrustLine",e.void()],["allowTrustTrustNotRequired",e.void()],["allowTrustCantRevoke",e.void()],["allowTrustSelfNotAllowed",e.void()],["allowTrustLowReserve",e.void()]],arms:{}}),e.enum("AccountMergeResultCode",{accountMergeSuccess:0,accountMergeMalformed:-1,accountMergeNoAccount:-2,accountMergeImmutableSet:-3,accountMergeHasSubEntries:-4,accountMergeSeqnumTooFar:-5,accountMergeDestFull:-6,accountMergeIsSponsor:-7}),e.union("AccountMergeResult",{switchOn:e.lookup("AccountMergeResultCode"),switchName:"code",switches:[["accountMergeSuccess","sourceAccountBalance"],["accountMergeMalformed",e.void()],["accountMergeNoAccount",e.void()],["accountMergeImmutableSet",e.void()],["accountMergeHasSubEntries",e.void()],["accountMergeSeqnumTooFar",e.void()],["accountMergeDestFull",e.void()],["accountMergeIsSponsor",e.void()]],arms:{sourceAccountBalance:e.lookup("Int64")}}),e.enum("InflationResultCode",{inflationSuccess:0,inflationNotTime:-1}),e.struct("InflationPayout",[["destination",e.lookup("AccountId")],["amount",e.lookup("Int64")]]),e.union("InflationResult",{switchOn:e.lookup("InflationResultCode"),switchName:"code",switches:[["inflationSuccess","payouts"],["inflationNotTime",e.void()]],arms:{payouts:e.varArray(e.lookup("InflationPayout"),2147483647)}}),e.enum("ManageDataResultCode",{manageDataSuccess:0,manageDataNotSupportedYet:-1,manageDataNameNotFound:-2,manageDataLowReserve:-3,manageDataInvalidName:-4}),e.union("ManageDataResult",{switchOn:e.lookup("ManageDataResultCode"),switchName:"code",switches:[["manageDataSuccess",e.void()],["manageDataNotSupportedYet",e.void()],["manageDataNameNotFound",e.void()],["manageDataLowReserve",e.void()],["manageDataInvalidName",e.void()]],arms:{}}),e.enum("BumpSequenceResultCode",{bumpSequenceSuccess:0,bumpSequenceBadSeq:-1}),e.union("BumpSequenceResult",{switchOn:e.lookup("BumpSequenceResultCode"),switchName:"code",switches:[["bumpSequenceSuccess",e.void()],["bumpSequenceBadSeq",e.void()]],arms:{}}),e.enum("CreateClaimableBalanceResultCode",{createClaimableBalanceSuccess:0,createClaimableBalanceMalformed:-1,createClaimableBalanceLowReserve:-2,createClaimableBalanceNoTrust:-3,createClaimableBalanceNotAuthorized:-4,createClaimableBalanceUnderfunded:-5}),e.union("CreateClaimableBalanceResult",{switchOn:e.lookup("CreateClaimableBalanceResultCode"),switchName:"code",switches:[["createClaimableBalanceSuccess","balanceId"],["createClaimableBalanceMalformed",e.void()],["createClaimableBalanceLowReserve",e.void()],["createClaimableBalanceNoTrust",e.void()],["createClaimableBalanceNotAuthorized",e.void()],["createClaimableBalanceUnderfunded",e.void()]],arms:{balanceId:e.lookup("ClaimableBalanceId")}}),e.enum("ClaimClaimableBalanceResultCode",{claimClaimableBalanceSuccess:0,claimClaimableBalanceDoesNotExist:-1,claimClaimableBalanceCannotClaim:-2,claimClaimableBalanceLineFull:-3,claimClaimableBalanceNoTrust:-4,claimClaimableBalanceNotAuthorized:-5}),e.union("ClaimClaimableBalanceResult",{switchOn:e.lookup("ClaimClaimableBalanceResultCode"),switchName:"code",switches:[["claimClaimableBalanceSuccess",e.void()],["claimClaimableBalanceDoesNotExist",e.void()],["claimClaimableBalanceCannotClaim",e.void()],["claimClaimableBalanceLineFull",e.void()],["claimClaimableBalanceNoTrust",e.void()],["claimClaimableBalanceNotAuthorized",e.void()]],arms:{}}),e.enum("BeginSponsoringFutureReservesResultCode",{beginSponsoringFutureReservesSuccess:0,beginSponsoringFutureReservesMalformed:-1,beginSponsoringFutureReservesAlreadySponsored:-2,beginSponsoringFutureReservesRecursive:-3}),e.union("BeginSponsoringFutureReservesResult",{switchOn:e.lookup("BeginSponsoringFutureReservesResultCode"),switchName:"code",switches:[["beginSponsoringFutureReservesSuccess",e.void()],["beginSponsoringFutureReservesMalformed",e.void()],["beginSponsoringFutureReservesAlreadySponsored",e.void()],["beginSponsoringFutureReservesRecursive",e.void()]],arms:{}}),e.enum("EndSponsoringFutureReservesResultCode",{endSponsoringFutureReservesSuccess:0,endSponsoringFutureReservesNotSponsored:-1}),e.union("EndSponsoringFutureReservesResult",{switchOn:e.lookup("EndSponsoringFutureReservesResultCode"),switchName:"code",switches:[["endSponsoringFutureReservesSuccess",e.void()],["endSponsoringFutureReservesNotSponsored",e.void()]],arms:{}}),e.enum("RevokeSponsorshipResultCode",{revokeSponsorshipSuccess:0,revokeSponsorshipDoesNotExist:-1,revokeSponsorshipNotSponsor:-2,revokeSponsorshipLowReserve:-3,revokeSponsorshipOnlyTransferable:-4,revokeSponsorshipMalformed:-5}),e.union("RevokeSponsorshipResult",{switchOn:e.lookup("RevokeSponsorshipResultCode"),switchName:"code",switches:[["revokeSponsorshipSuccess",e.void()],["revokeSponsorshipDoesNotExist",e.void()],["revokeSponsorshipNotSponsor",e.void()],["revokeSponsorshipLowReserve",e.void()],["revokeSponsorshipOnlyTransferable",e.void()],["revokeSponsorshipMalformed",e.void()]],arms:{}}),e.enum("ClawbackResultCode",{clawbackSuccess:0,clawbackMalformed:-1,clawbackNotClawbackEnabled:-2,clawbackNoTrust:-3,clawbackUnderfunded:-4}),e.union("ClawbackResult",{switchOn:e.lookup("ClawbackResultCode"),switchName:"code",switches:[["clawbackSuccess",e.void()],["clawbackMalformed",e.void()],["clawbackNotClawbackEnabled",e.void()],["clawbackNoTrust",e.void()],["clawbackUnderfunded",e.void()]],arms:{}}),e.enum("ClawbackClaimableBalanceResultCode",{clawbackClaimableBalanceSuccess:0,clawbackClaimableBalanceDoesNotExist:-1,clawbackClaimableBalanceNotIssuer:-2,clawbackClaimableBalanceNotClawbackEnabled:-3}),e.union("ClawbackClaimableBalanceResult",{switchOn:e.lookup("ClawbackClaimableBalanceResultCode"),switchName:"code",switches:[["clawbackClaimableBalanceSuccess",e.void()],["clawbackClaimableBalanceDoesNotExist",e.void()],["clawbackClaimableBalanceNotIssuer",e.void()],["clawbackClaimableBalanceNotClawbackEnabled",e.void()]],arms:{}}),e.enum("SetTrustLineFlagsResultCode",{setTrustLineFlagsSuccess:0,setTrustLineFlagsMalformed:-1,setTrustLineFlagsNoTrustLine:-2,setTrustLineFlagsCantRevoke:-3,setTrustLineFlagsInvalidState:-4,setTrustLineFlagsLowReserve:-5}),e.union("SetTrustLineFlagsResult",{switchOn:e.lookup("SetTrustLineFlagsResultCode"),switchName:"code",switches:[["setTrustLineFlagsSuccess",e.void()],["setTrustLineFlagsMalformed",e.void()],["setTrustLineFlagsNoTrustLine",e.void()],["setTrustLineFlagsCantRevoke",e.void()],["setTrustLineFlagsInvalidState",e.void()],["setTrustLineFlagsLowReserve",e.void()]],arms:{}}),e.enum("LiquidityPoolDepositResultCode",{liquidityPoolDepositSuccess:0,liquidityPoolDepositMalformed:-1,liquidityPoolDepositNoTrust:-2,liquidityPoolDepositNotAuthorized:-3,liquidityPoolDepositUnderfunded:-4,liquidityPoolDepositLineFull:-5,liquidityPoolDepositBadPrice:-6,liquidityPoolDepositPoolFull:-7}),e.union("LiquidityPoolDepositResult",{switchOn:e.lookup("LiquidityPoolDepositResultCode"),switchName:"code",switches:[["liquidityPoolDepositSuccess",e.void()],["liquidityPoolDepositMalformed",e.void()],["liquidityPoolDepositNoTrust",e.void()],["liquidityPoolDepositNotAuthorized",e.void()],["liquidityPoolDepositUnderfunded",e.void()],["liquidityPoolDepositLineFull",e.void()],["liquidityPoolDepositBadPrice",e.void()],["liquidityPoolDepositPoolFull",e.void()]],arms:{}}),e.enum("LiquidityPoolWithdrawResultCode",{liquidityPoolWithdrawSuccess:0,liquidityPoolWithdrawMalformed:-1,liquidityPoolWithdrawNoTrust:-2,liquidityPoolWithdrawUnderfunded:-3,liquidityPoolWithdrawLineFull:-4,liquidityPoolWithdrawUnderMinimum:-5}),e.union("LiquidityPoolWithdrawResult",{switchOn:e.lookup("LiquidityPoolWithdrawResultCode"),switchName:"code",switches:[["liquidityPoolWithdrawSuccess",e.void()],["liquidityPoolWithdrawMalformed",e.void()],["liquidityPoolWithdrawNoTrust",e.void()],["liquidityPoolWithdrawUnderfunded",e.void()],["liquidityPoolWithdrawLineFull",e.void()],["liquidityPoolWithdrawUnderMinimum",e.void()]],arms:{}}),e.enum("InvokeHostFunctionResultCode",{invokeHostFunctionSuccess:0,invokeHostFunctionMalformed:-1,invokeHostFunctionTrapped:-2,invokeHostFunctionResourceLimitExceeded:-3,invokeHostFunctionEntryArchived:-4,invokeHostFunctionInsufficientRefundableFee:-5}),e.union("InvokeHostFunctionResult",{switchOn:e.lookup("InvokeHostFunctionResultCode"),switchName:"code",switches:[["invokeHostFunctionSuccess","success"],["invokeHostFunctionMalformed",e.void()],["invokeHostFunctionTrapped",e.void()],["invokeHostFunctionResourceLimitExceeded",e.void()],["invokeHostFunctionEntryArchived",e.void()],["invokeHostFunctionInsufficientRefundableFee",e.void()]],arms:{success:e.lookup("Hash")}}),e.enum("ExtendFootprintTtlResultCode",{extendFootprintTtlSuccess:0,extendFootprintTtlMalformed:-1,extendFootprintTtlResourceLimitExceeded:-2,extendFootprintTtlInsufficientRefundableFee:-3}),e.union("ExtendFootprintTtlResult",{switchOn:e.lookup("ExtendFootprintTtlResultCode"),switchName:"code",switches:[["extendFootprintTtlSuccess",e.void()],["extendFootprintTtlMalformed",e.void()],["extendFootprintTtlResourceLimitExceeded",e.void()],["extendFootprintTtlInsufficientRefundableFee",e.void()]],arms:{}}),e.enum("RestoreFootprintResultCode",{restoreFootprintSuccess:0,restoreFootprintMalformed:-1,restoreFootprintResourceLimitExceeded:-2,restoreFootprintInsufficientRefundableFee:-3}),e.union("RestoreFootprintResult",{switchOn:e.lookup("RestoreFootprintResultCode"),switchName:"code",switches:[["restoreFootprintSuccess",e.void()],["restoreFootprintMalformed",e.void()],["restoreFootprintResourceLimitExceeded",e.void()],["restoreFootprintInsufficientRefundableFee",e.void()]],arms:{}}),e.enum("OperationResultCode",{opInner:0,opBadAuth:-1,opNoAccount:-2,opNotSupported:-3,opTooManySubentries:-4,opExceededWorkLimit:-5,opTooManySponsoring:-6}),e.union("OperationResultTr",{switchOn:e.lookup("OperationType"),switchName:"type",switches:[["createAccount","createAccountResult"],["payment","paymentResult"],["pathPaymentStrictReceive","pathPaymentStrictReceiveResult"],["manageSellOffer","manageSellOfferResult"],["createPassiveSellOffer","createPassiveSellOfferResult"],["setOptions","setOptionsResult"],["changeTrust","changeTrustResult"],["allowTrust","allowTrustResult"],["accountMerge","accountMergeResult"],["inflation","inflationResult"],["manageData","manageDataResult"],["bumpSequence","bumpSeqResult"],["manageBuyOffer","manageBuyOfferResult"],["pathPaymentStrictSend","pathPaymentStrictSendResult"],["createClaimableBalance","createClaimableBalanceResult"],["claimClaimableBalance","claimClaimableBalanceResult"],["beginSponsoringFutureReserves","beginSponsoringFutureReservesResult"],["endSponsoringFutureReserves","endSponsoringFutureReservesResult"],["revokeSponsorship","revokeSponsorshipResult"],["clawback","clawbackResult"],["clawbackClaimableBalance","clawbackClaimableBalanceResult"],["setTrustLineFlags","setTrustLineFlagsResult"],["liquidityPoolDeposit","liquidityPoolDepositResult"],["liquidityPoolWithdraw","liquidityPoolWithdrawResult"],["invokeHostFunction","invokeHostFunctionResult"],["extendFootprintTtl","extendFootprintTtlResult"],["restoreFootprint","restoreFootprintResult"]],arms:{createAccountResult:e.lookup("CreateAccountResult"),paymentResult:e.lookup("PaymentResult"),pathPaymentStrictReceiveResult:e.lookup("PathPaymentStrictReceiveResult"),manageSellOfferResult:e.lookup("ManageSellOfferResult"),createPassiveSellOfferResult:e.lookup("ManageSellOfferResult"),setOptionsResult:e.lookup("SetOptionsResult"),changeTrustResult:e.lookup("ChangeTrustResult"),allowTrustResult:e.lookup("AllowTrustResult"),accountMergeResult:e.lookup("AccountMergeResult"),inflationResult:e.lookup("InflationResult"),manageDataResult:e.lookup("ManageDataResult"),bumpSeqResult:e.lookup("BumpSequenceResult"),manageBuyOfferResult:e.lookup("ManageBuyOfferResult"),pathPaymentStrictSendResult:e.lookup("PathPaymentStrictSendResult"),createClaimableBalanceResult:e.lookup("CreateClaimableBalanceResult"),claimClaimableBalanceResult:e.lookup("ClaimClaimableBalanceResult"),beginSponsoringFutureReservesResult:e.lookup("BeginSponsoringFutureReservesResult"),endSponsoringFutureReservesResult:e.lookup("EndSponsoringFutureReservesResult"),revokeSponsorshipResult:e.lookup("RevokeSponsorshipResult"),clawbackResult:e.lookup("ClawbackResult"),clawbackClaimableBalanceResult:e.lookup("ClawbackClaimableBalanceResult"),setTrustLineFlagsResult:e.lookup("SetTrustLineFlagsResult"),liquidityPoolDepositResult:e.lookup("LiquidityPoolDepositResult"),liquidityPoolWithdrawResult:e.lookup("LiquidityPoolWithdrawResult"),invokeHostFunctionResult:e.lookup("InvokeHostFunctionResult"),extendFootprintTtlResult:e.lookup("ExtendFootprintTtlResult"),restoreFootprintResult:e.lookup("RestoreFootprintResult")}}),e.union("OperationResult",{switchOn:e.lookup("OperationResultCode"),switchName:"code",switches:[["opInner","tr"],["opBadAuth",e.void()],["opNoAccount",e.void()],["opNotSupported",e.void()],["opTooManySubentries",e.void()],["opExceededWorkLimit",e.void()],["opTooManySponsoring",e.void()]],arms:{tr:e.lookup("OperationResultTr")}}),e.enum("TransactionResultCode",{txFeeBumpInnerSuccess:1,txSuccess:0,txFailed:-1,txTooEarly:-2,txTooLate:-3,txMissingOperation:-4,txBadSeq:-5,txBadAuth:-6,txInsufficientBalance:-7,txNoAccount:-8,txInsufficientFee:-9,txBadAuthExtra:-10,txInternalError:-11,txNotSupported:-12,txFeeBumpInnerFailed:-13,txBadSponsorship:-14,txBadMinSeqAgeOrGap:-15,txMalformed:-16,txSorobanInvalid:-17}),e.union("InnerTransactionResultResult",{switchOn:e.lookup("TransactionResultCode"),switchName:"code",switches:[["txSuccess","results"],["txFailed","results"],["txTooEarly",e.void()],["txTooLate",e.void()],["txMissingOperation",e.void()],["txBadSeq",e.void()],["txBadAuth",e.void()],["txInsufficientBalance",e.void()],["txNoAccount",e.void()],["txInsufficientFee",e.void()],["txBadAuthExtra",e.void()],["txInternalError",e.void()],["txNotSupported",e.void()],["txBadSponsorship",e.void()],["txBadMinSeqAgeOrGap",e.void()],["txMalformed",e.void()],["txSorobanInvalid",e.void()]],arms:{results:e.varArray(e.lookup("OperationResult"),2147483647)}}),e.union("InnerTransactionResultExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("InnerTransactionResult",[["feeCharged",e.lookup("Int64")],["result",e.lookup("InnerTransactionResultResult")],["ext",e.lookup("InnerTransactionResultExt")]]),e.struct("InnerTransactionResultPair",[["transactionHash",e.lookup("Hash")],["result",e.lookup("InnerTransactionResult")]]),e.union("TransactionResultResult",{switchOn:e.lookup("TransactionResultCode"),switchName:"code",switches:[["txFeeBumpInnerSuccess","innerResultPair"],["txFeeBumpInnerFailed","innerResultPair"],["txSuccess","results"],["txFailed","results"],["txTooEarly",e.void()],["txTooLate",e.void()],["txMissingOperation",e.void()],["txBadSeq",e.void()],["txBadAuth",e.void()],["txInsufficientBalance",e.void()],["txNoAccount",e.void()],["txInsufficientFee",e.void()],["txBadAuthExtra",e.void()],["txInternalError",e.void()],["txNotSupported",e.void()],["txBadSponsorship",e.void()],["txBadMinSeqAgeOrGap",e.void()],["txMalformed",e.void()],["txSorobanInvalid",e.void()]],arms:{innerResultPair:e.lookup("InnerTransactionResultPair"),results:e.varArray(e.lookup("OperationResult"),2147483647)}}),e.union("TransactionResultExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionResult",[["feeCharged",e.lookup("Int64")],["result",e.lookup("TransactionResultResult")],["ext",e.lookup("TransactionResultExt")]]),e.typedef("Hash",e.opaque(32)),e.typedef("Uint256",e.opaque(32)),e.typedef("Uint32",e.uint()),e.typedef("Int32",e.int()),e.typedef("Uint64",e.uhyper()),e.typedef("Int64",e.hyper()),e.typedef("TimePoint",e.lookup("Uint64")),e.typedef("Duration",e.lookup("Uint64")),e.union("ExtensionPoint",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.enum("CryptoKeyType",{keyTypeEd25519:0,keyTypePreAuthTx:1,keyTypeHashX:2,keyTypeEd25519SignedPayload:3,keyTypeMuxedEd25519:256}),e.enum("PublicKeyType",{publicKeyTypeEd25519:0}),e.enum("SignerKeyType",{signerKeyTypeEd25519:0,signerKeyTypePreAuthTx:1,signerKeyTypeHashX:2,signerKeyTypeEd25519SignedPayload:3}),e.union("PublicKey",{switchOn:e.lookup("PublicKeyType"),switchName:"type",switches:[["publicKeyTypeEd25519","ed25519"]],arms:{ed25519:e.lookup("Uint256")}}),e.struct("SignerKeyEd25519SignedPayload",[["ed25519",e.lookup("Uint256")],["payload",e.varOpaque(64)]]),e.union("SignerKey",{switchOn:e.lookup("SignerKeyType"),switchName:"type",switches:[["signerKeyTypeEd25519","ed25519"],["signerKeyTypePreAuthTx","preAuthTx"],["signerKeyTypeHashX","hashX"],["signerKeyTypeEd25519SignedPayload","ed25519SignedPayload"]],arms:{ed25519:e.lookup("Uint256"),preAuthTx:e.lookup("Uint256"),hashX:e.lookup("Uint256"),ed25519SignedPayload:e.lookup("SignerKeyEd25519SignedPayload")}}),e.typedef("Signature",e.varOpaque(64)),e.typedef("SignatureHint",e.opaque(4)),e.typedef("NodeId",e.lookup("PublicKey")),e.typedef("AccountId",e.lookup("PublicKey")),e.struct("Curve25519Secret",[["key",e.opaque(32)]]),e.struct("Curve25519Public",[["key",e.opaque(32)]]),e.struct("HmacSha256Key",[["key",e.opaque(32)]]),e.struct("HmacSha256Mac",[["mac",e.opaque(32)]]),e.enum("ScValType",{scvBool:0,scvVoid:1,scvError:2,scvU32:3,scvI32:4,scvU64:5,scvI64:6,scvTimepoint:7,scvDuration:8,scvU128:9,scvI128:10,scvU256:11,scvI256:12,scvBytes:13,scvString:14,scvSymbol:15,scvVec:16,scvMap:17,scvAddress:18,scvContractInstance:19,scvLedgerKeyContractInstance:20,scvLedgerKeyNonce:21}),e.enum("ScErrorType",{sceContract:0,sceWasmVm:1,sceContext:2,sceStorage:3,sceObject:4,sceCrypto:5,sceEvents:6,sceBudget:7,sceValue:8,sceAuth:9}),e.enum("ScErrorCode",{scecArithDomain:0,scecIndexBounds:1,scecInvalidInput:2,scecMissingValue:3,scecExistingValue:4,scecExceededLimit:5,scecInvalidAction:6,scecInternalError:7,scecUnexpectedType:8,scecUnexpectedSize:9}),e.union("ScError",{switchOn:e.lookup("ScErrorType"),switchName:"type",switches:[["sceContract","contractCode"],["sceWasmVm","code"],["sceContext","code"],["sceStorage","code"],["sceObject","code"],["sceCrypto","code"],["sceEvents","code"],["sceBudget","code"],["sceValue","code"],["sceAuth","code"]],arms:{contractCode:e.lookup("Uint32"),code:e.lookup("ScErrorCode")}}),e.struct("UInt128Parts",[["hi",e.lookup("Uint64")],["lo",e.lookup("Uint64")]]),e.struct("Int128Parts",[["hi",e.lookup("Int64")],["lo",e.lookup("Uint64")]]),e.struct("UInt256Parts",[["hiHi",e.lookup("Uint64")],["hiLo",e.lookup("Uint64")],["loHi",e.lookup("Uint64")],["loLo",e.lookup("Uint64")]]),e.struct("Int256Parts",[["hiHi",e.lookup("Int64")],["hiLo",e.lookup("Uint64")],["loHi",e.lookup("Uint64")],["loLo",e.lookup("Uint64")]]),e.enum("ContractExecutableType",{contractExecutableWasm:0,contractExecutableStellarAsset:1}),e.union("ContractExecutable",{switchOn:e.lookup("ContractExecutableType"),switchName:"type",switches:[["contractExecutableWasm","wasmHash"],["contractExecutableStellarAsset",e.void()]],arms:{wasmHash:e.lookup("Hash")}}),e.enum("ScAddressType",{scAddressTypeAccount:0,scAddressTypeContract:1}),e.union("ScAddress",{switchOn:e.lookup("ScAddressType"),switchName:"type",switches:[["scAddressTypeAccount","accountId"],["scAddressTypeContract","contractId"]],arms:{accountId:e.lookup("AccountId"),contractId:e.lookup("Hash")}}),e.const("SCSYMBOL_LIMIT",32),e.typedef("ScVec",e.varArray(e.lookup("ScVal"),2147483647)),e.typedef("ScMap",e.varArray(e.lookup("ScMapEntry"),2147483647)),e.typedef("ScBytes",e.varOpaque()),e.typedef("ScString",e.string()),e.typedef("ScSymbol",e.string(32)),e.struct("ScNonceKey",[["nonce",e.lookup("Int64")]]),e.struct("ScContractInstance",[["executable",e.lookup("ContractExecutable")],["storage",e.option(e.lookup("ScMap"))]]),e.union("ScVal",{switchOn:e.lookup("ScValType"),switchName:"type",switches:[["scvBool","b"],["scvVoid",e.void()],["scvError","error"],["scvU32","u32"],["scvI32","i32"],["scvU64","u64"],["scvI64","i64"],["scvTimepoint","timepoint"],["scvDuration","duration"],["scvU128","u128"],["scvI128","i128"],["scvU256","u256"],["scvI256","i256"],["scvBytes","bytes"],["scvString","str"],["scvSymbol","sym"],["scvVec","vec"],["scvMap","map"],["scvAddress","address"],["scvLedgerKeyContractInstance",e.void()],["scvLedgerKeyNonce","nonceKey"],["scvContractInstance","instance"]],arms:{b:e.bool(),error:e.lookup("ScError"),u32:e.lookup("Uint32"),i32:e.lookup("Int32"),u64:e.lookup("Uint64"),i64:e.lookup("Int64"),timepoint:e.lookup("TimePoint"),duration:e.lookup("Duration"),u128:e.lookup("UInt128Parts"),i128:e.lookup("Int128Parts"),u256:e.lookup("UInt256Parts"),i256:e.lookup("Int256Parts"),bytes:e.lookup("ScBytes"),str:e.lookup("ScString"),sym:e.lookup("ScSymbol"),vec:e.option(e.lookup("ScVec")),map:e.option(e.lookup("ScMap")),address:e.lookup("ScAddress"),nonceKey:e.lookup("ScNonceKey"),instance:e.lookup("ScContractInstance")}}),e.struct("ScMapEntry",[["key",e.lookup("ScVal")],["val",e.lookup("ScVal")]]),e.enum("ScEnvMetaKind",{scEnvMetaKindInterfaceVersion:0}),e.union("ScEnvMetaEntry",{switchOn:e.lookup("ScEnvMetaKind"),switchName:"kind",switches:[["scEnvMetaKindInterfaceVersion","interfaceVersion"]],arms:{interfaceVersion:e.lookup("Uint64")}}),e.struct("ScMetaV0",[["key",e.string()],["val",e.string()]]),e.enum("ScMetaKind",{scMetaV0:0}),e.union("ScMetaEntry",{switchOn:e.lookup("ScMetaKind"),switchName:"kind",switches:[["scMetaV0","v0"]],arms:{v0:e.lookup("ScMetaV0")}}),e.const("SC_SPEC_DOC_LIMIT",1024),e.enum("ScSpecType",{scSpecTypeVal:0,scSpecTypeBool:1,scSpecTypeVoid:2,scSpecTypeError:3,scSpecTypeU32:4,scSpecTypeI32:5,scSpecTypeU64:6,scSpecTypeI64:7,scSpecTypeTimepoint:8,scSpecTypeDuration:9,scSpecTypeU128:10,scSpecTypeI128:11,scSpecTypeU256:12,scSpecTypeI256:13,scSpecTypeBytes:14,scSpecTypeString:16,scSpecTypeSymbol:17,scSpecTypeAddress:19,scSpecTypeOption:1e3,scSpecTypeResult:1001,scSpecTypeVec:1002,scSpecTypeMap:1004,scSpecTypeTuple:1005,scSpecTypeBytesN:1006,scSpecTypeUdt:2e3}),e.struct("ScSpecTypeOption",[["valueType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeResult",[["okType",e.lookup("ScSpecTypeDef")],["errorType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeVec",[["elementType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeMap",[["keyType",e.lookup("ScSpecTypeDef")],["valueType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeTuple",[["valueTypes",e.varArray(e.lookup("ScSpecTypeDef"),12)]]),e.struct("ScSpecTypeBytesN",[["n",e.lookup("Uint32")]]),e.struct("ScSpecTypeUdt",[["name",e.string(60)]]),e.union("ScSpecTypeDef",{switchOn:e.lookup("ScSpecType"),switchName:"type",switches:[["scSpecTypeVal",e.void()],["scSpecTypeBool",e.void()],["scSpecTypeVoid",e.void()],["scSpecTypeError",e.void()],["scSpecTypeU32",e.void()],["scSpecTypeI32",e.void()],["scSpecTypeU64",e.void()],["scSpecTypeI64",e.void()],["scSpecTypeTimepoint",e.void()],["scSpecTypeDuration",e.void()],["scSpecTypeU128",e.void()],["scSpecTypeI128",e.void()],["scSpecTypeU256",e.void()],["scSpecTypeI256",e.void()],["scSpecTypeBytes",e.void()],["scSpecTypeString",e.void()],["scSpecTypeSymbol",e.void()],["scSpecTypeAddress",e.void()],["scSpecTypeOption","option"],["scSpecTypeResult","result"],["scSpecTypeVec","vec"],["scSpecTypeMap","map"],["scSpecTypeTuple","tuple"],["scSpecTypeBytesN","bytesN"],["scSpecTypeUdt","udt"]],arms:{option:e.lookup("ScSpecTypeOption"),result:e.lookup("ScSpecTypeResult"),vec:e.lookup("ScSpecTypeVec"),map:e.lookup("ScSpecTypeMap"),tuple:e.lookup("ScSpecTypeTuple"),bytesN:e.lookup("ScSpecTypeBytesN"),udt:e.lookup("ScSpecTypeUdt")}}),e.struct("ScSpecUdtStructFieldV0",[["doc",e.string(t)],["name",e.string(30)],["type",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecUdtStructV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["fields",e.varArray(e.lookup("ScSpecUdtStructFieldV0"),40)]]),e.struct("ScSpecUdtUnionCaseVoidV0",[["doc",e.string(t)],["name",e.string(60)]]),e.struct("ScSpecUdtUnionCaseTupleV0",[["doc",e.string(t)],["name",e.string(60)],["type",e.varArray(e.lookup("ScSpecTypeDef"),12)]]),e.enum("ScSpecUdtUnionCaseV0Kind",{scSpecUdtUnionCaseVoidV0:0,scSpecUdtUnionCaseTupleV0:1}),e.union("ScSpecUdtUnionCaseV0",{switchOn:e.lookup("ScSpecUdtUnionCaseV0Kind"),switchName:"kind",switches:[["scSpecUdtUnionCaseVoidV0","voidCase"],["scSpecUdtUnionCaseTupleV0","tupleCase"]],arms:{voidCase:e.lookup("ScSpecUdtUnionCaseVoidV0"),tupleCase:e.lookup("ScSpecUdtUnionCaseTupleV0")}}),e.struct("ScSpecUdtUnionV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtUnionCaseV0"),50)]]),e.struct("ScSpecUdtEnumCaseV0",[["doc",e.string(t)],["name",e.string(60)],["value",e.lookup("Uint32")]]),e.struct("ScSpecUdtEnumV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtEnumCaseV0"),50)]]),e.struct("ScSpecUdtErrorEnumCaseV0",[["doc",e.string(t)],["name",e.string(60)],["value",e.lookup("Uint32")]]),e.struct("ScSpecUdtErrorEnumV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtErrorEnumCaseV0"),50)]]),e.struct("ScSpecFunctionInputV0",[["doc",e.string(t)],["name",e.string(30)],["type",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecFunctionV0",[["doc",e.string(t)],["name",e.lookup("ScSymbol")],["inputs",e.varArray(e.lookup("ScSpecFunctionInputV0"),10)],["outputs",e.varArray(e.lookup("ScSpecTypeDef"),1)]]),e.enum("ScSpecEntryKind",{scSpecEntryFunctionV0:0,scSpecEntryUdtStructV0:1,scSpecEntryUdtUnionV0:2,scSpecEntryUdtEnumV0:3,scSpecEntryUdtErrorEnumV0:4}),e.union("ScSpecEntry",{switchOn:e.lookup("ScSpecEntryKind"),switchName:"kind",switches:[["scSpecEntryFunctionV0","functionV0"],["scSpecEntryUdtStructV0","udtStructV0"],["scSpecEntryUdtUnionV0","udtUnionV0"],["scSpecEntryUdtEnumV0","udtEnumV0"],["scSpecEntryUdtErrorEnumV0","udtErrorEnumV0"]],arms:{functionV0:e.lookup("ScSpecFunctionV0"),udtStructV0:e.lookup("ScSpecUdtStructV0"),udtUnionV0:e.lookup("ScSpecUdtUnionV0"),udtEnumV0:e.lookup("ScSpecUdtEnumV0"),udtErrorEnumV0:e.lookup("ScSpecUdtErrorEnumV0")}}),e.struct("ConfigSettingContractExecutionLanesV0",[["ledgerMaxTxCount",e.lookup("Uint32")]]),e.struct("ConfigSettingContractComputeV0",[["ledgerMaxInstructions",e.lookup("Int64")],["txMaxInstructions",e.lookup("Int64")],["feeRatePerInstructionsIncrement",e.lookup("Int64")],["txMemoryLimit",e.lookup("Uint32")]]),e.struct("ConfigSettingContractLedgerCostV0",[["ledgerMaxReadLedgerEntries",e.lookup("Uint32")],["ledgerMaxReadBytes",e.lookup("Uint32")],["ledgerMaxWriteLedgerEntries",e.lookup("Uint32")],["ledgerMaxWriteBytes",e.lookup("Uint32")],["txMaxReadLedgerEntries",e.lookup("Uint32")],["txMaxReadBytes",e.lookup("Uint32")],["txMaxWriteLedgerEntries",e.lookup("Uint32")],["txMaxWriteBytes",e.lookup("Uint32")],["feeReadLedgerEntry",e.lookup("Int64")],["feeWriteLedgerEntry",e.lookup("Int64")],["feeRead1Kb",e.lookup("Int64")],["bucketListTargetSizeBytes",e.lookup("Int64")],["writeFee1KbBucketListLow",e.lookup("Int64")],["writeFee1KbBucketListHigh",e.lookup("Int64")],["bucketListWriteFeeGrowthFactor",e.lookup("Uint32")]]),e.struct("ConfigSettingContractHistoricalDataV0",[["feeHistorical1Kb",e.lookup("Int64")]]),e.struct("ConfigSettingContractEventsV0",[["txMaxContractEventsSizeBytes",e.lookup("Uint32")],["feeContractEvents1Kb",e.lookup("Int64")]]),e.struct("ConfigSettingContractBandwidthV0",[["ledgerMaxTxsSizeBytes",e.lookup("Uint32")],["txMaxSizeBytes",e.lookup("Uint32")],["feeTxSize1Kb",e.lookup("Int64")]]),e.enum("ContractCostType",{wasmInsnExec:0,memAlloc:1,memCpy:2,memCmp:3,dispatchHostFunction:4,visitObject:5,valSer:6,valDeser:7,computeSha256Hash:8,computeEd25519PubKey:9,verifyEd25519Sig:10,vmInstantiation:11,vmCachedInstantiation:12,invokeVmFunction:13,computeKeccak256Hash:14,computeEcdsaSecp256k1Sig:15,recoverEcdsaSecp256k1Key:16,int256AddSub:17,int256Mul:18,int256Div:19,int256Pow:20,int256Shift:21,chaCha20DrawBytes:22}),e.struct("ContractCostParamEntry",[["ext",e.lookup("ExtensionPoint")],["constTerm",e.lookup("Int64")],["linearTerm",e.lookup("Int64")]]),e.struct("StateArchivalSettings",[["maxEntryTtl",e.lookup("Uint32")],["minTemporaryTtl",e.lookup("Uint32")],["minPersistentTtl",e.lookup("Uint32")],["persistentRentRateDenominator",e.lookup("Int64")],["tempRentRateDenominator",e.lookup("Int64")],["maxEntriesToArchive",e.lookup("Uint32")],["bucketListSizeWindowSampleSize",e.lookup("Uint32")],["evictionScanSize",e.lookup("Uint64")],["startingEvictionScanLevel",e.lookup("Uint32")]]),e.struct("EvictionIterator",[["bucketListLevel",e.lookup("Uint32")],["isCurrBucket",e.bool()],["bucketFileOffset",e.lookup("Uint64")]]),e.const("CONTRACT_COST_COUNT_LIMIT",1024),e.typedef("ContractCostParams",e.varArray(e.lookup("ContractCostParamEntry"),e.lookup("CONTRACT_COST_COUNT_LIMIT"))),e.enum("ConfigSettingId",{configSettingContractMaxSizeBytes:0,configSettingContractComputeV0:1,configSettingContractLedgerCostV0:2,configSettingContractHistoricalDataV0:3,configSettingContractEventsV0:4,configSettingContractBandwidthV0:5,configSettingContractCostParamsCpuInstructions:6,configSettingContractCostParamsMemoryBytes:7,configSettingContractDataKeySizeBytes:8,configSettingContractDataEntrySizeBytes:9,configSettingStateArchival:10,configSettingContractExecutionLanes:11,configSettingBucketlistSizeWindow:12,configSettingEvictionIterator:13}),e.union("ConfigSettingEntry",{switchOn:e.lookup("ConfigSettingId"),switchName:"configSettingId",switches:[["configSettingContractMaxSizeBytes","contractMaxSizeBytes"],["configSettingContractComputeV0","contractCompute"],["configSettingContractLedgerCostV0","contractLedgerCost"],["configSettingContractHistoricalDataV0","contractHistoricalData"],["configSettingContractEventsV0","contractEvents"],["configSettingContractBandwidthV0","contractBandwidth"],["configSettingContractCostParamsCpuInstructions","contractCostParamsCpuInsns"],["configSettingContractCostParamsMemoryBytes","contractCostParamsMemBytes"],["configSettingContractDataKeySizeBytes","contractDataKeySizeBytes"],["configSettingContractDataEntrySizeBytes","contractDataEntrySizeBytes"],["configSettingStateArchival","stateArchivalSettings"],["configSettingContractExecutionLanes","contractExecutionLanes"],["configSettingBucketlistSizeWindow","bucketListSizeWindow"],["configSettingEvictionIterator","evictionIterator"]],arms:{contractMaxSizeBytes:e.lookup("Uint32"),contractCompute:e.lookup("ConfigSettingContractComputeV0"),contractLedgerCost:e.lookup("ConfigSettingContractLedgerCostV0"),contractHistoricalData:e.lookup("ConfigSettingContractHistoricalDataV0"),contractEvents:e.lookup("ConfigSettingContractEventsV0"),contractBandwidth:e.lookup("ConfigSettingContractBandwidthV0"),contractCostParamsCpuInsns:e.lookup("ContractCostParams"),contractCostParamsMemBytes:e.lookup("ContractCostParams"),contractDataKeySizeBytes:e.lookup("Uint32"),contractDataEntrySizeBytes:e.lookup("Uint32"),stateArchivalSettings:e.lookup("StateArchivalSettings"),contractExecutionLanes:e.lookup("ConfigSettingContractExecutionLanesV0"),bucketListSizeWindow:e.varArray(e.lookup("Uint64"),2147483647),evictionIterator:e.lookup("EvictionIterator")}})}));t.default=i},9396:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.LiquidityPoolFeeV18=void 0,t.getLiquidityPoolId=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("constant_product"!==e)throw new Error("liquidityPoolType is invalid");var r=t.assetA,o=t.assetB,c=t.fee;if(!(r&&r instanceof a.Asset))throw new Error("assetA is invalid");if(!(o&&o instanceof a.Asset))throw new Error("assetB is invalid");if(!c||c!==u)throw new Error("fee is invalid");if(-1!==a.Asset.compare(r,o))throw new Error("Assets are not in lexicographic order");var l=i.default.LiquidityPoolType.liquidityPoolConstantProduct().toXDR(),f=new i.default.LiquidityPoolConstantProductParameters({assetA:r.toXDRObject(),assetB:o.toXDRObject(),fee:c}).toXDR(),d=n.concat([l,f]);return(0,s.hash)(d)};var o,i=(o=r(4081))&&o.__esModule?o:{default:o},a=r(3469),s=r(9622),u=t.LiquidityPoolFeeV18=30},9622:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hash=function(e){var t=new n.sha256;return t.update(e,"utf8"),t.digest()};var n=r(9072)},4172:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={xdr:!0,hash:!0,sign:!0,verify:!0,FastSigning:!0,getLiquidityPoolId:!0,LiquidityPoolFeeV18:!0,Keypair:!0,UnsignedHyper:!0,Hyper:!0,TransactionBase:!0,Transaction:!0,FeeBumpTransaction:!0,TransactionBuilder:!0,TimeoutInfinite:!0,BASE_FEE:!0,Asset:!0,LiquidityPoolAsset:!0,LiquidityPoolId:!0,Operation:!0,AuthRequiredFlag:!0,AuthRevocableFlag:!0,AuthImmutableFlag:!0,AuthClawbackEnabledFlag:!0,Account:!0,MuxedAccount:!0,Claimant:!0,Networks:!0,StrKey:!0,SignerKey:!0,Soroban:!0,decodeAddressToMuxedAccount:!0,encodeMuxedAccountToAddress:!0,extractBaseAddress:!0,encodeMuxedAccount:!0,Contract:!0,Address:!0};Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return w.Account}}),Object.defineProperty(t,"Address",{enumerable:!0,get:function(){return O.Address}}),Object.defineProperty(t,"Asset",{enumerable:!0,get:function(){return y.Asset}}),Object.defineProperty(t,"AuthClawbackEnabledFlag",{enumerable:!0,get:function(){return v.AuthClawbackEnabledFlag}}),Object.defineProperty(t,"AuthImmutableFlag",{enumerable:!0,get:function(){return v.AuthImmutableFlag}}),Object.defineProperty(t,"AuthRequiredFlag",{enumerable:!0,get:function(){return v.AuthRequiredFlag}}),Object.defineProperty(t,"AuthRevocableFlag",{enumerable:!0,get:function(){return v.AuthRevocableFlag}}),Object.defineProperty(t,"BASE_FEE",{enumerable:!0,get:function(){return p.BASE_FEE}}),Object.defineProperty(t,"Claimant",{enumerable:!0,get:function(){return S.Claimant}}),Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return P.Contract}}),Object.defineProperty(t,"FastSigning",{enumerable:!0,get:function(){return s.FastSigning}}),Object.defineProperty(t,"FeeBumpTransaction",{enumerable:!0,get:function(){return h.FeeBumpTransaction}}),Object.defineProperty(t,"Hyper",{enumerable:!0,get:function(){return l.Hyper}}),Object.defineProperty(t,"Keypair",{enumerable:!0,get:function(){return c.Keypair}}),Object.defineProperty(t,"LiquidityPoolAsset",{enumerable:!0,get:function(){return m.LiquidityPoolAsset}}),Object.defineProperty(t,"LiquidityPoolFeeV18",{enumerable:!0,get:function(){return u.LiquidityPoolFeeV18}}),Object.defineProperty(t,"LiquidityPoolId",{enumerable:!0,get:function(){return g.LiquidityPoolId}}),Object.defineProperty(t,"MuxedAccount",{enumerable:!0,get:function(){return A.MuxedAccount}}),Object.defineProperty(t,"Networks",{enumerable:!0,get:function(){return k.Networks}}),Object.defineProperty(t,"Operation",{enumerable:!0,get:function(){return v.Operation}}),Object.defineProperty(t,"SignerKey",{enumerable:!0,get:function(){return E.SignerKey}}),Object.defineProperty(t,"Soroban",{enumerable:!0,get:function(){return x.Soroban}}),Object.defineProperty(t,"StrKey",{enumerable:!0,get:function(){return _.StrKey}}),Object.defineProperty(t,"TimeoutInfinite",{enumerable:!0,get:function(){return p.TimeoutInfinite}}),Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return d.Transaction}}),Object.defineProperty(t,"TransactionBase",{enumerable:!0,get:function(){return f.TransactionBase}}),Object.defineProperty(t,"TransactionBuilder",{enumerable:!0,get:function(){return p.TransactionBuilder}}),Object.defineProperty(t,"UnsignedHyper",{enumerable:!0,get:function(){return l.UnsignedHyper}}),Object.defineProperty(t,"decodeAddressToMuxedAccount",{enumerable:!0,get:function(){return T.decodeAddressToMuxedAccount}}),t.default=void 0,Object.defineProperty(t,"encodeMuxedAccount",{enumerable:!0,get:function(){return T.encodeMuxedAccount}}),Object.defineProperty(t,"encodeMuxedAccountToAddress",{enumerable:!0,get:function(){return T.encodeMuxedAccountToAddress}}),Object.defineProperty(t,"extractBaseAddress",{enumerable:!0,get:function(){return T.extractBaseAddress}}),Object.defineProperty(t,"getLiquidityPoolId",{enumerable:!0,get:function(){return u.getLiquidityPoolId}}),Object.defineProperty(t,"hash",{enumerable:!0,get:function(){return a.hash}}),Object.defineProperty(t,"sign",{enumerable:!0,get:function(){return s.sign}}),Object.defineProperty(t,"verify",{enumerable:!0,get:function(){return s.verify}}),Object.defineProperty(t,"xdr",{enumerable:!0,get:function(){return i.default}});var o=L(r(4431)),i=L(r(4081)),a=r(9622),s=r(5687),u=r(9396),c=r(6437),l=r(6263),f=r(1065),d=r(1388),h=r(1462),p=r(624),y=r(3469),m=r(1486),g=r(7287),v=r(4585),b=r(4856);Object.keys(b).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===b[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return b[e]}}))}));var w=r(3217),A=r(9022),S=r(1842),k=r(2844),_=r(8385),E=r(5822),x=r(251),T=r(6880),P=r(5618),O=r(3471),R=r(3180);Object.keys(R).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===R[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return R[e]}}))}));var I=r(5567);Object.keys(I).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===I[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return I[e]}}))}));var C=r(3761);Object.keys(C).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===C[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return C[e]}}))}));var M=r(5096);Object.keys(M).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===M[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return M[e]}}))}));var B=r(1687);Object.keys(B).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===B[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return B[e]}}))}));var N=r(3812);function L(e){return e&&e.__esModule?e:{default:e}}Object.keys(N).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||e in t&&t[e]===N[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return N[e]}}))})),o.default.DEBUG=!0,t.default=e.exports},3812:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildInvocationTree=function e(t){var r=t.function(),a={},s=r.value();switch(r.switch().value){case 0:a.type="execute",a.args={source:o.Address.fromScAddress(s.contractAddress()).toString(),function:s.functionName(),args:s.args().map((function(e){return(0,i.scValToNative)(e)}))};break;case 1:a.type="create",a.args={};var u=[s.executable(),s.contractIdPreimage()],c=u[0],l=u[1];if(!!c.switch().value!=!!l.switch().value)throw new Error("creation function appears invalid: ".concat(JSON.stringify(s)," (should be wasm+address or token+asset)"));switch(c.switch().value){case 0:var f=l.fromAddress();a.args.type="wasm",a.args.wasm={salt:f.salt().toString("hex"),hash:c.wasmHash().toString("hex"),address:o.Address.fromScAddress(f.address()).toString()};break;case 1:a.args.type="sac",a.args.asset=n.Asset.fromOperation(l.fromAsset()).toString();break;default:throw new Error("unknown creation type: ".concat(JSON.stringify(c)))}break;default:throw new Error("unknown invocation type (".concat(r.switch(),"): ").concat(JSON.stringify(r)))}return a.invocations=t.subInvocations().map((function(t){return e(t)})),a},t.walkInvocationTree=function(e,t){a(e,1,t)};var n=r(3469),o=r(3471),i=r(5567);function a(e,t,r,n){!1!==r(e,t,n)&&e.subInvocations().forEach((function(n){return a(n,t+1,r,e)}))}},6437:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Keypair=void 0;var o=c(r(7586)),i=r(5687),a=r(8385),s=r(9622),u=c(r(4081));function c(e){return e&&e.__esModule?e:{default:e}}function l(e){return l="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},l(e)}function f(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiquidityPoolAsset=void 0;var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(3469),a=r(9396);function s(e){return s="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},s(e)}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiquidityPoolId=void 0;var n,o=(n=r(4081))&&n.__esModule?n:{default:n};function i(e){return i="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},i(e)}function a(e,t){for(var r=0;r{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.MemoText=t.MemoReturn=t.MemoNone=t.MemoID=t.MemoHash=t.Memo=void 0;var o=r(6263),i=s(r(4431)),a=s(r(4081));function s(e){return e&&e.__esModule?e:{default:e}}function u(e){return u="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},u(e)}function c(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:null;switch(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._type=t,this._value=r,this._type){case l:break;case f:e._validateIdValue(r);break;case d:e._validateTextValue(r);break;case h:case p:e._validateHashValue(r),"string"==typeof r&&(this._value=n.from(r,"hex"));break;default:throw new Error("Invalid memo type")}}var t,r,s;return t=e,s=[{key:"_validateIdValue",value:function(e){var t,r=new Error("Expects a int64 as a string. Got ".concat(e));if("string"!=typeof e)throw r;try{t=new i.default(e)}catch(e){throw r}if(!t.isFinite())throw r;if(t.isNaN())throw r}},{key:"_validateTextValue",value:function(e){if(!a.default.Memo.armTypeForArm("text").isValid(e))throw new Error("Expects string, array or buffer, max 28 bytes")}},{key:"_validateHashValue",value:function(e){var t,r=new Error("Expects a 32 byte hash value or hex encoded string. Got ".concat(e));if(null==e)throw r;if("string"==typeof e){if(!/^[0-9A-Fa-f]{64}$/g.test(e))throw r;t=n.from(e,"hex")}else{if(!n.isBuffer(e))throw r;t=n.from(e)}if(!t.length||32!==t.length)throw r}},{key:"none",value:function(){return new e(l)}},{key:"text",value:function(t){return new e(d,t)}},{key:"id",value:function(t){return new e(f,t)}},{key:"hash",value:function(t){return new e(h,t)}},{key:"return",value:function(t){return new e(p,t)}},{key:"fromXDRObject",value:function(t){switch(t.arm()){case"id":return e.id(t.value().toString());case"text":return e.text(t.value());case"hash":return e.hash(t.value());case"retHash":return e.return(t.value())}if(void 0===t.value())return e.none();throw new Error("Unknown type")}}],(r=[{key:"type",get:function(){return this._type},set:function(e){throw new Error("Memo is immutable")}},{key:"value",get:function(){switch(this._type){case l:return null;case f:case d:return this._value;case h:case p:return n.from(this._value);default:throw new Error("Invalid memo type")}},set:function(e){throw new Error("Memo is immutable")}},{key:"toXDRObject",value:function(){switch(this._type){case l:return a.default.Memo.memoNone();case f:return a.default.Memo.memoId(o.UnsignedHyper.fromString(this._value));case d:return a.default.Memo.memoText(this._value);case h:return a.default.Memo.memoHash(this._value);case p:return a.default.Memo.memoReturn(this._value);default:return null}}}])&&c(t.prototype,r),s&&c(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9022:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MuxedAccount=void 0;var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(3217),a=r(8385),s=r(6880);function u(e){return u="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},u(e)}function c(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Networks=void 0,t.Networks={PUBLIC:"Public Global Stellar Network ; September 2015",TESTNET:"Test SDF Network ; September 2015",FUTURENET:"Test SDF Future Network ; October 2022",SANDBOX:"Local Sandbox Stellar Network ; September 2022",STANDALONE:"Standalone Network ; February 2017"}},3180:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Int128",{enumerable:!0,get:function(){return a.Int128}}),Object.defineProperty(t,"Int256",{enumerable:!0,get:function(){return s.Int256}}),Object.defineProperty(t,"ScInt",{enumerable:!0,get:function(){return u.ScInt}}),Object.defineProperty(t,"Uint128",{enumerable:!0,get:function(){return o.Uint128}}),Object.defineProperty(t,"Uint256",{enumerable:!0,get:function(){return i.Uint256}}),Object.defineProperty(t,"XdrLargeInt",{enumerable:!0,get:function(){return n.XdrLargeInt}}),t.scValToBigInt=function(e){var t=n.XdrLargeInt.getType(e.switch().name);switch(e.switch().name){case"scvU32":case"scvI32":return BigInt(e.value());case"scvU64":case"scvI64":return new n.XdrLargeInt(t,e.value()).toBigInt();case"scvU128":case"scvI128":return new n.XdrLargeInt(t,[e.value().lo(),e.value().hi()]).toBigInt();case"scvU256":case"scvI256":return new n.XdrLargeInt(t,[e.value().loLo(),e.value().loHi(),e.value().hiLo(),e.value().hiHi()]).toBigInt();default:throw TypeError("expected integer type, got ".concat(e.switch()))}};var n=r(6836),o=r(4006),i=r(7882),a=r(9982),s=r(7292),u=r(883)},9982:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Int128=void 0;var o=r(6263);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Int256=void 0;var o=r(6263);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.ScInt=void 0;var o=r(6836);function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=s(e);if(t){var i=s(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}t.ScInt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)}(n,e);var t,r=a(n);function n(e,t){var o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var i=e<0,a=null!==(o=null==t?void 0:t.type)&&void 0!==o?o:"";if(a.startsWith("u")&&i)throw TypeError("specified type ".concat(t.type," yet negative (").concat(e,")"));if(""===a){a=i?"i":"u";var s=function(e){var t,r=e.toString(2).length;return null!==(t=[64,128,256].find((function(e){return r<=e})))&&void 0!==t?t:r}(e);switch(s){case 64:case 128:case 256:a+=s.toString();break;default:throw RangeError("expected 64/128/256 bits for input (".concat(e,"), got ").concat(s))}}return r.call(this,a,e)}return t=n,Object.defineProperty(t,"prototype",{writable:!1}),t}(o.XdrLargeInt)},4006:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Uint128=void 0;var o=r(6263);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.Uint256=void 0;var o=r(6263);function i(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XdrLargeInt=void 0;var n,o=r(6263),i=r(4006),a=r(7882),s=r(9982),u=r(7292),c=(n=r(4081))&&n.__esModule?n:{default:n};function l(e){return l="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},l(e)}function f(e,t){for(var r=0;rNumber.MAX_SAFE_INTEGER||e>64n),r=BigInt.asUintN(64,e);return c.default.ScVal.scvI128(new c.default.Int128Parts({hi:new c.default.Int64(t),lo:new c.default.Uint64(r)}))}},{key:"toU128",value:function(){this._sizeCheck(128);var e=this.int.toBigInt();return c.default.ScVal.scvU128(new c.default.UInt128Parts({hi:new c.default.Uint64(BigInt.asUintN(64,e>>64n)),lo:new c.default.Uint64(BigInt.asUintN(64,e))}))}},{key:"toI256",value:function(){var e=this.int.toBigInt(),t=BigInt.asIntN(64,e>>192n),r=BigInt.asUintN(64,e>>128n),n=BigInt.asUintN(64,e>>64n),o=BigInt.asUintN(64,e);return c.default.ScVal.scvI256(new c.default.Int256Parts({hiHi:new c.default.Int64(t),hiLo:new c.default.Uint64(r),loHi:new c.default.Uint64(n),loLo:new c.default.Uint64(o)}))}},{key:"toU256",value:function(){var e=this.int.toBigInt(),t=BigInt.asUintN(64,e>>192n),r=BigInt.asUintN(64,e>>128n),n=BigInt.asUintN(64,e>>64n),o=BigInt.asUintN(64,e);return c.default.ScVal.scvU256(new c.default.UInt256Parts({hiHi:new c.default.Uint64(t),hiLo:new c.default.Uint64(r),loHi:new c.default.Uint64(n),loLo:new c.default.Uint64(o)}))}},{key:"toScVal",value:function(){switch(this.type){case"i64":return this.toI64();case"i128":return this.toI128();case"i256":return this.toI256();case"u64":return this.toU64();case"u128":return this.toU128();case"u256":return this.toU256();default:throw TypeError("invalid type: ".concat(this.type))}}},{key:"valueOf",value:function(){return this.int.valueOf()}},{key:"toString",value:function(){return this.int.toString()}},{key:"toJSON",value:function(){return{value:this.toBigInt().toString(),type:this.type}}},{key:"_sizeCheck",value:function(e){if(this.int.size>e)throw RangeError("value too large for ".concat(e," bits (").concat(this.type,")"))}}])&&f(t.prototype,r),n&&f(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},4585:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Operation=t.AuthRevocableFlag=t.AuthRequiredFlag=t.AuthImmutableFlag=t.AuthClawbackEnabledFlag=void 0;var n=r(6263),o=m(r(4431)),i=r(6006),a=r(5908),s=r(3469),u=r(1486),c=r(1842),l=r(8385),f=r(7287),d=m(r(4081)),h=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=g(e)&&"function"!=typeof e)return{default:e};var r=y(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(1138)),p=r(6880);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(y=function(e){return e?r:t})(e)}function m(e){return e&&e.__esModule?e:{default:e}}function g(e){return g="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},g(e)}function v(e,t){for(var r=0;r1&&void 0!==arguments[1]&&arguments[1];if("string"!=typeof e)return!1;try{t=new o.default(e)}catch(e){return!1}return!(!r&&t.isZero()||t.isNegative()||t.times(b).gt(new o.default("9223372036854775807").toString())||t.decimalPlaces()>7||t.isNaN()||!t.isFinite())}},{key:"constructAmountRequirementsError",value:function(e){return"".concat(e," argument must be of type String, represent a positive number and have at most 7 digits after the decimal")}},{key:"_checkUnsignedIntValue",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(void 0!==t)switch("string"==typeof t&&(t=parseFloat(t)),!0){case"number"!=typeof t||!Number.isFinite(t)||t%1!=0:throw new Error("".concat(e," value is invalid"));case t<0:throw new Error("".concat(e," value must be unsigned"));case!r||r&&r(t,e):return t;default:throw new Error("".concat(e," value is invalid"))}}},{key:"_toXDRAmount",value:function(e){var t=new o.default(e).times(b);return n.Hyper.fromString(t.toString())}},{key:"_fromXDRAmount",value:function(e){return new o.default(e).div(b).toFixed(7)}},{key:"_fromXDRPrice",value:function(e){return new o.default(e.n()).div(new o.default(e.d())).toString()}},{key:"_toXDRPrice",value:function(e){var t;if(e.n&&e.d)t=new d.default.Price(e);else{var r=(0,a.best_r)(e);t=new d.default.Price({n:parseInt(r[0],10),d:parseInt(r[1],10)})}if(t.n()<0||t.d()<0)throw new Error("price must be positive");return t}}],r&&v(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}());function A(e){return l.StrKey.encodeEd25519PublicKey(e.ed25519())}w.accountMerge=h.accountMerge,w.allowTrust=h.allowTrust,w.bumpSequence=h.bumpSequence,w.changeTrust=h.changeTrust,w.createAccount=h.createAccount,w.createClaimableBalance=h.createClaimableBalance,w.claimClaimableBalance=h.claimClaimableBalance,w.clawbackClaimableBalance=h.clawbackClaimableBalance,w.createPassiveSellOffer=h.createPassiveSellOffer,w.inflation=h.inflation,w.manageData=h.manageData,w.manageSellOffer=h.manageSellOffer,w.manageBuyOffer=h.manageBuyOffer,w.pathPaymentStrictReceive=h.pathPaymentStrictReceive,w.pathPaymentStrictSend=h.pathPaymentStrictSend,w.payment=h.payment,w.setOptions=h.setOptions,w.beginSponsoringFutureReserves=h.beginSponsoringFutureReserves,w.endSponsoringFutureReserves=h.endSponsoringFutureReserves,w.revokeAccountSponsorship=h.revokeAccountSponsorship,w.revokeTrustlineSponsorship=h.revokeTrustlineSponsorship,w.revokeOfferSponsorship=h.revokeOfferSponsorship,w.revokeDataSponsorship=h.revokeDataSponsorship,w.revokeClaimableBalanceSponsorship=h.revokeClaimableBalanceSponsorship,w.revokeLiquidityPoolSponsorship=h.revokeLiquidityPoolSponsorship,w.revokeSignerSponsorship=h.revokeSignerSponsorship,w.clawback=h.clawback,w.setTrustLineFlags=h.setTrustLineFlags,w.liquidityPoolDeposit=h.liquidityPoolDeposit,w.liquidityPoolWithdraw=h.liquidityPoolWithdraw,w.invokeHostFunction=h.invokeHostFunction,w.extendFootprintTtl=h.extendFootprintTtl,w.restoreFootprint=h.restoreFootprint,w.createStellarAssetContract=h.createStellarAssetContract,w.invokeContractFunction=h.invokeContractFunction,w.createCustomContract=h.createCustomContract,w.uploadContractWasm=h.uploadContractWasm},7703:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.accountMerge=function(e){var t={};try{t.body=o.default.OperationBody.accountMerge((0,i.decodeAddressToMuxedAccount)(e.destination))}catch(e){throw new Error("destination is invalid")}return this.setSourceAccount(t,e),new o.default.Operation(t)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6880)},6583:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.allowTrust=function(e){if(!a.StrKey.isValidEd25519PublicKey(e.trustor))throw new Error("trustor is invalid");var t={};if(t.trustor=i.Keypair.fromPublicKey(e.trustor).xdrAccountId(),e.assetCode.length<=4){var r=e.assetCode.padEnd(4,"\0");t.asset=o.default.AssetCode.assetTypeCreditAlphanum4(r)}else{if(!(e.assetCode.length<=12))throw new Error("Asset code must be 12 characters at max.");var n=e.assetCode.padEnd(12,"\0");t.asset=o.default.AssetCode.assetTypeCreditAlphanum12(n)}"boolean"==typeof e.authorize?e.authorize?t.authorize=o.default.TrustLineFlags.authorizedFlag().value:t.authorize=0:t.authorize=e.authorize;var s=new o.default.AllowTrustOp(t),u={};return u.body=o.default.OperationBody.allowTrust(s),this.setSourceAccount(u,e),new o.default.Operation(u)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6437),a=r(8385)},6318:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.beginSponsoringFutureReserves=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!i.StrKey.isValidEd25519PublicKey(e.sponsoredId))throw new Error("sponsoredId is invalid");var t=new o.default.BeginSponsoringFutureReservesOp({sponsoredId:a.Keypair.fromPublicKey(e.sponsoredId).xdrAccountId()}),r={};return r.body=o.default.OperationBody.beginSponsoringFutureReserves(t),this.setSourceAccount(r,e),new o.default.Operation(r)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(8385),a=r(6437)},3593:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bumpSequence=function(e){var t={};if("string"!=typeof e.bumpTo)throw new Error("bumpTo must be a string");try{new o.default(e.bumpTo)}catch(e){throw new Error("bumpTo must be a stringified number")}t.bumpTo=n.Hyper.fromString(e.bumpTo);var r=new i.default.BumpSequenceOp(t),a={};return a.body=i.default.OperationBody.bumpSequence(r),this.setSourceAccount(a,e),new i.default.Operation(a)};var n=r(6263),o=a(r(4431)),i=a(r(4081));function a(e){return e&&e.__esModule?e:{default:e}}},3960:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.changeTrust=function(e){var t={};if(e.asset instanceof a.Asset)t.line=e.asset.toChangeTrustXDRObject();else{if(!(e.asset instanceof s.LiquidityPoolAsset))throw new TypeError("asset must be Asset or LiquidityPoolAsset");t.line=e.asset.toXDRObject()}if(void 0!==e.limit&&!this.isValidAmount(e.limit,!0))throw new TypeError(this.constructAmountRequirementsError("limit"));e.limit?t.limit=this._toXDRAmount(e.limit):t.limit=n.Hyper.fromString(new o.default(c).toString()),e.source&&(t.source=e.source.masterKeypair);var r=new i.default.ChangeTrustOp(t),u={};return u.body=i.default.OperationBody.changeTrust(r),this.setSourceAccount(u,e),new i.default.Operation(u)};var n=r(6263),o=u(r(4431)),i=u(r(4081)),a=r(3469),s=r(1486);function u(e){return e&&e.__esModule?e:{default:e}}var c="9223372036854775807"},57:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.claimClaimableBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(e.balanceId);var t={};t.balanceId=o.default.ClaimableBalanceId.fromXDR(e.balanceId,"hex");var r=new o.default.ClaimClaimableBalanceOp(t),n={};return n.body=o.default.OperationBody.claimClaimableBalance(r),this.setSourceAccount(n,e),new o.default.Operation(n)},t.validateClaimableBalanceId=i;var n,o=(n=r(4081))&&n.__esModule?n:{default:n};function i(e){if("string"!=typeof e||72!==e.length)throw new Error("must provide a valid claimable balance id")}},6015:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clawback=function(e){var t={};if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));t.amount=this._toXDRAmount(e.amount),t.asset=e.asset.toXDRObject();try{t.from=(0,i.decodeAddressToMuxedAccount)(e.from)}catch(e){throw new Error("from address is invalid")}var r={body:o.default.OperationBody.clawback(new o.default.ClawbackOp(t))};return this.setSourceAccount(r,e),new o.default.Operation(r)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6880)},4283:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clawbackClaimableBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.validateClaimableBalanceId)(e.balanceId);var t={balanceId:o.default.ClaimableBalanceId.fromXDR(e.balanceId,"hex")},r={body:o.default.OperationBody.clawbackClaimableBalance(new o.default.ClawbackClaimableBalanceOp(t))};return this.setSourceAccount(r,e),new o.default.Operation(r)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(57)},7861:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAccount=function(e){if(!a.StrKey.isValidEd25519PublicKey(e.destination))throw new Error("destination is invalid");if(!this.isValidAmount(e.startingBalance,!0))throw new TypeError(this.constructAmountRequirementsError("startingBalance"));var t={};t.destination=i.Keypair.fromPublicKey(e.destination).xdrAccountId(),t.startingBalance=this._toXDRAmount(e.startingBalance);var r=new o.default.CreateAccountOp(t),n={};return n.body=o.default.OperationBody.createAccount(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6437),a=r(8385)},9471:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createClaimableBalance=function(e){if(!(e.asset instanceof i.Asset))throw new Error("must provide an asset for create claimable balance operation");if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(!Array.isArray(e.claimants)||0===e.claimants.length)throw new Error("must provide at least one claimant");var t={};t.asset=e.asset.toXDRObject(),t.amount=this._toXDRAmount(e.amount),t.claimants=Object.values(e.claimants).map((function(e){return e.toXDRObject()}));var r=new o.default.CreateClaimableBalanceOp(t),n={};return n.body=o.default.OperationBody.createClaimableBalance(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(3469)},3427:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPassiveSellOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price);var r=new o.default.CreatePassiveSellOfferOp(t),n={};return n.body=o.default.OperationBody.createPassiveSellOffer(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n}},729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.endSponsoringFutureReserves=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return t.body=o.default.OperationBody.endSponsoringFutureReserves(),this.setSourceAccount(t,e),new o.default.Operation(t)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n}},4774:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendFootprintTtl=function(e){var t;if((null!==(t=e.extendTo)&&void 0!==t?t:-1)<=0)throw new RangeError("extendTo isn't a ledger quantity (uint32)");var r=new o.default.ExtendFootprintTtlOp({ext:new o.default.ExtensionPoint(0),extendTo:e.extendTo}),n={body:o.default.OperationBody.extendFootprintTtl(r)};return this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n}},1138:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"accountMerge",{enumerable:!0,get:function(){return i.accountMerge}}),Object.defineProperty(t,"allowTrust",{enumerable:!0,get:function(){return a.allowTrust}}),Object.defineProperty(t,"beginSponsoringFutureReserves",{enumerable:!0,get:function(){return w.beginSponsoringFutureReserves}}),Object.defineProperty(t,"bumpSequence",{enumerable:!0,get:function(){return s.bumpSequence}}),Object.defineProperty(t,"changeTrust",{enumerable:!0,get:function(){return u.changeTrust}}),Object.defineProperty(t,"claimClaimableBalance",{enumerable:!0,get:function(){return f.claimClaimableBalance}}),Object.defineProperty(t,"clawback",{enumerable:!0,get:function(){return k.clawback}}),Object.defineProperty(t,"clawbackClaimableBalance",{enumerable:!0,get:function(){return d.clawbackClaimableBalance}}),Object.defineProperty(t,"createAccount",{enumerable:!0,get:function(){return c.createAccount}}),Object.defineProperty(t,"createClaimableBalance",{enumerable:!0,get:function(){return l.createClaimableBalance}}),Object.defineProperty(t,"createCustomContract",{enumerable:!0,get:function(){return T.createCustomContract}}),Object.defineProperty(t,"createPassiveSellOffer",{enumerable:!0,get:function(){return o.createPassiveSellOffer}}),Object.defineProperty(t,"createStellarAssetContract",{enumerable:!0,get:function(){return T.createStellarAssetContract}}),Object.defineProperty(t,"endSponsoringFutureReserves",{enumerable:!0,get:function(){return A.endSponsoringFutureReserves}}),Object.defineProperty(t,"extendFootprintTtl",{enumerable:!0,get:function(){return P.extendFootprintTtl}}),Object.defineProperty(t,"inflation",{enumerable:!0,get:function(){return h.inflation}}),Object.defineProperty(t,"invokeContractFunction",{enumerable:!0,get:function(){return T.invokeContractFunction}}),Object.defineProperty(t,"invokeHostFunction",{enumerable:!0,get:function(){return T.invokeHostFunction}}),Object.defineProperty(t,"liquidityPoolDeposit",{enumerable:!0,get:function(){return E.liquidityPoolDeposit}}),Object.defineProperty(t,"liquidityPoolWithdraw",{enumerable:!0,get:function(){return x.liquidityPoolWithdraw}}),Object.defineProperty(t,"manageBuyOffer",{enumerable:!0,get:function(){return y.manageBuyOffer}}),Object.defineProperty(t,"manageData",{enumerable:!0,get:function(){return p.manageData}}),Object.defineProperty(t,"manageSellOffer",{enumerable:!0,get:function(){return n.manageSellOffer}}),Object.defineProperty(t,"pathPaymentStrictReceive",{enumerable:!0,get:function(){return m.pathPaymentStrictReceive}}),Object.defineProperty(t,"pathPaymentStrictSend",{enumerable:!0,get:function(){return g.pathPaymentStrictSend}}),Object.defineProperty(t,"payment",{enumerable:!0,get:function(){return v.payment}}),Object.defineProperty(t,"restoreFootprint",{enumerable:!0,get:function(){return O.restoreFootprint}}),Object.defineProperty(t,"revokeAccountSponsorship",{enumerable:!0,get:function(){return S.revokeAccountSponsorship}}),Object.defineProperty(t,"revokeClaimableBalanceSponsorship",{enumerable:!0,get:function(){return S.revokeClaimableBalanceSponsorship}}),Object.defineProperty(t,"revokeDataSponsorship",{enumerable:!0,get:function(){return S.revokeDataSponsorship}}),Object.defineProperty(t,"revokeLiquidityPoolSponsorship",{enumerable:!0,get:function(){return S.revokeLiquidityPoolSponsorship}}),Object.defineProperty(t,"revokeOfferSponsorship",{enumerable:!0,get:function(){return S.revokeOfferSponsorship}}),Object.defineProperty(t,"revokeSignerSponsorship",{enumerable:!0,get:function(){return S.revokeSignerSponsorship}}),Object.defineProperty(t,"revokeTrustlineSponsorship",{enumerable:!0,get:function(){return S.revokeTrustlineSponsorship}}),Object.defineProperty(t,"setOptions",{enumerable:!0,get:function(){return b.setOptions}}),Object.defineProperty(t,"setTrustLineFlags",{enumerable:!0,get:function(){return _.setTrustLineFlags}}),Object.defineProperty(t,"uploadContractWasm",{enumerable:!0,get:function(){return T.uploadContractWasm}});var n=r(9606),o=r(3427),i=r(7703),a=r(6583),s=r(3593),u=r(3960),c=r(7861),l=r(9471),f=r(57),d=r(4283),h=r(6804),p=r(3941),y=r(6e3),m=r(4),g=r(8778),v=r(7937),b=r(6106),w=r(6318),A=r(729),S=r(6416),k=r(6015),_=r(1214),E=r(2205),x=r(9401),T=r(9456),P=r(4774),O=r(2671)},6804:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inflation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return t.body=o.default.OperationBody.inflation(),this.setSourceAccount(t,e),new o.default.Operation(t)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n}},9456:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.createCustomContract=function(e){var t=n.from(e.salt||a.Keypair.random().xdrPublicKey().value());if(!e.wasmHash||32!==e.wasmHash.length)throw new TypeError("expected hash(contract WASM) in 'opts.wasmHash', got ".concat(e.wasmHash));if(32!==t.length)throw new TypeError("expected 32-byte salt in 'opts.salt', got ".concat(e.wasmHash));return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.default.HostFunction.hostFunctionTypeCreateContract(new i.default.CreateContractArgs({executable:i.default.ContractExecutable.contractExecutableWasm(n.from(e.wasmHash)),contractIdPreimage:i.default.ContractIdPreimage.contractIdPreimageFromAddress(new i.default.ContractIdPreimageFromAddress({address:e.address.toScAddress(),salt:t}))}))})},t.createStellarAssetContract=function(e){var t,r=e.asset;if("string"==typeof r){var n=function(e){if(Array.isArray(e))return e}(t=r.split(":"))||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{for(i=(r=r.call(e)).next;!(u=(n=i.call(r)).done)&&(s.push(n.value),2!==s.length);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t)||function(e,t){if(e){if("string"==typeof e)return c(e,2);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)?c(e,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=n[0],a=n[1];r=new u.Asset(o,a)}if(!(r instanceof u.Asset))throw new TypeError("expected Asset in 'opts.asset', got ".concat(r));return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.default.HostFunction.hostFunctionTypeCreateContract(new i.default.CreateContractArgs({executable:i.default.ContractExecutable.contractExecutableStellarAsset(),contractIdPreimage:i.default.ContractIdPreimage.contractIdPreimageFromAsset(r.toXDRObject())}))})},t.invokeContractFunction=function(e){var t=new s.Address(e.contract);if("contract"!==t._type)throw new TypeError("expected contract strkey instance, got ".concat(t));return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.default.HostFunction.hostFunctionTypeInvokeContract(new i.default.InvokeContractArgs({contractAddress:t.toScAddress(),functionName:e.function,args:e.args}))})},t.invokeHostFunction=function(e){if(!e.func)throw new TypeError("host function invocation ('func') required (got ".concat(JSON.stringify(e),")"));var t=new i.default.InvokeHostFunctionOp({hostFunction:e.func,auth:e.auth||[]}),r={body:i.default.OperationBody.invokeHostFunction(t)};return this.setSourceAccount(r,e),new i.default.Operation(r)},t.uploadContractWasm=function(e){return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.default.HostFunction.hostFunctionTypeUploadContractWasm(n.from(e.wasm))})};var o,i=(o=r(4081))&&o.__esModule?o:{default:o},a=r(6437),s=r(3471),u=r(3469);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.liquidityPoolDeposit=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.liquidityPoolId,r=e.maxAmountA,n=e.maxAmountB,i=e.minPrice,a=e.maxPrice,s={};if(!t)throw new TypeError("liquidityPoolId argument is required");if(s.liquidityPoolId=o.default.PoolId.fromXDR(t,"hex"),!this.isValidAmount(r,!0))throw new TypeError(this.constructAmountRequirementsError("maxAmountA"));if(s.maxAmountA=this._toXDRAmount(r),!this.isValidAmount(n,!0))throw new TypeError(this.constructAmountRequirementsError("maxAmountB"));if(s.maxAmountB=this._toXDRAmount(n),void 0===i)throw new TypeError("minPrice argument is required");if(s.minPrice=this._toXDRPrice(i),void 0===a)throw new TypeError("maxPrice argument is required");s.maxPrice=this._toXDRPrice(a);var u=new o.default.LiquidityPoolDepositOp(s),c={body:o.default.OperationBody.liquidityPoolDeposit(u)};return this.setSourceAccount(c,e),new o.default.Operation(c)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n}},9401:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.liquidityPoolWithdraw=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};if(!e.liquidityPoolId)throw new TypeError("liquidityPoolId argument is required");if(t.liquidityPoolId=o.default.PoolId.fromXDR(e.liquidityPoolId,"hex"),!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),!this.isValidAmount(e.minAmountA,!0))throw new TypeError(this.constructAmountRequirementsError("minAmountA"));if(t.minAmountA=this._toXDRAmount(e.minAmountA),!this.isValidAmount(e.minAmountB,!0))throw new TypeError(this.constructAmountRequirementsError("minAmountB"));t.minAmountB=this._toXDRAmount(e.minAmountB);var r=new o.default.LiquidityPoolWithdrawOp(t),n={body:o.default.OperationBody.liquidityPoolWithdraw(r)};return this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n}},6e3:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.manageBuyOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.buyAmount,!0))throw new TypeError(this.constructAmountRequirementsError("buyAmount"));if(t.buyAmount=this._toXDRAmount(e.buyAmount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price),void 0!==e.offerId?e.offerId=e.offerId.toString():e.offerId="0",t.offerId=o.Hyper.fromString(e.offerId);var r=new i.default.ManageBuyOfferOp(t),n={};return n.body=i.default.OperationBody.manageBuyOffer(r),this.setSourceAccount(n,e),new i.default.Operation(n)};var n,o=r(6263),i=(n=r(4081))&&n.__esModule?n:{default:n}},3941:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.manageData=function(e){var t={};if(!("string"==typeof e.name&&e.name.length<=64))throw new Error("name must be a string, up to 64 characters");if(t.dataName=e.name,"string"!=typeof e.value&&!n.isBuffer(e.value)&&null!==e.value)throw new Error("value must be a string, Buffer or null");if("string"==typeof e.value?t.dataValue=n.from(e.value):t.dataValue=e.value,null!==t.dataValue&&t.dataValue.length>64)throw new Error("value cannot be longer that 64 bytes");var r=new i.default.ManageDataOp(t),o={};return o.body=i.default.OperationBody.manageData(r),this.setSourceAccount(o,e),new i.default.Operation(o)};var o,i=(o=r(4081))&&o.__esModule?o:{default:o}},9606:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.manageSellOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.amount,!0))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price),void 0!==e.offerId?e.offerId=e.offerId.toString():e.offerId="0",t.offerId=o.Hyper.fromString(e.offerId);var r=new i.default.ManageSellOfferOp(t),n={};return n.body=i.default.OperationBody.manageSellOffer(r),this.setSourceAccount(n,e),new i.default.Operation(n)};var n,o=r(6263),i=(n=r(4081))&&n.__esModule?n:{default:n}},4:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pathPaymentStrictReceive=function(e){switch(!0){case!e.sendAsset:throw new Error("Must specify a send asset");case!this.isValidAmount(e.sendMax):throw new TypeError(this.constructAmountRequirementsError("sendMax"));case!e.destAsset:throw new Error("Must provide a destAsset for a payment operation");case!this.isValidAmount(e.destAmount):throw new TypeError(this.constructAmountRequirementsError("destAmount"))}var t={};t.sendAsset=e.sendAsset.toXDRObject(),t.sendMax=this._toXDRAmount(e.sendMax);try{t.destination=(0,i.decodeAddressToMuxedAccount)(e.destination)}catch(e){throw new Error("destination is invalid")}t.destAsset=e.destAsset.toXDRObject(),t.destAmount=this._toXDRAmount(e.destAmount);var r=e.path?e.path:[];t.path=r.map((function(e){return e.toXDRObject()}));var n=new o.default.PathPaymentStrictReceiveOp(t),a={};return a.body=o.default.OperationBody.pathPaymentStrictReceive(n),this.setSourceAccount(a,e),new o.default.Operation(a)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6880)},8778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pathPaymentStrictSend=function(e){switch(!0){case!e.sendAsset:throw new Error("Must specify a send asset");case!this.isValidAmount(e.sendAmount):throw new TypeError(this.constructAmountRequirementsError("sendAmount"));case!e.destAsset:throw new Error("Must provide a destAsset for a payment operation");case!this.isValidAmount(e.destMin):throw new TypeError(this.constructAmountRequirementsError("destMin"))}var t={};t.sendAsset=e.sendAsset.toXDRObject(),t.sendAmount=this._toXDRAmount(e.sendAmount);try{t.destination=(0,i.decodeAddressToMuxedAccount)(e.destination)}catch(e){throw new Error("destination is invalid")}t.destAsset=e.destAsset.toXDRObject(),t.destMin=this._toXDRAmount(e.destMin);var r=e.path?e.path:[];t.path=r.map((function(e){return e.toXDRObject()}));var n=new o.default.PathPaymentStrictSendOp(t),a={};return a.body=o.default.OperationBody.pathPaymentStrictSend(n),this.setSourceAccount(a,e),new o.default.Operation(a)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6880)},7937:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.payment=function(e){if(!e.asset)throw new Error("Must provide an asset for a payment operation");if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));var t={};try{t.destination=(0,i.decodeAddressToMuxedAccount)(e.destination)}catch(e){throw new Error("destination is invalid")}t.asset=e.asset.toXDRObject(),t.amount=this._toXDRAmount(e.amount);var r=new o.default.PaymentOp(t),n={};return n.body=o.default.OperationBody.payment(r),this.setSourceAccount(n,e),new o.default.Operation(n)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6880)},2671:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.restoreFootprint=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new o.default.RestoreFootprintOp({ext:new o.default.ExtensionPoint(0)}),r={body:o.default.OperationBody.restoreFootprint(t)};return this.setSourceAccount(r,null!=e?e:{}),new o.default.Operation(r)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n}},6416:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.revokeAccountSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!a.StrKey.isValidEd25519PublicKey(e.account))throw new Error("account is invalid");var t=i.default.LedgerKey.account(new i.default.LedgerKeyAccount({accountId:s.Keypair.fromPublicKey(e.account).xdrAccountId()})),r=i.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=i.default.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new i.default.Operation(n)},t.revokeClaimableBalanceSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"!=typeof e.balanceId)throw new Error("balanceId is invalid");var t=i.default.LedgerKey.claimableBalance(new i.default.LedgerKeyClaimableBalance({balanceId:i.default.ClaimableBalanceId.fromXDR(e.balanceId,"hex")})),r=i.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=i.default.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new i.default.Operation(n)},t.revokeDataSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!a.StrKey.isValidEd25519PublicKey(e.account))throw new Error("account is invalid");if("string"!=typeof e.name||e.name.length>64)throw new Error("name must be a string, up to 64 characters");var t=i.default.LedgerKey.data(new i.default.LedgerKeyData({accountId:s.Keypair.fromPublicKey(e.account).xdrAccountId(),dataName:e.name})),r=i.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=i.default.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new i.default.Operation(n)},t.revokeLiquidityPoolSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"!=typeof e.liquidityPoolId)throw new Error("liquidityPoolId is invalid");var t=i.default.LedgerKey.liquidityPool(new i.default.LedgerKeyLiquidityPool({liquidityPoolId:i.default.PoolId.fromXDR(e.liquidityPoolId,"hex")})),r=i.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={body:i.default.OperationBody.revokeSponsorship(r)};return this.setSourceAccount(n,e),new i.default.Operation(n)},t.revokeOfferSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!a.StrKey.isValidEd25519PublicKey(e.seller))throw new Error("seller is invalid");if("string"!=typeof e.offerId)throw new Error("offerId is invalid");var t=i.default.LedgerKey.offer(new i.default.LedgerKeyOffer({sellerId:s.Keypair.fromPublicKey(e.seller).xdrAccountId(),offerId:i.default.Int64.fromString(e.offerId)})),r=i.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=i.default.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new i.default.Operation(n)},t.revokeSignerSponsorship=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!a.StrKey.isValidEd25519PublicKey(t.account))throw new Error("account is invalid");if(t.signer.ed25519PublicKey){if(!a.StrKey.isValidEd25519PublicKey(t.signer.ed25519PublicKey))throw new Error("signer.ed25519PublicKey is invalid.");var r=a.StrKey.decodeEd25519PublicKey(t.signer.ed25519PublicKey);e=new i.default.SignerKey.signerKeyTypeEd25519(r)}else if(t.signer.preAuthTx){var o;if(o="string"==typeof t.signer.preAuthTx?n.from(t.signer.preAuthTx,"hex"):t.signer.preAuthTx,!n.isBuffer(o)||32!==o.length)throw new Error("signer.preAuthTx must be 32 bytes Buffer.");e=new i.default.SignerKey.signerKeyTypePreAuthTx(o)}else{if(!t.signer.sha256Hash)throw new Error("signer is invalid");var u;if(u="string"==typeof t.signer.sha256Hash?n.from(t.signer.sha256Hash,"hex"):t.signer.sha256Hash,!n.isBuffer(u)||32!==u.length)throw new Error("signer.sha256Hash must be 32 bytes Buffer.");e=new i.default.SignerKey.signerKeyTypeHashX(u)}var c=new i.default.RevokeSponsorshipOpSigner({accountId:s.Keypair.fromPublicKey(t.account).xdrAccountId(),signerKey:e}),l=i.default.RevokeSponsorshipOp.revokeSponsorshipSigner(c),f={};return f.body=i.default.OperationBody.revokeSponsorship(l),this.setSourceAccount(f,t),new i.default.Operation(f)},t.revokeTrustlineSponsorship=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!a.StrKey.isValidEd25519PublicKey(t.account))throw new Error("account is invalid");if(t.asset instanceof u.Asset)e=t.asset.toTrustLineXDRObject();else{if(!(t.asset instanceof c.LiquidityPoolId))throw new TypeError("asset must be an Asset or LiquidityPoolId");e=t.asset.toXDRObject()}var r=i.default.LedgerKey.trustline(new i.default.LedgerKeyTrustLine({accountId:s.Keypair.fromPublicKey(t.account).xdrAccountId(),asset:e})),n=i.default.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(r),o={};return o.body=i.default.OperationBody.revokeSponsorship(n),this.setSourceAccount(o,t),new i.default.Operation(o)};var o,i=(o=r(4081))&&o.__esModule?o:{default:o},a=r(8385),s=r(6437),u=r(3469),c=r(7287)},6106:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.setOptions=function(e){var t={};if(e.inflationDest){if(!s.StrKey.isValidEd25519PublicKey(e.inflationDest))throw new Error("inflationDest is invalid");t.inflationDest=a.Keypair.fromPublicKey(e.inflationDest).xdrAccountId()}if(t.clearFlags=this._checkUnsignedIntValue("clearFlags",e.clearFlags),t.setFlags=this._checkUnsignedIntValue("setFlags",e.setFlags),t.masterWeight=this._checkUnsignedIntValue("masterWeight",e.masterWeight,u),t.lowThreshold=this._checkUnsignedIntValue("lowThreshold",e.lowThreshold,u),t.medThreshold=this._checkUnsignedIntValue("medThreshold",e.medThreshold,u),t.highThreshold=this._checkUnsignedIntValue("highThreshold",e.highThreshold,u),void 0!==e.homeDomain&&"string"!=typeof e.homeDomain)throw new TypeError("homeDomain argument must be of type String");if(t.homeDomain=e.homeDomain,e.signer){var r,o=this._checkUnsignedIntValue("signer.weight",e.signer.weight,u),c=0;if(e.signer.ed25519PublicKey){if(!s.StrKey.isValidEd25519PublicKey(e.signer.ed25519PublicKey))throw new Error("signer.ed25519PublicKey is invalid.");var l=s.StrKey.decodeEd25519PublicKey(e.signer.ed25519PublicKey);r=new i.default.SignerKey.signerKeyTypeEd25519(l),c+=1}if(e.signer.preAuthTx){if("string"==typeof e.signer.preAuthTx&&(e.signer.preAuthTx=n.from(e.signer.preAuthTx,"hex")),!n.isBuffer(e.signer.preAuthTx)||32!==e.signer.preAuthTx.length)throw new Error("signer.preAuthTx must be 32 bytes Buffer.");r=new i.default.SignerKey.signerKeyTypePreAuthTx(e.signer.preAuthTx),c+=1}if(e.signer.sha256Hash){if("string"==typeof e.signer.sha256Hash&&(e.signer.sha256Hash=n.from(e.signer.sha256Hash,"hex")),!n.isBuffer(e.signer.sha256Hash)||32!==e.signer.sha256Hash.length)throw new Error("signer.sha256Hash must be 32 bytes Buffer.");r=new i.default.SignerKey.signerKeyTypeHashX(e.signer.sha256Hash),c+=1}if(e.signer.ed25519SignedPayload){if(!s.StrKey.isValidSignedPayload(e.signer.ed25519SignedPayload))throw new Error("signer.ed25519SignedPayload is invalid.");var f=s.StrKey.decodeSignedPayload(e.signer.ed25519SignedPayload),d=i.default.SignerKeyEd25519SignedPayload.fromXDR(f);r=i.default.SignerKey.signerKeyTypeEd25519SignedPayload(d),c+=1}if(1!==c)throw new Error("Signer object must contain exactly one of signer.ed25519PublicKey, signer.sha256Hash, signer.preAuthTx.");t.signer=new i.default.Signer({key:r,weight:o})}var h=new i.default.SetOptionsOp(t),p={};return p.body=i.default.OperationBody.setOptions(h),this.setSourceAccount(p,e),new i.default.Operation(p)};var o,i=(o=r(4081))&&o.__esModule?o:{default:o},a=r(6437),s=r(8385);function u(e,t){if(e>=0&&e<=255)return!0;throw new Error("".concat(t," value must be between 0 and 255"))}},1214:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setTrustLineFlags=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};if("object"!==a(e.flags)||0===Object.keys(e.flags).length)throw new Error("opts.flags must be a map of boolean flags to modify");var r={authorized:o.default.TrustLineFlags.authorizedFlag(),authorizedToMaintainLiabilities:o.default.TrustLineFlags.authorizedToMaintainLiabilitiesFlag(),clawbackEnabled:o.default.TrustLineFlags.trustlineClawbackEnabledFlag()},n=0,s=0;Object.keys(e.flags).forEach((function(t){if(!Object.prototype.hasOwnProperty.call(r,t))throw new Error("unsupported flag name specified: ".concat(t));var o=e.flags[t],i=r[t].value;!0===o?s|=i:!1===o&&(n|=i)})),t.trustor=i.Keypair.fromPublicKey(e.trustor).xdrAccountId(),t.asset=e.asset.toXDRObject(),t.clearFlags=n,t.setFlags=s;var u={body:o.default.OperationBody.setTrustLineFlags(new o.default.SetTrustLineFlagsOp(t))};return this.setSourceAccount(u,e),new o.default.Operation(u)};var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(6437);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)}},5567:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.nativeToScVal=function e(t){var r,o,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(f(t)){case"object":if(null===t)return i.default.ScVal.scvVoid();if(t instanceof i.default.ScVal)return t;if(t instanceof a.Address)return t.toScVal();if(t instanceof s.Contract)return t.address().toScVal();if(t instanceof Uint8Array||n.isBuffer(t)){var d,h=Uint8Array.from(t);switch(null!==(d=null==l?void 0:l.type)&&void 0!==d?d:"bytes"){case"bytes":return i.default.ScVal.scvBytes(h);case"symbol":return i.default.ScVal.scvSymbol(h);case"string":return i.default.ScVal.scvString(h);default:throw new TypeError("invalid type (".concat(l.type,") specified for bytes-like value"))}}if(Array.isArray(t)){if(t.length>0&&t.some((function(e){return f(e)!==f(t[0])})))throw new TypeError("array values (".concat(t,") must have the same type (types: ").concat(t.map((function(e){return f(e)})).join(","),")"));return i.default.ScVal.scvVec(t.map((function(t){return e(t,l)})))}var p;if("Object"!==(null!==(r=null===(o=t.constructor)||void 0===o?void 0:o.name)&&void 0!==r?r:""))throw new TypeError("cannot interpret ".concat(null===(p=t.constructor)||void 0===p?void 0:p.name," value as ScVal (").concat(JSON.stringify(t),")"));return i.default.ScVal.scvMap(Object.entries(t).map((function(t){var r,n,o=c(t,2),a=o[0],s=o[1],u=c(null!==(r=(null!==(n=null==l?void 0:l.type)&&void 0!==n?n:{})[a])&&void 0!==r?r:[null,null],2),f=u[0],d=u[1],h=f?{type:f}:{},p=d?{type:d}:{};return new i.default.ScMapEntry({key:e(a,h),val:e(s,p)})})));case"number":case"bigint":switch(null==l?void 0:l.type){case"u32":return i.default.ScVal.scvU32(t);case"i32":return i.default.ScVal.scvI32(t)}return new u.ScInt(t,{type:null==l?void 0:l.type}).toScVal();case"string":var y,m=null!==(y=null==l?void 0:l.type)&&void 0!==y?y:"string";switch(m){case"string":return i.default.ScVal.scvString(t);case"symbol":return i.default.ScVal.scvSymbol(t);case"address":return new a.Address(t).toScVal();default:if(u.XdrLargeInt.isType(m))return new u.XdrLargeInt(m,t).toScVal();throw new TypeError("invalid type (".concat(l.type,") specified for string value"))}case"boolean":return i.default.ScVal.scvBool(t);case"undefined":return i.default.ScVal.scvVoid();case"function":return e(t());default:throw new TypeError("failed to convert typeof ".concat(f(t)," (").concat(t,")"))}},t.scValToNative=function e(t){var r,o;switch(t.switch().value){case i.default.ScValType.scvVoid().value:return null;case i.default.ScValType.scvU64().value:case i.default.ScValType.scvI64().value:return t.value().toBigInt();case i.default.ScValType.scvU128().value:case i.default.ScValType.scvI128().value:case i.default.ScValType.scvU256().value:case i.default.ScValType.scvI256().value:return(0,u.scValToBigInt)(t);case i.default.ScValType.scvVec().value:return(null!==(r=t.vec())&&void 0!==r?r:[]).map(e);case i.default.ScValType.scvAddress().value:return a.Address.fromScVal(t).toString();case i.default.ScValType.scvMap().value:return Object.fromEntries((null!==(o=t.map())&&void 0!==o?o:[]).map((function(t){return[e(t.key()),e(t.val())]})));case i.default.ScValType.scvBool().value:case i.default.ScValType.scvU32().value:case i.default.ScValType.scvI32().value:case i.default.ScValType.scvBytes().value:return t.value();case i.default.ScValType.scvSymbol().value:case i.default.ScValType.scvString().value:var s=t.value();if(n.isBuffer(s)||ArrayBuffer.isView(s))try{return(new TextDecoder).decode(s)}catch(e){return new Uint8Array(s.buffer)}return s;case i.default.ScValType.scvTimepoint().value:case i.default.ScValType.scvDuration().value:return new i.default.Uint64(t.value()).toBigInt();case i.default.ScValType.scvStatus().value:switch(t.value().switch()){case i.default.ScStatusType.sstOk().value:case i.default.ScStatusType.sstUnknownError().value:case i.default.ScStatusType.sstHostValueError().value:case i.default.ScStatusType.sstHostObjectError().value:case i.default.ScStatusType.sstHostFunctionError().value:case i.default.ScStatusType.sstHostStorageError().value:case i.default.ScStatusType.sstHostContextError().value:case i.default.ScStatusType.sstVmError().value:case i.default.ScStatusType.sstContractError().value:case i.default.ScStatusType.sstHostAuthError().value:}default:return t.value()}};var o,i=(o=r(4081))&&o.__esModule?o:{default:o},a=r(3471),s=r(5618),u=r(3180);function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);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)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignerKey=void 0;var n,o=(n=r(4081))&&n.__esModule?n:{default:n},i=r(8385);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 s(e,t){for(var r=0;r{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.FastSigning=void 0,t.generate=function(e){return o.generate(e)},t.sign=function(e,t){return o.sign(e,t)},t.verify=function(e,t,r){return o.verify(e,t,r)};var o={};function i(){var e=r(7586);return o.generate=function(t){var r=new Uint8Array(t),o=e.sign.keyPair.fromSeed(r);return n.from(o.publicKey)},o.sign=function(t,r){t=n.from(t),t=new Uint8Array(t.toJSON().data),r=new Uint8Array(r.toJSON().data);var o=e.sign.detached(t,r);return n.from(o)},o.verify=function(t,r,o){return t=n.from(t),t=new Uint8Array(t.toJSON().data),r=new Uint8Array(r.toJSON().data),o=new Uint8Array(o.toJSON().data),e.sign.detached.verify(t,r,o)},!1}t.FastSigning="undefined"==typeof window?function(){var e;try{e=r(Object(function(){var e=new Error("Cannot find module 'sodium-native'");throw e.code="MODULE_NOT_FOUND",e}()))}catch(e){return i()}return Object.keys(e).length?(o.generate=function(t){var r=n.alloc(e.crypto_sign_PUBLICKEYBYTES),o=n.alloc(e.crypto_sign_SECRETKEYBYTES);return e.crypto_sign_seed_keypair(r,o,t),r},o.sign=function(t,r){t=n.from(t);var o=n.alloc(e.crypto_sign_BYTES);return e.crypto_sign_detached(o,t,r),o},o.verify=function(t,r,o){t=n.from(t);try{return e.crypto_sign_verify_detached(r,t,o)}catch(e){return!1}},!0):i()}():i()},251:(e,t)=>{"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)}function n(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);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)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(r=t>r.length?["0",r.toString().padStart(t,"0")].join("."):[r.slice(0,-t),r.slice(-t)].join(".")),r.replace(/(\.\d*?)0+$/,"$1")}},{key:"parseTokenAmount",value:function(e,t){var r,o=n(e.split(".").slice()),i=o[0],a=o[1];if(o.slice(2).length)throw new Error("Invalid decimal value: ".concat(e));return BigInt(i+(null!==(r=null==a?void 0:a.padEnd(t,"0"))&&void 0!==r?r:"0".repeat(t))).toString()}}],r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},5096:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SorobanDataBuilder=void 0;var n,o=(n=r(4081))&&n.__esModule?n:{default:n};function i(e){return i="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},i(e)}function a(e,t){for(var r=0;r{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.StrKey=void 0,t.decodeCheck=d,t.encodeCheck=h;var o,i=(o=r(6906))&&o.__esModule?o:{default:o},a=r(9449);function s(e){return s="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},s(e)}function u(e,t){for(var r=0;r165)return!1;break;default:return!1}var r="";try{r=d(e,t)}catch(e){return!1}switch(e){case"ed25519PublicKey":case"ed25519SecretSeed":case"preAuthTx":case"sha256Hash":case"contract":return 32===r.length;case"med25519PublicKey":return 40===r.length;case"signedPayload":return r.length>=40&&r.length<=100;default:return!1}}function d(e,t){if("string"!=typeof t)throw new TypeError("encoded argument must be of type String");var r=i.default.decode(t),o=r[0],s=r.slice(0,-2),u=s.slice(1),l=r.slice(-2);if(t!==i.default.encode(r))throw new Error("invalid encoded string");var f=c[e];if(void 0===f)throw new Error("".concat(e," is not a valid version byte name. ")+"Expected one of ".concat(Object.keys(c).join(", ")));if(o!==f)throw new Error("invalid version byte. expected ".concat(f,", got ").concat(o));var d=p(s);if(!(0,a.verifyChecksum)(d,l))throw new Error("invalid checksum");return n.from(u)}function h(e,t){if(null==t)throw new Error("cannot encode null data");var r=c[e];if(void 0===r)throw new Error("".concat(e," is not a valid version byte name. ")+"Expected one of ".concat(Object.keys(c).join(", ")));t=n.from(t);var o=n.from([r]),a=n.concat([o,t]),s=p(a),u=n.concat([a,s]);return i.default.encode(u)}function p(e){for(var t=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920],r=0,n=0;n>8^e[n]],r&=65535;var o=new Uint8Array(2);return o[0]=255&r,o[1]=r>>8&255,o}t.StrKey=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,r=[{key:"encodeEd25519PublicKey",value:function(e){return h("ed25519PublicKey",e)}},{key:"decodeEd25519PublicKey",value:function(e){return d("ed25519PublicKey",e)}},{key:"isValidEd25519PublicKey",value:function(e){return f("ed25519PublicKey",e)}},{key:"encodeEd25519SecretSeed",value:function(e){return h("ed25519SecretSeed",e)}},{key:"decodeEd25519SecretSeed",value:function(e){return d("ed25519SecretSeed",e)}},{key:"isValidEd25519SecretSeed",value:function(e){return f("ed25519SecretSeed",e)}},{key:"encodeMed25519PublicKey",value:function(e){return h("med25519PublicKey",e)}},{key:"decodeMed25519PublicKey",value:function(e){return d("med25519PublicKey",e)}},{key:"isValidMed25519PublicKey",value:function(e){return f("med25519PublicKey",e)}},{key:"encodePreAuthTx",value:function(e){return h("preAuthTx",e)}},{key:"decodePreAuthTx",value:function(e){return d("preAuthTx",e)}},{key:"encodeSha256Hash",value:function(e){return h("sha256Hash",e)}},{key:"decodeSha256Hash",value:function(e){return d("sha256Hash",e)}},{key:"encodeSignedPayload",value:function(e){return h("signedPayload",e)}},{key:"decodeSignedPayload",value:function(e){return d("signedPayload",e)}},{key:"isValidSignedPayload",value:function(e){return f("signedPayload",e)}},{key:"encodeContract",value:function(e){return h("contract",e)}},{key:"decodeContract",value:function(e){return d("contract",e)}},{key:"isValidContract",value:function(e){return f("contract",e)}},{key:"getVersionByteForPrefix",value:function(e){return l[e[0]]}}],r&&u(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},1388:(e,t,r)=>{"use strict";var n=r(8764).Buffer;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)}Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=void 0;var i,a=(i=r(4081))&&i.__esModule?i:{default:i},s=r(9622),u=r(8385),c=r(4585),l=r(4856),f=r(1065),d=r(6880);function h(e,t){for(var r=0;r=this.operations.length)throw new RangeError("invalid operation index");var t=this.operations[e];try{t=c.Operation.createClaimableBalance(t)}catch(e){throw new TypeError("expected createClaimableBalance, got ".concat(t.type,": ").concat(e))}var r=u.StrKey.decodeEd25519PublicKey((0,d.extractBaseAddress)(this.source)),n=a.default.HashIdPreimage.envelopeTypeOpId(new a.default.HashIdPreimageOperationId({sourceAccount:a.default.AccountId.publicKeyTypeEd25519(r),seqNum:a.default.SequenceNumber.fromString(this.sequence),opNum:e})),o=(0,s.hash)(n.toXDR("raw"));return a.default.ClaimableBalanceId.claimableBalanceIdTypeV0(o).toXDR("hex")}}])&&h(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(f.TransactionBase)},1065:(e,t,r)=>{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionBase=void 0;var o,i=(o=r(4081))&&o.__esModule?o:{default:o},a=r(9622),s=r(6437);function u(e){return u="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},u(e)}function c(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!o||"string"!=typeof o)throw new Error("Invalid signature");if(!r||"string"!=typeof r)throw new Error("Invalid publicKey");var a=n.from(o,"base64");try{t=(e=s.Keypair.fromPublicKey(r)).signatureHint()}catch(e){throw new Error("Invalid publicKey")}if(!e.verify(this.hash(),a))throw new Error("Invalid signature");this.signatures.push(new i.default.DecoratedSignature({hint:t,signature:a}))}},{key:"addDecoratedSignature",value:function(e){this.signatures.push(e)}},{key:"signHashX",value:function(e){if("string"==typeof e&&(e=n.from(e,"hex")),e.length>64)throw new Error("preimage cannnot be longer than 64 bytes");var t=e,r=(0,a.hash)(e),o=r.slice(r.length-4);this.signatures.push(new i.default.DecoratedSignature({hint:o,signature:t}))}},{key:"hash",value:function(){return(0,a.hash)(this.signatureBase())}},{key:"signatureBase",value:function(){throw new Error("Implement in subclass")}},{key:"toEnvelope",value:function(){throw new Error("Implement in subclass")}},{key:"toXDR",value:function(){return this.toEnvelope().toXDR().toString("base64")}}],r&&c(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},624:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionBuilder=t.TimeoutInfinite=t.BASE_FEE=void 0,t.isValidDate=E;var n=r(6263),o=y(r(4431)),i=y(r(4081)),a=r(3217),s=r(9022),u=r(6880),c=r(1388),l=r(1462),f=r(5096),d=r(8385),h=r(5822),p=r(4856);function y(e){return e&&e.__esModule?e:{default:e}}function m(e){return m="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},m(e)}function g(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return v(e,t);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)?v(e,t):void 0}}(e)||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.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new Error("must specify source account for the transaction");if(void 0===r.fee)throw new Error("must specify fee for the transaction (in stroops)");this.source=t,this.operations=[],this.baseFee=r.fee,this.timebounds=r.timebounds?w({},r.timebounds):null,this.ledgerbounds=r.ledgerbounds?w({},r.ledgerbounds):null,this.minAccountSequence=r.minAccountSequence||null,this.minAccountSequenceAge=r.minAccountSequenceAge||null,this.minAccountSequenceLedgerGap=r.minAccountSequenceLedgerGap||null,this.extraSigners=r.extraSigners?g(r.extraSigners):null,this.memo=r.memo||p.Memo.none(),this.networkPassphrase=r.networkPassphrase||null,this.sorobanData=r.sorobanData?new f.SorobanDataBuilder(r.sorobanData).build():null}var t,r,y;return t=e,y=[{key:"cloneFrom",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(t instanceof c.Transaction))throw new TypeError("expected a 'Transaction', got: ".concat(t));var n,o=(BigInt(t.sequence)-1n).toString();if(d.StrKey.isValidMed25519PublicKey(t.source))n=s.MuxedAccount.fromAddress(t.source,o);else{if(!d.StrKey.isValidEd25519PublicKey(t.source))throw new TypeError("unsupported tx source account: ".concat(t.source));n=new a.Account(t.source,o)}var i=new e(n,w({fee:(parseInt(t.fee,10)/t.operations.length||_).toString(),memo:t.memo,networkPassphrase:t.networkPassphrase,timebounds:t.timeBounds,ledgerbounds:t.ledgerBounds,minAccountSequence:t.minAccountSequence,minAccountSequenceAge:t.minAccountSequenceAge,minAccountSequenceLedgerGap:t.minAccountSequenceLedgerGap,extraSigners:t.extraSigners},r));return t._tx.operations().forEach((function(e){return i.addOperation(e)})),i}},{key:"buildFeeBumpTransaction",value:function(e,t,r,n){var a=r.operations.length,s=new o.default(r.fee).div(a),c=new o.default(t);if(c.lt(s))throw new Error("Invalid baseFee, it should be at least ".concat(s," stroops."));var f=new o.default(_);if(c.lt(f))throw new Error("Invalid baseFee, it should be at least ".concat(f," stroops."));var d,h=r.toEnvelope();if(h.switch()===i.default.EnvelopeType.envelopeTypeTxV0()){var p=h.v0().tx(),y=new i.default.Transaction({sourceAccount:new i.default.MuxedAccount.keyTypeEd25519(p.sourceAccountEd25519()),fee:p.fee(),seqNum:p.seqNum(),cond:i.default.Preconditions.precondTime(p.timeBounds()),memo:p.memo(),operations:p.operations(),ext:new i.default.TransactionExt(0)});h=new i.default.TransactionEnvelope.envelopeTypeTx(new i.default.TransactionV1Envelope({tx:y,signatures:h.v0().signatures()}))}d="string"==typeof e?(0,u.decodeAddressToMuxedAccount)(e):e.xdrMuxedAccount();var m=new i.default.FeeBumpTransaction({feeSource:d,fee:i.default.Int64.fromString(c.times(a+1).toString()),innerTx:i.default.FeeBumpTransactionInnerTx.envelopeTypeTx(h.v1()),ext:new i.default.FeeBumpTransactionExt(0)}),g=new i.default.FeeBumpTransactionEnvelope({tx:m,signatures:[]}),v=new i.default.TransactionEnvelope.envelopeTypeTxFeeBump(g);return new l.FeeBumpTransaction(v,n)}},{key:"fromXDR",value:function(e,t){return"string"==typeof e&&(e=i.default.TransactionEnvelope.fromXDR(e,"base64")),e.switch()===i.default.EnvelopeType.envelopeTypeTxFeeBump()?new l.FeeBumpTransaction(e,t):new c.Transaction(e,t)}}],(r=[{key:"addOperation",value:function(e){return this.operations.push(e),this}},{key:"clearOperations",value:function(){return this.operations=[],this}},{key:"addMemo",value:function(e){return this.memo=e,this}},{key:"setTimeout",value:function(e){if(null!==this.timebounds&&this.timebounds.maxTime>0)throw new Error("TimeBounds.max_time has been already set - setting timeout would overwrite it.");if(e<0)throw new Error("timeout cannot be negative");if(e>0){var t=Math.floor(Date.now()/1e3)+e;null===this.timebounds?this.timebounds={minTime:0,maxTime:t}:this.timebounds={minTime:this.timebounds.minTime,maxTime:t}}else this.timebounds={minTime:0,maxTime:0};return this}},{key:"setTimebounds",value:function(e,t){if("number"==typeof e&&(e=new Date(1e3*e)),"number"==typeof t&&(t=new Date(1e3*t)),null!==this.timebounds)throw new Error("TimeBounds has been already set - setting timebounds would overwrite it.");var r=Math.floor(e.valueOf()/1e3),n=Math.floor(t.valueOf()/1e3);if(r<0)throw new Error("min_time cannot be negative");if(n<0)throw new Error("max_time cannot be negative");if(n>0&&r>n)throw new Error("min_time cannot be greater than max_time");return this.timebounds={minTime:r,maxTime:n},this}},{key:"setLedgerbounds",value:function(e,t){if(null!==this.ledgerbounds)throw new Error("LedgerBounds has been already set - setting ledgerbounds would overwrite it.");if(e<0)throw new Error("min_ledger cannot be negative");if(t<0)throw new Error("max_ledger cannot be negative");if(t>0&&e>t)throw new Error("min_ledger cannot be greater than max_ledger");return this.ledgerbounds={minLedger:e,maxLedger:t},this}},{key:"setMinAccountSequence",value:function(e){if(null!==this.minAccountSequence)throw new Error("min_account_sequence has been already set - setting min_account_sequence would overwrite it.");return this.minAccountSequence=e,this}},{key:"setMinAccountSequenceAge",value:function(e){if("number"!=typeof e)throw new Error("min_account_sequence_age must be a number");if(null!==this.minAccountSequenceAge)throw new Error("min_account_sequence_age has been already set - setting min_account_sequence_age would overwrite it.");if(e<0)throw new Error("min_account_sequence_age cannot be negative");return this.minAccountSequenceAge=e,this}},{key:"setMinAccountSequenceLedgerGap",value:function(e){if(null!==this.minAccountSequenceLedgerGap)throw new Error("min_account_sequence_ledger_gap has been already set - setting min_account_sequence_ledger_gap would overwrite it.");if(e<0)throw new Error("min_account_sequence_ledger_gap cannot be negative");return this.minAccountSequenceLedgerGap=e,this}},{key:"setExtraSigners",value:function(e){if(!Array.isArray(e))throw new Error("extra_signers must be an array of strings.");if(null!==this.extraSigners)throw new Error("extra_signers has been already set - setting extra_signers would overwrite it.");if(e.length>2)throw new Error("extra_signers cannot be longer than 2 elements.");return this.extraSigners=g(e),this}},{key:"setNetworkPassphrase",value:function(e){return this.networkPassphrase=e,this}},{key:"setSorobanData",value:function(e){return this.sorobanData=new f.SorobanDataBuilder(e).build(),this}},{key:"build",value:function(){var e=new o.default(this.source.sequenceNumber()).plus(1),t={fee:new o.default(this.baseFee).times(this.operations.length).toNumber(),seqNum:i.default.SequenceNumber.fromString(e.toString()),memo:this.memo?this.memo.toXDRObject():null};if(null===this.timebounds||void 0===this.timebounds.minTime||void 0===this.timebounds.maxTime)throw new Error("TimeBounds has to be set or you must call setTimeout(TimeoutInfinite).");E(this.timebounds.minTime)&&(this.timebounds.minTime=this.timebounds.minTime.getTime()/1e3),E(this.timebounds.maxTime)&&(this.timebounds.maxTime=this.timebounds.maxTime.getTime()/1e3),this.timebounds.minTime=n.UnsignedHyper.fromString(this.timebounds.minTime.toString()),this.timebounds.maxTime=n.UnsignedHyper.fromString(this.timebounds.maxTime.toString());var r=new i.default.TimeBounds(this.timebounds);if(this.hasV2Preconditions()){var a=null;null!==this.ledgerbounds&&(a=new i.default.LedgerBounds(this.ledgerbounds));var s=this.minAccountSequence||"0";s=i.default.SequenceNumber.fromString(s);var l=n.UnsignedHyper.fromString(null!==this.minAccountSequenceAge?this.minAccountSequenceAge.toString():"0"),f=this.minAccountSequenceLedgerGap||0,d=null!==this.extraSigners?this.extraSigners.map(h.SignerKey.decodeAddress):[];t.cond=i.default.Preconditions.precondV2(new i.default.PreconditionsV2({timeBounds:r,ledgerBounds:a,minSeqNum:s,minSeqAge:l,minSeqLedgerGap:f,extraSigners:d}))}else t.cond=i.default.Preconditions.precondTime(r);t.sourceAccount=(0,u.decodeAddressToMuxedAccount)(this.source.accountId()),this.sorobanData?t.ext=new i.default.TransactionExt(1,this.sorobanData):t.ext=new i.default.TransactionExt(0,i.default.Void);var p=new i.default.Transaction(t);p.operations(this.operations);var y=new i.default.TransactionEnvelope.envelopeTypeTx(new i.default.TransactionV1Envelope({tx:p})),m=new c.Transaction(y,this.networkPassphrase);return this.source.incrementSequenceNumber(),m}},{key:"hasV2Preconditions",value:function(){return null!==this.ledgerbounds||null!==this.minAccountSequence||null!==this.minAccountSequenceAge||null!==this.minAccountSequenceLedgerGap||null!==this.extraSigners&&this.extraSigners.length>0}}])&&S(t.prototype,r),y&&S(t,y),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9449:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyChecksum=function(e,t){if(e.length!==t.length)return!1;if(0===e.length)return!0;for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.best_r=function(e){for(var t,r,n=new o.default(e),s=[[new o.default(0),new o.default(1)],[new o.default(1),new o.default(0)]],u=2;!n.gt(a);){t=n.integerValue(o.default.ROUND_FLOOR),r=n.minus(t);var c=t.times(s[u-1][0]).plus(s[u-2][0]),l=t.times(s[u-1][1]).plus(s[u-2][1]);if(c.gt(a)||l.gt(a))break;if(s.push([c,l]),r.eq(0))break;n=new o.default(1).div(r),u+=1}var f=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{for(i=(r=r.call(e)).next;!(u=(n=i.call(r)).done)&&(s.push(n.value),2!==s.length);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e)||function(e,t){if(e){if("string"==typeof e)return i(e,2);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)?i(e,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(s[s.length-1]),d=f[0],h=f[1];if(d.isZero()||h.isZero())throw new Error("Couldn't find approximation");return[d.toNumber(),h.toNumber()]};var n,o=(n=r(4431))&&n.__esModule?n:{default:n};function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";var n=r(8764).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.decodeAddressToMuxedAccount=s,t.encodeMuxedAccount=function(e,t){if(!a.StrKey.isValidEd25519PublicKey(e))throw new Error("address should be a Stellar account ID (G...)");if("string"!=typeof t)throw new Error("id should be a string representing a number (uint64)");return i.default.MuxedAccount.keyTypeMuxedEd25519(new i.default.MuxedAccountMed25519({id:i.default.Uint64.fromString(t),ed25519:a.StrKey.decodeEd25519PublicKey(e)}))},t.encodeMuxedAccountToAddress=function e(t){return t.switch().value===i.default.CryptoKeyType.keyTypeMuxedEd25519().value?function(t){if(t.switch()===i.default.CryptoKeyType.keyTypeEd25519())return e(t);var r=t.med25519();return a.StrKey.encodeMed25519PublicKey(n.concat([r.ed25519(),r.id().toXDR("raw")]))}(t):a.StrKey.encodeEd25519PublicKey(t.ed25519())},t.extractBaseAddress=function(e){if(a.StrKey.isValidEd25519PublicKey(e))return e;if(!a.StrKey.isValidMed25519PublicKey(e))throw new TypeError("expected muxed account (M...), got ".concat(e));var t=s(e);return a.StrKey.encodeEd25519PublicKey(t.med25519().ed25519())};var o,i=(o=r(4081))&&o.__esModule?o:{default:o},a=r(8385);function s(e){return a.StrKey.isValidMed25519PublicKey(e)?function(e){var t=a.StrKey.decodeMed25519PublicKey(e);return i.default.MuxedAccount.keyTypeMuxedEd25519(new i.default.MuxedAccountMed25519({id:i.default.Uint64.fromXDR(t.subarray(-8)),ed25519:t.subarray(0,-8)}))}(e):i.default.MuxedAccount.keyTypeEd25519(a.StrKey.decodeEd25519PublicKey(e))}},6006:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trimEnd=void 0,t.trimEnd=function(e,t){for(var r="number"==typeof e,n=String(e);n.endsWith(t);)n=n.slice(0,-1);return r?Number(n):n}},4081:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(7701))&&n.__esModule?n:{default:n};t.default=o.default},7586:(e,t,r)=>{!function(e){"use strict";var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function y(e,t,r,n,o){var i,a=0;for(i=0;i>>8)-1}function m(e,t,r,n){return y(e,t,r,n,16)}function g(e,t,r,n){return y(e,t,r,n,32)}function v(e,t,r,n){!function(e,t,r,n){for(var o,i=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,m=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,g=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,v=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,b=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,A=i,S=a,k=s,_=u,E=c,x=l,T=f,P=d,O=h,R=p,I=y,C=m,M=g,B=v,N=b,L=w,j=0;j<20;j+=2)A^=(o=(M^=(o=(O^=(o=(E^=(o=A+M|0)<<7|o>>>25)+A|0)<<9|o>>>23)+E|0)<<13|o>>>19)+O|0)<<18|o>>>14,x^=(o=(S^=(o=(B^=(o=(R^=(o=x+S|0)<<7|o>>>25)+x|0)<<9|o>>>23)+R|0)<<13|o>>>19)+B|0)<<18|o>>>14,I^=(o=(T^=(o=(k^=(o=(N^=(o=I+T|0)<<7|o>>>25)+I|0)<<9|o>>>23)+N|0)<<13|o>>>19)+k|0)<<18|o>>>14,L^=(o=(C^=(o=(P^=(o=(_^=(o=L+C|0)<<7|o>>>25)+L|0)<<9|o>>>23)+_|0)<<13|o>>>19)+P|0)<<18|o>>>14,A^=(o=(_^=(o=(k^=(o=(S^=(o=A+_|0)<<7|o>>>25)+A|0)<<9|o>>>23)+S|0)<<13|o>>>19)+k|0)<<18|o>>>14,x^=(o=(E^=(o=(P^=(o=(T^=(o=x+E|0)<<7|o>>>25)+x|0)<<9|o>>>23)+T|0)<<13|o>>>19)+P|0)<<18|o>>>14,I^=(o=(R^=(o=(O^=(o=(C^=(o=I+R|0)<<7|o>>>25)+I|0)<<9|o>>>23)+C|0)<<13|o>>>19)+O|0)<<18|o>>>14,L^=(o=(N^=(o=(B^=(o=(M^=(o=L+N|0)<<7|o>>>25)+L|0)<<9|o>>>23)+M|0)<<13|o>>>19)+B|0)<<18|o>>>14;A=A+i|0,S=S+a|0,k=k+s|0,_=_+u|0,E=E+c|0,x=x+l|0,T=T+f|0,P=P+d|0,O=O+h|0,R=R+p|0,I=I+y|0,C=C+m|0,M=M+g|0,B=B+v|0,N=N+b|0,L=L+w|0,e[0]=A>>>0&255,e[1]=A>>>8&255,e[2]=A>>>16&255,e[3]=A>>>24&255,e[4]=S>>>0&255,e[5]=S>>>8&255,e[6]=S>>>16&255,e[7]=S>>>24&255,e[8]=k>>>0&255,e[9]=k>>>8&255,e[10]=k>>>16&255,e[11]=k>>>24&255,e[12]=_>>>0&255,e[13]=_>>>8&255,e[14]=_>>>16&255,e[15]=_>>>24&255,e[16]=E>>>0&255,e[17]=E>>>8&255,e[18]=E>>>16&255,e[19]=E>>>24&255,e[20]=x>>>0&255,e[21]=x>>>8&255,e[22]=x>>>16&255,e[23]=x>>>24&255,e[24]=T>>>0&255,e[25]=T>>>8&255,e[26]=T>>>16&255,e[27]=T>>>24&255,e[28]=P>>>0&255,e[29]=P>>>8&255,e[30]=P>>>16&255,e[31]=P>>>24&255,e[32]=O>>>0&255,e[33]=O>>>8&255,e[34]=O>>>16&255,e[35]=O>>>24&255,e[36]=R>>>0&255,e[37]=R>>>8&255,e[38]=R>>>16&255,e[39]=R>>>24&255,e[40]=I>>>0&255,e[41]=I>>>8&255,e[42]=I>>>16&255,e[43]=I>>>24&255,e[44]=C>>>0&255,e[45]=C>>>8&255,e[46]=C>>>16&255,e[47]=C>>>24&255,e[48]=M>>>0&255,e[49]=M>>>8&255,e[50]=M>>>16&255,e[51]=M>>>24&255,e[52]=B>>>0&255,e[53]=B>>>8&255,e[54]=B>>>16&255,e[55]=B>>>24&255,e[56]=N>>>0&255,e[57]=N>>>8&255,e[58]=N>>>16&255,e[59]=N>>>24&255,e[60]=L>>>0&255,e[61]=L>>>8&255,e[62]=L>>>16&255,e[63]=L>>>24&255}(e,t,r,n)}function b(e,t,r,n){!function(e,t,r,n){for(var o,i=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,y=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,m=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,g=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,v=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,b=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,A=0;A<20;A+=2)i^=(o=(g^=(o=(h^=(o=(c^=(o=i+g|0)<<7|o>>>25)+i|0)<<9|o>>>23)+c|0)<<13|o>>>19)+h|0)<<18|o>>>14,l^=(o=(a^=(o=(v^=(o=(p^=(o=l+a|0)<<7|o>>>25)+l|0)<<9|o>>>23)+p|0)<<13|o>>>19)+v|0)<<18|o>>>14,y^=(o=(f^=(o=(s^=(o=(b^=(o=y+f|0)<<7|o>>>25)+y|0)<<9|o>>>23)+b|0)<<13|o>>>19)+s|0)<<18|o>>>14,w^=(o=(m^=(o=(d^=(o=(u^=(o=w+m|0)<<7|o>>>25)+w|0)<<9|o>>>23)+u|0)<<13|o>>>19)+d|0)<<18|o>>>14,i^=(o=(u^=(o=(s^=(o=(a^=(o=i+u|0)<<7|o>>>25)+i|0)<<9|o>>>23)+a|0)<<13|o>>>19)+s|0)<<18|o>>>14,l^=(o=(c^=(o=(d^=(o=(f^=(o=l+c|0)<<7|o>>>25)+l|0)<<9|o>>>23)+f|0)<<13|o>>>19)+d|0)<<18|o>>>14,y^=(o=(p^=(o=(h^=(o=(m^=(o=y+p|0)<<7|o>>>25)+y|0)<<9|o>>>23)+m|0)<<13|o>>>19)+h|0)<<18|o>>>14,w^=(o=(b^=(o=(v^=(o=(g^=(o=w+b|0)<<7|o>>>25)+w|0)<<9|o>>>23)+g|0)<<13|o>>>19)+v|0)<<18|o>>>14;e[0]=i>>>0&255,e[1]=i>>>8&255,e[2]=i>>>16&255,e[3]=i>>>24&255,e[4]=l>>>0&255,e[5]=l>>>8&255,e[6]=l>>>16&255,e[7]=l>>>24&255,e[8]=y>>>0&255,e[9]=y>>>8&255,e[10]=y>>>16&255,e[11]=y>>>24&255,e[12]=w>>>0&255,e[13]=w>>>8&255,e[14]=w>>>16&255,e[15]=w>>>24&255,e[16]=f>>>0&255,e[17]=f>>>8&255,e[18]=f>>>16&255,e[19]=f>>>24&255,e[20]=d>>>0&255,e[21]=d>>>8&255,e[22]=d>>>16&255,e[23]=d>>>24&255,e[24]=h>>>0&255,e[25]=h>>>8&255,e[26]=h>>>16&255,e[27]=h>>>24&255,e[28]=p>>>0&255,e[29]=p>>>8&255,e[30]=p>>>16&255,e[31]=p>>>24&255}(e,t,r,n)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function A(e,t,r,n,o,i,a){var s,u,c=new Uint8Array(16),l=new Uint8Array(64);for(u=0;u<16;u++)c[u]=0;for(u=0;u<8;u++)c[u]=i[u];for(;o>=64;){for(v(l,c,a,w),u=0;u<64;u++)e[t+u]=r[n+u]^l[u];for(s=1,u=8;u<16;u++)s=s+(255&c[u])|0,c[u]=255&s,s>>>=8;o-=64,t+=64,n+=64}if(o>0)for(v(l,c,a,w),u=0;u=64;){for(v(u,s,o,w),a=0;a<64;a++)e[t+a]=u[a];for(i=1,a=8;a<16;a++)i=i+(255&s[a])|0,s[a]=255&i,i>>>=8;r-=64,t+=64}if(r>0)for(v(u,s,o,w),a=0;a>>13|r<<3),n=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|n<<6),o=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(n>>>7|o<<9),i=255&e[8]|(255&e[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,a=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(i>>>14|a<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(a>>>11|s<<5),u=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|u<<8),this.r[9]=u>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function x(e,t,r,n,o,i){var a=new E(i);return a.update(r,n,o),a.finish(e,t),0}function T(e,t,r,n,o,i){var a=new Uint8Array(16);return x(a,0,r,n,o,i),m(e,t,a,0)}function P(e,t,r,n,o){var i;if(r<32)return-1;for(_(e,0,t,0,r,n,o),x(e,16,e,32,r-32,e),i=0;i<16;i++)e[i]=0;return 0}function O(e,t,r,n,o){var i,a=new Uint8Array(32);if(r<32)return-1;if(k(a,0,32,n,o),0!==T(t,16,t,32,r-32,a))return-1;for(_(e,0,t,0,r,n,o),i=0;i<32;i++)e[i]=0;return 0}function R(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function I(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function C(e,t,r){for(var n,o=~(r-1),i=0;i<16;i++)n=o&(e[i]^t[i]),e[i]^=n,t[i]^=n}function M(e,r){var n,o,i,a=t(),s=t();for(n=0;n<16;n++)s[n]=r[n];for(I(s),I(s),I(s),o=0;o<2;o++){for(a[0]=s[0]-65517,n=1;n<15;n++)a[n]=s[n]-65535-(a[n-1]>>16&1),a[n-1]&=65535;a[15]=s[15]-32767-(a[14]>>16&1),i=a[15]>>16&1,a[14]&=65535,C(s,a,1-i)}for(n=0;n<16;n++)e[2*n]=255&s[n],e[2*n+1]=s[n]>>8}function B(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return M(r,e),M(n,t),g(r,0,n,0)}function N(e){var t=new Uint8Array(32);return M(t,e),1&t[0]}function L(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function j(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function U(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function F(e,t,r){var n,o,i=0,a=0,s=0,u=0,c=0,l=0,f=0,d=0,h=0,p=0,y=0,m=0,g=0,v=0,b=0,w=0,A=0,S=0,k=0,_=0,E=0,x=0,T=0,P=0,O=0,R=0,I=0,C=0,M=0,B=0,N=0,L=r[0],j=r[1],U=r[2],F=r[3],D=r[4],z=r[5],q=r[6],H=r[7],V=r[8],K=r[9],W=r[10],G=r[11],X=r[12],Z=r[13],Q=r[14],Y=r[15];i+=(n=t[0])*L,a+=n*j,s+=n*U,u+=n*F,c+=n*D,l+=n*z,f+=n*q,d+=n*H,h+=n*V,p+=n*K,y+=n*W,m+=n*G,g+=n*X,v+=n*Z,b+=n*Q,w+=n*Y,a+=(n=t[1])*L,s+=n*j,u+=n*U,c+=n*F,l+=n*D,f+=n*z,d+=n*q,h+=n*H,p+=n*V,y+=n*K,m+=n*W,g+=n*G,v+=n*X,b+=n*Z,w+=n*Q,A+=n*Y,s+=(n=t[2])*L,u+=n*j,c+=n*U,l+=n*F,f+=n*D,d+=n*z,h+=n*q,p+=n*H,y+=n*V,m+=n*K,g+=n*W,v+=n*G,b+=n*X,w+=n*Z,A+=n*Q,S+=n*Y,u+=(n=t[3])*L,c+=n*j,l+=n*U,f+=n*F,d+=n*D,h+=n*z,p+=n*q,y+=n*H,m+=n*V,g+=n*K,v+=n*W,b+=n*G,w+=n*X,A+=n*Z,S+=n*Q,k+=n*Y,c+=(n=t[4])*L,l+=n*j,f+=n*U,d+=n*F,h+=n*D,p+=n*z,y+=n*q,m+=n*H,g+=n*V,v+=n*K,b+=n*W,w+=n*G,A+=n*X,S+=n*Z,k+=n*Q,_+=n*Y,l+=(n=t[5])*L,f+=n*j,d+=n*U,h+=n*F,p+=n*D,y+=n*z,m+=n*q,g+=n*H,v+=n*V,b+=n*K,w+=n*W,A+=n*G,S+=n*X,k+=n*Z,_+=n*Q,E+=n*Y,f+=(n=t[6])*L,d+=n*j,h+=n*U,p+=n*F,y+=n*D,m+=n*z,g+=n*q,v+=n*H,b+=n*V,w+=n*K,A+=n*W,S+=n*G,k+=n*X,_+=n*Z,E+=n*Q,x+=n*Y,d+=(n=t[7])*L,h+=n*j,p+=n*U,y+=n*F,m+=n*D,g+=n*z,v+=n*q,b+=n*H,w+=n*V,A+=n*K,S+=n*W,k+=n*G,_+=n*X,E+=n*Z,x+=n*Q,T+=n*Y,h+=(n=t[8])*L,p+=n*j,y+=n*U,m+=n*F,g+=n*D,v+=n*z,b+=n*q,w+=n*H,A+=n*V,S+=n*K,k+=n*W,_+=n*G,E+=n*X,x+=n*Z,T+=n*Q,P+=n*Y,p+=(n=t[9])*L,y+=n*j,m+=n*U,g+=n*F,v+=n*D,b+=n*z,w+=n*q,A+=n*H,S+=n*V,k+=n*K,_+=n*W,E+=n*G,x+=n*X,T+=n*Z,P+=n*Q,O+=n*Y,y+=(n=t[10])*L,m+=n*j,g+=n*U,v+=n*F,b+=n*D,w+=n*z,A+=n*q,S+=n*H,k+=n*V,_+=n*K,E+=n*W,x+=n*G,T+=n*X,P+=n*Z,O+=n*Q,R+=n*Y,m+=(n=t[11])*L,g+=n*j,v+=n*U,b+=n*F,w+=n*D,A+=n*z,S+=n*q,k+=n*H,_+=n*V,E+=n*K,x+=n*W,T+=n*G,P+=n*X,O+=n*Z,R+=n*Q,I+=n*Y,g+=(n=t[12])*L,v+=n*j,b+=n*U,w+=n*F,A+=n*D,S+=n*z,k+=n*q,_+=n*H,E+=n*V,x+=n*K,T+=n*W,P+=n*G,O+=n*X,R+=n*Z,I+=n*Q,C+=n*Y,v+=(n=t[13])*L,b+=n*j,w+=n*U,A+=n*F,S+=n*D,k+=n*z,_+=n*q,E+=n*H,x+=n*V,T+=n*K,P+=n*W,O+=n*G,R+=n*X,I+=n*Z,C+=n*Q,M+=n*Y,b+=(n=t[14])*L,w+=n*j,A+=n*U,S+=n*F,k+=n*D,_+=n*z,E+=n*q,x+=n*H,T+=n*V,P+=n*K,O+=n*W,R+=n*G,I+=n*X,C+=n*Z,M+=n*Q,B+=n*Y,w+=(n=t[15])*L,a+=38*(S+=n*U),s+=38*(k+=n*F),u+=38*(_+=n*D),c+=38*(E+=n*z),l+=38*(x+=n*q),f+=38*(T+=n*H),d+=38*(P+=n*V),h+=38*(O+=n*K),p+=38*(R+=n*W),y+=38*(I+=n*G),m+=38*(C+=n*X),g+=38*(M+=n*Z),v+=38*(B+=n*Q),b+=38*(N+=n*Y),i=(n=(i+=38*(A+=n*j))+(o=1)+65535)-65536*(o=Math.floor(n/65536)),a=(n=a+o+65535)-65536*(o=Math.floor(n/65536)),s=(n=s+o+65535)-65536*(o=Math.floor(n/65536)),u=(n=u+o+65535)-65536*(o=Math.floor(n/65536)),c=(n=c+o+65535)-65536*(o=Math.floor(n/65536)),l=(n=l+o+65535)-65536*(o=Math.floor(n/65536)),f=(n=f+o+65535)-65536*(o=Math.floor(n/65536)),d=(n=d+o+65535)-65536*(o=Math.floor(n/65536)),h=(n=h+o+65535)-65536*(o=Math.floor(n/65536)),p=(n=p+o+65535)-65536*(o=Math.floor(n/65536)),y=(n=y+o+65535)-65536*(o=Math.floor(n/65536)),m=(n=m+o+65535)-65536*(o=Math.floor(n/65536)),g=(n=g+o+65535)-65536*(o=Math.floor(n/65536)),v=(n=v+o+65535)-65536*(o=Math.floor(n/65536)),b=(n=b+o+65535)-65536*(o=Math.floor(n/65536)),w=(n=w+o+65535)-65536*(o=Math.floor(n/65536)),i=(n=(i+=o-1+37*(o-1))+(o=1)+65535)-65536*(o=Math.floor(n/65536)),a=(n=a+o+65535)-65536*(o=Math.floor(n/65536)),s=(n=s+o+65535)-65536*(o=Math.floor(n/65536)),u=(n=u+o+65535)-65536*(o=Math.floor(n/65536)),c=(n=c+o+65535)-65536*(o=Math.floor(n/65536)),l=(n=l+o+65535)-65536*(o=Math.floor(n/65536)),f=(n=f+o+65535)-65536*(o=Math.floor(n/65536)),d=(n=d+o+65535)-65536*(o=Math.floor(n/65536)),h=(n=h+o+65535)-65536*(o=Math.floor(n/65536)),p=(n=p+o+65535)-65536*(o=Math.floor(n/65536)),y=(n=y+o+65535)-65536*(o=Math.floor(n/65536)),m=(n=m+o+65535)-65536*(o=Math.floor(n/65536)),g=(n=g+o+65535)-65536*(o=Math.floor(n/65536)),v=(n=v+o+65535)-65536*(o=Math.floor(n/65536)),b=(n=b+o+65535)-65536*(o=Math.floor(n/65536)),w=(n=w+o+65535)-65536*(o=Math.floor(n/65536)),i+=o-1+37*(o-1),e[0]=i,e[1]=a,e[2]=s,e[3]=u,e[4]=c,e[5]=l,e[6]=f,e[7]=d,e[8]=h,e[9]=p,e[10]=y,e[11]=m,e[12]=g,e[13]=v,e[14]=b,e[15]=w}function D(e,t){F(e,t,t)}function z(e,r){var n,o=t();for(n=0;n<16;n++)o[n]=r[n];for(n=253;n>=0;n--)D(o,o),2!==n&&4!==n&&F(o,o,r);for(n=0;n<16;n++)e[n]=o[n]}function q(e,r){var n,o=t();for(n=0;n<16;n++)o[n]=r[n];for(n=250;n>=0;n--)D(o,o),1!==n&&F(o,o,r);for(n=0;n<16;n++)e[n]=o[n]}function H(e,r,n){var o,i,a=new Uint8Array(32),s=new Float64Array(80),c=t(),l=t(),f=t(),d=t(),h=t(),p=t();for(i=0;i<31;i++)a[i]=r[i];for(a[31]=127&r[31]|64,a[0]&=248,L(s,n),i=0;i<16;i++)l[i]=s[i],d[i]=c[i]=f[i]=0;for(c[0]=d[0]=1,i=254;i>=0;--i)C(c,l,o=a[i>>>3]>>>(7&i)&1),C(f,d,o),j(h,c,f),U(c,c,f),j(f,l,d),U(l,l,d),D(d,h),D(p,c),F(c,f,c),F(f,l,h),j(h,c,f),U(c,c,f),D(l,c),U(f,d,p),F(c,f,u),j(c,c,d),F(f,f,c),F(c,d,p),F(d,l,s),D(l,h),C(c,l,o),C(f,d,o);for(i=0;i<16;i++)s[i+16]=c[i],s[i+32]=f[i],s[i+48]=l[i],s[i+64]=d[i];var y=s.subarray(32),m=s.subarray(16);return z(y,y),F(m,m,y),M(e,m),0}function V(e,t){return H(e,t,i)}function K(e,t){return n(t,32),V(e,t)}function W(e,t,r){var n=new Uint8Array(32);return H(n,r,t),b(e,o,n,w)}E.prototype.blocks=function(e,t,r){for(var n,o,i,a,s,u,c,l,f,d,h,p,y,m,g,v,b,w,A,S=this.fin?0:2048,k=this.h[0],_=this.h[1],E=this.h[2],x=this.h[3],T=this.h[4],P=this.h[5],O=this.h[6],R=this.h[7],I=this.h[8],C=this.h[9],M=this.r[0],B=this.r[1],N=this.r[2],L=this.r[3],j=this.r[4],U=this.r[5],F=this.r[6],D=this.r[7],z=this.r[8],q=this.r[9];r>=16;)d=f=0,d+=(k+=8191&(n=255&e[t+0]|(255&e[t+1])<<8))*M,d+=(_+=8191&(n>>>13|(o=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*q),d+=(E+=8191&(o>>>10|(i=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*z),d+=(x+=8191&(i>>>7|(a=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*D),f=(d+=(T+=8191&(a>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*F))>>>13,d&=8191,d+=(P+=s>>>1&8191)*(5*U),d+=(O+=8191&(s>>>14|(u=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*j),d+=(R+=8191&(u>>>11|(c=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*L),d+=(I+=8191&(c>>>8|(l=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*N),h=f+=(d+=(C+=l>>>5|S)*(5*B))>>>13,h+=k*B,h+=_*M,h+=E*(5*q),h+=x*(5*z),f=(h+=T*(5*D))>>>13,h&=8191,h+=P*(5*F),h+=O*(5*U),h+=R*(5*j),h+=I*(5*L),f+=(h+=C*(5*N))>>>13,h&=8191,p=f,p+=k*N,p+=_*B,p+=E*M,p+=x*(5*q),f=(p+=T*(5*z))>>>13,p&=8191,p+=P*(5*D),p+=O*(5*F),p+=R*(5*U),p+=I*(5*j),y=f+=(p+=C*(5*L))>>>13,y+=k*L,y+=_*N,y+=E*B,y+=x*M,f=(y+=T*(5*q))>>>13,y&=8191,y+=P*(5*z),y+=O*(5*D),y+=R*(5*F),y+=I*(5*U),m=f+=(y+=C*(5*j))>>>13,m+=k*j,m+=_*L,m+=E*N,m+=x*B,f=(m+=T*M)>>>13,m&=8191,m+=P*(5*q),m+=O*(5*z),m+=R*(5*D),m+=I*(5*F),g=f+=(m+=C*(5*U))>>>13,g+=k*U,g+=_*j,g+=E*L,g+=x*N,f=(g+=T*B)>>>13,g&=8191,g+=P*M,g+=O*(5*q),g+=R*(5*z),g+=I*(5*D),v=f+=(g+=C*(5*F))>>>13,v+=k*F,v+=_*U,v+=E*j,v+=x*L,f=(v+=T*N)>>>13,v&=8191,v+=P*B,v+=O*M,v+=R*(5*q),v+=I*(5*z),b=f+=(v+=C*(5*D))>>>13,b+=k*D,b+=_*F,b+=E*U,b+=x*j,f=(b+=T*L)>>>13,b&=8191,b+=P*N,b+=O*B,b+=R*M,b+=I*(5*q),w=f+=(b+=C*(5*z))>>>13,w+=k*z,w+=_*D,w+=E*F,w+=x*U,f=(w+=T*j)>>>13,w&=8191,w+=P*L,w+=O*N,w+=R*B,w+=I*M,A=f+=(w+=C*(5*q))>>>13,A+=k*q,A+=_*z,A+=E*D,A+=x*F,f=(A+=T*U)>>>13,A&=8191,A+=P*j,A+=O*L,A+=R*N,A+=I*B,k=d=8191&(f=(f=((f+=(A+=C*M)>>>13)<<2)+f|0)+(d&=8191)|0),_=h+=f>>>=13,E=p&=8191,x=y&=8191,T=m&=8191,P=g&=8191,O=v&=8191,R=b&=8191,I=w&=8191,C=A&=8191,t+=16,r-=16;this.h[0]=k,this.h[1]=_,this.h[2]=E,this.h[3]=x,this.h[4]=T,this.h[5]=P,this.h[6]=O,this.h[7]=R,this.h[8]=I,this.h[9]=C},E.prototype.finish=function(e,t){var r,n,o,i,a=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=r,r=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,a[0]=this.h[0]+5,r=a[0]>>>13,a[0]&=8191,i=1;i<10;i++)a[i]=this.h[i]+r,r=a[i]>>>13,a[i]&=8191;for(a[9]-=8192,n=(1^r)-1,i=0;i<10;i++)a[i]&=n;for(n=~n,i=0;i<10;i++)this.h[i]=this.h[i]&n|a[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},E.prototype.update=function(e,t,r){var n,o;if(this.leftover){for((o=16-this.leftover)>r&&(o=r),n=0;n=16&&(o=r-r%16,this.blocks(e,t,o),t+=o,r-=o),r){for(n=0;n=128;){for(S=0;S<16;S++)k=8*S+X,R[S]=r[k+0]<<24|r[k+1]<<16|r[k+2]<<8|r[k+3],I[S]=r[k+4]<<24|r[k+5]<<16|r[k+6]<<8|r[k+7];for(S=0;S<80;S++)if(o=C,i=M,a=B,s=N,u=L,c=j,l=U,d=D,h=z,p=q,y=H,m=V,g=K,v=W,x=65535&(E=G),T=E>>>16,P=65535&(_=F),O=_>>>16,x+=65535&(E=(V>>>14|L<<18)^(V>>>18|L<<14)^(L>>>9|V<<23)),T+=E>>>16,P+=65535&(_=(L>>>14|V<<18)^(L>>>18|V<<14)^(V>>>9|L<<23)),O+=_>>>16,x+=65535&(E=V&K^~V&W),T+=E>>>16,P+=65535&(_=L&j^~L&U),O+=_>>>16,_=Z[2*S],x+=65535&(E=Z[2*S+1]),T+=E>>>16,P+=65535&_,O+=_>>>16,_=R[S%16],T+=(E=I[S%16])>>>16,P+=65535&_,O+=_>>>16,P+=(T+=(x+=65535&E)>>>16)>>>16,x=65535&(E=A=65535&x|T<<16),T=E>>>16,P=65535&(_=w=65535&P|(O+=P>>>16)<<16),O=_>>>16,x+=65535&(E=(D>>>28|C<<4)^(C>>>2|D<<30)^(C>>>7|D<<25)),T+=E>>>16,P+=65535&(_=(C>>>28|D<<4)^(D>>>2|C<<30)^(D>>>7|C<<25)),O+=_>>>16,T+=(E=D&z^D&q^z&q)>>>16,P+=65535&(_=C&M^C&B^M&B),O+=_>>>16,f=65535&(P+=(T+=(x+=65535&E)>>>16)>>>16)|(O+=P>>>16)<<16,b=65535&x|T<<16,x=65535&(E=y),T=E>>>16,P=65535&(_=s),O=_>>>16,T+=(E=A)>>>16,P+=65535&(_=w),O+=_>>>16,M=o,B=i,N=a,L=s=65535&(P+=(T+=(x+=65535&E)>>>16)>>>16)|(O+=P>>>16)<<16,j=u,U=c,F=l,C=f,z=d,q=h,H=p,V=y=65535&x|T<<16,K=m,W=g,G=v,D=b,S%16==15)for(k=0;k<16;k++)_=R[k],x=65535&(E=I[k]),T=E>>>16,P=65535&_,O=_>>>16,_=R[(k+9)%16],x+=65535&(E=I[(k+9)%16]),T+=E>>>16,P+=65535&_,O+=_>>>16,w=R[(k+1)%16],x+=65535&(E=((A=I[(k+1)%16])>>>1|w<<31)^(A>>>8|w<<24)^(A>>>7|w<<25)),T+=E>>>16,P+=65535&(_=(w>>>1|A<<31)^(w>>>8|A<<24)^w>>>7),O+=_>>>16,w=R[(k+14)%16],T+=(E=((A=I[(k+14)%16])>>>19|w<<13)^(w>>>29|A<<3)^(A>>>6|w<<26))>>>16,P+=65535&(_=(w>>>19|A<<13)^(A>>>29|w<<3)^w>>>6),O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,R[k]=65535&P|O<<16,I[k]=65535&x|T<<16;x=65535&(E=D),T=E>>>16,P=65535&(_=C),O=_>>>16,_=e[0],T+=(E=t[0])>>>16,P+=65535&_,O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,e[0]=C=65535&P|O<<16,t[0]=D=65535&x|T<<16,x=65535&(E=z),T=E>>>16,P=65535&(_=M),O=_>>>16,_=e[1],T+=(E=t[1])>>>16,P+=65535&_,O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,e[1]=M=65535&P|O<<16,t[1]=z=65535&x|T<<16,x=65535&(E=q),T=E>>>16,P=65535&(_=B),O=_>>>16,_=e[2],T+=(E=t[2])>>>16,P+=65535&_,O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,e[2]=B=65535&P|O<<16,t[2]=q=65535&x|T<<16,x=65535&(E=H),T=E>>>16,P=65535&(_=N),O=_>>>16,_=e[3],T+=(E=t[3])>>>16,P+=65535&_,O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,e[3]=N=65535&P|O<<16,t[3]=H=65535&x|T<<16,x=65535&(E=V),T=E>>>16,P=65535&(_=L),O=_>>>16,_=e[4],T+=(E=t[4])>>>16,P+=65535&_,O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,e[4]=L=65535&P|O<<16,t[4]=V=65535&x|T<<16,x=65535&(E=K),T=E>>>16,P=65535&(_=j),O=_>>>16,_=e[5],T+=(E=t[5])>>>16,P+=65535&_,O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,e[5]=j=65535&P|O<<16,t[5]=K=65535&x|T<<16,x=65535&(E=W),T=E>>>16,P=65535&(_=U),O=_>>>16,_=e[6],T+=(E=t[6])>>>16,P+=65535&_,O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,e[6]=U=65535&P|O<<16,t[6]=W=65535&x|T<<16,x=65535&(E=G),T=E>>>16,P=65535&(_=F),O=_>>>16,_=e[7],T+=(E=t[7])>>>16,P+=65535&_,O+=_>>>16,O+=(P+=(T+=(x+=65535&E)>>>16)>>>16)>>>16,e[7]=F=65535&P|O<<16,t[7]=G=65535&x|T<<16,X+=128,n-=128}return n}function Y(e,t,r){var n,o=new Int32Array(8),i=new Int32Array(8),a=new Uint8Array(256),s=r;for(o[0]=1779033703,o[1]=3144134277,o[2]=1013904242,o[3]=2773480762,o[4]=1359893119,o[5]=2600822924,o[6]=528734635,o[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,Q(o,i,t,r),r%=128,n=0;n=0;--o)$(e,t,n=r[o/8|0]>>(7&o)&1),J(t,e),J(e,e),$(e,t,n)}function re(e,r){var n=[t(),t(),t(),t()];R(n[0],f),R(n[1],d),R(n[2],s),F(n[3],f,d),te(e,n,r)}function ne(e,r,o){var i,a=new Uint8Array(64),s=[t(),t(),t(),t()];for(o||n(r,32),Y(a,r,32),a[0]&=248,a[31]&=127,a[31]|=64,re(s,a),ee(e,s),i=0;i<32;i++)r[i+32]=e[i];return 0}var oe=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ie(e,t){var r,n,o,i;for(n=63;n>=32;--n){for(r=0,o=n-32,i=n-12;o>4)*oe[o],r=t[o]>>8,t[o]&=255;for(o=0;o<32;o++)t[o]-=r*oe[o];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function ae(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ie(e,r)}function se(e,r,n,o){var i,a,s=new Uint8Array(64),u=new Uint8Array(64),c=new Uint8Array(64),l=new Float64Array(64),f=[t(),t(),t(),t()];Y(s,o,32),s[0]&=248,s[31]&=127,s[31]|=64;var d=n+64;for(i=0;i>7&&U(e[0],a,e[0]),F(e[3],e[0],e[1]),0)}(d,o))return-1;for(i=0;i=0},e.sign.keyPair=function(){var e=new Uint8Array(le),t=new Uint8Array(fe);return ne(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(he(e),e.length!==fe)throw new Error("bad secret key size");for(var t=new Uint8Array(le),r=0;r{"use strict";r.r(t),r.d(t,{StellarBase:()=>i,axios:()=>a.Z,default:()=>s});var n=r(8026),o={};for(const u in n)["default","StellarBase","axios"].indexOf(u)<0&&(o[u]=()=>n[u]);r.d(t,o);var i=r(4172),a=r(1257);const s=(e=r.hmd(e)).exports},7939:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}function o(e,t){for(var r=0;ru});var a={allowHttp:!1,timeout:0},s=Object.assign({},a),u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,r=[{key:"setAllowHttp",value:function(e){s.allowHttp=e}},{key:"setTimeout",value:function(e){s.timeout=e}},{key:"isAllowHttp",value:function(){return s.allowHttp}},{key:"getTimeout",value:function(){return s.timeout}},{key:"setDefault",value:function(){s=Object.assign({},a)}}],r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},936:(e,t,r)=>{"use strict";r.d(t,{o:()=>y});var n=r(8026),o=r(8764).Buffer;function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function u(e){return u="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},u(e)}function c(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1)throw new Error("Multiple outputs not supported");var a=o[0];return a.switch().value===n.xdr.ScSpecType.scSpecTypeResult().value?this.scValToNative(r,a.result().okType()):this.scValToNative(r,a)}},{key:"findEntry",value:function(e){var t=this.entries.find((function(t){return t.value().name().toString()===e}));if(!t)throw new Error("no such entry: ".concat(e));return t}},{key:"nativeToScVal",value:function(e,t){var r=this,i=t.switch(),a=i.value;if(i.value===n.xdr.ScSpecType.scSpecTypeUdt().value){var s=t.udt();return this.nativeToUdt(e,s.name().toString())}if(a===n.xdr.ScSpecType.scSpecTypeOption().value){var c=t.option();return void 0===e?n.xdr.ScVal.scvVoid():this.nativeToScVal(e,c.valueType())}switch(u(e)){case"object":var l,f,h;if(null===e){if(a===n.xdr.ScSpecType.scSpecTypeVoid().value)return n.xdr.ScVal.scvVoid();throw new TypeError("Type ".concat(t," was not void, but value was null"))}if(e instanceof n.xdr.ScVal)return e;if(e instanceof n.Address){if(t.switch().value!==n.xdr.ScSpecType.scSpecTypeAddress().value)throw new TypeError("Type ".concat(t," was not address, but value was Address"));return e.toScVal()}if(e instanceof n.Contract){if(t.switch().value!==n.xdr.ScSpecType.scSpecTypeAddress().value)throw new TypeError("Type ".concat(t," was not address, but value was Address"));return e.address().toScVal()}if(e instanceof Uint8Array||o.isBuffer(e)){var p=Uint8Array.from(e);switch(a){case n.xdr.ScSpecType.scSpecTypeBytesN().value:var y=t.bytesN();if(p.length!==y.n())throw new TypeError("expected ".concat(y.n()," bytes, but got ").concat(p.length));return n.xdr.ScVal.scvBytes(p);case n.xdr.ScSpecType.scSpecTypeBytes().value:return n.xdr.ScVal.scvBytes(p);default:throw new TypeError("invalid type (".concat(t,") specified for Bytes and BytesN"))}}if(Array.isArray(e))switch(a){case n.xdr.ScSpecType.scSpecTypeVec().value:var m=t.vec().elementType();return n.xdr.ScVal.scvVec(e.map((function(e){return r.nativeToScVal(e,m)})));case n.xdr.ScSpecType.scSpecTypeTuple().value:var g=t.tuple().valueTypes();if(e.length!==g.length)throw new TypeError("Tuple expects ".concat(g.length," values, but ").concat(e.length," were provided"));return n.xdr.ScVal.scvVec(e.map((function(e,t){return r.nativeToScVal(e,g[t])})));case n.xdr.ScSpecType.scSpecTypeMap().value:var v=t.map(),b=v.keyType(),w=v.valueType();return n.xdr.ScVal.scvMap(e.map((function(e){var t=r.nativeToScVal(e[0],b),o=r.nativeToScVal(e[1],w);return new n.xdr.ScMapEntry({key:t,val:o})})));default:throw new TypeError("Type ".concat(t," was not vec, but value was Array"))}if(e.constructor===Map){if(a!==n.xdr.ScSpecType.scSpecTypeMap().value)throw new TypeError("Type ".concat(t," was not map, but value was Map"));for(var A=t.map(),S=[],k=e.entries(),_=k.next();!_.done;){var E=d(_.value,2),x=E[0],T=E[1],P=this.nativeToScVal(x,A.keyType()),O=this.nativeToScVal(T,A.valueType());S.push(new n.xdr.ScMapEntry({key:P,val:O})),_=k.next()}return n.xdr.ScVal.scvMap(S)}if("Object"!==(null!==(l=null===(f=e.constructor)||void 0===f?void 0:f.name)&&void 0!==l?l:""))throw new TypeError("cannot interpret ".concat(null===(h=e.constructor)||void 0===h?void 0:h.name," value as ScVal (").concat(JSON.stringify(e),")"));throw new TypeError("Received object ".concat(e," did not match the provided type ").concat(t));case"number":case"bigint":switch(a){case n.xdr.ScSpecType.scSpecTypeU32().value:return n.xdr.ScVal.scvU32(e);case n.xdr.ScSpecType.scSpecTypeI32().value:return n.xdr.ScVal.scvI32(e);case n.xdr.ScSpecType.scSpecTypeU64().value:case n.xdr.ScSpecType.scSpecTypeI64().value:case n.xdr.ScSpecType.scSpecTypeU128().value:case n.xdr.ScSpecType.scSpecTypeI128().value:case n.xdr.ScSpecType.scSpecTypeU256().value:case n.xdr.ScSpecType.scSpecTypeI256().value:var R=i.name.substring(10).toLowerCase();return new n.XdrLargeInt(R,e).toScVal();default:throw new TypeError("invalid type (".concat(t,") specified for integer"))}case"string":return function(e,t){switch(t.value){case n.xdr.ScSpecType.scSpecTypeString().value:return n.xdr.ScVal.scvString(e);case n.xdr.ScSpecType.scSpecTypeSymbol().value:return n.xdr.ScVal.scvSymbol(e);case n.xdr.ScSpecType.scSpecTypeAddress().value:var r=n.Address.fromString(e);return n.xdr.ScVal.scvAddress(r.toScAddress());case n.xdr.ScSpecType.scSpecTypeU64().value:return new n.XdrLargeInt("u64",e).toScVal();case n.xdr.ScSpecType.scSpecTypeI64().value:return new n.XdrLargeInt("i64",e).toScVal();case n.xdr.ScSpecType.scSpecTypeU128().value:return new n.XdrLargeInt("u128",e).toScVal();case n.xdr.ScSpecType.scSpecTypeI128().value:return new n.XdrLargeInt("i128",e).toScVal();case n.xdr.ScSpecType.scSpecTypeU256().value:return new n.XdrLargeInt("u256",e).toScVal();case n.xdr.ScSpecType.scSpecTypeI256().value:return new n.XdrLargeInt("i256",e).toScVal();case n.xdr.ScSpecType.scSpecTypeBytes().value:case n.xdr.ScSpecType.scSpecTypeBytesN().value:return n.xdr.ScVal.scvBytes(o.from(e,"base64"));default:throw new TypeError("invalid type ".concat(t.name," specified for string value"))}}(e,i);case"boolean":if(a!==n.xdr.ScSpecType.scSpecTypeBool().value)throw TypeError("Type ".concat(t," was not bool, but value was bool"));return n.xdr.ScVal.scvBool(e);case"undefined":if(!t)return n.xdr.ScVal.scvVoid();switch(a){case n.xdr.ScSpecType.scSpecTypeVoid().value:case n.xdr.ScSpecType.scSpecTypeOption().value:return n.xdr.ScVal.scvVoid();default:throw new TypeError("Type ".concat(t," was not void, but value was undefined"))}case"function":return this.nativeToScVal(e(),t);default:throw new TypeError("failed to convert typeof ".concat(u(e)," (").concat(e,")"))}}},{key:"nativeToUdt",value:function(e,t){var r=this.findEntry(t);switch(r.switch()){case n.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0():if("number"!=typeof e)throw new TypeError("expected number for enum ".concat(t,", but got ").concat(u(e)));return this.nativeToEnum(e,r.udtEnumV0());case n.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0():return this.nativeToStruct(e,r.udtStructV0());case n.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0():return this.nativeToUnion(e,r.udtUnionV0());default:throw new Error("failed to parse udt ".concat(t))}}},{key:"nativeToUnion",value:function(e,t){var r=this,o=e.tag,i=t.cases().find((function(e){return e.value().name().toString()===o}));if(!i)throw new TypeError("no such enum entry: ".concat(o," in ").concat(t));var a=n.xdr.ScVal.scvSymbol(o);switch(i.switch()){case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0():return n.xdr.ScVal.scvVec([a]);case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0():var s=i.tupleCase().type();if(Array.isArray(e.values)){if(e.values.length!=s.length)throw new TypeError("union ".concat(t," expects ").concat(s.length," values, but got ").concat(e.values.length));var u=e.values.map((function(e,t){return r.nativeToScVal(e,s[t])}));return u.unshift(a),n.xdr.ScVal.scvVec(u)}throw new Error("failed to parse union case ".concat(i," with ").concat(e));default:throw new Error("failed to parse union ".concat(t," with ").concat(e))}}},{key:"nativeToStruct",value:function(e,t){var r=this,o=t.fields();if(o.some(m)){if(!o.every(m))throw new Error("mixed numeric and non-numeric field names are not allowed");return n.xdr.ScVal.scvVec(o.map((function(t,n){return r.nativeToScVal(e[n],o[n].type())})))}return n.xdr.ScVal.scvMap(o.map((function(t){var o=t.name().toString();return new n.xdr.ScMapEntry({key:r.nativeToScVal(o,n.xdr.ScSpecTypeDef.scSpecTypeSymbol()),val:r.nativeToScVal(e[o],t.type())})})))}},{key:"nativeToEnum",value:function(e,t){if(t.cases().some((function(t){return t.value()===e})))return n.xdr.ScVal.scvU32(e);throw new TypeError("no such enum entry: ".concat(e," in ").concat(t))}},{key:"scValStrToNative",value:function(e,t){return this.scValToNative(n.xdr.ScVal.fromXDR(e,"base64"),t)}},{key:"scValToNative",value:function(e,t){var r=this,o=t.switch(),i=o.value;if(i===n.xdr.ScSpecType.scSpecTypeUdt().value)return this.scValUdtToNative(e,t.udt());switch(e.switch().value){case n.xdr.ScValType.scvVoid().value:return;case n.xdr.ScValType.scvU64().value:case n.xdr.ScValType.scvI64().value:case n.xdr.ScValType.scvU128().value:case n.xdr.ScValType.scvI128().value:case n.xdr.ScValType.scvU256().value:case n.xdr.ScValType.scvI256().value:return(0,n.scValToBigInt)(e);case n.xdr.ScValType.scvVec().value:if(i==n.xdr.ScSpecType.scSpecTypeVec().value){var a,s=t.vec();return(null!==(a=e.vec())&&void 0!==a?a:[]).map((function(e){return r.scValToNative(e,s.elementType())}))}if(i==n.xdr.ScSpecType.scSpecTypeTuple().value){var u,c=t.tuple().valueTypes();return(null!==(u=e.vec())&&void 0!==u?u:[]).map((function(e,t){return r.scValToNative(e,c[t])}))}throw new TypeError("Type ".concat(t," was not vec, but ").concat(e," is"));case n.xdr.ScValType.scvAddress().value:return n.Address.fromScVal(e).toString();case n.xdr.ScValType.scvMap().value:var l,f=null!==(l=e.map())&&void 0!==l?l:[];if(i==n.xdr.ScSpecType.scSpecTypeMap().value){var d=t.map(),h=d.keyType(),p=d.valueType();return f.map((function(e){return[r.scValToNative(e.key(),h),r.scValToNative(e.val(),p)]}))}throw new TypeError("ScSpecType ".concat(o.name," was not map, but ").concat(JSON.stringify(e,null,2)," is"));case n.xdr.ScValType.scvBool().value:case n.xdr.ScValType.scvU32().value:case n.xdr.ScValType.scvI32().value:case n.xdr.ScValType.scvBytes().value:return e.value();case n.xdr.ScValType.scvString().value:case n.xdr.ScValType.scvSymbol().value:var y;if(i!==n.xdr.ScSpecType.scSpecTypeString().value&&i!==n.xdr.ScSpecType.scSpecTypeSymbol().value)throw new Error("ScSpecType ".concat(o.name," was not string or symbol, but ").concat(JSON.stringify(e,null,2)," is"));return null===(y=e.value())||void 0===y?void 0:y.toString();case n.xdr.ScValType.scvTimepoint().value:case n.xdr.ScValType.scvDuration().value:return(0,n.scValToBigInt)(n.xdr.ScVal.scvU64(e.u64()));default:throw new TypeError("failed to convert ".concat(JSON.stringify(e,null,2)," to native type from type ").concat(o.name))}}},{key:"scValUdtToNative",value:function(e,t){var r=this.findEntry(t.name().toString());switch(r.switch()){case n.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0():return this.enumToNative(e);case n.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0():return this.structToNative(e,r.udtStructV0());case n.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0():return this.unionToNative(e,r.udtUnionV0());default:throw new Error("failed to parse udt ".concat(t.name().toString(),": ").concat(r))}}},{key:"unionToNative",value:function(e,t){var r=this,o=e.vec();if(!o)throw new Error("".concat(JSON.stringify(e,null,2)," is not a vec"));if(0===o.length&&0!==t.cases.length)throw new Error("".concat(e," has length 0, but the there are at least one case in the union"));var i=o[0].sym().toString();if(o[0].switch().value!=n.xdr.ScValType.scvSymbol().value)throw new Error("{vec[0]} is not a symbol");var a=t.cases().find(function(e){return function(t){switch(t.switch().value){case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value:return t.tupleCase().name().toString()===e;case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0().value:return t.voidCase().name().toString()===e;default:return!1}}}(i));if(!a)throw new Error("failed to find entry ".concat(i," in union {udt.name().toString()}"));var s={tag:i};if(a.switch().value===n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value){var u=a.tupleCase().type().map((function(e,t){return r.scValToNative(o[t+1],e)}));s.values=u}return s}},{key:"structToNative",value:function(e,t){var r,n,o=this,i={},a=t.fields();return a.some(m)?null===(n=e.vec())||void 0===n?void 0:n.map((function(e,t){return o.scValToNative(e,a[t].type())})):(null===(r=e.map())||void 0===r||r.forEach((function(e,t){var r=a[t];i[r.name().toString()]=o.scValToNative(e.val(),r.type())})),i)}},{key:"enumToNative",value:function(e){if(e.switch().value!==n.xdr.ScValType.scvU32().value)throw new Error("Enum must have a u32 value");return e.u32()}},{key:"jsonSchema",value:function(e){var t,r={},o=s(this.entries);try{for(o.s();!(t=o.n()).done;){var i=t.value;switch(i.switch().value){case n.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0().value:var u=i.udtEnumV0();r[u.name().toString()]=k(u);break;case n.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0().value:var c=i.udtStructV0();r[c.name().toString()]=b(c);break;case n.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0().value:var l=i.udtUnionV0();r[l.name().toString()]=S(l);break;case n.xdr.ScSpecEntryKind.scSpecEntryFunctionV0().value:var f=i.functionV0(),d=f.name().toString(),h=A(f).input;r[d]=h;case n.xdr.ScSpecEntryKind.scSpecEntryUdtErrorEnumV0().value:}}}catch(e){o.e(e)}finally{o.f()}var p={$schema:"http://json-schema.org/draft-07/schema#",definitions:a(a({},g),r)};return e&&(p.$ref="#/definitions/".concat(e)),p}}])&&c(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function m(e){return/^\d+$/.test(e.name().toString())}var g={U32:{type:"integer",minimum:0,maximum:4294967295},I32:{type:"integer",minimum:-2147483648,maximum:2147483647},U64:{type:"string",pattern:"^([1-9][0-9]*|0)$",minLength:1,maxLength:20},I64:{type:"string",pattern:"^(-?[1-9][0-9]*|0)$",minLength:1,maxLength:21},U128:{type:"string",pattern:"^([1-9][0-9]*|0)$",minLength:1,maxLength:39},I128:{type:"string",pattern:"^(-?[1-9][0-9]*|0)$",minLength:1,maxLength:40},U256:{type:"string",pattern:"^([1-9][0-9]*|0)$",minLength:1,maxLength:78},I256:{type:"string",pattern:"^(-?[1-9][0-9]*|0)$",minLength:1,maxLength:79},Address:{type:"string",format:"address",description:"Address can be a public key or contract id"},ScString:{type:"string",description:"ScString is a string"},ScSymbol:{type:"string",description:"ScString is a string"},DataUrl:{type:"string",pattern:"^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$"}};function v(e){var t;switch(e.switch().value){case n.xdr.ScSpecType.scSpecTypeVal().value:t="Val";break;case n.xdr.ScSpecType.scSpecTypeBool().value:return{type:"boolean"};case n.xdr.ScSpecType.scSpecTypeVoid().value:return{type:"null"};case n.xdr.ScSpecType.scSpecTypeError().value:t="Error";break;case n.xdr.ScSpecType.scSpecTypeU32().value:t="U32";break;case n.xdr.ScSpecType.scSpecTypeI32().value:t="I32";break;case n.xdr.ScSpecType.scSpecTypeU64().value:t="U64";break;case n.xdr.ScSpecType.scSpecTypeI64().value:t="I64";break;case n.xdr.ScSpecType.scSpecTypeTimepoint().value:throw new Error("Timepoint type not supported");case n.xdr.ScSpecType.scSpecTypeDuration().value:throw new Error("Duration not supported");case n.xdr.ScSpecType.scSpecTypeU128().value:t="U128";break;case n.xdr.ScSpecType.scSpecTypeI128().value:t="I128";break;case n.xdr.ScSpecType.scSpecTypeU256().value:t="U256";break;case n.xdr.ScSpecType.scSpecTypeI256().value:t="I256";break;case n.xdr.ScSpecType.scSpecTypeBytes().value:t="DataUrl";break;case n.xdr.ScSpecType.scSpecTypeString().value:t="ScString";break;case n.xdr.ScSpecType.scSpecTypeSymbol().value:t="ScSymbol";break;case n.xdr.ScSpecType.scSpecTypeAddress().value:t="Address";break;case n.xdr.ScSpecType.scSpecTypeOption().value:return v(e.option().valueType());case n.xdr.ScSpecType.scSpecTypeResult().value:break;case n.xdr.ScSpecType.scSpecTypeVec().value:return{type:"array",items:v(e.vec().elementType())};case n.xdr.ScSpecType.scSpecTypeMap().value:var r=e.map();return{type:"array",items:{type:"array",items:[v(r.keyType()),v(r.valueType())],minItems:2,maxItems:2}};case n.xdr.ScSpecType.scSpecTypeTuple().value:var o=e.tuple(),i=o.valueTypes().length,a=i;return{type:"array",items:o.valueTypes().map(v),minItems:i,maxItems:a};case n.xdr.ScSpecType.scSpecTypeBytesN().value:return{$ref:"#/definitions/DataUrl",maxLength:e.bytesN().n()};case n.xdr.ScSpecType.scSpecTypeUdt().value:t=e.udt().name().toString()}return{$ref:"#/definitions/".concat(t)}}function b(e){var t=e.fields();if(t.some(m)){if(!t.every(m))throw new Error("mixed numeric and non-numeric field names are not allowed");return{type:"array",items:t.map((function(e,r){return v(t[r].type())})),minItems:t.length,maxItems:t.length}}var r=e.doc().toString(),n=w(t),o=n.properties,i=n.required;return o.additionalProperties=!1,{description:r,properties:o,required:i,type:"object"}}function w(e){var t,r={},o=[],i=s(e);try{for(i.s();!(t=i.n()).done;){var a=t.value,u=a.type(),c=a.name().toString();r[c]=v(u),u.switch().value!=n.xdr.ScSpecType.scSpecTypeOption().value&&o.push(c)}}catch(e){i.e(e)}finally{i.f()}var l={properties:r};return o.length>0&&(l.required=o),l}function A(e){var t=w(e.inputs()),r=t.properties,o=t.required,i={additionalProperties:!1,properties:r,type:"object"};(null==o?void 0:o.length)>0&&(i.required=o);var a={properties:{args:i}},s=e.outputs(),u=s.length>0?v(s[0]):v(n.xdr.ScSpecTypeDef.scSpecTypeVoid()),c=e.doc().toString();return c.length>0&&(a.description=c),a.additionalProperties=!1,u.additionalProperties=!1,{input:a,output:u}}function S(e){var t,r=e.doc().toString(),o=[],i=s(e.cases());try{for(i.s();!(t=i.n()).done;){var a=t.value;switch(a.switch().value){case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0().value:var u=a.voidCase().name().toString();o.push({type:"object",title:u,properties:{tag:u},additionalProperties:!1,required:["tag"]});break;case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value:var c=a.tupleCase(),l=c.name().toString();o.push({type:"object",title:l,properties:{tag:l,values:{type:"array",items:c.type().map(v)}},required:["tag","values"],additionalProperties:!1})}}}catch(e){i.e(e)}finally{i.f()}var f={oneOf:o};return r.length>0&&(f.description=r),f}function k(e){var t,r=e.doc().toString(),n=[],o=s(e.cases());try{for(o.s();!(t=o.n()).done;){var i=t.value,a=i.name().toString(),u=i.doc().toString();n.push({description:u,title:a,enum:[i.value()],type:"number"})}}catch(e){o.e(e)}finally{o.f()}var c={oneOf:n};return r.length>0&&(c.description=r),c}},6086:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;ry,Fz:()=>v,dR:()=>m,hs:()=>b,oY:()=>g});var y=function(e){u(r,e);var t=c(r);function r(e,n){var i;o(this,r);var a=(this instanceof r?this.constructor:void 0).prototype;return(i=t.call(this,e)).__proto__=a,i.constructor=r,i.response=n,i}return a(r,[{key:"getResponse",value:function(){return this.response}}]),r}(l(Error)),m=function(e){u(r,e);var t=c(r);function r(e,n){var i;o(this,r);var a=(this instanceof r?this.constructor:void 0).prototype;return(i=t.call(this,e,n)).__proto__=a,i.constructor=r,i.name="NotFoundError",i}return a(r)}(y),g=function(e){u(r,e);var t=c(r);function r(e,n){var i;o(this,r);var a=(this instanceof r?this.constructor:void 0).prototype;return(i=t.call(this,e,n)).__proto__=a,i.constructor=r,i.name="BadRequestError",i}return a(r)}(y),v=function(e){u(r,e);var t=c(r);function r(e,n){var i;o(this,r);var a=(this instanceof r?this.constructor:void 0).prototype;return(i=t.call(this,e,n)).__proto__=a,i.constructor=r,i.name="BadResponseError",i}return a(r)}(y),b=function(e){u(r,e);var t=c(r);function r(e,n,i){var a;o(this,r);var s=(this instanceof r?this.constructor:void 0).prototype;return(a=t.call(this,e)).__proto__=s,a.constructor=r,a.name="AccountRequiresMemoError",a.accountId=n,a.operationIndex=i,a}return a(r)}(l(Error))},2761:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Api:()=>n,FEDERATION_RESPONSE_MAX_SIZE:()=>b,Server:()=>w});var n={};r.r(n),r.d(n,{Api:()=>{}});var o=r(1257),i=r(4172),a=r(4998),s=r.n(a),u=r(7939),c=r(6086),l=r(4700);function f(e){return f="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},f(e)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return h(e,t);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)?h(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:M(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function y(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function m(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){y(i,n,o,a,s,"next",e)}function s(e){y(i,n,o,a,s,"throw",e)}a(void 0)}))}}function g(e,t){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.serverURL=s()(t),this.domain=r;var o=void 0===n.allowHttp?u.D.isAllowHttp():n.allowHttp;if(this.timeout=void 0===n.timeout?u.D.getTimeout():n.timeout,"https"!==this.serverURL.protocol()&&!o)throw new Error("Cannot connect to insecure federation server")}var t,r,n,a,f,h,y,v,w;return t=e,r=[{key:"resolveAddress",value:(w=m(p().mark((function e(t){var r,n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t,!(t.indexOf("*")<0)){e.next=5;break}if(this.domain){e.next=4;break}return e.abrupt("return",Promise.reject(new Error("Unknown domain. Make sure `address` contains a domain (ex. `bob*stellar.org`) or pass `domain` parameter when instantiating the server object.")));case 4:r="".concat(t,"*").concat(this.domain);case 5:return n=this.serverURL.query({type:"name",q:r}),e.abrupt("return",this._sendRequest(n));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"resolveAccountId",value:(v=m(p().mark((function e(t){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.serverURL.query({type:"id",q:t}),e.abrupt("return",this._sendRequest(r));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"resolveTransactionId",value:(y=m(p().mark((function e(t){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.serverURL.query({type:"txid",q:t}),e.abrupt("return",this._sendRequest(r));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"_sendRequest",value:(h=m(p().mark((function e(t){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.timeout,e.abrupt("return",o.Z.get(t.toString(),{maxContentLength:b,timeout:r}).then((function(e){if(void 0!==e.data.memo&&"string"!=typeof e.data.memo)throw new Error("memo value should be of type string");return e.data})).catch((function(e){if(e instanceof Error){if(e.message.match(/^maxContentLength size/))throw new Error("federation response exceeds allowed size of ".concat(b));return Promise.reject(e)}return Promise.reject(new c.Fz("Server query failed. Server responded: ".concat(e.status," ").concat(e.statusText),e.data))})));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})}],n=[{key:"resolve",value:(f=m(p().mark((function t(r){var n,o,a,s,u,c=arguments;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=c.length>1&&void 0!==c[1]?c[1]:{},!(r.indexOf("*")<0)){t.next=5;break}if(i.StrKey.isValidEd25519PublicKey(r)){t.next=4;break}return t.abrupt("return",Promise.reject(new Error("Invalid Account ID")));case 4:return t.abrupt("return",Promise.resolve({account_id:r}));case 5:if(o=r.split("*"),a=d(o,2),s=a[1],2===o.length&&s){t.next=9;break}return t.abrupt("return",Promise.reject(new Error("Invalid Stellar address")));case 9:return t.next=11,e.createForDomain(s,n);case 11:return u=t.sent,t.abrupt("return",u.resolveAddress(r));case 13:case"end":return t.stop()}}),t)}))),function(e){return f.apply(this,arguments)})},{key:"createForDomain",value:(a=m(p().mark((function t(r){var n,o,i=arguments;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=3,l.Resolver.resolve(r,n);case 3:if((o=t.sent).FEDERATION_SERVER){t.next=6;break}return t.abrupt("return",Promise.reject(new Error("stellar.toml does not contain FEDERATION_SERVER field")));case 6:return t.abrupt("return",new e(o.FEDERATION_SERVER,r,n));case 7:case"end":return t.stop()}}),t)}))),function(e){return a.apply(this,arguments)})}],r&&g(t.prototype,r),n&&g(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},197:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Api:()=>{}})},6881:(e,t,r)=>{"use strict";var n,o;r.r(t),r.d(t,{AccountResponse:()=>l,AxiosClient:()=>z,HorizonApi:()=>n,SERVER_TIME_MAP:()=>U,Server:()=>Kt,ServerApi:()=>o,default:()=>Wt,getCurrentServerTime:()=>q}),function(e){var t=function(e){return e.constantProduct="constant_product",e}({});e.LiquidityPoolType=t;var r=function(e){return e.createAccount="create_account",e.payment="payment",e.pathPayment="path_payment_strict_receive",e.createPassiveOffer="create_passive_sell_offer",e.manageOffer="manage_sell_offer",e.setOptions="set_options",e.changeTrust="change_trust",e.allowTrust="allow_trust",e.accountMerge="account_merge",e.inflation="inflation",e.manageData="manage_data",e.bumpSequence="bump_sequence",e.manageBuyOffer="manage_buy_offer",e.pathPaymentStrictSend="path_payment_strict_send",e.createClaimableBalance="create_claimable_balance",e.claimClaimableBalance="claim_claimable_balance",e.beginSponsoringFutureReserves="begin_sponsoring_future_reserves",e.endSponsoringFutureReserves="end_sponsoring_future_reserves",e.revokeSponsorship="revoke_sponsorship",e.clawback="clawback",e.clawbackClaimableBalance="clawback_claimable_balance",e.setTrustLineFlags="set_trust_line_flags",e.liquidityPoolDeposit="liquidity_pool_deposit",e.liquidityPoolWithdraw="liquidity_pool_withdraw",e.invokeHostFunction="invoke_host_function",e.bumpFootprintExpiration="bump_footprint_expiration",e.restoreFootprint="restore_footprint",e}({});e.OperationResponseType=r;var n=function(e){return e[e.createAccount=0]="createAccount",e[e.payment=1]="payment",e[e.pathPayment=2]="pathPayment",e[e.createPassiveOffer=3]="createPassiveOffer",e[e.manageOffer=4]="manageOffer",e[e.setOptions=5]="setOptions",e[e.changeTrust=6]="changeTrust",e[e.allowTrust=7]="allowTrust",e[e.accountMerge=8]="accountMerge",e[e.inflation=9]="inflation",e[e.manageData=10]="manageData",e[e.bumpSequence=11]="bumpSequence",e[e.manageBuyOffer=12]="manageBuyOffer",e[e.pathPaymentStrictSend=13]="pathPaymentStrictSend",e[e.createClaimableBalance=14]="createClaimableBalance",e[e.claimClaimableBalance=15]="claimClaimableBalance",e[e.beginSponsoringFutureReserves=16]="beginSponsoringFutureReserves",e[e.endSponsoringFutureReserves=17]="endSponsoringFutureReserves",e[e.revokeSponsorship=18]="revokeSponsorship",e[e.clawback=19]="clawback",e[e.clawbackClaimableBalance=20]="clawbackClaimableBalance",e[e.setTrustLineFlags=21]="setTrustLineFlags",e[e.liquidityPoolDeposit=22]="liquidityPoolDeposit",e[e.liquidityPoolWithdraw=23]="liquidityPoolWithdraw",e[e.invokeHostFunction=24]="invokeHostFunction",e[e.bumpFootprintExpiration=25]="bumpFootprintExpiration",e[e.restoreFootprint=26]="restoreFootprint",e}({});e.OperationResponseTypeI=n;var o=function(e){return e.TX_FAILED="tx_failed",e.TX_BAD_SEQ="tx_bad_seq",e.TX_BAD_AUTH="tx_bad_auth",e.TX_BAD_AUTH_EXTRA="tx_bad_auth_extra",e.TX_FEE_BUMP_INNER_SUCCESS="tx_fee_bump_inner_success",e.TX_FEE_BUMP_INNER_FAILED="tx_fee_bump_inner_failed",e.TX_NOT_SUPPORTED="tx_not_supported",e.TX_SUCCESS="tx_success",e.TX_TOO_EARLY="tx_too_early",e.TX_TOO_LATE="tx_too_late",e.TX_MISSING_OPERATION="tx_missing_operation",e.TX_INSUFFICIENT_BALANCE="tx_insufficient_balance",e.TX_NO_SOURCE_ACCOUNT="tx_no_source_account",e.TX_INSUFFICIENT_FEE="tx_insufficient_fee",e.TX_INTERNAL_ERROR="tx_internal_error",e}({});e.TransactionFailedResultCodes=o}(n||(n={})),function(e){var t=function(e){return e.all="all",e.liquidityPools="liquidity_pool",e.orderbook="orderbook",e}({});e.TradeType=t,n.OperationResponseType,n.OperationResponseTypeI}(o||(o={}));var i=r(4172);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 s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0||e===t?t:t-1}function k(e){for(var t,r,n=1,o=e.length,i=e[0]+"";nc^r?1:-1;for(s=(u=o.length)<(c=i.length)?u:c,a=0;ai[a]^r?1:-1;return u==c?0:u>c^r?1:-1}function E(e,t,r,n){if(er||e!==h(e))throw Error(p+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function x(e){var t=e.c.length-1;return S(e.e/g)==t&&e.c[t]%2!=0}function T(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function P(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else tj?p.c=p.e=null:e.e=10;u/=10,s++);return void(s>j?p.c=p.e=null:(p.e=s,p.c=[e]))}d=String(e)}else{if(!f.test(d=String(e)))return o(p,d,c);p.s=45==d.charCodeAt(0)?(d=d.slice(1),-1):1}(s=d.indexOf("."))>-1&&(d=d.replace(".","")),(u=d.search(/e/i))>0?(s<0&&(s=u),s+=+d.slice(u+1),d=d.substring(0,u)):s<0&&(s=d.length)}else{if(E(t,2,q.length,"Base"),10==t&&H)return X(p=new V(e),C+p.e+1,M);if(d=String(e),c="number"==typeof e){if(0*e!=0)return o(p,d,c,t);if(p.s=1/e<0?(d=d.slice(1),-1):1,V.DEBUG&&d.replace(/^0\.0*|\./,"").length>15)throw Error(y+e)}else p.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1;for(r=q.slice(0,t),s=u=0,l=d.length;us){s=l;continue}}else if(!a&&(d==d.toUpperCase()&&(d=d.toLowerCase())||d==d.toLowerCase()&&(d=d.toUpperCase()))){a=!0,u=-1,s=0;continue}return o(p,String(e),c,t)}c=!1,(s=(d=n(d,t,10,p.s)).indexOf("."))>-1?d=d.replace(".",""):s=d.length}for(u=0;48===d.charCodeAt(u);u++);for(l=d.length;48===d.charCodeAt(--l););if(d=d.slice(u,++l)){if(l-=u,c&&V.DEBUG&&l>15&&(e>v||e!==h(e)))throw Error(y+p.s*e);if((s=s-u-1)>j)p.c=p.e=null;else if(s=N)?T(u,a):P(u,a,"0");else if(i=(e=X(new V(e),t,r)).e,s=(u=k(e.c)).length,1==n||2==n&&(t<=i||i<=B)){for(;ss){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=i-s)>0)for(i+1==s&&(u+=".");t--;u+="0");return e.s<0&&o?"-"+u:u}function W(e,t){for(var r,n,o=1,i=new V(e[0]);o=10;o/=10,n++);return(r=n+r*g-1)>j?e.c=e.e=null:r=10;s/=10,o++);if((i=t-o)<0)i+=g,a=t,u=f[c=0],l=h(u/p[o-a-1]%10);else if((c=d((i+1)/g))>=f.length){if(!n)break e;for(;f.length<=c;f.push(0));u=l=0,o=1,a=(i%=g)-g+1}else{for(u=s=f[c],o=1;s>=10;s/=10,o++);l=(a=(i%=g)-g+o)<0?0:h(u/p[o-a-1]%10)}if(n=n||t<0||null!=f[c+1]||(a<0?u:u%p[o-a-1]),n=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(i>0?a>0?u/p[o-a]:0:f[c-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,n?(t-=e.e+1,f[0]=p[(g-t%g)%g],e.e=-t||0):f[0]=e.e=0,e;if(0==i?(f.length=c,s=1,c--):(f.length=c+1,s=p[g-i],f[c]=a>0?h(u/p[o-a]%p[a])*s:0),n)for(;;){if(0==c){for(i=1,a=f[0];a>=10;a/=10,i++);for(a=f[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(e.e++,f[0]==m&&(f[0]=1));break}if(f[c]+=s,f[c]!=m)break;f[c--]=0,s=1}for(i=f.length;0===f[--i];f.pop());}e.e>j?e.c=e.e=null:e.e=N?T(t,r):P(t,r,"0"),e.s<0?"-"+t:t)}return V.clone=e,V.ROUND_UP=0,V.ROUND_DOWN=1,V.ROUND_CEIL=2,V.ROUND_FLOOR=3,V.ROUND_HALF_UP=4,V.ROUND_HALF_DOWN=5,V.ROUND_HALF_EVEN=6,V.ROUND_HALF_CEIL=7,V.ROUND_HALF_FLOOR=8,V.EUCLID=9,V.config=V.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(p+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(E(r=e[t],0,A,t),C=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(E(r=e[t],0,8,t),M=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(E(r[0],-A,0,t),E(r[1],0,A,t),B=r[0],N=r[1]):(E(r,-A,A,t),B=-(N=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)E(r[0],-A,-1,t),E(r[1],1,A,t),L=r[0],j=r[1];else{if(E(r,-A,A,t),!r)throw Error(p+t+" cannot be zero: "+r);L=-(j=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(p+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(p+"crypto unavailable");U=r}else U=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(E(r=e[t],0,9,t),F=r),e.hasOwnProperty(t="POW_PRECISION")&&(E(r=e[t],0,A,t),D=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(p+t+" not an object: "+r);z=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(p+t+" invalid: "+r);H="0123456789"==r.slice(0,10),q=r}}return{DECIMAL_PLACES:C,ROUNDING_MODE:M,EXPONENTIAL_AT:[B,N],RANGE:[L,j],CRYPTO:U,MODULO_MODE:F,POW_PRECISION:D,FORMAT:z,ALPHABET:q}},V.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!V.DEBUG)return!0;var t,r,n=e.c,o=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&o>=-A&&o<=A&&o===h(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%g)<1&&(t+=g),String(n[0]).length==t){for(t=0;t=m||r!==h(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(p+"Invalid BigNumber: "+e)},V.maximum=V.max=function(){return W(arguments,-1)},V.minimum=V.min=function(){return W(arguments,1)},V.random=(i=9007199254740992,a=Math.random()*i&2097151?function(){return h(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,i,s=0,u=[],c=new V(I);if(null==e?e=C:E(e,0,A),o=d(e/g),U)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));s>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(u.push(i%1e14),s+=2);s=o/2}else{if(!crypto.randomBytes)throw U=!1,Error(p+"crypto unavailable");for(t=crypto.randomBytes(o*=7);s=9e15?crypto.randomBytes(7).copy(t,s):(u.push(i%1e14),s+=7);s=o/7}if(!U)for(;s=10;i/=10,s++);sr-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/r|0,a[o]%=r)}return a.reverse()}return function(n,o,i,a,s){var u,c,l,f,d,h,p,y,m=n.indexOf("."),g=C,v=M;for(m>=0&&(f=D,D=0,n=n.replace(".",""),h=(y=new V(o)).pow(n.length-m),D=f,y.c=t(P(k(h.c),h.e,"0"),10,i,e),y.e=y.c.length),l=f=(p=t(n,o,i,s?(u=q,e):(u=e,q))).length;0==p[--f];p.pop());if(!p[0])return u.charAt(0);if(m<0?--l:(h.c=p,h.e=l,h.s=a,p=(h=r(h,y,g,v,i)).c,d=h.r,l=h.e),m=p[c=l+g+1],f=i/2,d=d||c<0||null!=p[c+1],d=v<4?(null!=m||d)&&(0==v||v==(h.s<0?3:2)):m>f||m==f&&(4==v||d||6==v&&1&p[c-1]||v==(h.s<0?8:7)),c<1||!p[0])n=d?P(u.charAt(1),-g,u.charAt(0)):u.charAt(0);else{if(p.length=c,d)for(--i;++p[--c]>i;)p[c]=0,c||(++l,p=[1].concat(p));for(f=p.length;!p[--f];);for(m=0,n="";m<=f;n+=u.charAt(p[m++]));n=P(n,l,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,o,i,a,s=0,u=e.length,c=t%w,l=t/w|0;for(e=e.slice();u--;)s=((o=c*(i=e[u]%w)+(n=l*i+(a=e[u]/w|0)*c)%w*w+s)/r|0)+(n/w|0)+l*a,e[u]=o%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var o,i;if(r!=n)i=r>n?1:-1;else for(o=i=0;ot[o]?1:-1;break}return i}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]1;e.splice(0,1));}return function(n,o,i,a,s){var u,c,l,f,d,p,y,v,b,w,A,k,_,E,x,T,P,O=n.s==o.s?1:-1,R=n.c,I=o.c;if(!(R&&R[0]&&I&&I[0]))return new V(n.s&&o.s&&(R?!I||R[0]!=I[0]:I)?R&&0==R[0]||!I?0*O:O/0:NaN);for(b=(v=new V(O)).c=[],O=i+(c=n.e-o.e)+1,s||(s=m,c=S(n.e/g)-S(o.e/g),O=O/g|0),l=0;I[l]==(R[l]||0);l++);if(I[l]>(R[l]||0)&&c--,O<0)b.push(1),f=!0;else{for(E=R.length,T=I.length,l=0,O+=2,(d=h(s/(I[0]+1)))>1&&(I=e(I,d,s),R=e(R,d,s),T=I.length,E=R.length),_=T,A=(w=R.slice(0,T)).length;A=s/2&&x++;do{if(d=0,(u=t(I,w,T,A))<0){if(k=w[0],T!=A&&(k=k*s+(w[1]||0)),(d=h(k/x))>1)for(d>=s&&(d=s-1),y=(p=e(I,d,s)).length,A=w.length;1==t(p,w,y,A);)d--,r(p,T=10;O/=10,l++);X(v,i+(v.e=l+c*g-1)+1,a,f)}else v.e=c,v.r=+f;return v}}(),s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,c=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(e,t,r,n){var o,i=r?t:t.replace(O,"");if(l.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(s,(function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t})),n&&(o=n,i=i.replace(u,"$1").replace(c,"0.$1")),t!=i))return new V(i,o);if(V.DEBUG)throw Error(p+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},R.absoluteValue=R.abs=function(){var e=new V(this);return e.s<0&&(e.s=1),e},R.comparedTo=function(e,t){return _(this,new V(e,t))},R.decimalPlaces=R.dp=function(e,t){var r,n,o,i=this;if(null!=e)return E(e,0,A),null==t?t=M:E(t,0,8),X(new V(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((o=r.length-1)-S(this.e/g))*g,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},R.dividedBy=R.div=function(e,t){return r(this,new V(e,t),C,M)},R.dividedToIntegerBy=R.idiv=function(e,t){return r(this,new V(e,t),0,1)},R.exponentiatedBy=R.pow=function(e,t){var r,n,o,i,a,s,u,c,l=this;if((e=new V(e)).c&&!e.isInteger())throw Error(p+"Exponent not an integer: "+Z(e));if(null!=t&&(t=new V(t)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return c=new V(Math.pow(+Z(l),a?e.s*(2-x(e)):+Z(e))),t?c.mod(t):c;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new V(NaN);(n=!s&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return i=l.s<0&&x(e)?-0:0,l.e>-1&&(i=1/i),new V(s?1/i:i);D&&(i=d(D/g+2))}for(a?(r=new V(.5),s&&(e.s=1),u=x(e)):u=(o=Math.abs(+Z(e)))%2,c=new V(I);;){if(u){if(!(c=c.times(l)).c)break;i?c.c.length>i&&(c.c.length=i):n&&(c=c.mod(t))}if(o){if(0===(o=h(o/2)))break;u=o%2}else if(X(e=e.times(r),e.e+1,1),e.e>14)u=x(e);else{if(0===(o=+Z(e)))break;u=o%2}l=l.times(l),i?l.c&&l.c.length>i&&(l.c.length=i):n&&(l=l.mod(t))}return n?c:(s&&(c=I.div(c)),t?c.mod(t):i?X(c,D,M,void 0):c)},R.integerValue=function(e){var t=new V(this);return null==e?e=M:E(e,0,8),X(t,t.e+1,e)},R.isEqualTo=R.eq=function(e,t){return 0===_(this,new V(e,t))},R.isFinite=function(){return!!this.c},R.isGreaterThan=R.gt=function(e,t){return _(this,new V(e,t))>0},R.isGreaterThanOrEqualTo=R.gte=function(e,t){return 1===(t=_(this,new V(e,t)))||0===t},R.isInteger=function(){return!!this.c&&S(this.e/g)>this.c.length-2},R.isLessThan=R.lt=function(e,t){return _(this,new V(e,t))<0},R.isLessThanOrEqualTo=R.lte=function(e,t){return-1===(t=_(this,new V(e,t)))||0===t},R.isNaN=function(){return!this.s},R.isNegative=function(){return this.s<0},R.isPositive=function(){return this.s>0},R.isZero=function(){return!!this.c&&0==this.c[0]},R.minus=function(e,t){var r,n,o,i,a=this,s=a.s;if(t=(e=new V(e,t)).s,!s||!t)return new V(NaN);if(s!=t)return e.s=-t,a.plus(e);var u=a.e/g,c=e.e/g,l=a.c,f=e.c;if(!u||!c){if(!l||!f)return l?(e.s=-t,e):new V(f?a:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new V(l[0]?a:3==M?-0:0)}if(u=S(u),c=S(c),l=l.slice(),s=u-c){for((i=s<0)?(s=-s,o=l):(c=u,o=f),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(n=(i=(s=l.length)<(t=f.length))?s:t,s=t=0;t0)for(;t--;l[r++]=0);for(t=m-1;n>s;){if(l[--n]=0;){for(r=0,d=k[o]%v,h=k[o]/v|0,i=o+(a=u);i>o;)r=((c=d*(c=A[--a]%v)+(s=h*c+(l=A[a]/v|0)*d)%v*v+p[i]+r)/y|0)+(s/v|0)+h*l,p[i--]=c%y;p[i]=r}return r?++n:p.splice(0,1),G(e,p,n)},R.negated=function(){var e=new V(this);return e.s=-e.s||null,e},R.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new V(e,t)).s,!o||!t)return new V(NaN);if(o!=t)return e.s=-t,n.minus(e);var i=n.e/g,a=e.e/g,s=n.c,u=e.c;if(!i||!a){if(!s||!u)return new V(o/0);if(!s[0]||!u[0])return u[0]?e:new V(s[0]?n:0*o)}if(i=S(i),a=S(a),s=s.slice(),o=i-a){for(o>0?(a=i,r=u):(o=-o,r=s),r.reverse();o--;r.push(0));r.reverse()}for((o=s.length)-(t=u.length)<0&&(r=u,u=s,s=r,t=o),o=0;t;)o=(s[--t]=s[t]+u[t]+o)/m|0,s[t]=m===s[t]?0:s[t]%m;return o&&(s=[o].concat(s),++a),G(e,s,a)},R.precision=R.sd=function(e,t){var r,n,o,i=this;if(null!=e&&e!==!!e)return E(e,1,A),null==t?t=M:E(t,0,8),X(new V(i),e,t);if(!(r=i.c))return null;if(n=(o=r.length-1)*g+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},R.shiftedBy=function(e){return E(e,-9007199254740991,v),this.times("1e"+e)},R.squareRoot=R.sqrt=function(){var e,t,n,o,i,a=this,s=a.c,u=a.s,c=a.e,l=C+4,f=new V("0.5");if(1!==u||!s||!s[0])return new V(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+Z(a)))||u==1/0?(((t=k(s)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=S((c+1)/2)-(c<0||c%2),n=new V(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new V(u+""),n.c[0])for((u=(c=n.e)+l)<3&&(u=0);;)if(i=n,n=f.times(i.plus(r(a,i,l,1))),k(i.c).slice(0,u)===(t=k(n.c)).slice(0,u)){if(n.e0&&y>0){for(i=y%s||s,l=h.substr(0,i);i0&&(l+=c+h.slice(i)),d&&(l="-"+l)}n=f?l+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):l}return(r.prefix||"")+n+(r.suffix||"")},R.toFraction=function(e){var t,n,o,i,a,s,u,c,l,f,d,h,y=this,m=y.c;if(null!=e&&(!(u=new V(e)).isInteger()&&(u.c||1!==u.s)||u.lt(I)))throw Error(p+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+Z(u));if(!m)return new V(y);for(t=new V(I),l=n=new V(I),o=c=new V(I),h=k(m),a=t.e=h.length-y.e-1,t.c[0]=b[(s=a%g)<0?g+s:s],e=!e||u.comparedTo(t)>0?a>0?t:l:u,s=j,j=1/0,u=new V(h),c.c[0]=0;f=r(u,t,0,1),1!=(i=n.plus(f.times(o))).comparedTo(e);)n=o,o=i,l=c.plus(f.times(i=l)),c=i,t=u.minus(f.times(i=t)),u=i;return i=r(e.minus(n),o,0,1),c=c.plus(i.times(l)),n=n.plus(i.times(o)),c.s=l.s=y.s,d=r(l,o,a*=2,M).minus(y).abs().comparedTo(r(c,n,a,M).minus(y).abs())<1?[l,o]:[c,n],j=s,d},R.toNumber=function(){return+Z(this)},R.toPrecision=function(e,t){return null!=e&&E(e,1,A),K(this,e,t,2)},R.toString=function(e){var t,r=this,o=r.s,i=r.e;return null===i?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=i<=B||i>=N?T(k(r.c),i):P(k(r.c),i,"0"):10===e&&H?t=P(k((r=X(new V(r),C+i+1,M)).c),r.e,"0"):(E(e,2,q.length,"Base"),t=n(P(k(r.c),i,"0"),10,e,o,!0)),o<0&&r.c[0]&&(t="-"+t)),t},R.valueOf=R.toJSON=function(){return Z(this)},R._isBigNumber=!0,R[Symbol.toStringTag]="BigNumber",R[Symbol.for("nodejs.util.inspect.custom")]=R.valueOf,null!=t&&V.set(t),V}();const R=O;var I=r(4998),C=r.n(I),M=r(1950),B=r.n(M),N=r(6086),L=r(1257),j=r(4147).i8,U={},F=L.Z.create({headers:{"X-Client-Name":"js-stellar-sdk","X-Client-Version":j}});function D(e){return Math.floor(e/1e3)}F.interceptors.response.use((function(e){var t=C()(e.config.url).hostname(),r=D(Date.parse(e.headers.date)),n=D((new Date).getTime());return isNaN(r)||(U[t]={serverTime:r,localTimeRecorded:n}),e}));const z=F;function q(e){var t=U[e];if(!t||!t.localTimeRecorded||!t.serverTime)return null;var r=t.serverTime,n=t.localTimeRecorded,o=D((new Date).getTime());return o-n>300?null:o-n+r}function H(e){return H="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},H(e)}var V,K,W;function G(){G=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof g?t:g,a=Object.create(i.prototype),s=new R(n||[]);return o(a,"_invoke",{value:x(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",y="completed",m={};function g(){}function v(){}function b(){}var w={};c(w,a,(function(){return this}));var A=Object.getPrototypeOf,S=A&&A(A(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var k=b.prototype=g.prototype=Object.create(w);function _(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==H(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function x(t,r,n){var o=d;return function(i,a){if(o===p)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=T(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(t,r,n);if("normal"===c.type){if(o=n.done?y:h,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=y,n.method="throw",n.arg=c.arg)}}}function T(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function I(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function X(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Z(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){X(i,n,o,a,s,"next",e)}function s(e){X(i,n,o,a,s,"throw",e)}a(void 0)}))}}function Q(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t.clone(),this.filter=[],this.originalSegments=this.url.segment()||[],this.neighborRoot=r}var t,r,n,o;return t=e,r=[{key:"call",value:function(){var e=this;return this.checkFilter(),this._sendNormalRequest(this.url).then((function(t){return e._parseResponse(t)}))}},{key:"stream",value:function(){var e,t,r=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.checkFilter(),this.url.setQuery("X-Client-Name","js-stellar-sdk"),this.url.setQuery("X-Client-Version",j);var o=function(){t=setTimeout((function(){var t;null===(t=e)||void 0===t||t.close(),e=i()}),n.reconnectTimeout||15e3)},i=function i(){try{e=new ee(r.url.toString())}catch(e){n.onerror&&n.onerror(e)}if(o(),!e)return e;var a=!1,s=function(){a||(clearTimeout(t),e.close(),i(),a=!0)},u=function(e){if("close"!==e.type){var i=e.data?r._parseRecord(JSON.parse(e.data)):e;i.paging_token&&r.url.setQuery("cursor",i.paging_token),clearTimeout(t),o(),void 0!==n.onmessage&&n.onmessage(i)}else s()},c=function(e){n.onerror&&n.onerror(e)};return e.addEventListener?(e.addEventListener("message",u.bind(r)),e.addEventListener("error",c.bind(r)),e.addEventListener("close",s.bind(r))):(e.onmessage=u.bind(r),e.onerror=c.bind(r)),e};return i(),function(){var r;clearTimeout(t),null===(r=e)||void 0===r||r.close()}}},{key:"cursor",value:function(e){return this.url.setQuery("cursor",e),this}},{key:"limit",value:function(e){return this.url.setQuery("limit",e.toString()),this}},{key:"order",value:function(e){return this.url.setQuery("order",e),this}},{key:"join",value:function(e){return this.url.setQuery("join",e),this}},{key:"forEndpoint",value:function(e,t){if(""===this.neighborRoot)throw new Error("Invalid usage: neighborRoot not set in constructor");return this.filter.push([e,t,this.neighborRoot]),this}},{key:"checkFilter",value:function(){if(this.filter.length>=2)throw new N.oY("Too many filters specified",this.filter);if(1===this.filter.length){var e=this.originalSegments.concat(this.filter[0]);this.url.segment(e)}}},{key:"_requestFnForLink",value:function(e){var t=this;return Z(G().mark((function r(){var n,o,i,a,s=arguments;return G().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=s.length>0&&void 0!==s[0]?s[0]:{},e.templated?(i=B()(e.href),o=C()(i.expand(n))):o=C()(e.href),r.next=4,t._sendNormalRequest(o);case 4:return a=r.sent,r.abrupt("return",t._parseResponse(a));case 6:case"end":return r.stop()}}),r)})))}},{key:"_parseRecord",value:function(e){var t=this;if(!e._links)return e;for(var r=function(){var r=o[n],i=e._links[r],a=!1;if(void 0!==e[r]&&(e["".concat(r,"_attr")]=e[r],a=!0),a&&J.indexOf(r)>=0){var s=t._parseRecord(e[r]);e[r]=Z(G().mark((function e(){return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s);case 1:case"end":return e.stop()}}),e)})))}else e[r]=t._requestFnForLink(i)},n=0,o=Object.keys(e._links);nt||e>=24*r||e%r!=0)}}])&&wt(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),o}(te);function xt(e){return xt="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},xt(e)}function Tt(e,t){for(var r=0;r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Dt(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function zt(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Dt(i,n,o,a,s,"next",e)}function s(e){Dt(i,n,o,a,s,"throw",e)}a(void 0)}))}}function qt(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.serverURL=C()(t);var n=void 0===r.allowHttp?re.D.isAllowHttp():r.allowHttp,o={};if(r.appName&&(o["X-App-Name"]=r.appName),r.appVersion&&(o["X-App-Version"]=r.appVersion),r.authToken&&(o["X-Auth-Token"]=r.authToken),Object.keys(o).length>0&&z.interceptors.request.use((function(e){return e.headers=Object.assign(e.headers,o),e})),"https"!==this.serverURL.protocol()&&!n)throw new Error("Cannot connect to insecure horizon server")}var t,r,n,o,a,s,u,c;return t=e,r=[{key:"fetchTimebounds",value:(c=zt(Ft().mark((function e(t){var r,n,o=arguments;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>1&&void 0!==o[1]&&o[1],!(n=q(this.serverURL.hostname()))){e.next=4;break}return e.abrupt("return",{minTime:0,maxTime:n+t});case 4:if(!r){e.next=6;break}return e.abrupt("return",{minTime:0,maxTime:Math.floor((new Date).getTime()/1e3)+t});case 6:return e.next=8,z.get(C()(this.serverURL).toString());case 8:return e.next=10,this.fetchTimebounds(t,!0);case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"fetchBaseFee",value:(u=zt(Ft().mark((function e(){var t;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.feeStats();case 2:return t=e.sent,e.abrupt("return",parseInt(t.last_ledger_base_fee,10)||100);case 4:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"feeStats",value:(s=zt(Ft().mark((function e(){var t;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=new te(C()(this.serverURL))).filter.push(["fee_stats"]),e.abrupt("return",t.call());case 3:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"submitTransaction",value:(a=zt(Ft().mark((function e(t){var r,n=arguments;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n.length>1&&void 0!==n[1]?n[1]:{skipMemoRequiredCheck:!1}).skipMemoRequiredCheck){e.next=4;break}return e.next=4,this.checkMemoRequired(t);case 4:return r=encodeURIComponent(t.toEnvelope().toXDR().toString("base64")),e.abrupt("return",z.post(C()(this.serverURL).segment("transactions").toString(),"tx=".concat(r),{timeout:6e4}).then((function(e){if(!e.data.result_xdr)return e.data;var t,r,n=i.xdr.TransactionResult.fromXDR(e.data.result_xdr,"base64").result().value();return n.length&&(t=n.map((function(e,t){if("manageBuyOffer"!==e.value().switch().name&&"manageSellOffer"!==e.value().switch().name)return null;r=!0;var n,o=new R(0),a=new R(0),s=e.value().value().success(),u=s.offersClaimed().map((function(e){var t=e.value(),r="";switch(e.switch()){case i.xdr.ClaimAtomType.claimAtomTypeV0():r=i.StrKey.encodeEd25519PublicKey(t.sellerEd25519());break;case i.xdr.ClaimAtomType.claimAtomTypeOrderBook():r=i.StrKey.encodeEd25519PublicKey(t.sellerId().ed25519());break;default:throw new Error("Invalid offer result type: "+e.switch())}var n=new R(t.amountBought().toString()),s=new R(t.amountSold().toString());o=o.plus(s),a=a.plus(n);var u=i.Asset.fromOperation(t.assetSold()),c=i.Asset.fromOperation(t.assetBought()),l={type:u.getAssetType(),assetCode:u.getCode(),issuer:u.getIssuer()},f={type:c.getAssetType(),assetCode:c.getCode(),issuer:c.getIssuer()};return{sellerId:r,offerId:t.offerId().toString(),assetSold:l,amountSold:Vt(s),assetBought:f,amountBought:Vt(n)}})),c=s.offer().switch().name;if("function"==typeof s.offer().value&&s.offer().value()){var l=s.offer().value();n={offerId:l.offerId().toString(),selling:{},buying:{},amount:Vt(l.amount().toString()),price:{n:l.price().n(),d:l.price().d()}};var f=i.Asset.fromOperation(l.selling());n.selling={type:f.getAssetType(),assetCode:f.getCode(),issuer:f.getIssuer()};var d=i.Asset.fromOperation(l.buying());n.buying={type:d.getAssetType(),assetCode:d.getCode(),issuer:d.getIssuer()}}return{offersClaimed:u,effect:c,operationIndex:t,currentOffer:n,amountBought:Vt(o),amountSold:Vt(a),isFullyOpen:!u.length&&"manageOfferDeleted"!==c,wasPartiallyFilled:!!u.length&&"manageOfferDeleted"!==c,wasImmediatelyFilled:!!u.length&&"manageOfferDeleted"===c,wasImmediatelyDeleted:!u.length&&"manageOfferDeleted"===c}})).filter((function(e){return!!e}))),Object.assign({},e.data,{offerResults:r?t:void 0})})).catch((function(e){return e instanceof Error?Promise.reject(e):Promise.reject(new N.Fz("Transaction submission failed. Server responded: ".concat(e.status," ").concat(e.statusText),e.data))})));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"accounts",value:function(){return new ue(C()(this.serverURL))}},{key:"claimableBalances",value:function(){return new we(C()(this.serverURL))}},{key:"ledgers",value:function(){return new Le(C()(this.serverURL))}},{key:"transactions",value:function(){return new jt(C()(this.serverURL))}},{key:"offers",value:function(){return new Xe(C()(this.serverURL))}},{key:"orderbook",value:function(e,t){return new ot(C()(this.serverURL),e,t)}},{key:"trades",value:function(){return new It(C()(this.serverURL))}},{key:"operations",value:function(){return new et(C()(this.serverURL))}},{key:"liquidityPools",value:function(){return new qe(C()(this.serverURL))}},{key:"strictReceivePaths",value:function(e,t,r){return new pt(C()(this.serverURL),e,t,r)}},{key:"strictSendPaths",value:function(e,t,r){return new vt(C()(this.serverURL),e,t,r)}},{key:"payments",value:function(){return new lt(C()(this.serverURL))}},{key:"effects",value:function(){return new xe(C()(this.serverURL))}},{key:"friendbot",value:function(e){return new Re(C()(this.serverURL),e)}},{key:"assets",value:function(){return new pe(C()(this.serverURL))}},{key:"loadAccount",value:(o=zt(Ft().mark((function e(t){var r;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.accounts().accountId(t).call();case 2:return r=e.sent,e.abrupt("return",new l(r));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"tradeAggregation",value:function(e,t,r,n,o,i){return new Et(C()(this.serverURL),e,t,r,n,o,i)}},{key:"checkMemoRequired",value:(n=zt(Ft().mark((function e(t){var r,n,o,a;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t instanceof i.FeeBumpTransaction&&(t=t.innerTransaction),"none"===t.memo.type){e.next=3;break}return e.abrupt("return");case 3:r=new Set,n=0;case 5:if(!(n{"use strict";r.r(t),r.d(t,{AccountRequiresMemoError:()=>n.hs,BadRequestError:()=>n.oY,BadResponseError:()=>n.Fz,Config:()=>o.D,ContractSpec:()=>d.o,Federation:()=>s,Friendbot:()=>c,Horizon:()=>l,NetworkError:()=>n.F7,NotFoundError:()=>n.dR,SorobanRpc:()=>f,StellarToml:()=>a,Utils:()=>i.c,WebAuth:()=>u,default:()=>y});var n=r(6086),o=r(7939),i=r(1557),a=r(4700),s=r(2761),u=r(273),c=r(197),l=r(6881),f=r(8491),d=r(936),h=r(4172),p={};for(const m in h)["default","Config","Utils","StellarToml","Federation","WebAuth","Friendbot","Horizon","SorobanRpc","ContractSpec","AccountRequiresMemoError","BadRequestError","BadResponseError","NetworkError","NotFoundError"].indexOf(m)<0&&(p[m]=()=>h[m]);r.d(t,p);const y=(e=r.hmd(e)).exports},8491:(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{Api:()=>n,AxiosClient:()=>c,Durability:()=>F,Server:()=>D,assembleTransaction:()=>T,default:()=>q,parseRawEvents:()=>_,parseRawSimulation:()=>x}),function(e){var t=function(e){return e.SUCCESS="SUCCESS",e.NOT_FOUND="NOT_FOUND",e.FAILED="FAILED",e}({});function r(e){return"transactionData"in e}e.GetTransactionStatus=t,e.isSimulationError=function(e){return"error"in e},e.isSimulationSuccess=r,e.isSimulationRestore=function(e){return r(e)&&"restorePreamble"in e&&!!e.restorePreamble.transactionData},e.isSimulationRaw=function(e){return!e._parsed}}(n||(n={}));var o=r(4998),i=r.n(o),a=r(4172),s=r(1257),u=r(4147).i8;const c=s.Z.create({headers:{"X-Client-Name":"js-soroban-client","X-Client-Version":u}});function l(e){return l="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},l(e)}function f(){f=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:P(e,r,s)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var p="suspendedStart",y="suspendedYield",m="executing",g="completed",v={};function b(){}function w(){}function A(){}var S={};c(S,a,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(M([])));_&&_!==r&&n.call(_,a)&&(S=_);var E=A.prototype=b.prototype=Object.create(S);function x(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,a,s){var u=h(e[o],e,i);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==l(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function P(t,r,n){var o=p;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=O(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=h(t,r,n);if("normal"===c.type){if(o=n.done?g:y,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.arg)}}}function O(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=h(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function M(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:M(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function d(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function h(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){d(i,n,o,a,s,"next",e)}function s(e){d(i,n,o,a,s,"throw",e)}a(void 0)}))}}function p(e,t){return y.apply(this,arguments)}function y(){return y=h(f().mark((function e(t,r){var n,o,i,a,s,u=arguments;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n=u.length,o=new Array(n>2?n-2:0),i=2;i0?l:o.result.auth}))}return u}function P(e){return P="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},P(e)}function O(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return R(e,t);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)?R(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),R(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:C(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function N(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function L(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){N(i,n,o,a,s,"next",e)}function s(e){N(i,n,o,a,s,"throw",e)}a(void 0)}))}}function j(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.serverURL=i()(t),r.headers&&0===Object.keys(r.headers).length&&c.interceptors.request.use((function(e){return e.headers=Object.assign(e.headers,r.headers),e})),"https"!==this.serverURL.protocol()&&!r.allowHttp)throw new Error("Cannot connect to insecure Soroban RPC server if `allowHttp` isn't set")}var t,r,o,s,u,l,f,d,h,y,g,v,b,w,A,S,P,O,R;return t=e,r=[{key:"getAccount",value:(R=L(B().mark((function e(t){var r,n,o;return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.xdr.LedgerKey.account(new a.xdr.LedgerKeyAccount({accountId:a.Keypair.fromPublicKey(t).xdrPublicKey()})),e.next=3,this.getLedgerEntries(r);case 3:if(0!==(n=e.sent).entries.length){e.next=6;break}return e.abrupt("return",Promise.reject({code:404,message:"Account not found: ".concat(t)}));case 6:return o=n.entries[0].val.account(),e.abrupt("return",new a.Account(t,o.seqNum().toString()));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return R.apply(this,arguments)})},{key:"getHealth",value:(O=L(B().mark((function e(){return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p(this.serverURL.toString(),"getHealth"));case 1:case"end":return e.stop()}}),e,this)}))),function(){return O.apply(this,arguments)})},{key:"getContractData",value:(P=L(B().mark((function e(t,r){var n,o,i,s,u=arguments;return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=u.length>2&&void 0!==u[2]?u[2]:F.Persistent,"string"!=typeof t){e.next=5;break}o=new a.Contract(t).address().toScAddress(),e.next=14;break;case 5:if(!(t instanceof a.Address)){e.next=9;break}o=t.toScAddress(),e.next=14;break;case 9:if(!(t instanceof a.Contract)){e.next=13;break}o=t.address().toScAddress(),e.next=14;break;case 13:throw new TypeError("unknown contract type: ".concat(t));case 14:e.t0=n,e.next=e.t0===F.Temporary?17:e.t0===F.Persistent?19:21;break;case 17:return i=a.xdr.ContractDataDurability.temporary(),e.abrupt("break",22);case 19:return i=a.xdr.ContractDataDurability.persistent(),e.abrupt("break",22);case 21:throw new TypeError("invalid durability: ".concat(n));case 22:return s=a.xdr.LedgerKey.contractData(new a.xdr.LedgerKeyContractData({key:r,contract:o,durability:i})),e.abrupt("return",this.getLedgerEntries(s).then((function(e){return 0===e.entries.length?Promise.reject({code:404,message:"Contract data not found. Contract: ".concat(a.Address.fromScAddress(o).toString(),", Key: ").concat(r.toXDR("base64"),", Durability: ").concat(n)}):e.entries[0]})));case 24:case"end":return e.stop()}}),e,this)}))),function(e,t){return P.apply(this,arguments)})},{key:"getLedgerEntries",value:(S=L(B().mark((function e(){var t=arguments;return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._getLedgerEntries.apply(this,t).then(E));case 1:case"end":return e.stop()}}),e,this)}))),function(){return S.apply(this,arguments)})},{key:"_getLedgerEntries",value:(A=L(B().mark((function e(){var t,r,n,o=arguments;return B().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=o.length,r=new Array(t),n=0;n{"use strict";r.r(t),r.d(t,{Api:()=>{},Resolver:()=>p,STELLAR_TOML_MAX_SIZE:()=>d});var n=r(1257),o=r(5424),i=r.n(o),a=r(7939);function s(e){return s="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},s(e)}function u(){u=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:P(e,r,s)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var p="suspendedStart",y="suspendedYield",m="executing",g="completed",v={};function b(){}function w(){}function A(){}var S={};f(S,a,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(M([])));_&&_!==r&&n.call(_,a)&&(S=_);var E=A.prototype=b.prototype=Object.create(S);function x(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,a,u){var c=h(e[o],e,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==s(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function P(t,r,n){var o=p;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=O(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=h(t,r,n);if("normal"===c.type){if(o=n.done?g:y,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.arg)}}}function O(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=h(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function M(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:M(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function c(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function l(e,t){for(var r=0;r1&&void 0!==l[1]?l[1]:{}).allowHttp?a.D.isAllowHttp():r.allowHttp,s=void 0===r.timeout?a.D.getTimeout():r.timeout,c=o?"http":"https",e.abrupt("return",n.Z.get("".concat(c,"://").concat(t,"/.well-known/stellar.toml"),{maxContentLength:d,cancelToken:s?new h((function(e){return setTimeout((function(){return e("timeout of ".concat(s,"ms exceeded"))}),s)})):void 0,timeout:s}).then((function(e){try{var t=i().parse(e.data);return Promise.resolve(t)}catch(e){return Promise.reject(new Error("stellar.toml is invalid - Parsing error on line ".concat(e.line,", column ").concat(e.column,": ").concat(e.message)))}})).catch((function(e){throw e.message.match(/^maxContentLength size/)?new Error("stellar.toml file exceeds allowed size of ".concat(d)):e})));case 5:case"end":return e.stop()}}),e)})),s=function(){var e=this,t=arguments;return new Promise((function(r,n){var i=o.apply(e,t);function a(e){c(i,r,n,a,s,"next",e)}function s(e){c(i,r,n,a,s,"throw",e)}a(void 0)}))},function(e){return s.apply(this,arguments)})}],r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},1557:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}function o(e,t){for(var r=0;ra});var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r;return t=e,r=[{key:"validateTimebounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!e.timeBounds)return!1;var r=Math.floor(Date.now()/1e3),n=e.timeBounds,o=n.minTime,i=n.maxTime;return r>=Number.parseInt(o,10)-t&&r<=Number.parseInt(i,10)+t}}],r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},273:(e,t,r)=>{"use strict";r.r(t),r.d(t,{InvalidChallengeError:()=>h,buildChallengeTx:()=>S,gatherTxSigners:()=>T,readChallengeTx:()=>k,verifyChallengeTxSigners:()=>E,verifyChallengeTxThreshold:()=>_,verifyTxSignedBy:()=>x});var n=r(1798),o=r.n(n),i=r(4172),a=r(1557);function s(e){return s="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},s(e)}function u(e){var t="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return c(e,arguments,d(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),f(r,e)},u(e)}function c(e,t,r){return c=l()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&f(o,r.prototype),o},c.apply(null,arguments)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(n,e);var t,r=function(e){var t=l();return function(){var r,n=d(e);if(t){var o=d(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}(n);function n(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var o=(this instanceof n?this.constructor:void 0).prototype;return(t=r.call(this,e)).__proto__=o,t.constructor=n,t.name="InvalidChallengeError",t}return t=n,Object.defineProperty(t,"prototype",{writable:!1}),t}(u(Error)),p=r(8764).Buffer;function y(e){return function(e){if(Array.isArray(e))return w(e)}(e)||A(e)||b(e)||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.")}()}function m(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=b(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function g(e){return g="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},g(e)}function v(e){return function(e){if(Array.isArray(e))return e}(e)||A(e)||b(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){if(e){if("string"==typeof e)return w(e,t);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)?w(e,t):void 0}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r3&&void 0!==arguments[3]?arguments[3]:300,a=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null;if(t.startsWith("M")&&u)throw Error("memo cannot be used if clientAccountID is a muxed account");var f=new i.Account(e.publicKey(),"-1"),d=Math.floor(Date.now()/1e3),h=o()(48).toString("base64"),p=new i.TransactionBuilder(f,{fee:i.BASE_FEE,networkPassphrase:a,timebounds:{minTime:d,maxTime:d+n}}).addOperation(i.Operation.manageData({name:"".concat(r," auth"),value:h,source:t})).addOperation(i.Operation.manageData({name:"web_auth_domain",value:s,source:f.accountId()}));if(c){if(!l)throw Error("clientSigningKey is required if clientDomain is provided");p.addOperation(i.Operation.manageData({name:"client_domain",value:c,source:l}))}u&&p.addMemo(i.Memo.id(u));var y=p.build();return y.sign(e),y.toEnvelope().toXDR("base64").toString()}function k(e,t,r,n,o){var s,u;if(t.startsWith("M"))throw Error("Invalid serverAccountID: multiplexed accounts are not supported.");try{u=new i.Transaction(e,r)}catch(t){try{u=new i.FeeBumpTransaction(e,r)}catch(e){throw new h("Invalid challenge: unable to deserialize challengeTx transaction string")}throw new h("Invalid challenge: expected a Transaction but received a FeeBumpTransaction")}if(0!==Number.parseInt(u.sequence,10))throw new h("The transaction sequence number should be zero");if(u.source!==t)throw new h("The transaction source account is not equal to the server's account");if(u.operations.length<1)throw new h("The transaction should contain at least one operation");var c=v(u.operations),l=c[0],f=c.slice(1);if(!l.source)throw new h("The transaction's operation should contain a source account");var d,y=l.source,b=null;if(u.memo.type!==i.MemoNone){if(y.startsWith("M"))throw new h("The transaction has a memo but the client account ID is a muxed account");if(u.memo.type!==i.MemoID)throw new h("The transaction's memo must be of type `id`");b=u.memo.value}if("manageData"!==l.type)throw new h("The transaction's operation type should be 'manageData'");if(u.timeBounds&&Number.parseInt(null===(s=u.timeBounds)||void 0===s?void 0:s.maxTime,10)===i.TimeoutInfinite)throw new h("The transaction requires non-infinite timebounds");if(!a.c.validateTimebounds(u,300))throw new h("The transaction has expired");if(void 0===l.value)throw new h("The transaction's operation values should not be null");if(!l.value)throw new h("The transaction's operation value should not be null");if(48!==p.from(l.value.toString(),"base64").length)throw new h("The transaction's operation value should be a 64 bytes base64 random string");if(!n)throw new h("Invalid homeDomains: a home domain must be provided for verification");if("string"==typeof n)"".concat(n," auth")===l.name&&(d=n);else{if(!Array.isArray(n))throw new h("Invalid homeDomains: homeDomains type is ".concat(g(n)," but should be a string or an array"));d=n.find((function(e){return"".concat(e," auth")===l.name}))}if(!d)throw new h("Invalid homeDomains: the transaction's operation key name does not match the expected home domain");var w,A=m(f);try{for(A.s();!(w=A.n()).done;){var S=w.value;if("manageData"!==S.type)throw new h("The transaction has operations that are not of type 'manageData'");if(S.source!==t&&"client_domain"!==S.name)throw new h("The transaction has operations that are unrecognized");if("web_auth_domain"===S.name){if(void 0===S.value)throw new h("'web_auth_domain' operation value should not be null");if(S.value.compare(p.from(o)))throw new h("'web_auth_domain' operation value does not match ".concat(o))}}}catch(e){A.e(e)}finally{A.f()}if(!x(u,t))throw new h("Transaction not signed by server: '".concat(t,"'"));return{tx:u,clientAccountID:y,matchedHomeDomain:d,memo:b}}function _(e,t,r,n,o,i,a){for(var s=E(e,t,r,o.map((function(e){return e.key})),i,a),u=0,c=function(){var e,t=f[l],r=(null===(e=o.find((function(e){return e.key===t})))||void 0===e?void 0:e.weight)||0;u+=r},l=0,f=s;l{"use strict";var r=function(e,t){return t||(t={}),e.split("").forEach((function(e,r){e in t||(t[e]=r)})),t},n={alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",charmap:{0:14,1:8}};n.charmap=r(n.alphabet,n.charmap);var o={alphabet:"0123456789ABCDEFGHJKMNPQRSTVWXYZ",charmap:{O:0,I:1,L:1}};o.charmap=r(o.alphabet,o.charmap);var i={alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",charmap:{}};function a(e){if(this.buf=[],this.shift=8,this.carry=0,e){switch(e.type){case"rfc4648":this.charmap=t.rfc4648.charmap;break;case"crockford":this.charmap=t.crockford.charmap;break;case"base32hex":this.charmap=t.base32hex.charmap;break;default:throw new Error("invalid type")}e.charmap&&(this.charmap=e.charmap)}}function s(e){if(this.buf="",this.shift=3,this.carry=0,e){switch(e.type){case"rfc4648":this.alphabet=t.rfc4648.alphabet;break;case"crockford":this.alphabet=t.crockford.alphabet;break;case"base32hex":this.alphabet=t.base32hex.alphabet;break;default:throw new Error("invalid type")}e.alphabet?this.alphabet=e.alphabet:e.lc&&(this.alphabet=this.alphabet.toLowerCase())}}i.charmap=r(i.alphabet,i.charmap),a.prototype.charmap=n.charmap,a.prototype.write=function(e){var t=this.charmap,r=this.buf,n=this.shift,o=this.carry;return e.toUpperCase().split("").forEach((function(e){if("="!=e){var i=255&t[e];(n-=5)>0?o|=i<>-n),o=i<<(n+=8)&255):(r.push(o|i),n=8,o=0)}})),this.shift=n,this.carry=o,this},a.prototype.finalize=function(e){return e&&this.write(e),8!==this.shift&&0!==this.carry&&(this.buf.push(this.carry),this.shift=8,this.carry=0),this.buf},s.prototype.alphabet=n.alphabet,s.prototype.write=function(e){var t,r,n,o=this.shift,i=this.carry;for(n=0;n>o,this.buf+=this.alphabet[31&t],o>5&&(t=r>>(o-=5),this.buf+=this.alphabet[31&t]),i=r<<(o=5-o),o=8-o;return this.shift=o,this.carry=i,this},s.prototype.finalize=function(e){return e&&this.write(e),3!==this.shift&&(this.buf+=this.alphabet[31&this.carry],this.shift=3,this.carry=0),this.buf},t.encode=function(e,t){return new s(t).finalize(e)},t.decode=function(e,t){return new a(t).finalize(e)},t.Decoder=a,t.Encoder=s,t.charmap=r,t.crockford=o,t.rfc4648=n,t.base32hex=i},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],u=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),l=0,f=u>0?a-4:a;for(r=0;r>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,c=n-o;sc?c:s+a));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var o,i,a=[],s=t;s>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},4431:function(e,t,r){var n;!function(o){"use strict";var i,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,u=Math.floor,c="[BigNumber Error] ",l=c+"Number primitive has more than 15 significant digits: ",f=1e14,d=14,h=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],y=1e7,m=1e9;function g(e){var t=0|e;return e>0||e===t?t:t-1}function v(e){for(var t,r,n=1,o=e.length,i=e[0]+"";nc^r?1:-1;for(s=(u=o.length)<(c=i.length)?u:c,a=0;ai[a]^r?1:-1;return u==c?0:u>c^r?1:-1}function w(e,t,r,n){if(er||e!==u(e))throw Error(c+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function A(e){var t=e.c.length-1;return g(e.e/d)==t&&e.c[t]%2!=0}function S(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function k(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else tj?g.c=g.e=null:e.e=10;f/=10,c++);return void(c>j?g.c=g.e=null:(g.e=c,g.c=[e]))}m=String(e)}else{if(!a.test(m=String(e)))return o(g,m,p);g.s=45==m.charCodeAt(0)?(m=m.slice(1),-1):1}(c=m.indexOf("."))>-1&&(m=m.replace(".","")),(f=m.search(/e/i))>0?(c<0&&(c=f),c+=+m.slice(f+1),m=m.substring(0,f)):c<0&&(c=m.length)}else{if(w(t,2,q.length,"Base"),10==t&&H)return X(g=new V(e),C+g.e+1,M);if(m=String(e),p="number"==typeof e){if(0*e!=0)return o(g,m,p,t);if(g.s=1/e<0?(m=m.slice(1),-1):1,V.DEBUG&&m.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else g.s=45===m.charCodeAt(0)?(m=m.slice(1),-1):1;for(r=q.slice(0,t),c=f=0,y=m.length;fc){c=y;continue}}else if(!s&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){s=!0,f=-1,c=0;continue}return o(g,String(e),p,t)}p=!1,(c=(m=n(m,t,10,g.s)).indexOf("."))>-1?m=m.replace(".",""):c=m.length}for(f=0;48===m.charCodeAt(f);f++);for(y=m.length;48===m.charCodeAt(--y););if(m=m.slice(f,++y)){if(y-=f,p&&V.DEBUG&&y>15&&(e>h||e!==u(e)))throw Error(l+g.s*e);if((c=c-f-1)>j)g.c=g.e=null;else if(c=N)?S(u,a):k(u,a,"0");else if(i=(e=X(new V(e),t,r)).e,s=(u=v(e.c)).length,1==n||2==n&&(t<=i||i<=B)){for(;ss){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=i-s)>0)for(i+1==s&&(u+=".");t--;u+="0");return e.s<0&&o?"-"+u:u}function W(e,t){for(var r,n,o=1,i=new V(e[0]);o=10;o/=10,n++);return(r=n+r*d-1)>j?e.c=e.e=null:r=10;c/=10,o++);if((i=t-o)<0)i+=d,a=t,l=m[h=0],y=u(l/g[o-a-1]%10);else if((h=s((i+1)/d))>=m.length){if(!n)break e;for(;m.length<=h;m.push(0));l=y=0,o=1,a=(i%=d)-d+1}else{for(l=c=m[h],o=1;c>=10;c/=10,o++);y=(a=(i%=d)-d+o)<0?0:u(l/g[o-a-1]%10)}if(n=n||t<0||null!=m[h+1]||(a<0?l:l%g[o-a-1]),n=r<4?(y||n)&&(0==r||r==(e.s<0?3:2)):y>5||5==y&&(4==r||n||6==r&&(i>0?a>0?l/g[o-a]:0:m[h-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,n?(t-=e.e+1,m[0]=g[(d-t%d)%d],e.e=-t||0):m[0]=e.e=0,e;if(0==i?(m.length=h,c=1,h--):(m.length=h+1,c=g[d-i],m[h]=a>0?u(l/g[o-a]%g[a])*c:0),n)for(;;){if(0==h){for(i=1,a=m[0];a>=10;a/=10,i++);for(a=m[0]+=c,c=1;a>=10;a/=10,c++);i!=c&&(e.e++,m[0]==f&&(m[0]=1));break}if(m[h]+=c,m[h]!=f)break;m[h--]=0,c=1}for(i=m.length;0===m[--i];m.pop());}e.e>j?e.c=e.e=null:e.e=N?S(t,r):k(t,r,"0"),e.s<0?"-"+t:t)}return V.clone=e,V.ROUND_UP=0,V.ROUND_DOWN=1,V.ROUND_CEIL=2,V.ROUND_FLOOR=3,V.ROUND_HALF_UP=4,V.ROUND_HALF_DOWN=5,V.ROUND_HALF_EVEN=6,V.ROUND_HALF_CEIL=7,V.ROUND_HALF_FLOOR=8,V.EUCLID=9,V.config=V.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(w(r=e[t],0,m,t),C=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(w(r=e[t],0,8,t),M=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(w(r[0],-m,0,t),w(r[1],0,m,t),B=r[0],N=r[1]):(w(r,-m,m,t),B=-(N=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)w(r[0],-m,-1,t),w(r[1],1,m,t),L=r[0],j=r[1];else{if(w(r,-m,m,t),!r)throw Error(c+t+" cannot be zero: "+r);L=-(j=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(c+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(c+"crypto unavailable");U=r}else U=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(w(r=e[t],0,9,t),F=r),e.hasOwnProperty(t="POW_PRECISION")&&(w(r=e[t],0,m,t),D=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(c+t+" not an object: "+r);z=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);H="0123456789"==r.slice(0,10),q=r}}return{DECIMAL_PLACES:C,ROUNDING_MODE:M,EXPONENTIAL_AT:[B,N],RANGE:[L,j],CRYPTO:U,MODULO_MODE:F,POW_PRECISION:D,FORMAT:z,ALPHABET:q}},V.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!V.DEBUG)return!0;var t,r,n=e.c,o=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&o>=-m&&o<=m&&o===u(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%d)<1&&(t+=d),String(n[0]).length==t){for(t=0;t=f||r!==u(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(c+"Invalid BigNumber: "+e)},V.maximum=V.max=function(){return W(arguments,-1)},V.minimum=V.min=function(){return W(arguments,1)},V.random=(i=9007199254740992,_=Math.random()*i&2097151?function(){return u(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,i,a=0,l=[],f=new V(I);if(null==e?e=C:w(e,0,m),o=s(e/d),U)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));a>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[a]=r[0],t[a+1]=r[1]):(l.push(i%1e14),a+=2);a=o/2}else{if(!crypto.randomBytes)throw U=!1,Error(c+"crypto unavailable");for(t=crypto.randomBytes(o*=7);a=9e15?crypto.randomBytes(7).copy(t,a):(l.push(i%1e14),a+=7);a=o/7}if(!U)for(;a=10;i/=10,a++);ar-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/r|0,a[o]%=r)}return a.reverse()}return function(n,o,i,a,s){var u,c,l,f,d,h,p,y,m=n.indexOf("."),g=C,b=M;for(m>=0&&(f=D,D=0,n=n.replace(".",""),h=(y=new V(o)).pow(n.length-m),D=f,y.c=t(k(v(h.c),h.e,"0"),10,i,e),y.e=y.c.length),l=f=(p=t(n,o,i,s?(u=q,e):(u=e,q))).length;0==p[--f];p.pop());if(!p[0])return u.charAt(0);if(m<0?--l:(h.c=p,h.e=l,h.s=a,p=(h=r(h,y,g,b,i)).c,d=h.r,l=h.e),m=p[c=l+g+1],f=i/2,d=d||c<0||null!=p[c+1],d=b<4?(null!=m||d)&&(0==b||b==(h.s<0?3:2)):m>f||m==f&&(4==b||d||6==b&&1&p[c-1]||b==(h.s<0?8:7)),c<1||!p[0])n=d?k(u.charAt(1),-g,u.charAt(0)):u.charAt(0);else{if(p.length=c,d)for(--i;++p[--c]>i;)p[c]=0,c||(++l,p=[1].concat(p));for(f=p.length;!p[--f];);for(m=0,n="";m<=f;n+=u.charAt(p[m++]));n=k(n,l,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,o,i,a,s=0,u=e.length,c=t%y,l=t/y|0;for(e=e.slice();u--;)s=((o=c*(i=e[u]%y)+(n=l*i+(a=e[u]/y|0)*c)%y*y+s)/r|0)+(n/y|0)+l*a,e[u]=o%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var o,i;if(r!=n)i=r>n?1:-1;else for(o=i=0;ot[o]?1:-1;break}return i}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]1;e.splice(0,1));}return function(n,o,i,a,s){var c,l,h,p,y,m,v,b,w,A,S,k,_,E,x,T,P,O=n.s==o.s?1:-1,R=n.c,I=o.c;if(!(R&&R[0]&&I&&I[0]))return new V(n.s&&o.s&&(R?!I||R[0]!=I[0]:I)?R&&0==R[0]||!I?0*O:O/0:NaN);for(w=(b=new V(O)).c=[],O=i+(l=n.e-o.e)+1,s||(s=f,l=g(n.e/d)-g(o.e/d),O=O/d|0),h=0;I[h]==(R[h]||0);h++);if(I[h]>(R[h]||0)&&l--,O<0)w.push(1),p=!0;else{for(E=R.length,T=I.length,h=0,O+=2,(y=u(s/(I[0]+1)))>1&&(I=e(I,y,s),R=e(R,y,s),T=I.length,E=R.length),_=T,S=(A=R.slice(0,T)).length;S=s/2&&x++;do{if(y=0,(c=t(I,A,T,S))<0){if(k=A[0],T!=S&&(k=k*s+(A[1]||0)),(y=u(k/x))>1)for(y>=s&&(y=s-1),v=(m=e(I,y,s)).length,S=A.length;1==t(m,A,v,S);)y--,r(m,T=10;O/=10,h++);X(b,i+(b.e=h+l*d-1)+1,a,p)}else b.e=l,b.r=+p;return b}}(),E=/^(-?)0([xbo])(?=\w[\w.]*$)/i,x=/^([^.]+)\.$/,T=/^\.([^.]+)$/,P=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(e,t,r,n){var o,i=r?t:t.replace(O,"");if(P.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(E,(function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t})),n&&(o=n,i=i.replace(x,"$1").replace(T,"0.$1")),t!=i))return new V(i,o);if(V.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},R.absoluteValue=R.abs=function(){var e=new V(this);return e.s<0&&(e.s=1),e},R.comparedTo=function(e,t){return b(this,new V(e,t))},R.decimalPlaces=R.dp=function(e,t){var r,n,o,i=this;if(null!=e)return w(e,0,m),null==t?t=M:w(t,0,8),X(new V(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((o=r.length-1)-g(this.e/d))*d,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},R.dividedBy=R.div=function(e,t){return r(this,new V(e,t),C,M)},R.dividedToIntegerBy=R.idiv=function(e,t){return r(this,new V(e,t),0,1)},R.exponentiatedBy=R.pow=function(e,t){var r,n,o,i,a,l,f,h,p=this;if((e=new V(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+Z(e));if(null!=t&&(t=new V(t)),a=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new V(Math.pow(+Z(p),a?e.s*(2-A(e)):+Z(e))),t?h.mod(t):h;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new V(NaN);(n=!l&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||a&&p.c[1]>=24e7:p.c[0]<8e13||a&&p.c[0]<=9999975e7)))return i=p.s<0&&A(e)?-0:0,p.e>-1&&(i=1/i),new V(l?1/i:i);D&&(i=s(D/d+2))}for(a?(r=new V(.5),l&&(e.s=1),f=A(e)):f=(o=Math.abs(+Z(e)))%2,h=new V(I);;){if(f){if(!(h=h.times(p)).c)break;i?h.c.length>i&&(h.c.length=i):n&&(h=h.mod(t))}if(o){if(0===(o=u(o/2)))break;f=o%2}else if(X(e=e.times(r),e.e+1,1),e.e>14)f=A(e);else{if(0===(o=+Z(e)))break;f=o%2}p=p.times(p),i?p.c&&p.c.length>i&&(p.c.length=i):n&&(p=p.mod(t))}return n?h:(l&&(h=I.div(h)),t?h.mod(t):i?X(h,D,M,void 0):h)},R.integerValue=function(e){var t=new V(this);return null==e?e=M:w(e,0,8),X(t,t.e+1,e)},R.isEqualTo=R.eq=function(e,t){return 0===b(this,new V(e,t))},R.isFinite=function(){return!!this.c},R.isGreaterThan=R.gt=function(e,t){return b(this,new V(e,t))>0},R.isGreaterThanOrEqualTo=R.gte=function(e,t){return 1===(t=b(this,new V(e,t)))||0===t},R.isInteger=function(){return!!this.c&&g(this.e/d)>this.c.length-2},R.isLessThan=R.lt=function(e,t){return b(this,new V(e,t))<0},R.isLessThanOrEqualTo=R.lte=function(e,t){return-1===(t=b(this,new V(e,t)))||0===t},R.isNaN=function(){return!this.s},R.isNegative=function(){return this.s<0},R.isPositive=function(){return this.s>0},R.isZero=function(){return!!this.c&&0==this.c[0]},R.minus=function(e,t){var r,n,o,i,a=this,s=a.s;if(t=(e=new V(e,t)).s,!s||!t)return new V(NaN);if(s!=t)return e.s=-t,a.plus(e);var u=a.e/d,c=e.e/d,l=a.c,h=e.c;if(!u||!c){if(!l||!h)return l?(e.s=-t,e):new V(h?a:NaN);if(!l[0]||!h[0])return h[0]?(e.s=-t,e):new V(l[0]?a:3==M?-0:0)}if(u=g(u),c=g(c),l=l.slice(),s=u-c){for((i=s<0)?(s=-s,o=l):(c=u,o=h),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(n=(i=(s=l.length)<(t=h.length))?s:t,s=t=0;t0)for(;t--;l[r++]=0);for(t=f-1;n>s;){if(l[--n]=0;){for(r=0,p=k[o]%w,m=k[o]/w|0,i=o+(a=u);i>o;)r=((c=p*(c=S[--a]%w)+(s=m*c+(l=S[a]/w|0)*p)%w*w+v[i]+r)/b|0)+(s/w|0)+m*l,v[i--]=c%b;v[i]=r}return r?++n:v.splice(0,1),G(e,v,n)},R.negated=function(){var e=new V(this);return e.s=-e.s||null,e},R.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new V(e,t)).s,!o||!t)return new V(NaN);if(o!=t)return e.s=-t,n.minus(e);var i=n.e/d,a=e.e/d,s=n.c,u=e.c;if(!i||!a){if(!s||!u)return new V(o/0);if(!s[0]||!u[0])return u[0]?e:new V(s[0]?n:0*o)}if(i=g(i),a=g(a),s=s.slice(),o=i-a){for(o>0?(a=i,r=u):(o=-o,r=s),r.reverse();o--;r.push(0));r.reverse()}for((o=s.length)-(t=u.length)<0&&(r=u,u=s,s=r,t=o),o=0;t;)o=(s[--t]=s[t]+u[t]+o)/f|0,s[t]=f===s[t]?0:s[t]%f;return o&&(s=[o].concat(s),++a),G(e,s,a)},R.precision=R.sd=function(e,t){var r,n,o,i=this;if(null!=e&&e!==!!e)return w(e,1,m),null==t?t=M:w(t,0,8),X(new V(i),e,t);if(!(r=i.c))return null;if(n=(o=r.length-1)*d+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},R.shiftedBy=function(e){return w(e,-9007199254740991,h),this.times("1e"+e)},R.squareRoot=R.sqrt=function(){var e,t,n,o,i,a=this,s=a.c,u=a.s,c=a.e,l=C+4,f=new V("0.5");if(1!==u||!s||!s[0])return new V(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+Z(a)))||u==1/0?(((t=v(s)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=g((c+1)/2)-(c<0||c%2),n=new V(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new V(u+""),n.c[0])for((u=(c=n.e)+l)<3&&(u=0);;)if(i=n,n=f.times(i.plus(r(a,i,l,1))),v(i.c).slice(0,u)===(t=v(n.c)).slice(0,u)){if(n.e0&&y>0){for(i=y%s||s,f=p.substr(0,i);i0&&(f+=l+p.slice(i)),h&&(f="-"+f)}n=d?f+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?d.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):f}return(r.prefix||"")+n+(r.suffix||"")},R.toFraction=function(e){var t,n,o,i,a,s,u,l,f,h,y,m,g=this,b=g.c;if(null!=e&&(!(u=new V(e)).isInteger()&&(u.c||1!==u.s)||u.lt(I)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+Z(u));if(!b)return new V(g);for(t=new V(I),f=n=new V(I),o=l=new V(I),m=v(b),a=t.e=m.length-g.e-1,t.c[0]=p[(s=a%d)<0?d+s:s],e=!e||u.comparedTo(t)>0?a>0?t:f:u,s=j,j=1/0,u=new V(m),l.c[0]=0;h=r(u,t,0,1),1!=(i=n.plus(h.times(o))).comparedTo(e);)n=o,o=i,f=l.plus(h.times(i=f)),l=i,t=u.minus(h.times(i=t)),u=i;return i=r(e.minus(n),o,0,1),l=l.plus(i.times(f)),n=n.plus(i.times(o)),l.s=f.s=g.s,y=r(f,o,a*=2,M).minus(g).abs().comparedTo(r(l,n,a,M).minus(g).abs())<1?[f,o]:[l,n],j=s,y},R.toNumber=function(){return+Z(this)},R.toPrecision=function(e,t){return null!=e&&w(e,1,m),K(this,e,t,2)},R.toString=function(e){var t,r=this,o=r.s,i=r.e;return null===i?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=i<=B||i>=N?S(v(r.c),i):k(v(r.c),i,"0"):10===e&&H?t=k(v((r=X(new V(r),C+i+1,M)).c),r.e,"0"):(w(e,2,q.length,"Base"),t=n(k(v(r.c),i,"0"),10,e,o,!0)),o<0&&r.c[0]&&(t="-"+t)),t},R.valueOf=R.toJSON=function(){return Z(this)},R._isBigNumber=!0,null!=t&&V.set(t),V}(),i.default=i.BigNumber=i,void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}()},8764:(e,t,r)=>{"use strict";const n=r(9742),o=r(645),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=s(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const o=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Q(e.length)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),s(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=s(t);for(let n=0;n=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(o)return n?-1:W(e).length;t=(""+t).toLowerCase(),o=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,o){let i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;is&&(r=s-u),i=r;i>=0;i--){let r=!0;for(let n=0;no&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(i=u));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),c=this.slice(n,o),l=e.slice(t,r);for(let u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function P(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;on)&&(r=n);let o="";for(let i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,r,n,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function B(e,t,r,n,o){q(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function N(e,t,r,n,o){q(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function L(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,n,i){return t=+t,r>>>=0,i||L(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||L(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=J((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i=o&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=J((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||C(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||M(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i>>=0,r>>>=0,n||M(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=J((function(e){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=J((function(e){return N(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o>>=0,!n){const n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=J((function(e){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=J((function(e){return N(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function q(e,t,r,n,o,i){if(e>r||e3?0===t||t===BigInt(0)?">= 0".concat(n," and < 2").concat(n," ** ").concat(8*(i+1)).concat(n):">= -(2".concat(n," ** ").concat(8*(i+1)-1).concat(n,") and < 2 ** ").concat(8*(i+1)-1).concat(n):">= ".concat(t).concat(n," and <= ").concat(r).concat(n),new F.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,o,i)}function H(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(typeof t)}),TypeError),D("ERR_OUT_OF_RANGE",(function(e,t,r){let n='The value of "'.concat(e,'" is out of range.'),o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=z(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=z(o)),o+="n"),n+=" It must be ".concat(t,". Received ").concat(o),n}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function W(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function X(e,t,r,n){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function J(e){return"undefined"==typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},584:e=>{e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},1924:(e,t,r)=>{"use strict";var n=r(210),o=r(5559),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},5559:(e,t,r)=>{"use strict";var n=r(8612),o=r(210),i=r(7771),a=o("%TypeError%"),s=o("%Function.prototype.apply%"),u=o("%Function.prototype.call%"),c=o("%Reflect.apply%",!0)||n.call(u,s),l=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){if("function"!=typeof e)throw new a("a function is required");var t=c(n,u,arguments);return i(t,1+f(0,e.length-(arguments.length-1)),!0)};var d=function(){return c(n,s,arguments)};l?l(e.exports,"apply",{value:d}):e.exports.apply=d},2296:(e,t,r)=>{"use strict";var n=r(1044)(),o=r(210),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(e){i=!1}var a=o("%SyntaxError%"),s=o("%TypeError%"),u=r(7296);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new s("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!u&&u(e,t);if(i)i(e,t,{configurable:null===c&&f?f.configurable:!c,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||c))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},7187:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}y(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var o,i,a,c;if(s(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),a=i[t]),void 0===a)a=i[t]=r,++e._eventsCount;else if("function"==typeof a?a=i[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=u(e))>0&&a.length>o&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=l.bind(n);return o.listener=r,n.wrapFn=o,o}function d(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,l=p(u,c);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},8751:(e,t,r)=>{var n=r(8764).Buffer,o=r(8575).parse,i=r(7187),a=r(9267),s=r(8501),u=r(9539),c=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","servername","checkServerIdentity"],l=[239,187,191],f=262144,d=/^(cookie|authorization)$/i;function h(e,t){var r=h.CONNECTING,i=t&&t.headers,u=!1;Object.defineProperty(this,"readyState",{get:function(){return r}}),Object.defineProperty(this,"url",{get:function(){return e}});var m,g=this;function v(t){r!==h.CLOSED&&(r=h.CONNECTING,E("error",new p("error",{message:t})),k&&(e=k,k=null,u=!1),setTimeout((function(){r!==h.CONNECTING||g.connectionInProgress||(g.connectionInProgress=!0,_())}),g.reconnectInterval))}g.reconnectInterval=1e3,g.connectionInProgress=!1;var b="";i&&i["Last-Event-ID"]&&(b=i["Last-Event-ID"],delete i["Last-Event-ID"]);var w=!1,A="",S="",k=null;function _(){var y=o(e),A="https:"===y.protocol;if(y.headers={"Cache-Control":"no-cache",Accept:"text/event-stream"},b&&(y.headers["Last-Event-ID"]=b),i){var S=u?function(e){var t={};for(var r in e)d.test(r)||(t[r]=e[r]);return t}(i):i;for(var T in S){var P=S[T];P&&(y.headers[T]=P)}}if(y.rejectUnauthorized=!(t&&!t.rejectUnauthorized),t&&void 0!==t.createConnection&&(y.createConnection=t.createConnection),t&&t.proxy){var O=o(t.proxy);A="https:"===O.protocol,y.protocol=A?"https:":"http:",y.path=e,y.headers.Host=y.host,y.hostname=O.hostname,y.host=O.host,y.port=O.port}if(t&&t.https)for(var R in t.https)if(-1!==c.indexOf(R)){var I=t.https[R];void 0!==I&&(y[R]=I)}t&&void 0!==t.withCredentials&&(y.withCredentials=t.withCredentials),m=(A?a:s).request(y,(function(t){if(g.connectionInProgress=!1,500===t.statusCode||502===t.statusCode||503===t.statusCode||504===t.statusCode)return E("error",new p("error",{status:t.statusCode,message:t.statusMessage})),void v();if(301===t.statusCode||302===t.statusCode||307===t.statusCode){var o=t.headers.location;if(!o)return void E("error",new p("error",{status:t.statusCode,message:t.statusMessage}));var i=new URL(e).origin,a=new URL(o).origin;return u=i!==a,307===t.statusCode&&(k=e),e=o,void process.nextTick(_)}if(200!==t.statusCode)return E("error",new p("error",{status:t.statusCode,message:t.statusMessage})),g.close();var s,c;r=h.OPEN,t.on("close",(function(){t.removeAllListeners("close"),t.removeAllListeners("end"),v()})),t.on("end",(function(){t.removeAllListeners("close"),t.removeAllListeners("end"),v()})),E("open",new p("open"));var d=0,y=-1,m=0,b=0;t.on("data",(function(e){s?(e.length>s.length-b&&((m=2*s.length+e.length)>f&&(m=s.length+e.length+f),c=n.alloc(m),s.copy(c,0,0,b),s=c),e.copy(s,b),b+=e.length):(function(e){return l.every((function(t,r){return e[r]===t}))}(s=e)&&(s=s.slice(l.length)),b=s.length);for(var t=0,r=b;t0&&(s=s.slice(t,b),b=s.length)}))})),m.on("error",(function(e){g.connectionInProgress=!1,v(e.message)})),m.setNoDelay&&m.setNoDelay(!0),m.end()}function E(){g.listeners(arguments[0]).length>0&&g.emit.apply(g,arguments)}function x(t,r,n,o){if(0===o){if(A.length>0){var i=S||"message";E(i,new y(i,{data:A.slice(0,-1),lastEventId:b,origin:new URL(e).origin})),A=""}S=void 0}else if(n>0){var a,s=n<0,u=t.slice(r,r+(s?o:n)).toString();r+=a=s?o:32!==t[r+n+1]?n+1:n+2;var c=o-a,l=t.slice(r,r+c).toString();if("data"===u)A+=l+"\n";else if("event"===u)S=l;else if("id"===u)b=l;else if("retry"===u){var f=parseInt(l,10);Number.isNaN(f)||(g.reconnectInterval=f)}}}_(),this._close=function(){r!==h.CLOSED&&(r=h.CLOSED,m.abort&&m.abort(),m.xhr&&m.xhr.abort&&m.xhr.abort())}}function p(e,t){if(Object.defineProperty(this,"type",{writable:!1,value:e,enumerable:!0}),t)for(var r in t)t.hasOwnProperty(r)&&Object.defineProperty(this,r,{writable:!1,value:t[r],enumerable:!0})}function y(e,t){for(var r in Object.defineProperty(this,"type",{writable:!1,value:e,enumerable:!0}),t)t.hasOwnProperty(r)&&Object.defineProperty(this,r,{writable:!1,value:t[r],enumerable:!0})}e.exports=h,u.inherits(h,i.EventEmitter),h.prototype.constructor=h,["open","error","message"].forEach((function(e){Object.defineProperty(h.prototype,"on"+e,{get:function(){var t=this.listeners(e)[0];return t?t._listener?t._listener:t:void 0},set:function(t){this.removeAllListeners(e),this.addEventListener(e,t)}})})),Object.defineProperty(h,"CONNECTING",{enumerable:!0,value:0}),Object.defineProperty(h,"OPEN",{enumerable:!0,value:1}),Object.defineProperty(h,"CLOSED",{enumerable:!0,value:2}),h.prototype.CONNECTING=0,h.prototype.OPEN=1,h.prototype.CLOSED=2,h.prototype.close=function(){this._close()},h.prototype.addEventListener=function(e,t){"function"==typeof t&&(t._listener=t,this.on(e,t))},h.prototype.dispatchEvent=function(e){if(!e.type)throw new Error("UNSPECIFIED_EVENT_TYPE_ERR");this.emit(e.type,e.detail)},h.prototype.removeEventListener=function(e,t){"function"==typeof t&&(t._listener=void 0,this.removeListener(e,t))}},4029:(e,t,r)=>{"use strict";var n=r(5320),o=Object.prototype.toString,i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=r),"[object Array]"===o.call(e)?function(e,t,r){for(var n=0,o=e.length;n{"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n{"use strict";var n=r(7648);e.exports=Function.prototype.bind||n},210:(e,t,r)=>{"use strict";var n,o=SyntaxError,i=Function,a=TypeError,s=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(e){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(e){u=null}var c=function(){throw new a},l=u?function(){try{return c}catch(e){try{return u(arguments,"callee").get}catch(e){return c}}}():c,f=r(1405)(),d=r(8185)(),h=Object.getPrototypeOf||(d?function(e){return e.__proto__}:null),p={},y="undefined"!=typeof Uint8Array&&h?h(Uint8Array):n,m={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":f&&h?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f&&h?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f&&h?h((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f&&h?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f&&h?h(""[Symbol.iterator]()):n,"%Symbol%":f?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":l,"%TypedArray%":y,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(h)try{null.error}catch(e){var g=h(h(e));m["%Error.prototype%"]=g}var v=function e(t){var r;if("%AsyncFunction%"===t)r=s("async function () {}");else if("%GeneratorFunction%"===t)r=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=s("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&h&&(r=h(o.prototype))}return m[t]=r,r},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},w=r(8612),A=r(8824),S=w.call(Function.call,Array.prototype.concat),k=w.call(Function.apply,Array.prototype.splice),_=w.call(Function.call,String.prototype.replace),E=w.call(Function.call,String.prototype.slice),x=w.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,P=/\\(\\)?/g,O=function(e,t){var r,n=e;if(A(b,n)&&(n="%"+(r=b[n])[0]+"%"),A(m,n)){var i=m[n];if(i===p&&(i=v(n)),void 0===i&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===x(/^%?[^%]*%?$/,e))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=E(e,0,1),r=E(e,-1);if("%"===t&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return _(e,T,(function(e,t,r,o){n[n.length]=r?_(o,P,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",i=O("%"+n+"%",t),s=i.name,c=i.value,l=!1,f=i.alias;f&&(n=f[0],k(r,S([0,1],f)));for(var d=1,h=!0;d=r.length){var v=u(c,p);c=(h=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:c[p]}else h=A(c,p),c=c[p];h&&!l&&(m[s]=c)}}return c}},7296:(e,t,r)=>{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},1044:(e,t,r)=>{"use strict";var n=r(210)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(e){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},8185:e=>{"use strict";var t={foo:{}},r=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof r)}},1405:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(5419);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},5419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},6410:(e,t,r)=>{"use strict";var n=r(5419);e.exports=function(){return n()&&!!Symbol.toStringTag}},8824:(e,t,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(8612);e.exports=i.call(n,o)},9267:(e,t,r)=>{var n=r(8501),o=r(8575),i=e.exports;for(var a in n)n.hasOwnProperty(a)&&(i[a]=n[a]);function s(e){if("string"==typeof e&&(e=o.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}i.request=function(e,t){return e=s(e),n.request.call(this,e,t)},i.get=function(e,t){return e=s(e),n.get.call(this,e,t)}},645:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<>1,l=-7,f=r?o-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=d,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=d,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+h]=255&s,h+=p,s/=256,o-=8);for(a=a<0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*y}},5717: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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},2584:(e,t,r)=>{"use strict";var n=r(6410)(),o=r(1924)("Object.prototype.toString"),i=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===o(e)},a=function(e){return!!i(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==o(e)&&"[object Function]"===o(e.callee)},s=function(){return i(arguments)}();i.isLegacyArguments=a,e.exports=s?i:a},5320:e=>{"use strict";var t,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,t)}catch(e){e!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(e){try{var t=n.call(e);return i.test(t)}catch(e){return!1}},s=function(e){try{return!a(e)&&(n.call(e),!0)}catch(e){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var d=document.all;u.call(d)===u.call(document.all)&&(f=function(e){if((l||!e)&&(void 0===e||"object"==typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=o?function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{o(e,null,t)}catch(e){if(e!==r)return!1}return!a(e)&&s(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return s(e);if(a(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},8662:(e,t,r)=>{"use strict";var n,o=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(6410)(),u=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(a.test(i.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===o.call(e);if(!u)return!1;if(void 0===n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&u(t)}return u(e)===n}},5692:(e,t,r)=>{"use strict";var n=r(6430);e.exports=function(e){return!!n(e)}},631:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&u&&"function"==typeof u.get?u.get:null,l=s&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,y=Object.prototype.toString,m=Function.prototype.toString,g=String.prototype.match,v=String.prototype.slice,b=String.prototype.replace,w=String.prototype.toUpperCase,A=String.prototype.toLowerCase,S=RegExp.prototype.test,k=Array.prototype.concat,_=Array.prototype.join,E=Array.prototype.slice,x=Math.floor,T="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,R="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,C=Object.prototype.propertyIsEnumerable,M=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function B(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||S.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-x(-e):x(e);if(n!==e){var o=String(n),i=v.call(t,o.length+1);return b.call(o,r,"$&_")+"."+b.call(b.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(t,r,"$&_")}var N=r(4654),L=N.custom,j=q(L)?L:null;function U(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function F(e){return b.call(String(e),/"/g,""")}function D(e){return!("[object Array]"!==K(e)||I&&"object"==typeof e&&I in e)}function z(e){return!("[object RegExp]"!==K(e)||I&&"object"==typeof e&&I in e)}function q(e){if(R)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!O)return!1;try{return O.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,o,s){var u=n||{};if(V(u,"quoteStyle")&&"single"!==u.quoteStyle&&"double"!==u.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(V(u,"maxStringLength")&&("number"==typeof u.maxStringLength?u.maxStringLength<0&&u.maxStringLength!==1/0:null!==u.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var y=!V(u,"customInspect")||u.customInspect;if("boolean"!=typeof y&&"symbol"!==y)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(V(u,"indent")&&null!==u.indent&&"\t"!==u.indent&&!(parseInt(u.indent,10)===u.indent&&u.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(V(u,"numericSeparator")&&"boolean"!=typeof u.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=u.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return G(t,u);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var S=String(t);return w?B(t,S):S}if("bigint"==typeof t){var x=String(t)+"n";return w?B(t,x):x}var P=void 0===u.depth?5:u.depth;if(void 0===o&&(o=0),o>=P&&P>0&&"object"==typeof t)return D(t)?"[Array]":"[Object]";var L=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=_.call(Array(e.indent+1)," ")}return{base:r,prev:_.call(Array(t+1),r)}}(u,o);if(void 0===s)s=[];else if(W(s,t)>=0)return"[Circular]";function H(t,r,n){if(r&&(s=E.call(s)).push(r),n){var i={depth:u.depth};return V(u,"quoteStyle")&&(i.quoteStyle=u.quoteStyle),e(t,i,o+1,s)}return e(t,u,o+1,s)}if("function"==typeof t&&!z(t)){var X=function(e){if(e.name)return e.name;var t=g.call(m.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),ee=$(t,H);return"[Function"+(X?": "+X:" (anonymous)")+"]"+(ee.length>0?" { "+_.call(ee,", ")+" }":"")}if(q(t)){var te=R?b.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(t);return"object"!=typeof t||R?te:Z(te)}if(function(e){return!(!e||"object"!=typeof e)&&("undefined"!=typeof HTMLElement&&e instanceof HTMLElement||"string"==typeof e.nodeName&&"function"==typeof e.getAttribute)}(t)){for(var re="<"+A.call(String(t.nodeName)),ne=t.attributes||[],oe=0;oe"}if(D(t)){if(0===t.length)return"[]";var ie=$(t,H);return L&&!function(e){for(var t=0;t=0)return!1;return!0}(ie)?"["+J(ie,L)+"]":"[ "+_.call(ie,", ")+" ]"}if(function(e){return!("[object Error]"!==K(e)||I&&"object"==typeof e&&I in e)}(t)){var ae=$(t,H);return"cause"in Error.prototype||!("cause"in t)||C.call(t,"cause")?0===ae.length?"["+String(t)+"]":"{ ["+String(t)+"] "+_.call(ae,", ")+" }":"{ ["+String(t)+"] "+_.call(k.call("[cause]: "+H(t.cause),ae),", ")+" }"}if("object"==typeof t&&y){if(j&&"function"==typeof t[j]&&N)return N(t,{depth:P-o});if("symbol"!==y&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var se=[];return a&&a.call(t,(function(e,r){se.push(H(r,t,!0)+" => "+H(e,t))})),Y("Map",i.call(t),se,L)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ue=[];return l&&l.call(t,(function(e){ue.push(H(e,t))})),Y("Set",c.call(t),ue,L)}if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return Q("WeakMap");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return Q("WeakSet");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{return h.call(e),!0}catch(e){}return!1}(t))return Q("WeakRef");if(function(e){return!("[object Number]"!==K(e)||I&&"object"==typeof e&&I in e)}(t))return Z(H(Number(t)));if(function(e){if(!e||"object"!=typeof e||!T)return!1;try{return T.call(e),!0}catch(e){}return!1}(t))return Z(H(T.call(t)));if(function(e){return!("[object Boolean]"!==K(e)||I&&"object"==typeof e&&I in e)}(t))return Z(p.call(t));if(function(e){return!("[object String]"!==K(e)||I&&"object"==typeof e&&I in e)}(t))return Z(H(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if(t===r.g)return"{ [object globalThis] }";if(!function(e){return!("[object Date]"!==K(e)||I&&"object"==typeof e&&I in e)}(t)&&!z(t)){var ce=$(t,H),le=M?M(t)===Object.prototype:t instanceof Object||t.constructor===Object,fe=t instanceof Object?"":"null prototype",de=!le&&I&&Object(t)===t&&I in t?v.call(K(t),8,-1):fe?"Object":"",he=(le||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(de||fe?"["+_.call(k.call([],de||[],fe||[]),": ")+"] ":"");return 0===ce.length?he+"{}":L?he+"{"+J(ce,L)+"}":he+"{ "+_.call(ce,", ")+" }"}return String(t)};var H=Object.prototype.hasOwnProperty||function(e){return e in this};function V(e,t){return H.call(e,t)}function K(e){return y.call(e)}function W(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;rt.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return G(v.call(e,0,t.maxStringLength),t)+n}return U(b.call(b.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",t)}function X(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function Z(e){return"Object("+e+")"}function Q(e){return e+" { ? }"}function Y(e,t,r,n){return e+" ("+t+") {"+(n?J(r,n):_.call(r,", "))+"}"}function J(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+_.call(e,","+r)+"\n"+t.prev}function $(e,t){var r=D(e),n=[];if(r){n.length=e.length;for(var o=0;o{"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC3986";e.exports={default:n,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:n}},129:(e,t,r)=>{"use strict";var n=r(8261),o=r(5235),i=r(5798);e.exports={formats:i,parse:o,stringify:n}},5235:(e,t,r)=>{"use strict";var n=r(2769),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},u=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c=function(e,t,r,n){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(i),c=s?i.slice(0,s.index):i,l=[];if(c){if(!r.plainObjects&&o.call(Object.prototype,c)&&!r.allowPrototypes)return;l.push(c)}for(var f=0;r.depth>0&&null!==(s=a.exec(i))&&f=0;--i){var a,s=e[i];if("[]"===s&&r.parseArrays)a=[].concat(o);else{a=r.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,l=parseInt(c,10);r.parseArrays||""!==c?!isNaN(l)&&s!==c&&String(l)===c&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(a=[])[l]=o:"__proto__"!==c&&(a[c]=o):a={0:o}}o=a}return o}(l,t,r,n)}};e.exports=function(e,t){var r=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var l="string"==typeof e?function(e,t){var r,c={__proto__:null},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,f=t.parameterLimit===1/0?void 0:t.parameterLimit,d=l.split(t.delimiter,f),h=-1,p=t.charset;if(t.charsetSentinel)for(r=0;r-1&&(m=i(m)?[m]:m),o.call(c,y)?c[y]=n.combine(c[y],m):c[y]=m}return c}(e,r):e,f=r.plainObjects?Object.create(null):{},d=Object.keys(l),h=0;h{"use strict";var n=r(7478),o=r(2769),i=r(5798),a=Object.prototype.hasOwnProperty,s={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},u=Array.isArray,c=Array.prototype.push,l=function(e,t){c.apply(e,u(t)?t:[t])},f=Date.prototype.toISOString,d=i.default,h={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:d,formatter:i.formatters[d],indices:!1,serializeDate:function(e){return f.call(e)},skipNulls:!1,strictNullHandling:!1},p={},y=function e(t,r,i,a,s,c,f,d,y,m,g,v,b,w,A,S){for(var k,_=t,E=S,x=0,T=!1;void 0!==(E=E.get(p))&&!T;){var P=E.get(t);if(x+=1,void 0!==P){if(P===x)throw new RangeError("Cyclic object value");T=!0}void 0===E.get(p)&&(x=0)}if("function"==typeof d?_=d(r,_):_ instanceof Date?_=g(_):"comma"===i&&u(_)&&(_=o.maybeMap(_,(function(e){return e instanceof Date?g(e):e}))),null===_){if(s)return f&&!w?f(r,h.encoder,A,"key",v):r;_=""}if("string"==typeof(k=_)||"number"==typeof k||"boolean"==typeof k||"symbol"==typeof k||"bigint"==typeof k||o.isBuffer(_))return f?[b(w?r:f(r,h.encoder,A,"key",v))+"="+b(f(_,h.encoder,A,"value",v))]:[b(r)+"="+b(String(_))];var O,R=[];if(void 0===_)return R;if("comma"===i&&u(_))w&&f&&(_=o.maybeMap(_,f)),O=[{value:_.length>0?_.join(",")||null:void 0}];else if(u(d))O=d;else{var I=Object.keys(_);O=y?I.sort(y):I}for(var C=a&&u(_)&&1===_.length?r+"[]":r,M=0;M0?A+w:""}},2769:(e,t,r)=>{"use strict";var n=r(5798),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n1;){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var n=[],o=0;o=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||i===n.RFC1738&&(40===l||41===l)?u+=s.charAt(c):l<128?u+=a[l]:l<2048?u+=a[192|l>>6]+a[128|63&l]:l<55296||l>=57344?u+=a[224|l>>12]+a[128|l>>6&63]+a[128|63&l]:(c+=1,l=65536+((1023&l)<<10|1023&s.charCodeAt(c)),u+=a[240|l>>18]+a[128|l>>12&63]+a[128|l>>6&63]+a[128|63&l])}return u},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var r=[],n=0;n{"use strict";var n=65536,o=r(9509).Buffer,i=r.g.crypto||r.g.msCrypto;i&&i.getRandomValues?e.exports=function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var r=o.allocUnsafe(e);if(e>0)if(e>n)for(var a=0;a{"use strict";var t={};function r(e,r,n){n||(n=Error);var o=function(e){var t,n;function o(t,n,o){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,o))||this}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,o}(n);o.prototype.name=n.name,o.prototype.code=e,t[e]=o}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var o,i,a;if("string"==typeof t&&(i="not ",t.substr(0,4)===i)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))a="The ".concat(e," ").concat(o," ").concat(n(t,"type"));else{var s=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+1>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument";a='The "'.concat(e,'" ').concat(s," ").concat(o," ").concat(n(t,"type"))}return a+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},6753:(e,t,r)=>{"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var o=r(9481),i=r(4229);r(5717)(c,o);for(var a=n(i.prototype),s=0;s{"use strict";e.exports=o;var n=r(4605);function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}r(5717)(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},9481:(e,t,r)=>{"use strict";var n;e.exports=_,_.ReadableState=k,r(7187).EventEmitter;var o,i=function(e,t){return e.listeners(t).length},a=r(2503),s=r(8764).Buffer,u=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},c=r(4616);o=c&&c.debuglog?c.debuglog("stream"):function(){};var l,f,d,h=r(7327),p=r(1195),y=r(2457).getHighWaterMark,m=r(4281).q,g=m.ERR_INVALID_ARG_TYPE,v=m.ERR_STREAM_PUSH_AFTER_EOF,b=m.ERR_METHOD_NOT_IMPLEMENTED,w=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(_,a);var A=p.errorOrDestroy,S=["error","close","destroy","pause","resume"];function k(e,t,o){n=n||r(6753),e=e||{},"boolean"!=typeof o&&(o=t instanceof n),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,"readableHighWaterMark",o),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(2553).s),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function _(e){if(n=n||r(6753),!(this instanceof _))return new _(e);var t=this instanceof n;this._readableState=new k(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function E(e,t,r,n,i){o("readableAddChunk",t);var a,c=e._readableState;if(null===t)c.reading=!1,function(e,t){if(o("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,R(e)))}}(e,c);else if(i||(a=function(e,t){var r,n;return n=t,s.isBuffer(n)||n instanceof u||"string"==typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t)),r}(c,t)),a)A(e,a);else if(c.objectMode||t&&t.length>0)if("string"==typeof t||c.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n)c.endEmitted?A(e,new w):x(e,c,t,!0);else if(c.ended)A(e,new v);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(t=c.decoder.write(t),c.objectMode||0!==t.length?x(e,c,t,!1):I(e,c)):x(e,c,t,!1)}else n||(c.reading=!1,I(e,c));return!c.ended&&(c.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=T?e=T:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(R,e))}function R(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function I(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(C,e,t))}function C(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function B(e){o("readable nexttick read 0"),e.read(0)}function N(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function j(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(F,t,e))}function F(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function D(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):O(this),null;if(0===(e=P(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e0?j(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},_.prototype._read=function(e){A(this,new b("_read()"))},_.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,t);var a=t&&!1===t.end||e===process.stdout||e===process.stderr?p:s;function s(){o("onend"),e.end()}n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",(function t(i,a){o("onunpipe"),i===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,o("cleanup"),e.removeListener("close",d),e.removeListener("finish",h),e.removeListener("drain",u),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",s),r.removeListener("end",p),r.removeListener("data",l),c=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}));var u=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,L(e))}}(r);e.on("drain",u);var c=!1;function l(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==D(n.pipes,e))&&!c&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function f(t){o("onerror",t),p(),e.removeListener("error",f),0===i(e,"error")&&A(e,t)}function d(){e.removeListener("finish",h),p()}function h(){o("onfinish"),e.removeListener("close",d),p()}function p(){o("unpipe"),r.unpipe(e)}return r.on("data",l),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",f),e.once("close",d),e.once("finish",h),e.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),e},_.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?O(this):n.reading||process.nextTick(B,this))),r},_.prototype.addListener=_.prototype.on,_.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(M,this),r},_.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(M,this),t},_.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(N,e,t))}(this,e)),e.paused=!1,this},_.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},_.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a{"use strict";e.exports=l;var n=r(4281).q,o=n.ERR_METHOD_NOT_IMPLEMENTED,i=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length{"use strict";function n(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var o=n.callback;t.pendingcb--,o(void 0),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var o;e.exports=_,_.WritableState=k;var i,a={deprecate:r(4927)},s=r(2503),u=r(8764).Buffer,c=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},l=r(1195),f=r(2457).getHighWaterMark,d=r(4281).q,h=d.ERR_INVALID_ARG_TYPE,p=d.ERR_METHOD_NOT_IMPLEMENTED,y=d.ERR_MULTIPLE_CALLBACK,m=d.ERR_STREAM_CANNOT_PIPE,g=d.ERR_STREAM_DESTROYED,v=d.ERR_STREAM_NULL_VALUES,b=d.ERR_STREAM_WRITE_AFTER_END,w=d.ERR_UNKNOWN_ENCODING,A=l.errorOrDestroy;function S(){}function k(e,t,i){o=o||r(6753),e=e||{},"boolean"!=typeof i&&(i=t instanceof o),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new y;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(process.nextTick(o,n),process.nextTick(R,e,t),e._writableState.errorEmitted=!0,A(e,n)):(o(n),e._writableState.errorEmitted=!0,A(e,n),R(e,t))}(e,r,n,t,o);else{var i=P(r)||e.destroyed;i||r.corked||r.bufferProcessing||!r.bufferedRequest||T(e,r),n?process.nextTick(x,e,r,i,o):x(e,r,i,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function _(e){var t=this instanceof(o=o||r(6753));if(!t&&!i.call(_,this))return new _(e);this._writableState=new k(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),s.call(this)}function E(e,t,r,n,o,i,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function x(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),R(e,t)}function T(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var o=t.bufferedRequestCount,i=new Array(o),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,E(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new n(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback;if(E(e,t,!1,t.objectMode?1:c.length,c,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function P(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final((function(r){t.pendingcb--,r&&A(e,r),t.prefinished=!0,e.emit("prefinish"),R(e,t)}))}function R(e,t){var r=P(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(O,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(5717)(_,s),k.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(k.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(e){return!!i.call(this,e)||this===_&&e&&e._writableState instanceof k}})):i=function(e){return e instanceof this},_.prototype.pipe=function(){A(this,new m)},_.prototype.write=function(e,t,r){var n,o=this._writableState,i=!1,a=!o.objectMode&&(n=e,u.isBuffer(n)||n instanceof c);return a&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=S),o.ending?function(e,t){var r=new b;A(e,r),process.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var o;return null===r?o=new v:"string"==typeof r||t.objectMode||(o=new h("chunk",["string","Buffer"],r)),!o||(A(e,o),process.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,i=function(e,t,r,n,o,i){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,r)),t}(t,n,o);n!==a&&(r=!0,o="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var c=t.length-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(_.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),_.prototype._write=function(e,t,r){r(new p("_write()"))},_.prototype._writev=null,_.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,R(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(_.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),_.prototype.destroy=l.destroy,_.prototype._undestroy=l.undestroy,_.prototype._destroy=function(e,t){t(e)}},5850:(e,t,r)=>{"use strict";var n;function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=r(8610),a=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var r=e[d].read();null!==r&&(e[l]=null,e[a]=null,e[s]=null,t(h(r,!1)))}}function y(e){process.nextTick(p,e)}var m=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((o(n={get stream(){return this[d]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise((function(t,r){process.nextTick((function(){e[u]?r(e[u]):t(h(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(h(void 0,!0)):t[f](r,n)}),n)}}(n,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(h(o,!1));r=new Promise(this[f])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(h(void 0,!0))}))}))})),n),m);e.exports=function(e){var t,r=Object.create(g,(o(t={},d,{value:e,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,s,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,c,{value:e._readableState.endEmitted,writable:!0}),o(t,f,{value:function(e,t){var n=r[d].read();n?(r[l]=null,r[a]=null,r[s]=null,e(h(n,!1))):(r[a]=e,r[s]=t)},writable:!0}),t));return r[l]=null,i(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[l]=null,r[a]=null,r[s]=null,t(e)),void(r[u]=e)}var n=r[a];null!==n&&(r[l]=null,r[a]=null,r[s]=null,n(h(void 0,!0))),r[c]=!0})),e.on("readable",y.bind(null,r)),r}},7327:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t,r,n,o=u.allocUnsafe(e>>>0),i=this.head,a=0;i;)t=i.data,r=o,n=a,u.prototype.copy.call(t,r,n),a+=i.data.length,i=i.next;return o}},{key:"consume",value:function(e,t){var r;return eo.length?o.length:e;if(i===o.length?n+=o:n+=o.slice(0,e),0==(e-=i)){i===o.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),0==(e-=i)){i===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(i));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return c(this,o(o({},t),{},{depth:0,customInspect:!1}))}}])&&a(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},1195:e=>{"use strict";function t(e,t){n(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function n(e,t){e.emit("error",t)}e.exports={destroy:function(e,o){var i=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(o?o(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(n,this,e)):process.nextTick(n,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!o&&e?i._writableState?i._writableState.errorEmitted?process.nextTick(r,i):(i._writableState.errorEmitted=!0,process.nextTick(t,i,e)):process.nextTick(t,i,e):o?(process.nextTick(r,i),o(e)):process.nextTick(r,i)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},8610:(e,t,r)=>{"use strict";var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function o(){}e.exports=function e(t,r,i){if("function"==typeof r)return e(t,null,r);r||(r={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(e,t,r)=>{"use strict";var n,o=r(4281).q,i=o.ERR_MISSING_ARGS,a=o.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),o=0;o0,(function(e){l||(l=e),e&&d.forEach(u),i||(d.forEach(u),f(l))}))}));return t.reduce(c)}},2457:(e,t,r)=>{"use strict";var n=r(4281).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,o){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,o,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(o?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}},2503:(e,t,r)=>{e.exports=r(7187).EventEmitter},8473:(e,t,r)=>{(t=e.exports=r(9481)).Stream=t,t.Readable=t,t.Writable=r(4229),t.Duplex=r(6753),t.Transform=r(4605),t.PassThrough=r(2725),t.finished=r(8610),t.pipeline=r(9946)},9509:(e,t,r)=>{var n=r(8764),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},7771:(e,t,r)=>{"use strict";var n=r(210),o=r(2296),i=r(1044)(),a=r(7296),s=n("%TypeError%"),u=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||u(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in e&&a){var l=a(e,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(c=!1)}return(n||c||!r)&&(i?o(e,"length",t,!0,!0):o(e,"length",t)),e}},4189:(e,t,r)=>{var n=r(9509).Buffer;function o(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}o.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,o=this._blockSize,i=e.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,o=(r-n)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},o.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=o},9072:(e,t,r)=>{var n=e.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};n.sha=r(4448),n.sha1=r(8336),n.sha224=r(8432),n.sha256=r(7499),n.sha384=r(1686),n.sha512=r(7816)},4448:(e,t,r)=>{var n=r(5717),o=r(4189),i=r(9509).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,o),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,o=0|this._b,i=0|this._c,s=0|this._d,u=0|this._e,f=0;f<16;++f)r[f]=e.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var d=0;d<80;++d){var h=~~(d/20),p=0|((t=n)<<5|t>>>27)+l(h,o,i,s)+u+r[d]+a[h];u=s,s=i,i=c(o),o=n,n=p}this._a=n+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},8336:(e,t,r)=>{var n=r(5717),o=r(4189),i=r(9509).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,o),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,o=0|this._b,i=0|this._c,s=0|this._d,u=0|this._e,d=0;d<16;++d)r[d]=e.readInt32BE(4*d);for(;d<80;++d)r[d]=(t=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|t>>>31;for(var h=0;h<80;++h){var p=~~(h/20),y=c(n)+f(p,o,i,s)+u+r[h]+a[p]|0;u=s,s=i,i=l(o),o=n,n=y}this._a=n+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},8432:(e,t,r)=>{var n=r(5717),o=r(7499),i=r(4189),a=r(9509).Buffer,s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}n(u,o),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},7499:(e,t,r)=>{var n=r(5717),o=r(4189),i=r(9509).Buffer,a=[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],s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function f(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(u,o),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,o=0|this._b,i=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,y=0|this._g,m=0|this._h,g=0;g<16;++g)r[g]=e.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((t=r[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[g-7]+h(r[g-15])+r[g-16];for(var v=0;v<64;++v){var b=m+d(u)+c(u,p,y)+a[v]+r[v]|0,w=f(n)+l(n,o,i)|0;m=y,y=p,p=u,u=s+b|0,s=i,i=o,o=n,n=b+w|0}this._a=n+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=y+this._g|0,this._h=m+this._h|0},u.prototype._hash=function(){var e=i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},1686:(e,t,r)=>{var n=r(5717),o=r(7816),i=r(4189),a=r(9509).Buffer,s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}n(u,o),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},7816:(e,t,r)=>{var n=r(5717),o=r(4189),i=r(9509).Buffer,a=[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],s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}function c(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function f(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0>>0?1:0}n(u,o),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,o=0|this._ch,i=0|this._dh,s=0|this._eh,u=0|this._fh,v=0|this._gh,b=0|this._hh,w=0|this._al,A=0|this._bl,S=0|this._cl,k=0|this._dl,_=0|this._el,E=0|this._fl,x=0|this._gl,T=0|this._hl,P=0;P<32;P+=2)t[P]=e.readInt32BE(4*P),t[P+1]=e.readInt32BE(4*P+4);for(;P<160;P+=2){var O=t[P-30],R=t[P-30+1],I=h(O,R),C=p(R,O),M=y(O=t[P-4],R=t[P-4+1]),B=m(R,O),N=t[P-14],L=t[P-14+1],j=t[P-32],U=t[P-32+1],F=C+L|0,D=I+N+g(F,C)|0;D=(D=D+M+g(F=F+B|0,B)|0)+j+g(F=F+U|0,U)|0,t[P]=D,t[P+1]=F}for(var z=0;z<160;z+=2){D=t[z],F=t[z+1];var q=l(r,n,o),H=l(w,A,S),V=f(r,w),K=f(w,r),W=d(s,_),G=d(_,s),X=a[z],Z=a[z+1],Q=c(s,u,v),Y=c(_,E,x),J=T+G|0,$=b+W+g(J,T)|0;$=($=($=$+Q+g(J=J+Y|0,Y)|0)+X+g(J=J+Z|0,Z)|0)+D+g(J=J+F|0,F)|0;var ee=K+H|0,te=V+q+g(ee,K)|0;b=v,T=x,v=u,x=E,u=s,E=_,s=i+$+g(_=k+J|0,k)|0,i=o,k=S,o=n,S=A,n=r,A=w,r=$+te+g(w=J+ee|0,J)|0}this._al=this._al+w|0,this._bl=this._bl+A|0,this._cl=this._cl+S|0,this._dl=this._dl+k|0,this._el=this._el+_|0,this._fl=this._fl+E|0,this._gl=this._gl+x|0,this._hl=this._hl+T|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+n+g(this._bl,A)|0,this._ch=this._ch+o+g(this._cl,S)|0,this._dh=this._dh+i+g(this._dl,k)|0,this._eh=this._eh+s+g(this._el,_)|0,this._fh=this._fh+u+g(this._fl,E)|0,this._gh=this._gh+v+g(this._gl,x)|0,this._hh=this._hh+b+g(this._hl,T)|0},u.prototype._hash=function(){var e=i.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},7478:(e,t,r)=>{"use strict";var n=r(210),o=r(1924),i=r(631),a=n("%TypeError%"),s=n("%WeakMap%",!0),u=n("%Map%",!0),c=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),d=o("Map.prototype.get",!0),h=o("Map.prototype.set",!0),p=o("Map.prototype.has",!0),y=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r};e.exports=function(){var e,t,r,n={assert:function(e){if(!n.has(e))throw new a("Side channel does not contain "+i(e))},get:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return c(e,n)}else if(u){if(t)return d(t,n)}else if(r)return function(e,t){var r=y(e,t);return r&&r.value}(r,n)},has:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return f(e,n)}else if(u){if(t)return p(t,n)}else if(r)return function(e,t){return!!y(e,t)}(r,n);return!1},set:function(n,o){s&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new s),l(e,n,o)):u?(t||(t=new u),h(t,n,o)):(r||(r={key:{},next:null}),function(e,t,r){var n=y(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,n,o))}};return n}},8501:(e,t,r)=>{var n=r(1989),o=r(5676),i=r(7529),a=r(584),s=r(8575),u=t;u.request=function(e,t){e="string"==typeof e?s.parse(e):i(e);var o=-1===r.g.location.protocol.search(/^https?:$/)?"http:":"",a=e.protocol||o,u=e.hostname||e.host,c=e.port,l=e.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),e.url=(u?a+"//"+u:"")+(c?":"+c:"")+l,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var f=new n(e);return t&&f.on("response",t),f},u.get=function(e,t){var r=u.request(e,t);return r.end(),r},u.ClientRequest=n,u.IncomingMessage=o.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=a,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},8725:(e,t,r)=>{var n;function o(){if(void 0!==n)return n;if(r.g.XMLHttpRequest){n=new r.g.XMLHttpRequest;try{n.open("GET",r.g.XDomainRequest?"/":"https://example.com")}catch(e){n=null}}else n=null;return n}function i(e){var t=o();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function a(e){return"function"==typeof e}t.fetch=a(r.g.fetch)&&a(r.g.ReadableStream),t.writableStream=a(r.g.WritableStream),t.abortController=a(r.g.AbortController),t.arraybuffer=t.fetch||i("arraybuffer"),t.msstream=!t.fetch&&i("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&i("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!o()&&a(o().overrideMimeType),n=null},1989:(e,t,r)=>{var n=r(8764).Buffer,o=r(8725),i=r(5717),a=r(5676),s=r(8473),u=a.IncomingMessage,c=a.readyStates,l=e.exports=function(e){var t,r=this;s.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+n.from(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){r.setHeader(t,e.headers[t])}));var i=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!o.abortController)i=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!o.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}r._mode=function(e,t){return o.fetch&&t?"fetch":o.mozchunkedarraybuffer?"moz-chunked-arraybuffer":o.msstream?"ms-stream":o.arraybuffer&&e?"arraybuffer":"text"}(t,i),r._fetchTimer=null,r._socketTimeout=null,r._socketTimer=null,r.on("finish",(function(){r._onFinish()}))};i(l,s.Writable),l.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===f.indexOf(r)&&(this._headers[r]={name:e,value:t})},l.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},l.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},l.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts;"timeout"in t&&0!==t.timeout&&e.setTimeout(t.timeout);var n=e._headers,i=null;"GET"!==t.method&&"HEAD"!==t.method&&(i=new Blob(e._body,{type:(n["content-type"]||{}).value||""}));var a=[];if(Object.keys(n).forEach((function(e){var t=n[e].name,r=n[e].value;Array.isArray(r)?r.forEach((function(e){a.push([t,e])})):a.push([t,r])})),"fetch"===e._mode){var s=null;if(o.abortController){var u=new AbortController;s=u.signal,e._fetchAbortController=u,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=r.g.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),t.requestTimeout))}r.g.fetch(e._opts.url,{method:e._opts.method,headers:a,body:i||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:s}).then((function(t){e._fetchResponse=t,e._resetTimers(!1),e._connect()}),(function(t){e._resetTimers(!0),e._destroyed||e.emit("error",t)}))}else{var l=e._xhr=new r.g.XMLHttpRequest;try{l.open(e._opts.method,e._opts.url,!0)}catch(t){return void process.nextTick((function(){e.emit("error",t)}))}"responseType"in l&&(l.responseType=e._mode),"withCredentials"in l&&(l.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in l&&l.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(l.timeout=t.requestTimeout,l.ontimeout=function(){e.emit("requestTimeout")}),a.forEach((function(e){l.setRequestHeader(e[0],e[1])})),e._response=null,l.onreadystatechange=function(){switch(l.readyState){case c.LOADING:case c.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(l.onprogress=function(){e._onXHRProgress()}),l.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{l.send(i)}catch(t){return void process.nextTick((function(){e.emit("error",t)}))}}}},l.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},l.prototype._connect=function(){var e=this;e._destroyed||(e._response=new u(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",(function(t){e.emit("error",t)})),e.emit("response",e._response))},l.prototype._write=function(e,t,r){this._body.push(e),r()},l.prototype._resetTimers=function(e){var t=this;r.g.clearTimeout(t._socketTimer),t._socketTimer=null,e?(r.g.clearTimeout(t._fetchTimer),t._fetchTimer=null):t._socketTimeout&&(t._socketTimer=r.g.setTimeout((function(){t.emit("timeout")}),t._socketTimeout))},l.prototype.abort=l.prototype.destroy=function(e){var t=this;t._destroyed=!0,t._resetTimers(!0),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort(),e&&t.emit("error",e)},l.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),s.Writable.prototype.end.call(this,e,t,r)},l.prototype.setTimeout=function(e,t){var r=this;t&&r.once("timeout",t),r._socketTimeout=e,r._resetTimers(!1)},l.prototype.flushHeaders=function(){},l.prototype.setNoDelay=function(){},l.prototype.setSocketKeepAlive=function(){};var f=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]},5676:(e,t,r)=>{var n=r(8764).Buffer,o=r(8725),i=r(5717),a=r(8473),s=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=t.IncomingMessage=function(e,t,r,i){var s=this;if(a.Readable.call(s),s._mode=r,s.headers={},s.rawHeaders=[],s.trailers={},s.rawTrailers=[],s.on("end",(function(){process.nextTick((function(){s.emit("close")}))})),"fetch"===r){if(s._fetchResponse=t,s.url=t.url,s.statusCode=t.status,s.statusMessage=t.statusText,t.headers.forEach((function(e,t){s.headers[t.toLowerCase()]=e,s.rawHeaders.push(t,e)})),o.writableStream){var u=new WritableStream({write:function(e){return i(!1),new Promise((function(t,r){s._destroyed?r():s.push(n.from(e))?t():s._resumeFetch=t}))},close:function(){i(!0),s._destroyed||s.push(null)},abort:function(e){i(!0),s._destroyed||s.emit("error",e)}});try{return void t.body.pipeTo(u).catch((function(e){i(!0),s._destroyed||s.emit("error",e)}))}catch(e){}}var c=t.body.getReader();!function e(){c.read().then((function(t){s._destroyed||(i(t.done),t.done?s.push(null):(s.push(n.from(t.value)),e()))})).catch((function(e){i(!0),s._destroyed||s.emit("error",e)}))}()}else if(s._xhr=e,s._pos=0,s.url=e.responseURL,s.statusCode=e.status,s.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===s.headers[r]&&(s.headers[r]=[]),s.headers[r].push(t[2])):void 0!==s.headers[r]?s.headers[r]+=", "+t[2]:s.headers[r]=t[2],s.rawHeaders.push(t[1],t[2])}})),s._charset="x-user-defined",!o.overrideMimeType){var l=s.rawHeaders["mime-type"];if(l){var f=l.match(/;\s*charset=([^;])(;|$)/);f&&(s._charset=f[1].toLowerCase())}s._charset||(s._charset="utf-8")}};i(u,a.Readable),u.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},u.prototype._onXHRProgress=function(e){var t=this,o=t._xhr,i=null;switch(t._mode){case"text":if((i=o.responseText).length>t._pos){var a=i.substr(t._pos);if("x-user-defined"===t._charset){for(var u=n.alloc(a.length),c=0;ct._pos&&(t.push(n.from(new Uint8Array(l.result.slice(t._pos)))),t._pos=l.result.byteLength)},l.onload=function(){e(!0),t.push(null)},l.readAsArrayBuffer(i)}t._xhr.readyState===s.DONE&&"ms-stream"!==t._mode&&(e(!0),t.push(null))}},2553:(e,t,r)=>{"use strict";var n=r(9509).Buffer,o=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.s=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(o>0&&(e.lastNeed=o-1),o):--n=0?(o>0&&(e.lastNeed=o-2),o):--n=0?(o>0&&(2===o?o=0:e.lastNeed=o-3),o):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},5424:(e,t,r)=>{var n=r(8311),o=r(5133);e.exports={parse:function(e){var t=n.parse(e.toString());return o.compile(t)}}},5133:e=>{"use strict";e.exports={compile:function(e){var t=[],r=[],n="",o=Object.create(null),i=o;return function(e){for(var t,r=0;r-1&&a("Cannot redefine existing key '"+u+"'.",o,i),(c=c[f])instanceof Array&&c.length&&l-1?'"'+e+'"':e}}}},8311:e=>{e.exports=function(){function e(e,t,r,n,o,i){this.message=e,this.expected=t,this.found=r,this.offset=n,this.line=o,this.column=i,this.name="SyntaxError"}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),{SyntaxError:e,parse:function(t){var r,n=arguments.length>1?arguments[1]:{},o={},i={start:Mt},a=Mt,s=function(){return fr},u=o,c="#",l={type:"literal",value:"#",description:'"#"'},f=void 0,d={type:"any",description:"any character"},h="[",p={type:"literal",value:"[",description:'"["'},y="]",m={type:"literal",value:"]",description:'"]"'},g=function(e){dr(hr("ObjectPath",e,Ot,Rt))},v=function(e){dr(hr("ArrayPath",e,Ot,Rt))},b=function(e,t){return e.concat(t)},w=function(e){return[e]},A=function(e){return e},S=".",k={type:"literal",value:".",description:'"."'},_="=",E={type:"literal",value:"=",description:'"="'},x=function(e,t){dr(hr("Assign",t,Ot,Rt,e))},T=function(e){return e.join("")},P=function(e){return e.value},O='"""',R={type:"literal",value:'"""',description:'"\\"\\"\\""'},I=null,C=function(e){return hr("String",e.join(""),Ot,Rt)},M='"',B={type:"literal",value:'"',description:'"\\""'},N="'''",L={type:"literal",value:"'''",description:"\"'''\""},j="'",U={type:"literal",value:"'",description:'"\'"'},F=function(e){return e},D=function(e){return e},z="\\",q={type:"literal",value:"\\",description:'"\\\\"'},H=function(){return""},V="e",K={type:"literal",value:"e",description:'"e"'},W="E",G={type:"literal",value:"E",description:'"E"'},X=function(e,t){return hr("Float",parseFloat(e+"e"+t),Ot,Rt)},Z=function(e){return hr("Float",parseFloat(e),Ot,Rt)},Q="+",Y={type:"literal",value:"+",description:'"+"'},J=function(e){return e.join("")},$="-",ee={type:"literal",value:"-",description:'"-"'},te=function(e){return"-"+e.join("")},re=function(e){return hr("Integer",parseInt(e,10),Ot,Rt)},ne="true",oe={type:"literal",value:"true",description:'"true"'},ie=function(){return hr("Boolean",!0,Ot,Rt)},ae="false",se={type:"literal",value:"false",description:'"false"'},ue=function(){return hr("Boolean",!1,Ot,Rt)},ce=function(){return hr("Array",[],Ot,Rt)},le=function(e){return hr("Array",e?[e]:[],Ot,Rt)},fe=function(e){return hr("Array",e,Ot,Rt)},de=function(e,t){return hr("Array",e.concat(t),Ot,Rt)},he=function(e){return e},pe=",",ye={type:"literal",value:",",description:'","'},me="{",ge={type:"literal",value:"{",description:'"{"'},ve="}",be={type:"literal",value:"}",description:'"}"'},we=function(e){return hr("InlineTable",e,Ot,Rt)},Ae=function(e,t){return hr("InlineTableValue",t,Ot,Rt,e)},Se=function(e){return"."+e},ke=function(e){return e.join("")},_e=":",Ee={type:"literal",value:":",description:'":"'},xe=function(e){return e.join("")},Te="T",Pe={type:"literal",value:"T",description:'"T"'},Oe="Z",Re={type:"literal",value:"Z",description:'"Z"'},Ie=function(e,t){return hr("Date",new Date(e+"T"+t+"Z"),Ot,Rt)},Ce=function(e,t){return hr("Date",new Date(e+"T"+t),Ot,Rt)},Me=/^[ \t]/,Be={type:"class",value:"[ \\t]",description:"[ \\t]"},Ne="\n",Le={type:"literal",value:"\n",description:'"\\n"'},je="\r",Ue={type:"literal",value:"\r",description:'"\\r"'},Fe=/^[0-9a-f]/i,De={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},ze=/^[0-9]/,qe={type:"class",value:"[0-9]",description:"[0-9]"},He="_",Ve={type:"literal",value:"_",description:'"_"'},Ke=function(){return""},We=/^[A-Za-z0-9_\-]/,Ge={type:"class",value:"[A-Za-z0-9_\\-]",description:"[A-Za-z0-9_\\-]"},Xe=function(e){return e.join("")},Ze='\\"',Qe={type:"literal",value:'\\"',description:'"\\\\\\""'},Ye=function(){return'"'},Je="\\\\",$e={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},et=function(){return"\\"},tt="\\b",rt={type:"literal",value:"\\b",description:'"\\\\b"'},nt=function(){return"\b"},ot="\\t",it={type:"literal",value:"\\t",description:'"\\\\t"'},at=function(){return"\t"},st="\\n",ut={type:"literal",value:"\\n",description:'"\\\\n"'},ct=function(){return"\n"},lt="\\f",ft={type:"literal",value:"\\f",description:'"\\\\f"'},dt=function(){return"\f"},ht="\\r",pt={type:"literal",value:"\\r",description:'"\\\\r"'},yt=function(){return"\r"},mt="\\U",gt={type:"literal",value:"\\U",description:'"\\\\U"'},vt=function(e){return function(e,t,r){var n=parseInt("0x"+e);if(!(!isFinite(n)||Math.floor(n)!=n||n<0||n>1114111||n>55295&&n<57344))return function(){var e,t,r=[],n=-1,o=arguments.length;if(!o)return"";for(var i="";++n>10),t=a%1024+56320,r.push(e,t)),(n+1==o||r.length>16384)&&(i+=String.fromCharCode.apply(null,r),r.length=0)}return i}(n);!function(e,t,r){var n=new Error(e);throw n.line=undefined,n.column=undefined,n}("Invalid Unicode escape code: "+e)}(e.join(""))},bt="\\u",wt={type:"literal",value:"\\u",description:'"\\\\u"'},At=0,St=0,kt=0,_t={line:1,column:1,seenCR:!1},Et=0,xt=[],Tt=0,Pt={};if("startRule"in n){if(!(n.startRule in i))throw new Error("Can't start parsing from rule \""+n.startRule+'".');a=i[n.startRule]}function Ot(){return It(St).line}function Rt(){return It(St).column}function It(e){return kt!==e&&(kt>e&&(kt=0,_t={line:1,column:1,seenCR:!1}),function(e,r,n){var o,i;for(o=r;oEt&&(Et=At,xt=[]),xt.push(e))}function Mt(){var e,t,r,n=49*At+0,i=Pt[n];if(i)return At=i.nextPos,i.result;for(e=At,t=[],r=Bt();r!==o;)t.push(r),r=Bt();return t!==o&&(St=e,t=s()),e=t,Pt[n]={nextPos:At,result:e},e}function Bt(){var e,r,n,i,a,s,c,l=49*At+1,f=Pt[l];if(f)return At=f.nextPos,f.result;for(e=At,r=[],n=rr();n!==o;)r.push(n),n=rr();if(r!==o)if(n=function(){var e,r=49*At+2,n=Pt[r];return n?(At=n.nextPos,n.result):((e=Nt())===o&&(e=function(){var e,r,n,i,a,s,c=49*At+4,l=Pt[c];if(l)return At=l.nextPos,l.result;if(e=At,91===t.charCodeAt(At)?(r=h,At++):(r=o,0===Tt&&Ct(p)),r!==o){for(n=[],i=rr();i!==o;)n.push(i),i=rr();if(n!==o)if((i=Lt())!==o){for(a=[],s=rr();s!==o;)a.push(s),s=rr();a!==o?(93===t.charCodeAt(At)?(s=y,At++):(s=o,0===Tt&&Ct(m)),s!==o?(St=e,e=r=g(i)):(At=e,e=u)):(At=e,e=u)}else At=e,e=u;else At=e,e=u}else At=e,e=u;return Pt[c]={nextPos:At,result:e},e}(),e===o&&(e=function(){var e,r,n,i,a,s,c,l,f=49*At+5,d=Pt[f];if(d)return At=d.nextPos,d.result;if(e=At,91===t.charCodeAt(At)?(r=h,At++):(r=o,0===Tt&&Ct(p)),r!==o)if(91===t.charCodeAt(At)?(n=h,At++):(n=o,0===Tt&&Ct(p)),n!==o){for(i=[],a=rr();a!==o;)i.push(a),a=rr();if(i!==o)if((a=Lt())!==o){for(s=[],c=rr();c!==o;)s.push(c),c=rr();s!==o?(93===t.charCodeAt(At)?(c=y,At++):(c=o,0===Tt&&Ct(m)),c!==o?(93===t.charCodeAt(At)?(l=y,At++):(l=o,0===Tt&&Ct(m)),l!==o?(St=e,e=r=v(a)):(At=e,e=u)):(At=e,e=u)):(At=e,e=u)}else At=e,e=u;else At=e,e=u}else At=e,e=u;else At=e,e=u;return Pt[f]={nextPos:At,result:e},e}(),e===o&&(e=function(){var e,r,n,i,a,s,c=49*At+9,l=Pt[c];if(l)return At=l.nextPos,l.result;if(e=At,(r=Ft())!==o){for(n=[],i=rr();i!==o;)n.push(i),i=rr();if(n!==o)if(61===t.charCodeAt(At)?(i=_,At++):(i=o,0===Tt&&Ct(E)),i!==o){for(a=[],s=rr();s!==o;)a.push(s),s=rr();a!==o&&(s=zt())!==o?(St=e,e=r=x(r,s)):(At=e,e=u)}else At=e,e=u;else At=e,e=u}else At=e,e=u;if(e===o)if(e=At,(r=Dt())!==o){for(n=[],i=rr();i!==o;)n.push(i),i=rr();if(n!==o)if(61===t.charCodeAt(At)?(i=_,At++):(i=o,0===Tt&&Ct(E)),i!==o){for(a=[],s=rr();s!==o;)a.push(s),s=rr();a!==o&&(s=zt())!==o?(St=e,e=r=x(r,s)):(At=e,e=u)}else At=e,e=u;else At=e,e=u}else At=e,e=u;return Pt[c]={nextPos:At,result:e},e}()))),Pt[r]={nextPos:At,result:e},e)}(),n!==o){for(i=[],a=rr();a!==o;)i.push(a),a=rr();if(i!==o){for(a=[],s=Nt();s!==o;)a.push(s),s=Nt();if(a!==o){if(s=[],(c=nr())!==o)for(;c!==o;)s.push(c),c=nr();else s=u;s===o&&(s=ir()),s!==o?e=r=[r,n,i,a,s]:(At=e,e=u)}else At=e,e=u}else At=e,e=u}else At=e,e=u;else At=e,e=u;if(e===o){if(e=At,r=[],(n=rr())!==o)for(;n!==o;)r.push(n),n=rr();else r=u;if(r!==o){if(n=[],(i=nr())!==o)for(;i!==o;)n.push(i),i=nr();else n=u;n===o&&(n=ir()),n!==o?e=r=[r,n]:(At=e,e=u)}else At=e,e=u;e===o&&(e=nr())}return Pt[l]={nextPos:At,result:e},e}function Nt(){var e,r,n,i,a,s,h=49*At+3,p=Pt[h];if(p)return At=p.nextPos,p.result;if(e=At,35===t.charCodeAt(At)?(r=c,At++):(r=o,0===Tt&&Ct(l)),r!==o){for(n=[],i=At,a=At,Tt++,(s=nr())===o&&(s=ir()),Tt--,s===o?a=f:(At=a,a=u),a!==o?(t.length>At?(s=t.charAt(At),At++):(s=o,0===Tt&&Ct(d)),s!==o?i=a=[a,s]:(At=i,i=u)):(At=i,i=u);i!==o;)n.push(i),i=At,a=At,Tt++,(s=nr())===o&&(s=ir()),Tt--,s===o?a=f:(At=a,a=u),a!==o?(t.length>At?(s=t.charAt(At),At++):(s=o,0===Tt&&Ct(d)),s!==o?i=a=[a,s]:(At=i,i=u)):(At=i,i=u);n!==o?e=r=[r,n]:(At=e,e=u)}else At=e,e=u;return Pt[h]={nextPos:At,result:e},e}function Lt(){var e,t,r,n=49*At+6,i=Pt[n];if(i)return At=i.nextPos,i.result;if(e=At,t=[],(r=Ut())!==o)for(;r!==o;)t.push(r),r=Ut();else t=u;return t!==o&&(r=jt())!==o?(St=e,e=t=b(t,r)):(At=e,e=u),e===o&&(e=At,(t=jt())!==o&&(St=e,t=w(t)),e=t),Pt[n]={nextPos:At,result:e},e}function jt(){var e,t,r,n,i,a=49*At+7,s=Pt[a];if(s)return At=s.nextPos,s.result;for(e=At,t=[],r=rr();r!==o;)t.push(r),r=rr();if(t!==o)if((r=Ft())!==o){for(n=[],i=rr();i!==o;)n.push(i),i=rr();n!==o?(St=e,e=t=A(r)):(At=e,e=u)}else At=e,e=u;else At=e,e=u;if(e===o){for(e=At,t=[],r=rr();r!==o;)t.push(r),r=rr();if(t!==o)if((r=Dt())!==o){for(n=[],i=rr();i!==o;)n.push(i),i=rr();n!==o?(St=e,e=t=A(r)):(At=e,e=u)}else At=e,e=u;else At=e,e=u}return Pt[a]={nextPos:At,result:e},e}function Ut(){var e,r,n,i,a,s,c,l=49*At+8,f=Pt[l];if(f)return At=f.nextPos,f.result;for(e=At,r=[],n=rr();n!==o;)r.push(n),n=rr();if(r!==o)if((n=Ft())!==o){for(i=[],a=rr();a!==o;)i.push(a),a=rr();if(i!==o)if(46===t.charCodeAt(At)?(a=S,At++):(a=o,0===Tt&&Ct(k)),a!==o){for(s=[],c=rr();c!==o;)s.push(c),c=rr();s!==o?(St=e,e=r=A(n)):(At=e,e=u)}else At=e,e=u;else At=e,e=u}else At=e,e=u;else At=e,e=u;if(e===o){for(e=At,r=[],n=rr();n!==o;)r.push(n),n=rr();if(r!==o)if((n=Dt())!==o){for(i=[],a=rr();a!==o;)i.push(a),a=rr();if(i!==o)if(46===t.charCodeAt(At)?(a=S,At++):(a=o,0===Tt&&Ct(k)),a!==o){for(s=[],c=rr();c!==o;)s.push(c),c=rr();s!==o?(St=e,e=r=A(n)):(At=e,e=u)}else At=e,e=u;else At=e,e=u}else At=e,e=u;else At=e,e=u}return Pt[l]={nextPos:At,result:e},e}function Ft(){var e,t,r,n=49*At+10,i=Pt[n];if(i)return At=i.nextPos,i.result;if(e=At,t=[],(r=ur())!==o)for(;r!==o;)t.push(r),r=ur();else t=u;return t!==o&&(St=e,t=T(t)),e=t,Pt[n]={nextPos:At,result:e},e}function Dt(){var e,t,r=49*At+11,n=Pt[r];return n?(At=n.nextPos,n.result):(e=At,(t=qt())!==o&&(St=e,t=P(t)),(e=t)===o&&(e=At,(t=Ht())!==o&&(St=e,t=P(t)),e=t),Pt[r]={nextPos:At,result:e},e)}function zt(){var e,r=49*At+12,n=Pt[r];return n?(At=n.nextPos,n.result):(e=function(){var e,r=49*At+13,n=Pt[r];return n?(At=n.nextPos,n.result):(e=function(){var e,r,n,i,a,s=49*At+14,c=Pt[s];if(c)return At=c.nextPos,c.result;if(e=At,t.substr(At,3)===O?(r=O,At+=3):(r=o,0===Tt&&Ct(R)),r!==o)if((n=nr())===o&&(n=I),n!==o){for(i=[],a=Wt();a!==o;)i.push(a),a=Wt();i!==o?(t.substr(At,3)===O?(a=O,At+=3):(a=o,0===Tt&&Ct(R)),a!==o?(St=e,e=r=C(i)):(At=e,e=u)):(At=e,e=u)}else At=e,e=u;else At=e,e=u;return Pt[s]={nextPos:At,result:e},e}(),e===o&&(e=qt())===o&&(e=function(){var e,r,n,i,a,s=49*At+16,c=Pt[s];if(c)return At=c.nextPos,c.result;if(e=At,t.substr(At,3)===N?(r=N,At+=3):(r=o,0===Tt&&Ct(L)),r!==o)if((n=nr())===o&&(n=I),n!==o){for(i=[],a=Gt();a!==o;)i.push(a),a=Gt();i!==o?(t.substr(At,3)===N?(a=N,At+=3):(a=o,0===Tt&&Ct(L)),a!==o?(St=e,e=r=C(i)):(At=e,e=u)):(At=e,e=u)}else At=e,e=u;else At=e,e=u;return Pt[s]={nextPos:At,result:e},e}(),e===o&&(e=Ht())),Pt[r]={nextPos:At,result:e},e)}(),e===o&&(e=function(){var e,r,n,i,a,s=49*At+38,c=Pt[s];return c?(At=c.nextPos,c.result):(e=At,(r=tr())!==o?(84===t.charCodeAt(At)?(n=Te,At++):(n=o,0===Tt&&Ct(Pe)),n!==o?(i=function(){var e,r,n,i,a,s,c,l,f,d,h,p=49*At+36,y=Pt[p];return y?(At=y.nextPos,y.result):(e=At,r=At,(n=sr())!==o&&(i=sr())!==o?(58===t.charCodeAt(At)?(a=_e,At++):(a=o,0===Tt&&Ct(Ee)),a!==o&&(s=sr())!==o&&(c=sr())!==o?(58===t.charCodeAt(At)?(l=_e,At++):(l=o,0===Tt&&Ct(Ee)),l!==o&&(f=sr())!==o&&(d=sr())!==o?((h=er())===o&&(h=I),h!==o?r=n=[n,i,a,s,c,l,f,d,h]:(At=r,r=u)):(At=r,r=u)):(At=r,r=u)):(At=r,r=u),r!==o&&(St=e,r=xe(r)),e=r,Pt[p]={nextPos:At,result:e},e)}(),i!==o?(90===t.charCodeAt(At)?(a=Oe,At++):(a=o,0===Tt&&Ct(Re)),a!==o?(St=e,e=r=Ie(r,i)):(At=e,e=u)):(At=e,e=u)):(At=e,e=u)):(At=e,e=u),e===o&&(e=At,(r=tr())!==o?(84===t.charCodeAt(At)?(n=Te,At++):(n=o,0===Tt&&Ct(Pe)),n!==o?(i=function(){var e,r,n,i,a,s,c,l,f,d,h,p,y,m,g,v,b,w=49*At+37,A=Pt[w];return A?(At=A.nextPos,A.result):(e=At,r=At,(n=sr())!==o&&(i=sr())!==o?(58===t.charCodeAt(At)?(a=_e,At++):(a=o,0===Tt&&Ct(Ee)),a!==o&&(s=sr())!==o&&(c=sr())!==o?(58===t.charCodeAt(At)?(l=_e,At++):(l=o,0===Tt&&Ct(Ee)),l!==o&&(f=sr())!==o&&(d=sr())!==o?((h=er())===o&&(h=I),h!==o?(45===t.charCodeAt(At)?(p=$,At++):(p=o,0===Tt&&Ct(ee)),p===o&&(43===t.charCodeAt(At)?(p=Q,At++):(p=o,0===Tt&&Ct(Y))),p!==o&&(y=sr())!==o&&(m=sr())!==o?(58===t.charCodeAt(At)?(g=_e,At++):(g=o,0===Tt&&Ct(Ee)),g!==o&&(v=sr())!==o&&(b=sr())!==o?r=n=[n,i,a,s,c,l,f,d,h,p,y,m,g,v,b]:(At=r,r=u)):(At=r,r=u)):(At=r,r=u)):(At=r,r=u)):(At=r,r=u)):(At=r,r=u),r!==o&&(St=e,r=xe(r)),e=r,Pt[w]={nextPos:At,result:e},e)}(),i!==o?(St=e,e=r=Ce(r,i)):(At=e,e=u)):(At=e,e=u)):(At=e,e=u)),Pt[s]={nextPos:At,result:e},e)}(),e===o&&(e=function(){var e,r,n,i,a=49*At+23,s=Pt[a];return s?(At=s.nextPos,s.result):(e=At,(r=Xt())===o&&(r=Zt()),r!==o?(101===t.charCodeAt(At)?(n=V,At++):(n=o,0===Tt&&Ct(K)),n===o&&(69===t.charCodeAt(At)?(n=W,At++):(n=o,0===Tt&&Ct(G))),n!==o&&(i=Zt())!==o?(St=e,e=r=X(r,i)):(At=e,e=u)):(At=e,e=u),e===o&&(e=At,(r=Xt())!==o&&(St=e,r=Z(r)),e=r),Pt[a]={nextPos:At,result:e},e)}(),e===o&&(e=function(){var e,t,r=49*At+25,n=Pt[r];return n?(At=n.nextPos,n.result):(e=At,(t=Zt())!==o&&(St=e,t=re(t)),e=t,Pt[r]={nextPos:At,result:e},e)}(),e===o&&(e=function(){var e,r,n=49*At+27,i=Pt[n];return i?(At=i.nextPos,i.result):(e=At,t.substr(At,4)===ne?(r=ne,At+=4):(r=o,0===Tt&&Ct(oe)),r!==o&&(St=e,r=ie()),(e=r)===o&&(e=At,t.substr(At,5)===ae?(r=ae,At+=5):(r=o,0===Tt&&Ct(se)),r!==o&&(St=e,r=ue()),e=r),Pt[n]={nextPos:At,result:e},e)}(),e===o&&(e=function(){var e,r,n,i,a,s=49*At+28,c=Pt[s];if(c)return At=c.nextPos,c.result;if(e=At,91===t.charCodeAt(At)?(r=h,At++):(r=o,0===Tt&&Ct(p)),r!==o){for(n=[],i=Jt();i!==o;)n.push(i),i=Jt();n!==o?(93===t.charCodeAt(At)?(i=y,At++):(i=o,0===Tt&&Ct(m)),i!==o?(St=e,e=r=ce()):(At=e,e=u)):(At=e,e=u)}else At=e,e=u;if(e===o&&(e=At,91===t.charCodeAt(At)?(r=h,At++):(r=o,0===Tt&&Ct(p)),r!==o?((n=Qt())===o&&(n=I),n!==o?(93===t.charCodeAt(At)?(i=y,At++):(i=o,0===Tt&&Ct(m)),i!==o?(St=e,e=r=le(n)):(At=e,e=u)):(At=e,e=u)):(At=e,e=u),e===o)){if(e=At,91===t.charCodeAt(At)?(r=h,At++):(r=o,0===Tt&&Ct(p)),r!==o){if(n=[],(i=Yt())!==o)for(;i!==o;)n.push(i),i=Yt();else n=u;n!==o?(93===t.charCodeAt(At)?(i=y,At++):(i=o,0===Tt&&Ct(m)),i!==o?(St=e,e=r=fe(n)):(At=e,e=u)):(At=e,e=u)}else At=e,e=u;if(e===o)if(e=At,91===t.charCodeAt(At)?(r=h,At++):(r=o,0===Tt&&Ct(p)),r!==o){if(n=[],(i=Yt())!==o)for(;i!==o;)n.push(i),i=Yt();else n=u;n!==o&&(i=Qt())!==o?(93===t.charCodeAt(At)?(a=y,At++):(a=o,0===Tt&&Ct(m)),a!==o?(St=e,e=r=de(n,i)):(At=e,e=u)):(At=e,e=u)}else At=e,e=u}return Pt[s]={nextPos:At,result:e},e}(),e===o&&(e=function(){var e,r,n,i,a,s,c=49*At+32,l=Pt[c];if(l)return At=l.nextPos,l.result;if(e=At,123===t.charCodeAt(At)?(r=me,At++):(r=o,0===Tt&&Ct(ge)),r!==o){for(n=[],i=rr();i!==o;)n.push(i),i=rr();if(n!==o){for(i=[],a=$t();a!==o;)i.push(a),a=$t();if(i!==o){for(a=[],s=rr();s!==o;)a.push(s),s=rr();a!==o?(125===t.charCodeAt(At)?(s=ve,At++):(s=o,0===Tt&&Ct(be)),s!==o?(St=e,e=r=we(i)):(At=e,e=u)):(At=e,e=u)}else At=e,e=u}else At=e,e=u}else At=e,e=u;return Pt[c]={nextPos:At,result:e},e}())))))),Pt[r]={nextPos:At,result:e},e)}function qt(){var e,r,n,i,a=49*At+15,s=Pt[a];if(s)return At=s.nextPos,s.result;if(e=At,34===t.charCodeAt(At)?(r=M,At++):(r=o,0===Tt&&Ct(B)),r!==o){for(n=[],i=Vt();i!==o;)n.push(i),i=Vt();n!==o?(34===t.charCodeAt(At)?(i=M,At++):(i=o,0===Tt&&Ct(B)),i!==o?(St=e,e=r=C(n)):(At=e,e=u)):(At=e,e=u)}else At=e,e=u;return Pt[a]={nextPos:At,result:e},e}function Ht(){var e,r,n,i,a=49*At+17,s=Pt[a];if(s)return At=s.nextPos,s.result;if(e=At,39===t.charCodeAt(At)?(r=j,At++):(r=o,0===Tt&&Ct(U)),r!==o){for(n=[],i=Kt();i!==o;)n.push(i),i=Kt();n!==o?(39===t.charCodeAt(At)?(i=j,At++):(i=o,0===Tt&&Ct(U)),i!==o?(St=e,e=r=C(n)):(At=e,e=u)):(At=e,e=u)}else At=e,e=u;return Pt[a]={nextPos:At,result:e},e}function Vt(){var e,r,n,i=49*At+18,a=Pt[i];return a?(At=a.nextPos,a.result):((e=lr())===o&&(e=At,r=At,Tt++,34===t.charCodeAt(At)?(n=M,At++):(n=o,0===Tt&&Ct(B)),Tt--,n===o?r=f:(At=r,r=u),r!==o?(t.length>At?(n=t.charAt(At),At++):(n=o,0===Tt&&Ct(d)),n!==o?(St=e,e=r=F(n)):(At=e,e=u)):(At=e,e=u)),Pt[i]={nextPos:At,result:e},e)}function Kt(){var e,r,n,i=49*At+19,a=Pt[i];return a?(At=a.nextPos,a.result):(e=At,r=At,Tt++,39===t.charCodeAt(At)?(n=j,At++):(n=o,0===Tt&&Ct(U)),Tt--,n===o?r=f:(At=r,r=u),r!==o?(t.length>At?(n=t.charAt(At),At++):(n=o,0===Tt&&Ct(d)),n!==o?(St=e,e=r=F(n)):(At=e,e=u)):(At=e,e=u),Pt[i]={nextPos:At,result:e},e)}function Wt(){var e,r,n,i=49*At+20,a=Pt[i];return a?(At=a.nextPos,a.result):((e=lr())===o&&(e=function(){var e,r,n,i,a=49*At+21,s=Pt[a];if(s)return At=s.nextPos,s.result;if(e=At,92===t.charCodeAt(At)?(r=z,At++):(r=o,0===Tt&&Ct(q)),r!==o)if(nr()!==o){for(n=[],i=or();i!==o;)n.push(i),i=or();n!==o?(St=e,e=r=H()):(At=e,e=u)}else At=e,e=u;else At=e,e=u;return Pt[a]={nextPos:At,result:e},e}(),e===o&&(e=At,r=At,Tt++,t.substr(At,3)===O?(n=O,At+=3):(n=o,0===Tt&&Ct(R)),Tt--,n===o?r=f:(At=r,r=u),r!==o?(t.length>At?(n=t.charAt(At),At++):(n=o,0===Tt&&Ct(d)),n!==o?(St=e,e=r=D(n)):(At=e,e=u)):(At=e,e=u))),Pt[i]={nextPos:At,result:e},e)}function Gt(){var e,r,n,i=49*At+22,a=Pt[i];return a?(At=a.nextPos,a.result):(e=At,r=At,Tt++,t.substr(At,3)===N?(n=N,At+=3):(n=o,0===Tt&&Ct(L)),Tt--,n===o?r=f:(At=r,r=u),r!==o?(t.length>At?(n=t.charAt(At),At++):(n=o,0===Tt&&Ct(d)),n!==o?(St=e,e=r=F(n)):(At=e,e=u)):(At=e,e=u),Pt[i]={nextPos:At,result:e},e)}function Xt(){var e,r,n,i,a,s,c=49*At+24,l=Pt[c];return l?(At=l.nextPos,l.result):(e=At,43===t.charCodeAt(At)?(r=Q,At++):(r=o,0===Tt&&Ct(Y)),r===o&&(r=I),r!==o?(n=At,(i=cr())!==o?(46===t.charCodeAt(At)?(a=S,At++):(a=o,0===Tt&&Ct(k)),a!==o&&(s=cr())!==o?n=i=[i,a,s]:(At=n,n=u)):(At=n,n=u),n!==o?(St=e,e=r=J(n)):(At=e,e=u)):(At=e,e=u),e===o&&(e=At,45===t.charCodeAt(At)?(r=$,At++):(r=o,0===Tt&&Ct(ee)),r!==o?(n=At,(i=cr())!==o?(46===t.charCodeAt(At)?(a=S,At++):(a=o,0===Tt&&Ct(k)),a!==o&&(s=cr())!==o?n=i=[i,a,s]:(At=n,n=u)):(At=n,n=u),n!==o?(St=e,e=r=te(n)):(At=e,e=u)):(At=e,e=u)),Pt[c]={nextPos:At,result:e},e)}function Zt(){var e,r,n,i,a,s=49*At+26,c=Pt[s];if(c)return At=c.nextPos,c.result;if(e=At,43===t.charCodeAt(At)?(r=Q,At++):(r=o,0===Tt&&Ct(Y)),r===o&&(r=I),r!==o){if(n=[],(i=sr())!==o)for(;i!==o;)n.push(i),i=sr();else n=u;n!==o?(i=At,Tt++,46===t.charCodeAt(At)?(a=S,At++):(a=o,0===Tt&&Ct(k)),Tt--,a===o?i=f:(At=i,i=u),i!==o?(St=e,e=r=J(n)):(At=e,e=u)):(At=e,e=u)}else At=e,e=u;if(e===o)if(e=At,45===t.charCodeAt(At)?(r=$,At++):(r=o,0===Tt&&Ct(ee)),r!==o){if(n=[],(i=sr())!==o)for(;i!==o;)n.push(i),i=sr();else n=u;n!==o?(i=At,Tt++,46===t.charCodeAt(At)?(a=S,At++):(a=o,0===Tt&&Ct(k)),Tt--,a===o?i=f:(At=i,i=u),i!==o?(St=e,e=r=te(n)):(At=e,e=u)):(At=e,e=u)}else At=e,e=u;return Pt[s]={nextPos:At,result:e},e}function Qt(){var e,t,r,n,i,a=49*At+29,s=Pt[a];if(s)return At=s.nextPos,s.result;for(e=At,t=[],r=Jt();r!==o;)t.push(r),r=Jt();if(t!==o)if((r=zt())!==o){for(n=[],i=Jt();i!==o;)n.push(i),i=Jt();n!==o?(St=e,e=t=he(r)):(At=e,e=u)}else At=e,e=u;else At=e,e=u;return Pt[a]={nextPos:At,result:e},e}function Yt(){var e,r,n,i,a,s,c,l=49*At+30,f=Pt[l];if(f)return At=f.nextPos,f.result;for(e=At,r=[],n=Jt();n!==o;)r.push(n),n=Jt();if(r!==o)if((n=zt())!==o){for(i=[],a=Jt();a!==o;)i.push(a),a=Jt();if(i!==o)if(44===t.charCodeAt(At)?(a=pe,At++):(a=o,0===Tt&&Ct(ye)),a!==o){for(s=[],c=Jt();c!==o;)s.push(c),c=Jt();s!==o?(St=e,e=r=he(n)):(At=e,e=u)}else At=e,e=u;else At=e,e=u}else At=e,e=u;else At=e,e=u;return Pt[l]={nextPos:At,result:e},e}function Jt(){var e,t=49*At+31,r=Pt[t];return r?(At=r.nextPos,r.result):((e=rr())===o&&(e=nr())===o&&(e=Nt()),Pt[t]={nextPos:At,result:e},e)}function $t(){var e,r,n,i,a,s,c,l,f,d,h,p=49*At+33,y=Pt[p];if(y)return At=y.nextPos,y.result;for(e=At,r=[],n=rr();n!==o;)r.push(n),n=rr();if(r!==o)if((n=Ft())!==o){for(i=[],a=rr();a!==o;)i.push(a),a=rr();if(i!==o)if(61===t.charCodeAt(At)?(a=_,At++):(a=o,0===Tt&&Ct(E)),a!==o){for(s=[],c=rr();c!==o;)s.push(c),c=rr();if(s!==o)if((c=zt())!==o){for(l=[],f=rr();f!==o;)l.push(f),f=rr();if(l!==o)if(44===t.charCodeAt(At)?(f=pe,At++):(f=o,0===Tt&&Ct(ye)),f!==o){for(d=[],h=rr();h!==o;)d.push(h),h=rr();d!==o?(St=e,e=r=Ae(n,c)):(At=e,e=u)}else At=e,e=u;else At=e,e=u}else At=e,e=u;else At=e,e=u}else At=e,e=u;else At=e,e=u}else At=e,e=u;else At=e,e=u;if(e===o){for(e=At,r=[],n=rr();n!==o;)r.push(n),n=rr();if(r!==o)if((n=Ft())!==o){for(i=[],a=rr();a!==o;)i.push(a),a=rr();if(i!==o)if(61===t.charCodeAt(At)?(a=_,At++):(a=o,0===Tt&&Ct(E)),a!==o){for(s=[],c=rr();c!==o;)s.push(c),c=rr();s!==o&&(c=zt())!==o?(St=e,e=r=Ae(n,c)):(At=e,e=u)}else At=e,e=u;else At=e,e=u}else At=e,e=u;else At=e,e=u}return Pt[p]={nextPos:At,result:e},e}function er(){var e,r,n,i=49*At+34,a=Pt[i];return a?(At=a.nextPos,a.result):(e=At,46===t.charCodeAt(At)?(r=S,At++):(r=o,0===Tt&&Ct(k)),r!==o&&(n=cr())!==o?(St=e,e=r=Se(n)):(At=e,e=u),Pt[i]={nextPos:At,result:e},e)}function tr(){var e,r,n,i,a,s,c,l,f,d,h,p,y=49*At+35,m=Pt[y];return m?(At=m.nextPos,m.result):(e=At,r=At,(n=sr())!==o&&(i=sr())!==o&&(a=sr())!==o&&(s=sr())!==o?(45===t.charCodeAt(At)?(c=$,At++):(c=o,0===Tt&&Ct(ee)),c!==o&&(l=sr())!==o&&(f=sr())!==o?(45===t.charCodeAt(At)?(d=$,At++):(d=o,0===Tt&&Ct(ee)),d!==o&&(h=sr())!==o&&(p=sr())!==o?r=n=[n,i,a,s,c,l,f,d,h,p]:(At=r,r=u)):(At=r,r=u)):(At=r,r=u),r!==o&&(St=e,r=ke(r)),e=r,Pt[y]={nextPos:At,result:e},e)}function rr(){var e,r=49*At+39,n=Pt[r];return n?(At=n.nextPos,n.result):(Me.test(t.charAt(At))?(e=t.charAt(At),At++):(e=o,0===Tt&&Ct(Be)),Pt[r]={nextPos:At,result:e},e)}function nr(){var e,r,n,i=49*At+40,a=Pt[i];return a?(At=a.nextPos,a.result):(10===t.charCodeAt(At)?(e=Ne,At++):(e=o,0===Tt&&Ct(Le)),e===o&&(e=At,13===t.charCodeAt(At)?(r=je,At++):(r=o,0===Tt&&Ct(Ue)),r!==o?(10===t.charCodeAt(At)?(n=Ne,At++):(n=o,0===Tt&&Ct(Le)),n!==o?e=r=[r,n]:(At=e,e=u)):(At=e,e=u)),Pt[i]={nextPos:At,result:e},e)}function or(){var e,t=49*At+41,r=Pt[t];return r?(At=r.nextPos,r.result):((e=nr())===o&&(e=rr()),Pt[t]={nextPos:At,result:e},e)}function ir(){var e,r,n=49*At+42,i=Pt[n];return i?(At=i.nextPos,i.result):(e=At,Tt++,t.length>At?(r=t.charAt(At),At++):(r=o,0===Tt&&Ct(d)),Tt--,r===o?e=f:(At=e,e=u),Pt[n]={nextPos:At,result:e},e)}function ar(){var e,r=49*At+43,n=Pt[r];return n?(At=n.nextPos,n.result):(Fe.test(t.charAt(At))?(e=t.charAt(At),At++):(e=o,0===Tt&&Ct(De)),Pt[r]={nextPos:At,result:e},e)}function sr(){var e,r,n=49*At+44,i=Pt[n];return i?(At=i.nextPos,i.result):(ze.test(t.charAt(At))?(e=t.charAt(At),At++):(e=o,0===Tt&&Ct(qe)),e===o&&(e=At,95===t.charCodeAt(At)?(r=He,At++):(r=o,0===Tt&&Ct(Ve)),r!==o&&(St=e,r=Ke()),e=r),Pt[n]={nextPos:At,result:e},e)}function ur(){var e,r=49*At+45,n=Pt[r];return n?(At=n.nextPos,n.result):(We.test(t.charAt(At))?(e=t.charAt(At),At++):(e=o,0===Tt&&Ct(Ge)),Pt[r]={nextPos:At,result:e},e)}function cr(){var e,t,r,n=49*At+46,i=Pt[n];if(i)return At=i.nextPos,i.result;if(e=At,t=[],(r=sr())!==o)for(;r!==o;)t.push(r),r=sr();else t=u;return t!==o&&(St=e,t=Xe(t)),e=t,Pt[n]={nextPos:At,result:e},e}function lr(){var e,r,n=49*At+47,i=Pt[n];return i?(At=i.nextPos,i.result):(e=At,t.substr(At,2)===Ze?(r=Ze,At+=2):(r=o,0===Tt&&Ct(Qe)),r!==o&&(St=e,r=Ye()),(e=r)===o&&(e=At,t.substr(At,2)===Je?(r=Je,At+=2):(r=o,0===Tt&&Ct($e)),r!==o&&(St=e,r=et()),(e=r)===o&&(e=At,t.substr(At,2)===tt?(r=tt,At+=2):(r=o,0===Tt&&Ct(rt)),r!==o&&(St=e,r=nt()),(e=r)===o&&(e=At,t.substr(At,2)===ot?(r=ot,At+=2):(r=o,0===Tt&&Ct(it)),r!==o&&(St=e,r=at()),(e=r)===o&&(e=At,t.substr(At,2)===st?(r=st,At+=2):(r=o,0===Tt&&Ct(ut)),r!==o&&(St=e,r=ct()),(e=r)===o&&(e=At,t.substr(At,2)===lt?(r=lt,At+=2):(r=o,0===Tt&&Ct(ft)),r!==o&&(St=e,r=dt()),(e=r)===o&&(e=At,t.substr(At,2)===ht?(r=ht,At+=2):(r=o,0===Tt&&Ct(pt)),r!==o&&(St=e,r=yt()),(e=r)===o&&(e=function(){var e,r,n,i,a,s,c,l,f,d,h,p=49*At+48,y=Pt[p];return y?(At=y.nextPos,y.result):(e=At,t.substr(At,2)===mt?(r=mt,At+=2):(r=o,0===Tt&&Ct(gt)),r!==o?(n=At,(i=ar())!==o&&(a=ar())!==o&&(s=ar())!==o&&(c=ar())!==o&&(l=ar())!==o&&(f=ar())!==o&&(d=ar())!==o&&(h=ar())!==o?n=i=[i,a,s,c,l,f,d,h]:(At=n,n=u),n!==o?(St=e,e=r=vt(n)):(At=e,e=u)):(At=e,e=u),e===o&&(e=At,t.substr(At,2)===bt?(r=bt,At+=2):(r=o,0===Tt&&Ct(wt)),r!==o?(n=At,(i=ar())!==o&&(a=ar())!==o&&(s=ar())!==o&&(c=ar())!==o?n=i=[i,a,s,c]:(At=n,n=u),n!==o?(St=e,e=r=vt(n)):(At=e,e=u)):(At=e,e=u)),Pt[p]={nextPos:At,result:e},e)}()))))))),Pt[n]={nextPos:At,result:e},e)}var fr=[];function dr(e){fr.push(e)}function hr(e,t,r,n,o){var i={type:e,value:t,line:r(),column:n()};return o&&(i.key=o),i}if((r=a())!==o&&At===t.length)return r;throw r!==o&&Att.description?1:0}));t1?n.slice(0,-1).join(", ")+" or "+n[e.length-1]:n[0])+" but "+(t?'"'+function(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,(function(e){return"\\x0"+t(e)})).replace(/[\x10-\x1F\x80-\xFF]/g,(function(e){return"\\x"+t(e)})).replace(/[\u0180-\u0FFF]/g,(function(e){return"\\u0"+t(e)})).replace(/[\u1080-\uFFFF]/g,(function(e){return"\\u"+t(e)}))}(t)+'"':"end of input")+" found."}(n,a),n,a,o,i.line,i.column)}(null,xt,Et)}}}()},2251:function(e,t,r){var n,o;!function(i,a){"use strict";e.exports?e.exports=a():void 0===(o="function"==typeof(n=a)?n.call(t,r,t,e):n)||(e.exports=o)}(0,(function(e){"use strict";var t=e&&e.IPv6;return{best:function(e){var t,r,n=e.toLowerCase().split(":"),o=n.length,i=8;for(""===n[0]&&""===n[1]&&""===n[2]?(n.shift(),n.shift()):""===n[0]&&""===n[1]?n.shift():""===n[o-1]&&""===n[o-2]&&n.pop(),-1!==n[(o=n.length)-1].indexOf(".")&&(i=7),t=0;t1;s++)r.splice(0,1);n[a]=r.join("")}var u=-1,c=0,l=0,f=-1,d=!1;for(a=0;ac&&(u=f,c=l)):"0"===n[a]&&(d=!0,f=a,l=1);l>c&&(u=f,c=l),c>1&&n.splice(u,c,""),o=n.length;var h="";for(""===n[0]&&(h=":"),a=0;a=e.length-1)return!1;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return!1;var o=r.list[e.slice(t+1)];return!!o&&o.indexOf(" "+e.slice(n+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;var n=r.list[e.slice(t+1)];return!!n&&n.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return null;var o=r.list[e.slice(t+1)];return o?o.indexOf(" "+e.slice(n+1,t)+" ")<0?null:e.slice(n+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return r}))},4998:function(e,t,r){var n,o,i;!function(a,s){"use strict";e.exports?e.exports=s(r(3132),r(2251),r(8640)):(o=[r(3132),r(2251),r(8640)],void 0===(i="function"==typeof(n=s)?n.apply(t,o):n)||(e.exports=i))}(0,(function(e,t,r,n){"use strict";var o=n&&n.URI;function i(e,t){var r=arguments.length>=1;if(!(this instanceof i))return r?arguments.length>=2?new i(e,t):new i(e):new i;if(void 0===e){if(r)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&r)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}i.version="1.19.11";var a=i.prototype,s=Object.prototype.hasOwnProperty;function u(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function l(e){return"Array"===c(e)}function f(e,t){var r,n,o={};if("RegExp"===c(t))o=null;else if(l(t))for(r=0,n=t.length;r]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?\xab\xbb\u201c\u201d\u201e\u2018\u2019]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},i.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return i.domAttributes[t]}},i.encode=m,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=m,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(e,t){var r=i.encode(e+"");return void 0===t&&(t=i.escapeQuerySpace),t?r.replace(/%20/g,"+"):r},i.decodeQuery=function(e,t){e+="",void 0===t&&(t=i.escapeQuerySpace);try{return i.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var g,v={encode:"encode",decode:"decode"},b=function(e,t){return function(r){try{return i[t](r+"").replace(i.characters[e][t].expression,(function(r){return i.characters[e][t].map[r]}))}catch(e){return r}}};for(g in v)i[g+"PathSegment"]=b("pathname",v[g]),i[g+"UrnPathSegment"]=b("urnpath",v[g]);var w=function(e,t,r){return function(n){var o;o=r?function(e){return i[t](i[r](e))}:i[t];for(var a=(n+"").split(e),s=0,u=a.length;s-1&&(t.fragment=e.substring(r+1)||null,e=e.substring(0,r)),(r=e.indexOf("?"))>-1&&(t.query=e.substring(r+1)||null,e=e.substring(0,r)),"//"===(e=(e=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=i.parseAuthority(e,t)):(r=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,r)||null,t.protocol&&!t.protocol.match(i.protocol_expression)?t.protocol=void 0:"//"===e.substring(r+1,r+3).replace(/\\/g,"/")?(e=e.substring(r+3),e=i.parseAuthority(e,t)):(e=e.substring(r+1),t.urn=!0)),t.path=e,t},i.parseHost=function(e,t){e||(e="");var r,n,o=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===o&&(o=e.length),"["===e.charAt(0))r=e.indexOf("]"),t.hostname=e.substring(1,r)||null,t.port=e.substring(r+2,o)||null,"/"===t.port&&(t.port=null);else{var a=e.indexOf(":"),s=e.indexOf("/"),u=e.indexOf(":",a+1);-1!==u&&(-1===s||u-1?o:e.length-1);return a>-1&&(-1===o||a-1?h.slice(0,p)+h.slice(p).replace(a,""):h.replace(a,"")).length<=c[0].length||r.ignore&&r.ignore.test(h))){var g=t(h,l,d=l+h.length,e);void 0!==g?(g=String(g),e=e.slice(0,l)+g+e.slice(d),n.lastIndex=l+g.length):n.lastIndex=d}}return n.lastIndex=0,e},i.ensureValidHostname=function(t,r){var n=!!t,o=!1;if(!!r&&(o=d(i.hostProtocols,r)),o&&!n)throw new TypeError("Hostname cannot be empty, if protocol is "+r);if(t&&t.match(i.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},i.noConflict=function(e){if(e){var t={URI:this.noConflict()};return n.URITemplate&&"function"==typeof n.URITemplate.noConflict&&(t.URITemplate=n.URITemplate.noConflict()),n.IPv6&&"function"==typeof n.IPv6.noConflict&&(t.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&"function"==typeof n.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=n.SecondLevelDomains.noConflict()),t}return n.URI===this&&(n.URI=o),this},a.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new i(this)},a.valueOf=a.toString=function(){return this.build(!1)._string},a.protocol=A("protocol"),a.username=A("username"),a.password=A("password"),a.hostname=A("hostname"),a.port=A("port"),a.query=S("query","?"),a.fragment=S("fragment","#"),a.search=function(e,t){var r=this.query(e,t);return"string"==typeof r&&r.length?"?"+r:r},a.hash=function(e,t){var r=this.fragment(e,t);return"string"==typeof r&&r.length?"#"+r:r},a.pathname=function(e,t){if(void 0===e||!0===e){var r=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?i.decodeUrnPath:i.decodePath)(r):r}return this._parts.urn?this._parts.path=e?i.recodeUrnPath(e):"":this._parts.path=e?i.recodePath(e):"/",this.build(!t),this},a.path=a.pathname,a.href=function(e,t){var r;if(void 0===e)return this.toString();this._string="",this._parts=i._parts();var n=e instanceof i,o="object"==typeof e&&(e.hostname||e.path||e.pathname);if(e.nodeName&&(e=e[i.getDomAttribute(e)]||"",o=!1),!n&&o&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=i.parse(String(e),this._parts);else{if(!n&&!o)throw new TypeError("invalid input");var a=n?e._parts:e;for(r in a)"query"!==r&&s.call(this._parts,r)&&(this._parts[r]=a[r]);a.query&&this.query(a.query,!1)}return this.build(!t),this},a.is=function(e){var t=!1,n=!1,o=!1,a=!1,s=!1,u=!1,c=!1,l=!this._parts.urn;switch(this._parts.hostname&&(l=!1,n=i.ip4_expression.test(this._parts.hostname),o=i.ip6_expression.test(this._parts.hostname),s=(a=!(t=n||o))&&r&&r.has(this._parts.hostname),u=a&&i.idn_expression.test(this._parts.hostname),c=a&&i.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return l;case"absolute":return!l;case"domain":case"name":return a;case"sld":return s;case"ip":return t;case"ip4":case"ipv4":case"inet4":return n;case"ip6":case"ipv6":case"inet6":return o;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var k=a.protocol,_=a.port,E=a.hostname;a.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(i.protocol_expression))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return k.call(this,e,t)},a.scheme=a.protocol,a.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(":"===(e+="").charAt(0)&&(e=e.substring(1)),i.ensureValidPort(e))),_.call(this,e,t))},a.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==i.parseHost(e,r))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=r.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(e,this._parts.protocol)}return E.call(this,e,t)},a.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var r=this.protocol();return this.authority()?(r?r+"://":"")+this.authority():""}var n=i(e);return this.protocol(n.protocol()).authority(n.authority()).build(!t),this},a.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildHost(this._parts):"";if("/"!==i.parseHost(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},a.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildAuthority(this._parts):"";if("/"!==i.parseAuthority(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},a.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var r=i.buildUserinfo(this._parts);return r?r.substring(0,r.length-1):r}return"@"!==e[e.length-1]&&(e+="@"),i.parseUserinfo(e,this._parts),this.build(!t),this},a.resource=function(e,t){var r;return void 0===e?this.path()+this.search()+this.hash():(r=i.parse(e),this._parts.path=r.path,this._parts.query=r.query,this._parts.fragment=r.fragment,this.build(!t),this)},a.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,r)||""}var n=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,n),a=new RegExp("^"+u(o));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&i.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(a,e),this.build(!t),this},a.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.match(/\./g);if(r&&r.length<2)return this._parts.hostname;var n=this._parts.hostname.length-this.tld(t).length-1;return n=this._parts.hostname.lastIndexOf(".",n-1)+1,this._parts.hostname.substring(n)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(i.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var o=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,e)}return this.build(!t),this},a.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(n+1);return!0!==t&&r&&r.list[o.toLowerCase()]&&r.get(this._parts.hostname)||o}var i;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!r||!r.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}return this.build(!t),this},a.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var r=this._parts.path.length-this.filename().length-1,n=this._parts.path.substring(0,r)||(this._parts.hostname?"/":"");return e?i.decodePath(n):n}var o=this._parts.path.length-this.filename().length,a=this._parts.path.substring(0,o),s=new RegExp("^"+u(a));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e),this.build(!t),this},a.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!=typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var r=this._parts.path.lastIndexOf("/"),n=this._parts.path.substring(r+1);return e?i.decodePathSegment(n):n}var o=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(o=!0);var a=new RegExp(u(this.filename())+"$");return e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e),o?this.normalizePath(t):this.build(!t),this},a.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var r,n,o=this.filename(),a=o.lastIndexOf(".");return-1===a?"":(r=o.substring(a+1),n=/^[a-z0-9%]+$/i.test(r)?r:"",e?i.decodePathSegment(n):n)}"."===e.charAt(0)&&(e=e.substring(1));var s,c=this.suffix();if(c)s=e?new RegExp(u(c)+"$"):new RegExp(u("."+c)+"$");else{if(!e)return this;this._parts.path+="."+i.recodePath(e)}return s&&(e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e)),this.build(!t),this},a.segment=function(e,t,r){var n=this._parts.urn?":":"/",o=this.path(),i="/"===o.substring(0,1),a=o.split(n);if(void 0!==e&&"number"!=typeof e&&(r=t,t=e,e=void 0),void 0!==e&&"number"!=typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(i&&a.shift(),e<0&&(e=Math.max(a.length+e,0)),void 0===t)return void 0===e?a:a[e];if(null===e||void 0===a[e])if(l(t)){a=[];for(var s=0,u=t.length;s{}"`^| \\]/,o.expand=function(e,t,r){var n,i,a,u=s[e.operator],c=u.named?"Named":"Unnamed",l=e.variables,f=[];for(a=0;i=l[a];a++){if(0===(n=t.get(i.name)).type&&r&&r.strict)throw new Error('Missing expansion value for variable "'+i.name+'"');if(n.val.length){if(n.type>1&&i.maxlength)throw new Error('Invalid expression: Prefix modifier not applicable to variable "'+i.name+'"');f.push(o["expand"+c](n,u,i.explode,i.explode&&u.separator||",",i.maxlength,i.name))}else n.type&&f.push("")}return f.length?u.prefix+f.join(u.separator):""},o.expandNamed=function(t,r,n,o,i,a){var s,u,c,l="",f=r.encode,d=r.empty_name_separator,h=!t[f].length,p=2===t.type?"":e[f](a);for(u=0,c=t.val.length;u= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=u-1,g=Math.floor,v=String.fromCharCode;function b(e){throw new RangeError(y[e])}function w(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function A(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+w((e=e.replace(p,".")).split("."),t).join(".")}function S(e){for(var t,r,n=[],o=0,i=e.length;o=55296&&t<=56319&&o65535&&(t+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+v(e)})).join("")}function _(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function E(e,t,r){var n=0;for(e=r?g(e/f):e>>1,e+=g(e/t);e>m*c>>1;n+=u)e=g(e/m);return g(n+(m+1)*e/(e+l))}function x(e){var t,r,n,o,i,a,l,f,d,h,p,y=[],m=e.length,v=0,w=128,A=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n=128&&b("not-basic"),y.push(e.charCodeAt(n));for(o=r>0?r+1:0;o=m&&b("invalid-input"),((f=(p=e.charCodeAt(o++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:u)>=u||f>g((s-v)/a))&&b("overflow"),v+=f*a,!(f<(d=l<=A?1:l>=A+c?c:l-A));l+=u)a>g(s/(h=u-d))&&b("overflow"),a*=h;A=E(v-i,t=y.length+1,0==i),g(v/t)>s-w&&b("overflow"),w+=g(v/t),v%=t,y.splice(v++,0,w)}return k(y)}function T(e){var t,r,n,o,i,a,l,f,d,h,p,y,m,w,A,k=[];for(y=(e=S(e)).length,t=128,r=0,i=72,a=0;a=t&&pg((s-r)/(m=n+1))&&b("overflow"),r+=(l-t)*m,t=l,a=0;as&&b("overflow"),p==t){for(f=r,d=u;!(f<(h=d<=i?1:d>=i+c?c:d-i));d+=u)A=f-h,w=u-h,k.push(v(_(h+A%w,0))),f=g(A/w);k.push(v(_(f,0))),i=E(r,m,n==o),r=0,++n}++r,++t}return k.join("")}a={version:"1.3.2",ucs2:{decode:S,encode:k},decode:x,encode:T,toASCII:function(e){return A(e,(function(e){return h.test(e)?"xn--"+T(e):e}))},toUnicode:function(e){return A(e,(function(e){return d.test(e)?x(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return a}.call(t,r,t,e))||(e.exports=n)}()},2511:function(e,t,r){var n;e=r.nmd(e),function(o){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof r.g&&r.g;i.global!==i&&i.window!==i&&i.self;var a,s=2147483647,u=36,c=26,l=38,f=700,d=/^xn--/,h=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=u-1,g=Math.floor,v=String.fromCharCode;function b(e){throw new RangeError(y[e])}function w(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function A(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+w((e=e.replace(p,".")).split("."),t).join(".")}function S(e){for(var t,r,n=[],o=0,i=e.length;o=55296&&t<=56319&&o65535&&(t+=v((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+v(e)})).join("")}function _(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function E(e,t,r){var n=0;for(e=r?g(e/f):e>>1,e+=g(e/t);e>m*c>>1;n+=u)e=g(e/m);return g(n+(m+1)*e/(e+l))}function x(e){var t,r,n,o,i,a,l,f,d,h,p,y=[],m=e.length,v=0,w=128,A=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n=128&&b("not-basic"),y.push(e.charCodeAt(n));for(o=r>0?r+1:0;o=m&&b("invalid-input"),((f=(p=e.charCodeAt(o++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:u)>=u||f>g((s-v)/a))&&b("overflow"),v+=f*a,!(f<(d=l<=A?1:l>=A+c?c:l-A));l+=u)a>g(s/(h=u-d))&&b("overflow"),a*=h;A=E(v-i,t=y.length+1,0==i),g(v/t)>s-w&&b("overflow"),w+=g(v/t),v%=t,y.splice(v++,0,w)}return k(y)}function T(e){var t,r,n,o,i,a,l,f,d,h,p,y,m,w,A,k=[];for(y=(e=S(e)).length,t=128,r=0,i=72,a=0;a=t&&pg((s-r)/(m=n+1))&&b("overflow"),r+=(l-t)*m,t=l,a=0;as&&b("overflow"),p==t){for(f=r,d=u;!(f<(h=d<=i?1:d>=i+c?c:d-i));d+=u)A=f-h,w=u-h,k.push(v(_(h+A%w,0))),f=g(A/w);k.push(v(_(f,0))),i=E(r,m,n==o),r=0,++n}++r,++t}return k.join("")}a={version:"1.4.1",ucs2:{decode:S,encode:k},decode:x,encode:T,toASCII:function(e){return A(e,(function(e){return h.test(e)?"xn--"+T(e):e}))},toUnicode:function(e){return A(e,(function(e){return d.test(e)?x(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return a}.call(t,r,t,e))||(e.exports=n)}()},8575:(e,t,r)=>{"use strict";var n=r(2511);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var i=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(u),l=["%","/","?",";","#"].concat(c),f=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=r(129);function v(e,t,r){if(e&&"object"==typeof e&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),a=-1!==o&&o127?C+="x":C+=I[M];if(!C.match(d)){var N=O.slice(0,x),L=O.slice(x+1),j=I.match(h);j&&(N.push(j[1]),L.unshift(j[2])),L.length&&(v="/"+L.join(".")+v),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=n.toASCII(this.hostname));var U=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+U,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!p[A])for(x=0,R=c.length;x0)&&r.host.split("@"))&&(r.auth=P.shift(),r.hostname=P.shift(),r.host=r.hostname)),r.search=e.search,r.query=e.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var _=S.slice(-1)[0],E=(r.host||e.host||S.length>1)&&("."===_||".."===_)||""===_,x=0,T=S.length;T>=0;T--)"."===(_=S[T])?S.splice(T,1):".."===_?(S.splice(T,1),x++):x&&(S.splice(T,1),x--);if(!w&&!A)for(;x--;x)S.unshift("..");!w||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),E&&"/"!==S.join("/").substr(-1)&&S.push("");var P,O=""===S[0]||S[0]&&"/"===S[0].charAt(0);return k&&(r.hostname=O?"":S.length?S.shift():"",r.host=r.hostname,(P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=P.shift(),r.hostname=P.shift(),r.host=r.hostname)),(w=w||r.host&&S.length)&&!O&&S.unshift(""),S.length>0?r.pathname=S.join("/"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},t.parse=v,t.resolve=function(e,t){return v(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},t.format=function(e){return"string"==typeof e&&(e=v(e)),e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o},4927:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},384:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},5955:(e,t,r)=>{"use strict";var n=r(2584),o=r(8662),i=r(6430),a=r(5692);function s(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,l=s(Object.prototype.toString),f=s(Number.prototype.valueOf),d=s(String.prototype.valueOf),h=s(Boolean.prototype.valueOf);if(u)var p=s(BigInt.prototype.valueOf);if(c)var y=s(Symbol.prototype.valueOf);function m(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function g(e){return"[object Map]"===l(e)}function v(e){return"[object Set]"===l(e)}function b(e){return"[object WeakMap]"===l(e)}function w(e){return"[object WeakSet]"===l(e)}function A(e){return"[object ArrayBuffer]"===l(e)}function S(e){return"undefined"!=typeof ArrayBuffer&&(A.working?A(e):e instanceof ArrayBuffer)}function k(e){return"[object DataView]"===l(e)}function _(e){return"undefined"!=typeof DataView&&(k.working?k(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=o,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||_(e)},t.isUint8Array=function(e){return"Uint8Array"===i(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===i(e)},t.isUint16Array=function(e){return"Uint16Array"===i(e)},t.isUint32Array=function(e){return"Uint32Array"===i(e)},t.isInt8Array=function(e){return"Int8Array"===i(e)},t.isInt16Array=function(e){return"Int16Array"===i(e)},t.isInt32Array=function(e){return"Int32Array"===i(e)},t.isFloat32Array=function(e){return"Float32Array"===i(e)},t.isFloat64Array=function(e){return"Float64Array"===i(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===i(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===i(e)},g.working="undefined"!=typeof Map&&g(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(g.working?g(e):e instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(v.working?v(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},A.working="undefined"!=typeof ArrayBuffer&&A(new ArrayBuffer),t.isArrayBuffer=S,k.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&k(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=_;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function x(e){return"[object SharedArrayBuffer]"===l(e)}function T(e){return void 0!==E&&(void 0===x.working&&(x.working=x(new E)),x.working?x(e):e instanceof E)}function P(e){return m(e,f)}function O(e){return m(e,d)}function R(e){return m(e,h)}function I(e){return u&&m(e,p)}function C(e){return c&&m(e,y)}t.isSharedArrayBuffer=T,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===l(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===l(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===l(e)},t.isGeneratorObject=function(e){return"[object Generator]"===l(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===l(e)},t.isNumberObject=P,t.isStringObject=O,t.isBooleanObject=R,t.isBigIntObject=I,t.isSymbolObject=C,t.isBoxedPrimitive=function(e){return P(e)||O(e)||R(e)||I(e)||C(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(S(e)||T(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},9539:(e,t,r)=>{var n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(r)?n.showHidden=r:r&&t._extend(n,r),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),f(n,e,n.depth)}function c(e,t){var r=u.styles[t];return r?"\x1b["+u.colors[r][0]+"m"+e+"\x1b["+u.colors[r][1]+"m":e}function l(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&_(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return v(o)||(o=f(e,o,n)),o}var i=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):y(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(e,r);if(i)return i;var a=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),k(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return d(r);if(0===a.length){if(_(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(w(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return e.stylize(Date.prototype.toString.call(r),"date");if(k(r))return d(r)}var c,l="",A=!1,E=["{","}"];return p(r)&&(A=!0,E=["[","]"]),_(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),w(r)&&(l=" "+RegExp.prototype.toString.call(r)),S(r)&&(l=" "+Date.prototype.toUTCString.call(r)),k(r)&&(l=" "+d(r)),0!==a.length||A&&0!=r.length?n<0?w(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=A?function(e,t,r,n,o){for(var i=[],a=0,s=t.length;a60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,l,E)):E[0]+l+E[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,o,i){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),P(n,o)||(a="["+o+"]"),s||(e.seen.indexOf(u.value)<0?(s=m(r)?f(e,u.value,null):f(e,u.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),b(a)){if(i&&o.match(/^\d+$/))return s;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function p(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function m(e){return null===e}function g(e){return"number"==typeof e}function v(e){return"string"==typeof e}function b(e){return void 0===e}function w(e){return A(e)&&"[object RegExp]"===E(e)}function A(e){return"object"==typeof e&&null!==e}function S(e){return A(e)&&"[object Date]"===E(e)}function k(e){return A(e)&&("[object Error]"===E(e)||e instanceof Error)}function _(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function x(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!i[e])if(a.test(e)){var r=process.pid;i[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else i[e]=function(){};return i[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(5955),t.isArray=p,t.isBoolean=y,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=b,t.isRegExp=w,t.types.isRegExp=w,t.isObject=A,t.isDate=S,t.types.isDate=S,t.isError=k,t.types.isNativeError=k,t.isFunction=_,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(384);var T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[x((e=new Date).getHours()),x(e.getMinutes()),x(e.getSeconds())].join(":"),[e.getDate(),T[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(5717),t._extend=function(e,t){if(!t||!A(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var O="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(O&&e[O]){var t;if("function"!=typeof(t=e[O]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,O,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),o=[],i=0;i{"use strict";var n=r(4029),o=r(3083),i=r(5559),a=r(1924),s=r(7296),u=a("Object.prototype.toString"),c=r(6410)(),l="undefined"==typeof globalThis?r.g:globalThis,f=o(),d=a("String.prototype.slice"),h=Object.getPrototypeOf,p=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1?t:"Object"===t&&function(e){var t=!1;return n(y,(function(r,n){if(!t)try{r(e),t=d(n,1)}catch(e){}})),t}(e)}return s?function(e){var t=!1;return n(y,(function(r,n){if(!t)try{"$"+r(e)===n&&(t=d(n,1))}catch(e){}})),t}(e):null}},7529:e=>{e.exports=function(){for(var e={},r=0;r{},4654:()=>{},2361:()=>{},4616:()=>{},3083:(e,t,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],o="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t{"use strict";n.d(t,{Z:()=>Ge});var o={};function i(e,t){return function(){return e.apply(t,arguments)}}n.r(o),n.d(o,{hasBrowserEnv:()=>ie,hasStandardBrowserEnv:()=>ae,hasStandardBrowserWebWorkerEnv:()=>ue});const{toString:a}=Object.prototype,{getPrototypeOf:s}=Object,u=(c=Object.create(null),e=>{const t=a.call(e);return c[t]||(c[t]=t.slice(8,-1).toLowerCase())});var c;const l=e=>(e=e.toLowerCase(),t=>u(t)===e),f=e=>t=>typeof t===e,{isArray:d}=Array,h=f("undefined"),p=l("ArrayBuffer"),y=f("string"),m=f("function"),g=f("number"),v=e=>null!==e&&"object"==typeof e,b=e=>{if("object"!==u(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},w=l("Date"),A=l("File"),S=l("Blob"),k=l("FileList"),_=l("URLSearchParams");function E(e,t){let r,n,{allOwnKeys:o=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!=e)if("object"!=typeof e&&(e=[e]),d(e))for(r=0,n=e.length;r0;)if(n=r[o],t===n.toLowerCase())return n;return null}const T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,P=e=>!h(e)&&e!==T,O=(R="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>R&&e instanceof R);var R;const I=l("HTMLFormElement"),C=(e=>{let{hasOwnProperty:t}=e;return(e,r)=>t.call(e,r)})(Object.prototype),M=l("RegExp"),B=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};E(r,((r,o)=>{let i;!1!==(i=t(r,o,e))&&(n[o]=i||r)})),Object.defineProperties(e,n)},N="abcdefghijklmnopqrstuvwxyz",L="0123456789",j={DIGIT:L,ALPHA:N,ALPHA_DIGIT:N+N.toUpperCase()+L},U=l("AsyncFunction"),F={isArray:d,isArrayBuffer:p,isBuffer:function(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&m(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||m(e.append)&&("formdata"===(t=u(e))||"object"===t&&m(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer),t},isString:y,isNumber:g,isBoolean:e=>!0===e||!1===e,isObject:v,isPlainObject:b,isUndefined:h,isDate:w,isFile:A,isBlob:S,isRegExp:M,isFunction:m,isStream:e=>v(e)&&m(e.pipe),isURLSearchParams:_,isTypedArray:O,isFileList:k,forEach:E,merge:function e(){const{caseless:t}=P(this)&&this||{},r={},n=(n,o)=>{const i=t&&x(r,o)||o;b(r[i])&&b(n)?r[i]=e(r[i],n):b(n)?r[i]=e({},n):d(n)?r[i]=n.slice():r[i]=n};for(let o=0,i=arguments.length;o3&&void 0!==arguments[3]?arguments[3]:{};return E(t,((t,n)=>{r&&m(t)?e[n]=i(t,r):e[n]=t}),{allOwnKeys:n}),e},trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,i,a;const u={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],n&&!n(a,e,t)||u[a]||(t[a]=e[a],u[a]=!0);e=!1!==r&&s(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:u,kindOfTest:l,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!g(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:I,hasOwnProperty:C,hasOwnProp:C,reduceDescriptors:B,freezeMethods:e=>{B(e,((t,r)=>{if(m(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];m(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return d(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:x,global:T,isContextDefined:P,ALPHABET:j,generateString:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:j.ALPHA_DIGIT,r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&m(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(v(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const o=d(e)?[]:{};return E(e,((e,t)=>{const i=r(e,n+1);!h(i)&&(o[t]=i)})),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:U,isThenable:e=>e&&(v(e)||m(e))&&m(e.then)&&m(e.catch)};function D(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}F.inherits(D,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:F.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const z=D.prototype,q={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{q[e]={value:e}})),Object.defineProperties(D,q),Object.defineProperty(z,"isAxiosError",{value:!0}),D.from=(e,t,r,n,o,i)=>{const a=Object.create(z);return F.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),D.call(a,e.message,t,r,n,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};const H=D;var V=n(8764).Buffer;function K(e){return F.isPlainObject(e)||F.isArray(e)}function W(e){return F.endsWith(e,"[]")?e.slice(0,-2):e}function G(e,t,r){return e?e.concat(t).map((function(e,t){return e=W(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const X=F.toFlatObject(F,{},null,(function(e){return/^is[A-Z]/.test(e)})),Z=function(e,t,r){if(!F.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=F.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!F.isUndefined(t[e])}))).metaTokens,o=r.visitor||c,i=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&F.isSpecCompliantForm(t);if(!F.isFunction(o))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(F.isDate(e))return e.toISOString();if(!s&&F.isBlob(e))throw new H("Blob is not supported. Use a Buffer instead.");return F.isArrayBuffer(e)||F.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):V.from(e):e}function c(e,r,o){let s=e;if(e&&!o&&"object"==typeof e)if(F.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(F.isArray(e)&&function(e){return F.isArray(e)&&!e.some(K)}(e)||(F.isFileList(e)||F.endsWith(r,"[]"))&&(s=F.toArray(e)))return r=W(r),s.forEach((function(e,n){!F.isUndefined(e)&&null!==e&&t.append(!0===a?G([r],n,i):null===a?r:r+"[]",u(e))})),!1;return!!K(e)||(t.append(G(o,r,i),u(e)),!1)}const l=[],f=Object.assign(X,{defaultVisitor:c,convertValue:u,isVisitable:K});if(!F.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!F.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),F.forEach(r,(function(r,i){!0===(!(F.isUndefined(r)||null===r)&&o.call(t,r,F.isString(i)?i.trim():i,n,f))&&e(r,n?n.concat(i):[i])})),l.pop()}}(e),t};function Q(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Y(e,t){this._pairs=[],e&&Z(e,this,t)}const J=Y.prototype;J.append=function(e,t){this._pairs.push([e,t])},J.toString=function(e){const t=e?function(t){return e.call(this,t,Q)}:Q;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const $=Y;function ee(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function te(e,t,r){if(!t)return e;const n=r&&r.encode||ee,o=r&&r.serialize;let i;if(i=o?o(t,r):F.isURLSearchParams(t)?t.toString():new $(t,r).toString(n),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const re=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){F.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ne={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},oe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:$,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ie="undefined"!=typeof window&&"undefined"!=typeof document,ae=(se="undefined"!=typeof navigator&&navigator.product,ie&&["ReactNative","NativeScript","NS"].indexOf(se)<0);var se;const ue="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ce={...o,...oe},le=function(e){function t(e,r,n,o){let i=e[o++];const a=Number.isFinite(+i),s=o>=e.length;return i=!i&&F.isArray(n)?n.length:i,s?(F.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a):(n[i]&&F.isObject(n[i])||(n[i]=[]),t(e,r,n[i],o)&&F.isArray(n[i])&&(n[i]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n{t(function(e){return F.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null},fe={transitional:ne,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=F.isObject(e);if(o&&F.isHTMLForm(e)&&(e=new FormData(e)),F.isFormData(e))return n&&n?JSON.stringify(le(e)):e;if(F.isArrayBuffer(e)||F.isBuffer(e)||F.isStream(e)||F.isFile(e)||F.isBlob(e))return e;if(F.isArrayBufferView(e))return e.buffer;if(F.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Z(e,new ce.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return ce.isNode&&F.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=F.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Z(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e,t,r){if(F.isString(e))try{return(0,JSON.parse)(e),F.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||fe.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&F.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw H.from(e,H.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ce.classes.FormData,Blob:ce.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};F.forEach(["delete","get","head","post","put","patch"],(e=>{fe.headers[e]={}}));const de=fe,he=F.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),pe=Symbol("internals");function ye(e){return e&&String(e).trim().toLowerCase()}function me(e){return!1===e||null==e?e:F.isArray(e)?e.map(me):String(e)}function ge(e,t,r,n,o){return F.isFunction(n)?n.call(this,t,r):(o&&(t=r),F.isString(t)?F.isString(n)?-1!==t.indexOf(n):F.isRegExp(n)?n.test(t):void 0:void 0)}class ve{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=ye(t);if(!o)throw new Error("header name must be a non-empty string");const i=F.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||t]=me(e))}const i=(e,t)=>F.forEach(e,((e,r)=>o(e,r,t)));return F.isPlainObject(e)||e instanceof this.constructor?i(e,t):F.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?i((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&he[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&o(t,e,r),this}get(e,t){if(e=ye(e)){const r=F.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(F.isFunction(t))return t.call(this,e,r);if(F.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ye(e)){const r=F.findKey(this,e);return!(!r||void 0===this[r]||t&&!ge(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=ye(e)){const o=F.findKey(r,e);!o||t&&!ge(0,r[o],o,t)||(delete r[o],n=!0)}}return F.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!ge(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return F.forEach(this,((n,o)=>{const i=F.findKey(r,o);if(i)return t[i]=me(n),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(o):String(o).trim();a!==o&&delete t[o],t[a]=me(n),r[a]=!0})),this}concat(){for(var e=arguments.length,t=new Array(e),r=0;r{null!=r&&!1!==r&&(t[n]=e&&F.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((e=>{let[t,r]=e;return t+": "+r})).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e){const t=new this(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;ot.set(e))),t}static accessor(e){const t=(this[pe]=this[pe]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=ye(e);t[n]||(function(e,t){const r=F.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})}))}(r,e),t[n]=!0)}return F.isArray(e)?e.forEach(n):n(e),this}}ve.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),F.reduceDescriptors(ve.prototype,((e,t)=>{let{value:r}=e,n=t[0].toUpperCase()+t.slice(1);return{get:()=>r,set(e){this[n]=e}}})),F.freezeMethods(ve);const be=ve;function we(e,t){const r=this||de,n=t||r,o=be.from(n.headers);let i=n.data;return F.forEach(e,(function(e){i=e.call(r,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function Ae(e){return!(!e||!e.__CANCEL__)}function Se(e,t,r){H.call(this,null==e?"canceled":e,H.ERR_CANCELED,t,r),this.name="CanceledError"}F.inherits(Se,H,{__CANCEL__:!0});const ke=Se,_e=ce.hasStandardBrowserEnv?{write(e,t,r,n,o,i){const a=[e+"="+encodeURIComponent(t)];F.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),F.isString(n)&&a.push("path="+n),F.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Ee(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const xe=ce.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=F.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function Te(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),c=n[a];o||(o=u),r[i]=s,n[i]=u;let l=a,f=0;for(;l!==i;)f+=r[l++],l%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),u-o{const i=o.loaded,a=o.lengthComputable?o.total:void 0,s=i-r,u=n(s);r=i;const c={loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:u||void 0,estimated:u&&a&&i<=a?(a-i)/u:void 0,event:o};c[t?"download":"upload"]=!0,e(c)}}const Pe={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const o=be.from(e.headers).normalize();let i,a,{responseType:s,withXSRFToken:u}=e;function c(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}if(F.isFormData(n))if(ce.hasStandardBrowserEnv||ce.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(a=o.getContentType())){const[e,...t]=a?a.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+r))}const f=Ee(e.baseURL,e.url);function d(){if(!l)return;const n=be.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new H("Request failed with status code "+r.status,[H.ERR_BAD_REQUEST,H.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),c()}),(function(e){r(e),c()}),{data:s&&"text"!==s&&"json"!==s?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:n,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),te(f,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=d:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(d)},l.onabort=function(){l&&(r(new H("Request aborted",H.ECONNABORTED,e,l)),l=null)},l.onerror=function(){r(new H("Network Error",H.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||ne;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new H(t,n.clarifyTimeoutError?H.ETIMEDOUT:H.ECONNABORTED,e,l)),l=null},ce.hasStandardBrowserEnv&&(u&&F.isFunction(u)&&(u=u(e)),u||!1!==u&&xe(f))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&_e.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===n&&o.setContentType(null),"setRequestHeader"in l&&F.forEach(o.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),F.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),s&&"json"!==s&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",Te(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",Te(e.onUploadProgress)),(e.cancelToken||e.signal)&&(i=t=>{l&&(r(!t||t.type?new ke(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i)));const h=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(f);h&&-1===ce.protocols.indexOf(h)?r(new H("Unsupported protocol "+h+":",H.ERR_BAD_REQUEST,e)):l.send(n||null)}))}};F.forEach(Pe,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Oe=e=>"- ".concat(e),Re=e=>F.isFunction(e)||null===e||!1===e,Ie=e=>{e=F.isArray(e)?e:[e];const{length:t}=e;let r,n;const o={};for(let i=0;i{let[t,r]=e;return"adapter ".concat(t," ")+(!1===r?"is not supported by the environment":"is not available in the build")}));let r=t?e.length>1?"since :\n"+e.map(Oe).join("\n"):" "+Oe(e[0]):"as no adapter specified";throw new H("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return n};function Ce(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ke(null,e)}function Me(e){return Ce(e),e.headers=be.from(e.headers),e.data=we.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ie(e.adapter||de.adapter)(e).then((function(t){return Ce(e),t.data=we.call(e,e.transformResponse,t),t.headers=be.from(t.headers),t}),(function(t){return Ae(t)||(Ce(e),t&&t.response&&(t.response.data=we.call(e,e.transformResponse,t.response),t.response.headers=be.from(t.response.headers))),Promise.reject(t)}))}const Be=e=>e instanceof be?e.toJSON():e;function Ne(e,t){t=t||{};const r={};function n(e,t,r){return F.isPlainObject(e)&&F.isPlainObject(t)?F.merge.call({caseless:r},e,t):F.isPlainObject(t)?F.merge({},t):F.isArray(t)?t.slice():t}function o(e,t,r){return F.isUndefined(t)?F.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function i(e,t){if(!F.isUndefined(t))return n(void 0,t)}function a(e,t){return F.isUndefined(t)?F.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,o,i){return i in t?n(r,o):i in e?n(void 0,r):void 0}const u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t)=>o(Be(e),Be(t),!0)};return F.forEach(Object.keys(Object.assign({},e,t)),(function(n){const i=u[n]||o,a=i(e[n],t[n],n);F.isUndefined(a)&&i!==s||(r[n]=a)})),r}const Le={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Le[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const je={};Le.transitional=function(e,t,r){function n(e,t){return"[Axios v1.6.2] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,i)=>{if(!1===e)throw new H(n(o," has been removed"+(t?" in "+t:"")),H.ERR_DEPRECATED);return t&&!je[o]&&(je[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}};const Ue={assertOptions:function(e,t,r){if("object"!=typeof e)throw new H("options must be an object",H.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],a=t[i];if(a){const t=e[i],r=void 0===t||a(t,i,e);if(!0!==r)throw new H("option "+i+" must be "+r,H.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new H("Unknown option "+i,H.ERR_BAD_OPTION)}},validators:Le},Fe=Ue.validators;class De{constructor(e){this.defaults=e,this.interceptors={request:new re,response:new re}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ne(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&Ue.assertOptions(r,{silentJSONParsing:Fe.transitional(Fe.boolean),forcedJSONParsing:Fe.transitional(Fe.boolean),clarifyTimeoutError:Fe.transitional(Fe.boolean)},!1),null!=n&&(F.isFunction(n)?t.paramsSerializer={serialize:n}:Ue.assertOptions(n,{encode:Fe.function,serialize:Fe.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&F.merge(o.common,o[t.method]);o&&F.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=be.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let l,f=0;if(!s){const e=[Me.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,u),l=e.length,c=Promise.resolve(t);f{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,o){r.reason||(r.reason=new ke(e,n,o),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new qe((function(t){e=t})),cancel:e}}}const He=qe,Ve={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ve).forEach((e=>{let[t,r]=e;Ve[r]=t}));const Ke=Ve,We=function e(t){const r=new ze(t),n=i(ze.prototype.request,r);return F.extend(n,ze.prototype,r,{allOwnKeys:!0}),F.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(Ne(t,r))},n}(de);We.Axios=ze,We.CanceledError=ke,We.CancelToken=He,We.isCancel=Ae,We.VERSION="1.6.2",We.toFormData=Z,We.AxiosError=H,We.Cancel=We.CanceledError,We.all=function(e){return Promise.all(e)},We.spread=function(e){return function(t){return e.apply(null,t)}},We.isAxiosError=function(e){return F.isObject(e)&&!0===e.isAxiosError},We.mergeConfig=Ne,We.AxiosHeaders=be,We.formToJSON=e=>le(F.isHTMLForm(e)?new FormData(e):e),We.getAdapter=Ie,We.HttpStatusCode=Ke,We.default=We;const Ge=We},4147:e=>{"use strict";e.exports={i8:"11.1.0"}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}return 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.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),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),n(5085)})(),e.exports=n()},7491:(e,t)=>{"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)}function n(e,t){for(var r=0;r{"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)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.AccountCallBuilder=void 0;var o=r(41537);function i(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccountResponse=void 0;var n=r(12034);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 i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.AssetsCallBuilder=void 0;var o=r(41537);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.CallBuilder=void 0;var o,i,a,s=f(r(6486)),u=f(r(71296)),c=r(24742),l=r(87481);function f(e){return e&&e.__esModule?e:{default:e}}function d(){d=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),s=new C(n||[]);return i(a,"_invoke",{value:P(e,r,s)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=f;var p="suspendedStart",y="suspendedYield",m="executing",g="completed",v={};function b(){}function w(){}function A(){}var S={};l(S,s,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(M([])));_&&_!==r&&o.call(_,s)&&(S=_);var E=A.prototype=b.prototype=Object.create(S);function x(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(i,a,s,u){var c=h(e[i],e,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,u)}))}u(c.arg)}var a;i(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function P(t,r,n){var o=p;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=O(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=h(t,r,n);if("normal"===c.type){if(o=n.done?g:y,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=g,n.method="throw",n.arg=c.arg)}}}function O(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=h(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function M(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:M(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function h(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(c){return void r(c)}s.done?t(u):Promise.resolve(u).then(n,o)}function p(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){h(i,n,o,a,s,"next",e)}function s(e){h(i,n,o,a,s,"throw",e)}a(void 0)}))}}function y(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t.clone(),this.filter=[],this.originalSegments=this.url.segment()||[],this.neighborRoot=r}var t,r,n;return t=e,r=[{key:"call",value:function(){var e=this;return this.checkFilter(),this._sendNormalRequest(this.url).then((function(t){return e._parseResponse(t)}))}},{key:"stream",value:function(){var e,t,r=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.checkFilter(),this.url.setQuery("X-Client-Name","js-stellar-sdk"),this.url.setQuery("X-Client-Version",l.version);var o=function(){t=setTimeout((function(){var t;null===(t=e)||void 0===t||t.close(),e=i()}),n.reconnectTimeout||15e3)},i=function i(){try{e=new b(r.url.toString())}catch(l){n.onerror&&n.onerror(l)}if(o(),!e)return e;var a=!1,s=function(){a||(clearTimeout(t),e.close(),i(),a=!0)},u=function(e){if("close"!==e.type){var i=e.data?r._parseRecord(JSON.parse(e.data)):e;i.paging_token&&r.url.setQuery("cursor",i.paging_token),clearTimeout(t),o(),"undefined"!==typeof n.onmessage&&n.onmessage(i)}else s()},c=function(e){n.onerror&&n.onerror(e)};return e.addEventListener?(e.addEventListener("message",u.bind(r)),e.addEventListener("error",c.bind(r)),e.addEventListener("close",s.bind(r))):(e.onmessage=u.bind(r),e.onerror=c.bind(r)),e};return i(),function(){var r;clearTimeout(t),null===(r=e)||void 0===r||r.close()}}},{key:"cursor",value:function(e){return this.url.setQuery("cursor",e),this}},{key:"limit",value:function(e){return this.url.setQuery("limit",e.toString()),this}},{key:"order",value:function(e){return this.url.setQuery("order",e),this}},{key:"join",value:function(e){return this.url.setQuery("join",e),this}},{key:"forEndpoint",value:function(e,t){if(""===this.neighborRoot)throw new Error("Invalid usage: neighborRoot not set in constructor");return this.filter.push([e,t,this.neighborRoot]),this}},{key:"checkFilter",value:function(){if(this.filter.length>=2)throw new c.BadRequestError("Too many filters specified",this.filter);if(1===this.filter.length){var e=this.originalSegments.concat(this.filter[0]);this.url.segment(e)}}},{key:"_requestFnForLink",value:function(e){var t=this;return p(d().mark((function r(){var n,o,i,a,c=arguments;return d().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=c.length>0&&void 0!==c[0]?c[0]:{},e.templated?(i=(0,u.default)(e.href),o=(0,s.default)(i.expand(n))):o=(0,s.default)(e.href),r.next=4,t._sendNormalRequest(o);case 4:return a=r.sent,r.abrupt("return",t._parseResponse(a));case 6:case"end":return r.stop()}}),r)})))}},{key:"_parseRecord",value:function(e){var t=this;if(!e._links)return e;for(var r=function(){var r=o[n],i=e._links[r],a=!1;if("undefined"!==typeof e[r]&&(e["".concat(r,"_attr")]=e[r],a=!0),a&&g.indexOf(r)>=0){var s=t._parseRecord(e[r]);e[r]=p(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s);case 1:case"end":return e.stop()}}),e)})))}else e[r]=t._requestFnForLink(i)},n=0,o=Object.keys(e._links);n{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.ClaimableBalanceCallBuilder=void 0;var o=r(41537);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.EffectCallBuilder=void 0;var o=r(41537);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.FriendbotBuilder=void 0;var o=r(41537);function i(e,t){for(var r=0;r{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.HorizonApi=void 0,function(e){var t=function(e){return e.constantProduct="constant_product",e}({});e.LiquidityPoolType=t;var r=function(e){return e.createAccount="create_account",e.payment="payment",e.pathPayment="path_payment_strict_receive",e.createPassiveOffer="create_passive_sell_offer",e.manageOffer="manage_sell_offer",e.setOptions="set_options",e.changeTrust="change_trust",e.allowTrust="allow_trust",e.accountMerge="account_merge",e.inflation="inflation",e.manageData="manage_data",e.bumpSequence="bump_sequence",e.manageBuyOffer="manage_buy_offer",e.pathPaymentStrictSend="path_payment_strict_send",e.createClaimableBalance="create_claimable_balance",e.claimClaimableBalance="claim_claimable_balance",e.beginSponsoringFutureReserves="begin_sponsoring_future_reserves",e.endSponsoringFutureReserves="end_sponsoring_future_reserves",e.revokeSponsorship="revoke_sponsorship",e.clawback="clawback",e.clawbackClaimableBalance="clawback_claimable_balance",e.setTrustLineFlags="set_trust_line_flags",e.liquidityPoolDeposit="liquidity_pool_deposit",e.liquidityPoolWithdraw="liquidity_pool_withdraw",e.invokeHostFunction="invoke_host_function",e.bumpFootprintExpiration="bump_footprint_expiration",e.restoreFootprint="restore_footprint",e}({});e.OperationResponseType=r;var n=function(e){return e[e.createAccount=0]="createAccount",e[e.payment=1]="payment",e[e.pathPayment=2]="pathPayment",e[e.createPassiveOffer=3]="createPassiveOffer",e[e.manageOffer=4]="manageOffer",e[e.setOptions=5]="setOptions",e[e.changeTrust=6]="changeTrust",e[e.allowTrust=7]="allowTrust",e[e.accountMerge=8]="accountMerge",e[e.inflation=9]="inflation",e[e.manageData=10]="manageData",e[e.bumpSequence=11]="bumpSequence",e[e.manageBuyOffer=12]="manageBuyOffer",e[e.pathPaymentStrictSend=13]="pathPaymentStrictSend",e[e.createClaimableBalance=14]="createClaimableBalance",e[e.claimClaimableBalance=15]="claimClaimableBalance",e[e.beginSponsoringFutureReserves=16]="beginSponsoringFutureReserves",e[e.endSponsoringFutureReserves=17]="endSponsoringFutureReserves",e[e.revokeSponsorship=18]="revokeSponsorship",e[e.clawback=19]="clawback",e[e.clawbackClaimableBalance=20]="clawbackClaimableBalance",e[e.setTrustLineFlags=21]="setTrustLineFlags",e[e.liquidityPoolDeposit=22]="liquidityPoolDeposit",e[e.liquidityPoolWithdraw=23]="liquidityPoolWithdraw",e[e.invokeHostFunction=24]="invokeHostFunction",e[e.bumpFootprintExpiration=25]="bumpFootprintExpiration",e[e.restoreFootprint=26]="restoreFootprint",e}({});e.OperationResponseTypeI=n;var o=function(e){return e.TX_FAILED="tx_failed",e.TX_BAD_SEQ="tx_bad_seq",e.TX_BAD_AUTH="tx_bad_auth",e.TX_BAD_AUTH_EXTRA="tx_bad_auth_extra",e.TX_FEE_BUMP_INNER_SUCCESS="tx_fee_bump_inner_success",e.TX_FEE_BUMP_INNER_FAILED="tx_fee_bump_inner_failed",e.TX_NOT_SUPPORTED="tx_not_supported",e.TX_SUCCESS="tx_success",e.TX_TOO_EARLY="tx_too_early",e.TX_TOO_LATE="tx_too_late",e.TX_MISSING_OPERATION="tx_missing_operation",e.TX_INSUFFICIENT_BALANCE="tx_insufficient_balance",e.TX_NO_SOURCE_ACCOUNT="tx_no_source_account",e.TX_INSUFFICIENT_FEE="tx_insufficient_fee",e.TX_INTERNAL_ERROR="tx_internal_error",e}({});e.TransactionFailedResultCodes=o}(r||(t.HorizonApi=r={}))},87481:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.SERVER_TIME_MAP=t.AxiosClient=void 0,t.getCurrentServerTime=function(e){var t=s[e];if(!t||!t.localTimeRecorded||!t.serverTime)return null;var r=t.serverTime,n=t.localTimeRecorded,o=c((new Date).getTime());if(o-n>300)return null;return o-n+r},t.version=void 0;var n=i(r(57387)),o=i(r(6486));function i(e){return e&&e.__esModule?e:{default:e}}var a=t.version=r(70321).version,s=t.SERVER_TIME_MAP={},u=t.AxiosClient=n.default.create({headers:{"X-Client-Name":"js-stellar-sdk","X-Client-Version":a}});function c(e){return Math.floor(e/1e3)}u.interceptors.response.use((function(e){var t=(0,o.default)(e.config.url).hostname(),r=c(Date.parse(e.headers.date)),n=c((new Date).getTime());return isNaN(r)||(s[t]={serverTime:r,localTimeRecorded:n}),e}));t.default=u},90341:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0});var o={Server:!0,AxiosClient:!0,SERVER_TIME_MAP:!0,getCurrentServerTime:!0};Object.defineProperty(t,"AxiosClient",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"SERVER_TIME_MAP",{enumerable:!0,get:function(){return c.SERVER_TIME_MAP}}),Object.defineProperty(t,"Server",{enumerable:!0,get:function(){return u.Server}}),t.default=void 0,Object.defineProperty(t,"getCurrentServerTime",{enumerable:!0,get:function(){return c.getCurrentServerTime}});var i=r(1);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(o,e)||e in t&&t[e]===i[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}}))}));var a=r(1681);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(o,e)||e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var s=r(73254);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(o,e)||e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))}));var u=r(74874),c=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=n(e)&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,r&&r.set(e,o),o}(r(87481));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}t.default=e.exports},29103:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.LedgerCallBuilder=void 0;var o=r(41537);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.LiquidityPoolCallBuilder=void 0;var o=r(41537);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.OfferCallBuilder=void 0;var o=r(41537);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.OperationCallBuilder=void 0;var o=r(41537);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.OrderbookCallBuilder=void 0;var o=r(41537);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentCallBuilder=void 0;var o=r(41537);function i(e,t){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Server=t.SUBMIT_TRANSACTION_TIMEOUT=void 0;var n=P(r(1991)),o=r(12034),i=P(r(6486)),a=r(41537),s=r(7491),u=r(24742),c=r(85205),l=r(73254),f=r(47115),d=r(67520),h=r(54123),p=r(44392),y=r(29103),m=r(12141),g=r(47038),v=r(79171),b=r(76475),w=r(57778),A=r(11273),S=r(14530),k=r(44373),_=r(42593),E=r(10092),x=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=O(e)&&"function"!=typeof e)return{default:e};var r=T(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(87481));function T(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(T=function(e){return e?r:t})(e)}function P(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 R(){R=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof g?t:g,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:x(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",y="completed",m={};function g(){}function v(){}function b(){}var w={};c(w,a,(function(){return this}));var A=Object.getPrototypeOf,S=A&&A(A(M([])));S&&S!==r&&n.call(S,a)&&(w=S);var k=b.prototype=g.prototype=Object.create(w);function _(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==O(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function x(t,r,n){var o=d;return function(i,a){if(o===p)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=T(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=f(t,r,n);if("normal"===c.type){if(o=n.done?y:h,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=y,n.method="throw",n.arg=c.arg)}}}function T(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function M(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:M(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function I(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(c){return void r(c)}s.done?t(u):Promise.resolve(u).then(n,o)}function C(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){I(i,n,o,a,s,"next",e)}function s(e){I(i,n,o,a,s,"throw",e)}a(void 0)}))}}function M(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.serverURL=(0,i.default)(t);var n="undefined"===typeof r.allowHttp?s.Config.isAllowHttp():r.allowHttp,o={};if(r.appName&&(o["X-App-Name"]=r.appName),r.appVersion&&(o["X-App-Version"]=r.appVersion),r.authToken&&(o["X-Auth-Token"]=r.authToken),Object.keys(o).length>0&&x.default.interceptors.request.use((function(e){return e.headers=Object.assign(e.headers,o),e})),"https"!==this.serverURL.protocol()&&!n)throw new Error("Cannot connect to insecure horizon server")}var t,r,T;return t=e,r=[{key:"fetchTimebounds",value:function(){var e=C(R().mark((function e(t){var r,n,o=arguments;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>1&&void 0!==o[1]&&o[1],!(n=(0,x.getCurrentServerTime)(this.serverURL.hostname()))){e.next=4;break}return e.abrupt("return",{minTime:0,maxTime:n+t});case 4:if(!r){e.next=6;break}return e.abrupt("return",{minTime:0,maxTime:Math.floor((new Date).getTime()/1e3)+t});case 6:return e.next=8,x.default.get((0,i.default)(this.serverURL).toString());case 8:return e.next=10,this.fetchTimebounds(t,!0);case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"fetchBaseFee",value:function(){var e=C(R().mark((function e(){var t;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.feeStats();case 2:return t=e.sent,e.abrupt("return",parseInt(t.last_ledger_base_fee,10)||100);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"feeStats",value:function(){var e=C(R().mark((function e(){var t;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=new a.CallBuilder((0,i.default)(this.serverURL))).filter.push(["fee_stats"]),e.abrupt("return",t.call());case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"submitTransaction",value:function(){var e=C(R().mark((function e(t){var r,a=arguments;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a.length>1&&void 0!==a[1]?a[1]:{skipMemoRequiredCheck:!1}).skipMemoRequiredCheck){e.next=4;break}return e.next=4,this.checkMemoRequired(t);case 4:return r=encodeURIComponent(t.toEnvelope().toXDR().toString("base64")),e.abrupt("return",x.default.post((0,i.default)(this.serverURL).segment("transactions").toString(),"tx=".concat(r),{timeout:N}).then((function(e){if(!e.data.result_xdr)return e.data;var t,r,i=o.xdr.TransactionResult.fromXDR(e.data.result_xdr,"base64").result().value();return i.length&&(t=i.map((function(e,t){if("manageBuyOffer"!==e.value().switch().name&&"manageSellOffer"!==e.value().switch().name)return null;r=!0;var i,a=new n.default(0),s=new n.default(0),u=e.value().value().success(),c=u.offersClaimed().map((function(e){var t=e.value(),r="";switch(e.switch()){case o.xdr.ClaimAtomType.claimAtomTypeV0():r=o.StrKey.encodeEd25519PublicKey(t.sellerEd25519());break;case o.xdr.ClaimAtomType.claimAtomTypeOrderBook():r=o.StrKey.encodeEd25519PublicKey(t.sellerId().ed25519());break;default:throw new Error("Invalid offer result type: "+e.switch())}var i=new n.default(t.amountBought().toString()),u=new n.default(t.amountSold().toString());a=a.plus(u),s=s.plus(i);var c=o.Asset.fromOperation(t.assetSold()),l=o.Asset.fromOperation(t.assetBought()),f={type:c.getAssetType(),assetCode:c.getCode(),issuer:c.getIssuer()},d={type:l.getAssetType(),assetCode:l.getCode(),issuer:l.getIssuer()};return{sellerId:r,offerId:t.offerId().toString(),assetSold:f,amountSold:L(u),assetBought:d,amountBought:L(i)}})),l=u.offer().switch().name;if("function"===typeof u.offer().value&&u.offer().value()){var f=u.offer().value();i={offerId:f.offerId().toString(),selling:{},buying:{},amount:L(f.amount().toString()),price:{n:f.price().n(),d:f.price().d()}};var d=o.Asset.fromOperation(f.selling());i.selling={type:d.getAssetType(),assetCode:d.getCode(),issuer:d.getIssuer()};var h=o.Asset.fromOperation(f.buying());i.buying={type:h.getAssetType(),assetCode:h.getCode(),issuer:h.getIssuer()}}return{offersClaimed:c,effect:l,operationIndex:t,currentOffer:i,amountBought:L(a),amountSold:L(s),isFullyOpen:!c.length&&"manageOfferDeleted"!==l,wasPartiallyFilled:!!c.length&&"manageOfferDeleted"!==l,wasImmediatelyFilled:!!c.length&&"manageOfferDeleted"===l,wasImmediatelyDeleted:!c.length&&"manageOfferDeleted"===l}})).filter((function(e){return!!e}))),Object.assign({},e.data,{offerResults:r?t:void 0})})).catch((function(e){return e instanceof Error?Promise.reject(e):Promise.reject(new u.BadResponseError("Transaction submission failed. Server responded: ".concat(e.status," ").concat(e.statusText),e.data))})));case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"accounts",value:function(){return new c.AccountCallBuilder((0,i.default)(this.serverURL))}},{key:"claimableBalances",value:function(){return new d.ClaimableBalanceCallBuilder((0,i.default)(this.serverURL))}},{key:"ledgers",value:function(){return new y.LedgerCallBuilder((0,i.default)(this.serverURL))}},{key:"transactions",value:function(){return new E.TransactionCallBuilder((0,i.default)(this.serverURL))}},{key:"offers",value:function(){return new g.OfferCallBuilder((0,i.default)(this.serverURL))}},{key:"orderbook",value:function(e,t){return new b.OrderbookCallBuilder((0,i.default)(this.serverURL),e,t)}},{key:"trades",value:function(){return new _.TradesCallBuilder((0,i.default)(this.serverURL))}},{key:"operations",value:function(){return new v.OperationCallBuilder((0,i.default)(this.serverURL))}},{key:"liquidityPools",value:function(){return new m.LiquidityPoolCallBuilder((0,i.default)(this.serverURL))}},{key:"strictReceivePaths",value:function(e,t,r){return new A.StrictReceivePathCallBuilder((0,i.default)(this.serverURL),e,t,r)}},{key:"strictSendPaths",value:function(e,t,r){return new S.StrictSendPathCallBuilder((0,i.default)(this.serverURL),e,t,r)}},{key:"payments",value:function(){return new w.PaymentCallBuilder((0,i.default)(this.serverURL))}},{key:"effects",value:function(){return new h.EffectCallBuilder((0,i.default)(this.serverURL))}},{key:"friendbot",value:function(e){return new p.FriendbotBuilder((0,i.default)(this.serverURL),e)}},{key:"assets",value:function(){return new f.AssetsCallBuilder((0,i.default)(this.serverURL))}},{key:"loadAccount",value:function(){var e=C(R().mark((function e(t){var r;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.accounts().accountId(t).call();case 2:return r=e.sent,e.abrupt("return",new l.AccountResponse(r));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"tradeAggregation",value:function(e,t,r,n,o,a){return new k.TradeAggregationCallBuilder((0,i.default)(this.serverURL),e,t,r,n,o,a)}},{key:"checkMemoRequired",value:function(){var e=C(R().mark((function e(t){var r,n,i,a;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t instanceof o.FeeBumpTransaction&&(t=t.innerTransaction),"none"===t.memo.type){e.next=3;break}return e.abrupt("return");case 3:r=new Set,n=0;case 5:if(!(n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServerApi=void 0;var n,o=r(1);!function(e){var t=function(e){return e.all="all",e.liquidityPools="liquidity_pool",e.orderbook="orderbook",e}({});e.TradeType=t;o.HorizonApi.OperationResponseType,o.HorizonApi.OperationResponseTypeI}(n||(t.ServerApi=n={}))},11273:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.StrictReceivePathCallBuilder=void 0;var o=r(41537);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.StrictSendPathCallBuilder=void 0;var o=r(41537);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.TradeAggregationCallBuilder=void 0;var o=r(41537),i=r(24742);function a(e,t){for(var r=0;rt||e>=24*r||e%r!==0)}}])&&a(t.prototype,r),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.CallBuilder)},42593:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.TradesCallBuilder=void 0;var o=r(41537);function i(e,t){for(var r=0;r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionCallBuilder=void 0;var o=r(41537);function i(e,t){for(var r=0;r{e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=28)}([function(e,t){e.exports=r(54756)},function(e,t){e.exports=r(29293)},function(e,t){e.exports=r(17383)},function(e,t){e.exports=r(34579)},function(e,t){e.exports=r(43693)},function(e,t){e.exports=r(23107)},function(e,t){e.exports=r(89106)},function(e,t){e.exports=r(57386)},function(e,t){e.exports=r(73738)},function(e,t){e.exports=r(41132)},function(e,t){e.exports=r(78027)},function(e,t){e.exports=r(85715)},function(e,t){e.exports=r(19547)},function(e,t){e.exports=r(1991)},function(e,t){e.exports=r(12475)},function(e,t){e.exports=r(3678)},function(e,t){e.exports=r(52279)},function(e,t){e.exports=r(38086)},function(e,t){e.exports=r(63072)},function(e,t){e.exports=r(29511)},function(e,t){e.exports=r(28452)},function(e,t){e.exports=r(74264)},function(e,t){e.exports=r(27458)},function(e,t){e.exports=r(14589)},function(e,t){e.exports=r(44650)},function(e,t){e.exports=r(89262)},function(e){e.exports=JSON.parse('{"a":"4.4.0"}')},function(e,t){e.exports=r(83565)},function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return dr}));var n={};r.r(n),r.d(n,"byte2hexStr",(function(){return B})),r.d(n,"bytesToString",(function(){return N})),r.d(n,"hextoString",(function(){return L})),r.d(n,"byteArray2hexStr",(function(){return j})),r.d(n,"base64DecodeFromString",(function(){return U})),r.d(n,"base64EncodeToString",(function(){return F}));var o={};r.r(o),r.d(o,"bin2String",(function(){return H})),r.d(o,"arrayEquals",(function(){return V})),r.d(o,"stringToBytes",(function(){return K})),r.d(o,"byte2hexStr",(function(){return B})),r.d(o,"bytesToString",(function(){return N})),r.d(o,"hextoString",(function(){return L})),r.d(o,"byteArray2hexStr",(function(){return j})),r.d(o,"base64DecodeFromString",(function(){return U})),r.d(o,"base64EncodeToString",(function(){return F})),r.d(o,"hexChar2byte",(function(){return W})),r.d(o,"isHexChar",(function(){return G})),r.d(o,"hexStr2byteArray",(function(){return X})),r.d(o,"strToDate",(function(){return Z})),r.d(o,"isNumber",(function(){return Q})),r.d(o,"getStringType",(function(){return Y}));var i={};r.r(i),r.d(i,"encode58",(function(){return te})),r.d(i,"decode58",(function(){return re}));var a={};r.r(a),r.d(a,"keccak256",(function(){return ie})),r.d(a,"sha256",(function(){return ae})),r.d(a,"toUtf8Bytes",(function(){return se})),r.d(a,"toUtf8String",(function(){return ue})),r.d(a,"recoverAddress",(function(){return ce})),r.d(a,"SigningKey",(function(){return le})),r.d(a,"AbiCoder",(function(){return fe})),r.d(a,"Interface",(function(){return de})),r.d(a,"FormatTypes",(function(){return he})),r.d(a,"splitSignature",(function(){return ye})),r.d(a,"joinSignature",(function(){return me})),r.d(a,"arrayify",(function(){return pe})),r.d(a,"ethersWallet",(function(){return oe.Wallet})),r.d(a,"concat",(function(){return ge})),r.d(a,"id",(function(){return ve})),r.d(a,"isValidMnemonic",(function(){return be}));var s={};r.r(s),r.d(s,"getBase58CheckAddress",(function(){return qe})),r.d(s,"decodeBase58Address",(function(){return He})),r.d(s,"signTransaction",(function(){return Ve})),r.d(s,"arrayToBase64String",(function(){return Ke})),r.d(s,"signBytes",(function(){return We})),r.d(s,"_signTypedData",(function(){return Ge})),r.d(s,"getRowBytesFromTransactionBase64",(function(){return Xe})),r.d(s,"genPriKey",(function(){return Ze})),r.d(s,"computeAddress",(function(){return Qe})),r.d(s,"getAddressFromPriKey",(function(){return Ye})),r.d(s,"decode58Check",(function(){return Je})),r.d(s,"isAddressValid",(function(){return $e})),r.d(s,"getBase58CheckAddressFromPriKeyBase64String",(function(){return et})),r.d(s,"getHexStrAddressFromPriKeyBase64String",(function(){return tt})),r.d(s,"getAddressFromPriKeyBase64String",(function(){return rt})),r.d(s,"getPubKeyFromPriKey",(function(){return nt})),r.d(s,"ECKeySign",(function(){return ot})),r.d(s,"SHA256",(function(){return it})),r.d(s,"passwordToAddress",(function(){return at})),r.d(s,"pkToAddress",(function(){return st}));var u={};r.r(u),r.d(u,"generateAccount",(function(){return ut})),r.d(u,"generateRandom",(function(){return ct})),r.d(u,"generateAccountWithMnemonic",(function(){return lt}));var c={};r.r(c),r.d(c,"decodeParams",(function(){return pt})),r.d(c,"encodeParams",(function(){return yt})),r.d(c,"encodeParamsV2ByABI",(function(){return vt})),r.d(c,"decodeParamsV2ByABI",(function(){return bt}));var l={};r.r(l),r.d(l,"TRON_MESSAGE_PREFIX",(function(){return wt})),r.d(l,"hashMessage",(function(){return At})),r.d(l,"signMessage",(function(){return St})),r.d(l,"verifyMessage",(function(){return kt}));var f=r(1),d=r.n(f),h=r(8),p=r.n(h),y=r(2),m=r.n(y),g=r(3),v=r.n(g),b=r(14),w=r.n(b),A=r(19),S=r.n(A),k=r(20),_=r.n(k),E=r(18),x=r.n(E),T=r(4),P=r.n(T),O=r(0),R=r.n(O),I=r(21),C=r.n(I);function M(){var e=this;this._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",this.encode=function(t){for(var r,n,o,i,a,s,u,c="",l=0;l>2,a=(3&r)<<4|(n=t.charCodeAt(l++))>>4,s=(15&n)<<2|(o=t.charCodeAt(l++))>>6,u=63&o,isNaN(n)?s=u=64:isNaN(o)&&(u=64),c=c+e._keyStr.charAt(i)+e._keyStr.charAt(a)+e._keyStr.charAt(s)+e._keyStr.charAt(u);return c},this.encodeIgnoreUtf8=function(t){for(var r,n,o,i,a,s,u,c="",l=0;l>2,a=(3&r)<<4|(n=t[l++])>>4,s=(15&n)<<2|(o=t[l++])>>6,u=63&o,isNaN(n)?s=u=64:isNaN(o)&&(u=64),c=c+e._keyStr.charAt(i)+e._keyStr.charAt(a)+e._keyStr.charAt(s)+e._keyStr.charAt(u);return c},this.decode=function(t){var r,n,o,i,a,s,u="",c=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,n=(15&i)<<4|(a=e._keyStr.indexOf(t.charAt(c++)))>>2,o=(3&a)<<6|(s=e._keyStr.indexOf(t.charAt(c++))),u+=String.fromCharCode(r),64!=a&&(u+=String.fromCharCode(n)),64!=s&&(u+=String.fromCharCode(o));return e._utf8_decode(u)},this.decodeToByteArray=function(t){var r,n,o,i,a,s,u="",c=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,n=(15&i)<<4|(a=e._keyStr.indexOf(t.charAt(c++)))>>2,o=(3&a)<<6|(s=e._keyStr.indexOf(t.charAt(c++))),u+=String.fromCharCode(r),64!=a&&(u+=String.fromCharCode(n)),64!=s&&(u+=String.fromCharCode(o));return e._out2ByteArray(u)},this._out2ByteArray=function(e){for(var t=new Array(e.length),r=0,n=0;r127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t},this._utf8_decode=function(e){for(var t="",r=0,n=0,o=0,i=0;r191&&n<224?(o=e.charCodeAt(r+1),t+=String.fromCharCode((31&n)<<6|63&o),r+=2):(o=e.charCodeAt(r+1),i=e.charCodeAt(r+2),t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&i),r+=3);return t}}function B(e){if("number"!=typeof e)throw new Error("Input must be a number");if(e<0||e>255)throw new Error("Input must be a byte");var t="";return(t+="0123456789ABCDEF".charAt(e>>4))+"0123456789ABCDEF".charAt(15&e)}function N(e){if("string"==typeof e)return e;for(var t="",r=0;r=65536&&r<=1114111?(n.push(r>>18&7|240),n.push(r>>12&63|128),n.push(r>>6&63|128),n.push(63&r|128)):r>=2048&&r<=65535?(n.push(r>>12&15|224),n.push(r>>6&63|128),n.push(63&r|128)):r>=128&&r<=2047?(n.push(r>>6&31|192),n.push(63&r|128)):n.push(255&r);return n}function W(e){var t;if(e>="A"&&e<="F"?t=e.charCodeAt(0)-"A".charCodeAt(0)+10:e>="a"&&e<="f"?t=e.charCodeAt(0)-"a".charCodeAt(0)+10:e>="0"&&e<="9"&&(t=e.charCodeAt(0)-"0".charCodeAt(0)),"number"==typeof t)return t;throw new Error("The passed hex char is not a valid hex char")}function G(e){return e>="A"&&e<="F"||e>="a"&&e<="f"||e>="0"&&e<="9"?1:0}function X(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"!=typeof e)throw new Error("The passed string is not a string");var r=e.length;t&&r%2&&(e="0".concat(e),r++);for(var n=Array(),o=0,i=0,a=0,s=0;s1){var a=t[1].split("-"),s=parseInt(a[0],10),u=parseInt(a[1],10),c=parseInt(a[2],10);return new Date(n,o,i,s,u,c)}return new Date(n,o,i)}function Q(e){return e>="0"&&e<="9"?1:0}function Y(e){if(null==e)return-1;if("string"!=typeof e)return-1;if(0==e.length||""==e)return-1;var t=0;if(40==e.length)for(;t<40&&G(e.charAt(t));t++);if(40==t)return 1;for(t=0;t" ")return 3;return-1}for(var J="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",$={},ee=0;ee>8,n[r]&=255;for(;i;)n.push(255&i),i>>=8}for(t=0;"1"===e[t]&&t256||t[2]&&t[2]!==String(n))&&Ee.throwArgumentError("invalid numeric width","type",e);var o=Ce.mask(r?n-1:n),i=r?o.add(Ie).mul(Oe):Re;return function(t){var r=we.BigNumber.from(t);return(r.lt(i)||r.gt(o))&&Ee.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),Object(Ae.hexZeroPad)(r.toTwos(256).toHexString(),32)}}var a=e.match(/^bytes(\d+)$/);if(a){var s=parseInt(a[1]);return(0===s||s>32||a[1]!==String(s))&&Ee.throwArgumentError("invalid bytes width","type",e),function(t){return Object(Ae.arrayify)(t).length!==s&&Ee.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=Object(Ae.arrayify)(e),r=t.length%32;return r?Object(Ae.hexConcat)([t,Pe.slice(r)]):Object(Ae.hexlify)(t)}(t)}}switch(e){case"trcToken":return Fe("uint256");case"address":return function(e){return Object(Ae.hexZeroPad)((t=e,dr.address.toHex(t).replace(q,"0x")),32);var t};case"bool":return function(e){return e?Me:Be};case"bytes":return function(e){return Object(Se.keccak256)(e)};case"string":return function(e){return Te(e)}}return null}function De(e,t){return"".concat(e,"(").concat(t.map((function(e){var t=e.name;return e.type+" "+t})).join(","),")")}var ze=function(){function e(t){m()(this,e),Object(ke.defineReadOnly)(this,"types",Object.freeze(Object(ke.deepCopy)(t))),Object(ke.defineReadOnly)(this,"_encoderCache",{}),Object(ke.defineReadOnly)(this,"_types",{});var r={},n={},o={};Object.keys(t).forEach((function(e){r[e]={},n[e]=[],o[e]={}}));var i=function(e){var o={};t[e].forEach((function(i){o[i.name]&&Ee.throwArgumentError("duplicate variable name ".concat(JSON.stringify(i.name)," in ").concat(JSON.stringify(e)),"types",t),o[i.name]=!0;var a=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===e&&Ee.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",t),Fe(a)||(n[a]||Ee.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",t),n[a].push(e),r[e][a]=!0)}))};for(var a in t)i(a);var s=Object.keys(n).filter((function(e){return 0===n[e].length}));for(var u in 0===s.length?Ee.throwArgumentError("missing primary type","types",t):s.length>1&&Ee.throwArgumentError("ambiguous primary types or unused types: ".concat(s.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),Object(ke.defineReadOnly)(this,"primaryType",s[0]),function e(i,a){a[i]&&Ee.throwArgumentError("circular type reference to ".concat(JSON.stringify(i)),"types",t),a[i]=!0,Object.keys(r[i]).forEach((function(t){n[t]&&(e(t,a),Object.keys(a).forEach((function(e){o[e][t]=!0})))})),delete a[i]}(this.primaryType,{}),o){var c=Object.keys(o[u]);c.sort(),this._types[u]=De(u,t[u])+c.map((function(e){return De(e,t[e])})).join("")}}return v()(e,[{key:"getEncoder",value:function(e){var t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}},{key:"_getEncoder",value:function(e){var t=this,r=Fe(e);if(r)return r;var n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){var o=n[1],i=this.getEncoder(o),a=parseInt(n[3]);return function(e){a>=0&&e.length!==a&&Ee.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);var r=e.map(i);return t._types[o]&&(r=r.map(Se.keccak256)),Object(Se.keccak256)(Object(Ae.hexConcat)(r))}}var s=this.types[e];if(s){var u=Te(this._types[e]);return function(e){var r=s.map((function(r){var n=r.name,o=r.type,i=t.getEncoder(o)(e[n]);return t._types[o]?Object(Se.keccak256)(i):i}));return r.unshift(u),Object(Ae.hexConcat)(r)}}return Ee.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e];return t||Ee.throwArgumentError("unknown type: ".concat(JSON.stringify(e)),"name",e),t}},{key:"encodeData",value:function(e,t){return this.getEncoder(e)(t)}},{key:"hashStruct",value:function(e,t){return Object(Se.keccak256)(this.encodeData(e,t))}},{key:"encode",value:function(e){return this.encodeData(this.primaryType,e)}},{key:"hash",value:function(e){return this.hashStruct(this.primaryType,e)}},{key:"_visit",value:function(e,t,r){var n=this;if(Fe(e))return r(e,t);var o=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(o){var i=o[1],a=parseInt(o[3]);return a>=0&&t.length!==a&&Ee.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((function(e){return n._visit(i,e,r)}))}var s=this.types[e];return s?s.reduce((function(e,o){var i=o.name,a=o.type;return e[i]=n._visit(a,t[i],r),e}),{}):Ee.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"visit",value:function(e,t){return this._visit(this.primaryType,e,t)}}],[{key:"from",value:function(t){return new e(t)}},{key:"getPrimaryType",value:function(t){return e.from(t).primaryType}},{key:"hashStruct",value:function(t,r,n){return e.from(r).hashStruct(t,n)}},{key:"hashDomain",value:function(t){var r=[];for(var n in t){var o=Ne[n];o||Ee.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(n)),"domain",t),r.push({name:n,type:o})}return r.sort((function(e,t){return Le.indexOf(e.name)-Le.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:r},t)}},{key:"encode",value:function(t,r,n){return Object(Ae.hexConcat)(["0x1901",e.hashDomain(t),e.from(r).hash(n)])}},{key:"hash",value:function(t,r,n){return Object(Se.keccak256)(e.encode(t,r,n))}},{key:"getPayload",value:function(t,r,n){e.hashDomain(t);var o={},i=[];Le.forEach((function(e){var r=t[e];null!=r&&(o[e]=Ue[e](r),i.push({name:e,type:Ne[e]}))}));var a=e.from(r),s=Object(ke.shallowCopy)(r);return s.EIP712Domain?Ee.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):s.EIP712Domain=i,a.encode(n),{types:s,domain:o,primaryType:a.primaryType,message:a.visit(n,(function(e,t){if(e.match(/^bytes(\d*)/))return Object(Ae.hexlify)(Object(Ae.arrayify)(t));if(e.match(/^u?int/))return we.BigNumber.from(t).toString();switch(e){case"trcToken":return we.BigNumber.from(t).toString();case"address":return xe(t).toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Ee.throwArgumentError("invalid string","value",t),t}return Ee.throwArgumentError("unsupported type","type",e)}))}}}]),e}();function qe(e){var t=it(e),r=it(t).slice(0,4);return te(r=e.concat(r))}function He(e){if("string"!=typeof e)return!1;if(e.length<=4)return!1;var t=re(e);if(e.length<=4)return!1;var r=t.length-4,n=t.slice(r),o=it(t=t.slice(0,r)),i=it(o).slice(0,4);if(n[0]==i[0]&&n[1]==i[1]&&n[2]==i[2]&&n[3]==i[3])return t;throw new Error("Invalid address provided")}function Ve(e,t){"string"==typeof e&&(e=X(e));var r=ot(X(t.txID),e);return Array.isArray(t.signature)?t.signature.includes(r)||t.signature.push(r):t.signature=[r],t}function Ke(e){return btoa(String.fromCharCode.apply(String,z()(e)))}function We(e,t){return"string"==typeof e&&(e=X(e)),ot(it(t),e)}function Ge(e,t,r,n){var o=new le({toHexString:function(){return"0x"+n},value:n}),i=ze.hash(e,t,r),a=o.signDigest(i);return["0x",a.r.substring(2),a.s.substring(2),Number(a.v).toString(16)].join("")}function Xe(e){var t=U(e);return proto.protocol.Transaction.deserializeBinary(t).getRawData().serializeBinary()}function Ze(){for(var e=new ne.ec("secp256k1").genKeyPair().getPrivate().toString("hex");e.length<64;)e="0".concat(e);return X(e)}function Qe(e){return 65===e.length&&(e=e.slice(1)),X("41"+ie(e).toString().substring(2).substring(24))}function Ye(e){return Qe(nt(e))}function Je(e){var t=re(e);if(t.length<=4)return!1;var r=t.slice(0,t.length-4),n=it(r),o=it(n);return o[0]===t[r.length]&&o[1]===t[r.length+1]&&o[2]===t[r.length+2]&&o[3]===t[r.length+3]&&r}function $e(e){if("string"!=typeof e)return!1;if(34!==e.length)return!1;var t=re(e);if(25!==t.length)return!1;if(65!==t[0])return!1;var r=t.slice(21),n=it(t=t.slice(0,21)),o=it(n).slice(0,4);return r[0]==o[0]&&r[1]==o[1]&&r[2]==o[2]&&r[3]==o[3]}function et(e){return qe(Qe(nt(U(e))))}function tt(e){return j(Qe(nt(U(e))))}function rt(e){return F(Qe(nt(U(e))))}function nt(e){for(var t=new ne.ec("secp256k1").keyFromPrivate(e,"bytes").getPublic(),r=t.x,n=t.y,o=r.toString("hex");o.length<64;)o="0".concat(o);for(var i=n.toString("hex");i.length<64;)i="0".concat(i);return X("04".concat(o).concat(i))}function ot(e,t){for(var r=new ne.ec("secp256k1").keyFromPrivate(t,"bytes").sign(e),n=r.r,o=r.s,i=r.recoveryParam,a=n.toString("hex");a.length<64;)a="0".concat(a);for(var s=o.toString("hex");s.length<64;)s="0".concat(s);return a+s+B(i)}function it(e){var t=j(e);return X(ae("0x"+t).replace(/^0x/,""))}function at(e){return qe(Ye(U(e)))}function st(e){return qe(Ye(X(e,arguments.length>1&&void 0!==arguments[1]&&arguments[1])))}function ut(){var e=Ze(),t=nt(e),r=Ye(e);return{privateKey:j(e),publicKey:j(t),address:{base58:qe(r),hex:j(r)}}}function ct(e){if(Rt.isObject(e)||(e={}),e.path||(e.path="m/44'/195'/0'/0/0"),!String(e.path).match(/^m\/44\'\/195\'/))throw new Error("Invalid tron path provided");var t=oe.Wallet.createRandom(e);return{mnemonic:t.mnemonic,privateKey:t.privateKey,publicKey:t.publicKey,address:st(t.privateKey.replace(/^0x/,""))}}function lt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en";if(t||(t="m/44'/195'/0'/0/0"),!String(t).match(/^m\/44\'\/195\'/))throw new Error("Invalid tron path provided");var n=oe.Wallet.fromMnemonic(e,t,r);return{mnemonic:n.mnemonic,privateKey:n.privateKey,publicKey:n.publicKey,address:st(n.privateKey.replace(/^0x/,""))}}var ft=new fe;function dt(e){return dr.address.toHex(e).replace(q,"0x")}function ht(e){if("[object Object]"!==Object.prototype.toString.call(e)&&"[object Array]"!==Object.prototype.toString.call(e))return e;var t,r=(t=e,Array.isArray(t)?[]:{});return Object.keys(e).forEach((function(t){return r[t]=e[t]instanceof Object&&!e[t]._isBigNumber?ht(e[t]):e[t]})),r}function pt(e,t,r,n){if(r&&"boolean"!=typeof r||(n=r,r=t,t=e,e=[]),n&&r.replace(/^0x/,"").length%64==8&&(r="0x"+r.replace(/^0x/,"").substring(8)),r.replace(/^0x/,"").length%64)throw new Error("The encoded string is not valid. Its length must be a multiple of 64.");return t=t.map((function(e){return/trcToken/.test(e)&&(e=e.replace(/trcToken/,"uint256")),e})),ft.decode(t,r).reduce((function(r,n,o){return"address"==t[o]&&(n="41"+n.substr(2).toLowerCase()),e.length?r[e[o]]=n:r.push(n),r}),e.length?{}:[])}function yt(e,t){for(var r=0;r1?r.length&&r.forEach((function(r){e(t,r,n-1)})):r.length&&n&&r.forEach((function(e){a(t,e)}))},a=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0;t.length&&t.forEach((function(t,n){var a=t.type;if(r[n])if("address"===a)r[n]=dt(r[n]);else if("address["===a.match(/^([^\x5b]*)(\x5b|$)/)[0])o(r[n]);else if(0===a.indexOf("tuple"))if(mt(a)){var s=gt(a);i(t.components,r[n],s)}else e(t.components,r[n])}))};if(e.inputs&&e.inputs.length)for(var s=0;s1?r.length&&r.forEach((function(r){e(t,r,n-1)})):r.length&&n&&r.forEach((function(e){i(t,e)}))},o=function e(t){var r=t.name?" ".concat(t.name):"";if(t&&0===t.type.indexOf("tuple")&&t.components){var n=t.components.map((function(t){return e(t)}));return"tuple(".concat(n.join(","),")").concat(mt(t.type)).concat(r)}return/trcToken/.test(t.type)?t.type.replace(/trcToken/,"uint256")+r:t.type+r},i=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1?arguments[1]:void 0;t.length&&t.forEach((function(t,i){var a=t.type,s=t.name;if(o[i])if("address"===a)o[i]=dr.address.toHex(o[i]),s&&(o[s]=dr.address.toHex(o[s]));else if("address["===a.match(/^([^\x5b]*)(\x5b|$)/)[0])r(o[i]),s&&r(o[s]);else if(0===a.indexOf("tuple")){if(mt(a)){var u=gt(a);n(t.components,o[i],u)}else e(t.components,o[i]);s&&(o[s]=o[i])}}))};if(e.outputs&&e.outputs.length>0){for(var a=[],s=0;s1?r-1:0),o=1;o0&&void 0!==e[0]?e[0]:1e3,t.abrupt("return",new Promise((function(e){return setTimeout(e,r)})));case 2:case"end":return t.stop()}}),t)})))()}}),{},{code:o,accounts:u,base58:i,bytes:n,crypto:s,abi:c,message:l,_TypedDataEncoder:ze,ethersUtils:a}),It={HttpProvider:function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e4,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"/";if(m()(this,e),!Rt.isValidURL(t))throw new Error("Invalid URL provided to HttpProvider");if(isNaN(r)||r<0)throw new Error("Invalid timeout duration provided");if(!Rt.isObject(i))throw new Error("Invalid headers object provided");t=t.replace(/\/+$/,""),this.host=t,this.timeout=r,this.user=n,this.password=o,this.headers=i,this.statusPage=a,this.instance=C.a.create({baseURL:t,timeout:r,headers:i,auth:n&&{user:n,password:o}})}var t;return v()(e,[{key:"setStatusPage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";this.statusPage=e}},{key:"isConnected",value:(t=d()(R.a.mark((function e(){var t,r=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:this.statusPage,e.abrupt("return",this.request(t).then((function(e){return Rt.hasProperties(e,"blockID","block_header")})).catch((function(){return!1})));case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"request",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"get";return r=r.toLowerCase(),this.instance.request({data:"post"==r&&Object.keys(t).length?t:null,params:"get"==r&&t,url:e,method:r}).then((function(e){return e.data}))}}]),e}()},Ct=r(25),Mt=r.n(Ct),Bt=r(26),Nt=r(16),Lt=r.n(Nt),jt=r(7),Ut=r.n(jt),Ft=r(11),Dt=r.n(Ft);function zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]&&arguments[0];if(m()(this,e),!t||!t instanceof dr)throw new Error("Expected instance of TronWeb");this.tronWeb=t}return v()(e,[{key:"invalid",value:function(e){return e.msg||"Invalid ".concat(e.name).concat("address"===e.type?" address":""," provided")}},{key:"notPositive",value:function(e){return"".concat(e.name," must be a positive integer")}},{key:"notEqual",value:function(e){return e.msg||"".concat(e.names[0]," can not be equal to ").concat(e.names[1])}},{key:"notValid",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Function,n={},o=!1,i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return zt(e,t);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)?zt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(t);try{for(i.s();!(e=i.n()).done;){var a=e.value,s=a.name,u=a.names,c=a.value,l=a.type,f=a.gt,d=a.lt,h=a.gte,p=a.lte;if(!(a.se,a.optional)||Rt.isNotNullOrUndefined(c)&&("boolean"===l||!1!==c)){switch(n[a.name]=a.value,l){case"address":this.tronWeb.isAddress(c)?n[s]=this.tronWeb.address.toHex(c):o=!0;break;case"integer":(!Rt.isInteger(c)||"number"==typeof f&&c<=a.gt||"number"==typeof d&&c>=a.lt||"number"==typeof h&&ca.lte)&&(o=!0);break;case"positive-integer":if(!Rt.isInteger(c)||c<=0)return void r(this.notPositive(a));break;case"tokenId":case"not-empty-string":Rt.isString(c)&&c.length||(o=!0);break;case"notEmptyObject":Rt.isObject(c)&&Object.keys(c).length||(o=!0);break;case"notEqual":if(n[u[0]]===n[u[1]])return r(this.notEqual(a)),!0;break;case"resource":["BANDWIDTH","ENERGY"].includes(c)||(o=!0);break;case"url":Rt.isValidURL(c)||(o=!0);break;case"hex":Rt.isHex(c)||(o=!0);break;case"array":Array.isArray(c)||(o=!0);break;case"boolean":Rt.isBoolean(c)||(o=!0);break;case"string":(!Rt.isString(c)||"number"==typeof f&&c.length<=a.gt||"number"==typeof d&&c.length>=a.lt||"number"==typeof h&&c.lengtha.lte)&&(o=!0)}if(o)return r(this.invalid(a)),!0}}}catch(e){i.e(e)}finally{i.f()}return!1}}]),e}();function Vt(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Kt(e,t);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)?Kt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Kt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]&&arguments[0];if(m()(this,e),!t||!t instanceof dr)throw new Error("Expected instance of TronWeb");qt=this,this.tronWeb=t,this.injectPromise=Ut()(this),this.validator=new Ht(t)}var t,r,n,o;return v()(e,[{key:"sendTrx",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tronWeb.defaultAddress.hex,n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Rt.isFunction(n)&&(o=n,n={}),Rt.isFunction(r)?(o=r,r=this.tronWeb.defaultAddress.hex):Rt.isObject(r)&&(n=r,r=this.tronWeb.defaultAddress.hex),!o)return this.injectPromise(this.sendTrx,e,t,r,n);if(t=parseInt(t),!this.validator.notValid([{name:"recipient",type:"address",value:e},{name:"origin",type:"address",value:r},{names:["recipient","origin"],type:"notEqual",msg:"Cannot transfer TRX to the same account"},{name:"amount",type:"integer",gt:0,value:t}],o)){var i={to_address:Wt(e),owner_address:Wt(r),amount:t};n&&n.permissionId&&(i.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/createtransaction",i,"post").then((function(e){return Xt(e,o)})).catch((function(e){return o(e)}))}}},{key:"sendToken",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Rt.isFunction(o)&&(i=o,o={}),Rt.isFunction(n)?(i=n,n=this.tronWeb.defaultAddress.hex):Rt.isObject(n)&&(o=n,n=this.tronWeb.defaultAddress.hex),!i)return this.injectPromise(this.sendToken,e,t,r,n,o);if(t=parseInt(t),!this.validator.notValid([{name:"recipient",type:"address",value:e},{name:"origin",type:"address",value:n},{names:["recipient","origin"],type:"notEqual",msg:"Cannot transfer tokens to the same account"},{name:"amount",type:"integer",gt:0,value:t},{name:"token ID",type:"tokenId",value:r}],i)){var a={to_address:Wt(e),owner_address:Wt(n),asset_name:Gt(r),amount:parseInt(t)};o&&o.permissionId&&(a.Permission_id=o.permissionId),this.tronWeb.fullNode.request("wallet/transferasset",a,"post").then((function(e){return Xt(e,i)})).catch((function(e){return i(e)}))}}},{key:"purchaseToken",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Rt.isFunction(o)&&(i=o,o={}),Rt.isFunction(n)?(i=n,n=this.tronWeb.defaultAddress.hex):Rt.isObject(n)&&(o=n,n=this.tronWeb.defaultAddress.hex),!i)return this.injectPromise(this.purchaseToken,e,t,r,n,o);if(!this.validator.notValid([{name:"buyer",type:"address",value:n},{name:"issuer",type:"address",value:e},{names:["buyer","issuer"],type:"notEqual",msg:"Cannot purchase tokens from same account"},{name:"amount",type:"integer",gt:0,value:r},{name:"token ID",type:"tokenId",value:t}],i)){var a={to_address:Wt(e),owner_address:Wt(n),asset_name:Gt(t),amount:parseInt(r)};o&&o.permissionId&&(a.Permission_id=o.permissionId),this.tronWeb.fullNode.request("wallet/participateassetissue",a,"post").then((function(e){return Xt(e,i)})).catch((function(e){return i(e)}))}}},{key:"freezeBalance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"BANDWIDTH",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(Rt.isFunction(i)&&(a=i,i={}),Rt.isFunction(o)?(a=o,o=void 0):Rt.isObject(o)&&(i=o,o=void 0),Rt.isFunction(n)?(a=n,n=this.tronWeb.defaultAddress.hex):Rt.isObject(n)&&(i=n,n=this.tronWeb.defaultAddress.hex),Rt.isFunction(t)&&(a=t,t=3),Rt.isFunction(r)&&(a=r,r="BANDWIDTH"),!a)return this.injectPromise(this.freezeBalance,e,t,r,n,o,i);if(!this.validator.notValid([{name:"origin",type:"address",value:n},{name:"receiver",type:"address",value:o,optional:!0},{name:"amount",type:"integer",gt:0,value:e},{name:"duration",type:"integer",gte:3,value:t},{name:"resource",type:"resource",value:r,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY'}],a)){var s={owner_address:Wt(n),frozen_balance:parseInt(e),frozen_duration:parseInt(t),resource:r};Rt.isNotNullOrUndefined(o)&&Wt(o)!==Wt(n)&&(s.receiver_address=Wt(o)),i&&i.permissionId&&(s.Permission_id=i.permissionId),this.tronWeb.fullNode.request("wallet/freezebalance",s,"post").then((function(e){return Xt(e,a)})).catch((function(e){return a(e)}))}}},{key:"unfreezeBalance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"BANDWIDTH",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Rt.isFunction(n)&&(o=n,n={}),Rt.isFunction(r)?(o=r,r=void 0):Rt.isObject(r)&&(n=r,r=void 0),Rt.isFunction(t)?(o=t,t=this.tronWeb.defaultAddress.hex):Rt.isObject(t)&&(n=t,t=this.tronWeb.defaultAddress.hex),Rt.isFunction(e)&&(o=e,e="BANDWIDTH"),!o)return this.injectPromise(this.unfreezeBalance,e,t,r,n);if(!this.validator.notValid([{name:"origin",type:"address",value:t},{name:"receiver",type:"address",value:r,optional:!0},{name:"resource",type:"resource",value:e,msg:'Invalid resource provided: Expected "BANDWIDTH" or "ENERGY'}],o)){var i={owner_address:Wt(t),resource:e};Rt.isNotNullOrUndefined(r)&&Wt(r)!==Wt(t)&&(i.receiver_address=Wt(r)),n&&n.permissionId&&(i.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/unfreezebalance",i,"post").then((function(e){return Xt(e,o)})).catch((function(e){return o(e)}))}}},{key:"withdrawBlockRewards",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Rt.isFunction(t)&&(r=t,t={}),Rt.isFunction(e)?(r=e,e=this.tronWeb.defaultAddress.hex):Rt.isObject(e)&&(t=e,e=this.tronWeb.defaultAddress.hex),!r)return this.injectPromise(this.withdrawBlockRewards,e,t);if(!this.validator.notValid([{name:"origin",type:"address",value:e}],r)){var n={owner_address:Wt(e)};t&&t.permissionId&&(n.Permission_id=t.permissionId),this.tronWeb.fullNode.request("wallet/withdrawbalance",n,"post").then((function(e){return Xt(e,r)})).catch((function(e){return r(e)}))}}},{key:"applyForSR",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Rt.isFunction(r)&&(n=r,r={}),Rt.isObject(t)&&Rt.isValidURL(e)&&(r=t,t=e,e=this.tronWeb.defaultAddress.hex),!n)return this.injectPromise(this.applyForSR,e,t,r);if(!this.validator.notValid([{name:"origin",type:"address",value:e},{name:"url",type:"url",value:t,msg:"Invalid url provided"}],n)){var o={owner_address:Wt(e),url:Gt(t)};r&&r.permissionId&&(o.Permission_id=r.permissionId),this.tronWeb.fullNode.request("wallet/createwitness",o,"post").then((function(e){return Xt(e,n)})).catch((function(e){return n(e)}))}}},{key:"vote",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Rt.isFunction(n)&&(o=n,n={}),Rt.isFunction(r)?(o=r,r=this.tronWeb.defaultAddress.hex):Rt.isObject(r)&&(n=r,r=this.tronWeb.defaultAddress.hex),!o)return this.injectPromise(this.vote,t,r,n);if(!this.validator.notValid([{name:"voter",type:"address",value:r},{name:"votes",type:"notEmptyObject",value:t}],o)){var i=!1;if(t=Object.entries(t).map((function(t){var r=Dt()(t,2),n=r[0],o=r[1];if(!i)return e.validator.notValid([{name:"SR",type:"address",value:n},{name:"vote count",type:"integer",gt:0,value:o,msg:"Invalid vote count provided for SR: "+n}])?i=!0:{vote_address:Wt(n),vote_count:parseInt(o)}})),!i){var a={owner_address:Wt(r),votes:t};n&&n.permissionId&&(a.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/votewitnessaccount",a,"post").then((function(e){return Xt(e,o)})).catch((function(e){return o(e)}))}}}},{key:"createSmartContract",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Rt.isFunction(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),!r)return this.injectPromise(this.createSmartContract,e,t);var n=e.feeLimit||this.tronWeb.feeLimit,o=e.userFeePercentage;"number"==typeof o||o||(o=100);var i=e.originEnergyLimit||1e7,a=e.callValue||0,s=e.tokenValue,u=e.tokenId||e.token_id,c=e.abi,l=void 0!==c&&c,f=e.bytecode,d=void 0!==f&&f,h=e.parameters,p=void 0===h?[]:h,y=e.name,m=void 0===y?"":y;if(l&&Rt.isString(l))try{l=JSON.parse(l)}catch(e){return r("Invalid options.abi provided")}if(l.entrys&&(l=l.entrys),!Rt.isArray(l))return r("Invalid options.abi provided");var g=l.some((function(e){return"constructor"===e.type&&"payable"===e.stateMutability.toLowerCase()}));if(!this.validator.notValid([{name:"bytecode",type:"hex",value:d},{name:"feeLimit",type:"integer",value:n,gt:0},{name:"callValue",type:"integer",value:a,gte:0},{name:"userFeePercentage",type:"integer",value:o,gte:0,lte:100},{name:"originEnergyLimit",type:"integer",value:i,gte:0,lte:1e7},{name:"parameters",type:"array",value:p},{name:"issuer",type:"address",value:t},{name:"tokenValue",type:"integer",value:s,gte:0,optional:!0},{name:"tokenId",type:"integer",value:u,gte:0,optional:!0}],r)){if(g&&0==a&&0==s)return r("When contract is payable, options.callValue or options.tokenValue must be a positive integer");if(!g&&(a>0||s>0))return r("When contract is not payable, options.callValue and options.tokenValue must be 0");if(e.rawParameter&&Rt.isString(e.rawParameter))p=e.rawParameter.replace(/^(0x)/,"");else if(e.funcABIV2)p=vt(e.funcABIV2,e.parametersV2).replace(/^(0x)/,"");else{var v=l.find((function(e){return"constructor"===e.type}));if(void 0!==v&&v){var b=new fe,w=[],A=[];if(v=v.inputs,p.length!=v.length)return r("constructor needs ".concat(v.length," but ").concat(p.length," provided"));for(var S=0;S2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.tronWeb.defaultAddress.hex,i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Rt.isFunction(o)&&(i=o,o=this.tronWeb.defaultAddress.hex),Rt.isFunction(n)&&(i=n,n=[]),!i)return this.injectPromise(this._triggerSmartContract,e,t,r,n,o);var a=Object.assign({callValue:0,feeLimit:this.tronWeb.feeLimit},r),s=a.tokenValue,u=a.tokenId,c=a.callValue,l=a.feeLimit;if(!this.validator.notValid([{name:"feeLimit",type:"integer",value:l,gt:0},{name:"callValue",type:"integer",value:c,gte:0},{name:"parameters",type:"array",value:n},{name:"contract",type:"address",value:e},{name:"issuer",type:"address",value:o,optional:!0},{name:"tokenValue",type:"integer",value:s,gte:0,optional:!0},{name:"tokenId",type:"integer",value:u,gte:0,optional:!0}],i)){var f={contract_address:Wt(e),owner_address:Wt(o)};if(t&&Rt.isString(t)){if(t=t.replace("/s*/g",""),n.length){for(var d=new fe,h=[],p=[],y=0;y1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!r)return this.injectPromise(this.clearABI,e,t);if(!this.tronWeb.isAddress(e))return r("Invalid contract address provided");if(!this.tronWeb.isAddress(t))return r("Invalid owner address provided");var n={contract_address:Wt(e),owner_address:Wt(t)};this.tronWeb.trx.cache.contracts[e]&&delete this.tronWeb.trx.cache.contracts[e],this.tronWeb.fullNode.request("wallet/clearabi",n,"post").then((function(e){return Xt(e,r)})).catch((function(e){return r(e)}))}},{key:"updateBrokerage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!r)return this.injectPromise(this.updateBrokerage,e,t);if(!Rt.isNotNullOrUndefined(e))return r("Invalid brokerage provided");if(!Rt.isInteger(e)||e<0||e>100)return r("Brokerage must be an integer between 0 and 100");if(!this.tronWeb.isAddress(t))return r("Invalid owner address provided");var n={brokerage:parseInt(e),owner_address:Wt(t)};this.tronWeb.fullNode.request("wallet/updateBrokerage",n,"post").then((function(e){return Xt(e,r)})).catch((function(e){return r(e)}))}},{key:"createToken",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Rt.isFunction(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),!r)return this.injectPromise(this.createToken,e,t);var n=e.name,o=void 0!==n&&n,i=e.abbreviation,a=void 0!==i&&i,s=e.description,u=void 0!==s&&s,c=e.url,l=void 0!==c&&c,f=e.totalSupply,d=void 0===f?0:f,h=e.trxRatio,p=void 0===h?1:h,y=e.tokenRatio,m=void 0===y?1:y,g=e.saleStart,v=void 0===g?Date.now():g,b=e.saleEnd,w=void 0!==b&&b,A=e.freeBandwidth,S=void 0===A?0:A,k=e.freeBandwidthLimit,_=void 0===k?0:k,E=e.frozenAmount,x=void 0===E?0:E,T=e.frozenDuration,P=void 0===T?0:T,O=e.voteScore,R=e.precision;if(!this.validator.notValid([{name:"Supply amount",type:"positive-integer",value:d},{name:"TRX ratio",type:"positive-integer",value:p},{name:"Token ratio",type:"positive-integer",value:m},{name:"token abbreviation",type:"not-empty-string",value:a},{name:"token name",type:"not-empty-string",value:o},{name:"token description",type:"not-empty-string",value:u},{name:"token url",type:"url",value:l},{name:"issuer",type:"address",value:t},{name:"sale start timestamp",type:"integer",value:v,gte:Date.now()},{name:"sale end timestamp",type:"integer",value:w,gt:v},{name:"Free bandwidth amount",type:"integer",value:S,gte:0},{name:"Free bandwidth limit",type:"integer",value:_,gte:0},{name:"Frozen supply",type:"integer",value:x,gte:0},{name:"Frozen duration",type:"integer",value:P,gte:0}],r)){if(Rt.isNotNullOrUndefined(O)&&(!Rt.isInteger(O)||O<=0))return r("voteScore must be a positive integer greater than 0");if(Rt.isNotNullOrUndefined(R)&&(!Rt.isInteger(R)||R<0||R>6))return r("precision must be a positive integer >= 0 and <= 6");var I={owner_address:Wt(t),name:Gt(o),abbr:Gt(a),description:Gt(u),url:Gt(l),total_supply:parseInt(d),trx_num:parseInt(p),num:parseInt(m),start_time:parseInt(v),end_time:parseInt(w),free_asset_net_limit:parseInt(S),public_free_asset_net_limit:parseInt(_),frozen_supply:{frozen_amount:parseInt(x),frozen_days:parseInt(P)}};parseInt(x)>0||delete I.frozen_supply,R&&!isNaN(parseInt(R))&&(I.precision=parseInt(R)),O&&!isNaN(parseInt(O))&&(I.vote_score=parseInt(O)),e&&e.permissionId&&(I.Permission_id=e.permissionId),this.tronWeb.fullNode.request("wallet/createassetissue",I,"post").then((function(e){return Xt(e,r)})).catch((function(e){return r(e)}))}}},{key:"updateAccount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Rt.isFunction(r)&&(n=r,r={}),Rt.isFunction(t)?(n=t,t=this.tronWeb.defaultAddress.hex):Rt.isObject(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),!n)return this.injectPromise(this.updateAccount,e,t,r);if(!this.validator.notValid([{name:"Name",type:"not-empty-string",value:e},{name:"origin",type:"address",value:t}],n)){var o={account_name:Gt(e),owner_address:Wt(t)};r&&r.permissionId&&(o.Permission_id=r.permissionId),this.tronWeb.fullNode.request("wallet/updateaccount",o,"post").then((function(e){return Xt(e,n)})).catch((function(e){return n(e)}))}}},{key:"setAccountId",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Rt.isFunction(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),!r)return this.injectPromise(this.setAccountId,e,t);e&&Rt.isString(e)&&e.startsWith("0x")&&(e=e.slice(2)),this.validator.notValid([{name:"accountId",type:"hex",value:e},{name:"accountId",type:"string",lte:32,gte:8,value:e},{name:"origin",type:"address",value:t}],r)||this.tronWeb.fullNode.request("wallet/setaccountid",{account_id:e,owner_address:Wt(t)},"post").then((function(e){return Xt(e,r)})).catch((function(e){return r(e)}))}},{key:"updateToken",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Rt.isFunction(t)?(r=t,t=this.tronWeb.defaultAddress.hex):Rt.isObject(t)&&(e=t,t=this.tronWeb.defaultAddress.hex),!r)return this.injectPromise(this.updateToken,e,t);var n=e,o=n.description,i=void 0!==o&&o,a=n.url,s=void 0!==a&&a,u=n.freeBandwidth,c=void 0===u?0:u,l=n.freeBandwidthLimit,f=void 0===l?0:l;if(!this.validator.notValid([{name:"token description",type:"not-empty-string",value:i},{name:"token url",type:"url",value:s},{name:"issuer",type:"address",value:t},{name:"Free bandwidth amount",type:"positive-integer",value:c},{name:"Free bandwidth limit",type:"positive-integer",value:f}],r)){var d={owner_address:Wt(t),description:Gt(i),url:Gt(s),new_limit:parseInt(c),new_public_limit:parseInt(f)};e&&e.permissionId&&(d.Permission_id=e.permissionId),this.tronWeb.fullNode.request("wallet/updateasset",d,"post").then((function(e){return Xt(e,r)})).catch((function(e){return r(e)}))}}},{key:"sendAsset",value:function(){return this.sendToken.apply(this,arguments)}},{key:"purchaseAsset",value:function(){return this.purchaseToken.apply(this,arguments)}},{key:"createAsset",value:function(){return this.createToken.apply(this,arguments)}},{key:"updateAsset",value:function(){return this.updateToken.apply(this,arguments)}},{key:"createProposal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Rt.isFunction(r)&&(n=r,r={}),Rt.isFunction(t)?(n=t,t=this.tronWeb.defaultAddress.hex):Rt.isObject(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),!n)return this.injectPromise(this.createProposal,e,t,r);if(!this.validator.notValid([{name:"issuer",type:"address",value:t}],n)){var o="Invalid proposal parameters provided";if(!e)return n(o);Rt.isArray(e)||(e=[e]);var i,a=Vt(e);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(!Rt.isObject(s))return n(o)}}catch(e){a.e(e)}finally{a.f()}var u={owner_address:Wt(t),parameters:e};r&&r.permissionId&&(u.Permission_id=r.permissionId),this.tronWeb.fullNode.request("wallet/proposalcreate",u,"post").then((function(e){return Xt(e,n)})).catch((function(e){return n(e)}))}}},{key:"deleteProposal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultAddress.hex,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Rt.isFunction(r)&&(n=r,r={}),Rt.isFunction(t)?(n=t,t=this.tronWeb.defaultAddress.hex):Rt.isObject(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),!n)return this.injectPromise(this.deleteProposal,e,t,r);if(!this.validator.notValid([{name:"issuer",type:"address",value:t},{name:"proposalID",type:"integer",value:e,gte:0}],n)){var o={owner_address:Wt(t),proposal_id:parseInt(e)};r&&r.permissionId&&(o.Permission_id=r.permissionId),this.tronWeb.fullNode.request("wallet/proposaldelete",o,"post").then((function(e){return Xt(e,n)})).catch((function(e){return n(e)}))}}},{key:"voteProposal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tronWeb.defaultAddress.hex,n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Rt.isFunction(n)&&(o=n,n={}),Rt.isFunction(r)?(o=r,r=this.tronWeb.defaultAddress.hex):Rt.isObject(r)&&(n=r,r=this.tronWeb.defaultAddress.hex),!o)return this.injectPromise(this.voteProposal,e,t,r,n);if(!this.validator.notValid([{name:"voter",type:"address",value:r},{name:"proposalID",type:"integer",value:e,gte:0},{name:"has approval",type:"boolean",value:t}],o)){var i={owner_address:Wt(r),proposal_id:parseInt(e),is_add_approval:t};n&&n.permissionId&&(i.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/proposalapprove",i,"post").then((function(e){return Xt(e,o)})).catch((function(e){return o(e)}))}}},{key:"createTRXExchange",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Rt.isFunction(o)&&(i=o,o={}),Rt.isFunction(n)?(i=n,n=this.tronWeb.defaultAddress.hex):Rt.isObject(n)&&(o=n,n=this.tronWeb.defaultAddress.hex),!i)return this.injectPromise(this.createTRXExchange,e,t,r,n,o);if(!this.validator.notValid([{name:"owner",type:"address",value:n},{name:"token name",type:"not-empty-string",value:e},{name:"token balance",type:"positive-integer",value:t},{name:"trx balance",type:"positive-integer",value:r}],i)){var a={owner_address:Wt(n),first_token_id:Gt(e),first_token_balance:t,second_token_id:"5f",second_token_balance:r};o&&o.permissionId&&(a.Permission_id=o.permissionId),this.tronWeb.fullNode.request("wallet/exchangecreate",a,"post").then((function(e){i(null,e)})).catch((function(e){return i(e)}))}}},{key:"createTokenExchange",value:function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.tronWeb.defaultAddress.hex,i=arguments.length>5?arguments[5]:void 0,a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(Rt.isFunction(i)&&(a=i,i={}),Rt.isFunction(o)?(a=o,o=this.tronWeb.defaultAddress.hex):Rt.isObject(o)&&(i=o,o=this.tronWeb.defaultAddress.hex),!a)return this.injectPromise(this.createTokenExchange,e,t,r,n,o,i);if(!this.validator.notValid([{name:"owner",type:"address",value:o},{name:"first token name",type:"not-empty-string",value:e},{name:"second token name",type:"not-empty-string",value:r},{name:"first token balance",type:"positive-integer",value:t},{name:"second token balance",type:"positive-integer",value:n}],a)){var s={owner_address:Wt(o),first_token_id:Gt(e),first_token_balance:t,second_token_id:Gt(r),second_token_balance:n};i&&i.permissionId&&(s.Permission_id=i.permissionId),this.tronWeb.fullNode.request("wallet/exchangecreate",s,"post").then((function(e){a(null,e)})).catch((function(e){return a(e)}))}}},{key:"injectExchangeTokens",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Rt.isFunction(o)&&(i=o,o={}),Rt.isFunction(n)?(i=n,n=this.tronWeb.defaultAddress.hex):Rt.isObject(n)&&(o=n,n=this.tronWeb.defaultAddress.hex),!i)return this.injectPromise(this.injectExchangeTokens,e,t,r,n,o);if(!this.validator.notValid([{name:"owner",type:"address",value:n},{name:"token name",type:"not-empty-string",value:t},{name:"token amount",type:"integer",value:r,gte:1},{name:"exchangeID",type:"integer",value:e,gte:0}],i)){var a={owner_address:Wt(n),exchange_id:parseInt(e),token_id:Gt(t),quant:parseInt(r)};o&&o.permissionId&&(a.Permission_id=o.permissionId),this.tronWeb.fullNode.request("wallet/exchangeinject",a,"post").then((function(e){return Xt(e,i)})).catch((function(e){return i(e)}))}}},{key:"withdrawExchangeTokens",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultAddress.hex,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(Rt.isFunction(o)&&(i=o,o={}),Rt.isFunction(n)?(i=n,n=this.tronWeb.defaultAddress.hex):Rt.isObject(n)&&(o=n,n=this.tronWeb.defaultAddress.hex),!i)return this.injectPromise(this.withdrawExchangeTokens,e,t,r,n,o);if(!this.validator.notValid([{name:"owner",type:"address",value:n},{name:"token name",type:"not-empty-string",value:t},{name:"token amount",type:"integer",value:r,gte:1},{name:"exchangeID",type:"integer",value:e,gte:0}],i)){var a={owner_address:Wt(n),exchange_id:parseInt(e),token_id:Gt(t),quant:parseInt(r)};o&&o.permissionId&&(a.Permission_id=o.permissionId),this.tronWeb.fullNode.request("wallet/exchangewithdraw",a,"post").then((function(e){return Xt(e,i)})).catch((function(e){return i(e)}))}}},{key:"tradeExchangeTokens",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.tronWeb.defaultAddress.hex,i=arguments.length>5?arguments[5]:void 0,a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(Rt.isFunction(i)&&(a=i,i={}),Rt.isFunction(o)?(a=o,o=this.tronWeb.defaultAddress.hex):Rt.isObject(o)&&(i=o,o=this.tronWeb.defaultAddress.hex),!a)return this.injectPromise(this.tradeExchangeTokens,e,t,r,n,o,i);if(!this.validator.notValid([{name:"owner",type:"address",value:o},{name:"token name",type:"not-empty-string",value:t},{name:"tokenAmountSold",type:"integer",value:r,gte:1},{name:"tokenAmountExpected",type:"integer",value:n,gte:1},{name:"exchangeID",type:"integer",value:e,gte:0}],a)){var s={owner_address:Wt(o),exchange_id:parseInt(e),token_id:this.tronWeb.fromAscii(t),quant:parseInt(r),expected:parseInt(n)};i&&i.permissionId&&(s.Permission_id=i.permissionId),this.tronWeb.fullNode.request("wallet/exchangetransaction",s,"post").then((function(e){return Xt(e,a)})).catch((function(e){return a(e)}))}}},{key:"updateSetting",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tronWeb.defaultAddress.hex,n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Rt.isFunction(n)&&(o=n,n={}),Rt.isFunction(r)?(o=r,r=this.tronWeb.defaultAddress.hex):Rt.isObject(r)&&(n=r,r=this.tronWeb.defaultAddress.hex),!o)return this.injectPromise(this.updateSetting,e,t,r,n);if(!this.validator.notValid([{name:"owner",type:"address",value:r},{name:"contract",type:"address",value:e},{name:"userFeePercentage",type:"integer",value:t,gte:0,lte:100}],o)){var i={owner_address:Wt(r),contract_address:Wt(e),consume_user_resource_percent:t};n&&n.permissionId&&(i.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/updatesetting",i,"post").then((function(e){return Xt(e,o)})).catch((function(e){return o(e)}))}}},{key:"updateEnergyLimit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tronWeb.defaultAddress.hex,n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Rt.isFunction(n)&&(o=n,n={}),Rt.isFunction(r)?(o=r,r=this.tronWeb.defaultAddress.hex):Rt.isObject(r)&&(n=r,r=this.tronWeb.defaultAddress.hex),!o)return this.injectPromise(this.updateEnergyLimit,e,t,r,n);if(!this.validator.notValid([{name:"owner",type:"address",value:r},{name:"contract",type:"address",value:e},{name:"originEnergyLimit",type:"integer",value:t,gte:0,lte:1e7}],o)){var i={owner_address:Wt(r),contract_address:Wt(e),origin_energy_limit:t};n&&n.permissionId&&(i.Permission_id=n.permissionId),this.tronWeb.fullNode.request("wallet/updateenergylimit",i,"post").then((function(e){return Xt(e,o)})).catch((function(e){return o(e)}))}}},{key:"checkPermissions",value:function(e,t){if(e){if(e.type!==t||!e.permission_name||!Rt.isString(e.permission_name)||!Rt.isInteger(e.threshold)||e.threshold<1||!e.keys)return!1;var r,n=Vt(e.keys);try{for(n.s();!(r=n.n()).done;){var o=r.value;if(!this.tronWeb.isAddress(o.address)||!Rt.isInteger(o.weight)||o.weight>e.threshold||o.weight<1||2===t&&!e.operations)return!1}}catch(e){n.e(e)}finally{n.f()}}return!0}},{key:"updateAccountPermissions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Rt.isFunction(n)&&(o=n,n=!1),Rt.isFunction(r)&&(o=r,r=n=!1),Rt.isFunction(t)&&(o=t,t=r=n=!1),!o)return this.injectPromise(this.updateAccountPermissions,e,t,r,n);if(!this.tronWeb.isAddress(e))return o("Invalid ownerAddress provided");if(!this.checkPermissions(t,0))return o("Invalid ownerPermissions provided");if(!this.checkPermissions(r,1))return o("Invalid witnessPermissions provided");Array.isArray(n)||(n=[n]);var i,a=Vt(n);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(!this.checkPermissions(s,2))return o("Invalid activesPermissions provided")}}catch(e){a.e(e)}finally{a.f()}var u={owner_address:e};t&&(u.owner=t),r&&(u.witness=r),n&&(u.actives=1===n.length?n[0]:n),this.tronWeb.fullNode.request("wallet/accountpermissionupdate",u,"post").then((function(e){return Xt(e,o)})).catch((function(e){return o(e)}))}},{key:"newTxID",value:(o=d()(R.a.mark((function e(t,r){return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",this.injectPromise(this.newTxID,t));case 2:this.tronWeb.fullNode.request("wallet/getsignweight",t,"post").then((function(e){e=e.transaction.transaction,"boolean"==typeof t.visible&&(e.visible=t.visible),r(null,e)})).catch((function(e){return r("Error generating a new transaction id.")}));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"alterTransaction",value:(n=d()(R.a.mark((function e(t){var r,n,o=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>1&&void 0!==o[1]?o[1]:{},n=o.length>2&&void 0!==o[2]&&o[2]){e.next=4;break}return e.abrupt("return",this.injectPromise(this.alterTransaction,t,r));case 4:if(!t.signature){e.next=6;break}return e.abrupt("return",n("You can not extend the expiration of a signed transaction."));case 6:if(!r.data){e.next=12;break}if("hex"!==r.dataFormat&&(r.data=this.tronWeb.toHex(r.data)),r.data=r.data.replace(/^0x/,""),0!==r.data.length){e.next=11;break}return e.abrupt("return",n("Invalid data provided"));case 11:t.raw_data.data=r.data;case 12:if(!r.extension){e.next=17;break}if(r.extension=parseInt(1e3*r.extension),!(isNaN(r.extension)||t.raw_data.expiration+r.extension<=Date.now()+3e3)){e.next=16;break}return e.abrupt("return",n("Invalid extension provided"));case 16:t.raw_data.expiration+=r.extension;case 17:this.newTxID(t,n);case 18:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"extendExpiration",value:(r=d()(R.a.mark((function e(t,r){var n,o=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.length>2&&void 0!==o[2]&&o[2]){e.next=3;break}return e.abrupt("return",this.injectPromise(this.extendExpiration,t,r));case 3:this.alterTransaction(t,{extension:r},n);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"addUpdateData",value:(t=d()(R.a.mark((function e(t,r){var n,o,i=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.length>2&&void 0!==i[2]?i[2]:"utf8",o=i.length>3&&void 0!==i[3]&&i[3],Rt.isFunction(n)&&(o=n,n="utf8"),o){e.next=5;break}return e.abrupt("return",this.injectPromise(this.addUpdateData,t,r,n));case 5:this.alterTransaction(t,{data:r,dataFormat:n},o);case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function Qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yt(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0];if(m()(this,e),!t||!t instanceof dr)throw new Error("Expected instance of TronWeb");this.tronWeb=t,this.injectPromise=Ut()(this),this.cache={contracts:{}},this.validator=new Ht(t)}var t,r,n,o,i,a,s,u,c,l,f,h,p,y,g,b,w;return v()(e,[{key:"_parseToken",value:function(e){return Yt(Yt({},e),{},{name:this.tronWeb.toUtf8(e.name),abbr:e.abbr&&this.tronWeb.toUtf8(e.abbr),description:e.description&&this.tronWeb.toUtf8(e.description),url:e.url&&this.tronWeb.toUtf8(e.url)})}},{key:"getCurrentBlock",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.injectPromise(this.getCurrentBlock);this.tronWeb.fullNode.request("wallet/getnowblock").then((function(t){e(null,t)})).catch((function(t){return e(t)}))}},{key:"getConfirmedCurrentBlock",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.injectPromise(this.getConfirmedCurrentBlock);this.tronWeb.solidityNode.request("walletsolidity/getnowblock").then((function(t){e(null,t)})).catch((function(t){return e(t)}))}},{key:"getBlock",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultBlock,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Rt.isFunction(e)&&(t=e,e=this.tronWeb.defaultBlock),t?!1===e?t("No block identifier provided"):("earliest"==e&&(e=0),"latest"==e?this.getCurrentBlock(t):isNaN(e)&&Rt.isHex(e)?this.getBlockByHash(e,t):void this.getBlockByNumber(e,t)):this.injectPromise(this.getBlock,e)}},{key:"getBlockByHash",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return this.injectPromise(this.getBlockByHash,e);this.tronWeb.fullNode.request("wallet/getblockbyid",{value:e},"post").then((function(e){if(!Object.keys(e).length)return t("Block not found");t(null,e)})).catch((function(e){return t(e)}))}},{key:"getBlockByNumber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?!Rt.isInteger(e)||e<0?t("Invalid block number provided"):void this.tronWeb.fullNode.request("wallet/getblockbynum",{num:parseInt(e)},"post").then((function(e){if(!Object.keys(e).length)return t("Block not found");t(null,e)})).catch((function(e){return t(e)})):this.injectPromise(this.getBlockByNumber,e)}},{key:"getBlockTransactionCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultBlock,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Rt.isFunction(e)&&(t=e,e=this.tronWeb.defaultBlock),!t)return this.injectPromise(this.getBlockTransactionCount,e);this.getBlock(e).then((function(e){var r=e.transactions;t(null,(void 0===r?[]:r).length)})).catch((function(e){return t(e)}))}},{key:"getTransactionFromBlock",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultBlock,t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Rt.isFunction(t)&&(r=t,t=0),Rt.isFunction(e)&&(r=e,e=this.tronWeb.defaultBlock),!r)return this.injectPromise(this.getTransactionFromBlock,e,t);this.getBlock(e).then((function(e){var n=e.transactions,o=void 0!==n&&n;o?"number"==typeof t?t>=0&&t1&&void 0!==arguments[1]&&arguments[1];if(!t)return this.injectPromise(this.getTransaction,e);this.tronWeb.fullNode.request("wallet/gettransactionbyid",{value:e},"post").then((function(e){if(!Object.keys(e).length)return t("Transaction not found");t(null,e)})).catch((function(e){return t(e)}))}},{key:"getConfirmedTransaction",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return this.injectPromise(this.getConfirmedTransaction,e);this.tronWeb.solidityNode.request("walletsolidity/gettransactionbyid",{value:e},"post").then((function(e){if(!Object.keys(e).length)return t("Transaction not found");t(null,e)})).catch((function(e){return t(e)}))}},{key:"getUnconfirmedTransactionInfo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._getTransactionInfoById(e,{confirmed:!1},t)}},{key:"getTransactionInfo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._getTransactionInfoById(e,{confirmed:!0},t)}},{key:"_getTransactionInfoById",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!r)return this.injectPromise(this._getTransactionInfoById,e,t);this.tronWeb[t.confirmed?"solidityNode":"fullNode"].request("wallet".concat(t.confirmed?"solidity":"","/gettransactioninfobyid"),{value:e},"post").then((function(e){r(null,e)})).catch((function(e){return r(e)}))}},{key:"getTransactionsToAddress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Rt.isFunction(r)&&(n=r,r=0),Rt.isFunction(t)&&(n=t,t=30),n?(e=this.tronWeb.address.toHex(e),this.getTransactionsRelated(e,"to",t,r,n)):this.injectPromise(this.getTransactionsToAddress,e,t,r)}},{key:"getTransactionsFromAddress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Rt.isFunction(r)&&(n=r,r=0),Rt.isFunction(t)&&(n=t,t=30),n?(e=this.tronWeb.address.toHex(e),this.getTransactionsRelated(e,"from",t,r,n)):this.injectPromise(this.getTransactionsFromAddress,e,t,r)}},{key:"getTransactionsRelated",value:(w=d()(R.a.mark((function e(){var t,r,n,o,i,a,s,u,c,l=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=l.length>0&&void 0!==l[0]?l[0]:this.tronWeb.defaultAddress.hex,r=l.length>1&&void 0!==l[1]?l[1]:"all",n=l.length>2&&void 0!==l[2]?l[2]:30,o=l.length>3&&void 0!==l[3]?l[3]:0,i=l.length>4&&void 0!==l[4]&&l[4],Rt.isFunction(o)&&(i=o,o=0),Rt.isFunction(n)&&(i=n,n=30),Rt.isFunction(r)&&(i=r,r="all"),Rt.isFunction(t)&&(i=t,t=this.tronWeb.defaultAddress.hex),i){e.next=11;break}return e.abrupt("return",this.injectPromise(this.getTransactionsRelated,t,r,n,o));case 11:if(["to","from","all"].includes(r)){e.next=13;break}return e.abrupt("return",i('Invalid direction provided: Expected "to", "from" or "all"'));case 13:if("all"!=r){e.next=27;break}return e.prev=14,e.next=17,Promise.all([this.getTransactionsRelated(t,"from",n,o),this.getTransactionsRelated(t,"to",n,o)]);case 17:return a=e.sent,s=Dt()(a,2),u=s[0],c=s[1],e.abrupt("return",i(null,[].concat(z()(u.map((function(e){return e.direction="from",e}))),z()(c.map((function(e){return e.direction="to",e})))).sort((function(e,t){return t.raw_data.timestamp-e.raw_data.timestamp}))));case 24:return e.prev=24,e.t0=e.catch(14),e.abrupt("return",i(e.t0));case 27:if(this.tronWeb.isAddress(t)){e.next=29;break}return e.abrupt("return",i("Invalid address provided"));case 29:if(!(!Rt.isInteger(n)||n<0||o&&n<1)){e.next=31;break}return e.abrupt("return",i("Invalid limit provided"));case 31:if(Rt.isInteger(o)&&!(o<0)){e.next=33;break}return e.abrupt("return",i("Invalid offset provided"));case 33:t=this.tronWeb.address.toHex(t),this.tronWeb.solidityNode.request("walletextension/gettransactions".concat(r,"this"),{account:{address:t},offset:o,limit:n},"post").then((function(e){var t=e.transaction;i(null,t)})).catch((function(e){return i(e)}));case 35:case"end":return e.stop()}}),e,this,[[14,24]])}))),function(){return w.apply(this,arguments)})},{key:"getAccount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Rt.isFunction(e)&&(t=e,e=this.tronWeb.defaultAddress.hex),t?this.tronWeb.isAddress(e)?(e=this.tronWeb.address.toHex(e),void this.tronWeb.solidityNode.request("walletsolidity/getaccount",{address:e},"post").then((function(e){t(null,e)})).catch((function(e){return t(e)}))):t("Invalid address provided"):this.injectPromise(this.getAccount,e)}},{key:"getAccountById",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return this.injectPromise(this.getAccountById,e);this.getAccountInfoById(e,{confirmed:!0},t)}},{key:"getAccountInfoById",value:function(e,t,r){this.validator.notValid([{name:"accountId",type:"hex",value:e},{name:"accountId",type:"string",lte:32,gte:8,value:e}],r)||(e.startsWith("0x")&&(e=e.slice(2)),this.tronWeb[t.confirmed?"solidityNode":"fullNode"].request("wallet".concat(t.confirmed?"solidity":"","/getaccountbyid"),{account_id:e},"post").then((function(e){r(null,e)})).catch((function(e){return r(e)})))}},{key:"getBalance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Rt.isFunction(e)&&(t=e,e=this.tronWeb.defaultAddress.hex),!t)return this.injectPromise(this.getBalance,e);this.getAccount(e).then((function(e){var r=e.balance;t(null,void 0===r?0:r)})).catch((function(e){return t(e)}))}},{key:"getUnconfirmedAccount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Rt.isFunction(e)&&(t=e,e=this.tronWeb.defaultAddress.hex),t?this.tronWeb.isAddress(e)?(e=this.tronWeb.address.toHex(e),void this.tronWeb.fullNode.request("wallet/getaccount",{address:e},"post").then((function(e){t(null,e)})).catch((function(e){return t(e)}))):t("Invalid address provided"):this.injectPromise(this.getUnconfirmedAccount,e)}},{key:"getUnconfirmedAccountById",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return this.injectPromise(this.getUnconfirmedAccountById,e);this.getAccountInfoById(e,{confirmed:!1},t)}},{key:"getUnconfirmedBalance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Rt.isFunction(e)&&(t=e,e=this.tronWeb.defaultAddress.hex),!t)return this.injectPromise(this.getUnconfirmedBalance,e);this.getUnconfirmedAccount(e).then((function(e){var r=e.balance;t(null,void 0===r?0:r)})).catch((function(e){return t(e)}))}},{key:"getBandwidth",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Rt.isFunction(e)&&(t=e,e=this.tronWeb.defaultAddress.hex),t?this.tronWeb.isAddress(e)?(e=this.tronWeb.address.toHex(e),void this.tronWeb.fullNode.request("wallet/getaccountnet",{address:e},"post").then((function(e){var r=e.freeNetUsed,n=void 0===r?0:r,o=e.freeNetLimit,i=void 0===o?0:o,a=e.NetUsed,s=void 0===a?0:a,u=e.NetLimit;t(null,i-n+((void 0===u?0:u)-s))})).catch((function(e){return t(e)}))):t("Invalid address provided"):this.injectPromise(this.getBandwidth,e)}},{key:"getTokensIssuedByAddress",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Rt.isFunction(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),r?this.tronWeb.isAddress(t)?(t=this.tronWeb.address.toHex(t),void this.tronWeb.fullNode.request("wallet/getassetissuebyaccount",{address:t},"post").then((function(t){var n=t.assetIssue,o=void 0!==n&&n;if(!o)return r(null,{});var i=o.map((function(t){return e._parseToken(t)})).reduce((function(e,t){return e[t.name]=t,e}),{});r(null,i)})).catch((function(e){return r(e)}))):r("Invalid address provided"):this.injectPromise(this.getTokensIssuedByAddress,t)}},{key:"getTokenFromID",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r?(Rt.isInteger(t)&&(t=t.toString()),Rt.isString(t)&&t.length?void this.tronWeb.fullNode.request("wallet/getassetissuebyname",{value:this.tronWeb.fromUtf8(t)},"post").then((function(t){if(!t.name)return r("Token does not exist");r(null,e._parseToken(t))})).catch((function(e){return r(e)})):r("Invalid token ID provided")):this.injectPromise(this.getTokenFromID,t)}},{key:"listNodes",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t)return this.injectPromise(this.listNodes);this.tronWeb.fullNode.request("wallet/listnodes").then((function(r){var n=r.nodes;t(null,(void 0===n?[]:n).map((function(t){var r=t.address,n=r.host,o=r.port;return"".concat(e.tronWeb.toUtf8(n),":").concat(o)})))})).catch((function(e){return t(e)}))}},{key:"getBlockRange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Rt.isFunction(t)&&(r=t,t=30),Rt.isFunction(e)&&(r=e,e=0),r?!Rt.isInteger(e)||e<0?r("Invalid start of range provided"):!Rt.isInteger(t)||t<=e?r("Invalid end of range provided"):void this.tronWeb.fullNode.request("wallet/getblockbylimitnext",{startNum:parseInt(e),endNum:parseInt(t)+1},"post").then((function(e){var t=e.block;r(null,void 0===t?[]:t)})).catch((function(e){return r(e)})):this.injectPromise(this.getBlockRange,e,t)}},{key:"listSuperRepresentatives",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.injectPromise(this.listSuperRepresentatives);this.tronWeb.fullNode.request("wallet/listwitnesses").then((function(t){var r=t.witnesses;e(null,void 0===r?[]:r)})).catch((function(t){return e(t)}))}},{key:"listTokens",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Rt.isFunction(r)&&(n=r,r=0),Rt.isFunction(t)&&(n=t,t=0),n?!Rt.isInteger(t)||t<0||r&&t<1?n("Invalid limit provided"):!Rt.isInteger(r)||r<0?n("Invalid offset provided"):t?void this.tronWeb.fullNode.request("wallet/getpaginatedassetissuelist",{offset:parseInt(r),limit:parseInt(t)},"post").then((function(t){var r=t.assetIssue;n(null,(void 0===r?[]:r).map((function(t){return e._parseToken(t)})))})).catch((function(e){return n(e)})):this.tronWeb.fullNode.request("wallet/getassetissuelist").then((function(t){var r=t.assetIssue;n(null,(void 0===r?[]:r).map((function(t){return e._parseToken(t)})))})).catch((function(e){return n(e)})):this.injectPromise(this.listTokens,t,r)}},{key:"timeUntilNextVoteCycle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.injectPromise(this.timeUntilNextVoteCycle);this.tronWeb.fullNode.request("wallet/getnextmaintenancetime").then((function(t){var r=t.num,n=void 0===r?-1:r;if(-1==n)return e("Failed to get time until next vote cycle");e(null,Math.floor(n/1e3))})).catch((function(t){return e(t)}))}},{key:"getContract",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r?this.tronWeb.isAddress(e)?void(this.cache.contracts[e]?r(null,this.cache.contracts[e]):(e=this.tronWeb.address.toHex(e),this.tronWeb.fullNode.request("wallet/getcontract",{value:e}).then((function(n){if(n.Error)return r("Contract does not exist");t.cache.contracts[e]=n,r(null,n)})).catch((function(e){return r(e)})))):r("Invalid contract address provided"):this.injectPromise(this.getContract,e)}},{key:"verifyMessage",value:(b=d()(R.a.mark((function t(){var r,n,o,i,a,s=arguments;return R.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=s.length>0&&void 0!==s[0]&&s[0],n=s.length>1&&void 0!==s[1]&&s[1],o=s.length>2&&void 0!==s[2]?s[2]:this.tronWeb.defaultAddress.base58,i=!(s.length>3&&void 0!==s[3])||s[3],a=s.length>4&&void 0!==s[4]&&s[4],Rt.isFunction(o)&&(a=o,o=this.tronWeb.defaultAddress.base58,i=!0),Rt.isFunction(i)&&(a=i,i=!0),a){t.next=9;break}return t.abrupt("return",this.injectPromise(this.verifyMessage,r,n,o,i));case 9:if(Rt.isHex(r)){t.next=11;break}return t.abrupt("return",a("Expected hex message input"));case 11:if(!e.verifySignature(r,o,n,i)){t.next=13;break}return t.abrupt("return",a(null,!0));case 13:a("Signature does not match");case 14:case"end":return t.stop()}}),t,this)}))),function(){return b.apply(this,arguments)})},{key:"verifyMessageV2",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Rt.isFunction(n)&&(o=n,n={}),!o)return this.injectPromise(this.verifyMessageV2,t,r,n);try{o(null,e.verifyMessageV2(t,r))}catch(e){o(e)}}},{key:"verifyTypedData",value:function(t,r,n,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.tronWeb.defaultAddress.base58,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return Rt.isFunction(i)&&(a=i,i=this.tronWeb.defaultAddress.base58),a?e.verifyTypedData(t,r,n,o,i)?a(null,!0):void a("Signature does not match"):this.injectPromise(this.verifyTypedData,t,r,n,o,i)}},{key:"sign",value:(g=d()(R.a.mark((function t(){var r,n,o,i,a,s,u=arguments;return R.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=u.length>0&&void 0!==u[0]&&u[0],n=u.length>1&&void 0!==u[1]?u[1]:this.tronWeb.defaultPrivateKey,o=!(u.length>2&&void 0!==u[2])||u[2],i=u.length>3&&void 0!==u[3]&&u[3],a=u.length>4&&void 0!==u[4]&&u[4],Rt.isFunction(i)&&(a=i,i=!1),Rt.isFunction(o)&&(a=o,o=!0,i=!1),Rt.isFunction(n)&&(a=n,n=this.tronWeb.defaultPrivateKey,o=!0,i=!1),a){t.next=10;break}return t.abrupt("return",this.injectPromise(this.sign,r,n,o,i));case 10:if(!Rt.isString(r)){t.next=21;break}if(Rt.isHex(r)){t.next=13;break}return t.abrupt("return",a("Expected hex message input"));case 13:return t.prev=13,s=e.signString(r,n,o),t.abrupt("return",a(null,s));case 18:t.prev=18,t.t0=t.catch(13),a(t.t0);case 21:if(Rt.isObject(r)){t.next=23;break}return t.abrupt("return",a("Invalid transaction provided"));case 23:if(i||!r.signature){t.next=25;break}return t.abrupt("return",a("Transaction is already signed"));case 25:if(t.prev=25,i){t.next=30;break}if(this.tronWeb.address.toHex(this.tronWeb.address.fromPrivateKey(n)).toLowerCase()===this.tronWeb.address.toHex(r.raw_data.contract[0].parameter.value.owner_address)){t.next=30;break}return t.abrupt("return",a("Private key does not match address in transaction"));case 30:return t.abrupt("return",a(null,Rt.crypto.signTransaction(n,r)));case 33:t.prev=33,t.t1=t.catch(25),a(t.t1);case 36:case"end":return t.stop()}}),t,this,[[13,18],[25,33]])}))),function(){return g.apply(this,arguments)})},{key:"signMessageV2",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.tronWeb.defaultPrivateKey,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Rt.isFunction(n)&&(o=n,n={}),Rt.isFunction(r)&&(o=r,r=this.tronWeb.defaultPrivateKey),!o)return this.injectPromise(this.signMessageV2,t,r);try{return o(null,e.signMessageV2(t,r))}catch(e){o(e)}}},{key:"_signTypedData",value:function(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.tronWeb.defaultPrivateKey,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Rt.isFunction(o)&&(i=o,o=this.tronWeb.defaultPrivateKey),!i)return this.injectPromise(this._signTypedData,t,r,n,o);try{return i(null,e._signTypedData(t,r,n,o))}catch(e){i(e)}}},{key:"multiSign",value:(y=d()(R.a.mark((function e(){var t,r,n,o,i,a,s,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]&&u[0],r=u.length>1&&void 0!==u[1]?u[1]:this.tronWeb.defaultPrivateKey,n=u.length>2&&void 0!==u[2]&&u[2],o=u.length>3&&void 0!==u[3]&&u[3],Rt.isFunction(n)&&(o=n,n=0),Rt.isFunction(r)&&(o=r,r=this.tronWeb.defaultPrivateKey,n=0),o){e.next=8;break}return e.abrupt("return",this.injectPromise(this.multiSign,t,r,n));case 8:if(Rt.isObject(t)&&t.raw_data&&t.raw_data.contract){e.next=10;break}return e.abrupt("return",o("Invalid transaction provided"));case 10:if(t.raw_data.contract[0].Permission_id||!(n>0)){e.next=30;break}return t.raw_data.contract[0].Permission_id=n,i=this.tronWeb.address.toHex(this.tronWeb.address.fromPrivateKey(r)).toLowerCase(),e.next=15,this.getSignWeight(t,n);case 15:if("PERMISSION_ERROR"!==(a=e.sent).result.code){e.next=18;break}return e.abrupt("return",o(a.result.message));case 18:if(s=!1,a.permission.keys.map((function(e){e.address===i&&(s=!0)})),s){e.next=22;break}return e.abrupt("return",o(r+" has no permission to sign"));case 22:if(!a.approved_list||-1==a.approved_list.indexOf(i)){e.next=24;break}return e.abrupt("return",o(r+" already sign transaction"));case 24:if(!a.transaction||!a.transaction.transaction){e.next=29;break}t=a.transaction.transaction,n>0&&(t.raw_data.contract[0].Permission_id=n),e.next=30;break;case 29:return e.abrupt("return",o("Invalid transaction provided"));case 30:return e.prev=30,e.abrupt("return",o(null,Rt.crypto.signTransaction(r,t)));case 34:e.prev=34,e.t0=e.catch(30),o(e.t0);case 37:case"end":return e.stop()}}),e,this,[[30,34]])}))),function(){return y.apply(this,arguments)})},{key:"getApprovedList",value:(p=d()(R.a.mark((function e(t){var r,n=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.length>1&&void 0!==n[1]&&n[1]){e.next=3;break}return e.abrupt("return",this.injectPromise(this.getApprovedList,t));case 3:if(Rt.isObject(t)){e.next=5;break}return e.abrupt("return",r("Invalid transaction provided"));case 5:this.tronWeb.fullNode.request("wallet/getapprovedlist",t,"post").then((function(e){r(null,e)})).catch((function(e){return r(e)}));case 6:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"getSignWeight",value:(h=d()(R.a.mark((function e(t,r){var n,o=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=o.length>2&&void 0!==o[2]&&o[2],Rt.isFunction(r)&&(n=r,r=void 0),n){e.next=4;break}return e.abrupt("return",this.injectPromise(this.getSignWeight,t,r));case 4:if(Rt.isObject(t)&&t.raw_data&&t.raw_data.contract){e.next=6;break}return e.abrupt("return",n("Invalid transaction provided"));case 6:if(Rt.isInteger(r)?t.raw_data.contract[0].Permission_id=parseInt(r):"number"!=typeof t.raw_data.contract[0].Permission_id&&(t.raw_data.contract[0].Permission_id=0),Rt.isObject(t)){e.next=9;break}return e.abrupt("return",n("Invalid transaction provided"));case 9:this.tronWeb.fullNode.request("wallet/getsignweight",t,"post").then((function(e){n(null,e)})).catch((function(e){return n(e)}));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"sendRawTransaction",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Rt.isFunction(t)&&(r=t,t={}),r?Rt.isObject(e)?Rt.isObject(t)?e.signature&&Rt.isArray(e.signature)?void this.tronWeb.fullNode.request("wallet/broadcasttransaction",e,"post").then((function(t){t.result&&(t.transaction=e),r(null,t)})).catch((function(e){return r(e)})):r("Transaction is not signed"):r("Invalid options provided"):r("Invalid transaction provided"):this.injectPromise(this.sendRawTransaction,e,t)}},{key:"sendHexTransaction",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Rt.isFunction(t)&&(r=t,t={}),!r)return this.injectPromise(this.sendHexTransaction,e,t);if(!Rt.isHex(e))return r("Invalid hex transaction provided");if(!Rt.isObject(t))return r("Invalid options provided");var n={transaction:e};this.tronWeb.fullNode.request("wallet/broadcasthex",n,"post").then((function(t){t.result&&(t.transaction=JSON.parse(t.transaction),t.hexTransaction=e),r(null,t)})).catch((function(e){return r(e)}))}},{key:"sendTransaction",value:(f=d()(R.a.mark((function e(){var t,r,n,o,i,a,s,u,c=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]&&c[0],r=c.length>1&&void 0!==c[1]&&c[1],n=c.length>2&&void 0!==c[2]?c[2]:{},o=c.length>3&&void 0!==c[3]&&c[3],Rt.isFunction(n)&&(o=n,n={}),"string"==typeof n&&(n={privateKey:n}),o){e.next=8;break}return e.abrupt("return",this.injectPromise(this.sendTransaction,t,r,n));case 8:if(this.tronWeb.isAddress(t)){e.next=10;break}return e.abrupt("return",o("Invalid recipient provided"));case 10:if(Rt.isInteger(r)&&!(r<=0)){e.next=12;break}return e.abrupt("return",o("Invalid amount provided"));case 12:if((n=Yt({privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex},n)).privateKey||n.address){e.next=15;break}return e.abrupt("return",o("Function requires either a private key or address to be set"));case 15:return e.prev=15,i=n.privateKey?this.tronWeb.address.fromPrivateKey(n.privateKey):n.address,e.next=19,this.tronWeb.transactionBuilder.sendTrx(t,r,i);case 19:return a=e.sent,e.next=22,this.sign(a,n.privateKey||void 0);case 22:return s=e.sent,e.next=25,this.sendRawTransaction(s);case 25:return u=e.sent,e.abrupt("return",o(null,u));case 29:return e.prev=29,e.t0=e.catch(15),e.abrupt("return",o(e.t0));case 32:case"end":return e.stop()}}),e,this,[[15,29]])}))),function(){return f.apply(this,arguments)})},{key:"sendToken",value:(l=d()(R.a.mark((function e(){var t,r,n,o,i,a,s,u,c,l=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=l.length>0&&void 0!==l[0]&&l[0],r=l.length>1&&void 0!==l[1]&&l[1],n=l.length>2&&void 0!==l[2]&&l[2],o=l.length>3&&void 0!==l[3]?l[3]:{},i=l.length>4&&void 0!==l[4]&&l[4],Rt.isFunction(o)&&(i=o,o={}),"string"==typeof o&&(o={privateKey:o}),i){e.next=9;break}return e.abrupt("return",this.injectPromise(this.sendToken,t,r,n,o));case 9:if(this.tronWeb.isAddress(t)){e.next=11;break}return e.abrupt("return",i("Invalid recipient provided"));case 11:if(Rt.isInteger(r)&&!(r<=0)){e.next=13;break}return e.abrupt("return",i("Invalid amount provided"));case 13:if(Rt.isInteger(n)&&(n=n.toString()),Rt.isString(n)){e.next=16;break}return e.abrupt("return",i("Invalid token ID provided"));case 16:if((o=Yt({privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex},o)).privateKey||o.address){e.next=19;break}return e.abrupt("return",i("Function requires either a private key or address to be set"));case 19:return e.prev=19,a=o.privateKey?this.tronWeb.address.fromPrivateKey(o.privateKey):o.address,e.next=23,this.tronWeb.transactionBuilder.sendToken(t,r,n,a);case 23:return s=e.sent,e.next=26,this.sign(s,o.privateKey||void 0);case 26:return u=e.sent,e.next=29,this.sendRawTransaction(u);case 29:return c=e.sent,e.abrupt("return",i(null,c));case 33:return e.prev=33,e.t0=e.catch(19),e.abrupt("return",i(e.t0));case 36:case"end":return e.stop()}}),e,this,[[19,33]])}))),function(){return l.apply(this,arguments)})},{key:"freezeBalance",value:(c=d()(R.a.mark((function e(){var t,r,n,o,i,a,s,u,c,l,f=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=f.length>0&&void 0!==f[0]?f[0]:0,r=f.length>1&&void 0!==f[1]?f[1]:3,n=f.length>2&&void 0!==f[2]?f[2]:"BANDWIDTH",o=f.length>3&&void 0!==f[3]?f[3]:{},i=f.length>4&&void 0!==f[4]?f[4]:void 0,a=f.length>5&&void 0!==f[5]&&f[5],Rt.isFunction(i)&&(a=i,i=void 0),Rt.isFunction(r)&&(a=r,r=3),Rt.isFunction(n)&&(a=n,n="BANDWIDTH"),Rt.isFunction(o)&&(a=o,o={}),"string"==typeof o&&(o={privateKey:o}),a){e.next=13;break}return e.abrupt("return",this.injectPromise(this.freezeBalance,t,r,n,o,i));case 13:if(["BANDWIDTH","ENERGY"].includes(n)){e.next=15;break}return e.abrupt("return",a('Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'));case 15:if(Rt.isInteger(t)&&!(t<=0)){e.next=17;break}return e.abrupt("return",a("Invalid amount provided"));case 17:if(Rt.isInteger(r)&&!(r<3)){e.next=19;break}return e.abrupt("return",a("Invalid duration provided, minimum of 3 days"));case 19:if((o=Yt({privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex},o)).privateKey||o.address){e.next=22;break}return e.abrupt("return",a("Function requires either a private key or address to be set"));case 22:return e.prev=22,s=o.privateKey?this.tronWeb.address.fromPrivateKey(o.privateKey):o.address,e.next=26,this.tronWeb.transactionBuilder.freezeBalance(t,r,n,s,i);case 26:return u=e.sent,e.next=29,this.sign(u,o.privateKey||void 0);case 29:return c=e.sent,e.next=32,this.sendRawTransaction(c);case 32:return l=e.sent,e.abrupt("return",a(null,l));case 36:return e.prev=36,e.t0=e.catch(22),e.abrupt("return",a(e.t0));case 39:case"end":return e.stop()}}),e,this,[[22,36]])}))),function(){return c.apply(this,arguments)})},{key:"unfreezeBalance",value:(u=d()(R.a.mark((function e(){var t,r,n,o,i,a,s,u,c=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:"BANDWIDTH",r=c.length>1&&void 0!==c[1]?c[1]:{},n=c.length>2&&void 0!==c[2]?c[2]:void 0,o=c.length>3&&void 0!==c[3]&&c[3],Rt.isFunction(n)&&(o=n,n=void 0),Rt.isFunction(t)&&(o=t,t="BANDWIDTH"),Rt.isFunction(r)&&(o=r,r={}),"string"==typeof r&&(r={privateKey:r}),o){e.next=10;break}return e.abrupt("return",this.injectPromise(this.unfreezeBalance,t,r,n));case 10:if(["BANDWIDTH","ENERGY"].includes(t)){e.next=12;break}return e.abrupt("return",o('Invalid resource provided: Expected "BANDWIDTH" or "ENERGY"'));case 12:if((r=Yt({privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex},r)).privateKey||r.address){e.next=15;break}return e.abrupt("return",o("Function requires either a private key or address to be set"));case 15:return e.prev=15,i=r.privateKey?this.tronWeb.address.fromPrivateKey(r.privateKey):r.address,e.next=19,this.tronWeb.transactionBuilder.unfreezeBalance(t,i,n);case 19:return a=e.sent,e.next=22,this.sign(a,r.privateKey||void 0);case 22:return s=e.sent,e.next=25,this.sendRawTransaction(s);case 25:return u=e.sent,e.abrupt("return",o(null,u));case 29:return e.prev=29,e.t0=e.catch(15),e.abrupt("return",o(e.t0));case 32:case"end":return e.stop()}}),e,this,[[15,29]])}))),function(){return u.apply(this,arguments)})},{key:"updateAccount",value:(s=d()(R.a.mark((function e(){var t,r,n,o,i,a,s,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]&&u[0],r=u.length>1&&void 0!==u[1]?u[1]:{},n=u.length>2&&void 0!==u[2]&&u[2],Rt.isFunction(r)&&(n=r,r={}),"string"==typeof r&&(r={privateKey:r}),n){e.next=7;break}return e.abrupt("return",this.injectPromise(this.updateAccount,t,r));case 7:if(Rt.isString(t)&&t.length){e.next=9;break}return e.abrupt("return",n("Name must be a string"));case 9:if((r=Yt({privateKey:this.tronWeb.defaultPrivateKey,address:this.tronWeb.defaultAddress.hex},r)).privateKey||r.address){e.next=12;break}return e.abrupt("return",n("Function requires either a private key or address to be set"));case 12:return e.prev=12,o=r.privateKey?this.tronWeb.address.fromPrivateKey(r.privateKey):r.address,e.next=16,this.tronWeb.transactionBuilder.updateAccount(t,o);case 16:return i=e.sent,e.next=19,this.sign(i,r.privateKey||void 0);case 19:return a=e.sent,e.next=22,this.sendRawTransaction(a);case 22:return s=e.sent,e.abrupt("return",n(null,s));case 26:return e.prev=26,e.t0=e.catch(12),e.abrupt("return",n(e.t0));case 29:case"end":return e.stop()}}),e,this,[[12,26]])}))),function(){return s.apply(this,arguments)})},{key:"signMessage",value:function(){return this.sign.apply(this,arguments)}},{key:"sendAsset",value:function(){return this.sendToken.apply(this,arguments)}},{key:"send",value:function(){return this.sendTransaction.apply(this,arguments)}},{key:"sendTrx",value:function(){return this.sendTransaction.apply(this,arguments)}},{key:"broadcast",value:function(){return this.sendRawTransaction.apply(this,arguments)}},{key:"broadcastHex",value:function(){return this.sendHexTransaction.apply(this,arguments)}},{key:"signTransaction",value:function(){return this.sign.apply(this,arguments)}},{key:"getProposal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?!Rt.isInteger(e)||e<0?t("Invalid proposalID provided"):void this.tronWeb.fullNode.request("wallet/getproposalbyid",{id:parseInt(e)},"post").then((function(e){t(null,e)})).catch((function(e){return t(e)})):this.injectPromise(this.getProposal,e)}},{key:"listProposals",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.injectPromise(this.listProposals);this.tronWeb.fullNode.request("wallet/listproposals",{},"post").then((function(t){var r=t.proposals;e(null,void 0===r?[]:r)})).catch((function(t){return e(t)}))}},{key:"getChainParameters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.injectPromise(this.getChainParameters);this.tronWeb.fullNode.request("wallet/getchainparameters",{},"post").then((function(t){var r=t.chainParameter;e(null,void 0===r?[]:r)})).catch((function(t){return e(t)}))}},{key:"getAccountResources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tronWeb.defaultAddress.hex,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?this.tronWeb.isAddress(e)?void this.tronWeb.fullNode.request("wallet/getaccountresource",{address:this.tronWeb.address.toHex(e)},"post").then((function(e){t(null,e)})).catch((function(e){return t(e)})):t("Invalid address provided"):this.injectPromise(this.getAccountResources,e)}},{key:"getExchangeByID",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?!Rt.isInteger(e)||e<0?t("Invalid exchangeID provided"):void this.tronWeb.fullNode.request("wallet/getexchangebyid",{id:e},"post").then((function(e){t(null,e)})).catch((function(e){return t(e)})):this.injectPromise(this.getExchangeByID,e)}},{key:"listExchanges",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.injectPromise(this.listExchanges);this.tronWeb.fullNode.request("wallet/listexchanges",{},"post").then((function(t){var r=t.exchanges;e(null,void 0===r?[]:r)}),"post").catch((function(t){return e(t)}))}},{key:"listExchangesPaginated",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Rt.isFunction(t)&&(r=t,t=0),Rt.isFunction(e)&&(r=e,e=10),!r)return this.injectPromise(this.listExchangesPaginated,e,t);this.tronWeb.fullNode.request("wallet/getpaginatedexchangelist",{limit:e,offset:t},"post").then((function(e){var t=e.exchanges;r(null,void 0===t?[]:t)})).catch((function(e){return r(e)}))}},{key:"getNodeInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.injectPromise(this.getNodeInfo);this.tronWeb.fullNode.request("wallet/getnodeinfo",{},"post").then((function(t){e(null,t)}),"post").catch((function(t){return e(t)}))}},{key:"getTokenListByName",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r?(Rt.isInteger(t)&&(t=t.toString()),Rt.isString(t)&&t.length?void this.tronWeb.fullNode.request("wallet/getassetissuelistbyname",{value:this.tronWeb.fromUtf8(t)},"post").then((function(t){if(Array.isArray(t.assetIssue))r(null,t.assetIssue.map((function(t){return e._parseToken(t)})));else if(!t.name)return r("Token does not exist");r(null,e._parseToken(t))})).catch((function(e){return r(e)})):r("Invalid token ID provided")):this.injectPromise(this.getTokenListByName,t)}},{key:"getTokenByID",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r?(Rt.isInteger(t)&&(t=t.toString()),Rt.isString(t)&&t.length?void this.tronWeb.fullNode.request("wallet/getassetissuebyid",{value:t},"post").then((function(t){if(!t.name)return r("Token does not exist");r(null,e._parseToken(t))})).catch((function(e){return r(e)})):r("Invalid token ID provided")):this.injectPromise(this.getTokenByID,t)}},{key:"getReward",value:(a=d()(R.a.mark((function e(t){var r,n,o=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>2&&void 0!==o[2]&&o[2],(r=o.length>1&&void 0!==o[1]?o[1]:{}).confirmed=!0,e.abrupt("return",this._getReward(t,r,n));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"getUnconfirmedReward",value:(i=d()(R.a.mark((function e(t){var r,n,o=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>2&&void 0!==o[2]&&o[2],(r=o.length>1&&void 0!==o[1]?o[1]:{}).confirmed=!1,e.abrupt("return",this._getReward(t,r,n));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"getBrokerage",value:(o=d()(R.a.mark((function e(t){var r,n,o=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>2&&void 0!==o[2]&&o[2],(r=o.length>1&&void 0!==o[1]?o[1]:{}).confirmed=!0,e.abrupt("return",this._getBrokerage(t,r,n));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"getUnconfirmedBrokerage",value:(n=d()(R.a.mark((function e(t){var r,n,o=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>2&&void 0!==o[2]&&o[2],(r=o.length>1&&void 0!==o[1]?o[1]:{}).confirmed=!1,e.abrupt("return",this._getBrokerage(t,r,n));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_getReward",value:(r=d()(R.a.mark((function e(){var t,r,n,o,i=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=i.length>0&&void 0!==i[0]?i[0]:this.tronWeb.defaultAddress.hex,r=i.length>1?i[1]:void 0,n=i.length>2&&void 0!==i[2]&&i[2],Rt.isFunction(r)&&(n=r,r={}),Rt.isFunction(t)?(n=t,t=this.tronWeb.defaultAddress.hex):Rt.isObject(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),n){e.next=7;break}return e.abrupt("return",this.injectPromise(this._getReward,t,r));case 7:if(!this.validator.notValid([{name:"origin",type:"address",value:t}],n)){e.next=9;break}return e.abrupt("return");case 9:o={address:Jt(t)},this.tronWeb[r.confirmed?"solidityNode":"fullNode"].request("wallet".concat(r.confirmed?"solidity":"","/getReward"),o,"post").then((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(void 0===e.reward)return n("Not found.");n(null,e.reward)})).catch((function(e){return n(e)}));case 11:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"_getBrokerage",value:(t=d()(R.a.mark((function e(){var t,r,n,o,i=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=i.length>0&&void 0!==i[0]?i[0]:this.tronWeb.defaultAddress.hex,r=i.length>1?i[1]:void 0,n=i.length>2&&void 0!==i[2]&&i[2],Rt.isFunction(r)&&(n=r,r={}),Rt.isFunction(t)?(n=t,t=this.tronWeb.defaultAddress.hex):Rt.isObject(t)&&(r=t,t=this.tronWeb.defaultAddress.hex),n){e.next=7;break}return e.abrupt("return",this.injectPromise(this._getBrokerage,t,r));case 7:if(!this.validator.notValid([{name:"origin",type:"address",value:t}],n)){e.next=9;break}return e.abrupt("return");case 9:o={address:Jt(t)},this.tronWeb[r.confirmed?"solidityNode":"fullNode"].request("wallet".concat(r.confirmed?"solidity":"","/getBrokerage"),o,"post").then((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(void 0===e.brokerage)return n("Not found.");n(null,e.brokerage)})).catch((function(e){return n(e)}));case 11:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}],[{key:"verifySignature",value:function(e,t,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];e=e.replace(/^0x/,""),r=r.replace(/^0x/,"");var o=[].concat(z()(se(n?"\x19TRON Signed Message:\n32":"\x19Ethereum Signed Message:\n32")),z()(Rt.code.hexStr2byteArray(e))),i=ie(o),a="41"+ce(i,{recoveryParam:"1c"==r.substring(128,130)?1:0,r:"0x"+r.substring(0,64),s:"0x"+r.substring(64,128)}).substr(2);return dr.address.fromHex(a)==dr.address.fromHex(t)}},{key:"verifyMessageV2",value:function(e,t){return Rt.message.verifyMessage(e,t)}},{key:"verifyTypedData",value:function(e,t,r,n,o){n=n.replace(/^0x/,"");var i=Rt._TypedDataEncoder.hash(e,t,r),a="41"+ce(i,{recoveryParam:"1c"==n.substring(128,130)?1:0,r:"0x"+n.substring(0,64),s:"0x"+n.substring(64,128)}).substr(2);return dr.address.fromHex(a)==dr.address.fromHex(o)}},{key:"signString",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e=e.replace(/^0x/,"");var n=new le({toHexString:function(){return"0x"+t},value:t}),o=[].concat(z()(se(r?"\x19TRON Signed Message:\n32":"\x19Ethereum Signed Message:\n32")),z()(Rt.code.hexStr2byteArray(e))),i=ie(o),a=n.signDigest(i);return["0x",a.r.substring(2),a.s.substring(2),Number(a.v).toString(16)].join("")}},{key:"signMessageV2",value:function(e,t){return Rt.message.signMessage(e,t)}},{key:"_signTypedData",value:function(e,t,r,n){return Rt.crypto._signTypedData(e,t,r,n)}}]),e}();function er(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tr(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Rt.isFunction(r)&&(n=r,r={}),r=tr(tr({},r),{},{rawParameter:t}),e._call([],[],r,n)},send:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.tronWeb.defaultPrivateKey,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Rt.isFunction(n)&&(o=n,n=e.tronWeb.defaultPrivateKey),Rt.isFunction(r)&&(o=r,r={}),r=tr(tr({},r),{},{rawParameter:t}),e._send([],[],r,n,o)},watch:function(){return e._watch.apply(e,arguments)}}}},{key:"_call",value:(n=d()(R.a.mark((function e(t,r){var n,o,i,a,s=this,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=u.length>2&&void 0!==u[2]?u[2]:{},o=u.length>3&&void 0!==u[3]&&u[3],Rt.isFunction(n)&&(o=n,n={}),o){e.next=5;break}return e.abrupt("return",this.injectPromise(this._call,t,r,n));case 5:if(t.length===r.length){e.next=7;break}return e.abrupt("return",o("Invalid argument count provided"));case 7:if(this.contract.address){e.next=9;break}return e.abrupt("return",o("Smart contract is missing address"));case 9:if(this.contract.deployed){e.next=11;break}return e.abrupt("return",o("Calling smart contracts requires you to load the contract first"));case 11:if(i=this.abi.stateMutability,["pure","view"].includes(i.toLowerCase())){e.next=14;break}return e.abrupt("return",o('Methods with state mutability "'.concat(i,'" must use send()')));case 14:n=tr(tr(tr({},this.defaultOptions),{},{from:this.tronWeb.defaultAddress.hex},n),{},{_isConstant:!0}),a=r.map((function(e,r){return{type:t[r],value:e}})),this.tronWeb.transactionBuilder.triggerSmartContract(this.contract.address,this.functionSelector,n,a,!!n.from&&this.tronWeb.address.toHex(n.from),(function(e,t){if(e)return o(e);if(!Rt.hasProperty(t,"constant_result"))return o("Failed to execute");try{var r=t.constant_result[0].length;if(0===r||r%64==8){var n="The call has been reverted or has thrown an error.";if(0!==r){n+=" Error message: ";for(var i="",a=t.constant_result[0].substring(8),u=0;u2&&void 0!==m[2]?m[2]:{},o=m.length>3&&void 0!==m[3]?m[3]:this.tronWeb.defaultPrivateKey,i=m.length>4&&void 0!==m[4]&&m[4],Rt.isFunction(o)&&(i=o,o=this.tronWeb.defaultPrivateKey),Rt.isFunction(n)&&(i=n,n={}),i){e.next=7;break}return e.abrupt("return",this.injectPromise(this._send,t,r,n,o));case 7:if(t.length===r.length){e.next=9;break}throw new Error("Invalid argument count provided");case 9:if(this.contract.address){e.next=11;break}return e.abrupt("return",i("Smart contract is missing address"));case 11:if(this.contract.deployed){e.next=13;break}return e.abrupt("return",i("Calling smart contracts requires you to load the contract first"));case 13:if(a=this.abi.stateMutability,!["pure","view"].includes(a.toLowerCase())){e.next=16;break}return e.abrupt("return",i('Methods with state mutability "'.concat(a,'" must use call()')));case 16:return["payable"].includes(a.toLowerCase())||(n.callValue=0),n=tr(tr({},this.defaultOptions),{},{from:this.tronWeb.defaultAddress.hex},n),s=r.map((function(e,r){return{type:t[r],value:e}})),e.prev=19,u=o?this.tronWeb.address.fromPrivateKey(o):this.tronWeb.defaultAddress.base58,e.next=23,this.tronWeb.transactionBuilder.triggerSmartContract(this.contract.address,this.functionSelector,n,s,this.tronWeb.address.toHex(u));case 23:if((c=e.sent).result&&c.result.result){e.next=26;break}return e.abrupt("return",i("Unknown error: "+JSON.stringify(c,null,2)));case 26:return e.next=28,this.tronWeb.trx.sign(c.transaction,o);case 28:if((l=e.sent).signature){e.next=33;break}if(o){e.next=32;break}return e.abrupt("return",i("Transaction was not signed properly"));case 32:return e.abrupt("return",i("Invalid private key provided"));case 33:return e.next=35,this.tronWeb.trx.sendRawTransaction(l);case 35:if(!(f=e.sent).code){e.next=40;break}return h={error:f.code,message:f.code},f.message&&(h.message=this.tronWeb.toUtf8(f.message)),e.abrupt("return",i(h));case 40:if(n.shouldPollResponse){e.next=42;break}return e.abrupt("return",i(null,l.txID));case 42:(p=function(){var e=d()(R.a.mark((function e(){var t,r,o,a=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(20!==(t=a.length>0&&void 0!==a[0]?a[0]:0)){e.next=3;break}return e.abrupt("return",i({error:"Cannot find result in solidity node",transaction:l}));case 3:return e.next=5,y.tronWeb.trx.getTransactionInfo(l.txID);case 5:if(r=e.sent,Object.keys(r).length){e.next=8;break}return e.abrupt("return",setTimeout((function(){p(t+1)}),3e3));case 8:if(!r.result||"FAILED"!==r.result){e.next=10;break}return e.abrupt("return",i({error:y.tronWeb.toUtf8(r.resMessage),transaction:l,output:r}));case 10:if(Rt.hasProperty(r,"contractResult")){e.next=12;break}return e.abrupt("return",i({error:"Failed to execute: "+JSON.stringify(r,null,2),transaction:l,output:r}));case 12:if(!n.rawResponse){e.next=14;break}return e.abrupt("return",i(null,r));case 14:if(1===(o=rr(y.abi,"0x"+r.contractResult[0])).length&&1===Object.keys(o).length&&(o=o[0]),!n.keepTxID){e.next=18;break}return e.abrupt("return",i(null,[l.txID,o]));case 18:return e.abrupt("return",i(null,o));case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())(),e.next=49;break;case 46:return e.prev=46,e.t0=e.catch(19),e.abrupt("return",i(e.t0));case 49:case"end":return e.stop()}}),e,this,[[19,46]])}))),function(e,t){return r.apply(this,arguments)})},{key:"_watch",value:(t=d()(R.a.mark((function e(){var t,r,n,o,i,a,s,u=this,c=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:{},r=c.length>1&&void 0!==c[1]&&c[1],Rt.isFunction(t)&&(r=t,t={}),Rt.isFunction(r)){e.next=5;break}throw new Error("Expected callback to be provided");case 5:if(this.contract.address){e.next=7;break}return e.abrupt("return",r("Smart contract is missing address"));case 7:if(this.abi.type&&/event/i.test(this.abi.type)){e.next=9;break}return e.abrupt("return",r("Invalid method type for event watching"));case 9:if(this.tronWeb.eventServer){e.next=11;break}return e.abrupt("return",r("No event server configured"));case 11:return n=!1,o=!1,i=Date.now()-1e3,a=function(){var e=d()(R.a.mark((function e(){var r,n,a,s,c,l;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r={since:i,eventName:u.name,sort:"block_timestamp",blockNumber:"latest",filters:t.filters},t.size&&(r.size=t.size),t.resourceNode&&(/full/i.test(t.resourceNode)?r.onlyUnconfirmed=!0:r.onlyConfirmed=!0),e.next=6,u.tronWeb.event.getEventsByContractAddress(u.contract.address,r);case 6:return n=e.sent,a=n.sort((function(e,t){return t.block-e.block})),s=Dt()(a,1),c=s[0],l=n.filter((function(e,r){return!(t.resourceNode&&e.resourceNode&&t.resourceNode.toLowerCase()!==e.resourceNode.toLowerCase()||n.slice(0,r).some((function(t){return JSON.stringify(t)==JSON.stringify(e)}))||o&&!(e.block>o))})),c&&(o=c.block),e.abrupt("return",l);case 13:return e.prev=13,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 16:case"end":return e.stop()}}),e,null,[[0,13]])})));return function(){return e.apply(this,arguments)}}(),s=function(){n&&clearInterval(n),n=setInterval((function(){a().then((function(e){return e.forEach((function(e){r(null,Rt.parseEvent(e,u.abi))}))})).catch((function(e){return r(e)}))}),3e3)},e.next=18,a();case 18:return s(),e.abrupt("return",{start:s,stop:function(){n&&(clearInterval(n),n=!1)}});case 20:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),or=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(m()(this,e),!t||!t instanceof dr)throw new Error("Expected instance of TronWeb");this.tronWeb=t,this.injectPromise=Ut()(this),this.address=n,this.abi=r,this.eventListener=!1,this.bytecode=!1,this.deployed=!1,this.lastBlock=!1,this.methods={},this.methodInstances={},this.props=[],this.tronWeb.isAddress(n)?this.deployed=!0:this.address=!1,this.loadAbi(r)}var t,r,n,o;return v()(e,[{key:"_getEvents",value:(o=d()(R.a.mark((function e(){var t,r,n,o,i,a,s=this,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=u.length>0&&void 0!==u[0]?u[0]:{},e.next=3,this.tronWeb.event.getEventsByContractAddress(this.address,t);case 3:return r=e.sent,n=r.sort((function(e,t){return t.block-e.block})),o=Dt()(n,1),i=o[0],a=r.filter((function(e,n){return!(t.resourceNode&&e.resourceNode&&t.resourceNode.toLowerCase()!==e.resourceNode.toLowerCase()||r.slice(0,n).some((function(t){return JSON.stringify(t)==JSON.stringify(e)}))||s.lastBlock&&!(e.block>s.lastBlock))})),i&&(this.lastBlock=i.block),e.abrupt("return",a);case 8:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"_startEventListener",value:(n=d()(R.a.mark((function e(){var t,r,n=this,o=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:{},r=o.length>1?o[1]:void 0,Rt.isFunction(t)&&(r=t,t={}),this.eventListener&&clearInterval(this.eventListener),this.tronWeb.eventServer){e.next=6;break}throw new Error("Event server is not configured");case 6:if(this.address){e.next=8;break}throw new Error("Contract is not configured with an address");case 8:return this.eventCallback=r,e.next=11,this._getEvents(t);case 11:this.eventListener=setInterval((function(){n._getEvents(t).then((function(e){return e.forEach((function(e){n.eventCallback&&n.eventCallback(e)}))})).catch((function(e){console.error("Failed to get event list",e)}))}),3e3);case 12:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_stopEventListener",value:function(){this.eventListener&&(clearInterval(this.eventListener),this.eventListener=!1,this.eventCallback=!1)}},{key:"hasProperty",value:function(e){return this.hasOwnProperty(e)||this.__proto__.hasOwnProperty(e)}},{key:"loadAbi",value:function(e){var t=this;this.abi=e,this.methods={},this.props.forEach((function(e){return delete t[e]})),e.forEach((function(e){if(e.type&&!/constructor/i.test(e.type)){var r=new nr(t,e),n=r.onMethod.bind(r),o=r.name,i=r.functionSelector,a=r.signature;t.methods[o]=n,t.methods[i]=n,t.methods[a]=n,t.methodInstances[o]=r,t.methodInstances[i]=r,t.methodInstances[a]=r,t.hasProperty(o)||(t[o]=n,t.props.push(o)),t.hasProperty(i)||(t[i]=n,t.props.push(i)),t.hasProperty(a)||(t[a]=n,t.props.push(a))}}))}},{key:"decodeInput",value:function(e){var t=e.substring(0,8),r=e.substring(8);if(!this.methodInstances[t])throw new Error("Contract method "+t+" not found");return{name:this.methodInstances[t].name,params:this.methodInstances[t].decodeInput(r)}}},{key:"new",value:(r=d()(R.a.mark((function e(t){var r,n,o,i,a,s,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=u.length>1&&void 0!==u[1]?u[1]:this.tronWeb.defaultPrivateKey,n=u.length>2&&void 0!==u[2]&&u[2],Rt.isFunction(r)&&(n=r,r=this.tronWeb.defaultPrivateKey),n){e.next=5;break}return e.abrupt("return",this.injectPromise(this.new,t,r));case 5:return e.prev=5,o=this.tronWeb.address.fromPrivateKey(r),e.next=9,this.tronWeb.transactionBuilder.createSmartContract(t,o);case 9:return i=e.sent,e.next=12,this.tronWeb.trx.sign(i,r);case 12:return a=e.sent,e.next=15,this.tronWeb.trx.sendRawTransaction(a);case 15:if(!(s=e.sent).code){e.next=18;break}return e.abrupt("return",n({error:s.code,message:this.tronWeb.toUtf8(s.message)}));case 18:return e.next=20,Rt.sleep(3e3);case 20:return e.abrupt("return",this.at(a.contract_address,n));case 23:return e.prev=23,e.t0=e.catch(5),e.abrupt("return",n(e.t0));case 26:case"end":return e.stop()}}),e,this,[[5,23]])}))),function(e){return r.apply(this,arguments)})},{key:"at",value:(t=d()(R.a.mark((function e(t){var r,n,o=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>1&&void 0!==o[1]&&o[1]){e.next=3;break}return e.abrupt("return",this.injectPromise(this.at,t));case 3:return e.prev=3,e.next=6,this.tronWeb.trx.getContract(t);case 6:if((n=e.sent).contract_address){e.next=9;break}return e.abrupt("return",r("Unknown error: "+JSON.stringify(n,null,2)));case 9:return this.address=n.contract_address,this.bytecode=n.bytecode,this.deployed=!0,this.loadAbi(n.abi&&n.abi.entrys?n.abi.entrys:[]),e.abrupt("return",r(null,this));case 16:if(e.prev=16,e.t0=e.catch(3),!e.t0.toString().includes("does not exist")){e.next=20;break}return e.abrupt("return",r("Contract has not been deployed on the network"));case 20:return e.abrupt("return",r(e.t0));case 21:case"end":return e.stop()}}),e,this,[[3,16]])}))),function(e){return t.apply(this,arguments)})},{key:"events",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Rt.isFunction(e)&&(t=e,e={}),!Rt.isFunction(t))throw new Error("Callback function expected");var r=this;return{start:function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return n?(r._startEventListener(e,t).then((function(){n()})).catch((function(e){n(e)})),this):(r._startEventListener(e,t),this)},stop:function(){r._stopEventListener()}}}}]),e}(),ir=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(m()(this,e),!t||!t instanceof dr)throw new Error("Expected instance of TronWeb");this.tronWeb=t,this.pluginNoOverride=["register"],this.disablePlugins=r.disablePlugins}return v()(e,[{key:"register",value:function(e,t){var r={requires:"0.0.0",components:{}},n={libs:[],plugged:[],skipped:[]};if(this.disablePlugins)return n.error="This instance of TronWeb has plugins disabled.",n;var o=new e(this.tronWeb);if(Rt.isFunction(o.pluginInterface)&&(r=o.pluginInterface(t)),!Lt.a.satisfies(dr.version,r.requires))throw new Error("The plugin is not compatible with this version of TronWeb");if(r.fullClass){var i=o.constructor.name,a=i.substring(0,1).toLowerCase()+i.substring(1);i!==a&&(dr[i]=e,this.tronWeb[a]=o,n.libs.push(i))}else for(var s in r.components)if(this.tronWeb.hasOwnProperty(s)){var u=r.components[s],c=this.tronWeb[s].pluginNoOverride||[];for(var l in u)"constructor"===l||this.tronWeb[s][l]&&(c.includes(l)||/^_/.test(l))?n.skipped.push(l):(this.tronWeb[s][l]=u[l].bind(this.tronWeb[s]),n.plugged.push(l))}return n}}]),e}(),ar=r(27),sr=r.n(ar),ur=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(m()(this,e),!(t&&t instanceof dr))throw new Error("Expected instance of TronWeb");this.tronWeb=t,this.injectPromise=Ut()(this)}return v()(e,[{key:"setServer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"healthcheck";if(!t)return this.tronWeb.eventServer=!1;if(Rt.isString(t)&&(t=new It.HttpProvider(t)),!this.tronWeb.isValidProvider(t))throw new Error("Invalid event server provided");this.tronWeb.eventServer=t,this.tronWeb.eventServer.isConnected=function(){return e.tronWeb.eventServer.request(r).then((function(){return!0})).catch((function(){return!1}))}}},{key:"getEventsByContractAddress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=Object.assign({sinceTimestamp:0,eventName:!1,blockNumber:!1,size:20,page:1},t),o=n.sinceTimestamp,i=n.since,a=n.fromTimestamp,s=n.eventName,u=n.blockNumber,c=n.size,l=n.page,f=n.onlyConfirmed,d=n.onlyUnconfirmed,h=n.previousLastEventFingerprint,y=n.previousFingerprint,m=n.fingerprint,g=n.rawResponse,v=n.sort,b=n.filters;if(!r)return this.injectPromise(this.getEventsByContractAddress,e,t);if(a=a||o||i,!this.tronWeb.eventServer)return r("No event server configured");var w=[];if(!this.tronWeb.isAddress(e))return r("Invalid contract address provided");if(s&&!e)return r("Usage of event name filtering requires a contract address");if(void 0!==a&&!Rt.isInteger(a))return r("Invalid fromTimestamp provided");if(!Rt.isInteger(c))return r("Invalid size provided");if(c>200&&(console.warn("Defaulting to maximum accepted size: 200"),c=200),!Rt.isInteger(l))return r("Invalid page provided");if(u&&!s)return r("Usage of block number filtering requires an event name");e&&w.push(this.tronWeb.address.fromHex(e)),s&&w.push(s),u&&w.push(u);var A={size:c,page:l};return"object"===p()(b)&&Object.keys(b).length>0&&(A.filters=JSON.stringify(b)),a&&(A.fromTimestamp=A.since=a),f&&(A.only_confirmed=f),d&&!f&&(A.only_unconfirmed=d),v&&(A.sort=v),(m=m||y||h)&&(A.fingerprint=m),this.tronWeb.eventServer.request("event/contract/".concat(w.join("/"),"?").concat(sr.a.stringify(A))).then((function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?Rt.isArray(e)?r(null,!0===g?e:e.map((function(e){return Rt.mapEvent(e)}))):r(e):r("Unknown error occurred")})).catch((function(e){return r(e.response&&e.response.data||e)}))}},{key:"getEventsByTransactionID",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Rt.isFunction(t)&&(r=t,t={}),r?this.tronWeb.eventServer?this.tronWeb.eventServer.request("event/transaction/".concat(e)).then((function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?Rt.isArray(e)?r(null,!0===t.rawResponse?e:e.map((function(e){return Rt.mapEvent(e)}))):r(e):r("Unknown error occurred")})).catch((function(e){return r(e.response&&e.response.data||e)})):r("No event server configured"):this.injectPromise(this.getEventsByTransactionID,e,t)}}]),e}();function cr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lr(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];m()(this,e),this.mainchain=n;var i=t.fullHost,a=t.fullNode,s=t.solidityNode,u=t.eventServer,c=t.mainGatewayAddress,l=t.sideGatewayAddress,f=t.sideChainId;this.sidechain=new r(i||a,i||s,i||u,o),this.isAddress=this.mainchain.isAddress,this.utils=this.mainchain.utils,this.setMainGatewayAddress(c),this.setSideGatewayAddress(l),this.setChainId(f),this.injectPromise=Ut()(this),this.validator=new Ht(this.sidechain);var d=this;this.sidechain.trx.sign=function(){return d.sign.apply(d,arguments)},this.sidechain.trx.multiSign=function(){return d.multiSign.apply(d,arguments)}}var t,r,n,o,i,a,s,u,c,l,f,h,p,y,g,b,w,A,S,k,_;return v()(e,[{key:"setMainGatewayAddress",value:function(e){if(!this.isAddress(e))throw new Error("Invalid main gateway address provided");this.mainGatewayAddress=e}},{key:"setSideGatewayAddress",value:function(e){if(!this.isAddress(e))throw new Error("Invalid side gateway address provided");this.sideGatewayAddress=e}},{key:"setChainId",value:function(e){if(!this.utils.isString(e)||!e)throw new Error("Invalid side chainId provided");this.chainId=e}},{key:"signTransaction",value:function(e,t){"string"==typeof e&&(e=this.utils.code.hexStr2byteArray(e));var r=this.utils.code.hexStr2byteArray(this.chainId),n=this.utils.code.hexStr2byteArray(t.txID).concat(r),o=this.sidechain.utils.ethersUtils.sha256(n),i=this.utils.crypto.ECKeySign(this.utils.code.hexStr2byteArray(o.replace(/^0x/,"")),e);return Array.isArray(t.signature)?t.signature.includes(i)||t.signature.push(i):t.signature=[i],t}},{key:"multiSign",value:(_=d()(R.a.mark((function e(){var t,r,n,o,i,a,s,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]&&u[0],r=u.length>1&&void 0!==u[1]?u[1]:this.sidechain.defaultPrivateKey,n=u.length>2&&void 0!==u[2]&&u[2],o=u.length>3&&void 0!==u[3]&&u[3],this.utils.isFunction(n)&&(o=n,n=0),this.utils.isFunction(r)&&(o=r,r=this.mainchain.defaultPrivateKey,n=0),o){e.next=8;break}return e.abrupt("return",this.injectPromise(this.multiSign,t,r,n));case 8:if(this.utils.isObject(t)&&t.raw_data&&t.raw_data.contract){e.next=10;break}return e.abrupt("return",o("Invalid transaction provided"));case 10:if(t.raw_data.contract[0].Permission_id||!(n>0)){e.next=30;break}return t.raw_data.contract[0].Permission_id=n,i=this.sidechain.address.toHex(this.sidechain.address.fromPrivateKey(r)).toLowerCase(),e.next=15,this.sidechain.trx.getSignWeight(t,n);case 15:if("PERMISSION_ERROR"!==(a=e.sent).result.code){e.next=18;break}return e.abrupt("return",o(a.result.message));case 18:if(s=!1,a.permission.keys.map((function(e){e.address===i&&(s=!0)})),s){e.next=22;break}return e.abrupt("return",o(r+" has no permission to sign"));case 22:if(!a.approved_list||-1==a.approved_list.indexOf(i)){e.next=24;break}return e.abrupt("return",o(r+" already sign transaction"));case 24:if(!a.transaction||!a.transaction.transaction){e.next=29;break}(t=a.transaction.transaction).raw_data.contract[0].Permission_id=n,e.next=30;break;case 29:return e.abrupt("return",o("Invalid transaction provided"));case 30:return e.prev=30,e.abrupt("return",o(null,this.signTransaction(r,t)));case 34:e.prev=34,e.t0=e.catch(30),o(e.t0);case 37:case"end":return e.stop()}}),e,this,[[30,34]])}))),function(){return _.apply(this,arguments)})},{key:"sign",value:(k=d()(R.a.mark((function e(){var t,r,n,o,i,a,s=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.length>0&&void 0!==s[0]&&s[0],r=s.length>1&&void 0!==s[1]?s[1]:this.sidechain.defaultPrivateKey,n=!(s.length>2&&void 0!==s[2])||s[2],o=s.length>3&&void 0!==s[3]&&s[3],i=s.length>4&&void 0!==s[4]&&s[4],this.utils.isFunction(o)&&(i=o,o=!1),this.utils.isFunction(n)&&(i=n,n=!0,o=!1),this.utils.isFunction(r)&&(i=r,r=this.sidechain.defaultPrivateKey,n=!0,o=!1),i){e.next=10;break}return e.abrupt("return",this.injectPromise(this.sign,t,r,n,o));case 10:if(!this.utils.isString(t)){e.next=21;break}if(this.utils.isHex(t)){e.next=13;break}return e.abrupt("return",i("Expected hex message input"));case 13:return e.prev=13,a=this.sidechain.trx.signString(t,r,n),e.abrupt("return",i(null,a));case 18:e.prev=18,e.t0=e.catch(13),i(e.t0);case 21:if(this.utils.isObject(t)){e.next=23;break}return e.abrupt("return",i("Invalid transaction provided"));case 23:if(o||!t.signature){e.next=25;break}return e.abrupt("return",i("Transaction is already signed"));case 25:if(e.prev=25,o){e.next=30;break}if(this.sidechain.address.toHex(this.sidechain.address.fromPrivateKey(r)).toLowerCase()===this.sidechain.address.toHex(t.raw_data.contract[0].parameter.value.owner_address)){e.next=30;break}return e.abrupt("return",i("Private key does not match address in transaction"));case 30:return e.abrupt("return",i(null,this.signTransaction(r,t)));case 33:e.prev=33,e.t1=e.catch(25),i(e.t1);case 36:case"end":return e.stop()}}),e,this,[[13,18],[25,33]])}))),function(){return k.apply(this,arguments)})},{key:"depositTrx",value:(S=d()(R.a.mark((function e(t,r,n){var o,i,a,s,u,c=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=c.length>3&&void 0!==c[3]?c[3]:{},i=c.length>4&&void 0!==c[4]?c[4]:this.mainchain.defaultPrivateKey,a=c.length>5&&void 0!==c[5]&&c[5],this.utils.isFunction(i)&&(a=i,i=this.mainchain.defaultPrivateKey),this.utils.isFunction(o)&&(a=o,o={}),a){e.next=7;break}return e.abrupt("return",this.injectPromise(this.depositTrx,t,r,n,o,i));case 7:if(!this.validator.notValid([{name:"callValue",type:"integer",value:t,gte:0},{name:"depositFee",type:"integer",value:r,gte:0},{name:"feeLimit",type:"integer",value:n,gte:0}],a)){e.next=9;break}return e.abrupt("return");case 9:return o=lr({callValue:Number(t)+Number(r),feeLimit:n},o),e.prev=10,e.next=13,this.mainchain.contract().at(this.mainGatewayAddress);case 13:return s=e.sent,e.next=16,s.depositTRX().send(o,i);case 16:return u=e.sent,e.abrupt("return",a(null,u));case 20:return e.prev=20,e.t0=e.catch(10),e.abrupt("return",a(e.t0));case 23:case"end":return e.stop()}}),e,this,[[10,20]])}))),function(e,t,r){return S.apply(this,arguments)})},{key:"depositTrc10",value:(A=d()(R.a.mark((function e(t,r,n,o){var i,a,s,u,c,l=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=l.length>4&&void 0!==l[4]?l[4]:{},a=l.length>5&&void 0!==l[5]?l[5]:this.mainchain.defaultPrivateKey,s=l.length>6&&void 0!==l[6]&&l[6],this.utils.isFunction(a)&&(s=a,a=this.mainchain.defaultPrivateKey),this.utils.isFunction(i)&&(s=i,i={}),s){e.next=7;break}return e.abrupt("return",this.injectPromise(this.depositTrc10,t,r,n,o,i,a));case 7:if(!this.validator.notValid([{name:"tokenValue",type:"integer",value:r,gte:0},{name:"depositFee",type:"integer",value:n,gte:0},{name:"feeLimit",type:"integer",value:o,gte:0},{name:"tokenId",type:"integer",value:t,gte:0}],s)){e.next=9;break}return e.abrupt("return");case 9:return i=lr(lr({tokenId:t,tokenValue:r,feeLimit:o},i),{},{callValue:n}),e.prev=10,e.next=13,this.mainchain.contract().at(this.mainGatewayAddress);case 13:return u=e.sent,e.next=16,u.depositTRC10(t,r).send(i,a);case 16:c=e.sent,s(null,c),e.next=23;break;case 20:return e.prev=20,e.t0=e.catch(10),e.abrupt("return",s(e.t0));case 23:case"end":return e.stop()}}),e,this,[[10,20]])}))),function(e,t,r,n){return A.apply(this,arguments)})},{key:"depositTrc",value:(w=d()(R.a.mark((function e(t,r,n,o,i){var a,s,u,c,l,f,d=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=d.length>5&&void 0!==d[5]?d[5]:{},s=d.length>6&&void 0!==d[6]?d[6]:this.mainchain.defaultPrivateKey,u=d.length>7&&void 0!==d[7]&&d[7],this.utils.isFunction(s)&&(u=s,s=this.mainchain.defaultPrivateKey),this.utils.isFunction(a)&&(u=a,a={}),u){e.next=7;break}return e.abrupt("return",this.injectPromise(this.depositTrc,t,r,n,o,i,a,s));case 7:if(!this.validator.notValid([{name:"functionSelector",type:"not-empty-string",value:t},{name:"num",type:"integer",value:r,gte:0},{name:"fee",type:"integer",value:n,gte:0},{name:"feeLimit",type:"integer",value:o,gte:0},{name:"contractAddress",type:"address",value:i}],u)){e.next=9;break}return e.abrupt("return");case 9:if(a=lr(lr({feeLimit:o},a),{},{callValue:n,tokenId:"",tokenValue:0}),e.prev=10,c=null,"approve"!==t){e.next=21;break}return e.next=15,this.mainchain.contract().at(i);case 15:return l=e.sent,e.next=18,l.approve(this.mainGatewayAddress,r).send(a,s);case 18:c=e.sent,e.next=44;break;case 21:return e.next=23,this.mainchain.contract().at(this.mainGatewayAddress);case 23:f=e.sent,e.t0=t,e.next="depositTRC20"===e.t0?27:"depositTRC721"===e.t0?31:"retryDeposit"===e.t0?35:"retryMapping"===e.t0?39:43;break;case 27:return e.next=29,f.depositTRC20(i,r).send(a,s);case 29:case 33:case 37:case 41:return c=e.sent,e.abrupt("break",44);case 31:return e.next=33,f.depositTRC721(i,r).send(a,s);case 35:return e.next=37,f.retryDeposit(r).send(a,s);case 39:return e.next=41,f.retryMapping(r).send(a,s);case 43:return e.abrupt("break",44);case 44:u(null,c),e.next=50;break;case 47:return e.prev=47,e.t1=e.catch(10),e.abrupt("return",u(e.t1));case 50:case"end":return e.stop()}}),e,this,[[10,47]])}))),function(e,t,r,n,o){return w.apply(this,arguments)})},{key:"approveTrc20",value:(b=d()(R.a.mark((function e(t,r,n){var o,i,a,s=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=s.length>3&&void 0!==s[3]?s[3]:{},i=s.length>4&&void 0!==s[4]?s[4]:this.mainchain.defaultPrivateKey,a=s.length>5&&void 0!==s[5]&&s[5],"approve",e.abrupt("return",this.depositTrc("approve",t,0,r,n,o,i,a));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return b.apply(this,arguments)})},{key:"approveTrc721",value:(g=d()(R.a.mark((function e(t,r,n){var o,i,a,s=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=s.length>3&&void 0!==s[3]?s[3]:{},i=s.length>4&&void 0!==s[4]?s[4]:this.mainchain.defaultPrivateKey,a=s.length>5&&void 0!==s[5]&&s[5],"approve",e.abrupt("return",this.depositTrc("approve",t,0,r,n,o,i,a));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return g.apply(this,arguments)})},{key:"depositTrc20",value:(y=d()(R.a.mark((function e(t,r,n,o){var i,a,s,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=u.length>4&&void 0!==u[4]?u[4]:{},a=u.length>5&&void 0!==u[5]?u[5]:this.mainchain.defaultPrivateKey,s=u.length>6&&void 0!==u[6]&&u[6],"depositTRC20",e.abrupt("return",this.depositTrc("depositTRC20",t,r,n,o,i,a,s));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return y.apply(this,arguments)})},{key:"depositTrc721",value:(p=d()(R.a.mark((function e(t,r,n,o){var i,a,s,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=u.length>4&&void 0!==u[4]?u[4]:{},a=u.length>5&&void 0!==u[5]?u[5]:this.mainchain.defaultPrivateKey,s=u.length>6&&void 0!==u[6]&&u[6],"depositTRC721",e.abrupt("return",this.depositTrc("depositTRC721",t,r,n,o,i,a,s));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return p.apply(this,arguments)})},{key:"mappingTrc",value:(h=d()(R.a.mark((function e(t,r,n,o){var i,a,s,u,c,l=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=l.length>4&&void 0!==l[4]?l[4]:{},a=l.length>5&&void 0!==l[5]?l[5]:this.mainchain.defaultPrivateKey,s=l.length>6?l[6]:void 0,this.utils.isFunction(a)&&(s=a,a=this.mainchain.defaultPrivateKey),this.utils.isFunction(i)&&(s=i,i={}),s){e.next=7;break}return e.abrupt("return",this.injectPromise(this.mappingTrc,t,r,n,o,i,a));case 7:if(!this.validator.notValid([{name:"trxHash",type:"not-empty-string",value:t},{name:"mappingFee",type:"integer",value:r,gte:0},{name:"feeLimit",type:"integer",value:n,gte:0}],s)){e.next=9;break}return e.abrupt("return");case 9:return t=t.startsWith("0x")?t:"0x"+t,i=lr(lr({feeLimit:n},i),{},{callValue:r}),e.prev=11,e.next=14,this.mainchain.contract().at(this.mainGatewayAddress);case 14:if(u=e.sent,c=null,"mappingTRC20"!==o){e.next=22;break}return e.next=19,u.mappingTRC20(t).send(i,a);case 19:c=e.sent,e.next=29;break;case 22:if("mappingTRC721"!==o){e.next=28;break}return e.next=25,u.mappingTRC721(t).send(i,a);case 25:c=e.sent,e.next=29;break;case 28:s(new Error("type must be trc20 or trc721"));case 29:s(null,c),e.next=35;break;case 32:return e.prev=32,e.t0=e.catch(11),e.abrupt("return",s(e.t0));case 35:case"end":return e.stop()}}),e,this,[[11,32]])}))),function(e,t,r,n){return h.apply(this,arguments)})},{key:"mappingTrc20",value:(f=d()(R.a.mark((function e(t,r,n){var o,i,a,s=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=s.length>3&&void 0!==s[3]?s[3]:{},i=s.length>4&&void 0!==s[4]?s[4]:this.mainchain.defaultPrivateKey,a=s.length>5&&void 0!==s[5]&&s[5],"mappingTRC20",e.abrupt("return",this.mappingTrc(t,r,n,"mappingTRC20",o,i,a));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return f.apply(this,arguments)})},{key:"mappingTrc721",value:(l=d()(R.a.mark((function e(t,r,n){var o,i,a,s=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=s.length>3&&void 0!==s[3]?s[3]:{},i=s.length>4&&void 0!==s[4]?s[4]:this.mainchain.defaultPrivateKey,a=s.length>5&&void 0!==s[5]&&s[5],"mappingTRC721",e.abrupt("return",this.mappingTrc(t,r,n,"mappingTRC721",o,i,a));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return l.apply(this,arguments)})},{key:"withdrawTrx",value:(c=d()(R.a.mark((function e(t,r,n){var o,i,a,s,u,c=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=c.length>3&&void 0!==c[3]?c[3]:{},i=c.length>4&&void 0!==c[4]?c[4]:this.mainchain.defaultPrivateKey,a=c.length>5&&void 0!==c[5]&&c[5],this.utils.isFunction(i)&&(a=i,i=this.mainchain.defaultPrivateKey),this.utils.isFunction(o)&&(a=o,o={}),a){e.next=7;break}return e.abrupt("return",this.injectPromise(this.withdrawTrx,t,r,n,o,i));case 7:if(!this.validator.notValid([{name:"callValue",type:"integer",value:t,gte:0},{name:"withdrawFee",type:"integer",value:r,gte:0},{name:"feeLimit",type:"integer",value:n,gte:0}],a)){e.next=9;break}return e.abrupt("return");case 9:return o=lr({callValue:Number(t)+Number(r),feeLimit:n},o),e.prev=10,e.next=13,this.sidechain.contract().at(this.sideGatewayAddress);case 13:return s=e.sent,e.next=16,s.withdrawTRX().send(o,i);case 16:return u=e.sent,e.abrupt("return",a(null,u));case 20:return e.prev=20,e.t0=e.catch(10),e.abrupt("return",a(e.t0));case 23:case"end":return e.stop()}}),e,this,[[10,20]])}))),function(e,t,r){return c.apply(this,arguments)})},{key:"withdrawTrc10",value:(u=d()(R.a.mark((function e(t,r,n,o){var i,a,s,u,c,l=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=l.length>4&&void 0!==l[4]?l[4]:{},a=l.length>5&&void 0!==l[5]?l[5]:this.mainchain.defaultPrivateKey,s=l.length>6&&void 0!==l[6]&&l[6],this.utils.isFunction(a)&&(s=a,a=this.mainchain.defaultPrivateKey),this.utils.isFunction(i)&&(s=i,i={}),s){e.next=7;break}return e.abrupt("return",this.injectPromise(this.withdrawTrc10,t,r,n,o,i,a));case 7:if(!this.validator.notValid([{name:"tokenId",type:"integer",value:t,gte:0},{name:"tokenValue",type:"integer",value:r,gte:0},{name:"withdrawFee",type:"integer",value:n,gte:0},{name:"feeLimit",type:"integer",value:o,gte:0}],s)){e.next=9;break}return e.abrupt("return");case 9:return i=lr({tokenValue:r,tokenId:t,callValue:n,feeLimit:o},i),e.prev=10,e.next=13,this.sidechain.contract().at(this.sideGatewayAddress);case 13:return u=e.sent,e.next=16,u.withdrawTRC10(t,r).send(i,a);case 16:return c=e.sent,e.abrupt("return",s(null,c));case 20:return e.prev=20,e.t0=e.catch(10),e.abrupt("return",s(e.t0));case 23:case"end":return e.stop()}}),e,this,[[10,20]])}))),function(e,t,r,n){return u.apply(this,arguments)})},{key:"withdrawTrc",value:(s=d()(R.a.mark((function e(t,r,n,o,i){var a,s,u,c,l,f,h,p,y,m,g=this,v=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=v.length>5&&void 0!==v[5]?v[5]:{},s=v.length>6&&void 0!==v[6]?v[6]:this.mainchain.defaultPrivateKey,u=v.length>7&&void 0!==v[7]&&v[7],this.utils.isFunction(s)&&(u=s,s=this.mainchain.defaultPrivateKey),this.utils.isFunction(a)&&(u=a,a={}),u){e.next=7;break}return e.abrupt("return",this.injectPromise(this.withdrawTrc,t,r,n,o,i,a,s));case 7:if(!this.validator.notValid([{name:"functionSelector",type:"not-empty-string",value:t},{name:"numOrId",type:"integer",value:r,gte:0},{name:"withdrawFee",type:"integer",value:n,gte:0},{name:"feeLimit",type:"integer",value:o,gte:0},{name:"contractAddress",type:"address",value:i}],u)){e.next=9;break}return e.abrupt("return");case 9:return a=lr(lr({feeLimit:o},a),{},{callValue:n}),c=[{type:"uint256",value:r}],e.prev=11,l=s?this.sidechain.address.fromPrivateKey(s):this.sidechain.defaultAddress.base58,e.next=15,this.sidechain.transactionBuilder.triggerSmartContract(i,t,a,c,this.sidechain.address.toHex(l));case 15:if((f=e.sent).result&&f.result.result){e.next=18;break}return e.abrupt("return",u("Unknown error: "+JSON.stringify(f.transaction,null,2)));case 18:return e.next=20,this.sidechain.trx.sign(f.transaction,s);case 20:if((h=e.sent).signature){e.next=25;break}if(s){e.next=24;break}return e.abrupt("return",u("Transaction was not signed properly"));case 24:return e.abrupt("return",u("Invalid private key provided"));case 25:return e.next=27,this.sidechain.trx.sendRawTransaction(h);case 27:if(!(p=e.sent).code){e.next=32;break}return y={error:p.code,message:p.code},p.message&&(y.message=this.sidechain.toUtf8(p.message)),e.abrupt("return",u(y));case 32:if(a.shouldPollResponse){e.next=34;break}return e.abrupt("return",u(null,h.txID));case 34:(m=function(){var e=d()(R.a.mark((function e(){var t,r,n,o=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(20!=(t=o.length>0&&void 0!==o[0]?o[0]:0)){e.next=3;break}return e.abrupt("return",u({error:"Cannot find result in solidity node",transaction:h}));case 3:return e.next=5,g.sidechain.trx.getTransactionInfo(h.txID);case 5:if(r=e.sent,Object.keys(r).length){e.next=8;break}return e.abrupt("return",setTimeout((function(){m(t+1)}),3e3));case 8:if(!r.result||"FAILED"!=r.result){e.next=10;break}return e.abrupt("return",u({error:g.sidechain.toUtf8(r.resMessage),transaction:h,output:r}));case 10:if(g.utils.hasProperty(r,"contractResult")){e.next=12;break}return e.abrupt("return",u({error:"Failed to execute: "+JSON.stringify(r,null,2),transaction:h,output:r}));case 12:if(!a.rawResponse){e.next=14;break}return e.abrupt("return",u(null,r));case 14:return 1===(n=decodeOutput(g.outputs,"0x"+r.contractResult[0])).length&&(n=n[0]),e.abrupt("return",u(null,n));case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())(),e.next=41;break;case 38:return e.prev=38,e.t0=e.catch(11),e.abrupt("return",u(e.t0));case 41:case"end":return e.stop()}}),e,this,[[11,38]])}))),function(e,t,r,n,o){return s.apply(this,arguments)})},{key:"withdrawTrc20",value:(a=d()(R.a.mark((function e(t,r,n,o,i){var a,s,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=u.length>5&&void 0!==u[5]?u[5]:this.mainchain.defaultPrivateKey,s=u.length>6&&void 0!==u[6]&&u[6],"withdrawal(uint256)",e.abrupt("return",this.withdrawTrc("withdrawal(uint256)",t,r,n,o,i,a,s));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,o){return a.apply(this,arguments)})},{key:"withdrawTrc721",value:(i=d()(R.a.mark((function e(t,r,n,o,i){var a,s,u=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=u.length>5&&void 0!==u[5]?u[5]:this.mainchain.defaultPrivateKey,s=u.length>6&&void 0!==u[6]&&u[6],"withdrawal(uint256)",e.abrupt("return",this.withdrawTrc("withdrawal(uint256)",t,r,n,o,i,a,s));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,o){return i.apply(this,arguments)})},{key:"injectFund",value:(o=d()(R.a.mark((function e(t,r,n){var o,i,a,s,u,c,l,f,d=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=d.length>3&&void 0!==d[3]?d[3]:this.mainchain.defaultPrivateKey,i=d.length>4&&void 0!==d[4]&&d[4],this.utils.isFunction(o)&&(i=o,o=this.mainchain.defaultPrivateKey),this.utils.isFunction(n)&&(i=n,n={}),i){e.next=6;break}return e.abrupt("return",this.injectPromise(this.injectFund,t,r,n,o));case 6:if(!this.validator.notValid([{name:"num",type:"integer",value:t,gte:0},{name:"feeLimit",type:"integer",value:r,gte:0}],i)){e.next=8;break}return e.abrupt("return");case 8:return e.prev=8,a=this.sidechain.address.fromPrivateKey(o),s=this.sidechain.address.toHex(a),e.next=13,this.sidechain.fullNode.request("/wallet/fundinject",{owner_address:s,amount:t},"post");case 13:return u=e.sent,e.next=16,this.sidechain.trx.sign(u,o);case 16:if((c=e.sent).signature){e.next=21;break}if(o){e.next=20;break}return e.abrupt("return",i("Transaction was not signed properly"));case 20:return e.abrupt("return",i("Invalid private key provided"));case 21:return e.next=23,this.sidechain.trx.sendRawTransaction(c);case 23:if(!(l=e.sent).code){e.next=28;break}return f={error:l.code,message:l.code},l.message&&(f.message=this.mainchain.toUtf8(l.message)),e.abrupt("return",i(f));case 28:return e.abrupt("return",i(null,c.txID));case 31:return e.prev=31,e.t0=e.catch(8),e.abrupt("return",i(e.t0));case 34:case"end":return e.stop()}}),e,this,[[8,31]])}))),function(e,t,r){return o.apply(this,arguments)})},{key:"retryWithdraw",value:(n=d()(R.a.mark((function e(t,r,n){var o,i,a,s=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=s.length>3&&void 0!==s[3]?s[3]:{},i=s.length>4&&void 0!==s[4]?s[4]:this.sidechain.defaultPrivateKey,a=s.length>5&&void 0!==s[5]&&s[5],"retryWithdraw(uint256)",e.abrupt("return",this.withdrawTrc("retryWithdraw(uint256)",t,r,n,this.sideGatewayAddress,o,i,a));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"retryDeposit",value:(r=d()(R.a.mark((function e(t,r,n){var o,i,a,s=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=s.length>3&&void 0!==s[3]?s[3]:{},i=s.length>4&&void 0!==s[4]?s[4]:this.mainchain.defaultPrivateKey,a=s.length>5&&void 0!==s[5]&&s[5],"retryDeposit",e.abrupt("return",this.depositTrc("retryDeposit",t,r,n,this.mainGatewayAddress,o,i,a));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"retryMapping",value:(t=d()(R.a.mark((function e(t,r,n){var o,i,a,s=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=s.length>3&&void 0!==s[3]?s[3]:{},i=s.length>4&&void 0!==s[4]?s[4]:this.mainchain.defaultPrivateKey,a=s.length>5&&void 0!==s[5]&&s[5],"retryMapping",e.abrupt("return",this.depositTrc("retryMapping",t,r,n,this.mainGatewayAddress,o,i,a));case 5:case"end":return e.stop()}}),e,this)}))),function(e,r,n){return t.apply(this,arguments)})}]),e}();var dr=function(e){S()(i,e);var t,r,n,o=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=x()(e);if(t){var o=x()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _()(this,r)}}(i);function i(){var e,t,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=arguments.length>4&&void 0!==arguments[4]&&arguments[4];m()(this,i),e=o.call(this);var c=!1,l=!1;return"object"===p()(r)&&(r.fullNode||r.fullHost)?(t=r.fullNode||r.fullHost,s=n,n=r.solidityNode||r.fullHost,a=r.eventServer||r.fullHost,c=r.headers||!1,l=r.eventHeaders||c,u=r.privateKey):t=r,Rt.isString(t)&&(t=new It.HttpProvider(t)),Rt.isString(n)&&(n=new It.HttpProvider(n)),Rt.isString(a)&&(a=new It.HttpProvider(a)),e.event=new ur(w()(e)),e.transactionBuilder=new Zt(w()(e)),e.trx=new $t(w()(e)),e.plugin=new ir(w()(e),r),e.utils=Rt,e.setFullNode(t),e.setSolidityNode(n),e.setEventServer(a),e.providers=It,e.BigNumber=Tt.a,e.defaultBlock=!1,e.defaultPrivateKey=!1,e.defaultAddress={hex:!1,base58:!1},["sha3","toHex","toUtf8","fromUtf8","toAscii","fromAscii","toDecimal","fromDecimal","toSun","fromSun","toBigNumber","isAddress","createAccount","address","version","createRandom","fromMnemonic"].forEach((function(t){e[t]=i[t]})),"object"===p()(s)&&(s.fullNode||s.fullHost)?e.sidechain=new fr(s,i,w()(e),u):u=u||s,u&&e.setPrivateKey(u),e.fullnodeVersion="3.5.0",e.feeLimit=15e7,e.injectPromise=Ut()(w()(e)),c&&e.setFullNodeHeader(c),l&&e.setEventHeader(l),e}return v()(i,[{key:"getFullnodeVersion",value:(n=d()(R.a.mark((function e(){var t;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.trx.getNodeInfo();case 3:t=e.sent,this.fullnodeVersion=t.configNodeInfo.codeVersion,2===this.fullnodeVersion.split(".").length&&(this.fullnodeVersion+=".0"),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),this.fullnodeVersion="3.5.0";case 11:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(){return n.apply(this,arguments)})},{key:"setDefaultBlock",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if([!1,"latest","earliest",0].includes(e))return this.defaultBlock=e;if(!Rt.isInteger(e)||!e)throw new Error("Invalid block ID provided");this.defaultBlock=Math.abs(e)}},{key:"setPrivateKey",value:function(e){try{this.setAddress(this.address.fromPrivateKey(e))}catch(e){throw new Error("Invalid private key provided")}this.defaultPrivateKey=e,this.emit("privateKeyChanged",e)}},{key:"setAddress",value:function(e){if(!this.isAddress(e))throw new Error("Invalid address provided");var t=this.address.toHex(e),r=this.address.fromHex(e);this.defaultPrivateKey&&this.address.fromPrivateKey(this.defaultPrivateKey)!==r&&(this.defaultPrivateKey=!1),this.defaultAddress={hex:t,base58:r},this.emit("addressChanged",{hex:t,base58:r})}},{key:"fullnodeSatisfies",value:function(e){return Lt.a.satisfies(this.fullnodeVersion,e)}},{key:"isValidProvider",value:function(e){return Object.values(It).some((function(t){return e instanceof t}))}},{key:"setFullNode",value:function(e){if(Rt.isString(e)&&(e=new It.HttpProvider(e)),!this.isValidProvider(e))throw new Error("Invalid full node provided");this.fullNode=e,this.fullNode.setStatusPage("wallet/getnowblock"),this.getFullnodeVersion()}},{key:"setSolidityNode",value:function(e){if(Rt.isString(e)&&(e=new It.HttpProvider(e)),!this.isValidProvider(e))throw new Error("Invalid solidity node provided");this.solidityNode=e,this.solidityNode.setStatusPage("walletsolidity/getnowblock")}},{key:"setEventServer",value:function(){var e;(e=this.event).setServer.apply(e,arguments)}},{key:"setHeader",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new It.HttpProvider(this.fullNode.host,3e4,!1,!1,e),r=new It.HttpProvider(this.solidityNode.host,3e4,!1,!1,e),n=new It.HttpProvider(this.eventServer.host,3e4,!1,!1,e);this.setFullNode(t),this.setSolidityNode(r),this.setEventServer(n)}},{key:"setFullNodeHeader",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new It.HttpProvider(this.fullNode.host,3e4,!1,!1,e),r=new It.HttpProvider(this.solidityNode.host,3e4,!1,!1,e);this.setFullNode(t),this.setSolidityNode(r)}},{key:"setEventHeader",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new It.HttpProvider(this.eventServer.host,3e4,!1,!1,e);this.setEventServer(t)}},{key:"currentProviders",value:function(){return{fullNode:this.fullNode,solidityNode:this.solidityNode,eventServer:this.eventServer}}},{key:"currentProvider",value:function(){return this.currentProviders()}},{key:"getEventResult",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:[],arguments.length>1&&void 0!==arguments[1]&&arguments[1])}},{key:"isConnected",value:(r=d()(R.a.mark((function e(){var t,r=arguments;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.length>0&&void 0!==r[0]&&r[0]){e.next=3;break}return e.abrupt("return",this.injectPromise(this.isConnected));case 3:return e.t0=t,e.next=6,this.fullNode.isConnected();case 6:return e.t1=e.sent,e.next=9,this.solidityNode.isConnected();case 9:if(e.t2=e.sent,e.t3=this.eventServer,!e.t3){e.next=15;break}return e.next=14,this.eventServer.isConnected();case 14:e.t3=e.sent;case 15:return e.t4=e.t3,e.t5={fullNode:e.t1,solidityNode:e.t2,eventServer:e.t4},e.abrupt("return",(0,e.t0)(null,e.t5));case 18:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}],[{key:"address",get:function(){return{fromHex:function(e){return Rt.isHex(e)?Rt.crypto.getBase58CheckAddress(Rt.code.hexStr2byteArray(e.replace(/^0x/,"41"))):e},toHex:function(e){return Rt.isHex(e)?e.toLowerCase().replace(/^0x/,"41"):Rt.code.byteArray2hexStr(Rt.crypto.decodeBase58Address(e)).toLowerCase()},fromPrivateKey:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{return Rt.crypto.pkToAddress(e,t)}catch(e){return!1}}}}},{key:"sha3",value:function(e){return(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?"0x":"")+ie(Buffer.from(e,"utf-8")).toString().substring(2)}},{key:"toHex",value:function(e){if(Rt.isBoolean(e))return i.fromDecimal(+e);if(Rt.isBigNumber(e))return i.fromDecimal(e);if("object"===p()(e))return i.fromUtf8(JSON.stringify(e));if(Rt.isString(e)){if(/^(-|)0x/.test(e))return e;if(!isFinite(e)||/^\s*$/.test(e))return i.fromUtf8(e)}var t=i.fromDecimal(e);if("0xNaN"===t)throw new Error("The passed value is not convertible to a hex string");return t}},{key:"toUtf8",value:function(e){if(Rt.isHex(e))return e=e.replace(/^0x/,""),Buffer.from(e,"hex").toString("utf8");throw new Error("The passed value is not a valid hex string")}},{key:"fromUtf8",value:function(e){if(!Rt.isString(e))throw new Error("The passed value is not a valid utf-8 string");return"0x"+Buffer.from(e,"utf8").toString("hex")}},{key:"toAscii",value:function(e){if(Rt.isHex(e)){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r0&&void 0!==arguments[0]?arguments[0]:0;return Rt.isBigNumber(e)?e:Rt.isString(e)&&/^(-|)0x/.test(e)?new Tt.a(e.replace("0x",""),16):new Tt.a(e.toString(10),10)}},{key:"isAddress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!Rt.isString(e))return!1;if(42===e.length)try{return i.isAddress(Rt.crypto.getBase58CheckAddress(Rt.code.hexStr2byteArray(e)))}catch(e){return!1}try{return Rt.crypto.isAddressValid(e)}catch(e){return!1}}},{key:"createAccount",value:(t=d()(R.a.mark((function e(){var t;return R.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Rt.accounts.generateAccount(),e.abrupt("return",t);case 2:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})},{key:"createRandom",value:function(e){return Rt.accounts.generateRandom(e)}},{key:"fromMnemonic",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m/44'/195'/0'/0/0",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en";return Rt.accounts.generateAccountWithMnemonic(e,t,r)}}]),i}(Mt.a);P()(dr,"providers",It),P()(dr,"BigNumber",Tt.a),P()(dr,"TransactionBuilder",Zt),P()(dr,"Trx",$t),P()(dr,"Contract",or),P()(dr,"Plugin",ir),P()(dr,"Event",ur),P()(dr,"version",Bt.a),P()(dr,"utils",Rt)}]).default},74264:(e,t,r)=>{e.exports=r(42742)},13311:(e,t,r)=>{"use strict";var n=r(35613),o=r(79887),i=r(73589),a=r(82077),s=r(17848),u=r(21195),c=r(69119),l=r(70420),f=r(15125),d=r(30525);e.exports=function(e){return new Promise((function(t,r){var h,p=e.data,y=e.headers,m=e.responseType;function g(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}n.isFormData(p)&&delete y["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var b=e.auth.username||"",w=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";y.Authorization="Basic "+btoa(b+":"+w)}var A=s(e.baseURL,e.url);function S(){if(v){var n="getAllResponseHeaders"in v?u(v.getAllResponseHeaders()):null,i={data:m&&"text"!==m&&"json"!==m?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:n,config:e,request:v};o((function(e){t(e),g()}),(function(e){r(e),g()}),i),v=null}}if(v.open(e.method.toUpperCase(),a(A,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=S:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(S)},v.onabort=function(){v&&(r(l("Request aborted",e,"ECONNABORTED",v)),v=null)},v.onerror=function(){r(l("Network Error",e,null,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||f;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(l(t,e,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},n.isStandardBrowserEnv()){var k=(e.withCredentials||c(A))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;k&&(y[e.xsrfHeaderName]=k)}"setRequestHeader"in v&&n.forEach(y,(function(e,t){"undefined"===typeof p&&"content-type"===t.toLowerCase()?delete y[t]:v.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),m&&"json"!==m&&(v.responseType=e.responseType),"function"===typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(e){v&&(r(!e||e&&e.type?new d("canceled"):e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),p||(p=null),v.send(p)}))}},42742:(e,t,r)=>{"use strict";var n=r(35613),o=r(17787),i=r(40684),a=r(13724);var s=function e(t){var r=new i(t),s=o(i.prototype.request,r);return n.extend(s,i.prototype,r),n.extend(s,r),s.create=function(r){return e(a(t,r))},s}(r(75631));s.Axios=i,s.Cancel=r(30525),s.CancelToken=r(51060),s.isCancel=r(677),s.VERSION=r(68190).version,s.all=function(e){return Promise.all(e)},s.spread=r(16979),s.isAxiosError=r(44052),e.exports=s,e.exports.default=s},30525:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},51060:(e,t,r)=>{"use strict";var n=r(30525);function o(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},40684:(e,t,r)=>{"use strict";var n=r(35613),o=r(82077),i=r(82598),a=r(34621),s=r(13724),u=r(13036),c=u.validators;function l(e){this.defaults=e,this.interceptors={request:new i,response:new i}}l.prototype.request=function(e,t){"string"===typeof e?(t=t||{}).url=e:t=e||{},(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&u.assertOptions(r,{silentJSONParsing:c.transitional(c.boolean),forcedJSONParsing:c.transitional(c.boolean),clarifyTimeoutError:c.transitional(c.boolean)},!1);var n=[],o=!0;this.interceptors.request.forEach((function(e){"function"===typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var i,l=[];if(this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)})),!o){var f=[a,void 0];for(Array.prototype.unshift.apply(f,n),f=f.concat(l),i=Promise.resolve(t);f.length;)i=i.then(f.shift(),f.shift());return i}for(var d=t;n.length;){var h=n.shift(),p=n.shift();try{d=h(d)}catch(y){p(y);break}}try{i=a(d)}catch(y){return Promise.reject(y)}for(;l.length;)i=i.then(l.shift(),l.shift());return i},l.prototype.getUri=function(e){return e=s(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,r){return this.request(s(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,r,n){return this.request(s(n||{},{method:e,url:t,data:r}))}})),e.exports=l},82598:(e,t,r)=>{"use strict";var n=r(35613);function o(){this.handlers=[]}o.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},17848:(e,t,r)=>{"use strict";var n=r(12480),o=r(77693);e.exports=function(e,t){return e&&!n(t)?o(e,t):t}},70420:(e,t,r)=>{"use strict";var n=r(98016);e.exports=function(e,t,r,o,i){var a=new Error(e);return n(a,t,r,o,i)}},34621:(e,t,r)=>{"use strict";var n=r(35613),o=r(97434),i=r(677),a=r(75631),s=r(30525);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s("canceled")}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return u(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(u(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},98016:e=>{"use strict";e.exports=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},13724:(e,t,r)=>{"use strict";var n=r(35613);e.exports=function(e,t){t=t||{};var r={};function o(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function i(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:o(void 0,e[r]):o(e[r],t[r])}function a(e){if(!n.isUndefined(t[e]))return o(void 0,t[e])}function s(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:o(void 0,e[r]):o(void 0,t[r])}function u(r){return r in t?o(e[r],t[r]):r in e?o(void 0,e[r]):void 0}var c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||i,o=t(e);n.isUndefined(o)&&t!==u||(r[e]=o)})),r}},79887:(e,t,r)=>{"use strict";var n=r(70420);e.exports=function(e,t,r){var o=r.config.validateStatus;r.status&&o&&!o(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},97434:(e,t,r)=>{"use strict";var n=r(35613),o=r(75631);e.exports=function(e,t,r){var i=this||o;return n.forEach(r,(function(r){e=r.call(i,e,t)})),e}},75631:(e,t,r)=>{"use strict";var n=r(35613),o=r(15739),i=r(98016),a=r(15125),s={"Content-Type":"application/x-www-form-urlencoded"};function u(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c={transitional:a,adapter:function(){var e;return("undefined"!==typeof XMLHttpRequest||"undefined"!==typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(e=r(13311)),e}(),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(u(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)||t&&"application/json"===t["Content-Type"]?(u(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(t||JSON.parse)(e),n.trim(e)}catch(o){if("SyntaxError"!==o.name)throw o}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||c.transitional,r=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,a=!r&&"json"===this.responseType;if(a||o&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(s){if(a){if("SyntaxError"===s.name)throw i(s,this,"E_JSON_PARSE");throw s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(s)})),e.exports=c},15125:e=>{"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},68190:e=>{e.exports={version:"0.26.1"}},17787:e=>{"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n{"use strict";var n=r(35613);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=t.toString();else{var a=[];n.forEach(t,(function(e,t){null!==e&&"undefined"!==typeof e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))})))})),i=a.join("&")}if(i){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},77693:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},73589:(e,t,r)=>{"use strict";var n=r(35613);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,o,i,a){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(o)&&s.push("path="+o),n.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},12480:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},44052:(e,t,r)=>{"use strict";var n=r(35613);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},69119:(e,t,r)=>{"use strict";var n=r(35613);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},15739:(e,t,r)=>{"use strict";var n=r(35613);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},21195:(e,t,r)=>{"use strict";var n=r(35613),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,i,a={};return e?(n.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=n.trim(e.substr(0,i)).toLowerCase(),r=n.trim(e.substr(i+1)),t){if(a[t]&&o.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}})),a):a}},16979:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},13036:(e,t,r)=>{"use strict";var n=r(68190).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var i={};o.transitional=function(e,t,r){function o(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,a){if(!1===e)throw new Error(o(n," has been removed"+(t?" in "+t:"")));return t&&!i[n]&&(i[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,a)}},e.exports={assertOptions:function(e,t,r){if("object"!==typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),o=n.length;o-- >0;){var i=n[o],a=t[i];if(a){var s=e[i],u=void 0===s||a(s,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:o}},35613:(e,t,r)=>{"use strict";var n=r(17787),o=Object.prototype.toString;function i(e){return Array.isArray(e)}function a(e){return"undefined"===typeof e}function s(e){return"[object ArrayBuffer]"===o.call(e)}function u(e){return null!==e&&"object"===typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r{"use strict";r.d(t,{A:()=>oe});var n=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?l(w,--v):0,m--,10===b&&(m=1,y--),b}function _(){return b=v2||P(b)>3?"":" "}function M(e,t){for(;--t&&_()&&!(b<48||b>102||b>57&&b<65||b>70&&b<97););return T(e,x()+(t<6&&32==E()&&32==_()))}function B(e){for(;_();)switch(b){case e:return v;case 34:case 39:34!==e&&39!==e&&B(b);break;case 40:41===e&&B(e);break;case 92:_()}return v}function N(e,t){for(;_()&&e+b!==57&&(e+b!==84||47!==E()););return"/*"+T(t,v-1)+"*"+i(47===e?e:_())}function L(e){for(;!P(E());)_();return T(e,v)}var j="-ms-",U="-moz-",F="-webkit-",D="comm",z="rule",q="decl",H="@keyframes";function V(e,t){for(var r="",n=h(e),o=0;o0&&d(U)-g&&p(b>32?Q(U+";",n,r,g-1):Q(u(U," ","")+";",n,r,g-2),h);break;case 59:U+=";";default:if(p(j=X(U,t,r,y,m,o,f,O,R=[],B=[],g),a),123===P)if(0===m)G(U,t,j,j,R,a,g,f,B);else switch(99===v&&110===l(U,3)?100:v){case 100:case 108:case 109:case 115:G(e,j,j,n&&p(X(e,j,j,0,0,o,f,O,o,R=[],g),B),o,B,g,f,n?R:B);break;default:G(U,j,j,j,[""],B,0,f,B)}}y=m=b=0,A=T=1,O=U="",g=s;break;case 58:g=1+d(U),b=w;default:if(A<1)if(123==P)--A;else if(125==P&&0==A++&&125==k())continue;switch(U+=i(P),P*A){case 38:T=m>0?1:(U+="\f",-1);break;case 44:f[y++]=(d(U)-1)*T,T=1;break;case 64:45===E()&&(U+=I(_())),v=E(),m=g=d(O=U+=L(x())),P++;break;case 45:45===w&&2==d(U)&&(A=0)}}return a}function X(e,t,r,n,i,a,c,l,d,p,y){for(var m=i-1,g=0===i?a:[""],v=h(g),b=0,w=0,S=0;b0?g[k]+" "+_:u(_,/&\f/g,g[k])))&&(d[S++]=E);return A(e,t,r,0===i?z:l,d,p,y)}function Z(e,t,r){return A(e,t,r,D,i(b),f(e,2,-2),0)}function Q(e,t,r,n){return A(e,t,r,q,f(e,0,n),f(e,n+1,-1),n)}var Y=function(e,t,r){for(var n=0,o=0;n=o,o=E(),38===n&&12===o&&(t[r]=1),!P(o);)_();return T(e,v)},J=function(e,t){return R(function(e,t){var r=-1,n=44;do{switch(P(n)){case 0:38===n&&12===E()&&(t[r]=1),e[r]+=Y(v-1,t,r);break;case 2:e[r]+=I(n);break;case 4:if(44===n){e[++r]=58===E()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=i(n)}}while(n=_());return e}(O(e),t))},$=new WeakMap,ee=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||$.get(r))&&!n){$.set(e,!0);for(var o=[],i=J(t,o),a=r.props,s=0,u=0;s6)switch(l(e,t+1)){case 109:if(45!==l(e,t+4))break;case 102:return u(e,/(.+:)(.+)-([^]+)/,"$1"+F+"$2-$3$1"+U+(108==l(e,t+3)?"$3":"$2-$3"))+e;case 115:return~c(e,"stretch")?re(u(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==l(e,t+1))break;case 6444:switch(l(e,d(e)-3-(~c(e,"!important")&&10))){case 107:return u(e,":",":"+F)+e;case 101:return u(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+F+(45===l(e,14)?"inline-":"")+"box$3$1"+F+"$2$3$1"+j+"$2box$3")+e}break;case 5936:switch(l(e,t+11)){case 114:return F+e+j+u(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return F+e+j+u(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return F+e+j+u(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return F+e+j+e+e}return e}var ne=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case q:e.return=re(e.value,e.length);break;case H:return V([S(e,{value:u(e.value,"@","@"+F)})],n);case z:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return V([S(e,{props:[u(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return V([S(e,{props:[u(t,/:(plac\w+)/,":"+F+"input-$1")]}),S(e,{props:[u(t,/:(plac\w+)/,":-moz-$1")]}),S(e,{props:[u(t,/:(plac\w+)/,j+"input-$1")]})],n)}return""}))}}],oe=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var o=e.stylisPlugins||ne;var i,a,s={},u=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r{"use strict";function n(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}r.d(t,{A:()=>n})},55756:(e,t,r)=>{"use strict";r.d(t,{C:()=>s,T:()=>c,i:()=>i,w:()=>u});var n=r(65043),o=r(35513),i=(r(12830),r(69436),!0),a=n.createContext("undefined"!==typeof HTMLElement?(0,o.A)({key:"css"}):null);var s=a.Provider,u=function(e){return(0,n.forwardRef)((function(t,r){var o=(0,n.useContext)(a);return e(t,o,r)}))};i||(u=function(e){return function(t){var r=(0,n.useContext)(a);return null===r?(r=(0,o.A)({key:"css"}),n.createElement(a.Provider,{value:r},e(t,r))):e(t,r)}});var c=n.createContext({})},83290:(e,t,r)=>{"use strict";r.d(t,{AH:()=>c,i7:()=>l,mL:()=>u});var n=r(55756),o=r(65043),i=r(81722),a=r(69436),s=r(12830),u=(r(35513),r(80219),(0,n.w)((function(e,t){var r=e.styles,u=(0,s.J)([r],void 0,o.useContext(n.T));if(!n.i){for(var c,l=u.name,f=u.styles,d=u.next;void 0!==d;)l+=" "+d.name,f+=d.styles,d=d.next;var h=!0===t.compat,p=t.insert("",{name:l,styles:f},t.sheet,h);return h?null:o.createElement("style",((c={})["data-emotion"]=t.key+"-global "+l,c.dangerouslySetInnerHTML={__html:p},c.nonce=t.sheet.nonce,c))}var y=o.useRef();return(0,a.i)((function(){var e=t.key+"-global",r=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),n=!1,o=document.querySelector('style[data-emotion="'+e+" "+u.name+'"]');return t.sheet.tags.length&&(r.before=t.sheet.tags[0]),null!==o&&(n=!0,o.setAttribute("data-emotion",e),r.hydrate([o])),y.current=[r,n],function(){r.flush()}}),[t]),(0,a.i)((function(){var e=y.current,r=e[0];if(e[1])e[1]=!1;else{if(void 0!==u.next&&(0,i.sk)(t,u.next,!0),r.tags.length){var n=r.tags[r.tags.length-1].nextElementSibling;r.before=n,r.flush()}t.insert("",u,r,!1)}}),[t,u.name]),null})));function c(){for(var e=arguments.length,t=new Array(e),r=0;r{"use strict";r.d(t,{J:()=>p});var n={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},o=r(30918),i=/[A-Z]|^ms/g,a=/_EMO_([^_]+?)_([^]*?)_EMO_/g,s=function(e){return 45===e.charCodeAt(1)},u=function(e){return null!=e&&"boolean"!==typeof e},c=(0,o.A)((function(e){return s(e)?e:e.replace(i,"-$&").toLowerCase()})),l=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(a,(function(e,t,r){return d={name:t,styles:r,next:d},t}))}return 1===n[e]||s(e)||"number"!==typeof t||0===t?t:t+"px"};function f(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return d={name:r.name,styles:r.styles,next:d},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)d={name:n.name,styles:n.styles,next:d},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o=4;++n,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(o){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(o)+u;return{name:c,styles:o,next:d}}},69436:(e,t,r)=>{"use strict";var n;r.d(t,{i:()=>s,s:()=>a});var o=r(65043),i=!!(n||(n=r.t(o,2))).useInsertionEffect&&(n||(n=r.t(o,2))).useInsertionEffect,a=i||function(e){return e()},s=i||o.useLayoutEffect},81722:(e,t,r)=>{"use strict";r.d(t,{Rk:()=>n,SF:()=>o,sk:()=>i});function n(e,t,r){var n="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]+";"):n+=r+" "})),n}var o=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},i=function(e,t,r){o(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}}},76700:(e,t,r)=>{"use strict";r.d(t,{r:()=>n});const n="bignumber/5.7.0"},2776:(e,t,r)=>{"use strict";r.d(t,{Os:()=>b,YR:()=>d,gH:()=>p,ii:()=>w});var n=r(6373),o=r.n(n),i=r(89106),a=r(14589),s=r(76700),u=o().BN;const c=new a.Logger(s.r),l={},f=9007199254740991;function d(e){return null!=e&&(p.isBigNumber(e)||"number"===typeof e&&e%1===0||"string"===typeof e&&!!e.match(/^-?[0-9]+$/)||(0,i.isHexString)(e)||"bigint"===typeof e||(0,i.isBytes)(e))}let h=!1;class p{constructor(e,t){e!==l&&c.throwError("cannot call constructor directly; use BigNumber.from",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return m(g(this).fromTwos(e))}toTwos(e){return m(g(this).toTwos(e))}abs(){return"-"===this._hex[0]?p.from(this._hex.substring(1)):this}add(e){return m(g(this).add(g(e)))}sub(e){return m(g(this).sub(g(e)))}div(e){return p.from(e).isZero()&&v("division-by-zero","div"),m(g(this).div(g(e)))}mul(e){return m(g(this).mul(g(e)))}mod(e){const t=g(e);return t.isNeg()&&v("division-by-zero","mod"),m(g(this).umod(t))}pow(e){const t=g(e);return t.isNeg()&&v("negative-power","pow"),m(g(this).pow(t))}and(e){const t=g(e);return(this.isNegative()||t.isNeg())&&v("unbound-bitwise-result","and"),m(g(this).and(t))}or(e){const t=g(e);return(this.isNegative()||t.isNeg())&&v("unbound-bitwise-result","or"),m(g(this).or(t))}xor(e){const t=g(e);return(this.isNegative()||t.isNeg())&&v("unbound-bitwise-result","xor"),m(g(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&v("negative-width","mask"),m(g(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&v("negative-width","shl"),m(g(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&v("negative-width","shr"),m(g(this).shrn(e))}eq(e){return g(this).eq(g(e))}lt(e){return g(this).lt(g(e))}lte(e){return g(this).lte(g(e))}gt(e){return g(this).gt(g(e))}gte(e){return g(this).gte(g(e))}isNegative(){return"-"===this._hex[0]}isZero(){return g(this).isZero()}toNumber(){try{return g(this).toNumber()}catch(e){v("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return c.throwError("this platform does not support BigInt",a.Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?h||(h=!0,c.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?c.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",a.Logger.errors.UNEXPECTED_ARGUMENT,{}):c.throwError("BigNumber.toString does not accept parameters",a.Logger.errors.UNEXPECTED_ARGUMENT,{})),g(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof p)return e;if("string"===typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new p(l,y(e)):e.match(/^-?[0-9]+$/)?new p(l,y(new u(e))):c.throwArgumentError("invalid BigNumber string","value",e);if("number"===typeof e)return e%1&&v("underflow","BigNumber.from",e),(e>=f||e<=-f)&&v("overflow","BigNumber.from",e),p.from(String(e));const t=e;if("bigint"===typeof t)return p.from(t.toString());if((0,i.isBytes)(t))return p.from((0,i.hexlify)(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"===typeof e)return p.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"===typeof e&&((0,i.isHexString)(e)||"-"===e[0]&&(0,i.isHexString)(e.substring(1))))return p.from(e)}return c.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function y(e){if("string"!==typeof e)return y(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&c.throwArgumentError("invalid hex","value",e),"0x00"===(e=y(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 m(e){return p.from(y(e))}function g(e){const t=p.from(e).toHexString();return"-"===t[0]?new u("-"+t.substring(3),16):new u(t.substring(2),16)}function v(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),c.throwError(e,a.Logger.errors.NUMERIC_FAULT,n)}function b(e){return new u(e,36).toString(16)}function w(e){return new u(e,16).toString(36)}},20956:(e,t,r)=>{"use strict";r.d(t,{I3:()=>g,gY:()=>m,gn:()=>p,gs:()=>y});var n=r(89106),o=r(14589),i=r(76700),a=r(2776);const s=new o.Logger(i.r),u={},c=a.gH.from(0),l=a.gH.from(-1);function f(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),s.throwError(e,o.Logger.errors.NUMERIC_FAULT,i)}let d="0";for(;d.length<256;)d+=d;function h(e){if("number"!==typeof e)try{e=a.gH.from(e).toNumber()}catch(t){}return"number"===typeof e&&e>=0&&e<=256&&!(e%1)?"1"+d.substring(0,e):s.throwArgumentError("invalid decimal size","decimals",e)}function p(e,t){null==t&&(t=0);const r=h(t),n=(e=a.gH.from(e)).lt(c);n&&(e=e.mul(l));let o=e.mod(r).toString();for(;o.length2&&s.throwArgumentError("too many decimal points","value",e);let i=o[0],u=o[1];for(i||(i="0"),u||(u="0");"0"===u[u.length-1];)u=u.substring(0,u.length-1);for(u.length>r.length-1&&f("fractional component exceeds decimals","underflow","parseFixed"),""===u&&(u="0");u.lengthnull==e[t]?n:(typeof e[t]!==r&&s.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=o("signed","boolean",t),r=o("width","number",r),n=o("decimals","number",n)}return r%8&&s.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&s.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new m(u,t,r,n)}}class g{constructor(e,t,r,n){e!==u&&s.throwError("cannot use FixedNumber constructor; use FixedNumber.from",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&s.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=y(this._value,this.format.decimals),r=y(e._value,e.format.decimals);return g.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=y(this._value,this.format.decimals),r=y(e._value,e.format.decimals);return g.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=y(this._value,this.format.decimals),r=y(e._value,e.format.decimals);return g.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=y(this._value,this.format.decimals),r=y(e._value,e.format.decimals);return g.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=g.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(v.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=g.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(v.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)&&s.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=g.from("1"+d.substring(0,e),this.format),n=b.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&s.throwArgumentError("invalid byte width","width",e);const t=a.gH.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,n.hexZeroPad)(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return g.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||(0,a.YR)(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),g.fromString(p(e,t),m.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=m.from(t),o=y(e,r.decimals);!r.signed&&o.lt(c)&&f("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=o.toTwos(r.width).toHexString():(i=o.toHexString(),i=(0,n.hexZeroPad)(i,r.width/8));const a=p(o,r.decimals);return new g(u,i,a,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=m.from(t);if((0,n.arrayify)(e).length>r.width/8)throw new Error("overflow");let o=a.gH.from(e);r.signed&&(o=o.fromTwos(r.width));const i=o.toTwos((r.signed?0:1)+r.width).toHexString(),s=p(o,r.decimals);return new g(u,i,s,r)}static from(e,t){if("string"===typeof e)return g.fromString(e,t);if((0,n.isBytes)(e))return g.fromBytes(e,t);try{return g.fromValue(e,0,t)}catch(r){if(r.code!==o.Logger.errors.INVALID_ARGUMENT)throw r}return s.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const v=g.from(1),b=g.from("0.5")},78027:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BigNumber:()=>n.gH,FixedFormat:()=>o.gY,FixedNumber:()=>o.I3,_base16To36:()=>n.ii,_base36To16:()=>n.Os,formatFixed:()=>o.gn,parseFixed:()=>o.gs});var n=r(2776),o=r(20956)},89106:(e,t,r)=>{"use strict";r.r(t),r.d(t,{arrayify:()=>c,concat:()=>l,hexConcat:()=>v,hexDataLength:()=>m,hexDataSlice:()=>g,hexStripZeros:()=>w,hexValue:()=>b,hexZeroPad:()=>A,hexlify:()=>y,isBytes:()=>u,isBytesLike:()=>a,isHexString:()=>h,joinSignature:()=>k,splitSignature:()=>S,stripZeros:()=>f,zeroPad:()=>d});const n=new(r(14589).Logger)("bytes/5.7.0");function o(e){return!!e.toHexString}function i(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return i(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){return h(e)&&!(e.length%2)||u(e)}function s(e){return"number"===typeof e&&e==e&&e%1===0}function u(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"===typeof e)return!1;if(!s(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function c(e,t){if(t||(t={}),"number"===typeof e){n.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),i(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),o(e)&&(e=e.toHexString()),h(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":n.throwArgumentError("hex data is odd-length","value",e));const o=[];for(let e=0;ec(e))),r=t.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(r);return t.reduce(((e,t)=>(n.set(t,e),e+t.length)),0),i(n)}function f(e){let t=c(e);if(0===t.length)return t;let r=0;for(;rt&&n.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),i(r)}function h(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const p="0123456789abcdef";function y(e,t){if(t||(t={}),"number"===typeof e){n.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=p[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),o(e))return e.toHexString();if(h(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(u(e)){let t="0x";for(let r=0;r>4]+p[15&n]}return t}return n.throwArgumentError("invalid hexlify value","value",e)}function m(e){if("string"!==typeof e)e=y(e);else if(!h(e)||e.length%2)return null;return(e.length-2)/2}function g(e,t,r){return"string"!==typeof e?e=y(e):(!h(e)||e.length%2)&&n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function v(e){let t="0x";return e.forEach((e=>{t+=y(e).substring(2)})),t}function b(e){const t=w(y(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function w(e){"string"!==typeof e&&(e=y(e)),h(e)||n.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function S(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(a(e)){let r=c(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=y(r.slice(0,32)),t.s=y(r.slice(32,64))):65===r.length?(t.r=y(r.slice(0,32)),t.s=y(r.slice(32,64)),t.v=r[64]):n.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=y(r.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 r=d(c(t._vs),32);t._vs=y(r);const o=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=o:t.recoveryParam!==o&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=y(r);null==t.s?t.s=i:t.s!==i&&n.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?n.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 r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&n.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&h(t.r)?t.r=A(t.r,32):n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&h(t.s)?t.s=A(t.s,32):n.throwArgumentError("signature missing or invalid s","signature",e);const r=c(t.s);r[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const o=y(r);t._vs&&(h(t._vs)||n.throwArgumentError("signature invalid _vs","signature",e),t._vs=A(t._vs,32)),null==t._vs?t._vs=o:t._vs!==o&&n.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function k(e){return y(l([(e=S(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},1953:(e,t,r)=>{"use strict";r.d(t,{j:()=>n});const n="0x0000000000000000000000000000000000000000000000000000000000000000"},63651:function(e){"use strict";!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function o(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function i(e){return new Uint8Array(e)}function a(e,t,r,n,o){null==n&&null==o||(e=e.slice?e.slice(n,o):Array.prototype.slice.call(e,n,o)),t.set(e,r)}var s={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},u=function(){var e="0123456789abcdef";return{toBytes:function(e){for(var t=[],r=0;r>4]+e[15&o])}return r.join("")}}}(),c={16:10,24:12,32:14},l=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],f=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],d=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],h=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],p=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],y=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],m=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],g=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],b=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],A=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],S=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],k=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],_=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function E(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=i[t],this._Kd[e-r][t%4]=i[t];for(var a,s=0,u=o;u>16&255]<<24^f[a>>8&255]<<16^f[255&a]<<8^f[a>>24&255]^l[s]<<24,s+=1,8!=o)for(t=1;t>8&255]<<8^f[a>>16&255]<<16^f[a>>24&255]<<24;for(t=o/2+1;t>2,h=u%4,this._Ke[d][h]=i[t],this._Kd[e-d][h]=i[t++],u++}for(var d=1;d>24&255]^S[a>>16&255]^k[a>>8&255]^_[255&a]},x.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=E(e),o=0;o<4;o++)n[o]^=this._Ke[0][o];for(var a=1;a>24&255]^p[n[(o+1)%4]>>16&255]^y[n[(o+2)%4]>>8&255]^m[255&n[(o+3)%4]]^this._Ke[a][o];n=r.slice()}var s,u=i(16);for(o=0;o<4;o++)s=this._Ke[t][o],u[4*o]=255&(f[n[o]>>24&255]^s>>24),u[4*o+1]=255&(f[n[(o+1)%4]>>16&255]^s>>16),u[4*o+2]=255&(f[n[(o+2)%4]>>8&255]^s>>8),u[4*o+3]=255&(f[255&n[(o+3)%4]]^s);return u},x.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=E(e),o=0;o<4;o++)n[o]^=this._Kd[0][o];for(var a=1;a>24&255]^v[n[(o+3)%4]>>16&255]^b[n[(o+2)%4]>>8&255]^w[255&n[(o+1)%4]]^this._Kd[a][o];n=r.slice()}var s,u=i(16);for(o=0;o<4;o++)s=this._Kd[t][o],u[4*o]=255&(d[n[o]>>24&255]^s>>24),u[4*o+1]=255&(d[n[(o+3)%4]>>16&255]^s>>16),u[4*o+2]=255&(d[n[(o+2)%4]>>8&255]^s>>8),u[4*o+3]=255&(d[255&n[(o+1)%4]]^s);return u};var T=function(e){if(!(this instanceof T))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new x(e)};T.prototype.encrypt=function(e){if((e=o(e)).length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),n=0;n=0;--t)this._counter[t]=e%256,e>>=8},I.prototype.setBytes=function(e){if(16!=(e=o(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},I.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var C=function(e,t){if(!(this instanceof C))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof I||(t=new I(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new x(e)};C.prototype.encrypt=function(e){for(var t=o(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n{"use strict";r.r(t),r.d(t,{keccak256:()=>a});var n=r(32161),o=r.n(n),i=r(89106);function a(e){return"0x"+o().keccak_256((0,i.arrayify)(e))}},14589:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ErrorCode:()=>l,LogLevel:()=>c,Logger:()=>d});let n=!1,o=!1;const i={debug:1,default:2,info:2,warning:3,error:4,off:5};let a=i.default,s=null;const u=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){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 c,l;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(c||(c={})),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"}(l||(l={}));const f="0123456789abcdef";class d{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==i[r]&&this.throwArgumentError("invalid log level name","logLevel",e),a>i[r]||console.log.apply(console,t)}debug(){for(var e=arguments.length,t=new Array(e),r=0;r{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e>4],r+=f[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(s){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push("code=".concat(t)),n.push("version=".concat(this.version));const i=e;let a="";switch(t){case l.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 l.CALL_EXCEPTION:case l.INSUFFICIENT_FUNDS:case l.MISSING_NEW:case l.NONCE_EXPIRED:case l.REPLACEMENT_UNDERPRICED:case l.TRANSACTION_REPLACED:case l.UNPREDICTABLE_GAS_LIMIT:a=t}a&&(e+=" [ See: https://links.ethers.org/v5-errors-"+a+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const s=new Error(e);return s.reason=i,s.code=t,Object.keys(r).forEach((function(e){s[e]=r[e]})),s}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,d.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),u&&this.throwError("platform missing String.prototype.normalize",d.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:u})}checkSafeUint53(e,t){"number"===typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,d.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,d.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,d.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",d.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",d.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",d.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return s||(s=new d("logger/5.7.0")),s}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",d.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),n){if(!e)return;this.globalLogger().throwError("error censorship permanent",d.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}o=!!e,n=!!t}static setLogLevel(e){const t=i[e.toLowerCase()];null!=t?a=t:d.globalLogger().warn("invalid log level - "+e)}static from(e){return new d(e)}}d.errors=l,d.levels=c},3678:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Description:()=>y,checkProperties:()=>c,deepCopy:()=>p,defineReadOnly:()=>a,getStatic:()=>s,resolveProperties:()=>u,shallowCopy:()=>l});var n=r(14589);var o=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const i=new n.Logger("properties/5.7.0");function a(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function s(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!==typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function u(e){return o(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function c(e,t){e&&"object"===typeof e||i.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||i.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function l(e){const t={};for(const r in e)t[r]=e[r];return t}const f={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function d(e){if(void 0===e||null===e||f[typeof e])return!0;if(Array.isArray(e)||"object"===typeof e){if(!Object.isFrozen(e))return!1;const r=Object.keys(e);for(let n=0;np(e))));if("object"===typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&a(t,r,p(n))}return t}return i.throwArgumentError("Cannot deepCopy ".concat(typeof e),"object",e)}function p(e){return h(e)}class y{constructor(e){for(const t in e)this[t]=p(e[t])}}},82844:(e,t,r)=>{"use strict";r.d(t,{R:()=>a,V:()=>s});var n=r(1953),o=r(89106),i=r(2614);function a(e){const t=(0,i.YW)(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,o.hexlify)((0,o.concat)([t,n.j]).slice(0,32))}function s(e){const t=(0,o.arrayify)(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return(0,i._v)(t.slice(0,r))}},72680:(e,t,r)=>{"use strict";r.d(t,{j9:()=>p});var n=r(2614);function o(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach((e=>{let o=e.split(":");r+=parseInt(o[0],16),n[r]=t(o[1])})),n}function i(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:n,h:t}}))}function a(e,t){let r=0;for(let n=0;n=r&&e<=r+o.h&&(e-r)%(o.d||1)===0){if(o.e&&-1!==o.e.indexOf(e-r))continue;return o}}return null}const s=i("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),u="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),c=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],l=o("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),f=o("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),d=o("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!==0)throw new Error("bad data");let t=[];for(let r=0;r{if(u.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=a(e,c);if(t)return[e+t.s];let r=l[e];if(r)return r;let n=f[e];return n?[e+n[0]]:d[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=(0,n.dg)((0,n.H5)(t),n.dz.NFKC),t.forEach((e=>{if(a(e,h))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(a(e,s))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let o=(0,n.H5)(t);if("-"===o.substring(0,1)||"--"===o.substring(2,4)||"-"===o.substring(o.length-1))throw new Error("invalid hyphen");return o}},27458:(e,t,r)=>{"use strict";r.r(t),r.d(t,{UnicodeNormalizationForm:()=>i.dz,Utf8ErrorFuncs:()=>i.d5,Utf8ErrorReason:()=>i._E,_toEscapedUtf8String:()=>i.Wj,formatBytes32String:()=>n.R,nameprep:()=>o.j9,parseBytes32String:()=>n.V,toUtf8Bytes:()=>i.YW,toUtf8CodePoints:()=>i.dg,toUtf8String:()=>i._v});var n=r(82844),o=r(72680),i=r(2614)},2614:(e,t,r)=>{"use strict";r.d(t,{dz:()=>i,d5:()=>u,_E:()=>a,Wj:()=>d,H5:()=>h,YW:()=>l,dg:()=>y,_v:()=>p});var n=r(89106);const o=new(r(14589).Logger)("strings/5.7.0");var i,a;function s(e,t,r,n,o){if(e===a.BAD_PREFIX||e===a.UNEXPECTED_CONTINUE){let e=0;for(let n=t+1;n>6===2;n++)e++;return e}return e===a.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(i||(i={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(a||(a={}));const u=Object.freeze({error:function(e,t,r,n,i){return o.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",r)},ignore:s,replace:function(e,t,r,n,o){return e===a.OVERLONG?(n.push(o),0):(n.push(65533),s(e,t,r))}});function c(e,t){null==t&&(t=u.error),e=(0,n.arrayify)(e);const r=[];let o=0;for(;o>7===0){r.push(n);continue}let i=null,s=null;if(192===(224&n))i=1,s=127;else if(224===(240&n))i=2,s=2047;else{if(240!==(248&n)){o+=t(128===(192&n)?a.UNEXPECTED_CONTINUE:a.BAD_PREFIX,o-1,e,r);continue}i=3,s=65535}if(o-1+i>=e.length){o+=t(a.OVERRUN,o-1,e,r);continue}let u=n&(1<<8-i-1)-1;for(let c=0;c1114111?o+=t(a.OUT_OF_RANGE,o-1-i,e,r,u):u>=55296&&u<=57343?o+=t(a.UTF16_SURROGATE,o-1-i,e,r,u):u<=s?o+=t(a.OVERLONG,o-1-i,e,r,u):r.push(u))}return r}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.current;t!=i.current&&(o.checkNormalize(),e=e.normalize(t));let r=[];for(let n=0;n>6|192),r.push(63&t|128);else if(55296==(64512&t)){n++;const o=e.charCodeAt(n);if(n>=e.length||56320!==(64512&o))throw new Error("invalid utf-8 string");const i=65536+((1023&t)<<10)+(1023&o);r.push(i>>18|240),r.push(i>>12&63|128),r.push(i>>6&63|128),r.push(63&i|128)}else r.push(t>>12|224),r.push(t>>6&63|128),r.push(63&t|128)}return(0,n.arrayify)(r)}function f(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function d(e,t){return'"'+c(e,t).map((e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?f(e):f(55296+((e-=65536)>>10&1023))+f(56320+(1023&e))})).join("")+'"'}function h(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function p(e,t){return h(c(e,t))}function y(e){return c(l(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.current))}},89611:(e,t,r)=>{"use strict";var n=r(24994);t.A=void 0;var o=n(r(40039)),i=r(70579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu")},40039:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.createSvgIcon}});var n=r(24962)},25881:(e,t)=>{"use strict";var r,n=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),c=Symbol.for("react.context"),l=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function g(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case i:case s:case a:case d:case h:return e;default:switch(e=e&&e.$$typeof){case l:case c:case f:case y:case p:case u:return e;default:return t}}case o:return t}}}r=Symbol.for("react.module.reference")},30805:(e,t,r)=>{"use strict";r(25881)},88279:(e,t,r)=>{"use strict";r.d(t,{A:()=>F});var n=r(58168),o=r(98587),i=r(6632),a=r(43216),s=r(37758),u=r(58812),c=r(18280);var l=r(67266);const f={black:"#000",white:"#fff"},d={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},h={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},p={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},y={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},m={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},g={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},v={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},b=["mode","contrastThreshold","tonalOffset"],w={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:f.white,default:f.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},A={text:{primary:f.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:f.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function S(e,t,r,n){const o=n.light||n,i=n.dark||1.5*n;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:"light"===t?e.light=(0,l.a)(e.main,o):"dark"===t&&(e.dark=(0,l.e$)(e.main,i)))}function k(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:s=.2}=e,u=(0,o.A)(e,b),c=e.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:m[200],light:m[50],dark:m[400]}:{main:m[700],light:m[400],dark:m[800]}}(t),k=e.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:h[200],light:h[50],dark:h[400]}:{main:h[500],light:h[300],dark:h[700]}}(t),_=e.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:p[500],light:p[300],dark:p[700]}:{main:p[700],light:p[400],dark:p[800]}}(t),E=e.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:g[400],light:g[300],dark:g[700]}:{main:g[700],light:g[500],dark:g[900]}}(t),x=e.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:v[400],light:v[300],dark:v[700]}:{main:v[800],light:v[500],dark:v[900]}}(t),T=e.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:y[400],light:y[300],dark:y[700]}:{main:"#ed6c02",light:y[500],dark:y[900]}}(t);function P(e){return(0,l.eM)(e,A.text.primary)>=r?A.text.primary:w.text.primary}const O=e=>{let{color:t,name:r,mainShade:o=500,lightShade:a=300,darkShade:u=700}=e;if(t=(0,n.A)({},t),!t.main&&t[o]&&(t.main=t[o]),!t.hasOwnProperty("main"))throw new Error((0,i.A)(11,r?" (".concat(r,")"):"",o));if("string"!==typeof t.main)throw new Error((0,i.A)(12,r?" (".concat(r,")"):"",JSON.stringify(t.main)));return S(t,"light",a,s),S(t,"dark",u,s),t.contrastText||(t.contrastText=P(t.main)),t},R={dark:A,light:w};return(0,a.A)((0,n.A)({common:(0,n.A)({},f),mode:t,primary:O({color:c,name:"primary"}),secondary:O({color:k,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:O({color:_,name:"error"}),warning:O({color:T,name:"warning"}),info:O({color:E,name:"info"}),success:O({color:x,name:"success"}),grey:d,contrastThreshold:r,getContrastText:P,augmentColor:O,tonalOffset:s},R[t]),u)}const _=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];const E={textTransform:"uppercase"},x='"Roboto", "Helvetica", "Arial", sans-serif';function T(e,t){const r="function"===typeof t?t(e):t,{fontFamily:i=x,fontSize:s=14,fontWeightLight:u=300,fontWeightRegular:c=400,fontWeightMedium:l=500,fontWeightBold:f=700,htmlFontSize:d=16,allVariants:h,pxToRem:p}=r,y=(0,o.A)(r,_);const m=s/14,g=p||(e=>"".concat(e/d*m,"rem")),v=(e,t,r,o,a)=>{return(0,n.A)({fontFamily:i,fontWeight:e,fontSize:g(t),lineHeight:r},i===x?{letterSpacing:"".concat((s=o/t,Math.round(1e5*s)/1e5),"em")}:{},a,h);var s},b={h1:v(u,96,1.167,-1.5),h2:v(u,60,1.2,-.5),h3:v(c,48,1.167,0),h4:v(c,34,1.235,.25),h5:v(c,24,1.334,0),h6:v(l,20,1.6,.15),subtitle1:v(c,16,1.75,.15),subtitle2:v(l,14,1.57,.1),body1:v(c,16,1.5,.15),body2:v(c,14,1.43,.15),button:v(l,14,1.75,.4,E),caption:v(c,12,1.66,.4),overline:v(c,12,2.66,1,E),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return(0,a.A)((0,n.A)({htmlFontSize:d,pxToRem:g,fontFamily:i,fontSize:s,fontWeightLight:u,fontWeightRegular:c,fontWeightMedium:l,fontWeightBold:f},b),y,{clone:!1})}function P(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}const O=["none",P(0,2,1,-1,0,1,1,0,0,1,3,0),P(0,3,1,-2,0,2,2,0,0,1,5,0),P(0,3,3,-2,0,3,4,0,0,1,8,0),P(0,2,4,-1,0,4,5,0,0,1,10,0),P(0,3,5,-1,0,5,8,0,0,1,14,0),P(0,3,5,-1,0,6,10,0,0,1,18,0),P(0,4,5,-2,0,7,10,1,0,2,16,1),P(0,5,5,-3,0,8,10,1,0,3,14,2),P(0,5,6,-3,0,9,12,1,0,3,16,2),P(0,6,6,-3,0,10,14,1,0,4,18,3),P(0,6,7,-4,0,11,15,1,0,4,20,3),P(0,7,8,-4,0,12,17,2,0,5,22,4),P(0,7,8,-4,0,13,19,2,0,5,24,4),P(0,7,9,-4,0,14,21,2,0,5,26,4),P(0,8,9,-5,0,15,22,2,0,6,28,5),P(0,8,10,-5,0,16,24,2,0,6,30,5),P(0,8,11,-5,0,17,26,2,0,6,32,5),P(0,9,11,-5,0,18,28,2,0,7,34,6),P(0,9,12,-6,0,19,29,2,0,7,36,6),P(0,10,13,-6,0,20,31,3,0,8,38,7),P(0,10,13,-6,0,21,33,3,0,8,40,7),P(0,10,14,-6,0,22,35,3,0,8,42,7),P(0,11,14,-7,0,23,36,3,0,9,44,8),P(0,11,15,-7,0,24,38,3,0,9,46,8)],R=["duration","easing","delay"],I={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},C={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function M(e){return"".concat(Math.round(e),"ms")}function B(e){if(!e)return 0;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}function N(e){const t=(0,n.A)({},I,e.easing),r=(0,n.A)({},C,e.duration);return(0,n.A)({getAutoHeightDuration:B,create:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{duration:i=r.standard,easing:a=t.easeInOut,delay:s=0}=n;(0,o.A)(n,R);return(Array.isArray(e)?e:[e]).map((e=>"".concat(e," ").concat("string"===typeof i?i:M(i)," ").concat(a," ").concat("string"===typeof s?s:M(s)))).join(",")}},e,{easing:t,duration:r})}const L={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},j=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function U(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{mixins:t={},palette:r={},transitions:l={},typography:f={}}=e,d=(0,o.A)(e,j);if(e.vars)throw new Error((0,i.A)(18));const h=k(r),p=(0,c.A)(e);let y=(0,a.A)(p,{mixins:(m=p.breakpoints,g=t,(0,n.A)({toolbar:{minHeight:56,[m.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[m.up("sm")]:{minHeight:64}}},g)),palette:h,shadows:O.slice(),typography:T(h,f),transitions:N(l),zIndex:(0,n.A)({},L)});var m,g;y=(0,a.A)(y,d);for(var v=arguments.length,b=new Array(v>1?v-1:0),w=1;w(0,a.A)(e,t)),y),y.unstable_sxConfig=(0,n.A)({},s.A,null==d?void 0:d.unstable_sxConfig),y.unstable_sx=function(e){return(0,u.A)({sx:e,theme:this})},y}const F=U},15170:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n=(0,r(88279).A)()},13375:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n="$$material"},61475:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(47123);const o=e=>(0,n.A)(e)&&"classes"!==e},47123:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n=function(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}},34535:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>s});var n=r(38052),o=r(15170),i=r(13375),a=r(61475);const s=(0,n.Ay)({themeId:i.A,defaultTheme:o.A,rootShouldForwardProp:a.A})},72876:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(32919),o=r(15170),i=r(13375);function a(e){let{props:t,name:r}=e;return(0,n.A)({props:t,name:r,defaultTheme:o.A,themeId:i.A})}},6803:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n=r(90410).A},59662:(e,t,r)=>{"use strict";r.d(t,{A:()=>b});var n=r(58168),o=r(65043),i=r(98587),a=r(58387),s=r(68606),u=r(6803),c=r(72876),l=r(34535),f=r(57056),d=r(32400);function h(e){return(0,d.Ay)("MuiSvgIcon",e)}(0,f.A)("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);var p=r(70579);const y=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],m=(0,l.Ay)("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,"inherit"!==r.color&&t["color".concat((0,u.A)(r.color))],t["fontSize".concat((0,u.A)(r.fontSize))]]}})((e=>{let{theme:t,ownerState:r}=e;var n,o,i,a,s,u,c,l,f,d,h,p,y;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:r.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:null==(n=t.transitions)||null==(o=n.create)?void 0:o.call(n,"fill",{duration:null==(i=t.transitions)||null==(i=i.duration)?void 0:i.shorter}),fontSize:{inherit:"inherit",small:(null==(a=t.typography)||null==(s=a.pxToRem)?void 0:s.call(a,20))||"1.25rem",medium:(null==(u=t.typography)||null==(c=u.pxToRem)?void 0:c.call(u,24))||"1.5rem",large:(null==(l=t.typography)||null==(f=l.pxToRem)?void 0:f.call(l,35))||"2.1875rem"}[r.fontSize],color:null!=(d=null==(h=(t.vars||t).palette)||null==(h=h[r.color])?void 0:h.main)?d:{action:null==(p=(t.vars||t).palette)||null==(p=p.action)?void 0:p.active,disabled:null==(y=(t.vars||t).palette)||null==(y=y.action)?void 0:y.disabled,inherit:void 0}[r.color]}})),g=o.forwardRef((function(e,t){const r=(0,c.A)({props:e,name:"MuiSvgIcon"}),{children:l,className:f,color:d="inherit",component:g="svg",fontSize:v="medium",htmlColor:b,inheritViewBox:w=!1,titleAccess:A,viewBox:S="0 0 24 24"}=r,k=(0,i.A)(r,y),_=o.isValidElement(l)&&"svg"===l.type,E=(0,n.A)({},r,{color:d,component:g,fontSize:v,instanceFontSize:e.fontSize,inheritViewBox:w,viewBox:S,hasSvgAsChild:_}),x={};w||(x.viewBox=S);const T=(e=>{const{color:t,fontSize:r,classes:n}=e,o={root:["root","inherit"!==t&&"color".concat((0,u.A)(t)),"fontSize".concat((0,u.A)(r))]};return(0,s.A)(o,h,n)})(E);return(0,p.jsxs)(m,(0,n.A)({as:g,className:(0,a.A)(T.root,f),focusable:"false",color:b,"aria-hidden":!A||void 0,role:A?"img":void 0,ref:t},x,k,_&&l.props,{ownerState:E,children:[_?l.props.children:l,A?(0,p.jsx)("title",{children:A}):null]}))}));g.muiName="SvgIcon";const v=g;function b(e,t){function r(r,o){return(0,p.jsx)(v,(0,n.A)({"data-testid":"".concat(t,"Icon"),ref:o},r,{children:e}))}return r.muiName=v.muiName,o.memo(o.forwardRef(r))}},80950:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n=r(76440).A},24962:(e,t,r)=>{"use strict";r.r(t),r.d(t,{capitalize:()=>o.A,createChainedFunction:()=>i,createSvgIcon:()=>a.A,debounce:()=>s.A,deprecatedPropType:()=>u,isMuiElement:()=>c.A,ownerDocument:()=>l.A,ownerWindow:()=>f.A,requirePropFactory:()=>d,setRef:()=>h,unstable_ClassNameGenerator:()=>A,unstable_useEnhancedEffect:()=>p.A,unstable_useId:()=>y,unsupportedProp:()=>m,useControlled:()=>g.A,useEventCallback:()=>v.A,useForkRef:()=>b.A,useIsFocusVisible:()=>w.A});var n=r(25430),o=r(6803);const i=r(44708).A;var a=r(59662),s=r(80950);const u=function(e,t){return()=>null};var c=r(90154),l=r(22427),f=r(36078);r(58168);const d=function(e,t){return()=>null};const h=r(69184).A;var p=r(55013);const y=r(20992).A;const m=function(e,t,r,n,o){return null};var g=r(75242),v=r(93319),b=r(95849),w=r(82191);const A={configure:e=>{n.A.configure(e)}}},90154:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(65043);const o=function(e,t){var r,o;return n.isValidElement(e)&&-1!==t.indexOf(null!=(r=e.type.muiName)?r:null==(o=e.type)||null==(o=o._payload)||null==(o=o.value)?void 0:o.muiName)}},22427:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n=r(22144).A},36078:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n=r(46288).A},75242:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(65043);const o=function(e){let{controlled:t,default:r,name:o,state:i="value"}=e;const{current:a}=n.useRef(void 0!==t),[s,u]=n.useState(r);return[a?t:s,n.useCallback((e=>{a||u(e)}),[])]}},55013:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n=r(63844).A},93319:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n=r(24626).A},95849:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n=r(47042).A},82191:(e,t,r)=>{"use strict";r.d(t,{A:()=>h});var n=r(65043),o=r(31140);let i=!0,a=!1;const s=new o.E,u={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function c(e){e.metaKey||e.altKey||e.ctrlKey||(i=!0)}function l(){i=!1}function f(){"hidden"===this.visibilityState&&a&&(i=!0)}function d(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch(r){}return i||function(e){const{type:t,tagName:r}=e;return!("INPUT"!==r||!u[t]||e.readOnly)||"TEXTAREA"===r&&!e.readOnly||!!e.isContentEditable}(t)}const h=function(){const e=n.useCallback((e=>{var t;null!=e&&((t=e.ownerDocument).addEventListener("keydown",c,!0),t.addEventListener("mousedown",l,!0),t.addEventListener("pointerdown",l,!0),t.addEventListener("touchstart",l,!0),t.addEventListener("visibilitychange",f,!0))}),[]),t=n.useRef(!1);return{isFocusVisibleRef:t,onFocus:function(e){return!!d(e)&&(t.current=!0,!0)},onBlur:function(){return!!t.current&&(a=!0,s.start(100,(()=>{a=!1})),t.current=!1,!0)},ref:e}}},70869:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});r(65043);var n=r(83290),o=r(70579);function i(e){const{styles:t,defaultTheme:r={}}=e,i="function"===typeof t?e=>{return t(void 0===(n=e)||null===n||0===Object.keys(n).length?r:e);var n}:t;return(0,o.jsx)(n.mL,{styles:i})}},13174:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalStyles:()=>k.A,StyledEngineProvider:()=>S,ThemeContext:()=>u.T,css:()=>v.AH,default:()=>_,internal_processStyles:()=>E,keyframes:()=>v.i7});var n=r(58168),o=r(65043),i=r(30918),a=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,s=(0,i.A)((function(e){return a.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),u=r(55756),c=r(81722),l=r(12830),f=r(69436),d=s,h=function(e){return"theme"!==e},p=function(e){return"string"===typeof e&&e.charCodeAt(0)>96?d:h},y=function(e,t,r){var n;if(t){var o=t.shouldForwardProp;n=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!==typeof n&&r&&(n=e.__emotion_forwardProp),n},m=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return(0,c.SF)(t,r,n),(0,f.s)((function(){return(0,c.sk)(t,r,n)})),null},g=function e(t,r){var i,a,s=t.__emotion_real===t,f=s&&t.__emotion_base||t;void 0!==r&&(i=r.label,a=r.target);var d=y(t,r,s),h=d||p(f),g=!h("as");return function(){var v=arguments,b=s&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==i&&b.push("label:"+i+";"),null==v[0]||void 0===v[0].raw)b.push.apply(b,v);else{0,b.push(v[0][0]);for(var w=v.length,A=1;A{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}},67266:(e,t,r)=>{"use strict";var n=r(24994);t.X4=h,t.e$=p,t.eM=function(e,t){const r=d(e),n=d(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)},t.a=y;var o=n(r(27245)),i=n(r(25383));function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return(0,i.default)(e,t,r)}function s(e){e=e.slice(1);const t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g");let r=e.match(t);return r&&1===r[0].length&&(r=r.map((e=>e+e))),r?"rgb".concat(4===r.length?"a":"","(").concat(r.map(((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3)).join(", "),")"):""}function u(e){if(e.type)return e;if("#"===e.charAt(0))return u(s(e));const t=e.indexOf("("),r=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(r))throw new Error((0,o.default)(9,e));let n,i=e.substring(t+1,e.length-1);if("color"===r){if(i=i.split(" "),n=i.shift(),4===i.length&&"/"===i[3].charAt(0)&&(i[3]=i[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(n))throw new Error((0,o.default)(10,n))}else i=i.split(",");return i=i.map((e=>parseFloat(e))),{type:r,values:i,colorSpace:n}}const c=e=>{const t=u(e);return t.values.slice(0,3).map(((e,r)=>-1!==t.type.indexOf("hsl")&&0!==r?"".concat(e,"%"):e)).join(" ")};function l(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return-1!==t.indexOf("rgb")?n=n.map(((e,t)=>t<3?parseInt(e,10):e)):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),n=-1!==t.indexOf("color")?"".concat(r," ").concat(n.join(" ")):"".concat(n.join(", ")),"".concat(t,"(").concat(n,")")}function f(e){e=u(e);const{values:t}=e,r=t[0],n=t[1]/100,o=t[2]/100,i=n*Math.min(o,1-o),a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+r/30)%12;return o-i*Math.max(Math.min(t-3,9-t,1),-1)};let s="rgb";const c=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===e.type&&(s+="a",c.push(t[3])),l({type:s,values:c})}function d(e){let t="hsl"===(e=u(e)).type||"hsla"===e.type?u(f(e)).values:e.values;return t=t.map((t=>("color"!==e.type&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4))),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function h(e,t){return e=u(e),t=a(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]="/".concat(t):e.values[3]=t,l(e)}function p(e,t){if(e=u(e),t=a(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(let r=0;r<3;r+=1)e.values[r]*=1-t;return l(e)}function y(e,t){if(e=u(e),t=a(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(-1!==e.type.indexOf("color"))for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return l(e)}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return d(e)>.5?p(e,t):y(e,t)}},38052:(e,t,r)=>{"use strict";var n=r(24994);t.Ay=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:t,defaultTheme:r=y,rootShouldForwardProp:n=p,slotShouldForwardProp:u=p}=e,l=e=>(0,c.default)((0,o.default)({},e,{theme:g((0,o.default)({},e,{defaultTheme:r,themeId:t}))}));return l.__mui_systemSx=!0,function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,a.internal_processStyles)(e,(e=>e.filter((e=>!(null!=e&&e.__mui_systemSx)))));const{name:f,slot:h,skipVariantsResolver:y,skipSx:w,overridesResolver:A=v(m(h))}=c,S=(0,i.default)(c,d),k=void 0!==y?y:h&&"Root"!==h&&"root"!==h||!1,_=w||!1;let E=p;"Root"===h||"root"===h?E=n:h?E=u:function(e){return"string"===typeof e&&e.charCodeAt(0)>96}(e)&&(E=void 0);const x=(0,a.default)(e,(0,o.default)({shouldForwardProp:E,label:undefined},S)),T=e=>"function"===typeof e&&e.__emotion_real!==e||(0,s.isPlainObject)(e)?n=>b(e,(0,o.default)({},n,{theme:g({theme:n.theme,defaultTheme:r,themeId:t})})):e,P=function(n){let i=T(n);for(var a=arguments.length,s=new Array(a>1?a-1:0),u=1;u{const n=g((0,o.default)({},e,{defaultTheme:r,themeId:t}));if(!n.components||!n.components[f]||!n.components[f].styleOverrides)return null;const i=n.components[f].styleOverrides,a={};return Object.entries(i).forEach((t=>{let[r,i]=t;a[r]=b(i,(0,o.default)({},e,{theme:n}))})),A(e,a)})),f&&!k&&c.push((e=>{var n;const i=g((0,o.default)({},e,{defaultTheme:r,themeId:t}));return b({variants:null==i||null==(n=i.components)||null==(n=n[f])?void 0:n.variants},(0,o.default)({},e,{theme:i}))})),_||c.push(l);const d=c.length-s.length;if(Array.isArray(n)&&d>0){const e=new Array(d).fill("");i=[...n,...e],i.raw=[...n.raw,...e]}const h=x(i,...c);return e.muiName&&(h.muiName=e.muiName),h};return x.withConfig&&(P.withConfig=x.withConfig),P}};var o=n(r(94634)),i=n(r(54893)),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=h(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}(r(13174)),s=r(14534),u=(n(r(20578)),n(r(92046)),n(r(24989))),c=n(r(73234));const l=["ownerState"],f=["variants"],d=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(h=function(e){return e?r:t})(e)}function p(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}const y=(0,u.default)(),m=e=>e?e.charAt(0).toLowerCase()+e.slice(1):e;function g(e){let{defaultTheme:t,theme:r,themeId:n}=e;return o=r,0===Object.keys(o).length?t:r[n]||r;var o}function v(e){return e?(t,r)=>r[e]:null}function b(e,t){let{ownerState:r}=t,n=(0,i.default)(t,l);const a="function"===typeof e?e((0,o.default)({ownerState:r},n)):e;if(Array.isArray(a))return a.flatMap((e=>b(e,(0,o.default)({ownerState:r},n))));if(a&&"object"===typeof a&&Array.isArray(a.variants)){const{variants:e=[]}=a;let t=(0,i.default)(a,f);return e.forEach((e=>{let i=!0;"function"===typeof e.props?i=e.props((0,o.default)({ownerState:r},n,r)):Object.keys(e.props).forEach((t=>{(null==r?void 0:r[t])!==e.props[t]&&n[t]!==e.props[t]&&(i=!1)})),i&&(Array.isArray(t)||(t=[t]),t.push("function"===typeof e.style?e.style((0,o.default)({ownerState:r},n,r)):e.style))})),t}return a}},89751:(e,t,r)=>{"use strict";r.d(t,{EU:()=>s,NI:()=>a,iZ:()=>c,kW:()=>l,vf:()=>u,zu:()=>o});var n=r(43216);const o={xs:0,sm:600,md:900,lg:1200,xl:1536},i={keys:["xs","sm","md","lg","xl"],up:e=>"@media (min-width:".concat(o[e],"px)")};function a(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const e=n.breakpoints||i;return t.reduce(((n,o,i)=>(n[e.up(e.keys[i])]=r(t[i]),n)),{})}if("object"===typeof t){const e=n.breakpoints||i;return Object.keys(t).reduce(((n,i)=>{if(-1!==Object.keys(e.values||o).indexOf(i)){n[e.up(i)]=r(t[i],i)}else{const e=i;n[e]=t[e]}return n}),{})}return r(t)}function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t;return(null==(t=e.keys)?void 0:t.reduce(((t,r)=>(t[e.up(r)]={},t)),{}))||{}}function u(e,t){return e.reduce(((e,t)=>{const r=e[t];return(!r||0===Object.keys(r).length)&&delete e[t],e}),t)}function c(e){const t=s(e);for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i(0,n.A)(e,t)),{});return u(Object.keys(t),a)}function l(e){let{values:t,breakpoints:r,base:n}=e;const o=n||function(e,t){if("object"!==typeof e)return{};const r={},n=Object.keys(t);return Array.isArray(e)?n.forEach(((t,n)=>{n{null!=e[t]&&(r[t]=!0)})),r}(t,r),i=Object.keys(o);if(0===i.length)return t;let a;return i.reduce(((e,r,n)=>(Array.isArray(t)?(e[r]=null!=t[n]?t[n]:t[a],a=n):"object"===typeof t?(e[r]=null!=t[r]?t[r]:t[a],a=r):e[r]=t,e)),{})}},89703:(e,t,r)=>{"use strict";function n(e,t){const r=this;if(r.vars&&"function"===typeof r.getColorSchemeSelector){const n=r.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)");return{[n]:t}}return r.palette.mode===e?t:{}}r.d(t,{A:()=>n})},34853:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(98587),o=r(58168);const i=["values","unit","step"],a=e=>{const t=Object.keys(e).map((t=>({key:t,val:e[t]})))||[];return t.sort(((e,t)=>e.val-t.val)),t.reduce(((e,t)=>(0,o.A)({},e,{[t.key]:t.val})),{})};function s(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:s=5}=e,u=(0,n.A)(e,i),c=a(t),l=Object.keys(c);function f(e){const n="number"===typeof t[e]?t[e]:e;return"@media (min-width:".concat(n).concat(r,")")}function d(e){const n="number"===typeof t[e]?t[e]:e;return"@media (max-width:".concat(n-s/100).concat(r,")")}function h(e,n){const o=l.indexOf(n);return"@media (min-width:".concat("number"===typeof t[e]?t[e]:e).concat(r,") and ")+"(max-width:".concat((-1!==o&&"number"===typeof t[l[o]]?t[l[o]]:n)-s/100).concat(r,")")}return(0,o.A)({keys:l,values:c,up:f,down:d,between:h,only:function(e){return l.indexOf(e)+1{"use strict";r.d(t,{A:()=>h});var n=r(58168),o=r(98587),i=r(43216),a=r(34853);const s={borderRadius:4};var u=r(28604);var c=r(58812),l=r(37758),f=r(89703);const d=["breakpoints","palette","spacing","shape"];const h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{breakpoints:t={},palette:r={},spacing:h,shape:p={}}=e,y=(0,o.A)(e,d),m=(0,a.A)(t),g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;const t=(0,u.LX)({spacing:e}),r=function(){for(var e=arguments.length,r=new Array(e),n=0;n{const r=t(e);return"number"===typeof r?"".concat(r,"px"):r})).join(" ")};return r.mui=!0,r}(h);let v=(0,i.A)({breakpoints:m,direction:"ltr",components:{},palette:(0,n.A)({mode:"light"},r),spacing:g,shape:(0,n.A)({},s,p)},y);v.applyStyles=f.A;for(var b=arguments.length,w=new Array(b>1?b-1:0),A=1;A(0,i.A)(e,t)),v),v.unstable_sxConfig=(0,n.A)({},l.A,null==y?void 0:y.unstable_sxConfig),v.unstable_sx=function(e){return(0,c.A)({sx:e,theme:this})},v}},24989:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n.A,private_createBreakpoints:()=>o.A,unstable_applyStyles:()=>i.A});var n=r(18280),o=r(34853),i=r(89703)},13815:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(43216);const o=function(e,t){return t?(0,n.A)(e,t,{clone:!1}):e}},28604:(e,t,r)=>{"use strict";r.d(t,{LX:()=>p,MA:()=>h,_W:()=>y,Lc:()=>v,Ms:()=>b});var n=r(89751),o=r(17162),i=r(13815);const a={m:"margin",p:"padding"},s={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},u={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},c=function(e){const t={};return r=>(void 0===t[r]&&(t[r]=e(r)),t[r])}((e=>{if(e.length>2){if(!u[e])return[e];e=u[e]}const[t,r]=e.split(""),n=a[t],o=s[r]||"";return Array.isArray(o)?o.map((e=>n+e)):[n+o]})),l=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],f=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],d=[...l,...f];function h(e,t,r,n){var i;const a=null!=(i=(0,o.Yn)(e,t,!1))?i:r;return"number"===typeof a?e=>"string"===typeof e?e:a*e:Array.isArray(a)?e=>"string"===typeof e?e:a[e]:"function"===typeof a?a:()=>{}}function p(e){return h(e,"spacing",8)}function y(e,t){if("string"===typeof t||null==t)return t;const r=e(Math.abs(t));return t>=0?r:"number"===typeof r?-r:"-".concat(r)}function m(e,t,r,o){if(-1===t.indexOf(r))return null;const i=function(e,t){return r=>e.reduce(((e,n)=>(e[n]=y(t,r),e)),{})}(c(r),o),a=e[r];return(0,n.NI)(e,a,i)}function g(e,t){const r=p(e.theme);return Object.keys(e).map((n=>m(e,t,n,r))).reduce(i.A,{})}function v(e){return g(e,l)}function b(e){return g(e,f)}function w(e){return g(e,d)}v.propTypes={},v.filterProps=l,b.propTypes={},b.filterProps=f,w.propTypes={},w.filterProps=d},17162:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>s,BO:()=>a,Yn:()=>i});var n=r(90410),o=r(89751);function i(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||"string"!==typeof t)return null;if(e&&e.vars&&r){const r="vars.".concat(t).split(".").reduce(((e,t)=>e&&e[t]?e[t]:null),e);if(null!=r)return r}return t.split(".").reduce(((e,t)=>e&&null!=e[t]?e[t]:null),e)}function a(e,t,r){let n,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r;return n="function"===typeof e?e(r):Array.isArray(e)?e[r]||o:i(e,r)||o,t&&(n=t(n,o,e)),n}const s=function(e){const{prop:t,cssProperty:r=e.prop,themeKey:s,transform:u}=e,c=e=>{if(null==e[t])return null;const c=e[t],l=i(e.theme,s)||{};return(0,o.NI)(e,c,(e=>{let o=a(l,u,e);return e===o&&"string"===typeof e&&(o=a(l,u,"".concat(t).concat("default"===e?"":(0,n.A)(e)),e)),!1===r?o:{[r]:o}}))};return c.propTypes={},c.filterProps=[t],c}},37758:(e,t,r)=>{"use strict";r.d(t,{A:()=>B});var n=r(28604),o=r(17162),i=r(13815);const a=function(){for(var e=arguments.length,t=new Array(e),r=0;r(t.filterProps.forEach((r=>{e[r]=t})),e)),{}),o=e=>Object.keys(e).reduce(((t,r)=>n[r]?(0,i.A)(t,n[r](e)):t),{});return o.propTypes={},o.filterProps=t.reduce(((e,t)=>e.concat(t.filterProps)),[]),o};var s=r(89751);function u(e){return"number"!==typeof e?e:"".concat(e,"px solid")}function c(e,t){return(0,o.Ay)({prop:e,themeKey:"borders",transform:t})}const l=c("border",u),f=c("borderTop",u),d=c("borderRight",u),h=c("borderBottom",u),p=c("borderLeft",u),y=c("borderColor"),m=c("borderTopColor"),g=c("borderRightColor"),v=c("borderBottomColor"),b=c("borderLeftColor"),w=c("outline",u),A=c("outlineColor"),S=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){const t=(0,n.MA)(e.theme,"shape.borderRadius",4,"borderRadius"),r=e=>({borderRadius:(0,n._W)(t,e)});return(0,s.NI)(e,e.borderRadius,r)}return null};S.propTypes={},S.filterProps=["borderRadius"];a(l,f,d,h,p,y,m,g,v,b,S,w,A);const k=e=>{if(void 0!==e.gap&&null!==e.gap){const t=(0,n.MA)(e.theme,"spacing",8,"gap"),r=e=>({gap:(0,n._W)(t,e)});return(0,s.NI)(e,e.gap,r)}return null};k.propTypes={},k.filterProps=["gap"];const _=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=(0,n.MA)(e.theme,"spacing",8,"columnGap"),r=e=>({columnGap:(0,n._W)(t,e)});return(0,s.NI)(e,e.columnGap,r)}return null};_.propTypes={},_.filterProps=["columnGap"];const E=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=(0,n.MA)(e.theme,"spacing",8,"rowGap"),r=e=>({rowGap:(0,n._W)(t,e)});return(0,s.NI)(e,e.rowGap,r)}return null};E.propTypes={},E.filterProps=["rowGap"];a(k,_,E,(0,o.Ay)({prop:"gridColumn"}),(0,o.Ay)({prop:"gridRow"}),(0,o.Ay)({prop:"gridAutoFlow"}),(0,o.Ay)({prop:"gridAutoColumns"}),(0,o.Ay)({prop:"gridAutoRows"}),(0,o.Ay)({prop:"gridTemplateColumns"}),(0,o.Ay)({prop:"gridTemplateRows"}),(0,o.Ay)({prop:"gridTemplateAreas"}),(0,o.Ay)({prop:"gridArea"}));function x(e,t){return"grey"===t?t:e}a((0,o.Ay)({prop:"color",themeKey:"palette",transform:x}),(0,o.Ay)({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:x}),(0,o.Ay)({prop:"backgroundColor",themeKey:"palette",transform:x}));function T(e){return e<=1&&0!==e?"".concat(100*e,"%"):e}const P=(0,o.Ay)({prop:"width",transform:T}),O=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{var r,n;const o=(null==(r=e.theme)||null==(r=r.breakpoints)||null==(r=r.values)?void 0:r[t])||s.zu[t];return o?"px"!==(null==(n=e.theme)||null==(n=n.breakpoints)?void 0:n.unit)?{maxWidth:"".concat(o).concat(e.theme.breakpoints.unit)}:{maxWidth:o}:{maxWidth:T(t)}};return(0,s.NI)(e,e.maxWidth,t)}return null};O.filterProps=["maxWidth"];const R=(0,o.Ay)({prop:"minWidth",transform:T}),I=(0,o.Ay)({prop:"height",transform:T}),C=(0,o.Ay)({prop:"maxHeight",transform:T}),M=(0,o.Ay)({prop:"minHeight",transform:T}),B=((0,o.Ay)({prop:"size",cssProperty:"width",transform:T}),(0,o.Ay)({prop:"size",cssProperty:"height",transform:T}),a(P,O,R,I,C,M,(0,o.Ay)({prop:"boxSizing"})),{border:{themeKey:"borders",transform:u},borderTop:{themeKey:"borders",transform:u},borderRight:{themeKey:"borders",transform:u},borderBottom:{themeKey:"borders",transform:u},borderLeft:{themeKey:"borders",transform:u},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:u},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:S},color:{themeKey:"palette",transform:x},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:x},backgroundColor:{themeKey:"palette",transform:x},p:{style:n.Ms},pt:{style:n.Ms},pr:{style:n.Ms},pb:{style:n.Ms},pl:{style:n.Ms},px:{style:n.Ms},py:{style:n.Ms},padding:{style:n.Ms},paddingTop:{style:n.Ms},paddingRight:{style:n.Ms},paddingBottom:{style:n.Ms},paddingLeft:{style:n.Ms},paddingX:{style:n.Ms},paddingY:{style:n.Ms},paddingInline:{style:n.Ms},paddingInlineStart:{style:n.Ms},paddingInlineEnd:{style:n.Ms},paddingBlock:{style:n.Ms},paddingBlockStart:{style:n.Ms},paddingBlockEnd:{style:n.Ms},m:{style:n.Lc},mt:{style:n.Lc},mr:{style:n.Lc},mb:{style:n.Lc},ml:{style:n.Lc},mx:{style:n.Lc},my:{style:n.Lc},margin:{style:n.Lc},marginTop:{style:n.Lc},marginRight:{style:n.Lc},marginBottom:{style:n.Lc},marginLeft:{style:n.Lc},marginX:{style:n.Lc},marginY:{style:n.Lc},marginInline:{style:n.Lc},marginInlineStart:{style:n.Lc},marginInlineEnd:{style:n.Lc},marginBlock:{style:n.Lc},marginBlockStart:{style:n.Lc},marginBlockEnd:{style:n.Lc},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:k},rowGap:{style:E},columnGap:{style:_},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:T},maxWidth:{style:O},minWidth:{transform:T},height:{transform:T},maxHeight:{transform:T},minHeight:{transform:T},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}})},18698:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(58168),o=r(98587),i=r(43216),a=r(37758);const s=["sx"],u=e=>{var t,r;const n={systemProps:{},otherProps:{}},o=null!=(t=null==e||null==(r=e.theme)?void 0:r.unstable_sxConfig)?t:a.A;return Object.keys(e).forEach((t=>{o[t]?n.systemProps[t]=e[t]:n.otherProps[t]=e[t]})),n};function c(e){const{sx:t}=e,r=(0,o.A)(e,s),{systemProps:a,otherProps:c}=u(r);let l;return l=Array.isArray(t)?[a,...t]:"function"===typeof t?function(){const e=t(...arguments);return(0,i.Q)(e)?(0,n.A)({},a,e):a}:(0,n.A)({},a,t),(0,n.A)({},c,{sx:l})}},73234:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n.A,extendSxProp:()=>o.A,unstable_createStyleFunctionSx:()=>n.k,unstable_defaultSxConfig:()=>i.A});var n=r(58812),o=r(18698),i=r(37758)},58812:(e,t,r)=>{"use strict";r.d(t,{A:()=>l,k:()=>u});var n=r(90410),o=r(13815),i=r(17162),a=r(89751),s=r(37758);function u(){function e(e,t,r,o){const s={[e]:t,theme:r},u=o[e];if(!u)return{[e]:t};const{cssProperty:c=e,themeKey:l,transform:f,style:d}=u;if(null==t)return null;if("typography"===l&&"inherit"===t)return{[e]:t};const h=(0,i.Yn)(r,l)||{};if(d)return d(s);return(0,a.NI)(s,t,(t=>{let r=(0,i.BO)(h,f,t);return t===r&&"string"===typeof t&&(r=(0,i.BO)(h,f,"".concat(e).concat("default"===t?"":(0,n.A)(t)),t)),!1===c?r:{[c]:r}}))}return function t(r){var n;const{sx:i,theme:u={}}=r||{};if(!i)return null;const c=null!=(n=u.unstable_sxConfig)?n:s.A;function l(r){let n=r;if("function"===typeof r)n=r(u);else if("object"!==typeof r)return r;if(!n)return null;const i=(0,a.EU)(u.breakpoints),s=Object.keys(i);let l=i;return Object.keys(n).forEach((r=>{const i=(s=n[r],f=u,"function"===typeof s?s(f):s);var s,f;if(null!==i&&void 0!==i)if("object"===typeof i)if(c[r])l=(0,o.A)(l,e(r,i,u,c));else{const e=(0,a.NI)({theme:u},i,(e=>({[r]:e})));!function(){for(var e=arguments.length,t=new Array(e),r=0;re.concat(Object.keys(t))),[]),o=new Set(n);return t.every((e=>o.size===Object.keys(e).length))}(e,i)?l=(0,o.A)(l,e):l[r]=t({sx:i,theme:u})}else l=(0,o.A)(l,e(r,i,u,c))})),(0,a.vf)(s,l)}return Array.isArray(i)?i.map(l):l(i)}}const c=u();c.filterProps=["sx"];const l=c},45527:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(18280),o=r(67082);const i=(0,n.A)();const a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return(0,o.A)(e)}},32919:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(22018);var o=r(45527);function i(e){let{props:t,name:r,defaultTheme:i,themeId:a}=e,s=(0,o.A)(i);a&&(s=s[a]||s);const u=function(e){const{theme:t,name:r,props:o}=e;return t&&t.components&&t.components[r]&&t.components[r].defaultProps?(0,n.A)(t.components[r].defaultProps,o):o}({theme:s,name:r,props:t});return u}},67082:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(65043),o=r(55756);const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=n.useContext(o.T);return t&&(r=t,0!==Object.keys(r).length)?t:e;var r}},25430:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});const n=e=>e,o=(()=>{let e=n;return{configure(t){e=t},generate:t=>e(t),reset(){e=n}}})()},90410:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(6632);function o(e){if("string"!==typeof e)throw new Error((0,n.A)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},20578:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n.A});var n=r(90410)},47040:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MIN_SAFE_INTEGER,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_SAFE_INTEGER;return Math.max(t,Math.min(e,r))}},25383:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n.A});var n=r(47040)},68606:(e,t,r)=>{"use strict";function n(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const n={};return Object.keys(e).forEach((o=>{n[o]=e[o].reduce(((e,n)=>{if(n){const o=t(n);""!==o&&e.push(o),r&&r[n]&&e.push(r[n])}return e}),[]).join(" ")})),n}r.d(t,{A:()=>n})},44708:(e,t,r)=>{"use strict";function n(){for(var e=arguments.length,t=new Array(e),r=0;rnull==t?e:function(){for(var r=arguments.length,n=new Array(r),o=0;o{}))}r.d(t,{A:()=>n})},76440:(e,t,r)=>{"use strict";function n(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function n(){for(var n=arguments.length,o=new Array(n),i=0;i{e.apply(this,o)}),r)}return n.clear=()=>{clearTimeout(t)},n}r.d(t,{A:()=>n})},43216:(e,t,r)=>{"use strict";r.d(t,{A:()=>a,Q:()=>o});var n=r(58168);function o(e){if("object"!==typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function i(e){if(!o(e))return e;const t={};return Object.keys(e).forEach((r=>{t[r]=i(e[r])})),t}function a(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0};const s=r.clone?(0,n.A)({},e):e;return o(e)&&o(t)&&Object.keys(t).forEach((n=>{"__proto__"!==n&&(o(t[n])&&n in e&&o(e[n])?s[n]=a(e[n],t[n],r):r.clone?s[n]=o(t[n])?i(t[n]):t[n]:s[n]=t[n])})),s}},14534:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n.A,isPlainObject:()=>n.Q});var n=r(43216)},6632:(e,t,r)=>{"use strict";function n(e){let t="https://mui.com/production-error/?code="+e;for(let r=1;rn})},27245:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n.A});var n=r(6632)},32400:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>i});var n=r(25430);const o={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function i(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui";const i=o[t];return i?"".concat(r,"-").concat(i):"".concat(n.A.generate(e),"-").concat(t)}},57056:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(32400);function o(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui";const o={};return t.forEach((t=>{o[t]=(0,n.Ay)(e,t,r)})),o}},92046:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u,getFunctionName:()=>i});var n=r(19565);const o=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function i(e){const t="".concat(e).match(o);return t&&t[1]||""}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.displayName||e.name||i(e)||t}function s(e,t,r){const n=a(t);return e.displayName||(""!==n?"".concat(r,"(").concat(n,")"):r)}function u(e){if(null!=e){if("string"===typeof e)return e;if("function"===typeof e)return a(e,"Component");if("object"===typeof e)switch(e.$$typeof){case n.ForwardRef:return s(e,e.render,"ForwardRef");case n.Memo:return s(e,e.type,"memo");default:return}}}},58609:(e,t)=>{"use strict";var r,n=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),c=Symbol.for("react.context"),l=Symbol.for("react.server_context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function g(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case i:case s:case a:case d:case h:return e;default:switch(e=e&&e.$$typeof){case l:case c:case f:case y:case p:case u:return e;default:return t}}case o:return t}}}r=Symbol.for("react.module.reference"),t.ForwardRef=f,t.Memo=p},19565:(e,t,r)=>{"use strict";e.exports=r(58609)},22144:(e,t,r)=>{"use strict";function n(e){return e&&e.ownerDocument||document}r.d(t,{A:()=>n})},46288:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(22144);function o(e){return(0,n.A)(e).defaultView||window}},22018:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(58168);function o(e,t){const r=(0,n.A)({},t);return Object.keys(e).forEach((i=>{if(i.toString().match(/^(components|slots)$/))r[i]=(0,n.A)({},e[i],r[i]);else if(i.toString().match(/^(componentsProps|slotProps)$/)){const a=e[i]||{},s=t[i];r[i]={},s&&Object.keys(s)?a&&Object.keys(a)?(r[i]=(0,n.A)({},s),Object.keys(a).forEach((e=>{r[i][e]=o(a[e],s[e])}))):r[i]=s:r[i]=a}else void 0===r[i]&&(r[i]=e[i])})),r}},69184:(e,t,r)=>{"use strict";function n(e,t){"function"===typeof e?e(t):e&&(e.current=t)}r.d(t,{A:()=>n})},63844:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(65043);const o="undefined"!==typeof window?n.useLayoutEffect:n.useEffect},24626:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(65043),o=r(63844);const i=function(e){const t=n.useRef(e);return(0,o.A)((()=>{t.current=e})),n.useRef((function(){return(0,t.current)(...arguments)})).current}},47042:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(65043),o=r(69184);function i(){for(var e=arguments.length,t=new Array(e),r=0;rt.every((e=>null==e))?null:e=>{t.forEach((t=>{(0,o.A)(t,e)}))}),t)}},20992:(e,t,r)=>{"use strict";var n;r.d(t,{A:()=>s});var o=r(65043);let i=0;const a=(n||(n=r.t(o,2)))["useId".toString()];function s(e){if(void 0!==a){const t=a();return null!=e?e:t}return function(e){const[t,r]=o.useState(e),n=e||t;return o.useEffect((()=>{null==t&&(i+=1,r("mui-".concat(i)))}),[t]),n}(e)}},31140:(e,t,r)=>{"use strict";r.d(t,{E:()=>a,A:()=>s});var n=r(65043);const o={};const i=[];class a{constructor(){this.currentId=null,this.clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new a}start(e,t){this.clear(),this.currentId=setTimeout((()=>{this.currentId=null,t()}),e)}}function s(){const e=function(e,t){const r=n.useRef(o);return r.current===o&&(r.current=e(t)),r}(a.create).current;var t;return t=e.disposeEffect,n.useEffect(t,i),e}},87250:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, not ".concat(e))}function n(e){if("boolean"!==typeof e)throw new Error("boolean expected, not ".concat(e))}function o(e){return e instanceof Uint8Array||null!=e&&"object"===typeof e&&"Uint8Array"===e.constructor.name}function i(e){if(!o(e))throw new Error("Uint8Array expected");for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n0&&!r.includes(e.length))throw new Error("Uint8Array expected of length ".concat(r,", not of length=").concat(e.length))}function a(e){if("function"!==typeof e||"function"!==typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];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){i(e);const r=t.outputLen;if(e.length{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add5L=t.add5H=t.add4H=t.add4L=t.add3H=t.add3L=t.add=t.rotlBL=t.rotlBH=t.rotlSL=t.rotlSH=t.rotr32L=t.rotr32H=t.rotrBL=t.rotrBH=t.rotrSL=t.rotrSH=t.shrSL=t.shrSH=t.toBig=t.split=t.fromBig=void 0;const r=BigInt(2**32-1),n=BigInt(32);function o(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function i(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;iBigInt(e>>>0)<>>0);t.toBig=a;const s=(e,t,r)=>e>>>r;t.shrSH=s;const u=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=u;const c=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=c;const l=(e,t,r)=>e<<32-r|t>>>r;t.rotrSL=l;const f=(e,t,r)=>e<<64-r|t>>>r-32;t.rotrBH=f;const d=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=d;const h=(e,t)=>t;t.rotr32H=h;const p=(e,t)=>e;t.rotr32L=p;const y=(e,t,r)=>e<>>32-r;t.rotlSH=y;const m=(e,t,r)=>t<>>32-r;t.rotlSL=m;const g=(e,t,r)=>t<>>64-r;t.rotlBH=g;const v=(e,t,r)=>e<>>64-r;function b(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:0|o}}t.rotlBL=v,t.add=b;const w=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=w;const A=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;t.add3H=A;const S=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);t.add4L=S;const k=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0;t.add4H=k;const _=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0);t.add5L=_;const E=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0;t.add5H=E;const x={fromBig:o,split:i,toBig:a,shrSH:s,shrSL:u,rotrSH:c,rotrSL:l,rotrBH:f,rotrBL:d,rotr32H:h,rotr32L:p,rotlSH:y,rotlSL:m,rotlBH:g,rotlBL:v,add:b,add3L:w,add3H:A,add4L:S,add4H:k,add5H:E,add5L:_};t.default=x},57932:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"===typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},67138:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=t.keccakP=void 0;const n=r(87250),o=r(87459),i=r(30684),a=[],s=[],u=[],c=BigInt(0),l=BigInt(1),f=BigInt(2),d=BigInt(7),h=BigInt(256),p=BigInt(113);for(let k=0,_=l,E=1,x=0;k<24;k++){[E,x]=[x,(2*E+3*x)%5],a.push(2*(5*x+E)),s.push((k+1)*(k+2)/2%64);let e=c;for(let t=0;t<7;t++)_=(_<>d)*p)%h,_&f&&(e^=l<<(l<r>32?(0,o.rotlBH)(e,t,r):(0,o.rotlSH)(e,t,r),v=(e,t,r)=>r>32?(0,o.rotlBL)(e,t,r):(0,o.rotlSL)(e,t,r);function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24;const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let n=0;n<10;n++)r[n]=e[n]^e[n+10]^e[n+20]^e[n+30]^e[n+40];for(let n=0;n<10;n+=2){const t=(n+8)%10,o=(n+2)%10,i=r[o],a=r[o+1],s=g(i,a,1)^r[t],u=v(i,a,1)^r[t+1];for(let r=0;r<50;r+=10)e[n+r]^=s,e[n+r+1]^=u}let t=e[2],o=e[3];for(let r=0;r<24;r++){const n=s[r],i=g(t,o,n),u=v(t,o,n),c=a[r];t=e[c],o=e[c+1],e[c]=i,e[c+1]=u}for(let n=0;n<50;n+=10){for(let t=0;t<10;t++)r[t]=e[n+t];for(let t=0;t<10;t++)e[n+t]^=~r[(t+2)%10]&r[(t+4)%10]}e[0]^=y[n],e[1]^=m[n]}r.fill(0)}t.keccakP=b;class w extends i.Hash{constructor(e,t,r){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:24;if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=o,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,n.number)(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,i.u32)(this.state)}keccak(){i.isLE||(0,i.byteSwap32)(this.state32),b(this.state32,this.rounds),i.isLE||(0,i.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,n.exists)(this);const{blockLen:t,state:r}=this,o=(e=(0,i.toBytes)(e)).length;for(let n=0;n=r&&this.keccak();const i=Math.min(r-this.posOut,o-n);e.set(t.subarray(this.posOut,this.posOut+i),n),this.posOut+=i,n+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,n.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,n.output)(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:r,outputLen:n,rounds:o,enableXOF:i}=this;return e||(e=new w(t,r,n,i,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=n,e.enableXOF=i,e.destroyed=this.destroyed,e}}t.Keccak=w;const A=(e,t,r)=>(0,i.wrapConstructor)((()=>new w(t,e,r)));t.sha3_224=A(6,144,28),t.sha3_256=A(6,136,32),t.sha3_384=A(6,104,48),t.sha3_512=A(6,72,64),t.keccak_224=A(1,144,28),t.keccak_256=A(1,136,32),t.keccak_384=A(1,104,48),t.keccak_512=A(1,72,64);const S=(e,t,r)=>(0,i.wrapXOFConstructorWithOpts)((function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new w(t,e,void 0===n.dkLen?r:n.dkLen,!0)}));t.shake128=S(31,168,16),t.shake256=S(31,136,32)},30684:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.byteSwap32=t.byteSwapIfBE=t.byteSwap=t.isLE=t.rotl=t.rotr=t.createView=t.u32=t.u8=t.isBytes=void 0;const n=r(57932),o=r(87250);t.isBytes=function(e){return e instanceof Uint8Array||null!=e&&"object"===typeof e&&"Uint8Array"===e.constructor.name};t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);t.rotr=(e,t)=>e<<32-t|e>>>t;t.rotl=(e,t)=>e<>>32-t>>>0,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];t.byteSwap=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,t.byteSwapIfBE=t.isLE?e=>e:e=>(0,t.byteSwap)(e),t.byteSwap32=function(e){for(let r=0;rt.toString(16).padStart(2,"0")));t.bytesToHex=function(e){(0,o.bytes)(e);let t="";for(let r=0;r=a._0&&e<=a._9?e-a._0:e>=a._A&&e<=a._F?e-(a._A-10):e>=a._a&&e<=a._f?e-(a._a-10):void 0}t.hexToBytes=function(e){if("string"!==typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let o=0,i=0;o{},t.asyncLoop=async function(e,r,n){let o=Date.now();for(let i=0;i=0&&ee().update(c(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(c(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(c(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(n.crypto&&"function"===typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},34742:e=>{"use strict";const t=(e,t)=>{if("string"!==typeof e&&!Array.isArray(e))throw new TypeError("Expected the input to be `string | string[]`");t=Object.assign({pascalCase:!1},t);if(e=Array.isArray(e)?e.map((e=>e.trim())).filter((e=>e.length)).join("-"):e.trim(),0===e.length)return"";if(1===e.length)return t.pascalCase?e.toUpperCase():e.toLowerCase();return e!==e.toLowerCase()&&(e=(e=>{let t=!1,r=!1,n=!1;for(let o=0;ot.toUpperCase())).replace(/\d+(\w|$)/g,(e=>e.toUpperCase())),r=e,t.pascalCase?r.charAt(0).toUpperCase()+r.slice(1):r;var r};e.exports=t,e.exports.default=t},39940:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.map=t.array=t.rustEnum=t.str=t.vecU8=t.tagged=t.vec=t.bool=t.option=t.publicKey=t.i128=t.u128=t.i64=t.u64=t.struct=t.f64=t.f32=t.i32=t.u32=t.i16=t.u16=t.i8=t.u8=void 0;const o=r(23465),i=r(44319),a=n(r(6373));var s=r(23465);Object.defineProperty(t,"u8",{enumerable:!0,get:function(){return s.u8}}),Object.defineProperty(t,"i8",{enumerable:!0,get:function(){return s.s8}}),Object.defineProperty(t,"u16",{enumerable:!0,get:function(){return s.u16}}),Object.defineProperty(t,"i16",{enumerable:!0,get:function(){return s.s16}}),Object.defineProperty(t,"u32",{enumerable:!0,get:function(){return s.u32}}),Object.defineProperty(t,"i32",{enumerable:!0,get:function(){return s.s32}}),Object.defineProperty(t,"f32",{enumerable:!0,get:function(){return s.f32}}),Object.defineProperty(t,"f64",{enumerable:!0,get:function(){return s.f64}}),Object.defineProperty(t,"struct",{enumerable:!0,get:function(){return s.struct}});class u extends o.Layout{constructor(e,t,r){super(e,r),this.blob=o.blob(e),this.signed=t}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=new a.default(this.blob.decode(e,t),10,"le");return this.signed?r.fromTwos(8*this.span).clone():r}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.signed&&(e=e.toTwos(8*this.span)),this.blob.encode(e.toArrayLike(Buffer,"le",this.span),t,r)}}function c(e){return new u(8,!1,e)}t.u64=c,t.i64=function(e){return new u(8,!0,e)},t.u128=function(e){return new u(16,!1,e)},t.i128=function(e){return new u(16,!0,e)};class l extends o.Layout{constructor(e,t,r,n){super(e.span,n),this.layout=e,this.decoder=t,this.encoder=r}decode(e,t){return this.decoder(this.layout.decode(e,t))}encode(e,t,r){return this.layout.encode(this.encoder(e),t,r)}getSpan(e,t){return this.layout.getSpan(e,t)}}t.publicKey=function(e){return new l(o.blob(32),(e=>new i.PublicKey(e)),(e=>e.toBuffer()),e)};class f extends o.Layout{constructor(e,t){super(-1,t),this.layout=e,this.discriminator=o.u8()}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return null===e||void 0===e?this.discriminator.encode(0,t,r):(this.discriminator.encode(1,t,r),this.layout.encode(e,t,r+1)+1)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=this.discriminator.decode(e,t);if(0===r)return null;if(1===r)return this.layout.decode(e,t+1);throw new Error("Invalid option "+this.property)}getSpan(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=this.discriminator.decode(e,t);if(0===r)return 1;if(1===r)return this.layout.getSpan(e,t+1)+1;throw new Error("Invalid option "+this.property)}}function d(e){if(0===e)return!1;if(1===e)return!0;throw new Error("Invalid bool: "+e)}function h(e){return e?1:0}function p(e){const t=o.u32("length"),r=o.struct([t,o.blob(o.offset(t,-t.span),"data")]);return new l(r,(e=>{let{data:t}=e;return t}),(e=>({data:e})),e)}t.option=function(e,t){return new f(e,t)},t.bool=function(e){return new l(o.u8(),d,h,e)},t.vec=function(e,t){const r=o.u32("length"),n=o.struct([r,o.seq(e,o.offset(r,-r.span),"values")]);return new l(n,(e=>{let{values:t}=e;return t}),(e=>({values:e})),t)},t.tagged=function(e,t,r){const n=o.struct([c("tag"),t.replicate("data")]);return new l(n,(function(t){let{tag:r,data:n}=t;if(!r.eq(e))throw new Error("Invalid tag, expected: "+e.toString("hex")+", got: "+r.toString("hex"));return n}),(t=>({tag:e,data:t})),r)},t.vecU8=p,t.str=function(e){return new l(p(),(e=>e.toString("utf-8")),(e=>Buffer.from(e,"utf-8")),e)},t.rustEnum=function(e,t,r){const n=o.union(null!==r&&void 0!==r?r:o.u8(),t);return e.forEach(((e,t)=>n.addVariant(t,e,e.property))),n},t.array=function(e,t,r){const n=o.struct([o.seq(e,t,"values")]);return new l(n,(e=>{let{values:t}=e;return t}),(e=>({values:e})),r)};class y extends o.Layout{constructor(e,t,r){super(e.span+t.span,r),this.keyLayout=e,this.valueLayout=t}decode(e,t){t=t||0;return[this.keyLayout.decode(e,t),this.valueLayout.decode(e,t+this.keyLayout.getSpan(e,t))]}encode(e,t,r){r=r||0;const n=this.keyLayout.encode(e[0],t,r);return n+this.valueLayout.encode(e[1],t,r+n)}getSpan(e,t){return this.keyLayout.getSpan(e,t)+this.valueLayout.getSpan(e,t)}}t.map=function(e,t,r){const n=o.u32("length"),i=o.struct([n,o.seq(new y(e,t),o.offset(n,-n.span),"values")]);return new l(i,(e=>{let{values:t}=e;return new Map(t)}),(e=>({values:Array.from(e.entries())})),r)}},99328:(e,t,r)=>{"use strict";t.I0=t.DH=t.NX=t.u8=t.cY=void 0,t.av=t.O6=t.w3=t.Wg=void 0;const n=r(26382);function o(e){if(!(e instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}function i(e){return o(e),n.Buffer.from(e.buffer,e.byteOffset,e.length)}class a{constructor(e,t){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=t}makeDestinationObject(){return{}}getSpan(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}}function s(e,t){return t.property?e+"["+t.property+"]":e}class u extends a{isCount(){throw new Error("ExternalLayout is abstract")}}class c extends u{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;if(!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,t),this.elementSpan=e}isCount(){return!0}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(e);const r=e.length-t;return Math.floor(r/this.elementSpan)}encode(e,t,r){return 0}}class l extends u{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;if(!(e instanceof a))throw new TypeError("layout must be a Layout");if(!Number.isInteger(t))throw new TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof f||this.layout instanceof d}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.layout.decode(e,t+this.offset)}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.layout.encode(e,t,r+this.offset)}}class f extends a{constructor(e,t){if(super(e,t),61&&void 0!==arguments[1]?arguments[1]:0;return i(e).readUIntLE(t,this.span)}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return i(t).writeUIntLE(e,r,this.span),this.span}}class d extends a{constructor(e,t){if(super(e,t),61&&void 0!==arguments[1]?arguments[1]:0;return i(e).readUIntBE(t,this.span)}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return i(t).writeUIntBE(e,r,this.span),this.span}}class h extends a{constructor(e,t){if(super(e,t),61&&void 0!==arguments[1]?arguments[1]:0;return i(e).readIntLE(t,this.span)}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return i(t).writeIntLE(e,r,this.span),this.span}}class p extends a{constructor(e,t){if(super(e,t),61&&void 0!==arguments[1]?arguments[1]:0;return i(e).readIntBE(t,this.span)}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return i(t).writeIntBE(e,r,this.span),this.span}}const y=Math.pow(2,32);function m(e){const t=Math.floor(e/y);return{hi32:t,lo32:e-t*y}}function g(e,t){return e*y+t}class v extends a{constructor(e){super(8,e)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=i(e),n=r.readUInt32LE(t);return g(r.readUInt32LE(t+4),n)}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=m(e),o=i(t);return o.writeUInt32LE(n.lo32,r),o.writeUInt32LE(n.hi32,r+4),8}}class b extends a{constructor(e){super(8,e)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=i(e);return g(r.readUInt32BE(t),r.readUInt32BE(t+4))}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=m(e),o=i(t);return o.writeUInt32BE(n.hi32,r),o.writeUInt32BE(n.lo32,r+4),8}}class w extends a{constructor(e){super(8,e)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=i(e),n=r.readUInt32LE(t);return g(r.readInt32LE(t+4),n)}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=m(e),o=i(t);return o.writeUInt32LE(n.lo32,r),o.writeInt32LE(n.hi32,r+4),8}}class A extends a{constructor(e){super(8,e)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=i(e);return g(r.readInt32BE(t),r.readUInt32BE(t+4))}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=m(e),o=i(t);return o.writeInt32BE(n.hi32,r),o.writeUInt32BE(n.lo32,r+4),8}}class S extends a{constructor(e){super(4,e)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return i(e).readFloatLE(t)}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return i(t).writeFloatLE(e,r),4}}class k extends a{constructor(e){super(4,e)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return i(e).readFloatBE(t)}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return i(t).writeFloatBE(e,r),4}}class _ extends a{constructor(e){super(8,e)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return i(e).readDoubleLE(t)}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return i(t).writeDoubleLE(e,r),8}}class E extends a{constructor(e){super(8,e)}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return i(e).readDoubleBE(t)}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return i(t).writeDoubleBE(e,r),8}}class x extends a{constructor(e,t,r){if(!(e instanceof a))throw new TypeError("elementLayout must be a Layout");if(!(t instanceof u&&t.isCount()||Number.isInteger(t)&&0<=t))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let n=-1;!(t instanceof u)&&01&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;let r=0,n=this.count;if(n instanceof u&&(n=n.decode(e,t)),01&&void 0!==arguments[1]?arguments[1]:0;const r=[];let n=0,o=this.count;for(o instanceof u&&(o=o.decode(e,t));n2&&void 0!==arguments[2]?arguments[2]:0;const n=this.elementLayout,o=e.reduce(((e,o)=>e+n.encode(o,t,r+e)),0);return this.count instanceof u&&this.count.encode(e.length,t,r),o}}class T extends a{constructor(e,t,r){if(!Array.isArray(e)||!e.reduce(((e,t)=>e&&t instanceof a),!0))throw new TypeError("fields must be array of Layout instances");"boolean"===typeof t&&void 0===r&&(r=t,t=void 0);for(const i of e)if(0>i.span&&void 0===i.property)throw new Error("fields cannot contain unnamed variable-length layout");let n=-1;try{n=e.reduce(((e,t)=>e+t.getSpan()),0)}catch(o){}super(n,t),this.fields=e,this.decodePrefixes=!!r}getSpan(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce(((r,n)=>{const o=n.getSpan(e,t);return t+=o,r+o}),0)}catch(n){throw new RangeError("indeterminate span")}return r}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(e);const r=this.makeDestinationObject();for(const n of this.fields)if(void 0!==n.property&&(r[n.property]=n.decode(e,t)),t+=n.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=r;let o=0,i=0;for(const a of this.fields){let n=a.span;if(i=0n&&(n=a.getSpan(t,r)))}o=r,r+=n}return o+i-n}fromArray(e){const t=this.makeDestinationObject();for(const r of this.fields)void 0!==r.property&&0r.span?t=-1:0<=t&&(t+=r.span)}}}class P{constructor(e){this.property=e}decode(e,t){throw new Error("UnionDiscriminator is abstract")}encode(e,t,r){throw new Error("UnionDiscriminator is abstract")}}class O extends P{constructor(e,t){if(!(e instanceof u&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(t||e.property||"variant"),this.layout=e}decode(e,t){return this.layout.decode(e,t)}encode(e,t,r){return this.layout.encode(e,t,r)}}class R extends a{constructor(e,t,r){let n;if(e instanceof f||e instanceof d)n=new O(new l(e));else if(e instanceof u&&e.isCount())n=new O(e);else{if(!(e instanceof P))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");n=e}if(void 0===t&&(t=null),!(null===t||t instanceof a))throw new TypeError("defaultLayout must be null or a Layout");if(null!==t){if(0>t.span)throw new Error("defaultLayout must have constant span");void 0===t.property&&(t=t.replicate("content"))}let o=-1;t&&(o=t.span,0<=o&&(e instanceof f||e instanceof d)&&(o+=n.layout.span)),super(o,r),this.discriminator=n,this.usesPrefixDiscriminator=e instanceof f||e instanceof d,this.defaultLayout=t,this.registry={};let i=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(e){return i(e)},this.configGetSourceVariant=function(e){i=e.bind(this)}}getSpan(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;const r=this.getVariant(e,t);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(e,t)}defaultGetSourceVariant(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;const t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(const t in this.registry){const r=this.registry[t];if(r.property&&Object.prototype.hasOwnProperty.call(e,r.property))return r}throw new Error("unable to infer src variant")}decode(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.discriminator,o=n.decode(e,r),i=this.registry[o];if(void 0===i){const i=this.defaultLayout;let a=0;this.usesPrefixDiscriminator&&(a=n.layout.span),t=this.makeDestinationObject(),t[n.property]=o,t[i.property]=i.decode(e,r+a)}else t=i.decode(e,r);return t}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=this.getSourceVariant(e);if(void 0===n){const n=this.discriminator,o=this.defaultLayout;let i=0;return this.usesPrefixDiscriminator&&(i=n.layout.span),n.encode(e[n.property],t,r),i+o.encode(e[o.property],t,r+i)}return n.encode(e,t,r)}addVariant(e,t,r){const n=new I(this,e,t,r);return this.registry[e]=n,n}getVariant(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t=e instanceof Uint8Array?this.discriminator.decode(e,r):e,this.registry[t]}}class I extends a{constructor(e,t,r,n){if(!(e instanceof R))throw new TypeError("union must be a Union");if(!Number.isInteger(t)||0>t)throw new TypeError("variant must be a (non-negative) integer");if("string"===typeof r&&void 0===n&&(n=r,r=null),r){if(!(r instanceof a))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=r.span&&r.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!==typeof n)throw new TypeError("variant must have a String property")}let o=e.span;0>e.span&&(o=r?r.span:0,0<=o&&e.usesPrefixDiscriminator&&(o+=e.discriminator.layout.span)),super(o,n),this.union=e,this.variant=t,this.layout=r||null}getSpan(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let n=0;return this.layout&&(n=this.layout.getSpan(e,t+r)),r+n}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw new Error("variant mismatch");let n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,t+n):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=0;if(this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,r);let o=n;if(this.layout&&(this.layout.encode(e[this.property],t,r+n),o+=this.layout.getSpan(t,r+n),0<=this.union.span&&o>this.union.span))throw new Error("encoded variant overruns containing union");return o}fromArray(e){if(this.layout)return this.layout.fromArray(e)}}function C(e){return 0>e&&(e+=4294967296),e}class M extends a{constructor(e,t,r){if(!(e instanceof f||e instanceof d))throw new TypeError("word must be a UInt or UIntBE layout");if("string"===typeof t&&void 0===r&&(r=t,t=!1),41&&void 0!==arguments[1]?arguments[1]:0;const r=this.makeDestinationObject(),n=this.word.decode(e,t);this._packedSetValue(n);for(const o of this.fields)void 0!==o.property&&(r[o.property]=o.decode(e));return r}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=this.word.decode(t,r);this._packedSetValue(n);for(const o of this.fields)if(void 0!==o.property){const t=e[o.property];void 0!==t&&o.encode(t)}return this.word.encode(this._packedGetValue(),t,r)}addField(e,t){const r=new B(this,e,t);return this.fields.push(r),r}addBoolean(e){const t=new N(this,e);return this.fields.push(t),t}fieldFor(e){if("string"!==typeof e)throw new TypeError("property must be string");for(const t of this.fields)if(t.property===e)return t}}class B{constructor(e,t,r){if(!(e instanceof M))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(t)||0>=t)throw new TypeError("bits must be positive integer");const n=8*e.span,o=e.fields.reduce(((e,t)=>e+t.bits),0);if(t+o>n)throw new Error("bits too long for span remainder ("+(n-o)+" of "+n+" remain)");this.container=e,this.bits=t,this.valueMask=(1<>>this.start}encode(e){if("number"!==typeof e||!Number.isInteger(e)||e!==C(e&this.valueMask))throw new TypeError(s("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const t=this.container._packedGetValue(),r=C(e<r&&(r=this.length.decode(e,t)),r}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.span;return 0>r&&(r=this.length.decode(e,t)),i(e).slice(t,t+r)}encode(e,t,r){let n=this.length;if(this.length instanceof u&&(n=e.length),!(e instanceof Uint8Array&&n===e.length))throw new TypeError(s("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(r+n>t.length)throw new RangeError("encoding overruns Uint8Array");const o=i(e);return i(t).write(o.toString("hex"),r,n,"hex"),this.length instanceof u&&this.length.encode(n,t,r),n}}class j extends a{constructor(e){super(-1,e)}getSpan(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(e);let r=t;for(;r1&&void 0!==arguments[1]?arguments[1]:0;const r=this.getSpan(e,t);return i(e).slice(t,t+r-1).toString("utf-8")}encode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;"string"!==typeof e&&(e=String(e));const o=n.Buffer.from(e,"utf8"),a=o.length;if(r+a>t.length)throw new RangeError("encoding overruns Buffer");const s=i(t);return o.copy(s,r),s[r+a]=0,a+1}}class U extends a{constructor(e,t){if("string"===typeof e&&void 0===t&&(t=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");super(-1,t),this.maxSpan=e}getSpan(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return o(e),e.length-t}decode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan2&&void 0!==arguments[2]?arguments[2]:0;"string"!==typeof e&&(e=String(e));const o=n.Buffer.from(e,"utf8"),a=o.length;if(0<=this.maxSpan&&this.maxSpant.length)throw new RangeError("encoding overruns Buffer");return o.copy(i(t),r),a}}class F extends a{constructor(e,t){super(0,t),this.value=e}decode(e,t){return this.value}encode(e,t,r){return 0}}t.cY=(e,t,r)=>new l(e,t,r),t.u8=e=>new f(1,e),t.NX=e=>new f(2,e),t.DH=e=>new f(4,e),t.I0=e=>new v(e),t.Wg=e=>new w(e),t.w3=(e,t,r)=>new T(e,t,r),t.O6=(e,t,r)=>new x(e,t,r),t.av=(e,t)=>new L(e,t)},44319:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Account:()=>jr,AddressLookupTableAccount:()=>Yn,AddressLookupTableInstruction:()=>Wi,AddressLookupTableProgram:()=>Gi,Authorized:()=>oa,BLOCKHASH_CACHE_TIMEOUT_MS:()=>no,BPF_LOADER_DEPRECATED_PROGRAM_ID:()=>Ur,BPF_LOADER_PROGRAM_ID:()=>jn,BpfLoader:()=>Un,COMPUTE_BUDGET_INSTRUCTION_LAYOUTS:()=>Zi,ComputeBudgetInstruction:()=>Xi,ComputeBudgetProgram:()=>Qi,Connection:()=>Hi,Ed25519Program:()=>Ji,Enum:()=>Rr,EpochSchedule:()=>Kn,FeeCalculatorLayout:()=>xn,Keypair:()=>Vi,LAMPORTS_PER_SOL:()=>Ta,LOOKUP_TABLE_INSTRUCTION_LAYOUTS:()=>Ki,Loader:()=>Ln,Lockup:()=>ia,MAX_SEED_LENGTH:()=>Mr,Message:()=>nn,MessageAccountKeys:()=>Kr,MessageV0:()=>on,NONCE_ACCOUNT_LENGTH:()=>Pn,NonceAccount:()=>On,PACKET_DATA_SIZE:()=>Fr,PUBLIC_KEY_LENGTH:()=>Br,PublicKey:()=>Lr,SIGNATURE_LENGTH_IN_BYTES:()=>zr,SOLANA_SCHEMA:()=>Ir,STAKE_CONFIG_ID:()=>na,STAKE_INSTRUCTION_LAYOUTS:()=>sa,SYSTEM_INSTRUCTION_LAYOUTS:()=>Mn,SYSVAR_CLOCK_PUBKEY:()=>hn,SYSVAR_EPOCH_SCHEDULE_PUBKEY:()=>pn,SYSVAR_INSTRUCTIONS_PUBKEY:()=>yn,SYSVAR_RECENT_BLOCKHASHES_PUBKEY:()=>mn,SYSVAR_RENT_PUBKEY:()=>gn,SYSVAR_REWARDS_PUBKEY:()=>vn,SYSVAR_SLOT_HASHES_PUBKEY:()=>bn,SYSVAR_SLOT_HISTORY_PUBKEY:()=>wn,SYSVAR_STAKE_HISTORY_PUBKEY:()=>An,Secp256k1Program:()=>ta,SendTransactionError:()=>Wn,SolanaJSONRPCError:()=>Xn,SolanaJSONRPCErrorCode:()=>Gn,StakeAuthorizationLayout:()=>ua,StakeInstruction:()=>aa,StakeProgram:()=>ca,Struct:()=>Or,SystemInstruction:()=>Cn,SystemProgram:()=>Bn,Transaction:()=>ln,TransactionExpiredBlockheightExceededError:()=>qr,TransactionExpiredNonceInvalidError:()=>Vr,TransactionExpiredTimeoutError:()=>Hr,TransactionInstruction:()=>cn,TransactionMessage:()=>fn,TransactionStatus:()=>sn,VALIDATOR_INFO_KEY:()=>ya,VERSION_PREFIX_MASK:()=>Dr,VOTE_PROGRAM_ID:()=>va,ValidatorInfo:()=>ga,VersionedMessage:()=>an,VersionedTransaction:()=>dn,VoteAccount:()=>wa,VoteAuthorizationLayout:()=>ha,VoteInit:()=>la,VoteInstruction:()=>fa,VoteProgram:()=>pa,clusterApiUrl:()=>Ea,sendAndConfirmRawTransaction:()=>xa,sendAndConfirmTransaction:()=>Sn});var n={};r.r(n),r.d(n,{DO:()=>q,OG:()=>te,My:()=>V,bytesToNumberBE:()=>Z,lX:()=>Q,Id:()=>ee,fg:()=>oe,qj:()=>$,hexToBytes:()=>X,aY:()=>z,lq:()=>Y,z:()=>J,Q5:()=>ae});var o=r(26382);function i(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, not ".concat(e))}function a(e){if(!((t=e)instanceof Uint8Array||null!=t&&"object"===typeof t&&"Uint8Array"===t.constructor.name))throw new Error("Uint8Array expected");for(var t,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o0&&!n.includes(e.length))throw new Error("Uint8Array expected of length ".concat(n,", not of length=").concat(e.length))}function s(e){if("function"!==typeof e||"function"!==typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");i(e.outputLen),i(e.blockLen)}function u(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];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 c(e,t){a(e);const r=t.outputLen;if(e.lengthnew DataView(e.buffer,e.byteOffset,e.byteLength),d=(e,t)=>e<<32-t|e>>>t,h=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],p=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function y(e){for(let t=0;te().update(g(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function A(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(l&&"function"===typeof l.getRandomValues)return l.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const S=(e,t,r)=>e&t^e&r^t&r;class k extends b{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=f(this.buffer)}update(e){u(this);const{view:t,buffer:r,blockLen:n}=this,o=(e=g(e)).length;for(let i=0;in-i&&(this.process(r,0),i=0);for(let u=i;u>o&i),s=Number(r&i),u=n?4:0,c=n?0:4;e.setUint32(t+u,a,n),e.setUint32(t+c,s,n)}(r,n-8,BigInt(8*this.length),o),this.process(r,0);const a=f(e),s=this.outputLen;if(s%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=s/4,d=this.get();if(l>d.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;u1&&void 0!==arguments[1]&&arguments[1]?{h:Number(e&_),l:Number(e>>E&_)}:{h:0|Number(e>>E&_),l:0|Number(e&_)}}function T(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;oe<>>32-r,O=(e,t,r)=>t<>>32-r,R=(e,t,r)=>t<>>64-r,I=(e,t,r)=>e<>>64-r;const C={fromBig:x,split:T,toBig:(e,t)=>BigInt(e>>>0)<>>0),shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:P,rotlSL:O,rotlBH:R,rotlBL:I,add:function(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:0|o}},add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,add5H:(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0,add5L:(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0)},[M,B]=(()=>C.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)))))(),N=new Uint32Array(80),L=new Uint32Array(80);class j extends k{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:r,Bl:n,Ch:o,Cl:i,Dh:a,Dl:s,Eh:u,El:c,Fh:l,Fl:f,Gh:d,Gl:h,Hh:p,Hl:y}=this;return[e,t,r,n,o,i,a,s,u,c,l,f,d,h,p,y]}set(e,t,r,n,o,i,a,s,u,c,l,f,d,h,p,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|o,this.Cl=0|i,this.Dh=0|a,this.Dl=0|s,this.Eh=0|u,this.El=0|c,this.Fh=0|l,this.Fl=0|f,this.Gh=0|d,this.Gl=0|h,this.Hh=0|p,this.Hl=0|y}process(e,t){for(let v=0;v<16;v++,t+=4)N[v]=e.getUint32(t),L[v]=e.getUint32(t+=4);for(let v=16;v<80;v++){const e=0|N[v-15],t=0|L[v-15],r=C.rotrSH(e,t,1)^C.rotrSH(e,t,8)^C.shrSH(e,t,7),n=C.rotrSL(e,t,1)^C.rotrSL(e,t,8)^C.shrSL(e,t,7),o=0|N[v-2],i=0|L[v-2],a=C.rotrSH(o,i,19)^C.rotrBH(o,i,61)^C.shrSH(o,i,6),s=C.rotrSL(o,i,19)^C.rotrBL(o,i,61)^C.shrSL(o,i,6),u=C.add4L(n,s,L[v-7],L[v-16]),c=C.add4H(u,r,a,N[v-7],N[v-16]);N[v]=0|c,L[v]=0|u}let{Ah:r,Al:n,Bh:o,Bl:i,Ch:a,Cl:s,Dh:u,Dl:c,Eh:l,El:f,Fh:d,Fl:h,Gh:p,Gl:y,Hh:m,Hl:g}=this;for(let v=0;v<80;v++){const e=C.rotrSH(l,f,14)^C.rotrSH(l,f,18)^C.rotrBH(l,f,41),t=C.rotrSL(l,f,14)^C.rotrSL(l,f,18)^C.rotrBL(l,f,41),b=l&d^~l&p,w=f&h^~f&y,A=C.add5L(g,t,w,B[v],L[v]),S=C.add5H(A,m,e,b,M[v],N[v]),k=0|A,_=C.rotrSH(r,n,28)^C.rotrBH(r,n,34)^C.rotrBH(r,n,39),E=C.rotrSL(r,n,28)^C.rotrBL(r,n,34)^C.rotrBL(r,n,39),x=r&o^r&a^o&a,T=n&i^n&s^i&s;m=0|p,g=0|y,p=0|d,y=0|h,d=0|l,h=0|f,({h:l,l:f}=C.add(0|u,0|c,0|S,0|k)),u=0|a,c=0|s,a=0|o,s=0|i,o=0|r,i=0|n;const P=C.add3L(k,E,T);r=C.add3H(P,S,_,x),n=0|P}({h:r,l:n}=C.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:i}=C.add(0|this.Bh,0|this.Bl,0|o,0|i)),({h:a,l:s}=C.add(0|this.Ch,0|this.Cl,0|a,0|s)),({h:u,l:c}=C.add(0|this.Dh,0|this.Dl,0|u,0|c)),({h:l,l:f}=C.add(0|this.Eh,0|this.El,0|l,0|f)),({h:d,l:h}=C.add(0|this.Fh,0|this.Fl,0|d,0|h)),({h:p,l:y}=C.add(0|this.Gh,0|this.Gl,0|p,0|y)),({h:m,l:g}=C.add(0|this.Hh,0|this.Hl,0|m,0|g)),this.set(r,n,o,i,a,s,u,c,l,f,d,h,p,y,m,g)}roundClean(){N.fill(0),L.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 U=w((()=>new j)),F=(BigInt(0),BigInt(1)),D=BigInt(2);function z(e){return e instanceof Uint8Array||null!=e&&"object"===typeof e&&"Uint8Array"===e.constructor.name}function q(e){if(!z(e))throw new Error("Uint8Array expected")}const H=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function V(e){q(e);let t="";for(let r=0;r=W._0&&e<=W._9?e-W._0:e>=W._A&&e<=W._F?e-(W._A-10):e>=W._a&&e<=W._f?e-(W._a-10):void 0}function X(e){if("string"!==typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let o=0,i=0;o(D<new Uint8Array(e),ne=e=>Uint8Array.from(e);function oe(e,t,r){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 r)throw new Error("hmacFn must be a function");let n=re(e),o=re(e),i=0;const a=()=>{n.fill(1),o.fill(0),i=0},s=function(){for(var e=arguments.length,t=new Array(e),i=0;i0&&void 0!==arguments[0]?arguments[0]:re();o=s(ne([0]),e),n=s(),0!==e.length&&(o=s(ne([1]),e),n=s())},c=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e{let r;for(a(),u(e);!(r=t(c()));)u();return a(),r}}const ie={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||z(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 ae(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(t,r,n)=>{const o=ie[r];if("function"!==typeof o)throw new Error('Invalid validator "'.concat(r,'", expected function'));const i=e[t];if((!n||void 0!==i)&&!o(i,e))throw new Error("Invalid param ".concat(String(t),"=").concat(i," (").concat(typeof i,"), expected ").concat(r))};for(const[o,i]of Object.entries(t))n(o,i,!1);for(const[o,i]of Object.entries(r))n(o,i,!0);return e}const se=BigInt(0),ue=BigInt(1),ce=BigInt(2),le=BigInt(3),fe=BigInt(4),de=BigInt(5),he=BigInt(8);BigInt(9),BigInt(16);function pe(e,t){const r=e%t;return r>=se?r:t+r}function ye(e,t,r){if(r<=se||t 0");if(r===ue)return se;let n=ue;for(;t>se;)t&ue&&(n=n*e%r),e=e*e%r,t>>=ue;return n}function me(e,t,r){let n=e;for(;t-- >se;)n*=n,n%=r;return n}function ge(e,t){if(e===se||t<=se)throw new Error("invert: expected positive integers, got n=".concat(e," mod=").concat(t));let r=pe(e,t),n=t,o=se,i=ue,a=ue,s=se;for(;r!==se;){const e=n/r,t=n%r,u=o-a*e,c=i-s*e;n=r,r=t,o=a,i=s,a=u,s=c}if(n!==ue)throw new Error("invert: does not exist");return pe(o,t)}function ve(e){if(e%fe===le){const t=(e+ue)/fe;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}if(e%he===de){const t=(e-de)/he;return function(e,r){const n=e.mul(r,ce),o=e.pow(n,t),i=e.mul(r,o),a=e.mul(e.mul(i,ce),o),s=e.mul(i,e.sub(a,e.ONE));if(!e.eql(e.sqr(s),r))throw new Error("Cannot find square root");return s}}return function(e){const t=(e-ue)/ce;let r,n,o;for(r=e-ue,n=0;r%ce===se;r/=ce,n++);for(o=ce;o(pe(e,t)&ue)===ue,we=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ae(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function Se(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(e<=se)throw new Error("Expected Field ORDER > 0, got ".concat(e));const{nBitLength:o,nByteLength:i}=Ae(e,t);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=ve(e),s=Object.freeze({ORDER:e,BITS:o,BYTES:i,MASK:te(o),ZERO:se,ONE:ue,create:t=>pe(t,e),isValid:t=>{if("bigint"!==typeof t)throw new Error("Invalid field element: expected bigint, got ".concat(typeof t));return se<=t&&te===se,isOdd:e=>(e&ue)===ue,neg:t=>pe(-t,e),eql:(e,t)=>e===t,sqr:t=>pe(t*t,e),add:(t,r)=>pe(t+r,e),sub:(t,r)=>pe(t-r,e),mul:(t,r)=>pe(t*r,e),pow:(e,t)=>function(e,t,r){if(r 0");if(r===se)return e.ONE;if(r===ue)return t;let n=e.ONE,o=t;for(;r>se;)r&ue&&(n=e.mul(n,o)),o=e.sqr(o),r>>=ue;return n}(s,e,t),div:(t,r)=>pe(t*ge(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>ge(t,e),sqrt:n.sqrt||(e=>a(s,e)),invertBatch:e=>function(e,t){const r=new Array(t.length),n=t.reduce(((t,n,o)=>e.is0(n)?t:(r[o]=t,e.mul(t,n))),e.ONE),o=e.inv(n);return t.reduceRight(((t,n,o)=>e.is0(n)?t:(r[o]=e.mul(t,r[o]),e.mul(t,n))),o),r}(s,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?J(e,i):Y(e,i),fromBytes:e=>{if(e.length!==i)throw new Error("Fp.fromBytes: expected ".concat(i,", got ").concat(e.length));return r?Q(e):Z(e)}});return Object.freeze(s)}function ke(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 _e(e){const t=ke(e);return t+Math.ceil(t/2)}const Ee=BigInt(0),xe=BigInt(1);function Te(e,t){const r=(e,t)=>{const r=t.negate();return e?r:t},n=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:r,unsafeLadder(t,r){let n=e.ZERO,o=t;for(;r>Ee;)r&xe&&(n=n.add(o)),o=o.double(),r>>=xe;return n},precomputeWindow(e,t){const{windows:r,windowSize:o}=n(t),i=[];let a=e,s=a;for(let n=0;n>=d,n>s&&(n-=f,i+=xe);const a=t,h=t+Math.abs(n)-1,p=e%2!==0,y=n<0;0===n?c=c.add(r(p,o[a])):u=u.add(r(y,o[h]))}return{p:u,f:c}},wNAFCached(e,t,r,n){const o=e._WINDOW_SIZE||1;let i=t.get(e);return i||(i=this.precomputeWindow(e,o),1!==o&&t.set(e,n(i))),this.wNAF(o,i,r)}}}function Pe(e){return function(e){const t=we.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});ae(e,t)}(e.Fp),ae(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ae(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const Oe=BigInt(0),Re=BigInt(1),Ie=BigInt(2),Ce=BigInt(8),Me={zip215:!0};function Be(e){const t=function(e){const t=Pe(e);return ae(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}(e),{Fp:r,n:n,prehash:o,hash:i,randomBytes:a,nByteLength:s,h:u}=t,c=Ie<{try{return{isValid:!0,value:r.sqrt(e*r.inv(t))}}catch(n){return{isValid:!1,value:Oe}}}),d=t.adjustScalarBytes||(e=>e),h=t.domain||((e,t,r)=>{if(t.length||r)throw new Error("Contexts/pre-hash are not supported");return e}),p=e=>"bigint"===typeof e&&Oep(e)&&p(t)&&ee===Oe||y(e,c);function g(e,t){if(y(e,t))return e;throw new Error("Expected valid scalar < ".concat(t,", got ").concat(typeof e," ").concat(e))}function v(e){return e===Oe?e:g(e,n)}const b=new Map;function w(e){if(!(e instanceof A))throw new Error("ExtendedPoint expected")}class A{constructor(e,t,r,n){if(this.ex=e,this.ey=t,this.ez=r,this.et=n,!m(e))throw new Error("x required");if(!m(t))throw new Error("y required");if(!m(r))throw new Error("z required");if(!m(n))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof A)throw new Error("extended point not allowed");const{x:t,y:r}=e||{};if(!m(t)||!m(r))throw new Error("invalid affine point");return new A(t,r,Re,l(t*r))}static normalizeZ(e){const t=r.invertBatch(e.map((e=>e.ez)));return e.map(((e,r)=>e.toAffine(t[r]))).map(A.fromAffine)}_setWindowSize(e){this._WINDOW_SIZE=e,b.delete(this)}assertValidity(){const{a:e,d:r}=t;if(this.is0())throw new Error("bad point: ZERO");const{ex:n,ey:o,ez:i,et:a}=this,s=l(n*n),u=l(o*o),c=l(i*i),f=l(c*c),d=l(s*e);if(l(c*l(d+u))!==l(f+l(r*l(s*u))))throw new Error("bad point: equation left != right (1)");if(l(n*o)!==l(i*a))throw new Error("bad point: equation left != right (2)")}equals(e){w(e);const{ex:t,ey:r,ez:n}=this,{ex:o,ey:i,ez:a}=e,s=l(t*a),u=l(o*n),c=l(r*a),f=l(i*n);return s===u&&c===f}is0(){return this.equals(A.ZERO)}negate(){return new A(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){const{a:e}=t,{ex:r,ey:n,ez:o}=this,i=l(r*r),a=l(n*n),s=l(Ie*l(o*o)),u=l(e*i),c=r+n,f=l(l(c*c)-i-a),d=u+a,h=d-s,p=u-a,y=l(f*h),m=l(d*p),g=l(f*p),v=l(h*d);return new A(y,m,v,g)}add(e){w(e);const{a:r,d:n}=t,{ex:o,ey:i,ez:a,et:s}=this,{ex:u,ey:c,ez:f,et:d}=e;if(r===BigInt(-1)){const e=l((i-o)*(c+u)),t=l((i+o)*(c-u)),r=l(t-e);if(r===Oe)return this.double();const n=l(a*Ie*d),h=l(s*Ie*f),p=h+n,y=t+e,m=h-n,g=l(p*r),v=l(y*m),b=l(p*m),w=l(r*y);return new A(g,v,w,b)}const h=l(o*u),p=l(i*c),y=l(s*n*d),m=l(a*f),g=l((o+i)*(u+c)-h-p),v=m-y,b=m+y,S=l(p-r*h),k=l(g*v),_=l(b*S),E=l(g*S),x=l(v*b);return new A(k,_,x,E)}subtract(e){return this.add(e.negate())}wNAF(e){return _.wNAFCached(this,b,e,A.normalizeZ)}multiply(e){const{p:t,f:r}=this.wNAF(g(e,n));return A.normalizeZ([t,r])[0]}multiplyUnsafe(e){let t=v(e);return t===Oe?k:this.equals(k)||t===Re?this:this.equals(S)?this.wNAF(t).p:_.unsafeLadder(this,t)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}isTorsionFree(){return _.unsafeLadder(this,n).is0()}toAffine(e){const{ex:t,ey:n,ez:o}=this,i=this.is0();null==e&&(e=i?Ce:r.inv(o));const a=l(t*e),s=l(n*e),u=l(o*e);if(i)return{x:Oe,y:Re};if(u!==Re)throw new Error("invZ was invalid");return{x:a,y:s}}clearCofactor(){const{h:e}=t;return e===Re?this:this.multiplyUnsafe(e)}static fromHex(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{d:o,a:i}=t,a=r.BYTES,s=(e=$("pointHex",e,a)).slice(),u=e[a-1];s[a-1]=-129&u;const d=Q(s);d===Oe||g(d,n?c:r.ORDER);const h=l(d*d),p=l(h-Re),y=l(o*h-i);let{isValid:m,value:v}=f(p,y);if(!m)throw new Error("Point.fromHex: invalid y coordinate");const b=(v&Re)===Re,w=0!==(128&u);if(!n&&v===Oe&&w)throw new Error("Point.fromHex: x=0 and x_0=1");return w!==b&&(v=l(-v)),A.fromAffine({x:v,y:d})}static fromPrivateKey(e){return T(e).point}toRawBytes(){const{x:e,y:t}=this.toAffine(),n=J(t,r.BYTES);return n[n.length-1]|=e&Re?128:0,n}toHex(){return V(this.toRawBytes())}}A.BASE=new A(t.Gx,t.Gy,Re,l(t.Gx*t.Gy)),A.ZERO=new A(Oe,Re,Re,Oe);const{BASE:S,ZERO:k}=A,_=Te(A,8*s);function E(e){return pe(e,n)}function x(e){return E(Q(e))}function T(e){const t=s;e=$("private key",e,t);const r=$("hashed private key",i(e),2*t),n=d(r.slice(0,t)),o=r.slice(t,2*t),a=x(n),u=S.multiply(a),c=u.toRawBytes();return{head:n,prefix:o,scalar:a,point:u,pointBytes:c}}function P(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array;for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;na(r.BYTES),precompute(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A.BASE;return t._setWindowSize(e),t.multiply(BigInt(3)),t}};return{CURVE:t,getPublicKey:function(e){return T(e).pointBytes},sign:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e=$("message",e),o&&(e=o(e));const{prefix:i,scalar:a,pointBytes:u}=T(t),c=P(n.context,i,e),l=S.multiply(c).toRawBytes(),f=E(c+P(n.context,l,u,e)*a);return v(f),$("result",ee(l,J(f,r.BYTES)),2*s)},verify:function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:O;const{context:a,zip215:s}=i,u=r.BYTES;e=$("signature",e,2*u),t=$("message",t),o&&(t=o(t));const c=Q(e.slice(u,2*u));let l,f,d;try{l=A.fromHex(n,s),f=A.fromHex(e.slice(0,u),s),d=S.multiplyUnsafe(c)}catch(p){return!1}if(!s&&l.isSmallOrder())return!1;const h=P(a,f.toRawBytes(),l.toRawBytes(),t);return f.add(l.multiplyUnsafe(h)).subtract(d).clearCofactor().equals(A.ZERO)},ExtendedPoint:A,utils:R}}const Ne=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Le=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),je=(BigInt(0),BigInt(1)),Ue=BigInt(2),Fe=BigInt(5),De=BigInt(10),ze=BigInt(20),qe=BigInt(40),He=BigInt(80);function Ve(e){const t=Ne,r=e*e%t*e%t,n=me(r,Ue,t)*r%t,o=me(n,je,t)*e%t,i=me(o,Fe,t)*o%t,a=me(i,De,t)*i%t,s=me(a,ze,t)*a%t,u=me(s,qe,t)*s%t,c=me(u,He,t)*u%t,l=me(c,He,t)*u%t,f=me(l,De,t)*i%t;return{pow_p_5_8:me(f,Ue,t)*e%t,b2:r}}function Ke(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function We(e,t){const r=Ne,n=pe(t*t*t,r),o=pe(n*n*t,r);let i=pe(e*n*Ve(e*o).pow_p_5_8,r);const a=pe(t*i*i,r),s=i,u=pe(i*Le,r),c=a===e,l=a===pe(-e,r),f=a===pe(-e*Le,r);return c&&(i=s),(l||f)&&(i=u),be(i,r)&&(i=pe(-i,r)),{isValid:c||l,value:i}}const Ge=Se(Ne,void 0,!0),Xe={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Ge,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:U,randomBytes:A,adjustScalarBytes:Ke,uvRatio:We},Ze=Be(Xe);function Qe(e,t,r){if(t.length>255)throw new Error("Context is too big");return v(m("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,t.length]),t,e)}const Ye=(Ge.ORDER+BigInt(3))/BigInt(8);Ge.pow(Ue,Ye),Ge.sqrt(Ge.neg(Ge.ONE)),Ge.ORDER,BigInt(5),BigInt(8),BigInt(486662);!function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);e.isOdd(r)&&e.neg(r)}(Ge,Ge.neg(BigInt(486664)));BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Je=r(6373),$e=r.n(Je),et=r(40462),tt=r.n(et);const rt=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]),nt=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ot=new Uint32Array(64);class it extends k{constructor(){super(64,32,8,!1),this.A=0|nt[0],this.B=0|nt[1],this.C=0|nt[2],this.D=0|nt[3],this.E=0|nt[4],this.F=0|nt[5],this.G=0|nt[6],this.H=0|nt[7]}get(){const{A:e,B:t,C:r,D:n,E:o,F:i,G:a,H:s}=this;return[e,t,r,n,o,i,a,s]}set(e,t,r,n,o,i,a,s){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|i,this.G=0|a,this.H=0|s}process(e,t){for(let f=0;f<16;f++,t+=4)ot[f]=e.getUint32(t,!1);for(let f=16;f<64;f++){const e=ot[f-15],t=ot[f-2],r=d(e,7)^d(e,18)^e>>>3,n=d(t,17)^d(t,19)^t>>>10;ot[f]=n+ot[f-7]+r+ot[f-16]|0}let{A:r,B:n,C:o,D:i,E:a,F:s,G:u,H:c}=this;for(let f=0;f<64;f++){const e=c+(d(a,6)^d(a,11)^d(a,25))+((l=a)&s^~l&u)+rt[f]+ot[f]|0,t=(d(r,2)^d(r,13)^d(r,22))+S(r,n,o)|0;c=u,u=s,s=a,a=i+e|0,i=o,o=n,n=r,r=e+t|0}var l;r=r+this.A|0,n=n+this.B|0,o=o+this.C|0,i=i+this.D|0,a=a+this.E|0,s=s+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,n,o,i,a,s,u,c)}roundClean(){ot.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const at=w((()=>new it));var st=r(96060),ut=r(99328),ct=r(17081);class lt extends TypeError{constructor(e,t){let r;const{message:n,...o}=e,{path:i}=e;super(0===i.length?n:"At path: "+i.join(".")+" -- "+n),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>{var n;return null!=(n=r)?n:r=[e,...t()]}}}function ft(e){return"object"===typeof e&&null!=e}function dt(e){return"string"===typeof e?JSON.stringify(e):""+e}function ht(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"===typeof e&&(e={message:e});const{path:o,branch:i}=t,{type:a}=r,{refinement:s,message:u="Expected a value of type `"+a+"`"+(s?" with refinement `"+s+"`":"")+", but received: `"+dt(n)+"`"}=e;return{value:n,type:a,refinement:s,key:o[o.length-1],path:o,branch:i,...e,message:u}}function*pt(e,t,r,n){var o;ft(o=e)&&"function"===typeof o[Symbol.iterator]||(e=[e]);for(const i of e){const e=ht(i,t,r,n);e&&(yield e)}}function yt(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){const{path:n=[],branch:o=[e],coerce:i=!1,mask:a=!1}=r,s={path:n,branch:o};if(i&&(e=t.coercer(e,s),a&&"type"!==t.type&&ft(t.schema)&&ft(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let u=!0;for(const r of t.validator(e,s))u=!1,yield[r,void 0];for(let[r,c,l]of t.entries(e,s)){const t=yt(c,l,{path:void 0===r?n:[...n,r],branch:void 0===r?o:[...o,c],coerce:i,mask:a});for(const n of t)n[0]?(u=!1,yield[n[0],void 0]):i&&(c=n[1],void 0===r?e=c:e instanceof Map?e.set(r,c):e instanceof Set?e.add(c):ft(e)&&(e[r]=c))}if(u)for(const r of t.refiner(e,s))u=!1,yield[r,void 0];u&&(yield[void 0,e])}()}class mt{constructor(e){const{type:t,schema:r,validator:n,refiner:o,coercer:i=(e=>e),entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=i,this.validator=n?(e,t)=>pt(n(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>pt(o(e,t),t,this,e):()=>[]}assert(e){return gt(e,this)}create(e){return vt(e,this)}is(e){return bt(e,this)}mask(e){return function(e,t){const r=wt(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e){return wt(e,this,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}}function gt(e,t){const r=wt(e,t);if(r[0])throw r[0]}function vt(e,t){const r=wt(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}function bt(e,t){return!wt(e,t)[0]}function wt(e,t){const r=yt(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),n=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(r);if(n[0]){return[new lt(n[0],(function*(){for(const e of r)e[0]&&(yield e[0])})),void 0]}return[void 0,n[1]]}function At(e,t){return new mt({type:e,schema:null,validator:t})}function St(e){return new mt({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+dt(e)})}function kt(){return At("boolean",(e=>"boolean"===typeof e))}function _t(e){return At("instance",(t=>t instanceof e||"Expected a `"+e.name+"` instance, but received: "+dt(t)))}function Et(e){const t=dt(e),r=typeof e;return new mt({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||"Expected the literal `"+t+"`, but received: "+dt(r)})}function xt(){return At("never",(()=>!1))}function Tt(e){return new mt({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})}function Pt(){return At("number",(e=>"number"===typeof e&&!isNaN(e)||"Expected a number, but received: "+dt(e)))}function Ot(e){return new mt({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function Rt(e,t){return new mt({type:"record",schema:null,*entries(r){if(ft(r))for(const n in r){const o=r[n];yield[n,n,e],yield[n,o,t]}},validator:e=>ft(e)||"Expected an object, but received: "+dt(e)})}function It(){return At("string",(e=>"string"===typeof e||"Expected a string, but received: "+dt(e)))}function Ct(e){const t=xt();return new mt({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let o=0;oArray.isArray(e)||"Expected an array, but received: "+dt(e)})}function Mt(e){const t=Object.keys(e);return new mt({type:"type",schema:e,*entries(r){if(ft(r))for(const n of t)yield[n,r[n],e[n]]},validator:e=>ft(e)||"Expected an object, but received: "+dt(e)})}function Bt(e){const t=e.map((e=>e.type)).join(" | ");return new mt({type:"union",schema:null,validator(r,n){const o=[];for(const t of e){const[...e]=yt(r,t,n),[i]=e;if(!i[0])return[];for(const[t]of e)t&&o.push(t)}return["Expected the value to satisfy a union of `"+t+"`, but received: "+dt(r),...o]}})}function Nt(){return At("unknown",(()=>!0))}function Lt(e,t,r){return new mt({...e,coercer:(n,o)=>bt(n,t)?e.coercer(r(n,o),o):e.coercer(n,o)})}var jt=r(23861),Ut=r.n(jt),Ft=r(18372),Dt=r(23938);const zt=[],qt=[],Ht=[],Vt=BigInt(0),Kt=BigInt(1),Wt=BigInt(2),Gt=BigInt(7),Xt=BigInt(256),Zt=BigInt(113);for(let Pa=0,Oa=Kt,Ra=1,Ia=0;Pa<24;Pa++){[Ra,Ia]=[Ia,(2*Ra+3*Ia)%5],zt.push(2*(5*Ia+Ra)),qt.push((Pa+1)*(Pa+2)/2%64);let e=Vt;for(let t=0;t<7;t++)Oa=(Oa<>Gt)*Zt)%Xt,Oa&Wt&&(e^=Kt<<(Kt<r>32?R(e,t,r):P(e,t,r),$t=(e,t,r)=>r>32?I(e,t,r):O(e,t,r);class er extends b{constructor(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:24;if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,i(r),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(){h||y(this.state32),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24;const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let n=0;n<10;n++)r[n]=e[n]^e[n+10]^e[n+20]^e[n+30]^e[n+40];for(let n=0;n<10;n+=2){const t=(n+8)%10,o=(n+2)%10,i=r[o],a=r[o+1],s=Jt(i,a,1)^r[t],u=$t(i,a,1)^r[t+1];for(let r=0;r<50;r+=10)e[n+r]^=s,e[n+r+1]^=u}let t=e[2],o=e[3];for(let r=0;r<24;r++){const n=qt[r],i=Jt(t,o,n),a=$t(t,o,n),s=zt[r];t=e[s],o=e[s+1],e[s]=i,e[s+1]=a}for(let n=0;n<50;n+=10){for(let t=0;t<10;t++)r[t]=e[n+t];for(let t=0;t<10;t++)e[n+t]^=~r[(t+2)%10]&r[(t+4)%10]}e[0]^=Qt[n],e[1]^=Yt[n]}r.fill(0)}(this.state32,this.rounds),h||y(this.state32),this.posOut=0,this.pos=0}update(e){u(this);const{blockLen:t,state:r}=this,n=(e=g(e)).length;for(let o=0;o=r&&this.keccak();const i=Math.min(r-this.posOut,o-n);e.set(t.subarray(this.posOut,this.posOut+i),n),this.posOut+=i,n+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return i(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(c(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:r,outputLen:n,rounds:o,enableXOF:i}=this;return e||(e=new er(t,r,n,i,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=n,e.enableXOF=i,e.destroyed=this.destroyed,e}}const tr=(e,t,r)=>w((()=>new er(t,e,r))),rr=tr(1,136,32);class nr extends b{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,s(e);const r=g(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 n=this.blockLen,o=new Uint8Array(n);o.set(r.length>n?e.create().update(r).digest():r);for(let i=0;inew nr(e,t).update(r).digest();or.create=(e,t)=>new nr(e,t);const{bytesToNumberBE:ir,hexToBytes:ar}=n,sr={Err:class extends Error{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}},_parseInt(e){const{Err:t}=sr;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const r=e[1],n=e.subarray(2,r+2);if(!r||n.length!==r)throw new t("Invalid signature integer: wrong length");if(128&n[0])throw new t("Invalid signature integer: negative");if(0===n[0]&&!(128&n[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:ir(n),l:e.subarray(r+2)}},toSig(e){const{Err:t}=sr,r="string"===typeof e?ar(e):e;q(r);let n=r.length;if(n<2||48!=r[0])throw new t("Invalid signature tag");if(r[1]!==n-2)throw new t("Invalid signature: incorrect length");const{d:o,l:i}=sr._parseInt(r.subarray(2)),{d:a,l:s}=sr._parseInt(i);if(s.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:a}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,r=e=>{const t=e.toString(16);return 1&t.length?"0".concat(t):t},n=t(r(e.s)),o=t(r(e.r)),i=n.length/2,a=o.length/2,s=r(i),u=r(a);return"30".concat(r(a+i+4),"02").concat(u).concat(o,"02").concat(s).concat(n)}},ur=BigInt(0),cr=BigInt(1),lr=(BigInt(2),BigInt(3));BigInt(4);function fr(e){const t=function(e){const t=Pe(e);ae(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:o}=t;if(r){if(!n.eql(o,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!==typeof r||"bigint"!==typeof r.beta||"function"!==typeof r.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,n=t.toBytes||((e,t,n)=>{const o=t.toAffine();return ee(Uint8Array.from([4]),r.toBytes(o.x),r.toBytes(o.y))}),o=t.fromBytes||(e=>{const t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function i(e){const{a:n,b:o}=t,i=r.sqr(e),a=r.mul(i,e);return r.add(r.add(a,r.mul(e,n)),o)}if(!r.eql(r.sqr(t.Gy),i(t.Gx)))throw new Error("bad generator point: equation left != right");function a(e){return"bigint"===typeof e&&urr.eql(e,r.ZERO);return o(t)&&o(n)?f.ZERO:new f(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=r.invertBatch(e.map((e=>e.pz)));return e.map(((e,r)=>e.toAffine(t[r]))).map(f.fromAffine)}static fromHex(e){const t=f.fromAffine(o($("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return f.BASE.multiply(u(e))}_setWindowSize(e){this._WINDOW_SIZE=e,c.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:n}=this.toAffine();if(!r.isValid(e)||!r.isValid(n))throw new Error("bad point: x or y not FE");const o=r.sqr(n),a=i(e);if(!r.eql(o,a))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(r.isOdd)return!r.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){l(e);const{px:t,py:n,pz:o}=this,{px:i,py:a,pz:s}=e,u=r.eql(r.mul(t,s),r.mul(i,o)),c=r.eql(r.mul(n,s),r.mul(a,o));return u&&c}negate(){return new f(this.px,r.neg(this.py),this.pz)}double(){const{a:e,b:n}=t,o=r.mul(n,lr),{px:i,py:a,pz:s}=this;let u=r.ZERO,c=r.ZERO,l=r.ZERO,d=r.mul(i,i),h=r.mul(a,a),p=r.mul(s,s),y=r.mul(i,a);return y=r.add(y,y),l=r.mul(i,s),l=r.add(l,l),u=r.mul(e,l),c=r.mul(o,p),c=r.add(u,c),u=r.sub(h,c),c=r.add(h,c),c=r.mul(u,c),u=r.mul(y,u),l=r.mul(o,l),p=r.mul(e,p),y=r.sub(d,p),y=r.mul(e,y),y=r.add(y,l),l=r.add(d,d),d=r.add(l,d),d=r.add(d,p),d=r.mul(d,y),c=r.add(c,d),p=r.mul(a,s),p=r.add(p,p),d=r.mul(p,y),u=r.sub(u,d),l=r.mul(p,h),l=r.add(l,l),l=r.add(l,l),new f(u,c,l)}add(e){l(e);const{px:n,py:o,pz:i}=this,{px:a,py:s,pz:u}=e;let c=r.ZERO,d=r.ZERO,h=r.ZERO;const p=t.a,y=r.mul(t.b,lr);let m=r.mul(n,a),g=r.mul(o,s),v=r.mul(i,u),b=r.add(n,o),w=r.add(a,s);b=r.mul(b,w),w=r.add(m,g),b=r.sub(b,w),w=r.add(n,i);let A=r.add(a,u);return w=r.mul(w,A),A=r.add(m,v),w=r.sub(w,A),A=r.add(o,i),c=r.add(s,u),A=r.mul(A,c),c=r.add(g,v),A=r.sub(A,c),h=r.mul(p,w),c=r.mul(y,v),h=r.add(c,h),c=r.sub(g,h),h=r.add(g,h),d=r.mul(c,h),g=r.add(m,m),g=r.add(g,m),v=r.mul(p,v),w=r.mul(y,w),g=r.add(g,v),v=r.sub(m,v),v=r.mul(p,v),w=r.add(w,v),m=r.mul(g,w),d=r.add(d,m),m=r.mul(A,w),c=r.mul(b,c),c=r.sub(c,m),m=r.mul(b,g),h=r.mul(A,h),h=r.add(h,m),new f(c,d,h)}subtract(e){return this.add(e.negate())}is0(){return this.equals(f.ZERO)}wNAF(e){return h.wNAFCached(this,c,e,(e=>{const t=r.invertBatch(e.map((e=>e.pz)));return e.map(((e,r)=>e.toAffine(t[r]))).map(f.fromAffine)}))}multiplyUnsafe(e){const n=f.ZERO;if(e===ur)return n;if(s(e),e===cr)return this;const{endo:o}=t;if(!o)return h.unsafeLadder(this,e);let{k1neg:i,k1:a,k2neg:u,k2:c}=o.splitScalar(e),l=n,d=n,p=this;for(;a>ur||c>ur;)a&cr&&(l=l.add(p)),c&cr&&(d=d.add(p)),p=p.double(),a>>=cr,c>>=cr;return i&&(l=l.negate()),u&&(d=d.negate()),d=new f(r.mul(d.px,o.beta),d.py,d.pz),l.add(d)}multiply(e){s(e);let n,o,i=e;const{endo:a}=t;if(a){const{k1neg:e,k1:t,k2neg:s,k2:u}=a.splitScalar(i);let{p:c,f:l}=this.wNAF(t),{p:d,f:p}=this.wNAF(u);c=h.constTimeNegate(e,c),d=h.constTimeNegate(s,d),d=new f(r.mul(d.px,a.beta),d.py,d.pz),n=c.add(d),o=l.add(p)}else{const{p:e,f:t}=this.wNAF(i);n=e,o=t}return f.normalizeZ([n,o])[0]}multiplyAndAddUnsafe(e,t,r){const n=f.BASE,o=(e,t)=>t!==ur&&t!==cr&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),i=o(this,t).add(o(e,r));return i.is0()?void 0:i}toAffine(e){const{px:t,py:n,pz:o}=this,i=this.is0();null==e&&(e=i?r.ONE:r.inv(o));const a=r.mul(t,e),s=r.mul(n,e),u=r.mul(o,e);if(i)return{x:r.ZERO,y:r.ZERO};if(!r.eql(u,r.ONE))throw new Error("invZ was invalid");return{x:a,y:s}}isTorsionFree(){const{h:e,isTorsionFree:r}=t;if(e===cr)return!0;if(r)return r(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:r}=t;return e===cr?this:r?r(f,this):this.multiplyUnsafe(t.h)}toRawBytes(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.assertValidity(),n(f,this,e)}toHex(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return V(this.toRawBytes(e))}}f.BASE=new f(t.Gx,t.Gy,r.ONE),f.ZERO=new f(r.ZERO,r.ONE,r.ZERO);const d=t.nBitLength,h=Te(f,t.endo?Math.ceil(d/2):d);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:u,weierstrassEquation:i,isWithinCurveOrder:a}}function dr(e){const t=function(e){const t=Pe(e);return ae(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n:n}=t,o=r.BYTES+1,i=2*r.BYTES+1;function a(e){return pe(e,n)}function s(e){return ge(e,n)}const{ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:l,isWithinCurveOrder:f}=fr({...t,toBytes(e,t,n){const o=t.toAffine(),i=r.toBytes(o.x),a=ee;return n?a(Uint8Array.from([t.hasEvenY()?2:3]),i):a(Uint8Array.from([4]),i,r.toBytes(o.y))},fromBytes(e){const t=e.length,n=e[0],a=e.subarray(1);if(t!==o||2!==n&&3!==n){if(t===i&&4===n){return{x:r.fromBytes(a.subarray(0,r.BYTES)),y:r.fromBytes(a.subarray(r.BYTES,2*r.BYTES))}}throw new Error("Point of length ".concat(t," was invalid. Expected ").concat(o," compressed bytes or ").concat(i," uncompressed bytes"))}{const e=Z(a);if(!(ur<(s=e)&&sV(Y(e,t.nByteLength));function h(e){return e>n>>cr}const p=(e,t,r)=>Z(e.slice(t,r));class y{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){const r=t.nByteLength;return e=$("compactSignature",e,2*r),new y(p(e,0,r),p(e,r,2*r))}static fromDER(e){const{r:t,s:r}=sr.toSig($("DER",e));return new y(t,r)}assertValidity(){if(!f(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!f(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new y(this.r,this.s,e)}recoverPublicKey(e){const{r:n,s:o,recovery:i}=this,c=b($("msgHash",e));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");const l=2===i||3===i?n+t.n:n;if(l>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const f=0===(1&i)?"02":"03",h=u.fromHex(f+d(l)),p=s(l),y=a(-c*p),m=a(o*p),g=u.BASE.multiplyAndAddUnsafe(h,y,m);if(!g)throw new Error("point at infinify");return g.assertValidity(),g}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return X(this.toDERHex())}toDERHex(){return sr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return X(this.toCompactHex())}toCompactHex(){return d(this.r)+d(this.s)}}const m={isValidPrivateKey(e){try{return c(e),!0}catch(t){return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const e=_e(t.n);return function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=e.length,o=ke(t),i=_e(t);if(n<16||n1024)throw new Error("expected ".concat(i,"-1024 bytes of input, got ").concat(n));const a=pe(r?Z(e):Q(e),t-ue)+ue;return r?J(a,o):Y(a,o)}(t.randomBytes(e),t.n)},precompute(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.BASE;return t._setWindowSize(e),t.multiply(BigInt(3)),t}};function g(e){const t=z(e),r="string"===typeof e,n=(t||r)&&e.length;return t?n===o||n===i:r?n===2*o||n===2*i:e instanceof u}const v=t.bits2int||function(e){const r=Z(e),n=8*e.length-t.nBitLength;return n>0?r>>BigInt(n):r},b=t.bits2int_modN||function(e){return a(v(e))},w=te(t.nBitLength);function A(e){if("bigint"!==typeof e)throw new Error("bigint expected");if(!(ur<=e&&e2&&void 0!==arguments[2]?arguments[2]:k;if(["recovered","canonical"].some((e=>e in o)))throw new Error("sign() legacy options not supported");const{hash:i,randomBytes:l}=t;let{lowS:d,prehash:p,extraEntropy:m}=o;null==d&&(d=!0),e=$("msgHash",e),p&&(e=$("prehashed msgHash",i(e)));const g=b(e),w=c(n),S=[A(w),A(g)];if(null!=m&&!1!==m){const e=!0===m?l(r.BYTES):m;S.push($("extraEntropy",e))}const _=ee(...S),E=g;return{seed:_,k2sig:function(e){const t=v(e);if(!f(t))return;const r=s(t),n=u.BASE.multiply(t).toAffine(),o=a(n.x);if(o===ur)return;const i=a(r*a(E+o*w));if(i===ur)return;let c=(n.x===o?0:2)|Number(n.y&cr),l=i;return d&&h(i)&&(l=function(e){return h(e)?a(-e):e}(i),c^=1),new y(o,l,c)}}}const k={lowS:t.lowS,prehash:!1},_={lowS:t.lowS,prehash:!1};return u.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return u.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(g(e))throw new Error("first arg must be private key");if(!g(t))throw new Error("second arg must be public key");return u.fromHex(t).multiply(c(e)).toRawBytes(r)},sign:function(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k;const{seed:o,k2sig:i}=S(e,r,n),a=t;return oe(a.hash.outputLen,a.nByteLength,a.hmac)(o,i)},verify:function(e,r,n){var o;let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:_;const c=e;if(r=$("msgHash",r),n=$("publicKey",n),"strict"in i)throw new Error("options.strict was renamed to lowS");const{lowS:l,prehash:f}=i;let d,h;try{if("string"===typeof c||z(c))try{d=y.fromDER(c)}catch(k){if(!(k instanceof sr.Err))throw k;d=y.fromCompact(c)}else{if("object"!==typeof c||"bigint"!==typeof c.r||"bigint"!==typeof c.s)throw new Error("PARSE");{const{r:e,s:t}=c;d=new y(e,t)}}h=u.fromHex(n)}catch(E){if("PARSE"===E.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(l&&d.hasHighS())return!1;f&&(r=t.hash(r));const{r:p,s:m}=d,g=b(r),v=s(m),w=a(g*v),A=a(p*v),S=null===(o=u.BASE.multiplyAndAddUnsafe(h,w,A))||void 0===o?void 0:o.toAffine();return!!S&&a(S.x)===p},ProjectivePoint:u,Signature:y,utils:m}}function hr(e){return{hash:e,hmac:function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o(e+t/gr)/t;function br(e){const t=pr,r=BigInt(3),n=BigInt(6),o=BigInt(11),i=BigInt(22),a=BigInt(23),s=BigInt(44),u=BigInt(88),c=e*e*e%t,l=c*c*e%t,f=me(l,r,t)*l%t,d=me(f,r,t)*l%t,h=me(d,gr,t)*c%t,p=me(h,o,t)*h%t,y=me(p,i,t)*p%t,m=me(y,s,t)*y%t,g=me(m,u,t)*m%t,v=me(g,s,t)*y%t,b=me(v,r,t)*l%t,w=me(b,a,t)*p%t,A=me(w,n,t)*c%t,S=me(A,gr,t);if(!wr.eql(wr.sqr(S),e))throw new Error("Cannot find square root");return S}const wr=Se(pr,void 0,void 0,{sqrt:br}),Ar=function(e,t){const r=t=>dr({...e,...hr(t)});return Object.freeze({...r(t),create:r})}({a:BigInt(0),b:BigInt(7),Fp:wr,n:yr,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=yr,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-mr*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=r,a=BigInt("0x100000000000000000000000000000000"),s=vr(i*e,t),u=vr(-n*e,t);let c=pe(e-s*r-u*o,t),l=pe(-s*n-u*i,t);const f=c>a,d=l>a;if(f&&(c=t-c),d&&(l=t-l),c>a||l>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:c,k2neg:d,k2:l}}}},at);BigInt(0);Ar.ProjectivePoint;const Sr=Ze.utils.randomPrivateKey,kr=()=>{const e=Ze.utils.randomPrivateKey(),t=_r(e),r=new Uint8Array(64);return r.set(e),r.set(t,32),{publicKey:t,secretKey:r}},_r=Ze.getPublicKey;function Er(e){try{return Ze.ExtendedPoint.fromHex(e),!0}catch{return!1}}const xr=(e,t)=>Ze.sign(e,t.slice(0,32)),Tr=Ze.verify,Pr=e=>o.Buffer.isBuffer(e)?e:e instanceof Uint8Array?o.Buffer.from(e.buffer,e.byteOffset,e.byteLength):o.Buffer.from(e);class Or{constructor(e){Object.assign(this,e)}encode(){return o.Buffer.from((0,st.serialize)(Ir,this))}static decode(e){return(0,st.deserialize)(Ir,this,e)}static decodeUnchecked(e){return(0,st.deserializeUnchecked)(Ir,this,e)}}class Rr extends Or{constructor(e){if(super(e),this.enum="",1!==Object.keys(e).length)throw new Error("Enum can only take single value");Object.keys(e).map((e=>{this.enum=e}))}}const Ir=new Map;var Cr;const Mr=32,Br=32;let Nr=1;class Lr extends Or{constructor(e){if(super({}),this._bn=void 0,function(e){return void 0!==e._bn}(e))this._bn=e._bn;else{if("string"===typeof e){const t=tt().decode(e);if(t.length!=Br)throw new Error("Invalid public key input");this._bn=new($e())(t)}else this._bn=new($e())(e);if(this._bn.byteLength()>Br)throw new Error("Invalid public key input")}}static unique(){const e=new Lr(Nr);return Nr+=1,new Lr(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return tt().encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(o.Buffer);if(e.length===Br)return e;const t=o.Buffer.alloc(32);return e.copy(t,32-e.length),t}get[Symbol.toStringTag](){return"PublicKey(".concat(this.toString(),")")}toString(){return this.toBase58()}static async createWithSeed(e,t,r){const n=o.Buffer.concat([e.toBuffer(),o.Buffer.from(t),r.toBuffer()]),i=at(n);return new Lr(i)}static createProgramAddressSync(e,t){let r=o.Buffer.alloc(0);e.forEach((function(e){if(e.length>Mr)throw new TypeError("Max seed length exceeded");r=o.Buffer.concat([r,Pr(e)])})),r=o.Buffer.concat([r,t.toBuffer(),o.Buffer.from("ProgramDerivedAddress")]);const n=at(r);if(Er(n))throw new Error("Invalid seeds, address must fall off the curve");return new Lr(n)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let r,n=255;for(;0!=n;){try{const i=e.concat(o.Buffer.from([n]));r=this.createProgramAddressSync(i,t)}catch(i){if(i instanceof TypeError)throw i;n--;continue}return[r,n]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){return Er(new Lr(e).toBytes())}}Cr=Lr,Lr.default=new Cr("11111111111111111111111111111111"),Ir.set(Lr,{kind:"struct",fields:[["_bn","u256"]]});class jr{constructor(e){if(this._publicKey=void 0,this._secretKey=void 0,e){const t=Pr(e);if(64!==e.length)throw new Error("bad secret key size");this._publicKey=t.slice(32,64),this._secretKey=t.slice(0,32)}else this._secretKey=Pr(Sr()),this._publicKey=Pr(_r(this._secretKey))}get publicKey(){return new Lr(this._publicKey)}get secretKey(){return o.Buffer.concat([this._secretKey,this._publicKey],64)}}const Ur=new Lr("BPFLoader1111111111111111111111111111111111"),Fr=1232,Dr=127,zr=64;class qr extends Error{constructor(e){super("Signature ".concat(e," has expired: block height exceeded.")),this.signature=void 0,this.signature=e}}Object.defineProperty(qr.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class Hr extends Error{constructor(e,t){super("Transaction was not confirmed in ".concat(t.toFixed(2)," seconds. It is ")+"unknown if it succeeded or failed. Check signature "+"".concat(e," using the Solana Explorer or CLI tools.")),this.signature=void 0,this.signature=e}}Object.defineProperty(Hr.prototype,"name",{value:"TransactionExpiredTimeoutError"});class Vr extends Error{constructor(e){super("Signature ".concat(e," has expired: the nonce is no longer valid.")),this.signature=void 0,this.signature=e}}Object.defineProperty(Vr.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class Kr{constructor(e,t){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=t}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const t of this.keySegments()){if(e256)throw new Error("Account index overflow encountered during compilation");const t=new Map;this.keySegments().flat().forEach(((e,r)=>{t.set(e.toBase58(),r)}));const r=e=>{const r=t.get(e.toBase58());if(void 0===r)throw new Error("Encountered an unknown instruction account key during compilation");return r};return e.map((e=>({programIdIndex:r(e.programId),accountKeyIndexes:e.keys.map((e=>r(e.pubkey))),data:e.data})))}}const Wr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"publicKey";return ut.av(32,e)},Gr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature";return ut.av(64,e)},Xr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"string";const t=ut.w3([ut.DH("length"),ut.DH("lengthPadding"),ut.av(ut.cY(ut.DH(),-8),"chars")],e),r=t.decode.bind(t),n=t.encode.bind(t),i=t;return i.decode=(e,t)=>r(e,t).chars.toString(),i.encode=(e,t,r)=>{const i={chars:o.Buffer.from(e,"utf8")};return n(i,t,r)},i.alloc=e=>ut.DH().span+ut.DH().span+o.Buffer.from(e,"utf8").length,i};function Zr(e,t){const r=e=>{if(e.span>=0)return e.span;if("function"===typeof e.alloc)return e.alloc(t[e.property]);if("count"in e&&"elementLayout"in e){const n=t[e.property];if(Array.isArray(n))return n.length*r(e.elementLayout)}else if("fields"in e)return Zr({layout:e},t[e.property]);return 0};let n=0;return e.layout.fields.forEach((e=>{n+=r(e)})),n}function Qr(e){let t=0,r=0;for(;;){let n=e.shift();if(t|=(127&n)<<7*r,r+=1,0===(128&n))break}return t}function Yr(e,t){let r=t;for(;;){let t=127&r;if(r>>=7,0==r){e.push(t);break}t|=128,e.push(t)}}function Jr(e,t){if(!e)throw new Error(t||"Assertion failed")}class $r{constructor(e,t){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=t}static compile(e,t){const r=new Map,n=e=>{const t=e.toBase58();let n=r.get(t);return void 0===n&&(n={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(t,n)),n},o=n(t);o.isSigner=!0,o.isWritable=!0;for(const i of e){n(i.programId).isInvoked=!0;for(const e of i.keys){const t=n(e.pubkey);t.isSigner||(t.isSigner=e.isSigner),t.isWritable||(t.isWritable=e.isWritable)}}return new $r(t,r)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];Jr(e.length<=256,"Max static account keys length exceeded");const t=e.filter((e=>{let[,t]=e;return t.isSigner&&t.isWritable})),r=e.filter((e=>{let[,t]=e;return t.isSigner&&!t.isWritable})),n=e.filter((e=>{let[,t]=e;return!t.isSigner&&t.isWritable})),o=e.filter((e=>{let[,t]=e;return!t.isSigner&&!t.isWritable})),i={numRequiredSignatures:t.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:o.length};{Jr(t.length>0,"Expected at least one writable signer key");const[e]=t[0];Jr(e===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}return[i,[...t.map((e=>{let[t]=e;return new Lr(t)})),...r.map((e=>{let[t]=e;return new Lr(t)})),...n.map((e=>{let[t]=e;return new Lr(t)})),...o.map((e=>{let[t]=e;return new Lr(t)}))]]}extractTableLookup(e){const[t,r]=this.drainKeysFoundInLookupTable(e.state.addresses,(e=>!e.isSigner&&!e.isInvoked&&e.isWritable)),[n,o]=this.drainKeysFoundInLookupTable(e.state.addresses,(e=>!e.isSigner&&!e.isInvoked&&!e.isWritable));if(0!==t.length||0!==n.length)return[{accountKey:e.key,writableIndexes:t,readonlyIndexes:n},{writable:r,readonly:o}]}drainKeysFoundInLookupTable(e,t){const r=new Array,n=new Array;for(const[o,i]of this.keyMetaMap.entries())if(t(i)){const t=new Lr(o),i=e.findIndex((e=>e.equals(t)));i>=0&&(Jr(i<256,"Max lookup table index exceeded"),r.push(i),n.push(t),this.keyMetaMap.delete(o))}return[r,n]}}const en="Reached end of buffer unexpectedly";function tn(e){if(0===e.length)throw new Error(en);return e.shift()}function rn(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),o=1;oe.length:i>=e.length)throw new Error(en);return e.splice(...n)}class nn{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map((e=>new Lr(e))),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach((e=>this.indexToProgramIds.set(e.programIdIndex,this.accountKeys[e.programIdIndex])))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map((e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:tt().decode(e.data)})))}get addressTableLookups(){return[]}getAccountKeys(){return new Kr(this.staticAccountKeys)}static compile(e){const t=$r.compile(e.instructions,e.payerKey),[r,n]=t.getMessageComponents(),o=new Kr(n).compileInstructions(e.instructions).map((e=>({programIdIndex:e.programIdIndex,accounts:e.accountKeyIndexes,data:tt().encode(e.data)})));return new nn({header:r,accountKeys:n,recentBlockhash:e.recentBlockhash,instructions:o})}isAccountSigner(e){return e=this.header.numRequiredSignatures){return e-t!this.isProgramId(t)))}serialize(){const e=this.accountKeys.length;let t=[];Yr(t,e);const r=this.instructions.map((e=>{const{accounts:t,programIdIndex:r}=e,n=Array.from(tt().decode(e.data));let i=[];Yr(i,t.length);let a=[];return Yr(a,n.length),{programIdIndex:r,keyIndicesCount:o.Buffer.from(i),keyIndices:t,dataLength:o.Buffer.from(a),data:n}}));let n=[];Yr(n,r.length);let i=o.Buffer.alloc(Fr);o.Buffer.from(n).copy(i);let a=n.length;r.forEach((e=>{const t=ut.w3([ut.u8("programIdIndex"),ut.av(e.keyIndicesCount.length,"keyIndicesCount"),ut.O6(ut.u8("keyIndex"),e.keyIndices.length,"keyIndices"),ut.av(e.dataLength.length,"dataLength"),ut.O6(ut.u8("userdatum"),e.data.length,"data")]).encode(e,i,a);a+=t})),i=i.slice(0,a);const s=ut.w3([ut.av(1,"numRequiredSignatures"),ut.av(1,"numReadonlySignedAccounts"),ut.av(1,"numReadonlyUnsignedAccounts"),ut.av(t.length,"keyCount"),ut.O6(Wr("key"),e,"keys"),Wr("recentBlockhash")]),u={numRequiredSignatures:o.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:o.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:o.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:o.Buffer.from(t),keys:this.accountKeys.map((e=>Pr(e.toBytes()))),recentBlockhash:tt().decode(this.recentBlockhash)};let c=o.Buffer.alloc(2048);const l=s.encode(u,c);return i.copy(c,l),c.slice(0,l+i.length)}static from(e){let t=[...e];const r=tn(t);if(r!==(r&Dr))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const n=tn(t),i=tn(t),a=Qr(t);let s=[];for(let d=0;d0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new Kr(this.staticAccountKeys,t)}isAccountSigner(e){return e=r){return e-re+t.writableIndexes.length),0)}if(e>=this.header.numRequiredSignatures){return e-te.key.equals(r.accountKey)));if(!n)throw new Error("Failed to find address lookup table account for table key ".concat(r.accountKey.toBase58()));for(const e of r.writableIndexes){if(!(ee.toBytes())),recentBlockhash:tt().decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:t,addressTableLookupsLength:new Uint8Array(o),serializedAddressTableLookups:n},a);return a.slice(0,s)}serializeInstructions(){let e=0;const t=new Uint8Array(Fr);for(const r of this.compiledInstructions){const n=Array();Yr(n,r.accountKeyIndexes.length);const o=Array();Yr(o,r.data.length);e+=ut.w3([ut.u8("programIdIndex"),ut.av(n.length,"encodedAccountKeyIndexesLength"),ut.O6(ut.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),ut.av(o.length,"encodedDataLength"),ut.av(r.data.length,"data")]).encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(n),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(o),data:r.data},t,e)}return t.slice(0,e)}serializeAddressTableLookups(){let e=0;const t=new Uint8Array(Fr);for(const r of this.addressTableLookups){const n=Array();Yr(n,r.writableIndexes.length);const o=Array();Yr(o,r.readonlyIndexes.length);e+=ut.w3([Wr("accountKey"),ut.av(n.length,"encodedWritableIndexesLength"),ut.O6(ut.u8(),r.writableIndexes.length,"writableIndexes"),ut.av(o.length,"encodedReadonlyIndexesLength"),ut.O6(ut.u8(),r.readonlyIndexes.length,"readonlyIndexes")]).encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(n),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(o),readonlyIndexes:r.readonlyIndexes},t,e)}return t.slice(0,e)}static deserialize(e){let t=[...e];const r=tn(t),n=r&Dr;Jr(r!==n,"Expected versioned message but received legacy message");Jr(0===n,"Expected versioned message with version 0 but found version ".concat(n));const o={numRequiredSignatures:tn(t),numReadonlySignedAccounts:tn(t),numReadonlyUnsignedAccounts:tn(t)},i=[],a=Qr(t);for(let d=0;d{const t=an.deserializeMessageVersion(e);if("legacy"===t)return nn.from(e);if(0===t)return on.deserialize(e);throw new Error("Transaction message version ".concat(t," deserialization is not supported"))}};let sn=function(e){return e[e.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",e[e.PROCESSED=1]="PROCESSED",e[e.TIMED_OUT=2]="TIMED_OUT",e[e.NONCE_INVALID=3]="NONCE_INVALID",e}({});const un=o.Buffer.alloc(zr).fill(0);class cn{constructor(e){this.keys=void 0,this.programId=void 0,this.data=o.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map((e=>{let{pubkey:t,isSigner:r,isWritable:n}=e;return{pubkey:t.toJSON(),isSigner:r,isWritable:n}})),programId:this.programId.toJSON(),data:[...this.data]}}}class ln{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:t,nonceInfo:r}=e;this.minNonceContextSlot=t,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:t,lastValidBlockHeight:r}=e;this.recentBlockhash=t,this.lastValidBlockHeight=r}else{const{recentBlockhash:t,nonceInfo:r}=e;r&&(this.nonceInfo=r),this.recentBlockhash=t}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map((e=>e.toJSON())),signers:this.signatures.map((e=>{let{publicKey:t}=e;return t.toJSON()}))}}add(){for(var e=arguments.length,t=new Array(e),r=0;r{"instructions"in e?this.instructions=this.instructions.concat(e.instructions):"data"in e&&"programId"in e&&"keys"in e?this.instructions.push(e):this.instructions.push(new cn(e))})),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,t,r;if(this.nonceInfo?(e=this.nonceInfo.nonce,t=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction,...this.instructions]:this.instructions):(e=this.recentBlockhash,t=this.instructions),!e)throw new Error("Transaction recentBlockhash required");if(t.length<1&&console.warn("No instructions provided"),this.feePayer)r=this.feePayer;else{if(!(this.signatures.length>0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");r=this.signatures[0].publicKey}for(let p=0;p{e.keys.forEach((e=>{o.push({...e})}));const t=e.programId.toString();n.includes(t)||n.push(t)})),n.forEach((e=>{o.push({pubkey:new Lr(e),isSigner:!1,isWritable:!1})}));const i=[];o.forEach((e=>{const t=e.pubkey.toString(),r=i.findIndex((e=>e.pubkey.toString()===t));r>-1?(i[r].isWritable=i[r].isWritable||e.isWritable,i[r].isSigner=i[r].isSigner||e.isSigner):i.push(e)})),i.sort((function(e,t){if(e.isSigner!==t.isSigner)return e.isSigner?-1:1;if(e.isWritable!==t.isWritable)return e.isWritable?-1:1;return e.pubkey.toBase58().localeCompare(t.pubkey.toBase58(),"en",{localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"})}));const a=i.findIndex((e=>e.pubkey.equals(r)));if(a>-1){const[e]=i.splice(a,1);e.isSigner=!0,e.isWritable=!0,i.unshift(e)}else i.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(const p of this.signatures){const e=i.findIndex((e=>e.pubkey.equals(p.publicKey)));if(!(e>-1))throw new Error("unknown signer: ".concat(p.publicKey.toString()));i[e].isSigner||(i[e].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."))}let s=0,u=0,c=0;const l=[],f=[];i.forEach((e=>{let{pubkey:t,isSigner:r,isWritable:n}=e;r?(l.push(t.toString()),s+=1,n||(u+=1)):(f.push(t.toString()),n||(c+=1))}));const d=l.concat(f),h=t.map((e=>{const{data:t,programId:r}=e;return{programIdIndex:d.indexOf(r.toString()),accounts:e.keys.map((e=>d.indexOf(e.pubkey.toString()))),data:tt().encode(t)}}));return h.forEach((e=>{Jr(e.programIdIndex>=0),e.accounts.forEach((e=>Jr(e>=0)))})),new nn({header:{numRequiredSignatures:s,numReadonlySignedAccounts:u,numReadonlyUnsignedAccounts:c},accountKeys:d,recentBlockhash:e,instructions:h})}_compile(){const e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);if(this.signatures.length===t.length){if(this.signatures.every(((e,r)=>t[r].equals(e.publicKey))))return e}return this.signatures=t.map((e=>({signature:null,publicKey:e}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(){for(var e=arguments.length,t=new Array(e),r=0;r{const t=e.toString();return!n.has(t)&&(n.add(t),!0)})).map((e=>({signature:null,publicKey:e})))}sign(){for(var e=arguments.length,t=new Array(e),r=0;r({signature:null,publicKey:e.publicKey})));const i=this._compile();this._partialSign(i,...o)}partialSign(){for(var e=arguments.length,t=new Array(e),r=0;r1?r-1:0),o=1;o{const r=xr(t,e.secretKey);this._addSignature(e.publicKey,Pr(r))}))}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){Jr(64===t.length);const r=this.signatures.findIndex((t=>e.equals(t.publicKey)));if(r<0)throw new Error("unknown signer: ".concat(e.toString()));this.signatures[r].signature=o.Buffer.from(t)}verifySignatures(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,t){const r={};for(const{signature:n,publicKey:o}of this.signatures)null===n?t&&(r.missing||(r.missing=[])).push(o):Tr(n,e,o.toBytes())||(r.invalid||(r.invalid=[])).push(o);return r.invalid||r.missing?r:void 0}serialize(e){const{requireAllSignatures:t,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),n=this.serializeMessage();if(r){const e=this._getMessageSignednessErrors(n,t);if(e){let t="Signature verification failed.";throw e.invalid&&(t+="\nInvalid signature for public key".concat(1===e.invalid.length?"":"(s)"," [`").concat(e.invalid.map((e=>e.toBase58())).join("`, `"),"`].")),e.missing&&(t+="\nMissing signature for public key".concat(1===e.missing.length?"":"(s)"," [`").concat(e.missing.map((e=>e.toBase58())).join("`, `"),"`].")),new Error(t)}}return this._serialize(n)}_serialize(e){const{signatures:t}=this,r=[];Yr(r,t.length);const n=r.length+64*t.length+e.length,i=o.Buffer.alloc(n);return Jr(t.length<256),o.Buffer.from(r).copy(i,0),t.forEach(((e,t)=>{let{signature:n}=e;null!==n&&(Jr(64===n.length,"signature has invalid length"),o.Buffer.from(n).copy(i,r.length+64*t))})),e.copy(i,r.length+64*t.length),Jr(i.length<=Fr,"Transaction too large: ".concat(i.length," > ").concat(Fr)),i}get keys(){return Jr(1===this.instructions.length),this.instructions[0].keys.map((e=>e.pubkey))}get programId(){return Jr(1===this.instructions.length),this.instructions[0].programId}get data(){return Jr(1===this.instructions.length),this.instructions[0].data}static from(e){let t=[...e];const r=Qr(t);let n=[];for(let i=0;i1&&void 0!==arguments[1]?arguments[1]:[];const r=new ln;return r.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(r.feePayer=e.accountKeys[0]),t.forEach(((t,n)=>{const o={signature:t==tt().encode(un)?null:tt().decode(t),publicKey:e.accountKeys[n]};r.signatures.push(o)})),e.instructions.forEach((t=>{const n=t.accounts.map((t=>{const n=e.accountKeys[t];return{pubkey:n,isSigner:r.signatures.some((e=>e.publicKey.toString()===n.toString()))||e.isAccountSigner(t),isWritable:e.isAccountWritable(t)}}));r.instructions.push(new cn({keys:n,programId:e.accountKeys[t.programIdIndex],data:tt().decode(t.data)}))})),r._message=e,r._json=r.toJSON(),r}}class fn{constructor(e){this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=e.payerKey,this.instructions=e.instructions,this.recentBlockhash=e.recentBlockhash}static decompile(e,t){const{header:r,compiledInstructions:n,recentBlockhash:o}=e,{numRequiredSignatures:i,numReadonlySignedAccounts:a,numReadonlyUnsignedAccounts:s}=r,u=i-a;Jr(u>0,"Message header is invalid");const c=e.staticAccountKeys.length-i-s;Jr(c>=0,"Message header is invalid");const l=e.getAccountKeys(t),f=l.get(0);if(void 0===f)throw new Error("Failed to decompile message because no account keys were found");const d=[];for(const h of n){const e=[];for(const n of h.accountKeyIndexes){const t=l.get(n);if(void 0===t)throw new Error("Failed to find key for account key index ".concat(n));let o;o=ne.equals(n.publicKey)));Jr(e>=0,"Cannot sign with non signer key ".concat(n.publicKey.toBase58())),this.signatures[e]=xr(t,n.secretKey)}}addSignature(e,t){Jr(64===t.byteLength,"Signature must be 64 bytes long");const r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex((t=>t.equals(e)));Jr(r>=0,"Can not add signature; `".concat(e.toBase58(),"` is not required to sign this transaction")),this.signatures[r]=t}}const hn=new Lr("SysvarC1ock11111111111111111111111111111111"),pn=new Lr("SysvarEpochSchedu1e111111111111111111111111"),yn=new Lr("Sysvar1nstructions1111111111111111111111111"),mn=new Lr("SysvarRecentB1ockHashes11111111111111111111"),gn=new Lr("SysvarRent111111111111111111111111111111111"),vn=new Lr("SysvarRewards111111111111111111111111111111"),bn=new Lr("SysvarS1otHashes111111111111111111111111111"),wn=new Lr("SysvarS1otHistory11111111111111111111111111"),An=new Lr("SysvarStakeHistory1111111111111111111111111");async function Sn(e,t,r,n){const o=n&&{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment,maxRetries:n.maxRetries,minContextSlot:n.minContextSlot},i=await e.sendTransaction(t,r,o);let a;if(null!=t.recentBlockhash&&null!=t.lastValidBlockHeight)a=(await e.confirmTransaction({abortSignal:null===n||void 0===n?void 0:n.abortSignal,signature:i,blockhash:t.recentBlockhash,lastValidBlockHeight:t.lastValidBlockHeight},n&&n.commitment)).value;else if(null!=t.minNonceContextSlot&&null!=t.nonceInfo){const{nonceInstruction:r}=t.nonceInfo,o=r.keys[0].pubkey;a=(await e.confirmTransaction({abortSignal:null===n||void 0===n?void 0:n.abortSignal,minContextSlot:t.minNonceContextSlot,nonceAccountPubkey:o,nonceValue:t.nonceInfo.nonce,signature:i},n&&n.commitment)).value}else null!=(null===n||void 0===n?void 0:n.abortSignal)&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),a=(await e.confirmTransaction(i,n&&n.commitment)).value;if(a.err)throw new Error("Transaction ".concat(i," failed (").concat(JSON.stringify(a),")"));return i}function kn(e){return new Promise((t=>setTimeout(t,e)))}function _n(e,t){const r=e.layout.span>=0?e.layout.span:Zr(e,t),n=o.Buffer.alloc(r),i=Object.assign({instruction:e.index},t);return e.layout.encode(i,n),n}function En(e,t){let r;try{r=e.layout.decode(t)}catch(n){throw new Error("invalid instruction; "+n)}if(r.instruction!==e.index)throw new Error("invalid instruction; instruction index mismatch ".concat(r.instruction," != ").concat(e.index));return r}const xn=ut.I0("lamportsPerSignature"),Tn=ut.w3([ut.DH("version"),ut.DH("state"),Wr("authorizedPubkey"),Wr("nonce"),ut.w3([xn],"feeCalculator")]),Pn=Tn.span;class On{constructor(e){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=e.authorizedPubkey,this.nonce=e.nonce,this.feeCalculator=e.feeCalculator}static fromAccountData(e){const t=Tn.decode(Pr(e),0);return new On({authorizedPubkey:new Lr(t.authorizedPubkey),nonce:new Lr(t.nonce).toString(),feeCalculator:t.feeCalculator})}}const Rn=(In=8,e=>{const t=(0,ut.av)(In,e),{encode:r,decode:n}=(e=>({decode:e.decode.bind(e),encode:e.encode.bind(e)}))(t),i=t;return i.decode=(e,t)=>{const r=n(e,t);return(0,ct.k5)(o.Buffer.from(r))},i.encode=(e,t,n)=>{const o=(0,ct.Bq)(e,In);return r(o,t,n)},i});var In;class Cn{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const t=ut.DH("instruction").decode(e.data);let r;for(const[n,o]of Object.entries(Mn))if(o.index==t){r=n;break}if(!r)throw new Error("Instruction type incorrect; not a SystemInstruction");return r}static decodeCreateAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{lamports:t,space:r,programId:n}=En(Mn.Create,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,lamports:t,space:r,programId:new Lr(n)}}static decodeTransfer(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{lamports:t}=En(Mn.Transfer,e.data);return{fromPubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,lamports:t}}static decodeTransferWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t,seed:r,programId:n}=En(Mn.TransferWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,basePubkey:e.keys[1].pubkey,toPubkey:e.keys[2].pubkey,lamports:t,seed:r,programId:new Lr(n)}}static decodeAllocate(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{space:t}=En(Mn.Allocate,e.data);return{accountPubkey:e.keys[0].pubkey,space:t}}static decodeAllocateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:t,seed:r,space:n,programId:o}=En(Mn.AllocateWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new Lr(t),seed:r,space:n,programId:new Lr(o)}}static decodeAssign(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{programId:t}=En(Mn.Assign,e.data);return{accountPubkey:e.keys[0].pubkey,programId:new Lr(t)}}static decodeAssignWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,1);const{base:t,seed:r,programId:n}=En(Mn.AssignWithSeed,e.data);return{accountPubkey:e.keys[0].pubkey,basePubkey:new Lr(t),seed:r,programId:new Lr(n)}}static decodeCreateWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{base:t,seed:r,lamports:n,space:o,programId:i}=En(Mn.CreateWithSeed,e.data);return{fromPubkey:e.keys[0].pubkey,newAccountPubkey:e.keys[1].pubkey,basePubkey:new Lr(t),seed:r,lamports:n,space:o,programId:new Lr(i)}}static decodeNonceInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{authorized:t}=En(Mn.InitializeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:new Lr(t)}}static decodeNonceAdvance(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),En(Mn.AdvanceNonceAccount,e.data),{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static decodeNonceWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:t}=En(Mn.WithdrawNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t}}static decodeNonceAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:t}=En(Mn.AuthorizeNonceAccount,e.data);return{noncePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[1].pubkey,newAuthorizedPubkey:new Lr(t)}}static checkProgramId(e){if(!e.equals(Bn.programId))throw new Error("invalid instruction; programId is not SystemProgram")}static checkKeyLength(e,t){if(e.length0?o:1,space:i.length,programId:n}));null!==s&&await Sn(e,s,[t,r],{commitment:"confirmed"})}const a=ut.w3([ut.DH("instruction"),ut.DH("offset"),ut.DH("bytesLength"),ut.DH("bytesLengthPadding"),ut.O6(ut.u8("byte"),ut.cY(ut.DH(),-8),"bytes")]),s=Ln.chunkSize;let u=0,c=i,l=[];for(;c.length>0;){const i=c.slice(0,s),f=o.Buffer.alloc(s+16);a.encode({instruction:0,offset:u,bytes:i,bytesLength:0,bytesLengthPadding:0},f);const d=(new ln).add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:n,data:f});if(l.push(Sn(e,d,[t,r],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")){const e=4;await kn(1e3/e)}u+=s,c=c.slice(s)}await Promise.all(l);{const i=ut.w3([ut.DH("instruction")]),a=o.Buffer.alloc(i.span);i.encode({instruction:1},a);const s=(new ln).add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:gn,isSigner:!1,isWritable:!1}],programId:n,data:a}),u="processed",c=await e.sendTransaction(s,[t,r],{preflightCommitment:u}),{context:l,value:f}=await e.confirmTransaction({signature:c,lastValidBlockHeight:s.lastValidBlockHeight,blockhash:s.recentBlockhash},u);if(f.err)throw new Error("Transaction ".concat(c," failed (").concat(JSON.stringify(f),")"));for(;;){try{if(await e.getSlot({commitment:u})>l.slot)break}catch{}await new Promise((e=>setTimeout(e,Math.round(200))))}}return!0}}Ln.chunkSize=Nn;const jn=new Lr("BPFLoader2111111111111111111111111111111111");class Un{static getMinNumSignatures(e){return Ln.getMinNumSignatures(e)}static load(e,t,r,n,o){return Ln.load(e,t,r,o,n)}}function Fn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dn=Object.prototype.toString,zn=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};function qn(e,t){var r,n,o,i,a,s,u;if(!0===e)return"true";if(!1===e)return"false";switch(typeof e){case"object":if(null===e)return null;if(e.toJSON&&"function"===typeof e.toJSON)return qn(e.toJSON(),t);if("[object Array]"===(u=Dn.call(e))){for(o="[",n=e.length-1,r=0;r-1&&(o+=qn(e[r],!0)),o+"]"}if("[object Object]"===u){for(n=(i=zn(e).sort()).length,o="",r=0;r1;)e/=2,t++;return t}class Kn{constructor(e,t,r,n,o){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=e,this.leaderScheduleSlotOffset=t,this.warmup=r,this.firstNormalEpoch=n,this.firstNormalSlot=o}getEpoch(e){return this.getEpochAndSlotIndex(e)[0]}getEpochAndSlotIndex(e){if(e>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,1+(t|=t>>32)))-Vn(32)-1;return[r,e-(this.getSlotsInEpoch(r)-32)]}{const t=e-this.firstNormalSlot,r=Math.floor(t/this.slotsPerEpoch);return[this.firstNormalEpoch+r,t%this.slotsPerEpoch]}var t}getFirstSlotInEpoch(e){return e<=this.firstNormalEpoch?32*(Math.pow(2,e)-1):(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}getSlotsInEpoch(e){return e{const r=(0,Dt.A)(e,{autoconnect:!0,max_reconnects:5,reconnect:!0,reconnect_interval:1e3,...t});return this.underlyingSocket="socket"in r?r.socket:r,r}),e,t,r),this.underlyingSocket=void 0}call(){var e;const t=null===(e=this.underlyingSocket)||void 0===e?void 0:e.readyState;return 1===t?super.call(...arguments):Promise.reject(new Error("Tried to call a JSON-RPC method `"+(arguments.length<=0?void 0:arguments[0])+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+t+")"))}notify(){var e;const t=null===(e=this.underlyingSocket)||void 0===e?void 0:e.readyState;return 1===t?super.notify(...arguments):Promise.reject(new Error("Tried to send a JSON-RPC notification `"+(arguments.length<=0?void 0:arguments[0])+"` but the socket was not `CONNECTING` or `OPEN` (`readyState` was "+t+")"))}}class Yn{constructor(e){this.key=void 0,this.state=void 0,this.key=e.key,this.state=e.state}isActive(){const e=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===e}static deserialize(e){const t=function(e,t){let r;try{r=e.layout.decode(t)}catch(n){throw new Error("invalid instruction; "+n)}if(r.typeIndex!==e.index)throw new Error("invalid account data; account type mismatch ".concat(r.typeIndex," != ").concat(e.index));return r}(Jn,e),r=e.length-56;Jr(r>=0,"lookup table is invalid"),Jr(r%32===0,"lookup table is invalid");const n=r/32,{addresses:o}=ut.w3([ut.O6(Wr(),n,"addresses")]).decode(e.slice(56));return{deactivationSlot:t.deactivationSlot,lastExtendedSlot:t.lastExtendedSlot,lastExtendedSlotStartIndex:t.lastExtendedStartIndex,authority:0!==t.authority.length?new Lr(t.authority[0]):void 0,addresses:o.map((e=>new Lr(e)))}}}const Jn={index:1,layout:ut.w3([ut.DH("typeIndex"),Rn("deactivationSlot"),ut.I0("lastExtendedSlot"),ut.u8("lastExtendedStartIndex"),ut.u8(),ut.O6(Wr(),ut.cY(ut.u8(),-1),"authority")])},$n=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;const eo=Lt(_t(Lr),It(),(e=>new Lr(e))),to=Ct([It(),Et("base64")]),ro=Lt(_t(o.Buffer),to,(e=>o.Buffer.from(e[0],"base64"))),no=3e4;function oo(e){let t,r;if("string"===typeof e)t=e;else if(e){const{commitment:n,...o}=e;t=n,r=o}return{commitment:t,config:r}}function io(e){return Bt([Mt({jsonrpc:Et("2.0"),id:It(),result:e}),Mt({jsonrpc:Et("2.0"),id:It(),error:Mt({code:Nt(),message:It(),data:Ot(At("any",(()=>!0)))})})])}const ao=io(Nt());function so(e){return Lt(io(e),ao,(t=>"error"in t?t:{...t,result:vt(t.result,e)}))}function uo(e){return so(Mt({context:Mt({slot:Pt()}),value:e}))}function co(e){return Mt({context:Mt({slot:Pt()}),value:e})}function lo(e,t){return 0===e?new on({header:t.header,staticAccountKeys:t.accountKeys.map((e=>new Lr(e))),recentBlockhash:t.recentBlockhash,compiledInstructions:t.instructions.map((e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:tt().decode(e.data)}))),addressTableLookups:t.addressTableLookups}):new nn(t)}const fo=Mt({foundation:Pt(),foundationTerm:Pt(),initial:Pt(),taper:Pt(),terminal:Pt()}),ho=so(St(Tt(Mt({epoch:Pt(),effectiveSlot:Pt(),amount:Pt(),postBalance:Pt(),commission:Ot(Tt(Pt()))})))),po=St(Mt({slot:Pt(),prioritizationFee:Pt()})),yo=Mt({total:Pt(),validator:Pt(),foundation:Pt(),epoch:Pt()}),mo=Mt({epoch:Pt(),slotIndex:Pt(),slotsInEpoch:Pt(),absoluteSlot:Pt(),blockHeight:Ot(Pt()),transactionCount:Ot(Pt())}),go=Mt({slotsPerEpoch:Pt(),leaderScheduleSlotOffset:Pt(),warmup:kt(),firstNormalEpoch:Pt(),firstNormalSlot:Pt()}),vo=Rt(It(),St(Pt())),bo=Tt(Bt([Mt({}),It()])),wo=Mt({err:bo}),Ao=Et("receivedSignature"),So=Mt({"solana-core":It(),"feature-set":Ot(Pt())}),ko=uo(Mt({err:Tt(Bt([Mt({}),It()])),logs:Tt(St(It())),accounts:Ot(Tt(St(Tt(Mt({executable:kt(),owner:It(),lamports:Pt(),data:St(It()),rentEpoch:Ot(Pt())}))))),unitsConsumed:Ot(Pt()),returnData:Ot(Tt(Mt({programId:It(),data:Ct([It(),Et("base64")])})))})),_o=uo(Mt({byIdentity:Rt(It(),St(Pt())),range:Mt({firstSlot:Pt(),lastSlot:Pt()})}));const Eo=so(fo),xo=so(yo),To=so(po),Po=so(mo),Oo=so(go),Ro=so(vo),Io=so(Pt()),Co=uo(Mt({total:Pt(),circulating:Pt(),nonCirculating:Pt(),nonCirculatingAccounts:St(eo)})),Mo=Mt({amount:It(),uiAmount:Tt(Pt()),decimals:Pt(),uiAmountString:Ot(It())}),Bo=uo(St(Mt({address:eo,amount:It(),uiAmount:Tt(Pt()),decimals:Pt(),uiAmountString:Ot(It())}))),No=uo(St(Mt({pubkey:eo,account:Mt({executable:kt(),owner:eo,lamports:Pt(),data:ro,rentEpoch:Pt()})}))),Lo=Mt({program:It(),parsed:Nt(),space:Pt()}),jo=uo(St(Mt({pubkey:eo,account:Mt({executable:kt(),owner:eo,lamports:Pt(),data:Lo,rentEpoch:Pt()})}))),Uo=uo(St(Mt({lamports:Pt(),address:eo}))),Fo=Mt({executable:kt(),owner:eo,lamports:Pt(),data:ro,rentEpoch:Pt()}),Do=Mt({pubkey:eo,account:Fo}),zo=Lt(Bt([_t(o.Buffer),Lo]),Bt([to,Lo]),(e=>Array.isArray(e)?vt(e,ro):e)),qo=Mt({executable:kt(),owner:eo,lamports:Pt(),data:zo,rentEpoch:Pt()}),Ho=Mt({pubkey:eo,account:qo}),Vo=Mt({state:Bt([Et("active"),Et("inactive"),Et("activating"),Et("deactivating")]),active:Pt(),inactive:Pt()}),Ko=so(St(Mt({signature:It(),slot:Pt(),err:bo,memo:Tt(It()),blockTime:Ot(Tt(Pt()))}))),Wo=so(St(Mt({signature:It(),slot:Pt(),err:bo,memo:Tt(It()),blockTime:Ot(Tt(Pt()))}))),Go=Mt({subscription:Pt(),result:co(Fo)}),Xo=Mt({pubkey:eo,account:Fo}),Zo=Mt({subscription:Pt(),result:co(Xo)}),Qo=Mt({parent:Pt(),slot:Pt(),root:Pt()}),Yo=Mt({subscription:Pt(),result:Qo}),Jo=Bt([Mt({type:Bt([Et("firstShredReceived"),Et("completed"),Et("optimisticConfirmation"),Et("root")]),slot:Pt(),timestamp:Pt()}),Mt({type:Et("createdBank"),parent:Pt(),slot:Pt(),timestamp:Pt()}),Mt({type:Et("frozen"),slot:Pt(),timestamp:Pt(),stats:Mt({numTransactionEntries:Pt(),numSuccessfulTransactions:Pt(),numFailedTransactions:Pt(),maxTransactionsPerEntry:Pt()})}),Mt({type:Et("dead"),slot:Pt(),timestamp:Pt(),err:It()})]),$o=Mt({subscription:Pt(),result:Jo}),ei=Mt({subscription:Pt(),result:co(Bt([wo,Ao]))}),ti=Mt({subscription:Pt(),result:Pt()}),ri=Mt({pubkey:It(),gossip:Tt(It()),tpu:Tt(It()),rpc:Tt(It()),version:Tt(It())}),ni=Mt({votePubkey:It(),nodePubkey:It(),activatedStake:Pt(),epochVoteAccount:kt(),epochCredits:St(Ct([Pt(),Pt(),Pt()])),commission:Pt(),lastVote:Pt(),rootSlot:Tt(Pt())}),oi=so(Mt({current:St(ni),delinquent:St(ni)})),ii=Bt([Et("processed"),Et("confirmed"),Et("finalized")]),ai=Mt({slot:Pt(),confirmations:Tt(Pt()),err:bo,confirmationStatus:Ot(ii)}),si=uo(St(Tt(ai))),ui=so(Pt()),ci=Mt({accountKey:eo,writableIndexes:St(Pt()),readonlyIndexes:St(Pt())}),li=Mt({signatures:St(It()),message:Mt({accountKeys:St(It()),header:Mt({numRequiredSignatures:Pt(),numReadonlySignedAccounts:Pt(),numReadonlyUnsignedAccounts:Pt()}),instructions:St(Mt({accounts:St(Pt()),data:It(),programIdIndex:Pt()})),recentBlockhash:It(),addressTableLookups:Ot(St(ci))})}),fi=Mt({pubkey:eo,signer:kt(),writable:kt(),source:Ot(Bt([Et("transaction"),Et("lookupTable")]))}),di=Mt({accountKeys:St(fi),signatures:St(It())}),hi=Mt({parsed:Nt(),program:It(),programId:eo}),pi=Mt({accounts:St(eo),data:It(),programId:eo}),yi=Lt(Bt([pi,hi]),Bt([Mt({parsed:Nt(),program:It(),programId:It()}),Mt({accounts:St(It()),data:It(),programId:It()})]),(e=>vt(e,"accounts"in e?pi:hi))),mi=Mt({signatures:St(It()),message:Mt({accountKeys:St(fi),instructions:St(yi),recentBlockhash:It(),addressTableLookups:Ot(Tt(St(ci)))})}),gi=Mt({accountIndex:Pt(),mint:It(),owner:Ot(It()),uiTokenAmount:Mo}),vi=Mt({writable:St(eo),readonly:St(eo)}),bi=Mt({err:bo,fee:Pt(),innerInstructions:Ot(Tt(St(Mt({index:Pt(),instructions:St(Mt({accounts:St(Pt()),data:It(),programIdIndex:Pt()}))})))),preBalances:St(Pt()),postBalances:St(Pt()),logMessages:Ot(Tt(St(It()))),preTokenBalances:Ot(Tt(St(gi))),postTokenBalances:Ot(Tt(St(gi))),loadedAddresses:Ot(vi),computeUnitsConsumed:Ot(Pt())}),wi=Mt({err:bo,fee:Pt(),innerInstructions:Ot(Tt(St(Mt({index:Pt(),instructions:St(yi)})))),preBalances:St(Pt()),postBalances:St(Pt()),logMessages:Ot(Tt(St(It()))),preTokenBalances:Ot(Tt(St(gi))),postTokenBalances:Ot(Tt(St(gi))),loadedAddresses:Ot(vi),computeUnitsConsumed:Ot(Pt())}),Ai=Bt([Et(0),Et("legacy")]),Si=Mt({pubkey:It(),lamports:Pt(),postBalance:Tt(Pt()),rewardType:Tt(It()),commission:Ot(Tt(Pt()))}),ki=so(Tt(Mt({blockhash:It(),previousBlockhash:It(),parentSlot:Pt(),transactions:St(Mt({transaction:li,meta:Tt(bi),version:Ot(Ai)})),rewards:Ot(St(Si)),blockTime:Tt(Pt()),blockHeight:Tt(Pt())}))),_i=so(Tt(Mt({blockhash:It(),previousBlockhash:It(),parentSlot:Pt(),rewards:Ot(St(Si)),blockTime:Tt(Pt()),blockHeight:Tt(Pt())}))),Ei=so(Tt(Mt({blockhash:It(),previousBlockhash:It(),parentSlot:Pt(),transactions:St(Mt({transaction:di,meta:Tt(bi),version:Ot(Ai)})),rewards:Ot(St(Si)),blockTime:Tt(Pt()),blockHeight:Tt(Pt())}))),xi=so(Tt(Mt({blockhash:It(),previousBlockhash:It(),parentSlot:Pt(),transactions:St(Mt({transaction:mi,meta:Tt(wi),version:Ot(Ai)})),rewards:Ot(St(Si)),blockTime:Tt(Pt()),blockHeight:Tt(Pt())}))),Ti=so(Tt(Mt({blockhash:It(),previousBlockhash:It(),parentSlot:Pt(),transactions:St(Mt({transaction:di,meta:Tt(wi),version:Ot(Ai)})),rewards:Ot(St(Si)),blockTime:Tt(Pt()),blockHeight:Tt(Pt())}))),Pi=so(Tt(Mt({blockhash:It(),previousBlockhash:It(),parentSlot:Pt(),rewards:Ot(St(Si)),blockTime:Tt(Pt()),blockHeight:Tt(Pt())}))),Oi=so(Tt(Mt({blockhash:It(),previousBlockhash:It(),parentSlot:Pt(),transactions:St(Mt({transaction:li,meta:Tt(bi)})),rewards:Ot(St(Si)),blockTime:Tt(Pt())}))),Ri=so(Tt(Mt({blockhash:It(),previousBlockhash:It(),parentSlot:Pt(),signatures:St(It()),blockTime:Tt(Pt())}))),Ii=so(Tt(Mt({slot:Pt(),meta:Tt(bi),blockTime:Ot(Tt(Pt())),transaction:li,version:Ot(Ai)}))),Ci=so(Tt(Mt({slot:Pt(),transaction:mi,meta:Tt(wi),blockTime:Ot(Tt(Pt())),version:Ot(Ai)}))),Mi=uo(Mt({blockhash:It(),feeCalculator:Mt({lamportsPerSignature:Pt()})})),Bi=uo(Mt({blockhash:It(),lastValidBlockHeight:Pt()})),Ni=uo(kt()),Li=so(St(Mt({slot:Pt(),numTransactions:Pt(),numSlots:Pt(),samplePeriodSecs:Pt()}))),ji=uo(Tt(Mt({feeCalculator:Mt({lamportsPerSignature:Pt()})}))),Ui=so(It()),Fi=so(It()),Di=Mt({err:bo,logs:St(It()),signature:It()}),zi=Mt({result:co(Di),subscription:Pt()}),qi={"solana-client":"js/".concat("0.0.0-development")};class Hi{constructor(e,t){let r,n,o,i,a,s;this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionHashByClientSubscriptionId={},this._subscriptionStateChangeCallbacksByHash={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,this.getBlockHeight=(()=>{const e={};return async t=>{var r;const{commitment:n,config:o}=oo(t),i=this._buildArgs([],n,void 0,o),a=Hn(i);return e[a]=null!==(r=e[a])&&void 0!==r?r:(async()=>{try{const e=vt(await this._rpcRequest("getBlockHeight",i),so(Pt()));if("error"in e)throw new Xn(e.error,"failed to get block height information");return e.result}finally{delete e[a]}})(),await e[a]}})(),t&&"string"===typeof t?this._commitment=t:t&&(this._commitment=t.commitment,this._confirmTransactionInitialTimeout=t.confirmTransactionInitialTimeout,r=t.wsEndpoint,n=t.httpHeaders,o=t.fetch,i=t.fetchMiddleware,a=t.disableRetryOnRateLimit,s=t.httpAgent),this._rpcEndpoint=function(e){if(!1===/^https?:/.test(e))throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return e}(e),this._rpcWsEndpoint=r||function(e){const t=e.match($n);if(null==t)throw TypeError("Failed to validate endpoint URL `".concat(e,"`"));const[r,n,o,i]=t,a=e.startsWith("https:")?"wss:":"ws:",s=null==o?null:parseInt(o.slice(1),10),u=null==s?"":":".concat(s+1);return"".concat(a,"//").concat(n).concat(u).concat(i)}(e),this._rpcClient=function(e,t,r,n,o,i){const a=r||Zn;let s;return null!=i&&console.warn("You have supplied an `httpAgent` when creating a `Connection` in a browser environment.It has been ignored; `httpAgent` is only used in Node environments."),n&&(s=async(e,t)=>{const r=await new Promise(((r,o)=>{try{n(e,t,((e,t)=>r([e,t])))}catch(i){o(i)}}));return await a(...r)}),new(Ut())((async(r,n)=>{const i={method:"POST",body:r,agent:void 0,headers:Object.assign({"Content-Type":"application/json"},t||{},qi)};try{let t,r=5,u=500;for(;t=s?await s(e,i):await a(e,i),429===t.status&&!0!==o&&(r-=1,0!==r);)console.error("Server responded with ".concat(t.status," ").concat(t.statusText,". Retrying after ").concat(u,"ms delay...")),await kn(u),u*=2;const c=await t.text();t.ok?n(null,c):n(new Error("".concat(t.status," ").concat(t.statusText,": ").concat(c)))}catch(u){u instanceof Error&&n(u)}}),{})}(e,n,o,i,a,s),this._rpcRequest=function(e){return(t,r)=>new Promise(((n,o)=>{e.request(t,r,((e,t)=>{e?o(e):n(t)}))}))}(this._rpcClient),this._rpcBatchRequest=function(e){return t=>new Promise(((r,n)=>{0===t.length&&r([]);const o=t.map((t=>e.request(t.methodName,t.args)));e.request(o,((e,t)=>{e?n(e):r(t)}))}))}(this._rpcClient),this._rpcWebSocket=new Qn(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(e,t){const{commitment:r,config:n}=oo(t),o=this._buildArgs([e.toBase58()],r,void 0,n),i=vt(await this._rpcRequest("getBalance",o),uo(Pt()));if("error"in i)throw new Xn(i.error,"failed to get balance for ".concat(e.toBase58()));return i.result}async getBalance(e,t){return await this.getBalanceAndContext(e,t).then((e=>e.value)).catch((t=>{throw new Error("failed to get balance of account "+e.toBase58()+": "+t)}))}async getBlockTime(e){const t=vt(await this._rpcRequest("getBlockTime",[e]),so(Tt(Pt())));if("error"in t)throw new Xn(t.error,"failed to get block time for slot ".concat(e));return t.result}async getMinimumLedgerSlot(){const e=vt(await this._rpcRequest("minimumLedgerSlot",[]),so(Pt()));if("error"in e)throw new Xn(e.error,"failed to get minimum ledger slot");return e.result}async getFirstAvailableBlock(){const e=vt(await this._rpcRequest("getFirstAvailableBlock",[]),Io);if("error"in e)throw new Xn(e.error,"failed to get first available block");return e.result}async getSupply(e){let t={};t="string"===typeof e?{commitment:e}:e?{...e,commitment:e&&e.commitment||this.commitment}:{commitment:this.commitment};const r=vt(await this._rpcRequest("getSupply",[t]),Co);if("error"in r)throw new Xn(r.error,"failed to get supply");return r.result}async getTokenSupply(e,t){const r=this._buildArgs([e.toBase58()],t),n=vt(await this._rpcRequest("getTokenSupply",r),uo(Mo));if("error"in n)throw new Xn(n.error,"failed to get token supply");return n.result}async getTokenAccountBalance(e,t){const r=this._buildArgs([e.toBase58()],t),n=vt(await this._rpcRequest("getTokenAccountBalance",r),uo(Mo));if("error"in n)throw new Xn(n.error,"failed to get token account balance");return n.result}async getTokenAccountsByOwner(e,t,r){const{commitment:n,config:o}=oo(r);let i=[e.toBase58()];"mint"in t?i.push({mint:t.mint.toBase58()}):i.push({programId:t.programId.toBase58()});const a=this._buildArgs(i,n,"base64",o),s=vt(await this._rpcRequest("getTokenAccountsByOwner",a),No);if("error"in s)throw new Xn(s.error,"failed to get token accounts owned by account ".concat(e.toBase58()));return s.result}async getParsedTokenAccountsByOwner(e,t,r){let n=[e.toBase58()];"mint"in t?n.push({mint:t.mint.toBase58()}):n.push({programId:t.programId.toBase58()});const o=this._buildArgs(n,r,"jsonParsed"),i=vt(await this._rpcRequest("getTokenAccountsByOwner",o),jo);if("error"in i)throw new Xn(i.error,"failed to get token accounts owned by account ".concat(e.toBase58()));return i.result}async getLargestAccounts(e){const t={...e,commitment:e&&e.commitment||this.commitment},r=t.filter||t.commitment?[t]:[],n=vt(await this._rpcRequest("getLargestAccounts",r),Uo);if("error"in n)throw new Xn(n.error,"failed to get largest accounts");return n.result}async getTokenLargestAccounts(e,t){const r=this._buildArgs([e.toBase58()],t),n=vt(await this._rpcRequest("getTokenLargestAccounts",r),Bo);if("error"in n)throw new Xn(n.error,"failed to get token largest accounts");return n.result}async getAccountInfoAndContext(e,t){const{commitment:r,config:n}=oo(t),o=this._buildArgs([e.toBase58()],r,"base64",n),i=vt(await this._rpcRequest("getAccountInfo",o),uo(Tt(Fo)));if("error"in i)throw new Xn(i.error,"failed to get info about account ".concat(e.toBase58()));return i.result}async getParsedAccountInfo(e,t){const{commitment:r,config:n}=oo(t),o=this._buildArgs([e.toBase58()],r,"jsonParsed",n),i=vt(await this._rpcRequest("getAccountInfo",o),uo(Tt(qo)));if("error"in i)throw new Xn(i.error,"failed to get info about account ".concat(e.toBase58()));return i.result}async getAccountInfo(e,t){try{return(await this.getAccountInfoAndContext(e,t)).value}catch(r){throw new Error("failed to get info about account "+e.toBase58()+": "+r)}}async getMultipleParsedAccounts(e,t){const{commitment:r,config:n}=oo(t),o=e.map((e=>e.toBase58())),i=this._buildArgs([o],r,"jsonParsed",n),a=vt(await this._rpcRequest("getMultipleAccounts",i),uo(St(Tt(qo))));if("error"in a)throw new Xn(a.error,"failed to get info for accounts ".concat(o));return a.result}async getMultipleAccountsInfoAndContext(e,t){const{commitment:r,config:n}=oo(t),o=e.map((e=>e.toBase58())),i=this._buildArgs([o],r,"base64",n),a=vt(await this._rpcRequest("getMultipleAccounts",i),uo(St(Tt(Fo))));if("error"in a)throw new Xn(a.error,"failed to get info for accounts ".concat(o));return a.result}async getMultipleAccountsInfo(e,t){return(await this.getMultipleAccountsInfoAndContext(e,t)).value}async getStakeActivation(e,t,r){const{commitment:n,config:o}=oo(t),i=this._buildArgs([e.toBase58()],n,void 0,{...o,epoch:null!=r?r:null===o||void 0===o?void 0:o.epoch}),a=vt(await this._rpcRequest("getStakeActivation",i),so(Vo));if("error"in a)throw new Xn(a.error,"failed to get Stake Activation ".concat(e.toBase58()));return a.result}async getProgramAccounts(e,t){const{commitment:r,config:n}=oo(t),{encoding:o,...i}=n||{},a=this._buildArgs([e.toBase58()],r,o||"base64",i),s=await this._rpcRequest("getProgramAccounts",a),u=St(Do),c=!0===i.withContext?vt(s,uo(u)):vt(s,so(u));if("error"in c)throw new Xn(c.error,"failed to get accounts owned by program ".concat(e.toBase58()));return c.result}async getParsedProgramAccounts(e,t){const{commitment:r,config:n}=oo(t),o=this._buildArgs([e.toBase58()],r,"jsonParsed",n),i=vt(await this._rpcRequest("getProgramAccounts",o),so(St(Ho)));if("error"in i)throw new Xn(i.error,"failed to get accounts owned by program ".concat(e.toBase58()));return i.result}async confirmTransaction(e,t){let r,n;if("string"==typeof e)r=e;else{var o;const t=e;if(null!==(o=t.abortSignal)&&void 0!==o&&o.aborted)return Promise.reject(t.abortSignal.reason);r=t.signature}try{n=tt().decode(r)}catch(i){throw new Error("signature must be base58 encoded: "+r)}return Jr(64===n.length,"signature has invalid length"),"string"===typeof e?await this.confirmTransactionUsingLegacyTimeoutStrategy({commitment:t||this.commitment,signature:r}):"lastValidBlockHeight"in e?await this.confirmTransactionUsingBlockHeightExceedanceStrategy({commitment:t||this.commitment,strategy:e}):await this.confirmTransactionUsingDurableNonceStrategy({commitment:t||this.commitment,strategy:e})}getCancellationPromise(e){return new Promise(((t,r)=>{null!=e&&(e.aborted?r(e.reason):e.addEventListener("abort",(()=>{r(e.reason)})))}))}getTransactionConfirmationPromise(e){let t,r,{commitment:n,signature:o}=e,i=!1;return{abortConfirmation:()=>{r&&(r(),r=void 0),null!=t&&(this.removeSignatureListener(t),t=void 0)},confirmationPromise:new Promise(((e,a)=>{try{t=this.onSignature(o,((r,n)=>{t=void 0;const o={context:n,value:r};e({__type:sn.PROCESSED,response:o})}),n);const s=new Promise((e=>{null==t?e():r=this._onSubscriptionStateChange(t,(t=>{"subscribed"===t&&e()}))}));(async()=>{if(await s,i)return;const t=await this.getSignatureStatus(o);if(i)return;if(null==t)return;const{context:r,value:u}=t;if(null!=u)if(null!==u&&void 0!==u&&u.err)a(u.err);else{switch(n){case"confirmed":case"single":case"singleGossip":if("processed"===u.confirmationStatus)return;break;case"finalized":case"max":case"root":if("processed"===u.confirmationStatus||"confirmed"===u.confirmationStatus)return}i=!0,e({__type:sn.PROCESSED,response:{context:r,value:u}})}})()}catch(s){a(s)}}))}}async confirmTransactionUsingBlockHeightExceedanceStrategy(e){let{commitment:t,strategy:{abortSignal:r,lastValidBlockHeight:n,signature:o}}=e,i=!1;const a=new Promise((e=>{const r=async()=>{try{return await this.getBlockHeight(t)}catch(e){return-1}};(async()=>{let t=await r();if(!i){for(;t<=n;){if(await kn(1e3),i)return;if(t=await r(),i)return}e({__type:sn.BLOCKHEIGHT_EXCEEDED})}})()})),{abortConfirmation:s,confirmationPromise:u}=this.getTransactionConfirmationPromise({commitment:t,signature:o}),c=this.getCancellationPromise(r);let l;try{const e=await Promise.race([c,u,a]);if(e.__type!==sn.PROCESSED)throw new qr(o);l=e.response}finally{i=!0,s()}return l}async confirmTransactionUsingDurableNonceStrategy(e){let{commitment:t,strategy:{abortSignal:r,minContextSlot:n,nonceAccountPubkey:o,nonceValue:i,signature:a}}=e,s=!1;const u=new Promise((e=>{let r=i,a=null;const u=async()=>{try{const{context:e,value:r}=await this.getNonceAndContext(o,{commitment:t,minContextSlot:n});return a=e.slot,null===r||void 0===r?void 0:r.nonce}catch(e){return r}};(async()=>{if(r=await u(),!s)for(;;){if(i!==r)return void e({__type:sn.NONCE_INVALID,slotInWhichNonceDidAdvance:a});if(await kn(2e3),s)return;if(r=await u(),s)return}})()})),{abortConfirmation:c,confirmationPromise:l}=this.getTransactionConfirmationPromise({commitment:t,signature:a}),f=this.getCancellationPromise(r);let d;try{const e=await Promise.race([f,l,u]);if(e.__type===sn.PROCESSED)d=e.response;else{var h;let r;for(;;){var p;const t=await this.getSignatureStatus(a);if(null==t)break;if(!(t.context.slot<(null!==(p=e.slotInWhichNonceDidAdvance)&&void 0!==p?p:n))){r=t;break}await kn(400)}if(null===(h=r)||void 0===h||!h.value)throw new Vr(a);{const e=t||"finalized",{confirmationStatus:n}=r.value;switch(e){case"processed":case"recent":if("processed"!==n&&"confirmed"!==n&&"finalized"!==n)throw new Vr(a);break;case"confirmed":case"single":case"singleGossip":if("confirmed"!==n&&"finalized"!==n)throw new Vr(a);break;case"finalized":case"max":case"root":if("finalized"!==n)throw new Vr(a)}d={context:r.context,value:{err:r.value.err}}}}}finally{s=!0,c()}return d}async confirmTransactionUsingLegacyTimeoutStrategy(e){let t,{commitment:r,signature:n}=e;const o=new Promise((e=>{let n=this._confirmTransactionInitialTimeout||6e4;switch(r){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":n=this._confirmTransactionInitialTimeout||3e4}t=setTimeout((()=>e({__type:sn.TIMED_OUT,timeoutMs:n})),n)})),{abortConfirmation:i,confirmationPromise:a}=this.getTransactionConfirmationPromise({commitment:r,signature:n});let s;try{const e=await Promise.race([a,o]);if(e.__type!==sn.PROCESSED)throw new Hr(n,e.timeoutMs/1e3);s=e.response}finally{clearTimeout(t),i()}return s}async getClusterNodes(){const e=vt(await this._rpcRequest("getClusterNodes",[]),so(St(ri)));if("error"in e)throw new Xn(e.error,"failed to get cluster nodes");return e.result}async getVoteAccounts(e){const t=this._buildArgs([],e),r=vt(await this._rpcRequest("getVoteAccounts",t),oi);if("error"in r)throw new Xn(r.error,"failed to get vote accounts");return r.result}async getSlot(e){const{commitment:t,config:r}=oo(e),n=this._buildArgs([],t,void 0,r),o=vt(await this._rpcRequest("getSlot",n),so(Pt()));if("error"in o)throw new Xn(o.error,"failed to get slot");return o.result}async getSlotLeader(e){const{commitment:t,config:r}=oo(e),n=this._buildArgs([],t,void 0,r),o=vt(await this._rpcRequest("getSlotLeader",n),so(It()));if("error"in o)throw new Xn(o.error,"failed to get slot leader");return o.result}async getSlotLeaders(e,t){const r=[e,t],n=vt(await this._rpcRequest("getSlotLeaders",r),so(St(eo)));if("error"in n)throw new Xn(n.error,"failed to get slot leaders");return n.result}async getSignatureStatus(e,t){const{context:r,value:n}=await this.getSignatureStatuses([e],t);Jr(1===n.length);return{context:r,value:n[0]}}async getSignatureStatuses(e,t){const r=[e];t&&r.push(t);const n=vt(await this._rpcRequest("getSignatureStatuses",r),si);if("error"in n)throw new Xn(n.error,"failed to get signature status");return n.result}async getTransactionCount(e){const{commitment:t,config:r}=oo(e),n=this._buildArgs([],t,void 0,r),o=vt(await this._rpcRequest("getTransactionCount",n),so(Pt()));if("error"in o)throw new Xn(o.error,"failed to get transaction count");return o.result}async getTotalSupply(e){return(await this.getSupply({commitment:e,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(e){const t=this._buildArgs([],e),r=vt(await this._rpcRequest("getInflationGovernor",t),Eo);if("error"in r)throw new Xn(r.error,"failed to get inflation");return r.result}async getInflationReward(e,t,r){const{commitment:n,config:o}=oo(r),i=this._buildArgs([e.map((e=>e.toBase58()))],n,void 0,{...o,epoch:null!=t?t:null===o||void 0===o?void 0:o.epoch}),a=vt(await this._rpcRequest("getInflationReward",i),ho);if("error"in a)throw new Xn(a.error,"failed to get inflation reward");return a.result}async getInflationRate(){const e=vt(await this._rpcRequest("getInflationRate",[]),xo);if("error"in e)throw new Xn(e.error,"failed to get inflation rate");return e.result}async getEpochInfo(e){const{commitment:t,config:r}=oo(e),n=this._buildArgs([],t,void 0,r),o=vt(await this._rpcRequest("getEpochInfo",n),Po);if("error"in o)throw new Xn(o.error,"failed to get epoch info");return o.result}async getEpochSchedule(){const e=vt(await this._rpcRequest("getEpochSchedule",[]),Oo);if("error"in e)throw new Xn(e.error,"failed to get epoch schedule");const t=e.result;return new Kn(t.slotsPerEpoch,t.leaderScheduleSlotOffset,t.warmup,t.firstNormalEpoch,t.firstNormalSlot)}async getLeaderSchedule(){const e=vt(await this._rpcRequest("getLeaderSchedule",[]),Ro);if("error"in e)throw new Xn(e.error,"failed to get leader schedule");return e.result}async getMinimumBalanceForRentExemption(e,t){const r=this._buildArgs([e],t),n=vt(await this._rpcRequest("getMinimumBalanceForRentExemption",r),ui);return"error"in n?(console.warn("Unable to fetch minimum balance for rent exemption"),0):n.result}async getRecentBlockhashAndContext(e){const t=this._buildArgs([],e),r=vt(await this._rpcRequest("getRecentBlockhash",t),Mi);if("error"in r)throw new Xn(r.error,"failed to get recent blockhash");return r.result}async getRecentPerformanceSamples(e){const t=vt(await this._rpcRequest("getRecentPerformanceSamples",e?[e]:[]),Li);if("error"in t)throw new Xn(t.error,"failed to get recent performance samples");return t.result}async getFeeCalculatorForBlockhash(e,t){const r=this._buildArgs([e],t),n=vt(await this._rpcRequest("getFeeCalculatorForBlockhash",r),ji);if("error"in n)throw new Xn(n.error,"failed to get fee calculator");const{context:o,value:i}=n.result;return{context:o,value:null!==i?i.feeCalculator:null}}async getFeeForMessage(e,t){const r=Pr(e.serialize()).toString("base64"),n=this._buildArgs([r],t),o=vt(await this._rpcRequest("getFeeForMessage",n),uo(Tt(Pt())));if("error"in o)throw new Xn(o.error,"failed to get fee for message");if(null===o.result)throw new Error("invalid blockhash");return o.result}async getRecentPrioritizationFees(e){var t;const r=null===e||void 0===e||null===(t=e.lockedWritableAccounts)||void 0===t?void 0:t.map((e=>e.toBase58())),n=null!==r&&void 0!==r&&r.length?[r]:[],o=vt(await this._rpcRequest("getRecentPrioritizationFees",n),To);if("error"in o)throw new Xn(o.error,"failed to get recent prioritization fees");return o.result}async getRecentBlockhash(e){try{return(await this.getRecentBlockhashAndContext(e)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhash(e){try{return(await this.getLatestBlockhashAndContext(e)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhashAndContext(e){const{commitment:t,config:r}=oo(e),n=this._buildArgs([],t,void 0,r),o=vt(await this._rpcRequest("getLatestBlockhash",n),Bi);if("error"in o)throw new Xn(o.error,"failed to get latest blockhash");return o.result}async isBlockhashValid(e,t){const{commitment:r,config:n}=oo(t),o=this._buildArgs([e],r,void 0,n),i=vt(await this._rpcRequest("isBlockhashValid",o),Ni);if("error"in i)throw new Xn(i.error,"failed to determine if the blockhash `"+e+"`is valid");return i.result}async getVersion(){const e=vt(await this._rpcRequest("getVersion",[]),so(So));if("error"in e)throw new Xn(e.error,"failed to get version");return e.result}async getGenesisHash(){const e=vt(await this._rpcRequest("getGenesisHash",[]),so(It()));if("error"in e)throw new Xn(e.error,"failed to get genesis hash");return e.result}async getBlock(e,t){const{commitment:r,config:n}=oo(t),o=this._buildArgsAtLeastConfirmed([e],r,void 0,n),i=await this._rpcRequest("getBlock",o);try{switch(null===n||void 0===n?void 0:n.transactionDetails){case"accounts":{const e=vt(i,Ei);if("error"in e)throw e.error;return e.result}case"none":{const e=vt(i,_i);if("error"in e)throw e.error;return e.result}default:{const e=vt(i,ki);if("error"in e)throw e.error;const{result:t}=e;return t?{...t,transactions:t.transactions.map((e=>{let{transaction:t,meta:r,version:n}=e;return{meta:r,transaction:{...t,message:lo(n,t.message)},version:n}}))}:null}}}catch(a){throw new Xn(a,"failed to get confirmed block")}}async getParsedBlock(e,t){const{commitment:r,config:n}=oo(t),o=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",n),i=await this._rpcRequest("getBlock",o);try{switch(null===n||void 0===n?void 0:n.transactionDetails){case"accounts":{const e=vt(i,Ti);if("error"in e)throw e.error;return e.result}case"none":{const e=vt(i,Pi);if("error"in e)throw e.error;return e.result}default:{const e=vt(i,xi);if("error"in e)throw e.error;return e.result}}}catch(a){throw new Xn(a,"failed to get block")}}async getBlockProduction(e){let t,r;if("string"===typeof e)r=e;else if(e){const{commitment:n,...o}=e;r=n,t=o}const n=this._buildArgs([],r,"base64",t),o=vt(await this._rpcRequest("getBlockProduction",n),_o);if("error"in o)throw new Xn(o.error,"failed to get block production information");return o.result}async getTransaction(e,t){const{commitment:r,config:n}=oo(t),o=this._buildArgsAtLeastConfirmed([e],r,void 0,n),i=vt(await this._rpcRequest("getTransaction",o),Ii);if("error"in i)throw new Xn(i.error,"failed to get transaction");const a=i.result;return a?{...a,transaction:{...a.transaction,message:lo(a.version,a.transaction.message)}}:a}async getParsedTransaction(e,t){const{commitment:r,config:n}=oo(t),o=this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",n),i=vt(await this._rpcRequest("getTransaction",o),Ci);if("error"in i)throw new Xn(i.error,"failed to get transaction");return i.result}async getParsedTransactions(e,t){const{commitment:r,config:n}=oo(t),o=e.map((e=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([e],r,"jsonParsed",n)})));return(await this._rpcBatchRequest(o)).map((e=>{const t=vt(e,Ci);if("error"in t)throw new Xn(t.error,"failed to get transactions");return t.result}))}async getTransactions(e,t){const{commitment:r,config:n}=oo(t),o=e.map((e=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([e],r,void 0,n)})));return(await this._rpcBatchRequest(o)).map((e=>{const t=vt(e,Ii);if("error"in t)throw new Xn(t.error,"failed to get transactions");const r=t.result;return r?{...r,transaction:{...r.transaction,message:lo(r.version,r.transaction.message)}}:r}))}async getConfirmedBlock(e,t){const r=this._buildArgsAtLeastConfirmed([e],t),n=vt(await this._rpcRequest("getConfirmedBlock",r),Oi);if("error"in n)throw new Xn(n.error,"failed to get confirmed block");const o=n.result;if(!o)throw new Error("Confirmed block "+e+" not found");const i={...o,transactions:o.transactions.map((e=>{let{transaction:t,meta:r}=e;const n=new nn(t.message);return{meta:r,transaction:{...t,message:n}}}))};return{...i,transactions:i.transactions.map((e=>{let{transaction:t,meta:r}=e;return{meta:r,transaction:ln.populate(t.message,t.signatures)}}))}}async getBlocks(e,t,r){const n=this._buildArgsAtLeastConfirmed(void 0!==t?[e,t]:[e],r),o=vt(await this._rpcRequest("getBlocks",n),so(St(Pt())));if("error"in o)throw new Xn(o.error,"failed to get blocks");return o.result}async getBlockSignatures(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),n=vt(await this._rpcRequest("getBlock",r),Ri);if("error"in n)throw new Xn(n.error,"failed to get block");const o=n.result;if(!o)throw new Error("Block "+e+" not found");return o}async getConfirmedBlockSignatures(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),n=vt(await this._rpcRequest("getConfirmedBlock",r),Ri);if("error"in n)throw new Xn(n.error,"failed to get confirmed block");const o=n.result;if(!o)throw new Error("Confirmed block "+e+" not found");return o}async getConfirmedTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t),n=vt(await this._rpcRequest("getConfirmedTransaction",r),Ii);if("error"in n)throw new Xn(n.error,"failed to get transaction");const o=n.result;if(!o)return o;const i=new nn(o.transaction.message),a=o.transaction.signatures;return{...o,transaction:ln.populate(i,a)}}async getParsedConfirmedTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,"jsonParsed"),n=vt(await this._rpcRequest("getConfirmedTransaction",r),Ci);if("error"in n)throw new Xn(n.error,"failed to get confirmed transaction");return n.result}async getParsedConfirmedTransactions(e,t){const r=e.map((e=>({methodName:"getConfirmedTransaction",args:this._buildArgsAtLeastConfirmed([e],t,"jsonParsed")})));return(await this._rpcBatchRequest(r)).map((e=>{const t=vt(e,Ci);if("error"in t)throw new Xn(t.error,"failed to get confirmed transactions");return t.result}))}async getConfirmedSignaturesForAddress(e,t,r){let n={},o=await this.getFirstAvailableBlock();for(;!("until"in n)&&!(--t<=0||t0&&(n.until=e.signatures[e.signatures.length-1].toString())}catch(a){if(a instanceof Error&&a.message.includes("skipped"))continue;throw a}let i=await this.getSlot("finalized");for(;!("before"in n)&&!(++r>i);)try{const e=await this.getConfirmedBlockSignatures(r);e.signatures.length>0&&(n.before=e.signatures[e.signatures.length-1].toString())}catch(a){if(a instanceof Error&&a.message.includes("skipped"))continue;throw a}return(await this.getConfirmedSignaturesForAddress2(e,n)).map((e=>e.signature))}async getConfirmedSignaturesForAddress2(e,t,r){const n=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,t),o=vt(await this._rpcRequest("getConfirmedSignaturesForAddress2",n),Ko);if("error"in o)throw new Xn(o.error,"failed to get confirmed signatures for address");return o.result}async getSignaturesForAddress(e,t,r){const n=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,t),o=vt(await this._rpcRequest("getSignaturesForAddress",n),Wo);if("error"in o)throw new Xn(o.error,"failed to get signatures for address");return o.result}async getAddressLookupTable(e,t){const{context:r,value:n}=await this.getAccountInfoAndContext(e,t);let o=null;return null!==n&&(o=new Yn({key:e,state:Yn.deserialize(n.data)})),{context:r,value:o}}async getNonceAndContext(e,t){const{context:r,value:n}=await this.getAccountInfoAndContext(e,t);let o=null;return null!==n&&(o=On.fromAccountData(n.data)),{context:r,value:o}}async getNonce(e,t){return await this.getNonceAndContext(e,t).then((e=>e.value)).catch((t=>{throw new Error("failed to get nonce for account "+e.toBase58()+": "+t)}))}async requestAirdrop(e,t){const r=vt(await this._rpcRequest("requestAirdrop",[e.toBase58(),t]),Ui);if("error"in r)throw new Xn(r.error,"airdrop to ".concat(e.toBase58()," failed"));return r.result}async _blockhashWithExpiryBlockHeight(e){if(!e){for(;this._pollingBlockhash;)await kn(100);const e=Date.now()-this._blockhashInfo.lastFetch>=no;if(null!==this._blockhashInfo.latestBlockhash&&!e)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const e=Date.now(),t=this._blockhashInfo.latestBlockhash,r=t?t.blockhash:null;for(let n=0;n<50;n++){const e=await this.getLatestBlockhash("finalized");if(r!==e.blockhash)return this._blockhashInfo={latestBlockhash:e,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},e;await kn(200)}throw new Error("Unable to obtain a new blockhash after ".concat(Date.now()-e,"ms"))}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(e){const{commitment:t,config:r}=oo(e),n=this._buildArgs([],t,"base64",r),o=vt(await this._rpcRequest("getStakeMinimumDelegation",n),uo(Pt()));if("error"in o)throw new Xn(o.error,"failed to get stake minimum delegation");return o.result}async simulateTransaction(e,t,r){if("message"in e){const n=e.serialize(),i=o.Buffer.from(n).toString("base64");if(Array.isArray(t)||void 0!==r)throw new Error("Invalid arguments");const a=t||{};a.encoding="base64","commitment"in a||(a.commitment=this.commitment);const s=[i,a],u=vt(await this._rpcRequest("simulateTransaction",s),ko);if("error"in u)throw new Error("failed to simulate transaction: "+u.error.message);return u.result}let n;if(e instanceof ln){let t=e;n=new ln,n.feePayer=t.feePayer,n.instructions=e.instructions,n.nonceInfo=t.nonceInfo,n.signatures=t.signatures}else n=ln.populate(e),n._message=n._json=void 0;if(void 0!==t&&!Array.isArray(t))throw new Error("Invalid arguments");const i=t;if(n.nonceInfo&&i)n.sign(...i);else{let e=this._disableBlockhashCaching;for(;;){const t=await this._blockhashWithExpiryBlockHeight(e);if(n.lastValidBlockHeight=t.lastValidBlockHeight,n.recentBlockhash=t.blockhash,!i)break;if(n.sign(...i),!n.signature)throw new Error("!signature");const r=n.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(r)&&!this._blockhashInfo.transactionSignatures.includes(r)){this._blockhashInfo.simulatedSignatures.push(r);break}e=!0}}const a=n._compile(),s=a.serialize(),u=n._serialize(s).toString("base64"),c={encoding:"base64",commitment:this.commitment};if(r){const e=(Array.isArray(r)?r:a.nonProgramIds()).map((e=>e.toBase58()));c.accounts={encoding:"base64",addresses:e}}i&&(c.sigVerify=!0);const l=[u,c],f=vt(await this._rpcRequest("simulateTransaction",l),ko);if("error"in f){let e;if("data"in f.error&&(e=f.error.data.logs,e&&Array.isArray(e))){const t="\n ",r=t+e.join(t);console.error(f.error.message,r)}throw new Wn("failed to simulate transaction: "+f.error.message,e)}return f.result}async sendTransaction(e,t,r){if("version"in e){if(t&&Array.isArray(t))throw new Error("Invalid arguments");const r=e.serialize();return await this.sendRawTransaction(r,t)}if(void 0===t||!Array.isArray(t))throw new Error("Invalid arguments");const n=t;if(e.nonceInfo)e.sign(...n);else{let t=this._disableBlockhashCaching;for(;;){const r=await this._blockhashWithExpiryBlockHeight(t);if(e.lastValidBlockHeight=r.lastValidBlockHeight,e.recentBlockhash=r.blockhash,e.sign(...n),!e.signature)throw new Error("!signature");const o=e.signature.toString("base64");if(!this._blockhashInfo.transactionSignatures.includes(o)){this._blockhashInfo.transactionSignatures.push(o);break}t=!0}}const o=e.serialize();return await this.sendRawTransaction(o,r)}async sendRawTransaction(e,t){const r=Pr(e).toString("base64");return await this.sendEncodedTransaction(r,t)}async sendEncodedTransaction(e,t){const r={encoding:"base64"},n=t&&t.skipPreflight,o=!0===n?"processed":t&&t.preflightCommitment||this.commitment;t&&null!=t.maxRetries&&(r.maxRetries=t.maxRetries),t&&null!=t.minContextSlot&&(r.minContextSlot=t.minContextSlot),n&&(r.skipPreflight=n),o&&(r.preflightCommitment=o);const i=[e,r],a=vt(await this._rpcRequest("sendTransaction",i),Fi);if("error"in a){let e;throw"data"in a.error&&(e=a.error.data.logs),new Wn("failed to send transaction: "+a.error.message,e)}return a.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval((()=>{(async()=>{try{await this._rpcWebSocket.notify("ping")}catch{}})()}),5e3),this._updateSubscriptions()}_wsOnError(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}_wsOnClose(e){this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3!==e?(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach((e=>{let[t,r]=e;this._setSubscription(t,{...r,state:"pending"})}))):this._updateSubscriptions()}_setSubscription(e,t){var r;const n=null===(r=this._subscriptionsByHash[e])||void 0===r?void 0:r.state;if(this._subscriptionsByHash[e]=t,n!==t.state){const r=this._subscriptionStateChangeCallbacksByHash[e];r&&r.forEach((e=>{try{e(t.state)}catch{}}))}}_onSubscriptionStateChange(e,t){var r;const n=this._subscriptionHashByClientSubscriptionId[e];if(null==n)return()=>{};const o=(r=this._subscriptionStateChangeCallbacksByHash)[n]||(r[n]=new Set);return o.add(t),()=>{o.delete(t),0===o.size&&delete this._subscriptionStateChangeCallbacksByHash[n]}}async _updateSubscriptions(){if(0===Object.keys(this._subscriptionsByHash).length)return void(this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout((()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(e){e instanceof Error&&console.log("Error when closing socket connection: ".concat(e.message))}}),500)));if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected)return void this._rpcWebSocket.connect();const e=this._rpcWebSocketGeneration,t=()=>e===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map((async e=>{const r=this._subscriptionsByHash[e];if(void 0!==r)switch(r.state){case"pending":case"unsubscribed":if(0===r.callbacks.size)return delete this._subscriptionsByHash[e],"unsubscribed"===r.state&&delete this._subscriptionCallbacksByServerSubscriptionId[r.serverSubscriptionId],void await this._updateSubscriptions();await(async()=>{const{args:n,method:o}=r;try{this._setSubscription(e,{...r,state:"subscribing"});const t=await this._rpcWebSocket.call(o,n);this._setSubscription(e,{...r,serverSubscriptionId:t,state:"subscribed"}),this._subscriptionCallbacksByServerSubscriptionId[t]=r.callbacks,await this._updateSubscriptions()}catch(i){if(i instanceof Error&&console.error("".concat(o," error for argument"),n,i.message),!t())return;this._setSubscription(e,{...r,state:"pending"}),await this._updateSubscriptions()}})();break;case"subscribed":0===r.callbacks.size&&await(async()=>{const{serverSubscriptionId:n,unsubscribeMethod:o}=r;if(this._subscriptionsAutoDisposedByRpc.has(n))this._subscriptionsAutoDisposedByRpc.delete(n);else{this._setSubscription(e,{...r,state:"unsubscribing"}),this._setSubscription(e,{...r,state:"unsubscribing"});try{await this._rpcWebSocket.call(o,[n])}catch(i){if(i instanceof Error&&console.error("".concat(o," error:"),i.message),!t())return;return this._setSubscription(e,{...r,state:"subscribed"}),void await this._updateSubscriptions()}}this._setSubscription(e,{...r,state:"unsubscribed"}),await this._updateSubscriptions()})()}})))}_handleServerNotification(e,t){const r=this._subscriptionCallbacksByServerSubscriptionId[e];void 0!==r&&r.forEach((e=>{try{e(...t)}catch(r){console.error(r)}}))}_wsOnAccountNotification(e){const{result:t,subscription:r}=vt(e,Go);this._handleServerNotification(r,[t.value,t.context])}_makeSubscription(e,t){const r=this._nextClientSubscriptionId++,n=Hn([e.method,t]),o=this._subscriptionsByHash[n];return void 0===o?this._subscriptionsByHash[n]={...e,args:t,callbacks:new Set([e.callback]),state:"pending"}:o.callbacks.add(e.callback),this._subscriptionHashByClientSubscriptionId[r]=n,this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[r],delete this._subscriptionHashByClientSubscriptionId[r];const t=this._subscriptionsByHash[n];Jr(void 0!==t,"Could not find a `Subscription` when tearing down client subscription #".concat(r)),t.callbacks.delete(e.callback),await this._updateSubscriptions()},this._updateSubscriptions(),r}onAccountChange(e,t,r){const n=this._buildArgs([e.toBase58()],r||this._commitment||"finalized","base64");return this._makeSubscription({callback:t,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},n)}async removeAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"account change")}_wsOnProgramAccountNotification(e){const{result:t,subscription:r}=vt(e,Zo);this._handleServerNotification(r,[{accountId:t.value.pubkey,accountInfo:t.value.account},t.context])}onProgramAccountChange(e,t,r,n){const o=this._buildArgs([e.toBase58()],r||this._commitment||"finalized","base64",n?{filters:n}:void 0);return this._makeSubscription({callback:t,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},o)}async removeProgramAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"program account change")}onLogs(e,t,r){const n=this._buildArgs(["object"===typeof e?{mentions:[e.toString()]}:e],r||this._commitment||"finalized");return this._makeSubscription({callback:t,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},n)}async removeOnLogsListener(e){await this._unsubscribeClientSubscription(e,"logs")}_wsOnLogsNotification(e){const{result:t,subscription:r}=vt(e,zi);this._handleServerNotification(r,[t.value,t.context])}_wsOnSlotNotification(e){const{result:t,subscription:r}=vt(e,Yo);this._handleServerNotification(r,[t])}onSlotChange(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(e){await this._unsubscribeClientSubscription(e,"slot change")}_wsOnSlotUpdatesNotification(e){const{result:t,subscription:r}=vt(e,$o);this._handleServerNotification(r,[t])}onSlotUpdate(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(e){await this._unsubscribeClientSubscription(e,"slot update")}async _unsubscribeClientSubscription(e,t){const r=this._subscriptionDisposeFunctionsByClientSubscriptionId[e];r?await r():console.warn("Ignored unsubscribe request because an active subscription with id "+"`".concat(e,"` for '").concat(t,"' events ")+"could not be found.")}_buildArgs(e,t,r,n){const o=t||this._commitment;if(o||r||n){let t={};r&&(t.encoding=r),o&&(t.commitment=o),n&&(t=Object.assign(t,n)),e.push(t)}return e}_buildArgsAtLeastConfirmed(e,t,r,n){const o=t||this._commitment;if(o&&!["confirmed","finalized"].includes(o))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,t,r,n)}_wsOnSignatureNotification(e){const{result:t,subscription:r}=vt(e,ei);"receivedSignature"!==t.value&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,"receivedSignature"===t.value?[{type:"received"},t.context]:[{type:"status",result:t.value},t.context])}onSignature(e,t,r){const n=this._buildArgs([e],r||this._commitment||"finalized"),o=this._makeSubscription({callback:(e,r)=>{if("status"===e.type){t(e.result,r);try{this.removeSignatureListener(o)}catch(n){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},n);return o}onSignatureWithOptions(e,t,r){const{commitment:n,...o}={...r,commitment:r&&r.commitment||this._commitment||"finalized"},i=this._buildArgs([e],n,void 0,o),a=this._makeSubscription({callback:(e,r)=>{t(e,r);try{this.removeSignatureListener(a)}catch(n){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},i);return a}async removeSignatureListener(e){await this._unsubscribeClientSubscription(e,"signature result")}_wsOnRootNotification(e){const{result:t,subscription:r}=vt(e,ti);this._handleServerNotification(r,[t])}onRootChange(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(e){await this._unsubscribeClientSubscription(e,"root change")}}class Vi{constructor(e){this._keypair=void 0,this._keypair=null!==e&&void 0!==e?e:kr()}static generate(){return new Vi(kr())}static fromSecretKey(e,t){if(64!==e.byteLength)throw new Error("bad secret key size");const r=e.slice(32,64);if(!t||!t.skipValidation){const t=e.slice(0,32),n=_r(t);for(let e=0;e<32;e++)if(r[e]!==n[e])throw new Error("provided secretKey is invalid")}return new Vi({publicKey:r,secretKey:e})}static fromSeed(e){const t=_r(e),r=new Uint8Array(64);return r.set(e),r.set(t,32),new Vi({publicKey:t,secretKey:r})}get publicKey(){return new Lr(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}const Ki=Object.freeze({CreateLookupTable:{index:0,layout:ut.w3([ut.DH("instruction"),Rn("recentSlot"),ut.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:ut.w3([ut.DH("instruction")])},ExtendLookupTable:{index:2,layout:ut.w3([ut.DH("instruction"),Rn(),ut.O6(Wr(),ut.cY(ut.DH(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:ut.w3([ut.DH("instruction")])},CloseLookupTable:{index:4,layout:ut.w3([ut.DH("instruction")])}});class Wi{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const t=ut.DH("instruction").decode(e.data);let r;for(const[n,o]of Object.entries(Ki))if(o.index==t){r=n;break}if(!r)throw new Error("Invalid Instruction. Should be a LookupTable Instruction");return r}static decodeCreateLookupTable(e){this.checkProgramId(e.programId),this.checkKeysLength(e.keys,4);const{recentSlot:t}=En(Ki.CreateLookupTable,e.data);return{authority:e.keys[1].pubkey,payer:e.keys[2].pubkey,recentSlot:Number(t)}}static decodeExtendLookupTable(e){if(this.checkProgramId(e.programId),e.keys.length<2)throw new Error("invalid instruction; found ".concat(e.keys.length," keys, expected at least 2"));const{addresses:t}=En(Ki.ExtendLookupTable,e.data);return{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,payer:e.keys.length>2?e.keys[2].pubkey:void 0,addresses:t.map((e=>new Lr(e)))}}static decodeCloseLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,3),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey,recipient:e.keys[2].pubkey}}static decodeFreezeLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static decodeDeactivateLookupTable(e){return this.checkProgramId(e.programId),this.checkKeysLength(e.keys,2),{lookupTable:e.keys[0].pubkey,authority:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(Gi.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}static checkKeysLength(e,t){if(e.lengthe.toBytes()))}),r=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return e.payer&&r.push({pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:Bn.programId,isSigner:!1,isWritable:!1}),new cn({programId:this.programId,keys:r,data:t})}static deactivateLookupTable(e){const t=_n(Ki.DeactivateLookupTable),r=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new cn({programId:this.programId,keys:r,data:t})}static closeLookupTable(e){const t=_n(Ki.CloseLookupTable),r=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.recipient,isSigner:!1,isWritable:!0}];return new cn({programId:this.programId,keys:r,data:t})}}Gi.programId=new Lr("AddressLookupTab1e1111111111111111111111111");class Xi{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const t=ut.u8("instruction").decode(e.data);let r;for(const[n,o]of Object.entries(Zi))if(o.index==t){r=n;break}if(!r)throw new Error("Instruction type incorrect; not a ComputeBudgetInstruction");return r}static decodeRequestUnits(e){this.checkProgramId(e.programId);const{units:t,additionalFee:r}=En(Zi.RequestUnits,e.data);return{units:t,additionalFee:r}}static decodeRequestHeapFrame(e){this.checkProgramId(e.programId);const{bytes:t}=En(Zi.RequestHeapFrame,e.data);return{bytes:t}}static decodeSetComputeUnitLimit(e){this.checkProgramId(e.programId);const{units:t}=En(Zi.SetComputeUnitLimit,e.data);return{units:t}}static decodeSetComputeUnitPrice(e){this.checkProgramId(e.programId);const{microLamports:t}=En(Zi.SetComputeUnitPrice,e.data);return{microLamports:t}}static checkProgramId(e){if(!e.equals(Qi.programId))throw new Error("invalid instruction; programId is not ComputeBudgetProgram")}}const Zi=Object.freeze({RequestUnits:{index:0,layout:ut.w3([ut.u8("instruction"),ut.DH("units"),ut.DH("additionalFee")])},RequestHeapFrame:{index:1,layout:ut.w3([ut.u8("instruction"),ut.DH("bytes")])},SetComputeUnitLimit:{index:2,layout:ut.w3([ut.u8("instruction"),ut.DH("units")])},SetComputeUnitPrice:{index:3,layout:ut.w3([ut.u8("instruction"),Rn("microLamports")])}});class Qi{constructor(){}static requestUnits(e){const t=_n(Zi.RequestUnits,e);return new cn({keys:[],programId:this.programId,data:t})}static requestHeapFrame(e){const t=_n(Zi.RequestHeapFrame,e);return new cn({keys:[],programId:this.programId,data:t})}static setComputeUnitLimit(e){const t=_n(Zi.SetComputeUnitLimit,e);return new cn({keys:[],programId:this.programId,data:t})}static setComputeUnitPrice(e){const t=_n(Zi.SetComputeUnitPrice,{microLamports:BigInt(e.microLamports)});return new cn({keys:[],programId:this.programId,data:t})}}Qi.programId=new Lr("ComputeBudget111111111111111111111111111111");const Yi=ut.w3([ut.u8("numSignatures"),ut.u8("padding"),ut.NX("signatureOffset"),ut.NX("signatureInstructionIndex"),ut.NX("publicKeyOffset"),ut.NX("publicKeyInstructionIndex"),ut.NX("messageDataOffset"),ut.NX("messageDataSize"),ut.NX("messageInstructionIndex")]);class Ji{constructor(){}static createInstructionWithPublicKey(e){const{publicKey:t,message:r,signature:n,instructionIndex:i}=e;Jr(32===t.length,"Public Key must be ".concat(32," bytes but received ").concat(t.length," bytes")),Jr(64===n.length,"Signature must be ".concat(64," bytes but received ").concat(n.length," bytes"));const a=Yi.span,s=a+t.length,u=s+n.length,c=o.Buffer.alloc(u+r.length),l=null==i?65535:i;return Yi.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:l,publicKeyOffset:a,publicKeyInstructionIndex:l,messageDataOffset:u,messageDataSize:r.length,messageInstructionIndex:l},c),c.fill(t,a),c.fill(n,s),c.fill(r,u),new cn({keys:[],programId:Ji.programId,data:c})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:r,instructionIndex:n}=e;Jr(64===t.length,"Private key must be ".concat(64," bytes but received ").concat(t.length," bytes"));try{const e=Vi.fromSecretKey(t),o=e.publicKey.toBytes(),i=xr(r,e.secretKey);return this.createInstructionWithPublicKey({publicKey:o,message:r,signature:i,instructionIndex:n})}catch(o){throw new Error("Error creating instruction; ".concat(o))}}}Ji.programId=new Lr("Ed25519SigVerify111111111111111111111111111");Ar.utils.isValidPrivateKey;const $i=Ar.getPublicKey,ea=ut.w3([ut.u8("numSignatures"),ut.NX("signatureOffset"),ut.u8("signatureInstructionIndex"),ut.NX("ethAddressOffset"),ut.u8("ethAddressInstructionIndex"),ut.NX("messageDataOffset"),ut.NX("messageDataSize"),ut.u8("messageInstructionIndex"),ut.av(20,"ethAddress"),ut.av(64,"signature"),ut.u8("recoveryId")]);class ta{constructor(){}static publicKeyToEthAddress(e){Jr(64===e.length,"Public key must be ".concat(64," bytes but received ").concat(e.length," bytes"));try{return o.Buffer.from(rr(Pr(e))).slice(-20)}catch(t){throw new Error("Error constructing Ethereum address: ".concat(t))}}static createInstructionWithPublicKey(e){const{publicKey:t,message:r,signature:n,recoveryId:o,instructionIndex:i}=e;return ta.createInstructionWithEthAddress({ethAddress:ta.publicKeyToEthAddress(t),message:r,signature:n,recoveryId:o,instructionIndex:i})}static createInstructionWithEthAddress(e){const{ethAddress:t,message:r,signature:n,recoveryId:i,instructionIndex:a=0}=e;let s;s="string"===typeof t?t.startsWith("0x")?o.Buffer.from(t.substr(2),"hex"):o.Buffer.from(t,"hex"):t,Jr(20===s.length,"Address must be ".concat(20," bytes but received ").concat(s.length," bytes"));const u=12+s.length,c=u+n.length+1,l=o.Buffer.alloc(ea.span+r.length);return ea.encode({numSignatures:1,signatureOffset:u,signatureInstructionIndex:a,ethAddressOffset:12,ethAddressInstructionIndex:a,messageDataOffset:c,messageDataSize:r.length,messageInstructionIndex:a,signature:Pr(n),ethAddress:Pr(s),recoveryId:i},l),l.fill(Pr(r),ea.span),new cn({keys:[],programId:ta.programId,data:l})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:r,instructionIndex:n}=e;Jr(32===t.length,"Private key must be ".concat(32," bytes but received ").concat(t.length," bytes"));try{const e=Pr(t),i=$i(e,!1).slice(1),a=o.Buffer.from(rr(Pr(r))),[s,u]=((e,t)=>{const r=Ar.sign(e,t);return[r.toCompactRawBytes(),r.recovery]})(a,e);return this.createInstructionWithPublicKey({publicKey:i,message:r,signature:s,recoveryId:u,instructionIndex:n})}catch(i){throw new Error("Error creating instruction; ".concat(i))}}}var ra;ta.programId=new Lr("KeccakSecp256k11111111111111111111111111111");const na=new Lr("StakeConfig11111111111111111111111111111111");class oa{constructor(e,t){this.staker=void 0,this.withdrawer=void 0,this.staker=e,this.withdrawer=t}}class ia{constructor(e,t,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=t,this.custodian=r}}ra=ia,ia.default=new ra(0,0,Lr.default);class aa{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const t=ut.DH("instruction").decode(e.data);let r;for(const[n,o]of Object.entries(sa))if(o.index==t){r=n;break}if(!r)throw new Error("Instruction type incorrect; not a StakeInstruction");return r}static decodeInitialize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{authorized:t,lockup:r}=En(sa.Initialize,e.data);return{stakePubkey:e.keys[0].pubkey,authorized:new oa(new Lr(t.staker),new Lr(t.withdrawer)),lockup:new ia(r.unixTimestamp,r.epoch,new Lr(r.custodian))}}static decodeDelegate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,6),En(sa.Delegate,e.data),{stakePubkey:e.keys[0].pubkey,votePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[5].pubkey}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:t,stakeAuthorizationType:r}=En(sa.Authorize,e.data),n={stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new Lr(t),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(n.custodianPubkey=e.keys[3].pubkey),n}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,2);const{newAuthorized:t,stakeAuthorizationType:r,authoritySeed:n,authorityOwner:o}=En(sa.AuthorizeWithSeed,e.data),i={stakePubkey:e.keys[0].pubkey,authorityBase:e.keys[1].pubkey,authoritySeed:n,authorityOwner:new Lr(o),newAuthorizedPubkey:new Lr(t),stakeAuthorizationType:{index:r}};return e.keys.length>3&&(i.custodianPubkey=e.keys[3].pubkey),i}static decodeSplit(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t}=En(sa.Split,e.data);return{stakePubkey:e.keys[0].pubkey,splitStakePubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[2].pubkey,lamports:t}}static decodeMerge(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),En(sa.Merge,e.data),{stakePubkey:e.keys[0].pubkey,sourceStakePubKey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,5);const{lamports:t}=En(sa.Withdraw,e.data),r={stakePubkey:e.keys[0].pubkey,toPubkey:e.keys[1].pubkey,authorizedPubkey:e.keys[4].pubkey,lamports:t};return e.keys.length>5&&(r.custodianPubkey=e.keys[5].pubkey),r}static decodeDeactivate(e){return this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3),En(sa.Deactivate,e.data),{stakePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey}}static checkProgramId(e){if(!e.equals(ca.programId))throw new Error("invalid instruction; programId is not StakeProgram")}static checkKeyLength(e,t){if(e.length0&&void 0!==arguments[0]?arguments[0]:"authorized";return ut.w3([Wr("staker"),Wr("withdrawer")],e)}(),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"lockup";return ut.w3([ut.Wg("unixTimestamp"),ut.Wg("epoch"),Wr("custodian")],e)}()])},Authorize:{index:1,layout:ut.w3([ut.DH("instruction"),Wr("newAuthorized"),ut.DH("stakeAuthorizationType")])},Delegate:{index:2,layout:ut.w3([ut.DH("instruction")])},Split:{index:3,layout:ut.w3([ut.DH("instruction"),ut.Wg("lamports")])},Withdraw:{index:4,layout:ut.w3([ut.DH("instruction"),ut.Wg("lamports")])},Deactivate:{index:5,layout:ut.w3([ut.DH("instruction")])},Merge:{index:7,layout:ut.w3([ut.DH("instruction")])},AuthorizeWithSeed:{index:8,layout:ut.w3([ut.DH("instruction"),Wr("newAuthorized"),ut.DH("stakeAuthorizationType"),Xr("authoritySeed"),Wr("authorityOwner")])}}),ua=Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class ca{constructor(){}static initialize(e){const{stakePubkey:t,authorized:r,lockup:n}=e,o=n||ia.default,i=_n(sa.Initialize,{authorized:{staker:Pr(r.staker.toBuffer()),withdrawer:Pr(r.withdrawer.toBuffer())},lockup:{unixTimestamp:o.unixTimestamp,epoch:o.epoch,custodian:Pr(o.custodian.toBuffer())}}),a={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:gn,isSigner:!1,isWritable:!1}],programId:this.programId,data:i};return new cn(a)}static createAccountWithSeed(e){const t=new ln;t.add(Bn.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:n,lockup:o}=e;return t.add(this.initialize({stakePubkey:r,authorized:n,lockup:o}))}static createAccount(e){const t=new ln;t.add(Bn.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:n,lockup:o}=e;return t.add(this.initialize({stakePubkey:r,authorized:n,lockup:o}))}static delegate(e){const{stakePubkey:t,authorizedPubkey:r,votePubkey:n}=e,o=_n(sa.Delegate);return(new ln).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:hn,isSigner:!1,isWritable:!1},{pubkey:An,isSigner:!1,isWritable:!1},{pubkey:na,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static authorize(e){const{stakePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:n,stakeAuthorizationType:o,custodianPubkey:i}=e,a=_n(sa.Authorize,{newAuthorized:Pr(n.toBuffer()),stakeAuthorizationType:o.index}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:hn,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return i&&s.push({pubkey:i,isSigner:!0,isWritable:!1}),(new ln).add({keys:s,programId:this.programId,data:a})}static authorizeWithSeed(e){const{stakePubkey:t,authorityBase:r,authoritySeed:n,authorityOwner:o,newAuthorizedPubkey:i,stakeAuthorizationType:a,custodianPubkey:s}=e,u=_n(sa.AuthorizeWithSeed,{newAuthorized:Pr(i.toBuffer()),stakeAuthorizationType:a.index,authoritySeed:n,authorityOwner:Pr(o.toBuffer())}),c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:hn,isSigner:!1,isWritable:!1}];return s&&c.push({pubkey:s,isSigner:!0,isWritable:!1}),(new ln).add({keys:c,programId:this.programId,data:u})}static splitInstruction(e){const{stakePubkey:t,authorizedPubkey:r,splitStakePubkey:n,lamports:o}=e,i=_n(sa.Split,{lamports:o});return new cn({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static split(e,t){const r=new ln;return r.add(Bn.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:t,space:this.space,programId:this.programId})),r.add(this.splitInstruction(e))}static splitWithSeed(e,t){const{stakePubkey:r,authorizedPubkey:n,splitStakePubkey:o,basePubkey:i,seed:a,lamports:s}=e,u=new ln;return u.add(Bn.allocate({accountPubkey:o,basePubkey:i,seed:a,space:this.space,programId:this.programId})),t&&t>0&&u.add(Bn.transfer({fromPubkey:e.authorizedPubkey,toPubkey:o,lamports:t})),u.add(this.splitInstruction({stakePubkey:r,authorizedPubkey:n,splitStakePubkey:o,lamports:s}))}static merge(e){const{stakePubkey:t,sourceStakePubKey:r,authorizedPubkey:n}=e,o=_n(sa.Merge);return(new ln).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:hn,isSigner:!1,isWritable:!1},{pubkey:An,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static withdraw(e){const{stakePubkey:t,authorizedPubkey:r,toPubkey:n,lamports:o,custodianPubkey:i}=e,a=_n(sa.Withdraw,{lamports:o}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:hn,isSigner:!1,isWritable:!1},{pubkey:An,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return i&&s.push({pubkey:i,isSigner:!0,isWritable:!1}),(new ln).add({keys:s,programId:this.programId,data:a})}static deactivate(e){const{stakePubkey:t,authorizedPubkey:r}=e,n=_n(sa.Deactivate);return(new ln).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:hn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}}ca.programId=new Lr("Stake11111111111111111111111111111111111111"),ca.space=200;class la{constructor(e,t,r,n){this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=e,this.authorizedVoter=t,this.authorizedWithdrawer=r,this.commission=n}}class fa{constructor(){}static decodeInstructionType(e){this.checkProgramId(e.programId);const t=ut.DH("instruction").decode(e.data);let r;for(const[n,o]of Object.entries(da))if(o.index==t){r=n;break}if(!r)throw new Error("Instruction type incorrect; not a VoteInstruction");return r}static decodeInitializeAccount(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,4);const{voteInit:t}=En(da.InitializeAccount,e.data);return{votePubkey:e.keys[0].pubkey,nodePubkey:e.keys[3].pubkey,voteInit:new la(new Lr(t.nodePubkey),new Lr(t.authorizedVoter),new Lr(t.authorizedWithdrawer),t.commission)}}static decodeAuthorize(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{newAuthorized:t,voteAuthorizationType:r}=En(da.Authorize,e.data);return{votePubkey:e.keys[0].pubkey,authorizedPubkey:e.keys[2].pubkey,newAuthorizedPubkey:new Lr(t),voteAuthorizationType:{index:r}}}static decodeAuthorizeWithSeed(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:t,currentAuthorityDerivedKeySeed:r,newAuthorized:n,voteAuthorizationType:o}}=En(da.AuthorizeWithSeed,e.data);return{currentAuthorityDerivedKeyBasePubkey:e.keys[2].pubkey,currentAuthorityDerivedKeyOwnerPubkey:new Lr(t),currentAuthorityDerivedKeySeed:r,newAuthorizedPubkey:new Lr(n),voteAuthorizationType:{index:o},votePubkey:e.keys[0].pubkey}}static decodeWithdraw(e){this.checkProgramId(e.programId),this.checkKeyLength(e.keys,3);const{lamports:t}=En(da.Withdraw,e.data);return{votePubkey:e.keys[0].pubkey,authorizedWithdrawerPubkey:e.keys[2].pubkey,lamports:t,toPubkey:e.keys[1].pubkey}}static checkProgramId(e){if(!e.equals(pa.programId))throw new Error("invalid instruction; programId is not VoteProgram")}static checkKeyLength(e,t){if(e.length0&&void 0!==arguments[0]?arguments[0]:"voteInit";return ut.w3([Wr("nodePubkey"),Wr("authorizedVoter"),Wr("authorizedWithdrawer"),ut.u8("commission")],e)}()])},Authorize:{index:1,layout:ut.w3([ut.DH("instruction"),Wr("newAuthorized"),ut.DH("voteAuthorizationType")])},Withdraw:{index:3,layout:ut.w3([ut.DH("instruction"),ut.Wg("lamports")])},UpdateValidatorIdentity:{index:4,layout:ut.w3([ut.DH("instruction")])},AuthorizeWithSeed:{index:10,layout:ut.w3([ut.DH("instruction"),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"voteAuthorizeWithSeedArgs";return ut.w3([ut.DH("voteAuthorizationType"),Wr("currentAuthorityDerivedKeyOwnerPubkey"),Xr("currentAuthorityDerivedKeySeed"),Wr("newAuthorized")],e)}()])}}),ha=Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class pa{constructor(){}static initializeAccount(e){const{votePubkey:t,nodePubkey:r,voteInit:n}=e,o=_n(da.InitializeAccount,{voteInit:{nodePubkey:Pr(n.nodePubkey.toBuffer()),authorizedVoter:Pr(n.authorizedVoter.toBuffer()),authorizedWithdrawer:Pr(n.authorizedWithdrawer.toBuffer()),commission:n.commission}}),i={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:gn,isSigner:!1,isWritable:!1},{pubkey:hn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o};return new cn(i)}static createAccount(e){const t=new ln;return t.add(Bn.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){const{votePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:n,voteAuthorizationType:o}=e,i=_n(da.Authorize,{newAuthorized:Pr(n.toBuffer()),voteAuthorizationType:o.index}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:hn,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return(new ln).add({keys:a,programId:this.programId,data:i})}static authorizeWithSeed(e){const{currentAuthorityDerivedKeyBasePubkey:t,currentAuthorityDerivedKeyOwnerPubkey:r,currentAuthorityDerivedKeySeed:n,newAuthorizedPubkey:o,voteAuthorizationType:i,votePubkey:a}=e,s=_n(da.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:Pr(r.toBuffer()),currentAuthorityDerivedKeySeed:n,newAuthorized:Pr(o.toBuffer()),voteAuthorizationType:i.index}}),u=[{pubkey:a,isSigner:!1,isWritable:!0},{pubkey:hn,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}];return(new ln).add({keys:u,programId:this.programId,data:s})}static withdraw(e){const{votePubkey:t,authorizedWithdrawerPubkey:r,lamports:n,toPubkey:o}=e,i=_n(da.Withdraw,{lamports:n}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return(new ln).add({keys:a,programId:this.programId,data:i})}static safeWithdraw(e,t,r){if(e.lamports>t-r)throw new Error("Withdraw will leave vote account with insufficient funds.");return pa.withdraw(e)}static updateValidatorIdentity(e){const{votePubkey:t,authorizedWithdrawerPubkey:r,nodePubkey:n}=e,o=_n(da.UpdateValidatorIdentity),i=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return(new ln).add({keys:i,programId:this.programId,data:o})}}pa.programId=new Lr("Vote111111111111111111111111111111111111111"),pa.space=3762;const ya=new Lr("Va1idator1nfo111111111111111111111111111111"),ma=Mt({name:It(),website:Ot(It()),details:Ot(It()),keybaseUsername:Ot(It())});class ga{constructor(e,t){this.key=void 0,this.info=void 0,this.key=e,this.info=t}static fromConfigData(e){let t=[...e];if(2!==Qr(t))return null;const r=[];for(let n=0;n<2;n++){const e=new Lr(rn(t,0,Br)),n=1===tn(t);r.push({publicKey:e,isSigner:n})}if(r[0].publicKey.equals(ya)&&r[1].isSigner){const e=Xr().decode(o.Buffer.from(t)),n=JSON.parse(e);return gt(n,ma),new ga(r[1].publicKey,n)}return null}}const va=new Lr("Vote111111111111111111111111111111111111111"),ba=ut.w3([Wr("nodePubkey"),Wr("authorizedWithdrawer"),ut.u8("commission"),ut.I0(),ut.O6(ut.w3([ut.I0("slot"),ut.DH("confirmationCount")]),ut.cY(ut.DH(),-8),"votes"),ut.u8("rootSlotValid"),ut.I0("rootSlot"),ut.I0(),ut.O6(ut.w3([ut.I0("epoch"),Wr("authorizedVoter")]),ut.cY(ut.DH(),-8),"authorizedVoters"),ut.w3([ut.O6(ut.w3([Wr("authorizedPubkey"),ut.I0("epochOfLastAuthorizedSwitch"),ut.I0("targetEpoch")]),32,"buf"),ut.I0("idx"),ut.u8("isEmpty")],"priorVoters"),ut.I0(),ut.O6(ut.w3([ut.I0("epoch"),ut.I0("credits"),ut.I0("prevCredits")]),ut.cY(ut.DH(),-8),"epochCredits"),ut.w3([ut.I0("slot"),ut.I0("timestamp")],"lastTimestamp")]);class wa{constructor(e){this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=e.nodePubkey,this.authorizedWithdrawer=e.authorizedWithdrawer,this.commission=e.commission,this.rootSlot=e.rootSlot,this.votes=e.votes,this.authorizedVoters=e.authorizedVoters,this.priorVoters=e.priorVoters,this.epochCredits=e.epochCredits,this.lastTimestamp=e.lastTimestamp}static fromAccountData(e){const t=ba.decode(Pr(e),4);let r=t.rootSlot;return t.rootSlotValid||(r=null),new wa({nodePubkey:new Lr(t.nodePubkey),authorizedWithdrawer:new Lr(t.authorizedWithdrawer),commission:t.commission,votes:t.votes,rootSlot:r,authorizedVoters:t.authorizedVoters.map(Aa),priorVoters:ka(t.priorVoters),epochCredits:t.epochCredits,lastTimestamp:t.lastTimestamp})}}function Aa(e){let{authorizedVoter:t,epoch:r}=e;return{epoch:r,authorizedVoter:new Lr(t)}}function Sa(e){let{authorizedPubkey:t,epochOfLastAuthorizedSwitch:r,targetEpoch:n}=e;return{authorizedPubkey:new Lr(t),epochOfLastAuthorizedSwitch:r,targetEpoch:n}}function ka(e){let{buf:t,idx:r,isEmpty:n}=e;return n?[]:[...t.slice(r+1).map(Sa),...t.slice(0,r).map(Sa)]}const _a={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function Ea(e,t){const r=!1===t?"http":"https";if(!e)return _a[r].devnet;const n=_a[r][e];if(!n)throw new Error("Unknown ".concat(r," cluster: ").concat(e));return n}async function xa(e,t,r,n){let o,i;r&&Object.prototype.hasOwnProperty.call(r,"lastValidBlockHeight")||r&&Object.prototype.hasOwnProperty.call(r,"nonceValue")?(o=r,i=n):i=r;const a=i&&{skipPreflight:i.skipPreflight,preflightCommitment:i.preflightCommitment||i.commitment,minContextSlot:i.minContextSlot},s=await e.sendRawTransaction(t,a),u=i&&i.commitment,c=o?e.confirmTransaction(o,u):e.confirmTransaction(s,u),l=(await c).value;if(l.err)throw new Error("Raw transaction ".concat(s," failed (").concat(JSON.stringify(l),")"));return s}const Ta=1e9},32922:function(e){e.exports=(()=>{"use strict";var e,t,r={d:(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};r.r(n),r.d(n,{default:()=>g,getNetwork:()=>l,getNetworkDetails:()=>f,getPublicKey:()=>i,getUserInfo:()=>p,isAllowed:()=>d,isBrowser:()=>m,isConnected:()=>c,requestAccess:()=>y,setAllowed:()=>h,signAuthEntry:()=>u,signBlob:()=>s,signTransaction:()=>a}),function(e){e.CREATE_ACCOUNT="CREATE_ACCOUNT",e.FUND_ACCOUNT="FUND_ACCOUNT",e.ADD_ACCOUNT="ADD_ACCOUNT",e.IMPORT_ACCOUNT="IMPORT_ACCOUNT",e.IMPORT_HARDWARE_WALLET="IMPORT_HARDWARE_WALLET",e.LOAD_ACCOUNT="LOAD_ACCOUNT",e.MAKE_ACCOUNT_ACTIVE="MAKE_ACCOUNT_ACTIVE",e.UPDATE_ACCOUNT_NAME="UPDATE_ACCOUNT_NAME",e.GET_MNEMONIC_PHRASE="GET_MNEMONIC_PHRASE",e.CONFIRM_MNEMONIC_PHRASE="CONFIRM_MNEMONIC_PHRASE",e.CONFIRM_MIGRATED_MNEMONIC_PHRASE="CONFIRM_MIGRATED_MNEMONIC_PHRASE",e.RECOVER_ACCOUNT="RECOVER_ACCOUNT",e.CONFIRM_PASSWORD="CONFIRM_PASSWORD",e.REJECT_ACCESS="REJECT_ACCESS",e.GRANT_ACCESS="GRANT_ACCESS",e.SIGN_TRANSACTION="SIGN_TRANSACTION",e.SIGN_BLOB="SIGN_BLOB",e.SIGN_AUTH_ENTRY="SIGN_AUTH_ENTRY",e.HANDLE_SIGNED_HW_TRANSACTION="HANDLE_SIGNED_HW_TRANSACTION",e.REJECT_TRANSACTION="REJECT_TRANSACTION",e.SIGN_FREIGHTER_TRANSACTION="SIGN_FREIGHTER_TRANSACTION",e.SIGN_FREIGHTER_SOROBAN_TRANSACTION="SIGN_FREIGHTER_SOROBAN_TRANSACTION",e.ADD_RECENT_ADDRESS="ADD_RECENT_ADDRESS",e.LOAD_RECENT_ADDRESSES="LOAD_RECENT_ADDRESSES",e.SIGN_OUT="SIGN_OUT",e.SHOW_BACKUP_PHRASE="SHOW_BACKUP_PHRASE",e.SAVE_ALLOWLIST="SAVE_ALLOWLIST",e.SAVE_SETTINGS="SAVE_SETTINGS",e.LOAD_SETTINGS="LOAD_SETTINGS",e.GET_CACHED_ASSET_ICON="GET_CACHED_ASSET_ICON",e.CACHE_ASSET_ICON="CACHE_ASSET_ICON",e.GET_CACHED_ASSET_DOMAIN="GET_CACHED_ASSET_DOMAIN",e.CACHE_ASSET_DOMAIN="CACHE_ASSET_DOMAIN",e.GET_BLOCKED_ACCOUNTS="GET_BLOCKED_ACCOUNTS",e.GET_BLOCKED_DOMAINS="GET_BLOCKED_DOMAINS",e.ADD_CUSTOM_NETWORK="ADD_CUSTOM_NETWORK",e.CHANGE_NETWORK="CHANGE_NETWORK",e.REMOVE_CUSTOM_NETWORK="REMOVE_CUSTOM_NETWORK",e.EDIT_CUSTOM_NETWORK="EDIT_CUSTOM_NETWORK",e.RESET_EXP_DATA="RESET_EXP_DATA",e.ADD_TOKEN_ID="ADD_TOKEN_ID",e.GET_TOKEN_IDS="GET_TOKEN_IDS",e.REMOVE_TOKEN_ID="REMOVE_TOKEN_ID",e.GET_MIGRATABLE_ACCOUNTS="GET_MIGRATABLE_ACCOUNTS",e.GET_MIGRATED_MNEMONIC_PHRASE="GET_MIGRATED_MNEMONIC_PHRASE",e.MIGRATE_ACCOUNTS="MIGRATE_ACCOUNTS"}(e||(e={})),function(e){e.REQUEST_ACCESS="REQUEST_ACCESS",e.REQUEST_PUBLIC_KEY="REQUEST_PUBLIC_KEY",e.SUBMIT_TRANSACTION="SUBMIT_TRANSACTION",e.SUBMIT_BLOB="SUBMIT_BLOB",e.SUBMIT_AUTH_ENTRY="SUBMIT_AUTH_ENTRY",e.REQUEST_NETWORK="REQUEST_NETWORK",e.REQUEST_NETWORK_DETAILS="REQUEST_NETWORK_DETAILS",e.REQUEST_CONNECTION_STATUS="REQUEST_CONNECTION_STATUS",e.REQUEST_ALLOWED_STATUS="REQUEST_ALLOWED_STATUS",e.SET_ALLOWED_STATUS="SET_ALLOWED_STATUS",e.REQUEST_USER_INFO="REQUEST_USER_INFO"}(t||(t={}));const o=e=>{const r=Date.now()+Math.random();return window.postMessage({source:"FREIGHTER_EXTERNAL_MSG_REQUEST",messageId:r,...e},window.location.origin),new Promise((n=>{let o=0;e.type!==t.REQUEST_CONNECTION_STATUS&&e.type!==t.REQUEST_PUBLIC_KEY||(o=setTimeout((()=>{n({isConnected:!1,publicKey:""}),window.removeEventListener("message",i)}),2e3));const i=e=>{var t,a;e.source===window&&"FREIGHTER_EXTERNAL_MSG_RESPONSE"===(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.source)&&(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.messagedId)===r&&(n(e.data),window.removeEventListener("message",i),clearTimeout(o))};window.addEventListener("message",i,!1)}))},i=()=>m?(async()=>{let e={publicKey:"",error:""};try{e=await o({type:t.REQUEST_PUBLIC_KEY})}catch(e){console.error(e)}const{publicKey:r,error:n}=e;if(n)throw n;return r})():Promise.resolve(""),a=(e,r)=>m?(async(e,r,n)=>{let i="",a="",s="";"object"==typeof r?(i=r.network||"",a=r.accountToSign||"",s=r.networkPassphrase||""):(i=r||"",a="");let u={signedTransaction:"",error:""};try{u=await o({transactionXdr:e,network:i,networkPassphrase:s,accountToSign:a,type:t.SUBMIT_TRANSACTION})}catch(e){throw console.error(e),e}const{signedTransaction:c,error:l}=u;if(l)throw l;return c})(e,r):Promise.resolve(""),s=(e,r)=>m?(async(e,r)=>{let n={signedBlob:"",error:""};const i=(r||{}).accountToSign||"";try{n=await o({blob:e,accountToSign:i,type:t.SUBMIT_BLOB})}catch(e){throw console.error(e),e}const{signedBlob:a,error:s}=n;if(s)throw s;return a})(e,r):Promise.resolve(""),u=(e,r)=>m?(async(e,r)=>{let n={signedAuthEntry:"",error:""};const i=(r||{}).accountToSign||"";try{n=await o({entryXdr:e,accountToSign:i,type:t.SUBMIT_AUTH_ENTRY})}catch(e){console.error(e)}const{signedAuthEntry:a,error:s}=n;if(s)throw s;return a})(e,r):Promise.resolve(""),c=()=>m?window.freighter?Promise.resolve(window.freighter):(async()=>{let e={isConnected:!1};try{e=await o({type:t.REQUEST_CONNECTION_STATUS})}catch(e){console.error(e)}return e.isConnected})():Promise.resolve(!1),l=()=>m?(async()=>{let e={network:"",error:""};try{e=await o({type:t.REQUEST_NETWORK})}catch(e){console.error(e)}const{network:r,error:n}=e;if(n)throw n;return r})():Promise.resolve(""),f=()=>m?(async()=>{let e={networkDetails:{network:"",networkName:"",networkUrl:"",networkPassphrase:"",sorobanRpcUrl:void 0},error:""};try{e=await o({type:t.REQUEST_NETWORK_DETAILS})}catch(e){console.error(e)}const{networkDetails:r,error:n}=e,{network:i,networkUrl:a,networkPassphrase:s,sorobanRpcUrl:u}=r;if(n)throw n;return{network:i,networkUrl:a,networkPassphrase:s,sorobanRpcUrl:u}})():Promise.resolve({network:"",networkUrl:"",networkPassphrase:"",sorobanRpcUrl:""}),d=()=>m?(async()=>{let e={isAllowed:!1};try{e=await o({type:t.REQUEST_ALLOWED_STATUS})}catch(e){console.error(e)}return e.isAllowed})():Promise.resolve(!1),h=()=>m?(async()=>{let e={isAllowed:!1,error:""};try{e=await o({type:t.SET_ALLOWED_STATUS})}catch(e){console.error(e)}const{isAllowed:r,error:n}=e;if(n)throw n;return r})():Promise.resolve(!1),p=()=>m?(async()=>{let e={userInfo:{publicKey:""},error:""};try{e=await o({type:t.REQUEST_USER_INFO})}catch(e){console.error(e)}const{userInfo:r,error:n}=e;if(n)throw n;return r})():Promise.resolve({publicKey:""}),y=()=>m?(async()=>{let e={publicKey:"",error:""};try{e=await o({type:t.REQUEST_ACCESS})}catch(e){console.error(e)}const{publicKey:r,error:n}=e;if(n)throw n;return r})():Promise.resolve(""),m="undefined"!=typeof window,g={getPublicKey:i,signTransaction:a,signBlob:s,signAuthEntry:u,isConnected:c,getNetwork:l,getNetworkDetails:f,isAllowed:d,setAllowed:h,getUserInfo:p,requestAccess:y};return n})()},75493:function(e,t,r){var n,o=r(43693).default;n=()=>(()=>{var e={616:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(287);n.hp.alloc(1).subarray(0,1)instanceof n.hp||(n.hp.prototype.subarray=function(e,t){const r=Uint8Array.prototype.subarray.call(this,e,t);return Object.setPrototypeOf(r,n.hp.prototype),r});const o=n.hp},281:(e,t,r)=>{const n=r(164);e.exports=n},164:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Array:()=>F,Bool:()=>C,Double:()=>R,Enum:()=>H,Float:()=>O,Hyper:()=>E,Int:()=>A,LargeInt:()=>_,Opaque:()=>L,Option:()=>z,Quadruple:()=>I,Reference:()=>V,String:()=>B,Struct:()=>K,Union:()=>G,UnsignedHyper:()=>P,UnsignedInt:()=>T,VarArray:()=>D,VarOpaque:()=>U,Void:()=>q,XdrReader:()=>c,XdrWriter:()=>d,config:()=>re});class n extends TypeError{constructor(e){super("XDR Write Error: ".concat(e))}}class i extends TypeError{constructor(e){super("XDR Read Error: ".concat(e))}}class a extends TypeError{constructor(e){super("XDR Type Definition Error: ".concat(e))}}class s extends a{constructor(){super("method not implemented, it should be overloaded in the descendant class.")}}var u=r(616).A;class c{constructor(e){if(o(this,"_buffer",void 0),o(this,"_length",void 0),o(this,"_index",void 0),!u.isBuffer(e)){if(!(e instanceof Array||Array.isArray(e)||ArrayBuffer.isView(e)))throw new i("source invalid: ".concat(e));e=u.from(e)}this._buffer=e,this._length=e.length,this._index=0}get eof(){return this._index===this._length}advance(e){const t=this._index;if(this._index+=e,this._length0){for(let e=0;e0){const e=this.alloc(r);this._buffer.fill(0,e,this._index)}}writeInt32BE(e){const t=this.alloc(4);this._buffer.writeInt32BE(e,t)}writeUInt32BE(e){const t=this.alloc(4);this._buffer.writeUInt32BE(e,t)}writeBigInt64BE(e){const t=this.alloc(8);this._buffer.writeBigInt64BE(e,t)}writeBigUInt64BE(e){const t=this.alloc(8);this._buffer.writeBigUInt64BE(e,t)}writeFloatBE(e){const t=this.alloc(4);this._buffer.writeFloatBE(e,t)}writeDoubleBE(e){const t=this.alloc(8);this._buffer.writeDoubleBE(e,t)}}o(d,"bufferChunkSize",f);var h=r(616).A;class p{toXDR(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"raw";if(!this.write)return this.constructor.toXDR(this,e);const t=new d;return this.write(this,t),v(t.finalize(),e)}fromXDR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"raw";if(!this.read)return this.constructor.fromXDR(e,t);const r=new c(b(e,t)),n=this.read(r);return r.ensureInputConsumed(),n}validateXDR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"raw";try{return this.fromXDR(e,t),!0}catch(e){return!1}}static toXDR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"raw";const r=new d;return this.write(e,r),v(r.finalize(),t)}static fromXDR(e){const t=new c(b(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"raw")),r=this.read(t);return t.ensureInputConsumed(),r}static validateXDR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"raw";try{return this.fromXDR(e,t),!0}catch(e){return!1}}}class y extends p{static read(e){throw new s}static write(e,t){throw new s}static isValid(e){return!1}}class m extends p{isValid(e){return!1}}class g extends TypeError{constructor(e){super("Invalid format ".concat(e,', must be one of "raw", "hex", "base64"'))}}function v(e,t){switch(t){case"raw":return e;case"hex":return e.toString("hex");case"base64":return e.toString("base64");default:throw new g(t)}}function b(e,t){switch(t){case"raw":return e;case"hex":return h.from(e,"hex");case"base64":return h.from(e,"base64");default:throw new g(t)}}const w=2147483647;class A extends y{static read(e){return e.readInt32BE()}static write(e,t){if("number"!=typeof e)throw new n("not a number");if((0|e)!==e)throw new n("invalid i32 value");t.writeInt32BE(e)}static isValid(e){return"number"==typeof e&&(0|e)===e&&e>=-2147483648&&e<=w}}function S(e,t,r){if("bigint"!=typeof e)throw new TypeError("Expected bigint 'value', got "+typeof e);const n=t/r;if(1===n)return[e];if(r<32||r>128||2!==n&&4!==n&&8!==n)throw new TypeError("invalid bigint (".concat(e,") and slice size (").concat(t," -> ").concat(r,") combination"));const o=BigInt(r),i=new Array(n);for(let a=0;a>=o;return i}function k(e,t){if(t)return[0n,(1n<=i&&o<=a)return o;throw new TypeError("bigint values [".concat(e,"] for ").concat(function(e,t){return"".concat(t?"u":"i").concat(e)}(t,r)," out of range [").concat(i,", ").concat(a,"]: ").concat(o))}(e,this.size,this.unsigned)}get unsigned(){throw new s}get size(){throw new s}slice(e){return S(this._value,this.size,e)}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}toBigInt(){return BigInt(this._value)}static read(e){const{size:t}=this.prototype;return 64===t?new this(e.readBigUInt64BE()):new this(...Array.from({length:t/64},(()=>e.readBigUInt64BE())).reverse())}static write(e,t){if(e instanceof this)e=e._value;else if("bigint"!=typeof e||e>this.MAX_VALUE||e>32n)}get size(){return 64}get unsigned(){return!1}static fromBits(e,t){return new this(e,t)}}E.defineIntBoundaries();const x=4294967295;class T extends y{static read(e){return e.readUInt32BE()}static write(e,t){if("number"!=typeof e||!(e>=0&&e<=x)||e%1!=0)throw new n("invalid u32 value");t.writeUInt32BE(e)}static isValid(e){return"number"==typeof e&&e%1==0&&e>=0&&e<=x}}T.MAX_VALUE=x,T.MIN_VALUE=0;class P extends _{constructor(){for(var e=arguments.length,t=new Array(e),r=0;r>32n)}get size(){return 64}get unsigned(){return!0}static fromBits(e,t){return new this(e,t)}}P.defineIntBoundaries();class O extends y{static read(e){return e.readFloatBE()}static write(e,t){if("number"!=typeof e)throw new n("not a number");t.writeFloatBE(e)}static isValid(e){return"number"==typeof e}}class R extends y{static read(e){return e.readDoubleBE()}static write(e,t){if("number"!=typeof e)throw new n("not a number");t.writeDoubleBE(e)}static isValid(e){return"number"==typeof e}}class I extends y{static read(){throw new a("quadruple not supported")}static write(){throw new a("quadruple not supported")}static isValid(){return!1}}class C extends y{static read(e){const t=A.read(e);switch(t){case 0:return!1;case 1:return!0;default:throw new i("got ".concat(t," when trying to read a bool"))}}static write(e,t){const r=e?1:0;A.write(r,t)}static isValid(e){return"boolean"==typeof e}}var M=r(616).A;class B extends m{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T.MAX_VALUE;super(),this._maxLength=e}read(e){const t=T.read(e);if(t>this._maxLength)throw new i("saw ".concat(t," length String, max allowed is ").concat(this._maxLength));return e.read(t)}readString(e){return this.read(e).toString("utf8")}write(e,t){const r="string"==typeof e?M.byteLength(e,"utf8"):e.length;if(r>this._maxLength)throw new n("got ".concat(e.length," bytes, max allowed is ").concat(this._maxLength));T.write(r,t),t.write(e,r)}isValid(e){return"string"==typeof e?M.byteLength(e,"utf8")<=this._maxLength:!!(e instanceof Array||M.isBuffer(e))&&e.length<=this._maxLength}}var N=r(616).A;class L extends m{constructor(e){super(),this._length=e}read(e){return e.read(this._length)}write(e,t){const{length:r}=e;if(r!==this._length)throw new n("got ".concat(e.length," bytes, expected ").concat(this._length));t.write(e,r)}isValid(e){return N.isBuffer(e)&&e.length===this._length}}var j=r(616).A;class U extends m{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T.MAX_VALUE;super(),this._maxLength=e}read(e){const t=T.read(e);if(t>this._maxLength)throw new i("saw ".concat(t," length VarOpaque, max allowed is ").concat(this._maxLength));return e.read(t)}write(e,t){const{length:r}=e;if(e.length>this._maxLength)throw new n("got ".concat(e.length," bytes, max allowed is ").concat(this._maxLength));T.write(r,t),t.write(e,r)}isValid(e){return j.isBuffer(e)&&e.length<=this._maxLength}}class F extends m{constructor(e,t){super(),this._childType=e,this._length=t}read(e){const t=new r.g.Array(this._length);for(let r=0;r1&&void 0!==arguments[1]?arguments[1]:T.MAX_VALUE;super(),this._childType=e,this._maxLength=t}read(e){const t=T.read(e);if(t>this._maxLength)throw new i("saw ".concat(t," length VarArray, max allowed is ").concat(this._maxLength));const r=new Array(t);for(let n=0;nthis._maxLength)throw new n("got array of size ".concat(e.length,", max allowed is ").concat(this._maxLength));T.write(e.length,t);for(const r of e)this._childType.write(r,t)}isValid(e){if(!(e instanceof Array)||e.length>this._maxLength)return!1;for(const t of e)if(!this._childType.isValid(t))return!1;return!0}}class z extends y{constructor(e){super(),this._childType=e}read(e){if(C.read(e))return this._childType.read(e)}write(e,t){const r=null!=e;C.write(r,t),r&&this._childType.write(e,t)}isValid(e){return null==e||this._childType.isValid(e)}}class q extends y{static read(){}static write(e){if(void 0!==e)throw new n("trying to write value to a void slot")}static isValid(e){return void 0===e}}class H extends y{constructor(e,t){super(),this.name=e,this.value=t}static read(e){const t=A.read(e),r=this._byValue[t];if(void 0===r)throw new i("unknown ".concat(this.enumName," member for value ").concat(t));return r}static write(e,t){if(!(e instanceof this))throw new n("unknown ".concat(e," is not a ").concat(this.enumName));A.write(e.value,t)}static isValid(e){return e instanceof this}static members(){return this._members}static values(){return Object.values(this._members)}static fromName(e){const t=this._members[e];if(!t)throw new TypeError("".concat(e," is not a member of ").concat(this.enumName));return t}static fromValue(e){const t=this._byValue[e];if(void 0===t)throw new TypeError("".concat(e," is not a value of any member of ").concat(this.enumName));return t}static create(e,t,r){const n=class extends H{};n.enumName=t,e.results[t]=n,n._members={},n._byValue={};for(const[o,i]of Object.entries(r)){const e=new n(o,i);n._members[o]=e,n._byValue[i]=e,n[o]=()=>e}return n}}class V extends y{resolve(){throw new a('"resolve" method should be implemented in the descendant class')}}class K extends y{constructor(e){super(),this._attributes=e||{}}static read(e){const t={};for(const[r,n]of this._fields)t[r]=n.read(e);return new this(t)}static write(e,t){if(!(e instanceof this))throw new n("".concat(e," is not a ").concat(this.structName));for(const[r,n]of this._fields){const o=e._attributes[r];n.write(o,t)}}static isValid(e){return e instanceof this}static create(e,t,r){const n=class extends K{};n.structName=t,e.results[t]=n;const o=new Array(r.length);for(let i=0;i0&&void 0!==arguments[0]?arguments[0]:this._arm;if(this._arm!==q&&this._arm!==e)throw new TypeError("".concat(e," not set"));return this._value}switch(){return this._switch}arm(){return this._arm}armType(){return this._armType}value(){return this._value}static armForSwitch(e){const t=this._switches.get(e);if(void 0!==t)return t;if(this._defaultArm)return this._defaultArm;throw new TypeError("Bad union switch: ".concat(e))}static armTypeForArm(e){return e===q?q:this._arms[e]}static read(e){const t=this._switchOn.read(e),r=this.armForSwitch(t),n=r===q?q:this._arms[r];let o;return o=void 0!==n?n.read(e):r.read(e),new this(t,o)}static write(e,t){if(!(e instanceof this))throw new n("".concat(e," is not a ").concat(this.unionName));this._switchOn.write(e.switch(),t),e.armType().write(e.value(),t)}static isValid(e){return e instanceof this}static create(e,t,r){const n=class extends G{};n.unionName=t,e.results[t]=n,r.switchOn instanceof V?n._switchOn=r.switchOn.resolve(e):n._switchOn=r.switchOn,n._switches=new Map,n._arms={};let o=r.defaultArm;o instanceof V&&(o=o.resolve(e)),n._defaultArm=o;for(const[i,a]of r.switches){const e="string"==typeof i?n._switchOn.fromName(i):i;n._switches.set(e,a)}if(void 0!==n._switchOn.values)for(const i of n._switchOn.values())n[i.name]=function(e){return new n(i,e)},n.prototype[i.name]=function(e){return this.set(i,e)};if(r.arms)for(const[i,a]of Object.entries(r.arms))n._arms[i]=a instanceof V?a.resolve(e):a,a!==q&&(n.prototype[i]=function(){return this.get(i)});return n}}class X extends V{constructor(e){super(),this.name=e}resolve(e){return e.definitions[this.name].resolve(e)}}class Z extends V{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];super(),this.childReference=e,this.length=t,this.variable=r}resolve(e){let t=this.childReference,r=this.length;return t instanceof V&&(t=t.resolve(e)),r instanceof V&&(r=r.resolve(e)),this.variable?new D(t,r):new F(t,r)}}class Q extends V{constructor(e){super(),this.childReference=e,this.name=e.name}resolve(e){let t=this.childReference;return t instanceof V&&(t=t.resolve(e)),new z(t)}}class Y extends V{constructor(e,t){super(),this.sizedType=e,this.length=t}resolve(e){let t=this.length;return t instanceof V&&(t=t.resolve(e)),new this.sizedType(t)}}class J{constructor(e,t,r){this.constructor=e,this.name=t,this.config=r}resolve(e){return this.name in e.results?e.results[this.name]:this.constructor(e,this.name,this.config)}}function $(e,t,r){return r instanceof V&&(r=r.resolve(e)),e.results[t]=r,r}function ee(e,t,r){return e.results[t]=r,r}class te{constructor(e){this._destination=e,this._definitions={}}enum(e,t){const r=new J(H.create,e,t);this.define(e,r)}struct(e,t){const r=new J(K.create,e,t);this.define(e,r)}union(e,t){const r=new J(G.create,e,t);this.define(e,r)}typedef(e,t){const r=new J($,e,t);this.define(e,r)}const(e,t){const r=new J(ee,e,t);this.define(e,r)}void(){return q}bool(){return C}int(){return A}hyper(){return E}uint(){return T}uhyper(){return P}float(){return O}double(){return R}quadruple(){return I}string(e){return new Y(B,e)}opaque(e){return new Y(L,e)}varOpaque(e){return new Y(U,e)}array(e,t){return new Z(e,t)}varArray(e,t){return new Z(e,t,!0)}option(e){return new Q(e)}define(e,t){if(void 0!==this._destination[e])throw new a("".concat(e," is already defined"));this._definitions[e]=t}lookup(e){return new X(e)}resolve(){for(const e of Object.values(this._definitions))e.resolve({definitions:this._definitions,results:this._destination})}}function re(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e){const r=new te(t);e(r),r.resolve()}return t}},526:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],u=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),l=0,f=u>0?a-4:a;for(r=0;r>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,c=n-o;sc?c:s+a));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var o,i,a=[],s=t;s>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},287:(e,t,r)=>{"use strict";const n=r(526),o=r(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=u,t.IS=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=s(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const o=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Q(e.length)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),s(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=s(t);for(let n=0;n=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(o)return n?-1:W(e).length;t=(""+t).toLowerCase(),o=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,o){let i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;is&&(r=s-u),i=r;i>=0;i--){let r=!0;for(let n=0;no&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(i=u));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),c=this.slice(n,o),l=e.slice(t,r);for(let u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function P(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;on)&&(r=n);let o="";for(let i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,r,n,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function B(e,t,r,n,o){q(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function N(e,t,r,n,o){q(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function L(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,n,i){return t=+t,r>>>=0,i||L(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||L(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=J((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i=o&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=J((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||C(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||M(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i>>=0,r>>>=0,n||M(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=J((function(e){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=J((function(e){return N(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o>>=0,!n){const n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=J((function(e){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=J((function(e){return N(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function q(e,t,r,n,o,i){if(e>r||e3?0===t||t===BigInt(0)?">= 0".concat(n," and < 2").concat(n," ** ").concat(8*(i+1)).concat(n):">= -(2".concat(n," ** ").concat(8*(i+1)-1).concat(n,") and < 2 ** ").concat(8*(i+1)-1).concat(n):">= ".concat(t).concat(n," and <= ").concat(r).concat(n),new F.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,o,i)}function H(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(typeof t)}),TypeError),D("ERR_OUT_OF_RANGE",(function(e,t,r){let n='The value of "'.concat(e,'" is out of range.'),o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=z(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=z(o)),o+="n"),n+=" It must be ".concat(t,". Received ").concat(o),n}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function W(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function X(e,t,r,n){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function J(e){return"undefined"==typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},251:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<>1,l=-7,f=r?o-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=d,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=d,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+h]=255&s,h+=p,s/=256,o-=8);for(a=a<0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*y}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(281)})(),e.exports=n()},2539:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}function o(e,t){for(var r=0;r1?r-1:0),o=1;o1?r-1:0),o=1;o1?r-1:0),o=1;o1?r-1:0),o=1;o{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;te.length)&&(r=e.length),e.substring(r-t.length,r)===t}var b="",w="",A="",S="",k={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function E(e){return m(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function x(e,t,r){var n="",o="",i=0,a="",s=!1,u=E(e),c=u.split("\n"),l=E(t).split("\n"),f=0,d="";if("strictEqual"===r&&"object"===y(e)&&"object"===y(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===c.length&&1===l.length&&c[0]!==l[0]){var h=c[0].length+l[0].length;if(h<=10){if(("object"!==y(e)||null===e)&&("object"!==y(t)||null===t)&&(0!==e||0!==t))return"".concat(k[r],"\n\n")+"".concat(c[0]," !== ").concat(l[0],"\n")}else if("strictEqualObject"!==r){if(h<(process.stderr&&process.stderr.isTTY?process.stderr.columns:80)){for(;c[0][f]===l[0][f];)f++;f>2&&(d="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",f),"^"),f=0)}}}for(var p=c[c.length-1],m=l[l.length-1];p===m&&(f++<2?a="\n ".concat(p).concat(a):n=p,c.pop(),l.pop(),0!==c.length&&0!==l.length);)p=c[c.length-1],m=l[l.length-1];var g=Math.max(c.length,l.length);if(0===g){var _=u.split("\n");if(_.length>30)for(_[26]="".concat(b,"...").concat(S);_.length>27;)_.pop();return"".concat(k.notIdentical,"\n\n").concat(_.join("\n"),"\n")}f>3&&(a="\n".concat(b,"...").concat(S).concat(a),s=!0),""!==n&&(a="\n ".concat(n).concat(a),n="");var x=0,T=k[r]+"\n".concat(w,"+ actual").concat(S," ").concat(A,"- expected").concat(S),P=" ".concat(b,"...").concat(S," Lines skipped");for(f=0;f1&&f>2&&(O>4?(o+="\n".concat(b,"...").concat(S),s=!0):O>3&&(o+="\n ".concat(l[f-2]),x++),o+="\n ".concat(l[f-1]),x++),i=f,n+="\n".concat(A,"-").concat(S," ").concat(l[f]),x++;else if(l.length1&&f>2&&(O>4?(o+="\n".concat(b,"...").concat(S),s=!0):O>3&&(o+="\n ".concat(c[f-2]),x++),o+="\n ".concat(c[f-1]),x++),i=f,o+="\n".concat(w,"+").concat(S," ").concat(c[f]),x++;else{var R=l[f],I=c[f],C=I!==R&&(!v(I,",")||I.slice(0,-1)!==R);C&&v(R,",")&&R.slice(0,-1)===I&&(C=!1,I+=","),C?(O>1&&f>2&&(O>4?(o+="\n".concat(b,"...").concat(S),s=!0):O>3&&(o+="\n ".concat(c[f-2]),x++),o+="\n ".concat(c[f-1]),x++),i=f,o+="\n".concat(w,"+").concat(S," ").concat(I),n+="\n".concat(A,"-").concat(S," ").concat(R),x+=2):(o+=n,n="",1!==O&&0!==f||(o+="\n ".concat(I),x++))}if(x>20&&f30)for(h[26]="".concat(b,"...").concat(S);h.length>27;)h.pop();t=1===h.length?s.call(this,"".concat(d," ").concat(h[0])):s.call(this,"".concat(d,"\n\n").concat(h.join("\n"),"\n"))}else{var p=E(i),m="",v=k[n];"notDeepEqual"===n||"notEqual"===n?(p="".concat(k[n],"\n\n").concat(p)).length>1024&&(p="".concat(p.slice(0,1021),"...")):(m="".concat(E(a)),p.length>512&&(p="".concat(p.slice(0,509),"...")),m.length>512&&(m="".concat(m.slice(0,509),"...")),"deepEqual"===n||"equal"===n?p="".concat(v,"\n\n").concat(p,"\n\nshould equal\n\n"):m=" ".concat(n," ").concat(m)),t=s.call(this,"".concat(p).concat(m))}return Error.stackTraceLimit=f,t.generatedMessage=!r,Object.defineProperty(c(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=i,t.expected=a,t.operator=n,Error.captureStackTrace&&Error.captureStackTrace(c(t),o),t.stack,t.name="AssertionError",u(t)}return r=l,(n=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return m(this,o(o({},t),{},{customInspect:!1,depth:0}))}}])&&a(r.prototype,n),i&&a(r,i),Object.defineProperty(r,"prototype",{writable:!1}),l}(l(Error),m.custom);e.exports=T},66608:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}function o(e,t){for(var r=0;r2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}d("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),d("ERR_INVALID_ARG_TYPE",(function(e,t,o){var i,a,s,u;if(void 0===c&&(c=r(2539)),c("string"===typeof e,"'name' must be a string"),"string"===typeof t&&(a="not ",t.substr(!s||s<0?0:+s,a.length)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))u="The ".concat(e," ").concat(i," ").concat(h(t,"type"));else{var l=function(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";u='The "'.concat(e,'" ').concat(l," ").concat(i," ").concat(h(t,"type"))}return u+=". Received type ".concat(n(o))}),TypeError),d("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===l&&(l=r(86494));var o=l.inspect(t);return o.length>128&&(o="".concat(o.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(o)}),TypeError,RangeError),d("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var o;return o=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(o,".")}),TypeError),d("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n0,"At least one arg needs to be specified");var o="The ",i=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),i){case 1:o+="".concat(t[0]," argument");break;case 2:o+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:o+=t.slice(0,i-1).join(", "),o+=", and ".concat(t[i-1]," arguments")}return"".concat(o," must be specified")}),TypeError),e.exports.codes=f},46062:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r10)return!0;for(var t=0;t57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function M(e){return Object.keys(e).filter(C).concat(l(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function B(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o{"use strict";var n=r(59966).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r>>0,l=new Uint8Array(a);e[r];){var f=t[e.charCodeAt(r)];if(255===f)return;for(var d=0,h=a-1;(0!==f||d>>0,l[h]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");i=d,r++}for(var p=a-i;p!==a&&0===l[p];)p++;var y=n.allocUnsafe(o+(a-p));y.fill(0,0,o);for(var m=o;p!==a;)y[m++]=l[p++];return y}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,o=0,i=0,a=t.length;i!==a&&0===t[i];)i++,r++;for(var c=(a-i)*l+1>>>0,f=new Uint8Array(c);i!==a;){for(var d=t[i],h=0,p=c-1;(0!==d||h>>0,f[p]=d%s>>>0,d=d/s>>>0;if(0!==d)throw new Error("Non-zero carry");o=h,i++}for(var y=c-o;y!==c&&0===f[y];)y++;for(var m=u.repeat(r);y{"use strict";var r=function(e,t){return t||(t={}),e.split("").forEach((function(e,r){e in t||(t[e]=r)})),t},n={alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",charmap:{0:14,1:8}};n.charmap=r(n.alphabet,n.charmap);var o={alphabet:"0123456789ABCDEFGHJKMNPQRSTVWXYZ",charmap:{O:0,I:1,L:1}};o.charmap=r(o.alphabet,o.charmap);var i={alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",charmap:{}};function a(e){if(this.buf=[],this.shift=8,this.carry=0,e){switch(e.type){case"rfc4648":this.charmap=t.rfc4648.charmap;break;case"crockford":this.charmap=t.crockford.charmap;break;case"base32hex":this.charmap=t.base32hex.charmap;break;default:throw new Error("invalid type")}e.charmap&&(this.charmap=e.charmap)}}function s(e){if(this.buf="",this.shift=3,this.carry=0,e){switch(e.type){case"rfc4648":this.alphabet=t.rfc4648.alphabet;break;case"crockford":this.alphabet=t.crockford.alphabet;break;case"base32hex":this.alphabet=t.base32hex.alphabet;break;default:throw new Error("invalid type")}e.alphabet?this.alphabet=e.alphabet:e.lc&&(this.alphabet=this.alphabet.toLowerCase())}}i.charmap=r(i.alphabet,i.charmap),a.prototype.charmap=n.charmap,a.prototype.write=function(e){var t=this.charmap,r=this.buf,n=this.shift,o=this.carry;return e.toUpperCase().split("").forEach((function(e){if("="!=e){var i=255&t[e];(n-=5)>0?o|=i<>-n),o=i<<(n+=8)&255):(r.push(o|i),n=8,o=0)}})),this.shift=n,this.carry=o,this},a.prototype.finalize=function(e){return e&&this.write(e),8!==this.shift&&0!==this.carry&&(this.buf.push(this.carry),this.shift=8,this.carry=0),this.buf},s.prototype.alphabet=n.alphabet,s.prototype.write=function(e){var t,r,n,o=this.shift,i=this.carry;for(n=0;n>o,this.buf+=this.alphabet[31&t],o>5&&(t=r>>(o-=5),this.buf+=this.alphabet[31&t]),i=r<<(o=5-o),o=8-o;return this.shift=o,this.carry=i,this},s.prototype.finalize=function(e){return e&&this.write(e),3!==this.shift&&(this.buf+=this.alphabet[31&this.carry],this.shift=3,this.carry=0),this.buf},t.encode=function(e,t){return new s(t).finalize(e)},t.decode=function(e,t){return new a(t).finalize(e)},t.Decoder=a,t.Encoder=s,t.charmap=r,t.crockford=o,t.rfc4648=n,t.base32hex=i},34445:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],u=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),l=0,f=u>0?a-4:a;for(r=0;r>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,c=n-o;sc?c:s+a));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!==typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var o,i,a=[],s=t;s>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},72943:e=>{"use strict";for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},n=0;n<32;n++){var o=t.charAt(n);if(void 0!==r[o])throw new TypeError(o+" is ambiguous");r[o]=n}function i(e){var t=e>>25;return(33554431&e)<<5^996825010&-(1&t)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function a(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=i(t)^n>>5}for(t=i(t),r=0;rt)return"Exceeds length limit";var n=e.toLowerCase(),o=e.toUpperCase();if(e!==n&&e!==o)return"Mixed-case string "+e;var s=(e=n).lastIndexOf("1");if(-1===s)return"No separator character for "+e;if(0===s)return"Missing prefix for "+e;var u=e.slice(0,s),c=e.slice(s+1);if(c.length<6)return"Data too short";var l=a(u);if("string"===typeof l)return l;for(var f=[],d=0;d=c.length||f.push(p)}return 1!==l?"Invalid checksum for "+e:{prefix:u,words:f}}function u(e,t,r,n){for(var o=0,i=0,a=(1<=r;)i-=r,s.push(o>>i&a);if(n)i>0&&s.push(o<=t)return"Excess padding";if(o<n)throw new TypeError("Exceeds length limit");var o=a(e=e.toLowerCase());if("string"===typeof o)throw new Error(o);for(var s=e+"1",u=0;u>5!==0)throw new Error("Non 5-bit word");o=i(o)^c,s+=t.charAt(c)}for(u=0;u<6;++u)o=i(o);for(o^=1,u=0;u<6;++u){s+=t.charAt(o>>5*(5-u)&31)}return s},toWordsUnsafe:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},17081:(e,t)=>{"use strict";t.k5=function(e){{const t=Buffer.from(e);t.reverse();const r=t.toString("hex");return 0===r.length?BigInt(0):BigInt("0x".concat(r))}},t.Bq=function(e,t){{const r=e.toString(16),n=Buffer.from(r.padStart(2*t,"0").slice(0,2*t),"hex");return n.reverse(),n}}},1991:function(e,t,r){var n;!function(o){"use strict";var i,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,u=Math.floor,c="[BigNumber Error] ",l=c+"Number primitive has more than 15 significant digits: ",f=1e14,d=14,h=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],y=1e7,m=1e9;function g(e){var t=0|e;return e>0||e===t?t:t-1}function v(e){for(var t,r,n=1,o=e.length,i=e[0]+"";nc^r?1:-1;for(s=(u=o.length)<(c=i.length)?u:c,a=0;ai[a]^r?1:-1;return u==c?0:u>c^r?1:-1}function w(e,t,r,n){if(er||e!==u(e))throw Error(c+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function A(e){var t=e.c.length-1;return g(e.e/d)==t&&e.c[t]%2!=0}function S(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function k(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else tR?g.c=g.e=null:e.e=10;f/=10,c++);return void(c>R?g.c=g.e=null:(g.e=c,g.c=[e]))}m=String(e)}else{if(!a.test(m=String(e)))return o(g,m,p);g.s=45==m.charCodeAt(0)?(m=m.slice(1),-1):1}(c=m.indexOf("."))>-1&&(m=m.replace(".","")),(f=m.search(/e/i))>0?(c<0&&(c=f),c+=+m.slice(f+1),m=m.substring(0,f)):c<0&&(c=m.length)}else{if(w(t,2,N.length,"Base"),10==t&&L)return z(g=new j(e),E+g.e+1,x);if(m=String(e),p="number"==typeof e){if(0*e!=0)return o(g,m,p,t);if(g.s=1/e<0?(m=m.slice(1),-1):1,j.DEBUG&&m.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else g.s=45===m.charCodeAt(0)?(m=m.slice(1),-1):1;for(r=N.slice(0,t),c=f=0,y=m.length;fc){c=y;continue}}else if(!s&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){s=!0,f=-1,c=0;continue}return o(g,String(e),p,t)}p=!1,(c=(m=n(m,t,10,g.s)).indexOf("."))>-1?m=m.replace(".",""):c=m.length}for(f=0;48===m.charCodeAt(f);f++);for(y=m.length;48===m.charCodeAt(--y););if(m=m.slice(f,++y)){if(y-=f,p&&j.DEBUG&&y>15&&(e>h||e!==u(e)))throw Error(l+g.s*e);if((c=c-f-1)>R)g.c=g.e=null;else if(c=P)?S(u,a):k(u,a,"0");else if(i=(e=z(new j(e),t,r)).e,s=(u=v(e.c)).length,1==n||2==n&&(t<=i||i<=T)){for(;ss){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=i-s)>0)for(i+1==s&&(u+=".");t--;u+="0");return e.s<0&&o?"-"+u:u}function F(e,t){for(var r,n,o=1,i=new j(e[0]);o=10;o/=10,n++);return(r=n+r*d-1)>R?e.c=e.e=null:r=10;c/=10,o++);if((i=t-o)<0)i+=d,a=t,l=m[h=0],y=u(l/g[o-a-1]%10);else if((h=s((i+1)/d))>=m.length){if(!n)break e;for(;m.length<=h;m.push(0));l=y=0,o=1,a=(i%=d)-d+1}else{for(l=c=m[h],o=1;c>=10;c/=10,o++);y=(a=(i%=d)-d+o)<0?0:u(l/g[o-a-1]%10)}if(n=n||t<0||null!=m[h+1]||(a<0?l:l%g[o-a-1]),n=r<4?(y||n)&&(0==r||r==(e.s<0?3:2)):y>5||5==y&&(4==r||n||6==r&&(i>0?a>0?l/g[o-a]:0:m[h-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,n?(t-=e.e+1,m[0]=g[(d-t%d)%d],e.e=-t||0):m[0]=e.e=0,e;if(0==i?(m.length=h,c=1,h--):(m.length=h+1,c=g[d-i],m[h]=a>0?u(l/g[o-a]%g[a])*c:0),n)for(;;){if(0==h){for(i=1,a=m[0];a>=10;a/=10,i++);for(a=m[0]+=c,c=1;a>=10;a/=10,c++);i!=c&&(e.e++,m[0]==f&&(m[0]=1));break}if(m[h]+=c,m[h]!=f)break;m[h--]=0,c=1}for(i=m.length;0===m[--i];m.pop());}e.e>R?e.c=e.e=null:e.e=P?S(t,r):k(t,r,"0"),e.s<0?"-"+t:t)}return j.clone=e,j.ROUND_UP=0,j.ROUND_DOWN=1,j.ROUND_CEIL=2,j.ROUND_FLOOR=3,j.ROUND_HALF_UP=4,j.ROUND_HALF_DOWN=5,j.ROUND_HALF_EVEN=6,j.ROUND_HALF_CEIL=7,j.ROUND_HALF_FLOOR=8,j.EUCLID=9,j.config=j.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(w(r=e[t],0,m,t),E=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(w(r=e[t],0,8,t),x=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(w(r[0],-m,0,t),w(r[1],0,m,t),T=r[0],P=r[1]):(w(r,-m,m,t),T=-(P=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)w(r[0],-m,-1,t),w(r[1],1,m,t),O=r[0],R=r[1];else{if(w(r,-m,m,t),!r)throw Error(c+t+" cannot be zero: "+r);O=-(R=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(c+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw I=!r,Error(c+"crypto unavailable");I=r}else I=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(w(r=e[t],0,9,t),C=r),e.hasOwnProperty(t="POW_PRECISION")&&(w(r=e[t],0,m,t),M=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(c+t+" not an object: "+r);B=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);L="0123456789"==r.slice(0,10),N=r}}return{DECIMAL_PLACES:E,ROUNDING_MODE:x,EXPONENTIAL_AT:[T,P],RANGE:[O,R],CRYPTO:I,MODULO_MODE:C,POW_PRECISION:M,FORMAT:B,ALPHABET:N}},j.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!j.DEBUG)return!0;var t,r,n=e.c,o=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&o>=-m&&o<=m&&o===u(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%d)<1&&(t+=d),String(n[0]).length==t){for(t=0;t=f||r!==u(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(c+"Invalid BigNumber: "+e)},j.maximum=j.max=function(){return F(arguments,-1)},j.minimum=j.min=function(){return F(arguments,1)},j.random=function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return u(Math.random()*e)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(e){var r,n,o,i,a,l=0,f=[],h=new j(_);if(null==e?e=E:w(e,0,m),i=s(e/d),I)if(crypto.getRandomValues){for(r=crypto.getRandomValues(new Uint32Array(i*=2));l>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),r[l]=n[0],r[l+1]=n[1]):(f.push(a%1e14),l+=2);l=i/2}else{if(!crypto.randomBytes)throw I=!1,Error(c+"crypto unavailable");for(r=crypto.randomBytes(i*=7);l=9e15?crypto.randomBytes(7).copy(r,l):(f.push(a%1e14),l+=7);l=i/7}if(!I)for(;l=10;a/=10,l++);lr-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/r|0,a[o]%=r)}return a.reverse()}return function(n,o,i,a,s){var u,c,l,f,d,h,p,y,m=n.indexOf("."),g=E,b=x;for(m>=0&&(f=M,M=0,n=n.replace(".",""),h=(y=new j(o)).pow(n.length-m),M=f,y.c=t(k(v(h.c),h.e,"0"),10,i,e),y.e=y.c.length),l=f=(p=t(n,o,i,s?(u=N,e):(u=e,N))).length;0==p[--f];p.pop());if(!p[0])return u.charAt(0);if(m<0?--l:(h.c=p,h.e=l,h.s=a,p=(h=r(h,y,g,b,i)).c,d=h.r,l=h.e),m=p[c=l+g+1],f=i/2,d=d||c<0||null!=p[c+1],d=b<4?(null!=m||d)&&(0==b||b==(h.s<0?3:2)):m>f||m==f&&(4==b||d||6==b&&1&p[c-1]||b==(h.s<0?8:7)),c<1||!p[0])n=d?k(u.charAt(1),-g,u.charAt(0)):u.charAt(0);else{if(p.length=c,d)for(--i;++p[--c]>i;)p[c]=0,c||(++l,p=[1].concat(p));for(f=p.length;!p[--f];);for(m=0,n="";m<=f;n+=u.charAt(p[m++]));n=k(n,l,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,o,i,a,s=0,u=e.length,c=t%y,l=t/y|0;for(e=e.slice();u--;)s=((o=c*(i=e[u]%y)+(n=l*i+(a=e[u]/y|0)*c)%y*y+s)/r|0)+(n/y|0)+l*a,e[u]=o%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var o,i;if(r!=n)i=r>n?1:-1;else for(o=i=0;ot[o]?1:-1;break}return i}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]1;e.splice(0,1));}return function(n,o,i,a,s){var c,l,h,p,y,m,v,b,w,A,S,k,_,E,x,T,P,O=n.s==o.s?1:-1,R=n.c,I=o.c;if(!R||!R[0]||!I||!I[0])return new j(n.s&&o.s&&(R?!I||R[0]!=I[0]:I)?R&&0==R[0]||!I?0*O:O/0:NaN);for(w=(b=new j(O)).c=[],O=i+(l=n.e-o.e)+1,s||(s=f,l=g(n.e/d)-g(o.e/d),O=O/d|0),h=0;I[h]==(R[h]||0);h++);if(I[h]>(R[h]||0)&&l--,O<0)w.push(1),p=!0;else{for(E=R.length,T=I.length,h=0,O+=2,(y=u(s/(I[0]+1)))>1&&(I=e(I,y,s),R=e(R,y,s),T=I.length,E=R.length),_=T,S=(A=R.slice(0,T)).length;S=s/2&&x++;do{if(y=0,(c=t(I,A,T,S))<0){if(k=A[0],T!=S&&(k=k*s+(A[1]||0)),(y=u(k/x))>1)for(y>=s&&(y=s-1),v=(m=e(I,y,s)).length,S=A.length;1==t(m,A,v,S);)y--,r(m,T=10;O/=10,h++);z(b,i+(b.e=h+l*d-1)+1,a,p)}else b.e=l,b.r=+p;return b}}(),o=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,r=/^\.([^.]+)$/,n=/^-?(Infinity|NaN)$/,o=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(i,a,s,u){var l,f=s?a:a.replace(o,"");if(n.test(f))i.s=isNaN(f)?null:f<0?-1:1;else{if(!s&&(f=f.replace(e,(function(e,t,r){return l="x"==(r=r.toLowerCase())?16:"b"==r?2:8,u&&u!=l?e:t})),u&&(l=u,f=f.replace(t,"$1").replace(r,"0.$1")),a!=f))return new j(f,l);if(j.DEBUG)throw Error(c+"Not a"+(u?" base "+u:"")+" number: "+a);i.s=null}i.c=i.e=null}}(),i.absoluteValue=i.abs=function(){var e=new j(this);return e.s<0&&(e.s=1),e},i.comparedTo=function(e,t){return b(this,new j(e,t))},i.decimalPlaces=i.dp=function(e,t){var r,n,o,i=this;if(null!=e)return w(e,0,m),null==t?t=x:w(t,0,8),z(new j(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((o=r.length-1)-g(this.e/d))*d,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},i.dividedBy=i.div=function(e,t){return r(this,new j(e,t),E,x)},i.dividedToIntegerBy=i.idiv=function(e,t){return r(this,new j(e,t),0,1)},i.exponentiatedBy=i.pow=function(e,t){var r,n,o,i,a,l,f,h,p=this;if((e=new j(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+q(e));if(null!=t&&(t=new j(t)),a=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new j(Math.pow(+q(p),a?e.s*(2-A(e)):+q(e))),t?h.mod(t):h;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new j(NaN);(n=!l&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||a&&p.c[1]>=24e7:p.c[0]<8e13||a&&p.c[0]<=9999975e7)))return i=p.s<0&&A(e)?-0:0,p.e>-1&&(i=1/i),new j(l?1/i:i);M&&(i=s(M/d+2))}for(a?(r=new j(.5),l&&(e.s=1),f=A(e)):f=(o=Math.abs(+q(e)))%2,h=new j(_);;){if(f){if(!(h=h.times(p)).c)break;i?h.c.length>i&&(h.c.length=i):n&&(h=h.mod(t))}if(o){if(0===(o=u(o/2)))break;f=o%2}else if(z(e=e.times(r),e.e+1,1),e.e>14)f=A(e);else{if(0===(o=+q(e)))break;f=o%2}p=p.times(p),i?p.c&&p.c.length>i&&(p.c.length=i):n&&(p=p.mod(t))}return n?h:(l&&(h=_.div(h)),t?h.mod(t):i?z(h,M,x,undefined):h)},i.integerValue=function(e){var t=new j(this);return null==e?e=x:w(e,0,8),z(t,t.e+1,e)},i.isEqualTo=i.eq=function(e,t){return 0===b(this,new j(e,t))},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(e,t){return b(this,new j(e,t))>0},i.isGreaterThanOrEqualTo=i.gte=function(e,t){return 1===(t=b(this,new j(e,t)))||0===t},i.isInteger=function(){return!!this.c&&g(this.e/d)>this.c.length-2},i.isLessThan=i.lt=function(e,t){return b(this,new j(e,t))<0},i.isLessThanOrEqualTo=i.lte=function(e,t){return-1===(t=b(this,new j(e,t)))||0===t},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&0==this.c[0]},i.minus=function(e,t){var r,n,o,i,a=this,s=a.s;if(t=(e=new j(e,t)).s,!s||!t)return new j(NaN);if(s!=t)return e.s=-t,a.plus(e);var u=a.e/d,c=e.e/d,l=a.c,h=e.c;if(!u||!c){if(!l||!h)return l?(e.s=-t,e):new j(h?a:NaN);if(!l[0]||!h[0])return h[0]?(e.s=-t,e):new j(l[0]?a:3==x?-0:0)}if(u=g(u),c=g(c),l=l.slice(),s=u-c){for((i=s<0)?(s=-s,o=l):(c=u,o=h),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(n=(i=(s=l.length)<(t=h.length))?s:t,s=t=0;t0)for(;t--;l[r++]=0);for(t=f-1;n>s;){if(l[--n]=0;){for(r=0,p=k[o]%w,m=k[o]/w|0,i=o+(a=u);i>o;)r=((c=p*(c=S[--a]%w)+(s=m*c+(l=S[a]/w|0)*p)%w*w+v[i]+r)/b|0)+(s/w|0)+m*l,v[i--]=c%b;v[i]=r}return r?++n:v.splice(0,1),D(e,v,n)},i.negated=function(){var e=new j(this);return e.s=-e.s||null,e},i.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new j(e,t)).s,!o||!t)return new j(NaN);if(o!=t)return e.s=-t,n.minus(e);var i=n.e/d,a=e.e/d,s=n.c,u=e.c;if(!i||!a){if(!s||!u)return new j(o/0);if(!s[0]||!u[0])return u[0]?e:new j(s[0]?n:0*o)}if(i=g(i),a=g(a),s=s.slice(),o=i-a){for(o>0?(a=i,r=u):(o=-o,r=s),r.reverse();o--;r.push(0));r.reverse()}for((o=s.length)-(t=u.length)<0&&(r=u,u=s,s=r,t=o),o=0;t;)o=(s[--t]=s[t]+u[t]+o)/f|0,s[t]=f===s[t]?0:s[t]%f;return o&&(s=[o].concat(s),++a),D(e,s,a)},i.precision=i.sd=function(e,t){var r,n,o,i=this;if(null!=e&&e!==!!e)return w(e,1,m),null==t?t=x:w(t,0,8),z(new j(i),e,t);if(!(r=i.c))return null;if(n=(o=r.length-1)*d+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},i.shiftedBy=function(e){return w(e,-9007199254740991,h),this.times("1e"+e)},i.squareRoot=i.sqrt=function(){var e,t,n,o,i,a=this,s=a.c,u=a.s,c=a.e,l=E+4,f=new j("0.5");if(1!==u||!s||!s[0])return new j(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+q(a)))||u==1/0?(((t=v(s)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=g((c+1)/2)-(c<0||c%2),n=new j(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new j(u+""),n.c[0])for((u=(c=n.e)+l)<3&&(u=0);;)if(i=n,n=f.times(i.plus(r(a,i,l,1))),v(i.c).slice(0,u)===(t=v(n.c)).slice(0,u)){if(n.e0&&y>0){for(i=y%s||s,f=p.substr(0,i);i0&&(f+=l+p.slice(i)),h&&(f="-"+f)}n=d?f+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?d.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):f}return(r.prefix||"")+n+(r.suffix||"")},i.toFraction=function(e){var t,n,o,i,a,s,u,l,f,h,y,m,g=this,b=g.c;if(null!=e&&(!(u=new j(e)).isInteger()&&(u.c||1!==u.s)||u.lt(_)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+q(u));if(!b)return new j(g);for(t=new j(_),f=n=new j(_),o=l=new j(_),m=v(b),a=t.e=m.length-g.e-1,t.c[0]=p[(s=a%d)<0?d+s:s],e=!e||u.comparedTo(t)>0?a>0?t:f:u,s=R,R=1/0,u=new j(m),l.c[0]=0;h=r(u,t,0,1),1!=(i=n.plus(h.times(o))).comparedTo(e);)n=o,o=i,f=l.plus(h.times(i=f)),l=i,t=u.minus(h.times(i=t)),u=i;return i=r(e.minus(n),o,0,1),l=l.plus(i.times(f)),n=n.plus(i.times(o)),l.s=f.s=g.s,y=r(f,o,a*=2,x).minus(g).abs().comparedTo(r(l,n,a,x).minus(g).abs())<1?[f,o]:[l,n],R=s,y},i.toNumber=function(){return+q(this)},i.toPrecision=function(e,t){return null!=e&&w(e,1,m),U(this,e,t,2)},i.toString=function(e){var t,r=this,o=r.s,i=r.e;return null===i?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=i<=T||i>=P?S(v(r.c),i):k(v(r.c),i,"0"):10===e&&L?t=k(v((r=z(new j(r),E+i+1,x)).c),r.e,"0"):(w(e,2,N.length,"Base"),t=n(k(v(r.c),i,"0"),10,e,o,!0)),o<0&&r.c[0]&&(t="-"+t)),t},i.valueOf=i.toJSON=function(){return q(this)},i._isBigNumber=!0,null!=t&&j.set(t),j}(),i.default=i.BigNumber=i,void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}()},6373:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(47790).Buffer}catch(P){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,o){for(var i=0,a=0,s=Math.min(e.length,r),u=t;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(o=0,i=0;o>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)o=u(e,t,n)<=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(n=(e.length-t)%2===0?t+1:t;n=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=t)n++;n--,o=o/t|0;for(var i=e.length-r,a=i%n,s=Math.min(i,i-a)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(P){i.prototype.inspect=f}else i.prototype.inspect=f;function f(){return(this.red?""}var d=["","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"],h=[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];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var o=0,i=0,a=0;a>>24-o&16777215,(o+=2)>=26&&(o-=26,a--),r=0!==i||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var y=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?y+r:d[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function y(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,f=67108863&u,d=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=d;h++){var p=c-h|0;l+=(a=(o=0|e.words[p])*(i=0|t.words[h])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var o=this.byteLength(),i=r||Math.max(1,o);n(o<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,o),a},i.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,o=0,i=0;o>8&255),r>16&255),6===i?(r>24&255),n=0,i=0):(n=a>>>24,i+=2)}if(r=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===i?(r>=0&&(e[r--]=a>>24&255),n=0,i=0):(n=a>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var o=0;o0&&(this.words[o]=~this.words[o]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,o=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.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 r,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,h=0|a[1],p=8191&h,y=h>>>13,m=0|a[2],g=8191&m,v=m>>>13,b=0|a[3],w=8191&b,A=b>>>13,S=0|a[4],k=8191&S,_=S>>>13,E=0|a[5],x=8191&E,T=E>>>13,P=0|a[6],O=8191&P,R=P>>>13,I=0|a[7],C=8191&I,M=I>>>13,B=0|a[8],N=8191&B,L=B>>>13,j=0|a[9],U=8191&j,F=j>>>13,D=0|s[0],z=8191&D,q=D>>>13,H=0|s[1],V=8191&H,K=H>>>13,W=0|s[2],G=8191&W,X=W>>>13,Z=0|s[3],Q=8191&Z,Y=Z>>>13,J=0|s[4],$=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ne=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,de=le>>>13,he=0|s[9],pe=8191&he,ye=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(n=Math.imul(f,z))|0)+((8191&(o=(o=Math.imul(f,q))+Math.imul(d,z)|0))<<13)|0;c=((i=Math.imul(d,q))+(o>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,z),o=(o=Math.imul(p,q))+Math.imul(y,z)|0,i=Math.imul(y,q);var ge=(c+(n=n+Math.imul(f,V)|0)|0)+((8191&(o=(o=o+Math.imul(f,K)|0)+Math.imul(d,V)|0))<<13)|0;c=((i=i+Math.imul(d,K)|0)+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,z),o=(o=Math.imul(g,q))+Math.imul(v,z)|0,i=Math.imul(v,q),n=n+Math.imul(p,V)|0,o=(o=o+Math.imul(p,K)|0)+Math.imul(y,V)|0,i=i+Math.imul(y,K)|0;var ve=(c+(n=n+Math.imul(f,G)|0)|0)+((8191&(o=(o=o+Math.imul(f,X)|0)+Math.imul(d,G)|0))<<13)|0;c=((i=i+Math.imul(d,X)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,z),o=(o=Math.imul(w,q))+Math.imul(A,z)|0,i=Math.imul(A,q),n=n+Math.imul(g,V)|0,o=(o=o+Math.imul(g,K)|0)+Math.imul(v,V)|0,i=i+Math.imul(v,K)|0,n=n+Math.imul(p,G)|0,o=(o=o+Math.imul(p,X)|0)+Math.imul(y,G)|0,i=i+Math.imul(y,X)|0;var be=(c+(n=n+Math.imul(f,Q)|0)|0)+((8191&(o=(o=o+Math.imul(f,Y)|0)+Math.imul(d,Q)|0))<<13)|0;c=((i=i+Math.imul(d,Y)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(k,z),o=(o=Math.imul(k,q))+Math.imul(_,z)|0,i=Math.imul(_,q),n=n+Math.imul(w,V)|0,o=(o=o+Math.imul(w,K)|0)+Math.imul(A,V)|0,i=i+Math.imul(A,K)|0,n=n+Math.imul(g,G)|0,o=(o=o+Math.imul(g,X)|0)+Math.imul(v,G)|0,i=i+Math.imul(v,X)|0,n=n+Math.imul(p,Q)|0,o=(o=o+Math.imul(p,Y)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,Y)|0;var we=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(o=(o=o+Math.imul(f,ee)|0)+Math.imul(d,$)|0))<<13)|0;c=((i=i+Math.imul(d,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,z),o=(o=Math.imul(x,q))+Math.imul(T,z)|0,i=Math.imul(T,q),n=n+Math.imul(k,V)|0,o=(o=o+Math.imul(k,K)|0)+Math.imul(_,V)|0,i=i+Math.imul(_,K)|0,n=n+Math.imul(w,G)|0,o=(o=o+Math.imul(w,X)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,X)|0,n=n+Math.imul(g,Q)|0,o=(o=o+Math.imul(g,Y)|0)+Math.imul(v,Q)|0,i=i+Math.imul(v,Y)|0,n=n+Math.imul(p,$)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,ee)|0;var Ae=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(o=(o=o+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((i=i+Math.imul(d,ne)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(O,z),o=(o=Math.imul(O,q))+Math.imul(R,z)|0,i=Math.imul(R,q),n=n+Math.imul(x,V)|0,o=(o=o+Math.imul(x,K)|0)+Math.imul(T,V)|0,i=i+Math.imul(T,K)|0,n=n+Math.imul(k,G)|0,o=(o=o+Math.imul(k,X)|0)+Math.imul(_,G)|0,i=i+Math.imul(_,X)|0,n=n+Math.imul(w,Q)|0,o=(o=o+Math.imul(w,Y)|0)+Math.imul(A,Q)|0,i=i+Math.imul(A,Y)|0,n=n+Math.imul(g,$)|0,o=(o=o+Math.imul(g,ee)|0)+Math.imul(v,$)|0,i=i+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,o=(o=o+Math.imul(p,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0;var Se=(c+(n=n+Math.imul(f,ie)|0)|0)+((8191&(o=(o=o+Math.imul(f,ae)|0)+Math.imul(d,ie)|0))<<13)|0;c=((i=i+Math.imul(d,ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(C,z),o=(o=Math.imul(C,q))+Math.imul(M,z)|0,i=Math.imul(M,q),n=n+Math.imul(O,V)|0,o=(o=o+Math.imul(O,K)|0)+Math.imul(R,V)|0,i=i+Math.imul(R,K)|0,n=n+Math.imul(x,G)|0,o=(o=o+Math.imul(x,X)|0)+Math.imul(T,G)|0,i=i+Math.imul(T,X)|0,n=n+Math.imul(k,Q)|0,o=(o=o+Math.imul(k,Y)|0)+Math.imul(_,Q)|0,i=i+Math.imul(_,Y)|0,n=n+Math.imul(w,$)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0,n=n+Math.imul(g,re)|0,o=(o=o+Math.imul(g,ne)|0)+Math.imul(v,re)|0,i=i+Math.imul(v,ne)|0,n=n+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,ae)|0;var ke=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(o=(o=o+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((i=i+Math.imul(d,ce)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(N,z),o=(o=Math.imul(N,q))+Math.imul(L,z)|0,i=Math.imul(L,q),n=n+Math.imul(C,V)|0,o=(o=o+Math.imul(C,K)|0)+Math.imul(M,V)|0,i=i+Math.imul(M,K)|0,n=n+Math.imul(O,G)|0,o=(o=o+Math.imul(O,X)|0)+Math.imul(R,G)|0,i=i+Math.imul(R,X)|0,n=n+Math.imul(x,Q)|0,o=(o=o+Math.imul(x,Y)|0)+Math.imul(T,Q)|0,i=i+Math.imul(T,Y)|0,n=n+Math.imul(k,$)|0,o=(o=o+Math.imul(k,ee)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,ee)|0,n=n+Math.imul(w,re)|0,o=(o=o+Math.imul(w,ne)|0)+Math.imul(A,re)|0,i=i+Math.imul(A,ne)|0,n=n+Math.imul(g,ie)|0,o=(o=o+Math.imul(g,ae)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,ae)|0,n=n+Math.imul(p,ue)|0,o=(o=o+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,i=i+Math.imul(y,ce)|0;var _e=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(o=(o=o+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((i=i+Math.imul(d,de)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(U,z),o=(o=Math.imul(U,q))+Math.imul(F,z)|0,i=Math.imul(F,q),n=n+Math.imul(N,V)|0,o=(o=o+Math.imul(N,K)|0)+Math.imul(L,V)|0,i=i+Math.imul(L,K)|0,n=n+Math.imul(C,G)|0,o=(o=o+Math.imul(C,X)|0)+Math.imul(M,G)|0,i=i+Math.imul(M,X)|0,n=n+Math.imul(O,Q)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,Y)|0,n=n+Math.imul(x,$)|0,o=(o=o+Math.imul(x,ee)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,ee)|0,n=n+Math.imul(k,re)|0,o=(o=o+Math.imul(k,ne)|0)+Math.imul(_,re)|0,i=i+Math.imul(_,ne)|0,n=n+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0,n=n+Math.imul(g,ue)|0,o=(o=o+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,i=i+Math.imul(v,ce)|0,n=n+Math.imul(p,fe)|0,o=(o=o+Math.imul(p,de)|0)+Math.imul(y,fe)|0,i=i+Math.imul(y,de)|0;var Ee=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(o=(o=o+Math.imul(f,ye)|0)+Math.imul(d,pe)|0))<<13)|0;c=((i=i+Math.imul(d,ye)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,V),o=(o=Math.imul(U,K))+Math.imul(F,V)|0,i=Math.imul(F,K),n=n+Math.imul(N,G)|0,o=(o=o+Math.imul(N,X)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,X)|0,n=n+Math.imul(C,Q)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(M,Q)|0,i=i+Math.imul(M,Y)|0,n=n+Math.imul(O,$)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(x,re)|0,o=(o=o+Math.imul(x,ne)|0)+Math.imul(T,re)|0,i=i+Math.imul(T,ne)|0,n=n+Math.imul(k,ie)|0,o=(o=o+Math.imul(k,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,n=n+Math.imul(w,ue)|0,o=(o=o+Math.imul(w,ce)|0)+Math.imul(A,ue)|0,i=i+Math.imul(A,ce)|0,n=n+Math.imul(g,fe)|0,o=(o=o+Math.imul(g,de)|0)+Math.imul(v,fe)|0,i=i+Math.imul(v,de)|0;var xe=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((i=i+Math.imul(y,ye)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(U,G),o=(o=Math.imul(U,X))+Math.imul(F,G)|0,i=Math.imul(F,X),n=n+Math.imul(N,Q)|0,o=(o=o+Math.imul(N,Y)|0)+Math.imul(L,Q)|0,i=i+Math.imul(L,Y)|0,n=n+Math.imul(C,$)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(M,$)|0,i=i+Math.imul(M,ee)|0,n=n+Math.imul(O,re)|0,o=(o=o+Math.imul(O,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(x,ie)|0,o=(o=o+Math.imul(x,ae)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,ae)|0,n=n+Math.imul(k,ue)|0,o=(o=o+Math.imul(k,ce)|0)+Math.imul(_,ue)|0,i=i+Math.imul(_,ce)|0,n=n+Math.imul(w,fe)|0,o=(o=o+Math.imul(w,de)|0)+Math.imul(A,fe)|0,i=i+Math.imul(A,de)|0;var Te=(c+(n=n+Math.imul(g,pe)|0)|0)+((8191&(o=(o=o+Math.imul(g,ye)|0)+Math.imul(v,pe)|0))<<13)|0;c=((i=i+Math.imul(v,ye)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,Q),o=(o=Math.imul(U,Y))+Math.imul(F,Q)|0,i=Math.imul(F,Y),n=n+Math.imul(N,$)|0,o=(o=o+Math.imul(N,ee)|0)+Math.imul(L,$)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(C,re)|0,o=(o=o+Math.imul(C,ne)|0)+Math.imul(M,re)|0,i=i+Math.imul(M,ne)|0,n=n+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,ae)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,ae)|0,n=n+Math.imul(x,ue)|0,o=(o=o+Math.imul(x,ce)|0)+Math.imul(T,ue)|0,i=i+Math.imul(T,ce)|0,n=n+Math.imul(k,fe)|0,o=(o=o+Math.imul(k,de)|0)+Math.imul(_,fe)|0,i=i+Math.imul(_,de)|0;var Pe=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,ye)|0)+Math.imul(A,pe)|0))<<13)|0;c=((i=i+Math.imul(A,ye)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,$),o=(o=Math.imul(U,ee))+Math.imul(F,$)|0,i=Math.imul(F,ee),n=n+Math.imul(N,re)|0,o=(o=o+Math.imul(N,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,ae)|0)+Math.imul(M,ie)|0,i=i+Math.imul(M,ae)|0,n=n+Math.imul(O,ue)|0,o=(o=o+Math.imul(O,ce)|0)+Math.imul(R,ue)|0,i=i+Math.imul(R,ce)|0,n=n+Math.imul(x,fe)|0,o=(o=o+Math.imul(x,de)|0)+Math.imul(T,fe)|0,i=i+Math.imul(T,de)|0;var Oe=(c+(n=n+Math.imul(k,pe)|0)|0)+((8191&(o=(o=o+Math.imul(k,ye)|0)+Math.imul(_,pe)|0))<<13)|0;c=((i=i+Math.imul(_,ye)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,re),o=(o=Math.imul(U,ne))+Math.imul(F,re)|0,i=Math.imul(F,ne),n=n+Math.imul(N,ie)|0,o=(o=o+Math.imul(N,ae)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,ae)|0,n=n+Math.imul(C,ue)|0,o=(o=o+Math.imul(C,ce)|0)+Math.imul(M,ue)|0,i=i+Math.imul(M,ce)|0,n=n+Math.imul(O,fe)|0,o=(o=o+Math.imul(O,de)|0)+Math.imul(R,fe)|0,i=i+Math.imul(R,de)|0;var Re=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(o=(o=o+Math.imul(x,ye)|0)+Math.imul(T,pe)|0))<<13)|0;c=((i=i+Math.imul(T,ye)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,ie),o=(o=Math.imul(U,ae))+Math.imul(F,ie)|0,i=Math.imul(F,ae),n=n+Math.imul(N,ue)|0,o=(o=o+Math.imul(N,ce)|0)+Math.imul(L,ue)|0,i=i+Math.imul(L,ce)|0,n=n+Math.imul(C,fe)|0,o=(o=o+Math.imul(C,de)|0)+Math.imul(M,fe)|0,i=i+Math.imul(M,de)|0;var Ie=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(o=(o=o+Math.imul(O,ye)|0)+Math.imul(R,pe)|0))<<13)|0;c=((i=i+Math.imul(R,ye)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,ue),o=(o=Math.imul(U,ce))+Math.imul(F,ue)|0,i=Math.imul(F,ce),n=n+Math.imul(N,fe)|0,o=(o=o+Math.imul(N,de)|0)+Math.imul(L,fe)|0,i=i+Math.imul(L,de)|0;var Ce=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,ye)|0)+Math.imul(M,pe)|0))<<13)|0;c=((i=i+Math.imul(M,ye)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(U,fe),o=(o=Math.imul(U,de))+Math.imul(F,fe)|0,i=Math.imul(F,de);var Me=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(o=(o=o+Math.imul(N,ye)|0)+Math.imul(L,pe)|0))<<13)|0;c=((i=i+Math.imul(L,ye)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863;var Be=(c+(n=Math.imul(U,pe))|0)+((8191&(o=(o=Math.imul(U,ye))+Math.imul(F,pe)|0))<<13)|0;return c=((i=Math.imul(F,ye))+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Ae,u[6]=Se,u[7]=ke,u[8]=_e,u[9]=Ee,u[10]=xe,u[11]=Te,u[12]=Pe,u[13]=Oe,u[14]=Re,u[15]=Ie,u[16]=Ce,u[17]=Me,u[18]=Be,0!==c&&(u[19]=c,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}r.words[i]=s,n=a,a=o}return 0!==n?r.words[i]=n:r.length--,r._strip()}function v(e,t,r){return g(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=y),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?y(this,e,t):r<1024?g(this,e,t):v(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,r,n,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,r+=i/67108864|0,r+=a>>>26,this.words[o]=67108863&a}return 0!==r&&(this.words[o]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>o&1}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,r=e%26,o=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=o);c--){var f=0|this.words[c];this.words[c]=l<<26-i|f>>>i,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,o=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var o=67108863^67108863>>>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},i.prototype.isubn=function(e){if(n("number"===typeof e),n(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>26)-(u/67108864|0),this.words[o+r]=67108863&i}for(;o>26,this.words[o+r]=67108863&i;if(0===s)return this._strip();for(n(-1===s),s=0,o=0;o>26,this.words[o]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,u=n.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var d=67108864*(0|n.words[o.length+f])+(0|n.words[o.length+f-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(o,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(o,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=d)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),o=e.andln(1),i=r.cmp(n);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,o=0,i=this.length-1;i>=0;i--)o=(r*o+(0|this.words[i]))%e;return t?-o:o},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,o=this.length-1;o>=0;o--){var i=(0|this.words[o])+67108864*r;this.words[o]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0===(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(f)),o.iushrn(1),a.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.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;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0===(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var o=t.cmp(r);if(o<0){var i=t;t=r,r=i}else if(0===o||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,o=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;r--){var n=0|this.words[r],o=0|e.words[r];if(n!==o){no&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new x(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(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 i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){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 E(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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 i(null);return e.words=new Array(Math.ceil(this.n/13)),e},A.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},A.prototype.split=function(e,t){e.iushrn(this.n,0,t)},A.prototype.imulK=function(e){return e.imul(this.k)},o(S,A),S.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),o=0;o>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},S.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=o,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new S;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 E}return w[e]=t,t},x.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,o),d=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var y=h,m=0;0!==y.cmp(s);m++)y=y.redSqr();n(m=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var f=c>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===n&&0===l)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}u=26}return o},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new T(e)},o(T,x),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},96060:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeUnchecked=t.deserialize=t.serialize=t.BinaryReader=t.BinaryWriter=t.BorshError=t.baseDecode=t.baseEncode=void 0;const u=s(r(6373)),c=s(r(40462)),l=a(r(38068)),f=new("function"!==typeof TextDecoder?l.TextDecoder:TextDecoder)("utf-8",{fatal:!0});t.baseEncode=function(e){return"string"===typeof e&&(e=Buffer.from(e,"utf8")),c.default.encode(Buffer.from(e))},t.baseDecode=function(e){return Buffer.from(c.default.decode(e))};const d=1024;class h extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}t.BorshError=h;class p{constructor(){this.buf=Buffer.alloc(d),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(d)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(Buffer.from(new u.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(Buffer.from(new u.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(Buffer.from(new u.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(Buffer.from(new u.default(e).toArray("le",64)))}writeBuffer(e){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),e,Buffer.alloc(d)]),this.length+=e.length}writeString(e){this.maybeResize();const t=Buffer.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(Buffer.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(const r of e)this.maybeResize(),t(r)}toArray(){return this.buf.subarray(0,this.length)}}function y(e,t,r){const n=r.value;r.value=function(){try{for(var e=arguments.length,t=new Array(e),r=0;r=0)throw new h("Reached the end of buffer when deserializing")}throw o}}}t.BinaryWriter=p;class m{constructor(e){this.buf=e,this.offset=0}readU8(){const e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){const e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){const e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){const e=this.readBuffer(8);return new u.default(e,"le")}readU128(){const e=this.readBuffer(16);return new u.default(e,"le")}readU256(){const e=this.readBuffer(32);return new u.default(e,"le")}readU512(){const e=this.readBuffer(64);return new u.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new h("Expected buffer length ".concat(e," isn't within bounds"));const t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){const e=this.readU32(),t=this.readBuffer(e);try{return f.decode(t)}catch(r){throw new h("Error decoding UTF-8 string: ".concat(r))}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){const t=this.readU32(),r=Array();for(let n=0;n{v(e,t,r,n[0],o)}));else if(void 0!==n.kind)switch(n.kind){case"option":null===r||void 0===r?o.writeU8(0):(o.writeU8(1),v(e,t,r,n.type,o));break;case"map":o.writeU32(r.size),r.forEach(((r,i)=>{v(e,t,i,n.key,o),v(e,t,r,n.value,o)}));break;default:throw new h("FieldType ".concat(n," unrecognized"))}else b(e,r,o)}catch(i){throw i instanceof h&&i.addToFieldPath(t),i}}function b(e,t,r){if("function"===typeof t.borshSerialize)return void t.borshSerialize(r);const n=e.get(t.constructor);if(!n)throw new h("Class ".concat(t.constructor.name," is missing in schema"));if("struct"===n.kind)n.fields.map((n=>{let[o,i]=n;v(e,o,t[o],i,r)}));else{if("enum"!==n.kind)throw new h("Unexpected schema kind: ".concat(n.kind," for ").concat(t.constructor.name));{const o=t[n.field];for(let i=0;iw(e,t,r[0],n)))}if("option"===r.kind){return n.readU8()?w(e,t,r.type,n):void 0}if("map"===r.kind){let o=new Map;const i=n.readU32();for(let a=0;a=n.values.length)throw new h("Enum index: ".concat(o," is out of range"));const[i,a]=n.values[o],s=w(e,i,a,r);return new t({[i]:s})}throw new h("Unexpected schema kind: ".concat(n.kind," for ").concat(t.constructor.name))}i([y],m.prototype,"readU8",null),i([y],m.prototype,"readU16",null),i([y],m.prototype,"readU32",null),i([y],m.prototype,"readU64",null),i([y],m.prototype,"readU128",null),i([y],m.prototype,"readU256",null),i([y],m.prototype,"readU512",null),i([y],m.prototype,"readString",null),i([y],m.prototype,"readFixedArray",null),i([y],m.prototype,"readArray",null),t.BinaryReader=m,t.serialize=function(e,t){const r=new(arguments.length>2&&void 0!==arguments[2]?arguments[2]:p);return b(e,t,r),r.toArray()},t.deserialize=function(e,t,r){const n=new(arguments.length>3&&void 0!==arguments[3]?arguments[3]:m)(r),o=A(e,t,n);if(n.offset3&&void 0!==arguments[3]?arguments[3]:m)(r))}},88462:(e,t,r)=>{var n;function o(e){this.rand=e}if(e.exports=function(e){return n||(n=new o(null)),n.generate(e)},e.exports.Rand=o,o.prototype.generate=function(e){return this._rand(e)},o.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r{var n=r(66281);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},23465:(e,t)=>{"use strict";class r{constructor(e,t){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=t}makeDestinationObject(){return{}}decode(e,t){throw new Error("Layout is abstract")}encode(e,t,r){throw new Error("Layout is abstract")}getSpan(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}}function n(e,t){return t.property?e+"["+t.property+"]":e}t.Layout=r,t.nameWithProperty=n,t.bindConstructorLayout=function(e,t){if("function"!==typeof e)throw new TypeError("Class must be constructor");if(e.hasOwnProperty("layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof r))throw new TypeError("layout must be a Layout");if(t.hasOwnProperty("boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=()=>new e,Object.defineProperty(e.prototype,"encode",{value:function(e,r){return t.encode(this,e,r)},writable:!0}),Object.defineProperty(e,"decode",{value:function(e,r){return t.decode(e,r)},writable:!0})};class o extends r{isCount(){throw new Error("ExternalLayout is abstract")}}class i extends o{constructor(e,t){if(void 0===e&&(e=1),!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,t),this.elementSpan=e}isCount(){return!0}decode(e,t){void 0===t&&(t=0);const r=e.length-t;return Math.floor(r/this.elementSpan)}encode(e,t,r){return 0}}class a extends o{constructor(e,t,n){if(!(e instanceof r))throw new TypeError("layout must be a Layout");if(void 0===t)t=0;else if(!Number.isInteger(t))throw new TypeError("offset must be integer or undefined");super(e.span,n||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof s||this.layout instanceof u}decode(e,t){return void 0===t&&(t=0),this.layout.decode(e,t+this.offset)}encode(e,t,r){return void 0===r&&(r=0),this.layout.encode(e,t,r+this.offset)}}class s extends r{constructor(e,t){if(super(e,t),6e+n.encode(o,t,r+e)),0);return this.count instanceof o&&this.count.encode(e.length,t,r),i}}class k extends r{constructor(e,t,n){if(!Array.isArray(e)||!e.reduce(((e,t)=>e&&t instanceof r),!0))throw new TypeError("fields must be array of Layout instances");"boolean"===typeof t&&void 0===n&&(n=t,t=void 0);for(const r of e)if(0>r.span&&void 0===r.property)throw new Error("fields cannot contain unnamed variable-length layout");let o=-1;try{o=e.reduce(((e,t)=>e+t.getSpan()),0)}catch(i){}super(o,t),this.fields=e,this.decodePrefixes=!!n}getSpan(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);let r=0;try{r=this.fields.reduce(((r,n)=>{const o=n.getSpan(e,t);return t+=o,r+o}),0)}catch(n){throw new RangeError("indeterminate span")}return r}decode(e,t){void 0===t&&(t=0);const r=this.makeDestinationObject();for(const n of this.fields)if(void 0!==n.property&&(r[n.property]=n.decode(e,t)),t+=n.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t,r){void 0===r&&(r=0);const n=r;let o=0,i=0;for(const a of this.fields){let n=a.span;if(i=0n&&(n=a.getSpan(t,r)))}o=r,r+=n}return o+i-n}fromArray(e){const t=this.makeDestinationObject();for(const r of this.fields)void 0!==r.property&&0r.span?t=-1:0<=t&&(t+=r.span)}}}class _{constructor(e){this.property=e}decode(){throw new Error("UnionDiscriminator is abstract")}encode(){throw new Error("UnionDiscriminator is abstract")}}class E extends _{constructor(e,t){if(!(e instanceof o&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(t||e.property||"variant"),this.layout=e}decode(e,t){return this.layout.decode(e,t)}encode(e,t,r){return this.layout.encode(e,t,r)}}class x extends r{constructor(e,t,n){const i=e instanceof s||e instanceof u;if(i)e=new E(new a(e));else if(e instanceof o&&e.isCount())e=new E(e);else if(!(e instanceof _))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(void 0===t&&(t=null),!(null===t||t instanceof r))throw new TypeError("defaultLayout must be null or a Layout");if(null!==t){if(0>t.span)throw new Error("defaultLayout must have constant span");void 0===t.property&&(t=t.replicate("content"))}let c=-1;t&&(c=t.span,0<=c&&i&&(c+=e.layout.span)),super(c,n),this.discriminator=e,this.usesPrefixDiscriminator=i,this.defaultLayout=t,this.registry={};let l=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(e){return l(e)},this.configGetSourceVariant=function(e){l=e.bind(this)}}getSpan(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);const r=this.getVariant(e,t);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(e,t)}defaultGetSourceVariant(e){if(e.hasOwnProperty(this.discriminator.property)){if(this.defaultLayout&&e.hasOwnProperty(this.defaultLayout.property))return;const t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||e.hasOwnProperty(t.property)))return t}else for(const t in this.registry){const r=this.registry[t];if(e.hasOwnProperty(r.property))return r}throw new Error("unable to infer src variant")}decode(e,t){let r;void 0===t&&(t=0);const n=this.discriminator,o=n.decode(e,t);let i=this.registry[o];if(void 0===i){let a=0;i=this.defaultLayout,this.usesPrefixDiscriminator&&(a=n.layout.span),r=this.makeDestinationObject(),r[n.property]=o,r[i.property]=this.defaultLayout.decode(e,t+a)}else r=i.decode(e,t);return r}encode(e,t,r){void 0===r&&(r=0);const n=this.getSourceVariant(e);if(void 0===n){const n=this.discriminator,o=this.defaultLayout;let i=0;return this.usesPrefixDiscriminator&&(i=n.layout.span),n.encode(e[n.property],t,r),i+o.encode(e[o.property],t,r+i)}return n.encode(e,t,r)}addVariant(e,t,r){const n=new T(this,e,t,r);return this.registry[e]=n,n}getVariant(e,t){let r=e;return Buffer.isBuffer(e)&&(void 0===t&&(t=0),r=this.discriminator.decode(e,t)),this.registry[r]}}class T extends r{constructor(e,t,n,o){if(!(e instanceof x))throw new TypeError("union must be a Union");if(!Number.isInteger(t)||0>t)throw new TypeError("variant must be a (non-negative) integer");if("string"===typeof n&&void 0===o&&(o=n,n=null),n){if(!(n instanceof r))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=n.span&&n.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!==typeof o)throw new TypeError("variant must have a String property")}let i=e.span;0>e.span&&(i=n?n.span:0,0<=i&&e.usesPrefixDiscriminator&&(i+=e.discriminator.layout.span)),super(i,o),this.union=e,this.variant=t,this.layout=n||null}getSpan(e,t){if(0<=this.span)return this.span;void 0===t&&(t=0);let r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),r+this.layout.getSpan(e,t+r)}decode(e,t){const r=this.makeDestinationObject();if(void 0===t&&(t=0),this!==this.union.getVariant(e,t))throw new Error("variant mismatch");let n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,t+n):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,t,r){void 0===r&&(r=0);let n=0;if(this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout&&!e.hasOwnProperty(this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,r);let o=n;if(this.layout&&(this.layout.encode(e[this.property],t,r+n),o+=this.layout.getSpan(t,r+n),0<=this.union.span&&o>this.union.span))throw new Error("encoded variant overruns containing union");return o}fromArray(e){if(this.layout)return this.layout.fromArray(e)}}function P(e){return 0>e&&(e+=4294967296),e}class O extends r{constructor(e,t,r){if(!(e instanceof s||e instanceof u))throw new TypeError("word must be a UInt or UIntBE layout");if("string"===typeof t&&void 0===r&&(r=t,t=void 0),4=t)throw new TypeError("bits must be positive integer");const n=8*e.span,o=e.fields.reduce(((e,t)=>e+t.bits),0);if(t+o>n)throw new Error("bits too long for span remainder ("+(n-o)+" of "+n+" remain)");this.container=e,this.bits=t,this.valueMask=(1<>>this.start}encode(e){if(!Number.isInteger(e)||e!==P(e&this.valueMask))throw new TypeError(n("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const t=this.container._packedGetValue(),r=P(e<r&&(r=this.length.decode(e,t)),r}decode(e,t){void 0===t&&(t=0);let r=this.span;return 0>r&&(r=this.length.decode(e,t)),e.slice(t,t+r)}encode(e,t,r){let i=this.length;if(this.length instanceof o&&(i=e.length),!Buffer.isBuffer(e)||i!==e.length)throw new TypeError(n("Blob.encode",this)+" requires (length "+i+") Buffer as src");if(r+i>t.length)throw new RangeError("encoding overruns Buffer");return t.write(e.toString("hex"),r,i,"hex"),this.length instanceof o&&this.length.encode(i,t,r),i}}class M extends r{constructor(e){super(-1,e)}getSpan(e,t){if(!Buffer.isBuffer(e))throw new TypeError("b must be a Buffer");void 0===t&&(t=0);let r=t;for(;rt.length)throw new RangeError("encoding overruns Buffer");return n.copy(t,r),t[r+o]=0,o+1}}class B extends r{constructor(e,t){if("string"===typeof e&&void 0===t&&(t=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");super(-1,t),this.maxSpan=e}getSpan(e,t){if(!Buffer.isBuffer(e))throw new TypeError("b must be a Buffer");return void 0===t&&(t=0),e.length-t}decode(e,t,r){void 0===t&&(t=0);let n=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpant.length)throw new RangeError("encoding overruns Buffer");return n.copy(t,r),o}}class N extends r{constructor(e,t){super(0,t),this.value=e}decode(e,t,r){return this.value}encode(e,t,r){return 0}}t.ExternalLayout=o,t.GreedyCount=i,t.OffsetLayout=a,t.UInt=s,t.UIntBE=u,t.Int=c,t.IntBE=l,t.Float=v,t.FloatBE=b,t.Double=w,t.DoubleBE=A,t.Sequence=S,t.Structure=k,t.UnionDiscriminator=_,t.UnionLayoutDiscriminator=E,t.Union=x,t.VariantLayout=T,t.BitStructure=O,t.BitField=R,t.Boolean=I,t.Blob=C,t.CString=M,t.UTF8=B,t.Constant=N,t.greedy=(e,t)=>new i(e,t),t.offset=(e,t,r)=>new a(e,t,r),t.u8=e=>new s(1,e),t.u16=e=>new s(2,e),t.u24=e=>new s(3,e),t.u32=e=>new s(4,e),t.u40=e=>new s(5,e),t.u48=e=>new s(6,e),t.nu64=e=>new p(e),t.u16be=e=>new u(2,e),t.u24be=e=>new u(3,e),t.u32be=e=>new u(4,e),t.u40be=e=>new u(5,e),t.u48be=e=>new u(6,e),t.nu64be=e=>new y(e),t.s8=e=>new c(1,e),t.s16=e=>new c(2,e),t.s24=e=>new c(3,e),t.s32=e=>new c(4,e),t.s40=e=>new c(5,e),t.s48=e=>new c(6,e),t.ns64=e=>new m(e),t.s16be=e=>new l(2,e),t.s24be=e=>new l(3,e),t.s32be=e=>new l(4,e),t.s40be=e=>new l(5,e),t.s48be=e=>new l(6,e),t.ns64be=e=>new g(e),t.f32=e=>new v(e),t.f32be=e=>new b(e),t.f64=e=>new w(e),t.f64be=e=>new A(e),t.struct=(e,t,r)=>new k(e,t,r),t.bits=(e,t,r)=>new O(e,t,r),t.seq=(e,t,r)=>new S(e,t,r),t.union=(e,t,r)=>new x(e,t,r),t.unionLayoutDiscriminator=(e,t)=>new E(e,t),t.blob=(e,t)=>new C(e,t),t.cstr=e=>new M(e),t.utf8=(e,t)=>new B(e,t),t.const=(e,t)=>new N(e,t)},26382:(e,t,r)=>{"use strict";const n=r(34445),o=r(6900),i="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"===typeof e)return function(e,t){"string"===typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=s(r);const o=n.write(e,t);o!==r&&(n=n.slice(0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const o=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!==typeof e.length||Q(e.length)?s(0):d(e);if("Buffer"===e.type&&Array.isArray(e.data))return d(e.data)}(e);if(o)return o;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),s(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=s(t);for(let n=0;n=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(o)return n?-1:W(e).length;t=(""+t).toLowerCase(),o=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,o){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"===typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,o);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,o){let i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;is&&(r=s-u),i=r;i>=0;i--){let r=!0;for(let n=0;no&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128===(192&r)&&(u=(31&t)<<6|63&r,u>127&&(i=u));break;case 3:r=e[o+1],n=e[o+2],128===(192&r)&&128===(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128===(192&r)&&128===(192&n)&&128===(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),c=this.slice(n,o),l=e.slice(t,r);for(let u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function P(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;on)&&(r=n);let o="";for(let i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,r,n,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function B(e,t,r,n,o){q(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function N(e,t,r,n,o){q(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function L(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,n,i){return t=+t,r>>>=0,i||L(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||L(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=J((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i=o&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=J((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||C(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){M(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=1,i=0;for(this[t]=255&e;++i>>=0,r>>>=0,!n){M(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=J((function(e){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=J((function(e){return N(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o>>=0,!n){const n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=J((function(e){return B(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=J((function(e){return N(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(o=t;o=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function q(e,t,r,n,o,i){if(e>r||e3?0===t||t===BigInt(0)?">= 0".concat(n," and < 2").concat(n," ** ").concat(8*(i+1)).concat(n):">= -(2".concat(n," ** ").concat(8*(i+1)-1).concat(n,") and < 2 ** ")+"".concat(8*(i+1)-1).concat(n):">= ".concat(t).concat(n," and <= ").concat(r).concat(n),new F.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,o,i)}function H(e,t){if("number"!==typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(typeof t)}),TypeError),D("ERR_OUT_OF_RANGE",(function(e,t,r){let n='The value of "'.concat(e,'" is out of range.'),o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=z(String(r)):"bigint"===typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=z(o)),o+="n"),n+=" It must be ".concat(t,". Received ").concat(o),n}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function W(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function X(e,t,r,n){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!==e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function J(e){return"undefined"===typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},58567:e=>{e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},12028:(e,t,r)=>{"use strict";var n=r(60002),o=r(61712),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"===typeof r&&i(e,".prototype.")>-1?o(r):r}},61712:(e,t,r)=>{"use strict";var n=r(63864),o=r(60002),i=r(75438),a=r(54902),s=o("%Function.prototype.apply%"),u=o("%Function.prototype.call%"),c=o("%Reflect.apply%",!0)||n.call(u,s),l=r(82090),f=o("%Math.max%");e.exports=function(e){if("function"!==typeof e)throw new a("a function is required");var t=c(n,u,arguments);return i(t,1+f(0,e.length-(arguments.length-1)),!0)};var d=function(){return c(n,s,arguments)};l?l(e.exports,"apply",{value:d}):e.exports.apply=d},6239:(e,t,r)=>{var n=r(59966).Buffer,o=r(61781).Transform,i=r(78694).I;function a(e){o.call(this),this.hashMode="string"===typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(56329)(a,o),a.prototype.update=function(e,t,r){"string"===typeof e&&(e=n.from(e,t));var o=this._update(e);return this.hashMode?this:(r&&(o=this._toString(o,r)),o)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(o){n=o}finally{r(n)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(r){t=r}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new i(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=a},36059:(e,t,r)=>{"use strict";var n=r(56329),o=r(41237),i=r(92108),a=r(20307),s=r(6239);function u(e){s.call(this,"digest"),this._hash=e}n(u,s),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new o:"rmd160"===e||"ripemd160"===e?new i:new u(a(e))}},74992:(e,t,r)=>{"use strict";var n=r(82090),o=r(62557),i=r(54902),a=r(95558);e.exports=function(e,t,r){if(!e||"object"!==typeof e&&"function"!==typeof e)throw new i("`obj` must be an object or a function`");if("string"!==typeof t&&"symbol"!==typeof t)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!==typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!==typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!==typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!==typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!a&&a(e,t);if(n)n(e,t,{configurable:null===c&&f?f.configurable:!c,enumerable:null===s&&f?f.enumerable:!s,value:r,writable:null===u&&f?f.writable:!u});else{if(!l&&(s||u||c))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},11779:(e,t,r)=>{"use strict";var n=r(2678),o="function"===typeof Symbol&&"symbol"===typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=r(74992),u=r(12101)(),c=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!==typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;u?s(e,t,r,!0):s(e,t,r)},l=function(e,t){var r=arguments.length>2?arguments[2]:{},i=n(t);o&&(i=a.call(i,Object.getOwnPropertySymbols(t)));for(var s=0;s{"use strict";var n=t;n.version=r(1636).rE,n.utils=r(86864),n.rand=r(88462),n.curve=r(87849),n.curves=r(36697),n.ec=r(77794),n.eddsa=r(24661)},66588:(e,t,r)=>{"use strict";var n=r(52835),o=r(86864),i=o.getNAF,a=o.getJSF,s=o.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}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 r=e._getDoubles(),n=i(t,1,this._bitLength),o=(1<=a;l--)u=(u<<1)+n[l];c.push(u)}for(var f=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=o;h>0;h--){for(a=0;a=0;c--){for(var l=0;c>=0&&0===a[c];c--)l++;if(c>=0&&l++,u=u.dblp(l),c<0)break;var f=a[c];s(0!==f),u="affine"===e.type?f>0?u.mixedAdd(o[f-1>>1]):u.mixedAdd(o[-f-1>>1].neg()):f>0?u.add(o[f-1>>1]):u.add(o[-f-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,o){var s,u,c,l=this._wnafT1,f=this._wnafT2,d=this._wnafT3,h=0;for(s=0;s=1;s-=2){var y=s-1,m=s;if(1===l[y]&&1===l[m]){var g=[t[y],null,null,t[m]];0===t[y].y.cmp(t[m].y)?(g[1]=t[y].add(t[m]),g[2]=t[y].toJ().mixedAdd(t[m].neg())):0===t[y].y.cmp(t[m].y.redNeg())?(g[1]=t[y].toJ().mixedAdd(t[m]),g[2]=t[y].add(t[m].neg())):(g[1]=t[y].toJ().mixedAdd(t[m]),g[2]=t[y].toJ().mixedAdd(t[m].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=a(r[y],r[m]);for(h=Math.max(b[0].length,h),d[y]=new Array(h),d[m]=new Array(h),u=0;u=0;s--){for(var _=0;s>=0;){var E=!0;for(u=0;u=0&&_++,S=S.dblp(_),s<0)break;for(u=0;u0?c=f[u][x-1>>1]:x<0&&(c=f[u][-x-1>>1].neg()),S="affine"===c.type?S.mixedAdd(c):S.add(c))}}for(s=0;s=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 r=[this],n=this,o=0;o{"use strict";var n=r(86864),o=r(52835),i=r(56329),a=r(66588),s=n.assert;function u(e){this.twisted=1!==(0|e.a),this.mOneA=this.twisted&&-1===(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new o(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(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,r,n,i){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(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 o(t,16),this.y=new o(r,16),this.z=n?new o(n,16):this.curve.one,this.t=i&&new o(i,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()))))}i(u,a),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,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(i.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).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 o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).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(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),o=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(o)},i(c,a.BasePoint),u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"":""},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(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),o=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),i=n.redAdd(t),a=i.redSub(r),s=n.redSub(t),u=o.redMul(a),c=i.redMul(s),l=o.redMul(s),f=a.redMul(i);return this.curve.point(u,c,f,l)},c.prototype._projDbl=function(){var e,t,r,n,o,i,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(s)).redAdd(u);this.zOne?(e=a.redSub(s).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(o=this.z.redSqr(),i=c.redSub(o).redISub(o),e=a.redSub(s).redISub(u).redMul(i),t=c.redMul(n.redSub(u)),r=c.redMul(i))}else n=s.redAdd(u),o=this.curve._mulC(this.z).redSqr(),i=n.redSub(o).redSub(o),e=this.curve._mulC(a.redISub(n)).redMul(i),t=this.curve._mulC(n).redMul(s.redISub(u)),r=n.redMul(i);return this.curve.point(e,t,r)},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)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),o=this.z.redMul(e.z.redAdd(e.z)),i=r.redSub(t),a=o.redSub(n),s=o.redAdd(n),u=r.redAdd(t),c=i.redMul(a),l=s.redMul(u),f=i.redMul(u),d=a.redMul(s);return this.curve.point(c,l,d,f)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),o=n.redSqr(),i=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(i).redMul(a),u=o.redSub(s),c=o.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(a),f=n.redMul(u).redMul(l);return this.curve.twisted?(t=n.redMul(c).redMul(a.redSub(this.curve._mulA(i))),r=u.redMul(c)):(t=n.redMul(c).redMul(a.redSub(i)),r=this.curve._mulC(u).redMul(c)),this.curve.point(f,t,r)},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,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],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 r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},87849:(e,t,r)=>{"use strict";var n=t;n.base=r(66588),n.short=r(68475),n.mont=r(67043),n.edwards=r(45697)},67043:(e,t,r)=>{"use strict";var n=r(52835),o=r(56329),i=r(66588),a=r(86864);function s(e){i.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){i.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(s,i),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},o(u,i.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.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()?"":""},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(),r=e.redSub(t),n=e.redMul(t),o=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,o)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),o=e.x.redAdd(e.z),i=e.x.redSub(e.z).redMul(r),a=o.redMul(n),s=t.z.redMul(i.redAdd(a).redSqr()),u=t.x.redMul(i.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),o=[];0!==t.cmpn(0);t.iushrn(1))o.push(t.andln(1));for(var i=o.length-1;i>=0;i--)0===o[i]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},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()}},68475:(e,t,r)=>{"use strict";var n=r(86864),o=r(52835),i=r(56329),a=r(66588),s=n.assert;function u(e){a.call(this,"short",e),this.a=new o(e.a,16).toRed(this.red),this.b=new o(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,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new o(t,16),this.y=new o(r,16),n&&(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,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o(0)):(this.x=new o(t,16),this.y=new o(r,16),this.z=new o(n,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}i(u,a),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new o(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new o(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new o(e.a,16),b:new o(e.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:o.mont(e),r=new o(2).toRed(t).redInvm(),n=r.redNeg(),i=new o(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,i,a,s,u,c,l,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new o(1),y=new o(0),m=new o(0),g=new o(1),v=0;0!==d.cmpn(0);){var b=h.div(d);c=h.sub(b.mul(d)),l=m.sub(b.mul(p));var w=g.sub(b.mul(y));if(!n&&c.cmp(f)<0)t=u.neg(),r=p,n=c.neg(),i=l;else if(n&&2===++v)break;u=c,h=d,d=c,m=p,p=l,g=y,y=w}a=c.neg(),s=l;var A=n.sqr().add(i.sqr());return a.sqr().add(s.sqr()).cmp(A)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:i},{a:a,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],o=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),a=o.mul(r.a),s=i.mul(n.a),u=o.mul(r.b),c=i.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(o).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,o=this._endoWnafT2,i=0;i":""},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 r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},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,r=this.x.redSqr(),n=e.redInvm(),o=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=o.redSqr().redISub(this.x.redAdd(this.x)),a=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new o(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,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,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 r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}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)},i(l,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},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(),r=this.z.redSqr(),n=this.x.redMul(t),o=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(o),u=i.redSub(a);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),f=n.redMul(c),d=u.redSqr().redIAdd(l).redISub(f).redISub(f),h=u.redMul(f.redISub(d)).redISub(i.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),o=this.y,i=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=o.redSub(i);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=r.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),d=s.redMul(l.redISub(f)).redISub(o.redMul(c)),h=this.z.redMul(a);return this.curve.jpoint(f,d,h)},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 r=this;for(t=0;t=0)return!1;if(r.redIAdd(o),0===this.x.cmp(r))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},36697:(e,t,r)=>{"use strict";var n,o=t,i=r(73697),a=r(87849),s=r(86864).assert;function u(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.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(o,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(o,e,{configurable:!0,enumerable:!0,value:r}),r}})}o.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:i.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:i.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:i.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:i.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:i.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:i.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:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(19112)}catch(l){n=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:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},77794:(e,t,r)=>{"use strict";var n=r(52835),o=r(31172),i=r(86864),a=r(36697),s=r(88462),u=i.assert,c=r(60109),l=r(69300);function f(e){if(!(this instanceof f))return new f(e);"string"===typeof e&&(u(Object.prototype.hasOwnProperty.call(a,e),"Unknown curve "+e),e=a[e]),e instanceof a.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=f,f.prototype.keyPair=function(e){return new c(this,e)},f.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},f.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},f.prototype.genKeyPair=function(e){e||(e={});for(var t=new o({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()}),r=this.n.byteLength(),i=this.n.sub(new n(2));;){var a=new n(t.generate(r));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}},f.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},f.prototype.sign=function(e,t,r,i){"object"===typeof r&&(i=r,r=null),i||(i={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),u=e.toArray("be",a),c=new o({hash:this.hash,entropy:s,nonce:u,pers:i.pers,persEnc:i.persEnc||"utf8"}),f=this.n.sub(new n(1)),d=0;;d++){var h=i.k?i.k(d):new n(c.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(f)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var y=p.getX(),m=y.umod(this.n);if(0!==m.cmpn(0)){var g=h.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==y.cmp(m)?2:0);return i.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),v^=1),new l({r:m,s:g,recoveryParam:v})}}}}}},f.prototype.verify=function(e,t,r,o){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,o);var i=(t=new l(t,"hex")).r,a=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(e).umod(this.n),f=u.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),f)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(c,r.getPublic(),f)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)},f.prototype.recoverPubKey=function(e,t,r,o){u((3&r)===r,"The recovery param is more than two bits"),t=new l(t,o);var i=this.n,a=new n(e),s=t.r,c=t.s,f=1&r,d=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),f):this.curve.pointFromX(s,f);var h=t.r.invm(i),p=i.sub(a).mul(h).umod(i),y=c.mul(h).umod(i);return this.g.mulAdd(p,s,y)},f.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new l(t,n)).recoveryParam)return t.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(r))return o}throw new Error("Unable to find valid recovery factor")}},60109:(e,t,r)=>{"use strict";var n=r(52835),o=r(86864).assert;function i(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=i,i.fromPublic=function(e,t,r){return t instanceof i?t:new i(e,{pub:t,pubEnc:r})},i.fromPrivate=function(e,t,r){return t instanceof i?t:new i(e,{priv:t,privEnc:r})},i.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"}},i.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},i.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?o(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||o(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)},i.prototype.derive=function(e){return e.validate()||o(e.validate(),"public point not validated"),e.mul(this.priv).getX()},i.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},i.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},i.prototype.inspect=function(){return""}},69300:(e,t,r)=>{"use strict";var n=r(52835),o=r(86864),i=o.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var o=0,i=0,a=t.place;i>>=0;return!(o<=127)&&(t.place=a,o)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=o.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;var i=u(e,r);if(!1===i)return!1;if(i+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var a=u(e,r);if(!1===a)return!1;var c=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var l=u(e,r);if(!1===l)return!1;if(e.length!==l+r.place)return!1;var f=e.slice(r.place,l+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(c),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];l(n,t.length),(n=n.concat(t)).push(2),l(n,r.length);var i=n.concat(r),a=[48];return l(a,i.length),a=a.concat(i),o.encode(a,e)}},24661:(e,t,r)=>{"use strict";var n=r(73697),o=r(36697),i=r(86864),a=i.assert,s=i.parseBytes,u=r(95206),c=r(83035);function l(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=o[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=n.sha512}e.exports=l,l.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),o=this.g.mul(n),i=this.encodePoint(o),a=this.hashInt(i,r.pubBytes(),e).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:o,S:u,Rencoded:i})},l.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),o=this.hashInt(t.Rencoded(),n.pubBytes(),e),i=this.g.mul(t.S());return t.R().add(n.pub().mul(o)).eq(i)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t{"use strict";var n=r(86864),o=n.assert,i=n.parseBytes,a=n.cachedProperty;function s(e,t){this.eddsa=e,this._secret=i(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=i(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},a(s,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),a(s,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),a(s,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),a(s,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),a(s,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),a(s,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),s.prototype.sign=function(e){return o(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 o(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},s.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=s},83035:(e,t,r)=>{"use strict";var n=r(52835),o=r(86864),i=o.assert,a=o.cachedProperty,s=o.parseBytes;function u(e,t){this.eddsa=e,"object"!==typeof t&&(t=s(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),i(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}a(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),a(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),a(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),a(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return o.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},19112: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"]]}}},86864:(e,t,r)=>{"use strict";var n=t,o=r(52835),i=r(75482),a=r(49848);n.assert=i,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(e,t,r){var n,o=new Array(Math.max(e.bitLength(),r)+1);for(n=0;n(i>>1)-1?(i>>1)-u:u,a.isubn(s)):s=0,o[n]=s,a.iushrn(1)}return o},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,o=0,i=0;e.cmpn(-o)>0||t.cmpn(-i)>0;){var a,s,u=e.andln(3)+o&3,c=t.andln(3)+i&3;3===u&&(u=-1),3===c&&(c=-1),a=0===(1&u)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[0].push(a),s=0===(1&c)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*o===a+1&&(o=1-o),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"===typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new o(e,"hex","le")}},52835:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(79368).Buffer}catch(E){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,n){for(var o=0,i=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return o}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(o=0,i=0;o>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)o=u(e,t,n)<=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(n=(e.length-t)%2===0?t+1:t;n=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=t)n++;n--,o=o/t|0;for(var i=e.length-r,a=i%n,s=Math.min(i,i-a)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};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"],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],d=[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 h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,f=67108863&u,d=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=d;h++){var p=c-h|0;l+=(a=(o=0|e.words[p])*(i=0|t.words[h])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var o=0,i=0,a=0;a>>24-o&16777215)||a!==this.length-1?l[6-u.length]+u+r:u+r,(o+=2)>=26&&(o-=26,a--)}for(0!==i&&(r=i.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],h=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?y+r:l[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return n("undefined"!==typeof a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){var o=this.byteLength(),i=r||Math.max(1,o);n(o<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(i),l=this.clone();if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var o=0;o0&&(this.words[o]=~this.words[o]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,o=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.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 r,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,h=0|a[1],p=8191&h,y=h>>>13,m=0|a[2],g=8191&m,v=m>>>13,b=0|a[3],w=8191&b,A=b>>>13,S=0|a[4],k=8191&S,_=S>>>13,E=0|a[5],x=8191&E,T=E>>>13,P=0|a[6],O=8191&P,R=P>>>13,I=0|a[7],C=8191&I,M=I>>>13,B=0|a[8],N=8191&B,L=B>>>13,j=0|a[9],U=8191&j,F=j>>>13,D=0|s[0],z=8191&D,q=D>>>13,H=0|s[1],V=8191&H,K=H>>>13,W=0|s[2],G=8191&W,X=W>>>13,Z=0|s[3],Q=8191&Z,Y=Z>>>13,J=0|s[4],$=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ne=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,de=le>>>13,he=0|s[9],pe=8191&he,ye=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(n=Math.imul(f,z))|0)+((8191&(o=(o=Math.imul(f,q))+Math.imul(d,z)|0))<<13)|0;c=((i=Math.imul(d,q))+(o>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,z),o=(o=Math.imul(p,q))+Math.imul(y,z)|0,i=Math.imul(y,q);var ge=(c+(n=n+Math.imul(f,V)|0)|0)+((8191&(o=(o=o+Math.imul(f,K)|0)+Math.imul(d,V)|0))<<13)|0;c=((i=i+Math.imul(d,K)|0)+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,z),o=(o=Math.imul(g,q))+Math.imul(v,z)|0,i=Math.imul(v,q),n=n+Math.imul(p,V)|0,o=(o=o+Math.imul(p,K)|0)+Math.imul(y,V)|0,i=i+Math.imul(y,K)|0;var ve=(c+(n=n+Math.imul(f,G)|0)|0)+((8191&(o=(o=o+Math.imul(f,X)|0)+Math.imul(d,G)|0))<<13)|0;c=((i=i+Math.imul(d,X)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,z),o=(o=Math.imul(w,q))+Math.imul(A,z)|0,i=Math.imul(A,q),n=n+Math.imul(g,V)|0,o=(o=o+Math.imul(g,K)|0)+Math.imul(v,V)|0,i=i+Math.imul(v,K)|0,n=n+Math.imul(p,G)|0,o=(o=o+Math.imul(p,X)|0)+Math.imul(y,G)|0,i=i+Math.imul(y,X)|0;var be=(c+(n=n+Math.imul(f,Q)|0)|0)+((8191&(o=(o=o+Math.imul(f,Y)|0)+Math.imul(d,Q)|0))<<13)|0;c=((i=i+Math.imul(d,Y)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(k,z),o=(o=Math.imul(k,q))+Math.imul(_,z)|0,i=Math.imul(_,q),n=n+Math.imul(w,V)|0,o=(o=o+Math.imul(w,K)|0)+Math.imul(A,V)|0,i=i+Math.imul(A,K)|0,n=n+Math.imul(g,G)|0,o=(o=o+Math.imul(g,X)|0)+Math.imul(v,G)|0,i=i+Math.imul(v,X)|0,n=n+Math.imul(p,Q)|0,o=(o=o+Math.imul(p,Y)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,Y)|0;var we=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(o=(o=o+Math.imul(f,ee)|0)+Math.imul(d,$)|0))<<13)|0;c=((i=i+Math.imul(d,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,z),o=(o=Math.imul(x,q))+Math.imul(T,z)|0,i=Math.imul(T,q),n=n+Math.imul(k,V)|0,o=(o=o+Math.imul(k,K)|0)+Math.imul(_,V)|0,i=i+Math.imul(_,K)|0,n=n+Math.imul(w,G)|0,o=(o=o+Math.imul(w,X)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,X)|0,n=n+Math.imul(g,Q)|0,o=(o=o+Math.imul(g,Y)|0)+Math.imul(v,Q)|0,i=i+Math.imul(v,Y)|0,n=n+Math.imul(p,$)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,ee)|0;var Ae=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(o=(o=o+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((i=i+Math.imul(d,ne)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(O,z),o=(o=Math.imul(O,q))+Math.imul(R,z)|0,i=Math.imul(R,q),n=n+Math.imul(x,V)|0,o=(o=o+Math.imul(x,K)|0)+Math.imul(T,V)|0,i=i+Math.imul(T,K)|0,n=n+Math.imul(k,G)|0,o=(o=o+Math.imul(k,X)|0)+Math.imul(_,G)|0,i=i+Math.imul(_,X)|0,n=n+Math.imul(w,Q)|0,o=(o=o+Math.imul(w,Y)|0)+Math.imul(A,Q)|0,i=i+Math.imul(A,Y)|0,n=n+Math.imul(g,$)|0,o=(o=o+Math.imul(g,ee)|0)+Math.imul(v,$)|0,i=i+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,o=(o=o+Math.imul(p,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0;var Se=(c+(n=n+Math.imul(f,ie)|0)|0)+((8191&(o=(o=o+Math.imul(f,ae)|0)+Math.imul(d,ie)|0))<<13)|0;c=((i=i+Math.imul(d,ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(C,z),o=(o=Math.imul(C,q))+Math.imul(M,z)|0,i=Math.imul(M,q),n=n+Math.imul(O,V)|0,o=(o=o+Math.imul(O,K)|0)+Math.imul(R,V)|0,i=i+Math.imul(R,K)|0,n=n+Math.imul(x,G)|0,o=(o=o+Math.imul(x,X)|0)+Math.imul(T,G)|0,i=i+Math.imul(T,X)|0,n=n+Math.imul(k,Q)|0,o=(o=o+Math.imul(k,Y)|0)+Math.imul(_,Q)|0,i=i+Math.imul(_,Y)|0,n=n+Math.imul(w,$)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0,n=n+Math.imul(g,re)|0,o=(o=o+Math.imul(g,ne)|0)+Math.imul(v,re)|0,i=i+Math.imul(v,ne)|0,n=n+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,ae)|0;var ke=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(o=(o=o+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((i=i+Math.imul(d,ce)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(N,z),o=(o=Math.imul(N,q))+Math.imul(L,z)|0,i=Math.imul(L,q),n=n+Math.imul(C,V)|0,o=(o=o+Math.imul(C,K)|0)+Math.imul(M,V)|0,i=i+Math.imul(M,K)|0,n=n+Math.imul(O,G)|0,o=(o=o+Math.imul(O,X)|0)+Math.imul(R,G)|0,i=i+Math.imul(R,X)|0,n=n+Math.imul(x,Q)|0,o=(o=o+Math.imul(x,Y)|0)+Math.imul(T,Q)|0,i=i+Math.imul(T,Y)|0,n=n+Math.imul(k,$)|0,o=(o=o+Math.imul(k,ee)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,ee)|0,n=n+Math.imul(w,re)|0,o=(o=o+Math.imul(w,ne)|0)+Math.imul(A,re)|0,i=i+Math.imul(A,ne)|0,n=n+Math.imul(g,ie)|0,o=(o=o+Math.imul(g,ae)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,ae)|0,n=n+Math.imul(p,ue)|0,o=(o=o+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,i=i+Math.imul(y,ce)|0;var _e=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(o=(o=o+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((i=i+Math.imul(d,de)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(U,z),o=(o=Math.imul(U,q))+Math.imul(F,z)|0,i=Math.imul(F,q),n=n+Math.imul(N,V)|0,o=(o=o+Math.imul(N,K)|0)+Math.imul(L,V)|0,i=i+Math.imul(L,K)|0,n=n+Math.imul(C,G)|0,o=(o=o+Math.imul(C,X)|0)+Math.imul(M,G)|0,i=i+Math.imul(M,X)|0,n=n+Math.imul(O,Q)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,Y)|0,n=n+Math.imul(x,$)|0,o=(o=o+Math.imul(x,ee)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,ee)|0,n=n+Math.imul(k,re)|0,o=(o=o+Math.imul(k,ne)|0)+Math.imul(_,re)|0,i=i+Math.imul(_,ne)|0,n=n+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0,n=n+Math.imul(g,ue)|0,o=(o=o+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,i=i+Math.imul(v,ce)|0,n=n+Math.imul(p,fe)|0,o=(o=o+Math.imul(p,de)|0)+Math.imul(y,fe)|0,i=i+Math.imul(y,de)|0;var Ee=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(o=(o=o+Math.imul(f,ye)|0)+Math.imul(d,pe)|0))<<13)|0;c=((i=i+Math.imul(d,ye)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,V),o=(o=Math.imul(U,K))+Math.imul(F,V)|0,i=Math.imul(F,K),n=n+Math.imul(N,G)|0,o=(o=o+Math.imul(N,X)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,X)|0,n=n+Math.imul(C,Q)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(M,Q)|0,i=i+Math.imul(M,Y)|0,n=n+Math.imul(O,$)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(x,re)|0,o=(o=o+Math.imul(x,ne)|0)+Math.imul(T,re)|0,i=i+Math.imul(T,ne)|0,n=n+Math.imul(k,ie)|0,o=(o=o+Math.imul(k,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,n=n+Math.imul(w,ue)|0,o=(o=o+Math.imul(w,ce)|0)+Math.imul(A,ue)|0,i=i+Math.imul(A,ce)|0,n=n+Math.imul(g,fe)|0,o=(o=o+Math.imul(g,de)|0)+Math.imul(v,fe)|0,i=i+Math.imul(v,de)|0;var xe=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((i=i+Math.imul(y,ye)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(U,G),o=(o=Math.imul(U,X))+Math.imul(F,G)|0,i=Math.imul(F,X),n=n+Math.imul(N,Q)|0,o=(o=o+Math.imul(N,Y)|0)+Math.imul(L,Q)|0,i=i+Math.imul(L,Y)|0,n=n+Math.imul(C,$)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(M,$)|0,i=i+Math.imul(M,ee)|0,n=n+Math.imul(O,re)|0,o=(o=o+Math.imul(O,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(x,ie)|0,o=(o=o+Math.imul(x,ae)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,ae)|0,n=n+Math.imul(k,ue)|0,o=(o=o+Math.imul(k,ce)|0)+Math.imul(_,ue)|0,i=i+Math.imul(_,ce)|0,n=n+Math.imul(w,fe)|0,o=(o=o+Math.imul(w,de)|0)+Math.imul(A,fe)|0,i=i+Math.imul(A,de)|0;var Te=(c+(n=n+Math.imul(g,pe)|0)|0)+((8191&(o=(o=o+Math.imul(g,ye)|0)+Math.imul(v,pe)|0))<<13)|0;c=((i=i+Math.imul(v,ye)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,Q),o=(o=Math.imul(U,Y))+Math.imul(F,Q)|0,i=Math.imul(F,Y),n=n+Math.imul(N,$)|0,o=(o=o+Math.imul(N,ee)|0)+Math.imul(L,$)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(C,re)|0,o=(o=o+Math.imul(C,ne)|0)+Math.imul(M,re)|0,i=i+Math.imul(M,ne)|0,n=n+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,ae)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,ae)|0,n=n+Math.imul(x,ue)|0,o=(o=o+Math.imul(x,ce)|0)+Math.imul(T,ue)|0,i=i+Math.imul(T,ce)|0,n=n+Math.imul(k,fe)|0,o=(o=o+Math.imul(k,de)|0)+Math.imul(_,fe)|0,i=i+Math.imul(_,de)|0;var Pe=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,ye)|0)+Math.imul(A,pe)|0))<<13)|0;c=((i=i+Math.imul(A,ye)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,$),o=(o=Math.imul(U,ee))+Math.imul(F,$)|0,i=Math.imul(F,ee),n=n+Math.imul(N,re)|0,o=(o=o+Math.imul(N,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,ae)|0)+Math.imul(M,ie)|0,i=i+Math.imul(M,ae)|0,n=n+Math.imul(O,ue)|0,o=(o=o+Math.imul(O,ce)|0)+Math.imul(R,ue)|0,i=i+Math.imul(R,ce)|0,n=n+Math.imul(x,fe)|0,o=(o=o+Math.imul(x,de)|0)+Math.imul(T,fe)|0,i=i+Math.imul(T,de)|0;var Oe=(c+(n=n+Math.imul(k,pe)|0)|0)+((8191&(o=(o=o+Math.imul(k,ye)|0)+Math.imul(_,pe)|0))<<13)|0;c=((i=i+Math.imul(_,ye)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,re),o=(o=Math.imul(U,ne))+Math.imul(F,re)|0,i=Math.imul(F,ne),n=n+Math.imul(N,ie)|0,o=(o=o+Math.imul(N,ae)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,ae)|0,n=n+Math.imul(C,ue)|0,o=(o=o+Math.imul(C,ce)|0)+Math.imul(M,ue)|0,i=i+Math.imul(M,ce)|0,n=n+Math.imul(O,fe)|0,o=(o=o+Math.imul(O,de)|0)+Math.imul(R,fe)|0,i=i+Math.imul(R,de)|0;var Re=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(o=(o=o+Math.imul(x,ye)|0)+Math.imul(T,pe)|0))<<13)|0;c=((i=i+Math.imul(T,ye)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,ie),o=(o=Math.imul(U,ae))+Math.imul(F,ie)|0,i=Math.imul(F,ae),n=n+Math.imul(N,ue)|0,o=(o=o+Math.imul(N,ce)|0)+Math.imul(L,ue)|0,i=i+Math.imul(L,ce)|0,n=n+Math.imul(C,fe)|0,o=(o=o+Math.imul(C,de)|0)+Math.imul(M,fe)|0,i=i+Math.imul(M,de)|0;var Ie=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(o=(o=o+Math.imul(O,ye)|0)+Math.imul(R,pe)|0))<<13)|0;c=((i=i+Math.imul(R,ye)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,ue),o=(o=Math.imul(U,ce))+Math.imul(F,ue)|0,i=Math.imul(F,ce),n=n+Math.imul(N,fe)|0,o=(o=o+Math.imul(N,de)|0)+Math.imul(L,fe)|0,i=i+Math.imul(L,de)|0;var Ce=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,ye)|0)+Math.imul(M,pe)|0))<<13)|0;c=((i=i+Math.imul(M,ye)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(U,fe),o=(o=Math.imul(U,de))+Math.imul(F,fe)|0,i=Math.imul(F,de);var Me=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(o=(o=o+Math.imul(N,ye)|0)+Math.imul(L,pe)|0))<<13)|0;c=((i=i+Math.imul(L,ye)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863;var Be=(c+(n=Math.imul(U,pe))|0)+((8191&(o=(o=Math.imul(U,ye))+Math.imul(F,pe)|0))<<13)|0;return c=((i=Math.imul(F,ye))+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Ae,u[6]=Se,u[7]=ke,u[8]=_e,u[9]=Ee,u[10]=xe,u[11]=Te,u[12]=Pe,u[13]=Oe,u[14]=Re,u[15]=Ie,u[16]=Ce,u[17]=Me,u[18]=Be,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=h),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}r.words[i]=s,n=a,a=o}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},m.prototype.permute=function(e,t,r,n,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,t+=o/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>o}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,r=e%26,o=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=o);c--){var f=0|this.words[c];this.words[c]=l<<26-i|f>>>i,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,o=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var o=67108863^67108863>>>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},i.prototype.isubn=function(e){if(n("number"===typeof e),n(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>26)-(u/67108864|0),this.words[o+r]=67108863&i}for(;o>26,this.words[o+r]=67108863&i;if(0===s)return this.strip();for(n(-1===s),s=0,o=0;o>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,u=n.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var d=67108864*(0|n.words[o.length+f])+(0|n.words[o.length+f-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(o,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(o,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),o=e.andln(1),i=r.cmp(n);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,o=this.length-1;o>=0;o--)r=(t*r+(0|this.words[o]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var o=(0|this.words[r])+67108864*t;this.words[r]=o/e|0,t=o%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0===(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(f)),o.iushrn(1),a.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.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;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0===(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var o=t.cmp(r);if(o<0){var i=t;t=r,r=i}else if(0===o||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,o=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;r--){var n=0|this.words[r],o=0|e.words[r];if(n!==o){no&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new k(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(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 i(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)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},o(b,v),b.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),o=0;o>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=o,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;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 S}return g[e]=t,t},k.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(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 r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},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(n(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,o),d=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var y=h,m=0;0!==y.cmp(s);m++)y=y.redSqr();n(m=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var f=c>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===n&&0===l)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}u=26}return o},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},i.mont=function(e){return new _(e)},o(_,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 r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},_.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},_.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},82090:(e,t,r)=>{"use strict";var n=r(60002)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(o){n=!1}e.exports=n},79820:e=>{"use strict";e.exports=EvalError},29304:e=>{"use strict";e.exports=Error},1725:e=>{"use strict";e.exports=RangeError},75077:e=>{"use strict";e.exports=ReferenceError},62557:e=>{"use strict";e.exports=SyntaxError},54902:e=>{"use strict";e.exports=TypeError},63094:e=>{"use strict";e.exports=URIError},50282:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(26875);function o(e){return"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)))}function i(e,t){"object"===typeof t&&t.constructor===Uint8Array&&(t=n.bytesToHex(t));const r=n.keccak256(t).replace("0x","");for(let n=0;n<12;n+=4){const t=(parseInt(r.substr(n,2),16)<<8)+parseInt(r.substr(n+2,2),16)&2047,o=1<=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 bloom")}function s(e){return"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)))}function u(e){return"string"===typeof e&&(!!e.match(/^(0x)?[0-9a-fA-F]{40}$/)||!!e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/))}t.isBloom=o,t.isInBloom=i,t.isUserEthereumAddressInBloom=function(e,t){if(!o(e))throw new Error("Invalid bloom given");if(!u(t))throw new Error('Invalid ethereum address given: "'.concat(t,'"'));return i(e,n.padLeft(t,64))},t.isContractAddressInBloom=function(e,t){if(!o(e))throw new Error("Invalid bloom given");if(!u(t))throw new Error('Invalid contract address given: "'.concat(t,'"'));return i(e,t)},t.isTopicInBloom=function(e,t){if(!o(e))throw new Error("Invalid bloom given");if(!s(t))throw new Error("Invalid topic");return i(e,t)},t.isTopic=s,t.isAddress=u},26875:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(67138);function o(e){const t=[];for(let r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return"0x".concat(t.join("").replace(/^0+/,""))}function i(e){if(null==e)throw new Error("cannot convert null value to array");if("string"===typeof e){const t=e.match(/^(0x)?[0-9a-fA-F]*$/);if(!t)throw new Error("invalid hexidecimal string");if("0x"!==t[1])throw new Error("hex string must have 0x prefix");(e=e.substring(2)).length%2&&(e="0"+e);const r=[];for(let n=0;n=256||parseInt(String(r))!=r)return!1}return!0}(e))return a(new Uint8Array(e));throw new Error("invalid arrayify value")}function a(e){return void 0!==e.slice||(e.slice=()=>{const t=Array.prototype.slice.call(arguments);return a(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}t.keccak256=function(e){return o(n.keccak_256(i(e)))},t.padLeft=(e,t)=>{const r=/^0x/i.test(e)||"number"===typeof e,n=t-(e=e.toString().replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(r?"0x":"")+new Array(n).join("0")+e},t.bytesToHex=o,t.toByteArray=i},36120:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHashFunction=function(e){return function(t){var r=e();return r.update(t),Buffer.from(r.digest())}}},30994:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(36120),o=r(85831);t.keccak224=n.createHashFunction((function(){return o("keccak224")})),t.keccak256=n.createHashFunction((function(){return o("keccak256")})),t.keccak384=n.createHashFunction((function(){return o("keccak384")})),t.keccak512=n.createHashFunction((function(){return o("keccak512")}))},93631:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(15838);t.getRandomBytes=function(e){return new Promise((function(t,r){n(e,(function(e,n){e?r(e):t(n)}))}))},t.getRandomBytesSync=function(e){return n(e)}},59490:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroAddress=t.zeroAddress=t.importPublic=t.privateToAddress=t.privateToPublic=t.publicToAddress=t.pubToAddress=t.isValidPublic=t.isValidPrivate=t.generateAddress2=t.generateAddress=t.isValidChecksumAddress=t.toChecksumAddress=t.isValidAddress=t.Account=void 0;var i=o(r(2539)),a=r(90820),s=r(59490),u=r(48547),c=r(55609),l=r(44063),f=r(23582),d=r(7617),h=r(80657),p=function(){function e(e,t,r,n){void 0===e&&(e=new a.BN(0)),void 0===t&&(t=new a.BN(0)),void 0===r&&(r=c.KECCAK256_RLP),void 0===n&&(n=c.KECCAK256_NULL),this.nonce=e,this.balance=t,this.stateRoot=r,this.codeHash=n,this._validate()}return e.fromAccountData=function(t){var r=t.nonce,n=t.balance,o=t.stateRoot,i=t.codeHash;return new e(r?new a.BN((0,l.toBuffer)(r)):void 0,n?new a.BN((0,l.toBuffer)(n)):void 0,o?(0,l.toBuffer)(o):void 0,i?(0,l.toBuffer)(i):void 0)},e.fromRlpSerializedAccount=function(e){var t=a.rlp.decode(e);if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)},e.fromValuesArray=function(t){var r=n(t,4),o=r[0],i=r[1],s=r[2],u=r[3];return new e(new a.BN(o),new a.BN(i),s,u)},e.prototype._validate=function(){if(this.nonce.lt(new a.BN(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new a.BN(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},e.prototype.raw=function(){return[(0,h.bnToUnpaddedBuffer)(this.nonce),(0,h.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},e.prototype.serialize=function(){return a.rlp.encode(this.raw())},e.prototype.isContract=function(){return!this.codeHash.equals(c.KECCAK256_NULL)},e.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(c.KECCAK256_NULL)},e}();t.Account=p;t.isValidAddress=function(e){try{(0,d.assertIsString)(e)}catch(t){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)};t.toChecksumAddress=function(e,t){(0,d.assertIsHexString)(e);var r=(0,u.stripHexPrefix)(e).toLowerCase(),n="";t&&(n=(0,h.toType)(t,h.TypeOutput.BN).toString()+"0x");for(var o=(0,f.keccakFromString)(n+r).toString("hex"),i="0x",a=0;a=8?i+=r[a].toUpperCase():i+=r[a];return i};t.isValidChecksumAddress=function(e,r){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,r)===e};t.generateAddress=function(e,t){(0,d.assertIsBuffer)(e),(0,d.assertIsBuffer)(t);var r=new a.BN(t);return r.isZero()?(0,f.rlphash)([e,null]).slice(-20):(0,f.rlphash)([e,Buffer.from(r.toArray())]).slice(-20)};t.generateAddress2=function(e,t,r){return(0,d.assertIsBuffer)(e),(0,d.assertIsBuffer)(t),(0,d.assertIsBuffer)(r),(0,i.default)(20===e.length),(0,i.default)(32===t.length),(0,f.keccak256)(Buffer.concat([Buffer.from("ff","hex"),e,t,(0,f.keccak256)(r)])).slice(-20)};t.isValidPrivate=function(e){return(0,s.privateKeyVerify)(e)};t.isValidPublic=function(e,t){return void 0===t&&(t=!1),(0,d.assertIsBuffer)(e),64===e.length?(0,s.publicKeyVerify)(Buffer.concat([Buffer.from([4]),e])):!!t&&(0,s.publicKeyVerify)(e)};t.pubToAddress=function(e,t){return void 0===t&&(t=!1),(0,d.assertIsBuffer)(e),t&&64!==e.length&&(e=Buffer.from((0,s.publicKeyConvert)(e,!1).slice(1))),(0,i.default)(64===e.length),(0,f.keccak)(e).slice(-20)},t.publicToAddress=t.pubToAddress;t.privateToPublic=function(e){return(0,d.assertIsBuffer)(e),Buffer.from((0,s.publicKeyCreate)(e,!1)).slice(1)};t.privateToAddress=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))};t.importPublic=function(e){return(0,d.assertIsBuffer)(e),64!==e.length&&(e=Buffer.from((0,s.publicKeyConvert)(e,!1).slice(1))),e};t.zeroAddress=function(){var e=(0,l.zeros)(20);return(0,l.bufferToHex)(e)};t.isZeroAddress=function(e){try{(0,d.assertIsString)(e)}catch(r){return!1}return(0,t.zeroAddress)()===e}},95564:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var o=n(r(2539)),i=r(90820),a=r(44063),s=r(92295),u=function(){function e(e){(0,o.default)(20===e.length,"Invalid address length"),this.buf=e}return e.zero=function(){return new e((0,a.zeros)(20))},e.fromString=function(t){return(0,o.default)((0,s.isValidAddress)(t),"Invalid address"),new e((0,a.toBuffer)(t))},e.fromPublicKey=function(t){return(0,o.default)(Buffer.isBuffer(t),"Public key should be Buffer"),new e((0,s.pubToAddress)(t))},e.fromPrivateKey=function(t){return(0,o.default)(Buffer.isBuffer(t),"Private key should be Buffer"),new e((0,s.privateToAddress)(t))},e.generate=function(t,r){return(0,o.default)(i.BN.isBN(r)),new e((0,s.generateAddress)(t.buf,r.toArrayLike(Buffer)))},e.generate2=function(t,r,n){return(0,o.default)(Buffer.isBuffer(r)),(0,o.default)(Buffer.isBuffer(n)),new e((0,s.generateAddress2)(t.buf,r,n))},e.prototype.equals=function(e){return this.buf.equals(e.buf)},e.prototype.isZero=function(){return this.equals(e.zero())},e.prototype.isPrecompileOrSystemAddress=function(){var e=new i.BN(this.buf),t=new i.BN(0),r=new i.BN("ffff","hex");return e.gte(t)&&e.lte(r)},e.prototype.toString=function(){return"0x"+this.buf.toString("hex")},e.prototype.toBuffer=function(){return Buffer.from(this.buf)},e}();t.Address=u},44063:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"===typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(90820),a=r(48547),s=r(7617);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(e){var r=(0,t.intToHex)(e);return Buffer.from((0,a.padToEven)(r.slice(2)),"hex")};t.zeros=function(e){return Buffer.allocUnsafe(e).fill(0)};var u=function(e,r,n){var o=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,s.assertIsBuffer)(e),c(e)};t.unpadArray=function(e){return(0,s.assertIsArray)(e),c(e)};t.unpadHexString=function(e){return(0,s.assertIsHexString)(e),e=(0,a.stripHexPrefix)(e),c(e)};t.toBuffer=function(e){if(null===e||void 0===e)return Buffer.allocUnsafe(0);if(Buffer.isBuffer(e))return Buffer.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return Buffer.from(e);if("string"===typeof e){if(!(0,a.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e));return Buffer.from((0,a.padToEven)((0,a.stripHexPrefix)(e)),"hex")}if("number"===typeof e)return(0,t.intToBuffer)(e);if(i.BN.isBN(e)){if(e.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e));return e.toArrayLike(Buffer)}if(e.toArray)return Buffer.from(e.toArray());if(e.toBuffer)return Buffer.from(e.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(e){return Buffer.from(e.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!==typeof e||(0,a.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(e){if((e=(0,a.stripHexPrefix)(e)).length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return Buffer.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(e){if(Buffer.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var r=[],n=0;n0&&0===c[0])throw new Error("".concat(u," cannot have leading zeroes, received: ").concat(c.toString("hex")))}}catch(l){t={error:l}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Buffer.from(t)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!==t&&void 0!==t?t:[])}},55609:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.MAX_INTEGER=t.MAX_UINT64=void 0;var n=r(26382),o=r(90820);t.MAX_UINT64=new o.BN("ffffffffffffffff",16),t.MAX_INTEGER=new o.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new o.BN("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=n.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=n.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=n.Buffer.from(t.KECCAK256_RLP_S,"hex")},90820:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var s=a(r(6373));t.BN=s.default;var u=i(r(3225));t.rlp=u},23582:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var n=r(30994),o=r(36059),i=r(90820),a=r(44063),s=r(7617);t.keccak=function(e,t){switch(void 0===t&&(t=256),(0,s.assertIsBuffer)(e),t){case 224:return(0,n.keccak224)(e);case 256:return(0,n.keccak256)(e);case 384:return(0,n.keccak384)(e);case 512:return(0,n.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(t))}};t.keccak256=function(e){return(0,t.keccak)(e)};t.keccakFromString=function(e,r){void 0===r&&(r=256),(0,s.assertIsString)(e);var n=Buffer.from(e,"utf8");return(0,t.keccak)(n,r)};t.keccakFromHexString=function(e,r){return void 0===r&&(r=256),(0,s.assertIsHexString)(e),(0,t.keccak)((0,a.toBuffer)(e),r)};t.keccakFromArray=function(e,r){return void 0===r&&(r=256),(0,s.assertIsArray)(e),(0,t.keccak)((0,a.toBuffer)(e),r)};var u=function(e){return e=(0,a.toBuffer)(e),o("sha256").update(e).digest()};t.sha256=function(e){return(0,s.assertIsBuffer)(e),u(e)};t.sha256FromString=function(e){return(0,s.assertIsString)(e),u(e)};t.sha256FromArray=function(e){return(0,s.assertIsArray)(e),u(e)};var c=function(e,t){e=(0,a.toBuffer)(e);var r=o("rmd160").update(e).digest();return!0===t?(0,a.setLengthLeft)(r,32):r};t.ripemd160=function(e,t){return(0,s.assertIsBuffer)(e),c(e,t)};t.ripemd160FromString=function(e,t){return(0,s.assertIsString)(e),c(e,t)};t.ripemd160FromArray=function(e,t){return(0,s.assertIsArray)(e),c(e,t)};t.rlphash=function(e){return(0,t.keccak)(i.rlp.encode(e))}},7617:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var n=r(48547);t.assertIsHexString=function(e){if(!(0,n.isHexString)(e)){var t="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(t)}};t.assertIsBuffer=function(e){if(!Buffer.isBuffer(e)){var t="This method only supports Buffer but input was: ".concat(e);throw new Error(t)}};t.assertIsArray=function(e){if(!Array.isArray(e)){var t="This method only supports number arrays but input was: ".concat(e);throw new Error(t)}};t.assertIsString=function(e){if("string"!==typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}}},90900:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,o(r(55609),t),o(r(92295),t),o(r(95564),t),o(r(23582),t),o(r(14578),t),o(r(44063),t),o(r(17329),t),o(r(90820),t),o(r(80657),t);var i=r(48547);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return i.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return i.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return i.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return i.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return i.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return i.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return i.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return i.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}})},48547:(e,t)=>{"use strict";function r(e){if("string"!==typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(typeof e));return"0"===e[0]&&"x"===e[1]}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=r;function n(e){var t=e;if("string"!==typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(typeof t));return t.length%2&&(t="0".concat(t)),t}t.stripHexPrefix=function(e){if("string"!==typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof e));return r(e)?e.slice(2):e},t.padToEven=n,t.getBinarySize=function(e){if("string"!==typeof e)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(typeof e));return Buffer.byteLength(e,"utf8")},t.arrayContainsArray=function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(typeof e,"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(typeof t,"'"));return t[r?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r=n.length,"The field ".concat(t.name," must not have more ").concat(t.length," bytes"))):t.allowZero&&0===n.length||!t.length||(0,o.default)(t.length===n.length,"The field ".concat(t.name," must have byte length of ").concat(t.length)),e.raw[r]=n}e._fields.push(t.name),Object.defineProperty(e,t.name,{enumerable:!0,configurable:!0,get:n,set:i}),t.default&&(e[t.name]=t.default),t.alias&&Object.defineProperty(e,t.alias,{enumerable:!1,configurable:!0,set:i,get:n})})),r)if("string"===typeof r&&(r=Buffer.from((0,i.stripHexPrefix)(r),"hex")),Buffer.isBuffer(r)&&(r=a.rlp.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach((function(t,r){e[e._fields[r]]=(0,s.toBuffer)(t)}))}else{if("object"!==typeof r)throw new Error("invalid data");var n=Object.keys(r);t.forEach((function(t){-1!==n.indexOf(t.name)&&(e[t.name]=r[t.name]),-1!==n.indexOf(t.alias)&&(e[t.alias]=r[t.alias])}))}}},14578:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hashPersonalMessage=t.isValidSignature=t.fromRpcSig=t.toCompactSig=t.toRpcSig=t.ecrecover=t.ecsign=void 0;var n=r(59490),o=r(90820),i=r(44063),a=r(23582),s=r(7617),u=r(80657);function c(e,t){var r=(0,u.toType)(e,u.TypeOutput.BN);if(r.eqn(0)||r.eqn(1))return(0,u.toType)(e,u.TypeOutput.BN);if(!t)return r.subn(27);var n=(0,u.toType)(t,u.TypeOutput.BN);return r.sub(n.muln(2).addn(35))}function l(e){var t=new o.BN(e);return t.eqn(0)||t.eqn(1)}t.ecsign=function(e,t,r){var o=(0,n.ecdsaSign)(e,t),i=o.signature,a=o.recid,s=Buffer.from(i.slice(0,32)),c=Buffer.from(i.slice(32,64));if(!r||"number"===typeof r){if(r&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{r:s,s:c,v:r?a+(2*r+35):a+27}}return{r:s,s:c,v:(0,u.toType)(r,u.TypeOutput.BN).muln(2).addn(35).addn(a).toArrayLike(Buffer)}};t.ecrecover=function(e,t,r,o,a){var s=Buffer.concat([(0,i.setLengthLeft)(r,32),(0,i.setLengthLeft)(o,32)],64),u=c(t,a);if(!l(u))throw new Error("Invalid signature v value");var f=(0,n.ecdsaRecover)(s,u.toNumber(),e);return Buffer.from((0,n.publicKeyConvert)(f,!1).slice(1))};t.toRpcSig=function(e,t,r,n){if(!l(c(e,n)))throw new Error("Invalid signature v value");return(0,i.bufferToHex)(Buffer.concat([(0,i.setLengthLeft)(t,32),(0,i.setLengthLeft)(r,32),(0,i.toBuffer)(e)]))};t.toCompactSig=function(e,t,r,n){if(!l(c(e,n)))throw new Error("Invalid signature v value");var o=(0,u.toType)(e,u.TypeOutput.Number),a=r;return(o>28&&o%2===1||1===o||28===o)&&((a=Buffer.from(r))[0]|=128),(0,i.bufferToHex)(Buffer.concat([(0,i.setLengthLeft)(t,32),(0,i.setLengthLeft)(a,32)]))};t.fromRpcSig=function(e){var t,r,n,o=(0,i.toBuffer)(e);if(o.length>=65)t=o.slice(0,32),r=o.slice(32,64),n=(0,i.bufferToInt)(o.slice(64));else{if(64!==o.length)throw new Error("Invalid signature length");t=o.slice(0,32),r=o.slice(32,64),n=(0,i.bufferToInt)(o.slice(32,33))>>7,r[0]&=127}return n<27&&(n+=27),{v:n,r:t,s:r}};t.isValidSignature=function(e,t,r,n,i){void 0===n&&(n=!0);var a=new o.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),s=new o.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==r.length)return!1;if(!l(c(e,i)))return!1;var u=new o.BN(t),f=new o.BN(r);return!(u.isZero()||u.gt(s)||f.isZero()||f.gt(s))&&(!n||1!==f.cmp(a))};t.hashPersonalMessage=function(e){(0,s.assertIsBuffer)(e);var t=Buffer.from("\x19Ethereum Signed Message:\n".concat(e.length),"utf-8");return(0,a.keccak)(Buffer.concat([t,e]))}},80657:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var n,o=r(90820),i=r(48547),a=r(44063);function s(e){return(0,a.unpadBuffer)(e.toArrayLike(Buffer))}t.bnToHex=function(e){return"0x".concat(e.toString(16))},t.bnToUnpaddedBuffer=s,t.bnToRlp=function(e){return s(e)},function(e){e[e.Number=0]="Number",e[e.BN=1]="BN",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(n=t.TypeOutput||(t.TypeOutput={})),t.toType=function(e,t){if(null===e)return null;if(void 0!==e){if("string"===typeof e&&!(0,i.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(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)");var r=(0,a.toBuffer)(e);if(t===n.Buffer)return r;if(t===n.BN)return new o.BN(r);if(t===n.Number){var s=new o.BN(r),u=new o.BN(Number.MAX_SAFE_INTEGER.toString());if(s.gt(u))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return s.toNumber()}return"0x".concat(r.toString("hex"))}}},93797:(e,t,r)=>{"use strict";var n=r(83076),o=r(56377),i=new n(0),a=new n(-1),s={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};function u(e){var t=e?e.toLowerCase():"ether",r=s[t];if("string"!==typeof r)throw new Error("[ethjs-unit] the unit provided "+e+" doesn't exists, please use the one of the following units "+JSON.stringify(s,null,2));return new n(r,10)}function c(e){if("string"===typeof e){if(!e.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+e+"', should be a number matching (^-?[0-9.]+).");return e}if("number"===typeof e)return String(e);if("object"===typeof e&&e.toString&&(e.toTwos||e.dividedToIntegerBy))return e.toPrecision?String(e.toPrecision()):e.toString(10);throw new Error("while converting number to string, invalid number value '"+e+"' type "+typeof e+".")}e.exports={unitMap:s,numberToString:c,getValueOfUnit:u,fromWei:function(e,t,r){var n=o(e),c=n.lt(i),l=u(t),f=s[t].length-1||1,d=r||{};c&&(n=n.mul(a));for(var h=n.mod(l).toString(10);h.length2)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal points");var d=f[0],h=f[1];if(d||(d="0"),h||(h="0"),h.length>i)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal places");for(;h.length=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(e,t,r,n){for(var o=0,i=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return o}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&o++,16===t?this._parseHex(e,o):this._parseBase(e,t,o),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initNumber=function(e,t,r){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):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("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 o=0;o=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(o=0,i=0;o>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)o=s(e,r,r+6),this.words[n]|=o<>>26-i&4194303,(i+=24)>=26&&(i-=26,n++);r+6!==t&&(o=s(e,t,r+6),this.words[n]|=o<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=t)n++;n--,o=o/t|0;for(var i=e.length-r,a=i%n,s=Math.min(i,i-a)+r,c=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","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"],l=[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],f=[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 d(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,f=67108863&u,d=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=d;h++){var p=c-h|0;l+=(a=(o=0|e.words[p])*(i=0|t.words[h])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var o=0,i=0,a=0;a>>24-o&16777215)||a!==this.length-1?c[6-u.length]+u+r:u+r,(o+=2)>=26&&(o-=26,a--)}for(0!==i&&(r=i.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=l[e],h=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?y+r:c[d-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return n("undefined"!==typeof a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){var o=this.byteLength(),i=r||Math.max(1,o);n(o<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(i),l=this.clone();if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var o=0;o0&&(this.words[o]=~this.words[o]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,o=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.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 r,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,h=0|a[1],p=8191&h,y=h>>>13,m=0|a[2],g=8191&m,v=m>>>13,b=0|a[3],w=8191&b,A=b>>>13,S=0|a[4],k=8191&S,_=S>>>13,E=0|a[5],x=8191&E,T=E>>>13,P=0|a[6],O=8191&P,R=P>>>13,I=0|a[7],C=8191&I,M=I>>>13,B=0|a[8],N=8191&B,L=B>>>13,j=0|a[9],U=8191&j,F=j>>>13,D=0|s[0],z=8191&D,q=D>>>13,H=0|s[1],V=8191&H,K=H>>>13,W=0|s[2],G=8191&W,X=W>>>13,Z=0|s[3],Q=8191&Z,Y=Z>>>13,J=0|s[4],$=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ne=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,de=le>>>13,he=0|s[9],pe=8191&he,ye=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(n=Math.imul(f,z))|0)+((8191&(o=(o=Math.imul(f,q))+Math.imul(d,z)|0))<<13)|0;c=((i=Math.imul(d,q))+(o>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,z),o=(o=Math.imul(p,q))+Math.imul(y,z)|0,i=Math.imul(y,q);var ge=(c+(n=n+Math.imul(f,V)|0)|0)+((8191&(o=(o=o+Math.imul(f,K)|0)+Math.imul(d,V)|0))<<13)|0;c=((i=i+Math.imul(d,K)|0)+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,z),o=(o=Math.imul(g,q))+Math.imul(v,z)|0,i=Math.imul(v,q),n=n+Math.imul(p,V)|0,o=(o=o+Math.imul(p,K)|0)+Math.imul(y,V)|0,i=i+Math.imul(y,K)|0;var ve=(c+(n=n+Math.imul(f,G)|0)|0)+((8191&(o=(o=o+Math.imul(f,X)|0)+Math.imul(d,G)|0))<<13)|0;c=((i=i+Math.imul(d,X)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,z),o=(o=Math.imul(w,q))+Math.imul(A,z)|0,i=Math.imul(A,q),n=n+Math.imul(g,V)|0,o=(o=o+Math.imul(g,K)|0)+Math.imul(v,V)|0,i=i+Math.imul(v,K)|0,n=n+Math.imul(p,G)|0,o=(o=o+Math.imul(p,X)|0)+Math.imul(y,G)|0,i=i+Math.imul(y,X)|0;var be=(c+(n=n+Math.imul(f,Q)|0)|0)+((8191&(o=(o=o+Math.imul(f,Y)|0)+Math.imul(d,Q)|0))<<13)|0;c=((i=i+Math.imul(d,Y)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(k,z),o=(o=Math.imul(k,q))+Math.imul(_,z)|0,i=Math.imul(_,q),n=n+Math.imul(w,V)|0,o=(o=o+Math.imul(w,K)|0)+Math.imul(A,V)|0,i=i+Math.imul(A,K)|0,n=n+Math.imul(g,G)|0,o=(o=o+Math.imul(g,X)|0)+Math.imul(v,G)|0,i=i+Math.imul(v,X)|0,n=n+Math.imul(p,Q)|0,o=(o=o+Math.imul(p,Y)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,Y)|0;var we=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(o=(o=o+Math.imul(f,ee)|0)+Math.imul(d,$)|0))<<13)|0;c=((i=i+Math.imul(d,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,z),o=(o=Math.imul(x,q))+Math.imul(T,z)|0,i=Math.imul(T,q),n=n+Math.imul(k,V)|0,o=(o=o+Math.imul(k,K)|0)+Math.imul(_,V)|0,i=i+Math.imul(_,K)|0,n=n+Math.imul(w,G)|0,o=(o=o+Math.imul(w,X)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,X)|0,n=n+Math.imul(g,Q)|0,o=(o=o+Math.imul(g,Y)|0)+Math.imul(v,Q)|0,i=i+Math.imul(v,Y)|0,n=n+Math.imul(p,$)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,ee)|0;var Ae=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(o=(o=o+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((i=i+Math.imul(d,ne)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(O,z),o=(o=Math.imul(O,q))+Math.imul(R,z)|0,i=Math.imul(R,q),n=n+Math.imul(x,V)|0,o=(o=o+Math.imul(x,K)|0)+Math.imul(T,V)|0,i=i+Math.imul(T,K)|0,n=n+Math.imul(k,G)|0,o=(o=o+Math.imul(k,X)|0)+Math.imul(_,G)|0,i=i+Math.imul(_,X)|0,n=n+Math.imul(w,Q)|0,o=(o=o+Math.imul(w,Y)|0)+Math.imul(A,Q)|0,i=i+Math.imul(A,Y)|0,n=n+Math.imul(g,$)|0,o=(o=o+Math.imul(g,ee)|0)+Math.imul(v,$)|0,i=i+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,o=(o=o+Math.imul(p,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0;var Se=(c+(n=n+Math.imul(f,ie)|0)|0)+((8191&(o=(o=o+Math.imul(f,ae)|0)+Math.imul(d,ie)|0))<<13)|0;c=((i=i+Math.imul(d,ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(C,z),o=(o=Math.imul(C,q))+Math.imul(M,z)|0,i=Math.imul(M,q),n=n+Math.imul(O,V)|0,o=(o=o+Math.imul(O,K)|0)+Math.imul(R,V)|0,i=i+Math.imul(R,K)|0,n=n+Math.imul(x,G)|0,o=(o=o+Math.imul(x,X)|0)+Math.imul(T,G)|0,i=i+Math.imul(T,X)|0,n=n+Math.imul(k,Q)|0,o=(o=o+Math.imul(k,Y)|0)+Math.imul(_,Q)|0,i=i+Math.imul(_,Y)|0,n=n+Math.imul(w,$)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0,n=n+Math.imul(g,re)|0,o=(o=o+Math.imul(g,ne)|0)+Math.imul(v,re)|0,i=i+Math.imul(v,ne)|0,n=n+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,ae)|0;var ke=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(o=(o=o+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((i=i+Math.imul(d,ce)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(N,z),o=(o=Math.imul(N,q))+Math.imul(L,z)|0,i=Math.imul(L,q),n=n+Math.imul(C,V)|0,o=(o=o+Math.imul(C,K)|0)+Math.imul(M,V)|0,i=i+Math.imul(M,K)|0,n=n+Math.imul(O,G)|0,o=(o=o+Math.imul(O,X)|0)+Math.imul(R,G)|0,i=i+Math.imul(R,X)|0,n=n+Math.imul(x,Q)|0,o=(o=o+Math.imul(x,Y)|0)+Math.imul(T,Q)|0,i=i+Math.imul(T,Y)|0,n=n+Math.imul(k,$)|0,o=(o=o+Math.imul(k,ee)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,ee)|0,n=n+Math.imul(w,re)|0,o=(o=o+Math.imul(w,ne)|0)+Math.imul(A,re)|0,i=i+Math.imul(A,ne)|0,n=n+Math.imul(g,ie)|0,o=(o=o+Math.imul(g,ae)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,ae)|0,n=n+Math.imul(p,ue)|0,o=(o=o+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,i=i+Math.imul(y,ce)|0;var _e=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(o=(o=o+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((i=i+Math.imul(d,de)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(U,z),o=(o=Math.imul(U,q))+Math.imul(F,z)|0,i=Math.imul(F,q),n=n+Math.imul(N,V)|0,o=(o=o+Math.imul(N,K)|0)+Math.imul(L,V)|0,i=i+Math.imul(L,K)|0,n=n+Math.imul(C,G)|0,o=(o=o+Math.imul(C,X)|0)+Math.imul(M,G)|0,i=i+Math.imul(M,X)|0,n=n+Math.imul(O,Q)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,Y)|0,n=n+Math.imul(x,$)|0,o=(o=o+Math.imul(x,ee)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,ee)|0,n=n+Math.imul(k,re)|0,o=(o=o+Math.imul(k,ne)|0)+Math.imul(_,re)|0,i=i+Math.imul(_,ne)|0,n=n+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0,n=n+Math.imul(g,ue)|0,o=(o=o+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,i=i+Math.imul(v,ce)|0,n=n+Math.imul(p,fe)|0,o=(o=o+Math.imul(p,de)|0)+Math.imul(y,fe)|0,i=i+Math.imul(y,de)|0;var Ee=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(o=(o=o+Math.imul(f,ye)|0)+Math.imul(d,pe)|0))<<13)|0;c=((i=i+Math.imul(d,ye)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,V),o=(o=Math.imul(U,K))+Math.imul(F,V)|0,i=Math.imul(F,K),n=n+Math.imul(N,G)|0,o=(o=o+Math.imul(N,X)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,X)|0,n=n+Math.imul(C,Q)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(M,Q)|0,i=i+Math.imul(M,Y)|0,n=n+Math.imul(O,$)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(x,re)|0,o=(o=o+Math.imul(x,ne)|0)+Math.imul(T,re)|0,i=i+Math.imul(T,ne)|0,n=n+Math.imul(k,ie)|0,o=(o=o+Math.imul(k,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,n=n+Math.imul(w,ue)|0,o=(o=o+Math.imul(w,ce)|0)+Math.imul(A,ue)|0,i=i+Math.imul(A,ce)|0,n=n+Math.imul(g,fe)|0,o=(o=o+Math.imul(g,de)|0)+Math.imul(v,fe)|0,i=i+Math.imul(v,de)|0;var xe=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((i=i+Math.imul(y,ye)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(U,G),o=(o=Math.imul(U,X))+Math.imul(F,G)|0,i=Math.imul(F,X),n=n+Math.imul(N,Q)|0,o=(o=o+Math.imul(N,Y)|0)+Math.imul(L,Q)|0,i=i+Math.imul(L,Y)|0,n=n+Math.imul(C,$)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(M,$)|0,i=i+Math.imul(M,ee)|0,n=n+Math.imul(O,re)|0,o=(o=o+Math.imul(O,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(x,ie)|0,o=(o=o+Math.imul(x,ae)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,ae)|0,n=n+Math.imul(k,ue)|0,o=(o=o+Math.imul(k,ce)|0)+Math.imul(_,ue)|0,i=i+Math.imul(_,ce)|0,n=n+Math.imul(w,fe)|0,o=(o=o+Math.imul(w,de)|0)+Math.imul(A,fe)|0,i=i+Math.imul(A,de)|0;var Te=(c+(n=n+Math.imul(g,pe)|0)|0)+((8191&(o=(o=o+Math.imul(g,ye)|0)+Math.imul(v,pe)|0))<<13)|0;c=((i=i+Math.imul(v,ye)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,Q),o=(o=Math.imul(U,Y))+Math.imul(F,Q)|0,i=Math.imul(F,Y),n=n+Math.imul(N,$)|0,o=(o=o+Math.imul(N,ee)|0)+Math.imul(L,$)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(C,re)|0,o=(o=o+Math.imul(C,ne)|0)+Math.imul(M,re)|0,i=i+Math.imul(M,ne)|0,n=n+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,ae)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,ae)|0,n=n+Math.imul(x,ue)|0,o=(o=o+Math.imul(x,ce)|0)+Math.imul(T,ue)|0,i=i+Math.imul(T,ce)|0,n=n+Math.imul(k,fe)|0,o=(o=o+Math.imul(k,de)|0)+Math.imul(_,fe)|0,i=i+Math.imul(_,de)|0;var Pe=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,ye)|0)+Math.imul(A,pe)|0))<<13)|0;c=((i=i+Math.imul(A,ye)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,$),o=(o=Math.imul(U,ee))+Math.imul(F,$)|0,i=Math.imul(F,ee),n=n+Math.imul(N,re)|0,o=(o=o+Math.imul(N,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,ae)|0)+Math.imul(M,ie)|0,i=i+Math.imul(M,ae)|0,n=n+Math.imul(O,ue)|0,o=(o=o+Math.imul(O,ce)|0)+Math.imul(R,ue)|0,i=i+Math.imul(R,ce)|0,n=n+Math.imul(x,fe)|0,o=(o=o+Math.imul(x,de)|0)+Math.imul(T,fe)|0,i=i+Math.imul(T,de)|0;var Oe=(c+(n=n+Math.imul(k,pe)|0)|0)+((8191&(o=(o=o+Math.imul(k,ye)|0)+Math.imul(_,pe)|0))<<13)|0;c=((i=i+Math.imul(_,ye)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,re),o=(o=Math.imul(U,ne))+Math.imul(F,re)|0,i=Math.imul(F,ne),n=n+Math.imul(N,ie)|0,o=(o=o+Math.imul(N,ae)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,ae)|0,n=n+Math.imul(C,ue)|0,o=(o=o+Math.imul(C,ce)|0)+Math.imul(M,ue)|0,i=i+Math.imul(M,ce)|0,n=n+Math.imul(O,fe)|0,o=(o=o+Math.imul(O,de)|0)+Math.imul(R,fe)|0,i=i+Math.imul(R,de)|0;var Re=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(o=(o=o+Math.imul(x,ye)|0)+Math.imul(T,pe)|0))<<13)|0;c=((i=i+Math.imul(T,ye)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,ie),o=(o=Math.imul(U,ae))+Math.imul(F,ie)|0,i=Math.imul(F,ae),n=n+Math.imul(N,ue)|0,o=(o=o+Math.imul(N,ce)|0)+Math.imul(L,ue)|0,i=i+Math.imul(L,ce)|0,n=n+Math.imul(C,fe)|0,o=(o=o+Math.imul(C,de)|0)+Math.imul(M,fe)|0,i=i+Math.imul(M,de)|0;var Ie=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(o=(o=o+Math.imul(O,ye)|0)+Math.imul(R,pe)|0))<<13)|0;c=((i=i+Math.imul(R,ye)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,ue),o=(o=Math.imul(U,ce))+Math.imul(F,ue)|0,i=Math.imul(F,ce),n=n+Math.imul(N,fe)|0,o=(o=o+Math.imul(N,de)|0)+Math.imul(L,fe)|0,i=i+Math.imul(L,de)|0;var Ce=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,ye)|0)+Math.imul(M,pe)|0))<<13)|0;c=((i=i+Math.imul(M,ye)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(U,fe),o=(o=Math.imul(U,de))+Math.imul(F,fe)|0,i=Math.imul(F,de);var Me=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(o=(o=o+Math.imul(N,ye)|0)+Math.imul(L,pe)|0))<<13)|0;c=((i=i+Math.imul(L,ye)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863;var Be=(c+(n=Math.imul(U,pe))|0)+((8191&(o=(o=Math.imul(U,ye))+Math.imul(F,pe)|0))<<13)|0;return c=((i=Math.imul(F,ye))+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Ae,u[6]=Se,u[7]=ke,u[8]=_e,u[9]=Ee,u[10]=xe,u[11]=Te,u[12]=Pe,u[13]=Oe,u[14]=Re,u[15]=Ie,u[16]=Ce,u[17]=Me,u[18]=Be,0!==c&&(u[19]=c,r.length++),r};function p(e,t,r){return(new y).mulp(e,t,r)}function y(e,t){this.x=e,this.y=t}Math.imul||(h=d),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?h(this,e,t):n<63?d(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}r.words[i]=s,n=a,a=o}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},y.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},y.prototype.permute=function(e,t,r,n,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,t+=o/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>o}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,r=e%26,o=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=o);c--){var f=0|this.words[c];this.words[c]=l<<26-i|f>>>i,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,o=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var o=67108863^67108863>>>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},i.prototype.isubn=function(e){if(n("number"===typeof e),n(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>26)-(u/67108864|0),this.words[o+r]=67108863&i}for(;o>26,this.words[o+r]=67108863&i;if(0===s)return this.strip();for(n(-1===s),s=0,o=0;o>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,u=n.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var d=67108864*(0|n.words[o.length+f])+(0|n.words[o.length+f-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(o,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(o,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),o=e.andln(1),i=r.cmp(n);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,o=this.length-1;o>=0;o--)r=(t*r+(0|this.words[o]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var o=(0|this.words[r])+67108864*t;this.words[r]=o/e|0,t=o%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0===(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(f)),o.iushrn(1),a.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.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;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0===(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var o=t.cmp(r);if(o<0){var i=t;t=r,r=i}else if(0===o||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,o=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;r--){var n=0|this.words[r],o=0|e.words[r];if(n!==o){no&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new S(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},o(v,g),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),o=0;o>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&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,r=0;r>>=26,e.words[r]=o,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new b;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return m[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,o),d=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var y=h,m=0;0!==y.cmp(s);m++)y=y.redSqr();n(m=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var f=c>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===n&&0===l)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}u=26}return o},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new k(e)},o(k,S),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},17283:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,a){if("function"!==typeof n)throw new TypeError("The listener must be a function");var s=new o(n,i||e,a),u=r?r+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 a(e,t){0===--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,i=n.length,a=new Array(i);o{"use strict";var t,r="object"===typeof Reflect?Reflect:null,n=r&&"function"===typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"===typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!==e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"===typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}y(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"===typeof e.on&&y(e,"error",t,r)}(e,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var o,i,a,c;if(s(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),a=i[t]),void 0===a)a=i[t]=r,++e._eventsCount;else if("function"===typeof a?a=i[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=u(e))>0&&a.length>o&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=l.bind(n);return o.listener=r,n.wrapFn=o,o}function d(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"===typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"===typeof u)n(u,this,t);else{var c=u.length,l=p(u,c);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},41292:(e,t,r)=>{var n=r(74080).parse,o=r(27284),i=r(42594),a=r(22363),s=r(86494),u=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","servername","checkServerIdentity"],c=[239,187,191],l=262144,f=/^(cookie|authorization)$/i;function d(e,t){var r=d.CONNECTING,o=t&&t.headers,s=!1;Object.defineProperty(this,"readyState",{get:function(){return r}}),Object.defineProperty(this,"url",{get:function(){return e}});var y,m=this;function g(t){r!==d.CLOSED&&(r=d.CONNECTING,_("error",new h("error",{message:t})),S&&(e=S,S=null,s=!1),setTimeout((function(){r!==d.CONNECTING||m.connectionInProgress||(m.connectionInProgress=!0,k())}),m.reconnectInterval))}m.reconnectInterval=1e3,m.connectionInProgress=!1;var v="";o&&o["Last-Event-ID"]&&(v=o["Last-Event-ID"],delete o["Last-Event-ID"]);var b=!1,w="",A="",S=null;function k(){var p=n(e),w="https:"===p.protocol;if(p.headers={"Cache-Control":"no-cache",Accept:"text/event-stream"},v&&(p.headers["Last-Event-ID"]=v),o){var A=s?function(e){var t={};for(var r in e)f.test(r)||(t[r]=e[r]);return t}(o):o;for(var x in A){var T=A[x];T&&(p.headers[x]=T)}}if(p.rejectUnauthorized=!(t&&!t.rejectUnauthorized),t&&void 0!==t.createConnection&&(p.createConnection=t.createConnection),t&&t.proxy){var P=n(t.proxy);w="https:"===P.protocol,p.protocol=w?"https:":"http:",p.path=e,p.headers.Host=p.host,p.hostname=P.hostname,p.host=P.host,p.port=P.port}if(t&&t.https)for(var O in t.https)if(-1!==u.indexOf(O)){var R=t.https[O];void 0!==R&&(p[O]=R)}t&&void 0!==t.withCredentials&&(p.withCredentials=t.withCredentials),y=(w?i:a).request(p,(function(t){if(m.connectionInProgress=!1,500===t.statusCode||502===t.statusCode||503===t.statusCode||504===t.statusCode)return _("error",new h("error",{status:t.statusCode,message:t.statusMessage})),void g();if(301===t.statusCode||302===t.statusCode||307===t.statusCode){var n=t.headers.location;if(!n)return void _("error",new h("error",{status:t.statusCode,message:t.statusMessage}));var o=new URL(e).origin,i=new URL(n).origin;return s=o!==i,307===t.statusCode&&(S=e),e=n,void process.nextTick(k)}if(200!==t.statusCode)return _("error",new h("error",{status:t.statusCode,message:t.statusMessage})),m.close();var a,u;r=d.OPEN,t.on("close",(function(){t.removeAllListeners("close"),t.removeAllListeners("end"),g()})),t.on("end",(function(){t.removeAllListeners("close"),t.removeAllListeners("end"),g()})),_("open",new h("open"));var f=0,p=-1,y=0,v=0;t.on("data",(function(e){a?(e.length>a.length-v&&((y=2*a.length+e.length)>l&&(y=a.length+e.length+l),u=Buffer.alloc(y),a.copy(u,0,0,v),a=u),e.copy(a,v),v+=e.length):(function(e){return c.every((function(t,r){return e[r]===t}))}(a=e)&&(a=a.slice(c.length)),v=a.length);for(var t=0,r=v;t0&&(a=a.slice(t,v),v=a.length)}))})),y.on("error",(function(e){m.connectionInProgress=!1,g(e.message)})),y.setNoDelay&&y.setNoDelay(!0),y.end()}function _(){m.listeners(arguments[0]).length>0&&m.emit.apply(m,arguments)}function E(t,r,n,o){if(0===o){if(w.length>0){var i=A||"message";_(i,new p(i,{data:w.slice(0,-1),lastEventId:v,origin:new URL(e).origin})),w=""}A=void 0}else if(n>0){var a=n<0,s=0,u=t.slice(r,r+(a?o:n)).toString();r+=s=a?o:32!==t[r+n+1]?n+1:n+2;var c=o-s,l=t.slice(r,r+c).toString();if("data"===u)w+=l+"\n";else if("event"===u)A=l;else if("id"===u)v=l;else if("retry"===u){var f=parseInt(l,10);Number.isNaN(f)||(m.reconnectInterval=f)}}}k(),this._close=function(){r!==d.CLOSED&&(r=d.CLOSED,y.abort&&y.abort(),y.xhr&&y.xhr.abort&&y.xhr.abort())}}function h(e,t){if(Object.defineProperty(this,"type",{writable:!1,value:e,enumerable:!0}),t)for(var r in t)t.hasOwnProperty(r)&&Object.defineProperty(this,r,{writable:!1,value:t[r],enumerable:!0})}function p(e,t){for(var r in Object.defineProperty(this,"type",{writable:!1,value:e,enumerable:!0}),t)t.hasOwnProperty(r)&&Object.defineProperty(this,r,{writable:!1,value:t[r],enumerable:!0})}e.exports=d,s.inherits(d,o.EventEmitter),d.prototype.constructor=d,["open","error","message"].forEach((function(e){Object.defineProperty(d.prototype,"on"+e,{get:function(){var t=this.listeners(e)[0];return t?t._listener?t._listener:t:void 0},set:function(t){this.removeAllListeners(e),this.addEventListener(e,t)}})})),Object.defineProperty(d,"CONNECTING",{enumerable:!0,value:0}),Object.defineProperty(d,"OPEN",{enumerable:!0,value:1}),Object.defineProperty(d,"CLOSED",{enumerable:!0,value:2}),d.prototype.CONNECTING=0,d.prototype.OPEN=1,d.prototype.CLOSED=2,d.prototype.close=function(){this._close()},d.prototype.addEventListener=function(e,t){"function"===typeof t&&(t._listener=t,this.on(e,t))},d.prototype.dispatchEvent=function(e){if(!e.type)throw new Error("UNSPECIFIED_EVENT_TYPE_ERR");this.emit(e.type,e.detail)},d.prototype.removeEventListener=function(e,t){"function"===typeof t&&(t._listener=void 0,this.removeListener(e,t))}},51903:(e,t,r)=>{"use strict";var n=r(78799),o=Object.prototype.toString,i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=r),"[object Array]"===o.call(e)?function(e,t,r){for(var n=0,o=e.length;n{"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n{"use strict";var n=r(17724);e.exports=Function.prototype.bind||n},60002:(e,t,r)=>{"use strict";var n,o=r(29304),i=r(79820),a=r(1725),s=r(75077),u=r(62557),c=r(54902),l=r(63094),f=Function,d=function(e){try{return f('"use strict"; return ('+e+").constructor;")()}catch(t){}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch(N){h=null}var p=function(){throw new c},y=h?function(){try{return p}catch(e){try{return h(arguments,"callee").get}catch(t){return p}}}():p,m=r(72108)(),g=r(80951)(),v=Object.getPrototypeOf||(g?function(e){return e.__proto__}:null),b={},w="undefined"!==typeof Uint8Array&&v?v(Uint8Array):n,A={__proto__:null,"%AggregateError%":"undefined"===typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"===typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":m&&v?v([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":"undefined"===typeof Atomics?n:Atomics,"%BigInt%":"undefined"===typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"===typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"===typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"===typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"===typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"===typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"===typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":f,"%GeneratorFunction%":b,"%Int8Array%":"undefined"===typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"===typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"===typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":m&&v?v(v([][Symbol.iterator]())):n,"%JSON%":"object"===typeof JSON?JSON:n,"%Map%":"undefined"===typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!==typeof Map&&m&&v?v((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"===typeof Promise?n:Promise,"%Proxy%":"undefined"===typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":s,"%Reflect%":"undefined"===typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"===typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!==typeof Set&&m&&v?v((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"===typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":m&&v?v(""[Symbol.iterator]()):n,"%Symbol%":m?Symbol:n,"%SyntaxError%":u,"%ThrowTypeError%":y,"%TypedArray%":w,"%TypeError%":c,"%Uint8Array%":"undefined"===typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"===typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"===typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"===typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"===typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"===typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"===typeof WeakSet?n:WeakSet};if(v)try{null.error}catch(N){var S=v(v(N));A["%Error.prototype%"]=S}var k=function e(t){var r;if("%AsyncFunction%"===t)r=d("async function () {}");else if("%GeneratorFunction%"===t)r=d("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=d("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&v&&(r=v(o.prototype))}return A[t]=r,r},_={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},E=r(63864),x=r(34384),T=E.call(Function.call,Array.prototype.concat),P=E.call(Function.apply,Array.prototype.splice),O=E.call(Function.call,String.prototype.replace),R=E.call(Function.call,String.prototype.slice),I=E.call(Function.call,RegExp.prototype.exec),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,B=function(e,t){var r,n=e;if(x(_,n)&&(n="%"+(r=_[n])[0]+"%"),x(A,n)){var o=A[n];if(o===b&&(o=k(n)),"undefined"===typeof o&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new u("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!==typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!==typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===I(/^%?[^%]*%?$/,e))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=R(e,0,1),r=R(e,-1);if("%"===t&&"%"!==r)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new u("invalid intrinsic syntax, expected opening `%`");var n=[];return O(e,C,(function(e,t,r,o){n[n.length]=r?O(o,M,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",o=B("%"+n+"%",t),i=o.name,a=o.value,s=!1,l=o.alias;l&&(n=l[0],P(r,T([0,1],l)));for(var f=1,d=!0;f=r.length){var g=h(a,p);a=(d=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:a[p]}else d=x(a,p),a=a[p];d&&!s&&(A[i]=a)}}return a}},95558:(e,t,r)=>{"use strict";var n=r(60002)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(o){n=null}e.exports=n},12101:(e,t,r)=>{"use strict";var n=r(82090),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},80951:e=>{"use strict";var t={__proto__:null,foo:{}},r=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof r)}},72108:(e,t,r)=>{"use strict";var n="undefined"!==typeof Symbol&&Symbol,o=r(99534);e.exports=function(){return"function"===typeof n&&("function"===typeof Symbol&&("symbol"===typeof n("foo")&&("symbol"===typeof Symbol("bar")&&o())))}},99534:e=>{"use strict";e.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"===typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"===typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},64635:(e,t,r)=>{"use strict";var n=r(99534);e.exports=function(){return n()&&!!Symbol.toStringTag}},59238:(e,t,r)=>{"use strict";var n=r(59966).Buffer,o=r(73350).Transform;function i(e){o.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(56329)(i,o),i.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(o){n=o}r(n)},i.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)},i.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!==typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,o=0;this._blockOffset+e.length-o>=this._blockSize;){for(var i=this._blockOffset;i0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},i.prototype._update=function(){throw new Error("_update is not implemented")},i.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},i.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=i},73697:(e,t,r)=>{var n=t;n.utils=r(97643),n.common=r(12629),n.sha=r(52624),n.ripemd=r(1859),n.hmac=r(67355),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},12629:(e,t,r)=>{"use strict";var n=r(97643),o=r(75482);function i(){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=i,i.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var o=0;o>>24&255,n[o++]=e>>>16&255,n[o++]=e>>>8&255,n[o++]=255&e}else for(n[o++]=255&e,n[o++]=e>>>8&255,n[o++]=e>>>16&255,n[o++]=e>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,i=8;i{"use strict";var n=r(97643),o=r(75482);function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=i,i.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),o(e.length<=this.blockSize);for(var t=e.length;t{"use strict";var n=r(97643),o=r(12629),i=n.rotl32,a=n.sum32,s=n.sum32_3,u=n.sum32_4,c=o.BlockHash;function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.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 r=this.h[0],n=this.h[1],o=this.h[2],c=this.h[3],l=this.h[4],v=r,b=n,w=o,A=c,S=l,k=0;k<80;k++){var _=a(i(u(r,f(k,n,o,c),e[p[k]+t],d(k)),m[k]),l);r=l,l=c,c=i(o,10),o=n,n=_,_=a(i(u(v,f(79-k,b,w,A),e[y[k]+t],h(k)),g[k]),S),v=S,S=A,A=i(w,10),w=b,b=_}_=s(this.h[1],o,A),this.h[1]=s(this.h[2],c,S),this.h[2]=s(this.h[3],l,v),this.h[3]=s(this.h[4],r,b),this.h[4]=s(this.h[0],n,w),this.h[0]=_},l.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.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],y=[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],m=[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],g=[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]},52624:(e,t,r)=>{"use strict";t.sha1=r(52236),t.sha224=r(93291),t.sha256=r(83410),t.sha384=r(44282),t.sha512=r(12155)},52236:(e,t,r)=>{"use strict";var n=r(97643),o=r(12629),i=r(61510),a=n.rotl32,s=n.sum32,u=n.sum32_5,c=i.ft_1,l=o.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,l),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n{"use strict";var n=r(97643),o=r(83410);function i(){if(!(this instanceof i))return new i;o.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(i,o),e.exports=i,i.blockSize=512,i.outSize=224,i.hmacStrength=192,i.padLength=64,i.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},83410:(e,t,r)=>{"use strict";var n=r(97643),o=r(12629),i=r(61510),a=r(75482),s=n.sum32,u=n.sum32_4,c=n.sum32_5,l=i.ch32,f=i.maj32,d=i.s0_256,h=i.s1_256,p=i.g0_256,y=i.g1_256,m=o.BlockHash,g=[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 v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(v,m),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n{"use strict";var n=r(97643),o=r(12155);function i(){if(!(this instanceof i))return new i;o.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(i,o),e.exports=i,i.blockSize=1024,i.outSize=384,i.hmacStrength=192,i.padLength=128,i.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},12155:(e,t,r)=>{"use strict";var n=r(97643),o=r(12629),i=r(75482),a=n.rotr64_hi,s=n.rotr64_lo,u=n.shr64_hi,c=n.shr64_lo,l=n.sum64,f=n.sum64_hi,d=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,y=n.sum64_5_hi,m=n.sum64_5_lo,g=o.BlockHash,v=[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 b(){if(!(this instanceof b))return new b;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function w(e,t,r,n,o){var i=e&r^~e&o;return i<0&&(i+=4294967296),i}function A(e,t,r,n,o,i){var a=t&n^~t&i;return a<0&&(a+=4294967296),a}function S(e,t,r,n,o){var i=e&r^e&o^r&o;return i<0&&(i+=4294967296),i}function k(e,t,r,n,o,i){var a=t&n^t&i^n&i;return a<0&&(a+=4294967296),a}function _(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function E(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function T(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function P(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function O(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function R(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}function I(e,t){var r=s(e,t,19)^s(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(b,g),e.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n{"use strict";var n=r(97643).rotr32;function o(e,t,r){return e&t^~e&r}function i(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?o(t,r,n):1===e||3===e?a(t,r,n):2===e?i(t,r,n):void 0},t.ch32=o,t.maj32=i,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},97643:(e,t,r)=>{"use strict";var n=r(75482),o=r(56329);function i(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function a(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=o,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"===typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e),o=0;o>6|192,r[n++]=63&a|128):i(e,o)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++o)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(o=0;o>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,o=0;n>>24,r[o+1]=i>>>16&255,r[o+2]=i>>>8&255,r[o+3]=255&i):(r[o+3]=i>>>24,r[o+2]=i>>>16&255,r[o+1]=i>>>8&255,r[o]=255&i)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,o){return e+t+r+n+o>>>0},t.sum64=function(e,t,r,n){var o=e[t],i=n+e[t+1]>>>0,a=(i>>0,e[t+1]=i},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,o,i,a,s){var u=0,c=t;return u+=(c=c+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,o,i,a,s){return t+n+i+s>>>0},t.sum64_5_hi=function(e,t,r,n,o,i,a,s,u,c){var l=0,f=t;return l+=(f=f+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,o,i,a,s,u,c){return t+n+i+s+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},34384:(e,t,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(63864);e.exports=i.call(n,o)},31172:(e,t,r)=>{"use strict";var n=r(73697),o=r(49848),i=r(75482);function a(e){if(!(this instanceof a))return new a(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=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),n=o.toArray(e.pers,e.persEnc||"hex");i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(n=r,r=t,t=null),r&&(r=o.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length{"use strict";var n=r(53763),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(e){return n.isMemo(e)?a:s[e.$$typeof]||o}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=a;var c=Object.defineProperty,l=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,r,n){if("string"!==typeof r){if(p){var o=h(r);o&&o!==p&&e(t,o,n)}var a=l(r);f&&(a=a.concat(f(r)));for(var s=u(t),y=u(r),m=0;m{"use strict";var r="function"===typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,a=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,v=r?Symbol.for("react.fundamental"):60117,b=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function A(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case l:case f:case i:case s:case a:case h:return e;default:switch(e=e&&e.$$typeof){case c:case d:case m:case y:case u:return e;default:return t}}case o:return t}}}function S(e){return A(e)===f}t.AsyncMode=l,t.ConcurrentMode=f,t.ContextConsumer=c,t.ContextProvider=u,t.Element=n,t.ForwardRef=d,t.Fragment=i,t.Lazy=m,t.Memo=y,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=h,t.isAsyncMode=function(e){return S(e)||A(e)===l},t.isConcurrentMode=S,t.isContextConsumer=function(e){return A(e)===c},t.isContextProvider=function(e){return A(e)===u},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return A(e)===d},t.isFragment=function(e){return A(e)===i},t.isLazy=function(e){return A(e)===m},t.isMemo=function(e){return A(e)===y},t.isPortal=function(e){return A(e)===o},t.isProfiler=function(e){return A(e)===s},t.isStrictMode=function(e){return A(e)===a},t.isSuspense=function(e){return A(e)===h},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===i||e===f||e===s||e===a||e===h||e===p||"object"===typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===y||e.$$typeof===u||e.$$typeof===c||e.$$typeof===d||e.$$typeof===v||e.$$typeof===b||e.$$typeof===w||e.$$typeof===g)},t.typeOf=A},53763:(e,t,r)=>{"use strict";e.exports=r(54983)},42594:(e,t,r)=>{var n=r(22363),o=r(74080),i=e.exports;for(var a in n)n.hasOwnProperty(a)&&(i[a]=n[a]);function s(e){if("string"===typeof e&&(e=o.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}i.request=function(e,t){return e=s(e),n.request.call(this,e,t)},i.get=function(e,t){return e=s(e),n.get.call(this,e,t)}},6900:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<>1,l=-7,f=r?o-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=d,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=d,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+h]=255&s,h+=p,s/=256,o-=8);for(a=a<0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*y}},56329: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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},57386:e=>{e.exports=function(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o1?t-1:0),n=1;n{e(...r,((e,r)=>{e?n(e):t(r)}))}))}(t.bind(e),...n)}}},68317:(e,t,r)=>{"use strict";var n=r(64635)(),o=r(12028)("Object.prototype.toString"),i=function(e){return!(n&&e&&"object"===typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===o(e)},a=function(e){return!!i(e)||null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Array]"!==o(e)&&"[object Function]"===o(e.callee)},s=function(){return i(arguments)}();i.isLegacyArguments=a,e.exports=s?i:a},78799:e=>{"use strict";var t,r,n=Function.prototype.toString,o="object"===typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"===typeof o&&"function"===typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,t)}catch(h){h!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(e){try{var t=n.call(e);return i.test(t)}catch(r){return!1}},s=function(e){try{return!a(e)&&(n.call(e),!0)}catch(t){return!1}},u=Object.prototype.toString,c="function"===typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"===typeof document){var d=document.all;u.call(d)===u.call(document.all)&&(f=function(e){if((l||!e)&&("undefined"===typeof e||"object"===typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(r){}return!1})}e.exports=o?function(e){if(f(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;try{o(e,null,t)}catch(n){if(n!==r)return!1}return!a(e)&&s(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;if(c)return s(e);if(a(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},71583:(e,t,r)=>{"use strict";var n,o=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(64635)(),u=Object.getPrototypeOf;e.exports=function(e){if("function"!==typeof e)return!1;if(a.test(i.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===o.call(e);if(!u)return!1;if("undefined"===typeof n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&u(t)}return u(e)===n}},9495:e=>{e.exports=function(e){if("string"!==typeof e)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof e+", while checking isHexPrefixed.");return"0x"===e.slice(0,2)}},68724:e=>{"use strict";e.exports=function(e){return e!==e}},22384:(e,t,r)=>{"use strict";var n=r(61712),o=r(11779),i=r(68724),a=r(77057),s=r(66607),u=n(a(),Number);o(u,{getPolyfill:a,implementation:i,shim:s}),e.exports=u},77057:(e,t,r)=>{"use strict";var n=r(68724);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},66607:(e,t,r)=>{"use strict";var n=r(11779),o=r(77057);e.exports=function(){var e=o();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},59849:(e,t,r)=>{"use strict";var n=r(58004);e.exports=function(e){return!!n(e)}},23861:(e,t,r)=>{"use strict";const n=r(55092).v4,o=r(8656),i=function(e,t){if(!(this instanceof i))return new i(e,t);t||(t={}),this.options={reviver:"undefined"!==typeof t.reviver?t.reviver:null,replacer:"undefined"!==typeof t.replacer?t.replacer:null,generator:"undefined"!==typeof t.generator?t.generator:function(){return n()},version:"undefined"!==typeof t.version?t.version:2,notificationIdNull:"boolean"===typeof t.notificationIdNull&&t.notificationIdNull},this.callServer=e};e.exports=i,i.prototype.request=function(e,t,r,n){const i=this;let a=null;const s=Array.isArray(e)&&"function"===typeof t;if(1===this.options.version&&s)throw new TypeError("JSON-RPC 1.0 does not support batching");if(s||!s&&e&&"object"===typeof e&&"function"===typeof t)n=t,a=e;else{"function"===typeof r&&(n=r,r=void 0);const i="function"===typeof n;try{a=o(e,t,r,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(c){if(i)return n(c);throw c}if(!i)return a}let u;try{u=JSON.stringify(a,this.options.replacer)}catch(c){return n(c)}return this.callServer(u,(function(e,t){i._parseResponse(e,t,n)})),a},i.prototype._parseResponse=function(e,t,r){if(e)return void r(e);if(!t)return r();let n;try{n=JSON.parse(t,this.options.reviver)}catch(e){return r(e)}if(3===r.length){if(Array.isArray(n)){const e=function(e){return"undefined"!==typeof e.error},t=function(t){return!e(t)};return r(null,n.filter(e),n.filter(t))}return r(null,n.error,n.result)}r(null,n)}},8656:(e,t,r)=>{"use strict";const n=r(55092).v4;e.exports=function(e,t,r,o){if("string"!==typeof e)throw new TypeError(e+" must be a string");const i="number"===typeof(o=o||{}).version?o.version:2;if(1!==i&&2!==i)throw new TypeError(i+" must be 1 or 2");const a={method:e};if(2===i&&(a.jsonrpc="2.0"),t){if("object"!==typeof t&&!Array.isArray(t))throw new TypeError(t+" must be an object, array or omitted");a.params=t}if("undefined"===typeof r){const e="function"===typeof o.generator?o.generator:function(){return n()};a.id=e(a,o)}else 2===i&&null===r?o.notificationIdNull&&(a.id=null):a.id=r;return a}},65813:(module,exports,__webpack_require__)=>{var __WEBPACK_AMD_DEFINE_RESULT__;(function(){"use strict";var ERROR="input is invalid type",WINDOW="object"===typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"===typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"===typeof process&&process.versions&&process.versions.node;NODE_JS?root=__webpack_require__.g:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&module.exports,AMD=__webpack_require__.amdO,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e,t){return function(r){return new Sha256(t,!0).update(r)[e]()}},createMethod=function(e){var t=createOutputMethod("hex",e);NODE_JS&&(t=nodeWrap(t,e)),t.create=function(){return new Sha256(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r>6,a[u++]=128|63&i):i<55296||i>=57344?(a[u++]=224|i>>12,a[u++]=128|i>>6&63,a[u++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++n)),a[u++]=240|i>>18,a[u++]=128|i>>12&63,a[u++]=128|i>>6&63,a[u++]=128|63&i);e=a}else{if("object"!==o)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(e)))throw new Error(ERROR)}e.length>64&&(e=new Sha256(t,!0).update(e).array());var c=[],l=[];for(n=0;n<64;++n){var f=e[n]||0;c[n]=92^f,l[n]=54^f}Sha256.call(this,t,r),this.update(l),this.oKeyPad=c,this.inner=!0,this.sharedMemory=r}Sha256.prototype.update=function(e){if(!this.finalized){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(e)))throw new Error(ERROR);t=!0}for(var n,o,i=0,a=e.length,s=this.blocks;i>2]|=e[i]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(s[o>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=64?(this.block=s[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var e,t,r,n,o,i,a,s,u,c=this.h0,l=this.h1,f=this.h2,d=this.h3,h=this.h4,p=this.h5,y=this.h6,m=this.h7,g=this.blocks;for(e=16;e<64;++e)t=((o=g[e-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,r=((o=g[e-2])>>>17|o<<15)^(o>>>19|o<<13)^o>>>10,g[e]=g[e-16]+t+g[e-7]+r|0;for(u=l&f,e=0;e<64;e+=4)this.first?(this.is224?(i=300032,m=(o=g[0]-1413257819)-150054599|0,d=o+24177077|0):(i=704751109,m=(o=g[0]-210244248)-1521486534|0,d=o+143694565|0),this.first=!1):(t=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),n=(i=c&l)^c&f^u,m=d+(o=m+(r=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&p^~h&y)+K[e]+g[e])|0,d=o+(t+n)|0),t=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),n=(a=d&c)^d&l^i,y=f+(o=y+(r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&h^~m&p)+K[e+1]+g[e+1])|0,t=((f=o+(t+n)|0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),n=(s=f&d)^f&c^a,p=l+(o=p+(r=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&m^~y&h)+K[e+2]+g[e+2])|0,t=((l=o+(t+n)|0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),n=(u=l&f)^l&d^s,h=c+(o=h+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&y^~p&m)+K[e+3]+g[e+3])|0,c=o+(t+n)|0;this.h0=this.h0+c|0,this.h1=this.h1+l|0,this.h2=this.h2+f|0,this.h3=this.h3+d|0,this.h4=this.h4+h|0,this.h5=this.h5+p|0,this.h6=this.h6+y|0,this.h7=this.h7+m|0},Sha256.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7,u=HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a];return this.is224||(u+=HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]),u},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7,u=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o,i>>24&255,i>>16&255,i>>8&255,255&i,a>>24&255,a>>16&255,a>>8&255,255&a];return this.is224||u.push(s>>24&255,s>>16&255,s>>8&255,255&s),u},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()},32161:(e,t,r)=>{var n;!function(){"use strict";var o="input is invalid type",i="object"===typeof window,a=i?window:{};a.JS_SHA3_NO_WINDOW&&(i=!1);var s=!i&&"object"===typeof self;!a.JS_SHA3_NO_NODE_JS&&"object"===typeof process&&process.versions&&process.versions.node?a=r.g:s&&(a=self);var u=!a.JS_SHA3_NO_COMMON_JS&&e.exports,c=r.amdO,l=!a.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,f="0123456789abcdef".split(""),d=[4,1024,262144,67108864],h=[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],y=[224,256,384,512],m=[128,256],g=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};!a.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!a.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 b=function(e,t,r){return function(n){return new B(e,t,e).update(n)[r]()}},w=function(e,t,r){return function(n,o){return new B(e,t,o).update(n)[r]()}},A=function(e,t,r){return function(t,n,o,i){return x["cshake"+e].update(t,n,o,i)[r]()}},S=function(e,t,r){return function(t,n,o,i){return x["kmac"+e].update(t,n,o,i)[r]()}},k=function(e,t,r,n){for(var o=0;o>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function N(e,t,r){B.call(this,e,t,r)}B.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(o);if(null===e)throw new Error(o);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!l||!ArrayBuffer.isView(e)))throw new Error(o);t=!0}for(var n,i,a=this.blocks,s=this.byteCount,u=e.length,c=this.blockCount,f=0,d=this.s;f>2]|=e[f]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(a[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=s){for(this.start=n-s,this.block=a[c],n=0;n>=8);r>0;)o.unshift(r),r=255&(e>>=8),++n;return t?o.push(n):o.unshift(n),this.update(o),o.length},B.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(o);if(null===e)throw new Error(o);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!l||!ArrayBuffer.isView(e)))throw new Error(o);t=!0}var n=0,i=e.length;if(t)n=i;else for(var a=0;a=57344?n+=3:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++a)),n+=4)}return n+=this.encode(8*n),this.update(e),n},B.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+f[15&e]+f[e>>12&15]+f[e>>8&15]+f[e>>20&15]+f[e>>16&15]+f[e>>28&15]+f[e>>24&15];a%t===0&&(L(r),i=0)}return o&&(e=r[i],s+=f[e>>4&15]+f[15&e],o>1&&(s+=f[e>>12&15]+f[e>>8&15]),o>2&&(s+=f[e>>20&15]+f[e>>16&15])),s},B.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,a=0,s=this.outputBits>>3;e=o?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);a>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%r===0&&L(n)}return i&&(e=s<<2,t=n[a],u[e]=255&t,i>1&&(u[e+1]=t>>8&255),i>2&&(u[e+2]=t>>16&255)),u},N.prototype=new B,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)};var L=function(e){var t,r,n,o,i,a,s,u,c,l,f,d,h,y,m,g,v,b,w,A,S,k,_,E,x,T,P,O,R,I,C,M,B,N,L,j,U,F,D,z,q,H,V,K,W,G,X,Z,Q,Y,J,$,ee,te,re,ne,oe,ie,ae,se,ue,ce,le;for(n=0;n<48;n+=2)o=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],a=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],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=o^(u<<1|c>>>31),r=i^(c<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(l<<1|f>>>31),r=s^(f<<1|l>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(d<<1|h>>>31),r=c^(h<<1|d>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=l^(o<<1|i>>>31),r=f^(i<<1|o>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,y=e[0],m=e[1],G=e[11]<<4|e[10]>>>28,X=e[10]<<4|e[11]>>>28,O=e[20]<<3|e[21]>>>29,R=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,N=e[2]<<1|e[3]>>>31,L=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,Q=e[23]<<10|e[22]>>>22,I=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,re=e[4]<<30|e[5]>>>2,j=e[14]<<6|e[15]>>>26,U=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,M=e[45]<<29|e[44]>>>3,B=e[44]<<29|e[45]>>>3,E=e[6]<<28|e[7]>>>4,x=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,oe=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,D=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,S=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,K=e[8]<<27|e[9]>>>5,W=e[9]<<27|e[8]>>>5,T=e[18]<<20|e[19]>>>12,P=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,z=e[38]<<8|e[39]>>>24,q=e[39]<<8|e[38]>>>24,k=e[48]<<14|e[49]>>>18,_=e[49]<<14|e[48]>>>18,e[0]=y^~g&b,e[1]=m^~v&w,e[10]=E^~T&O,e[11]=x^~P&R,e[20]=N^~j&F,e[21]=L^~U&D,e[30]=K^~G&Z,e[31]=W^~X&Q,e[40]=te^~ne&ie,e[41]=re^~oe&ae,e[2]=g^~b&A,e[3]=v^~w&S,e[12]=T^~O&I,e[13]=P^~R&C,e[22]=j^~F&z,e[23]=U^~D&q,e[32]=G^~Z&Y,e[33]=X^~Q&J,e[42]=ne^~ie&se,e[43]=oe^~ae&ue,e[4]=b^~A&k,e[5]=w^~S&_,e[14]=O^~I&M,e[15]=R^~C&B,e[24]=F^~z&H,e[25]=D^~q&V,e[34]=Z^~Y&$,e[35]=Q^~J&ee,e[44]=ie^~se&ce,e[45]=ae^~ue&le,e[6]=A^~k&y,e[7]=S^~_&m,e[16]=I^~M&E,e[17]=C^~B&x,e[26]=z^~H&N,e[27]=q^~V&L,e[36]=Y^~$&K,e[37]=J^~ee&W,e[46]=se^~ce&te,e[47]=ue^~le&re,e[8]=k^~y&g,e[9]=_^~m&v,e[18]=M^~E&T,e[19]=B^~x&P,e[28]=H^~N&j,e[29]=V^~L&U,e[38]=$^~K&G,e[39]=ee^~W&X,e[48]=ce^~te&ne,e[49]=le^~re&oe,e[0]^=p[n],e[1]^=p[n+1]};if(u)e.exports=x;else{for(P=0;P{e.exports=r(87597)(r(5890))},87597:(e,t,r)=>{const n=r(22923),o=r(66271);e.exports=function(e){const t=n(e),r=o(e);return function(e,n){switch("string"===typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,n);case"keccak256":return new t(1088,512,null,256,n);case"keccak384":return new t(832,768,null,384,n);case"keccak512":return new t(576,1024,null,512,n);case"sha3-224":return new t(1152,448,6,224,n);case"sha3-256":return new t(1088,512,6,256,n);case"sha3-384":return new t(832,768,6,384,n);case"sha3-512":return new t(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+e)}}}},22923:(e,t,r)=>{const{Transform:n}=r(73350);e.exports=e=>class t extends n{constructor(t,r,n,o,i){super(i),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=o,this._options=i,this._state=new e,this._state.initialize(t,r),this._finalized=!1}_transform(e,t,r){let n=null;try{this.update(e,t)}catch(o){n=o}r(n)}_flush(e){let t=null;try{this.push(this.digest())}catch(r){t=r}e(t)}update(e,t){if(!Buffer.isBuffer(e)&&"string"!==typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(e)||(e=Buffer.from(e,t)),this._state.absorb(e),this}digest(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}},66271:(e,t,r)=>{const{Transform:n}=r(73350);e.exports=e=>class t extends n{constructor(t,r,n,o){super(o),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._options=o,this._state=new e,this._state.initialize(t,r),this._finalized=!1}_transform(e,t,r){let n=null;try{this.update(e,t)}catch(o){n=o}r(n)}_flush(){}_read(e){this.push(this.squeeze(e))}update(e,t){if(!Buffer.isBuffer(e)&&"string"!==typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(e)||(e=Buffer.from(e,t)),this._state.absorb(e),this}squeeze(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}},80127:(e,t)=>{const r=[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];t.p1600=function(e){for(let t=0;t<24;++t){const n=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],s=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],d=e[9]^e[19]^e[29]^e[39]^e[49];let h=f^(i<<1|a>>>31),p=d^(a<<1|i>>>31);const y=e[0]^h,m=e[1]^p,g=e[10]^h,v=e[11]^p,b=e[20]^h,w=e[21]^p,A=e[30]^h,S=e[31]^p,k=e[40]^h,_=e[41]^p;h=n^(s<<1|u>>>31),p=o^(u<<1|s>>>31);const E=e[2]^h,x=e[3]^p,T=e[12]^h,P=e[13]^p,O=e[22]^h,R=e[23]^p,I=e[32]^h,C=e[33]^p,M=e[42]^h,B=e[43]^p;h=i^(c<<1|l>>>31),p=a^(l<<1|c>>>31);const N=e[4]^h,L=e[5]^p,j=e[14]^h,U=e[15]^p,F=e[24]^h,D=e[25]^p,z=e[34]^h,q=e[35]^p,H=e[44]^h,V=e[45]^p;h=s^(f<<1|d>>>31),p=u^(d<<1|f>>>31);const K=e[6]^h,W=e[7]^p,G=e[16]^h,X=e[17]^p,Z=e[26]^h,Q=e[27]^p,Y=e[36]^h,J=e[37]^p,$=e[46]^h,ee=e[47]^p;h=c^(n<<1|o>>>31),p=l^(o<<1|n>>>31);const te=e[8]^h,re=e[9]^p,ne=e[18]^h,oe=e[19]^p,ie=e[28]^h,ae=e[29]^p,se=e[38]^h,ue=e[39]^p,ce=e[48]^h,le=e[49]^p,fe=y,de=m,he=v<<4|g>>>28,pe=g<<4|v>>>28,ye=b<<3|w>>>29,me=w<<3|b>>>29,ge=S<<9|A>>>23,ve=A<<9|S>>>23,be=k<<18|_>>>14,we=_<<18|k>>>14,Ae=E<<1|x>>>31,Se=x<<1|E>>>31,ke=P<<12|T>>>20,_e=T<<12|P>>>20,Ee=O<<10|R>>>22,xe=R<<10|O>>>22,Te=C<<13|I>>>19,Pe=I<<13|C>>>19,Oe=M<<2|B>>>30,Re=B<<2|M>>>30,Ie=L<<30|N>>>2,Ce=N<<30|L>>>2,Me=j<<6|U>>>26,Be=U<<6|j>>>26,Ne=D<<11|F>>>21,Le=F<<11|D>>>21,je=z<<15|q>>>17,Ue=q<<15|z>>>17,Fe=V<<29|H>>>3,De=H<<29|V>>>3,ze=K<<28|W>>>4,qe=W<<28|K>>>4,He=X<<23|G>>>9,Ve=G<<23|X>>>9,Ke=Z<<25|Q>>>7,We=Q<<25|Z>>>7,Ge=Y<<21|J>>>11,Xe=J<<21|Y>>>11,Ze=ee<<24|$>>>8,Qe=$<<24|ee>>>8,Ye=te<<27|re>>>5,Je=re<<27|te>>>5,$e=ne<<20|oe>>>12,et=oe<<20|ne>>>12,tt=ae<<7|ie>>>25,rt=ie<<7|ae>>>25,nt=se<<8|ue>>>24,ot=ue<<8|se>>>24,it=ce<<14|le>>>18,at=le<<14|ce>>>18;e[0]=fe^~ke&Ne,e[1]=de^~_e&Le,e[10]=ze^~$e&ye,e[11]=qe^~et&me,e[20]=Ae^~Me&Ke,e[21]=Se^~Be&We,e[30]=Ye^~he&Ee,e[31]=Je^~pe&xe,e[40]=Ie^~He&tt,e[41]=Ce^~Ve&rt,e[2]=ke^~Ne&Ge,e[3]=_e^~Le&Xe,e[12]=$e^~ye&Te,e[13]=et^~me&Pe,e[22]=Me^~Ke&nt,e[23]=Be^~We&ot,e[32]=he^~Ee&je,e[33]=pe^~xe&Ue,e[42]=He^~tt&ge,e[43]=Ve^~rt&ve,e[4]=Ne^~Ge&it,e[5]=Le^~Xe&at,e[14]=ye^~Te&Fe,e[15]=me^~Pe&De,e[24]=Ke^~nt&be,e[25]=We^~ot&we,e[34]=Ee^~je&Ze,e[35]=xe^~Ue&Qe,e[44]=tt^~ge&Oe,e[45]=rt^~ve&Re,e[6]=Ge^~it&fe,e[7]=Xe^~at&de,e[16]=Te^~Fe&ze,e[17]=Pe^~De&qe,e[26]=nt^~be&Ae,e[27]=ot^~we&Se,e[36]=je^~Ze&Ye,e[37]=Ue^~Qe&Je,e[46]=ge^~Oe&Ie,e[47]=ve^~Re&Ce,e[8]=it^~fe&ke,e[9]=at^~de&_e,e[18]=Fe^~ze&$e,e[19]=De^~qe&et,e[28]=be^~Ae&Me,e[29]=we^~Se&Be,e[38]=Ze^~Ye&he,e[39]=Qe^~Je&pe,e[48]=Oe^~Ie&He,e[49]=Re^~Ce&Ve,e[0]^=r[2*t],e[1]^=r[2*t+1]}}},5890:(e,t,r)=>{const n=r(80127);function o(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}o.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},o.prototype.absorb=function(e){for(let t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return t},o.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=o},41237:(e,t,r)=>{"use strict";var n=r(56329),o=r(59238),i=r(59966).Buffer,a=new Array(16);function s(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(e,t){return e<>>32-t}function c(e,t,r,n,o,i,a){return u(e+(t&r|~t&n)+o+i|0,a)+t|0}function l(e,t,r,n,o,i,a){return u(e+(t&n|r&~n)+o+i|0,a)+t|0}function f(e,t,r,n,o,i,a){return u(e+(t^r^n)+o+i|0,a)+t|0}function d(e,t,r,n,o,i,a){return u(e+(r^(t|~n))+o+i|0,a)+t|0}n(s,o),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,o=this._c,i=this._d;r=c(r,n,o,i,e[0],3614090360,7),i=c(i,r,n,o,e[1],3905402710,12),o=c(o,i,r,n,e[2],606105819,17),n=c(n,o,i,r,e[3],3250441966,22),r=c(r,n,o,i,e[4],4118548399,7),i=c(i,r,n,o,e[5],1200080426,12),o=c(o,i,r,n,e[6],2821735955,17),n=c(n,o,i,r,e[7],4249261313,22),r=c(r,n,o,i,e[8],1770035416,7),i=c(i,r,n,o,e[9],2336552879,12),o=c(o,i,r,n,e[10],4294925233,17),n=c(n,o,i,r,e[11],2304563134,22),r=c(r,n,o,i,e[12],1804603682,7),i=c(i,r,n,o,e[13],4254626195,12),o=c(o,i,r,n,e[14],2792965006,17),r=l(r,n=c(n,o,i,r,e[15],1236535329,22),o,i,e[1],4129170786,5),i=l(i,r,n,o,e[6],3225465664,9),o=l(o,i,r,n,e[11],643717713,14),n=l(n,o,i,r,e[0],3921069994,20),r=l(r,n,o,i,e[5],3593408605,5),i=l(i,r,n,o,e[10],38016083,9),o=l(o,i,r,n,e[15],3634488961,14),n=l(n,o,i,r,e[4],3889429448,20),r=l(r,n,o,i,e[9],568446438,5),i=l(i,r,n,o,e[14],3275163606,9),o=l(o,i,r,n,e[3],4107603335,14),n=l(n,o,i,r,e[8],1163531501,20),r=l(r,n,o,i,e[13],2850285829,5),i=l(i,r,n,o,e[2],4243563512,9),o=l(o,i,r,n,e[7],1735328473,14),r=f(r,n=l(n,o,i,r,e[12],2368359562,20),o,i,e[5],4294588738,4),i=f(i,r,n,o,e[8],2272392833,11),o=f(o,i,r,n,e[11],1839030562,16),n=f(n,o,i,r,e[14],4259657740,23),r=f(r,n,o,i,e[1],2763975236,4),i=f(i,r,n,o,e[4],1272893353,11),o=f(o,i,r,n,e[7],4139469664,16),n=f(n,o,i,r,e[10],3200236656,23),r=f(r,n,o,i,e[13],681279174,4),i=f(i,r,n,o,e[0],3936430074,11),o=f(o,i,r,n,e[3],3572445317,16),n=f(n,o,i,r,e[6],76029189,23),r=f(r,n,o,i,e[9],3654602809,4),i=f(i,r,n,o,e[12],3873151461,11),o=f(o,i,r,n,e[15],530742520,16),r=d(r,n=f(n,o,i,r,e[2],3299628645,23),o,i,e[0],4096336452,6),i=d(i,r,n,o,e[7],1126891415,10),o=d(o,i,r,n,e[14],2878612391,15),n=d(n,o,i,r,e[5],4237533241,21),r=d(r,n,o,i,e[12],1700485571,6),i=d(i,r,n,o,e[3],2399980690,10),o=d(o,i,r,n,e[10],4293915773,15),n=d(n,o,i,r,e[1],2240044497,21),r=d(r,n,o,i,e[8],1873313359,6),i=d(i,r,n,o,e[15],4264355552,10),o=d(o,i,r,n,e[6],2734768916,15),n=d(n,o,i,r,e[13],1309151649,21),r=d(r,n,o,i,e[4],4149444226,6),i=d(i,r,n,o,e[11],3174756917,10),o=d(o,i,r,n,e[2],718787259,15),n=d(n,o,i,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+o|0,this._d=this._d+i|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=i.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},75482:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},49848:(e,t)=>{"use strict";var r=t;function n(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r>8,a=255&o;i?r.push(i,a):r.push(a)}return r},r.zero2=n,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}},54273:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a=r(26382).Buffer}catch(_){}function s(e,t,r){for(var n=0,o=Math.min(e.length,r),i=t;i=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(e,t,r,n){for(var o=0,i=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return o}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&o++,16===t?this._parseHex(e,o):this._parseBase(e,t,o),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initNumber=function(e,t,r){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):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("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 o=0;o=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(o=0,i=0;o>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)o=s(e,r,r+6),this.words[n]|=o<>>26-i&4194303,(i+=24)>=26&&(i-=26,n++);r+6!==t&&(o=s(e,t,r+6),this.words[n]|=o<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=t)n++;n--,o=o/t|0;for(var i=e.length-r,a=i%n,s=Math.min(i,i-a)+r,c=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","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"],l=[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],f=[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 d(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,f=67108863&u,d=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=d;h++){var p=c-h|0;l+=(a=(o=0|e.words[p])*(i=0|t.words[h])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var o=0,i=0,a=0;a>>24-o&16777215)||a!==this.length-1?c[6-u.length]+u+r:u+r,(o+=2)>=26&&(o-=26,a--)}for(0!==i&&(r=i.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=l[e],h=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?y+r:c[d-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return n("undefined"!==typeof a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){var o=this.byteLength(),i=r||Math.max(1,o);n(o<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(i),l=this.clone();if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var o=0;o0&&(this.words[o]=~this.words[o]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,o=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.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 r,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,h=0|a[1],p=8191&h,y=h>>>13,m=0|a[2],g=8191&m,v=m>>>13,b=0|a[3],w=8191&b,A=b>>>13,S=0|a[4],k=8191&S,_=S>>>13,E=0|a[5],x=8191&E,T=E>>>13,P=0|a[6],O=8191&P,R=P>>>13,I=0|a[7],C=8191&I,M=I>>>13,B=0|a[8],N=8191&B,L=B>>>13,j=0|a[9],U=8191&j,F=j>>>13,D=0|s[0],z=8191&D,q=D>>>13,H=0|s[1],V=8191&H,K=H>>>13,W=0|s[2],G=8191&W,X=W>>>13,Z=0|s[3],Q=8191&Z,Y=Z>>>13,J=0|s[4],$=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ne=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,de=le>>>13,he=0|s[9],pe=8191&he,ye=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(n=Math.imul(f,z))|0)+((8191&(o=(o=Math.imul(f,q))+Math.imul(d,z)|0))<<13)|0;c=((i=Math.imul(d,q))+(o>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,z),o=(o=Math.imul(p,q))+Math.imul(y,z)|0,i=Math.imul(y,q);var ge=(c+(n=n+Math.imul(f,V)|0)|0)+((8191&(o=(o=o+Math.imul(f,K)|0)+Math.imul(d,V)|0))<<13)|0;c=((i=i+Math.imul(d,K)|0)+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,z),o=(o=Math.imul(g,q))+Math.imul(v,z)|0,i=Math.imul(v,q),n=n+Math.imul(p,V)|0,o=(o=o+Math.imul(p,K)|0)+Math.imul(y,V)|0,i=i+Math.imul(y,K)|0;var ve=(c+(n=n+Math.imul(f,G)|0)|0)+((8191&(o=(o=o+Math.imul(f,X)|0)+Math.imul(d,G)|0))<<13)|0;c=((i=i+Math.imul(d,X)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(w,z),o=(o=Math.imul(w,q))+Math.imul(A,z)|0,i=Math.imul(A,q),n=n+Math.imul(g,V)|0,o=(o=o+Math.imul(g,K)|0)+Math.imul(v,V)|0,i=i+Math.imul(v,K)|0,n=n+Math.imul(p,G)|0,o=(o=o+Math.imul(p,X)|0)+Math.imul(y,G)|0,i=i+Math.imul(y,X)|0;var be=(c+(n=n+Math.imul(f,Q)|0)|0)+((8191&(o=(o=o+Math.imul(f,Y)|0)+Math.imul(d,Q)|0))<<13)|0;c=((i=i+Math.imul(d,Y)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(k,z),o=(o=Math.imul(k,q))+Math.imul(_,z)|0,i=Math.imul(_,q),n=n+Math.imul(w,V)|0,o=(o=o+Math.imul(w,K)|0)+Math.imul(A,V)|0,i=i+Math.imul(A,K)|0,n=n+Math.imul(g,G)|0,o=(o=o+Math.imul(g,X)|0)+Math.imul(v,G)|0,i=i+Math.imul(v,X)|0,n=n+Math.imul(p,Q)|0,o=(o=o+Math.imul(p,Y)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,Y)|0;var we=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(o=(o=o+Math.imul(f,ee)|0)+Math.imul(d,$)|0))<<13)|0;c=((i=i+Math.imul(d,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,z),o=(o=Math.imul(x,q))+Math.imul(T,z)|0,i=Math.imul(T,q),n=n+Math.imul(k,V)|0,o=(o=o+Math.imul(k,K)|0)+Math.imul(_,V)|0,i=i+Math.imul(_,K)|0,n=n+Math.imul(w,G)|0,o=(o=o+Math.imul(w,X)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,X)|0,n=n+Math.imul(g,Q)|0,o=(o=o+Math.imul(g,Y)|0)+Math.imul(v,Q)|0,i=i+Math.imul(v,Y)|0,n=n+Math.imul(p,$)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,ee)|0;var Ae=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(o=(o=o+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((i=i+Math.imul(d,ne)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(O,z),o=(o=Math.imul(O,q))+Math.imul(R,z)|0,i=Math.imul(R,q),n=n+Math.imul(x,V)|0,o=(o=o+Math.imul(x,K)|0)+Math.imul(T,V)|0,i=i+Math.imul(T,K)|0,n=n+Math.imul(k,G)|0,o=(o=o+Math.imul(k,X)|0)+Math.imul(_,G)|0,i=i+Math.imul(_,X)|0,n=n+Math.imul(w,Q)|0,o=(o=o+Math.imul(w,Y)|0)+Math.imul(A,Q)|0,i=i+Math.imul(A,Y)|0,n=n+Math.imul(g,$)|0,o=(o=o+Math.imul(g,ee)|0)+Math.imul(v,$)|0,i=i+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,o=(o=o+Math.imul(p,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0;var Se=(c+(n=n+Math.imul(f,ie)|0)|0)+((8191&(o=(o=o+Math.imul(f,ae)|0)+Math.imul(d,ie)|0))<<13)|0;c=((i=i+Math.imul(d,ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(C,z),o=(o=Math.imul(C,q))+Math.imul(M,z)|0,i=Math.imul(M,q),n=n+Math.imul(O,V)|0,o=(o=o+Math.imul(O,K)|0)+Math.imul(R,V)|0,i=i+Math.imul(R,K)|0,n=n+Math.imul(x,G)|0,o=(o=o+Math.imul(x,X)|0)+Math.imul(T,G)|0,i=i+Math.imul(T,X)|0,n=n+Math.imul(k,Q)|0,o=(o=o+Math.imul(k,Y)|0)+Math.imul(_,Q)|0,i=i+Math.imul(_,Y)|0,n=n+Math.imul(w,$)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0,n=n+Math.imul(g,re)|0,o=(o=o+Math.imul(g,ne)|0)+Math.imul(v,re)|0,i=i+Math.imul(v,ne)|0,n=n+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,ae)|0;var ke=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(o=(o=o+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((i=i+Math.imul(d,ce)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(N,z),o=(o=Math.imul(N,q))+Math.imul(L,z)|0,i=Math.imul(L,q),n=n+Math.imul(C,V)|0,o=(o=o+Math.imul(C,K)|0)+Math.imul(M,V)|0,i=i+Math.imul(M,K)|0,n=n+Math.imul(O,G)|0,o=(o=o+Math.imul(O,X)|0)+Math.imul(R,G)|0,i=i+Math.imul(R,X)|0,n=n+Math.imul(x,Q)|0,o=(o=o+Math.imul(x,Y)|0)+Math.imul(T,Q)|0,i=i+Math.imul(T,Y)|0,n=n+Math.imul(k,$)|0,o=(o=o+Math.imul(k,ee)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,ee)|0,n=n+Math.imul(w,re)|0,o=(o=o+Math.imul(w,ne)|0)+Math.imul(A,re)|0,i=i+Math.imul(A,ne)|0,n=n+Math.imul(g,ie)|0,o=(o=o+Math.imul(g,ae)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,ae)|0,n=n+Math.imul(p,ue)|0,o=(o=o+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,i=i+Math.imul(y,ce)|0;var _e=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(o=(o=o+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((i=i+Math.imul(d,de)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(U,z),o=(o=Math.imul(U,q))+Math.imul(F,z)|0,i=Math.imul(F,q),n=n+Math.imul(N,V)|0,o=(o=o+Math.imul(N,K)|0)+Math.imul(L,V)|0,i=i+Math.imul(L,K)|0,n=n+Math.imul(C,G)|0,o=(o=o+Math.imul(C,X)|0)+Math.imul(M,G)|0,i=i+Math.imul(M,X)|0,n=n+Math.imul(O,Q)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,Y)|0,n=n+Math.imul(x,$)|0,o=(o=o+Math.imul(x,ee)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,ee)|0,n=n+Math.imul(k,re)|0,o=(o=o+Math.imul(k,ne)|0)+Math.imul(_,re)|0,i=i+Math.imul(_,ne)|0,n=n+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0,n=n+Math.imul(g,ue)|0,o=(o=o+Math.imul(g,ce)|0)+Math.imul(v,ue)|0,i=i+Math.imul(v,ce)|0,n=n+Math.imul(p,fe)|0,o=(o=o+Math.imul(p,de)|0)+Math.imul(y,fe)|0,i=i+Math.imul(y,de)|0;var Ee=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(o=(o=o+Math.imul(f,ye)|0)+Math.imul(d,pe)|0))<<13)|0;c=((i=i+Math.imul(d,ye)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,V),o=(o=Math.imul(U,K))+Math.imul(F,V)|0,i=Math.imul(F,K),n=n+Math.imul(N,G)|0,o=(o=o+Math.imul(N,X)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,X)|0,n=n+Math.imul(C,Q)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(M,Q)|0,i=i+Math.imul(M,Y)|0,n=n+Math.imul(O,$)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(x,re)|0,o=(o=o+Math.imul(x,ne)|0)+Math.imul(T,re)|0,i=i+Math.imul(T,ne)|0,n=n+Math.imul(k,ie)|0,o=(o=o+Math.imul(k,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,n=n+Math.imul(w,ue)|0,o=(o=o+Math.imul(w,ce)|0)+Math.imul(A,ue)|0,i=i+Math.imul(A,ce)|0,n=n+Math.imul(g,fe)|0,o=(o=o+Math.imul(g,de)|0)+Math.imul(v,fe)|0,i=i+Math.imul(v,de)|0;var xe=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((i=i+Math.imul(y,ye)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(U,G),o=(o=Math.imul(U,X))+Math.imul(F,G)|0,i=Math.imul(F,X),n=n+Math.imul(N,Q)|0,o=(o=o+Math.imul(N,Y)|0)+Math.imul(L,Q)|0,i=i+Math.imul(L,Y)|0,n=n+Math.imul(C,$)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(M,$)|0,i=i+Math.imul(M,ee)|0,n=n+Math.imul(O,re)|0,o=(o=o+Math.imul(O,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(x,ie)|0,o=(o=o+Math.imul(x,ae)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,ae)|0,n=n+Math.imul(k,ue)|0,o=(o=o+Math.imul(k,ce)|0)+Math.imul(_,ue)|0,i=i+Math.imul(_,ce)|0,n=n+Math.imul(w,fe)|0,o=(o=o+Math.imul(w,de)|0)+Math.imul(A,fe)|0,i=i+Math.imul(A,de)|0;var Te=(c+(n=n+Math.imul(g,pe)|0)|0)+((8191&(o=(o=o+Math.imul(g,ye)|0)+Math.imul(v,pe)|0))<<13)|0;c=((i=i+Math.imul(v,ye)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,Q),o=(o=Math.imul(U,Y))+Math.imul(F,Q)|0,i=Math.imul(F,Y),n=n+Math.imul(N,$)|0,o=(o=o+Math.imul(N,ee)|0)+Math.imul(L,$)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(C,re)|0,o=(o=o+Math.imul(C,ne)|0)+Math.imul(M,re)|0,i=i+Math.imul(M,ne)|0,n=n+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,ae)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,ae)|0,n=n+Math.imul(x,ue)|0,o=(o=o+Math.imul(x,ce)|0)+Math.imul(T,ue)|0,i=i+Math.imul(T,ce)|0,n=n+Math.imul(k,fe)|0,o=(o=o+Math.imul(k,de)|0)+Math.imul(_,fe)|0,i=i+Math.imul(_,de)|0;var Pe=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,ye)|0)+Math.imul(A,pe)|0))<<13)|0;c=((i=i+Math.imul(A,ye)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,$),o=(o=Math.imul(U,ee))+Math.imul(F,$)|0,i=Math.imul(F,ee),n=n+Math.imul(N,re)|0,o=(o=o+Math.imul(N,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,ae)|0)+Math.imul(M,ie)|0,i=i+Math.imul(M,ae)|0,n=n+Math.imul(O,ue)|0,o=(o=o+Math.imul(O,ce)|0)+Math.imul(R,ue)|0,i=i+Math.imul(R,ce)|0,n=n+Math.imul(x,fe)|0,o=(o=o+Math.imul(x,de)|0)+Math.imul(T,fe)|0,i=i+Math.imul(T,de)|0;var Oe=(c+(n=n+Math.imul(k,pe)|0)|0)+((8191&(o=(o=o+Math.imul(k,ye)|0)+Math.imul(_,pe)|0))<<13)|0;c=((i=i+Math.imul(_,ye)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,re),o=(o=Math.imul(U,ne))+Math.imul(F,re)|0,i=Math.imul(F,ne),n=n+Math.imul(N,ie)|0,o=(o=o+Math.imul(N,ae)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,ae)|0,n=n+Math.imul(C,ue)|0,o=(o=o+Math.imul(C,ce)|0)+Math.imul(M,ue)|0,i=i+Math.imul(M,ce)|0,n=n+Math.imul(O,fe)|0,o=(o=o+Math.imul(O,de)|0)+Math.imul(R,fe)|0,i=i+Math.imul(R,de)|0;var Re=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(o=(o=o+Math.imul(x,ye)|0)+Math.imul(T,pe)|0))<<13)|0;c=((i=i+Math.imul(T,ye)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,ie),o=(o=Math.imul(U,ae))+Math.imul(F,ie)|0,i=Math.imul(F,ae),n=n+Math.imul(N,ue)|0,o=(o=o+Math.imul(N,ce)|0)+Math.imul(L,ue)|0,i=i+Math.imul(L,ce)|0,n=n+Math.imul(C,fe)|0,o=(o=o+Math.imul(C,de)|0)+Math.imul(M,fe)|0,i=i+Math.imul(M,de)|0;var Ie=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(o=(o=o+Math.imul(O,ye)|0)+Math.imul(R,pe)|0))<<13)|0;c=((i=i+Math.imul(R,ye)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,ue),o=(o=Math.imul(U,ce))+Math.imul(F,ue)|0,i=Math.imul(F,ce),n=n+Math.imul(N,fe)|0,o=(o=o+Math.imul(N,de)|0)+Math.imul(L,fe)|0,i=i+Math.imul(L,de)|0;var Ce=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,ye)|0)+Math.imul(M,pe)|0))<<13)|0;c=((i=i+Math.imul(M,ye)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(U,fe),o=(o=Math.imul(U,de))+Math.imul(F,fe)|0,i=Math.imul(F,de);var Me=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(o=(o=o+Math.imul(N,ye)|0)+Math.imul(L,pe)|0))<<13)|0;c=((i=i+Math.imul(L,ye)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863;var Be=(c+(n=Math.imul(U,pe))|0)+((8191&(o=(o=Math.imul(U,ye))+Math.imul(F,pe)|0))<<13)|0;return c=((i=Math.imul(F,ye))+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,u[0]=me,u[1]=ge,u[2]=ve,u[3]=be,u[4]=we,u[5]=Ae,u[6]=Se,u[7]=ke,u[8]=_e,u[9]=Ee,u[10]=xe,u[11]=Te,u[12]=Pe,u[13]=Oe,u[14]=Re,u[15]=Ie,u[16]=Ce,u[17]=Me,u[18]=Be,0!==c&&(u[19]=c,r.length++),r};function p(e,t,r){return(new y).mulp(e,t,r)}function y(e,t){this.x=e,this.y=t}Math.imul||(h=d),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?h(this,e,t):n<63?d(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}r.words[i]=s,n=a,a=o}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},y.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},y.prototype.permute=function(e,t,r,n,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,t+=o/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>o}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,r=e%26,o=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=o);c--){var f=0|this.words[c];this.words[c]=l<<26-i|f>>>i,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,o=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var o=67108863^67108863>>>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},i.prototype.isubn=function(e){if(n("number"===typeof e),n(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>26)-(u/67108864|0),this.words[o+r]=67108863&i}for(;o>26,this.words[o+r]=67108863&i;if(0===s)return this.strip();for(n(-1===s),s=0,o=0;o>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,u=n.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var d=67108864*(0|n.words[o.length+f])+(0|n.words[o.length+f-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(o,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(o,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),o=e.andln(1),i=r.cmp(n);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,o=this.length-1;o>=0;o--)r=(t*r+(0|this.words[o]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var o=(0|this.words[r])+67108864*t;this.words[r]=o/e|0,t=o%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0===(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(l),a.isub(f)),o.iushrn(1),a.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.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;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0===(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var o=t.cmp(r);if(o<0){var i=t;t=r,r=i}else if(0===o||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,o=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;r--){var n=0|this.words[r],o=0|e.words[r];if(n!==o){no&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new S(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},o(v,g),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),o=0;o>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&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,r=0;r>>=26,e.words[r]=o,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new b;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return m[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,o),d=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var y=h,m=0;0!==y.cmp(s);m++)y=y.redSqr();n(m=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var f=c>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===n&&0===l)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}u=26}return o},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new k(e)},o(k,S),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},56377:(e,t,r)=>{var n=r(54273),o=r(66420);e.exports=function(e){if("string"===typeof e||"number"===typeof e){var t=new n(1),r=String(e).toLowerCase().trim(),i="0x"===r.substr(0,2)||"-0x"===r.substr(0,3),a=o(r);if("-"===a.substr(0,1)&&(a=o(a.slice(1)),t=new n(-1,10)),!(a=""===a?"0":a).match(/^-?[0-9]+$/)&&a.match(/^[0-9A-Fa-f]+$/)||a.match(/^[a-fA-F]+$/)||!0===i&&a.match(/^[0-9A-Fa-f]+$/))return new n(a,16).mul(t);if((a.match(/^-?[0-9]+$/)||""===a)&&!1===i)return new n(a,10).mul(t)}else if("object"===typeof e&&e.toString&&!e.pop&&!e.push&&e.toString(10).match(/^-?[0-9]+$/)&&(e.mul||e.dividedToIntegerBy))return new n(e.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(e)+" to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.")}},68206:(e,t,r)=>{var n="function"===typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"===typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"===typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&u&&"function"===typeof u.get?u.get:null,l=s&&Set.prototype.forEach,f="function"===typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"===typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"===typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,y=Object.prototype.toString,m=Function.prototype.toString,g=String.prototype.match,v=String.prototype.slice,b=String.prototype.replace,w=String.prototype.toUpperCase,A=String.prototype.toLowerCase,S=RegExp.prototype.test,k=Array.prototype.concat,_=Array.prototype.join,E=Array.prototype.slice,x=Math.floor,T="function"===typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,O="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?Symbol.prototype.toString:null,R="function"===typeof Symbol&&"object"===typeof Symbol.iterator,I="function"===typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===R||"symbol")?Symbol.toStringTag:null,C=Object.prototype.propertyIsEnumerable,M=("function"===typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function B(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||S.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"===typeof e){var n=e<0?-x(-e):x(e);if(n!==e){var o=String(n),i=v.call(t,o.length+1);return b.call(o,r,"$&_")+"."+b.call(b.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(t,r,"$&_")}var N=r(42634),L=N.custom,j=q(L)?L:null;function U(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function F(e){return b.call(String(e),/"/g,""")}function D(e){return"[object Array]"===K(e)&&(!I||!("object"===typeof e&&I in e))}function z(e){return"[object RegExp]"===K(e)&&(!I||!("object"===typeof e&&I in e))}function q(e){if(R)return e&&"object"===typeof e&&e instanceof Symbol;if("symbol"===typeof e)return!0;if(!e||"object"!==typeof e||!O)return!1;try{return O.call(e),!0}catch(t){}return!1}e.exports=function e(t,n,o,s){var u=n||{};if(V(u,"quoteStyle")&&"single"!==u.quoteStyle&&"double"!==u.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(V(u,"maxStringLength")&&("number"===typeof u.maxStringLength?u.maxStringLength<0&&u.maxStringLength!==1/0:null!==u.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var y=!V(u,"customInspect")||u.customInspect;if("boolean"!==typeof y&&"symbol"!==y)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(V(u,"indent")&&null!==u.indent&&"\t"!==u.indent&&!(parseInt(u.indent,10)===u.indent&&u.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(V(u,"numericSeparator")&&"boolean"!==typeof u.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=u.numericSeparator;if("undefined"===typeof t)return"undefined";if(null===t)return"null";if("boolean"===typeof t)return t?"true":"false";if("string"===typeof t)return G(t,u);if("number"===typeof t){if(0===t)return 1/0/t>0?"0":"-0";var S=String(t);return w?B(t,S):S}if("bigint"===typeof t){var x=String(t)+"n";return w?B(t,x):x}var P="undefined"===typeof u.depth?5:u.depth;if("undefined"===typeof o&&(o=0),o>=P&&P>0&&"object"===typeof t)return D(t)?"[Array]":"[Object]";var L=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"===typeof e.indent&&e.indent>0))return null;r=_.call(Array(e.indent+1)," ")}return{base:r,prev:_.call(Array(t+1),r)}}(u,o);if("undefined"===typeof s)s=[];else if(W(s,t)>=0)return"[Circular]";function H(t,r,n){if(r&&(s=E.call(s)).push(r),n){var i={depth:u.depth};return V(u,"quoteStyle")&&(i.quoteStyle=u.quoteStyle),e(t,i,o+1,s)}return e(t,u,o+1,s)}if("function"===typeof t&&!z(t)){var X=function(e){if(e.name)return e.name;var t=g.call(m.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),ee=$(t,H);return"[Function"+(X?": "+X:" (anonymous)")+"]"+(ee.length>0?" { "+_.call(ee,", ")+" }":"")}if(q(t)){var te=R?b.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(t);return"object"!==typeof t||R?te:Z(te)}if(function(e){if(!e||"object"!==typeof e)return!1;if("undefined"!==typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"===typeof e.nodeName&&"function"===typeof e.getAttribute}(t)){for(var re="<"+A.call(String(t.nodeName)),ne=t.attributes||[],oe=0;oe"}if(D(t)){if(0===t.length)return"[]";var ie=$(t,H);return L&&!function(e){for(var t=0;t=0)return!1;return!0}(ie)?"["+J(ie,L)+"]":"[ "+_.call(ie,", ")+" ]"}if(function(e){return"[object Error]"===K(e)&&(!I||!("object"===typeof e&&I in e))}(t)){var ae=$(t,H);return"cause"in Error.prototype||!("cause"in t)||C.call(t,"cause")?0===ae.length?"["+String(t)+"]":"{ ["+String(t)+"] "+_.call(ae,", ")+" }":"{ ["+String(t)+"] "+_.call(k.call("[cause]: "+H(t.cause),ae),", ")+" }"}if("object"===typeof t&&y){if(j&&"function"===typeof t[j]&&N)return N(t,{depth:P-o});if("symbol"!==y&&"function"===typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!==typeof e)return!1;try{i.call(e);try{c.call(e)}catch(re){return!0}return e instanceof Map}catch(t){}return!1}(t)){var se=[];return a&&a.call(t,(function(e,r){se.push(H(r,t,!0)+" => "+H(e,t))})),Y("Map",i.call(t),se,L)}if(function(e){if(!c||!e||"object"!==typeof e)return!1;try{c.call(e);try{i.call(e)}catch(t){return!0}return e instanceof Set}catch(r){}return!1}(t)){var ue=[];return l&&l.call(t,(function(e){ue.push(H(e,t))})),Y("Set",c.call(t),ue,L)}if(function(e){if(!f||!e||"object"!==typeof e)return!1;try{f.call(e,f);try{d.call(e,d)}catch(re){return!0}return e instanceof WeakMap}catch(t){}return!1}(t))return Q("WeakMap");if(function(e){if(!d||!e||"object"!==typeof e)return!1;try{d.call(e,d);try{f.call(e,f)}catch(re){return!0}return e instanceof WeakSet}catch(t){}return!1}(t))return Q("WeakSet");if(function(e){if(!h||!e||"object"!==typeof e)return!1;try{return h.call(e),!0}catch(t){}return!1}(t))return Q("WeakRef");if(function(e){return"[object Number]"===K(e)&&(!I||!("object"===typeof e&&I in e))}(t))return Z(H(Number(t)));if(function(e){if(!e||"object"!==typeof e||!T)return!1;try{return T.call(e),!0}catch(t){}return!1}(t))return Z(H(T.call(t)));if(function(e){return"[object Boolean]"===K(e)&&(!I||!("object"===typeof e&&I in e))}(t))return Z(p.call(t));if(function(e){return"[object String]"===K(e)&&(!I||!("object"===typeof e&&I in e))}(t))return Z(H(String(t)));if("undefined"!==typeof window&&t===window)return"{ [object Window] }";if(t===r.g)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===K(e)&&(!I||!("object"===typeof e&&I in e))}(t)&&!z(t)){var ce=$(t,H),le=M?M(t)===Object.prototype:t instanceof Object||t.constructor===Object,fe=t instanceof Object?"":"null prototype",de=!le&&I&&Object(t)===t&&I in t?v.call(K(t),8,-1):fe?"Object":"",he=(le||"function"!==typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(de||fe?"["+_.call(k.call([],de||[],fe||[]),": ")+"] ":"");return 0===ce.length?he+"{}":L?he+"{"+J(ce,L)+"}":he+"{ "+_.call(ce,", ")+" }"}return String(t)};var H=Object.prototype.hasOwnProperty||function(e){return e in this};function V(e,t){return H.call(e,t)}function K(e){return y.call(e)}function W(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;rt.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return G(v.call(e,0,t.maxStringLength),t)+n}return U(b.call(b.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",t)}function X(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function Z(e){return"Object("+e+")"}function Q(e){return e+" { ? }"}function Y(e,t,r,n){return e+" ("+t+") {"+(n?J(r,n):_.call(r,", "))+"}"}function J(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+_.call(e,","+r)+"\n"+t.prev}function $(e,t){var r=D(e),n=[];if(r){n.length=e.length;for(var o=0;o{"use strict";var t=function(e){return e!==e};e.exports=function(e,r){return 0===e&&0===r?1/e===1/r:e===r||!(!t(e)||!t(r))}},52702:(e,t,r)=>{"use strict";var n=r(11779),o=r(61712),i=r(57974),a=r(3799),s=r(85289),u=o(a(),Object);n(u,{getPolyfill:a,implementation:i,shim:s}),e.exports=u},3799:(e,t,r)=>{"use strict";var n=r(57974);e.exports=function(){return"function"===typeof Object.is?Object.is:n}},85289:(e,t,r)=>{"use strict";var n=r(3799),o=r(11779);e.exports=function(){var e=n();return o(Object,{is:e},{is:function(){return Object.is!==e}}),e}},21038:(e,t,r)=>{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(80234),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"===typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"===typeof window[e])try{f(window[e])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(e){var t=null!==e&&"object"===typeof e,r="[object Function]"===i.call(e),n=a(e),s=t&&"[object String]"===i.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(s&&e.length>0&&!o.call(e,0))for(var y=0;y0)for(var m=0;m{"use strict";var n=Array.prototype.slice,o=r(80234),i=Object.keys,a=i?function(e){return i(e)}:r(21038),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return o(e)?s(n.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},80234:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},95590:(e,t,r)=>{"use strict";var n=r(2678),o=r(99534)(),i=r(12028),a=Object,s=i("Array.prototype.push"),u=i("Object.prototype.propertyIsEnumerable"),c=o?Object.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var r=a(e);if(1===arguments.length)return r;for(var i=1;i{"use strict";var n=r(95590);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n{"use strict";e.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},18871:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,r,n,o){r=r||"&",n=n||"=";var i={};if("string"!==typeof e||0===e.length)return i;var a=/\+/g;e=e.split(r);var s=1e3;o&&"number"===typeof o.maxKeys&&(s=o.maxKeys);var u=e.length;s>0&&u>s&&(u=s);for(var c=0;c=0?(l=p.substr(0,y),f=p.substr(y+1)):(l=p,f=""),d=decodeURIComponent(l),h=decodeURIComponent(f),t(i,d)?Array.isArray(i[d])?i[d].push(h):i[d]=[i[d],h]:i[d]=h}return i}},13939:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,r,n,o){return r=r||"&",n=n||"=",null===e&&(e=void 0),"object"===typeof e?Object.keys(e).map((function(o){var i=encodeURIComponent(t(o))+n;return Array.isArray(e[o])?e[o].map((function(e){return i+encodeURIComponent(t(e))})).join(r):i+encodeURIComponent(t(e[o]))})).filter(Boolean).join(r):o?encodeURIComponent(t(o))+n+encodeURIComponent(t(e)):""}},83565:(e,t,r)=>{"use strict";t.decode=t.parse=r(18871),t.encode=t.stringify=r(13939)},15838:(e,t,r)=>{"use strict";var n=65536,o=4294967295;var i=r(59966).Buffer,a=r.g.crypto||r.g.msCrypto;a&&a.getRandomValues?e.exports=function(e,t){if(e>o)throw new RangeError("requested too many random bytes");var r=i.allocUnsafe(e);if(e>0)if(e>n)for(var s=0;s{"use strict";var n=r(65043),o=r(78853);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r