@metamask/solana-wallet-snap 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +160 -0
- package/README.md +29 -0
- package/dist/bundle.js +1 -0
- package/dist/preinstalled-snap.json +1 -0
- package/package.json +58 -0
- package/snap.manifest.json +57 -0
package/dist/bundle.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var e={2191:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcRequestStruct=void 0;const n=r(7093),o=r(90),s=r(1427);t.JsonRpcRequestStruct=(0,s.object)({jsonrpc:(0,n.literal)("2.0"),id:(0,n.union)([(0,n.string)(),(0,n.number)(),(0,n.literal)(null)]),method:(0,n.string)(),params:(0,s.exactOptional)((0,n.union)([(0,n.array)(o.JsonStruct),(0,n.record)((0,n.string)(),o.JsonStruct)]))})},6071:function(e,t,r){"use strict";var n,o,s,i=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},a=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.KeyringClient=void 0;const c=r(7093),u=r(4596),l=r(9223),f=r(8992),h=r(1427);t.KeyringClient=class{constructor(e){n.add(this),o.set(this,void 0),i(this,o,e,"f")}async listAccounts(){return(0,h.strictMask)(await a(this,n,"m",s).call(this,{method:f.KeyringRpcMethod.ListAccounts}),l.ListAccountsResponseStruct)}async getAccount(e){return(0,h.strictMask)(await a(this,n,"m",s).call(this,{method:f.KeyringRpcMethod.GetAccount,params:{id:e}}),l.GetAccountResponseStruct)}async getAccountBalances(e,t){return(0,h.strictMask)(await a(this,n,"m",s).call(this,{method:f.KeyringRpcMethod.GetAccountBalances,params:{id:e,assets:t}}),l.GetAccountBalancesResponseStruct)}async createAccount(e={}){return(0,h.strictMask)(await a(this,n,"m",s).call(this,{method:f.KeyringRpcMethod.CreateAccount,params:{options:e}}),l.CreateAccountResponseStruct)}async filterAccountChains(e,t){return(0,h.strictMask)(await a(this,n,"m",s).call(this,{method:f.KeyringRpcMethod.FilterAccountChains,params:{id:e,chains:t}}),l.FilterAccountChainsResponseStruct)}async updateAccount(e){(0,c.assert)(await a(this,n,"m",s).call(this,{method:f.KeyringRpcMethod.UpdateAccount,params:{account:e}}),l.UpdateAccountResponseStruct)}async deleteAccount(e){(0,c.assert)(await a(this,n,"m",s).call(this,{method:f.KeyringRpcMethod.DeleteAccount,params:{id:e}}),l.DeleteAccountResponseStruct)}async exportAccount(e){return(0,h.strictMask)(await a(this,n,"m",s).call(this,{method:f.KeyringRpcMethod.ExportAccount,params:{id:e}}),l.ExportAccountResponseStruct)}async listRequests(){return(0,h.strictMask)(await a(this,n,"m",s).call(this,{method:f.KeyringRpcMethod.ListRequests}),l.ListRequestsResponseStruct)}async getRequest(e){return(0,h.strictMask)(await a(this,n,"m",s).call(this,{method:f.KeyringRpcMethod.GetRequest,params:{id:e}}),l.GetRequestResponseStruct)}async submitRequest(e){return(0,h.strictMask)(await a(this,n,"m",s).call(this,{method:f.KeyringRpcMethod.SubmitRequest,params:e}),l.SubmitRequestResponseStruct)}async approveRequest(e,t={}){(0,c.assert)(await a(this,n,"m",s).call(this,{method:f.KeyringRpcMethod.ApproveRequest,params:{id:e,data:t}}),l.ApproveRequestResponseStruct)}async rejectRequest(e){(0,c.assert)(await a(this,n,"m",s).call(this,{method:f.KeyringRpcMethod.RejectRequest,params:{id:e}}),l.RejectRequestResponseStruct)}},o=new WeakMap,n=new WeakSet,s=async function(e){return a(this,o,"f").send({jsonrpc:"2.0",id:(0,u.v4)(),...e})}},9178:function(e,t,r){"use strict";var n,o,s=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},i=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.KeyringSnapRpcClient=t.SnapRpcSender=void 0;const a=r(6071);class c{constructor(e,t){n.set(this,void 0),o.set(this,void 0),s(this,n,e,"f"),s(this,o,t,"f")}async send(e){return i(this,o,"f").request({method:"wallet_invokeKeyring",params:{snapId:i(this,n,"f"),request:e}})}}t.SnapRpcSender=c,n=new WeakMap,o=new WeakMap;class u extends a.KeyringClient{constructor(e,t){super(new c(e,t))}}t.KeyringSnapRpcClient=u},1313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyringAccountStruct=t.BtcAccountType=t.EthAccountType=void 0;const n=r(7093),o=r(90),s=r(1427),i=r(6523);var a,c;!function(e){e.Eoa="eip155:eoa",e.Erc4337="eip155:erc4337"}(a||(t.EthAccountType=a={})),function(e){e.P2wpkh="bip122:p2wpkh"}(c||(t.BtcAccountType=c={})),t.KeyringAccountStruct=(0,s.object)({id:i.UuidStruct,type:(0,n.enums)([`${a.Eoa}`,`${a.Erc4337}`,`${c.P2wpkh}`]),address:(0,n.string)(),options:(0,n.record)((0,n.string)(),o.JsonStruct),methods:(0,n.array)((0,n.string)())})},4610:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BalanceStruct=void 0;const n=r(7093),o=r(1427),s=r(6523);t.BalanceStruct=(0,o.object)({amount:s.StringNumberStruct,unit:(0,n.string)()})},7701:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isCaipAssetId=t.isCaipAssetType=t.CaipAssetIdStruct=t.CaipAssetTypeStruct=void 0;const n=r(7093),o=r(1427);t.CaipAssetTypeStruct=(0,o.definePattern)("CaipAssetType",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u),t.CaipAssetIdStruct=(0,o.definePattern)("CaipAssetId",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u),t.isCaipAssetType=function(e){return(0,n.is)(e,t.CaipAssetTypeStruct)},t.isCaipAssetId=function(e){return(0,n.is)(e,t.CaipAssetIdStruct)}},8114:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyringAccountDataStruct=void 0;const n=r(7093),o=r(90);t.KeyringAccountDataStruct=(0,n.record)((0,n.string)(),o.JsonStruct)},5338: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(1313),t),o(r(4610),t),o(r(7701),t),o(r(8114),t),o(r(643),t),o(r(3767),t)},643:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyringRequestStruct=void 0;const n=r(7093),o=r(90),s=r(1427),i=r(6523);t.KeyringRequestStruct=(0,s.object)({id:i.UuidStruct,scope:(0,n.string)(),account:i.UuidStruct,request:(0,s.object)({method:(0,n.string)(),params:(0,s.exactOptional)((0,n.union)([(0,n.array)(o.JsonStruct),(0,n.record)((0,n.string)(),o.JsonStruct)]))})})},3767:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyringResponseStruct=void 0;const n=r(7093),o=r(90),s=r(1427);t.KeyringResponseStruct=(0,n.union)([(0,s.object)({pending:(0,n.literal)(!0),redirect:(0,s.exactOptional)((0,s.object)({message:(0,s.exactOptional)((0,n.string)()),url:(0,s.exactOptional)((0,n.string)())}))}),(0,s.object)({pending:(0,n.literal)(!1),result:o.JsonStruct})])},2517: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(7644),t)},7644:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BtcP2wpkhAccountStruct=t.BtcMethod=t.BtcP2wpkhAddressStruct=void 0;const n=r(7093),o=r(6586),s=r(5338),i=r(1427);var a;t.BtcP2wpkhAddressStruct=(0,n.refine)((0,n.string)(),"BtcP2wpkhAddressStruct",(e=>{try{o.bech32.decode(e)}catch(e){return new Error(`Could not decode P2WPKH address: ${e.message}`)}return!0})),function(e){e.SendBitcoin="sendBitcoin"}(a||(t.BtcMethod=a={})),t.BtcP2wpkhAccountStruct=(0,i.object)({...s.KeyringAccountStruct.schema,address:t.BtcP2wpkhAddressStruct,type:(0,n.literal)(`${s.BtcAccountType.P2wpkh}`),methods:(0,n.array)((0,n.enums)([`${a.SendBitcoin}`]))})},1949: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(6628),t)},6628:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EthUserOperationPatchStruct=t.EthBaseUserOperationStruct=t.EthBaseTransactionStruct=t.EthUserOperationStruct=void 0;const n=r(1427),o=r(6523),s=r(3704);t.EthUserOperationStruct=(0,n.object)({sender:s.EthAddressStruct,nonce:s.EthUint256Struct,initCode:s.EthBytesStruct,callData:s.EthBytesStruct,callGasLimit:s.EthUint256Struct,verificationGasLimit:s.EthUint256Struct,preVerificationGas:s.EthUint256Struct,maxFeePerGas:s.EthUint256Struct,maxPriorityFeePerGas:s.EthUint256Struct,paymasterAndData:s.EthBytesStruct,signature:s.EthBytesStruct}),t.EthBaseTransactionStruct=(0,n.object)({to:s.EthAddressStruct,value:s.EthUint256Struct,data:s.EthBytesStruct}),t.EthBaseUserOperationStruct=(0,n.object)({nonce:s.EthUint256Struct,initCode:s.EthBytesStruct,callData:s.EthBytesStruct,gasLimits:(0,n.exactOptional)((0,n.object)({callGasLimit:s.EthUint256Struct,verificationGasLimit:s.EthUint256Struct,preVerificationGas:s.EthUint256Struct})),dummyPaymasterAndData:s.EthBytesStruct,dummySignature:s.EthBytesStruct,bundlerUrl:o.UrlStruct}),t.EthUserOperationPatchStruct=(0,n.object)({paymasterAndData:s.EthBytesStruct,callGasLimit:(0,n.exactOptional)(s.EthUint256Struct),verificationGasLimit:(0,n.exactOptional)(s.EthUint256Struct),preVerificationGas:(0,n.exactOptional)(s.EthUint256Struct)})},4089: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(1949),t),o(r(3704),t),o(r(1172),t)},3704:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EthErc4337AccountStruct=t.EthEoaAccountStruct=t.EthMethod=t.EthUint256Struct=t.EthAddressStruct=t.EthBytesStruct=void 0;const n=r(7093),o=r(5338),s=r(1427);var i;t.EthBytesStruct=(0,s.definePattern)("EthBytes",/^0x[0-9a-f]*$/iu),t.EthAddressStruct=(0,s.definePattern)("EthAddress",/^0x[0-9a-f]{40}$/iu),t.EthUint256Struct=(0,s.definePattern)("EthUint256",/^0x([1-9a-f][0-9a-f]*|0)$/iu),function(e){e.PersonalSign="personal_sign",e.Sign="eth_sign",e.SignTransaction="eth_signTransaction",e.SignTypedDataV1="eth_signTypedData_v1",e.SignTypedDataV3="eth_signTypedData_v3",e.SignTypedDataV4="eth_signTypedData_v4",e.PrepareUserOperation="eth_prepareUserOperation",e.PatchUserOperation="eth_patchUserOperation",e.SignUserOperation="eth_signUserOperation"}(i||(t.EthMethod=i={})),t.EthEoaAccountStruct=(0,s.object)({...o.KeyringAccountStruct.schema,address:t.EthAddressStruct,type:(0,n.literal)(`${o.EthAccountType.Eoa}`),methods:(0,n.array)((0,n.enums)([`${i.PersonalSign}`,`${i.Sign}`,`${i.SignTransaction}`,`${i.SignTypedDataV1}`,`${i.SignTypedDataV3}`,`${i.SignTypedDataV4}`]))}),t.EthErc4337AccountStruct=(0,s.object)({...o.KeyringAccountStruct.schema,address:t.EthAddressStruct,type:(0,n.literal)(`${o.EthAccountType.Erc4337}`),methods:(0,n.array)((0,n.enums)([`${i.PersonalSign}`,`${i.Sign}`,`${i.SignTypedDataV1}`,`${i.SignTypedDataV3}`,`${i.SignTypedDataV4}`,`${i.PrepareUserOperation}`,`${i.PatchUserOperation}`,`${i.SignUserOperation}`]))})},1172:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEvmAccountType=void 0;const n=r(5338);t.isEvmAccountType=function(e){return e===n.EthAccountType.Eoa||e===n.EthAccountType.Erc4337}},3972:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.KeyringEvent=void 0,function(e){e.AccountCreated="notify:accountCreated",e.AccountUpdated="notify:accountUpdated",e.AccountDeleted="notify:accountDeleted",e.RequestApproved="notify:requestApproved",e.RequestRejected="notify:requestRejected"}(r||(t.KeyringEvent=r={}))},4105: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(5338),t),o(r(2517),t),o(r(4089),t),o(r(3972),t),o(r(9267),t),o(r(6071),t),o(r(9178),t),o(r(935),t),o(r(1309),t),o(r(1427),t)},9223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RejectRequestResponseStruct=t.RejectRequestRequestStruct=t.ApproveRequestResponseStruct=t.ApproveRequestRequestStruct=t.SubmitRequestResponseStruct=t.SubmitRequestRequestStruct=t.GetRequestResponseStruct=t.GetRequestRequestStruct=t.ListRequestsResponseStruct=t.ListRequestsRequestStruct=t.ExportAccountResponseStruct=t.ExportAccountRequestStruct=t.DeleteAccountResponseStruct=t.DeleteAccountRequestStruct=t.UpdateAccountResponseStruct=t.UpdateAccountRequestStruct=t.FilterAccountChainsResponseStruct=t.FilterAccountChainsStruct=t.GetAccountBalancesResponseStruct=t.GetAccountBalancesRequestStruct=t.CreateAccountResponseStruct=t.CreateAccountRequestStruct=t.GetAccountResponseStruct=t.GetAccountRequestStruct=t.ListAccountsResponseStruct=t.ListAccountsRequestStruct=void 0;const n=r(7093),o=r(90),s=r(8992),i=r(5338),a=r(1427),c=r(6523),u={jsonrpc:(0,n.literal)("2.0"),id:(0,n.union)([(0,n.string)(),(0,n.number)(),(0,n.literal)(null)])};t.ListAccountsRequestStruct=(0,a.object)({...u,method:(0,n.literal)("keyring_listAccounts")}),t.ListAccountsResponseStruct=(0,n.array)(i.KeyringAccountStruct),t.GetAccountRequestStruct=(0,a.object)({...u,method:(0,n.literal)("keyring_getAccount"),params:(0,a.object)({id:c.UuidStruct})}),t.GetAccountResponseStruct=i.KeyringAccountStruct,t.CreateAccountRequestStruct=(0,a.object)({...u,method:(0,n.literal)("keyring_createAccount"),params:(0,a.object)({options:(0,n.record)((0,n.string)(),o.JsonStruct)})}),t.CreateAccountResponseStruct=i.KeyringAccountStruct,t.GetAccountBalancesRequestStruct=(0,a.object)({...u,method:(0,n.literal)(`${s.KeyringRpcMethod.GetAccountBalances}`),params:(0,a.object)({id:c.UuidStruct,assets:(0,n.array)(i.CaipAssetTypeStruct)})}),t.GetAccountBalancesResponseStruct=(0,n.record)(i.CaipAssetTypeStruct,i.BalanceStruct),t.FilterAccountChainsStruct=(0,a.object)({...u,method:(0,n.literal)("keyring_filterAccountChains"),params:(0,a.object)({id:c.UuidStruct,chains:(0,n.array)((0,n.string)())})}),t.FilterAccountChainsResponseStruct=(0,n.array)((0,n.string)()),t.UpdateAccountRequestStruct=(0,a.object)({...u,method:(0,n.literal)("keyring_updateAccount"),params:(0,a.object)({account:i.KeyringAccountStruct})}),t.UpdateAccountResponseStruct=(0,n.literal)(null),t.DeleteAccountRequestStruct=(0,a.object)({...u,method:(0,n.literal)("keyring_deleteAccount"),params:(0,a.object)({id:c.UuidStruct})}),t.DeleteAccountResponseStruct=(0,n.literal)(null),t.ExportAccountRequestStruct=(0,a.object)({...u,method:(0,n.literal)("keyring_exportAccount"),params:(0,a.object)({id:c.UuidStruct})}),t.ExportAccountResponseStruct=i.KeyringAccountDataStruct,t.ListRequestsRequestStruct=(0,a.object)({...u,method:(0,n.literal)("keyring_listRequests")}),t.ListRequestsResponseStruct=(0,n.array)(i.KeyringRequestStruct),t.GetRequestRequestStruct=(0,a.object)({...u,method:(0,n.literal)("keyring_getRequest"),params:(0,a.object)({id:c.UuidStruct})}),t.GetRequestResponseStruct=i.KeyringRequestStruct,t.SubmitRequestRequestStruct=(0,a.object)({...u,method:(0,n.literal)("keyring_submitRequest"),params:i.KeyringRequestStruct}),t.SubmitRequestResponseStruct=i.KeyringResponseStruct,t.ApproveRequestRequestStruct=(0,a.object)({...u,method:(0,n.literal)("keyring_approveRequest"),params:(0,a.object)({id:c.UuidStruct,data:(0,n.record)((0,n.string)(),o.JsonStruct)})}),t.ApproveRequestResponseStruct=(0,n.literal)(null),t.RejectRequestRequestStruct=(0,a.object)({...u,method:(0,n.literal)("keyring_rejectRequest"),params:(0,a.object)({id:c.UuidStruct})}),t.RejectRequestResponseStruct=(0,n.literal)(null)},9570:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RequestRejectedEventStruct=t.RequestApprovedEventStruct=t.AccountDeletedEventStruct=t.AccountUpdatedEventStruct=t.AccountCreatedEventStruct=void 0;const n=r(7093),o=r(90),s=r(5338),i=r(3972),a=r(1427),c=r(6523);t.AccountCreatedEventStruct=(0,a.object)({method:(0,n.literal)(`${i.KeyringEvent.AccountCreated}`),params:(0,a.object)({account:s.KeyringAccountStruct,accountNameSuggestion:(0,a.exactOptional)((0,n.string)()),displayConfirmation:(0,a.exactOptional)((0,n.boolean)())})}),t.AccountUpdatedEventStruct=(0,a.object)({method:(0,n.literal)(`${i.KeyringEvent.AccountUpdated}`),params:(0,a.object)({account:s.KeyringAccountStruct})}),t.AccountDeletedEventStruct=(0,a.object)({method:(0,n.literal)(`${i.KeyringEvent.AccountDeleted}`),params:(0,a.object)({id:c.UuidStruct})}),t.RequestApprovedEventStruct=(0,a.object)({method:(0,n.literal)(`${i.KeyringEvent.RequestApproved}`),params:(0,a.object)({id:c.UuidStruct,result:o.JsonStruct})}),t.RequestRejectedEventStruct=(0,a.object)({method:(0,n.literal)(`${i.KeyringEvent.RequestRejected}`),params:(0,a.object)({id:c.UuidStruct})})},9267: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(9223),t),o(r(9570),t),o(r(8992),t),o(r(9250),t)},8992:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.isKeyringRpcMethod=t.KeyringRpcMethod=void 0,function(e){e.ListAccounts="keyring_listAccounts",e.GetAccount="keyring_getAccount",e.CreateAccount="keyring_createAccount",e.GetAccountBalances="keyring_getAccountBalances",e.FilterAccountChains="keyring_filterAccountChains",e.UpdateAccount="keyring_updateAccount",e.DeleteAccount="keyring_deleteAccount",e.ExportAccount="keyring_exportAccount",e.ListRequests="keyring_listRequests",e.GetRequest="keyring_getRequest",e.SubmitRequest="keyring_submitRequest",e.ApproveRequest="keyring_approveRequest",e.RejectRequest="keyring_rejectRequest"}(r||(t.KeyringRpcMethod=r={})),t.isKeyringRpcMethod=function(e){return Object.values(r).includes(e)}},9250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InternalAccountStruct=t.InternalAccountStructs=t.InternalBtcP2wpkhAccountStruct=t.InternalEthErc4337AccountStruct=t.InternalEthEoaAccountStruct=t.InternalAccountMetadataStruct=void 0;const n=r(7093),o=r(5338),s=r(7644),i=r(3704),a=r(1427);t.InternalAccountMetadataStruct=(0,a.object)({metadata:(0,a.object)({name:(0,n.string)(),nameLastUpdatedAt:(0,a.exactOptional)((0,n.number)()),snap:(0,a.exactOptional)((0,a.object)({id:(0,n.string)(),enabled:(0,n.boolean)(),name:(0,n.string)()})),lastSelected:(0,a.exactOptional)((0,n.number)()),importTime:(0,n.number)(),keyring:(0,a.object)({type:(0,n.string)()})})}),t.InternalEthEoaAccountStruct=(0,a.object)({...i.EthEoaAccountStruct.schema,...t.InternalAccountMetadataStruct.schema}),t.InternalEthErc4337AccountStruct=(0,a.object)({...i.EthErc4337AccountStruct.schema,...t.InternalAccountMetadataStruct.schema}),t.InternalBtcP2wpkhAccountStruct=(0,a.object)({...s.BtcP2wpkhAccountStruct.schema,...t.InternalAccountMetadataStruct.schema}),t.InternalAccountStructs={[`${o.EthAccountType.Eoa}`]:t.InternalEthEoaAccountStruct,[`${o.EthAccountType.Erc4337}`]:t.InternalEthErc4337AccountStruct,[`${o.BtcAccountType.P2wpkh}`]:t.InternalBtcP2wpkhAccountStruct},t.InternalAccountStruct=(0,a.object)({...o.KeyringAccountStruct.schema,...t.InternalAccountMetadataStruct.schema})},935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleKeyringRequest=t.MethodNotSupportedError=void 0;const n=r(7093),o=r(9223),s=r(8992),i=r(2191);class a extends Error{constructor(e){super(`Method not supported: ${e}`)}}t.MethodNotSupportedError=a,t.handleKeyringRequest=async function(e,t){try{return await async function(e,t){switch((0,n.assert)(t,i.JsonRpcRequestStruct),t.method){case`${s.KeyringRpcMethod.ListAccounts}`:return(0,n.assert)(t,o.ListAccountsRequestStruct),e.listAccounts();case`${s.KeyringRpcMethod.GetAccount}`:return(0,n.assert)(t,o.GetAccountRequestStruct),e.getAccount(t.params.id);case`${s.KeyringRpcMethod.CreateAccount}`:return(0,n.assert)(t,o.CreateAccountRequestStruct),e.createAccount(t.params.options);case`${s.KeyringRpcMethod.GetAccountBalances}`:if(void 0===e.getAccountBalances)throw new a(t.method);return(0,n.assert)(t,o.GetAccountBalancesRequestStruct),e.getAccountBalances(t.params.id,t.params.assets);case`${s.KeyringRpcMethod.FilterAccountChains}`:return(0,n.assert)(t,o.FilterAccountChainsStruct),e.filterAccountChains(t.params.id,t.params.chains);case`${s.KeyringRpcMethod.UpdateAccount}`:return(0,n.assert)(t,o.UpdateAccountRequestStruct),e.updateAccount(t.params.account);case`${s.KeyringRpcMethod.DeleteAccount}`:return(0,n.assert)(t,o.DeleteAccountRequestStruct),e.deleteAccount(t.params.id);case`${s.KeyringRpcMethod.ExportAccount}`:if(void 0===e.exportAccount)throw new a(t.method);return(0,n.assert)(t,o.ExportAccountRequestStruct),e.exportAccount(t.params.id);case`${s.KeyringRpcMethod.ListRequests}`:if(void 0===e.listRequests)throw new a(t.method);return(0,n.assert)(t,o.ListRequestsRequestStruct),e.listRequests();case`${s.KeyringRpcMethod.GetRequest}`:if(void 0===e.getRequest)throw new a(t.method);return(0,n.assert)(t,o.GetRequestRequestStruct),e.getRequest(t.params.id);case`${s.KeyringRpcMethod.SubmitRequest}`:return(0,n.assert)(t,o.SubmitRequestRequestStruct),e.submitRequest(t.params);case`${s.KeyringRpcMethod.ApproveRequest}`:if(void 0===e.approveRequest)throw new a(t.method);return(0,n.assert)(t,o.ApproveRequestRequestStruct),e.approveRequest(t.params.id,t.params.data);case`${s.KeyringRpcMethod.RejectRequest}`:if(void 0===e.rejectRequest)throw new a(t.method);return(0,n.assert)(t,o.RejectRequestRequestStruct),e.rejectRequest(t.params.id);default:throw new a(t.method)}}(e,t)}catch(e){const t=e instanceof Error&&"string"==typeof e.message?e.message:"An unknown error occurred while handling the keyring request";throw new Error(t)}}},1309:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.emitSnapKeyringEvent=void 0,t.emitSnapKeyringEvent=async function(e,t,r){await e.request({method:"snap_manageAccounts",params:{method:t,params:{...r}}})}},1427:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.strictMask=t.definePattern=t.exactOptional=t.object=void 0;const n=r(7093);function o(e){return e.path[e.path.length-1]in e.branch[e.branch.length-2]}t.object=function(e){return(0,n.object)(e)},t.exactOptional=function(e){return new n.Struct({...e,validator:(t,r)=>!o(r)||e.validator(t,r),refiner:(t,r)=>!o(r)||e.refiner(t,r)})},t.definePattern=function(e,t){return(0,n.define)(e,(e=>"string"==typeof e&&t.test(e)))},t.strictMask=function(e,t,r){return(0,n.assert)(e,t,r),e}},6523: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(4330),t),o(r(5704),t)},4330:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringNumberStruct=t.UrlStruct=t.UuidStruct=void 0;const n=r(7093),o=r(1427);t.UuidStruct=(0,o.definePattern)("UuidV4",/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu),t.UrlStruct=(0,n.define)("Url",(e=>{try{const t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch{return!1}})),t.StringNumberStruct=(0,o.definePattern)("StringNumber",/^\d+(\.\d+)?$/u)},5704:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expectTrue=void 0,t.expectTrue=function(){}},8460:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function n(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function o(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function s(e,...t){if(!o(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function i(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 a(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function c(e,t){s(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=t.isBytes=void 0,t.number=r,t.bool=n,t.isBytes=o,t.bytes=s,t.hash=i,t.exists=a,t.output=c;const u={number:r,bool:n,bytes:s,hash:i,exists:a,output:c};t.default=u},8081:(e,t)=>{"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,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function s(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:i,l:a}=o(e[s],t);[r[s],n[s]]=[i,a]}return[r,n]}t.fromBig=o,t.split=s;const i=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);t.toBig=i;const a=(e,t,r)=>e>>>r;t.shrSH=a;const c=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=c;const u=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=u;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 h=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=h;const p=(e,t)=>t;t.rotr32H=p;const d=(e,t)=>e;t.rotr32L=d;const g=(e,t,r)=>e<<r|t>>>32-r;t.rotlSH=g;const y=(e,t,r)=>t<<r|e>>>32-r;t.rotlSL=y;const m=(e,t,r)=>t<<r-32|e>>>64-r;t.rotlBH=m;const b=(e,t,r)=>e<<r-32|t>>>64-r;function v(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:0|o}}t.rotlBL=b,t.add=v;const E=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=E;const w=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;t.add3H=w;const S=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);t.add4L=S;const A=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0;t.add4H=A;const R=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0);t.add5L=R;const I=(e,t,r,n,o,s)=>t+r+n+o+s+(e/2**32|0)|0;t.add5H=I;const O={fromBig:o,split:s,toBig:i,shrSH:a,shrSL:c,rotrSH:u,rotrSL:l,rotrBH:f,rotrBL:h,rotr32H:p,rotr32L:d,rotlSH:g,rotlSL:y,rotlBH:m,rotlBL:b,add:v,add3L:E,add3H:w,add4L:S,add4H:A,add5H:I,add5L:R};t.default=O},6910:(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},448:(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(8460),o=r(8081),s=r(9074),i=[],a=[],c=[],u=BigInt(0),l=BigInt(1),f=BigInt(2),h=BigInt(7),p=BigInt(256),d=BigInt(113);for(let e=0,t=l,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],i.push(2*(5*n+r)),a.push((e+1)*(e+2)/2%64);let o=u;for(let e=0;e<7;e++)t=(t<<l^(t>>h)*d)%p,t&f&&(o^=l<<(l<<BigInt(e))-l);c.push(o)}const[g,y]=(0,o.split)(c,!0),m=(e,t,r)=>r>32?(0,o.rotlBH)(e,t,r):(0,o.rotlSH)(e,t,r),b=(e,t,r)=>r>32?(0,o.rotlBL)(e,t,r):(0,o.rotlSL)(e,t,r);function v(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,o=(t+2)%10,s=r[o],i=r[o+1],a=m(s,i,1)^r[n],c=b(s,i,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],o=e[3];for(let r=0;r<24;r++){const n=a[r],s=m(t,o,n),c=b(t,o,n),u=i[r];t=e[u],o=e[u+1],e[u]=s,e[u+1]=c}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=g[n],e[1]^=y[n]}r.fill(0)}t.keccakP=v;class E extends s.Hash{constructor(e,t,r,o=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=o,this.rounds=i,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,s.u32)(this.state)}keccak(){s.isLE||(0,s.byteSwap32)(this.state32),v(this.state32,this.rounds),s.isLE||(0,s.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,n.exists)(this);const{blockLen:t,state:r}=this,o=(e=(0,s.toBytes)(e)).length;for(let n=0;n<o;){const s=Math.min(t-this.pos,o-n);for(let t=0;t<s;t++)r[this.pos++]^=e[n++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,0!=(128&t)&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){(0,n.exists)(this,!1),(0,n.bytes)(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,o=e.length;n<o;){this.posOut>=r&&this.keccak();const s=Math.min(r-this.posOut,o-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}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:s}=this;return e||(e=new E(t,r,n,s,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=s,e.destroyed=this.destroyed,e}}t.Keccak=E;const w=(e,t,r)=>(0,s.wrapConstructor)((()=>new E(t,e,r)));t.sha3_224=w(6,144,28),t.sha3_256=w(6,136,32),t.sha3_384=w(6,104,48),t.sha3_512=w(6,72,64),t.keccak_224=w(1,144,28),t.keccak_256=w(1,136,32),t.keccak_384=w(1,104,48),t.keccak_512=w(1,72,64);const S=(e,t,r)=>(0,s.wrapXOFConstructorWithOpts)(((n={})=>new E(t,e,void 0===n.dkLen?r:n.dkLen,!0)));t.shake128=S(31,168,16),t.shake256=S(31,136,32)},9074:(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(6910),o=r(8460);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<<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;r<e.length;r++)e[r]=(0,t.byteSwap)(e[r])};const s=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));t.bytesToHex=function(e){(0,o.bytes)(e);let t="";for(let r=0;r<e.length;r++)t+=s[e[r]];return t};const i={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function a(e){return e>=i._0&&e<=i._9?e-i._0:e>=i._A&&e<=i._F?e-(i._A-10):e>=i._a&&e<=i._f?e-(i._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 t=0,o=0;t<r;t++,o+=2){const r=a(e.charCodeAt(o)),s=a(e.charCodeAt(o+1));if(void 0===r||void 0===s){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+o)}n[t]=16*r+s}return n};function c(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function u(e){return"string"==typeof e&&(e=c(e)),(0,o.bytes)(e),e}t.nextTick=async()=>{},t.asyncLoop=async function(e,r,n){let o=Date.now();for(let s=0;s<e;s++){n(s);const e=Date.now()-o;e>=0&&e<r||(await(0,t.nextTick)(),o+=e)}},t.utf8ToBytes=c,t.toBytes=u,t.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];(0,o.bytes)(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const o=e[t];r.set(o,n),n+=o.length}return r};t.Hash=class{clone(){return this._cloneInto()}};const l={}.toString;t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!==l.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(u(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(u(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(u(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},6710:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function n(...e){const t=(e,t)=>r=>e(t(r)),r=Array.from(e).reverse().reduce(((e,r)=>e?t(e,r.encode):r.encode),void 0),n=e.reduce(((e,r)=>e?t(e,r.decode):r.decode),void 0);return{encode:r,decode:n}}function o(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map((t=>{if(r(t),t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]}))},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map((t=>{if("string"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const r=e.indexOf(t);if(-1===r)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return r}))}}}function s(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function i(e,t="="){if(r(e),"string"!=typeof t)throw new Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let e of r)if("string"!=typeof e)throw new Error(`padding.encode: non-string input=${e}`);for(;r.length*e%8;)r.push(t);return r},decode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let e of r)if("string"!=typeof e)throw new Error(`padding.decode: non-string input=${e}`);let n=r.length;if(n*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--)if(!((n-1)*e%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,n)}}}function a(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:e=>e,decode:t=>e(t)}}function c(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let o=0;const s=[],i=Array.from(e);for(i.forEach((e=>{if(r(e),e<0||e>=t)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,r=!0;for(let s=o;s<i.length;s++){const a=i[s],c=t*e+a;if(!Number.isSafeInteger(c)||t*e/t!==e||c-a!=t*e)throw new Error("convertRadix: carry overflow");e=c%n;const u=Math.floor(c/n);if(i[s]=u,!Number.isSafeInteger(u)||u*n+e!==c)throw new Error("convertRadix: carry overflow");r&&(u?r=!1:o=s)}if(s.push(e),r)break}for(let t=0;t<e.length-1&&0===e[t];t++)s.push(0);return s.reverse()}Object.defineProperty(t,"__esModule",{value:!0}),t.bytes=t.stringToBytes=t.str=t.bytesToString=t.hex=t.utf8=t.bech32m=t.bech32=t.base58check=t.base58xmr=t.base58xrp=t.base58flickr=t.base58=t.base64urlnopad=t.base64url=t.base64=t.base32crockford=t.base32hex=t.base32=t.base16=t.utils=t.assertNumber=void 0,t.assertNumber=r;const u=(e,t)=>t?u(t,e%t):e,l=(e,t)=>e+(t-u(e,t));function f(e,t,n,o){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(l(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${l(t,n)}`);let s=0,i=0;const a=2**n-1,c=[];for(const o of e){if(r(o),o>=2**t)throw new Error(`convertRadix2: invalid data word=${o} from=${t}`);if(s=s<<t|o,i+t>32)throw new Error(`convertRadix2: carry overflow pos=${i} from=${t}`);for(i+=t;i>=n;i-=n)c.push((s>>i-n&a)>>>0);s&=2**i-1}if(s=s<<n-i&a,!o&&i>=t)throw new Error("Excess padding");if(!o&&s)throw new Error(`Non-zero padding: ${s}`);return o&&i>0&&c.push(s>>>0),c}function h(e){return r(e),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return c(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of strings");return Uint8Array.from(c(t,e,256))}}}function p(e,t=!1){if(r(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(l(8,e)>32||l(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!(r instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return f(Array.from(r),8,e,!t)},decode:r=>{if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(f(r,e,8,t))}}}function d(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch(e){}}}function g(e,t){if(r(e),"function"!=typeof t)throw new Error("checksum fn should be function");return{encode(r){if(!(r instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");const n=t(r).slice(0,e),o=new Uint8Array(r.length+e);return o.set(r),o.set(n,r.length),o},decode(r){if(!(r instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");const n=r.slice(0,-e),o=t(n).slice(0,e),s=r.slice(-e);for(let t=0;t<e;t++)if(o[t]!==s[t])throw new Error("Invalid checksum");return n}}}t.utils={alphabet:o,chain:n,checksum:g,radix:h,radix2:p,join:s,padding:i},t.base16=n(p(4),o("0123456789ABCDEF"),s("")),t.base32=n(p(5),o("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),i(5),s("")),t.base32hex=n(p(5),o("0123456789ABCDEFGHIJKLMNOPQRSTUV"),i(5),s("")),t.base32crockford=n(p(5),o("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),s(""),a((e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),t.base64=n(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),i(6),s("")),t.base64url=n(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),i(6),s("")),t.base64urlnopad=n(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),s(""));const y=e=>n(h(58),o(e),s(""));t.base58=y("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),t.base58flickr=y("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),t.base58xrp=y("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const m=[0,2,3,5,6,7,9,10,11];t.base58xmr={encode(e){let r="";for(let n=0;n<e.length;n+=8){const o=e.subarray(n,n+8);r+=t.base58.encode(o).padStart(m[o.length],"1")}return r},decode(e){let r=[];for(let n=0;n<e.length;n+=11){const o=e.slice(n,n+11),s=m.indexOf(o.length),i=t.base58.decode(o);for(let e=0;e<i.length-s;e++)if(0!==i[e])throw new Error("base58xmr: wrong padding");r=r.concat(Array.from(i.slice(i.length-s)))}return Uint8Array.from(r)}};t.base58check=e=>n(g(4,(t=>e(e(t)))),t.base58);const b=n(o("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),s("")),v=[996825010,642813549,513874426,1027748829,705979059];function E(e){const t=e>>25;let r=(33554431&e)<<5;for(let e=0;e<v.length;e++)1==(t>>e&1)&&(r^=v[e]);return r}function w(e,t,r=1){const n=e.length;let o=1;for(let t=0;t<n;t++){const r=e.charCodeAt(t);if(r<33||r>126)throw new Error(`Invalid prefix (${e})`);o=E(o)^r>>5}o=E(o);for(let t=0;t<n;t++)o=E(o)^31&e.charCodeAt(t);for(let e of t)o=E(o)^e;for(let e=0;e<6;e++)o=E(o);return o^=r,b.encode(f([o%2**30],30,5,!1))}function S(e){const t="bech32"===e?1:734539939,r=p(5),n=r.decode,o=r.encode,s=d(n);function i(e,r=90){if("string"!=typeof e)throw new Error("bech32.decode input should be string, not "+typeof e);if(e.length<8||!1!==r&&e.length>r)throw new TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${r})`);const n=e.toLowerCase();if(e!==n&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const o=(e=n).lastIndexOf("1");if(0===o||-1===o)throw new Error('Letter "1" must be present between prefix and data only');const s=e.slice(0,o),i=e.slice(o+1);if(i.length<6)throw new Error("Data must be at least 6 characters long");const a=b.decode(i).slice(0,-6),c=w(s,a,t);if(!i.endsWith(c))throw new Error(`Invalid checksum in ${e}: expected "${c}"`);return{prefix:s,words:a}}return{encode:function(e,r,n=90){if("string"!=typeof e)throw new Error("bech32.encode prefix should be string, not "+typeof e);if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("bech32.encode words should be array of numbers, not "+typeof r);const o=e.length+7+r.length;if(!1!==n&&o>n)throw new TypeError(`Length ${o} exceeds limit ${n}`);const s=e.toLowerCase(),i=w(s,r,t);return`${s}1${b.encode(r)}${i}`},decode:i,decodeToBytes:function(e){const{prefix:t,words:r}=i(e,!1);return{prefix:t,words:r,bytes:n(r)}},decodeUnsafe:d(i),fromWords:n,fromWordsUnsafe:s,toWords:o}}t.bech32=S("bech32"),t.bech32m=S("bech32m"),t.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},t.hex=n(p(4),o("0123456789abcdef"),s(""),a((e=>{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})));const A={utf8:t.utf8,hex:t.hex,base16:t.base16,base32:t.base32,base64:t.base64,base64url:t.base64url,base58:t.base58,base58xmr:t.base58xmr},R="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";t.bytesToString=(e,t)=>{if("string"!=typeof e||!A.hasOwnProperty(e))throw new TypeError(R);if(!(t instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return A[e].encode(t)},t.str=t.bytesToString;t.stringToBytes=(e,t)=>{if(!A.hasOwnProperty(e))throw new TypeError(R);if("string"!=typeof t)throw new TypeError("stringToBytes() expects string");return A[e].decode(t)},t.bytes=t.stringToBytes},7991:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,s=a(e),i=s[0],c=s[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,i,c)),l=0,f=c>0?i-4:i;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[l++]=255&t);1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,s=[],i=16383,a=0,u=n-o;a<u;a+=i)s.push(c(e,a,a+i>u?u:a+i));1===o?(t=e[n-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return s.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)r[i]=s[i],n[s.charCodeAt(i)]=i;function a(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 c(e,t,n){for(var o,s,i=[],a=t;a<n;a+=3)o=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),i.push(r[(s=o)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},6586:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bech32m=t.bech32=void 0;const r="qpzry9x8gf2tvdw0s3jn54khce6mua7l",n={};for(let e=0;e<32;e++){const t=r.charAt(e);n[t]=e}function o(e){const t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function s(e){let t=1;for(let r=0;r<e.length;++r){const n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=o(t)^n>>5}t=o(t);for(let r=0;r<e.length;++r){const n=e.charCodeAt(r);t=o(t)^31&n}return t}function i(e,t,r,n){let o=0,s=0;const i=(1<<r)-1,a=[];for(let n=0;n<e.length;++n)for(o=o<<t|e[n],s+=t;s>=r;)s-=r,a.push(o>>s&i);if(n)s>0&&a.push(o<<r-s&i);else{if(s>=t)return"Excess padding";if(o<<r-s&i)return"Non-zero padding"}return a}function a(e){return i(e,8,5,!0)}function c(e){const t=i(e,5,8,!1);if(Array.isArray(t))return t}function u(e){const t=i(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}function l(e){let t;function i(e,r){if(r=r||90,e.length<8)return e+" too short";if(e.length>r)return"Exceeds length limit";const i=e.toLowerCase(),a=e.toUpperCase();if(e!==i&&e!==a)return"Mixed-case string "+e;const c=(e=i).lastIndexOf("1");if(-1===c)return"No separator character for "+e;if(0===c)return"Missing prefix for "+e;const u=e.slice(0,c),l=e.slice(c+1);if(l.length<6)return"Data too short";let f=s(u);if("string"==typeof f)return f;const h=[];for(let e=0;e<l.length;++e){const t=l.charAt(e),r=n[t];if(void 0===r)return"Unknown character "+t;f=o(f)^r,e+6>=l.length||h.push(r)}return f!==t?"Invalid checksum for "+e:{prefix:u,words:h}}return t="bech32"===e?1:734539939,{decodeUnsafe:function(e,t){const r=i(e,t);if("object"==typeof r)return r},decode:function(e,t){const r=i(e,t);if("object"==typeof r)return r;throw new Error(r)},encode:function(e,n,i){if(i=i||90,e.length+7+n.length>i)throw new TypeError("Exceeds length limit");let a=s(e=e.toLowerCase());if("string"==typeof a)throw new Error(a);let c=e+"1";for(let e=0;e<n.length;++e){const t=n[e];if(t>>5!=0)throw new Error("Non 5-bit word");a=o(a)^t,c+=r.charAt(t)}for(let e=0;e<6;++e)a=o(a);a^=t;for(let e=0;e<6;++e){c+=r.charAt(a>>5*(5-e)&31)}return c},toWords:a,fromWordsUnsafe:c,fromWords:u}}t.bech32=l("bech32"),t.bech32m=l("bech32m")},1048:(e,t,r)=>{"use strict";const n=r(7991),o=r(9318),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;const i=2147483647;function a(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(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 u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|g(e,t);let n=a(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(X(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(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(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return p(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 c.from(n,t,r);const o=function(e){if(c.isBuffer(e)){const t=0|d(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||W(e.length)?a(0):h(e);if("Buffer"===e.type&&Array.isArray(e.data))return h(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.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),a(e<0?0:0|d(e))}function h(e){const t=e.length<0?0:0|d(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function d(e){if(e>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function g(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(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 H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(o)return n?-1:H(e).length;t=(""+t).toLowerCase(),o=!0}}function y(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 $(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return C(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return I(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(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),W(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=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:v(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):v(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,o){let s,i=1,a=e.length,c=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;i=2,a/=2,c/=2,r/=2}function u(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){let n=-1;for(s=r;s<a;s++)if(u(e,s)===u(t,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===c)return n*i}else-1!==n&&(s-=s-n),n=-1}else for(r+c>a&&(r=a-c),s=r;s>=0;s--){let r=!0;for(let n=0;n<c;n++)if(u(e,s+n)!==u(t,n)){r=!1;break}if(r)return s}return-1}function E(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const s=t.length;let i;for(n>s/2&&(n=s/2),i=0;i<n;++i){const n=parseInt(t.substr(2*i,2),16);if(W(n))return i;e[r+i]=n}return i}function w(e,t,r,n){return K(H(t,e.length-r),e,r,n)}function S(e,t,r,n){return K(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function A(e,t,r,n){return K(z(t),e,r,n)}function R(e,t,r,n){return K(function(e,t){let r,n,o;const s=[];for(let i=0;i<e.length&&!((t-=2)<0);++i)r=e.charCodeAt(i),n=r>>8,o=r%256,s.push(o),s.push(n);return s}(t,e.length-r),e,r,n)}function I(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function O(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let s=null,i=t>239?4:t>223?3:t>191?2:1;if(o+i<=r){let r,n,a,c;switch(i){case 1:t<128&&(s=t);break;case 2:r=e[o+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(s=c));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:r=e[o+1],n=e[o+2],a=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(s=c))}}null===s?(s=65533,i=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=i}return function(e){const t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=_));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},c.allocUnsafe=function(e){return f(e)},c.allocUnsafeSlow=function(e){return f(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(X(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),X(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,s=Math.min(r,n);o<s;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(X(t,Uint8Array))o+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},c.byteLength=g,c.prototype._isBuffer=!0,c.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;t<e;t+=2)m(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?O(this,0,e):y.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,o){if(X(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.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 s=(o>>>=0)-(n>>>=0),i=(r>>>=0)-(t>>>=0);const a=Math.min(s,i),u=this.slice(n,o),l=e.slice(t,r);for(let e=0;e<a;++e)if(u[e]!==l[e]){s=u[e],i=l[e];break}return s<i?-1:i<s?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=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 s=!1;for(;;)switch(n){case"hex":return E(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function C(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function x(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function $(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=Y[e[n]];return o}function j(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function P(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,r,n,o,s){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function N(e,t,r,n,o){q(t,n,o,e,r,7);let s=Number(t&BigInt(4294967295));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let i=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,r}function L(e,t,r,n,o){q(t,n,o,e,r,7);let s=Number(t&BigInt(4294967295));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let i=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=i,i>>=8,e[r+2]=i,i>>=8,e[r+1]=i,i>>=8,e[r]=i,r+8}function B(e,t,r,n,o,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,t,r,n,s){return t=+t,r>>>=0,s||B(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,s){return t=+t,r>>>=0,s||B(e,0,r,8),o.write(e,t,r,n,52,8),r+8}c.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<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e],o=1,s=0;for(;++s<t&&(o*=256);)n+=this[e+s]*o;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=Z((function(e){J(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(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)<<BigInt(32))})),c.prototype.readBigUInt64BE=Z((function(e){J(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(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)<<BigInt(32))+BigInt(o)})),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e],o=1,s=0;for(;++s<t&&(o*=256);)n+=this[e+s]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=t,o=1,s=this[e+--n];for(;n>0&&(o*=256);)s+=this[e+--n]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*t)),s},c.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=Z((function(e){J(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=Z((function(e){J(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||P(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){T(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=1,s=0;for(this[t]=255&e;++s<r&&(o*=256);)this[t+s]=e/o&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){T(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=r-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(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},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(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},c.prototype.writeBigUInt64LE=Z((function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Z((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);T(this,e,t,r,n-1,-n)}let o=0,s=1,i=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===i&&0!==this[t+o-1]&&(i=1),this[t+o]=(e/s>>0)-i&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);T(this,e,t,r,n-1,-n)}let o=r-1,s=1,i=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===i&&0!==this[t+o+1]&&(i=1),this[t+o]=(e/s>>0)-i&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(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},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(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},c.prototype.writeBigInt64LE=Z((function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Z((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.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<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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<n-r&&(n=e.length-t+r);const o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const s=c.isBuffer(e)?e:c.from(e,n),i=s.length;if(0===i)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=s[o%i]}return this};const k={};function F(e,t,r){k[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function D(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function q(e,t,r,n,o,s){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=s>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(s+1)}${n}`:`>= -(2${n} ** ${8*(s+1)-1}${n}) and < 2 ** ${8*(s+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new k.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){J(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||G(t,e.length-(r+1))}(n,o,s)}function J(e,t){if("number"!=typeof e)throw new k.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,r){if(Math.floor(e)!==e)throw J(e,r),new k.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new k.ERR_BUFFER_OUT_OF_BOUNDS;throw new k.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=D(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=D(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function H(e,t){let r;t=t||1/0;const n=e.length;let o=null;const s=[];for(let i=0;i<n;++i){if(r=e.charCodeAt(i),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(i+1===n){(t-=3)>-1&&s.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&s.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.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;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function z(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function W(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 Z(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},8437:e=>{var t=1e3,r=60*t,n=60*r,o=24*n,s=7*o,i=365.25*o;function a(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}e.exports=function(e,c){c=c||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*i;case"weeks":case"week":case"w":return c*s;case"days":case"day":case"d":return c*o;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*r;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&isFinite(e))return c.long?function(e){var s=Math.abs(e);if(s>=o)return a(e,s,o,"day");if(s>=n)return a(e,s,n,"hour");if(s>=r)return a(e,s,r,"minute");if(s>=t)return a(e,s,t,"second");return e+" ms"}(e):function(e){var s=Math.abs(e);if(s>=o)return Math.round(e/o)+"d";if(s>=n)return Math.round(e/n)+"h";if(s>=r)return Math.round(e/r)+"m";if(s>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},124:(e,t,r)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))})),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e="false");return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(7891)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},7891:(e,t,r)=>{e.exports=function(e){function t(e){let r,o,s,i=null;function a(...e){if(!a.enabled)return;const n=a,o=Number(new Date),s=o-(r||o);n.diff=s,n.prev=r,n.curr=o,r=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,o)=>{if("%%"===r)return"%";i++;const s=t.formatters[o];if("function"==typeof s){const t=e[i];r=s.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(o!==t.namespaces&&(o=t.namespaces,s=t.enabled(e)),s),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(r=0;r<o;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(8437),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},282:e=>{e.exports=i,i.default=i,i.stable=l,i.stableStringify=l;var t="[...]",r="[Circular]",n=[],o=[];function s(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function i(e,t,r,i){var a;void 0===i&&(i=s()),c(e,"",0,[],void 0,0,i);try{a=0===o.length?JSON.stringify(e,t,r):JSON.stringify(e,h(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var u=n.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return a}function a(e,t,r,s){var i=Object.getOwnPropertyDescriptor(s,r);void 0!==i.get?i.configurable?(Object.defineProperty(s,r,{value:e}),n.push([s,r,t,i])):o.push([t,r,e]):(s[r]=e,n.push([s,r,t]))}function c(e,n,o,s,i,u,l){var f;if(u+=1,"object"==typeof e&&null!==e){for(f=0;f<s.length;f++)if(s[f]===e)return void a(r,e,n,i);if(void 0!==l.depthLimit&&u>l.depthLimit)return void a(t,e,n,i);if(void 0!==l.edgesLimit&&o+1>l.edgesLimit)return void a(t,e,n,i);if(s.push(e),Array.isArray(e))for(f=0;f<e.length;f++)c(e[f],f,f,s,e,u,l);else{var h=Object.keys(e);for(f=0;f<h.length;f++){var p=h[f];c(e[p],p,f,s,e,u,l)}}s.pop()}}function u(e,t){return e<t?-1:e>t?1:0}function l(e,t,r,i){void 0===i&&(i=s());var a,c=f(e,"",0,[],void 0,0,i)||e;try{a=0===o.length?JSON.stringify(c,t,r):JSON.stringify(c,h(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var u=n.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return a}function f(e,o,s,i,c,l,h){var p;if(l+=1,"object"==typeof e&&null!==e){for(p=0;p<i.length;p++)if(i[p]===e)return void a(r,e,o,c);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==h.depthLimit&&l>h.depthLimit)return void a(t,e,o,c);if(void 0!==h.edgesLimit&&s+1>h.edgesLimit)return void a(t,e,o,c);if(i.push(e),Array.isArray(e))for(p=0;p<e.length;p++)f(e[p],p,p,i,e,l,h);else{var d={},g=Object.keys(e).sort(u);for(p=0;p<g.length;p++){var y=g[p];f(e[y],y,p,i,e,l,h),d[y]=e[y]}if(void 0===c)return d;n.push([c,o,e]),c[o]=d}i.pop()}}function h(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(o.length>0)for(var n=0;n<o.length;n++){var s=o[n];if(s[1]===t&&s[0]===r){r=s[2],o.splice(n,1);break}}return e.call(this,t,r)}}},9318:(e,t)=>{t.read=function(e,t,r,n,o){var s,i,a=8*o-n-1,c=(1<<a)-1,u=c>>1,l=-7,f=r?o-1:0,h=r?-1:1,p=e[t+f];for(f+=h,s=p&(1<<-l)-1,p>>=-l,l+=a;l>0;s=256*s+e[t+f],f+=h,l-=8);for(i=s&(1<<-l)-1,s>>=-l,l+=n;l>0;i=256*i+e[t+f],f+=h,l-=8);if(0===s)s=1-u;else{if(s===c)return i?NaN:1/0*(p?-1:1);i+=Math.pow(2,n),s-=u}return(p?-1:1)*i*Math.pow(2,s-n)},t.write=function(e,t,r,n,o,s){var i,a,c,u=8*s-o-1,l=(1<<u)-1,f=l>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:s-1,d=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,i=l):(i=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-i))<1&&(i--,c*=2),(t+=i+f>=1?h/c:h*Math.pow(2,1-f))*c>=2&&(i++,c/=2),i+f>=l?(a=0,i=l):i+f>=1?(a=(t*c-1)*Math.pow(2,o),i+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,o),i=0));o>=8;e[r+p]=255&a,p+=d,a/=256,o-=8);for(i=i<<o|a,u+=o;u>0;e[r+p]=255&i,p+=d,i/=256,u-=8);e[r+p-d]|=128*g}},9756:(e,t,r)=>{"use strict";const{ErrorWithCause:n}=r(4525),{findCauseByReference:o,getErrorCause:s,messageWithCauses:i,stackWithCauses:a}=r(2197);e.exports={ErrorWithCause:n,findCauseByReference:o,getErrorCause:s,stackWithCauses:a,messageWithCauses:i}},4525:e=>{"use strict";class t extends Error{constructor(e,{cause:r}={}){super(e),this.name=t.name,r&&(this.cause=r),this.message=e}}e.exports={ErrorWithCause:t}},2197:e=>{"use strict";const t=e=>{if(e&&"object"==typeof e&&"cause"in e){if("function"==typeof e.cause){const t=e.cause();return t instanceof Error?t:void 0}return e.cause instanceof Error?e.cause:void 0}},r=(e,n)=>{if(!(e instanceof Error))return"";const o=e.stack||"";if(n.has(e))return o+"\ncauses have become circular...";const s=t(e);return s?(n.add(e),o+"\ncaused by: "+r(s,n)):o},n=(e,r,o)=>{if(!(e instanceof Error))return"";const s=o?"":e.message||"";if(r.has(e))return s+": ...";const i=t(e);if(i){r.add(e);const t="cause"in e&&"function"==typeof e.cause;return s+(t?"":": ")+n(i,r,t)}return s};e.exports={findCauseByReference:(e,r)=>{if(!e||!r)return;if(!(e instanceof Error))return;if(!(r.prototype instanceof Error)&&r!==Error)return;const n=new Set;let o=e;for(;o&&!n.has(o);){if(n.add(o),o instanceof r)return o;o=t(o)}},getErrorCause:t,stackWithCauses:e=>r(e,new Set),messageWithCauses:e=>n(e,new Set)}},1565:(e,t,r)=>{const n=Symbol("SemVer ANY");class o{static get ANY(){return n}constructor(e,t){if(t=s(t),e instanceof o){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new l(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof o))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new f(e.value,t).test(this.value):""===e.operator?""===e.value||new f(this.value,t).test(e.semver):(!(t=s(t)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(c(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(c(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}e.exports=o;const s=r(3990),{safeRe:i,t:a}=r(2841),c=r(4004),u=r(1361),l=r(4517),f=r(7476)},7476:(e,t,r)=>{class n{constructor(e,t){if(t=s(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof i)return this.raw=e.value,this.set=[[e]],this.format(),this;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((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!y(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&d)|(this.options.loose&&g))+":"+e,r=o.get(t);if(r)return r;const n=this.options.loose,s=n?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];e=e.replace(s,x(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(u[l.COMPARATORTRIM],f),a("comparator trim",e),e=e.replace(u[l.TILDETRIM],h),a("tilde trim",e),e=e.replace(u[l.CARETTRIM],p),a("caret trim",e);let c=e.split(" ").map((e=>v(e,this.options))).join(" ").split(/\s+/).map((e=>C(e,this.options)));n&&(c=c.filter((e=>(a("loose invalid filter",e,this.options),!!e.match(u[l.COMPARATORLOOSE]))))),a("range list",c);const m=new Map,b=c.map((e=>new i(e,this.options)));for(const e of b){if(y(e))return[e];m.set(e.value,e)}m.size>1&&m.has("")&&m.delete("");const E=[...m.values()];return o.set(t,E),E}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some((r=>b(r,t)&&e.set.some((e=>b(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if($(this.set[t],e,this.options))return!0;return!1}}e.exports=n;const o=new(r(9424))({max:1e3}),s=r(3990),i=r(1565),a=r(1361),c=r(4517),{safeRe:u,t:l,comparatorTrimReplace:f,tildeTrimReplace:h,caretTrimReplace:p}=r(2841),{FLAG_INCLUDE_PRERELEASE:d,FLAG_LOOSE:g}=r(9543),y=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,b=(e,t)=>{let r=!0;const n=e.slice();let o=n.pop();for(;r&&n.length;)r=n.every((e=>o.intersects(e,t))),o=n.pop();return r},v=(e,t)=>(a("comp",e,t),e=A(e,t),a("caret",e),e=w(e,t),a("tildes",e),e=I(e,t),a("xrange",e),e=_(e,t),a("stars",e),e),E=e=>!e||"x"===e.toLowerCase()||"*"===e,w=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{const r=t.loose?u[l.TILDELOOSE]:u[l.TILDE];return e.replace(r,((t,r,n,o,s)=>{let i;return a("tilde",e,t,r,n,o,s),E(r)?i="":E(n)?i=`>=${r}.0.0 <${+r+1}.0.0-0`:E(o)?i=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:s?(a("replaceTilde pr",s),i=`>=${r}.${n}.${o}-${s} <${r}.${+n+1}.0-0`):i=`>=${r}.${n}.${o} <${r}.${+n+1}.0-0`,a("tilde return",i),i}))},A=(e,t)=>e.trim().split(/\s+/).map((e=>R(e,t))).join(" "),R=(e,t)=>{a("caret",e,t);const r=t.loose?u[l.CARETLOOSE]:u[l.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,o,s,i)=>{let c;return a("caret",e,t,r,o,s,i),E(r)?c="":E(o)?c=`>=${r}.0.0${n} <${+r+1}.0.0-0`:E(s)?c="0"===r?`>=${r}.${o}.0${n} <${r}.${+o+1}.0-0`:`>=${r}.${o}.0${n} <${+r+1}.0.0-0`:i?(a("replaceCaret pr",i),c="0"===r?"0"===o?`>=${r}.${o}.${s}-${i} <${r}.${o}.${+s+1}-0`:`>=${r}.${o}.${s}-${i} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${s}-${i} <${+r+1}.0.0-0`):(a("no pr"),c="0"===r?"0"===o?`>=${r}.${o}.${s}${n} <${r}.${o}.${+s+1}-0`:`>=${r}.${o}.${s}${n} <${r}.${+o+1}.0-0`:`>=${r}.${o}.${s} <${+r+1}.0.0-0`),a("caret return",c),c}))},I=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map((e=>O(e,t))).join(" ")),O=(e,t)=>{e=e.trim();const r=t.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return e.replace(r,((r,n,o,s,i,c)=>{a("xRange",e,r,n,o,s,i,c);const u=E(o),l=u||E(s),f=l||E(i),h=f;return"="===n&&h&&(n=""),c=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&h?(l&&(s=0),i=0,">"===n?(n=">=",l?(o=+o+1,s=0,i=0):(s=+s+1,i=0)):"<="===n&&(n="<",l?o=+o+1:s=+s+1),"<"===n&&(c="-0"),r=`${n+o}.${s}.${i}${c}`):l?r=`>=${o}.0.0${c} <${+o+1}.0.0-0`:f&&(r=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),a("xRange return",r),r}))},_=(e,t)=>(a("replaceStars",e,t),e.trim().replace(u[l.STAR],"")),C=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?l.GTE0PRE:l.GTE0],"")),x=e=>(t,r,n,o,s,i,a,c,u,l,f,h,p)=>`${r=E(n)?"":E(o)?`>=${n}.0.0${e?"-0":""}`:E(s)?`>=${n}.${o}.0${e?"-0":""}`:i?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=E(u)?"":E(l)?`<${+u+1}.0.0-0`:E(f)?`<${u}.${+l+1}.0-0`:h?`<=${u}.${l}.${f}-${h}`:e?`<${u}.${l}.${+f+1}-0`:`<=${c}`}`.trim(),$=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(a(e[r].semver),e[r].semver!==i.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},4517:(e,t,r)=>{const n=r(1361),{MAX_LENGTH:o,MAX_SAFE_INTEGER:s}=r(9543),{safeRe:i,t:a}=r(2841),c=r(3990),{compareIdentifiers:u}=r(3806);class l{constructor(e,t){if(t=c(t),e instanceof l){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>o)throw new TypeError(`version is longer than ${o} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?i[a.LOOSE]:i[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof l)){if("string"==typeof e&&e===this.version)return 0;e=new l(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof l||(e=new l(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof l||(e=new l(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],o=e.prerelease[t];if(n("prerelease compare",t,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return u(r,o)}while(++t)}compareBuild(e){e instanceof l||(e=new l(e,this.options));let t=0;do{const r=this.build[t],o=e.build[t];if(n("prerelease compare",t,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return u(r,o)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=l},2281:(e,t,r)=>{const n=r(3955);e.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},4004:(e,t,r)=>{const n=r(8848),o=r(8220),s=r(9761),i=r(2386),a=r(1262),c=r(9639);e.exports=(e,t,r,u)=>{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 n(e,r,u);case"!=":return o(e,r,u);case">":return s(e,r,u);case">=":return i(e,r,u);case"<":return a(e,r,u);case"<=":return c(e,r,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},6783:(e,t,r)=>{const n=r(4517),o=r(3955),{safeRe:s,t:i}=r(2841);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){const n=t.includePrerelease?s[i.COERCERTLFULL]:s[i.COERCERTL];let o;for(;(o=n.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&o.index+o[0].length===r.index+r[0].length||(r=o),n.lastIndex=o.index+o[1].length+o[2].length;n.lastIndex=-1}else r=e.match(t.includePrerelease?s[i.COERCEFULL]:s[i.COERCE]);if(null===r)return null;const a=r[2],c=r[3]||"0",u=r[4]||"0",l=t.includePrerelease&&r[5]?`-${r[5]}`:"",f=t.includePrerelease&&r[6]?`+${r[6]}`:"";return o(`${a}.${c}.${u}${l}${f}`,t)}},6106:(e,t,r)=>{const n=r(4517);e.exports=(e,t,r)=>{const o=new n(e,r),s=new n(t,r);return o.compare(s)||o.compareBuild(s)}},2132:(e,t,r)=>{const n=r(7851);e.exports=(e,t)=>n(e,t,!0)},7851:(e,t,r)=>{const n=r(4517);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},3269:(e,t,r)=>{const n=r(3955);e.exports=(e,t)=>{const r=n(e,null,!0),o=n(t,null,!0),s=r.compare(o);if(0===s)return null;const i=s>0,a=i?r:o,c=i?o:r,u=!!a.prerelease.length;if(!!c.prerelease.length&&!u)return c.patch||c.minor?a.patch?"patch":a.minor?"minor":"major":"major";const l=u?"pre":"";return r.major!==o.major?l+"major":r.minor!==o.minor?l+"minor":r.patch!==o.patch?l+"patch":"prerelease"}},8848:(e,t,r)=>{const n=r(7851);e.exports=(e,t,r)=>0===n(e,t,r)},9761:(e,t,r)=>{const n=r(7851);e.exports=(e,t,r)=>n(e,t,r)>0},2386:(e,t,r)=>{const n=r(7851);e.exports=(e,t,r)=>n(e,t,r)>=0},8868:(e,t,r)=>{const n=r(4517);e.exports=(e,t,r,o,s)=>{"string"==typeof r&&(s=o,o=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,o,s).version}catch(e){return null}}},1262:(e,t,r)=>{const n=r(7851);e.exports=(e,t,r)=>n(e,t,r)<0},9639:(e,t,r)=>{const n=r(7851);e.exports=(e,t,r)=>n(e,t,r)<=0},6381:(e,t,r)=>{const n=r(4517);e.exports=(e,t)=>new n(e,t).major},1353:(e,t,r)=>{const n=r(4517);e.exports=(e,t)=>new n(e,t).minor},8220:(e,t,r)=>{const n=r(7851);e.exports=(e,t,r)=>0!==n(e,t,r)},3955:(e,t,r)=>{const n=r(4517);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},6082:(e,t,r)=>{const n=r(4517);e.exports=(e,t)=>new n(e,t).patch},9428:(e,t,r)=>{const n=r(3955);e.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},7555:(e,t,r)=>{const n=r(7851);e.exports=(e,t,r)=>n(t,e,r)},3810:(e,t,r)=>{const n=r(6106);e.exports=(e,t)=>e.sort(((e,r)=>n(r,e,t)))},7229:(e,t,r)=>{const n=r(7476);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},4042:(e,t,r)=>{const n=r(6106);e.exports=(e,t)=>e.sort(((e,r)=>n(e,r,t)))},8474:(e,t,r)=>{const n=r(3955);e.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}},2722:(e,t,r)=>{const n=r(2841),o=r(9543),s=r(4517),i=r(3806),a=r(3955),c=r(8474),u=r(2281),l=r(8868),f=r(3269),h=r(6381),p=r(1353),d=r(6082),g=r(9428),y=r(7851),m=r(7555),b=r(2132),v=r(6106),E=r(4042),w=r(3810),S=r(9761),A=r(1262),R=r(8848),I=r(8220),O=r(2386),_=r(9639),C=r(4004),x=r(6783),$=r(1565),j=r(7476),P=r(7229),T=r(6364),N=r(5039),L=r(5357),B=r(1280),M=r(7403),U=r(8854),k=r(7226),F=r(7183),D=r(8623),q=r(6486),J=r(583);e.exports={parse:a,valid:c,clean:u,inc:l,diff:f,major:h,minor:p,patch:d,prerelease:g,compare:y,rcompare:m,compareLoose:b,compareBuild:v,sort:E,rsort:w,gt:S,lt:A,eq:R,neq:I,gte:O,lte:_,cmp:C,coerce:x,Comparator:$,Range:j,satisfies:P,toComparators:T,maxSatisfying:N,minSatisfying:L,minVersion:B,validRange:M,outside:U,gtr:k,ltr:F,intersects:D,simplifyRange:q,subset:J,SemVer:s,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:o.SEMVER_SPEC_VERSION,RELEASE_TYPES:o.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers}},9543:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},1361:e=>{const t="object"==typeof process&&process.env&&/\bsemver\b/i.test("false")?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},3806:e=>{const t=/^[0-9]+$/,r=(e,r)=>{const n=t.test(e),o=t.test(r);return n&&o&&(e=+e,r=+r),e===r?0:n&&!o?-1:o&&!n?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},3990:e=>{const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},2841:(e,t,r)=>{const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:s}=r(9543),i=r(1361),a=(t=e.exports={}).re=[],c=t.safeRe=[],u=t.src=[],l=t.t={};let f=0;const h="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",s],[h,o]],d=(e,t,r)=>{const n=(e=>{for(const[t,r]of p)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),o=f++;i(e,o,t),l[e]=o,u[o]=t,a[o]=new RegExp(t,r?"g":void 0),c[o]=new RegExp(n,r?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),d("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),d("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",`${h}+`),d("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),d("FULL",`^${u[l.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),d("LOOSE",`^${u[l.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),d("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),d("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),d("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),d("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?`+`(?:${u[l.BUILD]})?(?:$|[^\\d])`),d("COERCERTL",u[l.COERCE],!0),d("COERCERTLFULL",u[l.COERCEFULL],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",d("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",d("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},9424:(e,t,r)=>{"use strict";const n=r(222),o=Symbol("max"),s=Symbol("length"),i=Symbol("lengthCalculator"),a=Symbol("allowStale"),c=Symbol("maxAge"),u=Symbol("dispose"),l=Symbol("noDisposeOnSet"),f=Symbol("lruList"),h=Symbol("cache"),p=Symbol("updateAgeOnGet"),d=()=>1;const g=(e,t,r)=>{const n=e[h].get(t);if(n){const t=n.value;if(y(e,t)){if(b(e,n),!e[a])return}else r&&(e[p]&&(n.value.now=Date.now()),e[f].unshiftNode(n));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[c])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[c]&&r>e[c]},m=e=>{if(e[s]>e[o])for(let t=e[f].tail;e[s]>e[o]&&null!==t;){const r=t.prev;b(e,t),t=r}},b=(e,t)=>{if(t){const r=t.value;e[u]&&e[u](r.key,r.value),e[s]-=r.length,e[h].delete(r.key),e[f].removeNode(t)}};class v{constructor(e,t,r,n,o){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=o||0}}const E=(e,t,r,n)=>{let o=r.value;y(e,o)&&(b(e,r),e[a]||(o=void 0)),o&&t.call(n,o.value,o.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[o]=e.max||1/0;const t=e.length||d;if(this[i]="function"!=typeof t?d:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[c]=e.maxAge||0,this[u]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[p]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[o]=e||1/0,m(this)}get max(){return this[o]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[c]=e,m(this)}get maxAge(){return this[c]}set lengthCalculator(e){"function"!=typeof e&&(e=d),e!==this[i]&&(this[i]=e,this[s]=0,this[f].forEach((e=>{e.length=this[i](e.value,e.key),this[s]+=e.length}))),m(this)}get lengthCalculator(){return this[i]}get length(){return this[s]}get itemCount(){return this[f].length}rforEach(e,t){t=t||this;for(let r=this[f].tail;null!==r;){const n=r.prev;E(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[f].head;null!==r;){const n=r.next;E(this,e,r,t),r=n}}keys(){return this[f].toArray().map((e=>e.key))}values(){return this[f].toArray().map((e=>e.value))}reset(){this[u]&&this[f]&&this[f].length&&this[f].forEach((e=>this[u](e.key,e.value))),this[h]=new Map,this[f]=new n,this[s]=0}dump(){return this[f].map((e=>!y(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[f]}set(e,t,r){if((r=r||this[c])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[i](t,e);if(this[h].has(e)){if(a>this[o])return b(this,this[h].get(e)),!1;const i=this[h].get(e).value;return this[u]&&(this[l]||this[u](e,i.value)),i.now=n,i.maxAge=r,i.value=t,this[s]+=a-i.length,i.length=a,this.get(e),m(this),!0}const p=new v(e,t,a,n,r);return p.length>this[o]?(this[u]&&this[u](e,t),!1):(this[s]+=p.length,this[f].unshift(p),this[h].set(e,this[f].head),m(this),!0)}has(e){if(!this[h].has(e))return!1;const t=this[h].get(e).value;return!y(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[f].tail;return e?(b(this,e),e.value):null}del(e){b(this,this[h].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],o=n.e||0;if(0===o)this.set(n.k,n.v);else{const e=o-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[h].forEach(((e,t)=>g(this,t,!1)))}}},7226:(e,t,r)=>{const n=r(8854);e.exports=(e,t,r)=>n(e,t,">",r)},8623:(e,t,r)=>{const n=r(7476);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},7183:(e,t,r)=>{const n=r(8854);e.exports=(e,t,r)=>n(e,t,"<",r)},5039:(e,t,r)=>{const n=r(4517),o=r(7476);e.exports=(e,t,r)=>{let s=null,i=null,a=null;try{a=new o(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(s&&-1!==i.compare(e)||(s=e,i=new n(s,r)))})),s}},5357:(e,t,r)=>{const n=r(4517),o=r(7476);e.exports=(e,t,r)=>{let s=null,i=null,a=null;try{a=new o(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(s&&1!==i.compare(e)||(s=e,i=new n(s,r)))})),s}},1280:(e,t,r)=>{const n=r(4517),o=r(7476),s=r(9761);e.exports=(e,t)=>{e=new o(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const o=e.set[t];let i=null;o.forEach((e=>{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!s(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||r&&!s(r,i)||(r=i)}return r&&e.test(r)?r:null}},8854:(e,t,r)=>{const n=r(4517),o=r(1565),{ANY:s}=o,i=r(7476),a=r(7229),c=r(9761),u=r(1262),l=r(9639),f=r(2386);e.exports=(e,t,r,h)=>{let p,d,g,y,m;switch(e=new n(e,h),t=new i(t,h),r){case">":p=c,d=l,g=u,y=">",m=">=";break;case"<":p=u,d=f,g=c,y="<",m="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,h))return!1;for(let r=0;r<t.set.length;++r){const n=t.set[r];let i=null,a=null;if(n.forEach((e=>{e.semver===s&&(e=new o(">=0.0.0")),i=i||e,a=a||e,p(e.semver,i.semver,h)?i=e:g(e.semver,a.semver,h)&&(a=e)})),i.operator===y||i.operator===m)return!1;if((!a.operator||a.operator===y)&&d(e,a.semver))return!1;if(a.operator===m&&g(e,a.semver))return!1}return!0}},6486:(e,t,r)=>{const n=r(7229),o=r(7851);e.exports=(e,t,r)=>{const s=[];let i=null,a=null;const c=e.sort(((e,t)=>o(e,t,r)));for(const e of c){n(e,t,r)?(a=e,i||(i=e)):(a&&s.push([i,a]),a=null,i=null)}i&&s.push([i,null]);const u=[];for(const[e,t]of s)e===t?u.push(e):t||e!==c[0]?t?e===c[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const l=u.join(" || "),f="string"==typeof t.raw?t.raw:String(t);return l.length<f.length?l:t}},583:(e,t,r)=>{const n=r(7476),o=r(1565),{ANY:s}=o,i=r(7229),a=r(7851),c=[new o(">=0.0.0-0")],u=[new o(">=0.0.0")],l=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=r.includePrerelease?c:u}if(1===t.length&&t[0].semver===s){if(r.includePrerelease)return!0;t=u}const n=new Set;let o,l,p,d,g,y,m;for(const t of e)">"===t.operator||">="===t.operator?o=f(o,t,r):"<"===t.operator||"<="===t.operator?l=h(l,t,r):n.add(t.semver);if(n.size>1)return null;if(o&&l){if(p=a(o.semver,l.semver,r),p>0)return null;if(0===p&&(">="!==o.operator||"<="!==l.operator))return null}for(const e of n){if(o&&!i(e,String(o),r))return null;if(l&&!i(e,String(l),r))return null;for(const n of t)if(!i(e,String(n),r))return!1;return!0}let b=!(!l||r.includePrerelease||!l.semver.prerelease.length)&&l.semver,v=!(!o||r.includePrerelease||!o.semver.prerelease.length)&&o.semver;b&&1===b.prerelease.length&&"<"===l.operator&&0===b.prerelease[0]&&(b=!1);for(const e of t){if(m=m||">"===e.operator||">="===e.operator,y=y||"<"===e.operator||"<="===e.operator,o)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),">"===e.operator||">="===e.operator){if(d=f(o,e,r),d===e&&d!==o)return!1}else if(">="===o.operator&&!i(o.semver,String(e),r))return!1;if(l)if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),"<"===e.operator||"<="===e.operator){if(g=h(l,e,r),g===e&&g!==l)return!1}else if("<="===l.operator&&!i(l.semver,String(e),r))return!1;if(!e.operator&&(l||o)&&0!==p)return!1}return!(o&&y&&!l&&0!==p)&&(!(l&&m&&!o&&0!==p)&&(!v&&!b))},f=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let o=!1;e:for(const n of e.set){for(const e of t.set){const t=l(n,e,r);if(o=o||null!==t,t)continue e}if(o)return!1}return!0}},6364:(e,t,r)=>{const n=r(7476);e.exports=(e,t)=>new n(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},7403:(e,t,r)=>{const n=r(7476);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},4596:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return c.default}});var n=h(r(4603)),o=h(r(9917)),s=h(r(2712)),i=h(r(3423)),a=h(r(5911)),c=h(r(4072)),u=h(r(4564)),l=h(r(6585)),f=h(r(9975));function h(e){return e&&e.__esModule?e:{default:e}}},2668:(e,t)=>{"use strict";function r(e){return 14+(e+64>>>9<<4)+1}function n(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function o(e,t,r,o,s,i){return n((a=n(n(t,e),n(o,i)))<<(c=s)|a>>>32-c,r);var a,c}function s(e,t,r,n,s,i,a){return o(t&r|~t&n,e,t,s,i,a)}function i(e,t,r,n,s,i,a){return o(t&n|r&~n,e,t,s,i,a)}function a(e,t,r,n,s,i,a){return o(t^r^n,e,t,s,i,a)}function c(e,t,r,n,s,i,a){return o(r^(t|~n),e,t,s,i,a)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){const t=[],r=32*e.length,n="0123456789abcdef";for(let o=0;o<r;o+=8){const r=e[o>>5]>>>o%32&255,s=parseInt(n.charAt(r>>>4&15)+n.charAt(15&r),16);t.push(s)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[r(t)-1]=t;let o=1732584193,u=-271733879,l=-1732584194,f=271733878;for(let t=0;t<e.length;t+=16){const r=o,h=u,p=l,d=f;o=s(o,u,l,f,e[t],7,-680876936),f=s(f,o,u,l,e[t+1],12,-389564586),l=s(l,f,o,u,e[t+2],17,606105819),u=s(u,l,f,o,e[t+3],22,-1044525330),o=s(o,u,l,f,e[t+4],7,-176418897),f=s(f,o,u,l,e[t+5],12,1200080426),l=s(l,f,o,u,e[t+6],17,-1473231341),u=s(u,l,f,o,e[t+7],22,-45705983),o=s(o,u,l,f,e[t+8],7,1770035416),f=s(f,o,u,l,e[t+9],12,-1958414417),l=s(l,f,o,u,e[t+10],17,-42063),u=s(u,l,f,o,e[t+11],22,-1990404162),o=s(o,u,l,f,e[t+12],7,1804603682),f=s(f,o,u,l,e[t+13],12,-40341101),l=s(l,f,o,u,e[t+14],17,-1502002290),u=s(u,l,f,o,e[t+15],22,1236535329),o=i(o,u,l,f,e[t+1],5,-165796510),f=i(f,o,u,l,e[t+6],9,-1069501632),l=i(l,f,o,u,e[t+11],14,643717713),u=i(u,l,f,o,e[t],20,-373897302),o=i(o,u,l,f,e[t+5],5,-701558691),f=i(f,o,u,l,e[t+10],9,38016083),l=i(l,f,o,u,e[t+15],14,-660478335),u=i(u,l,f,o,e[t+4],20,-405537848),o=i(o,u,l,f,e[t+9],5,568446438),f=i(f,o,u,l,e[t+14],9,-1019803690),l=i(l,f,o,u,e[t+3],14,-187363961),u=i(u,l,f,o,e[t+8],20,1163531501),o=i(o,u,l,f,e[t+13],5,-1444681467),f=i(f,o,u,l,e[t+2],9,-51403784),l=i(l,f,o,u,e[t+7],14,1735328473),u=i(u,l,f,o,e[t+12],20,-1926607734),o=a(o,u,l,f,e[t+5],4,-378558),f=a(f,o,u,l,e[t+8],11,-2022574463),l=a(l,f,o,u,e[t+11],16,1839030562),u=a(u,l,f,o,e[t+14],23,-35309556),o=a(o,u,l,f,e[t+1],4,-1530992060),f=a(f,o,u,l,e[t+4],11,1272893353),l=a(l,f,o,u,e[t+7],16,-155497632),u=a(u,l,f,o,e[t+10],23,-1094730640),o=a(o,u,l,f,e[t+13],4,681279174),f=a(f,o,u,l,e[t],11,-358537222),l=a(l,f,o,u,e[t+3],16,-722521979),u=a(u,l,f,o,e[t+6],23,76029189),o=a(o,u,l,f,e[t+9],4,-640364487),f=a(f,o,u,l,e[t+12],11,-421815835),l=a(l,f,o,u,e[t+15],16,530742520),u=a(u,l,f,o,e[t+2],23,-995338651),o=c(o,u,l,f,e[t],6,-198630844),f=c(f,o,u,l,e[t+7],10,1126891415),l=c(l,f,o,u,e[t+14],15,-1416354905),u=c(u,l,f,o,e[t+5],21,-57434055),o=c(o,u,l,f,e[t+12],6,1700485571),f=c(f,o,u,l,e[t+3],10,-1894986606),l=c(l,f,o,u,e[t+10],15,-1051523),u=c(u,l,f,o,e[t+1],21,-2054922799),o=c(o,u,l,f,e[t+8],6,1873313359),f=c(f,o,u,l,e[t+15],10,-30611744),l=c(l,f,o,u,e[t+6],15,-1560198380),u=c(u,l,f,o,e[t+13],21,1309151649),o=c(o,u,l,f,e[t+4],6,-145523070),f=c(f,o,u,l,e[t+11],10,-1120210379),l=c(l,f,o,u,e[t+2],15,718787259),u=c(u,l,f,o,e[t+9],21,-343485551),o=n(o,r),u=n(u,h),l=n(l,p),f=n(f,d)}return[o,u,l,f]}(function(e){if(0===e.length)return[];const t=8*e.length,n=new Uint32Array(r(t));for(let r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))};t.default=u},193:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};t.default=r},5911:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default="00000000-0000-0000-0000-000000000000"},9975:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(4564))&&n.__esModule?n:{default:n};var s=function(e){if(!(0,o.default)(e))throw TypeError("Invalid UUID");let t;const r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};t.default=s},6635:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},6470:(e,t)=>{"use strict";let r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(n)};const n=new Uint8Array(16)},4271:(e,t)=>{"use strict";function r(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function n(e,t){return e<<t|e>>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e){const t=[1518500249,1859775393,2400959708,3395469782],o=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const s=e.length/4+2,i=Math.ceil(s/16),a=new Array(i);for(let t=0;t<i;++t){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];a[t]=r}a[i-1][14]=8*(e.length-1)/Math.pow(2,32),a[i-1][14]=Math.floor(a[i-1][14]),a[i-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<i;++e){const s=new Uint32Array(80);for(let t=0;t<16;++t)s[t]=a[e][t];for(let e=16;e<80;++e)s[e]=n(s[e-3]^s[e-8]^s[e-14]^s[e-16],1);let i=o[0],c=o[1],u=o[2],l=o[3],f=o[4];for(let e=0;e<80;++e){const o=Math.floor(e/20),a=n(i,5)+r(o,c,u,l)+f+t[o]+s[e]>>>0;f=l,l=u,u=n(c,30)>>>0,c=i,i=a}o[0]=o[0]+i>>>0,o[1]=o[1]+c>>>0,o[2]=o[2]+u>>>0,o[3]=o[3]+l>>>0,o[4]=o[4]+f>>>0}return[o[0]>>24&255,o[0]>>16&255,o[0]>>8&255,255&o[0],o[1]>>24&255,o[1]>>16&255,o[1]>>8&255,255&o[1],o[2]>>24&255,o[2]>>16&255,o[2]>>8&255,255&o[2],o[3]>>24&255,o[3]>>16&255,o[3]>>8&255,255&o[3],o[4]>>24&255,o[4]>>16&255,o[4]>>8&255,255&o[4]]};t.default=o},6585:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=i;var n,o=(n=r(4564))&&n.__esModule?n:{default:n};const s=[];for(let e=0;e<256;++e)s.push((e+256).toString(16).slice(1));function i(e,t=0){return s[e[t+0]]+s[e[t+1]]+s[e[t+2]]+s[e[t+3]]+"-"+s[e[t+4]]+s[e[t+5]]+"-"+s[e[t+6]]+s[e[t+7]]+"-"+s[e[t+8]]+s[e[t+9]]+"-"+s[e[t+10]]+s[e[t+11]]+s[e[t+12]]+s[e[t+13]]+s[e[t+14]]+s[e[t+15]]}var a=function(e,t=0){const r=i(e,t);if(!(0,o.default)(r))throw TypeError("Stringified UUID is invalid");return r};t.default=a},4603:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(6470))&&n.__esModule?n:{default:n},s=r(6585);let i,a,c=0,u=0;var l=function(e,t,r){let n=t&&r||0;const l=t||new Array(16);let f=(e=e||{}).node||i,h=void 0!==e.clockseq?e.clockseq:a;if(null==f||null==h){const t=e.random||(e.rng||o.default)();null==f&&(f=i=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==h&&(h=a=16383&(t[6]<<8|t[7]))}let p=void 0!==e.msecs?e.msecs:Date.now(),d=void 0!==e.nsecs?e.nsecs:u+1;const g=p-c+(d-u)/1e4;if(g<0&&void 0===e.clockseq&&(h=h+1&16383),(g<0||p>c)&&void 0===e.nsecs&&(d=0),d>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=p,u=d,a=h,p+=122192928e5;const y=(1e4*(268435455&p)+d)%4294967296;l[n++]=y>>>24&255,l[n++]=y>>>16&255,l[n++]=y>>>8&255,l[n++]=255&y;const m=p/4294967296*1e4&268435455;l[n++]=m>>>8&255,l[n++]=255&m,l[n++]=m>>>24&15|16,l[n++]=m>>>16&255,l[n++]=h>>>8|128,l[n++]=255&h;for(let e=0;e<6;++e)l[n+e]=f[e];return t||(0,s.unsafeStringify)(l)};t.default=l},9917:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=s(r(4782)),o=s(r(2668));function s(e){return e&&e.__esModule?e:{default:e}}var i=(0,n.default)("v3",48,o.default);t.default=i},4782:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,r){function n(e,n,i,a){var c;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=(0,s.default)(n)),16!==(null===(c=n)||void 0===c?void 0:c.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+e.length);if(u.set(n),u.set(e,n.length),u=r(u),u[6]=15&u[6]|t,u[8]=63&u[8]|128,i){a=a||0;for(let e=0;e<16;++e)i[a+e]=u[e];return i}return(0,o.unsafeStringify)(u)}try{n.name=e}catch(e){}return n.DNS=i,n.URL=a,n};var n,o=r(6585),s=(n=r(9975))&&n.__esModule?n:{default:n};const i="6ba7b810-9dad-11d1-80b4-00c04fd430c8";t.DNS=i;const a="6ba7b811-9dad-11d1-80b4-00c04fd430c8";t.URL=a},2712:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(r(193)),o=i(r(6470)),s=r(6585);function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e,t,r){if(n.default.randomUUID&&!t&&!e)return n.default.randomUUID();const i=(e=e||{}).random||(e.rng||o.default)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=i[e];return t}return(0,s.unsafeStringify)(i)};t.default=a},3423:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=s(r(4782)),o=s(r(4271));function s(e){return e&&e.__esModule?e:{default:e}}var i=(0,n.default)("v5",80,o.default);t.default=i},4564:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(6635))&&n.__esModule?n:{default:n};var s=function(e){return"string"==typeof e&&o.default.test(e)};t.default=s},4072:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(4564))&&n.__esModule?n:{default:n};var s=function(e){if(!(0,o.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)};t.default=s},7047:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},222:(e,t,r)=>{"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,o=arguments.length;r<o;r++)t.push(arguments[r]);return t}function o(e,t,r){var n=t===e.head?new a(r,null,t,e):new a(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function s(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function i(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,r,n){if(!(this instanceof a))return new a(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=a,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)i(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,o=this.head;null!==o;)r.push(e.call(t,o.value,this)),o=o.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,o=this.tail;null!==o;)r.push(e.call(t,o.value,this)),o=o.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var o=0;null!==n;o++)r=e(r,n.value,o),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var o=this.length-1;null!==n;o--)r=e(r,n.value,o),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var o=0,s=this.head;null!==s&&o<e;o++)s=s.next;for(;null!==s&&o<t;o++,s=s.next)r.push(s.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var o=this.length,s=this.tail;null!==s&&o>t;o--)s=s.prev;for(;null!==s&&o>e;o--,s=s.prev)r.push(s.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,s=this.head;null!==s&&n<e;n++)s=s.next;var i=[];for(n=0;s&&n<t;n++)i.push(s.value),s=this.removeNode(s);null===s&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev);for(n=0;n<r.length;n++)s=o(this,s,r[n]);return i},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(7047)(n)}catch(e){}},6192:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertExhaustive=t.assertStruct=t.assert=t.AssertionError=void 0;const n=r(7093),o=r(4471);function s(e,t){return r=e,Boolean("string"==typeof r?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var r}class i extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}t.AssertionError=i,t.assert=function(e,t="Assertion failed.",r=i){if(!e){if(t instanceof Error)throw t;throw s(r,t)}},t.assertStruct=function(e,t,r="Assertion failed",a=i){try{(0,n.assert)(e,t)}catch(e){throw s(a,`${r}: ${function(e){return(0,o.getErrorMessage)(e).replace(/\.$/u,"")}(e)}.`)}},t.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}},6975:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.base64=void 0;const n=r(7093),o=r(6192);t.base64=(e,t={})=>{const r=t.paddingRequired??!1,s=t.characterSet??"base64";let i,a;return"base64"===s?i=String.raw`[A-Za-z0-9+\/]`:((0,o.assert)("base64url"===s),i=String.raw`[-_A-Za-z0-9]`),a=r?new RegExp(`^(?:${i}{4})*(?:${i}{3}=|${i}{2}==)?$`,"u"):new RegExp(`^(?:${i}{4})*(?:${i}{2,3}|${i}{3}=|${i}{2}==)?$`,"u"),(0,n.pattern)(e,a)}},3747:(e,t,r)=>{"use strict";var n=r(1048).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.createDataView=t.concatBytes=t.valueToBytes=t.base64ToBytes=t.stringToBytes=t.numberToBytes=t.signedBigIntToBytes=t.bigIntToBytes=t.hexToBytes=t.bytesToBase64=t.bytesToString=t.bytesToNumber=t.bytesToSignedBigInt=t.bytesToBigInt=t.bytesToHex=t.assertIsBytes=t.isBytes=void 0;const o=r(6710),s=r(6192),i=r(5209),a=48,c=58,u=87;const l=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function f(e){return e instanceof Uint8Array}function h(e){(0,s.assert)(f(e),"Value must be a Uint8Array.")}function p(e){if(h(e),0===e.length)return"0x";const t=l(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,i.add0x)(r.join(""))}function d(e){h(e);const t=p(e);return BigInt(t)}function g(e){if("0x"===e?.toLowerCase?.())return new Uint8Array;(0,i.assertIsHexString)(e);const t=(0,i.remove0x)(e).toLowerCase(),r=t.length%2==0?t:`0${t}`,n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++){const t=r.charCodeAt(2*e),o=r.charCodeAt(2*e+1),s=t-(t<c?a:u),i=o-(o<c?a:u);n[e]=16*s+i}return n}function y(e){(0,s.assert)("bigint"==typeof e,"Value must be a bigint."),(0,s.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");return g(e.toString(16))}function m(e){(0,s.assert)("number"==typeof e,"Value must be a number."),(0,s.assert)(e>=0,"Value must be a non-negative number."),(0,s.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");return g(e.toString(16))}function b(e){return(0,s.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function v(e){if("bigint"==typeof e)return y(e);if("number"==typeof e)return m(e);if("string"==typeof e)return e.startsWith("0x")?g(e):b(e);if(f(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}t.isBytes=f,t.assertIsBytes=h,t.bytesToHex=p,t.bytesToBigInt=d,t.bytesToSignedBigInt=function(e){h(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*e.length,t)},t.bytesToNumber=function(e){h(e);const t=d(e);return(0,s.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)},t.bytesToString=function(e){return h(e),(new TextDecoder).decode(e)},t.bytesToBase64=function(e){return h(e),o.base64.encode(e)},t.hexToBytes=g,t.bigIntToBytes=y,t.signedBigIntToBytes=function(e,t){(0,s.assert)("bigint"==typeof e,"Value must be a bigint."),(0,s.assert)("number"==typeof t,"Byte length must be a number."),(0,s.assert)(t>0,"Byte length must be greater than 0."),(0,s.assert)(function(e,t){(0,s.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let e=0;e<n.length;e++)n[e]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()},t.numberToBytes=m,t.stringToBytes=b,t.base64ToBytes=function(e){return(0,s.assert)("string"==typeof e,"Value must be a string."),o.base64.decode(e)},t.valueToBytes=v,t.concatBytes=function(e){const t=new Array(e.length);let r=0;for(let n=0;n<e.length;n++){const o=v(e[n]);t[n]=o,r+=o.length}const n=new Uint8Array(r);for(let e=0,r=0;e<t.length;e++)n.set(t[e],r),r+=t[e].length;return n},t.createDataView=function(e){if(void 0!==n&&e instanceof n){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}},1829:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toCaipChainId=t.parseCaipAccountId=t.parseCaipChainId=t.isCaipAssetId=t.isCaipAssetType=t.isCaipAccountAddress=t.isCaipAccountId=t.isCaipReference=t.isCaipNamespace=t.isCaipChainId=t.KnownCaipNamespace=t.CaipAssetIdStruct=t.CaipAssetTypeStruct=t.CaipAccountAddressStruct=t.CaipAccountIdStruct=t.CaipReferenceStruct=t.CaipNamespaceStruct=t.CaipChainIdStruct=t.CAIP_ASSET_ID_REGEX=t.CAIP_ASSET_TYPE_REGEX=t.CAIP_ACCOUNT_ADDRESS_REGEX=t.CAIP_ACCOUNT_ID_REGEX=t.CAIP_REFERENCE_REGEX=t.CAIP_NAMESPACE_REGEX=t.CAIP_CHAIN_ID_REGEX=void 0;const n=r(7093);function o(e){return(0,n.is)(e,t.CaipNamespaceStruct)}function s(e){return(0,n.is)(e,t.CaipReferenceStruct)}t.CAIP_CHAIN_ID_REGEX=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,t.CAIP_NAMESPACE_REGEX=/^[-a-z0-9]{3,8}$/u,t.CAIP_REFERENCE_REGEX=/^[-_a-zA-Z0-9]{1,32}$/u,t.CAIP_ACCOUNT_ID_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u,t.CAIP_ACCOUNT_ADDRESS_REGEX=/^[-.%a-zA-Z0-9]{1,128}$/u,t.CAIP_ASSET_TYPE_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u,t.CAIP_ASSET_ID_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u,t.CaipChainIdStruct=(0,n.pattern)((0,n.string)(),t.CAIP_CHAIN_ID_REGEX),t.CaipNamespaceStruct=(0,n.pattern)((0,n.string)(),t.CAIP_NAMESPACE_REGEX),t.CaipReferenceStruct=(0,n.pattern)((0,n.string)(),t.CAIP_REFERENCE_REGEX),t.CaipAccountIdStruct=(0,n.pattern)((0,n.string)(),t.CAIP_ACCOUNT_ID_REGEX),t.CaipAccountAddressStruct=(0,n.pattern)((0,n.string)(),t.CAIP_ACCOUNT_ADDRESS_REGEX),t.CaipAssetTypeStruct=(0,n.pattern)((0,n.string)(),t.CAIP_ASSET_TYPE_REGEX),t.CaipAssetIdStruct=(0,n.pattern)((0,n.string)(),t.CAIP_ASSET_ID_REGEX),function(e){e.Bip122="bip122",e.Eip155="eip155",e.Wallet="wallet"}(t.KnownCaipNamespace||(t.KnownCaipNamespace={})),t.isCaipChainId=function(e){return(0,n.is)(e,t.CaipChainIdStruct)},t.isCaipNamespace=o,t.isCaipReference=s,t.isCaipAccountId=function(e){return(0,n.is)(e,t.CaipAccountIdStruct)},t.isCaipAccountAddress=function(e){return(0,n.is)(e,t.CaipAccountAddressStruct)},t.isCaipAssetType=function(e){return(0,n.is)(e,t.CaipAssetTypeStruct)},t.isCaipAssetId=function(e){return(0,n.is)(e,t.CaipAssetIdStruct)},t.parseCaipChainId=function(e){const r=t.CAIP_CHAIN_ID_REGEX.exec(e);if(!r?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:r.groups.namespace,reference:r.groups.reference}},t.parseCaipAccountId=function(e){const r=t.CAIP_ACCOUNT_ID_REGEX.exec(e);if(!r?.groups)throw new Error("Invalid CAIP account ID.");return{address:r.groups.accountAddress,chainId:r.groups.chainId,chain:{namespace:r.groups.namespace,reference:r.groups.reference}}},t.toCaipChainId=function(e,r){if(!o(e))throw new Error(`Invalid "namespace", must match: ${t.CAIP_NAMESPACE_REGEX.toString()}`);if(!s(r))throw new Error(`Invalid "reference", must match: ${t.CAIP_REFERENCE_REGEX.toString()}`);return`${e}:${r}`}},2111:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChecksumStruct=void 0;const n=r(7093),o=r(6975);t.ChecksumStruct=(0,n.size)((0,o.base64)((0,n.string)(),{paddingRequired:!0}),44,44)},9540:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHex=t.createBytes=t.createBigInt=t.createNumber=void 0;const n=r(7093),o=r(6192),s=r(3747),i=r(5209),a=(0,n.union)([(0,n.number)(),(0,n.bigint)(),(0,n.string)(),i.StrictHexStruct]),c=(0,n.coerce)((0,n.number)(),a,Number),u=(0,n.coerce)((0,n.bigint)(),a,BigInt),l=((0,n.union)([i.StrictHexStruct,(0,n.instance)(Uint8Array)]),(0,n.coerce)((0,n.instance)(Uint8Array),(0,n.union)([i.StrictHexStruct]),s.hexToBytes)),f=(0,n.coerce)(i.StrictHexStruct,(0,n.instance)(Uint8Array),s.bytesToHex);t.createNumber=function(e){try{const t=(0,n.create)(e,c);return(0,o.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof n.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}},t.createBigInt=function(e){try{return(0,n.create)(e,u)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},t.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,n.create)(e,l)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},t.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,n.create)(e,f)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}},1393:function(e,t){"use strict";var r,n,o=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},s=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r};Object.defineProperty(t,"__esModule",{value:!0}),t.FrozenSet=t.FrozenMap=void 0;class i{get size(){return o(this,r,"f").size}[(r=new WeakMap,Symbol.iterator)](){return o(this,r,"f")[Symbol.iterator]()}constructor(e){r.set(this,void 0),s(this,r,new Map(e),"f"),Object.freeze(this)}entries(){return o(this,r,"f").entries()}forEach(e,t){return o(this,r,"f").forEach(((r,n,o)=>e.call(t,r,n,this)))}get(e){return o(this,r,"f").get(e)}has(e){return o(this,r,"f").has(e)}keys(){return o(this,r,"f").keys()}values(){return o(this,r,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}}t.FrozenMap=i;class a{get size(){return o(this,n,"f").size}[(n=new WeakMap,Symbol.iterator)](){return o(this,n,"f")[Symbol.iterator]()}constructor(e){n.set(this,void 0),s(this,n,new Set(e),"f"),Object.freeze(this)}entries(){return o(this,n,"f").entries()}forEach(e,t){return o(this,n,"f").forEach(((r,n,o)=>e.call(t,r,n,this)))}has(e){return o(this,n,"f").has(e)}keys(){return o(this,n,"f").keys()}values(){return o(this,n,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}t.FrozenSet=a,Object.freeze(i),Object.freeze(i.prototype),Object.freeze(a),Object.freeze(a.prototype)},4589:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4471:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wrapError=t.getErrorMessage=t.isErrorWithStack=t.isErrorWithMessage=t.isErrorWithCode=void 0;const n=r(9756),o=r(8990);function s(e){return"object"==typeof e&&null!==e&&"code"in e}function i(e){return"object"==typeof e&&null!==e&&"message"in e}t.isErrorWithCode=s,t.isErrorWithMessage=i,t.isErrorWithStack=function(e){return"object"==typeof e&&null!==e&&"stack"in e},t.getErrorMessage=function(e){return i(e)&&"string"==typeof e.message?e.message:(0,o.isNullOrUndefined)(e)?"":String(e)},t.wrapError=function(e,t){if((r=e)instanceof Error||(0,o.isObject)(r)&&"Error"===r.constructor.name){let r;return r=2===Error.length?new Error(t,{cause:e}):new n.ErrorWithCause(t,{cause:e}),s(e)&&(r.code=e.code),r}var r;return t.length>0?new Error(`${String(e)}: ${t}`):new Error(String(e))}},5209:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.isValidChecksumAddress=t.getChecksumAddress=t.isValidHexAddress=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.HexChecksumAddressStruct=t.HexAddressStruct=t.StrictHexStruct=t.HexStruct=void 0;const n=r(7093),o=r(448),s=r(6192),i=r(3747);function a(e){return(0,n.is)(e,t.HexStruct)}function c(e){return(0,n.is)(e,t.StrictHexStruct)}function u(e){(0,s.assert)((0,n.is)(e,t.HexChecksumAddressStruct),"Invalid hex address.");const r=f(e.toLowerCase()),a=f((0,i.bytesToHex)((0,o.keccak_256)(r)));return`0x${r.split("").map(((e,t)=>{const r=a[t];return(0,s.assert)((0,n.is)(r,(0,n.string)()),"Hash shorter than address."),parseInt(r,16)>7?e.toUpperCase():e})).join("")}`}function l(e){return!!(0,n.is)(e,t.HexChecksumAddressStruct)&&u(e)===e}function f(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}t.HexStruct=(0,n.pattern)((0,n.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]+$/iu),t.HexAddressStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]{40}$/u),t.HexChecksumAddressStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-fA-F]{40}$/u),t.isHexString=a,t.isStrictHexString=c,t.assertIsHexString=function(e){(0,s.assert)(a(e),"Value must be a hexadecimal string.")},t.assertIsStrictHexString=function(e){(0,s.assert)(c(e),'Value must be a hexadecimal string, starting with "0x".')},t.isValidHexAddress=function(e){return(0,n.is)(e,t.HexAddressStruct)||l(e)},t.getChecksumAddress=u,t.isValidChecksumAddress=l,t.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},t.remove0x=f},90: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(6192),t),o(r(6975),t),o(r(3747),t),o(r(1829),t),o(r(2111),t),o(r(9540),t),o(r(1393),t),o(r(4589),t),o(r(4471),t),o(r(5209),t),o(r(9220),t),o(r(493),t),o(r(3153),t),o(r(8990),t),o(r(3981),t),o(r(171),t),o(r(4401),t),o(r(5185),t),o(r(6314),t),o(r(1493),t)},9220:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.getJsonSize=t.getSafeJson=t.isValidJson=t.JsonStruct=t.UnsafeJsonStruct=t.exactOptional=t.object=void 0;const n=r(7093),o=r(6192),s=r(8990);function i({path:e,branch:t}){const r=e[e.length-1];return(0,s.hasProperty)(t[t.length-2],r)}function a(e){return new n.Struct({...e,type:`optional ${e.type}`,validator:(t,r)=>!i(r)||e.validator(t,r),refiner:(t,r)=>!i(r)||e.refiner(t,r)})}t.object=e=>(0,n.object)(e),t.exactOptional=a;function c(e){return(0,n.create)(e,t.JsonStruct)}t.UnsafeJsonStruct=(0,n.union)([(0,n.literal)(null),(0,n.boolean)(),(0,n.define)("finite number",(e=>(0,n.is)(e,(0,n.number)())&&Number.isFinite(e))),(0,n.string)(),(0,n.array)((0,n.lazy)((()=>t.UnsafeJsonStruct))),(0,n.record)((0,n.string)(),(0,n.lazy)((()=>t.UnsafeJsonStruct)))]),t.JsonStruct=(0,n.coerce)(t.UnsafeJsonStruct,(0,n.any)(),(e=>((0,o.assertStruct)(e,t.UnsafeJsonStruct),JSON.parse(JSON.stringify(e,((e,t)=>{if("__proto__"!==e&&"constructor"!==e)return t})))))),t.isValidJson=function(e){try{return c(e),!0}catch{return!1}},t.getSafeJson=c,t.getJsonSize=function(e){(0,o.assertStruct)(e,t.JsonStruct,"Invalid JSON value");const r=JSON.stringify(e);return(new TextEncoder).encode(r).byteLength},t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,n.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,n.nullable)((0,n.union)([(0,n.number)(),(0,n.string)()])),t.JsonRpcErrorStruct=(0,t.object)({code:(0,n.integer)(),message:(0,n.string)(),data:a(t.JsonStruct),stack:a((0,n.string)())}),t.JsonRpcParamsStruct=(0,n.union)([(0,n.record)((0,n.string)(),t.JsonStruct),(0,n.array)(t.JsonStruct)]),t.JsonRpcRequestStruct=(0,t.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,n.string)(),params:a(t.JsonRpcParamsStruct)}),t.JsonRpcNotificationStruct=(0,t.object)({jsonrpc:t.JsonRpcVersionStruct,method:(0,n.string)(),params:a(t.JsonRpcParamsStruct)}),t.isJsonRpcNotification=function(e){return(0,n.is)(e,t.JsonRpcNotificationStruct)},t.assertIsJsonRpcNotification=function(e,r){(0,o.assertStruct)(e,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",r)},t.isJsonRpcRequest=function(e){return(0,n.is)(e,t.JsonRpcRequestStruct)},t.assertIsJsonRpcRequest=function(e,r){(0,o.assertStruct)(e,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",r)},t.PendingJsonRpcResponseStruct=(0,n.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,n.optional)((0,n.unknown)()),error:(0,n.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,t.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,t.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,n.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]),t.isPendingJsonRpcResponse=function(e){return(0,n.is)(e,t.PendingJsonRpcResponseStruct)},t.assertIsPendingJsonRpcResponse=function(e,r){(0,o.assertStruct)(e,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",r)},t.isJsonRpcResponse=function(e){return(0,n.is)(e,t.JsonRpcResponseStruct)},t.assertIsJsonRpcResponse=function(e,r){(0,o.assertStruct)(e,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",r)},t.isJsonRpcSuccess=function(e){return(0,n.is)(e,t.JsonRpcSuccessStruct)},t.assertIsJsonRpcSuccess=function(e,r){(0,o.assertStruct)(e,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",r)},t.isJsonRpcFailure=function(e){return(0,n.is)(e,t.JsonRpcFailureStruct)},t.assertIsJsonRpcFailure=function(e,r){(0,o.assertStruct)(e,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",r)},t.isJsonRpcError=function(e){return(0,n.is)(e,t.JsonRpcErrorStruct)},t.assertIsJsonRpcError=function(e,r){(0,o.assertStruct)(e,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",r)},t.getJsonRpcIdValidator=function(e){const{permitEmptyString:t,permitFractions:r,permitNull:n}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return e=>Boolean("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||n&&null===e)}},493:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3153: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.createModuleLogger=t.createProjectLogger=void 0;const o=(0,n(r(124)).default)("metamask");t.createProjectLogger=function(e){return o.extend(e)},t.createModuleLogger=function(e,t){return e.extend(t)}},8990:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.getKnownPropertyNames=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0,t.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},t.isNullOrUndefined=function(e){return null==e},t.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)};function r(e){return e.charCodeAt(0)<=127}t.hasProperty=(e,t)=>Object.hasOwnProperty.call(e,t),t.getKnownPropertyNames=function(e){return Object.getOwnPropertyNames(e)},function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,t.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}},t.isASCII=r,t.calculateStringSize=function(e){return e.split("").reduce(((e,t)=>r(t)?e+1:e+2),0)+(e.match(t.ESCAPE_CHARACTERS_REGEXP)??[]).length},t.calculateNumberSize=function(e){return e.toString().length}},3981:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBigInt=t.hexToNumber=t.bigIntToHex=t.numberToHex=void 0;const n=r(6192),o=r(5209);t.numberToHex=e=>((0,n.assert)("number"==typeof e,"Value must be a number."),(0,n.assert)(e>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,o.add0x)(e.toString(16)));t.bigIntToHex=e=>((0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)(e>=0,"Value must be a non-negative bigint."),(0,o.add0x)(e.toString(16)));t.hexToNumber=e=>{(0,o.assertIsHexString)(e);const t=parseInt(e,16);return(0,n.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};t.hexToBigInt=e=>((0,o.assertIsHexString)(e),BigInt((0,o.add0x)(e)))},171:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4401:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDeferredPromise=void 0,t.createDeferredPromise=function({suppressUnhandledRejection:e=!1}={}){let t,r;const n=new Promise(((e,n)=>{t=e,r=n}));return e&&n.catch((e=>{})),{promise:n,resolve:t,reject:r}}},5185:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(e){e[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const r=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};t.inMilliseconds=function(e,t){return r(e,"count"),e*t},t.timeSince=function(e){return r(e,"timestamp"),Date.now()-e}},6314:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1493:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const n=r(7093),o=r(2722),s=r(6192);t.VersionStruct=(0,n.refine)((0,n.string)(),"Version",(e=>null!==(0,o.valid)(e)||`Expected SemVer version, got "${e}"`)),t.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",(e=>null!==(0,o.validRange)(e)||`Expected SemVer range, got "${e}"`)),t.isValidSemVerVersion=function(e){return(0,n.is)(e,t.VersionStruct)},t.isValidSemVerRange=function(e){return(0,n.is)(e,t.VersionRangeStruct)},t.assertIsSemVerVersion=function(e){(0,s.assertStruct)(e,t.VersionStruct)},t.assertIsSemVerRange=function(e){(0,s.assertStruct)(e,t.VersionRangeStruct)},t.gtVersion=function(e,t){return(0,o.gt)(e,t)},t.gtRange=function(e,t){return(0,o.gtr)(e,t)},t.satisfiesVersionRange=function(e,t){return(0,o.satisfies)(e,t,{includePrerelease:!0})}},3111:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StructError=void 0;class r extends TypeError{constructor(e,t){let r;const{message:n,explanation:o,...s}=e,{path:i}=e,a=0===i.length?n:`At path: ${i.join(".")} -- ${n}`;super(o??a),null!=o&&(this.cause=a),Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}t.StructError=r},7093: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(3111),t),o(r(172),t),o(r(145),t),o(r(5636),t),o(r(5573),t),o(r(6174),t)},172:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validate=t.is=t.mask=t.create=t.assert=t.Struct=void 0;const n=r(3111),o=r(2062);function s(e,t,r){const n=u(e,t,{message:r});if(n[0])throw n[0]}function i(e,t,r){const n=u(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function a(e,t,r){const n=u(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function c(e,t){return!u(e,t)[0]}function u(e,t,r={}){const s=(0,o.run)(e,t,r),i=(0,o.shiftIterator)(s);if(i[0]){return[new n.StructError(i[0],(function*(){for(const e of s)e[0]&&(yield e[0])})),void 0]}return[void 0,i[1]]}t.Struct=class{constructor(e){const{type:t,schema:r,validator:n,refiner:s,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)=>{const r=n(e,t);return(0,o.toFailures)(r,t,this,e)}:()=>[],this.refiner=s?(e,t)=>{const r=s(e,t);return(0,o.toFailures)(r,t,this,e)}:()=>[]}assert(e,t){return s(e,this,t)}create(e,t){return i(e,this,t)}is(e){return c(e,this)}mask(e,t){return a(e,this,t)}validate(e,t={}){return u(e,this,t)}},t.assert=s,t.create=i,t.mask=a,t.is=c,t.validate=u},145:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trimmed=t.defaulted=t.coerce=void 0;const n=r(172),o=r(2062),s=r(5573);function i(e,t,r){return new n.Struct({...e,coercer:(o,s)=>(0,n.is)(o,t)?e.coercer(r(o,s),s):e.coercer(o,s)})}t.coerce=i,t.defaulted=function(e,t,r={}){return i(e,(0,s.unknown)(),(e=>{const n="function"==typeof t?t():t;if(void 0===e)return n;if(!r.strict&&(0,o.isPlainObject)(e)&&(0,o.isPlainObject)(n)){const t={...e};let r=!1;for(const e in n)void 0===t[e]&&(t[e]=n[e],r=!0);if(r)return t}return e}))},t.trimmed=function(e){return i(e,(0,s.string)(),(e=>e.trim()))}},5636:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.refine=t.size=t.pattern=t.nonempty=t.min=t.max=t.empty=void 0;const n=r(172),o=r(2062);function s(e){return e instanceof Map||e instanceof Set?e.size:e.length}function i(e,t,r){return new n.Struct({...e,*refiner(n,s){yield*e.refiner(n,s);const i=r(n,s),a=(0,o.toFailures)(i,s,e,n);for(const e of a)yield{...e,refinement:t}}})}t.empty=function(e){return i(e,"empty",(t=>{const r=s(t);return 0===r||`Expected an empty ${e.type} but received one with a size of \`${r}\``}))},t.max=function(e,t,r={}){const{exclusive:n}=r;return i(e,"max",(r=>n?r<t:r<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${r}\``))},t.min=function(e,t,r={}){const{exclusive:n}=r;return i(e,"min",(r=>n?r>t:r>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${r}\``))},t.nonempty=function(e){return i(e,"nonempty",(t=>s(t)>0||`Expected a nonempty ${e.type} but received an empty one`))},t.pattern=function(e,t){return i(e,"pattern",(r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`))},t.size=function(e,t,r=t){const n=`Expected a ${e.type}`,o=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return i(e,"size",(e=>{if("number"==typeof e||e instanceof Date)return t<=e&&e<=r||`${n} ${o} but received \`${e}\``;if(e instanceof Map||e instanceof Set){const{size:s}=e;return t<=s&&s<=r||`${n} with a size ${o} but received one with a size of \`${s}\``}const{length:s}=e;return t<=s&&s<=r||`${n} with a length ${o} but received one with a length of \`${s}\``}))},t.refine=i},5573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unknown=t.union=t.type=t.tuple=t.string=t.set=t.regexp=t.record=t.optional=t.object=t.number=t.nullable=t.never=t.map=t.literal=t.intersection=t.integer=t.instance=t.func=t.enums=t.date=t.boolean=t.bigint=t.array=t.any=void 0;const n=r(172),o=r(2062),s=r(6174);function i(){return(0,s.define)("never",(()=>!1))}t.any=function(){return(0,s.define)("any",(()=>!0))},t.array=function(e){return new n.Struct({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: ${(0,o.print)(e)}`})},t.bigint=function(){return(0,s.define)("bigint",(e=>"bigint"==typeof e))},t.boolean=function(){return(0,s.define)("boolean",(e=>"boolean"==typeof e))},t.date=function(){return(0,s.define)("date",(e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${(0,o.print)(e)}`))},t.enums=function(e){const t={},r=e.map((e=>(0,o.print)(e))).join();for(const r of e)t[r]=r;return new n.Struct({type:"enums",schema:t,validator:t=>e.includes(t)||`Expected one of \`${r}\`, but received: ${(0,o.print)(t)}`})},t.func=function(){return(0,s.define)("func",(e=>"function"==typeof e||`Expected a function, but received: ${(0,o.print)(e)}`))},t.instance=function(e){return(0,s.define)("instance",(t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${(0,o.print)(t)}`))},t.integer=function(){return(0,s.define)("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${(0,o.print)(e)}`))},t.intersection=function(e){return new n.Struct({type:"intersection",schema:null,*entries(t,r){for(const{entries:n}of e)yield*n(t,r)},*validator(t,r){for(const{validator:n}of e)yield*n(t,r)},*refiner(t,r){for(const{refiner:n}of e)yield*n(t,r)}})},t.literal=function(e){const t=(0,o.print)(e),r=typeof e;return new n.Struct({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${(0,o.print)(r)}`})},t.map=function(e,t){return new n.Struct({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,o]of r.entries())yield[n,n,e],yield[n,o,t]},coercer:e=>e instanceof Map?new Map(e):e,validator:e=>e instanceof Map||`Expected a \`Map\` object, but received: ${(0,o.print)(e)}`})},t.never=i,t.nullable=function(e){return new n.Struct({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})},t.number=function(){return(0,s.define)("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${(0,o.print)(e)}`))},t.object=function(e){const t=e?Object.keys(e):[],r=i();return new n.Struct({type:"object",schema:e??null,*entries(n){if(e&&(0,o.isObject)(n)){const o=new Set(Object.keys(n));for(const r of t)o.delete(r),yield[r,n[r],e[r]];for(const e of o)yield[e,n[e],r]}},validator:e=>(0,o.isObject)(e)||`Expected an object, but received: ${(0,o.print)(e)}`,coercer:e=>(0,o.isObject)(e)?{...e}:e})},t.optional=function(e){return new n.Struct({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})},t.record=function(e,t){return new n.Struct({type:"record",schema:null,*entries(r){if((0,o.isObject)(r))for(const n in r){const o=r[n];yield[n,n,e],yield[n,o,t]}},validator:e=>(0,o.isObject)(e)||`Expected an object, but received: ${(0,o.print)(e)}`})},t.regexp=function(){return(0,s.define)("regexp",(e=>e instanceof RegExp))},t.set=function(e){return new n.Struct({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer:e=>e instanceof Set?new Set(e):e,validator:e=>e instanceof Set||`Expected a \`Set\` object, but received: ${(0,o.print)(e)}`})},t.string=function(){return(0,s.define)("string",(e=>"string"==typeof e||`Expected a string, but received: ${(0,o.print)(e)}`))},t.tuple=function(e){const t=i();return new n.Struct({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let o=0;o<n;o++)yield[o,r[o],e[o]||t]}},validator:e=>Array.isArray(e)||`Expected an array, but received: ${(0,o.print)(e)}`})},t.type=function(e){const t=Object.keys(e);return new n.Struct({type:"type",schema:e,*entries(r){if((0,o.isObject)(r))for(const n of t)yield[n,r[n],e[n]]},validator:e=>(0,o.isObject)(e)||`Expected an object, but received: ${(0,o.print)(e)}`,coercer:e=>(0,o.isObject)(e)?{...e}:e})},t.union=function(e){const t=e.map((e=>e.type)).join(" | ");return new n.Struct({type:"union",schema:null,coercer(t){for(const r of e){const[e,n]=r.validate(t,{coerce:!0});if(!e)return n}return t},validator(r,n){const s=[];for(const t of e){const[...e]=(0,o.run)(r,t,n),[i]=e;if(!i?.[0])return[];for(const[t]of e)t&&s.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${(0,o.print)(r)}`,...s]}})},t.unknown=function(){return(0,s.define)("unknown",(()=>!0))}},6174:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pick=t.partial=t.omit=t.lazy=t.dynamic=t.deprecated=t.define=t.assign=void 0;const n=r(172),o=r(5573);t.assign=function(...e){const t="type"===e[0]?.type,r=e.map((({schema:e})=>e)),n=Object.assign({},...r);return t?(0,o.type)(n):(0,o.object)(n)},t.define=function(e,t){return new n.Struct({type:e,schema:null,validator:t})},t.deprecated=function(e,t){return new n.Struct({...e,refiner:(t,r)=>void 0===t||e.refiner(t,r),validator:(r,n)=>void 0===r||(t(r,n),e.validator(r,n))})},t.dynamic=function(e){return new n.Struct({type:"dynamic",schema:null,*entries(t,r){const n=e(t,r);yield*n.entries(t,r)},validator:(t,r)=>e(t,r).validator(t,r),coercer:(t,r)=>e(t,r).coercer(t,r),refiner:(t,r)=>e(t,r).refiner(t,r)})},t.lazy=function(e){let t;return new n.Struct({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator:(r,n)=>(t??(t=e()),t.validator(r,n)),coercer:(r,n)=>(t??(t=e()),t.coercer(r,n)),refiner:(r,n)=>(t??(t=e()),t.refiner(r,n))})},t.omit=function(e,t){const{schema:r}=e,n={...r};for(const e of t)delete n[e];return"type"===e.type?(0,o.type)(n):(0,o.object)(n)},t.partial=function(e){const t=e instanceof n.Struct,r=t?{...e.schema}:{...e};for(const e in r)r[e]=(0,o.optional)(r[e]);return t&&"type"===e.type?(0,o.type)(r):(0,o.object)(r)},t.pick=function(e,t){const{schema:r}=e,n={};for(const e of t)n[e]=r[e];return"type"===e.type?(0,o.type)(n):(0,o.object)(n)}},2062:(e,t)=>{"use strict";function r(e){return"object"==typeof e&&null!==e}function n(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function o(e,t,r,o){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:s,branch:i}=t,{type:a}=r,{refinement:c,message:u=`Expected a value of type \`${a}\`${c?` with refinement \`${c}\``:""}, but received: \`${n(o)}\``}=e;return{value:o,type:a,refinement:c,key:s[s.length-1],path:s,branch:i,...e,message:u}}Object.defineProperty(t,"__esModule",{value:!0}),t.run=t.toFailures=t.toFailure=t.shiftIterator=t.print=t.isPlainObject=t.isObject=void 0,t.isObject=r,t.isPlainObject=function(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},t.print=n,t.shiftIterator=function(e){const{done:t,value:r}=e.next();return t?void 0:r},t.toFailure=o,t.toFailures=function*(e,t,n,s){(function(e){return r(e)&&"function"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const r of e){const e=o(r,t,n,s);e&&(yield e)}},t.run=function*e(t,n,o={}){const{path:s=[],branch:i=[t],coerce:a=!1,mask:c=!1}=o,u={path:s,branch:i};if(a&&(t=n.coercer(t,u),c&&"type"!==n.type&&r(n.schema)&&r(t)&&!Array.isArray(t)))for(const e in t)void 0===n.schema[e]&&delete t[e];let l="valid";for(const e of n.validator(t,u))e.explanation=o.message,l="not_valid",yield[e,void 0];for(let[f,h,p]of n.entries(t,u)){const n=e(h,p,{path:void 0===f?s:[...s,f],branch:void 0===f?i:[...i,h],coerce:a,mask:c,message:o.message});for(const e of n)e[0]?(l=null===e[0].refinement||void 0===e[0].refinement?"not_valid":"not_refined",yield[e[0],void 0]):a&&(h=e[1],void 0===f?t=h:t instanceof Map?t.set(f,h):t instanceof Set?t.add(h):r(t)&&(void 0!==h||f in t)&&(t[f]=h))}if("not_valid"!==l)for(const e of n.refiner(t,u))e.explanation=o.message,l="not_refined",yield[e,void 0];"valid"===l&&(yield[void 0,t])}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}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.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})};var n={};(()=>{"use strict";r.r(n),r.d(n,{onKeyringRequest:()=>_t,onRpcRequest:()=>Ot,validateOrigin:()=>Rt});var e=r(4105),t={invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},o={userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901},s={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};function i(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)}const a=(e,t)=>Object.hasOwnProperty.call(e,t);var c;!function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(c=c||(c={}));class u extends TypeError{constructor(e,t){let r;const{message:n,explanation:o,...s}=e,{path:i}=e,a=0===i.length?n:`At path: ${i.join(".")} -- ${n}`;super(o??a),null!=o&&(this.cause=a),Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function l(e){return"object"==typeof e&&null!==e}function f(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function h(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:o,branch:s}=t,{type:i}=r,{refinement:a,message:c=`Expected a value of type \`${i}\`${a?` with refinement \`${a}\``:""}, but received: \`${f(n)}\``}=e;return{value:n,type:i,refinement:a,key:o[o.length-1],path:o,branch:s,...e,message:c}}function*p(e,t,r,n){(function(e){return l(e)&&"function"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const o of e){const e=h(o,t,r,n);e&&(yield e)}}function*d(e,t,r={}){const{path:n=[],branch:o=[e],coerce:s=!1,mask:i=!1}=r,a={path:n,branch:o};if(s&&(e=t.coercer(e,a),i&&"type"!==t.type&&l(t.schema)&&l(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let c="valid";for(const n of t.validator(e,a))n.explanation=r.message,c="not_valid",yield[n,void 0];for(let[u,f,h]of t.entries(e,a)){const t=d(f,h,{path:void 0===u?n:[...n,u],branch:void 0===u?o:[...o,f],coerce:s,mask:i,message:r.message});for(const r of t)r[0]?(c=null===r[0].refinement||void 0===r[0].refinement?"not_valid":"not_refined",yield[r[0],void 0]):s&&(f=r[1],void 0===u?e=f:e instanceof Map?e.set(u,f):e instanceof Set?e.add(f):l(e)&&(void 0!==f||u in e)&&(e[u]=f))}if("not_valid"!==c)for(const n of t.refiner(e,a))n.explanation=r.message,c="not_refined",yield[n,void 0];"valid"===c&&(yield[void 0,e])}class g{constructor(e){const{type:t,schema:r,validator:n,refiner:o,coercer:s=(e=>e),entries:i=function*(){}}=e;this.type=t,this.schema=r,this.entries=i,this.coercer=s,this.validator=n?(e,t)=>p(n(e,t),t,this,e):()=>[],this.refiner=o?(e,t)=>p(o(e,t),t,this,e):()=>[]}assert(e,t){return y(e,this,t)}create(e,t){return m(e,this,t)}is(e){return b(e,this)}mask(e,t){return function(e,t,r){const n=v(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}(e,this,t)}validate(e,t={}){return v(e,this,t)}}function y(e,t,r){const n=v(e,t,{message:r});if(n[0])throw n[0]}function m(e,t,r){const n=v(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function b(e,t){return!v(e,t)[0]}function v(e,t,r={}){const n=d(e,t,r),o=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);if(o[0]){return[new u(o[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]}return[void 0,o[1]]}function E(e,t){return new g({type:e,schema:null,validator:t})}function w(e){let t;return new g({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator:(r,n)=>(t??(t=e()),t.validator(r,n)),coercer:(r,n)=>(t??(t=e()),t.coercer(r,n)),refiner:(r,n)=>(t??(t=e()),t.refiner(r,n))})}function S(){return E("any",(()=>!0))}function A(e){return new g({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: ${f(e)}`})}function R(){return E("boolean",(e=>"boolean"==typeof e))}function I(){return E("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${f(e)}`))}function O(e){const t=f(e),r=typeof e;return new g({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${f(r)}`})}function _(){return E("never",(()=>!1))}function C(e){return new g({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})}function x(){return E("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${f(e)}`))}function $(e){const t=e?Object.keys(e):[],r=_();return new g({type:"object",schema:e??null,*entries(n){if(e&&l(n)){const o=new Set(Object.keys(n));for(const r of t)o.delete(r),yield[r,n[r],e[r]];for(const e of o)yield[e,n[e],r]}},validator:e=>l(e)||`Expected an object, but received: ${f(e)}`,coercer:e=>l(e)?{...e}:e})}function j(e){return new g({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function P(e,t){return new g({type:"record",schema:null,*entries(r){if(l(r))for(const n in r){const o=r[n];yield[n,n,e],yield[n,o,t]}},validator:e=>l(e)||`Expected an object, but received: ${f(e)}`})}function T(){return E("string",(e=>"string"==typeof e||`Expected a string, but received: ${f(e)}`))}function N(e){const t=e.map((e=>e.type)).join(" | ");return new g({type:"union",schema:null,coercer(t){for(const r of e){const[e,n]=r.validate(t,{coerce:!0});if(!e)return n}return t},validator(r,n){const o=[];for(const t of e){const[...e]=d(r,t,n),[s]=e;if(!s?.[0])return[];for(const[t]of e)t&&o.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${f(r)}`,...o]}})}function L(){return E("unknown",(()=>!0))}function B(e,t,r){return new g({...e,coercer:(n,o)=>b(n,t)?e.coercer(r(n,o),o):e.coercer(n,o)})}Error;function M(e){return function(e){return function(e){return"object"==typeof e&&null!==e&&"message"in e}(e)&&"string"==typeof e.message?e.message:null==e?"":String(e)}(e).replace(/\.$/u,"")}function U(e,t){return r=e,Boolean("string"==typeof r?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var r}class k extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}const F=e=>$(e);function D({path:e,branch:t}){const r=e[e.length-1];return a(t[t.length-2],r)}function q(e){return new g({...e,type:`optional ${e.type}`,validator:(t,r)=>!D(r)||e.validator(t,r),refiner:(t,r)=>!D(r)||e.refiner(t,r)})}const J=N([O(null),R(),E("finite number",(e=>b(e,x())&&Number.isFinite(e))),T(),A(w((()=>J))),P(T(),w((()=>J)))]),G=B(J,S(),(e=>(function(e,t,r="Assertion failed",n=k){try{y(e,t)}catch(e){throw U(n,`${r}: ${M(e)}.`)}}(e,J),JSON.parse(JSON.stringify(e,((e,t)=>{if("__proto__"!==e&&"constructor"!==e)return t}))))));function V(e){try{return function(e){m(e,G)}(e),!0}catch{return!1}}const H=O("2.0"),z=C(N([x(),T()])),K=F({code:I(),message:T(),data:q(G),stack:q(T())}),X=N([P(T(),G),A(G)]);F({id:z,jsonrpc:H,method:T(),params:q(X)}),F({jsonrpc:H,method:T(),params:q(X)});$({id:z,jsonrpc:H,result:j(L()),error:j(K)});const W=F({id:z,jsonrpc:H,result:G}),Y=F({id:z,jsonrpc:H,error:K});N([W,Y]);var Z=t.internal,Q="Unspecified error message. This is a bug, please report it.",ee=(te(Z),"Unspecified server error.");function te(e,t=Q){if(function(e){return Number.isInteger(e)}(e)){const t=e.toString();if(a(s,t))return s[t].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return ee}return t}function re(e){return Array.isArray(e)?e.map((e=>V(e)?e:i(e)?ne(e):null)):i(e)?ne(e):V(e)?e:null}function ne(e){return Object.getOwnPropertyNames(e).reduce(((t,r)=>{const n=e[r];return V(n)&&(t[r]=n),t}),{})}var oe=r(282),se=class extends Error{constructor(e,t,r){var n=(...e)=>{super(...e)};if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a non-empty string.');!function(e){return i(e)&&a(e,"cause")&&i(e.cause)}(r)?n(t):(n(t,{cause:r.cause}),a(this,"cause")||Object.assign(this,{cause:r.cause})),void 0!==r&&(this.data=r),this.code=e}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data,function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}}(this.data)&&(e.data.cause=re(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return oe(this.serialize(),ae,2)}},ie=class extends se{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}};function ae(e,t){if("[Circular]"!==t)return t}var ce=e=>Re(t.parse,e),ue=e=>Re(t.invalidRequest,e),le=e=>Re(t.invalidParams,e),fe=e=>Re(t.methodNotFound,e),he=e=>Re(t.internal,e),pe=e=>Re(t.invalidInput,e),de=e=>Re(t.resourceNotFound,e),ge=e=>Re(t.resourceUnavailable,e),ye=e=>Re(t.transactionRejected,e),me=e=>Re(t.methodNotSupported,e),be=e=>Re(t.limitExceeded,e),ve=e=>Ie(o.userRejectedRequest,e),Ee=e=>Ie(o.unauthorized,e),we=e=>Ie(o.unsupportedMethod,e),Se=e=>Ie(o.disconnected,e),Ae=e=>Ie(o.chainDisconnected,e);function Re(e,t){const[r,n]=Oe(t);return new se(e,r??te(e),n)}function Ie(e,t){const[r,n]=Oe(t);return new ie(e,r??te(e),n)}function Oe(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t??void 0,r]}}return[]}function _e(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)}const Ce=(e,t)=>Object.hasOwnProperty.call(e,t);var xe;!function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(xe=xe||(xe={}));function $e(e){return function(e){return function(e){return"object"==typeof e&&null!==e&&"message"in e}(e)&&"string"==typeof e.message?e.message:null==e?"":String(e)}(e).replace(/\.$/u,"")}function je(e,t){return r=e,Boolean("string"==typeof r?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var r}class Pe extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}const Te=e=>$(e);function Ne({path:e,branch:t}){const r=e[e.length-1];return Ce(t[t.length-2],r)}function Le(e){return new g({...e,type:`optional ${e.type}`,validator:(t,r)=>!Ne(r)||e.validator(t,r),refiner:(t,r)=>!Ne(r)||e.refiner(t,r)})}const Be=N([O(null),R(),E("finite number",(e=>b(e,x())&&Number.isFinite(e))),T(),A(w((()=>Be))),P(T(),w((()=>Be)))]),Me=B(Be,S(),(e=>(function(e,t,r="Assertion failed",n=Pe){try{y(e,t)}catch(e){throw je(n,`${r}: ${$e(e)}.`)}}(e,Be),JSON.parse(JSON.stringify(e,((e,t)=>{if("__proto__"!==e&&"constructor"!==e)return t}))))));function Ue(e){try{return function(e){m(e,Me)}(e),!0}catch{return!1}}const ke=O("2.0"),Fe=C(N([x(),T()])),De=Te({code:I(),message:T(),data:Le(Me),stack:Le(T())}),qe=N([P(T(),Me),A(Me)]);Te({id:Fe,jsonrpc:ke,method:T(),params:Le(qe)}),Te({jsonrpc:ke,method:T(),params:Le(qe)});$({id:Fe,jsonrpc:ke,result:j(L()),error:j(De)});const Je=Te({id:Fe,jsonrpc:ke,result:Me}),Ge=Te({id:Fe,jsonrpc:ke,error:De});N([Je,Ge]);function Ve(e){return _e(e)&&Ce(e,"data")&&"object"==typeof e.data&&null!==e.data&&Ue(e.data)&&!Array.isArray(e.data)?e.data:{}}var He,ze,Ke,Xe,We=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},Ye=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Ze extends Error{constructor(e,t={}){const r=function(e){return _e(e)&&Ce(e,"message")&&"string"==typeof e.message?e.message:String(e)}(e);super(r),He.set(this,void 0),ze.set(this,void 0),Ke.set(this,void 0),Xe.set(this,void 0),We(this,ze,r,"f"),We(this,He,function(e){return _e(e)&&Ce(e,"code")&&"number"==typeof e.code&&Number.isInteger(e.code)?e.code:-32603}(e),"f");const n={...Ve(e),...t};Object.keys(n).length>0&&We(this,Ke,n,"f"),We(this,Xe,super.stack,"f")}get name(){return"SnapError"}get code(){return Ye(this,He,"f")}get message(){return Ye(this,ze,"f")}get data(){return Ye(this,Ke,"f")}get stack(){return Ye(this,Xe,"f")}toJSON(){return{code:-31002,message:"Snap Error",data:{cause:{code:this.code,message:this.message,stack:this.stack,...this.data?{data:this.data}:{}}}}}serialize(){return this.toJSON()}}function Qe(e){return class extends Ze{constructor(t,r){if("object"==typeof t){const r=e();return void super({code:r.code,message:r.message,data:t})}const n=e(t);super({code:n.code,message:n.message,data:r})}}}He=new WeakMap,ze=new WeakMap,Ke=new WeakMap,Xe=new WeakMap;const et=Qe(he),tt=Qe(pe),rt=Qe(le),nt=Qe(ue),ot=Qe(be),st=Qe(fe),it=Qe(me),at=Qe(ce),ct=Qe(de),ut=Qe(ge),lt=Qe(ye),ft=Qe(Ae),ht=Qe(Se),pt=Qe(Ee),dt=Qe(we),gt=Qe(ve);class yt{async get(){return await this.#e()}async set(e){await this.#t(e)}async update(e){return this.get().then((async t=>{const r=e(t);return this.set(r)}))}async#e(){return await snap.request({method:"snap_manageState",params:{operation:"get"}})}async#t(e){await snap.request({method:"snap_manageState",params:{operation:"update",newState:e}})}}Error;function mt(e){return[Ze,st,gt,it,st,at,ct,ut,lt,ft,ht,pt,dt,et,tt,rt,nt,ot].some((t=>e instanceof t))}const bt=console;var vt;vt||(vt={});const Et=new Set([e.KeyringRpcMethod.ListAccounts,e.KeyringRpcMethod.GetAccount,e.KeyringRpcMethod.GetAccountBalances,e.KeyringRpcMethod.SubmitRequest]),wt=new Set([e.KeyringRpcMethod.ListAccounts,e.KeyringRpcMethod.GetAccount,e.KeyringRpcMethod.CreateAccount,e.KeyringRpcMethod.FilterAccountChains,e.KeyringRpcMethod.DeleteAccount,e.KeyringRpcMethod.GetAccountBalances,e.KeyringRpcMethod.SubmitRequest]),St=["https://portfolio.metamask.io","https://portfolio-builds.metafi-dev.codefi.network","https://dev.portfolio.metamask.io","http://localhost:3000","https://ramps-dev.portfolio.metamask.io"],At=new Map([]);for(const e of St)At.set(e,Et);At.set("metamask",wt);const Rt=(e,t)=>{var r;if(!e)throw new pt("Origin not found");if(!(null===(r=At.get(e))||void 0===r?void 0:r.has(t)))throw new pt("Permission denied")},It=new class{#r;constructor(){this.#r=new yt}async listAccounts(){return[]}async getAccount(e){return{type:"eip155:eoa",id:"default-id",address:"default-address",options:{},methods:[]}}async createAccount(e){return{type:"eip155:eoa",id:"new-id",address:"new-address",options:{},methods:[]}}async filterAccountChains(e,t){return[]}async updateAccount(e){}async deleteAccount(e){}async submitRequest(e){return{pending:!0}}},Ot=async({origin:e,request:t})=>{try{const{method:r}=t;throw Rt(e,r),new st}catch(e){let t=e;throw mt(e)||(t=new Ze(e)),bt.error(`onRpcRequest error: ${JSON.stringify(t.toJSON(),null,2)}`),t}},_t=async({origin:t,request:r})=>{try{return Rt(t,r.method),await(0,e.handleKeyringRequest)(It,r)}catch(e){let t=e;throw mt(e)||(t=new Ze(e)),bt.error(`onKeyringRequest error: ${JSON.stringify(t.toJSON(),null,2)}`),t}}})();var o=exports;for(var s in n)o[s]=n[s];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();
|