algosdk 2.8.0 → 3.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/dist/browser/algosdk.min.js +1 -1
- package/dist/browser/algosdk.min.js.LICENSE.txt +0 -9
- package/dist/browser/algosdk.min.js.map +1 -1
- package/dist/cjs/abi/abi_type.js +34 -27
- package/dist/cjs/abi/abi_type.js.map +1 -1
- package/dist/cjs/abi/contract.js +5 -3
- package/dist/cjs/abi/contract.js.map +1 -1
- package/dist/cjs/{types/transactions/asset.js → abi/event.js} +1 -1
- package/dist/cjs/abi/event.js.map +1 -0
- package/dist/cjs/abi/index.js +6 -6
- package/dist/cjs/abi/index.js.map +1 -1
- package/dist/cjs/abi/interface.js +3 -3
- package/dist/cjs/abi/interface.js.map +1 -1
- package/dist/cjs/abi/method.js +14 -10
- package/dist/cjs/abi/method.js.map +1 -1
- package/dist/cjs/abi/reference.js +1 -1
- package/dist/cjs/abi/reference.js.map +1 -1
- package/dist/cjs/abi/transaction.js +2 -2
- package/dist/cjs/abi/transaction.js.map +1 -1
- package/dist/cjs/account.js +4 -4
- package/dist/cjs/account.js.map +1 -1
- package/dist/cjs/boxStorage.js +17 -17
- package/dist/cjs/boxStorage.js.map +1 -1
- package/dist/cjs/client/client.js +77 -41
- package/dist/cjs/client/client.js.map +1 -1
- package/dist/cjs/client/index.js +29 -0
- package/dist/cjs/client/index.js.map +1 -0
- package/dist/cjs/client/kmd.js +69 -86
- package/dist/cjs/client/kmd.js.map +1 -1
- package/dist/cjs/client/urlTokenBaseHTTPClient.js +16 -11
- package/dist/cjs/client/urlTokenBaseHTTPClient.js.map +1 -1
- package/dist/cjs/client/v2/algod/accountApplicationInformation.js +11 -7
- package/dist/cjs/client/v2/algod/accountApplicationInformation.js.map +1 -1
- package/dist/cjs/client/v2/algod/accountAssetInformation.js +11 -7
- package/dist/cjs/client/v2/algod/accountAssetInformation.js.map +1 -1
- package/dist/cjs/client/v2/algod/accountInformation.js +11 -6
- package/dist/cjs/client/v2/algod/accountInformation.js.map +1 -1
- package/dist/cjs/client/v2/algod/algod.js +85 -83
- package/dist/cjs/client/v2/algod/algod.js.map +1 -1
- package/dist/cjs/client/v2/algod/block.js +6 -33
- package/dist/cjs/client/v2/algod/block.js.map +1 -1
- package/dist/cjs/client/v2/algod/compile.js +17 -11
- package/dist/cjs/client/v2/algod/compile.js.map +1 -1
- package/dist/cjs/client/v2/algod/disassemble.js +17 -11
- package/dist/cjs/client/v2/algod/disassemble.js.map +1 -1
- package/dist/cjs/client/v2/algod/dryrun.js +18 -37
- package/dist/cjs/client/v2/algod/dryrun.js.map +1 -1
- package/dist/cjs/client/v2/algod/genesis.js +6 -2
- package/dist/cjs/client/v2/algod/genesis.js.map +1 -1
- package/dist/cjs/client/v2/algod/getApplicationBoxByName.js +10 -10
- package/dist/cjs/client/v2/algod/getApplicationBoxByName.js.map +1 -1
- package/dist/cjs/client/v2/algod/getApplicationBoxes.js +8 -8
- package/dist/cjs/client/v2/algod/getApplicationBoxes.js.map +1 -1
- package/dist/cjs/client/v2/algod/getApplicationByID.js +10 -5
- package/dist/cjs/client/v2/algod/getApplicationByID.js.map +1 -1
- package/dist/cjs/client/v2/algod/getAssetByID.js +10 -5
- package/dist/cjs/client/v2/algod/getAssetByID.js.map +1 -1
- package/dist/cjs/client/v2/algod/getBlockHash.js +10 -6
- package/dist/cjs/client/v2/algod/getBlockHash.js.map +1 -1
- package/dist/cjs/client/v2/algod/getBlockOffsetTimestamp.js +6 -5
- package/dist/cjs/client/v2/algod/getBlockOffsetTimestamp.js.map +1 -1
- package/dist/cjs/client/v2/algod/getBlockTxids.js +10 -4
- package/dist/cjs/client/v2/algod/getBlockTxids.js.map +1 -1
- package/dist/cjs/client/v2/algod/getLedgerStateDelta.js +11 -6
- package/dist/cjs/client/v2/algod/getLedgerStateDelta.js.map +1 -1
- package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +11 -6
- package/dist/cjs/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js.map +1 -1
- package/dist/cjs/client/v2/algod/getSyncRound.js +6 -5
- package/dist/cjs/client/v2/algod/getSyncRound.js.map +1 -1
- package/dist/cjs/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js +9 -9
- package/dist/cjs/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -1
- package/dist/cjs/client/v2/algod/getTransactionProof.js +10 -6
- package/dist/cjs/client/v2/algod/getTransactionProof.js.map +1 -1
- package/dist/cjs/client/v2/algod/healthCheck.js +4 -9
- package/dist/cjs/client/v2/algod/healthCheck.js.map +1 -1
- package/dist/cjs/{types → client/v2/algod}/index.js +5 -3
- package/dist/cjs/client/v2/algod/index.js.map +1 -0
- package/dist/cjs/client/v2/algod/lightBlockHeaderProof.js +10 -5
- package/dist/cjs/client/v2/algod/lightBlockHeaderProof.js.map +1 -1
- package/dist/cjs/client/v2/algod/models/types.js +3712 -1824
- package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
- package/dist/cjs/client/v2/algod/pendingTransactionInformation.js +6 -32
- package/dist/cjs/client/v2/algod/pendingTransactionInformation.js.map +1 -1
- package/dist/cjs/client/v2/algod/pendingTransactions.js +6 -31
- package/dist/cjs/client/v2/algod/pendingTransactions.js.map +1 -1
- package/dist/cjs/client/v2/algod/pendingTransactionsByAddress.js +7 -33
- package/dist/cjs/client/v2/algod/pendingTransactionsByAddress.js.map +1 -1
- package/dist/cjs/client/v2/algod/ready.js +4 -2
- package/dist/cjs/client/v2/algod/ready.js.map +1 -1
- package/dist/cjs/client/v2/algod/sendRawTransaction.js +17 -8
- package/dist/cjs/client/v2/algod/sendRawTransaction.js.map +1 -1
- package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js +13 -8
- package/dist/cjs/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -1
- package/dist/cjs/client/v2/algod/setSyncRound.js +13 -8
- package/dist/cjs/client/v2/algod/setSyncRound.js.map +1 -1
- package/dist/cjs/client/v2/algod/simulateTransaction.js +15 -35
- package/dist/cjs/client/v2/algod/simulateTransaction.js.map +1 -1
- package/dist/cjs/client/v2/algod/stateproof.js +10 -5
- package/dist/cjs/client/v2/algod/stateproof.js.map +1 -1
- package/dist/cjs/client/v2/algod/status.js +8 -2
- package/dist/cjs/client/v2/algod/status.js.map +1 -1
- package/dist/cjs/client/v2/algod/statusAfterBlock.js +10 -5
- package/dist/cjs/client/v2/algod/statusAfterBlock.js.map +1 -1
- package/dist/cjs/client/v2/algod/suggestedParams.js +13 -9
- package/dist/cjs/client/v2/algod/suggestedParams.js.map +1 -1
- package/dist/cjs/client/v2/algod/supply.js +8 -2
- package/dist/cjs/client/v2/algod/supply.js.map +1 -1
- package/dist/cjs/client/v2/algod/unsetSyncRound.js +11 -5
- package/dist/cjs/client/v2/algod/unsetSyncRound.js.map +1 -1
- package/dist/cjs/client/v2/algod/versions.js +8 -2
- package/dist/cjs/client/v2/algod/versions.js.map +1 -1
- package/dist/cjs/client/v2/indexer/index.js +22 -0
- package/dist/cjs/client/v2/indexer/index.js.map +1 -0
- package/dist/cjs/client/v2/indexer/indexer.js +44 -43
- package/dist/cjs/client/v2/indexer/indexer.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountAppLocalStates.js +11 -6
- package/dist/cjs/client/v2/indexer/lookupAccountAppLocalStates.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountAssets.js +11 -6
- package/dist/cjs/client/v2/indexer/lookupAccountAssets.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountByID.js +11 -6
- package/dist/cjs/client/v2/indexer/lookupAccountByID.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountCreatedApplications.js +11 -6
- package/dist/cjs/client/v2/indexer/lookupAccountCreatedApplications.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountCreatedAssets.js +11 -6
- package/dist/cjs/client/v2/indexer/lookupAccountCreatedAssets.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js +19 -12
- package/dist/cjs/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupApplicationBoxByIDandName.js +10 -10
- package/dist/cjs/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupApplicationLogs.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupApplicationLogs.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupApplications.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupApplications.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAssetBalances.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupAssetBalances.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAssetByID.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupAssetByID.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js +19 -12
- package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupBlock.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupBlock.js.map +1 -1
- package/dist/cjs/client/v2/indexer/lookupTransactionByID.js +10 -5
- package/dist/cjs/client/v2/indexer/lookupTransactionByID.js.map +1 -1
- package/dist/cjs/client/v2/indexer/makeHealthCheck.js +8 -2
- package/dist/cjs/client/v2/indexer/makeHealthCheck.js.map +1 -1
- package/dist/cjs/client/v2/indexer/models/types.js +3591 -1651
- package/dist/cjs/client/v2/indexer/models/types.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchAccounts.js +9 -3
- package/dist/cjs/client/v2/indexer/searchAccounts.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchForApplicationBoxes.js +8 -8
- package/dist/cjs/client/v2/indexer/searchForApplicationBoxes.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchForApplications.js +9 -3
- package/dist/cjs/client/v2/indexer/searchForApplications.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchForAssets.js +9 -3
- package/dist/cjs/client/v2/indexer/searchForAssets.js.map +1 -1
- package/dist/cjs/client/v2/indexer/searchForTransactions.js +17 -9
- package/dist/cjs/client/v2/indexer/searchForTransactions.js.map +1 -1
- package/dist/cjs/client/v2/jsonrequest.js +22 -54
- package/dist/cjs/client/v2/jsonrequest.js.map +1 -1
- package/dist/cjs/client/v2/serviceClient.js +5 -25
- package/dist/cjs/client/v2/serviceClient.js.map +1 -1
- package/dist/cjs/client/v2/untypedmodel.js +22 -0
- package/dist/cjs/client/v2/untypedmodel.js.map +1 -0
- package/dist/cjs/composer.js +64 -58
- package/dist/cjs/composer.js.map +1 -1
- package/dist/cjs/convert.js.map +1 -1
- package/dist/cjs/dryrun.js +107 -203
- package/dist/cjs/dryrun.js.map +1 -1
- package/dist/cjs/encoding/address.js +88 -104
- package/dist/cjs/encoding/address.js.map +1 -1
- package/dist/cjs/encoding/bigint.js +2 -3
- package/dist/cjs/encoding/bigint.js.map +1 -1
- package/dist/cjs/encoding/binarydata.js +82 -0
- package/dist/cjs/encoding/binarydata.js.map +1 -0
- package/dist/cjs/encoding/encoding.js +353 -38
- package/dist/cjs/encoding/encoding.js.map +1 -1
- package/dist/cjs/encoding/schema/address.js +41 -0
- package/dist/cjs/encoding/schema/address.js.map +1 -0
- package/dist/cjs/encoding/schema/array.js +43 -0
- package/dist/cjs/encoding/schema/array.js.map +1 -0
- package/dist/cjs/encoding/schema/binarystring.js +55 -0
- package/dist/cjs/encoding/schema/binarystring.js.map +1 -0
- package/dist/cjs/encoding/schema/blockhash.js +67 -0
- package/dist/cjs/encoding/schema/blockhash.js.map +1 -0
- package/dist/cjs/encoding/schema/boolean.js +42 -0
- package/dist/cjs/encoding/schema/boolean.js.map +1 -0
- package/dist/cjs/encoding/schema/bytearray.js +98 -0
- package/dist/cjs/encoding/schema/bytearray.js.map +1 -0
- package/dist/cjs/encoding/schema/index.js +34 -0
- package/dist/cjs/encoding/schema/index.js.map +1 -0
- package/dist/cjs/encoding/schema/map.js +528 -0
- package/dist/cjs/encoding/schema/map.js.map +1 -0
- package/dist/cjs/encoding/schema/optional.js +58 -0
- package/dist/cjs/encoding/schema/optional.js.map +1 -0
- package/dist/cjs/encoding/schema/string.js +43 -0
- package/dist/cjs/encoding/schema/string.js.map +1 -0
- package/dist/cjs/encoding/schema/uint64.js +36 -0
- package/dist/cjs/encoding/schema/uint64.js.map +1 -0
- package/dist/cjs/encoding/schema/untyped.js +33 -0
- package/dist/cjs/encoding/schema/untyped.js.map +1 -0
- package/dist/cjs/encoding/uint64.js +2 -2
- package/dist/cjs/encoding/uint64.js.map +1 -1
- package/dist/cjs/group.js +23 -60
- package/dist/cjs/group.js.map +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/logic/sourcemap.js +56 -25
- package/dist/cjs/logic/sourcemap.js.map +1 -1
- package/dist/cjs/logicsig.js +113 -146
- package/dist/cjs/logicsig.js.map +1 -1
- package/dist/cjs/main.js +113 -122
- package/dist/cjs/main.js.map +1 -1
- package/dist/cjs/makeTxn.js +320 -554
- package/dist/cjs/makeTxn.js.map +1 -1
- package/dist/cjs/mnemonic/mnemonic.js +8 -8
- package/dist/cjs/mnemonic/mnemonic.js.map +1 -1
- package/dist/cjs/multisig.js +60 -312
- package/dist/cjs/multisig.js.map +1 -1
- package/dist/cjs/multisigSigning.js +285 -0
- package/dist/cjs/multisigSigning.js.map +1 -0
- package/dist/cjs/nacl/naclWrappers.js +2 -2
- package/dist/cjs/nacl/naclWrappers.js.map +1 -1
- package/dist/cjs/signedTransaction.js +106 -0
- package/dist/cjs/signedTransaction.js.map +1 -0
- package/dist/cjs/signer.js +7 -7
- package/dist/cjs/signer.js.map +1 -1
- package/dist/cjs/signing.js +105 -0
- package/dist/cjs/signing.js.map +1 -0
- package/dist/cjs/stateproof.js +421 -0
- package/dist/cjs/stateproof.js.map +1 -0
- package/dist/cjs/transaction.js +724 -1009
- package/dist/cjs/transaction.js.map +1 -1
- package/dist/cjs/types/block.js +813 -0
- package/dist/cjs/types/block.js.map +1 -0
- package/dist/cjs/types/intDecoding.js +1 -1
- package/dist/cjs/types/intDecoding.js.map +1 -1
- package/dist/cjs/types/statedelta.js +1155 -0
- package/dist/cjs/types/statedelta.js.map +1 -0
- package/dist/cjs/types/transactions/base.js +22 -5
- package/dist/cjs/types/transactions/base.js.map +1 -1
- package/dist/cjs/types/transactions/encoded.js +67 -0
- package/dist/cjs/types/transactions/encoded.js.map +1 -1
- package/dist/cjs/types/transactions/index.js +2 -5
- package/dist/cjs/types/transactions/index.js.map +1 -1
- package/dist/cjs/utils/utils.js +86 -22
- package/dist/cjs/utils/utils.js.map +1 -1
- package/dist/cjs/wait.js +4 -4
- package/dist/cjs/wait.js.map +1 -1
- package/dist/esm/abi/abi_type.js +22 -15
- package/dist/esm/abi/abi_type.js.map +1 -1
- package/dist/esm/abi/contract.js +3 -1
- package/dist/esm/abi/contract.js.map +1 -1
- package/dist/esm/abi/event.js +2 -0
- package/dist/esm/abi/event.js.map +1 -0
- package/dist/esm/abi/index.js +6 -6
- package/dist/esm/abi/index.js.map +1 -1
- package/dist/esm/abi/interface.js +1 -1
- package/dist/esm/abi/interface.js.map +1 -1
- package/dist/esm/abi/method.js +8 -4
- package/dist/esm/abi/method.js.map +1 -1
- package/dist/esm/abi/transaction.js +1 -1
- package/dist/esm/abi/transaction.js.map +1 -1
- package/dist/esm/account.js +4 -4
- package/dist/esm/account.js.map +1 -1
- package/dist/esm/boxStorage.js +15 -15
- package/dist/esm/boxStorage.js.map +1 -1
- package/dist/esm/client/client.js +74 -40
- package/dist/esm/client/client.js.map +1 -1
- package/dist/esm/client/index.js +7 -0
- package/dist/esm/client/index.js.map +1 -0
- package/dist/esm/client/kmd.js +67 -62
- package/dist/esm/client/kmd.js.map +1 -1
- package/dist/esm/client/urlTokenBaseHTTPClient.js +16 -11
- package/dist/esm/client/urlTokenBaseHTTPClient.js.map +1 -1
- package/dist/esm/client/v2/algod/accountApplicationInformation.js +10 -6
- package/dist/esm/client/v2/algod/accountApplicationInformation.js.map +1 -1
- package/dist/esm/client/v2/algod/accountAssetInformation.js +10 -6
- package/dist/esm/client/v2/algod/accountAssetInformation.js.map +1 -1
- package/dist/esm/client/v2/algod/accountInformation.js +10 -5
- package/dist/esm/client/v2/algod/accountInformation.js.map +1 -1
- package/dist/esm/client/v2/algod/algod.js +71 -70
- package/dist/esm/client/v2/algod/algod.js.map +1 -1
- package/dist/esm/client/v2/algod/block.js +5 -9
- package/dist/esm/client/v2/algod/block.js.map +1 -1
- package/dist/esm/client/v2/algod/compile.js +16 -10
- package/dist/esm/client/v2/algod/compile.js.map +1 -1
- package/dist/esm/client/v2/algod/disassemble.js +16 -10
- package/dist/esm/client/v2/algod/disassemble.js.map +1 -1
- package/dist/esm/client/v2/algod/dryrun.js +16 -12
- package/dist/esm/client/v2/algod/dryrun.js.map +1 -1
- package/dist/esm/client/v2/algod/genesis.js +5 -1
- package/dist/esm/client/v2/algod/genesis.js.map +1 -1
- package/dist/esm/client/v2/algod/getApplicationBoxByName.js +9 -9
- package/dist/esm/client/v2/algod/getApplicationBoxByName.js.map +1 -1
- package/dist/esm/client/v2/algod/getApplicationBoxes.js +7 -7
- package/dist/esm/client/v2/algod/getApplicationBoxes.js.map +1 -1
- package/dist/esm/client/v2/algod/getApplicationByID.js +9 -4
- package/dist/esm/client/v2/algod/getApplicationByID.js.map +1 -1
- package/dist/esm/client/v2/algod/getAssetByID.js +9 -4
- package/dist/esm/client/v2/algod/getAssetByID.js.map +1 -1
- package/dist/esm/client/v2/algod/getBlockHash.js +9 -5
- package/dist/esm/client/v2/algod/getBlockHash.js.map +1 -1
- package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js +5 -4
- package/dist/esm/client/v2/algod/getBlockOffsetTimestamp.js.map +1 -1
- package/dist/esm/client/v2/algod/getBlockTxids.js +9 -3
- package/dist/esm/client/v2/algod/getBlockTxids.js.map +1 -1
- package/dist/esm/client/v2/algod/getLedgerStateDelta.js +10 -5
- package/dist/esm/client/v2/algod/getLedgerStateDelta.js.map +1 -1
- package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js +10 -5
- package/dist/esm/client/v2/algod/getLedgerStateDeltaForTransactionGroup.js.map +1 -1
- package/dist/esm/client/v2/algod/getSyncRound.js +5 -4
- package/dist/esm/client/v2/algod/getSyncRound.js.map +1 -1
- package/dist/esm/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js +8 -8
- package/dist/esm/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.js.map +1 -1
- package/dist/esm/client/v2/algod/getTransactionProof.js +9 -5
- package/dist/esm/client/v2/algod/getTransactionProof.js.map +1 -1
- package/dist/esm/client/v2/algod/healthCheck.js +3 -8
- package/dist/esm/client/v2/algod/healthCheck.js.map +1 -1
- package/dist/esm/client/v2/algod/index.js +4 -0
- package/dist/esm/client/v2/algod/index.js.map +1 -0
- package/dist/esm/client/v2/algod/lightBlockHeaderProof.js +9 -4
- package/dist/esm/client/v2/algod/lightBlockHeaderProof.js.map +1 -1
- package/dist/esm/client/v2/algod/models/types.js +3712 -1821
- package/dist/esm/client/v2/algod/models/types.js.map +1 -1
- package/dist/esm/client/v2/algod/pendingTransactionInformation.js +5 -8
- package/dist/esm/client/v2/algod/pendingTransactionInformation.js.map +1 -1
- package/dist/esm/client/v2/algod/pendingTransactions.js +5 -7
- package/dist/esm/client/v2/algod/pendingTransactions.js.map +1 -1
- package/dist/esm/client/v2/algod/pendingTransactionsByAddress.js +6 -9
- package/dist/esm/client/v2/algod/pendingTransactionsByAddress.js.map +1 -1
- package/dist/esm/client/v2/algod/ready.js +3 -1
- package/dist/esm/client/v2/algod/ready.js.map +1 -1
- package/dist/esm/client/v2/algod/sendRawTransaction.js +15 -6
- package/dist/esm/client/v2/algod/sendRawTransaction.js.map +1 -1
- package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js +12 -7
- package/dist/esm/client/v2/algod/setBlockOffsetTimestamp.js.map +1 -1
- package/dist/esm/client/v2/algod/setSyncRound.js +12 -7
- package/dist/esm/client/v2/algod/setSyncRound.js.map +1 -1
- package/dist/esm/client/v2/algod/simulateTransaction.js +14 -11
- package/dist/esm/client/v2/algod/simulateTransaction.js.map +1 -1
- package/dist/esm/client/v2/algod/stateproof.js +9 -4
- package/dist/esm/client/v2/algod/stateproof.js.map +1 -1
- package/dist/esm/client/v2/algod/status.js +7 -1
- package/dist/esm/client/v2/algod/status.js.map +1 -1
- package/dist/esm/client/v2/algod/statusAfterBlock.js +9 -4
- package/dist/esm/client/v2/algod/statusAfterBlock.js.map +1 -1
- package/dist/esm/client/v2/algod/suggestedParams.js +12 -8
- package/dist/esm/client/v2/algod/suggestedParams.js.map +1 -1
- package/dist/esm/client/v2/algod/supply.js +7 -1
- package/dist/esm/client/v2/algod/supply.js.map +1 -1
- package/dist/esm/client/v2/algod/unsetSyncRound.js +10 -4
- package/dist/esm/client/v2/algod/unsetSyncRound.js.map +1 -1
- package/dist/esm/client/v2/algod/versions.js +7 -1
- package/dist/esm/client/v2/algod/versions.js.map +1 -1
- package/dist/esm/client/v2/indexer/index.js +4 -0
- package/dist/esm/client/v2/indexer/index.js.map +1 -0
- package/dist/esm/client/v2/indexer/indexer.js +42 -42
- package/dist/esm/client/v2/indexer/indexer.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountAppLocalStates.js +10 -5
- package/dist/esm/client/v2/indexer/lookupAccountAppLocalStates.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountAssets.js +10 -5
- package/dist/esm/client/v2/indexer/lookupAccountAssets.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountByID.js +10 -5
- package/dist/esm/client/v2/indexer/lookupAccountByID.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountCreatedApplications.js +10 -5
- package/dist/esm/client/v2/indexer/lookupAccountCreatedApplications.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountCreatedAssets.js +10 -5
- package/dist/esm/client/v2/indexer/lookupAccountCreatedAssets.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAccountTransactions.js +18 -11
- package/dist/esm/client/v2/indexer/lookupAccountTransactions.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupApplicationBoxByIDandName.js +9 -9
- package/dist/esm/client/v2/indexer/lookupApplicationBoxByIDandName.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupApplicationLogs.js +9 -4
- package/dist/esm/client/v2/indexer/lookupApplicationLogs.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupApplications.js +9 -4
- package/dist/esm/client/v2/indexer/lookupApplications.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAssetBalances.js +9 -4
- package/dist/esm/client/v2/indexer/lookupAssetBalances.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAssetByID.js +9 -4
- package/dist/esm/client/v2/indexer/lookupAssetByID.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupAssetTransactions.js +17 -10
- package/dist/esm/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupBlock.js +9 -4
- package/dist/esm/client/v2/indexer/lookupBlock.js.map +1 -1
- package/dist/esm/client/v2/indexer/lookupTransactionByID.js +9 -4
- package/dist/esm/client/v2/indexer/lookupTransactionByID.js.map +1 -1
- package/dist/esm/client/v2/indexer/makeHealthCheck.js +7 -1
- package/dist/esm/client/v2/indexer/makeHealthCheck.js.map +1 -1
- package/dist/esm/client/v2/indexer/models/types.js +3591 -1648
- package/dist/esm/client/v2/indexer/models/types.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchAccounts.js +8 -2
- package/dist/esm/client/v2/indexer/searchAccounts.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchForApplicationBoxes.js +7 -7
- package/dist/esm/client/v2/indexer/searchForApplicationBoxes.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchForApplications.js +8 -2
- package/dist/esm/client/v2/indexer/searchForApplications.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchForAssets.js +8 -2
- package/dist/esm/client/v2/indexer/searchForAssets.js.map +1 -1
- package/dist/esm/client/v2/indexer/searchForTransactions.js +15 -7
- package/dist/esm/client/v2/indexer/searchForTransactions.js.map +1 -1
- package/dist/esm/client/v2/jsonrequest.js +22 -51
- package/dist/esm/client/v2/jsonrequest.js.map +1 -1
- package/dist/esm/client/v2/serviceClient.js +3 -20
- package/dist/esm/client/v2/serviceClient.js.map +1 -1
- package/dist/esm/client/v2/untypedmodel.js +18 -0
- package/dist/esm/client/v2/untypedmodel.js.map +1 -0
- package/dist/esm/composer.js +43 -37
- package/dist/esm/composer.js.map +1 -1
- package/dist/esm/convert.js.map +1 -1
- package/dist/esm/dryrun.js +98 -195
- package/dist/esm/dryrun.js.map +1 -1
- package/dist/esm/encoding/address.js +85 -100
- package/dist/esm/encoding/address.js.map +1 -1
- package/dist/esm/encoding/bigint.js +2 -3
- package/dist/esm/encoding/bigint.js.map +1 -1
- package/dist/esm/encoding/binarydata.js +73 -0
- package/dist/esm/encoding/binarydata.js.map +1 -0
- package/dist/esm/encoding/encoding.js +337 -12
- package/dist/esm/encoding/encoding.js.map +1 -1
- package/dist/esm/encoding/schema/address.js +37 -0
- package/dist/esm/encoding/schema/address.js.map +1 -0
- package/dist/esm/encoding/schema/array.js +39 -0
- package/dist/esm/encoding/schema/array.js.map +1 -0
- package/dist/esm/encoding/schema/binarystring.js +51 -0
- package/dist/esm/encoding/schema/binarystring.js.map +1 -0
- package/dist/esm/encoding/schema/blockhash.js +60 -0
- package/dist/esm/encoding/schema/blockhash.js.map +1 -0
- package/dist/esm/encoding/schema/boolean.js +38 -0
- package/dist/esm/encoding/schema/boolean.js.map +1 -0
- package/dist/esm/encoding/schema/bytearray.js +93 -0
- package/dist/esm/encoding/schema/bytearray.js.map +1 -0
- package/dist/esm/encoding/schema/index.js +12 -0
- package/dist/esm/encoding/schema/index.js.map +1 -0
- package/dist/esm/encoding/schema/map.js +517 -0
- package/dist/esm/encoding/schema/map.js.map +1 -0
- package/dist/esm/encoding/schema/optional.js +54 -0
- package/dist/esm/encoding/schema/optional.js.map +1 -0
- package/dist/esm/encoding/schema/string.js +39 -0
- package/dist/esm/encoding/schema/string.js.map +1 -0
- package/dist/esm/encoding/schema/uint64.js +32 -0
- package/dist/esm/encoding/schema/uint64.js.map +1 -0
- package/dist/esm/encoding/schema/untyped.js +29 -0
- package/dist/esm/encoding/schema/untyped.js.map +1 -0
- package/dist/esm/encoding/uint64.js +1 -1
- package/dist/esm/encoding/uint64.js.map +1 -1
- package/dist/esm/group.js +22 -58
- package/dist/esm/group.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/logic/sourcemap.js +54 -23
- package/dist/esm/logic/sourcemap.js.map +1 -1
- package/dist/esm/logicsig.js +110 -141
- package/dist/esm/logicsig.js.map +1 -1
- package/dist/esm/main.js +47 -76
- package/dist/esm/main.js.map +1 -1
- package/dist/esm/makeTxn.js +314 -513
- package/dist/esm/makeTxn.js.map +1 -1
- package/dist/esm/mnemonic/mnemonic.js +5 -5
- package/dist/esm/mnemonic/mnemonic.js.map +1 -1
- package/dist/esm/multisig.js +56 -305
- package/dist/esm/multisig.js.map +1 -1
- package/dist/esm/multisigSigning.js +254 -0
- package/dist/esm/multisigSigning.js.map +1 -0
- package/dist/esm/nacl/naclWrappers.js +1 -1
- package/dist/esm/nacl/naclWrappers.js.map +1 -1
- package/dist/esm/package.json +1 -0
- package/dist/esm/signedTransaction.js +100 -0
- package/dist/esm/signedTransaction.js.map +1 -0
- package/dist/esm/signer.js +3 -3
- package/dist/esm/signer.js.map +1 -1
- package/dist/esm/signing.js +77 -0
- package/dist/esm/signing.js.map +1 -0
- package/dist/esm/stateproof.js +408 -0
- package/dist/esm/stateproof.js.map +1 -0
- package/dist/esm/transaction.js +723 -1005
- package/dist/esm/transaction.js.map +1 -1
- package/dist/esm/types/block.js +797 -0
- package/dist/esm/types/block.js.map +1 -0
- package/dist/esm/types/intDecoding.js +1 -1
- package/dist/esm/types/intDecoding.js.map +1 -1
- package/dist/esm/types/statedelta.js +1129 -0
- package/dist/esm/types/statedelta.js.map +1 -0
- package/dist/esm/types/transactions/base.js +18 -2
- package/dist/esm/types/transactions/base.js.map +1 -1
- package/dist/esm/types/transactions/encoded.js +62 -1
- package/dist/esm/types/transactions/encoded.js.map +1 -1
- package/dist/esm/types/transactions/index.js +2 -3
- package/dist/esm/types/transactions/index.js.map +1 -1
- package/dist/esm/utils/utils.js +80 -21
- package/dist/esm/utils/utils.js.map +1 -1
- package/dist/esm/wait.js +4 -4
- package/dist/esm/wait.js.map +1 -1
- package/dist/types/abi/abi_type.d.ts +1 -1
- package/dist/types/abi/contract.d.ts +5 -1
- package/dist/types/abi/event.d.ts +16 -0
- package/dist/types/abi/index.d.ts +6 -6
- package/dist/types/abi/interface.d.ts +1 -1
- package/dist/types/abi/method.d.ts +12 -5
- package/dist/types/abi/transaction.d.ts +1 -1
- package/dist/types/account.d.ts +1 -1
- package/dist/types/boxStorage.d.ts +4 -5
- package/dist/types/client/baseHTTPClient.d.ts +9 -6
- package/dist/types/client/client.d.ts +59 -18
- package/dist/types/client/index.d.ts +5 -0
- package/dist/types/client/kmd.d.ts +12 -10
- package/dist/types/client/urlTokenBaseHTTPClient.d.ts +8 -5
- package/dist/types/client/v2/algod/accountApplicationInformation.d.ts +8 -6
- package/dist/types/client/v2/algod/accountAssetInformation.d.ts +8 -6
- package/dist/types/client/v2/algod/accountInformation.d.ts +7 -5
- package/dist/types/client/v2/algod/algod.d.ts +53 -52
- package/dist/types/client/v2/algod/block.d.ts +5 -4
- package/dist/types/client/v2/algod/compile.d.ts +7 -9
- package/dist/types/client/v2/algod/disassemble.d.ts +7 -9
- package/dist/types/client/v2/algod/dryrun.d.ts +7 -9
- package/dist/types/client/v2/algod/genesis.d.ts +4 -2
- package/dist/types/client/v2/algod/getApplicationBoxByName.d.ts +6 -7
- package/dist/types/client/v2/algod/getApplicationBoxes.d.ts +6 -7
- package/dist/types/client/v2/algod/getApplicationByID.d.ts +6 -5
- package/dist/types/client/v2/algod/getAssetByID.d.ts +6 -5
- package/dist/types/client/v2/algod/getBlockHash.d.ts +7 -6
- package/dist/types/client/v2/algod/getBlockOffsetTimestamp.d.ts +5 -4
- package/dist/types/client/v2/algod/getBlockTxids.d.ts +6 -5
- package/dist/types/client/v2/algod/getLedgerStateDelta.d.ts +6 -5
- package/dist/types/client/v2/algod/getLedgerStateDeltaForTransactionGroup.d.ts +6 -5
- package/dist/types/client/v2/algod/getSyncRound.d.ts +5 -4
- package/dist/types/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.d.ts +6 -7
- package/dist/types/client/v2/algod/getTransactionProof.d.ts +6 -5
- package/dist/types/client/v2/algod/healthCheck.d.ts +4 -3
- package/dist/types/client/v2/algod/index.d.ts +2 -0
- package/dist/types/client/v2/algod/lightBlockHeaderProof.d.ts +6 -5
- package/dist/types/client/v2/algod/models/types.d.ts +629 -318
- package/dist/types/client/v2/algod/pendingTransactionInformation.d.ts +5 -4
- package/dist/types/client/v2/algod/pendingTransactions.d.ts +5 -4
- package/dist/types/client/v2/algod/pendingTransactionsByAddress.d.ts +7 -5
- package/dist/types/client/v2/algod/ready.d.ts +4 -2
- package/dist/types/client/v2/algod/sendRawTransaction.d.ts +7 -5
- package/dist/types/client/v2/algod/setBlockOffsetTimestamp.d.ts +6 -6
- package/dist/types/client/v2/algod/setSyncRound.d.ts +6 -6
- package/dist/types/client/v2/algod/simulateTransaction.d.ts +7 -7
- package/dist/types/client/v2/algod/stateproof.d.ts +6 -5
- package/dist/types/client/v2/algod/status.d.ts +5 -2
- package/dist/types/client/v2/algod/statusAfterBlock.d.ts +6 -5
- package/dist/types/client/v2/algod/suggestedParams.d.ts +25 -4
- package/dist/types/client/v2/algod/supply.d.ts +5 -2
- package/dist/types/client/v2/algod/unsetSyncRound.d.ts +5 -3
- package/dist/types/client/v2/algod/versions.d.ts +5 -2
- package/dist/types/client/v2/indexer/index.d.ts +2 -0
- package/dist/types/client/v2/indexer/indexer.d.ts +31 -30
- package/dist/types/client/v2/indexer/lookupAccountAppLocalStates.d.ts +7 -5
- package/dist/types/client/v2/indexer/lookupAccountAssets.d.ts +7 -5
- package/dist/types/client/v2/indexer/lookupAccountByID.d.ts +7 -5
- package/dist/types/client/v2/indexer/lookupAccountCreatedApplications.d.ts +7 -5
- package/dist/types/client/v2/indexer/lookupAccountCreatedAssets.d.ts +7 -5
- package/dist/types/client/v2/indexer/lookupAccountTransactions.d.ts +11 -9
- package/dist/types/client/v2/indexer/lookupApplicationBoxByIDandName.d.ts +6 -7
- package/dist/types/client/v2/indexer/lookupApplicationLogs.d.ts +6 -5
- package/dist/types/client/v2/indexer/lookupApplications.d.ts +6 -5
- package/dist/types/client/v2/indexer/lookupAssetBalances.d.ts +6 -5
- package/dist/types/client/v2/indexer/lookupAssetByID.d.ts +6 -5
- package/dist/types/client/v2/indexer/lookupAssetTransactions.d.ts +12 -10
- package/dist/types/client/v2/indexer/lookupBlock.d.ts +6 -5
- package/dist/types/client/v2/indexer/lookupTransactionByID.d.ts +6 -5
- package/dist/types/client/v2/indexer/makeHealthCheck.d.ts +5 -2
- package/dist/types/client/v2/indexer/models/types.d.ts +513 -267
- package/dist/types/client/v2/indexer/searchAccounts.d.ts +7 -3
- package/dist/types/client/v2/indexer/searchForApplicationBoxes.d.ts +6 -7
- package/dist/types/client/v2/indexer/searchForApplications.d.ts +7 -3
- package/dist/types/client/v2/indexer/searchForAssets.d.ts +7 -3
- package/dist/types/client/v2/indexer/searchForTransactions.d.ts +11 -7
- package/dist/types/client/v2/jsonrequest.d.ts +20 -33
- package/dist/types/client/v2/serviceClient.d.ts +4 -18
- package/dist/types/client/v2/untypedmodel.d.ts +10 -0
- package/dist/types/composer.d.ts +18 -17
- package/dist/types/dryrun.d.ts +8 -80
- package/dist/types/encoding/address.d.ts +40 -31
- package/dist/types/encoding/binarydata.d.ts +30 -0
- package/dist/types/encoding/encoding.d.ts +219 -7
- package/dist/types/encoding/schema/address.d.ts +10 -0
- package/dist/types/encoding/schema/array.d.ts +11 -0
- package/dist/types/encoding/schema/binarystring.d.ts +18 -0
- package/dist/types/encoding/schema/blockhash.d.ts +16 -0
- package/dist/types/encoding/schema/boolean.d.ts +10 -0
- package/dist/types/encoding/schema/bytearray.d.ts +19 -0
- package/dist/types/encoding/schema/index.d.ts +11 -0
- package/dist/types/encoding/schema/map.d.ts +125 -0
- package/dist/types/encoding/schema/optional.d.ts +24 -0
- package/dist/types/encoding/schema/string.d.ts +9 -0
- package/dist/types/encoding/schema/uint64.d.ts +9 -0
- package/dist/types/encoding/schema/untyped.d.ts +9 -0
- package/dist/types/encoding/uint64.d.ts +1 -0
- package/dist/types/group.d.ts +6 -25
- package/dist/types/index.d.ts +2 -2
- package/dist/types/logic/sourcemap.d.ts +39 -13
- package/dist/types/logicsig.d.ts +27 -57
- package/dist/types/main.d.ts +43 -54
- package/dist/types/makeTxn.d.ts +129 -388
- package/dist/types/mnemonic/mnemonic.d.ts +1 -1
- package/dist/types/multisig.d.ts +28 -99
- package/dist/types/multisigSigning.d.ts +72 -0
- package/dist/types/signedTransaction.d.ts +55 -0
- package/dist/types/signer.d.ts +5 -5
- package/dist/types/signing.d.ts +29 -0
- package/dist/types/stateproof.d.ts +194 -0
- package/dist/types/transaction.d.ts +103 -182
- package/dist/types/types/account.d.ts +2 -1
- package/dist/types/types/block.d.ts +407 -0
- package/dist/types/types/intDecoding.d.ts +1 -1
- package/dist/types/types/statedelta.d.ts +575 -0
- package/dist/types/types/transactions/base.d.ts +206 -118
- package/dist/types/types/transactions/encoded.d.ts +7 -301
- package/dist/types/types/transactions/index.d.ts +2 -15
- package/dist/types/types/utils.d.ts +7 -7
- package/dist/types/utils/utils.d.ts +21 -16
- package/dist/types/wait.d.ts +3 -2
- package/package.json +48 -20
- package/src/abi/abi_type.ts +28 -18
- package/src/abi/contract.ts +7 -1
- package/src/abi/event.ts +16 -0
- package/src/abi/index.ts +6 -6
- package/src/abi/interface.ts +1 -1
- package/src/abi/method.ts +22 -8
- package/src/abi/transaction.ts +2 -2
- package/src/account.ts +5 -5
- package/src/boxStorage.ts +25 -23
- package/src/client/baseHTTPClient.ts +12 -6
- package/src/client/client.ts +147 -75
- package/src/client/index.ts +6 -0
- package/src/client/kmd.ts +79 -72
- package/src/client/urlTokenBaseHTTPClient.ts +25 -14
- package/src/client/v2/algod/accountApplicationInformation.ts +16 -9
- package/src/client/v2/algod/accountAssetInformation.ts +16 -9
- package/src/client/v2/algod/accountInformation.ts +16 -11
- package/src/client/v2/algod/algod.ts +83 -105
- package/src/client/v2/algod/block.ts +7 -11
- package/src/client/v2/algod/compile.ts +27 -19
- package/src/client/v2/algod/disassemble.ts +27 -19
- package/src/client/v2/algod/dryrun.ts +23 -19
- package/src/client/v2/algod/genesis.ts +8 -2
- package/src/client/v2/algod/getApplicationBoxByName.ts +10 -15
- package/src/client/v2/algod/getApplicationBoxes.ts +12 -13
- package/src/client/v2/algod/getApplicationByID.ts +15 -7
- package/src/client/v2/algod/getAssetByID.ts +15 -7
- package/src/client/v2/algod/getBlockHash.ts +13 -9
- package/src/client/v2/algod/getBlockOffsetTimestamp.ts +7 -8
- package/src/client/v2/algod/getBlockTxids.ts +12 -6
- package/src/client/v2/algod/getLedgerStateDelta.ts +16 -8
- package/src/client/v2/algod/getLedgerStateDeltaForTransactionGroup.ts +16 -8
- package/src/client/v2/algod/getSyncRound.ts +7 -8
- package/src/client/v2/algod/getTransactionGroupLedgerStateDeltasForRound.ts +15 -15
- package/src/client/v2/algod/getTransactionProof.ts +11 -9
- package/src/client/v2/algod/healthCheck.ts +5 -9
- package/src/client/v2/algod/index.ts +3 -0
- package/src/client/v2/algod/lightBlockHeaderProof.ts +15 -8
- package/src/client/v2/algod/models/types.ts +4729 -2254
- package/src/client/v2/algod/pendingTransactionInformation.ts +11 -11
- package/src/client/v2/algod/pendingTransactions.ts +7 -9
- package/src/client/v2/algod/pendingTransactionsByAddress.ts +12 -11
- package/src/client/v2/algod/ready.ts +6 -2
- package/src/client/v2/algod/sendRawTransaction.ts +24 -13
- package/src/client/v2/algod/setBlockOffsetTimestamp.ts +21 -11
- package/src/client/v2/algod/setSyncRound.ts +21 -11
- package/src/client/v2/algod/simulateTransaction.ts +22 -23
- package/src/client/v2/algod/stateproof.ts +15 -8
- package/src/client/v2/algod/status.ts +10 -2
- package/src/client/v2/algod/statusAfterBlock.ts +15 -7
- package/src/client/v2/algod/suggestedParams.ts +40 -10
- package/src/client/v2/algod/supply.ts +10 -2
- package/src/client/v2/algod/unsetSyncRound.ts +16 -5
- package/src/client/v2/algod/versions.ts +10 -2
- package/src/client/v2/indexer/index.ts +3 -0
- package/src/client/v2/indexer/indexer.ts +51 -59
- package/src/client/v2/indexer/lookupAccountAppLocalStates.ts +16 -11
- package/src/client/v2/indexer/lookupAccountAssets.ts +16 -11
- package/src/client/v2/indexer/lookupAccountByID.ts +16 -11
- package/src/client/v2/indexer/lookupAccountCreatedApplications.ts +16 -11
- package/src/client/v2/indexer/lookupAccountCreatedAssets.ts +16 -11
- package/src/client/v2/indexer/lookupAccountTransactions.ts +26 -19
- package/src/client/v2/indexer/lookupApplicationBoxByIDandName.ts +10 -15
- package/src/client/v2/indexer/lookupApplicationLogs.ts +15 -7
- package/src/client/v2/indexer/lookupApplications.ts +15 -7
- package/src/client/v2/indexer/lookupAssetBalances.ts +15 -7
- package/src/client/v2/indexer/lookupAssetByID.ts +15 -7
- package/src/client/v2/indexer/lookupAssetTransactions.ts +27 -16
- package/src/client/v2/indexer/lookupBlock.ts +15 -7
- package/src/client/v2/indexer/lookupTransactionByID.ts +15 -7
- package/src/client/v2/indexer/makeHealthCheck.ts +10 -2
- package/src/client/v2/indexer/models/types.ts +4454 -1988
- package/src/client/v2/indexer/searchAccounts.ts +13 -4
- package/src/client/v2/indexer/searchForApplicationBoxes.ts +12 -13
- package/src/client/v2/indexer/searchForApplications.ts +13 -4
- package/src/client/v2/indexer/searchForAssets.ts +13 -4
- package/src/client/v2/indexer/searchForTransactions.ts +22 -11
- package/src/client/v2/jsonrequest.ts +39 -57
- package/src/client/v2/serviceClient.ts +9 -31
- package/src/client/v2/untypedmodel.ts +25 -0
- package/src/composer.ts +83 -60
- package/src/dryrun.ts +129 -306
- package/src/encoding/address.ts +134 -146
- package/src/encoding/bigint.ts +2 -4
- package/src/encoding/binarydata.ts +80 -0
- package/src/encoding/encoding.ts +558 -13
- package/src/encoding/schema/address.ts +53 -0
- package/src/encoding/schema/array.ts +66 -0
- package/src/encoding/schema/binarystring.ts +73 -0
- package/src/encoding/schema/blockhash.ts +84 -0
- package/src/encoding/schema/boolean.ts +54 -0
- package/src/encoding/schema/bytearray.ts +127 -0
- package/src/encoding/schema/index.ts +26 -0
- package/src/encoding/schema/map.ts +713 -0
- package/src/encoding/schema/optional.ts +72 -0
- package/src/encoding/schema/string.ts +55 -0
- package/src/encoding/schema/uint64.ts +46 -0
- package/src/encoding/schema/untyped.ts +47 -0
- package/src/encoding/uint64.ts +2 -1
- package/src/group.ts +27 -75
- package/src/index.ts +2 -2
- package/src/logic/sourcemap.ts +94 -29
- package/src/logicsig.ts +154 -202
- package/src/main.ts +91 -94
- package/src/makeTxn.ts +670 -1320
- package/src/mnemonic/mnemonic.ts +14 -14
- package/src/multisig.ts +89 -403
- package/src/multisigSigning.ts +359 -0
- package/src/nacl/naclWrappers.ts +1 -1
- package/src/signedTransaction.ts +163 -0
- package/src/signer.ts +10 -5
- package/src/signing.ts +95 -0
- package/src/stateproof.ts +595 -0
- package/src/transaction.ts +986 -1242
- package/src/types/account.ts +3 -1
- package/src/types/block.ts +1278 -0
- package/src/types/intDecoding.ts +1 -1
- package/src/types/statedelta.ts +1717 -0
- package/src/types/transactions/base.ts +230 -122
- package/src/types/transactions/encoded.ts +81 -371
- package/src/types/transactions/index.ts +2 -72
- package/src/types/utils.ts +3 -3
- package/src/utils/utils.ts +96 -25
- package/src/wait.ts +8 -7
- package/dist/cjs/bid.js +0 -83
- package/dist/cjs/bid.js.map +0 -1
- package/dist/cjs/client/v2/basemodel.js +0 -67
- package/dist/cjs/client/v2/basemodel.js.map +0 -1
- package/dist/cjs/types/address.js +0 -3
- package/dist/cjs/types/address.js.map +0 -1
- package/dist/cjs/types/blockHeader.js +0 -3
- package/dist/cjs/types/blockHeader.js.map +0 -1
- package/dist/cjs/types/index.js.map +0 -1
- package/dist/cjs/types/multisig.js +0 -3
- package/dist/cjs/types/multisig.js.map +0 -1
- package/dist/cjs/types/transactions/application.js +0 -3
- package/dist/cjs/types/transactions/application.js.map +0 -1
- package/dist/cjs/types/transactions/asset.js.map +0 -1
- package/dist/cjs/types/transactions/builder.js +0 -3
- package/dist/cjs/types/transactions/builder.js.map +0 -1
- package/dist/cjs/types/transactions/keyreg.js +0 -3
- package/dist/cjs/types/transactions/keyreg.js.map +0 -1
- package/dist/cjs/types/transactions/payment.js +0 -3
- package/dist/cjs/types/transactions/payment.js.map +0 -1
- package/dist/cjs/types/transactions/stateproof.js +0 -3
- package/dist/cjs/types/transactions/stateproof.js.map +0 -1
- package/dist/esm/bid.js +0 -57
- package/dist/esm/bid.js.map +0 -1
- package/dist/esm/client/v2/basemodel.js +0 -64
- package/dist/esm/client/v2/basemodel.js.map +0 -1
- package/dist/esm/types/address.js +0 -2
- package/dist/esm/types/address.js.map +0 -1
- package/dist/esm/types/blockHeader.js +0 -2
- package/dist/esm/types/blockHeader.js.map +0 -1
- package/dist/esm/types/index.js +0 -4
- package/dist/esm/types/index.js.map +0 -1
- package/dist/esm/types/multisig.js +0 -2
- package/dist/esm/types/multisig.js.map +0 -1
- package/dist/esm/types/transactions/application.js +0 -2
- package/dist/esm/types/transactions/application.js.map +0 -1
- package/dist/esm/types/transactions/asset.js +0 -2
- package/dist/esm/types/transactions/asset.js.map +0 -1
- package/dist/esm/types/transactions/builder.js +0 -2
- package/dist/esm/types/transactions/builder.js.map +0 -1
- package/dist/esm/types/transactions/keyreg.js +0 -2
- package/dist/esm/types/transactions/keyreg.js.map +0 -1
- package/dist/esm/types/transactions/payment.js +0 -2
- package/dist/esm/types/transactions/payment.js.map +0 -1
- package/dist/esm/types/transactions/stateproof.js +0 -2
- package/dist/esm/types/transactions/stateproof.js.map +0 -1
- package/dist/types/bid.d.ts +0 -38
- package/dist/types/client/v2/basemodel.d.ts +0 -11
- package/dist/types/types/address.d.ts +0 -7
- package/dist/types/types/blockHeader.d.ts +0 -67
- package/dist/types/types/index.d.ts +0 -3
- package/dist/types/types/multisig.d.ts +0 -20
- package/dist/types/types/transactions/application.d.ts +0 -22
- package/dist/types/types/transactions/asset.d.ts +0 -28
- package/dist/types/types/transactions/builder.d.ts +0 -36
- package/dist/types/types/transactions/keyreg.d.ts +0 -8
- package/dist/types/types/transactions/payment.d.ts +0 -8
- package/dist/types/types/transactions/stateproof.d.ts +0 -8
- package/src/bid.ts +0 -96
- package/src/client/v2/basemodel.ts +0 -81
- package/src/types/address.ts +0 -7
- package/src/types/blockHeader.ts +0 -81
- package/src/types/index.ts +0 -3
- package/src/types/multisig.ts +0 -22
- package/src/types/transactions/application.ts +0 -111
- package/src/types/transactions/asset.ts +0 -108
- package/src/types/transactions/builder.ts +0 -69
- package/src/types/transactions/keyreg.ts +0 -23
- package/src/types/transactions/payment.ts +0 -14
- package/src/types/transactions/stateproof.ts +0 -17
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see algosdk.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.algosdk=t():e.algosdk=t()}(self,(()=>(()=>{var e={406:function(e){e.exports=function(e){var t={};function r(s){if(t[s])return t[s].exports;var n=t[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,s){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(r.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(s,n,function(t){return e[t]}.bind(null,n));return s},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t),r.d(t,"encode",(function(){return T})),r.d(t,"decode",(function(){return N})),r.d(t,"decodeAsync",(function(){return G})),r.d(t,"decodeArrayStream",(function(){return Y})),r.d(t,"decodeStream",(function(){return J})),r.d(t,"Decoder",(function(){return L})),r.d(t,"Encoder",(function(){return S})),r.d(t,"ExtensionCodec",(function(){return A})),r.d(t,"ExtData",(function(){return p})),r.d(t,"EXT_TIMESTAMP",(function(){return m})),r.d(t,"encodeDateToTimeSpec",(function(){return w})),r.d(t,"encodeTimeSpecToTimestamp",(function(){return y})),r.d(t,"decodeTimestampToTimeSpec",(function(){return v})),r.d(t,"encodeTimestampExtension",(function(){return b})),r.d(t,"decodeTimestampExtension",(function(){return x}));var s=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var s,n,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(s=i.next()).done;)o.push(s.value)}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o},n=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e},i="undefined"!=typeof process&&"undefined"!=typeof TextEncoder&&"undefined"!=typeof TextDecoder;function o(e){for(var t=e.length,r=0,s=0;s<t;){var n=e.charCodeAt(s++);if(0!=(4294967168&n))if(0==(4294965248&n))r+=2;else{if(n>=55296&&n<=56319&&s<t){var i=e.charCodeAt(s);56320==(64512&i)&&(++s,n=((1023&n)<<10)+(1023&i)+65536)}r+=0==(4294901760&n)?3:4}else r++}return r}var a=i?new TextEncoder:void 0,c="undefined"!=typeof process?200:0,u=(null==a?void 0:a.encodeInto)?function(e,t,r){a.encodeInto(e,t.subarray(r))}:function(e,t,r){t.set(a.encode(e),r)};function l(e,t,r){for(var s=t,i=s+r,o=[],a="";s<i;){var c=e[s++];if(0==(128&c))o.push(c);else if(192==(224&c)){var u=63&e[s++];o.push((31&c)<<6|u)}else if(224==(240&c)){u=63&e[s++];var l=63&e[s++];o.push((31&c)<<12|u<<6|l)}else if(240==(248&c)){var d=(7&c)<<18|(u=63&e[s++])<<12|(l=63&e[s++])<<6|63&e[s++];d>65535&&(d-=65536,o.push(d>>>10&1023|55296),d=56320|1023&d),o.push(d)}else o.push(c);o.length>=4096&&(a+=String.fromCharCode.apply(String,n(o)),o.length=0)}return o.length>0&&(a+=String.fromCharCode.apply(String,n(o))),a}var d=i?new TextDecoder:null,h="undefined"!=typeof process?200:0,p=function(e,t){this.type=e,this.data=t};function f(e,t,r){var s=Math.floor(r/4294967296),n=r;e.setUint32(t,s),e.setUint32(t+4,n)}function g(e,t){var r=e.getInt32(t),s=e.getUint32(t+4),n=r<Math.floor(Number.MIN_SAFE_INTEGER/4294967296)||r===Math.floor(Number.MIN_SAFE_INTEGER/4294967296)&&0===s,i=r>Math.floor(Number.MAX_SAFE_INTEGER/4294967296);return n||i?BigInt(r)*BigInt(4294967296)+BigInt(s):4294967296*r+s}var m=-1;function y(e){var t,r=e.sec,s=e.nsec;if(r>=0&&s>=0&&r<=17179869183){if(0===s&&r<=4294967295){var n=new Uint8Array(4);return(t=new DataView(n.buffer)).setUint32(0,r),n}var i=r/4294967296,o=4294967295&r;return n=new Uint8Array(8),(t=new DataView(n.buffer)).setUint32(0,s<<2|3&i),t.setUint32(4,o),n}return n=new Uint8Array(12),(t=new DataView(n.buffer)).setUint32(0,s),f(t,4,r),n}function w(e){var t=e.getTime(),r=Math.floor(t/1e3),s=1e6*(t-1e3*r),n=Math.floor(s/1e9);return{sec:r+n,nsec:s-1e9*n}}function b(e){return e instanceof Date?y(w(e)):null}function v(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:var r=t.getUint32(0);return{sec:4294967296*(3&r)+t.getUint32(4),nsec:r>>>2};case 12:return{sec:g(t,4),nsec:t.getUint32(0)};default:throw new Error("Unrecognized data size for timestamp: "+e.length)}}function x(e){var t=v(e);return new Date(1e3*t.sec+t.nsec/1e6)}var _={type:m,encode:b,decode:x},A=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(_)}return e.prototype.register=function(e){var t=e.type,r=e.encode,s=e.decode;if(t>=0)this.encoders[t]=r,this.decoders[t]=s;else{var n=1+t;this.builtInEncoders[n]=r,this.builtInDecoders[n]=s}},e.prototype.tryToEncode=function(e,t){for(var r=0;r<this.builtInEncoders.length;r++)if(null!=(s=this.builtInEncoders[r])&&null!=(n=s(e,t)))return new p(-1-r,n);for(r=0;r<this.encoders.length;r++){var s,n;if(null!=(s=this.encoders[r])&&null!=(n=s(e,t)))return new p(r,n)}return e instanceof p?e:null},e.prototype.decode=function(e,t,r){var s=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return s?s(e,t,r):new p(t,e)},e.defaultCodec=new e,e}();function E(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):Uint8Array.from(e)}var k=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],s=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&s>=e.length&&(e=void 0),{value:e&&e[s++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},S=function(){function e(e,t,r,s,n,i,o,a){void 0===e&&(e=A.defaultCodec),void 0===t&&(t=void 0),void 0===r&&(r=100),void 0===s&&(s=2048),void 0===n&&(n=!1),void 0===i&&(i=!1),void 0===o&&(o=!1),void 0===a&&(a=!1),this.extensionCodec=e,this.context=t,this.maxDepth=r,this.initialBufferSize=s,this.sortKeys=n,this.forceFloat32=i,this.ignoreUndefined=o,this.forceIntegerToFloat=a,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}return e.prototype.getUint8Array=function(){return this.bytes.subarray(0,this.pos)},e.prototype.reinitializeState=function(){this.pos=0},e.prototype.encode=function(e){return this.reinitializeState(),this.doEncode(e,1),this.getUint8Array()},e.prototype.doEncode=function(e,t){if(t>this.maxDepth)throw new Error("Too deep objects in depth "+t);null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.encodeNumber(e):"string"==typeof e?this.encodeString(e):"bigint"==typeof e?this.encodebigint(e):this.encodeObject(e,t)},e.prototype.ensureBufferSizeToWrite=function(e){var t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(2*t)},e.prototype.resizeBuffer=function(e){var t=new ArrayBuffer(e),r=new Uint8Array(t),s=new DataView(t);r.set(this.bytes),this.view=s,this.bytes=r},e.prototype.encodeNil=function(){this.writeU8(192)},e.prototype.encodeBoolean=function(e){!1===e?this.writeU8(194):this.writeU8(195)},e.prototype.encodeNumber=function(e){Number.isSafeInteger(e)&&!this.forceIntegerToFloat?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):(this.writeU8(211),this.writeI64(e)):this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},e.prototype.encodebigint=function(e){e>=BigInt(0)?e<BigInt(128)?this.writeU8(Number(e)):e<BigInt(256)?(this.writeU8(204),this.writeU8(Number(e))):e<BigInt(65536)?(this.writeU8(205),this.writeU16(Number(e))):e<BigInt(4294967296)?(this.writeU8(206),this.writeU32(Number(e))):(this.writeU8(207),this.writeBig64(e)):e>=BigInt(-32)?this.writeU8(224|Number(e)+32):e>=BigInt(-128)?(this.writeU8(208),this.writeI8(Number(e))):e>=BigInt(-32768)?(this.writeU8(209),this.writeI16(Number(e))):e>=BigInt(-2147483648)?(this.writeU8(210),this.writeI32(Number(e))):(this.writeU8(211),this.writeBig64(e))},e.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too long string: "+e+" bytes in UTF-8");this.writeU8(219),this.writeU32(e)}},e.prototype.encodeString=function(e){var t=e.length;if(i&&t>c){var r=o(e);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),u(e,this.bytes,this.pos),this.pos+=r}else r=o(e),this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),function(e,t,r){for(var s=e.length,n=r,i=0;i<s;){var o=e.charCodeAt(i++);if(0!=(4294967168&o)){if(0==(4294965248&o))t[n++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&i<s){var a=e.charCodeAt(i);56320==(64512&a)&&(++i,o=((1023&o)<<10)+(1023&a)+65536)}0==(4294901760&o)?(t[n++]=o>>12&15|224,t[n++]=o>>6&63|128):(t[n++]=o>>18&7|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128)}t[n++]=63&o|128}else t[n++]=o}}(e,this.bytes,this.pos),this.pos+=r},e.prototype.encodeObject=function(e,t){var r=this.extensionCodec.tryToEncode(e,this.context);if(null!=r)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else{if("object"!=typeof e)throw new Error("Unrecognized object: "+Object.prototype.toString.apply(e));this.encodeMap(e,t)}},e.prototype.encodeBinary=function(e){var t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large binary: "+t);this.writeU8(198),this.writeU32(t)}var r=E(e);this.writeU8a(r)},e.prototype.encodeArray=function(e,t){var r,s,n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else{if(!(n<4294967296))throw new Error("Too large array: "+n);this.writeU8(221),this.writeU32(n)}try{for(var i=k(e),o=i.next();!o.done;o=i.next()){var a=o.value;this.doEncode(a,t+1)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(s=i.return)&&s.call(i)}finally{if(r)throw r.error}}},e.prototype.countWithoutUndefined=function(e,t){var r,s,n=0;try{for(var i=k(t),o=i.next();!o.done;o=i.next())void 0!==e[o.value]&&n++}catch(e){r={error:e}}finally{try{o&&!o.done&&(s=i.return)&&s.call(i)}finally{if(r)throw r.error}}return n},e.prototype.encodeMap=function(e,t){var r,s,n=Object.keys(e);this.sortKeys&&n.sort();var i=this.ignoreUndefined?this.countWithoutUndefined(e,n):n.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else{if(!(i<4294967296))throw new Error("Too large map object: "+i);this.writeU8(223),this.writeU32(i)}try{for(var o=k(n),a=o.next();!a.done;a=o.next()){var c=a.value,u=e[c];this.ignoreUndefined&&void 0===u||(this.encodeString(c),this.doEncode(u,t+1))}}catch(e){r={error:e}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(r)throw r.error}}},e.prototype.encodeExtension=function(e){var t=e.data.length;if(1===t)this.writeU8(212);else if(2===t)this.writeU8(213);else if(4===t)this.writeU8(214);else if(8===t)this.writeU8(215);else if(16===t)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large extension object: "+t);this.writeU8(201),this.writeU32(t)}this.writeI8(e.type),this.writeU8a(e.data)},e.prototype.writeU8=function(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++},e.prototype.writeU8a=function(e){var t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t},e.prototype.writeI8=function(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++},e.prototype.writeU16=function(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2},e.prototype.writeI16=function(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2},e.prototype.writeU32=function(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4},e.prototype.writeI32=function(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4},e.prototype.writeF32=function(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4},e.prototype.writeF64=function(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8},e.prototype.writeU64=function(e){this.ensureBufferSizeToWrite(8),function(e,t,r){var s=r/4294967296,n=r;e.setUint32(t,s),e.setUint32(t+4,n)}(this.view,this.pos,e),this.pos+=8},e.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),f(this.view,this.pos,e),this.pos+=8},e.prototype.writeBig64=function(e){this.ensureBufferSizeToWrite(8),function(e,t,r){var s=Number(r/BigInt(4294967296)),n=Number(r%BigInt(4294967296));s<0&&0!==n&&(s-=1),e.setUint32(t,s),e.setUint32(t+4,n)}(this.view,this.pos,e),this.pos+=8},e}(),R={};function T(e,t){return void 0===t&&(t=R),new S(t.extensionCodec,t.context,t.maxDepth,t.initialBufferSize,t.sortKeys,t.forceFloat32,t.ignoreUndefined,t.forceIntegerToFloat).encode(e)}function I(e){return(e<0?"-":"")+"0x"+Math.abs(e).toString(16).padStart(2,"0")}var B=function(){function e(e,t){void 0===e&&(e=16),void 0===t&&(t=16),this.maxKeyLength=e,this.maxLengthPerKey=t,this.hit=0,this.miss=0,this.caches=[];for(var r=0;r<this.maxKeyLength;r++)this.caches.push([])}return e.prototype.canBeCached=function(e){return e>0&&e<=this.maxKeyLength},e.prototype.get=function(e,t,r){var s=this.caches[r-1],n=s.length;e:for(var i=0;i<n;i++){for(var o=s[i],a=o.bytes,c=0;c<r;c++)if(a[c]!==e[t+c])continue e;return o.value}return null},e.prototype.store=function(e,t){var r=this.caches[e.length-1],s={bytes:e,value:t};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=s:r.push(s)},e.prototype.decode=function(e,t,r){var s=this.get(e,t,r);if(null!=s)return this.hit++,s;this.miss++;var n=l(e,t,r),i=Uint8Array.prototype.slice.call(e,t,t+r);return this.store(i,n),n},e}(),U=function(e,t){var r,s,n,i,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,s&&(n=2&i[0]?s.return:i[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,i[1])).done)return n;switch(s=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,s=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){o.label=i[1];break}if(6===i[0]&&o.label<n[1]){o.label=n[1],n=i;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(i);break}n[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],s=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},P=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(r){t[r]=e[r]&&function(t){return new Promise((function(s,n){!function(e,t,r,s){Promise.resolve(s).then((function(t){e({value:t,done:r})}),t)}(s,n,(t=e[r](t)).done,t.value)}))}}},j=function(e){return this instanceof j?(this.v=e,this):new j(e)},q=new DataView(new ArrayBuffer(0)),$=new Uint8Array(q.buffer),C=function(){try{q.getInt8(0)}catch(e){return e.constructor}throw new Error("never reached")}(),D=new C("Insufficient data"),O=new B,L=function(){function e(e,t,r,s,n,i,o,a){void 0===e&&(e=A.defaultCodec),void 0===t&&(t=void 0),void 0===r&&(r=4294967295),void 0===s&&(s=4294967295),void 0===n&&(n=4294967295),void 0===i&&(i=4294967295),void 0===o&&(o=4294967295),void 0===a&&(a=O),this.extensionCodec=e,this.context=t,this.maxStrLength=r,this.maxBinLength=s,this.maxArrayLength=n,this.maxMapLength=i,this.maxExtLength=o,this.keyDecoder=a,this.totalPos=0,this.pos=0,this.view=q,this.bytes=$,this.headByte=-1,this.stack=[]}return e.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=-1},e.prototype.setBuffer=function(e){this.bytes=E(e),this.view=function(e){if(e instanceof ArrayBuffer)return new DataView(e);var t=E(e);return new DataView(t.buffer,t.byteOffset,t.byteLength)}(this.bytes),this.pos=0},e.prototype.appendBuffer=function(e){if(-1!==this.headByte||this.hasRemaining()){var t=this.bytes.subarray(this.pos),r=E(e),s=new Uint8Array(t.length+r.length);s.set(t),s.set(r,t.length),this.setBuffer(s)}else this.setBuffer(e)},e.prototype.hasRemaining=function(e){return void 0===e&&(e=1),this.view.byteLength-this.pos>=e},e.prototype.createNoExtraBytesError=function(e){var t=this.view,r=this.pos;return new RangeError("Extra "+(t.byteLength-r)+" of "+t.byteLength+" byte(s) found at buffer["+e+"]")},e.prototype.decode=function(e){return this.reinitializeState(),this.setBuffer(e),this.doDecodeSingleSync()},e.prototype.doDecodeSingleSync=function(){var e=this.doDecodeSync();if(this.hasRemaining())throw this.createNoExtraBytesError(this.pos);return e},e.prototype.decodeAsync=function(e){var t,r,s,n;return function(e,t,r,s){return new(r||(r=Promise))((function(n,i){function o(e){try{c(s.next(e))}catch(e){i(e)}}function a(e){try{c(s.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){var i,o,a,c,u,l,d,h;return U(this,(function(p){switch(p.label){case 0:i=!1,p.label=1;case 1:p.trys.push([1,6,7,12]),t=P(e),p.label=2;case 2:return[4,t.next()];case 3:if((r=p.sent()).done)return[3,5];if(a=r.value,i)throw this.createNoExtraBytesError(this.totalPos);this.appendBuffer(a);try{o=this.doDecodeSync(),i=!0}catch(e){if(!(e instanceof C))throw e}this.totalPos+=this.pos,p.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return c=p.sent(),s={error:c},[3,12];case 7:return p.trys.push([7,,10,11]),r&&!r.done&&(n=t.return)?[4,n.call(t)]:[3,9];case 8:p.sent(),p.label=9;case 9:return[3,11];case 10:if(s)throw s.error;return[7];case 11:return[7];case 12:if(i){if(this.hasRemaining())throw this.createNoExtraBytesError(this.totalPos);return[2,o]}throw l=(u=this).headByte,d=u.pos,h=u.totalPos,new RangeError("Insufficient data in parcing "+I(l)+" at "+h+" ("+d+" in the current buffer)")}}))}))},e.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},e.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},e.prototype.decodeMultiAsync=function(e,t){return function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s,n=r.apply(e,t||[]),i=[];return s={},o("next"),o("throw"),o("return"),s[Symbol.asyncIterator]=function(){return this},s;function o(e){n[e]&&(s[e]=function(t){return new Promise((function(r,s){i.push([e,t,r,s])>1||a(e,t)}))})}function a(e,t){try{(r=n[e](t)).value instanceof j?Promise.resolve(r.value.v).then(c,u):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function c(e){a("next",e)}function u(e){a("throw",e)}function l(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}(this,arguments,(function(){var r,s,n,i,o,a,c,u,l;return U(this,(function(d){switch(d.label){case 0:r=t,s=-1,d.label=1;case 1:d.trys.push([1,13,14,19]),n=P(e),d.label=2;case 2:return[4,j(n.next())];case 3:if((i=d.sent()).done)return[3,12];if(o=i.value,t&&0===s)throw this.createNoExtraBytesError(this.totalPos);this.appendBuffer(o),r&&(s=this.readArraySize(),r=!1,this.complete()),d.label=4;case 4:d.trys.push([4,9,,10]),d.label=5;case 5:return[4,j(this.doDecodeSync())];case 6:return[4,d.sent()];case 7:return d.sent(),0==--s?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((a=d.sent())instanceof C))throw a;return[3,10];case 10:this.totalPos+=this.pos,d.label=11;case 11:return[3,2];case 12:return[3,19];case 13:return c=d.sent(),u={error:c},[3,19];case 14:return d.trys.push([14,,17,18]),i&&!i.done&&(l=n.return)?[4,j(l.call(n))]:[3,16];case 15:d.sent(),d.label=16;case 16:return[3,18];case 17:if(u)throw u.error;return[7];case 18:return[7];case 19:return[2]}}))}))},e.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),t=void 0;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){if(0!=(s=e-128)){this.pushMapState(s),this.complete();continue e}t={}}else if(e<160){if(0!=(s=e-144)){this.pushArrayState(s),this.complete();continue e}t=[]}else{var r=e-160;t=this.decodeUtf8String(r,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.readU8();else if(205===e)t=this.readU16();else if(206===e)t=this.readU32();else if(207===e)t=this.readU64();else if(208===e)t=this.readI8();else if(209===e)t=this.readI16();else if(210===e)t=this.readI32();else if(211===e)t=this.readI64();else if(217===e)r=this.lookU8(),t=this.decodeUtf8String(r,1);else if(218===e)r=this.lookU16(),t=this.decodeUtf8String(r,2);else if(219===e)r=this.lookU32(),t=this.decodeUtf8String(r,4);else if(220===e){if(0!==(s=this.readU16())){this.pushArrayState(s),this.complete();continue e}t=[]}else if(221===e){if(0!==(s=this.readU32())){this.pushArrayState(s),this.complete();continue e}t=[]}else if(222===e){if(0!==(s=this.readU16())){this.pushMapState(s),this.complete();continue e}t={}}else if(223===e){if(0!==(s=this.readU32())){this.pushMapState(s),this.complete();continue e}t={}}else if(196===e){var s=this.lookU8();t=this.decodeBinary(s,1)}else if(197===e)s=this.lookU16(),t=this.decodeBinary(s,2);else if(198===e)s=this.lookU32(),t=this.decodeBinary(s,4);else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e)s=this.lookU8(),t=this.decodeExtension(s,1);else if(200===e)s=this.lookU16(),t=this.decodeExtension(s,2);else{if(201!==e)throw new Error("Unrecognized type byte: "+I(e));s=this.lookU32(),t=this.decodeExtension(s,4)}this.complete();for(var n=this.stack;n.length>0;){var i=n[n.length-1];if(0===i.type){if(i.array[i.position]=t,i.position++,i.position!==i.size)continue e;n.pop(),t=i.array}else{if(1===i.type){if(void 0,"string"!=(o=typeof t)&&"number"!==o)throw new Error("The type of key must be string or number but "+typeof t);i.key=t,i.type=2;continue e}if(i.map[i.key]=t,i.readCount++,i.readCount!==i.size){i.key=null,i.type=1;continue e}n.pop(),t=i.map}}return t}var o},e.prototype.readHeadByte=function(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte},e.prototype.complete=function(){this.headByte=-1},e.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new Error("Unrecognized array type byte: "+I(e))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new Error("Max length exceeded: map length ("+e+") > maxMapLengthLength ("+this.maxMapLength+")");this.stack.push({type:1,size:e,key:null,readCount:0,map:{}})},e.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new Error("Max length exceeded: array length ("+e+") > maxArrayLength ("+this.maxArrayLength+")");this.stack.push({type:0,size:e,array:new Array(e),position:0})},e.prototype.decodeUtf8String=function(e,t){var r;if(e>this.maxStrLength)throw new Error("Max length exceeded: UTF-8 byte length ("+e+") > maxStrLength ("+this.maxStrLength+")");if(this.bytes.byteLength<this.pos+t+e)throw D;var s,n=this.pos+t;return s=this.stateIsMapKey()&&(null===(r=this.keyDecoder)||void 0===r?void 0:r.canBeCached(e))?this.keyDecoder.decode(this.bytes,n,e):i&&e>h?function(e,t,r){var s=e.subarray(t,t+r);return d.decode(s)}(this.bytes,n,e):l(this.bytes,n,e),this.pos+=t+e,s},e.prototype.stateIsMapKey=function(){return this.stack.length>0&&1===this.stack[this.stack.length-1].type},e.prototype.decodeBinary=function(e,t){if(e>this.maxBinLength)throw new Error("Max length exceeded: bin length ("+e+") > maxBinLength ("+this.maxBinLength+")");if(!this.hasRemaining(e+t))throw D;var r=this.pos+t,s=this.bytes.subarray(r,r+e);return this.pos+=t+e,s},e.prototype.decodeExtension=function(e,t){if(e>this.maxExtLength)throw new Error("Max length exceeded: ext length ("+e+") > maxExtLength ("+this.maxExtLength+")");var r=this.view.getInt8(this.pos+t),s=this.decodeBinary(e,t+1);return this.extensionCodec.decode(s,r,this.context)},e.prototype.lookU8=function(){return this.view.getUint8(this.pos)},e.prototype.lookU16=function(){return this.view.getUint16(this.pos)},e.prototype.lookU32=function(){return this.view.getUint32(this.pos)},e.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},e.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},e.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},e.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},e.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},e.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},e.prototype.readU64=function(){var e,t,r,s,n=(e=this.view,t=this.pos,r=e.getUint32(t),s=e.getUint32(t+4),r>Math.floor(Number.MAX_SAFE_INTEGER/4294967296)?BigInt(r)*BigInt(4294967296)+BigInt(s):4294967296*r+s);return this.pos+=8,n},e.prototype.readI64=function(){var e=g(this.view,this.pos);return this.pos+=8,e},e.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},e.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},e}(),M={};function N(e,t){return void 0===t&&(t=M),new L(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decode(e)}var W=function(e,t){var r,s,n,i,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,s&&(n=2&i[0]?s.return:i[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,i[1])).done)return n;switch(s=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,s=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){o.label=i[1];break}if(6===i[0]&&o.label<n[1]){o.label=n[1],n=i;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(i);break}n[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],s=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},K=function(e){return this instanceof K?(this.v=e,this):new K(e)},F=function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s,n=r.apply(e,t||[]),i=[];return s={},o("next"),o("throw"),o("return"),s[Symbol.asyncIterator]=function(){return this},s;function o(e){n[e]&&(s[e]=function(t){return new Promise((function(r,s){i.push([e,t,r,s])>1||a(e,t)}))})}function a(e,t){try{(r=n[e](t)).value instanceof K?Promise.resolve(r.value.v).then(c,u):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function c(e){a("next",e)}function u(e){a("throw",e)}function l(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}};function z(e){return null!=e[Symbol.asyncIterator]?e:function(e){return F(this,arguments,(function(){var t,r,s,n;return W(this,(function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,K(t.read())];case 3:return r=i.sent(),s=r.done,n=r.value,s?[4,K(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return function(e){if(null==e)throw new Error("Assertion Failure: value must not be null nor undefined")}(n),[4,K(n)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}(e)}var V=function(e,t,r,s){return new(r||(r=Promise))((function(n,i){function o(e){try{c(s.next(e))}catch(e){i(e)}}function a(e){try{c(s.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))},H=function(e,t){var r,s,n,i,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,s&&(n=2&i[0]?s.return:i[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,i[1])).done)return n;switch(s=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,s=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){o.label=i[1];break}if(6===i[0]&&o.label<n[1]){o.label=n[1],n=i;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(i);break}n[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],s=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};function G(e,t){return void 0===t&&(t=M),V(this,void 0,void 0,(function(){var r;return H(this,(function(s){return r=z(e),[2,new L(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeAsync(r)]}))}))}function Y(e,t){void 0===t&&(t=M);var r=z(e);return new L(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeArrayStream(r)}function J(e,t){void 0===t&&(t=M);var r=z(e);return new L(t.extensionCodec,t.context,t.maxStrLength,t.maxBinLength,t.maxArrayLength,t.maxMapLength,t.maxExtLength).decodeStream(r)}}])},155:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],s=t[1];return 3*(r+s)/4-s},t.toByteArray=function(e){var t,r,i=a(e),o=i[0],c=i[1],u=new n(function(e,t,r){return 3*(t+r)/4-r}(0,o,c)),l=0,d=c>0?o-4:o;for(r=0;r<d;r+=4)t=s[e.charCodeAt(r)]<<18|s[e.charCodeAt(r+1)]<<12|s[e.charCodeAt(r+2)]<<6|s[e.charCodeAt(r+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===c&&(t=s[e.charCodeAt(r)]<<2|s[e.charCodeAt(r+1)]>>4,u[l++]=255&t),1===c&&(t=s[e.charCodeAt(r)]<<10|s[e.charCodeAt(r+1)]<<4|s[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},t.fromByteArray=function(e){for(var t,s=e.length,n=s%3,i=[],o=16383,a=0,u=s-n;a<u;a+=o)i.push(c(e,a,a+o>u?u:a+o));return 1===n?(t=e[s-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===n&&(t=(e[s-2]<<8)+e[s-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],s=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=i[o],s[i.charCodeAt(o)]=o;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,s){for(var n,i,o=[],a=t;a<s;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(r[(i=n)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},117:function(e,t,r){var s;!function(n){"use strict";var i,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,c=Math.floor,u="[BigNumber Error] ",l=u+"Number primitive has more than 15 significant digits: ",d=1e14,h=14,p=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],g=1e7,m=1e9;function y(e){var t=0|e;return e>0||e===t?t:t-1}function w(e){for(var t,r,s=1,n=e.length,i=e[0]+"";s<n;){for(t=e[s++]+"",r=h-t.length;r--;t="0"+t);i+=t}for(n=i.length;48===i.charCodeAt(--n););return i.slice(0,n+1||1)}function b(e,t){var r,s,n=e.c,i=t.c,o=e.s,a=t.s,c=e.e,u=t.e;if(!o||!a)return null;if(r=n&&!n[0],s=i&&!i[0],r||s)return r?s?0:-a:o;if(o!=a)return o;if(r=o<0,s=c==u,!n||!i)return s?0:!n^r?1:-1;if(!s)return c>u^r?1:-1;for(a=(c=n.length)<(u=i.length)?c:u,o=0;o<a;o++)if(n[o]!=i[o])return n[o]>i[o]^r?1:-1;return c==u?0:c>u^r?1:-1}function v(e,t,r,s){if(e<t||e>r||e!==c(e))throw Error(u+(s||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function x(e){var t=e.c.length-1;return y(e.e/h)==t&&e.c[t]%2!=0}function _(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function A(e,t,r){var s,n;if(t<0){for(n=r+".";++t;n+=r);e=n+e}else if(++t>(s=e.length)){for(n=r,t-=s;--t;n+=r);e+=n}else t<s&&(e=e.slice(0,t)+"."+e.slice(t));return e}i=function e(t){var r,s,n,i,E,k,S,R,T,I,B=K.prototype={constructor:K,toString:null,valueOf:null},U=new K(1),P=20,j=4,q=-7,$=21,C=-1e7,D=1e7,O=!1,L=1,M=0,N={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},W="0123456789abcdefghijklmnopqrstuvwxyz";function K(e,t){var r,i,a,u,d,f,g,m,y=this;if(!(y instanceof K))return new K(e,t);if(null==t){if(e&&!0===e._isBigNumber)return y.s=e.s,void(!e.c||e.e>D?y.c=y.e=null:e.e<C?y.c=[y.e=0]:(y.e=e.e,y.c=e.c.slice()));if((f="number"==typeof e)&&0*e==0){if(y.s=1/e<0?(e=-e,-1):1,e===~~e){for(u=0,d=e;d>=10;d/=10,u++);return void(u>D?y.c=y.e=null:(y.e=u,y.c=[e]))}m=String(e)}else{if(!o.test(m=String(e)))return n(y,m,f);y.s=45==m.charCodeAt(0)?(m=m.slice(1),-1):1}(u=m.indexOf("."))>-1&&(m=m.replace(".","")),(d=m.search(/e/i))>0?(u<0&&(u=d),u+=+m.slice(d+1),m=m.substring(0,d)):u<0&&(u=m.length)}else{if(v(t,2,W.length,"Base"),10==t)return H(y=new K(e),P+y.e+1,j);if(m=String(e),f="number"==typeof e){if(0*e!=0)return n(y,m,f,t);if(y.s=1/e<0?(m=m.slice(1),-1):1,K.DEBUG&&m.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else y.s=45===m.charCodeAt(0)?(m=m.slice(1),-1):1;for(r=W.slice(0,t),u=d=0,g=m.length;d<g;d++)if(r.indexOf(i=m.charAt(d))<0){if("."==i){if(d>u){u=g;continue}}else if(!a&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){a=!0,d=-1,u=0;continue}return n(y,String(e),f,t)}f=!1,(u=(m=s(m,t,10,y.s)).indexOf("."))>-1?m=m.replace(".",""):u=m.length}for(d=0;48===m.charCodeAt(d);d++);for(g=m.length;48===m.charCodeAt(--g););if(m=m.slice(d,++g)){if(g-=d,f&&K.DEBUG&&g>15&&(e>p||e!==c(e)))throw Error(l+y.s*e);if((u=u-d-1)>D)y.c=y.e=null;else if(u<C)y.c=[y.e=0];else{if(y.e=u,y.c=[],d=(u+1)%h,u<0&&(d+=h),d<g){for(d&&y.c.push(+m.slice(0,d)),g-=h;d<g;)y.c.push(+m.slice(d,d+=h));d=h-(m=m.slice(d)).length}else d-=g;for(;d--;m+="0");y.c.push(+m)}}else y.c=[y.e=0]}function F(e,t,r,s){var n,i,o,a,c;if(null==r?r=j:v(r,0,8),!e.c)return e.toString();if(n=e.c[0],o=e.e,null==t)c=w(e.c),c=1==s||2==s&&(o<=q||o>=$)?_(c,o):A(c,o,"0");else if(i=(e=H(new K(e),t,r)).e,a=(c=w(e.c)).length,1==s||2==s&&(t<=i||i<=q)){for(;a<t;c+="0",a++);c=_(c,i)}else if(t-=o,c=A(c,i,"0"),i+1>a){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=i-a)>0)for(i+1==a&&(c+=".");t--;c+="0");return e.s<0&&n?"-"+c:c}function z(e,t){for(var r,s=1,n=new K(e[0]);s<e.length;s++){if(!(r=new K(e[s])).s){n=r;break}t.call(n,r)&&(n=r)}return n}function V(e,t,r){for(var s=1,n=t.length;!t[--n];t.pop());for(n=t[0];n>=10;n/=10,s++);return(r=s+r*h-1)>D?e.c=e.e=null:r<C?e.c=[e.e=0]:(e.e=r,e.c=t),e}function H(e,t,r,s){var n,i,o,u,l,p,g,m=e.c,y=f;if(m){e:{for(n=1,u=m[0];u>=10;u/=10,n++);if((i=t-n)<0)i+=h,o=t,g=(l=m[p=0])/y[n-o-1]%10|0;else if((p=a((i+1)/h))>=m.length){if(!s)break e;for(;m.length<=p;m.push(0));l=g=0,n=1,o=(i%=h)-h+1}else{for(l=u=m[p],n=1;u>=10;u/=10,n++);g=(o=(i%=h)-h+n)<0?0:l/y[n-o-1]%10|0}if(s=s||t<0||null!=m[p+1]||(o<0?l:l%y[n-o-1]),s=r<4?(g||s)&&(0==r||r==(e.s<0?3:2)):g>5||5==g&&(4==r||s||6==r&&(i>0?o>0?l/y[n-o]:0:m[p-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,s?(t-=e.e+1,m[0]=y[(h-t%h)%h],e.e=-t||0):m[0]=e.e=0,e;if(0==i?(m.length=p,u=1,p--):(m.length=p+1,u=y[h-i],m[p]=o>0?c(l/y[n-o]%y[o])*u:0),s)for(;;){if(0==p){for(i=1,o=m[0];o>=10;o/=10,i++);for(o=m[0]+=u,u=1;o>=10;o/=10,u++);i!=u&&(e.e++,m[0]==d&&(m[0]=1));break}if(m[p]+=u,m[p]!=d)break;m[p--]=0,u=1}for(i=m.length;0===m[--i];m.pop());}e.e>D?e.c=e.e=null:e.e<C&&(e.c=[e.e=0])}return e}function G(e){var t,r=e.e;return null===r?e.toString():(t=w(e.c),t=r<=q||r>=$?_(t,r):A(t,r,"0"),e.s<0?"-"+t:t)}return K.clone=e,K.ROUND_UP=0,K.ROUND_DOWN=1,K.ROUND_CEIL=2,K.ROUND_FLOOR=3,K.ROUND_HALF_UP=4,K.ROUND_HALF_DOWN=5,K.ROUND_HALF_EVEN=6,K.ROUND_HALF_CEIL=7,K.ROUND_HALF_FLOOR=8,K.EUCLID=9,K.config=K.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(u+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(v(r=e[t],0,m,t),P=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(v(r=e[t],0,8,t),j=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(v(r[0],-m,0,t),v(r[1],0,m,t),q=r[0],$=r[1]):(v(r,-m,m,t),q=-($=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)v(r[0],-m,-1,t),v(r[1],1,m,t),C=r[0],D=r[1];else{if(v(r,-m,m,t),!r)throw Error(u+t+" cannot be zero: "+r);C=-(D=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(u+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw O=!r,Error(u+"crypto unavailable");O=r}else O=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(v(r=e[t],0,9,t),L=r),e.hasOwnProperty(t="POW_PRECISION")&&(v(r=e[t],0,m,t),M=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(u+t+" not an object: "+r);N=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(u+t+" invalid: "+r);W=r}}return{DECIMAL_PLACES:P,ROUNDING_MODE:j,EXPONENTIAL_AT:[q,$],RANGE:[C,D],CRYPTO:O,MODULO_MODE:L,POW_PRECISION:M,FORMAT:N,ALPHABET:W}},K.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!K.DEBUG)return!0;var t,r,s=e.c,n=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(s)){if((1===i||-1===i)&&n>=-m&&n<=m&&n===c(n)){if(0===s[0]){if(0===n&&1===s.length)return!0;break e}if((t=(n+1)%h)<1&&(t+=h),String(s[0]).length==t){for(t=0;t<s.length;t++)if((r=s[t])<0||r>=d||r!==c(r))break e;if(0!==r)return!0}}}else if(null===s&&null===n&&(null===i||1===i||-1===i))return!0;throw Error(u+"Invalid BigNumber: "+e)},K.maximum=K.max=function(){return z(arguments,B.lt)},K.minimum=K.min=function(){return z(arguments,B.gt)},K.random=(i=9007199254740992,E=Math.random()*i&2097151?function(){return c(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,s,n,i,o=0,l=[],d=new K(U);if(null==e?e=P:v(e,0,m),n=a(e/h),O)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(n*=2));o<n;)(i=131072*t[o]+(t[o+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(l.push(i%1e14),o+=2);o=n/2}else{if(!crypto.randomBytes)throw O=!1,Error(u+"crypto unavailable");for(t=crypto.randomBytes(n*=7);o<n;)(i=281474976710656*(31&t[o])+1099511627776*t[o+1]+4294967296*t[o+2]+16777216*t[o+3]+(t[o+4]<<16)+(t[o+5]<<8)+t[o+6])>=9e15?crypto.randomBytes(7).copy(t,o):(l.push(i%1e14),o+=7);o=n/7}if(!O)for(;o<n;)(i=E())<9e15&&(l[o++]=i%1e14);for(n=l[--o],e%=h,n&&e&&(i=f[h-e],l[o]=c(n/i)*i);0===l[o];l.pop(),o--);if(o<0)l=[s=0];else{for(s=-1;0===l[0];l.splice(0,1),s-=h);for(o=1,i=l[0];i>=10;i/=10,o++);o<h&&(s-=h-o)}return d.e=s,d.c=l,d}),K.sum=function(){for(var e=1,t=arguments,r=new K(t[0]);e<t.length;)r=r.plus(t[e++]);return r},s=function(){var e="0123456789";function t(e,t,r,s){for(var n,i,o=[0],a=0,c=e.length;a<c;){for(i=o.length;i--;o[i]*=t);for(o[0]+=s.indexOf(e.charAt(a++)),n=0;n<o.length;n++)o[n]>r-1&&(null==o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}return function(s,n,i,o,a){var c,u,l,d,h,p,f,g,m=s.indexOf("."),y=P,b=j;for(m>=0&&(d=M,M=0,s=s.replace(".",""),p=(g=new K(n)).pow(s.length-m),M=d,g.c=t(A(w(p.c),p.e,"0"),10,i,e),g.e=g.c.length),l=d=(f=t(s,n,i,a?(c=W,e):(c=e,W))).length;0==f[--d];f.pop());if(!f[0])return c.charAt(0);if(m<0?--l:(p.c=f,p.e=l,p.s=o,f=(p=r(p,g,y,b,i)).c,h=p.r,l=p.e),m=f[u=l+y+1],d=i/2,h=h||u<0||null!=f[u+1],h=b<4?(null!=m||h)&&(0==b||b==(p.s<0?3:2)):m>d||m==d&&(4==b||h||6==b&&1&f[u-1]||b==(p.s<0?8:7)),u<1||!f[0])s=h?A(c.charAt(1),-y,c.charAt(0)):c.charAt(0);else{if(f.length=u,h)for(--i;++f[--u]>i;)f[u]=0,u||(++l,f=[1].concat(f));for(d=f.length;!f[--d];);for(m=0,s="";m<=d;s+=c.charAt(f[m++]));s=A(s,l,c.charAt(0))}return s}}(),r=function(){function e(e,t,r){var s,n,i,o,a=0,c=e.length,u=t%g,l=t/g|0;for(e=e.slice();c--;)a=((n=u*(i=e[c]%g)+(s=l*i+(o=e[c]/g|0)*u)%g*g+a)/r|0)+(s/g|0)+l*o,e[c]=n%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,s){var n,i;if(r!=s)i=r>s?1:-1;else for(n=i=0;n<r;n++)if(e[n]!=t[n]){i=e[n]>t[n]?1:-1;break}return i}function r(e,t,r,s){for(var n=0;r--;)e[r]-=n,n=e[r]<t[r]?1:0,e[r]=n*s+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(s,n,i,o,a){var u,l,p,f,g,m,w,b,v,x,_,A,E,k,S,R,T,I=s.s==n.s?1:-1,B=s.c,U=n.c;if(!(B&&B[0]&&U&&U[0]))return new K(s.s&&n.s&&(B?!U||B[0]!=U[0]:U)?B&&0==B[0]||!U?0*I:I/0:NaN);for(v=(b=new K(I)).c=[],I=i+(l=s.e-n.e)+1,a||(a=d,l=y(s.e/h)-y(n.e/h),I=I/h|0),p=0;U[p]==(B[p]||0);p++);if(U[p]>(B[p]||0)&&l--,I<0)v.push(1),f=!0;else{for(k=B.length,R=U.length,p=0,I+=2,(g=c(a/(U[0]+1)))>1&&(U=e(U,g,a),B=e(B,g,a),R=U.length,k=B.length),E=R,_=(x=B.slice(0,R)).length;_<R;x[_++]=0);T=U.slice(),T=[0].concat(T),S=U[0],U[1]>=a/2&&S++;do{if(g=0,(u=t(U,x,R,_))<0){if(A=x[0],R!=_&&(A=A*a+(x[1]||0)),(g=c(A/S))>1)for(g>=a&&(g=a-1),w=(m=e(U,g,a)).length,_=x.length;1==t(m,x,w,_);)g--,r(m,R<w?T:U,w,a),w=m.length,u=1;else 0==g&&(u=g=1),w=(m=U.slice()).length;if(w<_&&(m=[0].concat(m)),r(x,m,_,a),_=x.length,-1==u)for(;t(U,x,R,_)<1;)g++,r(x,R<_?T:U,_,a),_=x.length}else 0===u&&(g++,x=[0]);v[p++]=g,x[0]?x[_++]=B[E]||0:(x=[B[E]],_=1)}while((E++<k||null!=x[0])&&I--);f=null!=x[0],v[0]||v.splice(0,1)}if(a==d){for(p=1,I=v[0];I>=10;I/=10,p++);H(b,i+(b.e=p+l*h-1)+1,o,f)}else b.e=l,b.r=+f;return b}}(),k=/^(-?)0([xbo])(?=\w[\w.]*$)/i,S=/^([^.]+)\.$/,R=/^\.([^.]+)$/,T=/^-?(Infinity|NaN)$/,I=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,t,r,s){var n,i=r?t:t.replace(I,"");if(T.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(k,(function(e,t,r){return n="x"==(r=r.toLowerCase())?16:"b"==r?2:8,s&&s!=n?e:t})),s&&(n=s,i=i.replace(S,"$1").replace(R,"0.$1")),t!=i))return new K(i,n);if(K.DEBUG)throw Error(u+"Not a"+(s?" base "+s:"")+" number: "+t);e.s=null}e.c=e.e=null},B.absoluteValue=B.abs=function(){var e=new K(this);return e.s<0&&(e.s=1),e},B.comparedTo=function(e,t){return b(this,new K(e,t))},B.decimalPlaces=B.dp=function(e,t){var r,s,n,i=this;if(null!=e)return v(e,0,m),null==t?t=j:v(t,0,8),H(new K(i),e+i.e+1,t);if(!(r=i.c))return null;if(s=((n=r.length-1)-y(this.e/h))*h,n=r[n])for(;n%10==0;n/=10,s--);return s<0&&(s=0),s},B.dividedBy=B.div=function(e,t){return r(this,new K(e,t),P,j)},B.dividedToIntegerBy=B.idiv=function(e,t){return r(this,new K(e,t),0,1)},B.exponentiatedBy=B.pow=function(e,t){var r,s,n,i,o,l,d,p,f=this;if((e=new K(e)).c&&!e.isInteger())throw Error(u+"Exponent not an integer: "+G(e));if(null!=t&&(t=new K(t)),o=e.e>14,!f.c||!f.c[0]||1==f.c[0]&&!f.e&&1==f.c.length||!e.c||!e.c[0])return p=new K(Math.pow(+G(f),o?2-x(e):+G(e))),t?p.mod(t):p;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new K(NaN);(s=!l&&f.isInteger()&&t.isInteger())&&(f=f.mod(t))}else{if(e.e>9&&(f.e>0||f.e<-1||(0==f.e?f.c[0]>1||o&&f.c[1]>=24e7:f.c[0]<8e13||o&&f.c[0]<=9999975e7)))return i=f.s<0&&x(e)?-0:0,f.e>-1&&(i=1/i),new K(l?1/i:i);M&&(i=a(M/h+2))}for(o?(r=new K(.5),l&&(e.s=1),d=x(e)):d=(n=Math.abs(+G(e)))%2,p=new K(U);;){if(d){if(!(p=p.times(f)).c)break;i?p.c.length>i&&(p.c.length=i):s&&(p=p.mod(t))}if(n){if(0===(n=c(n/2)))break;d=n%2}else if(H(e=e.times(r),e.e+1,1),e.e>14)d=x(e);else{if(0==(n=+G(e)))break;d=n%2}f=f.times(f),i?f.c&&f.c.length>i&&(f.c.length=i):s&&(f=f.mod(t))}return s?p:(l&&(p=U.div(p)),t?p.mod(t):i?H(p,M,j,void 0):p)},B.integerValue=function(e){var t=new K(this);return null==e?e=j:v(e,0,8),H(t,t.e+1,e)},B.isEqualTo=B.eq=function(e,t){return 0===b(this,new K(e,t))},B.isFinite=function(){return!!this.c},B.isGreaterThan=B.gt=function(e,t){return b(this,new K(e,t))>0},B.isGreaterThanOrEqualTo=B.gte=function(e,t){return 1===(t=b(this,new K(e,t)))||0===t},B.isInteger=function(){return!!this.c&&y(this.e/h)>this.c.length-2},B.isLessThan=B.lt=function(e,t){return b(this,new K(e,t))<0},B.isLessThanOrEqualTo=B.lte=function(e,t){return-1===(t=b(this,new K(e,t)))||0===t},B.isNaN=function(){return!this.s},B.isNegative=function(){return this.s<0},B.isPositive=function(){return this.s>0},B.isZero=function(){return!!this.c&&0==this.c[0]},B.minus=function(e,t){var r,s,n,i,o=this,a=o.s;if(t=(e=new K(e,t)).s,!a||!t)return new K(NaN);if(a!=t)return e.s=-t,o.plus(e);var c=o.e/h,u=e.e/h,l=o.c,p=e.c;if(!c||!u){if(!l||!p)return l?(e.s=-t,e):new K(p?o:NaN);if(!l[0]||!p[0])return p[0]?(e.s=-t,e):new K(l[0]?o:3==j?-0:0)}if(c=y(c),u=y(u),l=l.slice(),a=c-u){for((i=a<0)?(a=-a,n=l):(u=c,n=p),n.reverse(),t=a;t--;n.push(0));n.reverse()}else for(s=(i=(a=l.length)<(t=p.length))?a:t,a=t=0;t<s;t++)if(l[t]!=p[t]){i=l[t]<p[t];break}if(i&&(n=l,l=p,p=n,e.s=-e.s),(t=(s=p.length)-(r=l.length))>0)for(;t--;l[r++]=0);for(t=d-1;s>a;){if(l[--s]<p[s]){for(r=s;r&&!l[--r];l[r]=t);--l[r],l[s]+=d}l[s]-=p[s]}for(;0==l[0];l.splice(0,1),--u);return l[0]?V(e,l,u):(e.s=3==j?-1:1,e.c=[e.e=0],e)},B.modulo=B.mod=function(e,t){var s,n,i=this;return e=new K(e,t),!i.c||!e.s||e.c&&!e.c[0]?new K(NaN):!e.c||i.c&&!i.c[0]?new K(i):(9==L?(n=e.s,e.s=1,s=r(i,e,0,3),e.s=n,s.s*=n):s=r(i,e,0,L),(e=i.minus(s.times(e))).c[0]||1!=L||(e.s=i.s),e)},B.multipliedBy=B.times=function(e,t){var r,s,n,i,o,a,c,u,l,p,f,m,w,b,v,x=this,_=x.c,A=(e=new K(e,t)).c;if(!(_&&A&&_[0]&&A[0]))return!x.s||!e.s||_&&!_[0]&&!A||A&&!A[0]&&!_?e.c=e.e=e.s=null:(e.s*=x.s,_&&A?(e.c=[0],e.e=0):e.c=e.e=null),e;for(s=y(x.e/h)+y(e.e/h),e.s*=x.s,(c=_.length)<(p=A.length)&&(w=_,_=A,A=w,n=c,c=p,p=n),n=c+p,w=[];n--;w.push(0));for(b=d,v=g,n=p;--n>=0;){for(r=0,f=A[n]%v,m=A[n]/v|0,i=n+(o=c);i>n;)r=((u=f*(u=_[--o]%v)+(a=m*u+(l=_[o]/v|0)*f)%v*v+w[i]+r)/b|0)+(a/v|0)+m*l,w[i--]=u%b;w[i]=r}return r?++s:w.splice(0,1),V(e,w,s)},B.negated=function(){var e=new K(this);return e.s=-e.s||null,e},B.plus=function(e,t){var r,s=this,n=s.s;if(t=(e=new K(e,t)).s,!n||!t)return new K(NaN);if(n!=t)return e.s=-t,s.minus(e);var i=s.e/h,o=e.e/h,a=s.c,c=e.c;if(!i||!o){if(!a||!c)return new K(n/0);if(!a[0]||!c[0])return c[0]?e:new K(a[0]?s:0*n)}if(i=y(i),o=y(o),a=a.slice(),n=i-o){for(n>0?(o=i,r=c):(n=-n,r=a),r.reverse();n--;r.push(0));r.reverse()}for((n=a.length)-(t=c.length)<0&&(r=c,c=a,a=r,t=n),n=0;t;)n=(a[--t]=a[t]+c[t]+n)/d|0,a[t]=d===a[t]?0:a[t]%d;return n&&(a=[n].concat(a),++o),V(e,a,o)},B.precision=B.sd=function(e,t){var r,s,n,i=this;if(null!=e&&e!==!!e)return v(e,1,m),null==t?t=j:v(t,0,8),H(new K(i),e,t);if(!(r=i.c))return null;if(s=(n=r.length-1)*h+1,n=r[n]){for(;n%10==0;n/=10,s--);for(n=r[0];n>=10;n/=10,s++);}return e&&i.e+1>s&&(s=i.e+1),s},B.shiftedBy=function(e){return v(e,-9007199254740991,p),this.times("1e"+e)},B.squareRoot=B.sqrt=function(){var e,t,s,n,i,o=this,a=o.c,c=o.s,u=o.e,l=P+4,d=new K("0.5");if(1!==c||!a||!a[0])return new K(!c||c<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(c=Math.sqrt(+G(o)))||c==1/0?(((t=w(a)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=y((u+1)/2)-(u<0||u%2),s=new K(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):s=new K(c+""),s.c[0])for((c=(u=s.e)+l)<3&&(c=0);;)if(i=s,s=d.times(i.plus(r(o,i,l,1))),w(i.c).slice(0,c)===(t=w(s.c)).slice(0,c)){if(s.e<u&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(n||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(H(s,s.e+P+2,1),e=!s.times(s).eq(o));break}if(!n&&(H(i,i.e+P+2,0),i.times(i).eq(o))){s=i;break}l+=4,c+=4,n=1}return H(s,s.e+P+1,j,e)},B.toExponential=function(e,t){return null!=e&&(v(e,0,m),e++),F(this,e,t,1)},B.toFixed=function(e,t){return null!=e&&(v(e,0,m),e=e+this.e+1),F(this,e,t)},B.toFormat=function(e,t,r){var s,n=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=N;else if("object"!=typeof r)throw Error(u+"Argument not an object: "+r);if(s=n.toFixed(e,t),n.c){var i,o=s.split("."),a=+r.groupSize,c=+r.secondaryGroupSize,l=r.groupSeparator||"",d=o[0],h=o[1],p=n.s<0,f=p?d.slice(1):d,g=f.length;if(c&&(i=a,a=c,c=i,g-=i),a>0&&g>0){for(i=g%a||a,d=f.substr(0,i);i<g;i+=a)d+=l+f.substr(i,a);c>0&&(d+=l+f.slice(i)),p&&(d="-"+d)}s=h?d+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):d}return(r.prefix||"")+s+(r.suffix||"")},B.toFraction=function(e){var t,s,n,i,o,a,c,l,d,p,g,m,y=this,b=y.c;if(null!=e&&(!(c=new K(e)).isInteger()&&(c.c||1!==c.s)||c.lt(U)))throw Error(u+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+G(c));if(!b)return new K(y);for(t=new K(U),d=s=new K(U),n=l=new K(U),m=w(b),o=t.e=m.length-y.e-1,t.c[0]=f[(a=o%h)<0?h+a:a],e=!e||c.comparedTo(t)>0?o>0?t:d:c,a=D,D=1/0,c=new K(m),l.c[0]=0;p=r(c,t,0,1),1!=(i=s.plus(p.times(n))).comparedTo(e);)s=n,n=i,d=l.plus(p.times(i=d)),l=i,t=c.minus(p.times(i=t)),c=i;return i=r(e.minus(s),n,0,1),l=l.plus(i.times(d)),s=s.plus(i.times(n)),l.s=d.s=y.s,g=r(d,n,o*=2,j).minus(y).abs().comparedTo(r(l,s,o,j).minus(y).abs())<1?[d,n]:[l,s],D=a,g},B.toNumber=function(){return+G(this)},B.toPrecision=function(e,t){return null!=e&&v(e,1,m),F(this,e,t,2)},B.toString=function(e){var t,r=this,n=r.s,i=r.e;return null===i?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=i<=q||i>=$?_(w(r.c),i):A(w(r.c),i,"0"):10===e?t=A(w((r=H(new K(r),P+i+1,j)).c),r.e,"0"):(v(e,2,W.length,"Base"),t=s(A(w(r.c),i,"0"),10,e,n,!0)),n<0&&r.c[0]&&(t="-"+t)),t},B.valueOf=B.toJSON=function(){return G(this)},B._isBigNumber=!0,null!=t&&K.set(t),K}(),i.default=i.BigNumber=i,void 0===(s=function(){return i}.call(t,r,t,e))||(e.exports=s)}()},486:(e,t,r)=>{"use strict";const s=r(155),n=r(525),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=c,t.h2=50;const o=2147483647;function a(e){if(e>o)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 d(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|g(e,t);let s=a(r);const n=s.write(e,t);return n!==r&&(s=s.slice(0,n)),s}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Y(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(Y(e,ArrayBuffer)||e&&Y(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(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 s=e.valueOf&&e.valueOf();if(null!=s&&s!==e)return c.from(s,t,r);const n=function(e){if(c.isBuffer(e)){const t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(n)return n;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 d(e){return l(e),a(e<0?0:0|f(e))}function h(e){const t=e.length<0?0:0|f(e.length),r=a(t);for(let s=0;s<t;s+=1)r[s]=255&e[s];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 s;return s=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(s,c.prototype),s}function f(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function g(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(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,s=arguments.length>2&&!0===arguments[2];if(!s&&0===r)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(n)return s?-1:V(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){let s=!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 B(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r);default:if(s)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function y(e,t,r){const s=e[t];e[t]=e[r],e[r]=s}function w(e,t,r,s,n){if(0===e.length)return-1;if("string"==typeof r?(s=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=c.from(t,s)),c.isBuffer(t))return 0===t.length?-1:b(e,t,r,s,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,s,n);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,s,n){let i,o=1,a=e.length,c=t.length;if(void 0!==s&&("ucs2"===(s=String(s).toLowerCase())||"ucs-2"===s||"utf16le"===s||"utf-16le"===s)){if(e.length<2||t.length<2)return-1;o=2,a/=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){let s=-1;for(i=r;i<a;i++)if(u(e,i)===u(t,-1===s?0:i-s)){if(-1===s&&(s=i),i-s+1===c)return s*o}else-1!==s&&(i-=i-s),s=-1}else for(r+c>a&&(r=a-c),i=r;i>=0;i--){let r=!0;for(let s=0;s<c;s++)if(u(e,i+s)!==u(t,s)){r=!1;break}if(r)return i}return-1}function v(e,t,r,s){r=Number(r)||0;const n=e.length-r;s?(s=Number(s))>n&&(s=n):s=n;const i=t.length;let o;for(s>i/2&&(s=i/2),o=0;o<s;++o){const s=parseInt(t.substr(2*o,2),16);if(J(s))return o;e[r+o]=s}return o}function x(e,t,r,s){return G(V(t,e.length-r),e,r,s)}function _(e,t,r,s){return G(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,s)}function A(e,t,r,s){return G(H(t),e,r,s)}function E(e,t,r,s){return G(function(e,t){let r,s,n;const i=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)r=e.charCodeAt(o),s=r>>8,n=r%256,i.push(n),i.push(s);return i}(t,e.length-r),e,r,s)}function k(e,t,r){return 0===t&&r===e.length?s.fromByteArray(e):s.fromByteArray(e.slice(t,r))}function S(e,t,r){r=Math.min(e.length,r);const s=[];let n=t;for(;n<r;){const t=e[n];let i=null,o=t>239?4:t>223?3:t>191?2:1;if(n+o<=r){let r,s,a,c;switch(o){case 1:t<128&&(i=t);break;case 2:r=e[n+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(i=c));break;case 3:r=e[n+1],s=e[n+2],128==(192&r)&&128==(192&s)&&(c=(15&t)<<12|(63&r)<<6|63&s,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:r=e[n+1],s=e[n+2],a=e[n+3],128==(192&r)&&128==(192&s)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&s)<<6|63&a,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,o=1):i>65535&&(i-=65536,s.push(i>>>10&1023|55296),i=56320|1023&i),s.push(i),n+=o}return function(e){const t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);let r="",s=0;for(;s<t;)r+=String.fromCharCode.apply(String,e.slice(s,s+=R));return r}(s)}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 d(e)},c.allocUnsafeSlow=function(e){return d(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(Y(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),Y(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,s=t.length;for(let n=0,i=Math.min(r,s);n<i;++n)if(e[n]!==t[n]){r=e[n],s=t[n];break}return r<s?-1:s<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 s=c.allocUnsafe(t);let n=0;for(r=0;r<e.length;++r){let t=e[r];if(Y(t,Uint8Array))n+t.length>s.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(s,n)):Uint8Array.prototype.set.call(s,t,n);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(s,n)}n+=t.length}return s},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)y(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)y(this,t,t+3),y(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)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?S(this,0,e):m.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.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(e,t,r,s,n){if(Y(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===s&&(s=0),void 0===n&&(n=this.length),t<0||r>e.length||s<0||n>this.length)throw new RangeError("out of range index");if(s>=n&&t>=r)return 0;if(s>=n)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(n>>>=0)-(s>>>=0),o=(r>>>=0)-(t>>>=0);const a=Math.min(i,o),u=this.slice(s,n),l=e.slice(t,r);for(let e=0;e<a;++e)if(u[e]!==l[e]){i=u[e],o=l[e];break}return i<o?-1:o<i?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return w(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return w(this,e,t,r,!1)},c.prototype.write=function(e,t,r,s){if(void 0===t)s="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)s=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===s&&(s="utf8")):(s=r,r=void 0)}const n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");s||(s="utf8");let i=!1;for(;;)switch(s){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return x(this,e,t,r);case"ascii":case"latin1":case"binary":return _(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const R=4096;function T(e,t,r){let s="";r=Math.min(e.length,r);for(let n=t;n<r;++n)s+=String.fromCharCode(127&e[n]);return s}function I(e,t,r){let s="";r=Math.min(e.length,r);for(let n=t;n<r;++n)s+=String.fromCharCode(e[n]);return s}function B(e,t,r){const s=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>s)&&(r=s);let n="";for(let s=t;s<r;++s)n+=X[e[s]];return n}function U(e,t,r){const s=e.slice(t,r);let n="";for(let e=0;e<s.length-1;e+=2)n+=String.fromCharCode(s[e]+256*s[e+1]);return n}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 j(e,t,r,s,n,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<i)throw new RangeError('"value" argument is out of bounds');if(r+s>e.length)throw new RangeError("Index out of range")}function q(e,t,r,s,n){W(t,s,n,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function $(e,t,r,s,n){W(t,s,n,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function C(e,t,r,s,n,i){if(r+s>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,s,i){return t=+t,r>>>=0,i||C(e,0,r,4),n.write(e,t,r,s,23,4),r+4}function O(e,t,r,s,i){return t=+t,r>>>=0,i||C(e,0,r,8),n.write(e,t,r,s,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 s=this.subarray(e,t);return Object.setPrototypeOf(s,c.prototype),s},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let s=this[e],n=1,i=0;for(;++i<t&&(n*=256);)s+=this[e+i]*n;return s},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let s=this[e+--t],n=1;for(;t>0&&(n*=256);)s+=this[e+--t]*n;return s},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){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||F(e,this.length-8);const s=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,n=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(s)+(BigInt(n)<<BigInt(32))})),c.prototype.readBigUInt64BE=Z((function(e){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||F(e,this.length-8);const s=t*2**24+65536*this[++e]+256*this[++e]+this[++e],n=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(s)<<BigInt(32))+BigInt(n)})),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let s=this[e],n=1,i=0;for(;++i<t&&(n*=256);)s+=this[e+i]*n;return n*=128,s>=n&&(s-=Math.pow(2,8*t)),s},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let s=t,n=1,i=this[e+--s];for(;s>0&&(n*=256);)i+=this[e+--s]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*t)),i},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){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||F(e,this.length-8);const s=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(s)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=Z((function(e){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||F(e,this.length-8);const s=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(s)<<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),n.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),n.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),n.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),n.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,s){e=+e,t>>>=0,r>>>=0,s||j(this,e,t,r,Math.pow(2,8*r)-1,0);let n=1,i=0;for(this[t]=255&e;++i<r&&(n*=256);)this[t+i]=e/n&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,s){e=+e,t>>>=0,r>>>=0,s||j(this,e,t,r,Math.pow(2,8*r)-1,0);let n=r-1,i=1;for(this[t+n]=255&e;--n>=0&&(i*=256);)this[t+n]=e/i&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||j(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||j(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||j(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||j(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||j(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 q(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Z((function(e,t=0){return $(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,s){if(e=+e,t>>>=0,!s){const s=Math.pow(2,8*r-1);j(this,e,t,r,s-1,-s)}let n=0,i=1,o=0;for(this[t]=255&e;++n<r&&(i*=256);)e<0&&0===o&&0!==this[t+n-1]&&(o=1),this[t+n]=(e/i>>0)-o&255;return t+r},c.prototype.writeIntBE=function(e,t,r,s){if(e=+e,t>>>=0,!s){const s=Math.pow(2,8*r-1);j(this,e,t,r,s-1,-s)}let n=r-1,i=1,o=0;for(this[t+n]=255&e;--n>=0&&(i*=256);)e<0&&0===o&&0!==this[t+n+1]&&(o=1),this[t+n]=(e/i>>0)-o&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||j(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||j(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||j(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||j(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||j(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 q(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Z((function(e,t=0){return $(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return O(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return O(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,s){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),s||0===s||(s=this.length),t>=e.length&&(t=e.length),t||(t=0),s>0&&s<r&&(s=r),s===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(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),e.length-t<s-r&&(s=e.length-t+r);const n=s-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,s):Uint8Array.prototype.set.call(e,this.subarray(r,s),t),n},c.prototype.fill=function(e,t,r,s){if("string"==typeof e){if("string"==typeof t?(s=t,t=0,r=this.length):"string"==typeof r&&(s=r,r=this.length),void 0!==s&&"string"!=typeof s)throw new TypeError("encoding must be a string");if("string"==typeof s&&!c.isEncoding(s))throw new TypeError("Unknown encoding: "+s);if(1===e.length){const t=e.charCodeAt(0);("utf8"===s&&t<128||"latin1"===s)&&(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 n;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n<r;++n)this[n]=e;else{const i=c.isBuffer(e)?e:c.from(e,s),o=i.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=i[n%o]}return this};const L={};function M(e,t,r){L[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 N(e){let t="",r=e.length;const s="-"===e[0]?1:0;for(;r>=s+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function W(e,t,r,s,n,i){if(e>r||e<t){const s="bigint"==typeof t?"n":"";let n;throw n=i>3?0===t||t===BigInt(0)?`>= 0${s} and < 2${s} ** ${8*(i+1)}${s}`:`>= -(2${s} ** ${8*(i+1)-1}${s}) and < 2 ** ${8*(i+1)-1}${s}`:`>= ${t}${s} and <= ${r}${s}`,new L.ERR_OUT_OF_RANGE("value",n,e)}!function(e,t,r){K(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||F(t,e.length-(r+1))}(s,n,i)}function K(e,t){if("number"!=typeof e)throw new L.ERR_INVALID_ARG_TYPE(t,"number",e)}function F(e,t,r){if(Math.floor(e)!==e)throw K(e,r),new L.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new L.ERR_BUFFER_OUT_OF_BOUNDS;throw new L.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}M("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),M("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),M("ERR_OUT_OF_RANGE",(function(e,t,r){let s=`The value of "${e}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=N(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=N(n)),n+="n"),s+=` It must be ${t}. Received ${n}`,s}),RangeError);const z=/[^+/0-9A-Za-z-_]/g;function V(e,t){let r;t=t||1/0;const s=e.length;let n=null;const i=[];for(let o=0;o<s;++o){if(r=e.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===s){(t-=3)>-1&&i.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function H(e){return s.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,s){let n;for(n=0;n<s&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const s=16*r;for(let n=0;n<16;++n)t[s+n]=e[r]+e[n]}return t}();function Z(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},267:(e,t,r)=>{var s;!function(){"use strict";var t="object"==typeof window?window:{};!t.HI_BASE32_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(t=r.g);var n=!t.HI_BASE32_NO_COMMON_JS&&e.exports,i=r.amdO,o="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),a={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},c=[0,0,0,0,0,0,0,0],u=function(e,t){t.length>10&&(t="..."+t.substr(-10));var r=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+e+" bytes: "+t+" <-");throw r.position=e,r},l=function(e){if(""===e)return[];if(!/^[A-Z2-7=]+$/.test(e))throw new Error("Invalid base32 characters");for(var t,r,s,n,i,o,c,u,l=[],d=0,h=(e=e.replace(/=/g,"")).length,p=0,f=h>>3<<3;p<f;)t=a[e.charAt(p++)],r=a[e.charAt(p++)],s=a[e.charAt(p++)],n=a[e.charAt(p++)],i=a[e.charAt(p++)],o=a[e.charAt(p++)],c=a[e.charAt(p++)],u=a[e.charAt(p++)],l[d++]=255&(t<<3|r>>>2),l[d++]=255&(r<<6|s<<1|n>>>4),l[d++]=255&(n<<4|i>>>1),l[d++]=255&(i<<7|o<<2|c>>>3),l[d++]=255&(c<<5|u);var g=h-f;return 2===g?(t=a[e.charAt(p++)],r=a[e.charAt(p++)],l[d++]=255&(t<<3|r>>>2)):4===g?(t=a[e.charAt(p++)],r=a[e.charAt(p++)],s=a[e.charAt(p++)],n=a[e.charAt(p++)],l[d++]=255&(t<<3|r>>>2),l[d++]=255&(r<<6|s<<1|n>>>4)):5===g?(t=a[e.charAt(p++)],r=a[e.charAt(p++)],s=a[e.charAt(p++)],n=a[e.charAt(p++)],i=a[e.charAt(p++)],l[d++]=255&(t<<3|r>>>2),l[d++]=255&(r<<6|s<<1|n>>>4),l[d++]=255&(n<<4|i>>>1)):7===g&&(t=a[e.charAt(p++)],r=a[e.charAt(p++)],s=a[e.charAt(p++)],n=a[e.charAt(p++)],i=a[e.charAt(p++)],o=a[e.charAt(p++)],c=a[e.charAt(p++)],l[d++]=255&(t<<3|r>>>2),l[d++]=255&(r<<6|s<<1|n>>>4),l[d++]=255&(n<<4|i>>>1),l[d++]=255&(i<<7|o<<2|c>>>3)),l},d=function(e,t){if(!t)return function(e){for(var t,r,s="",n=e.length,i=0,o=0;i<n;)if((t=e[i++])<=127)s+=String.fromCharCode(t);else{t>191&&t<=223?(r=31&t,o=1):t<=239?(r=15&t,o=2):t<=247?(r=7&t,o=3):u(i,s);for(var a=0;a<o;++a)((t=e[i++])<128||t>191)&&u(i,s),r<<=6,r+=63&t;r>=55296&&r<=57343&&u(i,s),r>1114111&&u(i,s),r<=65535?s+=String.fromCharCode(r):(r-=65536,s+=String.fromCharCode(55296+(r>>10)),s+=String.fromCharCode(56320+(1023&r)))}return s}(l(e));if(""===e)return"";if(!/^[A-Z2-7=]+$/.test(e))throw new Error("Invalid base32 characters");var r,s,n,i,o,c,d,h,p="",f=e.indexOf("=");-1===f&&(f=e.length);for(var g=0,m=f>>3<<3;g<m;)r=a[e.charAt(g++)],s=a[e.charAt(g++)],n=a[e.charAt(g++)],i=a[e.charAt(g++)],o=a[e.charAt(g++)],c=a[e.charAt(g++)],d=a[e.charAt(g++)],h=a[e.charAt(g++)],p+=String.fromCharCode(255&(r<<3|s>>>2))+String.fromCharCode(255&(s<<6|n<<1|i>>>4))+String.fromCharCode(255&(i<<4|o>>>1))+String.fromCharCode(255&(o<<7|c<<2|d>>>3))+String.fromCharCode(255&(d<<5|h));var y=f-m;return 2===y?(r=a[e.charAt(g++)],s=a[e.charAt(g++)],p+=String.fromCharCode(255&(r<<3|s>>>2))):4===y?(r=a[e.charAt(g++)],s=a[e.charAt(g++)],n=a[e.charAt(g++)],i=a[e.charAt(g++)],p+=String.fromCharCode(255&(r<<3|s>>>2))+String.fromCharCode(255&(s<<6|n<<1|i>>>4))):5===y?(r=a[e.charAt(g++)],s=a[e.charAt(g++)],n=a[e.charAt(g++)],i=a[e.charAt(g++)],o=a[e.charAt(g++)],p+=String.fromCharCode(255&(r<<3|s>>>2))+String.fromCharCode(255&(s<<6|n<<1|i>>>4))+String.fromCharCode(255&(i<<4|o>>>1))):7===y&&(r=a[e.charAt(g++)],s=a[e.charAt(g++)],n=a[e.charAt(g++)],i=a[e.charAt(g++)],o=a[e.charAt(g++)],c=a[e.charAt(g++)],d=a[e.charAt(g++)],p+=String.fromCharCode(255&(r<<3|s>>>2))+String.fromCharCode(255&(s<<6|n<<1|i>>>4))+String.fromCharCode(255&(i<<4|o>>>1))+String.fromCharCode(255&(o<<7|c<<2|d>>>3))),p},h={encode:function(e,t){var r="string"!=typeof e;return r&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),r?function(e){for(var t,r,s,n,i,a="",c=e.length,u=0,l=5*parseInt(c/5);u<l;)t=e[u++],r=e[u++],s=e[u++],n=e[u++],i=e[u++],a+=o[t>>>3]+o[31&(t<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|s>>>4)]+o[31&(s<<1|n>>>7)]+o[n>>>2&31]+o[31&(n<<3|i>>>5)]+o[31&i];var d=c-l;return 1===d?(t=e[u],a+=o[t>>>3]+o[t<<2&31]+"======"):2===d?(t=e[u++],r=e[u],a+=o[t>>>3]+o[31&(t<<2|r>>>6)]+o[r>>>1&31]+o[r<<4&31]+"===="):3===d?(t=e[u++],r=e[u++],s=e[u],a+=o[t>>>3]+o[31&(t<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|s>>>4)]+o[s<<1&31]+"==="):4===d&&(t=e[u++],r=e[u++],s=e[u++],n=e[u],a+=o[t>>>3]+o[31&(t<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|s>>>4)]+o[31&(s<<1|n>>>7)]+o[n>>>2&31]+o[n<<3&31]+"="),a}(e):t?function(e){for(var t,r,s,n,i,a="",c=e.length,u=0,l=5*parseInt(c/5);u<l;)t=e.charCodeAt(u++),r=e.charCodeAt(u++),s=e.charCodeAt(u++),n=e.charCodeAt(u++),i=e.charCodeAt(u++),a+=o[t>>>3]+o[31&(t<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|s>>>4)]+o[31&(s<<1|n>>>7)]+o[n>>>2&31]+o[31&(n<<3|i>>>5)]+o[31&i];var d=c-l;return 1===d?(t=e.charCodeAt(u),a+=o[t>>>3]+o[t<<2&31]+"======"):2===d?(t=e.charCodeAt(u++),r=e.charCodeAt(u),a+=o[t>>>3]+o[31&(t<<2|r>>>6)]+o[r>>>1&31]+o[r<<4&31]+"===="):3===d?(t=e.charCodeAt(u++),r=e.charCodeAt(u++),s=e.charCodeAt(u),a+=o[t>>>3]+o[31&(t<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|s>>>4)]+o[s<<1&31]+"==="):4===d&&(t=e.charCodeAt(u++),r=e.charCodeAt(u++),s=e.charCodeAt(u++),n=e.charCodeAt(u),a+=o[t>>>3]+o[31&(t<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|s>>>4)]+o[31&(s<<1|n>>>7)]+o[n>>>2&31]+o[n<<3&31]+"="),a}(e):function(e){var t,r,s,n,i,a,u,l=!1,d="",h=0,p=0,f=e.length;if(""===e)return d;do{for(c[0]=c[5],c[1]=c[6],c[2]=c[7],u=p;h<f&&u<5;++h)(a=e.charCodeAt(h))<128?c[u++]=a:a<2048?(c[u++]=192|a>>6,c[u++]=128|63&a):a<55296||a>=57344?(c[u++]=224|a>>12,c[u++]=128|a>>6&63,c[u++]=128|63&a):(a=65536+((1023&a)<<10|1023&e.charCodeAt(++h)),c[u++]=240|a>>18,c[u++]=128|a>>12&63,c[u++]=128|a>>6&63,c[u++]=128|63&a);p=u-5,h===f&&++h,h>f&&u<6&&(l=!0),t=c[0],u>4?(r=c[1],s=c[2],n=c[3],i=c[4],d+=o[t>>>3]+o[31&(t<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|s>>>4)]+o[31&(s<<1|n>>>7)]+o[n>>>2&31]+o[31&(n<<3|i>>>5)]+o[31&i]):1===u?d+=o[t>>>3]+o[t<<2&31]+"======":2===u?(r=c[1],d+=o[t>>>3]+o[31&(t<<2|r>>>6)]+o[r>>>1&31]+o[r<<4&31]+"===="):3===u?(r=c[1],s=c[2],d+=o[t>>>3]+o[31&(t<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|s>>>4)]+o[s<<1&31]+"==="):(r=c[1],s=c[2],n=c[3],d+=o[t>>>3]+o[31&(t<<2|r>>>6)]+o[r>>>1&31]+o[31&(r<<4|s>>>4)]+o[31&(s<<1|n>>>7)]+o[n>>>2&31]+o[n<<3&31]+"=")}while(!l);return d}(e)},decode:d};d.asBytes=l,n?e.exports=h:(t.base32=h,i&&(void 0===(s=function(){return h}.call(h,r,h,e))||(e.exports=s)))}()},525:(e,t)=>{t.read=function(e,t,r,s,n){var i,o,a=8*n-s-1,c=(1<<a)-1,u=c>>1,l=-7,d=r?n-1:0,h=r?-1:1,p=e[t+d];for(d+=h,i=p&(1<<-l)-1,p>>=-l,l+=a;l>0;i=256*i+e[t+d],d+=h,l-=8);for(o=i&(1<<-l)-1,i>>=-l,l+=s;l>0;o=256*o+e[t+d],d+=h,l-=8);if(0===i)i=1-u;else{if(i===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,s),i-=u}return(p?-1:1)*o*Math.pow(2,i-s)},t.write=function(e,t,r,s,n,i){var o,a,c,u=8*i-n-1,l=(1<<u)-1,d=l>>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=s?0:i-1,f=s?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,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+d>=1?h/c:h*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=l?(a=0,o=l):o+d>=1?(a=(t*c-1)*Math.pow(2,n),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,n),o=0));n>=8;e[r+p]=255&a,p+=f,a/=256,n-=8);for(o=o<<n|a,u+=n;u>0;e[r+p]=255&o,p+=f,o/=256,u-=8);e[r+p-f]|=128*g}},757:(e,t,r)=>{var s;!function(){"use strict";var t="input is invalid type",n="object"==typeof window,i=n?window:{};i.JS_SHA512_NO_WINDOW&&(n=!1);var o=!n&&"object"==typeof self;!i.JS_SHA512_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?i=r.g:o&&(i=self);var a=!i.JS_SHA512_NO_COMMON_JS&&e.exports,c=r.amdO,u=!i.JS_SHA512_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,l="0123456789abcdef".split(""),d=[-2147483648,8388608,32768,128],h=[24,16,8,0],p=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],f=["hex","array","digest","arrayBuffer"],g=[];!i.JS_SHA512_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!u||!i.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var m=function(e,t){return function(r){return new v(t,!0).update(r)[e]()}},y=function(e){var t=m("hex",e);t.create=function(){return new v(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<f.length;++r){var s=f[r];t[s]=m(s,e)}return t},w=function(e,t){return function(r,s){return new x(r,t,!0).update(s)[e]()}},b=function(e){var t=w("hex",e);t.create=function(t){return new x(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<f.length;++r){var s=f[r];t[s]=w(s,e)}return t};function v(e,t){t?(g[0]=g[1]=g[2]=g[3]=g[4]=g[5]=g[6]=g[7]=g[8]=g[9]=g[10]=g[11]=g[12]=g[13]=g[14]=g[15]=g[16]=g[17]=g[18]=g[19]=g[20]=g[21]=g[22]=g[23]=g[24]=g[25]=g[26]=g[27]=g[28]=g[29]=g[30]=g[31]=g[32]=0,this.blocks=g):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],384==e?(this.h0h=3418070365,this.h0l=3238371032,this.h1h=1654270250,this.h1l=914150663,this.h2h=2438529370,this.h2l=812702999,this.h3h=355462360,this.h3l=4144912697,this.h4h=1731405415,this.h4l=4290775857,this.h5h=2394180231,this.h5l=1750603025,this.h6h=3675008525,this.h6l=1694076839,this.h7h=1203062813,this.h7l=3204075428):256==e?(this.h0h=573645204,this.h0l=4230739756,this.h1h=2673172387,this.h1l=3360449730,this.h2h=596883563,this.h2l=1867755857,this.h3h=2520282905,this.h3l=1497426621,this.h4h=2519219938,this.h4l=2827943907,this.h5h=3193839141,this.h5l=1401305490,this.h6h=721525244,this.h6l=746961066,this.h7h=246885852,this.h7l=2177182882):224==e?(this.h0h=2352822216,this.h0l=424955298,this.h1h=1944164710,this.h1l=2312950998,this.h2h=502970286,this.h2l=855612546,this.h3h=1738396948,this.h3l=1479516111,this.h4h=258812777,this.h4l=2077511080,this.h5h=2011393907,this.h5l=79989058,this.h6h=1067287976,this.h6l=1780299464,this.h7h=286451373,this.h7l=2446758561):(this.h0h=1779033703,this.h0l=4089235720,this.h1h=3144134277,this.h1l=2227873595,this.h2h=1013904242,this.h2l=4271175723,this.h3h=2773480762,this.h3l=1595750129,this.h4h=1359893119,this.h4l=2917565137,this.h5h=2600822924,this.h5l=725511199,this.h6h=528734635,this.h6l=4215389547,this.h7h=1541459225,this.h7l=327033209),this.bits=e,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}function x(e,r,s){var n,i=typeof e;if("string"!==i){if("object"!==i)throw new Error(t);if(null===e)throw new Error(t);if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||u&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}var o=e.length;if(!n){for(var a,c=[],l=(o=e.length,0),d=0;d<o;++d)(a=e.charCodeAt(d))<128?c[l++]=a:a<2048?(c[l++]=192|a>>6,c[l++]=128|63&a):a<55296||a>=57344?(c[l++]=224|a>>12,c[l++]=128|a>>6&63,c[l++]=128|63&a):(a=65536+((1023&a)<<10|1023&e.charCodeAt(++d)),c[l++]=240|a>>18,c[l++]=128|a>>12&63,c[l++]=128|a>>6&63,c[l++]=128|63&a);e=c}e.length>128&&(e=new v(r,!0).update(e).array());var h=[],p=[];for(d=0;d<128;++d){var f=e[d]||0;h[d]=92^f,p[d]=54^f}v.call(this,r,s),this.update(p),this.oKeyPad=h,this.inner=!0,this.sharedMemory=s}v.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var r,s=typeof e;if("string"!==s){if("object"!==s)throw new Error(t);if(null===e)throw new Error(t);if(u&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||u&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}for(var n,i,o=0,a=e.length,c=this.blocks;o<a;){if(this.hashed&&(this.hashed=!1,c[0]=this.block,c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=c[16]=c[17]=c[18]=c[19]=c[20]=c[21]=c[22]=c[23]=c[24]=c[25]=c[26]=c[27]=c[28]=c[29]=c[30]=c[31]=c[32]=0),r)for(i=this.start;o<a&&i<128;++o)c[i>>2]|=e[o]<<h[3&i++];else for(i=this.start;o<a&&i<128;++o)(n=e.charCodeAt(o))<128?c[i>>2]|=n<<h[3&i++]:n<2048?(c[i>>2]|=(192|n>>6)<<h[3&i++],c[i>>2]|=(128|63&n)<<h[3&i++]):n<55296||n>=57344?(c[i>>2]|=(224|n>>12)<<h[3&i++],c[i>>2]|=(128|n>>6&63)<<h[3&i++],c[i>>2]|=(128|63&n)<<h[3&i++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++o)),c[i>>2]|=(240|n>>18)<<h[3&i++],c[i>>2]|=(128|n>>12&63)<<h[3&i++],c[i>>2]|=(128|n>>6&63)<<h[3&i++],c[i>>2]|=(128|63&n)<<h[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=128?(this.block=c[32],this.start=i-128,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},v.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[32]=this.block,e[t>>2]|=d[3&t],this.block=e[32],t>=112&&(this.hashed||this.hash(),e[0]=this.block,e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=e[16]=e[17]=e[18]=e[19]=e[20]=e[21]=e[22]=e[23]=e[24]=e[25]=e[26]=e[27]=e[28]=e[29]=e[30]=e[31]=e[32]=0),e[30]=this.hBytes<<3|this.bytes>>>29,e[31]=this.bytes<<3,this.hash()}},v.prototype.hash=function(){var e,t,r,s,n,i,o,a,c,u,l,d,h,f,g,m,y,w,b,v,x,_,A,E,k,S=this.h0h,R=this.h0l,T=this.h1h,I=this.h1l,B=this.h2h,U=this.h2l,P=this.h3h,j=this.h3l,q=this.h4h,$=this.h4l,C=this.h5h,D=this.h5l,O=this.h6h,L=this.h6l,M=this.h7h,N=this.h7l,W=this.blocks;for(e=32;e<160;e+=2)t=((v=W[e-30])>>>1|(x=W[e-29])<<31)^(v>>>8|x<<24)^v>>>7,r=(x>>>1|v<<31)^(x>>>8|v<<24)^(x>>>7|v<<25),s=((v=W[e-4])>>>19|(x=W[e-3])<<13)^(x>>>29|v<<3)^v>>>6,n=(x>>>19|v<<13)^(v>>>29|x<<3)^(x>>>6|v<<26),v=W[e-32],x=W[e-31],c=((_=W[e-14])>>>16)+(v>>>16)+(t>>>16)+(s>>>16)+((a=(65535&_)+(65535&v)+(65535&t)+(65535&s)+((o=((A=W[e-13])>>>16)+(x>>>16)+(r>>>16)+(n>>>16)+((i=(65535&A)+(65535&x)+(65535&r)+(65535&n))>>>16))>>>16))>>>16),W[e]=c<<16|65535&a,W[e+1]=o<<16|65535&i;var K=S,F=R,z=T,V=I,H=B,G=U,Y=P,J=j,X=q,Z=$,Q=C,ee=D,te=O,re=L,se=M,ne=N;for(m=z&H,y=V&G,e=0;e<160;e+=8)t=(K>>>28|F<<4)^(F>>>2|K<<30)^(F>>>7|K<<25),r=(F>>>28|K<<4)^(K>>>2|F<<30)^(K>>>7|F<<25),s=(X>>>14|Z<<18)^(X>>>18|Z<<14)^(Z>>>9|X<<23),n=(Z>>>14|X<<18)^(Z>>>18|X<<14)^(X>>>9|Z<<23),w=(u=K&z)^K&H^m,b=(l=F&V)^F&G^y,E=X&Q^~X&te,k=Z&ee^~Z&re,v=W[e],x=W[e+1],v=(c=((_=p[e])>>>16)+(v>>>16)+(E>>>16)+(s>>>16)+(se>>>16)+((a=(65535&_)+(65535&v)+(65535&E)+(65535&s)+(65535&se)+((o=((A=p[e+1])>>>16)+(x>>>16)+(k>>>16)+(n>>>16)+(ne>>>16)+((i=(65535&A)+(65535&x)+(65535&k)+(65535&n)+(65535&ne))>>>16))>>>16))>>>16))<<16|65535&a,x=o<<16|65535&i,_=(c=(w>>>16)+(t>>>16)+((a=(65535&w)+(65535&t)+((o=(b>>>16)+(r>>>16)+((i=(65535&b)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&a,A=o<<16|65535&i,se=(c=(Y>>>16)+(v>>>16)+((a=(65535&Y)+(65535&v)+((o=(J>>>16)+(x>>>16)+((i=(65535&J)+(65535&x))>>>16))>>>16))>>>16))<<16|65535&a,ne=o<<16|65535&i,t=((Y=(c=(_>>>16)+(v>>>16)+((a=(65535&_)+(65535&v)+((o=(A>>>16)+(x>>>16)+((i=(65535&A)+(65535&x))>>>16))>>>16))>>>16))<<16|65535&a)>>>28|(J=o<<16|65535&i)<<4)^(J>>>2|Y<<30)^(J>>>7|Y<<25),r=(J>>>28|Y<<4)^(Y>>>2|J<<30)^(Y>>>7|J<<25),s=(se>>>14|ne<<18)^(se>>>18|ne<<14)^(ne>>>9|se<<23),n=(ne>>>14|se<<18)^(ne>>>18|se<<14)^(se>>>9|ne<<23),w=(d=Y&K)^Y&z^u,b=(h=J&F)^J&V^l,E=se&X^~se&Q,k=ne&Z^~ne&ee,v=W[e+2],x=W[e+3],v=(c=((_=p[e+2])>>>16)+(v>>>16)+(E>>>16)+(s>>>16)+(te>>>16)+((a=(65535&_)+(65535&v)+(65535&E)+(65535&s)+(65535&te)+((o=((A=p[e+3])>>>16)+(x>>>16)+(k>>>16)+(n>>>16)+(re>>>16)+((i=(65535&A)+(65535&x)+(65535&k)+(65535&n)+(65535&re))>>>16))>>>16))>>>16))<<16|65535&a,x=o<<16|65535&i,_=(c=(w>>>16)+(t>>>16)+((a=(65535&w)+(65535&t)+((o=(b>>>16)+(r>>>16)+((i=(65535&b)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&a,A=o<<16|65535&i,te=(c=(H>>>16)+(v>>>16)+((a=(65535&H)+(65535&v)+((o=(G>>>16)+(x>>>16)+((i=(65535&G)+(65535&x))>>>16))>>>16))>>>16))<<16|65535&a,re=o<<16|65535&i,t=((H=(c=(_>>>16)+(v>>>16)+((a=(65535&_)+(65535&v)+((o=(A>>>16)+(x>>>16)+((i=(65535&A)+(65535&x))>>>16))>>>16))>>>16))<<16|65535&a)>>>28|(G=o<<16|65535&i)<<4)^(G>>>2|H<<30)^(G>>>7|H<<25),r=(G>>>28|H<<4)^(H>>>2|G<<30)^(H>>>7|G<<25),s=(te>>>14|re<<18)^(te>>>18|re<<14)^(re>>>9|te<<23),n=(re>>>14|te<<18)^(re>>>18|te<<14)^(te>>>9|re<<23),w=(f=H&Y)^H&K^d,b=(g=G&J)^G&F^h,E=te&se^~te&X,k=re&ne^~re&Z,v=W[e+4],x=W[e+5],v=(c=((_=p[e+4])>>>16)+(v>>>16)+(E>>>16)+(s>>>16)+(Q>>>16)+((a=(65535&_)+(65535&v)+(65535&E)+(65535&s)+(65535&Q)+((o=((A=p[e+5])>>>16)+(x>>>16)+(k>>>16)+(n>>>16)+(ee>>>16)+((i=(65535&A)+(65535&x)+(65535&k)+(65535&n)+(65535&ee))>>>16))>>>16))>>>16))<<16|65535&a,x=o<<16|65535&i,_=(c=(w>>>16)+(t>>>16)+((a=(65535&w)+(65535&t)+((o=(b>>>16)+(r>>>16)+((i=(65535&b)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&a,A=o<<16|65535&i,Q=(c=(z>>>16)+(v>>>16)+((a=(65535&z)+(65535&v)+((o=(V>>>16)+(x>>>16)+((i=(65535&V)+(65535&x))>>>16))>>>16))>>>16))<<16|65535&a,ee=o<<16|65535&i,t=((z=(c=(_>>>16)+(v>>>16)+((a=(65535&_)+(65535&v)+((o=(A>>>16)+(x>>>16)+((i=(65535&A)+(65535&x))>>>16))>>>16))>>>16))<<16|65535&a)>>>28|(V=o<<16|65535&i)<<4)^(V>>>2|z<<30)^(V>>>7|z<<25),r=(V>>>28|z<<4)^(z>>>2|V<<30)^(z>>>7|V<<25),s=(Q>>>14|ee<<18)^(Q>>>18|ee<<14)^(ee>>>9|Q<<23),n=(ee>>>14|Q<<18)^(ee>>>18|Q<<14)^(Q>>>9|ee<<23),w=(m=z&H)^z&Y^f,b=(y=V&G)^V&J^g,E=Q&te^~Q&se,k=ee&re^~ee&ne,v=W[e+6],x=W[e+7],v=(c=((_=p[e+6])>>>16)+(v>>>16)+(E>>>16)+(s>>>16)+(X>>>16)+((a=(65535&_)+(65535&v)+(65535&E)+(65535&s)+(65535&X)+((o=((A=p[e+7])>>>16)+(x>>>16)+(k>>>16)+(n>>>16)+(Z>>>16)+((i=(65535&A)+(65535&x)+(65535&k)+(65535&n)+(65535&Z))>>>16))>>>16))>>>16))<<16|65535&a,x=o<<16|65535&i,_=(c=(w>>>16)+(t>>>16)+((a=(65535&w)+(65535&t)+((o=(b>>>16)+(r>>>16)+((i=(65535&b)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&a,A=o<<16|65535&i,X=(c=(K>>>16)+(v>>>16)+((a=(65535&K)+(65535&v)+((o=(F>>>16)+(x>>>16)+((i=(65535&F)+(65535&x))>>>16))>>>16))>>>16))<<16|65535&a,Z=o<<16|65535&i,K=(c=(_>>>16)+(v>>>16)+((a=(65535&_)+(65535&v)+((o=(A>>>16)+(x>>>16)+((i=(65535&A)+(65535&x))>>>16))>>>16))>>>16))<<16|65535&a,F=o<<16|65535&i;c=(S>>>16)+(K>>>16)+((a=(65535&S)+(65535&K)+((o=(R>>>16)+(F>>>16)+((i=(65535&R)+(65535&F))>>>16))>>>16))>>>16),this.h0h=c<<16|65535&a,this.h0l=o<<16|65535&i,c=(T>>>16)+(z>>>16)+((a=(65535&T)+(65535&z)+((o=(I>>>16)+(V>>>16)+((i=(65535&I)+(65535&V))>>>16))>>>16))>>>16),this.h1h=c<<16|65535&a,this.h1l=o<<16|65535&i,c=(B>>>16)+(H>>>16)+((a=(65535&B)+(65535&H)+((o=(U>>>16)+(G>>>16)+((i=(65535&U)+(65535&G))>>>16))>>>16))>>>16),this.h2h=c<<16|65535&a,this.h2l=o<<16|65535&i,c=(P>>>16)+(Y>>>16)+((a=(65535&P)+(65535&Y)+((o=(j>>>16)+(J>>>16)+((i=(65535&j)+(65535&J))>>>16))>>>16))>>>16),this.h3h=c<<16|65535&a,this.h3l=o<<16|65535&i,c=(q>>>16)+(X>>>16)+((a=(65535&q)+(65535&X)+((o=($>>>16)+(Z>>>16)+((i=(65535&$)+(65535&Z))>>>16))>>>16))>>>16),this.h4h=c<<16|65535&a,this.h4l=o<<16|65535&i,c=(C>>>16)+(Q>>>16)+((a=(65535&C)+(65535&Q)+((o=(D>>>16)+(ee>>>16)+((i=(65535&D)+(65535&ee))>>>16))>>>16))>>>16),this.h5h=c<<16|65535&a,this.h5l=o<<16|65535&i,c=(O>>>16)+(te>>>16)+((a=(65535&O)+(65535&te)+((o=(L>>>16)+(re>>>16)+((i=(65535&L)+(65535&re))>>>16))>>>16))>>>16),this.h6h=c<<16|65535&a,this.h6l=o<<16|65535&i,c=(M>>>16)+(se>>>16)+((a=(65535&M)+(65535&se)+((o=(N>>>16)+(ne>>>16)+((i=(65535&N)+(65535&ne))>>>16))>>>16))>>>16),this.h7h=c<<16|65535&a,this.h7l=o<<16|65535&i},v.prototype.hex=function(){this.finalize();var e=this.h0h,t=this.h0l,r=this.h1h,s=this.h1l,n=this.h2h,i=this.h2l,o=this.h3h,a=this.h3l,c=this.h4h,u=this.h4l,d=this.h5h,h=this.h5l,p=this.h6h,f=this.h6l,g=this.h7h,m=this.h7l,y=this.bits,w=l[e>>28&15]+l[e>>24&15]+l[e>>20&15]+l[e>>16&15]+l[e>>12&15]+l[e>>8&15]+l[e>>4&15]+l[15&e]+l[t>>28&15]+l[t>>24&15]+l[t>>20&15]+l[t>>16&15]+l[t>>12&15]+l[t>>8&15]+l[t>>4&15]+l[15&t]+l[r>>28&15]+l[r>>24&15]+l[r>>20&15]+l[r>>16&15]+l[r>>12&15]+l[r>>8&15]+l[r>>4&15]+l[15&r]+l[s>>28&15]+l[s>>24&15]+l[s>>20&15]+l[s>>16&15]+l[s>>12&15]+l[s>>8&15]+l[s>>4&15]+l[15&s]+l[n>>28&15]+l[n>>24&15]+l[n>>20&15]+l[n>>16&15]+l[n>>12&15]+l[n>>8&15]+l[n>>4&15]+l[15&n]+l[i>>28&15]+l[i>>24&15]+l[i>>20&15]+l[i>>16&15]+l[i>>12&15]+l[i>>8&15]+l[i>>4&15]+l[15&i]+l[o>>28&15]+l[o>>24&15]+l[o>>20&15]+l[o>>16&15]+l[o>>12&15]+l[o>>8&15]+l[o>>4&15]+l[15&o];return y>=256&&(w+=l[a>>28&15]+l[a>>24&15]+l[a>>20&15]+l[a>>16&15]+l[a>>12&15]+l[a>>8&15]+l[a>>4&15]+l[15&a]),y>=384&&(w+=l[c>>28&15]+l[c>>24&15]+l[c>>20&15]+l[c>>16&15]+l[c>>12&15]+l[c>>8&15]+l[c>>4&15]+l[15&c]+l[u>>28&15]+l[u>>24&15]+l[u>>20&15]+l[u>>16&15]+l[u>>12&15]+l[u>>8&15]+l[u>>4&15]+l[15&u]+l[d>>28&15]+l[d>>24&15]+l[d>>20&15]+l[d>>16&15]+l[d>>12&15]+l[d>>8&15]+l[d>>4&15]+l[15&d]+l[h>>28&15]+l[h>>24&15]+l[h>>20&15]+l[h>>16&15]+l[h>>12&15]+l[h>>8&15]+l[h>>4&15]+l[15&h]),512==y&&(w+=l[p>>28&15]+l[p>>24&15]+l[p>>20&15]+l[p>>16&15]+l[p>>12&15]+l[p>>8&15]+l[p>>4&15]+l[15&p]+l[f>>28&15]+l[f>>24&15]+l[f>>20&15]+l[f>>16&15]+l[f>>12&15]+l[f>>8&15]+l[f>>4&15]+l[15&f]+l[g>>28&15]+l[g>>24&15]+l[g>>20&15]+l[g>>16&15]+l[g>>12&15]+l[g>>8&15]+l[g>>4&15]+l[15&g]+l[m>>28&15]+l[m>>24&15]+l[m>>20&15]+l[m>>16&15]+l[m>>12&15]+l[m>>8&15]+l[m>>4&15]+l[15&m]),w},v.prototype.toString=v.prototype.hex,v.prototype.digest=function(){this.finalize();var e=this.h0h,t=this.h0l,r=this.h1h,s=this.h1l,n=this.h2h,i=this.h2l,o=this.h3h,a=this.h3l,c=this.h4h,u=this.h4l,l=this.h5h,d=this.h5l,h=this.h6h,p=this.h6l,f=this.h7h,g=this.h7l,m=this.bits,y=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,s>>24&255,s>>16&255,s>>8&255,255&s,n>>24&255,n>>16&255,n>>8&255,255&n,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o];return m>=256&&y.push(a>>24&255,a>>16&255,a>>8&255,255&a),m>=384&&y.push(c>>24&255,c>>16&255,c>>8&255,255&c,u>>24&255,u>>16&255,u>>8&255,255&u,l>>24&255,l>>16&255,l>>8&255,255&l,d>>24&255,d>>16&255,d>>8&255,255&d),512==m&&y.push(h>>24&255,h>>16&255,h>>8&255,255&h,p>>24&255,p>>16&255,p>>8&255,255&p,f>>24&255,f>>16&255,f>>8&255,255&f,g>>24&255,g>>16&255,g>>8&255,255&g),y},v.prototype.array=v.prototype.digest,v.prototype.arrayBuffer=function(){this.finalize();var e=this.bits,t=new ArrayBuffer(e/8),r=new DataView(t);return r.setUint32(0,this.h0h),r.setUint32(4,this.h0l),r.setUint32(8,this.h1h),r.setUint32(12,this.h1l),r.setUint32(16,this.h2h),r.setUint32(20,this.h2l),r.setUint32(24,this.h3h),e>=256&&r.setUint32(28,this.h3l),e>=384&&(r.setUint32(32,this.h4h),r.setUint32(36,this.h4l),r.setUint32(40,this.h5h),r.setUint32(44,this.h5l)),512==e&&(r.setUint32(48,this.h6h),r.setUint32(52,this.h6l),r.setUint32(56,this.h7h),r.setUint32(60,this.h7l)),t},v.prototype.clone=function(){var e=new v(this.bits,!1);return this.copyTo(e),e},v.prototype.copyTo=function(e){var t=0,r=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(t=0;t<r.length;++t)e[r[t]]=this[r[t]];for(t=0;t<this.blocks.length;++t)e.blocks[t]=this.blocks[t]},x.prototype=new v,x.prototype.finalize=function(){if(v.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();v.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(e),v.prototype.finalize.call(this)}},x.prototype.clone=function(){var e=new x([],this.bits,!1);this.copyTo(e),e.inner=this.inner;for(var t=0;t<this.oKeyPad.length;++t)e.oKeyPad[t]=this.oKeyPad[t];return e};var _=y(512);_.sha512=_,_.sha384=y(384),_.sha512_256=y(256),_.sha512_224=y(224),_.sha512.hmac=b(512),_.sha384.hmac=b(384),_.sha512_256.hmac=b(256),_.sha512_224.hmac=b(224),a?e.exports=_:(i.sha512=_.sha512,i.sha384=_.sha384,i.sha512_256=_.sha512_256,i.sha512_224=_.sha512_224,c&&(void 0===(s=function(){return _}.call(_,r,_,e))||(e.exports=s)))}()},360:(e,t,r)=>{var s=r(592).stringify,n=r(385);e.exports=function(e){return{parse:n(e),stringify:s}},e.exports.parse=n(),e.exports.stringify=s},385:(e,t,r)=>{var s=null;const n=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,i=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;e.exports=function(e){"use strict";var t={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(null!=e){if(!0===e.strict&&(t.strict=!0),!0===e.storeAsString&&(t.storeAsString=!0),t.alwaysParseAsBig=!0===e.alwaysParseAsBig&&e.alwaysParseAsBig,t.useNativeBigInt=!0===e.useNativeBigInt&&e.useNativeBigInt,void 0!==e.constructorAction){if("error"!==e.constructorAction&&"ignore"!==e.constructorAction&&"preserve"!==e.constructorAction)throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${e.constructorAction}`);t.constructorAction=e.constructorAction}if(void 0!==e.protoAction){if("error"!==e.protoAction&&"ignore"!==e.protoAction&&"preserve"!==e.protoAction)throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${e.protoAction}`);t.protoAction=e.protoAction}}var o,a,c,u,l={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},d=function(e){throw{name:"SyntaxError",message:e,at:o,text:c}},h=function(e){return e&&e!==a&&d("Expected '"+e+"' instead of '"+a+"'"),a=c.charAt(o),o+=1,a},p=function(){var e,n="";for("-"===a&&(n="-",h("-"));a>="0"&&a<="9";)n+=a,h();if("."===a)for(n+=".";h()&&a>="0"&&a<="9";)n+=a;if("e"===a||"E"===a)for(n+=a,h(),"-"!==a&&"+"!==a||(n+=a,h());a>="0"&&a<="9";)n+=a,h();if(e=+n,isFinite(e))return null==s&&(s=r(117)),n.length>15?t.storeAsString?n:t.useNativeBigInt?BigInt(n):new s(n):t.alwaysParseAsBig?t.useNativeBigInt?BigInt(e):new s(e):e;d("Bad number")},f=function(){var e,t,r,s="";if('"'===a)for(var n=o;h();){if('"'===a)return o-1>n&&(s+=c.substring(n,o-1)),h(),s;if("\\"===a){if(o-1>n&&(s+=c.substring(n,o-1)),h(),"u"===a){for(r=0,t=0;t<4&&(e=parseInt(h(),16),isFinite(e));t+=1)r=16*r+e;s+=String.fromCharCode(r)}else{if("string"!=typeof l[a])break;s+=l[a]}n=o}}d("Bad string")},g=function(){for(;a&&a<=" ";)h()};return u=function(){switch(g(),a){case"{":return function(){var e,r=Object.create(null);if("{"===a){if(h("{"),g(),"}"===a)return h("}"),r;for(;a;){if(e=f(),g(),h(":"),!0===t.strict&&Object.hasOwnProperty.call(r,e)&&d('Duplicate key "'+e+'"'),!0===n.test(e)?"error"===t.protoAction?d("Object contains forbidden prototype property"):"ignore"===t.protoAction?u():r[e]=u():!0===i.test(e)?"error"===t.constructorAction?d("Object contains forbidden constructor property"):"ignore"===t.constructorAction?u():r[e]=u():r[e]=u(),g(),"}"===a)return h("}"),r;h(","),g()}}d("Bad object")}();case"[":return function(){var e=[];if("["===a){if(h("["),g(),"]"===a)return h("]"),e;for(;a;){if(e.push(u()),g(),"]"===a)return h("]"),e;h(","),g()}}d("Bad array")}();case'"':return f();case"-":return p();default:return a>="0"&&a<="9"?p():function(){switch(a){case"t":return h("t"),h("r"),h("u"),h("e"),!0;case"f":return h("f"),h("a"),h("l"),h("s"),h("e"),!1;case"n":return h("n"),h("u"),h("l"),h("l"),null}d("Unexpected '"+a+"'")}()}},function(e,t){var r;return c=e+"",o=0,a=" ",r=u(),g(),a&&d("Syntax error"),"function"==typeof t?function e(r,s){var n,i=r[s];return i&&"object"==typeof i&&Object.keys(i).forEach((function(t){void 0!==(n=e(i,t))?i[t]=n:delete i[t]})),t.call(r,s,i)}({"":r},""):r}}},592:(e,t,r)=>{var s=r(117),n=e.exports;!function(){"use strict";var e,t,r,i=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function a(e){return i.lastIndex=0,i.test(e)?'"'+e.replace(i,(function(e){var t=o[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function c(n,i){var o,u,l,d,h,p=e,f=i[n],g=null!=f&&(f instanceof s||s.isBigNumber(f));switch(f&&"object"==typeof f&&"function"==typeof f.toJSON&&(f=f.toJSON(n)),"function"==typeof r&&(f=r.call(i,n,f)),typeof f){case"string":return g?f:a(f);case"number":return isFinite(f)?String(f):"null";case"boolean":case"null":case"bigint":return String(f);case"object":if(!f)return"null";if(e+=t,h=[],"[object Array]"===Object.prototype.toString.apply(f)){for(d=f.length,o=0;o<d;o+=1)h[o]=c(o,f)||"null";return l=0===h.length?"[]":e?"[\n"+e+h.join(",\n"+e)+"\n"+p+"]":"["+h.join(",")+"]",e=p,l}if(r&&"object"==typeof r)for(d=r.length,o=0;o<d;o+=1)"string"==typeof r[o]&&(l=c(u=r[o],f))&&h.push(a(u)+(e?": ":":")+l);else Object.keys(f).forEach((function(t){var r=c(t,f);r&&h.push(a(t)+(e?": ":":")+r)}));return l=0===h.length?"{}":e?"{\n"+e+h.join(",\n"+e)+"\n"+p+"}":"{"+h.join(",")+"}",e=p,l}}"function"!=typeof n.stringify&&(n.stringify=function(s,n,i){var o;if(e="",t="","number"==typeof i)for(o=0;o<i;o+=1)t+=" ";else"string"==typeof i&&(t=i);if(r=n,n&&"function"!=typeof n&&("object"!=typeof n||"number"!=typeof n.length))throw new Error("JSON.stringify");return c("",{"":s})})}()},765:function(e,t){!function(e){"use strict";var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;t++)r[t]=e[t];return r},r=function(){throw new Error("no PRNG")},s=new Uint8Array(16),n=new Uint8Array(32);n[0]=9;var i=t(),o=t([1]),a=t([56129,1]),c=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),l=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),d=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),h=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t,r,s){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=s>>24&255,e[t+5]=s>>16&255,e[t+6]=s>>8&255,e[t+7]=255&s}function f(e,t,r,s,n){var i,o=0;for(i=0;i<n;i++)o|=e[t+i]^r[s+i];return(1&o-1>>>8)-1}function g(e,t,r,s){return f(e,t,r,s,16)}function m(e,t,r,s){return f(e,t,r,s,32)}function y(e,t,r,s){!function(e,t,r,s){for(var n,i=255&s[0]|(255&s[1])<<8|(255&s[2])<<16|(255&s[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,l=255&s[4]|(255&s[5])<<8|(255&s[6])<<16|(255&s[7])<<24,d=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,f=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&s[8]|(255&s[9])<<8|(255&s[10])<<16|(255&s[11])<<24,m=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,y=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,w=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,b=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,v=255&s[12]|(255&s[13])<<8|(255&s[14])<<16|(255&s[15])<<24,x=i,_=o,A=a,E=c,k=u,S=l,R=d,T=h,I=p,B=f,U=g,P=m,j=y,q=w,$=b,C=v,D=0;D<20;D+=2)x^=(n=(j^=(n=(I^=(n=(k^=(n=x+j|0)<<7|n>>>25)+x|0)<<9|n>>>23)+k|0)<<13|n>>>19)+I|0)<<18|n>>>14,S^=(n=(_^=(n=(q^=(n=(B^=(n=S+_|0)<<7|n>>>25)+S|0)<<9|n>>>23)+B|0)<<13|n>>>19)+q|0)<<18|n>>>14,U^=(n=(R^=(n=(A^=(n=($^=(n=U+R|0)<<7|n>>>25)+U|0)<<9|n>>>23)+$|0)<<13|n>>>19)+A|0)<<18|n>>>14,C^=(n=(P^=(n=(T^=(n=(E^=(n=C+P|0)<<7|n>>>25)+C|0)<<9|n>>>23)+E|0)<<13|n>>>19)+T|0)<<18|n>>>14,x^=(n=(E^=(n=(A^=(n=(_^=(n=x+E|0)<<7|n>>>25)+x|0)<<9|n>>>23)+_|0)<<13|n>>>19)+A|0)<<18|n>>>14,S^=(n=(k^=(n=(T^=(n=(R^=(n=S+k|0)<<7|n>>>25)+S|0)<<9|n>>>23)+R|0)<<13|n>>>19)+T|0)<<18|n>>>14,U^=(n=(B^=(n=(I^=(n=(P^=(n=U+B|0)<<7|n>>>25)+U|0)<<9|n>>>23)+P|0)<<13|n>>>19)+I|0)<<18|n>>>14,C^=(n=($^=(n=(q^=(n=(j^=(n=C+$|0)<<7|n>>>25)+C|0)<<9|n>>>23)+j|0)<<13|n>>>19)+q|0)<<18|n>>>14;x=x+i|0,_=_+o|0,A=A+a|0,E=E+c|0,k=k+u|0,S=S+l|0,R=R+d|0,T=T+h|0,I=I+p|0,B=B+f|0,U=U+g|0,P=P+m|0,j=j+y|0,q=q+w|0,$=$+b|0,C=C+v|0,e[0]=x>>>0&255,e[1]=x>>>8&255,e[2]=x>>>16&255,e[3]=x>>>24&255,e[4]=_>>>0&255,e[5]=_>>>8&255,e[6]=_>>>16&255,e[7]=_>>>24&255,e[8]=A>>>0&255,e[9]=A>>>8&255,e[10]=A>>>16&255,e[11]=A>>>24&255,e[12]=E>>>0&255,e[13]=E>>>8&255,e[14]=E>>>16&255,e[15]=E>>>24&255,e[16]=k>>>0&255,e[17]=k>>>8&255,e[18]=k>>>16&255,e[19]=k>>>24&255,e[20]=S>>>0&255,e[21]=S>>>8&255,e[22]=S>>>16&255,e[23]=S>>>24&255,e[24]=R>>>0&255,e[25]=R>>>8&255,e[26]=R>>>16&255,e[27]=R>>>24&255,e[28]=T>>>0&255,e[29]=T>>>8&255,e[30]=T>>>16&255,e[31]=T>>>24&255,e[32]=I>>>0&255,e[33]=I>>>8&255,e[34]=I>>>16&255,e[35]=I>>>24&255,e[36]=B>>>0&255,e[37]=B>>>8&255,e[38]=B>>>16&255,e[39]=B>>>24&255,e[40]=U>>>0&255,e[41]=U>>>8&255,e[42]=U>>>16&255,e[43]=U>>>24&255,e[44]=P>>>0&255,e[45]=P>>>8&255,e[46]=P>>>16&255,e[47]=P>>>24&255,e[48]=j>>>0&255,e[49]=j>>>8&255,e[50]=j>>>16&255,e[51]=j>>>24&255,e[52]=q>>>0&255,e[53]=q>>>8&255,e[54]=q>>>16&255,e[55]=q>>>24&255,e[56]=$>>>0&255,e[57]=$>>>8&255,e[58]=$>>>16&255,e[59]=$>>>24&255,e[60]=C>>>0&255,e[61]=C>>>8&255,e[62]=C>>>16&255,e[63]=C>>>24&255}(e,t,r,s)}function w(e,t,r,s){!function(e,t,r,s){for(var n,i=255&s[0]|(255&s[1])<<8|(255&s[2])<<16|(255&s[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,l=255&s[4]|(255&s[5])<<8|(255&s[6])<<16|(255&s[7])<<24,d=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,h=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,f=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&s[8]|(255&s[9])<<8|(255&s[10])<<16|(255&s[11])<<24,m=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,y=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,w=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,b=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,v=255&s[12]|(255&s[13])<<8|(255&s[14])<<16|(255&s[15])<<24,x=0;x<20;x+=2)i^=(n=(y^=(n=(p^=(n=(u^=(n=i+y|0)<<7|n>>>25)+i|0)<<9|n>>>23)+u|0)<<13|n>>>19)+p|0)<<18|n>>>14,l^=(n=(o^=(n=(w^=(n=(f^=(n=l+o|0)<<7|n>>>25)+l|0)<<9|n>>>23)+f|0)<<13|n>>>19)+w|0)<<18|n>>>14,g^=(n=(d^=(n=(a^=(n=(b^=(n=g+d|0)<<7|n>>>25)+g|0)<<9|n>>>23)+b|0)<<13|n>>>19)+a|0)<<18|n>>>14,v^=(n=(m^=(n=(h^=(n=(c^=(n=v+m|0)<<7|n>>>25)+v|0)<<9|n>>>23)+c|0)<<13|n>>>19)+h|0)<<18|n>>>14,i^=(n=(c^=(n=(a^=(n=(o^=(n=i+c|0)<<7|n>>>25)+i|0)<<9|n>>>23)+o|0)<<13|n>>>19)+a|0)<<18|n>>>14,l^=(n=(u^=(n=(h^=(n=(d^=(n=l+u|0)<<7|n>>>25)+l|0)<<9|n>>>23)+d|0)<<13|n>>>19)+h|0)<<18|n>>>14,g^=(n=(f^=(n=(p^=(n=(m^=(n=g+f|0)<<7|n>>>25)+g|0)<<9|n>>>23)+m|0)<<13|n>>>19)+p|0)<<18|n>>>14,v^=(n=(b^=(n=(w^=(n=(y^=(n=v+b|0)<<7|n>>>25)+v|0)<<9|n>>>23)+y|0)<<13|n>>>19)+w|0)<<18|n>>>14;e[0]=i>>>0&255,e[1]=i>>>8&255,e[2]=i>>>16&255,e[3]=i>>>24&255,e[4]=l>>>0&255,e[5]=l>>>8&255,e[6]=l>>>16&255,e[7]=l>>>24&255,e[8]=g>>>0&255,e[9]=g>>>8&255,e[10]=g>>>16&255,e[11]=g>>>24&255,e[12]=v>>>0&255,e[13]=v>>>8&255,e[14]=v>>>16&255,e[15]=v>>>24&255,e[16]=d>>>0&255,e[17]=d>>>8&255,e[18]=d>>>16&255,e[19]=d>>>24&255,e[20]=h>>>0&255,e[21]=h>>>8&255,e[22]=h>>>16&255,e[23]=h>>>24&255,e[24]=p>>>0&255,e[25]=p>>>8&255,e[26]=p>>>16&255,e[27]=p>>>24&255,e[28]=f>>>0&255,e[29]=f>>>8&255,e[30]=f>>>16&255,e[31]=f>>>24&255}(e,t,r,s)}var b=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function v(e,t,r,s,n,i,o){var a,c,u=new Uint8Array(16),l=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=i[c];for(;n>=64;){for(y(l,u,o,b),c=0;c<64;c++)e[t+c]=r[s+c]^l[c];for(a=1,c=8;c<16;c++)a=a+(255&u[c])|0,u[c]=255&a,a>>>=8;n-=64,t+=64,s+=64}if(n>0)for(y(l,u,o,b),c=0;c<n;c++)e[t+c]=r[s+c]^l[c];return 0}function x(e,t,r,s,n){var i,o,a=new Uint8Array(16),c=new Uint8Array(64);for(o=0;o<16;o++)a[o]=0;for(o=0;o<8;o++)a[o]=s[o];for(;r>=64;){for(y(c,a,n,b),o=0;o<64;o++)e[t+o]=c[o];for(i=1,o=8;o<16;o++)i=i+(255&a[o])|0,a[o]=255&i,i>>>=8;r-=64,t+=64}if(r>0)for(y(c,a,n,b),o=0;o<r;o++)e[t+o]=c[o];return 0}function _(e,t,r,s,n){var i=new Uint8Array(32);w(i,s,n,b);for(var o=new Uint8Array(8),a=0;a<8;a++)o[a]=s[a+16];return x(e,t,r,o,i)}function A(e,t,r,s,n,i,o){var a=new Uint8Array(32);w(a,i,o,b);for(var c=new Uint8Array(8),u=0;u<8;u++)c[u]=i[u+16];return v(e,t,r,s,n,c,a)}var E=function(e){var t,r,s,n,i,o,a,c;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,r=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|r<<3),s=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|s<<6),n=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(s>>>7|n<<9),i=255&e[8]|(255&e[9])<<8,this.r[4]=255&(n>>>4|i<<12),this.r[5]=i>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(i>>>14|o<<2),a=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|a<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(a>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function k(e,t,r,s,n,i){var o=new E(i);return o.update(r,s,n),o.finish(e,t),0}function S(e,t,r,s,n,i){var o=new Uint8Array(16);return k(o,0,r,s,n,i),g(e,t,o,0)}function R(e,t,r,s,n){var i;if(r<32)return-1;for(A(e,0,t,0,r,s,n),k(e,16,e,32,r-32,e),i=0;i<16;i++)e[i]=0;return 0}function T(e,t,r,s,n){var i,o=new Uint8Array(32);if(r<32)return-1;if(_(o,0,32,s,n),0!==S(t,16,t,32,r-32,o))return-1;for(A(e,0,t,0,r,s,n),i=0;i<32;i++)e[i]=0;return 0}function I(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function B(e){var t,r,s=1;for(t=0;t<16;t++)r=e[t]+s+65535,s=Math.floor(r/65536),e[t]=r-65536*s;e[0]+=s-1+37*(s-1)}function U(e,t,r){for(var s,n=~(r-1),i=0;i<16;i++)s=n&(e[i]^t[i]),e[i]^=s,t[i]^=s}function P(e,r){var s,n,i,o=t(),a=t();for(s=0;s<16;s++)a[s]=r[s];for(B(a),B(a),B(a),n=0;n<2;n++){for(o[0]=a[0]-65517,s=1;s<15;s++)o[s]=a[s]-65535-(o[s-1]>>16&1),o[s-1]&=65535;o[15]=a[15]-32767-(o[14]>>16&1),i=o[15]>>16&1,o[14]&=65535,U(a,o,1-i)}for(s=0;s<16;s++)e[2*s]=255&a[s],e[2*s+1]=a[s]>>8}function j(e,t){var r=new Uint8Array(32),s=new Uint8Array(32);return P(r,e),P(s,t),m(r,0,s,0)}function q(e){var t=new Uint8Array(32);return P(t,e),1&t[0]}function $(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function C(e,t,r){for(var s=0;s<16;s++)e[s]=t[s]+r[s]}function D(e,t,r){for(var s=0;s<16;s++)e[s]=t[s]-r[s]}function O(e,t,r){var s,n,i=0,o=0,a=0,c=0,u=0,l=0,d=0,h=0,p=0,f=0,g=0,m=0,y=0,w=0,b=0,v=0,x=0,_=0,A=0,E=0,k=0,S=0,R=0,T=0,I=0,B=0,U=0,P=0,j=0,q=0,$=0,C=r[0],D=r[1],O=r[2],L=r[3],M=r[4],N=r[5],W=r[6],K=r[7],F=r[8],z=r[9],V=r[10],H=r[11],G=r[12],Y=r[13],J=r[14],X=r[15];i+=(s=t[0])*C,o+=s*D,a+=s*O,c+=s*L,u+=s*M,l+=s*N,d+=s*W,h+=s*K,p+=s*F,f+=s*z,g+=s*V,m+=s*H,y+=s*G,w+=s*Y,b+=s*J,v+=s*X,o+=(s=t[1])*C,a+=s*D,c+=s*O,u+=s*L,l+=s*M,d+=s*N,h+=s*W,p+=s*K,f+=s*F,g+=s*z,m+=s*V,y+=s*H,w+=s*G,b+=s*Y,v+=s*J,x+=s*X,a+=(s=t[2])*C,c+=s*D,u+=s*O,l+=s*L,d+=s*M,h+=s*N,p+=s*W,f+=s*K,g+=s*F,m+=s*z,y+=s*V,w+=s*H,b+=s*G,v+=s*Y,x+=s*J,_+=s*X,c+=(s=t[3])*C,u+=s*D,l+=s*O,d+=s*L,h+=s*M,p+=s*N,f+=s*W,g+=s*K,m+=s*F,y+=s*z,w+=s*V,b+=s*H,v+=s*G,x+=s*Y,_+=s*J,A+=s*X,u+=(s=t[4])*C,l+=s*D,d+=s*O,h+=s*L,p+=s*M,f+=s*N,g+=s*W,m+=s*K,y+=s*F,w+=s*z,b+=s*V,v+=s*H,x+=s*G,_+=s*Y,A+=s*J,E+=s*X,l+=(s=t[5])*C,d+=s*D,h+=s*O,p+=s*L,f+=s*M,g+=s*N,m+=s*W,y+=s*K,w+=s*F,b+=s*z,v+=s*V,x+=s*H,_+=s*G,A+=s*Y,E+=s*J,k+=s*X,d+=(s=t[6])*C,h+=s*D,p+=s*O,f+=s*L,g+=s*M,m+=s*N,y+=s*W,w+=s*K,b+=s*F,v+=s*z,x+=s*V,_+=s*H,A+=s*G,E+=s*Y,k+=s*J,S+=s*X,h+=(s=t[7])*C,p+=s*D,f+=s*O,g+=s*L,m+=s*M,y+=s*N,w+=s*W,b+=s*K,v+=s*F,x+=s*z,_+=s*V,A+=s*H,E+=s*G,k+=s*Y,S+=s*J,R+=s*X,p+=(s=t[8])*C,f+=s*D,g+=s*O,m+=s*L,y+=s*M,w+=s*N,b+=s*W,v+=s*K,x+=s*F,_+=s*z,A+=s*V,E+=s*H,k+=s*G,S+=s*Y,R+=s*J,T+=s*X,f+=(s=t[9])*C,g+=s*D,m+=s*O,y+=s*L,w+=s*M,b+=s*N,v+=s*W,x+=s*K,_+=s*F,A+=s*z,E+=s*V,k+=s*H,S+=s*G,R+=s*Y,T+=s*J,I+=s*X,g+=(s=t[10])*C,m+=s*D,y+=s*O,w+=s*L,b+=s*M,v+=s*N,x+=s*W,_+=s*K,A+=s*F,E+=s*z,k+=s*V,S+=s*H,R+=s*G,T+=s*Y,I+=s*J,B+=s*X,m+=(s=t[11])*C,y+=s*D,w+=s*O,b+=s*L,v+=s*M,x+=s*N,_+=s*W,A+=s*K,E+=s*F,k+=s*z,S+=s*V,R+=s*H,T+=s*G,I+=s*Y,B+=s*J,U+=s*X,y+=(s=t[12])*C,w+=s*D,b+=s*O,v+=s*L,x+=s*M,_+=s*N,A+=s*W,E+=s*K,k+=s*F,S+=s*z,R+=s*V,T+=s*H,I+=s*G,B+=s*Y,U+=s*J,P+=s*X,w+=(s=t[13])*C,b+=s*D,v+=s*O,x+=s*L,_+=s*M,A+=s*N,E+=s*W,k+=s*K,S+=s*F,R+=s*z,T+=s*V,I+=s*H,B+=s*G,U+=s*Y,P+=s*J,j+=s*X,b+=(s=t[14])*C,v+=s*D,x+=s*O,_+=s*L,A+=s*M,E+=s*N,k+=s*W,S+=s*K,R+=s*F,T+=s*z,I+=s*V,B+=s*H,U+=s*G,P+=s*Y,j+=s*J,q+=s*X,v+=(s=t[15])*C,o+=38*(_+=s*O),a+=38*(A+=s*L),c+=38*(E+=s*M),u+=38*(k+=s*N),l+=38*(S+=s*W),d+=38*(R+=s*K),h+=38*(T+=s*F),p+=38*(I+=s*z),f+=38*(B+=s*V),g+=38*(U+=s*H),m+=38*(P+=s*G),y+=38*(j+=s*Y),w+=38*(q+=s*J),b+=38*($+=s*X),i=(s=(i+=38*(x+=s*D))+(n=1)+65535)-65536*(n=Math.floor(s/65536)),o=(s=o+n+65535)-65536*(n=Math.floor(s/65536)),a=(s=a+n+65535)-65536*(n=Math.floor(s/65536)),c=(s=c+n+65535)-65536*(n=Math.floor(s/65536)),u=(s=u+n+65535)-65536*(n=Math.floor(s/65536)),l=(s=l+n+65535)-65536*(n=Math.floor(s/65536)),d=(s=d+n+65535)-65536*(n=Math.floor(s/65536)),h=(s=h+n+65535)-65536*(n=Math.floor(s/65536)),p=(s=p+n+65535)-65536*(n=Math.floor(s/65536)),f=(s=f+n+65535)-65536*(n=Math.floor(s/65536)),g=(s=g+n+65535)-65536*(n=Math.floor(s/65536)),m=(s=m+n+65535)-65536*(n=Math.floor(s/65536)),y=(s=y+n+65535)-65536*(n=Math.floor(s/65536)),w=(s=w+n+65535)-65536*(n=Math.floor(s/65536)),b=(s=b+n+65535)-65536*(n=Math.floor(s/65536)),v=(s=v+n+65535)-65536*(n=Math.floor(s/65536)),i=(s=(i+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(s/65536)),o=(s=o+n+65535)-65536*(n=Math.floor(s/65536)),a=(s=a+n+65535)-65536*(n=Math.floor(s/65536)),c=(s=c+n+65535)-65536*(n=Math.floor(s/65536)),u=(s=u+n+65535)-65536*(n=Math.floor(s/65536)),l=(s=l+n+65535)-65536*(n=Math.floor(s/65536)),d=(s=d+n+65535)-65536*(n=Math.floor(s/65536)),h=(s=h+n+65535)-65536*(n=Math.floor(s/65536)),p=(s=p+n+65535)-65536*(n=Math.floor(s/65536)),f=(s=f+n+65535)-65536*(n=Math.floor(s/65536)),g=(s=g+n+65535)-65536*(n=Math.floor(s/65536)),m=(s=m+n+65535)-65536*(n=Math.floor(s/65536)),y=(s=y+n+65535)-65536*(n=Math.floor(s/65536)),w=(s=w+n+65535)-65536*(n=Math.floor(s/65536)),b=(s=b+n+65535)-65536*(n=Math.floor(s/65536)),v=(s=v+n+65535)-65536*(n=Math.floor(s/65536)),i+=n-1+37*(n-1),e[0]=i,e[1]=o,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=d,e[7]=h,e[8]=p,e[9]=f,e[10]=g,e[11]=m,e[12]=y,e[13]=w,e[14]=b,e[15]=v}function L(e,t){O(e,t,t)}function M(e,r){var s,n=t();for(s=0;s<16;s++)n[s]=r[s];for(s=253;s>=0;s--)L(n,n),2!==s&&4!==s&&O(n,n,r);for(s=0;s<16;s++)e[s]=n[s]}function N(e,r){var s,n=t();for(s=0;s<16;s++)n[s]=r[s];for(s=250;s>=0;s--)L(n,n),1!==s&&O(n,n,r);for(s=0;s<16;s++)e[s]=n[s]}function W(e,r,s){var n,i,o=new Uint8Array(32),c=new Float64Array(80),u=t(),l=t(),d=t(),h=t(),p=t(),f=t();for(i=0;i<31;i++)o[i]=r[i];for(o[31]=127&r[31]|64,o[0]&=248,$(c,s),i=0;i<16;i++)l[i]=c[i],h[i]=u[i]=d[i]=0;for(u[0]=h[0]=1,i=254;i>=0;--i)U(u,l,n=o[i>>>3]>>>(7&i)&1),U(d,h,n),C(p,u,d),D(u,u,d),C(d,l,h),D(l,l,h),L(h,p),L(f,u),O(u,d,u),O(d,l,p),C(p,u,d),D(u,u,d),L(l,u),D(d,h,f),O(u,d,a),C(u,u,h),O(d,d,u),O(u,h,f),O(h,l,c),L(l,p),U(u,l,n),U(d,h,n);for(i=0;i<16;i++)c[i+16]=u[i],c[i+32]=d[i],c[i+48]=l[i],c[i+64]=h[i];var g=c.subarray(32),m=c.subarray(16);return M(g,g),O(m,m,g),P(e,m),0}function K(e,t){return W(e,t,n)}function F(e,t){return r(t,32),K(e,t)}function z(e,t,r){var n=new Uint8Array(32);return W(n,r,t),w(e,s,n,b)}E.prototype.blocks=function(e,t,r){for(var s,n,i,o,a,c,u,l,d,h,p,f,g,m,y,w,b,v,x,_=this.fin?0:2048,A=this.h[0],E=this.h[1],k=this.h[2],S=this.h[3],R=this.h[4],T=this.h[5],I=this.h[6],B=this.h[7],U=this.h[8],P=this.h[9],j=this.r[0],q=this.r[1],$=this.r[2],C=this.r[3],D=this.r[4],O=this.r[5],L=this.r[6],M=this.r[7],N=this.r[8],W=this.r[9];r>=16;)h=d=0,h+=(A+=8191&(s=255&e[t+0]|(255&e[t+1])<<8))*j,h+=(E+=8191&(s>>>13|(n=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*W),h+=(k+=8191&(n>>>10|(i=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*N),h+=(S+=8191&(i>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*M),d=(h+=(R+=8191&(o>>>4|(a=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*L))>>>13,h&=8191,h+=(T+=a>>>1&8191)*(5*O),h+=(I+=8191&(a>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*D),h+=(B+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*C),h+=(U+=8191&(u>>>8|(l=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*$),p=d+=(h+=(P+=l>>>5|_)*(5*q))>>>13,p+=A*q,p+=E*j,p+=k*(5*W),p+=S*(5*N),d=(p+=R*(5*M))>>>13,p&=8191,p+=T*(5*L),p+=I*(5*O),p+=B*(5*D),p+=U*(5*C),d+=(p+=P*(5*$))>>>13,p&=8191,f=d,f+=A*$,f+=E*q,f+=k*j,f+=S*(5*W),d=(f+=R*(5*N))>>>13,f&=8191,f+=T*(5*M),f+=I*(5*L),f+=B*(5*O),f+=U*(5*D),g=d+=(f+=P*(5*C))>>>13,g+=A*C,g+=E*$,g+=k*q,g+=S*j,d=(g+=R*(5*W))>>>13,g&=8191,g+=T*(5*N),g+=I*(5*M),g+=B*(5*L),g+=U*(5*O),m=d+=(g+=P*(5*D))>>>13,m+=A*D,m+=E*C,m+=k*$,m+=S*q,d=(m+=R*j)>>>13,m&=8191,m+=T*(5*W),m+=I*(5*N),m+=B*(5*M),m+=U*(5*L),y=d+=(m+=P*(5*O))>>>13,y+=A*O,y+=E*D,y+=k*C,y+=S*$,d=(y+=R*q)>>>13,y&=8191,y+=T*j,y+=I*(5*W),y+=B*(5*N),y+=U*(5*M),w=d+=(y+=P*(5*L))>>>13,w+=A*L,w+=E*O,w+=k*D,w+=S*C,d=(w+=R*$)>>>13,w&=8191,w+=T*q,w+=I*j,w+=B*(5*W),w+=U*(5*N),b=d+=(w+=P*(5*M))>>>13,b+=A*M,b+=E*L,b+=k*O,b+=S*D,d=(b+=R*C)>>>13,b&=8191,b+=T*$,b+=I*q,b+=B*j,b+=U*(5*W),v=d+=(b+=P*(5*N))>>>13,v+=A*N,v+=E*M,v+=k*L,v+=S*O,d=(v+=R*D)>>>13,v&=8191,v+=T*C,v+=I*$,v+=B*q,v+=U*j,x=d+=(v+=P*(5*W))>>>13,x+=A*W,x+=E*N,x+=k*M,x+=S*L,d=(x+=R*O)>>>13,x&=8191,x+=T*D,x+=I*C,x+=B*$,x+=U*q,A=h=8191&(d=(d=((d+=(x+=P*j)>>>13)<<2)+d|0)+(h&=8191)|0),E=p+=d>>>=13,k=f&=8191,S=g&=8191,R=m&=8191,T=y&=8191,I=w&=8191,B=b&=8191,U=v&=8191,P=x&=8191,t+=16,r-=16;this.h[0]=A,this.h[1]=E,this.h[2]=k,this.h[3]=S,this.h[4]=R,this.h[5]=T,this.h[6]=I,this.h[7]=B,this.h[8]=U,this.h[9]=P},E.prototype.finish=function(e,t){var r,s,n,i,o=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=r,r=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,i=1;i<10;i++)o[i]=this.h[i]+r,r=o[i]>>>13,o[i]&=8191;for(o[9]-=8192,s=(1^r)-1,i=0;i<10;i++)o[i]&=s;for(s=~s,i=0;i<10;i++)this.h[i]=this.h[i]&s|o[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),n=this.h[0]+this.pad[0],this.h[0]=65535&n,i=1;i<8;i++)n=(this.h[i]+this.pad[i]|0)+(n>>>16)|0,this.h[i]=65535&n;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},E.prototype.update=function(e,t,r){var s,n;if(this.leftover){for((n=16-this.leftover)>r&&(n=r),s=0;s<n;s++)this.buffer[this.leftover+s]=e[t+s];if(r-=n,t+=n,this.leftover+=n,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(n=r-r%16,this.blocks(e,t,n),t+=n,r-=n),r){for(s=0;s<r;s++)this.buffer[this.leftover+s]=e[t+s];this.leftover+=r}};var V=R,H=T,G=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Y(e,t,r,s){for(var n,i,o,a,c,u,l,d,h,p,f,g,m,y,w,b,v,x,_,A,E,k,S,R,T,I,B=new Int32Array(16),U=new Int32Array(16),P=e[0],j=e[1],q=e[2],$=e[3],C=e[4],D=e[5],O=e[6],L=e[7],M=t[0],N=t[1],W=t[2],K=t[3],F=t[4],z=t[5],V=t[6],H=t[7],Y=0;s>=128;){for(_=0;_<16;_++)A=8*_+Y,B[_]=r[A+0]<<24|r[A+1]<<16|r[A+2]<<8|r[A+3],U[_]=r[A+4]<<24|r[A+5]<<16|r[A+6]<<8|r[A+7];for(_=0;_<80;_++)if(n=P,i=j,o=q,a=$,c=C,u=D,l=O,h=M,p=N,f=W,g=K,m=F,y=z,w=V,S=65535&(k=H),R=k>>>16,T=65535&(E=L),I=E>>>16,S+=65535&(k=(F>>>14|C<<18)^(F>>>18|C<<14)^(C>>>9|F<<23)),R+=k>>>16,T+=65535&(E=(C>>>14|F<<18)^(C>>>18|F<<14)^(F>>>9|C<<23)),I+=E>>>16,S+=65535&(k=F&z^~F&V),R+=k>>>16,T+=65535&(E=C&D^~C&O),I+=E>>>16,E=G[2*_],S+=65535&(k=G[2*_+1]),R+=k>>>16,T+=65535&E,I+=E>>>16,E=B[_%16],R+=(k=U[_%16])>>>16,T+=65535&E,I+=E>>>16,T+=(R+=(S+=65535&k)>>>16)>>>16,S=65535&(k=x=65535&S|R<<16),R=k>>>16,T=65535&(E=v=65535&T|(I+=T>>>16)<<16),I=E>>>16,S+=65535&(k=(M>>>28|P<<4)^(P>>>2|M<<30)^(P>>>7|M<<25)),R+=k>>>16,T+=65535&(E=(P>>>28|M<<4)^(M>>>2|P<<30)^(M>>>7|P<<25)),I+=E>>>16,R+=(k=M&N^M&W^N&W)>>>16,T+=65535&(E=P&j^P&q^j&q),I+=E>>>16,d=65535&(T+=(R+=(S+=65535&k)>>>16)>>>16)|(I+=T>>>16)<<16,b=65535&S|R<<16,S=65535&(k=g),R=k>>>16,T=65535&(E=a),I=E>>>16,R+=(k=x)>>>16,T+=65535&(E=v),I+=E>>>16,j=n,q=i,$=o,C=a=65535&(T+=(R+=(S+=65535&k)>>>16)>>>16)|(I+=T>>>16)<<16,D=c,O=u,L=l,P=d,N=h,W=p,K=f,F=g=65535&S|R<<16,z=m,V=y,H=w,M=b,_%16==15)for(A=0;A<16;A++)E=B[A],S=65535&(k=U[A]),R=k>>>16,T=65535&E,I=E>>>16,E=B[(A+9)%16],S+=65535&(k=U[(A+9)%16]),R+=k>>>16,T+=65535&E,I+=E>>>16,v=B[(A+1)%16],S+=65535&(k=((x=U[(A+1)%16])>>>1|v<<31)^(x>>>8|v<<24)^(x>>>7|v<<25)),R+=k>>>16,T+=65535&(E=(v>>>1|x<<31)^(v>>>8|x<<24)^v>>>7),I+=E>>>16,v=B[(A+14)%16],R+=(k=((x=U[(A+14)%16])>>>19|v<<13)^(v>>>29|x<<3)^(x>>>6|v<<26))>>>16,T+=65535&(E=(v>>>19|x<<13)^(x>>>29|v<<3)^v>>>6),I+=E>>>16,I+=(T+=(R+=(S+=65535&k)>>>16)>>>16)>>>16,B[A]=65535&T|I<<16,U[A]=65535&S|R<<16;S=65535&(k=M),R=k>>>16,T=65535&(E=P),I=E>>>16,E=e[0],R+=(k=t[0])>>>16,T+=65535&E,I+=E>>>16,I+=(T+=(R+=(S+=65535&k)>>>16)>>>16)>>>16,e[0]=P=65535&T|I<<16,t[0]=M=65535&S|R<<16,S=65535&(k=N),R=k>>>16,T=65535&(E=j),I=E>>>16,E=e[1],R+=(k=t[1])>>>16,T+=65535&E,I+=E>>>16,I+=(T+=(R+=(S+=65535&k)>>>16)>>>16)>>>16,e[1]=j=65535&T|I<<16,t[1]=N=65535&S|R<<16,S=65535&(k=W),R=k>>>16,T=65535&(E=q),I=E>>>16,E=e[2],R+=(k=t[2])>>>16,T+=65535&E,I+=E>>>16,I+=(T+=(R+=(S+=65535&k)>>>16)>>>16)>>>16,e[2]=q=65535&T|I<<16,t[2]=W=65535&S|R<<16,S=65535&(k=K),R=k>>>16,T=65535&(E=$),I=E>>>16,E=e[3],R+=(k=t[3])>>>16,T+=65535&E,I+=E>>>16,I+=(T+=(R+=(S+=65535&k)>>>16)>>>16)>>>16,e[3]=$=65535&T|I<<16,t[3]=K=65535&S|R<<16,S=65535&(k=F),R=k>>>16,T=65535&(E=C),I=E>>>16,E=e[4],R+=(k=t[4])>>>16,T+=65535&E,I+=E>>>16,I+=(T+=(R+=(S+=65535&k)>>>16)>>>16)>>>16,e[4]=C=65535&T|I<<16,t[4]=F=65535&S|R<<16,S=65535&(k=z),R=k>>>16,T=65535&(E=D),I=E>>>16,E=e[5],R+=(k=t[5])>>>16,T+=65535&E,I+=E>>>16,I+=(T+=(R+=(S+=65535&k)>>>16)>>>16)>>>16,e[5]=D=65535&T|I<<16,t[5]=z=65535&S|R<<16,S=65535&(k=V),R=k>>>16,T=65535&(E=O),I=E>>>16,E=e[6],R+=(k=t[6])>>>16,T+=65535&E,I+=E>>>16,I+=(T+=(R+=(S+=65535&k)>>>16)>>>16)>>>16,e[6]=O=65535&T|I<<16,t[6]=V=65535&S|R<<16,S=65535&(k=H),R=k>>>16,T=65535&(E=L),I=E>>>16,E=e[7],R+=(k=t[7])>>>16,T+=65535&E,I+=E>>>16,I+=(T+=(R+=(S+=65535&k)>>>16)>>>16)>>>16,e[7]=L=65535&T|I<<16,t[7]=H=65535&S|R<<16,Y+=128,s-=128}return s}function J(e,t,r){var s,n=new Int32Array(8),i=new Int32Array(8),o=new Uint8Array(256),a=r;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,Y(n,i,t,r),r%=128,s=0;s<r;s++)o[s]=t[a-r+s];for(o[r]=128,o[(r=256-128*(r<112?1:0))-9]=0,p(o,r-8,a/536870912|0,a<<3),Y(n,i,o,r),s=0;s<8;s++)p(e,8*s,n[s],i[s]);return 0}function X(e,r){var s=t(),n=t(),i=t(),o=t(),a=t(),c=t(),l=t(),d=t(),h=t();D(s,e[1],e[0]),D(h,r[1],r[0]),O(s,s,h),C(n,e[0],e[1]),C(h,r[0],r[1]),O(n,n,h),O(i,e[3],r[3]),O(i,i,u),O(o,e[2],r[2]),C(o,o,o),D(a,n,s),D(c,o,i),C(l,o,i),C(d,n,s),O(e[0],a,c),O(e[1],d,l),O(e[2],l,c),O(e[3],a,d)}function Z(e,t,r){var s;for(s=0;s<4;s++)U(e[s],t[s],r)}function Q(e,r){var s=t(),n=t(),i=t();M(i,r[2]),O(s,r[0],i),O(n,r[1],i),P(e,n),e[31]^=q(s)<<7}function ee(e,t,r){var s,n;for(I(e[0],i),I(e[1],o),I(e[2],o),I(e[3],i),n=255;n>=0;--n)Z(e,t,s=r[n/8|0]>>(7&n)&1),X(t,e),X(e,e),Z(e,t,s)}function te(e,r){var s=[t(),t(),t(),t()];I(s[0],l),I(s[1],d),I(s[2],o),O(s[3],l,d),ee(e,s,r)}function re(e,s,n){var i,o=new Uint8Array(64),a=[t(),t(),t(),t()];for(n||r(s,32),J(o,s,32),o[0]&=248,o[31]&=127,o[31]|=64,te(a,o),Q(e,a),i=0;i<32;i++)s[i+32]=e[i];return 0}var se=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ne(e,t){var r,s,n,i;for(s=63;s>=32;--s){for(r=0,n=s-32,i=s-12;n<i;++n)t[n]+=r-16*t[s]*se[n-(s-32)],r=Math.floor((t[n]+128)/256),t[n]-=256*r;t[n]+=r,t[s]=0}for(r=0,n=0;n<32;n++)t[n]+=r-(t[31]>>4)*se[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;n++)t[n]-=r*se[n];for(s=0;s<32;s++)t[s+1]+=t[s]>>8,e[s]=255&t[s]}function ie(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ne(e,r)}function oe(e,r,s,n){var i,o,a=new Uint8Array(64),c=new Uint8Array(64),u=new Uint8Array(64),l=new Float64Array(64),d=[t(),t(),t(),t()];J(a,n,32),a[0]&=248,a[31]&=127,a[31]|=64;var h=s+64;for(i=0;i<s;i++)e[64+i]=r[i];for(i=0;i<32;i++)e[32+i]=a[32+i];for(J(u,e.subarray(32),s+32),ie(u),te(d,u),Q(e,d),i=32;i<64;i++)e[i]=n[i];for(J(c,e,s+64),ie(c),i=0;i<64;i++)l[i]=0;for(i=0;i<32;i++)l[i]=u[i];for(i=0;i<32;i++)for(o=0;o<32;o++)l[i+o]+=c[i]*a[o];return ne(e.subarray(32),l),h}function ae(e,r,s,n){var a,u=new Uint8Array(32),l=new Uint8Array(64),d=[t(),t(),t(),t()],p=[t(),t(),t(),t()];if(s<64)return-1;if(function(e,r){var s=t(),n=t(),a=t(),u=t(),l=t(),d=t(),p=t();return I(e[2],o),$(e[1],r),L(a,e[1]),O(u,a,c),D(a,a,e[2]),C(u,e[2],u),L(l,u),L(d,l),O(p,d,l),O(s,p,a),O(s,s,u),N(s,s),O(s,s,a),O(s,s,u),O(s,s,u),O(e[0],s,u),L(n,e[0]),O(n,n,u),j(n,a)&&O(e[0],e[0],h),L(n,e[0]),O(n,n,u),j(n,a)?-1:(q(e[0])===r[31]>>7&&D(e[0],i,e[0]),O(e[3],e[0],e[1]),0)}(p,n))return-1;for(a=0;a<s;a++)e[a]=r[a];for(a=0;a<32;a++)e[a+32]=n[a];if(J(l,e,s),ie(l),ee(d,p,l),te(p,r.subarray(32)),X(d,p),Q(u,d),s-=64,m(r,0,u,0)){for(a=0;a<s;a++)e[a]=0;return-1}for(a=0;a<s;a++)e[a]=r[a+64];return s}var ce=32,ue=24,le=ue,de=64,he=32,pe=64;function fe(e,t){if(e.length!==ce)throw new Error("bad key size");if(t.length!==ue)throw new Error("bad nonce size")}function ge(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function me(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:w,crypto_stream_xor:A,crypto_stream:_,crypto_stream_salsa20_xor:v,crypto_stream_salsa20:x,crypto_onetimeauth:k,crypto_onetimeauth_verify:S,crypto_verify_16:g,crypto_verify_32:m,crypto_secretbox:R,crypto_secretbox_open:T,crypto_scalarmult:W,crypto_scalarmult_base:K,crypto_box_beforenm:z,crypto_box_afternm:V,crypto_box:function(e,t,r,s,n,i){var o=new Uint8Array(32);return z(o,n,i),V(e,t,r,s,o)},crypto_box_open:function(e,t,r,s,n,i){var o=new Uint8Array(32);return z(o,n,i),H(e,t,r,s,o)},crypto_box_keypair:F,crypto_hash:J,crypto_sign:oe,crypto_sign_keypair:re,crypto_sign_open:ae,crypto_secretbox_KEYBYTES:ce,crypto_secretbox_NONCEBYTES:ue,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:le,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:de,crypto_sign_PUBLICKEYBYTES:he,crypto_sign_SECRETKEYBYTES:pe,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:c,L:se,pack25519:P,unpack25519:$,M:O,A:C,S:L,Z:D,pow2523:N,add:X,set25519:I,modL:ne,scalarmult:ee,scalarbase:te},e.randomBytes=function(e){var t=new Uint8Array(e);return r(t,e),t},e.secretbox=function(e,t,r){ge(e,t,r),fe(r,t);for(var s=new Uint8Array(32+e.length),n=new Uint8Array(s.length),i=0;i<e.length;i++)s[i+32]=e[i];return R(n,s,s.length,t,r),n.subarray(16)},e.secretbox.open=function(e,t,r){ge(e,t,r),fe(r,t);for(var s=new Uint8Array(16+e.length),n=new Uint8Array(s.length),i=0;i<e.length;i++)s[i+16]=e[i];return s.length<32||0!==T(n,s,s.length,t,r)?null:n.subarray(32)},e.secretbox.keyLength=ce,e.secretbox.nonceLength=ue,e.secretbox.overheadLength=16,e.scalarMult=function(e,t){if(ge(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var r=new Uint8Array(32);return W(r,e,t),r},e.scalarMult.base=function(e){if(ge(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return K(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,r,s,n){var i=e.box.before(s,n);return e.secretbox(t,r,i)},e.box.before=function(e,t){ge(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var r=new Uint8Array(32);return z(r,e,t),r},e.box.after=e.secretbox,e.box.open=function(t,r,s,n){var i=e.box.before(s,n);return e.secretbox.open(t,r,i)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return F(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(ge(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return K(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=le,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(ge(e,t),t.length!==pe)throw new Error("bad secret key size");var r=new Uint8Array(de+e.length);return oe(r,e,e.length,t),r},e.sign.open=function(e,t){if(ge(e,t),t.length!==he)throw new Error("bad public key size");var r=new Uint8Array(e.length),s=ae(r,e,e.length,t);if(s<0)return null;for(var n=new Uint8Array(s),i=0;i<n.length;i++)n[i]=r[i];return n},e.sign.detached=function(t,r){for(var s=e.sign(t,r),n=new Uint8Array(de),i=0;i<n.length;i++)n[i]=s[i];return n},e.sign.detached.verify=function(e,t,r){if(ge(e,t,r),t.length!==de)throw new Error("bad signature size");if(r.length!==he)throw new Error("bad public key size");var s,n=new Uint8Array(de+e.length),i=new Uint8Array(de+e.length);for(s=0;s<de;s++)n[s]=t[s];for(s=0;s<e.length;s++)n[s+de]=e[s];return ae(i,n,n.length,r)>=0},e.sign.keyPair=function(){var e=new Uint8Array(he),t=new Uint8Array(pe);return re(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(ge(e),e.length!==pe)throw new Error("bad secret key size");for(var t=new Uint8Array(he),r=0;r<t.length;r++)t[r]=e[32+r];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(ge(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(he),r=new Uint8Array(pe),s=0;s<32;s++)r[s]=e[s];return re(t,r,!0),{publicKey:t,secretKey:r}},e.sign.publicKeyLength=he,e.sign.secretKeyLength=pe,e.sign.seedLength=32,e.sign.signatureLength=de,e.hash=function(e){ge(e);var t=new Uint8Array(64);return J(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return ge(e,t),0!==e.length&&0!==t.length&&e.length===t.length&&0===f(e,0,t,0,e.length)},e.setPRNG=function(e){r=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&t.getRandomValues?e.setPRNG((function(e,r){var s,n=new Uint8Array(r);for(s=0;s<r;s+=65536)t.getRandomValues(n.subarray(s,s+Math.min(r-s,65536)));for(s=0;s<r;s++)e[s]=n[s];me(n)})):"undefined"!=typeof require&&(t=require("crypto"))&&t.randomBytes&&e.setPRNG((function(e,r){var s,n=t.randomBytes(r);for(s=0;s<r;s++)e[s]=n[s];me(n)}))}()}(void 0!==e&&e.exports?e.exports:self.nacl=self.nacl||{})}},t={};function r(s){var n=t[s];if(void 0!==n)return n.exports;var i=t[s]={exports:{}};return e[s].call(i.exports,i,i.exports,r),i.exports}r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{"use strict";r.r(s),r.d(s,{ABIAddressType:()=>Ji,ABIArrayDynamicType:()=>to,ABIArrayStaticType:()=>eo,ABIBoolType:()=>Xi,ABIByteType:()=>Zi,ABIContract:()=>po,ABIInterface:()=>fo,ABIMethod:()=>lo,ABIReferenceType:()=>oo,ABIStringType:()=>Qi,ABITransactionType:()=>io,ABITupleType:()=>ro,ABIType:()=>Hi,ABIUfixedType:()=>Yi,ABIUintType:()=>Gi,ADDR_BYTE_SIZE:()=>Ni,ALGORAND_MIN_TX_FEE:()=>te,Algodv2:()=>Er,AtomicTransactionComposer:()=>wo,AtomicTransactionComposerStatus:()=>mo,DryrunResult:()=>ii,ERROR_INVALID_MICROALGOS:()=>To,ERROR_MULTISIG_BAD_SENDER:()=>Ro,INVALID_MICROALGOS_ERROR_MSG:()=>de,Indexer:()=>en,IntDecoding:()=>p,Kmd:()=>kr,LENGTH_ENCODE_BYTE_SIZE:()=>Fi,LogicSig:()=>Dn,LogicSigAccount:()=>On,MAX_LEN:()=>Mi,MULTISIG_BAD_SENDER_ERROR_MSG:()=>vo,OnApplicationComplete:()=>ee,SINGLE_BOOL_SIZE:()=>Ki,SINGLE_BYTE_SIZE:()=>Wi,SourceMap:()=>Gn,Transaction:()=>se,TransactionType:()=>Q,abiCheckTransactionType:()=>co,abiTypeIsReference:()=>uo,abiTypeIsTransaction:()=>ao,algosToMicroalgos:()=>pe,appendSignMultisigTransaction:()=>jn,appendSignRawMultisigSignature:()=>qn,assignGroupID:()=>vn,bigIntToBytes:()=>rn,bytesToBigInt:()=>sn,computeGroupID:()=>bn,createDryrun:()=>Xn,createMultisigTransaction:()=>Rn,decodeAddress:()=>W,decodeObj:()=>So,decodeSignedTransaction:()=>ae,decodeUint64:()=>B,decodeUnsignedTransaction:()=>oe,default:()=>Io,encodeAddress:()=>F,encodeObj:()=>ko,encodeUint64:()=>I,encodeUnsignedSimulateTransaction:()=>ne,encodeUnsignedTransaction:()=>ie,generateAccount:()=>nn,getApplicationAddress:()=>H,getMethodByName:()=>ho,indexerModels:()=>t,instantiateTxnIfNeeded:()=>ce,isTransactionWithSigner:()=>Li,isValidAddress:()=>K,logicSigFromByte:()=>Nn,makeApplicationCallTxnFromObject:()=>qi,makeApplicationClearStateTxn:()=>Bi,makeApplicationClearStateTxnFromObject:()=>Ui,makeApplicationCloseOutTxn:()=>Ti,makeApplicationCloseOutTxnFromObject:()=>Ii,makeApplicationCreateTxn:()=>vi,makeApplicationCreateTxnFromObject:()=>xi,makeApplicationDeleteTxn:()=>Ei,makeApplicationDeleteTxnFromObject:()=>ki,makeApplicationNoOpTxn:()=>Pi,makeApplicationNoOpTxnFromObject:()=>ji,makeApplicationOptInTxn:()=>Si,makeApplicationOptInTxnFromObject:()=>Ri,makeApplicationUpdateTxn:()=>_i,makeApplicationUpdateTxnFromObject:()=>Ai,makeAssetConfigTxnWithSuggestedParams:()=>hi,makeAssetConfigTxnWithSuggestedParamsFromObject:()=>pi,makeAssetCreateTxnWithSuggestedParams:()=>li,makeAssetCreateTxnWithSuggestedParamsFromObject:()=>di,makeAssetDestroyTxnWithSuggestedParams:()=>fi,makeAssetDestroyTxnWithSuggestedParamsFromObject:()=>gi,makeAssetFreezeTxnWithSuggestedParams:()=>mi,makeAssetFreezeTxnWithSuggestedParamsFromObject:()=>yi,makeAssetTransferTxnWithSuggestedParams:()=>wi,makeAssetTransferTxnWithSuggestedParamsFromObject:()=>bi,makeBasicAccountTransactionSigner:()=>$i,makeEmptyTransactionSigner:()=>Oi,makeKeyRegistrationTxnWithSuggestedParams:()=>ci,makeKeyRegistrationTxnWithSuggestedParamsFromObject:()=>ui,makeLogicSigAccountTransactionSigner:()=>Ci,makeMultiSigAccountTransactionSigner:()=>Di,makePaymentTxnWithSuggestedParams:()=>oi,makePaymentTxnWithSuggestedParamsFromObject:()=>ai,masterDerivationKeyToMnemonic:()=>yn,mergeMultisigTransactions:()=>Bn,microalgosToAlgos:()=>he,mnemonicFromSeed:()=>hn,mnemonicToMasterDerivationKey:()=>mn,mnemonicToSecretKey:()=>fn,modelsv2:()=>e,multisigAddress:()=>$n,secretKeyToMnemonic:()=>gn,seedFromMnemonic:()=>pn,signBid:()=>_o,signBytes:()=>Ao,signLogicSigTransaction:()=>Mn,signLogicSigTransactionObject:()=>Ln,signMultisigTransaction:()=>Pn,signTransaction:()=>xo,tealSign:()=>Kn,tealSignFromProgram:()=>zn,verifyBytes:()=>Eo,verifyMultisig:()=>Un,verifyTealSign:()=>Fn,waitForConfirmation:()=>tn});var e={};r.r(e),r.d(e,{Account:()=>xe,AccountApplicationResponse:()=>_e,AccountAssetHolding:()=>Ae,AccountAssetResponse:()=>Ee,AccountAssetsInformationResponse:()=>ke,AccountParticipation:()=>Se,AccountStateDelta:()=>Re,AppCallLogs:()=>Te,Application:()=>Ie,ApplicationInitialStates:()=>Be,ApplicationKVStorage:()=>Ue,ApplicationLocalReference:()=>Pe,ApplicationLocalState:()=>je,ApplicationParams:()=>qe,ApplicationStateOperation:()=>$e,ApplicationStateSchema:()=>Ce,Asset:()=>De,AssetHolding:()=>Oe,AssetHoldingReference:()=>Le,AssetParams:()=>Me,AvmKeyValue:()=>Ne,AvmValue:()=>We,BlockHashResponse:()=>Ke,BlockLogsResponse:()=>Fe,BlockResponse:()=>ze,BlockTxidsResponse:()=>Ve,Box:()=>He,BoxDescriptor:()=>Ge,BoxReference:()=>Ye,BoxesResponse:()=>Je,BuildVersion:()=>Xe,CompileResponse:()=>Ze,DisassembleResponse:()=>Qe,DryrunRequest:()=>et,DryrunResponse:()=>tt,DryrunSource:()=>rt,DryrunState:()=>st,DryrunTxnResult:()=>nt,ErrorResponse:()=>it,EvalDelta:()=>ot,EvalDeltaKeyValue:()=>at,GetBlockTimeStampOffsetResponse:()=>ct,GetSyncRoundResponse:()=>ut,KvDelta:()=>lt,LedgerStateDeltaForTransactionGroup:()=>dt,LightBlockHeaderProof:()=>ht,NodeStatusResponse:()=>pt,PendingTransactionResponse:()=>ft,PendingTransactionsResponse:()=>gt,PostTransactionsResponse:()=>mt,ScratchChange:()=>yt,SimulateInitialStates:()=>wt,SimulateRequest:()=>bt,SimulateRequestTransactionGroup:()=>vt,SimulateResponse:()=>xt,SimulateTraceConfig:()=>_t,SimulateTransactionGroupResult:()=>At,SimulateTransactionResult:()=>Et,SimulateUnnamedResourcesAccessed:()=>kt,SimulationEvalOverrides:()=>St,SimulationOpcodeTraceUnit:()=>Rt,SimulationTransactionExecTrace:()=>Tt,StateProof:()=>It,StateProofMessage:()=>Bt,SupplyResponse:()=>Ut,TealKeyValue:()=>Pt,TealValue:()=>jt,TransactionGroupLedgerStateDeltasForRoundResponse:()=>qt,TransactionParametersResponse:()=>$t,TransactionProofResponse:()=>Ct,Version:()=>Dt});var t={};r.r(t),r.d(t,{Account:()=>Nr,AccountParticipation:()=>Wr,AccountResponse:()=>Kr,AccountStateDelta:()=>Fr,AccountsResponse:()=>zr,Application:()=>Vr,ApplicationLocalState:()=>Hr,ApplicationLocalStatesResponse:()=>Gr,ApplicationLogData:()=>Yr,ApplicationLogsResponse:()=>Jr,ApplicationParams:()=>Xr,ApplicationResponse:()=>Zr,ApplicationStateSchema:()=>Qr,ApplicationsResponse:()=>es,Asset:()=>ts,AssetBalancesResponse:()=>rs,AssetHolding:()=>ss,AssetHoldingsResponse:()=>ns,AssetParams:()=>is,AssetResponse:()=>os,AssetsResponse:()=>as,Block:()=>cs,BlockRewards:()=>us,BlockUpgradeState:()=>ls,BlockUpgradeVote:()=>ds,Box:()=>hs,BoxDescriptor:()=>ps,BoxesResponse:()=>fs,ErrorResponse:()=>gs,EvalDelta:()=>ms,EvalDeltaKeyValue:()=>ys,HashFactory:()=>ws,HealthCheck:()=>bs,IndexerStateProofMessage:()=>vs,MerkleArrayProof:()=>xs,MiniAssetHolding:()=>_s,ParticipationUpdates:()=>As,StateProofFields:()=>Es,StateProofParticipant:()=>ks,StateProofReveal:()=>Ss,StateProofSigSlot:()=>Rs,StateProofSignature:()=>Ts,StateProofTracking:()=>Is,StateProofVerifier:()=>Bs,StateSchema:()=>Us,TealKeyValue:()=>Ps,TealValue:()=>js,Transaction:()=>qs,TransactionApplication:()=>$s,TransactionAssetConfig:()=>Cs,TransactionAssetFreeze:()=>Ds,TransactionAssetTransfer:()=>Os,TransactionKeyreg:()=>Ls,TransactionPayment:()=>Ms,TransactionResponse:()=>Ns,TransactionSignature:()=>Ws,TransactionSignatureLogicsig:()=>Ks,TransactionSignatureMultisig:()=>Fs,TransactionSignatureMultisigSubsignature:()=>zs,TransactionStateProof:()=>Vs,TransactionsResponse:()=>Hs});var n={};r.r(n),r.d(n,{ABIAddressType:()=>Ji,ABIArrayDynamicType:()=>to,ABIArrayStaticType:()=>eo,ABIBoolType:()=>Xi,ABIByteType:()=>Zi,ABIContract:()=>po,ABIInterface:()=>fo,ABIMethod:()=>lo,ABIReferenceType:()=>oo,ABIStringType:()=>Qi,ABITransactionType:()=>io,ABITupleType:()=>ro,ABIType:()=>Hi,ABIUfixedType:()=>Yi,ABIUintType:()=>Gi,ADDR_BYTE_SIZE:()=>Ni,ALGORAND_MIN_TX_FEE:()=>te,Algodv2:()=>Er,AtomicTransactionComposer:()=>wo,AtomicTransactionComposerStatus:()=>mo,DryrunResult:()=>ii,ERROR_INVALID_MICROALGOS:()=>To,ERROR_MULTISIG_BAD_SENDER:()=>Ro,INVALID_MICROALGOS_ERROR_MSG:()=>de,Indexer:()=>en,IntDecoding:()=>p,Kmd:()=>kr,LENGTH_ENCODE_BYTE_SIZE:()=>Fi,LogicSig:()=>Dn,LogicSigAccount:()=>On,MAX_LEN:()=>Mi,MULTISIG_BAD_SENDER_ERROR_MSG:()=>vo,OnApplicationComplete:()=>ee,SINGLE_BOOL_SIZE:()=>Ki,SINGLE_BYTE_SIZE:()=>Wi,SourceMap:()=>Gn,Transaction:()=>se,TransactionType:()=>Q,abiCheckTransactionType:()=>co,abiTypeIsReference:()=>uo,abiTypeIsTransaction:()=>ao,algosToMicroalgos:()=>pe,appendSignMultisigTransaction:()=>jn,appendSignRawMultisigSignature:()=>qn,assignGroupID:()=>vn,bigIntToBytes:()=>rn,bytesToBigInt:()=>sn,computeGroupID:()=>bn,createDryrun:()=>Xn,createMultisigTransaction:()=>Rn,decodeAddress:()=>W,decodeObj:()=>So,decodeSignedTransaction:()=>ae,decodeUint64:()=>B,decodeUnsignedTransaction:()=>oe,encodeAddress:()=>F,encodeObj:()=>ko,encodeUint64:()=>I,encodeUnsignedSimulateTransaction:()=>ne,encodeUnsignedTransaction:()=>ie,generateAccount:()=>nn,getApplicationAddress:()=>H,getMethodByName:()=>ho,indexerModels:()=>t,instantiateTxnIfNeeded:()=>ce,isTransactionWithSigner:()=>Li,isValidAddress:()=>K,logicSigFromByte:()=>Nn,makeApplicationCallTxnFromObject:()=>qi,makeApplicationClearStateTxn:()=>Bi,makeApplicationClearStateTxnFromObject:()=>Ui,makeApplicationCloseOutTxn:()=>Ti,makeApplicationCloseOutTxnFromObject:()=>Ii,makeApplicationCreateTxn:()=>vi,makeApplicationCreateTxnFromObject:()=>xi,makeApplicationDeleteTxn:()=>Ei,makeApplicationDeleteTxnFromObject:()=>ki,makeApplicationNoOpTxn:()=>Pi,makeApplicationNoOpTxnFromObject:()=>ji,makeApplicationOptInTxn:()=>Si,makeApplicationOptInTxnFromObject:()=>Ri,makeApplicationUpdateTxn:()=>_i,makeApplicationUpdateTxnFromObject:()=>Ai,makeAssetConfigTxnWithSuggestedParams:()=>hi,makeAssetConfigTxnWithSuggestedParamsFromObject:()=>pi,makeAssetCreateTxnWithSuggestedParams:()=>li,makeAssetCreateTxnWithSuggestedParamsFromObject:()=>di,makeAssetDestroyTxnWithSuggestedParams:()=>fi,makeAssetDestroyTxnWithSuggestedParamsFromObject:()=>gi,makeAssetFreezeTxnWithSuggestedParams:()=>mi,makeAssetFreezeTxnWithSuggestedParamsFromObject:()=>yi,makeAssetTransferTxnWithSuggestedParams:()=>wi,makeAssetTransferTxnWithSuggestedParamsFromObject:()=>bi,makeBasicAccountTransactionSigner:()=>$i,makeEmptyTransactionSigner:()=>Oi,makeKeyRegistrationTxnWithSuggestedParams:()=>ci,makeKeyRegistrationTxnWithSuggestedParamsFromObject:()=>ui,makeLogicSigAccountTransactionSigner:()=>Ci,makeMultiSigAccountTransactionSigner:()=>Di,makePaymentTxnWithSuggestedParams:()=>oi,makePaymentTxnWithSuggestedParamsFromObject:()=>ai,masterDerivationKeyToMnemonic:()=>yn,mergeMultisigTransactions:()=>Bn,microalgosToAlgos:()=>he,mnemonicFromSeed:()=>hn,mnemonicToMasterDerivationKey:()=>mn,mnemonicToSecretKey:()=>fn,modelsv2:()=>e,multisigAddress:()=>$n,secretKeyToMnemonic:()=>gn,seedFromMnemonic:()=>pn,signBid:()=>_o,signBytes:()=>Ao,signLogicSigTransaction:()=>Mn,signLogicSigTransactionObject:()=>Ln,signMultisigTransaction:()=>Pn,signTransaction:()=>xo,tealSign:()=>Kn,tealSignFromProgram:()=>zn,verifyBytes:()=>Eo,verifyMultisig:()=>Un,verifyTealSign:()=>Fn,waitForConfirmation:()=>tn});var i,o=r(486),a=r(765),c=r.n(a),u=r(757),l=r.n(u),d=r(360),h=r.n(d);!function(e){e.DEFAULT="default",e.SAFE="safe",e.MIXED="mixed",e.BIGINT="bigint"}(i||(i={}));const p=i,f=h()({useNativeBigInt:!0,strict:!0});function g(e,t){return e.length===t.length&&Array.from(e).every(((e,r)=>e===t[r]))}function m(...e){const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);let s=0;for(let t=0;t<e.length;t++)r.set(e[t],s),s+=e[t].length;return r}function y(e){return l().sha512_256.array(e)}function w(e){return c().sign.keyPair.fromSeed(e)}function b(e){return e===c().sign.signatureLength}function v(e){return c().sign.keyPair.fromSecretKey(e)}function x(e,t){return c().sign.detached(e,t)}function _(e,t){return c().verify(e,t)}function A(e,t,r){return c().sign.detached.verify(e,t,r)}const E=c().sign.publicKeyLength,k=(c().sign.secretKeyLength,32),S=32;var R=r(267),T=r.n(R);function I(e){if("bigint"!=typeof e&&!Number.isInteger(e)||e<0||e>BigInt("0xffffffffffffffff"))throw new Error("Input is not a 64-bit unsigned integer");const t=new Uint8Array(8);return new DataView(t.buffer).setBigUint64(0,BigInt(e)),t}function B(e,t="safe"){if("safe"!==t&&"mixed"!==t&&"bigint"!==t)throw new Error(`Unknown decodingMode option: ${t}`);if(0===e.byteLength||e.byteLength>8)throw new Error(`Data has unacceptable length. Expected length is between 1 and 8, got ${e.byteLength}`);const r=m(new Uint8Array(8-e.byteLength),e),s=new DataView(r.buffer).getBigUint64(0),n=s>BigInt(Number.MAX_SAFE_INTEGER);if("safe"===t){if(n)throw new Error(`Integer exceeds maximum safe integer: ${s.toString()}. Try decoding with "mixed" or "safe" decodingMode.`);return Number(s)}return"mixed"!==t||n?s:Number(s)}const U=36,P=4,j=58,q=new Uint8Array([77,117,108,116,105,115,105,103,65,100,100,114]),$=o.lW.from("appID"),C="address seems to be malformed",D="wrong checksum for address",O="invalid multisig version",L="bad multisig threshold",M="bad multisig public key - wrong length",N="nacl public key length is not 32 bytes";function W(e){if("string"!=typeof e||e.length!==j)throw new Error(C);const t=T().decode.asBytes(e.toString());if(t.length!==U)throw new Error(C);const r=new Uint8Array(t.slice(0,U-P)),s=new Uint8Array(t.slice(E,U));if(!g(y(r).slice(k-P,k),s))throw new Error(D);return{publicKey:r,checksum:s}}function K(e){try{W(e)}catch(e){return!1}return!0}function F(e){const t=y(e).slice(E-P,E);return T().encode(m(e,t)).toString().slice(0,j)}function z({version:e,threshold:t,pks:r}){if(1!==e||e>255||e<0)throw new Error(O);if(0===t||0===r.length||t>r.length||t>255)throw new Error(L);const s=U-P;if(s!==E)throw new Error(N);const n=new Uint8Array(q.length+2+s*r.length);n.set(q,0),n.set([e],q.length),n.set([t],q.length+1);for(let e=0;e<r.length;e++){if(r[e].length!==s)throw new Error(M);n.set(r[e],q.length+2+e*s)}return new Uint8Array(y(n))}function V({version:e,threshold:t,addrs:r}){return F(z({version:e,threshold:t,pks:r.map((e=>W(e).publicKey))}))}function H(e){const t=y(m($,I(e)));return F(new Uint8Array(t))}var G=r(406);const Y="The object contains empty or 0 values. First empty or 0 value encountered during encoding: ";function J(e){return G.encode(e,{sortKeys:!0})}function X(e){const t=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(!e[t]||0===e[t].length))return{containsEmpty:!0,firstEmptyKey:t};return{containsEmpty:!1,firstEmptyKey:void 0}}(e);if(t.containsEmpty)throw new Error(Y+t.firstEmptyKey);return J(e)}function Z(e){return G.decode(e)}var Q,ee;!function(e){e.pay="pay",e.keyreg="keyreg",e.acfg="acfg",e.axfer="axfer",e.afrz="afrz",e.appl="appl",e.stpf="stpf"}(Q||(Q={})),function(e){e[e.NoOpOC=0]="NoOpOC",e[e.OptInOC=1]="OptInOC",e[e.CloseOutOC=2]="CloseOutOC",e[e.ClearStateOC=3]="ClearStateOC",e[e.UpdateApplicationOC=4]="UpdateApplicationOC",e[e.DeleteApplicationOC=5]="DeleteApplicationOC"}(ee||(ee={}));const te=1e3;function re(e,t,r){if(null==e)return;let s;if("string"==typeof e?s=o.lW.from(e,"base64"):e.constructor===Uint8Array?s=o.lW.from(e):o.lW.isBuffer(e)&&(s=e),null==s||s.byteLength!==r)throw Error(`${t} must be a ${r} byte Uint8Array or Buffer or base64 string.`);return s}class se{constructor({...e}){this.name="Transaction",this.tag=o.lW.from("TX");const t={type:Q.pay,flatFee:!1,nonParticipation:!1};if(void 0===e.type&&(e.type=t.type),void 0===e.flatFee&&(e.flatFee=t.flatFee),e.type===Q.keyreg&&void 0!==e.voteKey&&void 0===e.nonParticipation&&(e.nonParticipation=t.nonParticipation),void 0!==e.suggestedParams){const t=e;t.genesisHash=t.suggestedParams.genesisHash,t.fee=t.suggestedParams.fee,void 0!==t.suggestedParams.flatFee&&(t.flatFee=t.suggestedParams.flatFee),t.firstRound=t.suggestedParams.firstRound,t.lastRound=t.suggestedParams.lastRound,t.genesisID=t.suggestedParams.genesisID}const r=e;if(r.from=W(r.from),void 0!==r.to&&(r.to=W(r.to)),void 0!==r.closeRemainderTo&&(r.closeRemainderTo=W(r.closeRemainderTo)),void 0!==r.assetManager&&(r.assetManager=W(r.assetManager)),void 0!==r.assetReserve&&(r.assetReserve=W(r.assetReserve)),void 0!==r.assetFreeze&&(r.assetFreeze=W(r.assetFreeze)),void 0!==r.assetClawback&&(r.assetClawback=W(r.assetClawback)),void 0!==r.assetRevocationTarget&&(r.assetRevocationTarget=W(r.assetRevocationTarget)),void 0!==r.freezeAccount&&(r.freezeAccount=W(r.freezeAccount)),void 0!==r.reKeyTo&&(r.reKeyTo=W(r.reKeyTo)),void 0===r.genesisHash)throw Error("genesis hash must be specified and in a base64 string.");if(r.genesisHash=o.lW.from(r.genesisHash,"base64"),void 0!==r.amount&&(!(Number.isSafeInteger(r.amount)||"bigint"==typeof r.amount&&r.amount<=BigInt("0xffffffffffffffff"))||r.amount<0))throw Error("Amount must be a positive number and smaller than 2^64-1. If the number is larger than 2^53-1, use bigint.");if(!Number.isSafeInteger(r.fee)||r.fee<0)throw Error("fee must be a positive number and smaller than 2^53-1");if(!Number.isSafeInteger(r.firstRound)||r.firstRound<0)throw Error("firstRound must be a positive number");if(!Number.isSafeInteger(r.lastRound)||r.lastRound<0)throw Error("lastRound must be a positive number");if(void 0!==r.extraPages&&(!Number.isInteger(r.extraPages)||r.extraPages<0||r.extraPages>3))throw Error("extraPages must be an Integer between and including 0 to 3");if(void 0!==r.assetTotal&&(!(Number.isSafeInteger(r.assetTotal)||"bigint"==typeof r.assetTotal&&r.assetTotal<=BigInt("0xffffffffffffffff"))||r.assetTotal<0))throw Error("Total asset issuance must be a positive number and smaller than 2^64-1. If the number is larger than 2^53-1, use bigint.");if(void 0!==r.assetDecimals&&(!Number.isSafeInteger(r.assetDecimals)||r.assetDecimals<0||r.assetDecimals>19))throw Error(`assetDecimals must be a positive number and smaller than ${19..toString()}`);if(void 0!==r.assetIndex&&(!Number.isSafeInteger(r.assetIndex)||r.assetIndex<0))throw Error("Asset index must be a positive number and smaller than 2^53-1");if(void 0!==r.appIndex&&(!Number.isSafeInteger(r.appIndex)||r.appIndex<0))throw Error("Application index must be a positive number and smaller than 2^53-1");if(void 0!==r.appLocalInts&&(!Number.isSafeInteger(r.appLocalInts)||r.appLocalInts<0))throw Error("Application local ints count must be a positive number and smaller than 2^53-1");if(void 0!==r.appLocalByteSlices&&(!Number.isSafeInteger(r.appLocalByteSlices)||r.appLocalByteSlices<0))throw Error("Application local byte slices count must be a positive number and smaller than 2^53-1");if(void 0!==r.appGlobalInts&&(!Number.isSafeInteger(r.appGlobalInts)||r.appGlobalInts<0))throw Error("Application global ints count must be a positive number and smaller than 2^53-1");if(void 0!==r.appGlobalByteSlices&&(!Number.isSafeInteger(r.appGlobalByteSlices)||r.appGlobalByteSlices<0))throw Error("Application global byte slices count must be a positive number and smaller than 2^53-1");if(void 0!==r.appApprovalProgram&&r.appApprovalProgram.constructor!==Uint8Array)throw Error("appApprovalProgram must be a Uint8Array.");if(void 0!==r.appClearProgram&&r.appClearProgram.constructor!==Uint8Array)throw Error("appClearProgram must be a Uint8Array.");if(void 0!==r.appArgs){if(!Array.isArray(r.appArgs))throw Error("appArgs must be an Array of Uint8Array.");r.appArgs=r.appArgs.slice(),r.appArgs.forEach((e=>{if(e.constructor!==Uint8Array)throw Error("each element of AppArgs must be a Uint8Array.")}))}else r.appArgs=[];if(void 0!==r.appAccounts){if(!Array.isArray(r.appAccounts))throw Error("appAccounts must be an Array of addresses.");r.appAccounts=r.appAccounts.map((e=>W(e)))}if(void 0!==r.appForeignApps){if(!Array.isArray(r.appForeignApps))throw Error("appForeignApps must be an Array of integers.");r.appForeignApps=r.appForeignApps.slice(),r.appForeignApps.forEach((e=>{if(!Number.isSafeInteger(e)||e<0)throw Error("each foreign application index must be a positive number and smaller than 2^53-1")}))}if(void 0!==r.appForeignAssets){if(!Array.isArray(r.appForeignAssets))throw Error("appForeignAssets must be an Array of integers.");r.appForeignAssets=r.appForeignAssets.slice(),r.appForeignAssets.forEach((e=>{if(!Number.isSafeInteger(e)||e<0)throw Error("each foreign asset index must be a positive number and smaller than 2^53-1")}))}if(void 0!==r.boxes){if(!Array.isArray(r.boxes))throw Error("boxes must be an Array of BoxReference.");r.boxes=r.boxes.slice(),r.boxes.forEach((e=>{if(!Number.isSafeInteger(e.appIndex)||e.name.constructor!==Uint8Array)throw Error("box app index must be a number and name must be an Uint8Array.")}))}if(void 0!==r.assetMetadataHash&&0!==r.assetMetadataHash.length){if("string"==typeof r.assetMetadataHash&&(r.assetMetadataHash=new Uint8Array(o.lW.from(r.assetMetadataHash))),r.assetMetadataHash.constructor!==Uint8Array||32!==r.assetMetadataHash.byteLength)throw Error("assetMetadataHash must be a 32 byte Uint8Array or string.");r.assetMetadataHash.every((e=>0===e))&&(r.assetMetadataHash=void 0)}else r.assetMetadataHash=void 0;if(void 0!==r.note){if(r.note.constructor!==Uint8Array)throw Error("note must be a Uint8Array.")}else r.note=new Uint8Array(0);if(void 0!==r.lease){if(r.lease.constructor!==Uint8Array)throw Error("lease must be a Uint8Array.");if(32!==r.lease.length)throw Error(`lease must be of length ${32..toString()}.`);r.lease.every((e=>0===e))&&(r.lease=new Uint8Array(0))}else r.lease=new Uint8Array(0);if(r.voteKey=re(r.voteKey,"voteKey",32),r.selectionKey=re(r.selectionKey,"selectionKey",32),r.stateProofKey=re(r.stateProofKey,"stateProofKey",64),r.nonParticipation&&(r.voteKey||r.selectionKey||r.voteFirst||r.stateProofKey||r.voteLast||r.voteKeyDilution))throw new Error("nonParticipation is true but participation params are present.");if(!r.nonParticipation&&(r.voteKey||r.selectionKey||r.stateProofKey||r.voteFirst||r.voteLast||r.voteKeyDilution)&&!(r.voteKey&&r.selectionKey&&r.voteFirst&&r.voteLast&&r.voteKeyDilution))throw new Error("online key registration missing at least one of the following fields: voteKey, selectionKey, voteFirst, voteLast, voteKeyDilution");if(delete r.suggestedParams,Object.assign(this,function(e){const t={...e};return Object.keys(t).forEach((e=>{void 0===t[e]&&delete t[e]})),t}(r)),r.flatFee||(this.fee*=this.estimateSize(),this.fee<te&&(this.fee=te)),this.group=void 0,void 0!==r.stateProofType&&(!Number.isSafeInteger(r.stateProofType)||r.stateProofType<0))throw Error("State Proof type must be a positive number and smaller than 2^53-1");if(void 0!==r.stateProofMessage){if(r.stateProofMessage.constructor!==Uint8Array)throw Error("stateProofMessage must be a Uint8Array.")}else r.stateProofMessage=new Uint8Array(0);if(void 0!==r.stateProof){if(r.stateProof.constructor!==Uint8Array)throw Error("stateProof must be a Uint8Array.")}else r.stateProof=new Uint8Array(0)}get_obj_for_encoding(){if("pay"===this.type){const e={amt:this.amount,fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:o.lW.from(this.note),snd:o.lW.from(this.from.publicKey),type:"pay",gen:this.genesisID,gh:this.genesisHash,lx:o.lW.from(this.lease),grp:this.group};return void 0!==this.closeRemainderTo&&"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ"!==F(this.closeRemainderTo.publicKey)&&(e.close=o.lW.from(this.closeRemainderTo.publicKey)),void 0!==this.reKeyTo&&(e.rekey=o.lW.from(this.reKeyTo.publicKey)),void 0!==this.to&&(e.rcv=o.lW.from(this.to.publicKey)),e.note.length||delete e.note,e.amt||delete e.amt,e.fee||delete e.fee,e.fv||delete e.fv,e.gen||delete e.gen,void 0===e.grp&&delete e.grp,e.lx.length||delete e.lx,e.rekey||delete e.rekey,e}if("keyreg"===this.type){const e={fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:o.lW.from(this.note),snd:o.lW.from(this.from.publicKey),type:this.type,gen:this.genesisID,gh:this.genesisHash,lx:o.lW.from(this.lease),grp:this.group,votekey:this.voteKey,selkey:this.selectionKey,sprfkey:this.stateProofKey,votefst:this.voteFirst,votelst:this.voteLast,votekd:this.voteKeyDilution};return e.note.length||delete e.note,e.lx.length||delete e.lx,e.fee||delete e.fee,e.fv||delete e.fv,e.gen||delete e.gen,void 0===e.grp&&delete e.grp,void 0!==this.reKeyTo&&(e.rekey=o.lW.from(this.reKeyTo.publicKey)),this.nonParticipation&&(e.nonpart=!0),e.selkey||delete e.selkey,e.votekey||delete e.votekey,e.sprfkey||delete e.sprfkey,e.votefst||delete e.votefst,e.votelst||delete e.votelst,e.votekd||delete e.votekd,e}if("acfg"===this.type){const e={fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:o.lW.from(this.note),snd:o.lW.from(this.from.publicKey),type:this.type,gen:this.genesisID,gh:this.genesisHash,lx:o.lW.from(this.lease),grp:this.group,caid:this.assetIndex,apar:{t:this.assetTotal,df:this.assetDefaultFrozen,dc:this.assetDecimals}};return void 0!==this.assetManager&&(e.apar.m=o.lW.from(this.assetManager.publicKey)),void 0!==this.assetReserve&&(e.apar.r=o.lW.from(this.assetReserve.publicKey)),void 0!==this.assetFreeze&&(e.apar.f=o.lW.from(this.assetFreeze.publicKey)),void 0!==this.assetClawback&&(e.apar.c=o.lW.from(this.assetClawback.publicKey)),void 0!==this.assetName&&(e.apar.an=this.assetName),void 0!==this.assetUnitName&&(e.apar.un=this.assetUnitName),void 0!==this.assetURL&&(e.apar.au=this.assetURL),void 0!==this.assetMetadataHash&&(e.apar.am=o.lW.from(this.assetMetadataHash)),e.note.length||delete e.note,e.lx.length||delete e.lx,e.amt||delete e.amt,e.fee||delete e.fee,e.fv||delete e.fv,e.gen||delete e.gen,void 0!==this.reKeyTo&&(e.rekey=o.lW.from(this.reKeyTo.publicKey)),e.caid||delete e.caid,e.apar.t||e.apar.un||e.apar.an||e.apar.df||e.apar.m||e.apar.r||e.apar.f||e.apar.c||e.apar.au||e.apar.am||e.apar.dc?(e.apar.t||delete e.apar.t,e.apar.dc||delete e.apar.dc,e.apar.un||delete e.apar.un,e.apar.an||delete e.apar.an,e.apar.df||delete e.apar.df,e.apar.m||delete e.apar.m,e.apar.r||delete e.apar.r,e.apar.f||delete e.apar.f,e.apar.c||delete e.apar.c,e.apar.au||delete e.apar.au,e.apar.am||delete e.apar.am):delete e.apar,void 0===e.grp&&delete e.grp,e}if("axfer"===this.type){const e={aamt:this.amount,fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:o.lW.from(this.note),snd:o.lW.from(this.from.publicKey),arcv:o.lW.from(this.to.publicKey),type:this.type,gen:this.genesisID,gh:this.genesisHash,lx:o.lW.from(this.lease),grp:this.group,xaid:this.assetIndex};return void 0!==this.closeRemainderTo&&(e.aclose=o.lW.from(this.closeRemainderTo.publicKey)),void 0!==this.assetRevocationTarget&&(e.asnd=o.lW.from(this.assetRevocationTarget.publicKey)),e.note.length||delete e.note,e.lx.length||delete e.lx,e.aamt||delete e.aamt,e.amt||delete e.amt,e.fee||delete e.fee,e.fv||delete e.fv,e.gen||delete e.gen,void 0===e.grp&&delete e.grp,e.aclose||delete e.aclose,e.asnd||delete e.asnd,e.rekey||delete e.rekey,void 0!==this.reKeyTo&&(e.rekey=o.lW.from(this.reKeyTo.publicKey)),e}if("afrz"===this.type){const e={fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:o.lW.from(this.note),snd:o.lW.from(this.from.publicKey),type:this.type,gen:this.genesisID,gh:this.genesisHash,lx:o.lW.from(this.lease),grp:this.group,faid:this.assetIndex,afrz:this.freezeState};return void 0!==this.freezeAccount&&(e.fadd=o.lW.from(this.freezeAccount.publicKey)),e.note.length||delete e.note,e.lx.length||delete e.lx,e.amt||delete e.amt,e.fee||delete e.fee,e.fv||delete e.fv,e.gen||delete e.gen,e.afrz||delete e.afrz,void 0===e.grp&&delete e.grp,void 0!==this.reKeyTo&&(e.rekey=o.lW.from(this.reKeyTo.publicKey)),e}if("appl"===this.type){const s={fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:o.lW.from(this.note),snd:o.lW.from(this.from.publicKey),type:this.type,gen:this.genesisID,gh:this.genesisHash,lx:o.lW.from(this.lease),grp:this.group,apid:this.appIndex,apan:this.appOnComplete,apls:{nui:this.appLocalInts,nbs:this.appLocalByteSlices},apgs:{nui:this.appGlobalInts,nbs:this.appGlobalByteSlices},apfa:this.appForeignApps,apas:this.appForeignAssets,apep:this.extraPages,apbx:(e=this.boxes,t=this.appForeignApps,r=this.appIndex,null==e?[]:e.map((e=>function(e,t,r){const s=e.appIndex,n=e.name,i=0===s||s===r;let o=0;if(null!=t&&(o=t.indexOf(s)+1),0===o&&!i)throw new Error(`Box ref with appId ${s} not in foreign-apps`);return{i:o,n}}(e,t,r))))};void 0!==this.reKeyTo&&(s.rekey=o.lW.from(this.reKeyTo.publicKey)),void 0!==this.appApprovalProgram&&(s.apap=o.lW.from(this.appApprovalProgram)),void 0!==this.appClearProgram&&(s.apsu=o.lW.from(this.appClearProgram)),void 0!==this.appArgs&&(s.apaa=this.appArgs.map((e=>o.lW.from(e)))),void 0!==this.appAccounts&&(s.apat=this.appAccounts.map((e=>o.lW.from(e.publicKey)))),s.note.length||delete s.note,s.lx.length||delete s.lx,s.amt||delete s.amt,s.fee||delete s.fee,s.fv||delete s.fv,s.gen||delete s.gen,s.apid||delete s.apid,s.apls.nui||delete s.apls.nui,s.apls.nbs||delete s.apls.nbs,s.apls.nui||s.apls.nbs||delete s.apls,s.apgs.nui||delete s.apgs.nui,s.apgs.nbs||delete s.apgs.nbs,s.apaa&&s.apaa.length||delete s.apaa,s.apgs.nui||s.apgs.nbs||delete s.apgs,s.apap||delete s.apap,s.apsu||delete s.apsu,s.apan||delete s.apan,s.apfa&&s.apfa.length||delete s.apfa,s.apas&&s.apas.length||delete s.apas;for(const e of s.apbx)e.i||delete e.i,e.n&&e.n.length||delete e.n;return s.apbx&&s.apbx.length||delete s.apbx,s.apat&&s.apat.length||delete s.apat,s.apep||delete s.apep,void 0===s.grp&&delete s.grp,s}var e,t,r;if("stpf"===this.type){const e={fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:o.lW.from(this.note),snd:o.lW.from(this.from.publicKey),type:this.type,gen:this.genesisID,gh:this.genesisHash,lx:o.lW.from(this.lease),sptype:this.stateProofType,spmsg:o.lW.from(this.stateProofMessage),sp:o.lW.from(this.stateProof)};return e.sptype||delete e.sptype,e.note.length||delete e.note,e.lx.length||delete e.lx,e.amt||delete e.amt,e.fee||delete e.fee,e.fv||delete e.fv,e.gen||delete e.gen,e.apid||delete e.apid,e.apaa&&e.apaa.length||delete e.apaa,e.apap||delete e.apap,e.apsu||delete e.apsu,e.apan||delete e.apan,e.apfa&&e.apfa.length||delete e.apfa,e.apas&&e.apas.length||delete e.apas,e.apat&&e.apat.length||delete e.apat,e.apep||delete e.apep,void 0===e.grp&&delete e.grp,e}}static from_obj_for_encoding(e){const t=Object.create(this.prototype);if(t.name="Transaction",t.tag=o.lW.from("TX"),t.genesisID=e.gen,t.genesisHash=o.lW.from(e.gh),(r=e.type)!==Q.pay&&r!==Q.keyreg&&r!==Q.acfg&&r!==Q.axfer&&r!==Q.afrz&&r!==Q.appl&&r!==Q.stpf)throw new Error(`Unrecognized transaction type: ${e.type}`);var r;return t.type=e.type,t.fee=e.fee,t.firstRound=e.fv,t.lastRound=e.lv,t.note=new Uint8Array(e.note),t.lease=new Uint8Array(e.lx),t.from=W(F(new Uint8Array(e.snd))),void 0!==e.grp&&(t.group=o.lW.from(e.grp)),void 0!==e.rekey&&(t.reKeyTo=W(F(new Uint8Array(e.rekey)))),"pay"===e.type?(t.amount=e.amt,t.to=W(F(new Uint8Array(e.rcv))),void 0!==e.close&&(t.closeRemainderTo=W(F(e.close)))):"keyreg"===e.type?(void 0!==e.votekey&&(t.voteKey=o.lW.from(e.votekey)),void 0!==e.selkey&&(t.selectionKey=o.lW.from(e.selkey)),void 0!==e.sprfkey&&(t.stateProofKey=o.lW.from(e.sprfkey)),void 0!==e.votekd&&(t.voteKeyDilution=e.votekd),void 0!==e.votefst&&(t.voteFirst=e.votefst),void 0!==e.votelst&&(t.voteLast=e.votelst),void 0!==e.nonpart&&(t.nonParticipation=e.nonpart)):"acfg"===e.type?(void 0!==e.caid&&(t.assetIndex=e.caid),void 0!==e.apar&&(t.assetTotal=e.apar.t,t.assetDefaultFrozen=e.apar.df,void 0!==e.apar.dc&&(t.assetDecimals=e.apar.dc),void 0!==e.apar.m&&(t.assetManager=W(F(new Uint8Array(e.apar.m)))),void 0!==e.apar.r&&(t.assetReserve=W(F(new Uint8Array(e.apar.r)))),void 0!==e.apar.f&&(t.assetFreeze=W(F(new Uint8Array(e.apar.f)))),void 0!==e.apar.c&&(t.assetClawback=W(F(new Uint8Array(e.apar.c)))),void 0!==e.apar.un&&(t.assetUnitName=e.apar.un),void 0!==e.apar.an&&(t.assetName=e.apar.an),void 0!==e.apar.au&&(t.assetURL=e.apar.au),void 0!==e.apar.am&&(t.assetMetadataHash=e.apar.am))):"axfer"===e.type?(void 0!==e.xaid&&(t.assetIndex=e.xaid),void 0!==e.aamt&&(t.amount=e.aamt),void 0!==e.aclose&&(t.closeRemainderTo=W(F(new Uint8Array(e.aclose)))),void 0!==e.asnd&&(t.assetRevocationTarget=W(F(new Uint8Array(e.asnd)))),t.to=W(F(new Uint8Array(e.arcv)))):"afrz"===e.type?(void 0!==e.afrz&&(t.freezeState=e.afrz),void 0!==e.faid&&(t.assetIndex=e.faid),t.freezeAccount=W(F(new Uint8Array(e.fadd)))):"appl"===e.type?(void 0!==e.apid&&(t.appIndex=e.apid),void 0!==e.apan&&(t.appOnComplete=e.apan),void 0!==e.apls&&(void 0!==e.apls.nui&&(t.appLocalInts=e.apls.nui),void 0!==e.apls.nbs&&(t.appLocalByteSlices=e.apls.nbs)),void 0!==e.apgs&&(void 0!==e.apgs.nui&&(t.appGlobalInts=e.apgs.nui),void 0!==e.apgs.nbs&&(t.appGlobalByteSlices=e.apgs.nbs)),void 0!==e.apep&&(t.extraPages=e.apep),void 0!==e.apap&&(t.appApprovalProgram=new Uint8Array(e.apap)),void 0!==e.apsu&&(t.appClearProgram=new Uint8Array(e.apsu)),void 0!==e.apaa&&(t.appArgs=e.apaa.map((e=>new Uint8Array(e)))),void 0!==e.apat&&(t.appAccounts=e.apat.map((e=>W(F(new Uint8Array(e)))))),void 0!==e.apfa&&(t.appForeignApps=e.apfa),void 0!==e.apas&&(t.appForeignAssets=e.apas),void 0!==e.apbx&&(t.boxes=e.apbx.map((e=>({appIndex:e.i?t.appForeignApps[e.i-1]:0,name:e.n}))))):"stpf"===e.type&&(void 0!==e.sptype&&(t.stateProofType=e.sptype),void 0!==e.sp&&(t.stateProof=e.sp),void 0!==e.spmsg&&(t.stateProofMessage=e.spmsg)),t}estimateSize(){return this.toByte().length+75}bytesToSign(){const e=this.toByte();return o.lW.from(m(this.tag,e))}toByte(){return X(this.get_obj_for_encoding())}rawSignTxn(e){const t=x(this.bytesToSign(),e);return o.lW.from(t)}signTxn(e){const t={sig:this.rawSignTxn(e),txn:this.get_obj_for_encoding()},r=v(e).publicKey;return F(r)!==F(this.from.publicKey)&&(t.sgnr=o.lW.from(r)),new Uint8Array(X(t))}attachSignature(e,t){if(!b(t.length))throw new Error("Invalid signature length");const r={sig:o.lW.from(t),txn:this.get_obj_for_encoding()};if(e!==F(this.from.publicKey)){const t=W(e).publicKey;r.sgnr=o.lW.from(t)}return new Uint8Array(X(r))}rawTxID(){const e=this.toByte(),t=o.lW.from(m(this.tag,e));return o.lW.from(y(t))}txID(){const e=this.rawTxID();return T().encode(e).slice(0,52)}addLease(e,t=0){let r;if(void 0!==e){if(e.constructor!==Uint8Array)throw Error("lease must be a Uint8Array.");if(32!==e.length)throw Error(`lease must be of length ${32..toString()}.`);r=new Uint8Array(e)}else r=new Uint8Array(0);this.lease=r,0!==t&&(this.fee+=37*t)}addRekey(e,t=0){void 0!==e&&(this.reKeyTo=W(e)),0!==t&&(this.fee+=37*t)}_getDictForDisplay(){const e={...this};return e.tag=e.tag.toString(),e.from=F(e.from.publicKey),void 0!==e.to&&(e.to=F(e.to.publicKey)),void 0!==e.freezeAccount&&(e.freezeAccount=F(e.freezeAccount.publicKey)),void 0!==e.closeRemainderTo&&(e.closeRemainderTo=F(e.closeRemainderTo.publicKey)),void 0!==e.assetManager&&(e.assetManager=F(e.assetManager.publicKey)),void 0!==e.assetReserve&&(e.assetReserve=F(e.assetReserve.publicKey)),void 0!==e.assetFreeze&&(e.assetFreeze=F(e.assetFreeze.publicKey)),void 0!==e.assetClawback&&(e.assetClawback=F(e.assetClawback.publicKey)),void 0!==e.assetRevocationTarget&&(e.assetRevocationTarget=F(e.assetRevocationTarget.publicKey)),void 0!==e.reKeyTo&&(e.reKeyTo=F(e.reKeyTo.publicKey)),e.genesisHash=e.genesisHash.toString("base64"),e}prettyPrint(){console.log(this._getDictForDisplay())}toString(){return JSON.stringify(this._getDictForDisplay())}}function ne(e){return X({txn:e.get_obj_for_encoding()})}function ie(e){return X(e.get_obj_for_encoding())}function oe(e){const t=Z(e);return se.from_obj_for_encoding(t)}function ae(e){const t=Z(e);return{...t,txn:se.from_obj_for_encoding(t.txn)}}function ce(e){return e instanceof se?e:new se(e)}class ue{constructor({bidderKey:e,bidAmount:t,bidID:r,auctionKey:s,auctionID:n,maxPrice:i}){this.name="Bid",this.tag=o.lW.from([97,66]);const a=W(e),c=W(s);if(!Number.isSafeInteger(t)||t<0)throw Error("Bid amount must be positive and 2^53-1");if(!Number.isSafeInteger(r)||r<0)throw Error("BidID must be positive and 2^53-1");if(!Number.isSafeInteger(n)||n<0)throw Error("auctionID must be positive");Object.assign(this,{bidderKey:a,bidAmount:t,bidID:r,auctionKey:c,auctionID:n,maxPrice:i})}get_obj_for_encoding(){return{bidder:o.lW.from(this.bidderKey.publicKey),cur:this.bidAmount,price:this.maxPrice,id:this.bidID,auc:o.lW.from(this.auctionKey.publicKey),aid:this.auctionID}}signBid(e){const t=X(this.get_obj_for_encoding()),r=x(o.lW.from(m(this.tag,t)),e),s={sig:o.lW.from(r),bid:this.get_obj_for_encoding()};return new Uint8Array(X({t:"b",b:s}))}}const le=1e6,de="Microalgos should be positive and less than 2^53 - 1.";function he(e){if(e<0||!Number.isSafeInteger(e))throw new Error(de);return e/le}function pe(e){const t=e*le;return Math.round(t)}class fe extends Error{constructor(e,t){super(e),this.response=t,this.name="URLTokenBaseHTTPError",this.response=t}}class ge{constructor(e,t,r,s={}){this.defaultHeaders=s;const n=t.endsWith("/")?t:`${t}/`,i=new URL(n);if(void 0!==r&&(i.port=r.toString()),0===i.protocol.length)throw new Error("Invalid base server URL, protocol must be defined.");this.baseURL=i,this.tokenHeader=e}getURL(e,t){let r;r=e.startsWith("./")?e:e.startsWith("/")?`.${e}`:`./${e}`;const s=new URL(r,this.baseURL);if(t)for(const[e,r]of Object.entries(t))s.searchParams.set(e,r);return s.toString()}static formatFetchResponseHeaders(e){const t={};return e.forEach(((e,r)=>{t[e]=r})),t}static async checkHttpError(e){if(e.ok)return;let t=null,r=null;try{t=new Uint8Array(await e.arrayBuffer());const s=JSON.parse(o.lW.from(t).toString());s.message&&(r=s.message)}catch(e){}let s=`Network request error. Received status ${e.status} (${e.statusText})`;throw r&&(s+=`: ${r}`),new fe(s,{body:t,status:e.status,headers:ge.formatFetchResponseHeaders(e.headers)})}static async formatFetchResponse(e){return await this.checkHttpError(e),{body:new Uint8Array(await e.arrayBuffer()),status:e.status,headers:ge.formatFetchResponseHeaders(e.headers)}}async get(e,t,r={}){const s={...this.tokenHeader,...this.defaultHeaders,...r},n=await fetch(this.getURL(e,t),{headers:s});return ge.formatFetchResponse(n)}async post(e,t,r,s={}){const n={...this.tokenHeader,...this.defaultHeaders,...s},i=await fetch(this.getURL(e,r),{method:"POST",body:t,headers:n});return ge.formatFetchResponse(i)}async delete(e,t,r,s={}){const n={...this.tokenHeader,...this.defaultHeaders,...s},i=await fetch(this.getURL(e,r),{method:"DELETE",body:t,headers:n});return ge.formatFetchResponse(i)}}function me(e){return Object.keys(e).reduce(((t,r)=>(t[r.toLowerCase()]=e[r],t)),{})}class ye{constructor(e,t,r,s={}){this.bc=void 0!==t?new ge(e,t,r,s):e}static parseJSON(e,t,r={}){try{return 0===Object.keys(r).length?e&&JSON.parse(e):e&&function(e,t){const r=t&&t.intDecoding?t.intDecoding:p.DEFAULT;return f.parse(e,((e,t)=>{if(null!=t&&"object"==typeof t&&null==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,Object.prototype),"bigint"==typeof t){if("safe"===r&&t>Number.MAX_SAFE_INTEGER)throw new Error(`Integer exceeds maximum safe integer: ${t.toString()}. Try parsing with a different intDecoding option.`);return"bigint"===r||"mixed"===r&&t>Number.MAX_SAFE_INTEGER?t:Number(t)}return"number"==typeof t&&"bigint"===r&&Number.isInteger(t)?BigInt(t):t}))}(e,r)}catch(r){const s=r;throw s.rawResponse=e||null,s.statusCode=t,s}}static serializeData(e,t){if(!e)return new Uint8Array(0);if("application/json"===t["content-type"])return new Uint8Array(o.lW.from(JSON.stringify(e)));if("string"==typeof e)return new Uint8Array(o.lW.from(e));if(e instanceof Uint8Array)return e;throw new Error("provided data is neither a string nor a Uint8Array and content-type is not application/json")}static prepareResponse(e,t,r,s={}){let n,{body:i}=e;return"application/msgpack"!==t&&(n=i&&o.lW.from(i).toString()||""),r&&"application/json"===t&&(i=ye.parseJSON(n,e.status,s)),{...e,body:i,text:n,ok:2===Math.trunc(e.status/100)}}static prepareResponseError(e){return e.response&&(e.response=ye.prepareResponse(e.response,"application/json",!0),e.status=e.response.status),e}async get(e,t,r={},s={},n=!0){const i=function(e){return void 0!==e&&Object.prototype.hasOwnProperty.call(e,"format")&&"msgpack"===e.format?"application/msgpack":"application/json"}(t),o={...r,accept:i};try{const r=await this.bc.get(e,function(e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(e[t]&&0!==e[t].length||delete e[t]);return e}(t),o);return ye.prepareResponse(r,i,n,s)}catch(e){throw ye.prepareResponseError(e)}}async post(e,t,r={},s,n=!0){const i={"content-type":"application/json",...me(r)};try{const r=await this.bc.post(e,ye.serializeData(t,i),s,i);return ye.prepareResponse(r,"application/json",n)}catch(e){throw ye.prepareResponseError(e)}}async delete(e,t,r={},s=!0){const n={"content-type":"application/json",...me(r)},i=await this.bc.delete(e,ye.serializeData(t,n),void 0,n);return ye.prepareResponse(i,"application/json",s)}}class we{constructor(e,t,r,s,n={}){if("function"==typeof t.get)this.c=new ye(t);else{let i;i="string"==typeof t?function(e="",t){const r={};return""===e||(r[t]=e),r}(t,e):t,this.c=new ye(i,r,s,n)}this.intDecoding=p.DEFAULT}setIntEncoding(e){this.intDecoding=e}getIntEncoding(){return this.intDecoding}}function be(e,t){let r;if(e instanceof Uint8Array)r=t?e:o.lW.from(e).toString("base64");else if("function"==typeof e.get_obj_for_encoding)r=e.get_obj_for_encoding(t);else if(Array.isArray(e)){r=[];for(const s of e)r.push(be(s,t))}else if("object"==typeof e){const s={};for(const r of Object.keys(e))s[r]=be(e[r],t);r=s}else{if(!function(e){return void 0===e||null==e||"object"!=typeof e&&"function"!=typeof e}(e))throw new Error(`Unsupported value: ${String(e)}`);r=e}return r}class ve{get_obj_for_encoding(e=!1){const t={};for(const r of Object.keys(this.attribute_map)){const s=this.attribute_map[r],n=this[r];void 0!==n&&(t[s]=null===n?null:be(n,e))}return t}}class xe extends ve{constructor({address:e,amount:t,amountWithoutPendingRewards:r,minBalance:s,pendingRewards:n,rewards:i,round:o,status:a,totalAppsOptedIn:c,totalAssetsOptedIn:u,totalCreatedApps:l,totalCreatedAssets:d,appsLocalState:h,appsTotalExtraPages:p,appsTotalSchema:f,assets:g,authAddr:m,createdApps:y,createdAssets:w,incentiveEligible:b,lastHeartbeat:v,lastProposed:x,participation:_,rewardBase:A,sigType:E,totalBoxBytes:k,totalBoxes:S}){super(),this.address=e,this.amount=t,this.amountWithoutPendingRewards=r,this.minBalance=s,this.pendingRewards=n,this.rewards=i,this.round=o,this.status=a,this.totalAppsOptedIn=c,this.totalAssetsOptedIn=u,this.totalCreatedApps=l,this.totalCreatedAssets=d,this.appsLocalState=h,this.appsTotalExtraPages=p,this.appsTotalSchema=f,this.assets=g,this.authAddr=m,this.createdApps=y,this.createdAssets=w,this.incentiveEligible=b,this.lastHeartbeat=v,this.lastProposed=x,this.participation=_,this.rewardBase=A,this.sigType=E,this.totalBoxBytes=k,this.totalBoxes=S,this.attribute_map={address:"address",amount:"amount",amountWithoutPendingRewards:"amount-without-pending-rewards",minBalance:"min-balance",pendingRewards:"pending-rewards",rewards:"rewards",round:"round",status:"status",totalAppsOptedIn:"total-apps-opted-in",totalAssetsOptedIn:"total-assets-opted-in",totalCreatedApps:"total-created-apps",totalCreatedAssets:"total-created-assets",appsLocalState:"apps-local-state",appsTotalExtraPages:"apps-total-extra-pages",appsTotalSchema:"apps-total-schema",assets:"assets",authAddr:"auth-addr",createdApps:"created-apps",createdAssets:"created-assets",incentiveEligible:"incentive-eligible",lastHeartbeat:"last-heartbeat",lastProposed:"last-proposed",participation:"participation",rewardBase:"reward-base",sigType:"sig-type",totalBoxBytes:"total-box-bytes",totalBoxes:"total-boxes"}}static from_obj_for_encoding(e){if(void 0===e.address)throw new Error(`Response is missing required field 'address': ${e}`);if(void 0===e.amount)throw new Error(`Response is missing required field 'amount': ${e}`);if(void 0===e["amount-without-pending-rewards"])throw new Error(`Response is missing required field 'amount-without-pending-rewards': ${e}`);if(void 0===e["min-balance"])throw new Error(`Response is missing required field 'min-balance': ${e}`);if(void 0===e["pending-rewards"])throw new Error(`Response is missing required field 'pending-rewards': ${e}`);if(void 0===e.rewards)throw new Error(`Response is missing required field 'rewards': ${e}`);if(void 0===e.round)throw new Error(`Response is missing required field 'round': ${e}`);if(void 0===e.status)throw new Error(`Response is missing required field 'status': ${e}`);if(void 0===e["total-apps-opted-in"])throw new Error(`Response is missing required field 'total-apps-opted-in': ${e}`);if(void 0===e["total-assets-opted-in"])throw new Error(`Response is missing required field 'total-assets-opted-in': ${e}`);if(void 0===e["total-created-apps"])throw new Error(`Response is missing required field 'total-created-apps': ${e}`);if(void 0===e["total-created-assets"])throw new Error(`Response is missing required field 'total-created-assets': ${e}`);return new xe({address:e.address,amount:e.amount,amountWithoutPendingRewards:e["amount-without-pending-rewards"],minBalance:e["min-balance"],pendingRewards:e["pending-rewards"],rewards:e.rewards,round:e.round,status:e.status,totalAppsOptedIn:e["total-apps-opted-in"],totalAssetsOptedIn:e["total-assets-opted-in"],totalCreatedApps:e["total-created-apps"],totalCreatedAssets:e["total-created-assets"],appsLocalState:void 0!==e["apps-local-state"]?e["apps-local-state"].map(je.from_obj_for_encoding):void 0,appsTotalExtraPages:e["apps-total-extra-pages"],appsTotalSchema:void 0!==e["apps-total-schema"]?Ce.from_obj_for_encoding(e["apps-total-schema"]):void 0,assets:void 0!==e.assets?e.assets.map(Oe.from_obj_for_encoding):void 0,authAddr:e["auth-addr"],createdApps:void 0!==e["created-apps"]?e["created-apps"].map(Ie.from_obj_for_encoding):void 0,createdAssets:void 0!==e["created-assets"]?e["created-assets"].map(De.from_obj_for_encoding):void 0,incentiveEligible:e["incentive-eligible"],lastHeartbeat:e["last-heartbeat"],lastProposed:e["last-proposed"],participation:void 0!==e.participation?Se.from_obj_for_encoding(e.participation):void 0,rewardBase:e["reward-base"],sigType:e["sig-type"],totalBoxBytes:e["total-box-bytes"],totalBoxes:e["total-boxes"]})}}class _e extends ve{constructor({round:e,appLocalState:t,createdApp:r}){super(),this.round=e,this.appLocalState=t,this.createdApp=r,this.attribute_map={round:"round",appLocalState:"app-local-state",createdApp:"created-app"}}static from_obj_for_encoding(e){if(void 0===e.round)throw new Error(`Response is missing required field 'round': ${e}`);return new _e({round:e.round,appLocalState:void 0!==e["app-local-state"]?je.from_obj_for_encoding(e["app-local-state"]):void 0,createdApp:void 0!==e["created-app"]?qe.from_obj_for_encoding(e["created-app"]):void 0})}}class Ae extends ve{constructor({assetHolding:e,assetParams:t}){super(),this.assetHolding=e,this.assetParams=t,this.attribute_map={assetHolding:"asset-holding",assetParams:"asset-params"}}static from_obj_for_encoding(e){if(void 0===e["asset-holding"])throw new Error(`Response is missing required field 'asset-holding': ${e}`);return new Ae({assetHolding:Oe.from_obj_for_encoding(e["asset-holding"]),assetParams:void 0!==e["asset-params"]?Me.from_obj_for_encoding(e["asset-params"]):void 0})}}class Ee extends ve{constructor({round:e,assetHolding:t,createdAsset:r}){super(),this.round=e,this.assetHolding=t,this.createdAsset=r,this.attribute_map={round:"round",assetHolding:"asset-holding",createdAsset:"created-asset"}}static from_obj_for_encoding(e){if(void 0===e.round)throw new Error(`Response is missing required field 'round': ${e}`);return new Ee({round:e.round,assetHolding:void 0!==e["asset-holding"]?Oe.from_obj_for_encoding(e["asset-holding"]):void 0,createdAsset:void 0!==e["created-asset"]?Me.from_obj_for_encoding(e["created-asset"]):void 0})}}class ke extends ve{constructor({round:e,assetHoldings:t,nextToken:r}){super(),this.round=e,this.assetHoldings=t,this.nextToken=r,this.attribute_map={round:"round",assetHoldings:"asset-holdings",nextToken:"next-token"}}static from_obj_for_encoding(e){if(void 0===e.round)throw new Error(`Response is missing required field 'round': ${e}`);return new ke({round:e.round,assetHoldings:void 0!==e["asset-holdings"]?e["asset-holdings"].map(Ae.from_obj_for_encoding):void 0,nextToken:e["next-token"]})}}class Se extends ve{constructor({selectionParticipationKey:e,voteFirstValid:t,voteKeyDilution:r,voteLastValid:s,voteParticipationKey:n,stateProofKey:i}){super(),this.selectionParticipationKey="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.voteFirstValid=t,this.voteKeyDilution=r,this.voteLastValid=s,this.voteParticipationKey="string"==typeof n?new Uint8Array(o.lW.from(n,"base64")):n,this.stateProofKey="string"==typeof i?new Uint8Array(o.lW.from(i,"base64")):i,this.attribute_map={selectionParticipationKey:"selection-participation-key",voteFirstValid:"vote-first-valid",voteKeyDilution:"vote-key-dilution",voteLastValid:"vote-last-valid",voteParticipationKey:"vote-participation-key",stateProofKey:"state-proof-key"}}static from_obj_for_encoding(e){if(void 0===e["selection-participation-key"])throw new Error(`Response is missing required field 'selection-participation-key': ${e}`);if(void 0===e["vote-first-valid"])throw new Error(`Response is missing required field 'vote-first-valid': ${e}`);if(void 0===e["vote-key-dilution"])throw new Error(`Response is missing required field 'vote-key-dilution': ${e}`);if(void 0===e["vote-last-valid"])throw new Error(`Response is missing required field 'vote-last-valid': ${e}`);if(void 0===e["vote-participation-key"])throw new Error(`Response is missing required field 'vote-participation-key': ${e}`);return new Se({selectionParticipationKey:e["selection-participation-key"],voteFirstValid:e["vote-first-valid"],voteKeyDilution:e["vote-key-dilution"],voteLastValid:e["vote-last-valid"],voteParticipationKey:e["vote-participation-key"],stateProofKey:e["state-proof-key"]})}}class Re extends ve{constructor({address:e,delta:t}){super(),this.address=e,this.delta=t,this.attribute_map={address:"address",delta:"delta"}}static from_obj_for_encoding(e){if(void 0===e.address)throw new Error(`Response is missing required field 'address': ${e}`);if(!Array.isArray(e.delta))throw new Error(`Response is missing required array field 'delta': ${e}`);return new Re({address:e.address,delta:e.delta.map(at.from_obj_for_encoding)})}}class Te extends ve{constructor({applicationIndex:e,logs:t,txid:r}){super(),this.applicationIndex=e,this.logs=t,this.txid=r,this.attribute_map={applicationIndex:"application-index",logs:"logs",txid:"txId"}}static from_obj_for_encoding(e){if(void 0===e["application-index"])throw new Error(`Response is missing required field 'application-index': ${e}`);if(!Array.isArray(e.logs))throw new Error(`Response is missing required array field 'logs': ${e}`);if(void 0===e.txId)throw new Error(`Response is missing required field 'txId': ${e}`);return new Te({applicationIndex:e["application-index"],logs:e.logs,txid:e.txId})}}class Ie extends ve{constructor({id:e,params:t}){super(),this.id=e,this.params=t,this.attribute_map={id:"id",params:"params"}}static from_obj_for_encoding(e){if(void 0===e.id)throw new Error(`Response is missing required field 'id': ${e}`);if(void 0===e.params)throw new Error(`Response is missing required field 'params': ${e}`);return new Ie({id:e.id,params:qe.from_obj_for_encoding(e.params)})}}class Be extends ve{constructor({id:e,appBoxes:t,appGlobals:r,appLocals:s}){super(),this.id=e,this.appBoxes=t,this.appGlobals=r,this.appLocals=s,this.attribute_map={id:"id",appBoxes:"app-boxes",appGlobals:"app-globals",appLocals:"app-locals"}}static from_obj_for_encoding(e){if(void 0===e.id)throw new Error(`Response is missing required field 'id': ${e}`);return new Be({id:e.id,appBoxes:void 0!==e["app-boxes"]?Ue.from_obj_for_encoding(e["app-boxes"]):void 0,appGlobals:void 0!==e["app-globals"]?Ue.from_obj_for_encoding(e["app-globals"]):void 0,appLocals:void 0!==e["app-locals"]?e["app-locals"].map(Ue.from_obj_for_encoding):void 0})}}class Ue extends ve{constructor({kvs:e,account:t}){super(),this.kvs=e,this.account=t,this.attribute_map={kvs:"kvs",account:"account"}}static from_obj_for_encoding(e){if(!Array.isArray(e.kvs))throw new Error(`Response is missing required array field 'kvs': ${e}`);return new Ue({kvs:e.kvs.map(Ne.from_obj_for_encoding),account:e.account})}}class Pe extends ve{constructor({account:e,app:t}){super(),this.account=e,this.app=t,this.attribute_map={account:"account",app:"app"}}static from_obj_for_encoding(e){if(void 0===e.account)throw new Error(`Response is missing required field 'account': ${e}`);if(void 0===e.app)throw new Error(`Response is missing required field 'app': ${e}`);return new Pe({account:e.account,app:e.app})}}class je extends ve{constructor({id:e,schema:t,keyValue:r}){super(),this.id=e,this.schema=t,this.keyValue=r,this.attribute_map={id:"id",schema:"schema",keyValue:"key-value"}}static from_obj_for_encoding(e){if(void 0===e.id)throw new Error(`Response is missing required field 'id': ${e}`);if(void 0===e.schema)throw new Error(`Response is missing required field 'schema': ${e}`);return new je({id:e.id,schema:Ce.from_obj_for_encoding(e.schema),keyValue:void 0!==e["key-value"]?e["key-value"].map(Pt.from_obj_for_encoding):void 0})}}class qe extends ve{constructor({approvalProgram:e,clearStateProgram:t,creator:r,extraProgramPages:s,globalState:n,globalStateSchema:i,localStateSchema:a}){super(),this.approvalProgram="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.clearStateProgram="string"==typeof t?new Uint8Array(o.lW.from(t,"base64")):t,this.creator=r,this.extraProgramPages=s,this.globalState=n,this.globalStateSchema=i,this.localStateSchema=a,this.attribute_map={approvalProgram:"approval-program",clearStateProgram:"clear-state-program",creator:"creator",extraProgramPages:"extra-program-pages",globalState:"global-state",globalStateSchema:"global-state-schema",localStateSchema:"local-state-schema"}}static from_obj_for_encoding(e){if(void 0===e["approval-program"])throw new Error(`Response is missing required field 'approval-program': ${e}`);if(void 0===e["clear-state-program"])throw new Error(`Response is missing required field 'clear-state-program': ${e}`);if(void 0===e.creator)throw new Error(`Response is missing required field 'creator': ${e}`);return new qe({approvalProgram:e["approval-program"],clearStateProgram:e["clear-state-program"],creator:e.creator,extraProgramPages:e["extra-program-pages"],globalState:void 0!==e["global-state"]?e["global-state"].map(Pt.from_obj_for_encoding):void 0,globalStateSchema:void 0!==e["global-state-schema"]?Ce.from_obj_for_encoding(e["global-state-schema"]):void 0,localStateSchema:void 0!==e["local-state-schema"]?Ce.from_obj_for_encoding(e["local-state-schema"]):void 0})}}class $e extends ve{constructor({appStateType:e,key:t,operation:r,account:s,newValue:n}){super(),this.appStateType=e,this.key="string"==typeof t?new Uint8Array(o.lW.from(t,"base64")):t,this.operation=r,this.account=s,this.newValue=n,this.attribute_map={appStateType:"app-state-type",key:"key",operation:"operation",account:"account",newValue:"new-value"}}static from_obj_for_encoding(e){if(void 0===e["app-state-type"])throw new Error(`Response is missing required field 'app-state-type': ${e}`);if(void 0===e.key)throw new Error(`Response is missing required field 'key': ${e}`);if(void 0===e.operation)throw new Error(`Response is missing required field 'operation': ${e}`);return new $e({appStateType:e["app-state-type"],key:e.key,operation:e.operation,account:e.account,newValue:void 0!==e["new-value"]?We.from_obj_for_encoding(e["new-value"]):void 0})}}class Ce extends ve{constructor({numUint:e,numByteSlice:t}){super(),this.numUint=e,this.numByteSlice=t,this.attribute_map={numUint:"num-uint",numByteSlice:"num-byte-slice"}}static from_obj_for_encoding(e){if(void 0===e["num-uint"])throw new Error(`Response is missing required field 'num-uint': ${e}`);if(void 0===e["num-byte-slice"])throw new Error(`Response is missing required field 'num-byte-slice': ${e}`);return new Ce({numUint:e["num-uint"],numByteSlice:e["num-byte-slice"]})}}class De extends ve{constructor({index:e,params:t}){super(),this.index=e,this.params=t,this.attribute_map={index:"index",params:"params"}}static from_obj_for_encoding(e){if(void 0===e.index)throw new Error(`Response is missing required field 'index': ${e}`);if(void 0===e.params)throw new Error(`Response is missing required field 'params': ${e}`);return new De({index:e.index,params:Me.from_obj_for_encoding(e.params)})}}class Oe extends ve{constructor({amount:e,assetId:t,isFrozen:r}){super(),this.amount=e,this.assetId=t,this.isFrozen=r,this.attribute_map={amount:"amount",assetId:"asset-id",isFrozen:"is-frozen"}}static from_obj_for_encoding(e){if(void 0===e.amount)throw new Error(`Response is missing required field 'amount': ${e}`);if(void 0===e["asset-id"])throw new Error(`Response is missing required field 'asset-id': ${e}`);if(void 0===e["is-frozen"])throw new Error(`Response is missing required field 'is-frozen': ${e}`);return new Oe({amount:e.amount,assetId:e["asset-id"],isFrozen:e["is-frozen"]})}}class Le extends ve{constructor({account:e,asset:t}){super(),this.account=e,this.asset=t,this.attribute_map={account:"account",asset:"asset"}}static from_obj_for_encoding(e){if(void 0===e.account)throw new Error(`Response is missing required field 'account': ${e}`);if(void 0===e.asset)throw new Error(`Response is missing required field 'asset': ${e}`);return new Le({account:e.account,asset:e.asset})}}class Me extends ve{constructor({creator:e,decimals:t,total:r,clawback:s,defaultFrozen:n,freeze:i,manager:a,metadataHash:c,name:u,nameB64:l,reserve:d,unitName:h,unitNameB64:p,url:f,urlB64:g}){super(),this.creator=e,this.decimals=t,this.total=r,this.clawback=s,this.defaultFrozen=n,this.freeze=i,this.manager=a,this.metadataHash="string"==typeof c?new Uint8Array(o.lW.from(c,"base64")):c,this.name=u,this.nameB64="string"==typeof l?new Uint8Array(o.lW.from(l,"base64")):l,this.reserve=d,this.unitName=h,this.unitNameB64="string"==typeof p?new Uint8Array(o.lW.from(p,"base64")):p,this.url=f,this.urlB64="string"==typeof g?new Uint8Array(o.lW.from(g,"base64")):g,this.attribute_map={creator:"creator",decimals:"decimals",total:"total",clawback:"clawback",defaultFrozen:"default-frozen",freeze:"freeze",manager:"manager",metadataHash:"metadata-hash",name:"name",nameB64:"name-b64",reserve:"reserve",unitName:"unit-name",unitNameB64:"unit-name-b64",url:"url",urlB64:"url-b64"}}static from_obj_for_encoding(e){if(void 0===e.creator)throw new Error(`Response is missing required field 'creator': ${e}`);if(void 0===e.decimals)throw new Error(`Response is missing required field 'decimals': ${e}`);if(void 0===e.total)throw new Error(`Response is missing required field 'total': ${e}`);return new Me({creator:e.creator,decimals:e.decimals,total:e.total,clawback:e.clawback,defaultFrozen:e["default-frozen"],freeze:e.freeze,manager:e.manager,metadataHash:e["metadata-hash"],name:e.name,nameB64:e["name-b64"],reserve:e.reserve,unitName:e["unit-name"],unitNameB64:e["unit-name-b64"],url:e.url,urlB64:e["url-b64"]})}}class Ne extends ve{constructor({key:e,value:t}){super(),this.key="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.value=t,this.attribute_map={key:"key",value:"value"}}static from_obj_for_encoding(e){if(void 0===e.key)throw new Error(`Response is missing required field 'key': ${e}`);if(void 0===e.value)throw new Error(`Response is missing required field 'value': ${e}`);return new Ne({key:e.key,value:We.from_obj_for_encoding(e.value)})}}class We extends ve{constructor({type:e,bytes:t,uint:r}){super(),this.type=e,this.bytes="string"==typeof t?new Uint8Array(o.lW.from(t,"base64")):t,this.uint=r,this.attribute_map={type:"type",bytes:"bytes",uint:"uint"}}static from_obj_for_encoding(e){if(void 0===e.type)throw new Error(`Response is missing required field 'type': ${e}`);return new We({type:e.type,bytes:e.bytes,uint:e.uint})}}class Ke extends ve{constructor({blockhash:e}){super(),this.blockhash=e,this.attribute_map={blockhash:"blockHash"}}static from_obj_for_encoding(e){if(void 0===e.blockHash)throw new Error(`Response is missing required field 'blockHash': ${e}`);return new Ke({blockhash:e.blockHash})}}class Fe extends ve{constructor({logs:e}){super(),this.logs=e,this.attribute_map={logs:"logs"}}static from_obj_for_encoding(e){if(!Array.isArray(e.logs))throw new Error(`Response is missing required array field 'logs': ${e}`);return new Fe({logs:e.logs.map(Te.from_obj_for_encoding)})}}class ze extends ve{constructor({block:e,cert:t}){super(),this.block=e,this.cert=t,this.attribute_map={block:"block",cert:"cert"}}static from_obj_for_encoding(e){if(void 0===e.block)throw new Error(`Response is missing required field 'block': ${e}`);return new ze({block:e.block,cert:e.cert})}}class Ve extends ve{constructor({blocktxids:e}){super(),this.blocktxids=e,this.attribute_map={blocktxids:"blockTxids"}}static from_obj_for_encoding(e){if(!Array.isArray(e.blockTxids))throw new Error(`Response is missing required array field 'blockTxids': ${e}`);return new Ve({blocktxids:e.blockTxids})}}class He extends ve{constructor({name:e,round:t,value:r}){super(),this.name="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.round=t,this.value="string"==typeof r?new Uint8Array(o.lW.from(r,"base64")):r,this.attribute_map={name:"name",round:"round",value:"value"}}static from_obj_for_encoding(e){if(void 0===e.name)throw new Error(`Response is missing required field 'name': ${e}`);if(void 0===e.round)throw new Error(`Response is missing required field 'round': ${e}`);if(void 0===e.value)throw new Error(`Response is missing required field 'value': ${e}`);return new He({name:e.name,round:e.round,value:e.value})}}class Ge extends ve{constructor({name:e}){super(),this.name="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.attribute_map={name:"name"}}static from_obj_for_encoding(e){if(void 0===e.name)throw new Error(`Response is missing required field 'name': ${e}`);return new Ge({name:e.name})}}class Ye extends ve{constructor({app:e,name:t}){super(),this.app=e,this.name="string"==typeof t?new Uint8Array(o.lW.from(t,"base64")):t,this.attribute_map={app:"app",name:"name"}}static from_obj_for_encoding(e){if(void 0===e.app)throw new Error(`Response is missing required field 'app': ${e}`);if(void 0===e.name)throw new Error(`Response is missing required field 'name': ${e}`);return new Ye({app:e.app,name:e.name})}}class Je extends ve{constructor({boxes:e}){super(),this.boxes=e,this.attribute_map={boxes:"boxes"}}static from_obj_for_encoding(e){if(!Array.isArray(e.boxes))throw new Error(`Response is missing required array field 'boxes': ${e}`);return new Je({boxes:e.boxes.map(Ge.from_obj_for_encoding)})}}class Xe extends ve{constructor({branch:e,buildNumber:t,channel:r,commitHash:s,major:n,minor:i}){super(),this.branch=e,this.buildNumber=t,this.channel=r,this.commitHash=s,this.major=n,this.minor=i,this.attribute_map={branch:"branch",buildNumber:"build_number",channel:"channel",commitHash:"commit_hash",major:"major",minor:"minor"}}static from_obj_for_encoding(e){if(void 0===e.branch)throw new Error(`Response is missing required field 'branch': ${e}`);if(void 0===e.build_number)throw new Error(`Response is missing required field 'build_number': ${e}`);if(void 0===e.channel)throw new Error(`Response is missing required field 'channel': ${e}`);if(void 0===e.commit_hash)throw new Error(`Response is missing required field 'commit_hash': ${e}`);if(void 0===e.major)throw new Error(`Response is missing required field 'major': ${e}`);if(void 0===e.minor)throw new Error(`Response is missing required field 'minor': ${e}`);return new Xe({branch:e.branch,buildNumber:e.build_number,channel:e.channel,commitHash:e.commit_hash,major:e.major,minor:e.minor})}}class Ze extends ve{constructor({hash:e,result:t,sourcemap:r}){super(),this.hash=e,this.result=t,this.sourcemap=r,this.attribute_map={hash:"hash",result:"result",sourcemap:"sourcemap"}}static from_obj_for_encoding(e){if(void 0===e.hash)throw new Error(`Response is missing required field 'hash': ${e}`);if(void 0===e.result)throw new Error(`Response is missing required field 'result': ${e}`);return new Ze({hash:e.hash,result:e.result,sourcemap:e.sourcemap})}}class Qe extends ve{constructor({result:e}){super(),this.result=e,this.attribute_map={result:"result"}}static from_obj_for_encoding(e){if(void 0===e.result)throw new Error(`Response is missing required field 'result': ${e}`);return new Qe({result:e.result})}}class et extends ve{constructor({accounts:e,apps:t,latestTimestamp:r,protocolVersion:s,round:n,sources:i,txns:o}){super(),this.accounts=e,this.apps=t,this.latestTimestamp=r,this.protocolVersion=s,this.round=n,this.sources=i,this.txns=o,this.attribute_map={accounts:"accounts",apps:"apps",latestTimestamp:"latest-timestamp",protocolVersion:"protocol-version",round:"round",sources:"sources",txns:"txns"}}static from_obj_for_encoding(e){if(!Array.isArray(e.accounts))throw new Error(`Response is missing required array field 'accounts': ${e}`);if(!Array.isArray(e.apps))throw new Error(`Response is missing required array field 'apps': ${e}`);if(void 0===e["latest-timestamp"])throw new Error(`Response is missing required field 'latest-timestamp': ${e}`);if(void 0===e["protocol-version"])throw new Error(`Response is missing required field 'protocol-version': ${e}`);if(void 0===e.round)throw new Error(`Response is missing required field 'round': ${e}`);if(!Array.isArray(e.sources))throw new Error(`Response is missing required array field 'sources': ${e}`);if(!Array.isArray(e.txns))throw new Error(`Response is missing required array field 'txns': ${e}`);return new et({accounts:e.accounts.map(xe.from_obj_for_encoding),apps:e.apps.map(Ie.from_obj_for_encoding),latestTimestamp:e["latest-timestamp"],protocolVersion:e["protocol-version"],round:e.round,sources:e.sources.map(rt.from_obj_for_encoding),txns:e.txns})}}class tt extends ve{constructor({error:e,protocolVersion:t,txns:r}){super(),this.error=e,this.protocolVersion=t,this.txns=r,this.attribute_map={error:"error",protocolVersion:"protocol-version",txns:"txns"}}static from_obj_for_encoding(e){if(void 0===e.error)throw new Error(`Response is missing required field 'error': ${e}`);if(void 0===e["protocol-version"])throw new Error(`Response is missing required field 'protocol-version': ${e}`);if(!Array.isArray(e.txns))throw new Error(`Response is missing required array field 'txns': ${e}`);return new tt({error:e.error,protocolVersion:e["protocol-version"],txns:e.txns.map(nt.from_obj_for_encoding)})}}class rt extends ve{constructor({fieldName:e,source:t,txnIndex:r,appIndex:s}){super(),this.fieldName=e,this.source=t,this.txnIndex=r,this.appIndex=s,this.attribute_map={fieldName:"field-name",source:"source",txnIndex:"txn-index",appIndex:"app-index"}}static from_obj_for_encoding(e){if(void 0===e["field-name"])throw new Error(`Response is missing required field 'field-name': ${e}`);if(void 0===e.source)throw new Error(`Response is missing required field 'source': ${e}`);if(void 0===e["txn-index"])throw new Error(`Response is missing required field 'txn-index': ${e}`);if(void 0===e["app-index"])throw new Error(`Response is missing required field 'app-index': ${e}`);return new rt({fieldName:e["field-name"],source:e.source,txnIndex:e["txn-index"],appIndex:e["app-index"]})}}class st extends ve{constructor({line:e,pc:t,stack:r,error:s,scratch:n}){super(),this.line=e,this.pc=t,this.stack=r,this.error=s,this.scratch=n,this.attribute_map={line:"line",pc:"pc",stack:"stack",error:"error",scratch:"scratch"}}static from_obj_for_encoding(e){if(void 0===e.line)throw new Error(`Response is missing required field 'line': ${e}`);if(void 0===e.pc)throw new Error(`Response is missing required field 'pc': ${e}`);if(!Array.isArray(e.stack))throw new Error(`Response is missing required array field 'stack': ${e}`);return new st({line:e.line,pc:e.pc,stack:e.stack.map(jt.from_obj_for_encoding),error:e.error,scratch:void 0!==e.scratch?e.scratch.map(jt.from_obj_for_encoding):void 0})}}class nt extends ve{constructor({disassembly:e,appCallMessages:t,appCallTrace:r,budgetAdded:s,budgetConsumed:n,globalDelta:i,localDeltas:o,logicSigDisassembly:a,logicSigMessages:c,logicSigTrace:u,logs:l}){super(),this.disassembly=e,this.appCallMessages=t,this.appCallTrace=r,this.budgetAdded=s,this.budgetConsumed=n,this.globalDelta=i,this.localDeltas=o,this.logicSigDisassembly=a,this.logicSigMessages=c,this.logicSigTrace=u,this.logs=l,this.attribute_map={disassembly:"disassembly",appCallMessages:"app-call-messages",appCallTrace:"app-call-trace",budgetAdded:"budget-added",budgetConsumed:"budget-consumed",globalDelta:"global-delta",localDeltas:"local-deltas",logicSigDisassembly:"logic-sig-disassembly",logicSigMessages:"logic-sig-messages",logicSigTrace:"logic-sig-trace",logs:"logs"}}static from_obj_for_encoding(e){if(!Array.isArray(e.disassembly))throw new Error(`Response is missing required array field 'disassembly': ${e}`);return new nt({disassembly:e.disassembly,appCallMessages:e["app-call-messages"],appCallTrace:void 0!==e["app-call-trace"]?e["app-call-trace"].map(st.from_obj_for_encoding):void 0,budgetAdded:e["budget-added"],budgetConsumed:e["budget-consumed"],globalDelta:void 0!==e["global-delta"]?e["global-delta"].map(at.from_obj_for_encoding):void 0,localDeltas:void 0!==e["local-deltas"]?e["local-deltas"].map(Re.from_obj_for_encoding):void 0,logicSigDisassembly:e["logic-sig-disassembly"],logicSigMessages:e["logic-sig-messages"],logicSigTrace:void 0!==e["logic-sig-trace"]?e["logic-sig-trace"].map(st.from_obj_for_encoding):void 0,logs:e.logs})}}class it extends ve{constructor({message:e,data:t}){super(),this.message=e,this.data=t,this.attribute_map={message:"message",data:"data"}}static from_obj_for_encoding(e){if(void 0===e.message)throw new Error(`Response is missing required field 'message': ${e}`);return new it({message:e.message,data:e.data})}}class ot extends ve{constructor({action:e,bytes:t,uint:r}){super(),this.action=e,this.bytes=t,this.uint=r,this.attribute_map={action:"action",bytes:"bytes",uint:"uint"}}static from_obj_for_encoding(e){if(void 0===e.action)throw new Error(`Response is missing required field 'action': ${e}`);return new ot({action:e.action,bytes:e.bytes,uint:e.uint})}}class at extends ve{constructor({key:e,value:t}){super(),this.key=e,this.value=t,this.attribute_map={key:"key",value:"value"}}static from_obj_for_encoding(e){if(void 0===e.key)throw new Error(`Response is missing required field 'key': ${e}`);if(void 0===e.value)throw new Error(`Response is missing required field 'value': ${e}`);return new at({key:e.key,value:ot.from_obj_for_encoding(e.value)})}}class ct extends ve{constructor({offset:e}){super(),this.offset=e,this.attribute_map={offset:"offset"}}static from_obj_for_encoding(e){if(void 0===e.offset)throw new Error(`Response is missing required field 'offset': ${e}`);return new ct({offset:e.offset})}}class ut extends ve{constructor({round:e}){super(),this.round=e,this.attribute_map={round:"round"}}static from_obj_for_encoding(e){if(void 0===e.round)throw new Error(`Response is missing required field 'round': ${e}`);return new ut({round:e.round})}}class lt extends ve{constructor({key:e,value:t}){super(),this.key="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.value="string"==typeof t?new Uint8Array(o.lW.from(t,"base64")):t,this.attribute_map={key:"key",value:"value"}}static from_obj_for_encoding(e){return new lt({key:e.key,value:e.value})}}class dt extends ve{constructor({delta:e,ids:t}){super(),this.delta=e,this.ids=t,this.attribute_map={delta:"Delta",ids:"Ids"}}static from_obj_for_encoding(e){if(void 0===e.Delta)throw new Error(`Response is missing required field 'Delta': ${e}`);if(!Array.isArray(e.Ids))throw new Error(`Response is missing required array field 'Ids': ${e}`);return new dt({delta:e.Delta,ids:e.Ids})}}class ht extends ve{constructor({index:e,proof:t,treedepth:r}){super(),this.index=e,this.proof="string"==typeof t?new Uint8Array(o.lW.from(t,"base64")):t,this.treedepth=r,this.attribute_map={index:"index",proof:"proof",treedepth:"treedepth"}}static from_obj_for_encoding(e){if(void 0===e.index)throw new Error(`Response is missing required field 'index': ${e}`);if(void 0===e.proof)throw new Error(`Response is missing required field 'proof': ${e}`);if(void 0===e.treedepth)throw new Error(`Response is missing required field 'treedepth': ${e}`);return new ht({index:e.index,proof:e.proof,treedepth:e.treedepth})}}class pt extends ve{constructor({catchupTime:e,lastRound:t,lastVersion:r,nextVersion:s,nextVersionRound:n,nextVersionSupported:i,stoppedAtUnsupportedRound:o,timeSinceLastRound:a,catchpoint:c,catchpointAcquiredBlocks:u,catchpointProcessedAccounts:l,catchpointProcessedKvs:d,catchpointTotalAccounts:h,catchpointTotalBlocks:p,catchpointTotalKvs:f,catchpointVerifiedAccounts:g,catchpointVerifiedKvs:m,lastCatchpoint:y,upgradeDelay:w,upgradeNextProtocolVoteBefore:b,upgradeNoVotes:v,upgradeNodeVote:x,upgradeVoteRounds:_,upgradeVotes:A,upgradeVotesRequired:E,upgradeYesVotes:k}){super(),this.catchupTime=e,this.lastRound=t,this.lastVersion=r,this.nextVersion=s,this.nextVersionRound=n,this.nextVersionSupported=i,this.stoppedAtUnsupportedRound=o,this.timeSinceLastRound=a,this.catchpoint=c,this.catchpointAcquiredBlocks=u,this.catchpointProcessedAccounts=l,this.catchpointProcessedKvs=d,this.catchpointTotalAccounts=h,this.catchpointTotalBlocks=p,this.catchpointTotalKvs=f,this.catchpointVerifiedAccounts=g,this.catchpointVerifiedKvs=m,this.lastCatchpoint=y,this.upgradeDelay=w,this.upgradeNextProtocolVoteBefore=b,this.upgradeNoVotes=v,this.upgradeNodeVote=x,this.upgradeVoteRounds=_,this.upgradeVotes=A,this.upgradeVotesRequired=E,this.upgradeYesVotes=k,this.attribute_map={catchupTime:"catchup-time",lastRound:"last-round",lastVersion:"last-version",nextVersion:"next-version",nextVersionRound:"next-version-round",nextVersionSupported:"next-version-supported",stoppedAtUnsupportedRound:"stopped-at-unsupported-round",timeSinceLastRound:"time-since-last-round",catchpoint:"catchpoint",catchpointAcquiredBlocks:"catchpoint-acquired-blocks",catchpointProcessedAccounts:"catchpoint-processed-accounts",catchpointProcessedKvs:"catchpoint-processed-kvs",catchpointTotalAccounts:"catchpoint-total-accounts",catchpointTotalBlocks:"catchpoint-total-blocks",catchpointTotalKvs:"catchpoint-total-kvs",catchpointVerifiedAccounts:"catchpoint-verified-accounts",catchpointVerifiedKvs:"catchpoint-verified-kvs",lastCatchpoint:"last-catchpoint",upgradeDelay:"upgrade-delay",upgradeNextProtocolVoteBefore:"upgrade-next-protocol-vote-before",upgradeNoVotes:"upgrade-no-votes",upgradeNodeVote:"upgrade-node-vote",upgradeVoteRounds:"upgrade-vote-rounds",upgradeVotes:"upgrade-votes",upgradeVotesRequired:"upgrade-votes-required",upgradeYesVotes:"upgrade-yes-votes"}}static from_obj_for_encoding(e){if(void 0===e["catchup-time"])throw new Error(`Response is missing required field 'catchup-time': ${e}`);if(void 0===e["last-round"])throw new Error(`Response is missing required field 'last-round': ${e}`);if(void 0===e["last-version"])throw new Error(`Response is missing required field 'last-version': ${e}`);if(void 0===e["next-version"])throw new Error(`Response is missing required field 'next-version': ${e}`);if(void 0===e["next-version-round"])throw new Error(`Response is missing required field 'next-version-round': ${e}`);if(void 0===e["next-version-supported"])throw new Error(`Response is missing required field 'next-version-supported': ${e}`);if(void 0===e["stopped-at-unsupported-round"])throw new Error(`Response is missing required field 'stopped-at-unsupported-round': ${e}`);if(void 0===e["time-since-last-round"])throw new Error(`Response is missing required field 'time-since-last-round': ${e}`);return new pt({catchupTime:e["catchup-time"],lastRound:e["last-round"],lastVersion:e["last-version"],nextVersion:e["next-version"],nextVersionRound:e["next-version-round"],nextVersionSupported:e["next-version-supported"],stoppedAtUnsupportedRound:e["stopped-at-unsupported-round"],timeSinceLastRound:e["time-since-last-round"],catchpoint:e.catchpoint,catchpointAcquiredBlocks:e["catchpoint-acquired-blocks"],catchpointProcessedAccounts:e["catchpoint-processed-accounts"],catchpointProcessedKvs:e["catchpoint-processed-kvs"],catchpointTotalAccounts:e["catchpoint-total-accounts"],catchpointTotalBlocks:e["catchpoint-total-blocks"],catchpointTotalKvs:e["catchpoint-total-kvs"],catchpointVerifiedAccounts:e["catchpoint-verified-accounts"],catchpointVerifiedKvs:e["catchpoint-verified-kvs"],lastCatchpoint:e["last-catchpoint"],upgradeDelay:e["upgrade-delay"],upgradeNextProtocolVoteBefore:e["upgrade-next-protocol-vote-before"],upgradeNoVotes:e["upgrade-no-votes"],upgradeNodeVote:e["upgrade-node-vote"],upgradeVoteRounds:e["upgrade-vote-rounds"],upgradeVotes:e["upgrade-votes"],upgradeVotesRequired:e["upgrade-votes-required"],upgradeYesVotes:e["upgrade-yes-votes"]})}}class ft extends ve{constructor({poolError:e,txn:t,applicationIndex:r,assetClosingAmount:s,assetIndex:n,closeRewards:i,closingAmount:o,confirmedRound:a,globalStateDelta:c,innerTxns:u,localStateDelta:l,logs:d,receiverRewards:h,senderRewards:p}){super(),this.poolError=e,this.txn=t,this.applicationIndex=r,this.assetClosingAmount=s,this.assetIndex=n,this.closeRewards=i,this.closingAmount=o,this.confirmedRound=a,this.globalStateDelta=c,this.innerTxns=u,this.localStateDelta=l,this.logs=d,this.receiverRewards=h,this.senderRewards=p,this.attribute_map={poolError:"pool-error",txn:"txn",applicationIndex:"application-index",assetClosingAmount:"asset-closing-amount",assetIndex:"asset-index",closeRewards:"close-rewards",closingAmount:"closing-amount",confirmedRound:"confirmed-round",globalStateDelta:"global-state-delta",innerTxns:"inner-txns",localStateDelta:"local-state-delta",logs:"logs",receiverRewards:"receiver-rewards",senderRewards:"sender-rewards"}}static from_obj_for_encoding(e){if(void 0===e["pool-error"])throw new Error(`Response is missing required field 'pool-error': ${e}`);if(void 0===e.txn)throw new Error(`Response is missing required field 'txn': ${e}`);return new ft({poolError:e["pool-error"],txn:e.txn,applicationIndex:e["application-index"],assetClosingAmount:e["asset-closing-amount"],assetIndex:e["asset-index"],closeRewards:e["close-rewards"],closingAmount:e["closing-amount"],confirmedRound:e["confirmed-round"],globalStateDelta:void 0!==e["global-state-delta"]?e["global-state-delta"].map(at.from_obj_for_encoding):void 0,innerTxns:void 0!==e["inner-txns"]?e["inner-txns"].map(ft.from_obj_for_encoding):void 0,localStateDelta:void 0!==e["local-state-delta"]?e["local-state-delta"].map(Re.from_obj_for_encoding):void 0,logs:e.logs,receiverRewards:e["receiver-rewards"],senderRewards:e["sender-rewards"]})}}class gt extends ve{constructor({topTransactions:e,totalTransactions:t}){super(),this.topTransactions=e,this.totalTransactions=t,this.attribute_map={topTransactions:"top-transactions",totalTransactions:"total-transactions"}}static from_obj_for_encoding(e){if(!Array.isArray(e["top-transactions"]))throw new Error(`Response is missing required array field 'top-transactions': ${e}`);if(void 0===e["total-transactions"])throw new Error(`Response is missing required field 'total-transactions': ${e}`);return new gt({topTransactions:e["top-transactions"],totalTransactions:e["total-transactions"]})}}class mt extends ve{constructor({txid:e}){super(),this.txid=e,this.attribute_map={txid:"txId"}}static from_obj_for_encoding(e){if(void 0===e.txId)throw new Error(`Response is missing required field 'txId': ${e}`);return new mt({txid:e.txId})}}class yt extends ve{constructor({newValue:e,slot:t}){super(),this.newValue=e,this.slot=t,this.attribute_map={newValue:"new-value",slot:"slot"}}static from_obj_for_encoding(e){if(void 0===e["new-value"])throw new Error(`Response is missing required field 'new-value': ${e}`);if(void 0===e.slot)throw new Error(`Response is missing required field 'slot': ${e}`);return new yt({newValue:We.from_obj_for_encoding(e["new-value"]),slot:e.slot})}}class wt extends ve{constructor({appInitialStates:e}){super(),this.appInitialStates=e,this.attribute_map={appInitialStates:"app-initial-states"}}static from_obj_for_encoding(e){return new wt({appInitialStates:void 0!==e["app-initial-states"]?e["app-initial-states"].map(Be.from_obj_for_encoding):void 0})}}class bt extends ve{constructor({txnGroups:e,allowEmptySignatures:t,allowMoreLogging:r,allowUnnamedResources:s,execTraceConfig:n,extraOpcodeBudget:i,round:o}){super(),this.txnGroups=e,this.allowEmptySignatures=t,this.allowMoreLogging=r,this.allowUnnamedResources=s,this.execTraceConfig=n,this.extraOpcodeBudget=i,this.round=o,this.attribute_map={txnGroups:"txn-groups",allowEmptySignatures:"allow-empty-signatures",allowMoreLogging:"allow-more-logging",allowUnnamedResources:"allow-unnamed-resources",execTraceConfig:"exec-trace-config",extraOpcodeBudget:"extra-opcode-budget",round:"round"}}static from_obj_for_encoding(e){if(!Array.isArray(e["txn-groups"]))throw new Error(`Response is missing required array field 'txn-groups': ${e}`);return new bt({txnGroups:e["txn-groups"].map(vt.from_obj_for_encoding),allowEmptySignatures:e["allow-empty-signatures"],allowMoreLogging:e["allow-more-logging"],allowUnnamedResources:e["allow-unnamed-resources"],execTraceConfig:void 0!==e["exec-trace-config"]?_t.from_obj_for_encoding(e["exec-trace-config"]):void 0,extraOpcodeBudget:e["extra-opcode-budget"],round:e.round})}}class vt extends ve{constructor({txns:e}){super(),this.txns=e,this.attribute_map={txns:"txns"}}static from_obj_for_encoding(e){if(!Array.isArray(e.txns))throw new Error(`Response is missing required array field 'txns': ${e}`);return new vt({txns:e.txns})}}class xt extends ve{constructor({lastRound:e,txnGroups:t,version:r,evalOverrides:s,execTraceConfig:n,initialStates:i}){super(),this.lastRound=e,this.txnGroups=t,this.version=r,this.evalOverrides=s,this.execTraceConfig=n,this.initialStates=i,this.attribute_map={lastRound:"last-round",txnGroups:"txn-groups",version:"version",evalOverrides:"eval-overrides",execTraceConfig:"exec-trace-config",initialStates:"initial-states"}}static from_obj_for_encoding(e){if(void 0===e["last-round"])throw new Error(`Response is missing required field 'last-round': ${e}`);if(!Array.isArray(e["txn-groups"]))throw new Error(`Response is missing required array field 'txn-groups': ${e}`);if(void 0===e.version)throw new Error(`Response is missing required field 'version': ${e}`);return new xt({lastRound:e["last-round"],txnGroups:e["txn-groups"].map(At.from_obj_for_encoding),version:e.version,evalOverrides:void 0!==e["eval-overrides"]?St.from_obj_for_encoding(e["eval-overrides"]):void 0,execTraceConfig:void 0!==e["exec-trace-config"]?_t.from_obj_for_encoding(e["exec-trace-config"]):void 0,initialStates:void 0!==e["initial-states"]?wt.from_obj_for_encoding(e["initial-states"]):void 0})}}class _t extends ve{constructor({enable:e,scratchChange:t,stackChange:r,stateChange:s}){super(),this.enable=e,this.scratchChange=t,this.stackChange=r,this.stateChange=s,this.attribute_map={enable:"enable",scratchChange:"scratch-change",stackChange:"stack-change",stateChange:"state-change"}}static from_obj_for_encoding(e){return new _t({enable:e.enable,scratchChange:e["scratch-change"],stackChange:e["stack-change"],stateChange:e["state-change"]})}}class At extends ve{constructor({txnResults:e,appBudgetAdded:t,appBudgetConsumed:r,failedAt:s,failureMessage:n,unnamedResourcesAccessed:i}){super(),this.txnResults=e,this.appBudgetAdded=t,this.appBudgetConsumed=r,this.failedAt=s,this.failureMessage=n,this.unnamedResourcesAccessed=i,this.attribute_map={txnResults:"txn-results",appBudgetAdded:"app-budget-added",appBudgetConsumed:"app-budget-consumed",failedAt:"failed-at",failureMessage:"failure-message",unnamedResourcesAccessed:"unnamed-resources-accessed"}}static from_obj_for_encoding(e){if(!Array.isArray(e["txn-results"]))throw new Error(`Response is missing required array field 'txn-results': ${e}`);return new At({txnResults:e["txn-results"].map(Et.from_obj_for_encoding),appBudgetAdded:e["app-budget-added"],appBudgetConsumed:e["app-budget-consumed"],failedAt:e["failed-at"],failureMessage:e["failure-message"],unnamedResourcesAccessed:void 0!==e["unnamed-resources-accessed"]?kt.from_obj_for_encoding(e["unnamed-resources-accessed"]):void 0})}}class Et extends ve{constructor({txnResult:e,appBudgetConsumed:t,execTrace:r,logicSigBudgetConsumed:s,unnamedResourcesAccessed:n}){super(),this.txnResult=e,this.appBudgetConsumed=t,this.execTrace=r,this.logicSigBudgetConsumed=s,this.unnamedResourcesAccessed=n,this.attribute_map={txnResult:"txn-result",appBudgetConsumed:"app-budget-consumed",execTrace:"exec-trace",logicSigBudgetConsumed:"logic-sig-budget-consumed",unnamedResourcesAccessed:"unnamed-resources-accessed"}}static from_obj_for_encoding(e){if(void 0===e["txn-result"])throw new Error(`Response is missing required field 'txn-result': ${e}`);return new Et({txnResult:ft.from_obj_for_encoding(e["txn-result"]),appBudgetConsumed:e["app-budget-consumed"],execTrace:void 0!==e["exec-trace"]?Tt.from_obj_for_encoding(e["exec-trace"]):void 0,logicSigBudgetConsumed:e["logic-sig-budget-consumed"],unnamedResourcesAccessed:void 0!==e["unnamed-resources-accessed"]?kt.from_obj_for_encoding(e["unnamed-resources-accessed"]):void 0})}}class kt extends ve{constructor({accounts:e,appLocals:t,apps:r,assetHoldings:s,assets:n,boxes:i,extraBoxRefs:o}){super(),this.accounts=e,this.appLocals=t,this.apps=r,this.assetHoldings=s,this.assets=n,this.boxes=i,this.extraBoxRefs=o,this.attribute_map={accounts:"accounts",appLocals:"app-locals",apps:"apps",assetHoldings:"asset-holdings",assets:"assets",boxes:"boxes",extraBoxRefs:"extra-box-refs"}}static from_obj_for_encoding(e){return new kt({accounts:e.accounts,appLocals:void 0!==e["app-locals"]?e["app-locals"].map(Pe.from_obj_for_encoding):void 0,apps:e.apps,assetHoldings:void 0!==e["asset-holdings"]?e["asset-holdings"].map(Le.from_obj_for_encoding):void 0,assets:e.assets,boxes:void 0!==e.boxes?e.boxes.map(Ye.from_obj_for_encoding):void 0,extraBoxRefs:e["extra-box-refs"]})}}class St extends ve{constructor({allowEmptySignatures:e,allowUnnamedResources:t,extraOpcodeBudget:r,maxLogCalls:s,maxLogSize:n}){super(),this.allowEmptySignatures=e,this.allowUnnamedResources=t,this.extraOpcodeBudget=r,this.maxLogCalls=s,this.maxLogSize=n,this.attribute_map={allowEmptySignatures:"allow-empty-signatures",allowUnnamedResources:"allow-unnamed-resources",extraOpcodeBudget:"extra-opcode-budget",maxLogCalls:"max-log-calls",maxLogSize:"max-log-size"}}static from_obj_for_encoding(e){return new St({allowEmptySignatures:e["allow-empty-signatures"],allowUnnamedResources:e["allow-unnamed-resources"],extraOpcodeBudget:e["extra-opcode-budget"],maxLogCalls:e["max-log-calls"],maxLogSize:e["max-log-size"]})}}class Rt extends ve{constructor({pc:e,scratchChanges:t,spawnedInners:r,stackAdditions:s,stackPopCount:n,stateChanges:i}){super(),this.pc=e,this.scratchChanges=t,this.spawnedInners=r,this.stackAdditions=s,this.stackPopCount=n,this.stateChanges=i,this.attribute_map={pc:"pc",scratchChanges:"scratch-changes",spawnedInners:"spawned-inners",stackAdditions:"stack-additions",stackPopCount:"stack-pop-count",stateChanges:"state-changes"}}static from_obj_for_encoding(e){if(void 0===e.pc)throw new Error(`Response is missing required field 'pc': ${e}`);return new Rt({pc:e.pc,scratchChanges:void 0!==e["scratch-changes"]?e["scratch-changes"].map(yt.from_obj_for_encoding):void 0,spawnedInners:e["spawned-inners"],stackAdditions:void 0!==e["stack-additions"]?e["stack-additions"].map(We.from_obj_for_encoding):void 0,stackPopCount:e["stack-pop-count"],stateChanges:void 0!==e["state-changes"]?e["state-changes"].map($e.from_obj_for_encoding):void 0})}}class Tt extends ve{constructor({approvalProgramHash:e,approvalProgramTrace:t,clearStateProgramHash:r,clearStateProgramTrace:s,clearStateRollback:n,clearStateRollbackError:i,innerTrace:a,logicSigHash:c,logicSigTrace:u}){super(),this.approvalProgramHash="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.approvalProgramTrace=t,this.clearStateProgramHash="string"==typeof r?new Uint8Array(o.lW.from(r,"base64")):r,this.clearStateProgramTrace=s,this.clearStateRollback=n,this.clearStateRollbackError=i,this.innerTrace=a,this.logicSigHash="string"==typeof c?new Uint8Array(o.lW.from(c,"base64")):c,this.logicSigTrace=u,this.attribute_map={approvalProgramHash:"approval-program-hash",approvalProgramTrace:"approval-program-trace",clearStateProgramHash:"clear-state-program-hash",clearStateProgramTrace:"clear-state-program-trace",clearStateRollback:"clear-state-rollback",clearStateRollbackError:"clear-state-rollback-error",innerTrace:"inner-trace",logicSigHash:"logic-sig-hash",logicSigTrace:"logic-sig-trace"}}static from_obj_for_encoding(e){return new Tt({approvalProgramHash:e["approval-program-hash"],approvalProgramTrace:void 0!==e["approval-program-trace"]?e["approval-program-trace"].map(Rt.from_obj_for_encoding):void 0,clearStateProgramHash:e["clear-state-program-hash"],clearStateProgramTrace:void 0!==e["clear-state-program-trace"]?e["clear-state-program-trace"].map(Rt.from_obj_for_encoding):void 0,clearStateRollback:e["clear-state-rollback"],clearStateRollbackError:e["clear-state-rollback-error"],innerTrace:void 0!==e["inner-trace"]?e["inner-trace"].map(Tt.from_obj_for_encoding):void 0,logicSigHash:e["logic-sig-hash"],logicSigTrace:void 0!==e["logic-sig-trace"]?e["logic-sig-trace"].map(Rt.from_obj_for_encoding):void 0})}}class It extends ve{constructor({message:e,stateproof:t}){super(),this.message=e,this.stateproof="string"==typeof t?new Uint8Array(o.lW.from(t,"base64")):t,this.attribute_map={message:"Message",stateproof:"StateProof"}}static from_obj_for_encoding(e){if(void 0===e.Message)throw new Error(`Response is missing required field 'Message': ${e}`);if(void 0===e.StateProof)throw new Error(`Response is missing required field 'StateProof': ${e}`);return new It({message:Bt.from_obj_for_encoding(e.Message),stateproof:e.StateProof})}}class Bt extends ve{constructor({blockheaderscommitment:e,firstattestedround:t,lastattestedround:r,lnprovenweight:s,voterscommitment:n}){super(),this.blockheaderscommitment="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.firstattestedround=t,this.lastattestedround=r,this.lnprovenweight=s,this.voterscommitment="string"==typeof n?new Uint8Array(o.lW.from(n,"base64")):n,this.attribute_map={blockheaderscommitment:"BlockHeadersCommitment",firstattestedround:"FirstAttestedRound",lastattestedround:"LastAttestedRound",lnprovenweight:"LnProvenWeight",voterscommitment:"VotersCommitment"}}static from_obj_for_encoding(e){if(void 0===e.BlockHeadersCommitment)throw new Error(`Response is missing required field 'BlockHeadersCommitment': ${e}`);if(void 0===e.FirstAttestedRound)throw new Error(`Response is missing required field 'FirstAttestedRound': ${e}`);if(void 0===e.LastAttestedRound)throw new Error(`Response is missing required field 'LastAttestedRound': ${e}`);if(void 0===e.LnProvenWeight)throw new Error(`Response is missing required field 'LnProvenWeight': ${e}`);if(void 0===e.VotersCommitment)throw new Error(`Response is missing required field 'VotersCommitment': ${e}`);return new Bt({blockheaderscommitment:e.BlockHeadersCommitment,firstattestedround:e.FirstAttestedRound,lastattestedround:e.LastAttestedRound,lnprovenweight:e.LnProvenWeight,voterscommitment:e.VotersCommitment})}}class Ut extends ve{constructor({currentRound:e,onlineMoney:t,totalMoney:r}){super(),this.currentRound=e,this.onlineMoney=t,this.totalMoney=r,this.attribute_map={currentRound:"current_round",onlineMoney:"online-money",totalMoney:"total-money"}}static from_obj_for_encoding(e){if(void 0===e.current_round)throw new Error(`Response is missing required field 'current_round': ${e}`);if(void 0===e["online-money"])throw new Error(`Response is missing required field 'online-money': ${e}`);if(void 0===e["total-money"])throw new Error(`Response is missing required field 'total-money': ${e}`);return new Ut({currentRound:e.current_round,onlineMoney:e["online-money"],totalMoney:e["total-money"]})}}class Pt extends ve{constructor({key:e,value:t}){super(),this.key=e,this.value=t,this.attribute_map={key:"key",value:"value"}}static from_obj_for_encoding(e){if(void 0===e.key)throw new Error(`Response is missing required field 'key': ${e}`);if(void 0===e.value)throw new Error(`Response is missing required field 'value': ${e}`);return new Pt({key:e.key,value:jt.from_obj_for_encoding(e.value)})}}class jt extends ve{constructor({type:e,bytes:t,uint:r}){super(),this.type=e,this.bytes=t,this.uint=r,this.attribute_map={type:"type",bytes:"bytes",uint:"uint"}}static from_obj_for_encoding(e){if(void 0===e.type)throw new Error(`Response is missing required field 'type': ${e}`);if(void 0===e.bytes)throw new Error(`Response is missing required field 'bytes': ${e}`);if(void 0===e.uint)throw new Error(`Response is missing required field 'uint': ${e}`);return new jt({type:e.type,bytes:e.bytes,uint:e.uint})}}class qt extends ve{constructor({deltas:e}){super(),this.deltas=e,this.attribute_map={deltas:"Deltas"}}static from_obj_for_encoding(e){if(!Array.isArray(e.Deltas))throw new Error(`Response is missing required array field 'Deltas': ${e}`);return new qt({deltas:e.Deltas.map(dt.from_obj_for_encoding)})}}class $t extends ve{constructor({consensusVersion:e,fee:t,genesisHash:r,genesisId:s,lastRound:n,minFee:i}){super(),this.consensusVersion=e,this.fee=t,this.genesisHash="string"==typeof r?new Uint8Array(o.lW.from(r,"base64")):r,this.genesisId=s,this.lastRound=n,this.minFee=i,this.attribute_map={consensusVersion:"consensus-version",fee:"fee",genesisHash:"genesis-hash",genesisId:"genesis-id",lastRound:"last-round",minFee:"min-fee"}}static from_obj_for_encoding(e){if(void 0===e["consensus-version"])throw new Error(`Response is missing required field 'consensus-version': ${e}`);if(void 0===e.fee)throw new Error(`Response is missing required field 'fee': ${e}`);if(void 0===e["genesis-hash"])throw new Error(`Response is missing required field 'genesis-hash': ${e}`);if(void 0===e["genesis-id"])throw new Error(`Response is missing required field 'genesis-id': ${e}`);if(void 0===e["last-round"])throw new Error(`Response is missing required field 'last-round': ${e}`);if(void 0===e["min-fee"])throw new Error(`Response is missing required field 'min-fee': ${e}`);return new $t({consensusVersion:e["consensus-version"],fee:e.fee,genesisHash:e["genesis-hash"],genesisId:e["genesis-id"],lastRound:e["last-round"],minFee:e["min-fee"]})}}class Ct extends ve{constructor({idx:e,proof:t,stibhash:r,treedepth:s,hashtype:n}){super(),this.idx=e,this.proof="string"==typeof t?new Uint8Array(o.lW.from(t,"base64")):t,this.stibhash="string"==typeof r?new Uint8Array(o.lW.from(r,"base64")):r,this.treedepth=s,this.hashtype=n,this.attribute_map={idx:"idx",proof:"proof",stibhash:"stibhash",treedepth:"treedepth",hashtype:"hashtype"}}static from_obj_for_encoding(e){if(void 0===e.idx)throw new Error(`Response is missing required field 'idx': ${e}`);if(void 0===e.proof)throw new Error(`Response is missing required field 'proof': ${e}`);if(void 0===e.stibhash)throw new Error(`Response is missing required field 'stibhash': ${e}`);if(void 0===e.treedepth)throw new Error(`Response is missing required field 'treedepth': ${e}`);return new Ct({idx:e.idx,proof:e.proof,stibhash:e.stibhash,treedepth:e.treedepth,hashtype:e.hashtype})}}class Dt extends ve{constructor({build:e,genesisHashB64:t,genesisId:r,versions:s}){super(),this.build=e,this.genesisHashB64="string"==typeof t?new Uint8Array(o.lW.from(t,"base64")):t,this.genesisId=r,this.versions=s,this.attribute_map={build:"build",genesisHashB64:"genesis_hash_b64",genesisId:"genesis_id",versions:"versions"}}static from_obj_for_encoding(e){if(void 0===e.build)throw new Error(`Response is missing required field 'build': ${e}`);if(void 0===e.genesis_hash_b64)throw new Error(`Response is missing required field 'genesis_hash_b64': ${e}`);if(void 0===e.genesis_id)throw new Error(`Response is missing required field 'genesis_id': ${e}`);if(!Array.isArray(e.versions))throw new Error(`Response is missing required array field 'versions': ${e}`);return new Dt({build:Xe.from_obj_for_encoding(e.build),genesisHashB64:e.genesis_hash_b64,genesisId:e.genesis_id,versions:e.versions})}}class Ot{constructor(e,t){this.c=e,this.query={},this.intDecoding=t||p.DEFAULT}prepare(e){return e}async do(e={}){const t={};"default"!==this.intDecoding&&(t.intDecoding=this.intDecoding);const r=await this.c.get(this.path(),this.query,e,t);return this.prepare(r.body)}async doRaw(e={}){return(await this.c.get(this.path(),this.query,e,{},!1)).body}setIntDecoding(e){if("default"!==e&&"safe"!==e&&"mixed"!==e&&"bigint"!==e)throw new Error(`Invalid method for int decoding: ${e}`);return this.intDecoding=e,this}}class Lt extends Ot{constructor(e,t,r){super(e,t),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}`}exclude(e){return this.query.exclude=e,this}}class Mt extends Ot{constructor(e,t,r,s){super(e,t),this.account=r,this.assetID=s,this.account=r,this.assetID=s}path(){return`/v2/accounts/${this.account}/assets/${this.assetID}`}}class Nt extends Ot{constructor(e,t,r,s){super(e,t),this.account=r,this.applicationID=s,this.account=r,this.applicationID=s}path(){return`/v2/accounts/${this.account}/applications/${this.applicationID}`}}class Wt extends Ot{constructor(e,t){if(super(e),!Number.isInteger(t))throw Error("roundNumber should be an integer");this.round=t,this.query={format:"msgpack"}}path(){return`/v2/blocks/${this.round}`}prepare(e){if(e&&e.byteLength>0)return Z(e)}}function Kt(e={}){let t=e;return Object.keys(t).every((e=>"content-type"!==e.toLowerCase()))&&(t={...e},t["Content-Type"]="text/plain"),t}class Ft extends Ot{constructor(e,t){super(e),this.source=t,this.source=t}path(){return"/v2/teal/compile"}sourcemap(e=!0){return this.query.sourcemap=e,this}async do(e={}){const t=Kt(e);return(await this.c.post(this.path(),o.lW.from(this.source),t,this.query)).body}}class zt extends Ot{constructor(e,t){super(e),this.blob=X(t.get_obj_for_encoding(!0))}path(){return"/v2/teal/dryrun"}async do(e={}){const t=Kt(e);return(await this.c.post(this.path(),o.lW.from(this.blob),t)).body}}class Vt extends Ot{path(){return"/genesis"}}class Ht extends Ot{constructor(e,t,r){super(e,t),this.index=r,this.index=r}path(){return`/v2/assets/${this.index}`}}class Gt extends Ot{constructor(e,t,r){super(e,t),this.index=r,this.index=r}path(){return`/v2/applications/${this.index}`}}class Yt extends Ot{constructor(e,t,r){if(super(e,t),!Number.isInteger(r))throw Error("roundNumber should be an integer");this.round=r}path(){return`/v2/blocks/${this.round}/hash`}}class Jt extends Ot{constructor(e,t,r){if(super(e,t),!Number.isInteger(r))throw Error("roundNumber should be an integer");this.round=r}path(){return`/v2/blocks/${this.round}/txids`}}class Xt extends Ot{constructor(e,t,r,s){super(e,t),this.index=r,this.index=r;const n=o.lW.from(s).toString("base64");this.query.name=encodeURI(`b64:${n}`)}path(){return`/v2/applications/${this.index}/box`}prepare(e){return He.from_obj_for_encoding(e)}}class Zt extends Ot{constructor(e,t,r){super(e,t),this.index=r,this.index=r,this.query.max=0}path(){return`/v2/applications/${this.index}/boxes`}max(e){return this.query.max=e,this}prepare(e){return Je.from_obj_for_encoding(e)}}class Qt extends Ot{path(){return"/health"}async do(e={}){const t=await this.c.get(this.path(),{},e);if(!t.ok)throw new Error(`Health response: ${t.status}`);return{}}}class er extends Ot{constructor(e,t){super(e),this.txid=t,this.txid=t,this.query.format="msgpack"}prepare(e){if(e&&e.byteLength>0)return Z(e)}path(){return`/v2/transactions/pending/${this.txid}`}max(e){return this.query.max=e,this}}class tr extends Ot{constructor(e){super(e),this.query.format="msgpack"}path(){return"/v2/transactions/pending"}prepare(e){if(e&&e.byteLength>0)return Z(e)}max(e){return this.query.max=e,this}}class rr extends Ot{constructor(e,t){super(e),this.address=t,this.address=t,this.query.format="msgpack"}prepare(e){if(e&&e.byteLength>0)return Z(e)}path(){return`/v2/accounts/${this.address}/transactions/pending`}max(e){return this.query.max=e,this}}class sr extends Ot{constructor(e,t,r,s){super(e,t),this.round=r,this.txID=s,this.round=r,this.txID=s}path(){return`/v2/blocks/${this.round}/transactions/${this.txID}/proof`}hashType(e){return this.query.hashtype=e,this}}function nr(e){return e&&void 0!==e.byteLength}class ir extends Ot{constructor(e,t){super(e);let r=t;if(Array.isArray(t)){if(!t.every(nr))throw new TypeError("Array elements must be byte arrays");r=m(...t)}else if(!nr(r))throw new TypeError("Argument must be byte array");this.txnBytesToPost=r}path(){return"/v2/transactions"}async do(e={}){const t=function(e={}){let t=e;return Object.keys(t).every((e=>"content-type"!==e.toLowerCase()))&&(t={...e},t["Content-Type"]="application/x-binary"),t}(e);return(await this.c.post(this.path(),o.lW.from(this.txnBytesToPost),t)).body}}class or extends Ot{path(){return"/v2/status"}}class ar extends Ot{constructor(e,t,r){if(super(e,t),this.round=r,!Number.isInteger(r))throw Error("round should be an integer");this.round=r}path(){return`/v2/status/wait-for-block-after/${this.round}`}}class cr extends Ot{path(){return"/v2/transactions/params"}prepare(e){return{flatFee:!1,fee:e.fee,firstRound:e["last-round"],lastRound:e["last-round"]+1e3,genesisID:e["genesis-id"],genesisHash:e["genesis-hash"],minFee:e["min-fee"]}}}class ur extends Ot{path(){return"/v2/ledger/supply"}}class lr extends Ot{path(){return"/versions"}}class dr extends Ot{constructor(e,t,r){super(e,t),this.round=r,this.round=r}path(){return`/v2/blocks/${this.round}/lightheader/proof`}}class hr extends Ot{constructor(e,t,r){super(e,t),this.round=r,this.round=r}path(){return`/v2/stateproofs/${this.round}`}}class pr extends Ot{constructor(e,t,r){super(e,t),this.round=r,this.round=r}path(){return`/v2/ledger/sync/${this.round}`}async do(e={}){return(await this.c.post(this.path(),e)).body}}class fr extends Ot{path(){return"/v2/ledger/sync"}prepare(e){return ut.from_obj_for_encoding(e)}}class gr extends Ot{constructor(e,t,r){super(e,t),this.offset=r,this.offset=r}path(){return`/v2/devmode/blocks/offset/${this.offset}`}async do(e={}){return(await this.c.post(this.path(),e)).body}}class mr extends Ot{path(){return"/v2/devmode/blocks/offset"}prepare(e){return ct.from_obj_for_encoding(e)}}class yr extends Ot{constructor(e,t){super(e),this.source=t,this.source=t}path(){return"/v2/teal/disassemble"}async do(e={}){const t=function(e={}){let t=e;return Object.keys(t).every((e=>"content-type"!==e.toLowerCase()))&&(t={...e},t["Content-Type"]="text/plain"),t}(e);return(await this.c.post(this.path(),o.lW.from(this.source),t,this.query)).body}}class wr extends Ot{constructor(e,t){super(e),this.query.format="msgpack",this.requestBytes=J(t.get_obj_for_encoding(!0))}path(){return"/v2/transactions/simulate"}async do(e={}){const t=function(e={}){let t=e;return Object.keys(t).every((e=>"content-type"!==e.toLowerCase()))&&(t={...e},t["Content-Type"]="application/msgpack"),t}(e),r=await this.c.post(this.path(),o.lW.from(this.requestBytes),t,this.query,!1);return this.prepare(r.body)}prepare(e){const t=Z(e);return xt.from_obj_for_encoding(t)}}class br extends Ot{path(){return"/ready"}}class vr extends Ot{path(){return"/v2/ledger/sync"}async do(e={}){return(await this.c.delete(this.path(),e)).body}}class xr extends Ot{constructor(e,t,r){super(e,t),this.id=r,this.id=r,this.query={format:"json"}}path(){return`/v2/deltas/txn/group/${this.id}`}}class _r extends Ot{constructor(e,t,r){super(e,t),this.round=r,this.round=r,this.query={format:"json"}}path(){return`/v2/deltas/${this.round}`}}class Ar extends Ot{constructor(e,t,r){super(e,t),this.round=r,this.round=r,this.query={format:"json"}}path(){return`/v2/deltas/${this.round}/txn/group`}prepare(e){return qt.from_obj_for_encoding(e)}}class Er extends we{constructor(e,t,r,s={}){super("X-Algo-API-Token",e,t,r,s)}healthCheck(){return new Qt(this.c)}versionsCheck(){return new lr(this.c)}sendRawTransaction(e){return new ir(this.c,e)}accountInformation(e){return new Lt(this.c,this.intDecoding,e)}accountAssetInformation(e,t){return new Mt(this.c,this.intDecoding,e,t)}accountApplicationInformation(e,t){return new Nt(this.c,this.intDecoding,e,t)}block(e){return new Wt(this.c,e)}getBlockHash(e){return new Yt(this.c,this.intDecoding,e)}getBlockTxids(e){return new Jt(this.c,this.intDecoding,e)}pendingTransactionInformation(e){return new er(this.c,e)}pendingTransactionsInformation(){return new tr(this.c)}pendingTransactionByAddress(e){return new rr(this.c,e)}status(){return new or(this.c,this.intDecoding)}statusAfterBlock(e){return new ar(this.c,this.intDecoding,e)}getTransactionParams(){return new cr(this.c)}supply(){return new ur(this.c,this.intDecoding)}compile(e){return new Ft(this.c,e)}disassemble(e){return new yr(this.c,e)}dryrun(e){return new zt(this.c,e)}getAssetByID(e){return new Ht(this.c,this.intDecoding,e)}getApplicationByID(e){return new Gt(this.c,this.intDecoding,e)}getApplicationBoxByName(e,t){return new Xt(this.c,this.intDecoding,e,t)}getApplicationBoxes(e){return new Zt(this.c,this.intDecoding,e)}genesis(){return new Vt(this.c,this.intDecoding)}getTransactionProof(e,t){return new sr(this.c,this.intDecoding,e,t)}getLightBlockHeaderProof(e){return new dr(this.c,this.intDecoding,e)}getStateProof(e){return new hr(this.c,this.intDecoding,e)}simulateRawTransactions(e){const t=[];if(Array.isArray(e))for(const r of e)t.push(Z(r));else t.push(Z(e));const r=new bt({txnGroups:[new vt({txns:t})]});return this.simulateTransactions(r)}simulateTransactions(e){return new wr(this.c,e)}setBlockOffsetTimestamp(e){return new gr(this.c,this.intDecoding,e)}getBlockOffsetTimestamp(){return new mr(this.c,this.intDecoding)}setSyncRound(e){return new pr(this.c,this.intDecoding,e)}unsetSyncRound(){return new vr(this.c,this.intDecoding)}getSyncRound(){return new fr(this.c,this.intDecoding)}ready(){return new br(this.c,this.intDecoding)}getLedgerStateDeltaForTransactionGroup(e){return new xr(this.c,this.intDecoding,e)}getLedgerStateDelta(e){return new _r(this.c,this.intDecoding,e)}getTransactionGroupLedgerStateDeltasForRound(e){return new Ar(this.c,this.intDecoding,e)}}class kr extends we{constructor(e,t="http://127.0.0.1",r=7833,s={}){super("X-KMD-API-Token",e,t,r,s)}async versions(){return(await this.c.get("/versions")).body}async listWallets(){return(await this.c.get("/v1/wallets")).body}async createWallet(e,t,r=new Uint8Array,s="sqlite"){const n={wallet_name:e,wallet_driver_name:s,wallet_password:t,master_derivation_key:o.lW.from(r).toString("base64")};return(await this.c.post("/v1/wallet",n)).body}async initWalletHandle(e,t){const r={wallet_id:e,wallet_password:t};return(await this.c.post("/v1/wallet/init",r)).body}async releaseWalletHandle(e){const t={wallet_handle_token:e};return(await this.c.post("/v1/wallet/release",t)).body}async renewWalletHandle(e){const t={wallet_handle_token:e};return(await this.c.post("/v1/wallet/renew",t)).body}async renameWallet(e,t,r){const s={wallet_id:e,wallet_password:t,wallet_name:r};return(await this.c.post("/v1/wallet/rename",s)).body}async getWallet(e){const t={wallet_handle_token:e};return(await this.c.post("/v1/wallet/info",t)).body}async exportMasterDerivationKey(e,t){const r={wallet_handle_token:e,wallet_password:t},s=await this.c.post("/v1/master-key/export",r);return{master_derivation_key:o.lW.from(s.body.master_derivation_key,"base64")}}async importKey(e,t){const r={wallet_handle_token:e,private_key:o.lW.from(t).toString("base64")};return(await this.c.post("/v1/key/import",r)).body}async exportKey(e,t,r){const s={wallet_handle_token:e,address:r,wallet_password:t},n=await this.c.post("/v1/key/export",s);return{private_key:o.lW.from(n.body.private_key,"base64")}}async generateKey(e){const t={wallet_handle_token:e,display_mnemonic:!1};return(await this.c.post("/v1/key",t)).body}async deleteKey(e,t,r){const s={wallet_handle_token:e,address:r,wallet_password:t};return(await this.c.delete("/v1/key",s)).body}async listKeys(e){const t={wallet_handle_token:e};return(await this.c.post("/v1/key/list",t)).body}async signTransaction(e,t,r){const s=ce(r),n={wallet_handle_token:e,wallet_password:t,transaction:o.lW.from(s.toByte()).toString("base64")},i=await this.c.post("/v1/transaction/sign",n);return 200===i.status?o.lW.from(i.body.signed_transaction,"base64"):i.body}async signTransactionWithSpecificPublicKey(e,t,r,s){const n=ce(r),i={wallet_handle_token:e,wallet_password:t,transaction:o.lW.from(n.toByte()).toString("base64"),public_key:o.lW.from(s).toString("base64")},a=await this.c.post("/v1/transaction/sign",i);return 200===a.status?o.lW.from(a.body.signed_transaction,"base64"):a.body}async listMultisig(e){const t={wallet_handle_token:e};return(await this.c.post("/v1/multisig/list",t)).body}async importMultisig(e,t,r,s){const n={wallet_handle_token:e,multisig_version:t,threshold:r,pks:s};return(await this.c.post("/v1/multisig/import",n)).body}async exportMultisig(e,t){const r={wallet_handle_token:e,address:t};return(await this.c.post("/v1/multisig/export",r)).body}async signMultisigTransaction(e,t,r,s,n){const i=ce(r),a={wallet_handle_token:e,transaction:o.lW.from(i.toByte()).toString("base64"),public_key:o.lW.from(s).toString("base64"),partial_multisig:n,wallet_password:t};return(await this.c.post("/v1/multisig/sign",a)).body}async deleteMultisig(e,t,r){const s={wallet_handle_token:e,address:r,wallet_password:t};return(await this.c.delete("/v1/multisig",s)).body}}class Sr extends Ot{path(){return"/health"}}class Rr extends Ot{constructor(e,t,r){super(e,t),this.index=r,this.index=r}path(){return`/v2/assets/${this.index}/balances`}limit(e){return this.query.limit=e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}}function Tr(e){return"string"==typeof e?e:o.lW.from(e).toString("base64")}class Ir extends Ot{constructor(e,t,r){super(e,t),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}/transactions`}notePrefix(e){return this.query["note-prefix"]=Tr(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}assetID(e){return this.query["asset-id"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e,this}afterTime(e){return this.query["after-time"]=e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}}class Br extends Ot{constructor(e,t,r){super(e,t),this.index=r,this.index=r}path(){return`/v2/assets/${this.index}/transactions`}notePrefix(e){return this.query["note-prefix"]=Tr(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e,this}afterTime(e){return this.query["after-time"]=e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}addressRole(e){return this.query["address-role"]=e,this}address(e){return this.query.address=e,this}excludeCloseTo(e){return this.query["exclude-close-to"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}}class Ur extends Ot{constructor(e,t,r){super(e,t),this.round=r,this.round=r}path(){return`/v2/blocks/${this.round}`}headerOnly(e){return this.query["header-only"]=e,this}}class Pr extends Ot{constructor(e,t,r){super(e,t),this.txID=r,this.txID=r}path(){return`/v2/transactions/${this.txID}`}}class jr extends Ot{constructor(e,t,r){super(e,t),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}`}round(e){return this.query.round=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}exclude(e){return this.query.exclude=e,this}}class qr extends Ot{constructor(e,t,r){super(e,t),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}/assets`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}assetId(e){return this.query["asset-id"]=e,this}}class $r extends Ot{constructor(e,t,r){super(e,t),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}/created-assets`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}assetID(e){return this.query["asset-id"]=e,this}}class Cr extends Ot{constructor(e,t,r){super(e,t),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}/apps-local-state`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}applicationID(e){return this.query["application-id"]=e,this}}class Dr extends Ot{constructor(e,t,r){super(e,t),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}/created-applications`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}applicationID(e){return this.query["application-id"]=e,this}}class Or extends Ot{constructor(e,t,r){super(e,t),this.index=r,this.index=r}path(){return`/v2/assets/${this.index}`}includeAll(e=!0){return this.query["include-all"]=e,this}}class Lr extends Ot{constructor(e,t,r){super(e,t),this.index=r,this.index=r}path(){return`/v2/applications/${this.index}`}includeAll(e=!0){return this.query["include-all"]=e,this}}class Mr extends Ot{constructor(e,t,r){super(e,t),this.appID=r,this.appID=r}path(){return`/v2/applications/${this.appID}/logs`}limit(e){return this.query.limit=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}nextToken(e){return this.query.next=e,this}sender(e){return this.query["sender-address"]=e,this}txid(e){return this.query.txid=e,this}}class Nr extends ve{constructor({address:e,amount:t,amountWithoutPendingRewards:r,minBalance:s,pendingRewards:n,rewards:i,round:o,status:a,totalAppsOptedIn:c,totalAssetsOptedIn:u,totalBoxBytes:l,totalBoxes:d,totalCreatedApps:h,totalCreatedAssets:p,appsLocalState:f,appsTotalExtraPages:g,appsTotalSchema:m,assets:y,authAddr:w,closedAtRound:b,createdApps:v,createdAssets:x,createdAtRound:_,deleted:A,incentiveEligible:E,lastHeartbeat:k,lastProposed:S,participation:R,rewardBase:T,sigType:I}){super(),this.address=e,this.amount=t,this.amountWithoutPendingRewards=r,this.minBalance=s,this.pendingRewards=n,this.rewards=i,this.round=o,this.status=a,this.totalAppsOptedIn=c,this.totalAssetsOptedIn=u,this.totalBoxBytes=l,this.totalBoxes=d,this.totalCreatedApps=h,this.totalCreatedAssets=p,this.appsLocalState=f,this.appsTotalExtraPages=g,this.appsTotalSchema=m,this.assets=y,this.authAddr=w,this.closedAtRound=b,this.createdApps=v,this.createdAssets=x,this.createdAtRound=_,this.deleted=A,this.incentiveEligible=E,this.lastHeartbeat=k,this.lastProposed=S,this.participation=R,this.rewardBase=T,this.sigType=I,this.attribute_map={address:"address",amount:"amount",amountWithoutPendingRewards:"amount-without-pending-rewards",minBalance:"min-balance",pendingRewards:"pending-rewards",rewards:"rewards",round:"round",status:"status",totalAppsOptedIn:"total-apps-opted-in",totalAssetsOptedIn:"total-assets-opted-in",totalBoxBytes:"total-box-bytes",totalBoxes:"total-boxes",totalCreatedApps:"total-created-apps",totalCreatedAssets:"total-created-assets",appsLocalState:"apps-local-state",appsTotalExtraPages:"apps-total-extra-pages",appsTotalSchema:"apps-total-schema",assets:"assets",authAddr:"auth-addr",closedAtRound:"closed-at-round",createdApps:"created-apps",createdAssets:"created-assets",createdAtRound:"created-at-round",deleted:"deleted",incentiveEligible:"incentive-eligible",lastHeartbeat:"last-heartbeat",lastProposed:"last-proposed",participation:"participation",rewardBase:"reward-base",sigType:"sig-type"}}static from_obj_for_encoding(e){if(void 0===e.address)throw new Error(`Response is missing required field 'address': ${e}`);if(void 0===e.amount)throw new Error(`Response is missing required field 'amount': ${e}`);if(void 0===e["amount-without-pending-rewards"])throw new Error(`Response is missing required field 'amount-without-pending-rewards': ${e}`);if(void 0===e["min-balance"])throw new Error(`Response is missing required field 'min-balance': ${e}`);if(void 0===e["pending-rewards"])throw new Error(`Response is missing required field 'pending-rewards': ${e}`);if(void 0===e.rewards)throw new Error(`Response is missing required field 'rewards': ${e}`);if(void 0===e.round)throw new Error(`Response is missing required field 'round': ${e}`);if(void 0===e.status)throw new Error(`Response is missing required field 'status': ${e}`);if(void 0===e["total-apps-opted-in"])throw new Error(`Response is missing required field 'total-apps-opted-in': ${e}`);if(void 0===e["total-assets-opted-in"])throw new Error(`Response is missing required field 'total-assets-opted-in': ${e}`);if(void 0===e["total-box-bytes"])throw new Error(`Response is missing required field 'total-box-bytes': ${e}`);if(void 0===e["total-boxes"])throw new Error(`Response is missing required field 'total-boxes': ${e}`);if(void 0===e["total-created-apps"])throw new Error(`Response is missing required field 'total-created-apps': ${e}`);if(void 0===e["total-created-assets"])throw new Error(`Response is missing required field 'total-created-assets': ${e}`);return new Nr({address:e.address,amount:e.amount,amountWithoutPendingRewards:e["amount-without-pending-rewards"],minBalance:e["min-balance"],pendingRewards:e["pending-rewards"],rewards:e.rewards,round:e.round,status:e.status,totalAppsOptedIn:e["total-apps-opted-in"],totalAssetsOptedIn:e["total-assets-opted-in"],totalBoxBytes:e["total-box-bytes"],totalBoxes:e["total-boxes"],totalCreatedApps:e["total-created-apps"],totalCreatedAssets:e["total-created-assets"],appsLocalState:void 0!==e["apps-local-state"]?e["apps-local-state"].map(Hr.from_obj_for_encoding):void 0,appsTotalExtraPages:e["apps-total-extra-pages"],appsTotalSchema:void 0!==e["apps-total-schema"]?Qr.from_obj_for_encoding(e["apps-total-schema"]):void 0,assets:void 0!==e.assets?e.assets.map(ss.from_obj_for_encoding):void 0,authAddr:e["auth-addr"],closedAtRound:e["closed-at-round"],createdApps:void 0!==e["created-apps"]?e["created-apps"].map(Vr.from_obj_for_encoding):void 0,createdAssets:void 0!==e["created-assets"]?e["created-assets"].map(ts.from_obj_for_encoding):void 0,createdAtRound:e["created-at-round"],deleted:e.deleted,incentiveEligible:e["incentive-eligible"],lastHeartbeat:e["last-heartbeat"],lastProposed:e["last-proposed"],participation:void 0!==e.participation?Wr.from_obj_for_encoding(e.participation):void 0,rewardBase:e["reward-base"],sigType:e["sig-type"]})}}class Wr extends ve{constructor({selectionParticipationKey:e,voteFirstValid:t,voteKeyDilution:r,voteLastValid:s,voteParticipationKey:n,stateProofKey:i}){super(),this.selectionParticipationKey="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.voteFirstValid=t,this.voteKeyDilution=r,this.voteLastValid=s,this.voteParticipationKey="string"==typeof n?new Uint8Array(o.lW.from(n,"base64")):n,this.stateProofKey="string"==typeof i?new Uint8Array(o.lW.from(i,"base64")):i,this.attribute_map={selectionParticipationKey:"selection-participation-key",voteFirstValid:"vote-first-valid",voteKeyDilution:"vote-key-dilution",voteLastValid:"vote-last-valid",voteParticipationKey:"vote-participation-key",stateProofKey:"state-proof-key"}}static from_obj_for_encoding(e){if(void 0===e["selection-participation-key"])throw new Error(`Response is missing required field 'selection-participation-key': ${e}`);if(void 0===e["vote-first-valid"])throw new Error(`Response is missing required field 'vote-first-valid': ${e}`);if(void 0===e["vote-key-dilution"])throw new Error(`Response is missing required field 'vote-key-dilution': ${e}`);if(void 0===e["vote-last-valid"])throw new Error(`Response is missing required field 'vote-last-valid': ${e}`);if(void 0===e["vote-participation-key"])throw new Error(`Response is missing required field 'vote-participation-key': ${e}`);return new Wr({selectionParticipationKey:e["selection-participation-key"],voteFirstValid:e["vote-first-valid"],voteKeyDilution:e["vote-key-dilution"],voteLastValid:e["vote-last-valid"],voteParticipationKey:e["vote-participation-key"],stateProofKey:e["state-proof-key"]})}}class Kr extends ve{constructor({account:e,currentRound:t}){super(),this.account=e,this.currentRound=t,this.attribute_map={account:"account",currentRound:"current-round"}}static from_obj_for_encoding(e){if(void 0===e.account)throw new Error(`Response is missing required field 'account': ${e}`);if(void 0===e["current-round"])throw new Error(`Response is missing required field 'current-round': ${e}`);return new Kr({account:Nr.from_obj_for_encoding(e.account),currentRound:e["current-round"]})}}class Fr extends ve{constructor({address:e,delta:t}){super(),this.address=e,this.delta=t,this.attribute_map={address:"address",delta:"delta"}}static from_obj_for_encoding(e){if(void 0===e.address)throw new Error(`Response is missing required field 'address': ${e}`);if(!Array.isArray(e.delta))throw new Error(`Response is missing required array field 'delta': ${e}`);return new Fr({address:e.address,delta:e.delta.map(ys.from_obj_for_encoding)})}}class zr extends ve{constructor({accounts:e,currentRound:t,nextToken:r}){super(),this.accounts=e,this.currentRound=t,this.nextToken=r,this.attribute_map={accounts:"accounts",currentRound:"current-round",nextToken:"next-token"}}static from_obj_for_encoding(e){if(!Array.isArray(e.accounts))throw new Error(`Response is missing required array field 'accounts': ${e}`);if(void 0===e["current-round"])throw new Error(`Response is missing required field 'current-round': ${e}`);return new zr({accounts:e.accounts.map(Nr.from_obj_for_encoding),currentRound:e["current-round"],nextToken:e["next-token"]})}}class Vr extends ve{constructor({id:e,params:t,createdAtRound:r,deleted:s,deletedAtRound:n}){super(),this.id=e,this.params=t,this.createdAtRound=r,this.deleted=s,this.deletedAtRound=n,this.attribute_map={id:"id",params:"params",createdAtRound:"created-at-round",deleted:"deleted",deletedAtRound:"deleted-at-round"}}static from_obj_for_encoding(e){if(void 0===e.id)throw new Error(`Response is missing required field 'id': ${e}`);if(void 0===e.params)throw new Error(`Response is missing required field 'params': ${e}`);return new Vr({id:e.id,params:Xr.from_obj_for_encoding(e.params),createdAtRound:e["created-at-round"],deleted:e.deleted,deletedAtRound:e["deleted-at-round"]})}}class Hr extends ve{constructor({id:e,schema:t,closedOutAtRound:r,deleted:s,keyValue:n,optedInAtRound:i}){super(),this.id=e,this.schema=t,this.closedOutAtRound=r,this.deleted=s,this.keyValue=n,this.optedInAtRound=i,this.attribute_map={id:"id",schema:"schema",closedOutAtRound:"closed-out-at-round",deleted:"deleted",keyValue:"key-value",optedInAtRound:"opted-in-at-round"}}static from_obj_for_encoding(e){if(void 0===e.id)throw new Error(`Response is missing required field 'id': ${e}`);if(void 0===e.schema)throw new Error(`Response is missing required field 'schema': ${e}`);return new Hr({id:e.id,schema:Qr.from_obj_for_encoding(e.schema),closedOutAtRound:e["closed-out-at-round"],deleted:e.deleted,keyValue:void 0!==e["key-value"]?e["key-value"].map(Ps.from_obj_for_encoding):void 0,optedInAtRound:e["opted-in-at-round"]})}}class Gr extends ve{constructor({appsLocalStates:e,currentRound:t,nextToken:r}){super(),this.appsLocalStates=e,this.currentRound=t,this.nextToken=r,this.attribute_map={appsLocalStates:"apps-local-states",currentRound:"current-round",nextToken:"next-token"}}static from_obj_for_encoding(e){if(!Array.isArray(e["apps-local-states"]))throw new Error(`Response is missing required array field 'apps-local-states': ${e}`);if(void 0===e["current-round"])throw new Error(`Response is missing required field 'current-round': ${e}`);return new Gr({appsLocalStates:e["apps-local-states"].map(Hr.from_obj_for_encoding),currentRound:e["current-round"],nextToken:e["next-token"]})}}class Yr extends ve{constructor({logs:e,txid:t}){super(),this.logs=e,this.txid=t,this.attribute_map={logs:"logs",txid:"txid"}}static from_obj_for_encoding(e){if(!Array.isArray(e.logs))throw new Error(`Response is missing required array field 'logs': ${e}`);if(void 0===e.txid)throw new Error(`Response is missing required field 'txid': ${e}`);return new Yr({logs:e.logs,txid:e.txid})}}class Jr extends ve{constructor({applicationId:e,currentRound:t,logData:r,nextToken:s}){super(),this.applicationId=e,this.currentRound=t,this.logData=r,this.nextToken=s,this.attribute_map={applicationId:"application-id",currentRound:"current-round",logData:"log-data",nextToken:"next-token"}}static from_obj_for_encoding(e){if(void 0===e["application-id"])throw new Error(`Response is missing required field 'application-id': ${e}`);if(void 0===e["current-round"])throw new Error(`Response is missing required field 'current-round': ${e}`);return new Jr({applicationId:e["application-id"],currentRound:e["current-round"],logData:void 0!==e["log-data"]?e["log-data"].map(Yr.from_obj_for_encoding):void 0,nextToken:e["next-token"]})}}class Xr extends ve{constructor({approvalProgram:e,clearStateProgram:t,creator:r,extraProgramPages:s,globalState:n,globalStateSchema:i,localStateSchema:a}){super(),this.approvalProgram="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.clearStateProgram="string"==typeof t?new Uint8Array(o.lW.from(t,"base64")):t,this.creator=r,this.extraProgramPages=s,this.globalState=n,this.globalStateSchema=i,this.localStateSchema=a,this.attribute_map={approvalProgram:"approval-program",clearStateProgram:"clear-state-program",creator:"creator",extraProgramPages:"extra-program-pages",globalState:"global-state",globalStateSchema:"global-state-schema",localStateSchema:"local-state-schema"}}static from_obj_for_encoding(e){if(void 0===e["approval-program"])throw new Error(`Response is missing required field 'approval-program': ${e}`);if(void 0===e["clear-state-program"])throw new Error(`Response is missing required field 'clear-state-program': ${e}`);return new Xr({approvalProgram:e["approval-program"],clearStateProgram:e["clear-state-program"],creator:e.creator,extraProgramPages:e["extra-program-pages"],globalState:void 0!==e["global-state"]?e["global-state"].map(Ps.from_obj_for_encoding):void 0,globalStateSchema:void 0!==e["global-state-schema"]?Qr.from_obj_for_encoding(e["global-state-schema"]):void 0,localStateSchema:void 0!==e["local-state-schema"]?Qr.from_obj_for_encoding(e["local-state-schema"]):void 0})}}class Zr extends ve{constructor({currentRound:e,application:t}){super(),this.currentRound=e,this.application=t,this.attribute_map={currentRound:"current-round",application:"application"}}static from_obj_for_encoding(e){if(void 0===e["current-round"])throw new Error(`Response is missing required field 'current-round': ${e}`);return new Zr({currentRound:e["current-round"],application:void 0!==e.application?Vr.from_obj_for_encoding(e.application):void 0})}}class Qr extends ve{constructor({numByteSlice:e,numUint:t}){super(),this.numByteSlice=e,this.numUint=t,this.attribute_map={numByteSlice:"num-byte-slice",numUint:"num-uint"}}static from_obj_for_encoding(e){if(void 0===e["num-byte-slice"])throw new Error(`Response is missing required field 'num-byte-slice': ${e}`);if(void 0===e["num-uint"])throw new Error(`Response is missing required field 'num-uint': ${e}`);return new Qr({numByteSlice:e["num-byte-slice"],numUint:e["num-uint"]})}}class es extends ve{constructor({applications:e,currentRound:t,nextToken:r}){super(),this.applications=e,this.currentRound=t,this.nextToken=r,this.attribute_map={applications:"applications",currentRound:"current-round",nextToken:"next-token"}}static from_obj_for_encoding(e){if(!Array.isArray(e.applications))throw new Error(`Response is missing required array field 'applications': ${e}`);if(void 0===e["current-round"])throw new Error(`Response is missing required field 'current-round': ${e}`);return new es({applications:e.applications.map(Vr.from_obj_for_encoding),currentRound:e["current-round"],nextToken:e["next-token"]})}}class ts extends ve{constructor({index:e,params:t,createdAtRound:r,deleted:s,destroyedAtRound:n}){super(),this.index=e,this.params=t,this.createdAtRound=r,this.deleted=s,this.destroyedAtRound=n,this.attribute_map={index:"index",params:"params",createdAtRound:"created-at-round",deleted:"deleted",destroyedAtRound:"destroyed-at-round"}}static from_obj_for_encoding(e){if(void 0===e.index)throw new Error(`Response is missing required field 'index': ${e}`);if(void 0===e.params)throw new Error(`Response is missing required field 'params': ${e}`);return new ts({index:e.index,params:is.from_obj_for_encoding(e.params),createdAtRound:e["created-at-round"],deleted:e.deleted,destroyedAtRound:e["destroyed-at-round"]})}}class rs extends ve{constructor({balances:e,currentRound:t,nextToken:r}){super(),this.balances=e,this.currentRound=t,this.nextToken=r,this.attribute_map={balances:"balances",currentRound:"current-round",nextToken:"next-token"}}static from_obj_for_encoding(e){if(!Array.isArray(e.balances))throw new Error(`Response is missing required array field 'balances': ${e}`);if(void 0===e["current-round"])throw new Error(`Response is missing required field 'current-round': ${e}`);return new rs({balances:e.balances.map(_s.from_obj_for_encoding),currentRound:e["current-round"],nextToken:e["next-token"]})}}class ss extends ve{constructor({amount:e,assetId:t,isFrozen:r,deleted:s,optedInAtRound:n,optedOutAtRound:i}){super(),this.amount=e,this.assetId=t,this.isFrozen=r,this.deleted=s,this.optedInAtRound=n,this.optedOutAtRound=i,this.attribute_map={amount:"amount",assetId:"asset-id",isFrozen:"is-frozen",deleted:"deleted",optedInAtRound:"opted-in-at-round",optedOutAtRound:"opted-out-at-round"}}static from_obj_for_encoding(e){if(void 0===e.amount)throw new Error(`Response is missing required field 'amount': ${e}`);if(void 0===e["asset-id"])throw new Error(`Response is missing required field 'asset-id': ${e}`);if(void 0===e["is-frozen"])throw new Error(`Response is missing required field 'is-frozen': ${e}`);return new ss({amount:e.amount,assetId:e["asset-id"],isFrozen:e["is-frozen"],deleted:e.deleted,optedInAtRound:e["opted-in-at-round"],optedOutAtRound:e["opted-out-at-round"]})}}class ns extends ve{constructor({assets:e,currentRound:t,nextToken:r}){super(),this.assets=e,this.currentRound=t,this.nextToken=r,this.attribute_map={assets:"assets",currentRound:"current-round",nextToken:"next-token"}}static from_obj_for_encoding(e){if(!Array.isArray(e.assets))throw new Error(`Response is missing required array field 'assets': ${e}`);if(void 0===e["current-round"])throw new Error(`Response is missing required field 'current-round': ${e}`);return new ns({assets:e.assets.map(ss.from_obj_for_encoding),currentRound:e["current-round"],nextToken:e["next-token"]})}}class is extends ve{constructor({creator:e,decimals:t,total:r,clawback:s,defaultFrozen:n,freeze:i,manager:a,metadataHash:c,name:u,nameB64:l,reserve:d,unitName:h,unitNameB64:p,url:f,urlB64:g}){super(),this.creator=e,this.decimals=t,this.total=r,this.clawback=s,this.defaultFrozen=n,this.freeze=i,this.manager=a,this.metadataHash="string"==typeof c?new Uint8Array(o.lW.from(c,"base64")):c,this.name=u,this.nameB64="string"==typeof l?new Uint8Array(o.lW.from(l,"base64")):l,this.reserve=d,this.unitName=h,this.unitNameB64="string"==typeof p?new Uint8Array(o.lW.from(p,"base64")):p,this.url=f,this.urlB64="string"==typeof g?new Uint8Array(o.lW.from(g,"base64")):g,this.attribute_map={creator:"creator",decimals:"decimals",total:"total",clawback:"clawback",defaultFrozen:"default-frozen",freeze:"freeze",manager:"manager",metadataHash:"metadata-hash",name:"name",nameB64:"name-b64",reserve:"reserve",unitName:"unit-name",unitNameB64:"unit-name-b64",url:"url",urlB64:"url-b64"}}static from_obj_for_encoding(e){if(void 0===e.creator)throw new Error(`Response is missing required field 'creator': ${e}`);if(void 0===e.decimals)throw new Error(`Response is missing required field 'decimals': ${e}`);if(void 0===e.total)throw new Error(`Response is missing required field 'total': ${e}`);return new is({creator:e.creator,decimals:e.decimals,total:e.total,clawback:e.clawback,defaultFrozen:e["default-frozen"],freeze:e.freeze,manager:e.manager,metadataHash:e["metadata-hash"],name:e.name,nameB64:e["name-b64"],reserve:e.reserve,unitName:e["unit-name"],unitNameB64:e["unit-name-b64"],url:e.url,urlB64:e["url-b64"]})}}class os extends ve{constructor({asset:e,currentRound:t}){super(),this.asset=e,this.currentRound=t,this.attribute_map={asset:"asset",currentRound:"current-round"}}static from_obj_for_encoding(e){if(void 0===e.asset)throw new Error(`Response is missing required field 'asset': ${e}`);if(void 0===e["current-round"])throw new Error(`Response is missing required field 'current-round': ${e}`);return new os({asset:ts.from_obj_for_encoding(e.asset),currentRound:e["current-round"]})}}class as extends ve{constructor({assets:e,currentRound:t,nextToken:r}){super(),this.assets=e,this.currentRound=t,this.nextToken=r,this.attribute_map={assets:"assets",currentRound:"current-round",nextToken:"next-token"}}static from_obj_for_encoding(e){if(!Array.isArray(e.assets))throw new Error(`Response is missing required array field 'assets': ${e}`);if(void 0===e["current-round"])throw new Error(`Response is missing required field 'current-round': ${e}`);return new as({assets:e.assets.map(ts.from_obj_for_encoding),currentRound:e["current-round"],nextToken:e["next-token"]})}}class cs extends ve{constructor({genesisHash:e,genesisId:t,previousBlockHash:r,round:s,seed:n,timestamp:i,transactionsRoot:a,transactionsRootSha256:c,bonus:u,feesCollected:l,participationUpdates:d,proposer:h,proposerPayout:p,rewards:f,stateProofTracking:g,transactions:m,txnCounter:y,upgradeState:w,upgradeVote:b}){super(),this.genesisHash="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.genesisId=t,this.previousBlockHash="string"==typeof r?new Uint8Array(o.lW.from(r,"base64")):r,this.round=s,this.seed="string"==typeof n?new Uint8Array(o.lW.from(n,"base64")):n,this.timestamp=i,this.transactionsRoot="string"==typeof a?new Uint8Array(o.lW.from(a,"base64")):a,this.transactionsRootSha256="string"==typeof c?new Uint8Array(o.lW.from(c,"base64")):c,this.bonus=u,this.feesCollected=l,this.participationUpdates=d,this.proposer=h,this.proposerPayout=p,this.rewards=f,this.stateProofTracking=g,this.transactions=m,this.txnCounter=y,this.upgradeState=w,this.upgradeVote=b,this.attribute_map={genesisHash:"genesis-hash",genesisId:"genesis-id",previousBlockHash:"previous-block-hash",round:"round",seed:"seed",timestamp:"timestamp",transactionsRoot:"transactions-root",transactionsRootSha256:"transactions-root-sha256",bonus:"bonus",feesCollected:"fees-collected",participationUpdates:"participation-updates",proposer:"proposer",proposerPayout:"proposer-payout",rewards:"rewards",stateProofTracking:"state-proof-tracking",transactions:"transactions",txnCounter:"txn-counter",upgradeState:"upgrade-state",upgradeVote:"upgrade-vote"}}static from_obj_for_encoding(e){if(void 0===e["genesis-hash"])throw new Error(`Response is missing required field 'genesis-hash': ${e}`);if(void 0===e["genesis-id"])throw new Error(`Response is missing required field 'genesis-id': ${e}`);if(void 0===e["previous-block-hash"])throw new Error(`Response is missing required field 'previous-block-hash': ${e}`);if(void 0===e.round)throw new Error(`Response is missing required field 'round': ${e}`);if(void 0===e.seed)throw new Error(`Response is missing required field 'seed': ${e}`);if(void 0===e.timestamp)throw new Error(`Response is missing required field 'timestamp': ${e}`);if(void 0===e["transactions-root"])throw new Error(`Response is missing required field 'transactions-root': ${e}`);if(void 0===e["transactions-root-sha256"])throw new Error(`Response is missing required field 'transactions-root-sha256': ${e}`);return new cs({genesisHash:e["genesis-hash"],genesisId:e["genesis-id"],previousBlockHash:e["previous-block-hash"],round:e.round,seed:e.seed,timestamp:e.timestamp,transactionsRoot:e["transactions-root"],transactionsRootSha256:e["transactions-root-sha256"],bonus:e.bonus,feesCollected:e["fees-collected"],participationUpdates:void 0!==e["participation-updates"]?As.from_obj_for_encoding(e["participation-updates"]):void 0,proposer:e.proposer,proposerPayout:e["proposer-payout"],rewards:void 0!==e.rewards?us.from_obj_for_encoding(e.rewards):void 0,stateProofTracking:void 0!==e["state-proof-tracking"]?e["state-proof-tracking"].map(Is.from_obj_for_encoding):void 0,transactions:void 0!==e.transactions?e.transactions.map(qs.from_obj_for_encoding):void 0,txnCounter:e["txn-counter"],upgradeState:void 0!==e["upgrade-state"]?ls.from_obj_for_encoding(e["upgrade-state"]):void 0,upgradeVote:void 0!==e["upgrade-vote"]?ds.from_obj_for_encoding(e["upgrade-vote"]):void 0})}}class us extends ve{constructor({feeSink:e,rewardsCalculationRound:t,rewardsLevel:r,rewardsPool:s,rewardsRate:n,rewardsResidue:i}){super(),this.feeSink=e,this.rewardsCalculationRound=t,this.rewardsLevel=r,this.rewardsPool=s,this.rewardsRate=n,this.rewardsResidue=i,this.attribute_map={feeSink:"fee-sink",rewardsCalculationRound:"rewards-calculation-round",rewardsLevel:"rewards-level",rewardsPool:"rewards-pool",rewardsRate:"rewards-rate",rewardsResidue:"rewards-residue"}}static from_obj_for_encoding(e){if(void 0===e["fee-sink"])throw new Error(`Response is missing required field 'fee-sink': ${e}`);if(void 0===e["rewards-calculation-round"])throw new Error(`Response is missing required field 'rewards-calculation-round': ${e}`);if(void 0===e["rewards-level"])throw new Error(`Response is missing required field 'rewards-level': ${e}`);if(void 0===e["rewards-pool"])throw new Error(`Response is missing required field 'rewards-pool': ${e}`);if(void 0===e["rewards-rate"])throw new Error(`Response is missing required field 'rewards-rate': ${e}`);if(void 0===e["rewards-residue"])throw new Error(`Response is missing required field 'rewards-residue': ${e}`);return new us({feeSink:e["fee-sink"],rewardsCalculationRound:e["rewards-calculation-round"],rewardsLevel:e["rewards-level"],rewardsPool:e["rewards-pool"],rewardsRate:e["rewards-rate"],rewardsResidue:e["rewards-residue"]})}}class ls extends ve{constructor({currentProtocol:e,nextProtocol:t,nextProtocolApprovals:r,nextProtocolSwitchOn:s,nextProtocolVoteBefore:n}){super(),this.currentProtocol=e,this.nextProtocol=t,this.nextProtocolApprovals=r,this.nextProtocolSwitchOn=s,this.nextProtocolVoteBefore=n,this.attribute_map={currentProtocol:"current-protocol",nextProtocol:"next-protocol",nextProtocolApprovals:"next-protocol-approvals",nextProtocolSwitchOn:"next-protocol-switch-on",nextProtocolVoteBefore:"next-protocol-vote-before"}}static from_obj_for_encoding(e){if(void 0===e["current-protocol"])throw new Error(`Response is missing required field 'current-protocol': ${e}`);return new ls({currentProtocol:e["current-protocol"],nextProtocol:e["next-protocol"],nextProtocolApprovals:e["next-protocol-approvals"],nextProtocolSwitchOn:e["next-protocol-switch-on"],nextProtocolVoteBefore:e["next-protocol-vote-before"]})}}class ds extends ve{constructor({upgradeApprove:e,upgradeDelay:t,upgradePropose:r}){super(),this.upgradeApprove=e,this.upgradeDelay=t,this.upgradePropose=r,this.attribute_map={upgradeApprove:"upgrade-approve",upgradeDelay:"upgrade-delay",upgradePropose:"upgrade-propose"}}static from_obj_for_encoding(e){return new ds({upgradeApprove:e["upgrade-approve"],upgradeDelay:e["upgrade-delay"],upgradePropose:e["upgrade-propose"]})}}class hs extends ve{constructor({name:e,round:t,value:r}){super(),this.name="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.round=t,this.value="string"==typeof r?new Uint8Array(o.lW.from(r,"base64")):r,this.attribute_map={name:"name",round:"round",value:"value"}}static from_obj_for_encoding(e){if(void 0===e.name)throw new Error(`Response is missing required field 'name': ${e}`);if(void 0===e.round)throw new Error(`Response is missing required field 'round': ${e}`);if(void 0===e.value)throw new Error(`Response is missing required field 'value': ${e}`);return new hs({name:e.name,round:e.round,value:e.value})}}class ps extends ve{constructor({name:e}){super(),this.name="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.attribute_map={name:"name"}}static from_obj_for_encoding(e){if(void 0===e.name)throw new Error(`Response is missing required field 'name': ${e}`);return new ps({name:e.name})}}class fs extends ve{constructor({applicationId:e,boxes:t,nextToken:r}){super(),this.applicationId=e,this.boxes=t,this.nextToken=r,this.attribute_map={applicationId:"application-id",boxes:"boxes",nextToken:"next-token"}}static from_obj_for_encoding(e){if(void 0===e["application-id"])throw new Error(`Response is missing required field 'application-id': ${e}`);if(!Array.isArray(e.boxes))throw new Error(`Response is missing required array field 'boxes': ${e}`);return new fs({applicationId:e["application-id"],boxes:e.boxes.map(ps.from_obj_for_encoding),nextToken:e["next-token"]})}}class gs extends ve{constructor({message:e,data:t}){super(),this.message=e,this.data=t,this.attribute_map={message:"message",data:"data"}}static from_obj_for_encoding(e){if(void 0===e.message)throw new Error(`Response is missing required field 'message': ${e}`);return new gs({message:e.message,data:e.data})}}class ms extends ve{constructor({action:e,bytes:t,uint:r}){super(),this.action=e,this.bytes=t,this.uint=r,this.attribute_map={action:"action",bytes:"bytes",uint:"uint"}}static from_obj_for_encoding(e){if(void 0===e.action)throw new Error(`Response is missing required field 'action': ${e}`);return new ms({action:e.action,bytes:e.bytes,uint:e.uint})}}class ys extends ve{constructor({key:e,value:t}){super(),this.key=e,this.value=t,this.attribute_map={key:"key",value:"value"}}static from_obj_for_encoding(e){if(void 0===e.key)throw new Error(`Response is missing required field 'key': ${e}`);if(void 0===e.value)throw new Error(`Response is missing required field 'value': ${e}`);return new ys({key:e.key,value:ms.from_obj_for_encoding(e.value)})}}class ws extends ve{constructor({hashType:e}){super(),this.hashType=e,this.attribute_map={hashType:"hash-type"}}static from_obj_for_encoding(e){return new ws({hashType:e["hash-type"]})}}class bs extends ve{constructor({dbAvailable:e,isMigrating:t,message:r,round:s,version:n,data:i,errors:o}){super(),this.dbAvailable=e,this.isMigrating=t,this.message=r,this.round=s,this.version=n,this.data=i,this.errors=o,this.attribute_map={dbAvailable:"db-available",isMigrating:"is-migrating",message:"message",round:"round",version:"version",data:"data",errors:"errors"}}static from_obj_for_encoding(e){if(void 0===e["db-available"])throw new Error(`Response is missing required field 'db-available': ${e}`);if(void 0===e["is-migrating"])throw new Error(`Response is missing required field 'is-migrating': ${e}`);if(void 0===e.message)throw new Error(`Response is missing required field 'message': ${e}`);if(void 0===e.round)throw new Error(`Response is missing required field 'round': ${e}`);if(void 0===e.version)throw new Error(`Response is missing required field 'version': ${e}`);return new bs({dbAvailable:e["db-available"],isMigrating:e["is-migrating"],message:e.message,round:e.round,version:e.version,data:e.data,errors:e.errors})}}class vs extends ve{constructor({blockHeadersCommitment:e,firstAttestedRound:t,latestAttestedRound:r,lnProvenWeight:s,votersCommitment:n}){super(),this.blockHeadersCommitment="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.firstAttestedRound=t,this.latestAttestedRound=r,this.lnProvenWeight=s,this.votersCommitment="string"==typeof n?new Uint8Array(o.lW.from(n,"base64")):n,this.attribute_map={blockHeadersCommitment:"block-headers-commitment",firstAttestedRound:"first-attested-round",latestAttestedRound:"latest-attested-round",lnProvenWeight:"ln-proven-weight",votersCommitment:"voters-commitment"}}static from_obj_for_encoding(e){return new vs({blockHeadersCommitment:e["block-headers-commitment"],firstAttestedRound:e["first-attested-round"],latestAttestedRound:e["latest-attested-round"],lnProvenWeight:e["ln-proven-weight"],votersCommitment:e["voters-commitment"]})}}class xs extends ve{constructor({hashFactory:e,path:t,treeDepth:r}){super(),this.hashFactory=e,this.path=t,this.treeDepth=r,this.attribute_map={hashFactory:"hash-factory",path:"path",treeDepth:"tree-depth"}}static from_obj_for_encoding(e){return new xs({hashFactory:void 0!==e["hash-factory"]?ws.from_obj_for_encoding(e["hash-factory"]):void 0,path:e.path,treeDepth:e["tree-depth"]})}}class _s extends ve{constructor({address:e,amount:t,isFrozen:r,deleted:s,optedInAtRound:n,optedOutAtRound:i}){super(),this.address=e,this.amount=t,this.isFrozen=r,this.deleted=s,this.optedInAtRound=n,this.optedOutAtRound=i,this.attribute_map={address:"address",amount:"amount",isFrozen:"is-frozen",deleted:"deleted",optedInAtRound:"opted-in-at-round",optedOutAtRound:"opted-out-at-round"}}static from_obj_for_encoding(e){if(void 0===e.address)throw new Error(`Response is missing required field 'address': ${e}`);if(void 0===e.amount)throw new Error(`Response is missing required field 'amount': ${e}`);if(void 0===e["is-frozen"])throw new Error(`Response is missing required field 'is-frozen': ${e}`);return new _s({address:e.address,amount:e.amount,isFrozen:e["is-frozen"],deleted:e.deleted,optedInAtRound:e["opted-in-at-round"],optedOutAtRound:e["opted-out-at-round"]})}}class As extends ve{constructor({absentParticipationAccounts:e,expiredParticipationAccounts:t}){super(),this.absentParticipationAccounts=e,this.expiredParticipationAccounts=t,this.attribute_map={absentParticipationAccounts:"absent-participation-accounts",expiredParticipationAccounts:"expired-participation-accounts"}}static from_obj_for_encoding(e){return new As({absentParticipationAccounts:e["absent-participation-accounts"],expiredParticipationAccounts:e["expired-participation-accounts"]})}}class Es extends ve{constructor({partProofs:e,positionsToReveal:t,reveals:r,saltVersion:s,sigCommit:n,sigProofs:i,signedWeight:a}){super(),this.partProofs=e,this.positionsToReveal=t,this.reveals=r,this.saltVersion=s,this.sigCommit="string"==typeof n?new Uint8Array(o.lW.from(n,"base64")):n,this.sigProofs=i,this.signedWeight=a,this.attribute_map={partProofs:"part-proofs",positionsToReveal:"positions-to-reveal",reveals:"reveals",saltVersion:"salt-version",sigCommit:"sig-commit",sigProofs:"sig-proofs",signedWeight:"signed-weight"}}static from_obj_for_encoding(e){return new Es({partProofs:void 0!==e["part-proofs"]?xs.from_obj_for_encoding(e["part-proofs"]):void 0,positionsToReveal:e["positions-to-reveal"],reveals:void 0!==e.reveals?e.reveals.map(Ss.from_obj_for_encoding):void 0,saltVersion:e["salt-version"],sigCommit:e["sig-commit"],sigProofs:void 0!==e["sig-proofs"]?xs.from_obj_for_encoding(e["sig-proofs"]):void 0,signedWeight:e["signed-weight"]})}}class ks extends ve{constructor({verifier:e,weight:t}){super(),this.verifier=e,this.weight=t,this.attribute_map={verifier:"verifier",weight:"weight"}}static from_obj_for_encoding(e){return new ks({verifier:void 0!==e.verifier?Bs.from_obj_for_encoding(e.verifier):void 0,weight:e.weight})}}class Ss extends ve{constructor({participant:e,position:t,sigSlot:r}){super(),this.participant=e,this.position=t,this.sigSlot=r,this.attribute_map={participant:"participant",position:"position",sigSlot:"sig-slot"}}static from_obj_for_encoding(e){return new Ss({participant:void 0!==e.participant?ks.from_obj_for_encoding(e.participant):void 0,position:e.position,sigSlot:void 0!==e["sig-slot"]?Rs.from_obj_for_encoding(e["sig-slot"]):void 0})}}class Rs extends ve{constructor({lowerSigWeight:e,signature:t}){super(),this.lowerSigWeight=e,this.signature=t,this.attribute_map={lowerSigWeight:"lower-sig-weight",signature:"signature"}}static from_obj_for_encoding(e){return new Rs({lowerSigWeight:e["lower-sig-weight"],signature:void 0!==e.signature?Ts.from_obj_for_encoding(e.signature):void 0})}}class Ts extends ve{constructor({falconSignature:e,merkleArrayIndex:t,proof:r,verifyingKey:s}){super(),this.falconSignature="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.merkleArrayIndex=t,this.proof=r,this.verifyingKey="string"==typeof s?new Uint8Array(o.lW.from(s,"base64")):s,this.attribute_map={falconSignature:"falcon-signature",merkleArrayIndex:"merkle-array-index",proof:"proof",verifyingKey:"verifying-key"}}static from_obj_for_encoding(e){return new Ts({falconSignature:e["falcon-signature"],merkleArrayIndex:e["merkle-array-index"],proof:void 0!==e.proof?xs.from_obj_for_encoding(e.proof):void 0,verifyingKey:e["verifying-key"]})}}class Is extends ve{constructor({nextRound:e,onlineTotalWeight:t,type:r,votersCommitment:s}){super(),this.nextRound=e,this.onlineTotalWeight=t,this.type=r,this.votersCommitment="string"==typeof s?new Uint8Array(o.lW.from(s,"base64")):s,this.attribute_map={nextRound:"next-round",onlineTotalWeight:"online-total-weight",type:"type",votersCommitment:"voters-commitment"}}static from_obj_for_encoding(e){return new Is({nextRound:e["next-round"],onlineTotalWeight:e["online-total-weight"],type:e.type,votersCommitment:e["voters-commitment"]})}}class Bs extends ve{constructor({commitment:e,keyLifetime:t}){super(),this.commitment="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.keyLifetime=t,this.attribute_map={commitment:"commitment",keyLifetime:"key-lifetime"}}static from_obj_for_encoding(e){return new Bs({commitment:e.commitment,keyLifetime:e["key-lifetime"]})}}class Us extends ve{constructor({numByteSlice:e,numUint:t}){super(),this.numByteSlice=e,this.numUint=t,this.attribute_map={numByteSlice:"num-byte-slice",numUint:"num-uint"}}static from_obj_for_encoding(e){if(void 0===e["num-byte-slice"])throw new Error(`Response is missing required field 'num-byte-slice': ${e}`);if(void 0===e["num-uint"])throw new Error(`Response is missing required field 'num-uint': ${e}`);return new Us({numByteSlice:e["num-byte-slice"],numUint:e["num-uint"]})}}class Ps extends ve{constructor({key:e,value:t}){super(),this.key=e,this.value=t,this.attribute_map={key:"key",value:"value"}}static from_obj_for_encoding(e){if(void 0===e.key)throw new Error(`Response is missing required field 'key': ${e}`);if(void 0===e.value)throw new Error(`Response is missing required field 'value': ${e}`);return new Ps({key:e.key,value:js.from_obj_for_encoding(e.value)})}}class js extends ve{constructor({bytes:e,type:t,uint:r}){super(),this.bytes=e,this.type=t,this.uint=r,this.attribute_map={bytes:"bytes",type:"type",uint:"uint"}}static from_obj_for_encoding(e){if(void 0===e.bytes)throw new Error(`Response is missing required field 'bytes': ${e}`);if(void 0===e.type)throw new Error(`Response is missing required field 'type': ${e}`);if(void 0===e.uint)throw new Error(`Response is missing required field 'uint': ${e}`);return new js({bytes:e.bytes,type:e.type,uint:e.uint})}}class qs extends ve{constructor({fee:e,firstValid:t,lastValid:r,sender:s,applicationTransaction:n,assetConfigTransaction:i,assetFreezeTransaction:a,assetTransferTransaction:c,authAddr:u,closeRewards:l,closingAmount:d,confirmedRound:h,createdApplicationIndex:p,createdAssetIndex:f,genesisHash:g,genesisId:m,globalStateDelta:y,group:w,id:b,innerTxns:v,intraRoundOffset:x,keyregTransaction:_,lease:A,localStateDelta:E,logs:k,note:S,paymentTransaction:R,receiverRewards:T,rekeyTo:I,roundTime:B,senderRewards:U,signature:P,stateProofTransaction:j,txType:q}){super(),this.fee=e,this.firstValid=t,this.lastValid=r,this.sender=s,this.applicationTransaction=n,this.assetConfigTransaction=i,this.assetFreezeTransaction=a,this.assetTransferTransaction=c,this.authAddr=u,this.closeRewards=l,this.closingAmount=d,this.confirmedRound=h,this.createdApplicationIndex=p,this.createdAssetIndex=f,this.genesisHash="string"==typeof g?new Uint8Array(o.lW.from(g,"base64")):g,this.genesisId=m,this.globalStateDelta=y,this.group="string"==typeof w?new Uint8Array(o.lW.from(w,"base64")):w,this.id=b,this.innerTxns=v,this.intraRoundOffset=x,this.keyregTransaction=_,this.lease="string"==typeof A?new Uint8Array(o.lW.from(A,"base64")):A,this.localStateDelta=E,this.logs=k,this.note="string"==typeof S?new Uint8Array(o.lW.from(S,"base64")):S,this.paymentTransaction=R,this.receiverRewards=T,this.rekeyTo=I,this.roundTime=B,this.senderRewards=U,this.signature=P,this.stateProofTransaction=j,this.txType=q,this.attribute_map={fee:"fee",firstValid:"first-valid",lastValid:"last-valid",sender:"sender",applicationTransaction:"application-transaction",assetConfigTransaction:"asset-config-transaction",assetFreezeTransaction:"asset-freeze-transaction",assetTransferTransaction:"asset-transfer-transaction",authAddr:"auth-addr",closeRewards:"close-rewards",closingAmount:"closing-amount",confirmedRound:"confirmed-round",createdApplicationIndex:"created-application-index",createdAssetIndex:"created-asset-index",genesisHash:"genesis-hash",genesisId:"genesis-id",globalStateDelta:"global-state-delta",group:"group",id:"id",innerTxns:"inner-txns",intraRoundOffset:"intra-round-offset",keyregTransaction:"keyreg-transaction",lease:"lease",localStateDelta:"local-state-delta",logs:"logs",note:"note",paymentTransaction:"payment-transaction",receiverRewards:"receiver-rewards",rekeyTo:"rekey-to",roundTime:"round-time",senderRewards:"sender-rewards",signature:"signature",stateProofTransaction:"state-proof-transaction",txType:"tx-type"}}static from_obj_for_encoding(e){if(void 0===e.fee)throw new Error(`Response is missing required field 'fee': ${e}`);if(void 0===e["first-valid"])throw new Error(`Response is missing required field 'first-valid': ${e}`);if(void 0===e["last-valid"])throw new Error(`Response is missing required field 'last-valid': ${e}`);if(void 0===e.sender)throw new Error(`Response is missing required field 'sender': ${e}`);return new qs({fee:e.fee,firstValid:e["first-valid"],lastValid:e["last-valid"],sender:e.sender,applicationTransaction:void 0!==e["application-transaction"]?$s.from_obj_for_encoding(e["application-transaction"]):void 0,assetConfigTransaction:void 0!==e["asset-config-transaction"]?Cs.from_obj_for_encoding(e["asset-config-transaction"]):void 0,assetFreezeTransaction:void 0!==e["asset-freeze-transaction"]?Ds.from_obj_for_encoding(e["asset-freeze-transaction"]):void 0,assetTransferTransaction:void 0!==e["asset-transfer-transaction"]?Os.from_obj_for_encoding(e["asset-transfer-transaction"]):void 0,authAddr:e["auth-addr"],closeRewards:e["close-rewards"],closingAmount:e["closing-amount"],confirmedRound:e["confirmed-round"],createdApplicationIndex:e["created-application-index"],createdAssetIndex:e["created-asset-index"],genesisHash:e["genesis-hash"],genesisId:e["genesis-id"],globalStateDelta:void 0!==e["global-state-delta"]?e["global-state-delta"].map(ys.from_obj_for_encoding):void 0,group:e.group,id:e.id,innerTxns:void 0!==e["inner-txns"]?e["inner-txns"].map(qs.from_obj_for_encoding):void 0,intraRoundOffset:e["intra-round-offset"],keyregTransaction:void 0!==e["keyreg-transaction"]?Ls.from_obj_for_encoding(e["keyreg-transaction"]):void 0,lease:e.lease,localStateDelta:void 0!==e["local-state-delta"]?e["local-state-delta"].map(Fr.from_obj_for_encoding):void 0,logs:e.logs,note:e.note,paymentTransaction:void 0!==e["payment-transaction"]?Ms.from_obj_for_encoding(e["payment-transaction"]):void 0,receiverRewards:e["receiver-rewards"],rekeyTo:e["rekey-to"],roundTime:e["round-time"],senderRewards:e["sender-rewards"],signature:void 0!==e.signature?Ws.from_obj_for_encoding(e.signature):void 0,stateProofTransaction:void 0!==e["state-proof-transaction"]?Vs.from_obj_for_encoding(e["state-proof-transaction"]):void 0,txType:e["tx-type"]})}}class $s extends ve{constructor({applicationId:e,accounts:t,applicationArgs:r,approvalProgram:s,clearStateProgram:n,extraProgramPages:i,foreignApps:a,foreignAssets:c,globalStateSchema:u,localStateSchema:l,onCompletion:d}){super(),this.applicationId=e,this.accounts=t,this.applicationArgs=r,this.approvalProgram="string"==typeof s?new Uint8Array(o.lW.from(s,"base64")):s,this.clearStateProgram="string"==typeof n?new Uint8Array(o.lW.from(n,"base64")):n,this.extraProgramPages=i,this.foreignApps=a,this.foreignAssets=c,this.globalStateSchema=u,this.localStateSchema=l,this.onCompletion=d,this.attribute_map={applicationId:"application-id",accounts:"accounts",applicationArgs:"application-args",approvalProgram:"approval-program",clearStateProgram:"clear-state-program",extraProgramPages:"extra-program-pages",foreignApps:"foreign-apps",foreignAssets:"foreign-assets",globalStateSchema:"global-state-schema",localStateSchema:"local-state-schema",onCompletion:"on-completion"}}static from_obj_for_encoding(e){if(void 0===e["application-id"])throw new Error(`Response is missing required field 'application-id': ${e}`);return new $s({applicationId:e["application-id"],accounts:e.accounts,applicationArgs:e["application-args"],approvalProgram:e["approval-program"],clearStateProgram:e["clear-state-program"],extraProgramPages:e["extra-program-pages"],foreignApps:e["foreign-apps"],foreignAssets:e["foreign-assets"],globalStateSchema:void 0!==e["global-state-schema"]?Us.from_obj_for_encoding(e["global-state-schema"]):void 0,localStateSchema:void 0!==e["local-state-schema"]?Us.from_obj_for_encoding(e["local-state-schema"]):void 0,onCompletion:e["on-completion"]})}}class Cs extends ve{constructor({assetId:e,params:t}){super(),this.assetId=e,this.params=t,this.attribute_map={assetId:"asset-id",params:"params"}}static from_obj_for_encoding(e){return new Cs({assetId:e["asset-id"],params:void 0!==e.params?is.from_obj_for_encoding(e.params):void 0})}}class Ds extends ve{constructor({address:e,assetId:t,newFreezeStatus:r}){super(),this.address=e,this.assetId=t,this.newFreezeStatus=r,this.attribute_map={address:"address",assetId:"asset-id",newFreezeStatus:"new-freeze-status"}}static from_obj_for_encoding(e){if(void 0===e.address)throw new Error(`Response is missing required field 'address': ${e}`);if(void 0===e["asset-id"])throw new Error(`Response is missing required field 'asset-id': ${e}`);if(void 0===e["new-freeze-status"])throw new Error(`Response is missing required field 'new-freeze-status': ${e}`);return new Ds({address:e.address,assetId:e["asset-id"],newFreezeStatus:e["new-freeze-status"]})}}class Os extends ve{constructor({amount:e,assetId:t,receiver:r,closeAmount:s,closeTo:n,sender:i}){super(),this.amount=e,this.assetId=t,this.receiver=r,this.closeAmount=s,this.closeTo=n,this.sender=i,this.attribute_map={amount:"amount",assetId:"asset-id",receiver:"receiver",closeAmount:"close-amount",closeTo:"close-to",sender:"sender"}}static from_obj_for_encoding(e){if(void 0===e.amount)throw new Error(`Response is missing required field 'amount': ${e}`);if(void 0===e["asset-id"])throw new Error(`Response is missing required field 'asset-id': ${e}`);if(void 0===e.receiver)throw new Error(`Response is missing required field 'receiver': ${e}`);return new Os({amount:e.amount,assetId:e["asset-id"],receiver:e.receiver,closeAmount:e["close-amount"],closeTo:e["close-to"],sender:e.sender})}}class Ls extends ve{constructor({nonParticipation:e,selectionParticipationKey:t,stateProofKey:r,voteFirstValid:s,voteKeyDilution:n,voteLastValid:i,voteParticipationKey:a}){super(),this.nonParticipation=e,this.selectionParticipationKey="string"==typeof t?new Uint8Array(o.lW.from(t,"base64")):t,this.stateProofKey="string"==typeof r?new Uint8Array(o.lW.from(r,"base64")):r,this.voteFirstValid=s,this.voteKeyDilution=n,this.voteLastValid=i,this.voteParticipationKey="string"==typeof a?new Uint8Array(o.lW.from(a,"base64")):a,this.attribute_map={nonParticipation:"non-participation",selectionParticipationKey:"selection-participation-key",stateProofKey:"state-proof-key",voteFirstValid:"vote-first-valid",voteKeyDilution:"vote-key-dilution",voteLastValid:"vote-last-valid",voteParticipationKey:"vote-participation-key"}}static from_obj_for_encoding(e){return new Ls({nonParticipation:e["non-participation"],selectionParticipationKey:e["selection-participation-key"],stateProofKey:e["state-proof-key"],voteFirstValid:e["vote-first-valid"],voteKeyDilution:e["vote-key-dilution"],voteLastValid:e["vote-last-valid"],voteParticipationKey:e["vote-participation-key"]})}}class Ms extends ve{constructor({amount:e,receiver:t,closeAmount:r,closeRemainderTo:s}){super(),this.amount=e,this.receiver=t,this.closeAmount=r,this.closeRemainderTo=s,this.attribute_map={amount:"amount",receiver:"receiver",closeAmount:"close-amount",closeRemainderTo:"close-remainder-to"}}static from_obj_for_encoding(e){if(void 0===e.amount)throw new Error(`Response is missing required field 'amount': ${e}`);if(void 0===e.receiver)throw new Error(`Response is missing required field 'receiver': ${e}`);return new Ms({amount:e.amount,receiver:e.receiver,closeAmount:e["close-amount"],closeRemainderTo:e["close-remainder-to"]})}}class Ns extends ve{constructor({currentRound:e,transaction:t}){super(),this.currentRound=e,this.transaction=t,this.attribute_map={currentRound:"current-round",transaction:"transaction"}}static from_obj_for_encoding(e){if(void 0===e["current-round"])throw new Error(`Response is missing required field 'current-round': ${e}`);if(void 0===e.transaction)throw new Error(`Response is missing required field 'transaction': ${e}`);return new Ns({currentRound:e["current-round"],transaction:qs.from_obj_for_encoding(e.transaction)})}}class Ws extends ve{constructor({logicsig:e,multisig:t,sig:r}){super(),this.logicsig=e,this.multisig=t,this.sig="string"==typeof r?new Uint8Array(o.lW.from(r,"base64")):r,this.attribute_map={logicsig:"logicsig",multisig:"multisig",sig:"sig"}}static from_obj_for_encoding(e){return new Ws({logicsig:void 0!==e.logicsig?Ks.from_obj_for_encoding(e.logicsig):void 0,multisig:void 0!==e.multisig?Fs.from_obj_for_encoding(e.multisig):void 0,sig:e.sig})}}class Ks extends ve{constructor({logic:e,args:t,multisigSignature:r,signature:s}){super(),this.logic="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.args=t,this.multisigSignature=r,this.signature="string"==typeof s?new Uint8Array(o.lW.from(s,"base64")):s,this.attribute_map={logic:"logic",args:"args",multisigSignature:"multisig-signature",signature:"signature"}}static from_obj_for_encoding(e){if(void 0===e.logic)throw new Error(`Response is missing required field 'logic': ${e}`);return new Ks({logic:e.logic,args:e.args,multisigSignature:void 0!==e["multisig-signature"]?Fs.from_obj_for_encoding(e["multisig-signature"]):void 0,signature:e.signature})}}class Fs extends ve{constructor({subsignature:e,threshold:t,version:r}){super(),this.subsignature=e,this.threshold=t,this.version=r,this.attribute_map={subsignature:"subsignature",threshold:"threshold",version:"version"}}static from_obj_for_encoding(e){return new Fs({subsignature:void 0!==e.subsignature?e.subsignature.map(zs.from_obj_for_encoding):void 0,threshold:e.threshold,version:e.version})}}class zs extends ve{constructor({publicKey:e,signature:t}){super(),this.publicKey="string"==typeof e?new Uint8Array(o.lW.from(e,"base64")):e,this.signature="string"==typeof t?new Uint8Array(o.lW.from(t,"base64")):t,this.attribute_map={publicKey:"public-key",signature:"signature"}}static from_obj_for_encoding(e){return new zs({publicKey:e["public-key"],signature:e.signature})}}class Vs extends ve{constructor({message:e,stateProof:t,stateProofType:r}){super(),this.message=e,this.stateProof=t,this.stateProofType=r,this.attribute_map={message:"message",stateProof:"state-proof",stateProofType:"state-proof-type"}}static from_obj_for_encoding(e){return new Vs({message:void 0!==e.message?vs.from_obj_for_encoding(e.message):void 0,stateProof:void 0!==e["state-proof"]?Es.from_obj_for_encoding(e["state-proof"]):void 0,stateProofType:e["state-proof-type"]})}}class Hs extends ve{constructor({currentRound:e,transactions:t,nextToken:r}){super(),this.currentRound=e,this.transactions=t,this.nextToken=r,this.attribute_map={currentRound:"current-round",transactions:"transactions",nextToken:"next-token"}}static from_obj_for_encoding(e){if(void 0===e["current-round"])throw new Error(`Response is missing required field 'current-round': ${e}`);if(!Array.isArray(e.transactions))throw new Error(`Response is missing required array field 'transactions': ${e}`);return new Hs({currentRound:e["current-round"],transactions:e.transactions.map(qs.from_obj_for_encoding),nextToken:e["next-token"]})}}class Gs extends Ot{constructor(e,t,r,s){super(e,t),this.index=r,this.index=r;const n=o.lW.from(s).toString("base64");this.query.name=encodeURI(`b64:${n}`)}path(){return`/v2/applications/${this.index}/box`}prepare(e){return hs.from_obj_for_encoding(e)}}class Ys extends Ot{path(){return"/v2/accounts"}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}limit(e){return this.query.limit=e,this}assetID(e){return this.query["asset-id"]=e,this}nextToken(e){return this.query.next=e,this}round(e){return this.query.round=e,this}authAddr(e){return this.query["auth-addr"]=e,this}applicationID(e){return this.query["application-id"]=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}exclude(e){return this.query.exclude=e,this}}class Js extends Ot{path(){return"/v2/transactions"}notePrefix(e){return this.query["note-prefix"]=Tr(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}assetID(e){return this.query["asset-id"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e,this}afterTime(e){return this.query["after-time"]=e,this}addressRole(e){return this.query["address-role"]=e,this}address(e){return this.query.address=e,this}excludeCloseTo(e){return this.query["exclude-close-to"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}applicationID(e){return this.query["application-id"]=e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}}class Xs extends Ot{path(){return"/v2/assets"}limit(e){return this.query.limit=e,this}creator(e){return this.query.creator=e,this}name(e){return this.query.name=e,this}unit(e){return this.query.unit=e,this}index(e){return this.query["asset-id"]=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}}class Zs extends Ot{path(){return"/v2/applications"}index(e){return this.query["application-id"]=e,this}creator(e){return this.query.creator=e,this}nextToken(e){return this.query.next=e,this}limit(e){return this.query.limit=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}}class Qs extends Ot{constructor(e,t,r){super(e,t),this.index=r,this.index=r}path(){return`/v2/applications/${this.index}/boxes`}nextToken(e){return this.query.next=e,this}limit(e){return this.query.limit=e,this}prepare(e){return fs.from_obj_for_encoding(e)}}class en extends we{constructor(e,t="http://127.0.0.1",r=8080,s={}){super("X-Indexer-API-Token",e,t,r,s)}makeHealthCheck(){return new Sr(this.c,this.intDecoding)}lookupAssetBalances(e){return new Rr(this.c,this.intDecoding,e)}lookupAssetTransactions(e){return new Br(this.c,this.intDecoding,e)}lookupAccountTransactions(e){return new Ir(this.c,this.intDecoding,e)}lookupBlock(e){return new Ur(this.c,this.intDecoding,e)}lookupTransactionByID(e){return new Pr(this.c,this.intDecoding,e)}lookupAccountByID(e){return new jr(this.c,this.intDecoding,e)}lookupAccountAssets(e){return new qr(this.c,this.intDecoding,e)}lookupAccountCreatedAssets(e){return new $r(this.c,this.intDecoding,e)}lookupAccountAppLocalStates(e){return new Cr(this.c,this.intDecoding,e)}lookupAccountCreatedApplications(e){return new Dr(this.c,this.intDecoding,e)}lookupAssetByID(e){return new Or(this.c,this.intDecoding,e)}lookupApplications(e){return new Lr(this.c,this.intDecoding,e)}lookupApplicationLogs(e){return new Mr(this.c,this.intDecoding,e)}searchAccounts(){return new Ys(this.c,this.intDecoding)}searchForTransactions(){return new Js(this.c,this.intDecoding)}searchForAssets(){return new Xs(this.c,this.intDecoding)}searchForApplications(){return new Zs(this.c,this.intDecoding)}searchForApplicationBoxes(e){return new Qs(this.c,this.intDecoding,e)}lookupApplicationBoxByIDandName(e,t){return new Gs(this.c,this.intDecoding,e,t)}}async function tn(e,t,r){const s=await e.status().do();if(void 0===s)throw new Error("Unable to get node status");const n=s["last-round"]+1;let i=n;for(;i<n+r;){let r=!1;try{const s=await e.pendingTransactionInformation(t).do();if(s["confirmed-round"])return s;if(s["pool-error"])throw r=!0,new Error(`Transaction Rejected: ${s["pool-error"]}`)}catch(e){if(r)throw e}await e.statusAfterBlock(i).do(),i+=1}throw new Error(`Transaction not confirmed after ${r} rounds`)}function rn(e,t){let r=e.toString(16);r.length!==2*t&&(r=r.padStart(2*t,"0"));const s=new Uint8Array(r.length/2);for(let e=0,t=0;e<r.length/2;e++,t+=2)s[e]=parseInt(r.slice(t,t+2),16);return s}function sn(e){let t=BigInt(0);const r=o.lW.from(e);for(let s=0;s<e.length;s++)t=BigInt(Number(r.readUIntBE(s,1)))+t*BigInt(256);return t}function nn(){const e=w((t=c().box.secretKeyLength,function(){const{navigator:e}=globalThis;return"object"==typeof e&&"ReactNative"===e.product}()&&console.warn("It looks like you're running in react-native. In order to perform common crypto operations you will need to polyfill common operations such as crypto.getRandomValues"),c().randomBytes(t)));var t;return{addr:F(e.publicKey),sk:e.secretKey}}const on=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"],an="failed to decode mnemonic",cn="the mnemonic contains a word that is not in the wordlist";function un(e){const t=[];let r=0,s=0;return e.forEach((function(e){r|=e<<s,s+=8,s>=11&&(t.push(2047&r),r>>=11,s-=11)})),s&&t.push(r),t}function ln(e){return e.map((e=>on[e]))}function dn(e){return ln(un(y(e)))[0]}function hn(e){if(e.length!==S)throw new RangeError(`Seed length must be ${S}`);const t=ln(un(e)),r=dn(e);return`${t.join(" ")} ${r}`}function pn(e){const t=e.split(" "),r=t.slice(0,24);for(const e of r)if(-1===on.indexOf(e))throw new Error(cn);const s=t[t.length-1];let n=function(e){const t=[];let r=0,s=0;return e.forEach((function(e){for(r|=e<<s,s+=11;s>=8;)t.push(255&r),r>>=8,s-=8})),s&&t.push(r),new Uint8Array(t)}(r.map((e=>on.indexOf(e))));if(33!==n.length)throw new Error(an);if(0!==n[n.length-1])throw new Error(an);if(n=n.slice(0,n.length-1),dn(n)===s)return n;throw new Error(an)}function fn(e){const t=w(pn(e));return{addr:F(t.publicKey),sk:t.secretKey}}function gn(e){return hn(e.slice(0,S))}function mn(e){return pn(e)}function yn(e){return hn(e)}class wn{constructor(e){if(this.name="Transaction group",this.tag=o.lW.from("TG"),e.length>16){const t=`${e.length.toString()} transactions grouped together but max group size is ${16..toString()}`;throw Error(t)}this.txGroupHashes=e}get_obj_for_encoding(){return{txlist:this.txGroupHashes}}static from_obj_for_encoding(e){const t=Object.create(this.prototype);t.name="Transaction group",t.tag=o.lW.from("TG"),t.txGroupHashes=[];for(const r of e.txlist)t.txGroupHashes.push(o.lW.from(r));return t}toByte(){return X(this.get_obj_for_encoding())}}function bn(e){const t=[];for(const r of e){const e=ce(r);t.push(e.rawTxID())}const r=new wn(t),s=r.toByte(),n=y(o.lW.from(m(r.tag,s)));return o.lW.from(n)}function vn(e,t){const r=bn(e),s=[];for(const n of e){const e=ce(n);t&&F(e.from.publicKey)!==t||(e.group=r,s.push(e))}return s}const xn="Not enough multisig transactions to merge. Need at least two",_n="Cannot merge txs. txIDs differ",An="Cannot merge txs. Auth addrs differ",En="Cannot merge txs. Multisig preimages differ",kn="Cannot merge txs. subsigs are mismatched.",Sn="Cannot mutate a multisig field as it would invalidate all existing signatures.";function Rn(e,{version:t,threshold:r,addrs:s}){const n=s.map((e=>W(e).publicKey)),i={v:t,thr:r,subsig:n.map((e=>({pk:o.lW.from(e)})))},a=e.get_obj_for_encoding(),c={msig:i,txn:a},u=z({version:t,threshold:r,pks:n});return F(a.snd)!==F(u)&&(c.sgnr=o.lW.from(u)),new Uint8Array(X(c))}function Tn(e,{rawSig:t,myPk:r},{version:s,threshold:n,pks:i}){const a=Z(Rn(e,{version:s,threshold:n,addrs:i.map((e=>F(e)))}));let c=!1;if(a.msig.subsig.forEach(((e,s)=>{_(e.pk,r)&&(c=!0,a.msig.subsig[s].s=t)})),!1===c)throw new Error("Key does not exist");const u=z({version:s,threshold:n,pks:i});return F(a.txn.snd)!==F(u)&&(a.sgnr=o.lW.from(u)),new Uint8Array(X(a))}class In extends se{addLease(){throw new Error(Sn)}addRekey(){throw new Error(Sn)}signTxn(e){throw new Error("Cannot sign a multisig transaction using `signTxn`. Use `partialSignTxn` instead.")}partialSignTxn({version:e,threshold:t,pks:r},s){const n=v(s).publicKey;return Tn(this,{rawSig:this.rawSignTxn(s),myPk:n},{version:e,threshold:t,pks:r})}partialSignWithMultisigSignature(e,t,r){if(!b(r.length))throw new Error("Cannot add multisig signature. Signature is not of the correct length.");return Tn(this,{rawSig:r,myPk:W(t).publicKey},e)}static from_obj_for_encoding(e){return super.from_obj_for_encoding(e)}}function Bn(e){if(e.length<2)throw new Error(xn);const t=Z(e[0]),r=In.from_obj_for_encoding(t.txn).txID(),s=t.sgnr?F(t.sgnr):void 0,n=F(z({version:t.msig.v,threshold:t.msig.thr,pks:t.msig.subsig.map((e=>e.pk))})),i=t.msig.subsig.map((e=>({...e})));for(let a=1;a<e.length;a++){const c=Z(e[a]);if(In.from_obj_for_encoding(c.txn).txID()!==r)throw new Error(_n);if(s!==(c.sgnr?F(c.sgnr):void 0))throw new Error(An);if(c.msig.subsig.length!==t.msig.subsig.length)throw new Error(En);if(n!==F(z({version:c.msig.v,threshold:c.msig.thr,pks:c.msig.subsig.map((e=>e.pk))})))throw new Error(En);c.msig.subsig.forEach(((e,t)=>{if(!e.s)return;const r=i[t];if(r.s&&0!==o.lW.compare(o.lW.from(e.s),o.lW.from(r.s)))throw new Error(kn);r.s=e.s}))}const a={msig:{v:t.msig.v,thr:t.msig.thr,subsig:i},txn:t.txn};return void 0!==s&&(a.sgnr=o.lW.from(W(s).publicKey)),new Uint8Array(X(a))}function Un(e,t,r){const s=t.v,n=t.thr,i=t.subsig,o=i.map((e=>e.pk));if(t.subsig.length<n)return!1;let a;try{a=z({version:s,threshold:n,pks:o})}catch(e){return!1}if(!g(a,r))return!1;let c=0;for(const e of i)void 0!==e.s&&(c+=1);if(c<n)return!1;let u=0;for(const t of i)void 0!==t.s&&A(e,t.s,t.pk)&&(u+=1);return!(u<n)}function Pn(e,{version:t,threshold:r,addrs:s},n){const i=V({version:t,threshold:r,addrs:s});Object.prototype.hasOwnProperty.call(e,"from")||(e.from=i);const o=s.map((e=>W(e).publicKey));let a,c;return e instanceof se?(a=e,c=In.prototype.partialSignTxn.call(a,{version:t,threshold:r,pks:o},n)):(a=new In(e),c=a.partialSignTxn({version:t,threshold:r,pks:o},n)),{txID:a.txID().toString(),blob:c}}function jn(e,{version:t,threshold:r,addrs:s},n){const i=s.map((e=>W(e).publicKey)),o=Z(e),a=In.from_obj_for_encoding(o.txn),c=a.partialSignTxn({version:t,threshold:r,pks:i},n);return{txID:a.txID().toString(),blob:Bn([e,c])}}function qn(e,{version:t,threshold:r,addrs:s},n,i){const o=s.map((e=>W(e).publicKey)),a=Z(e),c=In.from_obj_for_encoding(a.txn),u=c.partialSignWithMultisigSignature({version:t,threshold:r,pks:o},n,i);return{txID:c.txID().toString(),blob:Bn([e,u])}}function $n({version:e,threshold:t,addrs:r}){return V({version:e,threshold:t,addrs:r})}function Cn(e){if(!e||0===e.length)throw new Error("empty program");const t="\n".charCodeAt(0),r=" ".charCodeAt(0),s="~".charCodeAt(0);if(e.every((e=>e===t||(e=>r<=e&&e<=s)(e)))){const t=o.lW.from(e).toString();if(K(t))throw new Error("requesting program bytes, get Algorand address");if(o.lW.from(t,"base64").toString("base64")===t)throw new Error("program should not be b64 encoded");throw new Error("program bytes are all ASCII printable characters, not looking like Teal byte code")}}class Dn{constructor(e,t){if(this.tag=o.lW.from("Program"),t&&(!Array.isArray(t)||!t.every((e=>e.constructor===Uint8Array||o.lW.isBuffer(e)))))throw new TypeError("Invalid arguments");let r;null!=t&&(r=t.map((e=>new Uint8Array(e)))),Cn(e),this.logic=e,this.args=r,this.sig=void 0,this.msig=void 0}get_obj_for_encoding(){const e={l:this.logic};return this.args&&(e.arg=this.args),this.sig?e.sig=this.sig:this.msig&&(e.msig=this.msig),e}static from_obj_for_encoding(e){const t=new Dn(e.l,e.arg);return t.sig=e.sig,t.msig=e.msig,t}verify(e){if(this.sig&&this.msig)return!1;try{Cn(this.logic)}catch(e){return!1}const t=m(this.tag,this.logic);return this.sig||this.msig?this.sig?A(t,this.sig,e):Un(t,this.msig,e):g(y(t),e)}address(){const e=y(m(this.tag,this.logic));return F(new Uint8Array(e))}sign(e,t){if(null==t)this.sig=this.signProgram(e);else{const r=t.addrs.map((e=>({pk:W(e).publicKey})));this.msig={v:t.version,thr:t.threshold,subsig:r};const[s,n]=this.singleSignMultisig(e,this.msig);this.msig.subsig[n].s=s}}appendToMultisig(e){if(void 0===this.msig)throw new Error("no multisig present");const[t,r]=this.singleSignMultisig(e,this.msig);this.msig.subsig[r].s=t}signProgram(e){return x(m(this.tag,this.logic),e)}singleSignMultisig(e,t){let r=-1;const s=v(e).publicKey;for(let e=0;e<t.subsig.length;e++){const{pk:n}=t.subsig[e];if(g(n,s)){r=e;break}}if(-1===r)throw new Error("invalid secret key");return[this.signProgram(e),r]}toByte(){return X(this.get_obj_for_encoding())}static fromByte(e){const t=Z(e);return Dn.from_obj_for_encoding(t)}}class On{constructor(e,t){this.lsig=new Dn(e,t),this.sigkey=void 0}get_obj_for_encoding(){const e={lsig:this.lsig.get_obj_for_encoding()};return this.sigkey&&(e.sigkey=this.sigkey),e}static from_obj_for_encoding(e){const t=new On(e.lsig.l,e.lsig.arg);return t.lsig=Dn.from_obj_for_encoding(e.lsig),t.sigkey=e.sigkey,t}toByte(){return X(this.get_obj_for_encoding())}static fromByte(e){const t=Z(e);return On.from_obj_for_encoding(t)}isDelegated(){return!(!this.lsig.sig&&!this.lsig.msig)}verify(){const e=this.address();return this.lsig.verify(W(e).publicKey)}address(){if(this.lsig.sig&&this.lsig.msig)throw new Error("LogicSig has too many signatures. At most one of sig or msig may be present");if(this.lsig.sig){if(!this.sigkey)throw new Error("Signing key for delegated account is missing");return F(this.sigkey)}return this.lsig.msig?F(z({version:this.lsig.msig.v,threshold:this.lsig.msig.thr,pks:this.lsig.msig.subsig.map((e=>e.pk))})):this.lsig.address()}signMultisig(e,t){this.lsig.sign(t,e)}appendToMultisig(e){this.lsig.appendToMultisig(e)}sign(e){this.lsig.sign(e),this.sigkey=v(e).publicKey}}function Ln(e,t){let r,s;return t instanceof On?(r=t.lsig,s=W(t.address()).publicKey):(r=t,s=r.sig?e.from.publicKey:r.msig?z({version:r.msig.v,threshold:r.msig.thr,pks:r.msig.subsig.map((e=>e.pk))}):W(r.address()).publicKey),function(e,t,r){if(!t.verify(r))throw new Error("Logic signature verification failed. Ensure the program and signature are valid.");const s={lsig:t.get_obj_for_encoding(),txn:e.get_obj_for_encoding()};return _(r,e.from.publicKey)||(s.sgnr=o.lW.from(r)),{txID:e.txID().toString(),blob:X(s)}}(e,r,s)}function Mn(e,t){return Ln(ce(e),t)}function Nn(e){return Dn.fromByte(e)}const Wn=o.lW.from("ProgData");function Kn(e,t,r){const s=m(W(r).publicKey,t);return x(o.lW.from(m(Wn,s)),e)}function Fn(e,t,r,s){const n=m(W(t).publicKey,e);return A(o.lW.from(m(Wn,n)),r,s)}function zn(e,t,r){return Kn(e,t,new Dn(r).address())}let Vn={},Hn={};"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split("").forEach((function(e,t){Vn[e]=t,Hn[t]=e}));class Gn{constructor({version:e,sources:t,names:r,mappings:s}){if(this.version=e,this.sources=t,this.names=r,this.mappings=s,3!==this.version)throw new Error(`Only version 3 is supported, got ${this.version}`);if(void 0===this.mappings)throw new Error("mapping undefined, cannot build source map without `mapping`");const n=this.mappings.split(";").map((e=>{const t=function(e){let t=[],r=0,s=0;for(let n=0;n<e.length;n+=1){let i=Vn[e[n]];if(void 0===i)throw new Error("Invalid character ("+e[n]+")");const o=32&i;if(i&=31,s+=i<<r,o)r+=5;else{const e=1&s;s>>>=1,e?t.push(0===s?-2147483648:-s):t.push(s),s=r=0}}return t}(e);if(t.length>2)return t[2]}));this.pcToLine={},this.lineToPc={};let i=0;for(const[e,t]of n.entries())void 0!==t&&(i+=t),i in this.lineToPc||(this.lineToPc[i]=[]),this.lineToPc[i].push(e),this.pcToLine[e]=i}getLineForPc(e){return this.pcToLine[e]}getPcsForLine(e){return this.lineToPc[e]}}const Yn=1380011588;function Jn(e){return e.params["approval-program"]=o.lW.from(e.params["approval-program"].toString(),"base64"),e.params["clear-state-program"]=o.lW.from(e.params["clear-state-program"].toString(),"base64"),e}async function Xn({client:e,txns:t,protocolVersion:r,latestTimestamp:s,round:n,sources:i}){const o=[],a=[],c=[],u=[],l=[];for(const e of t)e.txn.type===Q.appl&&(l.push(F(e.txn.from.publicKey)),e.txn.appAccounts&&l.push(...e.txn.appAccounts.map((e=>F(e.publicKey)))),e.txn.appForeignApps&&(c.push(...e.txn.appForeignApps),l.push(...e.txn.appForeignApps.map((e=>H(e))))),e.txn.appForeignAssets&&u.push(...e.txn.appForeignAssets),void 0===e.txn.appIndex||0===e.txn.appIndex?o.push(new Ie({id:Yn,params:new qe({creator:F(e.txn.from.publicKey),approvalProgram:e.txn.appApprovalProgram,clearStateProgram:e.txn.appClearProgram,localStateSchema:new Ce({numUint:e.txn.appLocalInts,numByteSlice:e.txn.appLocalByteSlices}),globalStateSchema:new Ce({numUint:e.txn.appGlobalInts,numByteSlice:e.txn.appGlobalByteSlices})})})):(c.push(e.txn.appIndex),l.push(H(e.txn.appIndex))));const d=[];for(const t of[...new Set(u)])d.push(e.getAssetByID(t).do().then((e=>{l.push(e.params.creator)})));await Promise.all(d);const h=[];for(const t of[...new Set(c)])h.push(e.getApplicationByID(t).do().then((e=>{const t=Jn(e);o.push(t),l.push(t.params.creator)})));await Promise.all(h);const p=[];for(const t of[...new Set(l)])p.push(e.accountInformation(t).do().then((e=>{"created-apps"in e&&(e["created-apps"]=e["created-apps"].map((e=>Jn(e)))),a.push(e)})));return await Promise.all(p),new et({txns:t.map((e=>({...e,txn:e.txn.get_obj_for_encoding()}))),accounts:a,apps:o,latestTimestamp:s,round:n,protocolVersion:r,sources:i})}class Zn{constructor(e){this.type=0,this.bytes="",this.uint=0,this.type=e.type,this.bytes=e.bytes,this.uint=e.uint}toString(){return 1===this.type?`0x${o.lW.from(this.bytes,"base64").toString("hex")}`:this.uint.toString()}}class Qn{constructor(e){this.error="",this.line=0,this.pc=0,this.scratch=[],this.stack=[],this.error=void 0===e.error?"":e.error,this.line=e.line,this.pc=e.pc,this.scratch=e.scratch,this.stack=e.stack.map((e=>new Zn(e)))}}class ei{constructor(e){this.trace=[],null!=e&&(this.trace=e.map((e=>new Qn(e))))}}function ti(e,t){return e.length>t&&t>0?`${e.slice(0,t)}...`:e}function ri(e,t){if(0===t.length)return"";let r=null;for(let s=0;s<t.length;s++)(s>e.length||JSON.stringify(e[s])!==JSON.stringify(t[s]))&&(r=s);if(null==r)return"";const s=t[r];return s.bytes.length>0?`${r} = 0x${o.lW.from(s.bytes,"base64").toString("hex")}`:`${r} = ${s.uint.toString()}`}function si(e,t){return`[${(t?e.reverse():e).map((e=>{switch(e.type){case 1:return`0x${o.lW.from(e.bytes,"base64").toString("hex")}`;case 2:return`${e.uint.toString()}`;default:return""}})).join(", ")}]`}class ni{constructor(e){this.disassembly=[],this.appCallMessages=[],this.localDeltas=[],this.globalDelta=[],this.cost=0,this.logicSigMessages=[],this.logicSigDisassembly=[],this.logs=[],this.appCallTrace=void 0,this.logicSigTrace=void 0,this.required=["disassembly"],this.optionals=["app-call-messages","local-deltas","global-delta","cost","logic-sig-messages","logic-sig-disassembly","logs"],this.traces=["app-call-trace","logic-sig-trace"],this.disassembly=e.disassembly,this.appCallMessages=e["app-call-messages"],this.localDeltas=e["local-deltas"],this.globalDelta=e["global-delta"],this.cost=e.cost,this.logicSigMessages=e["logic-sig-messages"],this.logicSigDisassembly=e["logic-sig-disassembly"],this.logs=e.logs,this.appCallTrace=new ei(e["app-call-trace"]),this.logicSigTrace=new ei(e["logic-sig-trace"])}appCallRejected(){return void 0!==this.appCallMessages&&this.appCallMessages.includes("REJECT")}logicSigRejected(){return void 0!==this.logicSigMessages&&this.logicSigMessages.includes("REJECT")}static trace(e,t,r){const s=r.maxValueWidth||30,n=[["pc#","ln#","source","scratch","stack"]];for(let i=0;i<e.trace.length;i++){const{line:o,error:a,pc:c,scratch:u,stack:l}=e.trace[i],d=void 0!==u?u:[],h=i>0&&void 0!==e.trace[i-1].scratch?e.trace[i-1].scratch:[],p=""===a?t[o]:`!! ${a} !!`;n.push([c.toString().padEnd(3," "),o.toString().padEnd(3," "),ti(p,s),ti(ri(h,d),s),ti(si(l,r.topOfStackFirst),s)])}const i=n.reduce(((e,t)=>{const r=new Array(n[0].length).fill(0);for(let s=0;s<e.length;s++)r[s]=t[s].length>e[s]?t[s].length:e[s];return r}),new Array(n[0].length).fill(0));return`${n.map((e=>e.map(((e,t)=>e.padEnd(i[t]+1," "))).join("|").trim())).join("\n")}\n`}appTrace(e){if(void 0===this.appCallTrace||!this.disassembly)return"";let t=e;return void 0===e&&(t={maxValueWidth:30,topOfStackFirst:!1}),ni.trace(this.appCallTrace,this.disassembly,t)}lsigTrace(e){if(void 0===this.logicSigTrace||void 0===this.logicSigDisassembly)return"";let t=e;return void 0===e&&(t={maxValueWidth:30,topOfStackFirst:!0}),ni.trace(this.logicSigTrace,this.logicSigDisassembly,t)}}class ii{constructor(e){this.error="",this.protocolVersion="",this.txns=[],this.error=e.error,this.protocolVersion=e["protocol-version"],this.txns=e.txns.map((e=>new ni(e)))}}function oi(e,t,r,s,n,i,o){const a={from:e,to:t,amount:r,closeRemainderTo:s,note:n,suggestedParams:i,type:Q.pay,reKeyTo:o};return new se(a)}function ai(e){return oi(e.from,e.to,e.amount,e.closeRemainderTo,e.note,e.suggestedParams,e.rekeyTo)}function ci(e,t,r,s,n,i,o,a,c,u=!1,l=void 0){const d={from:e,note:t,voteKey:r,selectionKey:s,voteFirst:n,voteLast:i,voteKeyDilution:o,suggestedParams:a,type:Q.keyreg,reKeyTo:c,nonParticipation:u,stateProofKey:l};return new se(d)}function ui(e){return ci(e.from,e.note,e.voteKey,e.selectionKey,e.voteFirst,e.voteLast,e.voteKeyDilution,e.suggestedParams,e.rekeyTo,e.nonParticipation,e.stateProofKey)}function li(e,t,r,s,n,i,o,a,c,u,l,d,h,p,f){const g={from:e,note:t,suggestedParams:p,assetTotal:r,assetDecimals:s,assetDefaultFrozen:n,assetUnitName:u,assetName:l,assetURL:d,assetMetadataHash:h,assetManager:i,assetReserve:o,assetFreeze:a,assetClawback:c,type:Q.acfg,reKeyTo:f};return new se(g)}function di(e){return li(e.from,e.note,e.total,e.decimals,e.defaultFrozen,e.manager,e.reserve,e.freeze,e.clawback,e.unitName,e.assetName,e.assetURL,e.assetMetadataHash,e.suggestedParams,e.rekeyTo)}function hi(e,t,r,s,n,i,o,a,c=!0,u){if(c&&(void 0===s||void 0===n||void 0===i||void 0===o))throw Error("strict empty address checking was turned on, but at least one empty address was provided");const l={from:e,suggestedParams:a,assetIndex:r,assetManager:s,assetReserve:n,assetFreeze:i,assetClawback:o,type:Q.acfg,note:t,reKeyTo:u};return new se(l)}function pi(e){return hi(e.from,e.note,e.assetIndex,e.manager,e.reserve,e.freeze,e.clawback,e.suggestedParams,e.strictEmptyAddressChecking,e.rekeyTo)}function fi(e,t,r,s,n){const i={from:e,suggestedParams:s,assetIndex:r,type:Q.acfg,note:t,reKeyTo:n};return new se(i)}function gi(e){return fi(e.from,e.note,e.assetIndex,e.suggestedParams,e.rekeyTo)}function mi(e,t,r,s,n,i,o){const a={from:e,type:Q.afrz,freezeAccount:s,assetIndex:r,freezeState:n,note:t,suggestedParams:i,reKeyTo:o};return new se(a)}function yi(e){return mi(e.from,e.note,e.assetIndex,e.freezeTarget,e.freezeState,e.suggestedParams,e.rekeyTo)}function wi(e,t,r,s,n,i,o,a,c){const u={type:Q.axfer,from:e,to:t,amount:n,suggestedParams:a,assetIndex:o,note:i,assetRevocationTarget:s,closeRemainderTo:r,reKeyTo:c};return new se(u)}function bi(e){return wi(e.from,e.to,e.closeRemainderTo,e.revocationTarget,e.amount,e.note,e.assetIndex,e.suggestedParams,e.rekeyTo)}function vi(e,t,r,s,n,i,o,a,c,u,l,d,h,p,f,g,m,y){const w={type:Q.appl,from:e,suggestedParams:t,appIndex:0,appOnComplete:r,appLocalInts:i,appLocalByteSlices:o,appGlobalInts:a,appGlobalByteSlices:c,appApprovalProgram:s,appClearProgram:n,appArgs:u,appAccounts:l,appForeignApps:d,appForeignAssets:h,boxes:y,note:p,lease:f,reKeyTo:g,extraPages:m};return new se(w)}function xi(e){return vi(e.from,e.suggestedParams,e.onComplete,e.approvalProgram,e.clearProgram,e.numLocalInts,e.numLocalByteSlices,e.numGlobalInts,e.numGlobalByteSlices,e.appArgs,e.accounts,e.foreignApps,e.foreignAssets,e.note,e.lease,e.rekeyTo,e.extraPages,e.boxes)}function _i(e,t,r,s,n,i,o,a,c,u,l,d,h){const p={type:Q.appl,from:e,suggestedParams:t,appIndex:r,appApprovalProgram:s,appOnComplete:ee.UpdateApplicationOC,appClearProgram:n,appArgs:i,appAccounts:o,appForeignApps:a,appForeignAssets:c,boxes:h,note:u,lease:l,reKeyTo:d};return new se(p)}function Ai(e){return _i(e.from,e.suggestedParams,e.appIndex,e.approvalProgram,e.clearProgram,e.appArgs,e.accounts,e.foreignApps,e.foreignAssets,e.note,e.lease,e.rekeyTo,e.boxes)}function Ei(e,t,r,s,n,i,o,a,c,u,l){const d={type:Q.appl,from:e,suggestedParams:t,appIndex:r,appOnComplete:ee.DeleteApplicationOC,appArgs:s,appAccounts:n,appForeignApps:i,appForeignAssets:o,boxes:l,note:a,lease:c,reKeyTo:u};return new se(d)}function ki(e){return Ei(e.from,e.suggestedParams,e.appIndex,e.appArgs,e.accounts,e.foreignApps,e.foreignAssets,e.note,e.lease,e.rekeyTo,e.boxes)}function Si(e,t,r,s,n,i,o,a,c,u,l){const d={type:Q.appl,from:e,suggestedParams:t,appIndex:r,appOnComplete:ee.OptInOC,appArgs:s,appAccounts:n,appForeignApps:i,appForeignAssets:o,boxes:l,note:a,lease:c,reKeyTo:u};return new se(d)}function Ri(e){return Si(e.from,e.suggestedParams,e.appIndex,e.appArgs,e.accounts,e.foreignApps,e.foreignAssets,e.note,e.lease,e.rekeyTo,e.boxes)}function Ti(e,t,r,s,n,i,o,a,c,u,l){const d={type:Q.appl,from:e,suggestedParams:t,appIndex:r,appOnComplete:ee.CloseOutOC,appArgs:s,appAccounts:n,appForeignApps:i,appForeignAssets:o,boxes:l,note:a,lease:c,reKeyTo:u};return new se(d)}function Ii(e){return Ti(e.from,e.suggestedParams,e.appIndex,e.appArgs,e.accounts,e.foreignApps,e.foreignAssets,e.note,e.lease,e.rekeyTo,e.boxes)}function Bi(e,t,r,s,n,i,o,a,c,u,l){const d={type:Q.appl,from:e,suggestedParams:t,appIndex:r,appOnComplete:ee.ClearStateOC,appArgs:s,appAccounts:n,appForeignApps:i,appForeignAssets:o,boxes:l,note:a,lease:c,reKeyTo:u};return new se(d)}function Ui(e){return Bi(e.from,e.suggestedParams,e.appIndex,e.appArgs,e.accounts,e.foreignApps,e.foreignAssets,e.note,e.lease,e.rekeyTo,e.boxes)}function Pi(e,t,r,s,n,i,o,a,c,u,l){const d={type:Q.appl,from:e,suggestedParams:t,appIndex:r,appOnComplete:ee.NoOpOC,appArgs:s,appAccounts:n,appForeignApps:i,appForeignAssets:o,boxes:l,note:a,lease:c,reKeyTo:u};return new se(d)}function ji(e){return Pi(e.from,e.suggestedParams,e.appIndex,e.appArgs,e.accounts,e.foreignApps,e.foreignAssets,e.note,e.lease,e.rekeyTo,e.boxes)}function qi(e){const t={type:Q.appl,from:e.from,suggestedParams:e.suggestedParams,appIndex:e.appIndex,appOnComplete:e.onComplete,appLocalInts:e.numLocalInts,appLocalByteSlices:e.numLocalByteSlices,appGlobalInts:e.numGlobalInts,appGlobalByteSlices:e.numGlobalByteSlices,appApprovalProgram:e.approvalProgram,appClearProgram:e.clearProgram,appArgs:e.appArgs,appAccounts:e.accounts,appForeignApps:e.foreignApps,appForeignAssets:e.foreignAssets,boxes:e.boxes,note:e.note,lease:e.lease,reKeyTo:e.rekeyTo,extraPages:e.extraPages};return new se(t)}function $i(e){return(t,r)=>{const s=[];for(const n of r)s.push(t[n].signTxn(e.sk));return Promise.resolve(s)}}function Ci(e){return(t,r)=>{const s=[];for(const n of r){const{blob:r}=Ln(t[n],e);s.push(r)}return Promise.resolve(s)}}function Di(e,t){return(r,s)=>{const n=[];for(const i of s){const s=r[i],o=[];for(const r of t){const{blob:t}=Pn(s,e,r);o.push(t)}o.length>1?n.push(Bn(o)):n.push(o[0])}return Promise.resolve(n)}}function Oi(){return(e,t)=>{const r=[];for(const s of t)r.push(ne(e[s]));return Promise.resolve(r)}}function Li(e){return"object"==typeof e&&2===Object.keys(e).length&&"object"==typeof e.txn&&"function"==typeof e.signer}const Mi=65535,Ni=32,Wi=1,Ki=1,Fi=2,zi=/^([a-z\d[\](),]+)\[(0|[1-9][\d]*)]$/,Vi=/^ufixed([1-9][\d]*)x([1-9][\d]*)$/;class Hi{static from(e){if(e.endsWith("[]")){const t=Hi.from(e.slice(0,e.length-2));return new to(t)}if(e.endsWith("]")){const t=e.match(zi);if(3!==t.length)throw new Error(`malformed static array string: ${e}`);const r=t[2],s=parseInt(r,10);if(s>Mi)throw new Error(`array length exceeds limit ${Mi}`);const n=Hi.from(t[1]);return new eo(n,s)}if(e.startsWith("uint")){const t=e=>[...e].every((e=>"0123456789".includes(e))),r=e.slice(4,e.length);if(!t(r))throw new Error(`malformed uint string: ${r}`);const s=parseInt(r,10);if(s>Mi)throw new Error(`malformed uint string: ${s}`);return new Gi(s)}if("byte"===e)return new Zi;if(e.startsWith("ufixed")){const t=e.match(Vi);if(3!==t.length)throw new Error(`malformed ufixed type: ${e}`);const r=parseInt(t[1],10),s=parseInt(t[2],10);return new Yi(r,s)}if("bool"===e)return new Xi;if("address"===e)return new Ji;if("string"===e)return new Qi;if(e.length>=2&&"("===e[0]&&")"===e[e.length-1]){const t=ro.parseTupleContent(e.slice(1,e.length-1)),r=[];for(let e=0;e<t.length;e++){const s=Hi.from(t[e]);r.push(s)}return new ro(r)}throw new Error(`cannot convert a string ${e} to an ABI type`)}}class Gi extends Hi{constructor(e){if(super(),e%8!=0||e<8||e>512)throw new Error(`unsupported uint type bitSize: ${e}`);this.bitSize=e}toString(){return`uint${this.bitSize}`}equals(e){return e instanceof Gi&&this.bitSize===e.bitSize}isDynamic(){return!1}byteLen(){return this.bitSize/8}encode(e){if("bigint"!=typeof e&&"number"!=typeof e)throw new Error(`Cannot encode value as uint${this.bitSize}: ${e}`);if(e>=BigInt(2**this.bitSize)||e<BigInt(0))throw new Error(`${e} is not a non-negative int or too big to fit in size uint${this.bitSize}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error(`${e} should be converted into a BigInt before it is encoded`);return rn(e,this.bitSize/8)}decode(e){if(e.length!==this.bitSize/8)throw new Error(`byte string must correspond to a uint${this.bitSize}`);return sn(e)}}class Yi extends Hi{constructor(e,t){if(super(),e%8!=0||e<8||e>512)throw new Error(`unsupported ufixed type bitSize: ${e}`);if(t>160||t<1)throw new Error(`unsupported ufixed type precision: ${t}`);this.bitSize=e,this.precision=t}toString(){return`ufixed${this.bitSize}x${this.precision}`}equals(e){return e instanceof Yi&&this.bitSize===e.bitSize&&this.precision===e.precision}isDynamic(){return!1}byteLen(){return this.bitSize/8}encode(e){if("bigint"!=typeof e&&"number"!=typeof e)throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);if(e>=BigInt(2**this.bitSize)||e<BigInt(0))throw new Error(`${e} is not a non-negative int or too big to fit in size ${this.toString()}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error(`${e} should be converted into a BigInt before it is encoded`);return rn(e,this.bitSize/8)}decode(e){if(e.length!==this.bitSize/8)throw new Error(`byte string must correspond to a ${this.toString()}`);return sn(e)}}class Ji extends Hi{toString(){return"address"}equals(e){return e instanceof Ji}isDynamic(){return!1}byteLen(){return Ni}encode(e){if("string"!=typeof e&&!(e instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);if("string"==typeof e)return W(e).publicKey;if(32!==e.byteLength)throw new Error("byte string must be 32 bytes long for an address");return e}decode(e){if(32!==e.byteLength)throw new Error("byte string must be 32 bytes long for an address");return F(e)}}class Xi extends Hi{toString(){return"bool"}equals(e){return e instanceof Xi}isDynamic(){return!1}byteLen(){return Ki}encode(e){if("boolean"!=typeof e)throw new Error(`Cannot encode value as bool: ${e}`);return e?new Uint8Array([128]):new Uint8Array([0])}decode(e){if(1!==e.byteLength)throw new Error("bool string must be 1 byte long");const t=e[0];if(128===t)return!0;if(0===t)return!1;throw new Error("boolean could not be decoded from the byte string")}}class Zi extends Hi{toString(){return"byte"}equals(e){return e instanceof Zi}isDynamic(){return!1}byteLen(){return Wi}encode(e){if("number"!=typeof e&&"bigint"!=typeof e)throw new Error(`Cannot encode value as byte: ${e}`);if("bigint"==typeof e&&(e=Number(e)),e<0||e>255)throw new Error(`${e} cannot be encoded into a byte`);return new Uint8Array([e])}decode(e){if(1!==e.byteLength)throw new Error("byte string must be 1 byte long");return e[0]}}class Qi extends Hi{toString(){return"string"}equals(e){return e instanceof Qi}isDynamic(){return!0}byteLen(){throw new Error(`${this.toString()} is a dynamic type`)}encode(e){if("string"!=typeof e&&!(e instanceof Uint8Array))throw new Error(`Cannot encode value as string: ${e}`);const t=o.lW.from(e),r=rn(t.length,Fi),s=new Uint8Array(t.length+Fi);return s.set(r),s.set(t,Fi),s}decode(e){if(e.length<Fi)throw new Error(`byte string is too short to be decoded. Actual length is ${e.length}, but expected at least ${Fi}`);const t=o.lW.from(e).readUIntBE(0,Fi),r=e.slice(Fi,e.length);if(t!==r.length)throw new Error(`string length bytes do not match the actual length of string. Expected ${t}, got ${r.length}`);return o.lW.from(r).toString("utf-8")}}class eo extends Hi{constructor(e,t){if(super(),t<0)throw new Error(`static array must have a non negative length: ${t}`);this.childType=e,this.staticLength=t}toString(){return`${this.childType.toString()}[${this.staticLength}]`}equals(e){return e instanceof eo&&this.staticLength===e.staticLength&&this.childType.equals(e.childType)}isDynamic(){return this.childType.isDynamic()}byteLen(){return this.childType.constructor===Xi?Math.ceil(this.staticLength/8):this.staticLength*this.childType.byteLen()}encode(e){if(!(Array.isArray(e)||e instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);if(e.length!==this.staticLength)throw new Error(`Value array does not match static array length. Expected ${this.staticLength}, got ${e.length}`);return this.toABITupleType().encode(e)}decode(e){return this.toABITupleType().decode(e)}toABITupleType(){return new ro(Array(this.staticLength).fill(this.childType))}}class to extends Hi{constructor(e){super(),this.childType=e}toString(){return`${this.childType.toString()}[]`}equals(e){return e instanceof to&&this.childType.equals(e.childType)}isDynamic(){return!0}byteLen(){throw new Error(`${this.toString()} is a dynamic type`)}encode(e){if(!(Array.isArray(e)||e instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);const t=this.toABITupleType(e.length),r=t.encode(e);return m(rn(t.childTypes.length,Fi),r)}decode(e){const t=o.lW.from(e).readUIntBE(0,Fi);return this.toABITupleType(t).decode(e.slice(Fi,e.length))}toABITupleType(e){return new ro(Array(e).fill(this.childType))}}class ro extends Hi{constructor(e){if(super(),e.length>=Mi)throw new Error("tuple type child type number larger than maximum uint16 error");this.childTypes=e}toString(){const e=[];for(let t=0;t<this.childTypes.length;t++)e[t]=this.childTypes[t].toString();return`(${e.join(",")})`}equals(e){return e instanceof ro&&this.childTypes.length===e.childTypes.length&&this.childTypes.every(((t,r)=>t.equals(e.childTypes[r])))}isDynamic(){return this.childTypes.some((e=>e.isDynamic()))}byteLen(){let e=0;for(let t=0;t<this.childTypes.length;t++)if(this.childTypes[t].constructor===Xi){const r=no(this.childTypes,t,1),s=r+1;t+=r,e+=Math.trunc((s+7)/8)}else e+=this.childTypes[t].byteLen();return e}encode(e){if(!(Array.isArray(e)||e instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);const t=Array.from(e);if(e.length>Mi)throw new Error("length of tuple array should not exceed a uint16");const r=this.childTypes,s=[],n=[],i=new Map;let o=0;for(;o<r.length;){const e=r[o];if(e.isDynamic())i.set(s.length,!0),s.push(new Uint8Array([0,0])),n.push(e.encode(t[o]));else{if(e.constructor===Xi){const e=no(r,o,-1);let n=no(r,o,1);if(e%8!=0)throw new Error("expected before index should have number of bool mod 8 equal 0");n=Math.min(7,n);const i=so(t.slice(o,o+n+1));s.push(rn(i,1)),o+=n}else{const r=e.encode(t[o]);s.push(r)}i.set(o,!1),n.push(new Uint8Array)}o+=1}let a=0;for(const e of s)a+=e.length;let c=0;for(let e=0;e<s.length;e++){if(i.get(e)){const t=a+c;if(t>Mi)throw new Error(`byte length of ${t} should not exceed a uint16`);s[e]=rn(t,Fi)}c+=n[e].length}return m(...s,...n)}decode(e){const t=this.childTypes,r=[],s=[];let n=0,i=0;const a=o.lW.from(e);for(;n<t.length;){const o=t[n];if(o.isDynamic()){if(e.slice(i,e.length).length<Fi)throw new Error("dynamic type in tuple is too short to be decoded");const t=a.readUIntBE(i,Fi);if(r.length>0&&(r[r.length-1].right=t,t<r[r.length-1].left))throw new Error("dynamic index segment miscalculation: left is greater than right index");const n={left:t,right:-1};r.push(n),s.push(null),i+=Fi}else if(o.constructor===Xi){const t=no(this.childTypes,n,-1);let r=no(this.childTypes,n,1);if(t%8!=0)throw new Error("expected before bool number mod 8 === 0");r=Math.min(7,r);for(let t=0;t<=r;t++){const r=128>>t;(e[i]&r)>0?s.push(new Uint8Array([128])):s.push(new Uint8Array([0]))}n+=r,i+=1}else{const t=o.byteLen();s.push(e.slice(i,i+t)),i+=t}if(n!==t.length-1&&i>=e.length)throw new Error("input byte not enough to decode");n+=1}if(r.length>0&&(r[r.length-1].right=e.length,i=e.length),i<e.length)throw new Error("input byte not fully consumed");for(let e=0;e<r.length;e++){const t=r[e];if(t.left>t.right)throw new Error("dynamic segment should display a [l, r] space with l <= r");if(e!==r.length-1&&t.right!==r[e+1].left)throw new Error("dynamic segment should be consecutive")}let c=0;for(let n=0;n<t.length;n++)t[n].isDynamic()&&(s[n]=e.slice(r[c].left,r[c].right),c+=1);const u=[];for(let e=0;e<t.length;e++){const r=t[e].decode(s[e]);u.push(r)}return u}static parseTupleContent(e){if(0===e.length)return[];if(e.endsWith(",")||e.startsWith(","))throw new Error("tuple string should not start with comma");if(e.includes(",,"))throw new Error("tuple string should not have consecutive commas");const t=[];let r=0,s="";for(const n of e)s+=n,"("===n?r+=1:")"===n?r-=1:","===n&&0===r&&(t.push(s.slice(0,s.length-1)),s="");if(0!==s.length&&t.push(s),0!==r)throw new Error("tuple string has mismatched parentheses");return t}}function so(e){let t=0;if(e.length>8)throw new Error("value list passed in should be no greater than length 8");for(let r=0;r<e.length;r++){const s=e[r];if("boolean"!=typeof s)throw new Error("non-boolean values cannot be compressed into a byte");s&&(t|=1<<7-r)}return t}function no(e,t,r){let s=0;for(;;){const n=t+r*s;if(e[n].constructor!==Xi){s-=1;break}if(n!==e.length-1&&1===r)s+=1;else{if(!(n>0&&-1===r))break;s+=1}}return s}var io,oo;function ao(e){return e===io.any||e===io.pay||e===io.keyreg||e===io.acfg||e===io.axfer||e===io.afrz||e===io.appl}function co(e,t){return e===io.any||t.type&&t.type.toString()===e.toString()}function uo(e){return e===oo.account||e===oo.application||e===oo.asset}!function(e){e.any="txn",e.pay="pay",e.keyreg="keyreg",e.acfg="acfg",e.axfer="axfer",e.afrz="afrz",e.appl="appl"}(io||(io={})),function(e){e.account="account",e.application="application",e.asset="asset"}(oo||(oo={}));class lo{constructor(e){if("string"!=typeof e.name||"object"!=typeof e.returns||!Array.isArray(e.args))throw new Error("Invalid ABIMethod parameters");this.name=e.name,this.description=e.desc,this.args=e.args.map((({type:e,name:t,desc:r})=>ao(e)||uo(e)?{type:e,name:t,description:r}:{type:Hi.from(e),name:t,description:r})),this.returns={type:"void"===e.returns.type?e.returns.type:Hi.from(e.returns.type),description:e.returns.desc}}getSignature(){const e=this.args.map((e=>e.type.toString())).join(","),t=this.returns.type.toString();return`${this.name}(${e})${t}`}getSelector(){const e=y(this.getSignature());return new Uint8Array(e.slice(0,4))}txnCount(){let e=1;for(const t of this.args)"string"==typeof t.type&&ao(t.type)&&(e+=1);return e}toJSON(){return{name:this.name,desc:this.description,args:this.args.map((({type:e,name:t,description:r})=>({type:e.toString(),name:t,desc:r}))),returns:{type:this.returns.type.toString(),desc:this.returns.description}}}static fromSignature(e){const{name:t,args:r,returns:s}=function(e){const t=e.indexOf("(");if(-1===t)throw new Error(`Invalid method signature: ${e}`);let r=-1,s=0;for(let n=t;n<e.length;n++){const t=e[n];if("("===t)s+=1;else if(")"===t){if(0===s)break;if(s-=1,0===s){r=n;break}}}if(-1===r)throw new Error(`Invalid method signature: ${e}`);return{name:e.slice(0,t),args:ro.parseTupleContent(e.slice(t+1,r)),returns:e.slice(r+1)}}(e);return new lo({name:t,args:r.map((e=>({type:e}))),returns:{type:s}})}}function ho(e,t){if(null===e||!Array.isArray(e)||!e.every((e=>e instanceof lo)))throw new Error("Methods list provided is null or not the correct type");const r=e.filter((e=>e.name===t));if(r.length>1)throw new Error(`found ${r.length} methods with the same name ${r.map((e=>e.getSignature())).join(",")}`);if(0===r.length)throw new Error(`found 0 methods with the name ${t}`);return r[0]}class po{constructor(e){if("string"!=typeof e.name||!Array.isArray(e.methods)||e.networks&&"object"!=typeof e.networks)throw new Error("Invalid ABIContract parameters");this.name=e.name,this.description=e.desc,this.networks=e.networks?{...e.networks}:{},this.methods=e.methods.map((e=>new lo(e)))}toJSON(){return{name:this.name,desc:this.description,networks:this.networks,methods:this.methods.map((e=>e.toJSON()))}}getMethodByName(e){return ho(this.methods,e)}}class fo{constructor(e){if("string"!=typeof e.name||!Array.isArray(e.methods))throw new Error("Invalid ABIInterface parameters");this.name=e.name,this.description=e.desc,this.methods=e.methods.map((e=>new lo(e)))}toJSON(){return{name:this.name,desc:this.description,methods:this.methods.map((e=>e.toJSON()))}}getMethodByName(e){return ho(this.methods,e)}}const go=o.lW.from([21,31,124,117]);var mo;function yo(e,t,r){if(null!=r&&e===r)return 0;const s=null==r?0:1;for(let r=0;r<t.length;r++)if(e===t[r])return r+s;return t.push(e),t.length-1+s}!function(e){e[e.BUILDING=0]="BUILDING",e[e.BUILT=1]="BUILT",e[e.SIGNED=2]="SIGNED",e[e.SUBMITTED=3]="SUBMITTED",e[e.COMMITTED=4]="COMMITTED"}(mo||(mo={}));class wo{constructor(){this.status=mo.BUILDING,this.transactions=[],this.methodCalls=new Map,this.signedTxns=[],this.txIDs=[]}getStatus(){return this.status}count(){return this.transactions.length}clone(){const e=new wo;return e.transactions=this.transactions.map((({txn:e,signer:t})=>({txn:se.from_obj_for_encoding({...e.get_obj_for_encoding(),grp:void 0}),signer:t}))),e.methodCalls=new Map(this.methodCalls),e}addTransaction(e){if(this.status!==mo.BUILDING)throw new Error("Cannot add transactions when composer status is not BUILDING");if(this.transactions.length===wo.MAX_GROUP_SIZE)throw new Error(`Adding an additional transaction exceeds the maximum atomic group size of ${wo.MAX_GROUP_SIZE}`);if(e.txn.group&&e.txn.group.some((e=>0!==e)))throw new Error("Cannot add a transaction with nonzero group ID");this.transactions.push(e)}addMethodCall({appID:e,method:t,methodArgs:r,sender:s,suggestedParams:n,onComplete:i,approvalProgram:o,clearProgram:a,numGlobalInts:c,numGlobalByteSlices:u,numLocalInts:l,numLocalByteSlices:d,extraPages:h,appAccounts:p,appForeignApps:f,appForeignAssets:g,boxes:m,note:y,lease:w,rekeyTo:b,signer:v}){if(this.status!==mo.BUILDING)throw new Error("Cannot add transactions when composer status is not BUILDING");if(this.transactions.length+t.txnCount()>wo.MAX_GROUP_SIZE)throw new Error(`Adding additional transactions exceeds the maximum atomic group size of ${wo.MAX_GROUP_SIZE}`);if(0===e){if(null==o||null==a||null==c||null==u||null==l||null==d)throw new Error("One of the following required parameters for application creation is missing: approvalProgram, clearProgram, numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices")}else if(i===ee.UpdateApplicationOC){if(null==o||null==a)throw new Error("One of the following required parameters for OnApplicationComplete.UpdateApplicationOC is missing: approvalProgram, clearProgram");if(null!=c||null!=u||null!=l||null!=d||null!=h)throw new Error("One of the following application creation parameters were set on a non-creation call: numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices, extraPages")}else if(null!=o||null!=a||null!=c||null!=u||null!=l||null!=d||null!=h)throw new Error("One of the following application creation parameters were set on a non-creation call: approvalProgram, clearProgram, numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices, extraPages");if(null==r&&(r=[]),r.length!==t.args.length)throw new Error(`Incorrect number of method arguments. Expected ${t.args.length}, got ${r.length}`);let x=[],_=[];const A=[],E=[],k=[],S=new Map,R=m||[];for(let e=0;e<r.length;e++){let s=t.args[e].type;const n=r[e];if(ao(s)){if(!Li(n)||!co(s,n.txn))throw new Error(`Expected ${s} TransactionWithSigner for argument at index ${e}`);if(n.txn.group&&n.txn.group.some((e=>0!==e)))throw new Error("Cannot add a transaction with nonzero group ID");A.push(n)}else{if(Li(n))throw new Error(`Expected non-transaction value for argument at index ${e}`);if(uo(s)&&(S.set(E.length,x.length),E.push(s),k.push(n),s=new Gi(8)),"string"==typeof s)throw new Error(`Unknown ABI type: ${s}`);x.push(s),_.push(n)}}const T=[],I=null==p?[]:p.slice(),B=null==f?[]:f.slice(),U=null==g?[]:g.slice();for(let t=0;t<E.length;t++){const r=E[t],n=k[t];let i=0;switch(r){case oo.account:{const e=new Ji;i=yo(e.decode(e.encode(n)),I,s);break}case oo.application:{const t=new Gi(64),r=t.decode(t.encode(n));if(r>Number.MAX_SAFE_INTEGER)throw new Error(`Expected safe integer for application value, got ${r}`);i=yo(Number(r),B,e);break}case oo.asset:{const e=new Gi(64),t=e.decode(e.encode(n));if(t>Number.MAX_SAFE_INTEGER)throw new Error(`Expected safe integer for asset value, got ${t}`);i=yo(Number(t),U);break}default:throw new Error(`Unknown reference type: ${r}`)}T.push(i)}for(let e=0;e<T.length;e++)_[S.get(e)]=T[e];if(x.length>15){const e=x.slice(14),t=_.slice(14);x=x.slice(0,14),_=_.slice(0,14),x.push(new ro(e)),_.push(t)}const P=[t.getSelector()];for(let e=0;e<x.length;e++)P.push(x[e].encode(_[e]));const j={txn:qi({from:s,appIndex:e,appArgs:P,accounts:I,foreignApps:B,foreignAssets:U,boxes:R,onComplete:null==i?ee.NoOpOC:i,approvalProgram:o,clearProgram:a,numGlobalInts:c,numGlobalByteSlices:u,numLocalInts:l,numLocalByteSlices:d,extraPages:h,lease:w,note:y,rekeyTo:b,suggestedParams:n}),signer:v};this.transactions.push(...A,j),this.methodCalls.set(this.transactions.length-1,t)}buildGroup(){if(this.status===mo.BUILDING){if(0===this.transactions.length)throw new Error("Cannot build a group with 0 transactions");this.transactions.length>1&&vn(this.transactions.map((e=>e.txn))),this.status=mo.BUILT}return this.transactions}async gatherSignatures(){if(this.status>=mo.SIGNED)return this.signedTxns;const e=this.buildGroup(),t=e.map((e=>e.txn)),r=new Map;for(let t=0;t<e.length;t++){const{signer:s}=e[t];r.has(s)||r.set(s,[]),r.get(s).push(t)}const s=Array.from(r),n=await Promise.all(s.map((([e,r])=>e(t,r)))),i=e.map((()=>null));for(let e=0;e<s.length;e++){const t=s[e][1],r=n[e];for(let e=0;e<t.length;e++)i[t[e]]=r[e]}if(!i.every((e=>null!=e)))throw new Error(`Missing signatures. Got ${i}`);const o=i.map(((e,t)=>{try{return ae(e).txn.txID()}catch(e){throw new Error(`Cannot decode signed transaction at index ${t}. ${e}`)}}));return this.signedTxns=i,this.txIDs=o,this.status=mo.SIGNED,i}async submit(e){if(this.status>mo.SUBMITTED)throw new Error("Transaction group cannot be resubmitted");const t=await this.gatherSignatures();return await e.sendRawTransaction(t).do(),this.status=mo.SUBMITTED,this.txIDs}async simulate(e,t){if(this.status>mo.SUBMITTED)throw new Error("Simulated Transaction group has already been submitted to the network");const r=(await this.gatherSignatures()).map((e=>Z(e))),s=null==t?new bt({txnGroups:[]}):t;s.txnGroups=[new vt({txns:r})];const n=await e.simulateTransactions(s).do(),i=[];for(const[e,t]of this.methodCalls){const r=this.txIDs[e],s=n.txnGroups[0].txnResults[e].txnResult,o={txID:r,rawReturnValue:new Uint8Array,method:t};i.push(wo.parseMethodResponse(t,o,s.get_obj_for_encoding()))}return{methodResults:i,simulateResponse:n}}async execute(e,t){if(this.status===mo.COMMITTED)throw new Error("Transaction group has already been executed successfully");const r=await this.submit(e);this.status=mo.SUBMITTED;const s=this.transactions.findIndex(((e,t)=>this.methodCalls.has(t))),n=-1===s?0:s,i=await tn(e,r[n],t);this.status=mo.COMMITTED;const o=i["confirmed-round"],a=[];for(const[t,n]of this.methodCalls){const o=r[t];let c={txID:o,rawReturnValue:new Uint8Array,method:n};try{const r=t===s?i:await e.pendingTransactionInformation(o).do();c=wo.parseMethodResponse(n,c,r)}catch(e){c.decodeError=e}a.push(c)}return{confirmedRound:o,txIDs:r,methodResults:a}}static parseMethodResponse(e,t,r){const s=t;try{if(s.txInfo=r,"void"!==e.returns.type){const n=r.logs||[];if(0===n.length)throw new Error("App call transaction did not log a return value");const i=o.lW.from(n[n.length-1],"base64");if(i.byteLength<4||!i.slice(0,4).equals(go))throw new Error("App call transaction did not log a return value");s.rawReturnValue=new Uint8Array(i.slice(4)),s.returnValue=e.returns.type.decode(t.rawReturnValue)}}catch(e){s.decodeError=e}return s}}wo.MAX_GROUP_SIZE=16;const bo=o.lW.from([77,88]),vo="The transaction sender address and multisig preimage do not match.";function xo(e,t){if(void 0===e.from){const r=v(t);e.from=F(r.publicKey)}const r=ce(e);return{txID:r.txID().toString(),blob:r.signTxn(t)}}function _o(e,t){return new ue(e).signBid(t)}function Ao(e,t){return x(o.lW.from(m(bo,e)),t)}function Eo(e,t,r){return A(o.lW.from(m(bo,e)),t,W(r).publicKey)}function ko(e){return new Uint8Array(X(e))}function So(e){return Z(e)}const Ro=new Error(vo),To=new Error(de),Io=n})(),s})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.algosdk=t():e.algosdk=t()}(self,(()=>(()=>{var e={117:function(e,t,n){var a;!function(i){"use strict";var r,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,c=Math.floor,h="[BigNumber Error] ",d=h+"Number primitive has more than 15 significant digits: ",u=1e14,l=14,g=9007199254740991,m=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],p=1e7,f=1e9;function y(e){var t=0|e;return e>0||e===t?t:t-1}function w(e){for(var t,n,a=1,i=e.length,r=e[0]+"";a<i;){for(t=e[a++]+"",n=l-t.length;n--;t="0"+t);r+=t}for(i=r.length;48===r.charCodeAt(--i););return r.slice(0,i+1||1)}function v(e,t){var n,a,i=e.c,r=t.c,o=e.s,s=t.s,c=e.e,h=t.e;if(!o||!s)return null;if(n=i&&!i[0],a=r&&!r[0],n||a)return n?a?0:-s:o;if(o!=s)return o;if(n=o<0,a=c==h,!i||!r)return a?0:!i^n?1:-1;if(!a)return c>h^n?1:-1;for(s=(c=i.length)<(h=r.length)?c:h,o=0;o<s;o++)if(i[o]!=r[o])return i[o]>r[o]^n?1:-1;return c==h?0:c>h^n?1:-1}function S(e,t,n,a){if(e<t||e>n||e!==c(e))throw Error(h+(a||"Argument")+("number"==typeof e?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function E(e){var t=e.c.length-1;return y(e.e/l)==t&&e.c[t]%2!=0}function k(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function b(e,t,n){var a,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(++t>(a=e.length)){for(i=n,t-=a;--t;i+=n);e+=i}else t<a&&(e=e.slice(0,t)+"."+e.slice(t));return e}r=function e(t){var n,a,i,r,x,A,D,T,I,M,V=K.prototype={constructor:K,toString:null,valueOf:null},P=new K(1),R=20,B=4,C=-7,U=21,O=-1e7,$=1e7,N=!1,L=1,_=0,z={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz";function K(e,t){var n,r,s,h,u,m,p,f,y=this;if(!(y instanceof K))return new K(e,t);if(null==t){if(e&&!0===e._isBigNumber)return y.s=e.s,void(!e.c||e.e>$?y.c=y.e=null:e.e<O?y.c=[y.e=0]:(y.e=e.e,y.c=e.c.slice()));if((m="number"==typeof e)&&0*e==0){if(y.s=1/e<0?(e=-e,-1):1,e===~~e){for(h=0,u=e;u>=10;u/=10,h++);return void(h>$?y.c=y.e=null:(y.e=h,y.c=[e]))}f=String(e)}else{if(!o.test(f=String(e)))return i(y,f,m);y.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(h=f.indexOf("."))>-1&&(f=f.replace(".","")),(u=f.search(/e/i))>0?(h<0&&(h=u),h+=+f.slice(u+1),f=f.substring(0,u)):h<0&&(h=f.length)}else{if(S(t,2,F.length,"Base"),10==t)return G(y=new K(e),R+y.e+1,B);if(f=String(e),m="number"==typeof e){if(0*e!=0)return i(y,f,m,t);if(y.s=1/e<0?(f=f.slice(1),-1):1,K.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(d+e)}else y.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(n=F.slice(0,t),h=u=0,p=f.length;u<p;u++)if(n.indexOf(r=f.charAt(u))<0){if("."==r){if(u>h){h=p;continue}}else if(!s&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){s=!0,u=-1,h=0;continue}return i(y,String(e),m,t)}m=!1,(h=(f=a(f,t,10,y.s)).indexOf("."))>-1?f=f.replace(".",""):h=f.length}for(u=0;48===f.charCodeAt(u);u++);for(p=f.length;48===f.charCodeAt(--p););if(f=f.slice(u,++p)){if(p-=u,m&&K.DEBUG&&p>15&&(e>g||e!==c(e)))throw Error(d+y.s*e);if((h=h-u-1)>$)y.c=y.e=null;else if(h<O)y.c=[y.e=0];else{if(y.e=h,y.c=[],u=(h+1)%l,h<0&&(u+=l),u<p){for(u&&y.c.push(+f.slice(0,u)),p-=l;u<p;)y.c.push(+f.slice(u,u+=l));u=l-(f=f.slice(u)).length}else u-=p;for(;u--;f+="0");y.c.push(+f)}}else y.c=[y.e=0]}function q(e,t,n,a){var i,r,o,s,c;if(null==n?n=B:S(n,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,null==t)c=w(e.c),c=1==a||2==a&&(o<=C||o>=U)?k(c,o):b(c,o,"0");else if(r=(e=G(new K(e),t,n)).e,s=(c=w(e.c)).length,1==a||2==a&&(t<=r||r<=C)){for(;s<t;c+="0",s++);c=k(c,r)}else if(t-=o,c=b(c,r,"0"),r+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=r-s)>0)for(r+1==s&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function H(e,t){for(var n,a=1,i=new K(e[0]);a<e.length;a++){if(!(n=new K(e[a])).s){i=n;break}t.call(i,n)&&(i=n)}return i}function j(e,t,n){for(var a=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,a++);return(n=a+n*l-1)>$?e.c=e.e=null:n<O?e.c=[e.e=0]:(e.e=n,e.c=t),e}function G(e,t,n,a){var i,r,o,h,d,g,p,f=e.c,y=m;if(f){e:{for(i=1,h=f[0];h>=10;h/=10,i++);if((r=t-i)<0)r+=l,o=t,p=(d=f[g=0])/y[i-o-1]%10|0;else if((g=s((r+1)/l))>=f.length){if(!a)break e;for(;f.length<=g;f.push(0));d=p=0,i=1,o=(r%=l)-l+1}else{for(d=h=f[g],i=1;h>=10;h/=10,i++);p=(o=(r%=l)-l+i)<0?0:d/y[i-o-1]%10|0}if(a=a||t<0||null!=f[g+1]||(o<0?d:d%y[i-o-1]),a=n<4?(p||a)&&(0==n||n==(e.s<0?3:2)):p>5||5==p&&(4==n||a||6==n&&(r>0?o>0?d/y[i-o]:0:f[g-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,a?(t-=e.e+1,f[0]=y[(l-t%l)%l],e.e=-t||0):f[0]=e.e=0,e;if(0==r?(f.length=g,h=1,g--):(f.length=g+1,h=y[l-r],f[g]=o>0?c(d/y[i-o]%y[o])*h:0),a)for(;;){if(0==g){for(r=1,o=f[0];o>=10;o/=10,r++);for(o=f[0]+=h,h=1;o>=10;o/=10,h++);r!=h&&(e.e++,f[0]==u&&(f[0]=1));break}if(f[g]+=h,f[g]!=u)break;f[g--]=0,h=1}for(r=f.length;0===f[--r];f.pop());}e.e>$?e.c=e.e=null:e.e<O&&(e.c=[e.e=0])}return e}function J(e){var t,n=e.e;return null===n?e.toString():(t=w(e.c),t=n<=C||n>=U?k(t,n):b(t,n,"0"),e.s<0?"-"+t:t)}return K.clone=e,K.ROUND_UP=0,K.ROUND_DOWN=1,K.ROUND_CEIL=2,K.ROUND_FLOOR=3,K.ROUND_HALF_UP=4,K.ROUND_HALF_DOWN=5,K.ROUND_HALF_EVEN=6,K.ROUND_HALF_CEIL=7,K.ROUND_HALF_FLOOR=8,K.EUCLID=9,K.config=K.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(h+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(S(n=e[t],0,f,t),R=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(S(n=e[t],0,8,t),B=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(S(n[0],-f,0,t),S(n[1],0,f,t),C=n[0],U=n[1]):(S(n,-f,f,t),C=-(U=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)S(n[0],-f,-1,t),S(n[1],1,f,t),O=n[0],$=n[1];else{if(S(n,-f,f,t),!n)throw Error(h+t+" cannot be zero: "+n);O=-($=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(h+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw N=!n,Error(h+"crypto unavailable");N=n}else N=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(S(n=e[t],0,9,t),L=n),e.hasOwnProperty(t="POW_PRECISION")&&(S(n=e[t],0,f,t),_=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(h+t+" not an object: "+n);z=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(h+t+" invalid: "+n);F=n}}return{DECIMAL_PLACES:R,ROUNDING_MODE:B,EXPONENTIAL_AT:[C,U],RANGE:[O,$],CRYPTO:N,MODULO_MODE:L,POW_PRECISION:_,FORMAT:z,ALPHABET:F}},K.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!K.DEBUG)return!0;var t,n,a=e.c,i=e.e,r=e.s;e:if("[object Array]"=={}.toString.call(a)){if((1===r||-1===r)&&i>=-f&&i<=f&&i===c(i)){if(0===a[0]){if(0===i&&1===a.length)return!0;break e}if((t=(i+1)%l)<1&&(t+=l),String(a[0]).length==t){for(t=0;t<a.length;t++)if((n=a[t])<0||n>=u||n!==c(n))break e;if(0!==n)return!0}}}else if(null===a&&null===i&&(null===r||1===r||-1===r))return!0;throw Error(h+"Invalid BigNumber: "+e)},K.maximum=K.max=function(){return H(arguments,V.lt)},K.minimum=K.min=function(){return H(arguments,V.gt)},K.random=(r=9007199254740992,x=Math.random()*r&2097151?function(){return c(Math.random()*r)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,a,i,r,o=0,d=[],u=new K(P);if(null==e?e=R:S(e,0,f),i=s(e/l),N)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));o<i;)(r=131072*t[o]+(t[o+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[o]=n[0],t[o+1]=n[1]):(d.push(r%1e14),o+=2);o=i/2}else{if(!crypto.randomBytes)throw N=!1,Error(h+"crypto unavailable");for(t=crypto.randomBytes(i*=7);o<i;)(r=281474976710656*(31&t[o])+1099511627776*t[o+1]+4294967296*t[o+2]+16777216*t[o+3]+(t[o+4]<<16)+(t[o+5]<<8)+t[o+6])>=9e15?crypto.randomBytes(7).copy(t,o):(d.push(r%1e14),o+=7);o=i/7}if(!N)for(;o<i;)(r=x())<9e15&&(d[o++]=r%1e14);for(i=d[--o],e%=l,i&&e&&(r=m[l-e],d[o]=c(i/r)*r);0===d[o];d.pop(),o--);if(o<0)d=[a=0];else{for(a=-1;0===d[0];d.splice(0,1),a-=l);for(o=1,r=d[0];r>=10;r/=10,o++);o<l&&(a-=l-o)}return u.e=a,u.c=d,u}),K.sum=function(){for(var e=1,t=arguments,n=new K(t[0]);e<t.length;)n=n.plus(t[e++]);return n},a=function(){var e="0123456789";function t(e,t,n,a){for(var i,r,o=[0],s=0,c=e.length;s<c;){for(r=o.length;r--;o[r]*=t);for(o[0]+=a.indexOf(e.charAt(s++)),i=0;i<o.length;i++)o[i]>n-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/n|0,o[i]%=n)}return o.reverse()}return function(a,i,r,o,s){var c,h,d,u,l,g,m,p,f=a.indexOf("."),y=R,v=B;for(f>=0&&(u=_,_=0,a=a.replace(".",""),g=(p=new K(i)).pow(a.length-f),_=u,p.c=t(b(w(g.c),g.e,"0"),10,r,e),p.e=p.c.length),d=u=(m=t(a,i,r,s?(c=F,e):(c=e,F))).length;0==m[--u];m.pop());if(!m[0])return c.charAt(0);if(f<0?--d:(g.c=m,g.e=d,g.s=o,m=(g=n(g,p,y,v,r)).c,l=g.r,d=g.e),f=m[h=d+y+1],u=r/2,l=l||h<0||null!=m[h+1],l=v<4?(null!=f||l)&&(0==v||v==(g.s<0?3:2)):f>u||f==u&&(4==v||l||6==v&&1&m[h-1]||v==(g.s<0?8:7)),h<1||!m[0])a=l?b(c.charAt(1),-y,c.charAt(0)):c.charAt(0);else{if(m.length=h,l)for(--r;++m[--h]>r;)m[h]=0,h||(++d,m=[1].concat(m));for(u=m.length;!m[--u];);for(f=0,a="";f<=u;a+=c.charAt(m[f++]));a=b(a,d,c.charAt(0))}return a}}(),n=function(){function e(e,t,n){var a,i,r,o,s=0,c=e.length,h=t%p,d=t/p|0;for(e=e.slice();c--;)s=((i=h*(r=e[c]%p)+(a=d*r+(o=e[c]/p|0)*h)%p*p+s)/n|0)+(a/p|0)+d*o,e[c]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,a){var i,r;if(n!=a)r=n>a?1:-1;else for(i=r=0;i<n;i++)if(e[i]!=t[i]){r=e[i]>t[i]?1:-1;break}return r}function n(e,t,n,a){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*a+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(a,i,r,o,s){var h,d,g,m,p,f,w,v,S,E,k,b,x,A,D,T,I,M=a.s==i.s?1:-1,V=a.c,P=i.c;if(!(V&&V[0]&&P&&P[0]))return new K(a.s&&i.s&&(V?!P||V[0]!=P[0]:P)?V&&0==V[0]||!P?0*M:M/0:NaN);for(S=(v=new K(M)).c=[],M=r+(d=a.e-i.e)+1,s||(s=u,d=y(a.e/l)-y(i.e/l),M=M/l|0),g=0;P[g]==(V[g]||0);g++);if(P[g]>(V[g]||0)&&d--,M<0)S.push(1),m=!0;else{for(A=V.length,T=P.length,g=0,M+=2,(p=c(s/(P[0]+1)))>1&&(P=e(P,p,s),V=e(V,p,s),T=P.length,A=V.length),x=T,k=(E=V.slice(0,T)).length;k<T;E[k++]=0);I=P.slice(),I=[0].concat(I),D=P[0],P[1]>=s/2&&D++;do{if(p=0,(h=t(P,E,T,k))<0){if(b=E[0],T!=k&&(b=b*s+(E[1]||0)),(p=c(b/D))>1)for(p>=s&&(p=s-1),w=(f=e(P,p,s)).length,k=E.length;1==t(f,E,w,k);)p--,n(f,T<w?I:P,w,s),w=f.length,h=1;else 0==p&&(h=p=1),w=(f=P.slice()).length;if(w<k&&(f=[0].concat(f)),n(E,f,k,s),k=E.length,-1==h)for(;t(P,E,T,k)<1;)p++,n(E,T<k?I:P,k,s),k=E.length}else 0===h&&(p++,E=[0]);S[g++]=p,E[0]?E[k++]=V[x]||0:(E=[V[x]],k=1)}while((x++<A||null!=E[0])&&M--);m=null!=E[0],S[0]||S.splice(0,1)}if(s==u){for(g=1,M=S[0];M>=10;M/=10,g++);G(v,r+(v.e=g+d*l-1)+1,o,m)}else v.e=d,v.r=+m;return v}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,D=/^([^.]+)\.$/,T=/^\.([^.]+)$/,I=/^-?(Infinity|NaN)$/,M=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,n,a){var i,r=n?t:t.replace(M,"");if(I.test(r))e.s=isNaN(r)?null:r<0?-1:1;else{if(!n&&(r=r.replace(A,(function(e,t,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,a&&a!=i?e:t})),a&&(i=a,r=r.replace(D,"$1").replace(T,"0.$1")),t!=r))return new K(r,i);if(K.DEBUG)throw Error(h+"Not a"+(a?" base "+a:"")+" number: "+t);e.s=null}e.c=e.e=null},V.absoluteValue=V.abs=function(){var e=new K(this);return e.s<0&&(e.s=1),e},V.comparedTo=function(e,t){return v(this,new K(e,t))},V.decimalPlaces=V.dp=function(e,t){var n,a,i,r=this;if(null!=e)return S(e,0,f),null==t?t=B:S(t,0,8),G(new K(r),e+r.e+1,t);if(!(n=r.c))return null;if(a=((i=n.length-1)-y(this.e/l))*l,i=n[i])for(;i%10==0;i/=10,a--);return a<0&&(a=0),a},V.dividedBy=V.div=function(e,t){return n(this,new K(e,t),R,B)},V.dividedToIntegerBy=V.idiv=function(e,t){return n(this,new K(e,t),0,1)},V.exponentiatedBy=V.pow=function(e,t){var n,a,i,r,o,d,u,g,m=this;if((e=new K(e)).c&&!e.isInteger())throw Error(h+"Exponent not an integer: "+J(e));if(null!=t&&(t=new K(t)),o=e.e>14,!m.c||!m.c[0]||1==m.c[0]&&!m.e&&1==m.c.length||!e.c||!e.c[0])return g=new K(Math.pow(+J(m),o?2-E(e):+J(e))),t?g.mod(t):g;if(d=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new K(NaN);(a=!d&&m.isInteger()&&t.isInteger())&&(m=m.mod(t))}else{if(e.e>9&&(m.e>0||m.e<-1||(0==m.e?m.c[0]>1||o&&m.c[1]>=24e7:m.c[0]<8e13||o&&m.c[0]<=9999975e7)))return r=m.s<0&&E(e)?-0:0,m.e>-1&&(r=1/r),new K(d?1/r:r);_&&(r=s(_/l+2))}for(o?(n=new K(.5),d&&(e.s=1),u=E(e)):u=(i=Math.abs(+J(e)))%2,g=new K(P);;){if(u){if(!(g=g.times(m)).c)break;r?g.c.length>r&&(g.c.length=r):a&&(g=g.mod(t))}if(i){if(0===(i=c(i/2)))break;u=i%2}else if(G(e=e.times(n),e.e+1,1),e.e>14)u=E(e);else{if(0==(i=+J(e)))break;u=i%2}m=m.times(m),r?m.c&&m.c.length>r&&(m.c.length=r):a&&(m=m.mod(t))}return a?g:(d&&(g=P.div(g)),t?g.mod(t):r?G(g,_,B,void 0):g)},V.integerValue=function(e){var t=new K(this);return null==e?e=B:S(e,0,8),G(t,t.e+1,e)},V.isEqualTo=V.eq=function(e,t){return 0===v(this,new K(e,t))},V.isFinite=function(){return!!this.c},V.isGreaterThan=V.gt=function(e,t){return v(this,new K(e,t))>0},V.isGreaterThanOrEqualTo=V.gte=function(e,t){return 1===(t=v(this,new K(e,t)))||0===t},V.isInteger=function(){return!!this.c&&y(this.e/l)>this.c.length-2},V.isLessThan=V.lt=function(e,t){return v(this,new K(e,t))<0},V.isLessThanOrEqualTo=V.lte=function(e,t){return-1===(t=v(this,new K(e,t)))||0===t},V.isNaN=function(){return!this.s},V.isNegative=function(){return this.s<0},V.isPositive=function(){return this.s>0},V.isZero=function(){return!!this.c&&0==this.c[0]},V.minus=function(e,t){var n,a,i,r,o=this,s=o.s;if(t=(e=new K(e,t)).s,!s||!t)return new K(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/l,h=e.e/l,d=o.c,g=e.c;if(!c||!h){if(!d||!g)return d?(e.s=-t,e):new K(g?o:NaN);if(!d[0]||!g[0])return g[0]?(e.s=-t,e):new K(d[0]?o:3==B?-0:0)}if(c=y(c),h=y(h),d=d.slice(),s=c-h){for((r=s<0)?(s=-s,i=d):(h=c,i=g),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(a=(r=(s=d.length)<(t=g.length))?s:t,s=t=0;t<a;t++)if(d[t]!=g[t]){r=d[t]<g[t];break}if(r&&(i=d,d=g,g=i,e.s=-e.s),(t=(a=g.length)-(n=d.length))>0)for(;t--;d[n++]=0);for(t=u-1;a>s;){if(d[--a]<g[a]){for(n=a;n&&!d[--n];d[n]=t);--d[n],d[a]+=u}d[a]-=g[a]}for(;0==d[0];d.splice(0,1),--h);return d[0]?j(e,d,h):(e.s=3==B?-1:1,e.c=[e.e=0],e)},V.modulo=V.mod=function(e,t){var a,i,r=this;return e=new K(e,t),!r.c||!e.s||e.c&&!e.c[0]?new K(NaN):!e.c||r.c&&!r.c[0]?new K(r):(9==L?(i=e.s,e.s=1,a=n(r,e,0,3),e.s=i,a.s*=i):a=n(r,e,0,L),(e=r.minus(a.times(e))).c[0]||1!=L||(e.s=r.s),e)},V.multipliedBy=V.times=function(e,t){var n,a,i,r,o,s,c,h,d,g,m,f,w,v,S,E=this,k=E.c,b=(e=new K(e,t)).c;if(!(k&&b&&k[0]&&b[0]))return!E.s||!e.s||k&&!k[0]&&!b||b&&!b[0]&&!k?e.c=e.e=e.s=null:(e.s*=E.s,k&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(a=y(E.e/l)+y(e.e/l),e.s*=E.s,(c=k.length)<(g=b.length)&&(w=k,k=b,b=w,i=c,c=g,g=i),i=c+g,w=[];i--;w.push(0));for(v=u,S=p,i=g;--i>=0;){for(n=0,m=b[i]%S,f=b[i]/S|0,r=i+(o=c);r>i;)n=((h=m*(h=k[--o]%S)+(s=f*h+(d=k[o]/S|0)*m)%S*S+w[r]+n)/v|0)+(s/S|0)+f*d,w[r--]=h%v;w[r]=n}return n?++a:w.splice(0,1),j(e,w,a)},V.negated=function(){var e=new K(this);return e.s=-e.s||null,e},V.plus=function(e,t){var n,a=this,i=a.s;if(t=(e=new K(e,t)).s,!i||!t)return new K(NaN);if(i!=t)return e.s=-t,a.minus(e);var r=a.e/l,o=e.e/l,s=a.c,c=e.c;if(!r||!o){if(!s||!c)return new K(i/0);if(!s[0]||!c[0])return c[0]?e:new K(s[0]?a:0*i)}if(r=y(r),o=y(o),s=s.slice(),i=r-o){for(i>0?(o=r,n=c):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for((i=s.length)-(t=c.length)<0&&(n=c,c=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+c[t]+i)/u|0,s[t]=u===s[t]?0:s[t]%u;return i&&(s=[i].concat(s),++o),j(e,s,o)},V.precision=V.sd=function(e,t){var n,a,i,r=this;if(null!=e&&e!==!!e)return S(e,1,f),null==t?t=B:S(t,0,8),G(new K(r),e,t);if(!(n=r.c))return null;if(a=(i=n.length-1)*l+1,i=n[i]){for(;i%10==0;i/=10,a--);for(i=n[0];i>=10;i/=10,a++);}return e&&r.e+1>a&&(a=r.e+1),a},V.shiftedBy=function(e){return S(e,-9007199254740991,g),this.times("1e"+e)},V.squareRoot=V.sqrt=function(){var e,t,a,i,r,o=this,s=o.c,c=o.s,h=o.e,d=R+4,u=new K("0.5");if(1!==c||!s||!s[0])return new K(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);if(0==(c=Math.sqrt(+J(o)))||c==1/0?(((t=w(s)).length+h)%2==0&&(t+="0"),c=Math.sqrt(+t),h=y((h+1)/2)-(h<0||h%2),a=new K(t=c==1/0?"5e"+h:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+h)):a=new K(c+""),a.c[0])for((c=(h=a.e)+d)<3&&(c=0);;)if(r=a,a=u.times(r.plus(n(o,r,d,1))),w(r.c).slice(0,c)===(t=w(a.c)).slice(0,c)){if(a.e<h&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(G(a,a.e+R+2,1),e=!a.times(a).eq(o));break}if(!i&&(G(r,r.e+R+2,0),r.times(r).eq(o))){a=r;break}d+=4,c+=4,i=1}return G(a,a.e+R+1,B,e)},V.toExponential=function(e,t){return null!=e&&(S(e,0,f),e++),q(this,e,t,1)},V.toFixed=function(e,t){return null!=e&&(S(e,0,f),e=e+this.e+1),q(this,e,t)},V.toFormat=function(e,t,n){var a,i=this;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=z;else if("object"!=typeof n)throw Error(h+"Argument not an object: "+n);if(a=i.toFixed(e,t),i.c){var r,o=a.split("."),s=+n.groupSize,c=+n.secondaryGroupSize,d=n.groupSeparator||"",u=o[0],l=o[1],g=i.s<0,m=g?u.slice(1):u,p=m.length;if(c&&(r=s,s=c,c=r,p-=r),s>0&&p>0){for(r=p%s||s,u=m.substr(0,r);r<p;r+=s)u+=d+m.substr(r,s);c>0&&(u+=d+m.slice(r)),g&&(u="-"+u)}a=l?u+(n.decimalSeparator||"")+((c=+n.fractionGroupSize)?l.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):l):u}return(n.prefix||"")+a+(n.suffix||"")},V.toFraction=function(e){var t,a,i,r,o,s,c,d,u,g,p,f,y=this,v=y.c;if(null!=e&&(!(c=new K(e)).isInteger()&&(c.c||1!==c.s)||c.lt(P)))throw Error(h+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+J(c));if(!v)return new K(y);for(t=new K(P),u=a=new K(P),i=d=new K(P),f=w(v),o=t.e=f.length-y.e-1,t.c[0]=m[(s=o%l)<0?l+s:s],e=!e||c.comparedTo(t)>0?o>0?t:u:c,s=$,$=1/0,c=new K(f),d.c[0]=0;g=n(c,t,0,1),1!=(r=a.plus(g.times(i))).comparedTo(e);)a=i,i=r,u=d.plus(g.times(r=u)),d=r,t=c.minus(g.times(r=t)),c=r;return r=n(e.minus(a),i,0,1),d=d.plus(r.times(u)),a=a.plus(r.times(i)),d.s=u.s=y.s,p=n(u,i,o*=2,B).minus(y).abs().comparedTo(n(d,a,o,B).minus(y).abs())<1?[u,i]:[d,a],$=s,p},V.toNumber=function(){return+J(this)},V.toPrecision=function(e,t){return null!=e&&S(e,1,f),q(this,e,t,2)},V.toString=function(e){var t,n=this,i=n.s,r=n.e;return null===r?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=r<=C||r>=U?k(w(n.c),r):b(w(n.c),r,"0"):10===e?t=b(w((n=G(new K(n),R+r+1,B)).c),n.e,"0"):(S(e,2,F.length,"Base"),t=a(b(w(n.c),r,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},V.valueOf=V.toJSON=function(){return J(this)},V._isBigNumber=!0,null!=t&&K.set(t),K}(),r.default=r.BigNumber=r,void 0===(a=function(){return r}.call(t,n,t,e))||(e.exports=a)}()},267:(e,t,n)=>{var a;!function(){"use strict";var t="object"==typeof window?window:{};!t.HI_BASE32_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(t=n.g);var i=!t.HI_BASE32_NO_COMMON_JS&&e.exports,r=n.amdO,o="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),s={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},c=[0,0,0,0,0,0,0,0],h=function(e,t){t.length>10&&(t="..."+t.substr(-10));var n=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+e+" bytes: "+t+" <-");throw n.position=e,n},d=function(e){if(""===e)return[];if(!/^[A-Z2-7=]+$/.test(e))throw new Error("Invalid base32 characters");for(var t,n,a,i,r,o,c,h,d=[],u=0,l=(e=e.replace(/=/g,"")).length,g=0,m=l>>3<<3;g<m;)t=s[e.charAt(g++)],n=s[e.charAt(g++)],a=s[e.charAt(g++)],i=s[e.charAt(g++)],r=s[e.charAt(g++)],o=s[e.charAt(g++)],c=s[e.charAt(g++)],h=s[e.charAt(g++)],d[u++]=255&(t<<3|n>>>2),d[u++]=255&(n<<6|a<<1|i>>>4),d[u++]=255&(i<<4|r>>>1),d[u++]=255&(r<<7|o<<2|c>>>3),d[u++]=255&(c<<5|h);var p=l-m;return 2===p?(t=s[e.charAt(g++)],n=s[e.charAt(g++)],d[u++]=255&(t<<3|n>>>2)):4===p?(t=s[e.charAt(g++)],n=s[e.charAt(g++)],a=s[e.charAt(g++)],i=s[e.charAt(g++)],d[u++]=255&(t<<3|n>>>2),d[u++]=255&(n<<6|a<<1|i>>>4)):5===p?(t=s[e.charAt(g++)],n=s[e.charAt(g++)],a=s[e.charAt(g++)],i=s[e.charAt(g++)],r=s[e.charAt(g++)],d[u++]=255&(t<<3|n>>>2),d[u++]=255&(n<<6|a<<1|i>>>4),d[u++]=255&(i<<4|r>>>1)):7===p&&(t=s[e.charAt(g++)],n=s[e.charAt(g++)],a=s[e.charAt(g++)],i=s[e.charAt(g++)],r=s[e.charAt(g++)],o=s[e.charAt(g++)],c=s[e.charAt(g++)],d[u++]=255&(t<<3|n>>>2),d[u++]=255&(n<<6|a<<1|i>>>4),d[u++]=255&(i<<4|r>>>1),d[u++]=255&(r<<7|o<<2|c>>>3)),d},u=function(e,t){if(!t)return function(e){for(var t,n,a="",i=e.length,r=0,o=0;r<i;)if((t=e[r++])<=127)a+=String.fromCharCode(t);else{t>191&&t<=223?(n=31&t,o=1):t<=239?(n=15&t,o=2):t<=247?(n=7&t,o=3):h(r,a);for(var s=0;s<o;++s)((t=e[r++])<128||t>191)&&h(r,a),n<<=6,n+=63&t;n>=55296&&n<=57343&&h(r,a),n>1114111&&h(r,a),n<=65535?a+=String.fromCharCode(n):(n-=65536,a+=String.fromCharCode(55296+(n>>10)),a+=String.fromCharCode(56320+(1023&n)))}return a}(d(e));if(""===e)return"";if(!/^[A-Z2-7=]+$/.test(e))throw new Error("Invalid base32 characters");var n,a,i,r,o,c,u,l,g="",m=e.indexOf("=");-1===m&&(m=e.length);for(var p=0,f=m>>3<<3;p<f;)n=s[e.charAt(p++)],a=s[e.charAt(p++)],i=s[e.charAt(p++)],r=s[e.charAt(p++)],o=s[e.charAt(p++)],c=s[e.charAt(p++)],u=s[e.charAt(p++)],l=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))+String.fromCharCode(255&(a<<6|i<<1|r>>>4))+String.fromCharCode(255&(r<<4|o>>>1))+String.fromCharCode(255&(o<<7|c<<2|u>>>3))+String.fromCharCode(255&(u<<5|l));var y=m-f;return 2===y?(n=s[e.charAt(p++)],a=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))):4===y?(n=s[e.charAt(p++)],a=s[e.charAt(p++)],i=s[e.charAt(p++)],r=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))+String.fromCharCode(255&(a<<6|i<<1|r>>>4))):5===y?(n=s[e.charAt(p++)],a=s[e.charAt(p++)],i=s[e.charAt(p++)],r=s[e.charAt(p++)],o=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))+String.fromCharCode(255&(a<<6|i<<1|r>>>4))+String.fromCharCode(255&(r<<4|o>>>1))):7===y&&(n=s[e.charAt(p++)],a=s[e.charAt(p++)],i=s[e.charAt(p++)],r=s[e.charAt(p++)],o=s[e.charAt(p++)],c=s[e.charAt(p++)],u=s[e.charAt(p++)],g+=String.fromCharCode(255&(n<<3|a>>>2))+String.fromCharCode(255&(a<<6|i<<1|r>>>4))+String.fromCharCode(255&(r<<4|o>>>1))+String.fromCharCode(255&(o<<7|c<<2|u>>>3))),g},l={encode:function(e,t){var n="string"!=typeof e;return n&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),n?function(e){for(var t,n,a,i,r,s="",c=e.length,h=0,d=5*parseInt(c/5);h<d;)t=e[h++],n=e[h++],a=e[h++],i=e[h++],r=e[h++],s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[31&(i<<3|r>>>5)]+o[31&r];var u=c-d;return 1===u?(t=e[h],s+=o[t>>>3]+o[t<<2&31]+"======"):2===u?(t=e[h++],n=e[h],s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[n<<4&31]+"===="):3===u?(t=e[h++],n=e[h++],a=e[h],s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[a<<1&31]+"==="):4===u&&(t=e[h++],n=e[h++],a=e[h++],i=e[h],s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[i<<3&31]+"="),s}(e):t?function(e){for(var t,n,a,i,r,s="",c=e.length,h=0,d=5*parseInt(c/5);h<d;)t=e.charCodeAt(h++),n=e.charCodeAt(h++),a=e.charCodeAt(h++),i=e.charCodeAt(h++),r=e.charCodeAt(h++),s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[31&(i<<3|r>>>5)]+o[31&r];var u=c-d;return 1===u?(t=e.charCodeAt(h),s+=o[t>>>3]+o[t<<2&31]+"======"):2===u?(t=e.charCodeAt(h++),n=e.charCodeAt(h),s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[n<<4&31]+"===="):3===u?(t=e.charCodeAt(h++),n=e.charCodeAt(h++),a=e.charCodeAt(h),s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[a<<1&31]+"==="):4===u&&(t=e.charCodeAt(h++),n=e.charCodeAt(h++),a=e.charCodeAt(h++),i=e.charCodeAt(h),s+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[i<<3&31]+"="),s}(e):function(e){var t,n,a,i,r,s,h,d=!1,u="",l=0,g=0,m=e.length;if(""===e)return u;do{for(c[0]=c[5],c[1]=c[6],c[2]=c[7],h=g;l<m&&h<5;++l)(s=e.charCodeAt(l))<128?c[h++]=s:s<2048?(c[h++]=192|s>>6,c[h++]=128|63&s):s<55296||s>=57344?(c[h++]=224|s>>12,c[h++]=128|s>>6&63,c[h++]=128|63&s):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++l)),c[h++]=240|s>>18,c[h++]=128|s>>12&63,c[h++]=128|s>>6&63,c[h++]=128|63&s);g=h-5,l===m&&++l,l>m&&h<6&&(d=!0),t=c[0],h>4?(n=c[1],a=c[2],i=c[3],r=c[4],u+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[31&(i<<3|r>>>5)]+o[31&r]):1===h?u+=o[t>>>3]+o[t<<2&31]+"======":2===h?(n=c[1],u+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[n<<4&31]+"===="):3===h?(n=c[1],a=c[2],u+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[a<<1&31]+"==="):(n=c[1],a=c[2],i=c[3],u+=o[t>>>3]+o[31&(t<<2|n>>>6)]+o[n>>>1&31]+o[31&(n<<4|a>>>4)]+o[31&(a<<1|i>>>7)]+o[i>>>2&31]+o[i<<3&31]+"=")}while(!d);return u}(e)},decode:u};u.asBytes=d,i?e.exports=l:(t.base32=l,r&&(void 0===(a=function(){return l}.call(l,n,l,e))||(e.exports=a)))}()},757:(e,t,n)=>{var a;!function(){"use strict";var t="input is invalid type",i="object"==typeof window,r=i?window:{};r.JS_SHA512_NO_WINDOW&&(i=!1);var o=!i&&"object"==typeof self;!r.JS_SHA512_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=n.g:o&&(r=self);var s=!r.JS_SHA512_NO_COMMON_JS&&e.exports,c=n.amdO,h=!r.JS_SHA512_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),u=[-2147483648,8388608,32768,128],l=[24,16,8,0],g=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],m=["hex","array","digest","arrayBuffer"],p=[];!r.JS_SHA512_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!h||!r.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var f=function(e,t){return function(n){return new S(t,!0).update(n)[e]()}},y=function(e){var t=f("hex",e);t.create=function(){return new S(e)},t.update=function(e){return t.create().update(e)};for(var n=0;n<m.length;++n){var a=m[n];t[a]=f(a,e)}return t},w=function(e,t){return function(n,a){return new E(n,t,!0).update(a)[e]()}},v=function(e){var t=w("hex",e);t.create=function(t){return new E(t,e)},t.update=function(e,n){return t.create(e).update(n)};for(var n=0;n<m.length;++n){var a=m[n];t[a]=w(a,e)}return t};function S(e,t){t?(p[0]=p[1]=p[2]=p[3]=p[4]=p[5]=p[6]=p[7]=p[8]=p[9]=p[10]=p[11]=p[12]=p[13]=p[14]=p[15]=p[16]=p[17]=p[18]=p[19]=p[20]=p[21]=p[22]=p[23]=p[24]=p[25]=p[26]=p[27]=p[28]=p[29]=p[30]=p[31]=p[32]=0,this.blocks=p):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],384==e?(this.h0h=3418070365,this.h0l=3238371032,this.h1h=1654270250,this.h1l=914150663,this.h2h=2438529370,this.h2l=812702999,this.h3h=355462360,this.h3l=4144912697,this.h4h=1731405415,this.h4l=4290775857,this.h5h=2394180231,this.h5l=1750603025,this.h6h=3675008525,this.h6l=1694076839,this.h7h=1203062813,this.h7l=3204075428):256==e?(this.h0h=573645204,this.h0l=4230739756,this.h1h=2673172387,this.h1l=3360449730,this.h2h=596883563,this.h2l=1867755857,this.h3h=2520282905,this.h3l=1497426621,this.h4h=2519219938,this.h4l=2827943907,this.h5h=3193839141,this.h5l=1401305490,this.h6h=721525244,this.h6l=746961066,this.h7h=246885852,this.h7l=2177182882):224==e?(this.h0h=2352822216,this.h0l=424955298,this.h1h=1944164710,this.h1l=2312950998,this.h2h=502970286,this.h2l=855612546,this.h3h=1738396948,this.h3l=1479516111,this.h4h=258812777,this.h4l=2077511080,this.h5h=2011393907,this.h5l=79989058,this.h6h=1067287976,this.h6l=1780299464,this.h7h=286451373,this.h7l=2446758561):(this.h0h=1779033703,this.h0l=4089235720,this.h1h=3144134277,this.h1l=2227873595,this.h2h=1013904242,this.h2l=4271175723,this.h3h=2773480762,this.h3l=1595750129,this.h4h=1359893119,this.h4l=2917565137,this.h5h=2600822924,this.h5l=725511199,this.h6h=528734635,this.h6l=4215389547,this.h7h=1541459225,this.h7l=327033209),this.bits=e,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}function E(e,n,a){var i,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(t);if(null===e)throw new Error(t);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(t);i=!0}var o=e.length;if(!i){for(var s,c=[],d=(o=e.length,0),u=0;u<o;++u)(s=e.charCodeAt(u))<128?c[d++]=s:s<2048?(c[d++]=192|s>>6,c[d++]=128|63&s):s<55296||s>=57344?(c[d++]=224|s>>12,c[d++]=128|s>>6&63,c[d++]=128|63&s):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++u)),c[d++]=240|s>>18,c[d++]=128|s>>12&63,c[d++]=128|s>>6&63,c[d++]=128|63&s);e=c}e.length>128&&(e=new S(n,!0).update(e).array());var l=[],g=[];for(u=0;u<128;++u){var m=e[u]||0;l[u]=92^m,g[u]=54^m}S.call(this,n,a),this.update(g),this.oKeyPad=l,this.inner=!0,this.sharedMemory=a}S.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var n,a=typeof e;if("string"!==a){if("object"!==a)throw new Error(t);if(null===e)throw new Error(t);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}for(var i,r,o=0,s=e.length,c=this.blocks;o<s;){if(this.hashed&&(this.hashed=!1,c[0]=this.block,c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=c[16]=c[17]=c[18]=c[19]=c[20]=c[21]=c[22]=c[23]=c[24]=c[25]=c[26]=c[27]=c[28]=c[29]=c[30]=c[31]=c[32]=0),n)for(r=this.start;o<s&&r<128;++o)c[r>>2]|=e[o]<<l[3&r++];else for(r=this.start;o<s&&r<128;++o)(i=e.charCodeAt(o))<128?c[r>>2]|=i<<l[3&r++]:i<2048?(c[r>>2]|=(192|i>>6)<<l[3&r++],c[r>>2]|=(128|63&i)<<l[3&r++]):i<55296||i>=57344?(c[r>>2]|=(224|i>>12)<<l[3&r++],c[r>>2]|=(128|i>>6&63)<<l[3&r++],c[r>>2]|=(128|63&i)<<l[3&r++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++o)),c[r>>2]|=(240|i>>18)<<l[3&r++],c[r>>2]|=(128|i>>12&63)<<l[3&r++],c[r>>2]|=(128|i>>6&63)<<l[3&r++],c[r>>2]|=(128|63&i)<<l[3&r++]);this.lastByteIndex=r,this.bytes+=r-this.start,r>=128?(this.block=c[32],this.start=r-128,this.hash(),this.hashed=!0):this.start=r}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[32]=this.block,e[t>>2]|=u[3&t],this.block=e[32],t>=112&&(this.hashed||this.hash(),e[0]=this.block,e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=e[16]=e[17]=e[18]=e[19]=e[20]=e[21]=e[22]=e[23]=e[24]=e[25]=e[26]=e[27]=e[28]=e[29]=e[30]=e[31]=e[32]=0),e[30]=this.hBytes<<3|this.bytes>>>29,e[31]=this.bytes<<3,this.hash()}},S.prototype.hash=function(){var e,t,n,a,i,r,o,s,c,h,d,u,l,m,p,f,y,w,v,S,E,k,b,x,A,D=this.h0h,T=this.h0l,I=this.h1h,M=this.h1l,V=this.h2h,P=this.h2l,R=this.h3h,B=this.h3l,C=this.h4h,U=this.h4l,O=this.h5h,$=this.h5l,N=this.h6h,L=this.h6l,_=this.h7h,z=this.h7l,F=this.blocks;for(e=32;e<160;e+=2)t=((S=F[e-30])>>>1|(E=F[e-29])<<31)^(S>>>8|E<<24)^S>>>7,n=(E>>>1|S<<31)^(E>>>8|S<<24)^(E>>>7|S<<25),a=((S=F[e-4])>>>19|(E=F[e-3])<<13)^(E>>>29|S<<3)^S>>>6,i=(E>>>19|S<<13)^(S>>>29|E<<3)^(E>>>6|S<<26),S=F[e-32],E=F[e-31],c=((k=F[e-14])>>>16)+(S>>>16)+(t>>>16)+(a>>>16)+((s=(65535&k)+(65535&S)+(65535&t)+(65535&a)+((o=((b=F[e-13])>>>16)+(E>>>16)+(n>>>16)+(i>>>16)+((r=(65535&b)+(65535&E)+(65535&n)+(65535&i))>>>16))>>>16))>>>16),F[e]=c<<16|65535&s,F[e+1]=o<<16|65535&r;var K=D,q=T,H=I,j=M,G=V,J=P,W=R,Y=B,X=C,Z=U,Q=O,ee=$,te=N,ne=L,ae=_,ie=z;for(f=H&G,y=j&J,e=0;e<160;e+=8)t=(K>>>28|q<<4)^(q>>>2|K<<30)^(q>>>7|K<<25),n=(q>>>28|K<<4)^(K>>>2|q<<30)^(K>>>7|q<<25),a=(X>>>14|Z<<18)^(X>>>18|Z<<14)^(Z>>>9|X<<23),i=(Z>>>14|X<<18)^(Z>>>18|X<<14)^(X>>>9|Z<<23),w=(h=K&H)^K&G^f,v=(d=q&j)^q&J^y,x=X&Q^~X&te,A=Z&ee^~Z&ne,S=F[e],E=F[e+1],S=(c=((k=g[e])>>>16)+(S>>>16)+(x>>>16)+(a>>>16)+(ae>>>16)+((s=(65535&k)+(65535&S)+(65535&x)+(65535&a)+(65535&ae)+((o=((b=g[e+1])>>>16)+(E>>>16)+(A>>>16)+(i>>>16)+(ie>>>16)+((r=(65535&b)+(65535&E)+(65535&A)+(65535&i)+(65535&ie))>>>16))>>>16))>>>16))<<16|65535&s,E=o<<16|65535&r,k=(c=(w>>>16)+(t>>>16)+((s=(65535&w)+(65535&t)+((o=(v>>>16)+(n>>>16)+((r=(65535&v)+(65535&n))>>>16))>>>16))>>>16))<<16|65535&s,b=o<<16|65535&r,ae=(c=(W>>>16)+(S>>>16)+((s=(65535&W)+(65535&S)+((o=(Y>>>16)+(E>>>16)+((r=(65535&Y)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s,ie=o<<16|65535&r,t=((W=(c=(k>>>16)+(S>>>16)+((s=(65535&k)+(65535&S)+((o=(b>>>16)+(E>>>16)+((r=(65535&b)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(Y=o<<16|65535&r)<<4)^(Y>>>2|W<<30)^(Y>>>7|W<<25),n=(Y>>>28|W<<4)^(W>>>2|Y<<30)^(W>>>7|Y<<25),a=(ae>>>14|ie<<18)^(ae>>>18|ie<<14)^(ie>>>9|ae<<23),i=(ie>>>14|ae<<18)^(ie>>>18|ae<<14)^(ae>>>9|ie<<23),w=(u=W&K)^W&H^h,v=(l=Y&q)^Y&j^d,x=ae&X^~ae&Q,A=ie&Z^~ie&ee,S=F[e+2],E=F[e+3],S=(c=((k=g[e+2])>>>16)+(S>>>16)+(x>>>16)+(a>>>16)+(te>>>16)+((s=(65535&k)+(65535&S)+(65535&x)+(65535&a)+(65535&te)+((o=((b=g[e+3])>>>16)+(E>>>16)+(A>>>16)+(i>>>16)+(ne>>>16)+((r=(65535&b)+(65535&E)+(65535&A)+(65535&i)+(65535&ne))>>>16))>>>16))>>>16))<<16|65535&s,E=o<<16|65535&r,k=(c=(w>>>16)+(t>>>16)+((s=(65535&w)+(65535&t)+((o=(v>>>16)+(n>>>16)+((r=(65535&v)+(65535&n))>>>16))>>>16))>>>16))<<16|65535&s,b=o<<16|65535&r,te=(c=(G>>>16)+(S>>>16)+((s=(65535&G)+(65535&S)+((o=(J>>>16)+(E>>>16)+((r=(65535&J)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s,ne=o<<16|65535&r,t=((G=(c=(k>>>16)+(S>>>16)+((s=(65535&k)+(65535&S)+((o=(b>>>16)+(E>>>16)+((r=(65535&b)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(J=o<<16|65535&r)<<4)^(J>>>2|G<<30)^(J>>>7|G<<25),n=(J>>>28|G<<4)^(G>>>2|J<<30)^(G>>>7|J<<25),a=(te>>>14|ne<<18)^(te>>>18|ne<<14)^(ne>>>9|te<<23),i=(ne>>>14|te<<18)^(ne>>>18|te<<14)^(te>>>9|ne<<23),w=(m=G&W)^G&K^u,v=(p=J&Y)^J&q^l,x=te&ae^~te&X,A=ne&ie^~ne&Z,S=F[e+4],E=F[e+5],S=(c=((k=g[e+4])>>>16)+(S>>>16)+(x>>>16)+(a>>>16)+(Q>>>16)+((s=(65535&k)+(65535&S)+(65535&x)+(65535&a)+(65535&Q)+((o=((b=g[e+5])>>>16)+(E>>>16)+(A>>>16)+(i>>>16)+(ee>>>16)+((r=(65535&b)+(65535&E)+(65535&A)+(65535&i)+(65535&ee))>>>16))>>>16))>>>16))<<16|65535&s,E=o<<16|65535&r,k=(c=(w>>>16)+(t>>>16)+((s=(65535&w)+(65535&t)+((o=(v>>>16)+(n>>>16)+((r=(65535&v)+(65535&n))>>>16))>>>16))>>>16))<<16|65535&s,b=o<<16|65535&r,Q=(c=(H>>>16)+(S>>>16)+((s=(65535&H)+(65535&S)+((o=(j>>>16)+(E>>>16)+((r=(65535&j)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s,ee=o<<16|65535&r,t=((H=(c=(k>>>16)+(S>>>16)+((s=(65535&k)+(65535&S)+((o=(b>>>16)+(E>>>16)+((r=(65535&b)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s)>>>28|(j=o<<16|65535&r)<<4)^(j>>>2|H<<30)^(j>>>7|H<<25),n=(j>>>28|H<<4)^(H>>>2|j<<30)^(H>>>7|j<<25),a=(Q>>>14|ee<<18)^(Q>>>18|ee<<14)^(ee>>>9|Q<<23),i=(ee>>>14|Q<<18)^(ee>>>18|Q<<14)^(Q>>>9|ee<<23),w=(f=H&G)^H&W^m,v=(y=j&J)^j&Y^p,x=Q&te^~Q&ae,A=ee&ne^~ee&ie,S=F[e+6],E=F[e+7],S=(c=((k=g[e+6])>>>16)+(S>>>16)+(x>>>16)+(a>>>16)+(X>>>16)+((s=(65535&k)+(65535&S)+(65535&x)+(65535&a)+(65535&X)+((o=((b=g[e+7])>>>16)+(E>>>16)+(A>>>16)+(i>>>16)+(Z>>>16)+((r=(65535&b)+(65535&E)+(65535&A)+(65535&i)+(65535&Z))>>>16))>>>16))>>>16))<<16|65535&s,E=o<<16|65535&r,k=(c=(w>>>16)+(t>>>16)+((s=(65535&w)+(65535&t)+((o=(v>>>16)+(n>>>16)+((r=(65535&v)+(65535&n))>>>16))>>>16))>>>16))<<16|65535&s,b=o<<16|65535&r,X=(c=(K>>>16)+(S>>>16)+((s=(65535&K)+(65535&S)+((o=(q>>>16)+(E>>>16)+((r=(65535&q)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s,Z=o<<16|65535&r,K=(c=(k>>>16)+(S>>>16)+((s=(65535&k)+(65535&S)+((o=(b>>>16)+(E>>>16)+((r=(65535&b)+(65535&E))>>>16))>>>16))>>>16))<<16|65535&s,q=o<<16|65535&r;c=(D>>>16)+(K>>>16)+((s=(65535&D)+(65535&K)+((o=(T>>>16)+(q>>>16)+((r=(65535&T)+(65535&q))>>>16))>>>16))>>>16),this.h0h=c<<16|65535&s,this.h0l=o<<16|65535&r,c=(I>>>16)+(H>>>16)+((s=(65535&I)+(65535&H)+((o=(M>>>16)+(j>>>16)+((r=(65535&M)+(65535&j))>>>16))>>>16))>>>16),this.h1h=c<<16|65535&s,this.h1l=o<<16|65535&r,c=(V>>>16)+(G>>>16)+((s=(65535&V)+(65535&G)+((o=(P>>>16)+(J>>>16)+((r=(65535&P)+(65535&J))>>>16))>>>16))>>>16),this.h2h=c<<16|65535&s,this.h2l=o<<16|65535&r,c=(R>>>16)+(W>>>16)+((s=(65535&R)+(65535&W)+((o=(B>>>16)+(Y>>>16)+((r=(65535&B)+(65535&Y))>>>16))>>>16))>>>16),this.h3h=c<<16|65535&s,this.h3l=o<<16|65535&r,c=(C>>>16)+(X>>>16)+((s=(65535&C)+(65535&X)+((o=(U>>>16)+(Z>>>16)+((r=(65535&U)+(65535&Z))>>>16))>>>16))>>>16),this.h4h=c<<16|65535&s,this.h4l=o<<16|65535&r,c=(O>>>16)+(Q>>>16)+((s=(65535&O)+(65535&Q)+((o=($>>>16)+(ee>>>16)+((r=(65535&$)+(65535&ee))>>>16))>>>16))>>>16),this.h5h=c<<16|65535&s,this.h5l=o<<16|65535&r,c=(N>>>16)+(te>>>16)+((s=(65535&N)+(65535&te)+((o=(L>>>16)+(ne>>>16)+((r=(65535&L)+(65535&ne))>>>16))>>>16))>>>16),this.h6h=c<<16|65535&s,this.h6l=o<<16|65535&r,c=(_>>>16)+(ae>>>16)+((s=(65535&_)+(65535&ae)+((o=(z>>>16)+(ie>>>16)+((r=(65535&z)+(65535&ie))>>>16))>>>16))>>>16),this.h7h=c<<16|65535&s,this.h7l=o<<16|65535&r},S.prototype.hex=function(){this.finalize();var e=this.h0h,t=this.h0l,n=this.h1h,a=this.h1l,i=this.h2h,r=this.h2l,o=this.h3h,s=this.h3l,c=this.h4h,h=this.h4l,u=this.h5h,l=this.h5l,g=this.h6h,m=this.h6l,p=this.h7h,f=this.h7l,y=this.bits,w=d[e>>28&15]+d[e>>24&15]+d[e>>20&15]+d[e>>16&15]+d[e>>12&15]+d[e>>8&15]+d[e>>4&15]+d[15&e]+d[t>>28&15]+d[t>>24&15]+d[t>>20&15]+d[t>>16&15]+d[t>>12&15]+d[t>>8&15]+d[t>>4&15]+d[15&t]+d[n>>28&15]+d[n>>24&15]+d[n>>20&15]+d[n>>16&15]+d[n>>12&15]+d[n>>8&15]+d[n>>4&15]+d[15&n]+d[a>>28&15]+d[a>>24&15]+d[a>>20&15]+d[a>>16&15]+d[a>>12&15]+d[a>>8&15]+d[a>>4&15]+d[15&a]+d[i>>28&15]+d[i>>24&15]+d[i>>20&15]+d[i>>16&15]+d[i>>12&15]+d[i>>8&15]+d[i>>4&15]+d[15&i]+d[r>>28&15]+d[r>>24&15]+d[r>>20&15]+d[r>>16&15]+d[r>>12&15]+d[r>>8&15]+d[r>>4&15]+d[15&r]+d[o>>28&15]+d[o>>24&15]+d[o>>20&15]+d[o>>16&15]+d[o>>12&15]+d[o>>8&15]+d[o>>4&15]+d[15&o];return y>=256&&(w+=d[s>>28&15]+d[s>>24&15]+d[s>>20&15]+d[s>>16&15]+d[s>>12&15]+d[s>>8&15]+d[s>>4&15]+d[15&s]),y>=384&&(w+=d[c>>28&15]+d[c>>24&15]+d[c>>20&15]+d[c>>16&15]+d[c>>12&15]+d[c>>8&15]+d[c>>4&15]+d[15&c]+d[h>>28&15]+d[h>>24&15]+d[h>>20&15]+d[h>>16&15]+d[h>>12&15]+d[h>>8&15]+d[h>>4&15]+d[15&h]+d[u>>28&15]+d[u>>24&15]+d[u>>20&15]+d[u>>16&15]+d[u>>12&15]+d[u>>8&15]+d[u>>4&15]+d[15&u]+d[l>>28&15]+d[l>>24&15]+d[l>>20&15]+d[l>>16&15]+d[l>>12&15]+d[l>>8&15]+d[l>>4&15]+d[15&l]),512==y&&(w+=d[g>>28&15]+d[g>>24&15]+d[g>>20&15]+d[g>>16&15]+d[g>>12&15]+d[g>>8&15]+d[g>>4&15]+d[15&g]+d[m>>28&15]+d[m>>24&15]+d[m>>20&15]+d[m>>16&15]+d[m>>12&15]+d[m>>8&15]+d[m>>4&15]+d[15&m]+d[p>>28&15]+d[p>>24&15]+d[p>>20&15]+d[p>>16&15]+d[p>>12&15]+d[p>>8&15]+d[p>>4&15]+d[15&p]+d[f>>28&15]+d[f>>24&15]+d[f>>20&15]+d[f>>16&15]+d[f>>12&15]+d[f>>8&15]+d[f>>4&15]+d[15&f]),w},S.prototype.toString=S.prototype.hex,S.prototype.digest=function(){this.finalize();var e=this.h0h,t=this.h0l,n=this.h1h,a=this.h1l,i=this.h2h,r=this.h2l,o=this.h3h,s=this.h3l,c=this.h4h,h=this.h4l,d=this.h5h,u=this.h5l,l=this.h6h,g=this.h6l,m=this.h7h,p=this.h7l,f=this.bits,y=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24&255,n>>16&255,n>>8&255,255&n,a>>24&255,a>>16&255,a>>8&255,255&a,i>>24&255,i>>16&255,i>>8&255,255&i,r>>24&255,r>>16&255,r>>8&255,255&r,o>>24&255,o>>16&255,o>>8&255,255&o];return f>=256&&y.push(s>>24&255,s>>16&255,s>>8&255,255&s),f>=384&&y.push(c>>24&255,c>>16&255,c>>8&255,255&c,h>>24&255,h>>16&255,h>>8&255,255&h,d>>24&255,d>>16&255,d>>8&255,255&d,u>>24&255,u>>16&255,u>>8&255,255&u),512==f&&y.push(l>>24&255,l>>16&255,l>>8&255,255&l,g>>24&255,g>>16&255,g>>8&255,255&g,m>>24&255,m>>16&255,m>>8&255,255&m,p>>24&255,p>>16&255,p>>8&255,255&p),y},S.prototype.array=S.prototype.digest,S.prototype.arrayBuffer=function(){this.finalize();var e=this.bits,t=new ArrayBuffer(e/8),n=new DataView(t);return n.setUint32(0,this.h0h),n.setUint32(4,this.h0l),n.setUint32(8,this.h1h),n.setUint32(12,this.h1l),n.setUint32(16,this.h2h),n.setUint32(20,this.h2l),n.setUint32(24,this.h3h),e>=256&&n.setUint32(28,this.h3l),e>=384&&(n.setUint32(32,this.h4h),n.setUint32(36,this.h4l),n.setUint32(40,this.h5h),n.setUint32(44,this.h5l)),512==e&&(n.setUint32(48,this.h6h),n.setUint32(52,this.h6l),n.setUint32(56,this.h7h),n.setUint32(60,this.h7l)),t},S.prototype.clone=function(){var e=new S(this.bits,!1);return this.copyTo(e),e},S.prototype.copyTo=function(e){var t=0,n=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(t=0;t<n.length;++t)e[n[t]]=this[n[t]];for(t=0;t<this.blocks.length;++t)e.blocks[t]=this.blocks[t]},E.prototype=new S,E.prototype.finalize=function(){if(S.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();S.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(e),S.prototype.finalize.call(this)}},E.prototype.clone=function(){var e=new E([],this.bits,!1);this.copyTo(e),e.inner=this.inner;for(var t=0;t<this.oKeyPad.length;++t)e.oKeyPad[t]=this.oKeyPad[t];return e};var k=y(512);k.sha512=k,k.sha384=y(384),k.sha512_256=y(256),k.sha512_224=y(224),k.sha512.hmac=v(512),k.sha384.hmac=v(384),k.sha512_256.hmac=v(256),k.sha512_224.hmac=v(224),s?e.exports=k:(r.sha512=k.sha512,r.sha384=k.sha384,r.sha512_256=k.sha512_256,r.sha512_224=k.sha512_224,c&&(void 0===(a=function(){return k}.call(k,n,k,e))||(e.exports=a)))}()},360:(e,t,n)=>{var a=n(592).stringify,i=n(385);e.exports=function(e){return{parse:i(e),stringify:a}},e.exports.parse=i(),e.exports.stringify=a},385:(e,t,n)=>{var a=null;const i=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,r=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;e.exports=function(e){"use strict";var t={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(null!=e){if(!0===e.strict&&(t.strict=!0),!0===e.storeAsString&&(t.storeAsString=!0),t.alwaysParseAsBig=!0===e.alwaysParseAsBig&&e.alwaysParseAsBig,t.useNativeBigInt=!0===e.useNativeBigInt&&e.useNativeBigInt,void 0!==e.constructorAction){if("error"!==e.constructorAction&&"ignore"!==e.constructorAction&&"preserve"!==e.constructorAction)throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${e.constructorAction}`);t.constructorAction=e.constructorAction}if(void 0!==e.protoAction){if("error"!==e.protoAction&&"ignore"!==e.protoAction&&"preserve"!==e.protoAction)throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${e.protoAction}`);t.protoAction=e.protoAction}}var o,s,c,h,d={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},u=function(e){throw{name:"SyntaxError",message:e,at:o,text:c}},l=function(e){return e&&e!==s&&u("Expected '"+e+"' instead of '"+s+"'"),s=c.charAt(o),o+=1,s},g=function(){var e,i="";for("-"===s&&(i="-",l("-"));s>="0"&&s<="9";)i+=s,l();if("."===s)for(i+=".";l()&&s>="0"&&s<="9";)i+=s;if("e"===s||"E"===s)for(i+=s,l(),"-"!==s&&"+"!==s||(i+=s,l());s>="0"&&s<="9";)i+=s,l();if(e=+i,isFinite(e))return null==a&&(a=n(117)),i.length>15?t.storeAsString?i:t.useNativeBigInt?BigInt(i):new a(i):t.alwaysParseAsBig?t.useNativeBigInt?BigInt(e):new a(e):e;u("Bad number")},m=function(){var e,t,n,a="";if('"'===s)for(var i=o;l();){if('"'===s)return o-1>i&&(a+=c.substring(i,o-1)),l(),a;if("\\"===s){if(o-1>i&&(a+=c.substring(i,o-1)),l(),"u"===s){for(n=0,t=0;t<4&&(e=parseInt(l(),16),isFinite(e));t+=1)n=16*n+e;a+=String.fromCharCode(n)}else{if("string"!=typeof d[s])break;a+=d[s]}i=o}}u("Bad string")},p=function(){for(;s&&s<=" ";)l()};return h=function(){switch(p(),s){case"{":return function(){var e,n=Object.create(null);if("{"===s){if(l("{"),p(),"}"===s)return l("}"),n;for(;s;){if(e=m(),p(),l(":"),!0===t.strict&&Object.hasOwnProperty.call(n,e)&&u('Duplicate key "'+e+'"'),!0===i.test(e)?"error"===t.protoAction?u("Object contains forbidden prototype property"):"ignore"===t.protoAction?h():n[e]=h():!0===r.test(e)?"error"===t.constructorAction?u("Object contains forbidden constructor property"):"ignore"===t.constructorAction?h():n[e]=h():n[e]=h(),p(),"}"===s)return l("}"),n;l(","),p()}}u("Bad object")}();case"[":return function(){var e=[];if("["===s){if(l("["),p(),"]"===s)return l("]"),e;for(;s;){if(e.push(h()),p(),"]"===s)return l("]"),e;l(","),p()}}u("Bad array")}();case'"':return m();case"-":return g();default:return s>="0"&&s<="9"?g():function(){switch(s){case"t":return l("t"),l("r"),l("u"),l("e"),!0;case"f":return l("f"),l("a"),l("l"),l("s"),l("e"),!1;case"n":return l("n"),l("u"),l("l"),l("l"),null}u("Unexpected '"+s+"'")}()}},function(e,t){var n;return c=e+"",o=0,s=" ",n=h(),p(),s&&u("Syntax error"),"function"==typeof t?function e(n,a){var i,r=n[a];return r&&"object"==typeof r&&Object.keys(r).forEach((function(t){void 0!==(i=e(r,t))?r[t]=i:delete r[t]})),t.call(n,a,r)}({"":n},""):n}}},592:(e,t,n)=>{var a=n(117),i=e.exports;!function(){"use strict";var e,t,n,r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function s(e){return r.lastIndex=0,r.test(e)?'"'+e.replace(r,(function(e){var t=o[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function c(i,r){var o,h,d,u,l,g=e,m=r[i],p=null!=m&&(m instanceof a||a.isBigNumber(m));switch(m&&"object"==typeof m&&"function"==typeof m.toJSON&&(m=m.toJSON(i)),"function"==typeof n&&(m=n.call(r,i,m)),typeof m){case"string":return p?m:s(m);case"number":return isFinite(m)?String(m):"null";case"boolean":case"null":case"bigint":return String(m);case"object":if(!m)return"null";if(e+=t,l=[],"[object Array]"===Object.prototype.toString.apply(m)){for(u=m.length,o=0;o<u;o+=1)l[o]=c(o,m)||"null";return d=0===l.length?"[]":e?"[\n"+e+l.join(",\n"+e)+"\n"+g+"]":"["+l.join(",")+"]",e=g,d}if(n&&"object"==typeof n)for(u=n.length,o=0;o<u;o+=1)"string"==typeof n[o]&&(d=c(h=n[o],m))&&l.push(s(h)+(e?": ":":")+d);else Object.keys(m).forEach((function(t){var n=c(t,m);n&&l.push(s(t)+(e?": ":":")+n)}));return d=0===l.length?"{}":e?"{\n"+e+l.join(",\n"+e)+"\n"+g+"}":"{"+l.join(",")+"}",e=g,d}}"function"!=typeof i.stringify&&(i.stringify=function(a,i,r){var o;if(e="",t="","number"==typeof r)for(o=0;o<r;o+=1)t+=" ";else"string"==typeof r&&(t=r);if(n=i,i&&"function"!=typeof i&&("object"!=typeof i||"number"!=typeof i.length))throw new Error("JSON.stringify");return c("",{"":a})})}()},765:function(e,t){!function(e){"use strict";var t=function(e){var t,n=new Float64Array(16);if(e)for(t=0;t<e.length;t++)n[t]=e[t];return n},n=function(){throw new Error("no PRNG")},a=new Uint8Array(16),i=new Uint8Array(32);i[0]=9;var r=t(),o=t([1]),s=t([56129,1]),c=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),d=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),u=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),l=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function g(e,t,n,a){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n,e[t+4]=a>>24&255,e[t+5]=a>>16&255,e[t+6]=a>>8&255,e[t+7]=255&a}function m(e,t,n,a,i){var r,o=0;for(r=0;r<i;r++)o|=e[t+r]^n[a+r];return(1&o-1>>>8)-1}function p(e,t,n,a){return m(e,t,n,a,16)}function f(e,t,n,a){return m(e,t,n,a,32)}function y(e,t,n,a){!function(e,t,n,a){for(var i,r=255&a[0]|(255&a[1])<<8|(255&a[2])<<16|(255&a[3])<<24,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,h=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,d=255&a[4]|(255&a[5])<<8|(255&a[6])<<16|(255&a[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,l=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,g=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,m=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&a[8]|(255&a[9])<<8|(255&a[10])<<16|(255&a[11])<<24,f=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,y=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,w=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,v=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,S=255&a[12]|(255&a[13])<<8|(255&a[14])<<16|(255&a[15])<<24,E=r,k=o,b=s,x=c,A=h,D=d,T=u,I=l,M=g,V=m,P=p,R=f,B=y,C=w,U=v,O=S,$=0;$<20;$+=2)E^=(i=(B^=(i=(M^=(i=(A^=(i=E+B|0)<<7|i>>>25)+E|0)<<9|i>>>23)+A|0)<<13|i>>>19)+M|0)<<18|i>>>14,D^=(i=(k^=(i=(C^=(i=(V^=(i=D+k|0)<<7|i>>>25)+D|0)<<9|i>>>23)+V|0)<<13|i>>>19)+C|0)<<18|i>>>14,P^=(i=(T^=(i=(b^=(i=(U^=(i=P+T|0)<<7|i>>>25)+P|0)<<9|i>>>23)+U|0)<<13|i>>>19)+b|0)<<18|i>>>14,O^=(i=(R^=(i=(I^=(i=(x^=(i=O+R|0)<<7|i>>>25)+O|0)<<9|i>>>23)+x|0)<<13|i>>>19)+I|0)<<18|i>>>14,E^=(i=(x^=(i=(b^=(i=(k^=(i=E+x|0)<<7|i>>>25)+E|0)<<9|i>>>23)+k|0)<<13|i>>>19)+b|0)<<18|i>>>14,D^=(i=(A^=(i=(I^=(i=(T^=(i=D+A|0)<<7|i>>>25)+D|0)<<9|i>>>23)+T|0)<<13|i>>>19)+I|0)<<18|i>>>14,P^=(i=(V^=(i=(M^=(i=(R^=(i=P+V|0)<<7|i>>>25)+P|0)<<9|i>>>23)+R|0)<<13|i>>>19)+M|0)<<18|i>>>14,O^=(i=(U^=(i=(C^=(i=(B^=(i=O+U|0)<<7|i>>>25)+O|0)<<9|i>>>23)+B|0)<<13|i>>>19)+C|0)<<18|i>>>14;E=E+r|0,k=k+o|0,b=b+s|0,x=x+c|0,A=A+h|0,D=D+d|0,T=T+u|0,I=I+l|0,M=M+g|0,V=V+m|0,P=P+p|0,R=R+f|0,B=B+y|0,C=C+w|0,U=U+v|0,O=O+S|0,e[0]=E>>>0&255,e[1]=E>>>8&255,e[2]=E>>>16&255,e[3]=E>>>24&255,e[4]=k>>>0&255,e[5]=k>>>8&255,e[6]=k>>>16&255,e[7]=k>>>24&255,e[8]=b>>>0&255,e[9]=b>>>8&255,e[10]=b>>>16&255,e[11]=b>>>24&255,e[12]=x>>>0&255,e[13]=x>>>8&255,e[14]=x>>>16&255,e[15]=x>>>24&255,e[16]=A>>>0&255,e[17]=A>>>8&255,e[18]=A>>>16&255,e[19]=A>>>24&255,e[20]=D>>>0&255,e[21]=D>>>8&255,e[22]=D>>>16&255,e[23]=D>>>24&255,e[24]=T>>>0&255,e[25]=T>>>8&255,e[26]=T>>>16&255,e[27]=T>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=M>>>0&255,e[33]=M>>>8&255,e[34]=M>>>16&255,e[35]=M>>>24&255,e[36]=V>>>0&255,e[37]=V>>>8&255,e[38]=V>>>16&255,e[39]=V>>>24&255,e[40]=P>>>0&255,e[41]=P>>>8&255,e[42]=P>>>16&255,e[43]=P>>>24&255,e[44]=R>>>0&255,e[45]=R>>>8&255,e[46]=R>>>16&255,e[47]=R>>>24&255,e[48]=B>>>0&255,e[49]=B>>>8&255,e[50]=B>>>16&255,e[51]=B>>>24&255,e[52]=C>>>0&255,e[53]=C>>>8&255,e[54]=C>>>16&255,e[55]=C>>>24&255,e[56]=U>>>0&255,e[57]=U>>>8&255,e[58]=U>>>16&255,e[59]=U>>>24&255,e[60]=O>>>0&255,e[61]=O>>>8&255,e[62]=O>>>16&255,e[63]=O>>>24&255}(e,t,n,a)}function w(e,t,n,a){!function(e,t,n,a){for(var i,r=255&a[0]|(255&a[1])<<8|(255&a[2])<<16|(255&a[3])<<24,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,c=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,h=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,d=255&a[4]|(255&a[5])<<8|(255&a[6])<<16|(255&a[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,l=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,g=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,m=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&a[8]|(255&a[9])<<8|(255&a[10])<<16|(255&a[11])<<24,f=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,y=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,w=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,v=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,S=255&a[12]|(255&a[13])<<8|(255&a[14])<<16|(255&a[15])<<24,E=0;E<20;E+=2)r^=(i=(y^=(i=(g^=(i=(h^=(i=r+y|0)<<7|i>>>25)+r|0)<<9|i>>>23)+h|0)<<13|i>>>19)+g|0)<<18|i>>>14,d^=(i=(o^=(i=(w^=(i=(m^=(i=d+o|0)<<7|i>>>25)+d|0)<<9|i>>>23)+m|0)<<13|i>>>19)+w|0)<<18|i>>>14,p^=(i=(u^=(i=(s^=(i=(v^=(i=p+u|0)<<7|i>>>25)+p|0)<<9|i>>>23)+v|0)<<13|i>>>19)+s|0)<<18|i>>>14,S^=(i=(f^=(i=(l^=(i=(c^=(i=S+f|0)<<7|i>>>25)+S|0)<<9|i>>>23)+c|0)<<13|i>>>19)+l|0)<<18|i>>>14,r^=(i=(c^=(i=(s^=(i=(o^=(i=r+c|0)<<7|i>>>25)+r|0)<<9|i>>>23)+o|0)<<13|i>>>19)+s|0)<<18|i>>>14,d^=(i=(h^=(i=(l^=(i=(u^=(i=d+h|0)<<7|i>>>25)+d|0)<<9|i>>>23)+u|0)<<13|i>>>19)+l|0)<<18|i>>>14,p^=(i=(m^=(i=(g^=(i=(f^=(i=p+m|0)<<7|i>>>25)+p|0)<<9|i>>>23)+f|0)<<13|i>>>19)+g|0)<<18|i>>>14,S^=(i=(v^=(i=(w^=(i=(y^=(i=S+v|0)<<7|i>>>25)+S|0)<<9|i>>>23)+y|0)<<13|i>>>19)+w|0)<<18|i>>>14;e[0]=r>>>0&255,e[1]=r>>>8&255,e[2]=r>>>16&255,e[3]=r>>>24&255,e[4]=d>>>0&255,e[5]=d>>>8&255,e[6]=d>>>16&255,e[7]=d>>>24&255,e[8]=p>>>0&255,e[9]=p>>>8&255,e[10]=p>>>16&255,e[11]=p>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=u>>>0&255,e[17]=u>>>8&255,e[18]=u>>>16&255,e[19]=u>>>24&255,e[20]=l>>>0&255,e[21]=l>>>8&255,e[22]=l>>>16&255,e[23]=l>>>24&255,e[24]=g>>>0&255,e[25]=g>>>8&255,e[26]=g>>>16&255,e[27]=g>>>24&255,e[28]=m>>>0&255,e[29]=m>>>8&255,e[30]=m>>>16&255,e[31]=m>>>24&255}(e,t,n,a)}var v=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function S(e,t,n,a,i,r,o){var s,c,h=new Uint8Array(16),d=new Uint8Array(64);for(c=0;c<16;c++)h[c]=0;for(c=0;c<8;c++)h[c]=r[c];for(;i>=64;){for(y(d,h,o,v),c=0;c<64;c++)e[t+c]=n[a+c]^d[c];for(s=1,c=8;c<16;c++)s=s+(255&h[c])|0,h[c]=255&s,s>>>=8;i-=64,t+=64,a+=64}if(i>0)for(y(d,h,o,v),c=0;c<i;c++)e[t+c]=n[a+c]^d[c];return 0}function E(e,t,n,a,i){var r,o,s=new Uint8Array(16),c=new Uint8Array(64);for(o=0;o<16;o++)s[o]=0;for(o=0;o<8;o++)s[o]=a[o];for(;n>=64;){for(y(c,s,i,v),o=0;o<64;o++)e[t+o]=c[o];for(r=1,o=8;o<16;o++)r=r+(255&s[o])|0,s[o]=255&r,r>>>=8;n-=64,t+=64}if(n>0)for(y(c,s,i,v),o=0;o<n;o++)e[t+o]=c[o];return 0}function k(e,t,n,a,i){var r=new Uint8Array(32);w(r,a,i,v);for(var o=new Uint8Array(8),s=0;s<8;s++)o[s]=a[s+16];return E(e,t,n,o,r)}function b(e,t,n,a,i,r,o){var s=new Uint8Array(32);w(s,r,o,v);for(var c=new Uint8Array(8),h=0;h<8;h++)c[h]=r[h+16];return S(e,t,n,a,i,c,s)}var x=function(e){var t,n,a,i,r,o,s,c;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,n=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|n<<3),a=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(n>>>10|a<<6),i=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(a>>>7|i<<9),r=255&e[8]|(255&e[9])<<8,this.r[4]=255&(i>>>4|r<<12),this.r[5]=r>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(r>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function A(e,t,n,a,i,r){var o=new x(r);return o.update(n,a,i),o.finish(e,t),0}function D(e,t,n,a,i,r){var o=new Uint8Array(16);return A(o,0,n,a,i,r),p(e,t,o,0)}function T(e,t,n,a,i){var r;if(n<32)return-1;for(b(e,0,t,0,n,a,i),A(e,16,e,32,n-32,e),r=0;r<16;r++)e[r]=0;return 0}function I(e,t,n,a,i){var r,o=new Uint8Array(32);if(n<32)return-1;if(k(o,0,32,a,i),0!==D(t,16,t,32,n-32,o))return-1;for(b(e,0,t,0,n,a,i),r=0;r<32;r++)e[r]=0;return 0}function M(e,t){var n;for(n=0;n<16;n++)e[n]=0|t[n]}function V(e){var t,n,a=1;for(t=0;t<16;t++)n=e[t]+a+65535,a=Math.floor(n/65536),e[t]=n-65536*a;e[0]+=a-1+37*(a-1)}function P(e,t,n){for(var a,i=~(n-1),r=0;r<16;r++)a=i&(e[r]^t[r]),e[r]^=a,t[r]^=a}function R(e,n){var a,i,r,o=t(),s=t();for(a=0;a<16;a++)s[a]=n[a];for(V(s),V(s),V(s),i=0;i<2;i++){for(o[0]=s[0]-65517,a=1;a<15;a++)o[a]=s[a]-65535-(o[a-1]>>16&1),o[a-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),r=o[15]>>16&1,o[14]&=65535,P(s,o,1-r)}for(a=0;a<16;a++)e[2*a]=255&s[a],e[2*a+1]=s[a]>>8}function B(e,t){var n=new Uint8Array(32),a=new Uint8Array(32);return R(n,e),R(a,t),f(n,0,a,0)}function C(e){var t=new Uint8Array(32);return R(t,e),1&t[0]}function U(e,t){var n;for(n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}function O(e,t,n){for(var a=0;a<16;a++)e[a]=t[a]+n[a]}function $(e,t,n){for(var a=0;a<16;a++)e[a]=t[a]-n[a]}function N(e,t,n){var a,i,r=0,o=0,s=0,c=0,h=0,d=0,u=0,l=0,g=0,m=0,p=0,f=0,y=0,w=0,v=0,S=0,E=0,k=0,b=0,x=0,A=0,D=0,T=0,I=0,M=0,V=0,P=0,R=0,B=0,C=0,U=0,O=n[0],$=n[1],N=n[2],L=n[3],_=n[4],z=n[5],F=n[6],K=n[7],q=n[8],H=n[9],j=n[10],G=n[11],J=n[12],W=n[13],Y=n[14],X=n[15];r+=(a=t[0])*O,o+=a*$,s+=a*N,c+=a*L,h+=a*_,d+=a*z,u+=a*F,l+=a*K,g+=a*q,m+=a*H,p+=a*j,f+=a*G,y+=a*J,w+=a*W,v+=a*Y,S+=a*X,o+=(a=t[1])*O,s+=a*$,c+=a*N,h+=a*L,d+=a*_,u+=a*z,l+=a*F,g+=a*K,m+=a*q,p+=a*H,f+=a*j,y+=a*G,w+=a*J,v+=a*W,S+=a*Y,E+=a*X,s+=(a=t[2])*O,c+=a*$,h+=a*N,d+=a*L,u+=a*_,l+=a*z,g+=a*F,m+=a*K,p+=a*q,f+=a*H,y+=a*j,w+=a*G,v+=a*J,S+=a*W,E+=a*Y,k+=a*X,c+=(a=t[3])*O,h+=a*$,d+=a*N,u+=a*L,l+=a*_,g+=a*z,m+=a*F,p+=a*K,f+=a*q,y+=a*H,w+=a*j,v+=a*G,S+=a*J,E+=a*W,k+=a*Y,b+=a*X,h+=(a=t[4])*O,d+=a*$,u+=a*N,l+=a*L,g+=a*_,m+=a*z,p+=a*F,f+=a*K,y+=a*q,w+=a*H,v+=a*j,S+=a*G,E+=a*J,k+=a*W,b+=a*Y,x+=a*X,d+=(a=t[5])*O,u+=a*$,l+=a*N,g+=a*L,m+=a*_,p+=a*z,f+=a*F,y+=a*K,w+=a*q,v+=a*H,S+=a*j,E+=a*G,k+=a*J,b+=a*W,x+=a*Y,A+=a*X,u+=(a=t[6])*O,l+=a*$,g+=a*N,m+=a*L,p+=a*_,f+=a*z,y+=a*F,w+=a*K,v+=a*q,S+=a*H,E+=a*j,k+=a*G,b+=a*J,x+=a*W,A+=a*Y,D+=a*X,l+=(a=t[7])*O,g+=a*$,m+=a*N,p+=a*L,f+=a*_,y+=a*z,w+=a*F,v+=a*K,S+=a*q,E+=a*H,k+=a*j,b+=a*G,x+=a*J,A+=a*W,D+=a*Y,T+=a*X,g+=(a=t[8])*O,m+=a*$,p+=a*N,f+=a*L,y+=a*_,w+=a*z,v+=a*F,S+=a*K,E+=a*q,k+=a*H,b+=a*j,x+=a*G,A+=a*J,D+=a*W,T+=a*Y,I+=a*X,m+=(a=t[9])*O,p+=a*$,f+=a*N,y+=a*L,w+=a*_,v+=a*z,S+=a*F,E+=a*K,k+=a*q,b+=a*H,x+=a*j,A+=a*G,D+=a*J,T+=a*W,I+=a*Y,M+=a*X,p+=(a=t[10])*O,f+=a*$,y+=a*N,w+=a*L,v+=a*_,S+=a*z,E+=a*F,k+=a*K,b+=a*q,x+=a*H,A+=a*j,D+=a*G,T+=a*J,I+=a*W,M+=a*Y,V+=a*X,f+=(a=t[11])*O,y+=a*$,w+=a*N,v+=a*L,S+=a*_,E+=a*z,k+=a*F,b+=a*K,x+=a*q,A+=a*H,D+=a*j,T+=a*G,I+=a*J,M+=a*W,V+=a*Y,P+=a*X,y+=(a=t[12])*O,w+=a*$,v+=a*N,S+=a*L,E+=a*_,k+=a*z,b+=a*F,x+=a*K,A+=a*q,D+=a*H,T+=a*j,I+=a*G,M+=a*J,V+=a*W,P+=a*Y,R+=a*X,w+=(a=t[13])*O,v+=a*$,S+=a*N,E+=a*L,k+=a*_,b+=a*z,x+=a*F,A+=a*K,D+=a*q,T+=a*H,I+=a*j,M+=a*G,V+=a*J,P+=a*W,R+=a*Y,B+=a*X,v+=(a=t[14])*O,S+=a*$,E+=a*N,k+=a*L,b+=a*_,x+=a*z,A+=a*F,D+=a*K,T+=a*q,I+=a*H,M+=a*j,V+=a*G,P+=a*J,R+=a*W,B+=a*Y,C+=a*X,S+=(a=t[15])*O,o+=38*(k+=a*N),s+=38*(b+=a*L),c+=38*(x+=a*_),h+=38*(A+=a*z),d+=38*(D+=a*F),u+=38*(T+=a*K),l+=38*(I+=a*q),g+=38*(M+=a*H),m+=38*(V+=a*j),p+=38*(P+=a*G),f+=38*(R+=a*J),y+=38*(B+=a*W),w+=38*(C+=a*Y),v+=38*(U+=a*X),r=(a=(r+=38*(E+=a*$))+(i=1)+65535)-65536*(i=Math.floor(a/65536)),o=(a=o+i+65535)-65536*(i=Math.floor(a/65536)),s=(a=s+i+65535)-65536*(i=Math.floor(a/65536)),c=(a=c+i+65535)-65536*(i=Math.floor(a/65536)),h=(a=h+i+65535)-65536*(i=Math.floor(a/65536)),d=(a=d+i+65535)-65536*(i=Math.floor(a/65536)),u=(a=u+i+65535)-65536*(i=Math.floor(a/65536)),l=(a=l+i+65535)-65536*(i=Math.floor(a/65536)),g=(a=g+i+65535)-65536*(i=Math.floor(a/65536)),m=(a=m+i+65535)-65536*(i=Math.floor(a/65536)),p=(a=p+i+65535)-65536*(i=Math.floor(a/65536)),f=(a=f+i+65535)-65536*(i=Math.floor(a/65536)),y=(a=y+i+65535)-65536*(i=Math.floor(a/65536)),w=(a=w+i+65535)-65536*(i=Math.floor(a/65536)),v=(a=v+i+65535)-65536*(i=Math.floor(a/65536)),S=(a=S+i+65535)-65536*(i=Math.floor(a/65536)),r=(a=(r+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(a/65536)),o=(a=o+i+65535)-65536*(i=Math.floor(a/65536)),s=(a=s+i+65535)-65536*(i=Math.floor(a/65536)),c=(a=c+i+65535)-65536*(i=Math.floor(a/65536)),h=(a=h+i+65535)-65536*(i=Math.floor(a/65536)),d=(a=d+i+65535)-65536*(i=Math.floor(a/65536)),u=(a=u+i+65535)-65536*(i=Math.floor(a/65536)),l=(a=l+i+65535)-65536*(i=Math.floor(a/65536)),g=(a=g+i+65535)-65536*(i=Math.floor(a/65536)),m=(a=m+i+65535)-65536*(i=Math.floor(a/65536)),p=(a=p+i+65535)-65536*(i=Math.floor(a/65536)),f=(a=f+i+65535)-65536*(i=Math.floor(a/65536)),y=(a=y+i+65535)-65536*(i=Math.floor(a/65536)),w=(a=w+i+65535)-65536*(i=Math.floor(a/65536)),v=(a=v+i+65535)-65536*(i=Math.floor(a/65536)),S=(a=S+i+65535)-65536*(i=Math.floor(a/65536)),r+=i-1+37*(i-1),e[0]=r,e[1]=o,e[2]=s,e[3]=c,e[4]=h,e[5]=d,e[6]=u,e[7]=l,e[8]=g,e[9]=m,e[10]=p,e[11]=f,e[12]=y,e[13]=w,e[14]=v,e[15]=S}function L(e,t){N(e,t,t)}function _(e,n){var a,i=t();for(a=0;a<16;a++)i[a]=n[a];for(a=253;a>=0;a--)L(i,i),2!==a&&4!==a&&N(i,i,n);for(a=0;a<16;a++)e[a]=i[a]}function z(e,n){var a,i=t();for(a=0;a<16;a++)i[a]=n[a];for(a=250;a>=0;a--)L(i,i),1!==a&&N(i,i,n);for(a=0;a<16;a++)e[a]=i[a]}function F(e,n,a){var i,r,o=new Uint8Array(32),c=new Float64Array(80),h=t(),d=t(),u=t(),l=t(),g=t(),m=t();for(r=0;r<31;r++)o[r]=n[r];for(o[31]=127&n[31]|64,o[0]&=248,U(c,a),r=0;r<16;r++)d[r]=c[r],l[r]=h[r]=u[r]=0;for(h[0]=l[0]=1,r=254;r>=0;--r)P(h,d,i=o[r>>>3]>>>(7&r)&1),P(u,l,i),O(g,h,u),$(h,h,u),O(u,d,l),$(d,d,l),L(l,g),L(m,h),N(h,u,h),N(u,d,g),O(g,h,u),$(h,h,u),L(d,h),$(u,l,m),N(h,u,s),O(h,h,l),N(u,u,h),N(h,l,m),N(l,d,c),L(d,g),P(h,d,i),P(u,l,i);for(r=0;r<16;r++)c[r+16]=h[r],c[r+32]=u[r],c[r+48]=d[r],c[r+64]=l[r];var p=c.subarray(32),f=c.subarray(16);return _(p,p),N(f,f,p),R(e,f),0}function K(e,t){return F(e,t,i)}function q(e,t){return n(t,32),K(e,t)}function H(e,t,n){var i=new Uint8Array(32);return F(i,n,t),w(e,a,i,v)}x.prototype.blocks=function(e,t,n){for(var a,i,r,o,s,c,h,d,u,l,g,m,p,f,y,w,v,S,E,k=this.fin?0:2048,b=this.h[0],x=this.h[1],A=this.h[2],D=this.h[3],T=this.h[4],I=this.h[5],M=this.h[6],V=this.h[7],P=this.h[8],R=this.h[9],B=this.r[0],C=this.r[1],U=this.r[2],O=this.r[3],$=this.r[4],N=this.r[5],L=this.r[6],_=this.r[7],z=this.r[8],F=this.r[9];n>=16;)l=u=0,l+=(b+=8191&(a=255&e[t+0]|(255&e[t+1])<<8))*B,l+=(x+=8191&(a>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*F),l+=(A+=8191&(i>>>10|(r=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*z),l+=(D+=8191&(r>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*_),u=(l+=(T+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*L))>>>13,l&=8191,l+=(I+=s>>>1&8191)*(5*N),l+=(M+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*$),l+=(V+=8191&(c>>>11|(h=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*O),l+=(P+=8191&(h>>>8|(d=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*U),g=u+=(l+=(R+=d>>>5|k)*(5*C))>>>13,g+=b*C,g+=x*B,g+=A*(5*F),g+=D*(5*z),u=(g+=T*(5*_))>>>13,g&=8191,g+=I*(5*L),g+=M*(5*N),g+=V*(5*$),g+=P*(5*O),u+=(g+=R*(5*U))>>>13,g&=8191,m=u,m+=b*U,m+=x*C,m+=A*B,m+=D*(5*F),u=(m+=T*(5*z))>>>13,m&=8191,m+=I*(5*_),m+=M*(5*L),m+=V*(5*N),m+=P*(5*$),p=u+=(m+=R*(5*O))>>>13,p+=b*O,p+=x*U,p+=A*C,p+=D*B,u=(p+=T*(5*F))>>>13,p&=8191,p+=I*(5*z),p+=M*(5*_),p+=V*(5*L),p+=P*(5*N),f=u+=(p+=R*(5*$))>>>13,f+=b*$,f+=x*O,f+=A*U,f+=D*C,u=(f+=T*B)>>>13,f&=8191,f+=I*(5*F),f+=M*(5*z),f+=V*(5*_),f+=P*(5*L),y=u+=(f+=R*(5*N))>>>13,y+=b*N,y+=x*$,y+=A*O,y+=D*U,u=(y+=T*C)>>>13,y&=8191,y+=I*B,y+=M*(5*F),y+=V*(5*z),y+=P*(5*_),w=u+=(y+=R*(5*L))>>>13,w+=b*L,w+=x*N,w+=A*$,w+=D*O,u=(w+=T*U)>>>13,w&=8191,w+=I*C,w+=M*B,w+=V*(5*F),w+=P*(5*z),v=u+=(w+=R*(5*_))>>>13,v+=b*_,v+=x*L,v+=A*N,v+=D*$,u=(v+=T*O)>>>13,v&=8191,v+=I*U,v+=M*C,v+=V*B,v+=P*(5*F),S=u+=(v+=R*(5*z))>>>13,S+=b*z,S+=x*_,S+=A*L,S+=D*N,u=(S+=T*$)>>>13,S&=8191,S+=I*O,S+=M*U,S+=V*C,S+=P*B,E=u+=(S+=R*(5*F))>>>13,E+=b*F,E+=x*z,E+=A*_,E+=D*L,u=(E+=T*N)>>>13,E&=8191,E+=I*$,E+=M*O,E+=V*U,E+=P*C,b=l=8191&(u=(u=((u+=(E+=R*B)>>>13)<<2)+u|0)+(l&=8191)|0),x=g+=u>>>=13,A=m&=8191,D=p&=8191,T=f&=8191,I=y&=8191,M=w&=8191,V=v&=8191,P=S&=8191,R=E&=8191,t+=16,n-=16;this.h[0]=b,this.h[1]=x,this.h[2]=A,this.h[3]=D,this.h[4]=T,this.h[5]=I,this.h[6]=M,this.h[7]=V,this.h[8]=P,this.h[9]=R},x.prototype.finish=function(e,t){var n,a,i,r,o=new Uint16Array(10);if(this.leftover){for(r=this.leftover,this.buffer[r++]=1;r<16;r++)this.buffer[r]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,r=2;r<10;r++)this.h[r]+=n,n=this.h[r]>>>13,this.h[r]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,o[0]=this.h[0]+5,n=o[0]>>>13,o[0]&=8191,r=1;r<10;r++)o[r]=this.h[r]+n,n=o[r]>>>13,o[r]&=8191;for(o[9]-=8192,a=(1^n)-1,r=0;r<10;r++)o[r]&=a;for(a=~a,r=0;r<10;r++)this.h[r]=this.h[r]&a|o[r];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,r=1;r<8;r++)i=(this.h[r]+this.pad[r]|0)+(i>>>16)|0,this.h[r]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},x.prototype.update=function(e,t,n){var a,i;if(this.leftover){for((i=16-this.leftover)>n&&(i=n),a=0;a<i;a++)this.buffer[this.leftover+a]=e[t+a];if(n-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(i=n-n%16,this.blocks(e,t,i),t+=i,n-=i),n){for(a=0;a<n;a++)this.buffer[this.leftover+a]=e[t+a];this.leftover+=n}};var j=T,G=I,J=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function W(e,t,n,a){for(var i,r,o,s,c,h,d,u,l,g,m,p,f,y,w,v,S,E,k,b,x,A,D,T,I,M,V=new Int32Array(16),P=new Int32Array(16),R=e[0],B=e[1],C=e[2],U=e[3],O=e[4],$=e[5],N=e[6],L=e[7],_=t[0],z=t[1],F=t[2],K=t[3],q=t[4],H=t[5],j=t[6],G=t[7],W=0;a>=128;){for(k=0;k<16;k++)b=8*k+W,V[k]=n[b+0]<<24|n[b+1]<<16|n[b+2]<<8|n[b+3],P[k]=n[b+4]<<24|n[b+5]<<16|n[b+6]<<8|n[b+7];for(k=0;k<80;k++)if(i=R,r=B,o=C,s=U,c=O,h=$,d=N,l=_,g=z,m=F,p=K,f=q,y=H,w=j,D=65535&(A=G),T=A>>>16,I=65535&(x=L),M=x>>>16,D+=65535&(A=(q>>>14|O<<18)^(q>>>18|O<<14)^(O>>>9|q<<23)),T+=A>>>16,I+=65535&(x=(O>>>14|q<<18)^(O>>>18|q<<14)^(q>>>9|O<<23)),M+=x>>>16,D+=65535&(A=q&H^~q&j),T+=A>>>16,I+=65535&(x=O&$^~O&N),M+=x>>>16,x=J[2*k],D+=65535&(A=J[2*k+1]),T+=A>>>16,I+=65535&x,M+=x>>>16,x=V[k%16],T+=(A=P[k%16])>>>16,I+=65535&x,M+=x>>>16,I+=(T+=(D+=65535&A)>>>16)>>>16,D=65535&(A=E=65535&D|T<<16),T=A>>>16,I=65535&(x=S=65535&I|(M+=I>>>16)<<16),M=x>>>16,D+=65535&(A=(_>>>28|R<<4)^(R>>>2|_<<30)^(R>>>7|_<<25)),T+=A>>>16,I+=65535&(x=(R>>>28|_<<4)^(_>>>2|R<<30)^(_>>>7|R<<25)),M+=x>>>16,T+=(A=_&z^_&F^z&F)>>>16,I+=65535&(x=R&B^R&C^B&C),M+=x>>>16,u=65535&(I+=(T+=(D+=65535&A)>>>16)>>>16)|(M+=I>>>16)<<16,v=65535&D|T<<16,D=65535&(A=p),T=A>>>16,I=65535&(x=s),M=x>>>16,T+=(A=E)>>>16,I+=65535&(x=S),M+=x>>>16,B=i,C=r,U=o,O=s=65535&(I+=(T+=(D+=65535&A)>>>16)>>>16)|(M+=I>>>16)<<16,$=c,N=h,L=d,R=u,z=l,F=g,K=m,q=p=65535&D|T<<16,H=f,j=y,G=w,_=v,k%16==15)for(b=0;b<16;b++)x=V[b],D=65535&(A=P[b]),T=A>>>16,I=65535&x,M=x>>>16,x=V[(b+9)%16],D+=65535&(A=P[(b+9)%16]),T+=A>>>16,I+=65535&x,M+=x>>>16,S=V[(b+1)%16],D+=65535&(A=((E=P[(b+1)%16])>>>1|S<<31)^(E>>>8|S<<24)^(E>>>7|S<<25)),T+=A>>>16,I+=65535&(x=(S>>>1|E<<31)^(S>>>8|E<<24)^S>>>7),M+=x>>>16,S=V[(b+14)%16],T+=(A=((E=P[(b+14)%16])>>>19|S<<13)^(S>>>29|E<<3)^(E>>>6|S<<26))>>>16,I+=65535&(x=(S>>>19|E<<13)^(E>>>29|S<<3)^S>>>6),M+=x>>>16,M+=(I+=(T+=(D+=65535&A)>>>16)>>>16)>>>16,V[b]=65535&I|M<<16,P[b]=65535&D|T<<16;D=65535&(A=_),T=A>>>16,I=65535&(x=R),M=x>>>16,x=e[0],T+=(A=t[0])>>>16,I+=65535&x,M+=x>>>16,M+=(I+=(T+=(D+=65535&A)>>>16)>>>16)>>>16,e[0]=R=65535&I|M<<16,t[0]=_=65535&D|T<<16,D=65535&(A=z),T=A>>>16,I=65535&(x=B),M=x>>>16,x=e[1],T+=(A=t[1])>>>16,I+=65535&x,M+=x>>>16,M+=(I+=(T+=(D+=65535&A)>>>16)>>>16)>>>16,e[1]=B=65535&I|M<<16,t[1]=z=65535&D|T<<16,D=65535&(A=F),T=A>>>16,I=65535&(x=C),M=x>>>16,x=e[2],T+=(A=t[2])>>>16,I+=65535&x,M+=x>>>16,M+=(I+=(T+=(D+=65535&A)>>>16)>>>16)>>>16,e[2]=C=65535&I|M<<16,t[2]=F=65535&D|T<<16,D=65535&(A=K),T=A>>>16,I=65535&(x=U),M=x>>>16,x=e[3],T+=(A=t[3])>>>16,I+=65535&x,M+=x>>>16,M+=(I+=(T+=(D+=65535&A)>>>16)>>>16)>>>16,e[3]=U=65535&I|M<<16,t[3]=K=65535&D|T<<16,D=65535&(A=q),T=A>>>16,I=65535&(x=O),M=x>>>16,x=e[4],T+=(A=t[4])>>>16,I+=65535&x,M+=x>>>16,M+=(I+=(T+=(D+=65535&A)>>>16)>>>16)>>>16,e[4]=O=65535&I|M<<16,t[4]=q=65535&D|T<<16,D=65535&(A=H),T=A>>>16,I=65535&(x=$),M=x>>>16,x=e[5],T+=(A=t[5])>>>16,I+=65535&x,M+=x>>>16,M+=(I+=(T+=(D+=65535&A)>>>16)>>>16)>>>16,e[5]=$=65535&I|M<<16,t[5]=H=65535&D|T<<16,D=65535&(A=j),T=A>>>16,I=65535&(x=N),M=x>>>16,x=e[6],T+=(A=t[6])>>>16,I+=65535&x,M+=x>>>16,M+=(I+=(T+=(D+=65535&A)>>>16)>>>16)>>>16,e[6]=N=65535&I|M<<16,t[6]=j=65535&D|T<<16,D=65535&(A=G),T=A>>>16,I=65535&(x=L),M=x>>>16,x=e[7],T+=(A=t[7])>>>16,I+=65535&x,M+=x>>>16,M+=(I+=(T+=(D+=65535&A)>>>16)>>>16)>>>16,e[7]=L=65535&I|M<<16,t[7]=G=65535&D|T<<16,W+=128,a-=128}return a}function Y(e,t,n){var a,i=new Int32Array(8),r=new Int32Array(8),o=new Uint8Array(256),s=n;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,r[0]=4089235720,r[1]=2227873595,r[2]=4271175723,r[3]=1595750129,r[4]=2917565137,r[5]=725511199,r[6]=4215389547,r[7]=327033209,W(i,r,t,n),n%=128,a=0;a<n;a++)o[a]=t[s-n+a];for(o[n]=128,o[(n=256-128*(n<112?1:0))-9]=0,g(o,n-8,s/536870912|0,s<<3),W(i,r,o,n),a=0;a<8;a++)g(e,8*a,i[a],r[a]);return 0}function X(e,n){var a=t(),i=t(),r=t(),o=t(),s=t(),c=t(),d=t(),u=t(),l=t();$(a,e[1],e[0]),$(l,n[1],n[0]),N(a,a,l),O(i,e[0],e[1]),O(l,n[0],n[1]),N(i,i,l),N(r,e[3],n[3]),N(r,r,h),N(o,e[2],n[2]),O(o,o,o),$(s,i,a),$(c,o,r),O(d,o,r),O(u,i,a),N(e[0],s,c),N(e[1],u,d),N(e[2],d,c),N(e[3],s,u)}function Z(e,t,n){var a;for(a=0;a<4;a++)P(e[a],t[a],n)}function Q(e,n){var a=t(),i=t(),r=t();_(r,n[2]),N(a,n[0],r),N(i,n[1],r),R(e,i),e[31]^=C(a)<<7}function ee(e,t,n){var a,i;for(M(e[0],r),M(e[1],o),M(e[2],o),M(e[3],r),i=255;i>=0;--i)Z(e,t,a=n[i/8|0]>>(7&i)&1),X(t,e),X(e,e),Z(e,t,a)}function te(e,n){var a=[t(),t(),t(),t()];M(a[0],d),M(a[1],u),M(a[2],o),N(a[3],d,u),ee(e,a,n)}function ne(e,a,i){var r,o=new Uint8Array(64),s=[t(),t(),t(),t()];for(i||n(a,32),Y(o,a,32),o[0]&=248,o[31]&=127,o[31]|=64,te(s,o),Q(e,s),r=0;r<32;r++)a[r+32]=e[r];return 0}var ae=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ie(e,t){var n,a,i,r;for(a=63;a>=32;--a){for(n=0,i=a-32,r=a-12;i<r;++i)t[i]+=n-16*t[a]*ae[i-(a-32)],n=Math.floor((t[i]+128)/256),t[i]-=256*n;t[i]+=n,t[a]=0}for(n=0,i=0;i<32;i++)t[i]+=n-(t[31]>>4)*ae[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=n*ae[i];for(a=0;a<32;a++)t[a+1]+=t[a]>>8,e[a]=255&t[a]}function re(e){var t,n=new Float64Array(64);for(t=0;t<64;t++)n[t]=e[t];for(t=0;t<64;t++)e[t]=0;ie(e,n)}function oe(e,n,a,i){var r,o,s=new Uint8Array(64),c=new Uint8Array(64),h=new Uint8Array(64),d=new Float64Array(64),u=[t(),t(),t(),t()];Y(s,i,32),s[0]&=248,s[31]&=127,s[31]|=64;var l=a+64;for(r=0;r<a;r++)e[64+r]=n[r];for(r=0;r<32;r++)e[32+r]=s[32+r];for(Y(h,e.subarray(32),a+32),re(h),te(u,h),Q(e,u),r=32;r<64;r++)e[r]=i[r];for(Y(c,e,a+64),re(c),r=0;r<64;r++)d[r]=0;for(r=0;r<32;r++)d[r]=h[r];for(r=0;r<32;r++)for(o=0;o<32;o++)d[r+o]+=c[r]*s[o];return ie(e.subarray(32),d),l}function se(e,n,a,i){var s,h=new Uint8Array(32),d=new Uint8Array(64),u=[t(),t(),t(),t()],g=[t(),t(),t(),t()];if(a<64)return-1;if(function(e,n){var a=t(),i=t(),s=t(),h=t(),d=t(),u=t(),g=t();return M(e[2],o),U(e[1],n),L(s,e[1]),N(h,s,c),$(s,s,e[2]),O(h,e[2],h),L(d,h),L(u,d),N(g,u,d),N(a,g,s),N(a,a,h),z(a,a),N(a,a,s),N(a,a,h),N(a,a,h),N(e[0],a,h),L(i,e[0]),N(i,i,h),B(i,s)&&N(e[0],e[0],l),L(i,e[0]),N(i,i,h),B(i,s)?-1:(C(e[0])===n[31]>>7&&$(e[0],r,e[0]),N(e[3],e[0],e[1]),0)}(g,i))return-1;for(s=0;s<a;s++)e[s]=n[s];for(s=0;s<32;s++)e[s+32]=i[s];if(Y(d,e,a),re(d),ee(u,g,d),te(g,n.subarray(32)),X(u,g),Q(h,u),a-=64,f(n,0,h,0)){for(s=0;s<a;s++)e[s]=0;return-1}for(s=0;s<a;s++)e[s]=n[s+64];return a}var ce=32,he=24,de=he,ue=64,le=32,ge=64;function me(e,t){if(e.length!==ce)throw new Error("bad key size");if(t.length!==he)throw new Error("bad nonce size")}function pe(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function fe(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:w,crypto_stream_xor:b,crypto_stream:k,crypto_stream_salsa20_xor:S,crypto_stream_salsa20:E,crypto_onetimeauth:A,crypto_onetimeauth_verify:D,crypto_verify_16:p,crypto_verify_32:f,crypto_secretbox:T,crypto_secretbox_open:I,crypto_scalarmult:F,crypto_scalarmult_base:K,crypto_box_beforenm:H,crypto_box_afternm:j,crypto_box:function(e,t,n,a,i,r){var o=new Uint8Array(32);return H(o,i,r),j(e,t,n,a,o)},crypto_box_open:function(e,t,n,a,i,r){var o=new Uint8Array(32);return H(o,i,r),G(e,t,n,a,o)},crypto_box_keypair:q,crypto_hash:Y,crypto_sign:oe,crypto_sign_keypair:ne,crypto_sign_open:se,crypto_secretbox_KEYBYTES:ce,crypto_secretbox_NONCEBYTES:he,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:de,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:ue,crypto_sign_PUBLICKEYBYTES:le,crypto_sign_SECRETKEYBYTES:ge,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:c,L:ae,pack25519:R,unpack25519:U,M:N,A:O,S:L,Z:$,pow2523:z,add:X,set25519:M,modL:ie,scalarmult:ee,scalarbase:te},e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,n){pe(e,t,n),me(n,t);for(var a=new Uint8Array(32+e.length),i=new Uint8Array(a.length),r=0;r<e.length;r++)a[r+32]=e[r];return T(i,a,a.length,t,n),i.subarray(16)},e.secretbox.open=function(e,t,n){pe(e,t,n),me(n,t);for(var a=new Uint8Array(16+e.length),i=new Uint8Array(a.length),r=0;r<e.length;r++)a[r+16]=e[r];return a.length<32||0!==I(i,a,a.length,t,n)?null:i.subarray(32)},e.secretbox.keyLength=ce,e.secretbox.nonceLength=he,e.secretbox.overheadLength=16,e.scalarMult=function(e,t){if(pe(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var n=new Uint8Array(32);return F(n,e,t),n},e.scalarMult.base=function(e){if(pe(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return K(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,n,a,i){var r=e.box.before(a,i);return e.secretbox(t,n,r)},e.box.before=function(e,t){pe(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var n=new Uint8Array(32);return H(n,e,t),n},e.box.after=e.secretbox,e.box.open=function(t,n,a,i){var r=e.box.before(a,i);return e.secretbox.open(t,n,r)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return q(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(pe(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return K(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=de,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(pe(e,t),t.length!==ge)throw new Error("bad secret key size");var n=new Uint8Array(ue+e.length);return oe(n,e,e.length,t),n},e.sign.open=function(e,t){if(pe(e,t),t.length!==le)throw new Error("bad public key size");var n=new Uint8Array(e.length),a=se(n,e,e.length,t);if(a<0)return null;for(var i=new Uint8Array(a),r=0;r<i.length;r++)i[r]=n[r];return i},e.sign.detached=function(t,n){for(var a=e.sign(t,n),i=new Uint8Array(ue),r=0;r<i.length;r++)i[r]=a[r];return i},e.sign.detached.verify=function(e,t,n){if(pe(e,t,n),t.length!==ue)throw new Error("bad signature size");if(n.length!==le)throw new Error("bad public key size");var a,i=new Uint8Array(ue+e.length),r=new Uint8Array(ue+e.length);for(a=0;a<ue;a++)i[a]=t[a];for(a=0;a<e.length;a++)i[a+ue]=e[a];return se(r,i,i.length,n)>=0},e.sign.keyPair=function(){var e=new Uint8Array(le),t=new Uint8Array(ge);return ne(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(pe(e),e.length!==ge)throw new Error("bad secret key size");for(var t=new Uint8Array(le),n=0;n<t.length;n++)t[n]=e[32+n];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(pe(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(le),n=new Uint8Array(ge),a=0;a<32;a++)n[a]=e[a];return ne(t,n,!0),{publicKey:t,secretKey:n}},e.sign.publicKeyLength=le,e.sign.secretKeyLength=ge,e.sign.seedLength=32,e.sign.signatureLength=ue,e.hash=function(e){pe(e);var t=new Uint8Array(64);return Y(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return pe(e,t),0!==e.length&&0!==t.length&&e.length===t.length&&0===m(e,0,t,0,e.length)},e.setPRNG=function(e){n=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&t.getRandomValues?e.setPRNG((function(e,n){var a,i=new Uint8Array(n);for(a=0;a<n;a+=65536)t.getRandomValues(i.subarray(a,a+Math.min(n-a,65536)));for(a=0;a<n;a++)e[a]=i[a];fe(i)})):"undefined"!=typeof require&&(t=require("crypto"))&&t.randomBytes&&e.setPRNG((function(e,n){var a,i=t.randomBytes(n);for(a=0;a<n;a++)e[a]=i[a];fe(i)}))}()}(void 0!==e&&e.exports?e.exports:self.nacl=self.nacl||{})}},t={};function n(a){var i=t[a];if(void 0!==i)return i.exports;var r=t[a]={exports:{}};return e[a].call(r.exports,r,r.exports,n),r.exports}n.amdO={},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{"use strict";n.r(a),n.d(a,{ABIAddressType:()=>fc,ABIArrayDynamicType:()=>Ec,ABIArrayStaticType:()=>Sc,ABIBoolType:()=>yc,ABIByteType:()=>wc,ABIContract:()=>Rc,ABIInterface:()=>Bc,ABIMethod:()=>Vc,ABIReferenceType:()=>Dc,ABIStringType:()=>vc,ABITransactionType:()=>Ac,ABITupleType:()=>kc,ABIType:()=>gc,ABIUfixedType:()=>pc,ABIUintType:()=>mc,ADDR_BYTE_SIZE:()=>sc,ALGORAND_ZERO_ADDRESS_STRING:()=>q,AccountBaseData:()=>Qn,AccountData:()=>ea,AccountDeltas:()=>na,AccountTotals:()=>sa,Address:()=>G,AlgoCount:()=>oa,Algodv2:()=>lr,AppLocalState:()=>Kn,AppLocalStateDelta:()=>qn,AppParams:()=>Fn,AppParamsDelta:()=>Hn,AppResourceRecord:()=>jn,ApplyData:()=>Un,AssetHolding:()=>Gn,AssetHoldingDelta:()=>Jn,AssetParams:()=>Wn,AssetParamsDelta:()=>Yn,AssetResourceRecord:()=>Xn,AtomicTransactionComposer:()=>$c,AtomicTransactionComposerStatus:()=>Uc,BalanceRecord:()=>ta,Block:()=>Nn,BlockHeader:()=>Rn,ENCODED_MULTISIG_SCHEMA:()=>dn,ENCODED_SUBSIG_SCHEMA:()=>sn,ERROR_INVALID_MICROALGOS:()=>qc,ERROR_MULTISIG_BAD_SENDER:()=>Kc,EvalDelta:()=>Cn,FalconSignatureStruct:()=>Pt,FalconVerifier:()=>Vt,HashFactory:()=>Dt,INVALID_MICROALGOS_ERROR_MSG:()=>ee,IncludedTransactions:()=>ia,Indexer:()=>Ko,IntDecoding:()=>l,Kmd:()=>gr,KvValueDelta:()=>aa,LENGTH_ENCODE_BYTE_SIZE:()=>dc,LedgerStateDelta:()=>ca,LogicSig:()=>fn,LogicSigAccount:()=>yn,MAX_LEN:()=>oc,MULTISIG_BAD_SENDER_ERROR_MSG:()=>Lc,MerkleArrayProof:()=>Tt,MerkleSignatureVerifier:()=>It,ModifiedCreatable:()=>ra,OnApplicationComplete:()=>et,Participant:()=>Mt,ParticipationUpdates:()=>Pn,ProgramSourceMap:()=>Ms,Reveal:()=>Bt,RewardState:()=>In,SINGLE_BOOL_SIZE:()=>hc,SINGLE_BYTE_SIZE:()=>cc,SignedTransaction:()=>bn,SignedTxnInBlock:()=>$n,SignedTxnWithAD:()=>On,SigslotCommit:()=>Rt,StateProof:()=>Ct,StateProofMessage:()=>Ut,StateProofTrackingData:()=>Dn,StateSchema:()=>zn,TealValue:()=>_n,Transaction:()=>Jt,TransactionType:()=>Qe,TxnCommitments:()=>Tn,UntypedValue:()=>Ln,UpgradeState:()=>Mn,UpgradeVote:()=>Vn,ValueDelta:()=>Bn,VotingData:()=>Zn,abiCheckTransactionType:()=>Ic,abiTypeIsReference:()=>Mc,abiTypeIsTransaction:()=>Tc,algosToMicroalgos:()=>ne,appendSignMultisigTransaction:()=>xs,appendSignRawMultisigSignature:()=>As,assignGroupID:()=>hs,base64ToBytes:()=>O,bigIntToBytes:()=>Ho,bytesToBase64:()=>$,bytesToBigInt:()=>jo,bytesToHex:()=>_,bytesToString:()=>N,coerceToBytes:()=>L,computeGroupID:()=>cs,createDryrun:()=>Rs,createMultisigTransaction:()=>vs,decodeAddress:()=>J,decodeJSON:()=>rt,decodeMsgpack:()=>at,decodeObj:()=>Je,decodeSignedTransaction:()=>xn,decodeUint64:()=>U,decodeUnsignedTransaction:()=>Yt,default:()=>Hc,dryrunTxnResultAppTrace:()=>$s,dryrunTxnResultLogicSigTrace:()=>Ns,encodeAddress:()=>Y,encodeJSON:()=>ot,encodeMsgpack:()=>it,encodeObj:()=>He,encodeUint64:()=>C,encodeUnsignedSimulateTransaction:()=>An,encodeUnsignedTransaction:()=>Wt,encodedMultiSigFromEncodingData:()=>un,encodedMultiSigToEncodingData:()=>ln,encodedSubsigFromEncodingData:()=>cn,encodedSubsigToEncodingData:()=>hn,generateAccount:()=>Go,getApplicationAddress:()=>Z,getMethodByName:()=>Pc,hexToBytes:()=>z,indexerModels:()=>t,isOnApplicationComplete:()=>At,isTransactionType:()=>xt,isTransactionWithSigner:()=>rc,isValidAddress:()=>W,logicSigFromByte:()=>wn,makeApplicationCallTxnFromObject:()=>Gs,makeApplicationClearStateTxnFromObject:()=>Qs,makeApplicationCloseOutTxnFromObject:()=>Zs,makeApplicationCreateTxnFromObject:()=>Js,makeApplicationDeleteTxnFromObject:()=>Ys,makeApplicationNoOpTxnFromObject:()=>ec,makeApplicationOptInTxnFromObject:()=>Xs,makeApplicationUpdateTxnFromObject:()=>Ws,makeAssetConfigTxnWithSuggestedParamsFromObject:()=>Ks,makeAssetCreateTxnWithSuggestedParamsFromObject:()=>Fs,makeAssetDestroyTxnWithSuggestedParamsFromObject:()=>qs,makeAssetFreezeTxnWithSuggestedParamsFromObject:()=>Hs,makeAssetTransferTxnWithSuggestedParamsFromObject:()=>js,makeBaseAssetConfigTxn:()=>zs,makeBasicAccountTransactionSigner:()=>tc,makeEmptyTransactionSigner:()=>ic,makeKeyRegistrationTxnWithSuggestedParamsFromObject:()=>_s,makeLogicSigAccountTransactionSigner:()=>nc,makeMultiSigAccountTransactionSigner:()=>ac,makePaymentTxnWithSuggestedParamsFromObject:()=>Ls,masterDerivationKeyToMnemonic:()=>rs,mergeMultisigTransactions:()=>ks,microalgosToAlgos:()=>te,mnemonicFromSeed:()=>es,mnemonicToMasterDerivationKey:()=>is,mnemonicToSecretKey:()=>ns,modelsv2:()=>e,msgpackRawDecode:()=>Ge,msgpackRawDecodeAsMap:()=>We,msgpackRawEncode:()=>qe,multisigAddress:()=>on,parseJSON:()=>m,secretKeyToMnemonic:()=>as,seedFromMnemonic:()=>ts,signBytes:()=>zc,signLogicSigTransaction:()=>us,signLogicSigTransactionObject:()=>ds,signMultisigTransaction:()=>bs,signTransaction:()=>_c,stringifyJSON:()=>p,tealSign:()=>Sn,tealSignFromProgram:()=>kn,verifyBytes:()=>Fc,verifyMultisig:()=>rn,verifyTealSign:()=>En,waitForConfirmation:()=>qo});var e={};n.r(e),n.d(e,{Account:()=>ha,AccountApplicationResponse:()=>da,AccountAssetHolding:()=>ua,AccountAssetResponse:()=>la,AccountAssetsInformationResponse:()=>ga,AccountParticipation:()=>ma,AccountStateDelta:()=>pa,AppCallLogs:()=>fa,Application:()=>ya,ApplicationInitialStates:()=>wa,ApplicationKVStorage:()=>va,ApplicationLocalReference:()=>Sa,ApplicationLocalState:()=>Ea,ApplicationParams:()=>ka,ApplicationStateOperation:()=>ba,ApplicationStateSchema:()=>xa,Asset:()=>Aa,AssetHolding:()=>Da,AssetHoldingReference:()=>Ta,AssetParams:()=>Ia,AvmKeyValue:()=>Ma,AvmValue:()=>Va,BlockHashResponse:()=>Pa,BlockLogsResponse:()=>Ra,BlockResponse:()=>Ba,BlockTxidsResponse:()=>Ca,Box:()=>Ua,BoxDescriptor:()=>Oa,BoxReference:()=>$a,BoxesResponse:()=>Na,BuildVersion:()=>La,CompileResponse:()=>_a,DisassembleResponse:()=>za,DryrunRequest:()=>Fa,DryrunResponse:()=>Ka,DryrunSource:()=>qa,DryrunState:()=>Ha,DryrunTxnResult:()=>ja,ErrorResponse:()=>Ga,EvalDelta:()=>Ja,EvalDeltaKeyValue:()=>Wa,GetBlockTimeStampOffsetResponse:()=>Ya,GetSyncRoundResponse:()=>Xa,KvDelta:()=>Za,LedgerStateDeltaForTransactionGroup:()=>Qa,LightBlockHeaderProof:()=>ei,NodeStatusResponse:()=>ti,PendingTransactionResponse:()=>ni,PendingTransactionsResponse:()=>ai,PostTransactionsResponse:()=>ii,ScratchChange:()=>ri,SimulateInitialStates:()=>oi,SimulateRequest:()=>si,SimulateRequestTransactionGroup:()=>ci,SimulateResponse:()=>hi,SimulateTraceConfig:()=>di,SimulateTransactionGroupResult:()=>ui,SimulateTransactionResult:()=>li,SimulateUnnamedResourcesAccessed:()=>gi,SimulationEvalOverrides:()=>mi,SimulationOpcodeTraceUnit:()=>pi,SimulationTransactionExecTrace:()=>fi,StateProof:()=>yi,StateProofMessage:()=>wi,SupplyResponse:()=>vi,TealKeyValue:()=>Si,TealValue:()=>Ei,TransactionGroupLedgerStateDeltasForRoundResponse:()=>ki,TransactionParametersResponse:()=>bi,TransactionProofResponse:()=>xi,Version:()=>Ai});var t={};n.r(t),n.d(t,{Account:()=>mr,AccountParticipation:()=>pr,AccountResponse:()=>fr,AccountStateDelta:()=>yr,AccountsResponse:()=>wr,Application:()=>vr,ApplicationLocalState:()=>Sr,ApplicationLocalStatesResponse:()=>Er,ApplicationLogData:()=>kr,ApplicationLogsResponse:()=>br,ApplicationParams:()=>xr,ApplicationResponse:()=>Ar,ApplicationStateSchema:()=>Dr,ApplicationsResponse:()=>Tr,Asset:()=>Ir,AssetBalancesResponse:()=>Mr,AssetHolding:()=>Vr,AssetHoldingsResponse:()=>Pr,AssetParams:()=>Rr,AssetResponse:()=>Br,AssetsResponse:()=>Cr,Block:()=>Ur,BlockRewards:()=>Or,BlockUpgradeState:()=>$r,BlockUpgradeVote:()=>Nr,Box:()=>Lr,BoxDescriptor:()=>_r,BoxesResponse:()=>zr,ErrorResponse:()=>Fr,EvalDelta:()=>Kr,EvalDeltaKeyValue:()=>qr,HashFactory:()=>Hr,HealthCheck:()=>jr,IndexerStateProofMessage:()=>Gr,MerkleArrayProof:()=>Jr,MiniAssetHolding:()=>Wr,ParticipationUpdates:()=>Yr,StateProofFields:()=>Xr,StateProofParticipant:()=>Zr,StateProofReveal:()=>Qr,StateProofSigSlot:()=>eo,StateProofSignature:()=>to,StateProofTracking:()=>no,StateProofVerifier:()=>ao,StateSchema:()=>io,TealKeyValue:()=>ro,TealValue:()=>oo,Transaction:()=>so,TransactionApplication:()=>co,TransactionAssetConfig:()=>ho,TransactionAssetFreeze:()=>uo,TransactionAssetTransfer:()=>lo,TransactionKeyreg:()=>go,TransactionPayment:()=>mo,TransactionResponse:()=>po,TransactionSignature:()=>fo,TransactionSignatureLogicsig:()=>yo,TransactionSignatureMultisig:()=>wo,TransactionSignatureMultisigSubsignature:()=>vo,TransactionStateProof:()=>So,TransactionsResponse:()=>Eo});var i={};n.r(i),n.d(i,{ABIAddressType:()=>fc,ABIArrayDynamicType:()=>Ec,ABIArrayStaticType:()=>Sc,ABIBoolType:()=>yc,ABIByteType:()=>wc,ABIContract:()=>Rc,ABIInterface:()=>Bc,ABIMethod:()=>Vc,ABIReferenceType:()=>Dc,ABIStringType:()=>vc,ABITransactionType:()=>Ac,ABITupleType:()=>kc,ABIType:()=>gc,ABIUfixedType:()=>pc,ABIUintType:()=>mc,ADDR_BYTE_SIZE:()=>sc,ALGORAND_ZERO_ADDRESS_STRING:()=>q,AccountBaseData:()=>Qn,AccountData:()=>ea,AccountDeltas:()=>na,AccountTotals:()=>sa,Address:()=>G,AlgoCount:()=>oa,Algodv2:()=>lr,AppLocalState:()=>Kn,AppLocalStateDelta:()=>qn,AppParams:()=>Fn,AppParamsDelta:()=>Hn,AppResourceRecord:()=>jn,ApplyData:()=>Un,AssetHolding:()=>Gn,AssetHoldingDelta:()=>Jn,AssetParams:()=>Wn,AssetParamsDelta:()=>Yn,AssetResourceRecord:()=>Xn,AtomicTransactionComposer:()=>$c,AtomicTransactionComposerStatus:()=>Uc,BalanceRecord:()=>ta,Block:()=>Nn,BlockHeader:()=>Rn,ENCODED_MULTISIG_SCHEMA:()=>dn,ENCODED_SUBSIG_SCHEMA:()=>sn,ERROR_INVALID_MICROALGOS:()=>qc,ERROR_MULTISIG_BAD_SENDER:()=>Kc,EvalDelta:()=>Cn,FalconSignatureStruct:()=>Pt,FalconVerifier:()=>Vt,HashFactory:()=>Dt,INVALID_MICROALGOS_ERROR_MSG:()=>ee,IncludedTransactions:()=>ia,Indexer:()=>Ko,IntDecoding:()=>l,Kmd:()=>gr,KvValueDelta:()=>aa,LENGTH_ENCODE_BYTE_SIZE:()=>dc,LedgerStateDelta:()=>ca,LogicSig:()=>fn,LogicSigAccount:()=>yn,MAX_LEN:()=>oc,MULTISIG_BAD_SENDER_ERROR_MSG:()=>Lc,MerkleArrayProof:()=>Tt,MerkleSignatureVerifier:()=>It,ModifiedCreatable:()=>ra,OnApplicationComplete:()=>et,Participant:()=>Mt,ParticipationUpdates:()=>Pn,ProgramSourceMap:()=>Ms,Reveal:()=>Bt,RewardState:()=>In,SINGLE_BOOL_SIZE:()=>hc,SINGLE_BYTE_SIZE:()=>cc,SignedTransaction:()=>bn,SignedTxnInBlock:()=>$n,SignedTxnWithAD:()=>On,SigslotCommit:()=>Rt,StateProof:()=>Ct,StateProofMessage:()=>Ut,StateProofTrackingData:()=>Dn,StateSchema:()=>zn,TealValue:()=>_n,Transaction:()=>Jt,TransactionType:()=>Qe,TxnCommitments:()=>Tn,UntypedValue:()=>Ln,UpgradeState:()=>Mn,UpgradeVote:()=>Vn,ValueDelta:()=>Bn,VotingData:()=>Zn,abiCheckTransactionType:()=>Ic,abiTypeIsReference:()=>Mc,abiTypeIsTransaction:()=>Tc,algosToMicroalgos:()=>ne,appendSignMultisigTransaction:()=>xs,appendSignRawMultisigSignature:()=>As,assignGroupID:()=>hs,base64ToBytes:()=>O,bigIntToBytes:()=>Ho,bytesToBase64:()=>$,bytesToBigInt:()=>jo,bytesToHex:()=>_,bytesToString:()=>N,coerceToBytes:()=>L,computeGroupID:()=>cs,createDryrun:()=>Rs,createMultisigTransaction:()=>vs,decodeAddress:()=>J,decodeJSON:()=>rt,decodeMsgpack:()=>at,decodeObj:()=>Je,decodeSignedTransaction:()=>xn,decodeUint64:()=>U,decodeUnsignedTransaction:()=>Yt,dryrunTxnResultAppTrace:()=>$s,dryrunTxnResultLogicSigTrace:()=>Ns,encodeAddress:()=>Y,encodeJSON:()=>ot,encodeMsgpack:()=>it,encodeObj:()=>He,encodeUint64:()=>C,encodeUnsignedSimulateTransaction:()=>An,encodeUnsignedTransaction:()=>Wt,encodedMultiSigFromEncodingData:()=>un,encodedMultiSigToEncodingData:()=>ln,encodedSubsigFromEncodingData:()=>cn,encodedSubsigToEncodingData:()=>hn,generateAccount:()=>Go,getApplicationAddress:()=>Z,getMethodByName:()=>Pc,hexToBytes:()=>z,indexerModels:()=>t,isOnApplicationComplete:()=>At,isTransactionType:()=>xt,isTransactionWithSigner:()=>rc,isValidAddress:()=>W,logicSigFromByte:()=>wn,makeApplicationCallTxnFromObject:()=>Gs,makeApplicationClearStateTxnFromObject:()=>Qs,makeApplicationCloseOutTxnFromObject:()=>Zs,makeApplicationCreateTxnFromObject:()=>Js,makeApplicationDeleteTxnFromObject:()=>Ys,makeApplicationNoOpTxnFromObject:()=>ec,makeApplicationOptInTxnFromObject:()=>Xs,makeApplicationUpdateTxnFromObject:()=>Ws,makeAssetConfigTxnWithSuggestedParamsFromObject:()=>Ks,makeAssetCreateTxnWithSuggestedParamsFromObject:()=>Fs,makeAssetDestroyTxnWithSuggestedParamsFromObject:()=>qs,makeAssetFreezeTxnWithSuggestedParamsFromObject:()=>Hs,makeAssetTransferTxnWithSuggestedParamsFromObject:()=>js,makeBaseAssetConfigTxn:()=>zs,makeBasicAccountTransactionSigner:()=>tc,makeEmptyTransactionSigner:()=>ic,makeKeyRegistrationTxnWithSuggestedParamsFromObject:()=>_s,makeLogicSigAccountTransactionSigner:()=>nc,makeMultiSigAccountTransactionSigner:()=>ac,makePaymentTxnWithSuggestedParamsFromObject:()=>Ls,masterDerivationKeyToMnemonic:()=>rs,mergeMultisigTransactions:()=>ks,microalgosToAlgos:()=>te,mnemonicFromSeed:()=>es,mnemonicToMasterDerivationKey:()=>is,mnemonicToSecretKey:()=>ns,modelsv2:()=>e,msgpackRawDecode:()=>Ge,msgpackRawDecodeAsMap:()=>We,msgpackRawEncode:()=>qe,multisigAddress:()=>on,parseJSON:()=>m,secretKeyToMnemonic:()=>as,seedFromMnemonic:()=>ts,signBytes:()=>zc,signLogicSigTransaction:()=>us,signLogicSigTransactionObject:()=>ds,signMultisigTransaction:()=>bs,signTransaction:()=>_c,stringifyJSON:()=>p,tealSign:()=>Sn,tealSignFromProgram:()=>kn,verifyBytes:()=>Fc,verifyMultisig:()=>rn,verifyTealSign:()=>En,waitForConfirmation:()=>qo});var r,o=n(765),s=n.n(o),c=n(757),h=n.n(c),d=n(360),u=n.n(d);!function(e){e.UNSAFE="unsafe",e.SAFE="safe",e.MIXED="mixed",e.BIGINT="bigint"}(r||(r={}));const l=r,g=u()({useNativeBigInt:!0,strict:!0});function m(e,{intDecoding:t}){if(t!==l.SAFE&&t!==l.UNSAFE&&t!==l.BIGINT&&t!==l.MIXED)throw new Error(`Invalid intDecoding option: ${t}`);return g.parse(e,((e,n)=>{if(null!=n&&"object"==typeof n&&null==Object.getPrototypeOf(n)&&Object.setPrototypeOf(n,Object.prototype),"bigint"==typeof n){if(t===l.SAFE&&n>Number.MAX_SAFE_INTEGER)throw new Error(`Integer exceeds maximum safe integer: ${n.toString()}. Try parsing with a different intDecoding option.`);return t===l.BIGINT||t===l.MIXED&&n>Number.MAX_SAFE_INTEGER?n:Number(n)}return"number"==typeof n&&t===l.BIGINT&&Number.isInteger(n)?BigInt(n):n}))}function p(e,t,n){return g.stringify(e,t,n)}function f(e,t){return e.length===t.length&&Array.from(e).every(((e,n)=>e===t[n]))}function y(...e){const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let a=0;for(let t=0;t<e.length;t++)n.set(e[t],a),a+=e[t].length;return n}function w(){return"object"==typeof process&&"object"==typeof process.versions&&void 0!==process.versions.node}function v(e){if(void 0===e)throw new Error("Value is undefined");if("bigint"==typeof e){if(e>BigInt(Number.MAX_SAFE_INTEGER)||e<BigInt(Number.MIN_SAFE_INTEGER))throw new Error(`BigInt value ${e} is not a safe integer`);return Number(e)}if("number"==typeof e){if(Number.isSafeInteger(e))return e;throw new Error(`Value ${e} is not a safe integer`)}throw new Error(`Unexpected type ${typeof e}, ${e}`)}function S(e){const t=v(e);if(t<0)throw new Error(`Value ${t} is negative`);return t}function E(e){if(void 0===e)throw new Error("Value is undefined");if("bigint"==typeof e)return e;if("number"==typeof e){if(!Number.isSafeInteger(e))throw new Error(`Value ${e} is not a safe integer`);return BigInt(e)}throw new Error(`Unexpected type ${typeof e}, ${e}`)}function k(e){const t=E(e);if(t<0||t>BigInt("0xffffffffffffffff"))throw new Error(`Value ${t} is not a uint64`);return t}function b(e){return h().sha512_256.array(e)}function x(e){return s().sign.keyPair.fromSeed(e)}function A(e){return e===s().sign.signatureLength}function D(e){return s().sign.keyPair.fromSecretKey(e)}function T(e,t){return s().sign.detached(e,t)}function I(e,t){return s().verify(e,t)}function M(e,t,n){return s().sign.detached.verify(e,t,n)}const V=s().sign.publicKeyLength,P=(s().sign.secretKeyLength,32);var R=n(267),B=n.n(R);function C(e){if("bigint"!=typeof e&&!Number.isInteger(e)||e<0||e>BigInt("0xffffffffffffffff"))throw new Error("Input is not a 64-bit unsigned integer");const t=new Uint8Array(8);return new DataView(t.buffer).setBigUint64(0,BigInt(e)),t}function U(e,t="safe"){if("safe"!==t&&"mixed"!==t&&"bigint"!==t)throw new Error(`Unknown decodingMode option: ${t}`);if(0===e.byteLength||e.byteLength>8)throw new Error(`Data has unacceptable length. Expected length is between 1 and 8, got ${e.byteLength}`);const n=y(new Uint8Array(8-e.byteLength),e),a=new DataView(n.buffer).getBigUint64(0),i=a>BigInt(Number.MAX_SAFE_INTEGER);if("safe"===t){if(i)throw new Error(`Integer exceeds maximum safe integer: ${a.toString()}. Try decoding with "mixed" or "safe" decodingMode.`);return Number(a)}return"mixed"!==t||i?a:Number(a)}function O(e){if(w())return new Uint8Array(Buffer.from(e,"base64"));const t=atob(e);return Uint8Array.from(t,(e=>e.codePointAt(0)))}function $(e){if(w())return Buffer.from(e).toString("base64");const t=Array.from(e,(e=>String.fromCodePoint(e))).join("");return btoa(t)}function N(e){return(new TextDecoder).decode(e)}function L(e){return"string"==typeof e?(new TextEncoder).encode(e):e}function _(e){return w()?Buffer.from(e).toString("hex"):Array.from(e).map((e=>e.toString(16).padStart(2,"0"))).join("")}function z(e){if(w())return Buffer.from(e,"hex");let t=e;e.length%2!=0&&(t=e.padStart(1,"0"));const n=new Uint8Array(t.length/2);for(let e=0;e<t.length/2;e++)n[e]=parseInt(t.slice(2*e,2*e+2),16);return n}const F=36,K=4,q="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ",H="address seems to be malformed";function j(e){return Uint8Array.from(b(e).slice(32-K,32))}class G{constructor(e){if(!(e instanceof Uint8Array))throw new Error(`${H}: ${e} is not Uint8Array, type ${typeof e}`);if(e.length!==F-K)throw new Error(`${H}: 0x${_(e)}, length ${e.length}`);this.publicKey=e}equals(e){return e instanceof G&&f(this.publicKey,e.publicKey)}checksum(){return j(this.publicKey)}toString(){return B().encode(y(this.publicKey,this.checksum())).slice(0,58)}static fromString(e){if("string"!=typeof e)throw new Error(`${H}: expected string, got ${typeof e}, ${e}`);if(58!==e.length)throw new Error(`${H}: expected length 58, got ${e.length}: ${e}`);const t=B().decode.asBytes(e);if(t.length!==F)throw new Error(`${H}: expected byte length ${F}, got ${t.length}`);const n=new Uint8Array(t.slice(0,F-K)),a=new Uint8Array(t.slice(V,F));if(!f(j(n),a))throw new Error("wrong checksum for address");return new G(n)}static zeroAddress(){return new G(new Uint8Array(F-K))}}function J(e){return G.fromString(e)}function W(e){try{G.fromString(e)}catch(e){return!1}return!0}function Y(e){return new G(e).toString()}const X=(new TextEncoder).encode("appID");function Z(e){const t=b(y(X,C(e)));return new G(Uint8Array.from(t))}const Q=1e6,ee="Microalgos should be positive and less than 2^53 - 1.";function te(e){if(e<0||!Number.isSafeInteger(e))throw new Error(ee);return e/Q}function ne(e){const t=e*Q;return Math.round(t)}class ae extends Error{constructor(e,t){super(e),this.response=t,this.name="URLTokenBaseHTTPError",this.response=t}}class ie{constructor(e,t,n,a={}){this.defaultHeaders=a;const i=t.endsWith("/")?t:`${t}/`,r=new URL(i);if(void 0!==n&&(r.port=n.toString()),0===r.protocol.length)throw new Error("Invalid base server URL, protocol must be defined.");this.baseURL=r,this.tokenHeader=e}getURL(e,t){let n;n=e.startsWith("./")?e:e.startsWith("/")?`.${e}`:`./${e}`;const a=new URL(n,this.baseURL);if(t)for(const[e,n]of Object.entries(t))a.searchParams.set(e,n);return a.toString()}static formatFetchResponseHeaders(e){const t={};return e.forEach(((e,n)=>{t[e]=n})),t}static async checkHttpError(e){if(e.ok)return;let t,n;try{t=new Uint8Array(await e.arrayBuffer());const a=JSON.parse((new TextDecoder).decode(t));a.message&&(n=a.message)}catch(e){}let a=`Network request error. Received status ${e.status} (${e.statusText})`;throw n&&(a+=`: ${n}`),new ae(a,{body:t??new Uint8Array,status:e.status,headers:ie.formatFetchResponseHeaders(e.headers)})}static async formatFetchResponse(e){return await this.checkHttpError(e),{body:new Uint8Array(await e.arrayBuffer()),status:e.status,headers:ie.formatFetchResponseHeaders(e.headers)}}async get(e,t,n,a){const i={...this.tokenHeader,...this.defaultHeaders,...n??{}},r=await fetch(this.getURL(e,t),{headers:i,...a??{}});return ie.formatFetchResponse(r)}async post(e,t,n,a,i){const r={...this.tokenHeader,...this.defaultHeaders,...a??{}},o=await fetch(this.getURL(e,n),{method:"POST",body:t,headers:r,...i??{}});return ie.formatFetchResponse(o)}async delete(e,t,n,a,i){const r={...this.tokenHeader,...this.defaultHeaders,...a??{}},o=await fetch(this.getURL(e,n),{method:"DELETE",body:t,headers:r,...i??{}});return ie.formatFetchResponse(o)}}class re{constructor(e){this.body=e.body,this.text=e.text,this.format=e.format,this.headers=e.headers,this.status=e.status,this.ok=e.ok}getJSONText(){if(void 0===this.text)throw new Error(`Response body does not contain JSON data. Format is ${this.format}`);return this.text}parseBodyAsJSON(e){if(void 0===this.text)throw new Error(`Response body does not contain JSON data. Format is ${this.format}`);return se.parseJSON(this.text,this.status,e)}}function oe(e){return Object.keys(e).reduce(((t,n)=>(t[n.toLowerCase()]=e[n],t)),{})}class se{constructor(e,t,n,a={}){this.bc=void 0!==t?new ie(e,t,n,a):e}static parseJSON(e,t,n){try{return e?m(e,n):null}catch(n){const a=n;throw a.rawResponse=e||null,a.statusCode=t,a}}static serializeData(e,t){if(!e)return new Uint8Array(0);if("application/json"===t["content-type"])return(new TextEncoder).encode(p(e));if("string"==typeof e)return(new TextEncoder).encode(e);if(e instanceof Uint8Array)return e;throw new Error("provided data is neither a string nor a Uint8Array and content-type is not application/json")}static prepareResponse(e,t){const{body:n}=e;let a;return"application/msgpack"!==t&&(a=n&&(new TextDecoder).decode(n)||""),new re({...e,format:t,text:a,ok:2===Math.trunc(e.status/100)})}static prepareResponseError(e){return e.response&&(e.response=se.prepareResponse(e.response,"application/json"),e.status=e.response.status),e}async get({relativePath:e,query:t,requestHeaders:n,customOptions:a}){const i=function(e){return void 0!==e&&Object.prototype.hasOwnProperty.call(e,"format")&&"msgpack"===e.format?"application/msgpack":"application/json"}(t),r={...n??{},accept:i};try{const n=await this.bc.get(e,t?function(e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(e[t]&&0!==e[t].length||delete e[t]);return e}(t):void 0,r,a);return se.prepareResponse(n,i)}catch(e){throw se.prepareResponseError(e)}}async post({relativePath:e,data:t,query:n,requestHeaders:a,customOptions:i}){const r={"content-type":"application/json",...oe(a??{})};try{const a=await this.bc.post(e,se.serializeData(t,r),n,r,i);return se.prepareResponse(a,"application/json")}catch(e){throw se.prepareResponseError(e)}}async delete({relativePath:e,data:t,requestHeaders:n,customOptions:a}){const i={"content-type":"application/json",...oe(n??{})};try{const n=await this.bc.delete(e,void 0!==t?se.serializeData(t,i):void 0,void 0,i,a);return se.prepareResponse(n,"application/json")}catch(e){throw se.prepareResponseError(e)}}}class ce{constructor(e,t,n,a,i={}){if("function"==typeof t.get)this.c=new se(t);else{let r;r="string"==typeof t?function(e,t=""){const n={};return""===t||(n[e]=t),n}(e,t):t,this.c=new se(r,n,a,i)}}}var he=new TextEncoder;var de=4096;function ue(e,t,n){for(var a=t,i=a+n,r=[],o="";a<i;){var s=e[a++];if(0==(128&s))r.push(s);else if(192==(224&s)){var c=63&e[a++];r.push((31&s)<<6|c)}else if(224==(240&s)){c=63&e[a++];var h=63&e[a++];r.push((31&s)<<12|c<<6|h)}else if(240==(248&s)){var d=(7&s)<<18|(c=63&e[a++])<<12|(h=63&e[a++])<<6|63&e[a++];d>65535&&(d-=65536,r.push(d>>>10&1023|55296),d=56320|1023&d),r.push(d)}else r.push(s);r.length>=de&&(o+=String.fromCharCode.apply(String,r),r.length=0)}return r.length>0&&(o+=String.fromCharCode.apply(String,r)),o}var le=new TextDecoder;var ge,me,pe=function(e,t){this.type=e,this.data=t},fe=(ge=function(e,t){return ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ge(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ge(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ye=function(e){function t(n){var a=e.call(this,n)||this,i=Object.create(t.prototype);return Object.setPrototypeOf(a,i),Object.defineProperty(a,"name",{configurable:!0,enumerable:!1,value:t.name}),a}return fe(t,e),t}(Error);!function(e){e[e.UNSAFE_NUMBER=0]="UNSAFE_NUMBER",e[e.SAFE_NUMBER=1]="SAFE_NUMBER",e[e.AS_ENCODED=2]="AS_ENCODED",e[e.MIXED=3]="MIXED",e[e.BIGINT=4]="BIGINT"}(me||(me={}));var we=4294967295;function ve(e,t,n){var a=Math.floor(n/4294967296),i=n;e.setUint32(t,a),e.setUint32(t+4,i)}function Se(e,t,n){if(n===me.UNSAFE_NUMBER||n===me.SAFE_NUMBER){var a=e.getInt32(t),i=e.getUint32(t+4);if(n===me.SAFE_NUMBER&&(a<Math.floor(Number.MIN_SAFE_INTEGER/4294967296)||a===Math.floor(Number.MIN_SAFE_INTEGER/4294967296)&&0===i||a>(Number.MAX_SAFE_INTEGER-i)/4294967296)){var r="".concat(a<0?"-":"","0x").concat(Math.abs(a).toString(16)).concat(i.toString(16).padStart(8,"0"));throw new Error("Mode is IntMode.SAFE_NUMBER and value is not a safe integer: ".concat(r))}return 4294967296*a+i}var o=e.getBigInt64(t);return n===me.MIXED&&o>=Number.MIN_SAFE_INTEGER&&o<=Number.MAX_SAFE_INTEGER?Number(o):o}var Ee={type:-1,encode:function(e){var t,n,a,i;return e instanceof Date?function(e){var t,n=e.sec,a=e.nsec;if(n>=0&&a>=0&&n<=17179869183){if(0===a&&n<=4294967295){var i=new Uint8Array(4);return(t=new DataView(i.buffer)).setUint32(0,n),i}var r=n/4294967296,o=4294967295&n;return i=new Uint8Array(8),(t=new DataView(i.buffer)).setUint32(0,a<<2|3&r),t.setUint32(4,o),i}return i=new Uint8Array(12),(t=new DataView(i.buffer)).setUint32(0,a),ve(t,4,n),i}((a=1e6*((t=e.getTime())-1e3*(n=Math.floor(t/1e3))),{sec:n+(i=Math.floor(a/1e9)),nsec:a-1e9*i})):null},decode:function(e){var t=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:var n=t.getUint32(0);return{sec:4294967296*(3&n)+t.getUint32(4),nsec:n>>>2};case 12:return{sec:Se(t,4,me.UNSAFE_NUMBER),nsec:t.getUint32(0)};default:throw new ye("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(e.length))}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}},ke=function(){function e(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(Ee)}return e.prototype.register=function(e){var t=e.type,n=e.encode,a=e.decode;if(t>=0)this.encoders[t]=n,this.decoders[t]=a;else{var i=1+t;this.builtInEncoders[i]=n,this.builtInDecoders[i]=a}},e.prototype.tryToEncode=function(e,t){for(var n=0;n<this.builtInEncoders.length;n++)if(null!=(a=this.builtInEncoders[n])&&null!=(i=a(e,t)))return new pe(-1-n,i);for(n=0;n<this.encoders.length;n++){var a,i;if(null!=(a=this.encoders[n])&&null!=(i=a(e,t)))return new pe(n,i)}return e instanceof pe?e:null},e.prototype.decode=function(e,t,n){var a=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return a?a(e,t,n):new pe(t,e)},e.defaultCodec=new e,e}();function be(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):Uint8Array.from(e)}function xe(e,t){for(var n=Math.min(e.length,t.length),a=0;a<n;a++){var i=e[a]-t[a];if(0!==i)return i}return e.length-t.length}var Ae=function(e){if(this.rawBinaryValue=e,!ArrayBuffer.isView(e))throw new TypeError("RawBinaryString: rawBinaryValue must be an ArrayBufferView")},De=function(){function e(e){var t,n,a,i,r,o,s,c;this.extensionCodec=null!==(t=null==e?void 0:e.extensionCodec)&&void 0!==t?t:ke.defaultCodec,this.context=null==e?void 0:e.context,this.forceBigIntToInt64=null!==(n=null==e?void 0:e.forceBigIntToInt64)&&void 0!==n&&n,this.maxDepth=null!==(a=null==e?void 0:e.maxDepth)&&void 0!==a?a:100,this.initialBufferSize=null!==(i=null==e?void 0:e.initialBufferSize)&&void 0!==i?i:2048,this.sortKeys=null!==(r=null==e?void 0:e.sortKeys)&&void 0!==r&&r,this.forceFloat32=null!==(o=null==e?void 0:e.forceFloat32)&&void 0!==o&&o,this.ignoreUndefined=null!==(s=null==e?void 0:e.ignoreUndefined)&&void 0!==s&&s,this.forceIntegerToFloat=null!==(c=null==e?void 0:e.forceIntegerToFloat)&&void 0!==c&&c,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}return e.prototype.reinitializeState=function(){this.pos=0},e.prototype.encodeSharedRef=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)},e.prototype.encode=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)},e.prototype.doEncode=function(e,t){if(t>this.maxDepth)throw new Error("Too deep objects in depth ".concat(t));null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.encodeNumber(e):"string"==typeof e?this.encodeString(e):this.encodeObject(e,t)},e.prototype.ensureBufferSizeToWrite=function(e){var t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(2*t)},e.prototype.resizeBuffer=function(e){var t=new ArrayBuffer(e),n=new Uint8Array(t),a=new DataView(t);n.set(this.bytes),this.view=a,this.bytes=n},e.prototype.encodeNil=function(){this.writeU8(192)},e.prototype.encodeBoolean=function(e){!1===e?this.writeU8(194):this.writeU8(195)},e.prototype.encodeNumber=function(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)},e.prototype.encodeNumberAsFloat=function(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},e.prototype.encodeBigInt=function(e){if(this.forceBigIntToInt64)this.encodeBigIntAsInt64(e);else if(e>=0)if(e<4294967296||this.forceIntegerToFloat)this.encodeNumber(Number(e));else{if(!(e<BigInt("0x10000000000000000")))throw new Error("Bigint is too large for uint64: ".concat(e));this.encodeBigIntAsInt64(e)}else if(e>=-2147483648||this.forceIntegerToFloat)this.encodeNumber(Number(e));else{if(!(e>=BigInt(-1)*BigInt("0x8000000000000000")))throw new Error("Bigint is too small for int64: ".concat(e));this.encodeBigIntAsInt64(e)}},e.prototype.encodeBigIntAsInt64=function(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))},e.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too long string: ".concat(e," bytes in UTF-8"));this.writeU8(219),this.writeU32(e)}},e.prototype.encodeString=function(e){var t,n,a,i=function(e){for(var t=e.length,n=0,a=0;a<t;){var i=e.charCodeAt(a++);if(0!=(4294967168&i))if(0==(4294965248&i))n+=2;else{if(i>=55296&&i<=56319&&a<t){var r=e.charCodeAt(a);56320==(64512&r)&&(++a,i=((1023&i)<<10)+(1023&r)+65536)}n+=0==(4294901760&i)?3:4}else n++}return n}(e);this.ensureBufferSizeToWrite(5+i),this.writeStringHeader(i),t=e,n=this.bytes,a=this.pos,t.length>50?function(e,t,n){he.encodeInto(e,t.subarray(n))}(t,n,a):function(e,t,n){for(var a=e.length,i=n,r=0;r<a;){var o=e.charCodeAt(r++);if(0!=(4294967168&o)){if(0==(4294965248&o))t[i++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&r<a){var s=e.charCodeAt(r);56320==(64512&s)&&(++r,o=((1023&o)<<10)+(1023&s)+65536)}0==(4294901760&o)?(t[i++]=o>>12&15|224,t[i++]=o>>6&63|128):(t[i++]=o>>18&7|240,t[i++]=o>>12&63|128,t[i++]=o>>6&63|128)}t[i++]=63&o|128}else t[i++]=o}}(t,n,a),this.pos+=i},e.prototype.encodeObject=function(e,t){var n=this.extensionCodec.tryToEncode(e,this.context);if(null!=n)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(e instanceof Ae)this.encodeBinaryAsString(e);else if("bigint"==typeof e)this.encodeBigInt(e);else if(e instanceof Map)this.encodeMap(e,t);else{if("object"!=typeof e)throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(e)));this.encodeMapObject(e,t)}},e.prototype.encodeBinary=function(e){var t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large binary: ".concat(t));this.writeU8(198),this.writeU32(t)}var n=be(e);this.writeU8a(n)},e.prototype.encodeBinaryAsString=function(e){var t=e.rawBinaryValue;this.writeStringHeader(t.byteLength);var n=be(t);this.writeU8a(n)},e.prototype.encodeArray=function(e,t){var n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else{if(!(n<4294967296))throw new Error("Too large array: ".concat(n));this.writeU8(221),this.writeU32(n)}for(var a=0,i=e;a<i.length;a++){var r=i[a];this.doEncode(r,t+1)}},e.prototype.countWithoutUndefined=function(e,t){for(var n=0,a=0,i=t;a<i.length;a++){var r=i[a];void 0!==e.get(r)&&n++}return n},e.prototype.sortMapKeys=function(e){for(var t=[],n=[],a=[],i=[],r=0,o=e;r<o.length;r++){var s=o[r];if("number"==typeof s){if(isNaN(s))throw new Error("Cannot sort map keys with NaN value");t.push(s)}else if("bigint"==typeof s)t.push(s);else if("string"==typeof s)n.push(s);else if(ArrayBuffer.isView(s))i.push(be(s));else{if(!(s instanceof Ae))throw new Error("Unsupported map key type: ".concat(Object.prototype.toString.apply(s)));a.push(s)}}return t.sort((function(e,t){return e<t?-1:e>t?1:0})),n.sort(),a.sort((function(e,t){return xe(be(e.rawBinaryValue),be(t.rawBinaryValue))})),i.sort(xe),[].concat(t,n,a,i)},e.prototype.encodeMapObject=function(e,t){this.encodeMap(new Map(Object.entries(e)),t)},e.prototype.encodeMap=function(e,t){var n=Array.from(e.keys());this.sortKeys&&(n=this.sortMapKeys(n));var a=this.ignoreUndefined?this.countWithoutUndefined(e,n):n.length;if(a<16)this.writeU8(128+a);else if(a<65536)this.writeU8(222),this.writeU16(a);else{if(!(a<4294967296))throw new Error("Too large map object: ".concat(a));this.writeU8(223),this.writeU32(a)}for(var i=0,r=n;i<r.length;i++){var o=r[i],s=e.get(o);if(!this.ignoreUndefined||void 0!==s){if("string"==typeof o)this.encodeString(o);else if("number"==typeof o)this.encodeNumber(o);else if("bigint"==typeof o)this.encodeBigInt(o);else if(ArrayBuffer.isView(o))this.encodeBinary(o);else{if(!(o instanceof Ae))throw new Error("Unsupported map key type: ".concat(Object.prototype.toString.apply(o)));this.encodeBinaryAsString(o)}this.doEncode(s,t+1)}}},e.prototype.encodeExtension=function(e){var t=e.data.length;if(1===t)this.writeU8(212);else if(2===t)this.writeU8(213);else if(4===t)this.writeU8(214);else if(8===t)this.writeU8(215);else if(16===t)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too large extension object: ".concat(t));this.writeU8(201),this.writeU32(t)}this.writeI8(e.type),this.writeU8a(e.data)},e.prototype.writeU8=function(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++},e.prototype.writeU8a=function(e){var t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t},e.prototype.writeI8=function(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++},e.prototype.writeU16=function(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2},e.prototype.writeI16=function(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2},e.prototype.writeU32=function(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4},e.prototype.writeI32=function(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4},e.prototype.writeF32=function(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4},e.prototype.writeF64=function(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8},e.prototype.writeU64=function(e){this.ensureBufferSizeToWrite(8),function(e,t,n){var a=n/4294967296,i=n;e.setUint32(t,a),e.setUint32(t+4,i)}(this.view,this.pos,e),this.pos+=8},e.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),ve(this.view,this.pos,e),this.pos+=8},e.prototype.writeBigUint64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8},e.prototype.writeBigInt64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8},e}();function Te(e){return"".concat(e<0?"-":"","0x").concat(Math.abs(e).toString(16).padStart(2,"0"))}var Ie=function(){function e(e,t){void 0===e&&(e=16),void 0===t&&(t=16),this.maxKeyLength=e,this.maxLengthPerKey=t,this.hit=0,this.miss=0,this.caches=[];for(var n=0;n<this.maxKeyLength;n++)this.caches.push([])}return e.prototype.canBeCached=function(e){return e>0&&e<=this.maxKeyLength},e.prototype.find=function(e,t,n){e:for(var a=0,i=this.caches[n-1];a<i.length;a++){for(var r=i[a],o=r.bytes,s=0;s<n;s++)if(o[s]!==e[t+s])continue e;return r.str}return null},e.prototype.store=function(e,t){var n=this.caches[e.length-1],a={bytes:e,str:t};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=a:n.push(a)},e.prototype.decode=function(e,t,n){var a=this.find(e,t,n);if(null!=a)return this.hit++,a;this.miss++;var i=ue(e,t,n),r=Uint8Array.prototype.slice.call(e,t,t+n);return this.store(r,i),i},e}(),Me=function(e,t){var n,a,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(o=0)),o;)try{if(n=1,a&&(i=2&s[0]?a.return:s[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;switch(a=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,a=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],a=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Ve=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},a("next"),a("throw"),a("return"),t[Symbol.asyncIterator]=function(){return this},t);function a(n){t[n]=e[n]&&function(t){return new Promise((function(a,i){!function(e,t,n,a){Promise.resolve(a).then((function(t){e({value:t,done:n})}),t)}(a,i,(t=e[n](t)).done,t.value)}))}}},Pe=function(e){return this instanceof Pe?(this.v=e,this):new Pe(e)},Re="array",Be="map_key",Ce="map_value",Ue=function(){function e(e){this.useMap=e,this.stack=[],this.stackHeadPosition=-1}return Object.defineProperty(e.prototype,"length",{get:function(){return this.stackHeadPosition+1},enumerable:!1,configurable:!0}),e.prototype.top=function(){return this.stack[this.stackHeadPosition]},e.prototype.pushArrayState=function(e){var t=this.getUninitializedStateFromPool();t.type=Re,t.position=0,t.size=e,t.array=new Array(e)},e.prototype.pushMapState=function(e){var t=this.getUninitializedStateFromPool();t.type=Be,t.readCount=0,t.size=e,t.map=this.useMap?new Map:{}},e.prototype.getUninitializedStateFromPool=function(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){this.stack.push({type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null})}return this.stack[this.stackHeadPosition]},e.prototype.release=function(e){var t;if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");e.type===Re&&((t=e).size=0,t.array=void 0,t.position=0,t.type=void 0),e.type!==Be&&e.type!==Ce||((t=e).size=0,t.map=void 0,t.readCount=0,t.type=void 0),this.stackHeadPosition--},e.prototype.reset=function(){this.stack.length=0,this.stackHeadPosition=-1},e}(),Oe=new DataView(new ArrayBuffer(0)),$e=new Uint8Array(Oe.buffer);try{Oe.getInt8(0)}catch(e){if(!(e instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var Ne=RangeError,Le=new Ne("Insufficient data"),_e=new Ie,ze=function(){function e(e){var t,n,a,i,r,o,s,c,h,d,u,l;if(this.totalPos=0,this.pos=0,this.view=Oe,this.bytes=$e,this.headByte=-1,this.extensionCodec=null!==(t=null==e?void 0:e.extensionCodec)&&void 0!==t?t:ke.defaultCodec,this.context=null==e?void 0:e.context,this.intMode=null!==(n=null==e?void 0:e.intMode)&&void 0!==n?n:(null==e?void 0:e.useBigInt64)?me.AS_ENCODED:me.UNSAFE_NUMBER,this.rawBinaryStringValues=null!==(a=null==e?void 0:e.rawBinaryStringValues)&&void 0!==a&&a,this.rawBinaryStringKeys=null!==(i=null==e?void 0:e.rawBinaryStringKeys)&&void 0!==i&&i,this.useRawBinaryStringClass=null!==(r=null==e?void 0:e.useRawBinaryStringClass)&&void 0!==r&&r,this.useMap=null!==(o=null==e?void 0:e.useMap)&&void 0!==o&&o,this.supportObjectNumberKeys=null!==(s=null==e?void 0:e.supportObjectNumberKeys)&&void 0!==s&&s,this.maxStrLength=null!==(c=null==e?void 0:e.maxStrLength)&&void 0!==c?c:we,this.maxBinLength=null!==(h=null==e?void 0:e.maxBinLength)&&void 0!==h?h:we,this.maxArrayLength=null!==(d=null==e?void 0:e.maxArrayLength)&&void 0!==d?d:we,this.maxMapLength=null!==(u=null==e?void 0:e.maxMapLength)&&void 0!==u?u:we,this.maxExtLength=null!==(l=null==e?void 0:e.maxExtLength)&&void 0!==l?l:we,this.keyDecoder=void 0!==(null==e?void 0:e.keyDecoder)?e.keyDecoder:_e,this.rawBinaryStringKeys&&!this.useMap)throw new Error("rawBinaryStringKeys is only supported when useMap is true");this.stack=new Ue(this.useMap)}return e.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=-1,this.stack.reset()},e.prototype.setBuffer=function(e){this.bytes=be(e),this.view=function(e){if(e instanceof ArrayBuffer)return new DataView(e);var t=be(e);return new DataView(t.buffer,t.byteOffset,t.byteLength)}(this.bytes),this.pos=0},e.prototype.appendBuffer=function(e){if(-1!==this.headByte||this.hasRemaining(1)){var t=this.bytes.subarray(this.pos),n=be(e),a=new Uint8Array(t.length+n.length);a.set(t),a.set(n,t.length),this.setBuffer(a)}else this.setBuffer(e)},e.prototype.hasRemaining=function(e){return this.view.byteLength-this.pos>=e},e.prototype.createExtraByteError=function(e){var t=this.view,n=this.pos;return new RangeError("Extra ".concat(t.byteLength-n," of ").concat(t.byteLength," byte(s) found at buffer[").concat(e,"]"))},e.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t},e.prototype.decodeMulti=function(e){return Me(this,(function(t){switch(t.label){case 0:this.reinitializeState(),this.setBuffer(e),t.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return t.sent(),[3,1];case 3:return[2]}}))},e.prototype.decodeAsync=function(e){var t,n,a,i,r,o,s,c,h,d,u;return c=this,h=void 0,u=function(){var c,h,d,u,l,g,m,p;return Me(this,(function(f){switch(f.label){case 0:c=!1,f.label=1;case 1:f.trys.push([1,6,7,12]),t=!0,n=Ve(e),f.label=2;case 2:return[4,n.next()];case 3:if(a=f.sent(),i=a.done)return[3,5];if(s=a.value,t=!1,d=s,c)throw this.createExtraByteError(this.totalPos);this.appendBuffer(d);try{h=this.doDecodeSync(),c=!0}catch(e){if(!(e instanceof Ne))throw e}this.totalPos+=this.pos,f.label=4;case 4:return t=!0,[3,2];case 5:return[3,12];case 6:return u=f.sent(),r={error:u},[3,12];case 7:return f.trys.push([7,,10,11]),t||i||!(o=n.return)?[3,9]:[4,o.call(n)];case 8:f.sent(),f.label=9;case 9:return[3,11];case 10:if(r)throw r.error;return[7];case 11:return[7];case 12:if(c){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,h]}throw g=(l=this).headByte,m=l.pos,p=l.totalPos,new RangeError("Insufficient data in parsing ".concat(Te(g)," at ").concat(p," (").concat(m," in the current buffer)"))}}))},new((d=void 0)||(d=Promise))((function(e,t){function n(e){try{i(u.next(e))}catch(e){t(e)}}function a(e){try{i(u.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof d?i:new d((function(e){e(i)}))).then(n,a)}i((u=u.apply(c,h||[])).next())}))},e.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},e.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},e.prototype.decodeMultiAsync=function(e,t){return function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a,i=n.apply(e,t||[]),r=[];return a={},o("next"),o("throw"),o("return"),a[Symbol.asyncIterator]=function(){return this},a;function o(e){i[e]&&(a[e]=function(t){return new Promise((function(n,a){r.push([e,t,n,a])>1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof Pe?Promise.resolve(n.value.v).then(c,h):d(r[0][2],n)}catch(e){d(r[0][3],e)}var n}function c(e){s("next",e)}function h(e){s("throw",e)}function d(e,t){e(t),r.shift(),r.length&&s(r[0][0],r[0][1])}}(this,arguments,(function(){var n,a,i,r,o,s,c,h,d,u,l,g;return Me(this,(function(m){switch(m.label){case 0:n=t,a=-1,m.label=1;case 1:m.trys.push([1,13,14,19]),i=!0,r=Ve(e),m.label=2;case 2:return[4,Pe(r.next())];case 3:if(o=m.sent(),d=o.done)return[3,12];if(g=o.value,i=!1,s=g,t&&0===a)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),n&&(a=this.readArraySize(),n=!1,this.complete()),m.label=4;case 4:m.trys.push([4,9,,10]),m.label=5;case 5:return[4,Pe(this.doDecodeSync())];case 6:return[4,m.sent()];case 7:return m.sent(),0==--a?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((c=m.sent())instanceof Ne))throw c;return[3,10];case 10:this.totalPos+=this.pos,m.label=11;case 11:return i=!0,[3,2];case 12:return[3,19];case 13:return h=m.sent(),u={error:h},[3,19];case 14:return m.trys.push([14,,17,18]),i||d||!(l=r.return)?[3,16]:[4,Pe(l.call(r))];case 15:m.sent(),m.label=16;case 16:return[3,18];case 17:if(u)throw u.error;return[7];case 18:return[7];case 19:return[2]}}))}))},e.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),t=void 0;if(e>=224)t=this.convertNumber(e-256);else if(e<192)if(e<128)t=this.convertNumber(e);else if(e<144){if(0!=(a=e-128)){this.pushMapState(a),this.complete();continue e}t=this.useMap?new Map:{}}else if(e<160){if(0!=(a=e-144)){this.pushArrayState(a),this.complete();continue e}t=[]}else{var n=e-160;t=this.decodeString(n,0)}else if(192===e)t=null;else if(194===e)t=!1;else if(195===e)t=!0;else if(202===e)t=this.readF32();else if(203===e)t=this.readF64();else if(204===e)t=this.convertNumber(this.readU8());else if(205===e)t=this.convertNumber(this.readU16());else if(206===e)t=this.convertNumber(this.readU32());else if(207===e)t=this.readU64();else if(208===e)t=this.convertNumber(this.readI8());else if(209===e)t=this.convertNumber(this.readI16());else if(210===e)t=this.convertNumber(this.readI32());else if(211===e)t=this.readI64();else if(217===e)n=this.lookU8(),t=this.decodeString(n,1);else if(218===e)n=this.lookU16(),t=this.decodeString(n,2);else if(219===e)n=this.lookU32(),t=this.decodeString(n,4);else if(220===e){if(0!==(a=this.readU16())){this.pushArrayState(a),this.complete();continue e}t=[]}else if(221===e){if(0!==(a=this.readU32())){this.pushArrayState(a),this.complete();continue e}t=[]}else if(222===e){if(0!==(a=this.readU16())){this.pushMapState(a),this.complete();continue e}t={}}else if(223===e){if(0!==(a=this.readU32())){this.pushMapState(a),this.complete();continue e}t={}}else if(196===e){var a=this.lookU8();t=this.decodeBinary(a,1)}else if(197===e)a=this.lookU16(),t=this.decodeBinary(a,2);else if(198===e)a=this.lookU32(),t=this.decodeBinary(a,4);else if(212===e)t=this.decodeExtension(1,0);else if(213===e)t=this.decodeExtension(2,0);else if(214===e)t=this.decodeExtension(4,0);else if(215===e)t=this.decodeExtension(8,0);else if(216===e)t=this.decodeExtension(16,0);else if(199===e)a=this.lookU8(),t=this.decodeExtension(a,1);else if(200===e)a=this.lookU16(),t=this.decodeExtension(a,2);else{if(201!==e)throw new ye("Unrecognized type byte: ".concat(Te(e)));a=this.lookU32(),t=this.decodeExtension(a,4)}this.complete();for(var i=this.stack;i.length>0;){var r=i.top();if(r.type===Re){if(r.array[r.position]=t,r.position++,r.position!==r.size)continue e;t=r.array,i.release(r)}else{if(r.type===Be){if(s=t,c=this.useMap,h=this.supportObjectNumberKeys,!(c?"string"==typeof s||"number"==typeof s||"bigint"==typeof s||s instanceof Uint8Array||s instanceof Ae:"string"==typeof s||h&&"number"==typeof s)){var o=this.useMap?"string, number, bigint, or Uint8Array":this.supportObjectNumberKeys?"string or number":"string";throw new ye("The type of key must be ".concat(o," but got ").concat(typeof t))}if(!this.useMap&&"__proto__"===t)throw new ye("The key __proto__ is not allowed");r.key=t,r.type=Ce;continue e}if(this.useMap?r.map.set(r.key,t):r.map[r.key]=t,r.readCount++,r.readCount!==r.size){r.key=null,r.type=Be;continue e}t=r.map,i.release(r)}}return t}var s,c,h},e.prototype.readHeadByte=function(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte},e.prototype.complete=function(){this.headByte=-1},e.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new ye("Unrecognized array type byte: ".concat(Te(e)))}},e.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new ye("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.pushMapState(e)},e.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new ye("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.pushArrayState(e)},e.prototype.decodeString=function(e,t){if(this.stateIsMapKey()?this.rawBinaryStringKeys:this.rawBinaryStringValues){var n=this.decodeBinary(e,t);return this.useRawBinaryStringClass?new Ae(n):n}return this.decodeUtf8String(e,t)},e.prototype.decodeUtf8String=function(e,t){var n;if(e>this.maxStrLength)throw new ye("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLength<this.pos+t+e)throw Le;var a,i=this.pos+t;return a=this.stateIsMapKey()&&(null===(n=this.keyDecoder)||void 0===n?void 0:n.canBeCached(e))?this.keyDecoder.decode(this.bytes,i,e):function(e,t,n){return n>200?function(e,t,n){var a=e.subarray(t,t+n);return le.decode(a)}(e,t,n):ue(e,t,n)}(this.bytes,i,e),this.pos+=t+e,a},e.prototype.stateIsMapKey=function(){return this.stack.length>0&&this.stack.top().type===Be},e.prototype.decodeBinary=function(e,t){if(e>this.maxBinLength)throw new ye("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+t))throw Le;var n=this.pos+t,a=this.bytes.subarray(n,n+e);return this.pos+=t+e,a},e.prototype.decodeExtension=function(e,t){if(e>this.maxExtLength)throw new ye("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var n=this.view.getInt8(this.pos+t),a=this.decodeBinary(e,t+1);return this.extensionCodec.decode(a,n,this.context)},e.prototype.convertNumber=function(e){return function(e,t){return t===me.BIGINT?BigInt(e):Number(e)}(e,this.intMode)},e.prototype.lookU8=function(){return this.view.getUint8(this.pos)},e.prototype.lookU16=function(){return this.view.getUint16(this.pos)},e.prototype.lookU32=function(){return this.view.getUint32(this.pos)},e.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},e.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},e.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},e.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},e.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},e.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},e.prototype.readU64=function(){var e=function(e,t,n){if(n===me.UNSAFE_NUMBER||n===me.SAFE_NUMBER){var a=e.getUint32(t),i=e.getUint32(t+4);if(n===me.SAFE_NUMBER&&a>(Number.MAX_SAFE_INTEGER-i)/4294967296){var r="0x".concat(a.toString(16)).concat(i.toString(16).padStart(8,"0"));throw new Error("Mode is IntMode.SAFE_NUMBER and value is not a safe integer: ".concat(r))}return 4294967296*a+i}var o=e.getBigUint64(t);return n===me.MIXED&&o<=Number.MAX_SAFE_INTEGER?Number(o):o}(this.view,this.pos,this.intMode);return this.pos+=8,e},e.prototype.readI64=function(){var e=Se(this.view,this.pos,this.intMode);return this.pos+=8,e},e.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},e.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},e}();function Fe(e,t){return new ze(t).decode(e)}const Ke="The object contains empty or 0 values. First empty or 0 value encountered during encoding: ";function qe(e){return t=e,new De({sortKeys:!0}).encodeSharedRef(t);var t}function He(e){const t=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(!e[t]||0===e[t].length))return{containsEmpty:!0,firstEmptyKey:t};return{containsEmpty:!1,firstEmptyKey:void 0}}(e);if(t.containsEmpty)throw new Error(Ke+t.firstEmptyKey);return qe(e)}function je(e){switch(e){case l.UNSAFE:return me.UNSAFE_NUMBER;case l.SAFE:return me.SAFE_NUMBER;case l.MIXED:return me.MIXED;case l.BIGINT:return me.BIGINT;default:throw new Error(`Invalid intDecoding: ${e}`)}}function Ge(e,t){return Fe(e,{intMode:t?.intDecoding?je(t?.intDecoding):me.BIGINT})}function Je(e){return Ge(e,{intDecoding:l.MIXED})}function We(e,t){return Fe(e,{intMode:t?.intDecoding?je(t?.intDecoding):me.BIGINT,useMap:!0})}function Ye(e){if(null==e)return e;if(e instanceof Uint8Array)return $(e);if(Array.isArray(e))return e.map(Ye);if(e instanceof Map){const t={};for(const[n,a]of e){if("string"!=typeof n)throw new Error(`JSON map key must be a string: ${n}`);t[n]=Ye(a)}return t}return e}function Xe(e){if(null==e)return e;if("string"==typeof e||"number"==typeof e||"bigint"==typeof e||"boolean"==typeof e)return e;if(Array.isArray(e))return e.map(Xe);if("object"==typeof e){const t=new Map;for(const[n,a]of Object.entries(e))t.set(n,Xe(a));return t}throw new Error(`Invalid JSON encoding data: ${e}`)}var Ze,Qe,et;!function(e){e[e.MAP_VALUE=0]="MAP_VALUE",e[e.ARRAY_ELEMENT=1]="ARRAY_ELEMENT"}(Ze||(Ze={}));class tt{constructor({parent:e,segment:t,baseObjectBytes:n}){this.resolvedCache=null,this.resolvedCachePresent=!1,this.parent=e,this.segment=t,this.baseObjectBytes=n}withMapValue(e){return new tt({parent:this,segment:{kind:Ze.MAP_VALUE,key:e}})}withArrayElement(e){return new tt({parent:this,segment:{kind:Ze.ARRAY_ELEMENT,key:e}})}getRawStringAtCurrentLocation(){const e=this.resolve();if(e instanceof Ae)return e.rawBinaryValue;throw new Error(`Invalid type. Expected RawBinaryString, got ${e} (${typeof e})`)}getRawStringKeysAndValuesAtCurrentLocation(){const e=this.resolve();if(!(e instanceof Map))throw new Error(`Invalid type. Expected Map, got ${e} (${typeof e})`);const t=new Map;for(const[n,a]of e){if(!(n instanceof Ae))throw new Error(`Invalid type for map key. Expected RawBinaryString, got ${n} (${typeof n})`);t.set(n.rawBinaryValue,a)}return t}resolve(){if(this.resolvedCachePresent)return this.resolvedCache;let e;if(e=this.parent?this.parent.resolve():Fe(this.baseObjectBytes,{intMode:me.BIGINT,useMap:!0,rawBinaryStringKeys:!0,rawBinaryStringValues:!0,useRawBinaryStringClass:!0}),!this.segment)return this.resolvedCache=e,this.resolvedCachePresent=!0,e;if(this.segment.kind===Ze.MAP_VALUE){if(!(e instanceof Map))throw new Error(`Invalid type. Expected Map, got ${e} (${typeof e})`);if("string"==typeof this.segment.key||this.segment.key instanceof Uint8Array||this.segment.key instanceof Ae){const t=this.segment.key instanceof Ae?this.segment.key.rawBinaryValue:L(this.segment.key),n="string"==typeof this.segment.key||this.segment.key instanceof Ae;for(const[a,i]of e){let e;if(n?a instanceof Ae&&(e=a.rawBinaryValue):a instanceof Uint8Array&&(e=a),e&&f(t,e)){this.resolvedCache=i;break}}}else this.resolvedCache=e.get(this.segment.key);return this.resolvedCachePresent=!0,this.resolvedCache}if(this.segment.kind===Ze.ARRAY_ELEMENT){if(!Array.isArray(e))throw new Error(`Invalid type. Expected Array, got ${e} (${typeof e})`);return this.resolvedCache=e[this.segment.key],this.resolvedCachePresent=!0,this.resolvedCache}throw new Error(`Invalid segment kind: ${this.segment.kind}`)}getPathString(){const e=this.parent?this.parent.getPathString():"root";return this.segment?this.segment.kind===Ze.MAP_VALUE?`${e} -> map key "${this.segment.key}" (${typeof this.segment.key})`:this.segment.kind===Ze.ARRAY_ELEMENT?`${e} -> array index ${this.segment.key} (${typeof this.segment.key})`:`${e} -> unknown segment kind ${this.segment.kind}`:e}}class nt{}function at(e,t){const n=We(e),a=new tt({baseObjectBytes:e});return t.fromEncodingData(t.encodingSchema.fromPreparedMsgpack(n,a))}function it(e){return qe(e.getEncodingSchema().prepareMsgpack(e.toEncodingData()))}function rt(e,t){const n=m(e,{intDecoding:l.BIGINT});return t.fromEncodingData(t.encodingSchema.fromPreparedJSON(n))}function ot(e,t){const{space:n,...a}=t??{};return p(e.getEncodingSchema().prepareJSON(e.toEncodingData(),a),void 0,n)}class st extends nt{defaultValue(){return!1}isDefaultValue(e){return!1===e}prepareMsgpack(e){if("boolean"==typeof e)return e;throw new Error("Invalid boolean")}fromPreparedMsgpack(e,t){if("boolean"==typeof e)return e;throw new Error("Invalid boolean")}prepareJSON(e,t){if("boolean"==typeof e)return e;throw new Error("Invalid boolean")}fromPreparedJSON(e){if("boolean"==typeof e)return e;throw new Error("Invalid boolean")}}class ct extends nt{defaultValue(){return""}isDefaultValue(e){return""===e}prepareMsgpack(e){if("string"==typeof e)return e;throw new Error(`Invalid string: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){if("string"==typeof e)return e;throw new Error(`Invalid string: (${typeof e}) ${e}`)}prepareJSON(e,t){if("string"==typeof e)return e;throw new Error(`Invalid string: (${typeof e}) ${e}`)}fromPreparedJSON(e){if("string"==typeof e)return e;throw new Error(`Invalid string: (${typeof e}) ${e}`)}}class ht extends nt{defaultValue(){return BigInt(0)}isDefaultValue(e){return"bigint"==typeof e?e===BigInt(0):"number"==typeof e&&0===e}prepareMsgpack(e){return k(e)}fromPreparedMsgpack(e,t){return k(e)}prepareJSON(e,t){return k(e)}fromPreparedJSON(e){return k(e)}}class dt extends nt{defaultValue(){return G.zeroAddress()}isDefaultValue(e){return G.zeroAddress().equals(e)}prepareMsgpack(e){if(e instanceof G)return e.publicKey;throw new Error(`Invalid address: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){return new G(e)}prepareJSON(e,t){if(e instanceof G)return e.toString();throw new Error(`Invalid address: (${typeof e}) ${e}`)}fromPreparedJSON(e){return G.fromString(e)}}class ut extends nt{defaultValue(){return new Uint8Array}isDefaultValue(e){return e instanceof Uint8Array&&0===e.byteLength}prepareMsgpack(e){if(e instanceof Uint8Array)return e;throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){if(e instanceof Uint8Array)return e;throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}prepareJSON(e,t){if(e instanceof Uint8Array)return $(e);throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedJSON(e){if("string"==typeof e)return O(e);throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}}class lt extends nt{constructor(e){super(),this.length=e}defaultValue(){return new Uint8Array(this.length)}isDefaultValue(e){return e instanceof Uint8Array&&e.byteLength===this.length&&e.every((e=>0===e))}prepareMsgpack(e){if(e instanceof Uint8Array){if(e.byteLength===this.length)return e;throw new Error(`Invalid byte array length: wanted ${this.length}, got ${e.byteLength}`)}throw new Error("Invalid byte array")}fromPreparedMsgpack(e,t){if(e instanceof Uint8Array){if(e.byteLength===this.length)return e;throw new Error(`Invalid byte array length: wanted ${this.length}, got ${e.byteLength}`)}throw new Error("Invalid byte array")}prepareJSON(e){if(e instanceof Uint8Array){if(e.byteLength===this.length)return $(e);throw new Error(`Invalid byte array length: wanted ${this.length}, got ${e.byteLength}`)}throw new Error("Invalid byte array")}fromPreparedJSON(e){if("string"==typeof e){const t=O(e);if(t.byteLength===this.length)return t;throw new Error(`Invalid byte array length: wanted ${this.length}, got ${t.byteLength}`)}throw new Error("Invalid base64 byte array")}}class gt extends nt{defaultValue(){return new Uint8Array}isDefaultValue(e){return e instanceof Uint8Array&&0===e.byteLength}prepareMsgpack(e){if(e instanceof Uint8Array)return new Ae(e);throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){return t.getRawStringAtCurrentLocation()}prepareJSON(e,t){if(e instanceof Uint8Array){const n=N(e);if(!t.lossyBinaryStringConversion&&!f(L(n),e))throw new Error(`Invalid UTF-8 byte array encountered. Encode with lossyBinaryStringConversion enabled to bypass this check. Base64 value: ${$(e)}`);return n}throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}fromPreparedJSON(e){if("string"==typeof e)return L(e);throw new Error(`Invalid byte array: (${typeof e}) ${e}`)}}class mt extends nt{constructor(e){super(),this.itemSchema=e}defaultValue(){return[]}isDefaultValue(e){return Array.isArray(e)&&0===e.length}prepareMsgpack(e){if(Array.isArray(e))return e.map((e=>this.itemSchema.prepareMsgpack(e)));throw new Error("ArraySchema data must be an array")}fromPreparedMsgpack(e,t){if(Array.isArray(e))return e.map(((e,n)=>this.itemSchema.fromPreparedMsgpack(e,t.withArrayElement(n))));throw new Error(`ArraySchema encoded data must be an array: ${e} (${typeof e})`)}prepareJSON(e,t){if(Array.isArray(e))return e.map((e=>this.itemSchema.prepareJSON(e,t)));throw new Error("ArraySchema data must be an array")}fromPreparedJSON(e){if(Array.isArray(e))return e.map((e=>this.itemSchema.fromPreparedJSON(e)));throw new Error(`ArraySchema encoded data must be an array: ${e} (${typeof e})`)}}function pt(e){return e.map((e=>({...e,omitEmpty:!0})))}class ft extends nt{constructor(e){super(),this.entries=e,this.checkEntries()}pushEntries(...e){this.entries.push(...e),this.checkEntries()}checkEntries(){for(const e of this.entries)if(e.embedded){if(""!==e.key)throw new Error("Embedded entries must have an empty key");if(!(e.valueSchema instanceof ft))throw new Error("Embedded entry valueSchema must be a NamedMapSchema")}const e=new Set;for(const t of this.getEntries()){if(e.has(t.key))throw new Error(`Duplicate key: ${t.key}`);e.add(t.key)}}getEntries(){const e=[];for(const t of this.entries)if(t.embedded){const n=t.valueSchema;e.push(...n.getEntries())}else e.push(t);return e}defaultValue(){const e=new Map;for(const t of this.getEntries())e.set(t.key,t.valueSchema.defaultValue());return e}isDefaultValue(e){if(!(e instanceof Map))return!1;for(const t of this.getEntries())if(!t.valueSchema.isDefaultValue(e.get(t.key)))return!1;return!0}prepareMsgpack(e){if(!(e instanceof Map))throw new Error(`NamedMapSchema data must be a Map. Got (${typeof e}) ${e}`);const t=new Map;for(const n of this.getEntries()){const a=e.get(n.key);n.omitEmpty&&n.valueSchema.isDefaultValue(a)||t.set(n.key,n.valueSchema.prepareMsgpack(a))}return t}fromPreparedMsgpack(e,t){if(!(e instanceof Map))throw new Error("NamedMapSchema data must be a Map");const n=new Map;for(const a of this.getEntries())if(e.has(a.key))n.set(a.key,a.valueSchema.fromPreparedMsgpack(e.get(a.key),t.withMapValue(a.key)));else{if(!a.omitEmpty)throw new Error(`Missing key: ${a.key}`);n.set(a.key,a.valueSchema.defaultValue())}return n}prepareJSON(e,t){if(!(e instanceof Map))throw new Error("NamedMapSchema data must be a Map");const n={};for(const a of this.getEntries()){const i=e.get(a.key);a.omitEmpty&&a.valueSchema.isDefaultValue(i)||(n[a.key]=a.valueSchema.prepareJSON(i,t))}return n}fromPreparedJSON(e){if(null==e||"object"!=typeof e||Array.isArray(e))throw new Error("NamedMapSchema data must be an object");const t=new Map;for(const n of this.getEntries())if(Object.prototype.hasOwnProperty.call(e,n.key))t.set(n.key,n.valueSchema.fromPreparedJSON(e[n.key]));else{if(!n.omitEmpty)throw new Error(`Missing key: ${n.key}`);t.set(n.key,n.valueSchema.defaultValue())}return t}}function yt(...e){const t=new Map;for(const n of e)for(const[e,a]of n){if(t.has(e))throw new Error(`Duplicate key: ${e}`);t.set(e,a)}return t}function wt(e,t){const n=new Map;for(const[a,i]of e){const[e,r]=t(a,i);n.set(e,r)}return n}class vt extends nt{constructor(e){super(),this.valueSchema=e}defaultValue(){return new Map}isDefaultValue(e){return e instanceof Map&&0===e.size}prepareMsgpack(e){if(!(e instanceof Map))throw new Error(`Uint64MapSchema data must be a Map. Got (${typeof e}) ${e}`);const t=new Map;for(const[n,a]of e){const e=k(n);if(t.has(e))throw new Error(`Duplicate key: ${e}`);t.set(e,this.valueSchema.prepareMsgpack(a))}return t}fromPreparedMsgpack(e,t){if(!(e instanceof Map))throw new Error("Uint64MapSchema data must be a Map");const n=new Map;for(const[a,i]of e){const e=k(a);if(n.has(e))throw new Error(`Duplicate key: ${e}`);n.set(e,this.valueSchema.fromPreparedMsgpack(i,t.withMapValue(a)))}return n}prepareJSON(e,t){if(!(e instanceof Map))throw new Error(`Uint64MapSchema data must be a Map. Got (${typeof e}) ${e}`);const n=new Map;for(const[a,i]of e){const e=k(a);if(n.has(e))throw new Error(`Duplicate key: ${e}`);n.set(e,this.valueSchema.prepareJSON(i,t))}const a={};for(const[e,t]of n)a[e.toString()]=t;return a}fromPreparedJSON(e){if(null==e||"object"!=typeof e||Array.isArray(e))throw new Error("Uint64MapSchema data must be an object");const t=new Map;for(const[n,a]of Object.entries(e)){const e=BigInt(n);if(t.has(e))throw new Error(`Duplicate key: ${e}`);t.set(e,this.valueSchema.fromPreparedJSON(a))}return t}}function St(e){if(e instanceof Ae)return N(e.rawBinaryValue);if(e instanceof Map){const t=new Map;for(const[n,a]of e)t.set(St(n),St(a));return t}return Array.isArray(e)?e.map(St):e}class Et extends nt{constructor(e){super(),this.valueSchema=e}defaultValue(){return new Map}isDefaultValue(e){return e instanceof Map&&0===e.size}prepareMsgpack(e){if(!(e instanceof Map))throw new Error(`SpecialCaseBinaryStringMapSchema data must be a Map. Got (${typeof e}) ${e}`);const t=new Map;for(const[n,a]of e){if(!(n instanceof Uint8Array))throw new Error(`Invalid key: ${n} (${typeof n})`);t.set(new Ae(n),this.valueSchema.prepareMsgpack(a))}return t}fromPreparedMsgpack(e,t){const n=new Map,a=t.getRawStringKeysAndValuesAtCurrentLocation();for(const[e,i]of a)n.set(e,this.valueSchema.fromPreparedMsgpack(St(i),t.withMapValue(new Ae(e))));return n}prepareJSON(e,t){if(!(e instanceof Map))throw new Error(`SpecialCaseBinaryStringMapSchema data must be a Map. Got (${typeof e}) ${e}`);const n=new Map;for(const[a,i]of e){if(!(a instanceof Uint8Array))throw new Error(`Invalid key: ${a}`);const e=N(a);if(!t.lossyBinaryStringConversion&&!f(L(e),a))throw new Error(`Invalid UTF-8 byte array encountered. Encode with lossyBinaryStringConversion enabled to bypass this check. Base64 value: ${$(a)}`);n.set(e,this.valueSchema.prepareJSON(i,t))}const a={};for(const[e,t]of n)a[e]=t;return a}fromPreparedJSON(e){if(null==e||"object"!=typeof e||Array.isArray(e))throw new Error("SpecialCaseBinaryStringMapSchema data must be an object");const t=new Map;for(const[n,a]of Object.entries(e))t.set(L(n),this.valueSchema.fromPreparedJSON(a));return t}}class kt extends nt{constructor(e){super(),this.valueSchema=e}defaultValue(){}isDefaultValue(e){return void 0===e||this.valueSchema.isDefaultValue(e)}prepareMsgpack(e){if(void 0!==e)return this.valueSchema.prepareMsgpack(e)}fromPreparedMsgpack(e,t){if(null!=e)return this.valueSchema.fromPreparedMsgpack(e,t)}prepareJSON(e,t){return void 0===e?null:this.valueSchema.prepareJSON(e,t)}fromPreparedJSON(e){if(null!=e)return this.valueSchema.fromPreparedJSON(e)}}class bt extends nt{defaultValue(){}isDefaultValue(e){return void 0===e}prepareMsgpack(e){return e}fromPreparedMsgpack(e,t){return e}prepareJSON(e,t){return Ye(e)}fromPreparedJSON(e){return Xe(e)}}function xt(e){return e===Qe.pay||e===Qe.keyreg||e===Qe.acfg||e===Qe.axfer||e===Qe.afrz||e===Qe.appl||e===Qe.stpf}function At(e){return e===et.NoOpOC||e===et.OptInOC||e===et.CloseOutOC||e===et.ClearStateOC||e===et.UpdateApplicationOC||e===et.DeleteApplicationOC}!function(e){e.pay="pay",e.keyreg="keyreg",e.acfg="acfg",e.axfer="axfer",e.afrz="afrz",e.appl="appl",e.stpf="stpf"}(Qe||(Qe={})),function(e){e[e.NoOpOC=0]="NoOpOC",e[e.OptInOC=1]="OptInOC",e[e.CloseOutOC=2]="CloseOutOC",e[e.ClearStateOC=3]="ClearStateOC",e[e.UpdateApplicationOC=4]="UpdateApplicationOC",e[e.DeleteApplicationOC=5]="DeleteApplicationOC"}(et||(et={}));class Dt{constructor(e){this.hashType=e.hashType}getEncodingSchema(){return Dt.encodingSchema}toEncodingData(){return new Map([["t",this.hashType]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded HashFactory: ${e}`);return new Dt({hashType:Number(e.get("t"))})}}Dt.encodingSchema=new ft(pt([{key:"t",valueSchema:new ht}]));class Tt{constructor(e){this.path=e.path,this.hashFactory=e.hashFactory,this.treeDepth=e.treeDepth}getEncodingSchema(){return Tt.encodingSchema}toEncodingData(){return new Map([["pth",this.path],["hsh",this.hashFactory.toEncodingData()],["td",this.treeDepth]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded MerkleArrayProof: ${e}`);return new Tt({path:e.get("pth"),hashFactory:Dt.fromEncodingData(e.get("hsh")),treeDepth:Number(e.get("td"))})}}Tt.encodingSchema=new ft(pt([{key:"pth",valueSchema:new mt(new ut)},{key:"hsh",valueSchema:Dt.encodingSchema},{key:"td",valueSchema:new ht}]));class It{constructor(e){this.commitment=e.commitment,this.keyLifetime=e.keyLifetime}getEncodingSchema(){return It.encodingSchema}toEncodingData(){return new Map([["cmt",this.commitment],["lf",this.keyLifetime]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded MerkleSignatureVerifier: ${e}`);return new It({commitment:e.get("cmt"),keyLifetime:e.get("lf")})}}It.encodingSchema=new ft(pt([{key:"cmt",valueSchema:new lt(64)},{key:"lf",valueSchema:new ht}]));class Mt{constructor(e){this.pk=e.pk,this.weight=e.weight}getEncodingSchema(){return Mt.encodingSchema}toEncodingData(){return new Map([["p",this.pk.toEncodingData()],["w",this.weight]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Participant: ${e}`);return new Mt({pk:It.fromEncodingData(e.get("p")),weight:e.get("w")})}}Mt.encodingSchema=new ft(pt([{key:"p",valueSchema:It.encodingSchema},{key:"w",valueSchema:new ht}]));class Vt{constructor(e){this.publicKey=e.publicKey}getEncodingSchema(){return Vt.encodingSchema}toEncodingData(){return new Map([["k",this.publicKey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded FalconVerifier: ${e}`);return new Vt({publicKey:e.get("k")})}}Vt.encodingSchema=new ft(pt([{key:"k",valueSchema:new lt(1793)}]));class Pt{constructor(e){this.signature=e.signature,this.vectorCommitmentIndex=e.index,this.proof=e.proof,this.verifyingKey=e.verifyingKey}getEncodingSchema(){return Pt.encodingSchema}toEncodingData(){return new Map([["sig",this.signature],["idx",this.vectorCommitmentIndex],["prf",this.proof.toEncodingData()],["vkey",this.verifyingKey.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded FalconSignatureStruct: ${e}`);return new Pt({signature:e.get("sig"),index:e.get("idx"),proof:Tt.fromEncodingData(e.get("prf")),verifyingKey:Vt.fromEncodingData(e.get("vkey"))})}}Pt.encodingSchema=new ft(pt([{key:"sig",valueSchema:new ut},{key:"idx",valueSchema:new ht},{key:"prf",valueSchema:Tt.encodingSchema},{key:"vkey",valueSchema:Vt.encodingSchema}]));class Rt{constructor(e){this.sig=e.sig,this.l=e.l}getEncodingSchema(){return Rt.encodingSchema}toEncodingData(){return new Map([["s",this.sig.toEncodingData()],["l",this.l]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SigslotCommit: ${e}`);return new Rt({sig:Pt.fromEncodingData(e.get("s")),l:e.get("l")})}}Rt.encodingSchema=new ft(pt([{key:"s",valueSchema:Pt.encodingSchema},{key:"l",valueSchema:new ht}]));class Bt{constructor(e){this.sigslot=e.sigslot,this.participant=e.participant}getEncodingSchema(){return Bt.encodingSchema}toEncodingData(){return new Map([["s",this.sigslot.toEncodingData()],["p",this.participant.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Reveal: ${e}`);return new Bt({sigslot:Rt.fromEncodingData(e.get("s")),participant:Mt.fromEncodingData(e.get("p"))})}}Bt.encodingSchema=new ft(pt([{key:"s",valueSchema:Rt.encodingSchema},{key:"p",valueSchema:Mt.encodingSchema}]));class Ct{constructor(e){this.sigCommit=e.sigCommit,this.signedWeight=e.signedWeight,this.sigProofs=e.sigProofs,this.partProofs=e.partProofs,this.merkleSignatureSaltVersion=e.merkleSignatureSaltVersion,this.reveals=e.reveals,this.positionsToReveal=e.positionsToReveal}getEncodingSchema(){return Ct.encodingSchema}toEncodingData(){return new Map([["c",this.sigCommit],["w",this.signedWeight],["S",this.sigProofs.toEncodingData()],["P",this.partProofs.toEncodingData()],["v",this.merkleSignatureSaltVersion],["r",wt(this.reveals,((e,t)=>[e,t.toEncodingData()]))],["pr",this.positionsToReveal]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProof: ${e}`);return new Ct({sigCommit:e.get("c"),signedWeight:e.get("w"),sigProofs:Tt.fromEncodingData(e.get("S")),partProofs:Tt.fromEncodingData(e.get("P")),merkleSignatureSaltVersion:Number(e.get("v")),reveals:wt(e.get("r"),((e,t)=>[e,Bt.fromEncodingData(t)])),positionsToReveal:e.get("pr")})}}Ct.encodingSchema=new ft(pt([{key:"c",valueSchema:new ut},{key:"w",valueSchema:new ht},{key:"S",valueSchema:Tt.encodingSchema},{key:"P",valueSchema:Tt.encodingSchema},{key:"v",valueSchema:new ht},{key:"r",valueSchema:new vt(Bt.encodingSchema)},{key:"pr",valueSchema:new mt(new ht)}]));class Ut{constructor(e){this.blockHeadersCommitment=e.blockHeadersCommitment,this.votersCommitment=e.votersCommitment,this.lnProvenWeight=e.lnProvenWeight,this.firstAttestedRound=e.firstAttestedRound,this.lastAttestedRound=e.lastAttestedRound}getEncodingSchema(){return Ut.encodingSchema}toEncodingData(){return new Map([["b",this.blockHeadersCommitment],["v",this.votersCommitment],["P",this.lnProvenWeight],["f",this.firstAttestedRound],["l",this.lastAttestedRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofMessage: ${e}`);return new Ut({blockHeadersCommitment:e.get("b"),votersCommitment:e.get("v"),lnProvenWeight:e.get("P"),firstAttestedRound:e.get("f"),lastAttestedRound:e.get("l")})}static fromMap(e){return new Ut({blockHeadersCommitment:e.get("b"),votersCommitment:e.get("v"),lnProvenWeight:e.get("P"),firstAttestedRound:e.get("f"),lastAttestedRound:e.get("l")})}}function Ot(e){return e.every((e=>0===e))}function $t(e,t,n){if(null==e)return;let a;if(e instanceof Uint8Array&&(a=e),null==a||a.byteLength!==n)throw Error(`${t} must be a ${n} byte Uint8Array`);return a}function Nt(e){if(null==e)throw new Error("Address must not be null or undefined");if("string"==typeof e)return G.fromString(e);if(e instanceof G)return e;throw new Error(`Not an address: ${e}`)}function Lt(e){if(null==e)return;let t;if(e instanceof G)t=e;else{if("string"!=typeof e)throw new Error(`Not an address: ${e}`);t=G.fromString(e)}if(Ot(t.publicKey))throw new Error("Invalid use of the zero address. To omit this value, pass in undefined");return t}function _t(e){if(void 0!==e){if(e instanceof Uint8Array)return e;throw new Error(`Not a Uint8Array: ${e}`)}}function zt(e){if(e instanceof Uint8Array)return e;throw new Error(`Not a Uint8Array: ${e}`)}function Ft(e){if(void 0!==e)return k(e)}function Kt(e){if(!0===e||!1===e)return e;throw new Error(`Not a boolean: ${e}`)}function qt(e){if(Array.isArray(e))return e.slice();throw new Error(`Not an array: ${e}`)}function Ht(e,t,n){const a=_t(e);if(void 0!==a){if(a.byteLength!==t)throw new Error(`${n} must be ${t} bytes long, was ${a.byteLength}`);if(!Ot(a))return a}}function jt(e){if(null!=e&&"object"==typeof e){const{appIndex:t,name:n}=e;return{appIndex:k(t),name:zt(n)}}throw new Error(`Not a box reference: ${e}`)}Ut.encodingSchema=new ft(pt([{key:"b",valueSchema:new ut},{key:"v",valueSchema:new ut},{key:"P",valueSchema:new ht},{key:"f",valueSchema:new ht},{key:"l",valueSchema:new ht}]));const Gt=(new TextEncoder).encode("TX");class Jt{constructor(e){if(!xt(e.type))throw new Error(`Invalid transaction type: ${e.type}`);if(this.type=e.type,this.sender=Nt(e.sender),this.note=zt(e.note??new Uint8Array),this.lease=Ht(e.lease,32,"lease"),this.rekeyTo=Lt(e.rekeyTo),this.group=void 0,this.firstValid=k(e.suggestedParams.firstValid),this.lastValid=k(e.suggestedParams.lastValid),e.suggestedParams.genesisID){if("string"!=typeof e.suggestedParams.genesisID)throw new Error("Genesis ID must be a string if present");this.genesisID=e.suggestedParams.genesisID}this.genesisHash=_t(e.suggestedParams.genesisHash);const t=[];if(e.paymentParams&&t.push(Qe.pay),e.keyregParams&&t.push(Qe.keyreg),e.assetConfigParams&&t.push(Qe.acfg),e.assetTransferParams&&t.push(Qe.axfer),e.assetFreezeParams&&t.push(Qe.afrz),e.appCallParams&&t.push(Qe.appl),e.stateProofParams&&t.push(Qe.stpf),1!==t.length)throw new Error(`Transaction has wrong number of type fields present (${t.length}): ${t}`);if(this.type!==t[0])throw new Error(`Transaction has type ${this.type} but fields present for ${t[0]}`);if(e.paymentParams&&(this.payment={receiver:Nt(e.paymentParams.receiver),amount:k(e.paymentParams.amount),closeRemainderTo:Lt(e.paymentParams.closeRemainderTo)}),e.keyregParams){if(this.keyreg={voteKey:$t(e.keyregParams.voteKey,"voteKey",32),selectionKey:$t(e.keyregParams.selectionKey,"selectionKey",32),stateProofKey:$t(e.keyregParams.stateProofKey,"stateProofKey",64),voteFirst:Ft(e.keyregParams.voteFirst),voteLast:Ft(e.keyregParams.voteLast),voteKeyDilution:Ft(e.keyregParams.voteKeyDilution),nonParticipation:Kt(e.keyregParams.nonParticipation??!1)},this.keyreg.nonParticipation&&(this.keyreg.voteKey||this.keyreg.selectionKey||this.keyreg.stateProofKey||void 0!==this.keyreg.voteFirst||void 0!==this.keyreg.voteLast||void 0!==this.keyreg.voteKeyDilution))throw new Error("nonParticipation is true but participation params are present.");if(!this.keyreg.nonParticipation&&(this.keyreg.voteKey||this.keyreg.selectionKey||this.keyreg.stateProofKey||void 0!==this.keyreg.voteFirst||void 0!==this.keyreg.voteLast||void 0!==this.keyreg.voteKeyDilution)&&(!this.keyreg.voteKey||!this.keyreg.selectionKey||void 0===this.keyreg.voteFirst||void 0===this.keyreg.voteLast||void 0===this.keyreg.voteKeyDilution))throw new Error("Online key registration missing at least one of the following fields: voteKey, selectionKey, voteFirst, voteLast, voteKeyDilution")}if(e.assetConfigParams&&(this.assetConfig={assetIndex:k(e.assetConfigParams.assetIndex??0),total:k(e.assetConfigParams.total??0),decimals:S(e.assetConfigParams.decimals??0),defaultFrozen:Kt(e.assetConfigParams.defaultFrozen??!1),manager:Lt(e.assetConfigParams.manager),reserve:Lt(e.assetConfigParams.reserve),freeze:Lt(e.assetConfigParams.freeze),clawback:Lt(e.assetConfigParams.clawback),unitName:e.assetConfigParams.unitName,assetName:e.assetConfigParams.assetName,assetURL:e.assetConfigParams.assetURL,assetMetadataHash:Ht(e.assetConfigParams.assetMetadataHash,32,"assetMetadataHash")}),e.assetTransferParams&&(this.assetTransfer={assetIndex:k(e.assetTransferParams.assetIndex),amount:k(e.assetTransferParams.amount),assetSender:Lt(e.assetTransferParams.assetSender),receiver:Nt(e.assetTransferParams.receiver),closeRemainderTo:Lt(e.assetTransferParams.closeRemainderTo)}),e.assetFreezeParams&&(this.assetFreeze={assetIndex:k(e.assetFreezeParams.assetIndex),freezeAccount:Nt(e.assetFreezeParams.freezeTarget),frozen:Kt(e.assetFreezeParams.frozen)}),e.appCallParams){const{onComplete:t}=e.appCallParams;if(!At(t))throw new Error(`Invalid onCompletion value: ${t}`);this.applicationCall={appIndex:k(e.appCallParams.appIndex),onComplete:t,numLocalInts:S(e.appCallParams.numLocalInts??0),numLocalByteSlices:S(e.appCallParams.numLocalByteSlices??0),numGlobalInts:S(e.appCallParams.numGlobalInts??0),numGlobalByteSlices:S(e.appCallParams.numGlobalByteSlices??0),extraPages:S(e.appCallParams.extraPages??0),approvalProgram:zt(e.appCallParams.approvalProgram??new Uint8Array),clearProgram:zt(e.appCallParams.clearProgram??new Uint8Array),appArgs:qt(e.appCallParams.appArgs??[]).map(zt),accounts:qt(e.appCallParams.accounts??[]).map(Nt),foreignApps:qt(e.appCallParams.foreignApps??[]).map(k),foreignAssets:qt(e.appCallParams.foreignAssets??[]).map(k),boxes:qt(e.appCallParams.boxes??[]).map(jt)}}if(e.stateProofParams&&(this.stateProof={stateProofType:S(e.stateProofParams.stateProofType??0),stateProof:e.stateProofParams.stateProof,message:e.stateProofParams.message}),this.fee=k(e.suggestedParams.fee),!Kt(e.suggestedParams.flatFee??!1)){const t=k(e.suggestedParams.minFee);this.fee*=BigInt(this.estimateSize()),this.fee<t&&(this.fee=t)}}getEncodingSchema(){return Jt.encodingSchema}toEncodingData(){const e=new Map([["type",this.type],["fv",this.firstValid],["lv",this.lastValid],["snd",this.sender],["gen",this.genesisID],["gh",this.genesisHash],["fee",this.fee],["note",this.note],["lx",this.lease],["rekey",this.rekeyTo],["grp",this.group]]);if(this.payment)return e.set("amt",this.payment.amount),e.set("rcv",this.payment.receiver),e.set("close",this.payment.closeRemainderTo),e;if(this.keyreg)return e.set("votekey",this.keyreg.voteKey),e.set("selkey",this.keyreg.selectionKey),e.set("sprfkey",this.keyreg.stateProofKey),e.set("votefst",this.keyreg.voteFirst),e.set("votelst",this.keyreg.voteLast),e.set("votekd",this.keyreg.voteKeyDilution),e.set("nonpart",this.keyreg.nonParticipation),e;if(this.assetConfig){e.set("caid",this.assetConfig.assetIndex);const t=new Map([["t",this.assetConfig.total],["dc",this.assetConfig.decimals],["df",this.assetConfig.defaultFrozen],["m",this.assetConfig.manager],["r",this.assetConfig.reserve],["f",this.assetConfig.freeze],["c",this.assetConfig.clawback],["un",this.assetConfig.unitName],["an",this.assetConfig.assetName],["au",this.assetConfig.assetURL],["am",this.assetConfig.assetMetadataHash]]);return e.set("apar",t),e}if(this.assetTransfer)return e.set("xaid",this.assetTransfer.assetIndex),e.set("aamt",this.assetTransfer.amount),e.set("arcv",this.assetTransfer.receiver),e.set("aclose",this.assetTransfer.closeRemainderTo),e.set("asnd",this.assetTransfer.assetSender),e;if(this.assetFreeze)return e.set("faid",this.assetFreeze.assetIndex),e.set("afrz",this.assetFreeze.frozen),e.set("fadd",this.assetFreeze.freezeAccount),e;if(this.applicationCall)return e.set("apid",this.applicationCall.appIndex),e.set("apan",this.applicationCall.onComplete),e.set("apaa",this.applicationCall.appArgs),e.set("apat",this.applicationCall.accounts),e.set("apas",this.applicationCall.foreignAssets),e.set("apfa",this.applicationCall.foreignApps),e.set("apbx",function(e,t,n){const a=BigInt(n),i=t.map(BigInt);return e.map((e=>function(e,t,n){const a=BigInt(e.appIndex),i=e.name,r=a===BigInt(0)||a===n,o=t.indexOf(a)+1;if(0===o&&!r)throw new Error(`Box ref with appId ${a} not in foreign-apps`);return new Map([["i",o],["n",i]])}(e,i,a)))}(this.applicationCall.boxes,this.applicationCall.foreignApps,this.applicationCall.appIndex)),e.set("apap",this.applicationCall.approvalProgram),e.set("apsu",this.applicationCall.clearProgram),e.set("apls",new Map([["nui",this.applicationCall.numLocalInts],["nbs",this.applicationCall.numLocalByteSlices]])),e.set("apgs",new Map([["nui",this.applicationCall.numGlobalInts],["nbs",this.applicationCall.numGlobalByteSlices]])),e.set("apep",this.applicationCall.extraPages),e;if(this.stateProof)return e.set("sptype",this.stateProof.stateProofType),e.set("sp",this.stateProof.stateProof?this.stateProof.stateProof.toEncodingData():void 0),e.set("spmsg",this.stateProof.message?this.stateProof.message.toEncodingData():void 0),e;throw new Error(`Unexpected transaction type: ${this.type}`)}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded logic sig account: ${e}`);const t={minFee:BigInt(0),flatFee:!0,fee:e.get("fee")??0,firstValid:e.get("fv")??0,lastValid:e.get("lv")??0,genesisHash:e.get("gh"),genesisID:e.get("gen")},n=e.get("type");if(!xt(n))throw new Error(`Unrecognized transaction type: ${n}`);const a={type:n,sender:e.get("snd")??G.zeroAddress(),note:e.get("note"),lease:e.get("lx"),suggestedParams:t};if(e.get("rekey")&&(a.rekeyTo=e.get("rekey")),a.type===Qe.pay){const t={amount:e.get("amt")??0,receiver:e.get("rcv")??G.zeroAddress()};e.get("close")&&(t.closeRemainderTo=e.get("close")),a.paymentParams=t}else if(a.type===Qe.keyreg){const t={voteKey:e.get("votekey"),selectionKey:e.get("selkey"),stateProofKey:e.get("sprfkey"),voteFirst:e.get("votefst"),voteLast:e.get("votelst"),voteKeyDilution:e.get("votekd"),nonParticipation:e.get("nonpart")};a.keyregParams=t}else if(a.type===Qe.acfg){const t={assetIndex:e.get("caid")};if(e.get("apar")){const n=e.get("apar");t.total=n.get("t"),t.decimals=n.get("dc"),t.defaultFrozen=n.get("df"),t.unitName=n.get("un"),t.assetName=n.get("an"),t.assetURL=n.get("au"),t.assetMetadataHash=n.get("am"),n.get("m")&&(t.manager=n.get("m")),n.get("r")&&(t.reserve=n.get("r")),n.get("f")&&(t.freeze=n.get("f")),n.get("c")&&(t.clawback=n.get("c"))}a.assetConfigParams=t}else if(a.type===Qe.axfer){const t={assetIndex:e.get("xaid")??0,amount:e.get("aamt")??0,receiver:e.get("arcv")??G.zeroAddress()};e.get("aclose")&&(t.closeRemainderTo=e.get("aclose")),e.get("asnd")&&(t.assetSender=e.get("asnd")),a.assetTransferParams=t}else if(a.type===Qe.afrz){const t={assetIndex:e.get("faid")??0,freezeTarget:e.get("fadd")??G.zeroAddress(),frozen:e.get("afrz")??!1};a.assetFreezeParams=t}else if(a.type===Qe.appl){const t={appIndex:e.get("apid")??0,onComplete:S(e.get("apan")??0),appArgs:e.get("apaa"),accounts:e.get("apat"),foreignAssets:e.get("apas"),foreignApps:e.get("apfa"),approvalProgram:e.get("apap"),clearProgram:e.get("apsu"),extraPages:e.get("apep")},n=e.get("apls");n&&(t.numLocalInts=n.get("nui"),t.numLocalByteSlices=n.get("nbs"));const i=e.get("apgs");i&&(t.numGlobalInts=i.get("nui"),t.numGlobalByteSlices=i.get("nbs"));const r=e.get("apbx");r&&(t.boxes=r.map((e=>{const n=S(e.get("i")??0),a=zt(e.get("n")??new Uint8Array);if(0===n)return{appIndex:0,name:a};if(!t.foreignApps||n>t.foreignApps.length)throw new Error(`Cannot find foreign app index ${n} in ${t.foreignApps}`);return{appIndex:t.foreignApps[n-1],name:a}}))),a.appCallParams=t}else{if(a.type!==Qe.stpf){const e=a.type;throw new Error(`Unexpected transaction type: ${e}`)}{const t={stateProofType:e.get("sptype"),stateProof:e.get("sp")?Ct.fromEncodingData(e.get("sp")):void 0,message:e.get("spmsg")?Ut.fromEncodingData(e.get("spmsg")):void 0};a.stateProofParams=t}}const i=new Jt(a);if(e.get("grp")){const t=zt(e.get("grp"));if(32!==t.byteLength)throw new Error(`Invalid group length: ${t.byteLength}`);i.group=t}return i}estimateSize(){return this.toByte().length+75}bytesToSign(){const e=this.toByte();return y(Gt,e)}toByte(){return it(this)}rawSignTxn(e){return T(this.bytesToSign(),e)}signTxn(e){const t=D(e),n=new G(t.publicKey),a=this.rawSignTxn(e);return this.attachSignature(n,a)}attachSignature(e,t){if(!A(t.length))throw new Error("Invalid signature length");const n=new Map([["sig",t],["txn",this.toEncodingData()]]),a=Nt(e);return this.sender.equals(a)||n.set("sgnr",a),qe(new ft(pt([{key:"txn",valueSchema:Jt.encodingSchema},{key:"sig",valueSchema:new lt(64)},{key:"sgnr",valueSchema:new kt(new dt)}])).prepareMsgpack(n))}rawTxID(){const e=this.toByte(),t=y(Gt,e);return Uint8Array.from(b(t))}txID(){const e=this.rawTxID();return B().encode(e).slice(0,52)}}function Wt(e){return it(e)}function Yt(e){return at(e,Jt)}Jt.encodingSchema=new ft(pt([{key:"type",valueSchema:new ct},{key:"snd",valueSchema:new dt},{key:"lv",valueSchema:new ht},{key:"gen",valueSchema:new kt(new ct)},{key:"gh",valueSchema:new kt(new lt(32))},{key:"fee",valueSchema:new ht},{key:"fv",valueSchema:new ht},{key:"note",valueSchema:new ut},{key:"lx",valueSchema:new kt(new lt(32))},{key:"rekey",valueSchema:new kt(new dt)},{key:"grp",valueSchema:new kt(new lt(32))},{key:"amt",valueSchema:new kt(new ht)},{key:"rcv",valueSchema:new kt(new dt)},{key:"close",valueSchema:new kt(new dt)},{key:"votekey",valueSchema:new kt(new lt(32))},{key:"selkey",valueSchema:new kt(new lt(32))},{key:"sprfkey",valueSchema:new kt(new lt(64))},{key:"votefst",valueSchema:new kt(new ht)},{key:"votelst",valueSchema:new kt(new ht)},{key:"votekd",valueSchema:new kt(new ht)},{key:"nonpart",valueSchema:new kt(new st)},{key:"caid",valueSchema:new kt(new ht)},{key:"apar",valueSchema:new kt(new ft(pt([{key:"t",valueSchema:new ht},{key:"dc",valueSchema:new ht},{key:"df",valueSchema:new st},{key:"m",valueSchema:new kt(new dt)},{key:"r",valueSchema:new kt(new dt)},{key:"f",valueSchema:new kt(new dt)},{key:"c",valueSchema:new kt(new dt)},{key:"un",valueSchema:new kt(new ct)},{key:"an",valueSchema:new kt(new ct)},{key:"au",valueSchema:new kt(new ct)},{key:"am",valueSchema:new kt(new lt(32))}])))},{key:"xaid",valueSchema:new kt(new ht)},{key:"aamt",valueSchema:new kt(new ht)},{key:"arcv",valueSchema:new kt(new dt)},{key:"aclose",valueSchema:new kt(new dt)},{key:"asnd",valueSchema:new kt(new dt)},{key:"faid",valueSchema:new kt(new ht)},{key:"afrz",valueSchema:new kt(new st)},{key:"fadd",valueSchema:new kt(new dt)},{key:"apid",valueSchema:new kt(new ht)},{key:"apan",valueSchema:new kt(new ht)},{key:"apaa",valueSchema:new kt(new mt(new ut))},{key:"apat",valueSchema:new kt(new mt(new dt))},{key:"apas",valueSchema:new kt(new mt(new ht))},{key:"apfa",valueSchema:new kt(new mt(new ht))},{key:"apbx",valueSchema:new kt(new mt(new ft(pt([{key:"i",valueSchema:new ht},{key:"n",valueSchema:new ut}]))))},{key:"apap",valueSchema:new kt(new ut)},{key:"apsu",valueSchema:new kt(new ut)},{key:"apls",valueSchema:new kt(new ft(pt([{key:"nui",valueSchema:new ht},{key:"nbs",valueSchema:new ht}])))},{key:"apgs",valueSchema:new kt(new ft(pt([{key:"nui",valueSchema:new ht},{key:"nbs",valueSchema:new ht}])))},{key:"apep",valueSchema:new kt(new ht)},{key:"sptype",valueSchema:new kt(new ht)},{key:"sp",valueSchema:new kt(Ct.encodingSchema)},{key:"spmsg",valueSchema:new kt(Ut.encodingSchema)}]));const Xt=new Uint8Array([77,117,108,116,105,115,105,103,65,100,100,114]),Zt="invalid multisig version",Qt="bad multisig threshold",en="bad multisig public key - wrong length",tn="nacl public key length is not 32 bytes";function nn(e){return e.map((e=>"string"==typeof e?G.fromString(e).publicKey:e.publicKey))}function an({version:e,threshold:t,pks:n}){if(1!==e||e>255||e<0)throw new Error(Zt);if(0===t||0===n.length||t>n.length||t>255)throw new Error(Qt);const a=F-K;if(a!==V)throw new Error(tn);const i=new Uint8Array(Xt.length+2+a*n.length);i.set(Xt,0),i.set([e],Xt.length),i.set([t],Xt.length+1);for(let e=0;e<n.length;e++){if(n[e].length!==a)throw new Error(en);i.set(n[e],Xt.length+2+e*a)}return new G(Uint8Array.from(b(i)))}function rn(e,t,n){const a=t.v,i=t.thr,r=t.subsig,o=r.map((e=>e.pk));if(t.subsig.length<i)return!1;let s;try{s=an({version:a,threshold:i,pks:o}).publicKey}catch(e){return!1}if(!f(s,n))return!1;let c=0;for(const e of r)void 0!==e.s&&(c+=1);if(c<i)return!1;let h=0;for(const t of r)void 0!==t.s&&M(e,t.s,t.pk)&&(h+=1);return!(h<i)}function on({version:e,threshold:t,addrs:n}){return function({version:e,threshold:t,addrs:n}){return an({version:e,threshold:t,pks:nn(n)})}({version:e,threshold:t,addrs:n})}const sn=new ft(pt([{key:"pk",valueSchema:new lt(32)},{key:"s",valueSchema:new kt(new lt(64))}]));function cn(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EncodedSubsig: ${e}`);const t={pk:e.get("pk")};return e.get("s")&&(t.s=e.get("s")),t}function hn(e){const t=new Map([["pk",e.pk]]);return e.s&&t.set("s",e.s),t}const dn=new ft(pt([{key:"v",valueSchema:new ht},{key:"thr",valueSchema:new ht},{key:"subsig",valueSchema:new mt(sn)}]));function un(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EncodedMultiSig: ${e}`);return{v:S(e.get("v")),thr:S(e.get("thr")),subsig:e.get("subsig").map(cn)}}function ln(e){return new Map([["v",e.v],["thr",e.thr],["subsig",e.subsig.map(hn)]])}const gn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;function mn(e){if(!e||0===e.length)throw new Error("empty program");const t="\n".charCodeAt(0),n=" ".charCodeAt(0),a="~".charCodeAt(0);if(e.every((e=>e===t||(e=>n<=e&&e<=a)(e)))){const t=(new TextDecoder).decode(e);if(W(t))throw new Error("requesting program bytes, get Algorand address");if(gn.test(t))throw new Error("program should not be b64 encoded");throw new Error("program bytes are all ASCII printable characters, not looking like Teal byte code")}}const pn=(new TextEncoder).encode("Program");class fn{constructor(e,t){if(t&&(!Array.isArray(t)||!t.every((e=>e.constructor===Uint8Array))))throw new TypeError("Invalid arguments");let n=[];null!=t&&(n=t.map((e=>new Uint8Array(e)))),mn(e),this.logic=e,this.args=n,this.sig=void 0,this.msig=void 0}getEncodingSchema(){return fn.encodingSchema}toEncodingData(){const e=new Map([["l",this.logic],["arg",this.args],["sig",this.sig]]);return this.msig&&e.set("msig",ln(this.msig)),e}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded logic sig: ${e}`);const t=new fn(e.get("l"),e.get("arg"));return t.sig=e.get("sig"),e.get("msig")&&(t.msig=un(e.get("msig"))),t}verify(e){if(this.sig&&this.msig)return!1;try{mn(this.logic)}catch(e){return!1}const t=y(pn,this.logic);return this.sig||this.msig?this.sig?M(t,this.sig,e):rn(t,this.msig,e):f(b(t),e)}address(){const e=b(y(pn,this.logic));return new G(Uint8Array.from(e))}sign(e,t){if(null==t)this.sig=this.signProgram(e);else{const n=nn(t.addrs).map((e=>({pk:e})));this.msig={v:t.version,thr:t.threshold,subsig:n};const[a,i]=this.singleSignMultisig(e,this.msig);this.msig.subsig[i].s=a}}appendToMultisig(e){if(void 0===this.msig)throw new Error("no multisig present");const[t,n]=this.singleSignMultisig(e,this.msig);this.msig.subsig[n].s=t}signProgram(e){return T(y(pn,this.logic),e)}singleSignMultisig(e,t){let n=-1;const a=D(e).publicKey;for(let e=0;e<t.subsig.length;e++){const{pk:i}=t.subsig[e];if(f(i,a)){n=e;break}}if(-1===n)throw new Error("invalid secret key");return[this.signProgram(e),n]}toByte(){return it(this)}static fromByte(e){return at(e,fn)}}fn.encodingSchema=new ft(pt([{key:"l",valueSchema:new ut},{key:"arg",valueSchema:new mt(new ut)},{key:"sig",valueSchema:new kt(new lt(64))},{key:"msig",valueSchema:new kt(dn)}]));class yn{constructor(e,t){this.lsig=new fn(e,t),this.sigkey=void 0}getEncodingSchema(){return yn.encodingSchema}toEncodingData(){return new Map([["lsig",this.lsig.toEncodingData()],["sigkey",this.sigkey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded logic sig account: ${e}`);const t=e,n=fn.fromEncodingData(t.get("lsig")),a=new yn(n.logic,n.args);return a.lsig=n,a.sigkey=t.get("sigkey"),a}toByte(){return it(this)}static fromByte(e){return at(e,yn)}isDelegated(){return!(!this.lsig.sig&&!this.lsig.msig)}verify(){const e=this.address();return this.lsig.verify(e.publicKey)}address(){if(this.lsig.sig&&this.lsig.msig)throw new Error("LogicSig has too many signatures. At most one of sig or msig may be present");if(this.lsig.sig){if(!this.sigkey)throw new Error("Signing key for delegated account is missing");return new G(this.sigkey)}return this.lsig.msig?an({version:this.lsig.msig.v,threshold:this.lsig.msig.thr,pks:this.lsig.msig.subsig.map((e=>e.pk))}):this.lsig.address()}signMultisig(e,t){this.lsig.sign(t,e)}appendToMultisig(e){this.lsig.appendToMultisig(e)}sign(e){this.lsig.sign(e),this.sigkey=D(e).publicKey}}function wn(e){return at(e,fn)}yn.encodingSchema=new ft(pt([{key:"lsig",valueSchema:fn.encodingSchema},{key:"sigkey",valueSchema:new kt(new lt(32))}]));const vn=(new TextEncoder).encode("ProgData");function Sn(e,t,n){const a=y(("string"==typeof n?G.fromString(n):n).publicKey,t);return T(y(vn,a),e)}function En(e,t,n,a){const i=y(("string"==typeof t?G.fromString(t):t).publicKey,e);return M(y(vn,i),n,a)}function kn(e,t,n){return Sn(e,t,new fn(n).address())}class bn{constructor({txn:e,sig:t,msig:n,lsig:a,sgnr:i}){this.txn=e,this.sig=t,this.msig=n,this.lsig=a,this.sgnr=i;let r=0;if(t&&(r+=1),n&&(r+=1),a&&(r+=1),r>1)throw new Error(`SignedTransaction must not have more than 1 signature. Got ${r}`)}getEncodingSchema(){return bn.encodingSchema}toEncodingData(){return new Map([["txn",this.txn.toEncodingData()],["sig",this.sig],["msig",this.msig?ln(this.msig):void 0],["lsig",this.lsig?this.lsig.toEncodingData():void 0],["sgnr",this.sgnr]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SignedTransaction: ${e}`);return new bn({txn:Jt.fromEncodingData(e.get("txn")),sig:e.get("sig"),msig:e.get("msig")?un(e.get("msig")):void 0,lsig:e.get("lsig")?fn.fromEncodingData(e.get("lsig")):void 0,sgnr:e.get("sgnr")})}}function xn(e){return at(e,bn)}function An(e){return it(new bn({txn:e}))}bn.encodingSchema=new ft(pt([{key:"txn",valueSchema:Jt.encodingSchema},{key:"sig",valueSchema:new kt(new lt(64))},{key:"msig",valueSchema:new kt(dn)},{key:"lsig",valueSchema:new kt(fn.encodingSchema)},{key:"sgnr",valueSchema:new kt(new dt)}]));class Dn{constructor(e){this.stateProofVotersCommitment=e.stateProofVotersCommitment,this.stateProofOnlineTotalWeight=e.stateProofOnlineTotalWeight,this.stateProofNextRound=e.stateProofNextRound}getEncodingSchema(){return Dn.encodingSchema}toEncodingData(){return new Map([["v",this.stateProofVotersCommitment],["t",this.stateProofOnlineTotalWeight],["n",this.stateProofNextRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofTrackingData: ${e}`);return new Dn({stateProofVotersCommitment:e.get("v"),stateProofOnlineTotalWeight:e.get("t"),stateProofNextRound:e.get("n")})}}Dn.encodingSchema=new ft(pt([{key:"v",valueSchema:new ut},{key:"t",valueSchema:new ht},{key:"n",valueSchema:new ht}]));class Tn{constructor(e){this.nativeSha512_256Commitment=e.nativeSha512_256Commitment,this.sha256Commitment=e.sha256Commitment}getEncodingSchema(){return Tn.encodingSchema}toEncodingData(){return new Map([["txn",this.nativeSha512_256Commitment],["txn256",this.sha256Commitment]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TxnCommitments: ${e}`);return new Tn({nativeSha512_256Commitment:e.get("txn"),sha256Commitment:e.get("txn256")})}}Tn.encodingSchema=new ft(pt([{key:"txn",valueSchema:new lt(32)},{key:"txn256",valueSchema:new lt(32)}]));class In{constructor(e){this.feeSink=e.feeSink,this.rewardsPool=e.rewardsPool,this.rewardsLevel=e.rewardsLevel,this.rewardsRate=e.rewardsRate,this.rewardsResidue=e.rewardsResidue,this.rewardsRecalculationRound=e.rewardsRecalculationRound}getEncodingSchema(){return In.encodingSchema}toEncodingData(){return new Map([["fees",this.feeSink],["rwd",this.rewardsPool],["earn",this.rewardsLevel],["rate",this.rewardsRate],["frac",this.rewardsResidue],["rwcalr",this.rewardsRecalculationRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded RewardState: ${e}`);return new In({feeSink:e.get("fees"),rewardsPool:e.get("rwd"),rewardsLevel:e.get("earn"),rewardsRate:e.get("rate"),rewardsResidue:e.get("frac"),rewardsRecalculationRound:e.get("rwcalr")})}}In.encodingSchema=new ft(pt([{key:"fees",valueSchema:new dt},{key:"rwd",valueSchema:new dt},{key:"earn",valueSchema:new ht},{key:"rate",valueSchema:new ht},{key:"frac",valueSchema:new ht},{key:"rwcalr",valueSchema:new ht}]));class Mn{constructor(e){this.currentProtocol=e.currentProtocol,this.nextProtocol=e.nextProtocol,this.nextProtocolApprovals=e.nextProtocolApprovals,this.nextProtocolVoteBefore=e.nextProtocolVoteBefore,this.nextProtocolSwitchOn=e.nextProtocolSwitchOn}getEncodingSchema(){return Mn.encodingSchema}toEncodingData(){return new Map([["proto",this.currentProtocol],["nextproto",this.nextProtocol],["nextyes",this.nextProtocolApprovals],["nextbefore",this.nextProtocolVoteBefore],["nextswitch",this.nextProtocolSwitchOn]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded UpgradeState: ${e}`);return new Mn({currentProtocol:e.get("proto"),nextProtocol:e.get("nextproto"),nextProtocolApprovals:e.get("nextyes"),nextProtocolVoteBefore:e.get("nextbefore"),nextProtocolSwitchOn:e.get("nextswitch")})}}Mn.encodingSchema=new ft(pt([{key:"proto",valueSchema:new ct},{key:"nextproto",valueSchema:new ct},{key:"nextyes",valueSchema:new ht},{key:"nextbefore",valueSchema:new ht},{key:"nextswitch",valueSchema:new ht}]));class Vn{constructor(e){this.upgradePropose=e.upgradePropose,this.upgradeDelay=e.upgradeDelay,this.upgradeApprove=e.upgradeApprove}getEncodingSchema(){return Vn.encodingSchema}toEncodingData(){return new Map([["upgradeprop",this.upgradePropose],["upgradedelay",this.upgradeDelay],["upgradeyes",this.upgradeApprove]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded UpgradeVote: ${e}`);return new Vn({upgradePropose:e.get("upgradeprop"),upgradeDelay:e.get("upgradedelay"),upgradeApprove:e.get("upgradeyes")})}}Vn.encodingSchema=new ft(pt([{key:"upgradeprop",valueSchema:new ct},{key:"upgradedelay",valueSchema:new ht},{key:"upgradeyes",valueSchema:new st}]));class Pn{constructor(e){this.expiredParticipationAccounts=e.expiredParticipationAccounts,this.absentParticipationAccounts=e.absentParticipationAccounts}getEncodingSchema(){return Pn.encodingSchema}toEncodingData(){return new Map([["partupdrmv",this.expiredParticipationAccounts],["partupdabs",this.absentParticipationAccounts]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ParticipationUpdates: ${e}`);return new Pn({expiredParticipationAccounts:e.get("partupdrmv"),absentParticipationAccounts:e.get("partupdabs")})}}Pn.encodingSchema=new ft(pt([{key:"partupdrmv",valueSchema:new mt(new dt)},{key:"partupdabs",valueSchema:new mt(new dt)}]));class Rn{constructor(e){this.round=e.round,this.branch=e.branch,this.seed=e.seed,this.txnCommitments=e.txnCommitments,this.timestamp=e.timestamp,this.genesisID=e.genesisID,this.genesisHash=e.genesisHash,this.proposer=e.proposer,this.feesCollected=e.feesCollected,this.bonus=e.bonus,this.proposerPayout=e.proposerPayout,this.rewardState=e.rewardState,this.upgradeState=e.upgradeState,this.upgradeVote=e.upgradeVote,this.txnCounter=e.txnCounter,this.stateproofTracking=e.stateproofTracking,this.participationUpdates=e.participationUpdates}getEncodingSchema(){return Rn.encodingSchema}toEncodingData(){return yt(new Map([["rnd",this.round],["prev",this.branch],["seed",this.seed],["ts",this.timestamp],["gen",this.genesisID],["gh",this.genesisHash],["prp",this.proposer],["fc",this.feesCollected],["bi",this.bonus],["pp",this.proposerPayout],["tc",this.txnCounter],["spt",wt(this.stateproofTracking,((e,t)=>[e,t.toEncodingData()]))]]),this.txnCommitments.toEncodingData(),this.rewardState.toEncodingData(),this.upgradeState.toEncodingData(),this.upgradeVote.toEncodingData(),this.participationUpdates.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockHeader: ${e}`);return new Rn({round:e.get("rnd"),branch:e.get("prev"),seed:e.get("seed"),txnCommitments:Tn.fromEncodingData(e),timestamp:e.get("ts"),genesisID:e.get("gen"),genesisHash:e.get("gh"),proposer:e.get("prp"),feesCollected:e.get("fc"),bonus:e.get("bi"),proposerPayout:e.get("pp"),rewardState:In.fromEncodingData(e),upgradeState:Mn.fromEncodingData(e),upgradeVote:Vn.fromEncodingData(e),txnCounter:e.get("tc"),stateproofTracking:wt(e.get("spt"),((e,t)=>[Number(e),Dn.fromEncodingData(t)])),participationUpdates:Pn.fromEncodingData(e)})}}Rn.encodingSchema=new ft(pt([{key:"rnd",valueSchema:new ht},{key:"prev",valueSchema:new class extends nt{defaultValue(){return new Uint8Array(32)}isDefaultValue(e){return e instanceof Uint8Array&&32===e.byteLength&&e.every((e=>0===e))}prepareMsgpack(e){if(e instanceof Uint8Array&&32===e.byteLength)return e;throw new Error(`Invalid block hash: (${typeof e}) ${e}`)}fromPreparedMsgpack(e,t){if(e instanceof Uint8Array&&32===e.byteLength)return e;throw new Error(`Invalid block hash: (${typeof e}) ${e}`)}prepareJSON(e,t){if(e instanceof Uint8Array&&32===e.byteLength)return`blk-${B().encode(e).slice(0,52)}`;throw new Error(`Invalid block hash: (${typeof e}) ${e}`)}fromPreparedJSON(e){if("string"==typeof e&&56===e.length&&e.startsWith("blk-"))return Uint8Array.from(B().decode.asBytes(e.slice(4)));throw new Error(`Invalid block hash: (${typeof e}) ${e}`)}}},{key:"seed",valueSchema:new ut},{key:"",valueSchema:Tn.encodingSchema,embedded:!0},{key:"ts",valueSchema:new ht},{key:"gen",valueSchema:new ct},{key:"gh",valueSchema:new lt(32)},{key:"prp",valueSchema:new dt},{key:"fc",valueSchema:new ht},{key:"bi",valueSchema:new ht},{key:"pp",valueSchema:new ht},{key:"",valueSchema:In.encodingSchema,embedded:!0},{key:"",valueSchema:Mn.encodingSchema,embedded:!0},{key:"",valueSchema:Vn.encodingSchema,embedded:!0},{key:"tc",valueSchema:new ht},{key:"spt",valueSchema:new vt(Dn.encodingSchema)},{key:"",valueSchema:Pn.encodingSchema,embedded:!0}]));class Bn{constructor(e){this.action=e.action,this.bytes=e.bytes,this.uint=e.uint}getEncodingSchema(){return Bn.encodingSchema}toEncodingData(){return new Map([["at",this.action],["bs",this.bytes],["ui",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ValueDelta: ${e}`);return new Bn({action:Number(e.get("at")),bytes:e.get("bs"),uint:e.get("ui")})}}Bn.encodingSchema=new ft(pt([{key:"at",valueSchema:new ht},{key:"bs",valueSchema:new gt},{key:"ui",valueSchema:new ht}]));class Cn{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries(...pt([{key:"gd",valueSchema:new kt(new Et(Bn.encodingSchema))},{key:"ld",valueSchema:new kt(new vt(new Et(Bn.encodingSchema)))},{key:"sa",valueSchema:new kt(new mt(new dt))},{key:"lg",valueSchema:new kt(new mt(new gt))},{key:"itx",valueSchema:new kt(new mt(On.encodingSchema))}]))),this.encodingSchemaValue}constructor(e){this.globalDelta=e.globalDelta??new Map,this.localDeltas=e.localDeltas??new Map,this.sharedAccts=e.sharedAccts??[],this.logs=e.logs??[],this.innerTxns=e.innerTxns??[]}getEncodingSchema(){return Cn.encodingSchema}toEncodingData(){return new Map([["gd",wt(this.globalDelta,((e,t)=>[e,t.toEncodingData()]))],["ld",wt(this.localDeltas,((e,t)=>[e,wt(t,((e,t)=>[e,t.toEncodingData()]))]))],["sa",this.sharedAccts],["lg",this.logs],["itx",this.innerTxns.map((e=>e.toEncodingData()))]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EvalDelta: ${e}`);return new Cn({globalDelta:e.get("gd")?wt(e.get("gd"),((e,t)=>[e,Bn.fromEncodingData(t)])):void 0,localDeltas:e.get("ld")?wt(e.get("ld"),((e,t)=>[Number(e),wt(t,((e,t)=>[e,Bn.fromEncodingData(t)]))])):void 0,sharedAccts:e.get("sa"),logs:e.get("lg"),innerTxns:(e.get("itx")??[]).map(On.fromEncodingData)})}}class Un{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries(...pt([{key:"ca",valueSchema:new kt(new ht)},{key:"aca",valueSchema:new kt(new ht)},{key:"rs",valueSchema:new kt(new ht)},{key:"rr",valueSchema:new kt(new ht)},{key:"rc",valueSchema:new kt(new ht)},{key:"dt",valueSchema:new kt(Cn.encodingSchema)},{key:"caid",valueSchema:new kt(new ht)},{key:"apid",valueSchema:new kt(new ht)}]))),this.encodingSchemaValue}constructor(e){this.closingAmount=e.closingAmount,this.assetClosingAmount=e.assetClosingAmount,this.senderRewards=e.senderRewards,this.receiverRewards=e.receiverRewards,this.closeRewards=e.closeRewards,this.evalDelta=e.evalDelta,this.configAsset=e.configAsset,this.applicationID=e.applicationID}getEncodingSchema(){return Un.encodingSchema}toEncodingData(){return new Map([["ca",this.closingAmount],["aca",this.assetClosingAmount],["rs",this.senderRewards],["rr",this.receiverRewards],["rc",this.closeRewards],["dt",this.evalDelta?this.evalDelta.toEncodingData():void 0],["caid",this.configAsset],["apid",this.applicationID]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplyData: ${e}`);return new Un({closingAmount:e.get("ca"),assetClosingAmount:e.get("aca"),senderRewards:e.get("rs"),receiverRewards:e.get("rr"),closeRewards:e.get("rc"),evalDelta:e.get("dt")?Cn.fromEncodingData(e.get("dt")):void 0,configAsset:e.get("caid"),applicationID:e.get("apid")})}}class On{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries(...pt([{key:"",valueSchema:bn.encodingSchema,embedded:!0},{key:"",valueSchema:Un.encodingSchema,embedded:!0}]))),this.encodingSchemaValue}constructor(e){this.signedTxn=e.signedTxn,this.applyData=e.applyData}getEncodingSchema(){return On.encodingSchema}toEncodingData(){return yt(this.signedTxn.toEncodingData(),this.applyData.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SignedTxnWithAD: ${e}`);return new On({signedTxn:bn.fromEncodingData(e),applyData:Un.fromEncodingData(e)})}}class $n{constructor(e){this.signedTxn=e.signedTxn,this.hasGenesisID=e.hasGenesisID,this.hasGenesisHash=e.hasGenesisHash}getEncodingSchema(){return $n.encodingSchema}toEncodingData(){return yt(new Map([["hgi",this.hasGenesisID],["hgh",this.hasGenesisHash]]),this.signedTxn.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SignedTxnInBlock: ${e}`);return new $n({signedTxn:On.fromEncodingData(e),hasGenesisID:e.get("hgi"),hasGenesisHash:e.get("hgh")})}}$n.encodingSchema=new ft(pt([{key:"",valueSchema:On.encodingSchema,embedded:!0},{key:"hgi",valueSchema:new st},{key:"hgh",valueSchema:new st}]));class Nn{constructor(e){this.header=e.header,this.payset=e.payset}getEncodingSchema(){return Nn.encodingSchema}toEncodingData(){return yt(new Map([["txns",this.payset.map((e=>e.toEncodingData()))]]),this.header.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockHeader: ${e}`);return new Nn({header:Rn.fromEncodingData(e),payset:e.get("txns").map($n.fromEncodingData)})}}Nn.encodingSchema=new ft(pt([{key:"",valueSchema:Rn.encodingSchema,embedded:!0},{key:"txns",valueSchema:new mt($n.encodingSchema)}]));class Ln{constructor(e){this.data=e}getEncodingSchema(){return Ln.encodingSchema}toEncodingData(){return this.data}static fromEncodingData(e){return new Ln(e)}}Ln.encodingSchema=new bt;class _n{constructor(e){this.type=e.type,this.bytes=e.bytes,this.uint=e.uint}getEncodingSchema(){return _n.encodingSchema}toEncodingData(){return new Map([["tt",this.type],["tb",this.bytes],["ui",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TealValue: ${e}`);return new _n({type:Number(e.get("tt")),bytes:e.get("tb"),uint:e.get("ui")})}}_n.encodingSchema=new ft(pt([{key:"tt",valueSchema:new ht},{key:"tb",valueSchema:new kt(new gt)},{key:"ui",valueSchema:new kt(new ht)}]));class zn{constructor(e){this.numUints=e.numUints,this.numByteSlices=e.numByteSlices}getEncodingSchema(){return zn.encodingSchema}toEncodingData(){return new Map([["nui",this.numUints],["nbs",this.numByteSlices]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateSchema: ${e}`);return new zn({numUints:Number(e.get("nui")),numByteSlices:Number(e.get("nbs"))})}}zn.encodingSchema=new ft(pt([{key:"nui",valueSchema:new ht},{key:"nbs",valueSchema:new ht}]));class Fn{constructor(e){this.approvalProgram=e.approvalProgram,this.clearStateProgram=e.clearStateProgram,this.globalState=e.globalState,this.localStateSchema=e.localStateSchema,this.globalStateSchema=e.globalStateSchema,this.extraProgramPages=e.extraProgramPages}getEncodingSchema(){return Fn.encodingSchema}toEncodingData(){return new Map([["approv",this.approvalProgram],["clearp",this.clearStateProgram],["gs",wt(this.globalState,((e,t)=>[e,t.toEncodingData()]))],["lsch",this.localStateSchema.toEncodingData()],["gsch",this.globalStateSchema.toEncodingData()],["epp",this.extraProgramPages]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppParams: ${e}`);return new Fn({approvalProgram:e.get("approv"),clearStateProgram:e.get("clearp"),globalState:wt(e.get("gs"),((e,t)=>[e,_n.fromEncodingData(t)])),localStateSchema:zn.fromEncodingData(e.get("lsch")),globalStateSchema:zn.fromEncodingData(e.get("gsch")),extraProgramPages:Number(e.get("epp"))})}}Fn.encodingSchema=new ft(pt([{key:"approv",valueSchema:new ut},{key:"clearp",valueSchema:new ut},{key:"gs",valueSchema:new Et(_n.encodingSchema)},{key:"lsch",valueSchema:zn.encodingSchema},{key:"gsch",valueSchema:zn.encodingSchema},{key:"epp",valueSchema:new ht}]));class Kn{constructor(e){this.schema=e.schema,this.keyValue=e.keyValue}getEncodingSchema(){return Kn.encodingSchema}toEncodingData(){return new Map([["hsch",this.schema.toEncodingData()],["tkv",wt(this.keyValue,((e,t)=>[e,t.toEncodingData()]))]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppLocalState: ${e}`);return new Kn({schema:zn.fromEncodingData(e.get("hsch")),keyValue:wt(e.get("tkv"),((e,t)=>[e,_n.fromEncodingData(t)]))})}}Kn.encodingSchema=new ft(pt([{key:"hsch",valueSchema:zn.encodingSchema},{key:"tkv",valueSchema:new Et(_n.encodingSchema)}]));class qn{constructor(e){this.localState=e.localState,this.deleted=e.deleted}getEncodingSchema(){return qn.encodingSchema}toEncodingData(){return new Map([["LocalState",this.localState?this.localState.toEncodingData():void 0],["Deleted",this.deleted]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppLocalStateDelta: ${e}`);return new qn({localState:e.get("LocalState")?Kn.fromEncodingData(e.get("LocalState")):void 0,deleted:e.get("Deleted")})}}qn.encodingSchema=new ft(pt([{key:"LocalState",valueSchema:new kt(Kn.encodingSchema)},{key:"Deleted",valueSchema:new st}]));class Hn{constructor(e){this.params=e.params,this.deleted=e.deleted}getEncodingSchema(){return Hn.encodingSchema}toEncodingData(){return new Map([["Params",this.params?this.params.toEncodingData():void 0],["Deleted",this.deleted]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppParamsDelta: ${e}`);return new Hn({params:e.get("Params")?Fn.fromEncodingData(e.get("Params")):void 0,deleted:e.get("Deleted")})}}Hn.encodingSchema=new ft(pt([{key:"Params",valueSchema:new kt(Fn.encodingSchema)},{key:"Deleted",valueSchema:new st}]));class jn{constructor(e){this.id=e.id,this.address=e.address,this.params=e.params,this.state=e.state}getEncodingSchema(){return jn.encodingSchema}toEncodingData(){return new Map([["Aidx",this.id],["Addr",this.address],["Params",this.params.toEncodingData()],["State",this.state.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppResourceRecord: ${e}`);return new jn({id:e.get("Aidx"),address:e.get("Addr"),params:Hn.fromEncodingData(e.get("Params")),state:qn.fromEncodingData(e.get("State"))})}}jn.encodingSchema=new ft(pt([{key:"Aidx",valueSchema:new ht},{key:"Addr",valueSchema:new dt},{key:"Params",valueSchema:Hn.encodingSchema},{key:"State",valueSchema:qn.encodingSchema}]));class Gn{constructor(e){this.amount=e.amount,this.frozen=e.frozen}getEncodingSchema(){return Gn.encodingSchema}toEncodingData(){return new Map([["a",this.amount],["f",this.frozen]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHolding: ${e}`);return new Gn({amount:e.get("a"),frozen:e.get("f")})}}Gn.encodingSchema=new ft(pt([{key:"a",valueSchema:new ht},{key:"f",valueSchema:new st}]));class Jn{constructor(e){this.holding=e.holding,this.deleted=e.deleted}getEncodingSchema(){return Jn.encodingSchema}toEncodingData(){return new Map([["Holding",this.holding?this.holding.toEncodingData():void 0],["Deleted",this.deleted]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHoldingDelta: ${e}`);return new Jn({holding:e.get("Holding")?Gn.fromEncodingData(e.get("Holding")):void 0,deleted:e.get("Deleted")})}}Jn.encodingSchema=new ft(pt([{key:"Holding",valueSchema:new kt(Gn.encodingSchema)},{key:"Deleted",valueSchema:new st}]));class Wn{constructor(e){this.total=e.total,this.decimals=e.decimals,this.defaultFrozen=e.defaultFrozen,this.unitName=e.unitName,this.assetName=e.assetName,this.url=e.url,this.metadataHash=e.metadataHash,this.manager=e.manager,this.reserve=e.reserve,this.freeze=e.freeze,this.clawback=e.clawback}getEncodingSchema(){return Wn.encodingSchema}toEncodingData(){return new Map([["t",this.total],["dc",this.decimals],["df",this.defaultFrozen],["un",this.unitName],["an",this.assetName],["au",this.url],["am",this.metadataHash],["m",this.manager],["r",this.reserve],["f",this.freeze],["c",this.clawback]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetParams: ${e}`);return new Wn({total:e.get("t"),decimals:e.get("dc"),defaultFrozen:e.get("df"),unitName:e.get("un"),assetName:e.get("an"),url:e.get("au"),metadataHash:e.get("am"),manager:e.get("m"),reserve:e.get("r"),freeze:e.get("f"),clawback:e.get("c")})}}Wn.encodingSchema=new ft(pt([{key:"t",valueSchema:new ht},{key:"dc",valueSchema:new ht},{key:"df",valueSchema:new st},{key:"un",valueSchema:new kt(new gt)},{key:"an",valueSchema:new kt(new gt)},{key:"au",valueSchema:new kt(new gt)},{key:"am",valueSchema:new lt(32)},{key:"m",valueSchema:new kt(new dt)},{key:"r",valueSchema:new kt(new dt)},{key:"f",valueSchema:new kt(new dt)},{key:"c",valueSchema:new kt(new dt)}]));class Yn{constructor(e){this.params=e.params,this.deleted=e.deleted}getEncodingSchema(){return Yn.encodingSchema}toEncodingData(){return new Map([["Params",this.params?this.params.toEncodingData():void 0],["Deleted",this.deleted]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetParamsDelta: ${e}`);return new Yn({params:e.get("Params")?Wn.fromEncodingData(e.get("Params")):void 0,deleted:e.get("Deleted")})}}Yn.encodingSchema=new ft(pt([{key:"Params",valueSchema:new kt(Wn.encodingSchema)},{key:"Deleted",valueSchema:new st}]));class Xn{constructor(e){this.id=e.id,this.address=e.address,this.params=e.params,this.holding=e.holding}getEncodingSchema(){return Xn.encodingSchema}toEncodingData(){return new Map([["Aidx",this.id],["Addr",this.address],["Params",this.params.toEncodingData()],["Holding",this.holding.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetResourceRecord: ${e}`);return new Xn({id:e.get("Aidx"),address:e.get("Addr"),params:Yn.fromEncodingData(e.get("Params")),holding:Jn.fromEncodingData(e.get("Holding"))})}}Xn.encodingSchema=new ft(pt([{key:"Aidx",valueSchema:new ht},{key:"Addr",valueSchema:new dt},{key:"Params",valueSchema:Yn.encodingSchema},{key:"Holding",valueSchema:Jn.encodingSchema}]));class Zn{constructor(e){this.voteID=e.voteID,this.selectionID=e.selectionID,this.stateProofID=e.stateProofID,this.voteFirstValid=e.voteFirstValid,this.voteLastValid=e.voteLastValid,this.voteKeyDilution=e.voteKeyDilution}getEncodingSchema(){return Zn.encodingSchema}toEncodingData(){return new Map([["VoteID",this.voteID],["SelectionID",this.selectionID],["StateProofID",this.stateProofID],["VoteFirstValid",this.voteFirstValid],["VoteLastValid",this.voteLastValid],["VoteKeyDilution",this.voteKeyDilution]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded VotingData: ${e}`);return new Zn({voteID:e.get("VoteID"),selectionID:e.get("SelectionID"),stateProofID:e.get("StateProofID"),voteFirstValid:e.get("VoteFirstValid"),voteLastValid:e.get("VoteLastValid"),voteKeyDilution:e.get("VoteKeyDilution")})}}Zn.encodingSchema=new ft(pt([{key:"VoteID",valueSchema:new lt(32)},{key:"SelectionID",valueSchema:new lt(32)},{key:"StateProofID",valueSchema:new lt(64)},{key:"VoteFirstValid",valueSchema:new ht},{key:"VoteLastValid",valueSchema:new ht},{key:"VoteKeyDilution",valueSchema:new ht}]));class Qn{constructor(e){this.status=e.status,this.microAlgos=e.microAlgos,this.rewardsBase=e.rewardsBase,this.rewardedMicroAlgos=e.rewardedMicroAlgos,this.authAddr=e.authAddr,this.incentiveEligible=e.incentiveEligible,this.totalAppSchema=e.totalAppSchema,this.totalExtraAppPages=e.totalExtraAppPages,this.totalAppParams=e.totalAppParams,this.totalAppLocalStates=e.totalAppLocalStates,this.totalAssetParams=e.totalAssetParams,this.totalAssets=e.totalAssets,this.totalBoxes=e.totalBoxes,this.totalBoxBytes=e.totalBoxBytes,this.lastProposed=e.lastProposed,this.lastHeartbeat=e.lastHeartbeat}getEncodingSchema(){return Qn.encodingSchema}toEncodingData(){return new Map([["Status",this.status],["MicroAlgos",this.microAlgos],["RewardsBase",this.rewardsBase],["RewardedMicroAlgos",this.rewardedMicroAlgos],["AuthAddr",this.authAddr],["IncentiveEligible",this.incentiveEligible],["TotalAppSchema",this.totalAppSchema.toEncodingData()],["TotalExtraAppPages",this.totalExtraAppPages],["TotalAppParams",this.totalAppParams],["TotalAppLocalStates",this.totalAppLocalStates],["TotalAssetParams",this.totalAssetParams],["TotalAssets",this.totalAssets],["TotalBoxes",this.totalBoxes],["TotalBoxBytes",this.totalBoxBytes],["LastProposed",this.lastProposed],["LastHeartbeat",this.lastHeartbeat]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountBaseData: ${e}`);return new Qn({status:Number(e.get("Status")),microAlgos:e.get("MicroAlgos"),rewardsBase:e.get("RewardsBase"),rewardedMicroAlgos:e.get("RewardedMicroAlgos"),authAddr:e.get("AuthAddr"),incentiveEligible:e.get("IncentiveEligible"),totalAppSchema:zn.fromEncodingData(e.get("TotalAppSchema")),totalExtraAppPages:Number(e.get("TotalExtraAppPages")),totalAppParams:e.get("TotalAppParams"),totalAppLocalStates:e.get("TotalAppLocalStates"),totalAssetParams:e.get("TotalAssetParams"),totalAssets:e.get("TotalAssets"),totalBoxes:e.get("TotalBoxes"),totalBoxBytes:e.get("TotalBoxBytes"),lastProposed:e.get("LastProposed"),lastHeartbeat:e.get("LastHeartbeat")})}}Qn.encodingSchema=new ft(pt([{key:"Status",valueSchema:new ht},{key:"MicroAlgos",valueSchema:new ht},{key:"RewardsBase",valueSchema:new ht},{key:"RewardedMicroAlgos",valueSchema:new ht},{key:"AuthAddr",valueSchema:new dt},{key:"IncentiveEligible",valueSchema:new st},{key:"TotalAppSchema",valueSchema:zn.encodingSchema},{key:"TotalExtraAppPages",valueSchema:new ht},{key:"TotalAppParams",valueSchema:new ht},{key:"TotalAppLocalStates",valueSchema:new ht},{key:"TotalAssetParams",valueSchema:new ht},{key:"TotalAssets",valueSchema:new ht},{key:"TotalBoxes",valueSchema:new ht},{key:"TotalBoxBytes",valueSchema:new ht},{key:"LastProposed",valueSchema:new ht},{key:"LastHeartbeat",valueSchema:new ht}]));class ea{constructor(e){this.accountBaseData=e.accountBaseData,this.votingData=e.votingData}getEncodingSchema(){return ea.encodingSchema}toEncodingData(){return yt(this.accountBaseData.toEncodingData(),this.votingData.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountData: ${e}`);return new ea({accountBaseData:Qn.fromEncodingData(e),votingData:Zn.fromEncodingData(e)})}}ea.encodingSchema=new ft(pt([{key:"",valueSchema:Qn.encodingSchema,embedded:!0},{key:"",valueSchema:Zn.encodingSchema,embedded:!0}]));class ta{constructor(e){this.addr=e.addr,this.accountData=e.accountData}getEncodingSchema(){return ta.encodingSchema}toEncodingData(){return yt(new Map([["Addr",this.addr]]),this.accountData.toEncodingData())}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BalanceRecord: ${e}`);return new ta({addr:e.get("Addr"),accountData:ea.fromEncodingData(e)})}}ta.encodingSchema=new ft(pt([{key:"Addr",valueSchema:new dt},{key:"",valueSchema:ea.encodingSchema,embedded:!0}]));class na{constructor(e){this.accounts=e.accounts,this.appResources=e.appResources,this.assetResources=e.assetResources}getEncodingSchema(){return na.encodingSchema}toEncodingData(){return new Map([["Accts",this.accounts.map((e=>e.toEncodingData()))],["AppResources",0===this.appResources.length?void 0:this.appResources.map((e=>e.toEncodingData()))],["AssetResources",0===this.assetResources.length?void 0:this.assetResources.map((e=>e.toEncodingData()))]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountDeltas: ${e}`);return new na({accounts:(e.get("Accts")??[]).map(ta.fromEncodingData),appResources:(e.get("AppResources")??[]).map(jn.fromEncodingData),assetResources:(e.get("AssetResources")??[]).map(Xn.fromEncodingData)})}}na.encodingSchema=new ft(pt([{key:"Accts",valueSchema:new mt(ta.encodingSchema)},{key:"AppResources",valueSchema:new kt(new mt(jn.encodingSchema))},{key:"AssetResources",valueSchema:new kt(new mt(Xn.encodingSchema))}]));class aa{constructor(e){this.data=e.data,this.oldData=e.oldData}getEncodingSchema(){return aa.encodingSchema}toEncodingData(){return new Map([["Data",this.data],["OldData",this.oldData]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded KvValueDelta: ${e}`);return new aa({data:e.get("Data"),oldData:e.get("OldData")})}}aa.encodingSchema=new ft(pt([{key:"Data",valueSchema:new kt(new ut)},{key:"OldData",valueSchema:new kt(new ut)}]));class ia{constructor(e){this.lastValid=e.lastValid,this.intra=e.intra}getEncodingSchema(){return ia.encodingSchema}toEncodingData(){return new Map([["LastValid",this.lastValid],["Intra",this.intra]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded IncludedTransactions: ${e}`);return new ia({lastValid:e.get("LastValid"),intra:Number(e.get("Intra"))})}}ia.encodingSchema=new ft(pt([{key:"LastValid",valueSchema:new ht},{key:"Intra",valueSchema:new ht}]));class ra{constructor(e){this.creatableType=e.creatableType,this.created=e.created,this.creator=e.creator,this.ndeltas=e.ndeltas}getEncodingSchema(){return ra.encodingSchema}toEncodingData(){return new Map([["Ctype",this.creatableType],["Created",this.created],["Creator",this.creator],["Ndeltas",this.ndeltas]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ModifiedCreatable: ${e}`);return new ra({creatableType:Number(e.get("Ctype")),created:e.get("Created"),creator:e.get("Creator"),ndeltas:Number(e.get("Ndeltas"))})}}ra.encodingSchema=new ft(pt([{key:"Ctype",valueSchema:new ht},{key:"Created",valueSchema:new st},{key:"Creator",valueSchema:new dt},{key:"Ndeltas",valueSchema:new ht}]));class oa{constructor(e){this.money=e.money,this.rewardUnits=e.rewardUnits}getEncodingSchema(){return oa.encodingSchema}toEncodingData(){return new Map([["mon",this.money],["rwd",this.rewardUnits]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AlgoCount: ${e}`);return new oa({money:e.get("mon"),rewardUnits:e.get("rwd")})}}oa.encodingSchema=new ft(pt([{key:"mon",valueSchema:new ht},{key:"rwd",valueSchema:new ht}]));class sa{constructor(e){this.online=e.online,this.offline=e.offline,this.notParticipating=e.notParticipating,this.rewardsLevel=e.rewardsLevel}getEncodingSchema(){return sa.encodingSchema}toEncodingData(){return new Map([["online",this.online.toEncodingData()],["offline",this.offline.toEncodingData()],["notpart",this.notParticipating.toEncodingData()],["rwdlvl",this.rewardsLevel]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountTotals: ${e}`);return new sa({online:oa.fromEncodingData(e.get("online")),offline:oa.fromEncodingData(e.get("offline")),notParticipating:oa.fromEncodingData(e.get("notpart")),rewardsLevel:e.get("rwdlvl")})}}sa.encodingSchema=new ft(pt([{key:"online",valueSchema:oa.encodingSchema},{key:"offline",valueSchema:oa.encodingSchema},{key:"notpart",valueSchema:oa.encodingSchema},{key:"rwdlvl",valueSchema:new ht}]));class ca{constructor(e){this.accounts=e.accounts,this.kvMods=e.kvMods,this.txids=e.txids,this.txleases=e.txleases,this.creatables=e.creatables,this.blockHeader=e.blockHeader,this.stateProofNext=e.stateProofNext,this.prevTimestamp=e.prevTimestamp,this.totals=e.totals}getEncodingSchema(){return ca.encodingSchema}toEncodingData(){return new Map([["Accts",this.accounts.toEncodingData()],["KvMods",0===this.kvMods.size?void 0:wt(this.kvMods,((e,t)=>[e,t.toEncodingData()]))],["Txids",wt(this.txids,((e,t)=>[e,t.toEncodingData()]))],["Txleases",this.txleases.toEncodingData()],["Creatables",0===this.creatables.size?void 0:wt(this.creatables,((e,t)=>[e,t.toEncodingData()]))],["Hdr",this.blockHeader.toEncodingData()],["StateProofNext",this.stateProofNext],["PrevTimestamp",this.prevTimestamp],["Totals",this.totals.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded LedgerStateDelta: ${e}`);return new ca({accounts:na.fromEncodingData(e.get("Accts")),kvMods:wt(e.get("KvMods")??new Map,((e,t)=>[e,aa.fromEncodingData(t)])),txids:wt(e.get("Txids"),((e,t)=>[e,ia.fromEncodingData(t)])),txleases:Ln.fromEncodingData(e.get("Txleases")),creatables:wt(e.get("Creatables")??new Map,((e,t)=>[e,ra.fromEncodingData(t)])),blockHeader:Rn.fromEncodingData(e.get("Hdr")),stateProofNext:e.get("StateProofNext"),prevTimestamp:e.get("PrevTimestamp"),totals:sa.fromEncodingData(e.get("Totals"))})}}ca.encodingSchema=new ft(pt([{key:"Accts",valueSchema:na.encodingSchema},{key:"KvMods",valueSchema:new kt(new Et(aa.encodingSchema))},{key:"Txids",valueSchema:new class extends nt{constructor(e){super(),this.valueSchema=e}defaultValue(){return new Map}isDefaultValue(e){return e instanceof Map&&0===e.size}prepareMsgpack(e){if(!(e instanceof Map))throw new Error(`ByteArrayMapSchema data must be a Map. Got (${typeof e}) ${e}`);const t=new Map;for(const[n,a]of e){if(!(n instanceof Uint8Array))throw new Error(`Invalid key: ${n} (${typeof n})`);t.set(n,this.valueSchema.prepareMsgpack(a))}return t}fromPreparedMsgpack(e,t){if(!(e instanceof Map))throw new Error("ByteArrayMapSchema data must be a Map");const n=new Map;for(const[a,i]of e){if(!(a instanceof Uint8Array))throw new Error(`Invalid key: ${a} (${typeof a})`);n.set(a,this.valueSchema.fromPreparedMsgpack(i,t.withMapValue(a)))}return n}prepareJSON(e,t){if(!(e instanceof Map))throw new Error(`ByteArrayMapSchema data must be a Map. Got (${typeof e}) ${e}`);const n=new Map;for(const[a,i]of e){if(!(a instanceof Uint8Array))throw new Error(`Invalid key: ${a} (${typeof a})`);const e=$(a);if(n.has(e))throw new Error(`Duplicate key (base64): ${e}`);n.set(e,this.valueSchema.prepareJSON(i,t))}const a={};for(const[e,t]of n)a[e]=t;return a}fromPreparedJSON(e){if(null==e||"object"!=typeof e||Array.isArray(e))throw new Error("ByteArrayMapSchema data must be an object");const t=new Map;for(const[n,a]of Object.entries(e))t.set(O(n),this.valueSchema.fromPreparedJSON(a));return t}}(ia.encodingSchema)},{key:"Txleases",valueSchema:new kt(new bt)},{key:"Creatables",valueSchema:new kt(new vt(ra.encodingSchema))},{key:"Hdr",valueSchema:Rn.encodingSchema},{key:"StateProofNext",valueSchema:new ht},{key:"PrevTimestamp",valueSchema:new ht},{key:"Totals",valueSchema:sa.encodingSchema}]));class ha{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new ct,omitEmpty:!0},{key:"amount",valueSchema:new ht,omitEmpty:!0},{key:"amount-without-pending-rewards",valueSchema:new ht,omitEmpty:!0},{key:"min-balance",valueSchema:new ht,omitEmpty:!0},{key:"pending-rewards",valueSchema:new ht,omitEmpty:!0},{key:"rewards",valueSchema:new ht,omitEmpty:!0},{key:"round",valueSchema:new ht,omitEmpty:!0},{key:"status",valueSchema:new ct,omitEmpty:!0},{key:"total-apps-opted-in",valueSchema:new ht,omitEmpty:!0},{key:"total-assets-opted-in",valueSchema:new ht,omitEmpty:!0},{key:"total-created-apps",valueSchema:new ht,omitEmpty:!0},{key:"total-created-assets",valueSchema:new ht,omitEmpty:!0},{key:"apps-local-state",valueSchema:new kt(new mt(Ea.encodingSchema)),omitEmpty:!0},{key:"apps-total-extra-pages",valueSchema:new kt(new ht),omitEmpty:!0},{key:"apps-total-schema",valueSchema:new kt(xa.encodingSchema),omitEmpty:!0},{key:"assets",valueSchema:new kt(new mt(Da.encodingSchema)),omitEmpty:!0},{key:"auth-addr",valueSchema:new kt(new ct),omitEmpty:!0},{key:"created-apps",valueSchema:new kt(new mt(ya.encodingSchema)),omitEmpty:!0},{key:"created-assets",valueSchema:new kt(new mt(Aa.encodingSchema)),omitEmpty:!0},{key:"incentive-eligible",valueSchema:new kt(new st),omitEmpty:!0},{key:"last-heartbeat",valueSchema:new kt(new ht),omitEmpty:!0},{key:"last-proposed",valueSchema:new kt(new ht),omitEmpty:!0},{key:"participation",valueSchema:new kt(ma.encodingSchema),omitEmpty:!0},{key:"reward-base",valueSchema:new kt(new ht),omitEmpty:!0},{key:"sig-type",valueSchema:new kt(new ct),omitEmpty:!0},{key:"total-box-bytes",valueSchema:new kt(new ht),omitEmpty:!0},{key:"total-boxes",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,amount:t,amountWithoutPendingRewards:n,minBalance:a,pendingRewards:i,rewards:r,round:o,status:s,totalAppsOptedIn:c,totalAssetsOptedIn:h,totalCreatedApps:d,totalCreatedAssets:u,appsLocalState:l,appsTotalExtraPages:g,appsTotalSchema:m,assets:p,authAddr:f,createdApps:y,createdAssets:w,incentiveEligible:S,lastHeartbeat:k,lastProposed:b,participation:x,rewardBase:A,sigType:D,totalBoxBytes:T,totalBoxes:I}){this.address=e,this.amount=E(t),this.amountWithoutPendingRewards=E(n),this.minBalance=E(a),this.pendingRewards=E(i),this.rewards=E(r),this.round=E(o),this.status=s,this.totalAppsOptedIn=v(c),this.totalAssetsOptedIn=v(h),this.totalCreatedApps=v(d),this.totalCreatedAssets=v(u),this.appsLocalState=l,this.appsTotalExtraPages=void 0===g?void 0:v(g),this.appsTotalSchema=m,this.assets=p,this.authAddr="string"==typeof f?G.fromString(f):f,this.createdApps=y,this.createdAssets=w,this.incentiveEligible=S,this.lastHeartbeat=void 0===k?void 0:v(k),this.lastProposed=void 0===b?void 0:v(b),this.participation=x,this.rewardBase=void 0===A?void 0:E(A),this.sigType=D,this.totalBoxBytes=void 0===T?void 0:v(T),this.totalBoxes=void 0===I?void 0:v(I)}getEncodingSchema(){return ha.encodingSchema}toEncodingData(){return new Map([["address",this.address],["amount",this.amount],["amount-without-pending-rewards",this.amountWithoutPendingRewards],["min-balance",this.minBalance],["pending-rewards",this.pendingRewards],["rewards",this.rewards],["round",this.round],["status",this.status],["total-apps-opted-in",this.totalAppsOptedIn],["total-assets-opted-in",this.totalAssetsOptedIn],["total-created-apps",this.totalCreatedApps],["total-created-assets",this.totalCreatedAssets],["apps-local-state",void 0!==this.appsLocalState?this.appsLocalState.map((e=>e.toEncodingData())):void 0],["apps-total-extra-pages",this.appsTotalExtraPages],["apps-total-schema",void 0!==this.appsTotalSchema?this.appsTotalSchema.toEncodingData():void 0],["assets",void 0!==this.assets?this.assets.map((e=>e.toEncodingData())):void 0],["auth-addr",void 0!==this.authAddr?this.authAddr.toString():void 0],["created-apps",void 0!==this.createdApps?this.createdApps.map((e=>e.toEncodingData())):void 0],["created-assets",void 0!==this.createdAssets?this.createdAssets.map((e=>e.toEncodingData())):void 0],["incentive-eligible",this.incentiveEligible],["last-heartbeat",this.lastHeartbeat],["last-proposed",this.lastProposed],["participation",void 0!==this.participation?this.participation.toEncodingData():void 0],["reward-base",this.rewardBase],["sig-type",this.sigType],["total-box-bytes",this.totalBoxBytes],["total-boxes",this.totalBoxes]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Account: ${e}`);return new ha({address:e.get("address"),amount:e.get("amount"),amountWithoutPendingRewards:e.get("amount-without-pending-rewards"),minBalance:e.get("min-balance"),pendingRewards:e.get("pending-rewards"),rewards:e.get("rewards"),round:e.get("round"),status:e.get("status"),totalAppsOptedIn:e.get("total-apps-opted-in"),totalAssetsOptedIn:e.get("total-assets-opted-in"),totalCreatedApps:e.get("total-created-apps"),totalCreatedAssets:e.get("total-created-assets"),appsLocalState:void 0!==e.get("apps-local-state")?e.get("apps-local-state").map((e=>Ea.fromEncodingData(e))):void 0,appsTotalExtraPages:e.get("apps-total-extra-pages"),appsTotalSchema:void 0!==e.get("apps-total-schema")?xa.fromEncodingData(e.get("apps-total-schema")):void 0,assets:void 0!==e.get("assets")?e.get("assets").map((e=>Da.fromEncodingData(e))):void 0,authAddr:e.get("auth-addr"),createdApps:void 0!==e.get("created-apps")?e.get("created-apps").map((e=>ya.fromEncodingData(e))):void 0,createdAssets:void 0!==e.get("created-assets")?e.get("created-assets").map((e=>Aa.fromEncodingData(e))):void 0,incentiveEligible:e.get("incentive-eligible"),lastHeartbeat:e.get("last-heartbeat"),lastProposed:e.get("last-proposed"),participation:void 0!==e.get("participation")?ma.fromEncodingData(e.get("participation")):void 0,rewardBase:e.get("reward-base"),sigType:e.get("sig-type"),totalBoxBytes:e.get("total-box-bytes"),totalBoxes:e.get("total-boxes")})}}class da{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new ht,omitEmpty:!0},{key:"app-local-state",valueSchema:new kt(Ea.encodingSchema),omitEmpty:!0},{key:"created-app",valueSchema:new kt(ka.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e,appLocalState:t,createdApp:n}){this.round=E(e),this.appLocalState=t,this.createdApp=n}getEncodingSchema(){return da.encodingSchema}toEncodingData(){return new Map([["round",this.round],["app-local-state",void 0!==this.appLocalState?this.appLocalState.toEncodingData():void 0],["created-app",void 0!==this.createdApp?this.createdApp.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountApplicationResponse: ${e}`);return new da({round:e.get("round"),appLocalState:void 0!==e.get("app-local-state")?Ea.fromEncodingData(e.get("app-local-state")):void 0,createdApp:void 0!==e.get("created-app")?ka.fromEncodingData(e.get("created-app")):void 0})}}class ua{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"asset-holding",valueSchema:Da.encodingSchema,omitEmpty:!0},{key:"asset-params",valueSchema:new kt(Ia.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({assetHolding:e,assetParams:t}){this.assetHolding=e,this.assetParams=t}getEncodingSchema(){return ua.encodingSchema}toEncodingData(){return new Map([["asset-holding",this.assetHolding.toEncodingData()],["asset-params",void 0!==this.assetParams?this.assetParams.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountAssetHolding: ${e}`);return new ua({assetHolding:Da.fromEncodingData(e.get("asset-holding")??new Map),assetParams:void 0!==e.get("asset-params")?Ia.fromEncodingData(e.get("asset-params")):void 0})}}class la{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new ht,omitEmpty:!0},{key:"asset-holding",valueSchema:new kt(Da.encodingSchema),omitEmpty:!0},{key:"created-asset",valueSchema:new kt(Ia.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e,assetHolding:t,createdAsset:n}){this.round=E(e),this.assetHolding=t,this.createdAsset=n}getEncodingSchema(){return la.encodingSchema}toEncodingData(){return new Map([["round",this.round],["asset-holding",void 0!==this.assetHolding?this.assetHolding.toEncodingData():void 0],["created-asset",void 0!==this.createdAsset?this.createdAsset.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountAssetResponse: ${e}`);return new la({round:e.get("round"),assetHolding:void 0!==e.get("asset-holding")?Da.fromEncodingData(e.get("asset-holding")):void 0,createdAsset:void 0!==e.get("created-asset")?Ia.fromEncodingData(e.get("created-asset")):void 0})}}class ga{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new ht,omitEmpty:!0},{key:"asset-holdings",valueSchema:new kt(new mt(ua.encodingSchema)),omitEmpty:!0},{key:"next-token",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e,assetHoldings:t,nextToken:n}){this.round=v(e),this.assetHoldings=t,this.nextToken=n}getEncodingSchema(){return ga.encodingSchema}toEncodingData(){return new Map([["round",this.round],["asset-holdings",void 0!==this.assetHoldings?this.assetHoldings.map((e=>e.toEncodingData())):void 0],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountAssetsInformationResponse: ${e}`);return new ga({round:e.get("round"),assetHoldings:void 0!==e.get("asset-holdings")?e.get("asset-holdings").map((e=>ua.fromEncodingData(e))):void 0,nextToken:e.get("next-token")})}}class ma{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"selection-participation-key",valueSchema:new ut,omitEmpty:!0},{key:"vote-first-valid",valueSchema:new ht,omitEmpty:!0},{key:"vote-key-dilution",valueSchema:new ht,omitEmpty:!0},{key:"vote-last-valid",valueSchema:new ht,omitEmpty:!0},{key:"vote-participation-key",valueSchema:new ut,omitEmpty:!0},{key:"state-proof-key",valueSchema:new kt(new ut),omitEmpty:!0})),this.encodingSchemaValue}constructor({selectionParticipationKey:e,voteFirstValid:t,voteKeyDilution:n,voteLastValid:a,voteParticipationKey:i,stateProofKey:r}){this.selectionParticipationKey="string"==typeof e?O(e):e,this.voteFirstValid=E(t),this.voteKeyDilution=E(n),this.voteLastValid=E(a),this.voteParticipationKey="string"==typeof i?O(i):i,this.stateProofKey="string"==typeof r?O(r):r}getEncodingSchema(){return ma.encodingSchema}toEncodingData(){return new Map([["selection-participation-key",this.selectionParticipationKey],["vote-first-valid",this.voteFirstValid],["vote-key-dilution",this.voteKeyDilution],["vote-last-valid",this.voteLastValid],["vote-participation-key",this.voteParticipationKey],["state-proof-key",this.stateProofKey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountParticipation: ${e}`);return new ma({selectionParticipationKey:e.get("selection-participation-key"),voteFirstValid:e.get("vote-first-valid"),voteKeyDilution:e.get("vote-key-dilution"),voteLastValid:e.get("vote-last-valid"),voteParticipationKey:e.get("vote-participation-key"),stateProofKey:e.get("state-proof-key")})}}class pa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new ct,omitEmpty:!0},{key:"delta",valueSchema:new mt(Wa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,delta:t}){this.address=e,this.delta=t}getEncodingSchema(){return pa.encodingSchema}toEncodingData(){return new Map([["address",this.address],["delta",this.delta.map((e=>e.toEncodingData()))]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountStateDelta: ${e}`);return new pa({address:e.get("address"),delta:(e.get("delta")??[]).map((e=>Wa.fromEncodingData(e)))})}}class fa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"application-index",valueSchema:new ht,omitEmpty:!0},{key:"logs",valueSchema:new mt(new ut),omitEmpty:!0},{key:"txId",valueSchema:new ct,omitEmpty:!0})),this.encodingSchemaValue}constructor({applicationIndex:e,logs:t,txid:n}){this.applicationIndex=v(e),this.logs=t,this.txid=n}getEncodingSchema(){return fa.encodingSchema}toEncodingData(){return new Map([["application-index",this.applicationIndex],["logs",this.logs],["txId",this.txid]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AppCallLogs: ${e}`);return new fa({applicationIndex:e.get("application-index"),logs:e.get("logs"),txid:e.get("txId")})}}class ya{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new ht,omitEmpty:!0},{key:"params",valueSchema:ka.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,params:t}){this.id=E(e),this.params=t}getEncodingSchema(){return ya.encodingSchema}toEncodingData(){return new Map([["id",this.id],["params",this.params.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Application: ${e}`);return new ya({id:e.get("id"),params:ka.fromEncodingData(e.get("params")??new Map)})}}class wa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new ht,omitEmpty:!0},{key:"app-boxes",valueSchema:new kt(va.encodingSchema),omitEmpty:!0},{key:"app-globals",valueSchema:new kt(va.encodingSchema),omitEmpty:!0},{key:"app-locals",valueSchema:new kt(new mt(va.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,appBoxes:t,appGlobals:n,appLocals:a}){this.id=E(e),this.appBoxes=t,this.appGlobals=n,this.appLocals=a}getEncodingSchema(){return wa.encodingSchema}toEncodingData(){return new Map([["id",this.id],["app-boxes",void 0!==this.appBoxes?this.appBoxes.toEncodingData():void 0],["app-globals",void 0!==this.appGlobals?this.appGlobals.toEncodingData():void 0],["app-locals",void 0!==this.appLocals?this.appLocals.map((e=>e.toEncodingData())):void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationInitialStates: ${e}`);return new wa({id:e.get("id"),appBoxes:void 0!==e.get("app-boxes")?va.fromEncodingData(e.get("app-boxes")):void 0,appGlobals:void 0!==e.get("app-globals")?va.fromEncodingData(e.get("app-globals")):void 0,appLocals:void 0!==e.get("app-locals")?e.get("app-locals").map((e=>va.fromEncodingData(e))):void 0})}}class va{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"kvs",valueSchema:new mt(Ma.encodingSchema),omitEmpty:!0},{key:"account",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({kvs:e,account:t}){this.kvs=e,this.account="string"==typeof t?G.fromString(t):t}getEncodingSchema(){return va.encodingSchema}toEncodingData(){return new Map([["kvs",this.kvs.map((e=>e.toEncodingData()))],["account",void 0!==this.account?this.account.toString():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationKVStorage: ${e}`);return new va({kvs:(e.get("kvs")??[]).map((e=>Ma.fromEncodingData(e))),account:e.get("account")})}}class Sa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"account",valueSchema:new ct,omitEmpty:!0},{key:"app",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({account:e,app:t}){this.account="string"==typeof e?G.fromString(e):e,this.app=E(t)}getEncodingSchema(){return Sa.encodingSchema}toEncodingData(){return new Map([["account",this.account.toString()],["app",this.app]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLocalReference: ${e}`);return new Sa({account:e.get("account"),app:e.get("app")})}}class Ea{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new ht,omitEmpty:!0},{key:"schema",valueSchema:xa.encodingSchema,omitEmpty:!0},{key:"key-value",valueSchema:new kt(new mt(Si.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,schema:t,keyValue:n}){this.id=E(e),this.schema=t,this.keyValue=n}getEncodingSchema(){return Ea.encodingSchema}toEncodingData(){return new Map([["id",this.id],["schema",this.schema.toEncodingData()],["key-value",void 0!==this.keyValue?this.keyValue.map((e=>e.toEncodingData())):void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLocalState: ${e}`);return new Ea({id:e.get("id"),schema:xa.fromEncodingData(e.get("schema")??new Map),keyValue:void 0!==e.get("key-value")?e.get("key-value").map((e=>Si.fromEncodingData(e))):void 0})}}class ka{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"approval-program",valueSchema:new ut,omitEmpty:!0},{key:"clear-state-program",valueSchema:new ut,omitEmpty:!0},{key:"creator",valueSchema:new ct,omitEmpty:!0},{key:"extra-program-pages",valueSchema:new kt(new ht),omitEmpty:!0},{key:"global-state",valueSchema:new kt(new mt(Si.encodingSchema)),omitEmpty:!0},{key:"global-state-schema",valueSchema:new kt(xa.encodingSchema),omitEmpty:!0},{key:"local-state-schema",valueSchema:new kt(xa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({approvalProgram:e,clearStateProgram:t,creator:n,extraProgramPages:a,globalState:i,globalStateSchema:r,localStateSchema:o}){this.approvalProgram="string"==typeof e?O(e):e,this.clearStateProgram="string"==typeof t?O(t):t,this.creator="string"==typeof n?G.fromString(n):n,this.extraProgramPages=void 0===a?void 0:v(a),this.globalState=i,this.globalStateSchema=r,this.localStateSchema=o}getEncodingSchema(){return ka.encodingSchema}toEncodingData(){return new Map([["approval-program",this.approvalProgram],["clear-state-program",this.clearStateProgram],["creator",this.creator.toString()],["extra-program-pages",this.extraProgramPages],["global-state",void 0!==this.globalState?this.globalState.map((e=>e.toEncodingData())):void 0],["global-state-schema",void 0!==this.globalStateSchema?this.globalStateSchema.toEncodingData():void 0],["local-state-schema",void 0!==this.localStateSchema?this.localStateSchema.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationParams: ${e}`);return new ka({approvalProgram:e.get("approval-program"),clearStateProgram:e.get("clear-state-program"),creator:e.get("creator"),extraProgramPages:e.get("extra-program-pages"),globalState:void 0!==e.get("global-state")?e.get("global-state").map((e=>Si.fromEncodingData(e))):void 0,globalStateSchema:void 0!==e.get("global-state-schema")?xa.fromEncodingData(e.get("global-state-schema")):void 0,localStateSchema:void 0!==e.get("local-state-schema")?xa.fromEncodingData(e.get("local-state-schema")):void 0})}}class ba{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"app-state-type",valueSchema:new ct,omitEmpty:!0},{key:"key",valueSchema:new ut,omitEmpty:!0},{key:"operation",valueSchema:new ct,omitEmpty:!0},{key:"account",valueSchema:new kt(new ct),omitEmpty:!0},{key:"new-value",valueSchema:new kt(Va.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({appStateType:e,key:t,operation:n,account:a,newValue:i}){this.appStateType=e,this.key="string"==typeof t?O(t):t,this.operation=n,this.account="string"==typeof a?G.fromString(a):a,this.newValue=i}getEncodingSchema(){return ba.encodingSchema}toEncodingData(){return new Map([["app-state-type",this.appStateType],["key",this.key],["operation",this.operation],["account",void 0!==this.account?this.account.toString():void 0],["new-value",void 0!==this.newValue?this.newValue.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationStateOperation: ${e}`);return new ba({appStateType:e.get("app-state-type"),key:e.get("key"),operation:e.get("operation"),account:e.get("account"),newValue:void 0!==e.get("new-value")?Va.fromEncodingData(e.get("new-value")):void 0})}}class xa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"num-byte-slice",valueSchema:new ht,omitEmpty:!0},{key:"num-uint",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({numByteSlice:e,numUint:t}){this.numByteSlice=v(e),this.numUint=v(t)}getEncodingSchema(){return xa.encodingSchema}toEncodingData(){return new Map([["num-byte-slice",this.numByteSlice],["num-uint",this.numUint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationStateSchema: ${e}`);return new xa({numByteSlice:e.get("num-byte-slice"),numUint:e.get("num-uint")})}}class Aa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"index",valueSchema:new ht,omitEmpty:!0},{key:"params",valueSchema:Ia.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({index:e,params:t}){this.index=E(e),this.params=t}getEncodingSchema(){return Aa.encodingSchema}toEncodingData(){return new Map([["index",this.index],["params",this.params.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Asset: ${e}`);return new Aa({index:e.get("index"),params:Ia.fromEncodingData(e.get("params")??new Map)})}}class Da{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"amount",valueSchema:new ht,omitEmpty:!0},{key:"asset-id",valueSchema:new ht,omitEmpty:!0},{key:"is-frozen",valueSchema:new st,omitEmpty:!0})),this.encodingSchemaValue}constructor({amount:e,assetId:t,isFrozen:n}){this.amount=E(e),this.assetId=E(t),this.isFrozen=n}getEncodingSchema(){return Da.encodingSchema}toEncodingData(){return new Map([["amount",this.amount],["asset-id",this.assetId],["is-frozen",this.isFrozen]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHolding: ${e}`);return new Da({amount:e.get("amount"),assetId:e.get("asset-id"),isFrozen:e.get("is-frozen")})}}class Ta{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"account",valueSchema:new ct,omitEmpty:!0},{key:"asset",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({account:e,asset:t}){this.account="string"==typeof e?G.fromString(e):e,this.asset=E(t)}getEncodingSchema(){return Ta.encodingSchema}toEncodingData(){return new Map([["account",this.account.toString()],["asset",this.asset]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHoldingReference: ${e}`);return new Ta({account:e.get("account"),asset:e.get("asset")})}}class Ia{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"creator",valueSchema:new ct,omitEmpty:!0},{key:"decimals",valueSchema:new ht,omitEmpty:!0},{key:"total",valueSchema:new ht,omitEmpty:!0},{key:"clawback",valueSchema:new kt(new ct),omitEmpty:!0},{key:"default-frozen",valueSchema:new kt(new st),omitEmpty:!0},{key:"freeze",valueSchema:new kt(new ct),omitEmpty:!0},{key:"manager",valueSchema:new kt(new ct),omitEmpty:!0},{key:"metadata-hash",valueSchema:new kt(new ut),omitEmpty:!0},{key:"name",valueSchema:new kt(new ct),omitEmpty:!0},{key:"name-b64",valueSchema:new kt(new ut),omitEmpty:!0},{key:"reserve",valueSchema:new kt(new ct),omitEmpty:!0},{key:"unit-name",valueSchema:new kt(new ct),omitEmpty:!0},{key:"unit-name-b64",valueSchema:new kt(new ut),omitEmpty:!0},{key:"url",valueSchema:new kt(new ct),omitEmpty:!0},{key:"url-b64",valueSchema:new kt(new ut),omitEmpty:!0})),this.encodingSchemaValue}constructor({creator:e,decimals:t,total:n,clawback:a,defaultFrozen:i,freeze:r,manager:o,metadataHash:s,name:c,nameB64:h,reserve:d,unitName:u,unitNameB64:l,url:g,urlB64:m}){this.creator=e,this.decimals=v(t),this.total=E(n),this.clawback=a,this.defaultFrozen=i,this.freeze=r,this.manager=o,this.metadataHash="string"==typeof s?O(s):s,this.name=c,this.nameB64="string"==typeof h?O(h):h,this.reserve=d,this.unitName=u,this.unitNameB64="string"==typeof l?O(l):l,this.url=g,this.urlB64="string"==typeof m?O(m):m}getEncodingSchema(){return Ia.encodingSchema}toEncodingData(){return new Map([["creator",this.creator],["decimals",this.decimals],["total",this.total],["clawback",this.clawback],["default-frozen",this.defaultFrozen],["freeze",this.freeze],["manager",this.manager],["metadata-hash",this.metadataHash],["name",this.name],["name-b64",this.nameB64],["reserve",this.reserve],["unit-name",this.unitName],["unit-name-b64",this.unitNameB64],["url",this.url],["url-b64",this.urlB64]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetParams: ${e}`);return new Ia({creator:e.get("creator"),decimals:e.get("decimals"),total:e.get("total"),clawback:e.get("clawback"),defaultFrozen:e.get("default-frozen"),freeze:e.get("freeze"),manager:e.get("manager"),metadataHash:e.get("metadata-hash"),name:e.get("name"),nameB64:e.get("name-b64"),reserve:e.get("reserve"),unitName:e.get("unit-name"),unitNameB64:e.get("unit-name-b64"),url:e.get("url"),urlB64:e.get("url-b64")})}}class Ma{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new ut,omitEmpty:!0},{key:"value",valueSchema:Va.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key="string"==typeof e?O(e):e,this.value=t}getEncodingSchema(){return Ma.encodingSchema}toEncodingData(){return new Map([["key",this.key],["value",this.value.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AvmKeyValue: ${e}`);return new Ma({key:e.get("key"),value:Va.fromEncodingData(e.get("value")??new Map)})}}class Va{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"type",valueSchema:new ht,omitEmpty:!0},{key:"bytes",valueSchema:new kt(new ut),omitEmpty:!0},{key:"uint",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({type:e,bytes:t,uint:n}){this.type=v(e),this.bytes="string"==typeof t?O(t):t,this.uint=void 0===n?void 0:E(n)}getEncodingSchema(){return Va.encodingSchema}toEncodingData(){return new Map([["type",this.type],["bytes",this.bytes],["uint",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AvmValue: ${e}`);return new Va({type:e.get("type"),bytes:e.get("bytes"),uint:e.get("uint")})}}class Pa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"blockHash",valueSchema:new ct,omitEmpty:!0})),this.encodingSchemaValue}constructor({blockhash:e}){this.blockhash=e}getEncodingSchema(){return Pa.encodingSchema}toEncodingData(){return new Map([["blockHash",this.blockhash]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockHashResponse: ${e}`);return new Pa({blockhash:e.get("blockHash")})}}class Ra{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"logs",valueSchema:new mt(fa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({logs:e}){this.logs=e}getEncodingSchema(){return Ra.encodingSchema}toEncodingData(){return new Map([["logs",this.logs.map((e=>e.toEncodingData()))]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockLogsResponse: ${e}`);return new Ra({logs:(e.get("logs")??[]).map((e=>fa.fromEncodingData(e)))})}}class Ba{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"block",valueSchema:Nn.encodingSchema,omitEmpty:!0},{key:"cert",valueSchema:new kt(Ln.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({block:e,cert:t}){this.block=e,this.cert=t}getEncodingSchema(){return Ba.encodingSchema}toEncodingData(){return new Map([["block",this.block.toEncodingData()],["cert",void 0!==this.cert?this.cert.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockResponse: ${e}`);return new Ba({block:Nn.fromEncodingData(e.get("block")??new Map),cert:void 0!==e.get("cert")?Ln.fromEncodingData(e.get("cert")):void 0})}}class Ca{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"blockTxids",valueSchema:new mt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({blocktxids:e}){this.blocktxids=e}getEncodingSchema(){return Ca.encodingSchema}toEncodingData(){return new Map([["blockTxids",this.blocktxids]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockTxidsResponse: ${e}`);return new Ca({blocktxids:e.get("blockTxids")})}}class Ua{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"name",valueSchema:new ut,omitEmpty:!0},{key:"round",valueSchema:new ht,omitEmpty:!0},{key:"value",valueSchema:new ut,omitEmpty:!0})),this.encodingSchemaValue}constructor({name:e,round:t,value:n}){this.name="string"==typeof e?O(e):e,this.round=E(t),this.value="string"==typeof n?O(n):n}getEncodingSchema(){return Ua.encodingSchema}toEncodingData(){return new Map([["name",this.name],["round",this.round],["value",this.value]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Box: ${e}`);return new Ua({name:e.get("name"),round:e.get("round"),value:e.get("value")})}}class Oa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"name",valueSchema:new ut,omitEmpty:!0})),this.encodingSchemaValue}constructor({name:e}){this.name="string"==typeof e?O(e):e}getEncodingSchema(){return Oa.encodingSchema}toEncodingData(){return new Map([["name",this.name]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxDescriptor: ${e}`);return new Oa({name:e.get("name")})}}class $a{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"app",valueSchema:new ht,omitEmpty:!0},{key:"name",valueSchema:new ut,omitEmpty:!0})),this.encodingSchemaValue}constructor({app:e,name:t}){this.app=E(e),this.name="string"==typeof t?O(t):t}getEncodingSchema(){return $a.encodingSchema}toEncodingData(){return new Map([["app",this.app],["name",this.name]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxReference: ${e}`);return new $a({app:e.get("app"),name:e.get("name")})}}class Na{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"boxes",valueSchema:new mt(Oa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({boxes:e}){this.boxes=e}getEncodingSchema(){return Na.encodingSchema}toEncodingData(){return new Map([["boxes",this.boxes.map((e=>e.toEncodingData()))]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxesResponse: ${e}`);return new Na({boxes:(e.get("boxes")??[]).map((e=>Oa.fromEncodingData(e)))})}}class La{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"branch",valueSchema:new ct,omitEmpty:!0},{key:"build_number",valueSchema:new ht,omitEmpty:!0},{key:"channel",valueSchema:new ct,omitEmpty:!0},{key:"commit_hash",valueSchema:new ct,omitEmpty:!0},{key:"major",valueSchema:new ht,omitEmpty:!0},{key:"minor",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({branch:e,buildNumber:t,channel:n,commitHash:a,major:i,minor:r}){this.branch=e,this.buildNumber=v(t),this.channel=n,this.commitHash=a,this.major=v(i),this.minor=v(r)}getEncodingSchema(){return La.encodingSchema}toEncodingData(){return new Map([["branch",this.branch],["build_number",this.buildNumber],["channel",this.channel],["commit_hash",this.commitHash],["major",this.major],["minor",this.minor]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BuildVersion: ${e}`);return new La({branch:e.get("branch"),buildNumber:e.get("build_number"),channel:e.get("channel"),commitHash:e.get("commit_hash"),major:e.get("major"),minor:e.get("minor")})}}class _a{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"hash",valueSchema:new ct,omitEmpty:!0},{key:"result",valueSchema:new ct,omitEmpty:!0},{key:"sourcemap",valueSchema:new kt(Ln.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({hash:e,result:t,sourcemap:n}){this.hash=e,this.result=t,this.sourcemap=n}getEncodingSchema(){return _a.encodingSchema}toEncodingData(){return new Map([["hash",this.hash],["result",this.result],["sourcemap",void 0!==this.sourcemap?this.sourcemap.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded CompileResponse: ${e}`);return new _a({hash:e.get("hash"),result:e.get("result"),sourcemap:void 0!==e.get("sourcemap")?Ln.fromEncodingData(e.get("sourcemap")):void 0})}}class za{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"result",valueSchema:new ct,omitEmpty:!0})),this.encodingSchemaValue}constructor({result:e}){this.result=e}getEncodingSchema(){return za.encodingSchema}toEncodingData(){return new Map([["result",this.result]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded DisassembleResponse: ${e}`);return new za({result:e.get("result")})}}class Fa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"accounts",valueSchema:new mt(ha.encodingSchema),omitEmpty:!0},{key:"apps",valueSchema:new mt(ya.encodingSchema),omitEmpty:!0},{key:"latest-timestamp",valueSchema:new ht,omitEmpty:!0},{key:"protocol-version",valueSchema:new ct,omitEmpty:!0},{key:"round",valueSchema:new ht,omitEmpty:!0},{key:"sources",valueSchema:new mt(qa.encodingSchema),omitEmpty:!0},{key:"txns",valueSchema:new mt(bn.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({accounts:e,apps:t,latestTimestamp:n,protocolVersion:a,round:i,sources:r,txns:o}){this.accounts=e,this.apps=t,this.latestTimestamp=v(n),this.protocolVersion=a,this.round=E(i),this.sources=r,this.txns=o}getEncodingSchema(){return Fa.encodingSchema}toEncodingData(){return new Map([["accounts",this.accounts.map((e=>e.toEncodingData()))],["apps",this.apps.map((e=>e.toEncodingData()))],["latest-timestamp",this.latestTimestamp],["protocol-version",this.protocolVersion],["round",this.round],["sources",this.sources.map((e=>e.toEncodingData()))],["txns",this.txns.map((e=>e.toEncodingData()))]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded DryrunRequest: ${e}`);return new Fa({accounts:(e.get("accounts")??[]).map((e=>ha.fromEncodingData(e))),apps:(e.get("apps")??[]).map((e=>ya.fromEncodingData(e))),latestTimestamp:e.get("latest-timestamp"),protocolVersion:e.get("protocol-version"),round:e.get("round"),sources:(e.get("sources")??[]).map((e=>qa.fromEncodingData(e))),txns:(e.get("txns")??[]).map((e=>bn.fromEncodingData(e)))})}}class Ka{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"error",valueSchema:new ct,omitEmpty:!0},{key:"protocol-version",valueSchema:new ct,omitEmpty:!0},{key:"txns",valueSchema:new mt(ja.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({error:e,protocolVersion:t,txns:n}){this.error=e,this.protocolVersion=t,this.txns=n}getEncodingSchema(){return Ka.encodingSchema}toEncodingData(){return new Map([["error",this.error],["protocol-version",this.protocolVersion],["txns",this.txns.map((e=>e.toEncodingData()))]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded DryrunResponse: ${e}`);return new Ka({error:e.get("error"),protocolVersion:e.get("protocol-version"),txns:(e.get("txns")??[]).map((e=>ja.fromEncodingData(e)))})}}class qa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"app-index",valueSchema:new ht,omitEmpty:!0},{key:"field-name",valueSchema:new ct,omitEmpty:!0},{key:"source",valueSchema:new ct,omitEmpty:!0},{key:"txn-index",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({appIndex:e,fieldName:t,source:n,txnIndex:a}){this.appIndex=E(e),this.fieldName=t,this.source=n,this.txnIndex=v(a)}getEncodingSchema(){return qa.encodingSchema}toEncodingData(){return new Map([["app-index",this.appIndex],["field-name",this.fieldName],["source",this.source],["txn-index",this.txnIndex]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded DryrunSource: ${e}`);return new qa({appIndex:e.get("app-index"),fieldName:e.get("field-name"),source:e.get("source"),txnIndex:e.get("txn-index")})}}class Ha{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"line",valueSchema:new ht,omitEmpty:!0},{key:"pc",valueSchema:new ht,omitEmpty:!0},{key:"stack",valueSchema:new mt(Ei.encodingSchema),omitEmpty:!0},{key:"error",valueSchema:new kt(new ct),omitEmpty:!0},{key:"scratch",valueSchema:new kt(new mt(Ei.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({line:e,pc:t,stack:n,error:a,scratch:i}){this.line=v(e),this.pc=v(t),this.stack=n,this.error=a,this.scratch=i}getEncodingSchema(){return Ha.encodingSchema}toEncodingData(){return new Map([["line",this.line],["pc",this.pc],["stack",this.stack.map((e=>e.toEncodingData()))],["error",this.error],["scratch",void 0!==this.scratch?this.scratch.map((e=>e.toEncodingData())):void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded DryrunState: ${e}`);return new Ha({line:e.get("line"),pc:e.get("pc"),stack:(e.get("stack")??[]).map((e=>Ei.fromEncodingData(e))),error:e.get("error"),scratch:void 0!==e.get("scratch")?e.get("scratch").map((e=>Ei.fromEncodingData(e))):void 0})}}class ja{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"disassembly",valueSchema:new mt(new ct),omitEmpty:!0},{key:"app-call-messages",valueSchema:new kt(new mt(new ct)),omitEmpty:!0},{key:"app-call-trace",valueSchema:new kt(new mt(Ha.encodingSchema)),omitEmpty:!0},{key:"budget-added",valueSchema:new kt(new ht),omitEmpty:!0},{key:"budget-consumed",valueSchema:new kt(new ht),omitEmpty:!0},{key:"global-delta",valueSchema:new kt(new mt(Wa.encodingSchema)),omitEmpty:!0},{key:"local-deltas",valueSchema:new kt(new mt(pa.encodingSchema)),omitEmpty:!0},{key:"logic-sig-disassembly",valueSchema:new kt(new mt(new ct)),omitEmpty:!0},{key:"logic-sig-messages",valueSchema:new kt(new mt(new ct)),omitEmpty:!0},{key:"logic-sig-trace",valueSchema:new kt(new mt(Ha.encodingSchema)),omitEmpty:!0},{key:"logs",valueSchema:new kt(new mt(new ut)),omitEmpty:!0})),this.encodingSchemaValue}constructor({disassembly:e,appCallMessages:t,appCallTrace:n,budgetAdded:a,budgetConsumed:i,globalDelta:r,localDeltas:o,logicSigDisassembly:s,logicSigMessages:c,logicSigTrace:h,logs:d}){this.disassembly=e,this.appCallMessages=t,this.appCallTrace=n,this.budgetAdded=void 0===a?void 0:v(a),this.budgetConsumed=void 0===i?void 0:v(i),this.globalDelta=r,this.localDeltas=o,this.logicSigDisassembly=s,this.logicSigMessages=c,this.logicSigTrace=h,this.logs=d}getEncodingSchema(){return ja.encodingSchema}toEncodingData(){return new Map([["disassembly",this.disassembly],["app-call-messages",this.appCallMessages],["app-call-trace",void 0!==this.appCallTrace?this.appCallTrace.map((e=>e.toEncodingData())):void 0],["budget-added",this.budgetAdded],["budget-consumed",this.budgetConsumed],["global-delta",void 0!==this.globalDelta?this.globalDelta.map((e=>e.toEncodingData())):void 0],["local-deltas",void 0!==this.localDeltas?this.localDeltas.map((e=>e.toEncodingData())):void 0],["logic-sig-disassembly",this.logicSigDisassembly],["logic-sig-messages",this.logicSigMessages],["logic-sig-trace",void 0!==this.logicSigTrace?this.logicSigTrace.map((e=>e.toEncodingData())):void 0],["logs",this.logs]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded DryrunTxnResult: ${e}`);return new ja({disassembly:e.get("disassembly"),appCallMessages:e.get("app-call-messages"),appCallTrace:void 0!==e.get("app-call-trace")?e.get("app-call-trace").map((e=>Ha.fromEncodingData(e))):void 0,budgetAdded:e.get("budget-added"),budgetConsumed:e.get("budget-consumed"),globalDelta:void 0!==e.get("global-delta")?e.get("global-delta").map((e=>Wa.fromEncodingData(e))):void 0,localDeltas:void 0!==e.get("local-deltas")?e.get("local-deltas").map((e=>pa.fromEncodingData(e))):void 0,logicSigDisassembly:e.get("logic-sig-disassembly"),logicSigMessages:e.get("logic-sig-messages"),logicSigTrace:void 0!==e.get("logic-sig-trace")?e.get("logic-sig-trace").map((e=>Ha.fromEncodingData(e))):void 0,logs:e.get("logs")})}}class Ga{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"message",valueSchema:new ct,omitEmpty:!0},{key:"data",valueSchema:new kt(Ln.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({message:e,data:t}){this.message=e,this.data=t}getEncodingSchema(){return Ga.encodingSchema}toEncodingData(){return new Map([["message",this.message],["data",void 0!==this.data?this.data.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ErrorResponse: ${e}`);return new Ga({message:e.get("message"),data:void 0!==e.get("data")?Ln.fromEncodingData(e.get("data")):void 0})}}class Ja{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"action",valueSchema:new ht,omitEmpty:!0},{key:"bytes",valueSchema:new kt(new ct),omitEmpty:!0},{key:"uint",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({action:e,bytes:t,uint:n}){this.action=v(e),this.bytes=t,this.uint=void 0===n?void 0:E(n)}getEncodingSchema(){return Ja.encodingSchema}toEncodingData(){return new Map([["action",this.action],["bytes",this.bytes],["uint",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EvalDelta: ${e}`);return new Ja({action:e.get("action"),bytes:e.get("bytes"),uint:e.get("uint")})}}class Wa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new ct,omitEmpty:!0},{key:"value",valueSchema:Ja.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key=e,this.value=t}getEncodingSchema(){return Wa.encodingSchema}toEncodingData(){return new Map([["key",this.key],["value",this.value.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EvalDeltaKeyValue: ${e}`);return new Wa({key:e.get("key"),value:Ja.fromEncodingData(e.get("value")??new Map)})}}class Ya{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"offset",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({offset:e}){this.offset=v(e)}getEncodingSchema(){return Ya.encodingSchema}toEncodingData(){return new Map([["offset",this.offset]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded GetBlockTimeStampOffsetResponse: ${e}`);return new Ya({offset:e.get("offset")})}}class Xa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"round",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({round:e}){this.round=E(e)}getEncodingSchema(){return Xa.encodingSchema}toEncodingData(){return new Map([["round",this.round]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded GetSyncRoundResponse: ${e}`);return new Xa({round:e.get("round")})}}class Za{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new kt(new ut),omitEmpty:!0},{key:"value",valueSchema:new kt(new ut),omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key="string"==typeof e?O(e):e,this.value="string"==typeof t?O(t):t}getEncodingSchema(){return Za.encodingSchema}toEncodingData(){return new Map([["key",this.key],["value",this.value]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded KvDelta: ${e}`);return new Za({key:e.get("key"),value:e.get("value")})}}class Qa{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"Delta",valueSchema:ca.encodingSchema,omitEmpty:!0},{key:"Ids",valueSchema:new mt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({delta:e,ids:t}){this.delta=e,this.ids=t}getEncodingSchema(){return Qa.encodingSchema}toEncodingData(){return new Map([["Delta",this.delta.toEncodingData()],["Ids",this.ids]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded LedgerStateDeltaForTransactionGroup: ${e}`);return new Qa({delta:ca.fromEncodingData(e.get("Delta")??new Map),ids:e.get("Ids")})}}class ei{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"index",valueSchema:new ht,omitEmpty:!0},{key:"proof",valueSchema:new ut,omitEmpty:!0},{key:"treedepth",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({index:e,proof:t,treedepth:n}){this.index=v(e),this.proof="string"==typeof t?O(t):t,this.treedepth=v(n)}getEncodingSchema(){return ei.encodingSchema}toEncodingData(){return new Map([["index",this.index],["proof",this.proof],["treedepth",this.treedepth]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded LightBlockHeaderProof: ${e}`);return new ei({index:e.get("index"),proof:e.get("proof"),treedepth:e.get("treedepth")})}}class ti{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"catchup-time",valueSchema:new ht,omitEmpty:!0},{key:"last-round",valueSchema:new ht,omitEmpty:!0},{key:"last-version",valueSchema:new ct,omitEmpty:!0},{key:"next-version",valueSchema:new ct,omitEmpty:!0},{key:"next-version-round",valueSchema:new ht,omitEmpty:!0},{key:"next-version-supported",valueSchema:new st,omitEmpty:!0},{key:"stopped-at-unsupported-round",valueSchema:new st,omitEmpty:!0},{key:"time-since-last-round",valueSchema:new ht,omitEmpty:!0},{key:"catchpoint",valueSchema:new kt(new ct),omitEmpty:!0},{key:"catchpoint-acquired-blocks",valueSchema:new kt(new ht),omitEmpty:!0},{key:"catchpoint-processed-accounts",valueSchema:new kt(new ht),omitEmpty:!0},{key:"catchpoint-processed-kvs",valueSchema:new kt(new ht),omitEmpty:!0},{key:"catchpoint-total-accounts",valueSchema:new kt(new ht),omitEmpty:!0},{key:"catchpoint-total-blocks",valueSchema:new kt(new ht),omitEmpty:!0},{key:"catchpoint-total-kvs",valueSchema:new kt(new ht),omitEmpty:!0},{key:"catchpoint-verified-accounts",valueSchema:new kt(new ht),omitEmpty:!0},{key:"catchpoint-verified-kvs",valueSchema:new kt(new ht),omitEmpty:!0},{key:"last-catchpoint",valueSchema:new kt(new ct),omitEmpty:!0},{key:"upgrade-delay",valueSchema:new kt(new ht),omitEmpty:!0},{key:"upgrade-next-protocol-vote-before",valueSchema:new kt(new ht),omitEmpty:!0},{key:"upgrade-no-votes",valueSchema:new kt(new ht),omitEmpty:!0},{key:"upgrade-node-vote",valueSchema:new kt(new st),omitEmpty:!0},{key:"upgrade-vote-rounds",valueSchema:new kt(new ht),omitEmpty:!0},{key:"upgrade-votes",valueSchema:new kt(new ht),omitEmpty:!0},{key:"upgrade-votes-required",valueSchema:new kt(new ht),omitEmpty:!0},{key:"upgrade-yes-votes",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({catchupTime:e,lastRound:t,lastVersion:n,nextVersion:a,nextVersionRound:i,nextVersionSupported:r,stoppedAtUnsupportedRound:o,timeSinceLastRound:s,catchpoint:c,catchpointAcquiredBlocks:h,catchpointProcessedAccounts:d,catchpointProcessedKvs:u,catchpointTotalAccounts:l,catchpointTotalBlocks:g,catchpointTotalKvs:m,catchpointVerifiedAccounts:p,catchpointVerifiedKvs:f,lastCatchpoint:y,upgradeDelay:w,upgradeNextProtocolVoteBefore:S,upgradeNoVotes:k,upgradeNodeVote:b,upgradeVoteRounds:x,upgradeVotes:A,upgradeVotesRequired:D,upgradeYesVotes:T}){this.catchupTime=E(e),this.lastRound=E(t),this.lastVersion=n,this.nextVersion=a,this.nextVersionRound=E(i),this.nextVersionSupported=r,this.stoppedAtUnsupportedRound=o,this.timeSinceLastRound=E(s),this.catchpoint=c,this.catchpointAcquiredBlocks=void 0===h?void 0:v(h),this.catchpointProcessedAccounts=void 0===d?void 0:v(d),this.catchpointProcessedKvs=void 0===u?void 0:v(u),this.catchpointTotalAccounts=void 0===l?void 0:v(l),this.catchpointTotalBlocks=void 0===g?void 0:v(g),this.catchpointTotalKvs=void 0===m?void 0:v(m),this.catchpointVerifiedAccounts=void 0===p?void 0:v(p),this.catchpointVerifiedKvs=void 0===f?void 0:v(f),this.lastCatchpoint=y,this.upgradeDelay=void 0===w?void 0:E(w),this.upgradeNextProtocolVoteBefore=void 0===S?void 0:E(S),this.upgradeNoVotes=void 0===k?void 0:v(k),this.upgradeNodeVote=b,this.upgradeVoteRounds=void 0===x?void 0:v(x),this.upgradeVotes=void 0===A?void 0:v(A),this.upgradeVotesRequired=void 0===D?void 0:v(D),this.upgradeYesVotes=void 0===T?void 0:v(T)}getEncodingSchema(){return ti.encodingSchema}toEncodingData(){return new Map([["catchup-time",this.catchupTime],["last-round",this.lastRound],["last-version",this.lastVersion],["next-version",this.nextVersion],["next-version-round",this.nextVersionRound],["next-version-supported",this.nextVersionSupported],["stopped-at-unsupported-round",this.stoppedAtUnsupportedRound],["time-since-last-round",this.timeSinceLastRound],["catchpoint",this.catchpoint],["catchpoint-acquired-blocks",this.catchpointAcquiredBlocks],["catchpoint-processed-accounts",this.catchpointProcessedAccounts],["catchpoint-processed-kvs",this.catchpointProcessedKvs],["catchpoint-total-accounts",this.catchpointTotalAccounts],["catchpoint-total-blocks",this.catchpointTotalBlocks],["catchpoint-total-kvs",this.catchpointTotalKvs],["catchpoint-verified-accounts",this.catchpointVerifiedAccounts],["catchpoint-verified-kvs",this.catchpointVerifiedKvs],["last-catchpoint",this.lastCatchpoint],["upgrade-delay",this.upgradeDelay],["upgrade-next-protocol-vote-before",this.upgradeNextProtocolVoteBefore],["upgrade-no-votes",this.upgradeNoVotes],["upgrade-node-vote",this.upgradeNodeVote],["upgrade-vote-rounds",this.upgradeVoteRounds],["upgrade-votes",this.upgradeVotes],["upgrade-votes-required",this.upgradeVotesRequired],["upgrade-yes-votes",this.upgradeYesVotes]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded NodeStatusResponse: ${e}`);return new ti({catchupTime:e.get("catchup-time"),lastRound:e.get("last-round"),lastVersion:e.get("last-version"),nextVersion:e.get("next-version"),nextVersionRound:e.get("next-version-round"),nextVersionSupported:e.get("next-version-supported"),stoppedAtUnsupportedRound:e.get("stopped-at-unsupported-round"),timeSinceLastRound:e.get("time-since-last-round"),catchpoint:e.get("catchpoint"),catchpointAcquiredBlocks:e.get("catchpoint-acquired-blocks"),catchpointProcessedAccounts:e.get("catchpoint-processed-accounts"),catchpointProcessedKvs:e.get("catchpoint-processed-kvs"),catchpointTotalAccounts:e.get("catchpoint-total-accounts"),catchpointTotalBlocks:e.get("catchpoint-total-blocks"),catchpointTotalKvs:e.get("catchpoint-total-kvs"),catchpointVerifiedAccounts:e.get("catchpoint-verified-accounts"),catchpointVerifiedKvs:e.get("catchpoint-verified-kvs"),lastCatchpoint:e.get("last-catchpoint"),upgradeDelay:e.get("upgrade-delay"),upgradeNextProtocolVoteBefore:e.get("upgrade-next-protocol-vote-before"),upgradeNoVotes:e.get("upgrade-no-votes"),upgradeNodeVote:e.get("upgrade-node-vote"),upgradeVoteRounds:e.get("upgrade-vote-rounds"),upgradeVotes:e.get("upgrade-votes"),upgradeVotesRequired:e.get("upgrade-votes-required"),upgradeYesVotes:e.get("upgrade-yes-votes")})}}class ni{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"pool-error",valueSchema:new ct,omitEmpty:!0},{key:"txn",valueSchema:bn.encodingSchema,omitEmpty:!0},{key:"application-index",valueSchema:new kt(new ht),omitEmpty:!0},{key:"asset-closing-amount",valueSchema:new kt(new ht),omitEmpty:!0},{key:"asset-index",valueSchema:new kt(new ht),omitEmpty:!0},{key:"close-rewards",valueSchema:new kt(new ht),omitEmpty:!0},{key:"closing-amount",valueSchema:new kt(new ht),omitEmpty:!0},{key:"confirmed-round",valueSchema:new kt(new ht),omitEmpty:!0},{key:"global-state-delta",valueSchema:new kt(new mt(Wa.encodingSchema)),omitEmpty:!0},{key:"inner-txns",valueSchema:new kt(new mt(ni.encodingSchema)),omitEmpty:!0},{key:"local-state-delta",valueSchema:new kt(new mt(pa.encodingSchema)),omitEmpty:!0},{key:"logs",valueSchema:new kt(new mt(new ut)),omitEmpty:!0},{key:"receiver-rewards",valueSchema:new kt(new ht),omitEmpty:!0},{key:"sender-rewards",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({poolError:e,txn:t,applicationIndex:n,assetClosingAmount:a,assetIndex:i,closeRewards:r,closingAmount:o,confirmedRound:s,globalStateDelta:c,innerTxns:h,localStateDelta:d,logs:u,receiverRewards:l,senderRewards:g}){this.poolError=e,this.txn=t,this.applicationIndex=void 0===n?void 0:E(n),this.assetClosingAmount=void 0===a?void 0:E(a),this.assetIndex=void 0===i?void 0:E(i),this.closeRewards=void 0===r?void 0:E(r),this.closingAmount=void 0===o?void 0:E(o),this.confirmedRound=void 0===s?void 0:E(s),this.globalStateDelta=c,this.innerTxns=h,this.localStateDelta=d,this.logs=u,this.receiverRewards=void 0===l?void 0:E(l),this.senderRewards=void 0===g?void 0:E(g)}getEncodingSchema(){return ni.encodingSchema}toEncodingData(){return new Map([["pool-error",this.poolError],["txn",this.txn.toEncodingData()],["application-index",this.applicationIndex],["asset-closing-amount",this.assetClosingAmount],["asset-index",this.assetIndex],["close-rewards",this.closeRewards],["closing-amount",this.closingAmount],["confirmed-round",this.confirmedRound],["global-state-delta",void 0!==this.globalStateDelta?this.globalStateDelta.map((e=>e.toEncodingData())):void 0],["inner-txns",void 0!==this.innerTxns?this.innerTxns.map((e=>e.toEncodingData())):void 0],["local-state-delta",void 0!==this.localStateDelta?this.localStateDelta.map((e=>e.toEncodingData())):void 0],["logs",this.logs],["receiver-rewards",this.receiverRewards],["sender-rewards",this.senderRewards]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded PendingTransactionResponse: ${e}`);return new ni({poolError:e.get("pool-error"),txn:bn.fromEncodingData(e.get("txn")??new Map),applicationIndex:e.get("application-index"),assetClosingAmount:e.get("asset-closing-amount"),assetIndex:e.get("asset-index"),closeRewards:e.get("close-rewards"),closingAmount:e.get("closing-amount"),confirmedRound:e.get("confirmed-round"),globalStateDelta:void 0!==e.get("global-state-delta")?e.get("global-state-delta").map((e=>Wa.fromEncodingData(e))):void 0,innerTxns:void 0!==e.get("inner-txns")?e.get("inner-txns").map((e=>ni.fromEncodingData(e))):void 0,localStateDelta:void 0!==e.get("local-state-delta")?e.get("local-state-delta").map((e=>pa.fromEncodingData(e))):void 0,logs:e.get("logs"),receiverRewards:e.get("receiver-rewards"),senderRewards:e.get("sender-rewards")})}}class ai{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"top-transactions",valueSchema:new mt(bn.encodingSchema),omitEmpty:!0},{key:"total-transactions",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({topTransactions:e,totalTransactions:t}){this.topTransactions=e,this.totalTransactions=v(t)}getEncodingSchema(){return ai.encodingSchema}toEncodingData(){return new Map([["top-transactions",this.topTransactions.map((e=>e.toEncodingData()))],["total-transactions",this.totalTransactions]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded PendingTransactionsResponse: ${e}`);return new ai({topTransactions:(e.get("top-transactions")??[]).map((e=>bn.fromEncodingData(e))),totalTransactions:e.get("total-transactions")})}}class ii{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"txId",valueSchema:new ct,omitEmpty:!0})),this.encodingSchemaValue}constructor({txid:e}){this.txid=e}getEncodingSchema(){return ii.encodingSchema}toEncodingData(){return new Map([["txId",this.txid]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded PostTransactionsResponse: ${e}`);return new ii({txid:e.get("txId")})}}class ri{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"new-value",valueSchema:Va.encodingSchema,omitEmpty:!0},{key:"slot",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({newValue:e,slot:t}){this.newValue=e,this.slot=v(t)}getEncodingSchema(){return ri.encodingSchema}toEncodingData(){return new Map([["new-value",this.newValue.toEncodingData()],["slot",this.slot]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ScratchChange: ${e}`);return new ri({newValue:Va.fromEncodingData(e.get("new-value")??new Map),slot:e.get("slot")})}}class oi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"app-initial-states",valueSchema:new kt(new mt(wa.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({appInitialStates:e}){this.appInitialStates=e}getEncodingSchema(){return oi.encodingSchema}toEncodingData(){return new Map([["app-initial-states",void 0!==this.appInitialStates?this.appInitialStates.map((e=>e.toEncodingData())):void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateInitialStates: ${e}`);return new oi({appInitialStates:void 0!==e.get("app-initial-states")?e.get("app-initial-states").map((e=>wa.fromEncodingData(e))):void 0})}}class si{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"txn-groups",valueSchema:new mt(ci.encodingSchema),omitEmpty:!0},{key:"allow-empty-signatures",valueSchema:new kt(new st),omitEmpty:!0},{key:"allow-more-logging",valueSchema:new kt(new st),omitEmpty:!0},{key:"allow-unnamed-resources",valueSchema:new kt(new st),omitEmpty:!0},{key:"exec-trace-config",valueSchema:new kt(di.encodingSchema),omitEmpty:!0},{key:"extra-opcode-budget",valueSchema:new kt(new ht),omitEmpty:!0},{key:"fix-signers",valueSchema:new kt(new st),omitEmpty:!0},{key:"round",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({txnGroups:e,allowEmptySignatures:t,allowMoreLogging:n,allowUnnamedResources:a,execTraceConfig:i,extraOpcodeBudget:r,fixSigners:o,round:s}){this.txnGroups=e,this.allowEmptySignatures=t,this.allowMoreLogging=n,this.allowUnnamedResources=a,this.execTraceConfig=i,this.extraOpcodeBudget=void 0===r?void 0:v(r),this.fixSigners=o,this.round=void 0===s?void 0:E(s)}getEncodingSchema(){return si.encodingSchema}toEncodingData(){return new Map([["txn-groups",this.txnGroups.map((e=>e.toEncodingData()))],["allow-empty-signatures",this.allowEmptySignatures],["allow-more-logging",this.allowMoreLogging],["allow-unnamed-resources",this.allowUnnamedResources],["exec-trace-config",void 0!==this.execTraceConfig?this.execTraceConfig.toEncodingData():void 0],["extra-opcode-budget",this.extraOpcodeBudget],["fix-signers",this.fixSigners],["round",this.round]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateRequest: ${e}`);return new si({txnGroups:(e.get("txn-groups")??[]).map((e=>ci.fromEncodingData(e))),allowEmptySignatures:e.get("allow-empty-signatures"),allowMoreLogging:e.get("allow-more-logging"),allowUnnamedResources:e.get("allow-unnamed-resources"),execTraceConfig:void 0!==e.get("exec-trace-config")?di.fromEncodingData(e.get("exec-trace-config")):void 0,extraOpcodeBudget:e.get("extra-opcode-budget"),fixSigners:e.get("fix-signers"),round:e.get("round")})}}class ci{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"txns",valueSchema:new mt(bn.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({txns:e}){this.txns=e}getEncodingSchema(){return ci.encodingSchema}toEncodingData(){return new Map([["txns",this.txns.map((e=>e.toEncodingData()))]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateRequestTransactionGroup: ${e}`);return new ci({txns:(e.get("txns")??[]).map((e=>bn.fromEncodingData(e)))})}}class hi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"last-round",valueSchema:new ht,omitEmpty:!0},{key:"txn-groups",valueSchema:new mt(ui.encodingSchema),omitEmpty:!0},{key:"version",valueSchema:new ht,omitEmpty:!0},{key:"eval-overrides",valueSchema:new kt(mi.encodingSchema),omitEmpty:!0},{key:"exec-trace-config",valueSchema:new kt(di.encodingSchema),omitEmpty:!0},{key:"initial-states",valueSchema:new kt(oi.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({lastRound:e,txnGroups:t,version:n,evalOverrides:a,execTraceConfig:i,initialStates:r}){this.lastRound=E(e),this.txnGroups=t,this.version=v(n),this.evalOverrides=a,this.execTraceConfig=i,this.initialStates=r}getEncodingSchema(){return hi.encodingSchema}toEncodingData(){return new Map([["last-round",this.lastRound],["txn-groups",this.txnGroups.map((e=>e.toEncodingData()))],["version",this.version],["eval-overrides",void 0!==this.evalOverrides?this.evalOverrides.toEncodingData():void 0],["exec-trace-config",void 0!==this.execTraceConfig?this.execTraceConfig.toEncodingData():void 0],["initial-states",void 0!==this.initialStates?this.initialStates.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateResponse: ${e}`);return new hi({lastRound:e.get("last-round"),txnGroups:(e.get("txn-groups")??[]).map((e=>ui.fromEncodingData(e))),version:e.get("version"),evalOverrides:void 0!==e.get("eval-overrides")?mi.fromEncodingData(e.get("eval-overrides")):void 0,execTraceConfig:void 0!==e.get("exec-trace-config")?di.fromEncodingData(e.get("exec-trace-config")):void 0,initialStates:void 0!==e.get("initial-states")?oi.fromEncodingData(e.get("initial-states")):void 0})}}class di{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"enable",valueSchema:new kt(new st),omitEmpty:!0},{key:"scratch-change",valueSchema:new kt(new st),omitEmpty:!0},{key:"stack-change",valueSchema:new kt(new st),omitEmpty:!0},{key:"state-change",valueSchema:new kt(new st),omitEmpty:!0})),this.encodingSchemaValue}constructor({enable:e,scratchChange:t,stackChange:n,stateChange:a}){this.enable=e,this.scratchChange=t,this.stackChange=n,this.stateChange=a}getEncodingSchema(){return di.encodingSchema}toEncodingData(){return new Map([["enable",this.enable],["scratch-change",this.scratchChange],["stack-change",this.stackChange],["state-change",this.stateChange]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateTraceConfig: ${e}`);return new di({enable:e.get("enable"),scratchChange:e.get("scratch-change"),stackChange:e.get("stack-change"),stateChange:e.get("state-change")})}}class ui{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"txn-results",valueSchema:new mt(li.encodingSchema),omitEmpty:!0},{key:"app-budget-added",valueSchema:new kt(new ht),omitEmpty:!0},{key:"app-budget-consumed",valueSchema:new kt(new ht),omitEmpty:!0},{key:"failed-at",valueSchema:new kt(new mt(new ht)),omitEmpty:!0},{key:"failure-message",valueSchema:new kt(new ct),omitEmpty:!0},{key:"unnamed-resources-accessed",valueSchema:new kt(gi.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({txnResults:e,appBudgetAdded:t,appBudgetConsumed:n,failedAt:a,failureMessage:i,unnamedResourcesAccessed:r}){this.txnResults=e,this.appBudgetAdded=void 0===t?void 0:v(t),this.appBudgetConsumed=void 0===n?void 0:v(n),this.failedAt=void 0===a?void 0:a.map(v),this.failureMessage=i,this.unnamedResourcesAccessed=r}getEncodingSchema(){return ui.encodingSchema}toEncodingData(){return new Map([["txn-results",this.txnResults.map((e=>e.toEncodingData()))],["app-budget-added",this.appBudgetAdded],["app-budget-consumed",this.appBudgetConsumed],["failed-at",this.failedAt],["failure-message",this.failureMessage],["unnamed-resources-accessed",void 0!==this.unnamedResourcesAccessed?this.unnamedResourcesAccessed.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateTransactionGroupResult: ${e}`);return new ui({txnResults:(e.get("txn-results")??[]).map((e=>li.fromEncodingData(e))),appBudgetAdded:e.get("app-budget-added"),appBudgetConsumed:e.get("app-budget-consumed"),failedAt:e.get("failed-at"),failureMessage:e.get("failure-message"),unnamedResourcesAccessed:void 0!==e.get("unnamed-resources-accessed")?gi.fromEncodingData(e.get("unnamed-resources-accessed")):void 0})}}class li{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"txn-result",valueSchema:ni.encodingSchema,omitEmpty:!0},{key:"app-budget-consumed",valueSchema:new kt(new ht),omitEmpty:!0},{key:"exec-trace",valueSchema:new kt(fi.encodingSchema),omitEmpty:!0},{key:"fixed-signer",valueSchema:new kt(new ct),omitEmpty:!0},{key:"logic-sig-budget-consumed",valueSchema:new kt(new ht),omitEmpty:!0},{key:"unnamed-resources-accessed",valueSchema:new kt(gi.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({txnResult:e,appBudgetConsumed:t,execTrace:n,fixedSigner:a,logicSigBudgetConsumed:i,unnamedResourcesAccessed:r}){this.txnResult=e,this.appBudgetConsumed=void 0===t?void 0:v(t),this.execTrace=n,this.fixedSigner="string"==typeof a?G.fromString(a):a,this.logicSigBudgetConsumed=void 0===i?void 0:v(i),this.unnamedResourcesAccessed=r}getEncodingSchema(){return li.encodingSchema}toEncodingData(){return new Map([["txn-result",this.txnResult.toEncodingData()],["app-budget-consumed",this.appBudgetConsumed],["exec-trace",void 0!==this.execTrace?this.execTrace.toEncodingData():void 0],["fixed-signer",void 0!==this.fixedSigner?this.fixedSigner.toString():void 0],["logic-sig-budget-consumed",this.logicSigBudgetConsumed],["unnamed-resources-accessed",void 0!==this.unnamedResourcesAccessed?this.unnamedResourcesAccessed.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateTransactionResult: ${e}`);return new li({txnResult:ni.fromEncodingData(e.get("txn-result")??new Map),appBudgetConsumed:e.get("app-budget-consumed"),execTrace:void 0!==e.get("exec-trace")?fi.fromEncodingData(e.get("exec-trace")):void 0,fixedSigner:e.get("fixed-signer"),logicSigBudgetConsumed:e.get("logic-sig-budget-consumed"),unnamedResourcesAccessed:void 0!==e.get("unnamed-resources-accessed")?gi.fromEncodingData(e.get("unnamed-resources-accessed")):void 0})}}class gi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"accounts",valueSchema:new kt(new mt(new ct)),omitEmpty:!0},{key:"app-locals",valueSchema:new kt(new mt(Sa.encodingSchema)),omitEmpty:!0},{key:"apps",valueSchema:new kt(new mt(new ht)),omitEmpty:!0},{key:"asset-holdings",valueSchema:new kt(new mt(Ta.encodingSchema)),omitEmpty:!0},{key:"assets",valueSchema:new kt(new mt(new ht)),omitEmpty:!0},{key:"boxes",valueSchema:new kt(new mt($a.encodingSchema)),omitEmpty:!0},{key:"extra-box-refs",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({accounts:e,appLocals:t,apps:n,assetHoldings:a,assets:i,boxes:r,extraBoxRefs:o}){this.accounts=void 0!==e?e.map((e=>"string"==typeof e?G.fromString(e):e)):void 0,this.appLocals=t,this.apps=void 0===n?void 0:n.map(E),this.assetHoldings=a,this.assets=void 0===i?void 0:i.map(E),this.boxes=r,this.extraBoxRefs=void 0===o?void 0:v(o)}getEncodingSchema(){return gi.encodingSchema}toEncodingData(){return new Map([["accounts",void 0!==this.accounts?this.accounts.map((e=>e.toString())):void 0],["app-locals",void 0!==this.appLocals?this.appLocals.map((e=>e.toEncodingData())):void 0],["apps",this.apps],["asset-holdings",void 0!==this.assetHoldings?this.assetHoldings.map((e=>e.toEncodingData())):void 0],["assets",this.assets],["boxes",void 0!==this.boxes?this.boxes.map((e=>e.toEncodingData())):void 0],["extra-box-refs",this.extraBoxRefs]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulateUnnamedResourcesAccessed: ${e}`);return new gi({accounts:e.get("accounts"),appLocals:void 0!==e.get("app-locals")?e.get("app-locals").map((e=>Sa.fromEncodingData(e))):void 0,apps:e.get("apps"),assetHoldings:void 0!==e.get("asset-holdings")?e.get("asset-holdings").map((e=>Ta.fromEncodingData(e))):void 0,assets:e.get("assets"),boxes:void 0!==e.get("boxes")?e.get("boxes").map((e=>$a.fromEncodingData(e))):void 0,extraBoxRefs:e.get("extra-box-refs")})}}class mi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"allow-empty-signatures",valueSchema:new kt(new st),omitEmpty:!0},{key:"allow-unnamed-resources",valueSchema:new kt(new st),omitEmpty:!0},{key:"extra-opcode-budget",valueSchema:new kt(new ht),omitEmpty:!0},{key:"fix-signers",valueSchema:new kt(new st),omitEmpty:!0},{key:"max-log-calls",valueSchema:new kt(new ht),omitEmpty:!0},{key:"max-log-size",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({allowEmptySignatures:e,allowUnnamedResources:t,extraOpcodeBudget:n,fixSigners:a,maxLogCalls:i,maxLogSize:r}){this.allowEmptySignatures=e,this.allowUnnamedResources=t,this.extraOpcodeBudget=void 0===n?void 0:v(n),this.fixSigners=a,this.maxLogCalls=void 0===i?void 0:v(i),this.maxLogSize=void 0===r?void 0:v(r)}getEncodingSchema(){return mi.encodingSchema}toEncodingData(){return new Map([["allow-empty-signatures",this.allowEmptySignatures],["allow-unnamed-resources",this.allowUnnamedResources],["extra-opcode-budget",this.extraOpcodeBudget],["fix-signers",this.fixSigners],["max-log-calls",this.maxLogCalls],["max-log-size",this.maxLogSize]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulationEvalOverrides: ${e}`);return new mi({allowEmptySignatures:e.get("allow-empty-signatures"),allowUnnamedResources:e.get("allow-unnamed-resources"),extraOpcodeBudget:e.get("extra-opcode-budget"),fixSigners:e.get("fix-signers"),maxLogCalls:e.get("max-log-calls"),maxLogSize:e.get("max-log-size")})}}class pi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"pc",valueSchema:new ht,omitEmpty:!0},{key:"scratch-changes",valueSchema:new kt(new mt(ri.encodingSchema)),omitEmpty:!0},{key:"spawned-inners",valueSchema:new kt(new mt(new ht)),omitEmpty:!0},{key:"stack-additions",valueSchema:new kt(new mt(Va.encodingSchema)),omitEmpty:!0},{key:"stack-pop-count",valueSchema:new kt(new ht),omitEmpty:!0},{key:"state-changes",valueSchema:new kt(new mt(ba.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({pc:e,scratchChanges:t,spawnedInners:n,stackAdditions:a,stackPopCount:i,stateChanges:r}){this.pc=v(e),this.scratchChanges=t,this.spawnedInners=void 0===n?void 0:n.map(v),this.stackAdditions=a,this.stackPopCount=void 0===i?void 0:v(i),this.stateChanges=r}getEncodingSchema(){return pi.encodingSchema}toEncodingData(){return new Map([["pc",this.pc],["scratch-changes",void 0!==this.scratchChanges?this.scratchChanges.map((e=>e.toEncodingData())):void 0],["spawned-inners",this.spawnedInners],["stack-additions",void 0!==this.stackAdditions?this.stackAdditions.map((e=>e.toEncodingData())):void 0],["stack-pop-count",this.stackPopCount],["state-changes",void 0!==this.stateChanges?this.stateChanges.map((e=>e.toEncodingData())):void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulationOpcodeTraceUnit: ${e}`);return new pi({pc:e.get("pc"),scratchChanges:void 0!==e.get("scratch-changes")?e.get("scratch-changes").map((e=>ri.fromEncodingData(e))):void 0,spawnedInners:e.get("spawned-inners"),stackAdditions:void 0!==e.get("stack-additions")?e.get("stack-additions").map((e=>Va.fromEncodingData(e))):void 0,stackPopCount:e.get("stack-pop-count"),stateChanges:void 0!==e.get("state-changes")?e.get("state-changes").map((e=>ba.fromEncodingData(e))):void 0})}}class fi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"approval-program-hash",valueSchema:new kt(new ut),omitEmpty:!0},{key:"approval-program-trace",valueSchema:new kt(new mt(pi.encodingSchema)),omitEmpty:!0},{key:"clear-state-program-hash",valueSchema:new kt(new ut),omitEmpty:!0},{key:"clear-state-program-trace",valueSchema:new kt(new mt(pi.encodingSchema)),omitEmpty:!0},{key:"clear-state-rollback",valueSchema:new kt(new st),omitEmpty:!0},{key:"clear-state-rollback-error",valueSchema:new kt(new ct),omitEmpty:!0},{key:"inner-trace",valueSchema:new kt(new mt(fi.encodingSchema)),omitEmpty:!0},{key:"logic-sig-hash",valueSchema:new kt(new ut),omitEmpty:!0},{key:"logic-sig-trace",valueSchema:new kt(new mt(pi.encodingSchema)),omitEmpty:!0})),this.encodingSchemaValue}constructor({approvalProgramHash:e,approvalProgramTrace:t,clearStateProgramHash:n,clearStateProgramTrace:a,clearStateRollback:i,clearStateRollbackError:r,innerTrace:o,logicSigHash:s,logicSigTrace:c}){this.approvalProgramHash="string"==typeof e?O(e):e,this.approvalProgramTrace=t,this.clearStateProgramHash="string"==typeof n?O(n):n,this.clearStateProgramTrace=a,this.clearStateRollback=i,this.clearStateRollbackError=r,this.innerTrace=o,this.logicSigHash="string"==typeof s?O(s):s,this.logicSigTrace=c}getEncodingSchema(){return fi.encodingSchema}toEncodingData(){return new Map([["approval-program-hash",this.approvalProgramHash],["approval-program-trace",void 0!==this.approvalProgramTrace?this.approvalProgramTrace.map((e=>e.toEncodingData())):void 0],["clear-state-program-hash",this.clearStateProgramHash],["clear-state-program-trace",void 0!==this.clearStateProgramTrace?this.clearStateProgramTrace.map((e=>e.toEncodingData())):void 0],["clear-state-rollback",this.clearStateRollback],["clear-state-rollback-error",this.clearStateRollbackError],["inner-trace",void 0!==this.innerTrace?this.innerTrace.map((e=>e.toEncodingData())):void 0],["logic-sig-hash",this.logicSigHash],["logic-sig-trace",void 0!==this.logicSigTrace?this.logicSigTrace.map((e=>e.toEncodingData())):void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SimulationTransactionExecTrace: ${e}`);return new fi({approvalProgramHash:e.get("approval-program-hash"),approvalProgramTrace:void 0!==e.get("approval-program-trace")?e.get("approval-program-trace").map((e=>pi.fromEncodingData(e))):void 0,clearStateProgramHash:e.get("clear-state-program-hash"),clearStateProgramTrace:void 0!==e.get("clear-state-program-trace")?e.get("clear-state-program-trace").map((e=>pi.fromEncodingData(e))):void 0,clearStateRollback:e.get("clear-state-rollback"),clearStateRollbackError:e.get("clear-state-rollback-error"),innerTrace:void 0!==e.get("inner-trace")?e.get("inner-trace").map((e=>fi.fromEncodingData(e))):void 0,logicSigHash:e.get("logic-sig-hash"),logicSigTrace:void 0!==e.get("logic-sig-trace")?e.get("logic-sig-trace").map((e=>pi.fromEncodingData(e))):void 0})}}class yi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"Message",valueSchema:wi.encodingSchema,omitEmpty:!0},{key:"StateProof",valueSchema:new ut,omitEmpty:!0})),this.encodingSchemaValue}constructor({message:e,stateproof:t}){this.message=e,this.stateproof="string"==typeof t?O(t):t}getEncodingSchema(){return yi.encodingSchema}toEncodingData(){return new Map([["Message",this.message.toEncodingData()],["StateProof",this.stateproof]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProof: ${e}`);return new yi({message:wi.fromEncodingData(e.get("Message")??new Map),stateproof:e.get("StateProof")})}}class wi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"BlockHeadersCommitment",valueSchema:new ut,omitEmpty:!0},{key:"FirstAttestedRound",valueSchema:new ht,omitEmpty:!0},{key:"LastAttestedRound",valueSchema:new ht,omitEmpty:!0},{key:"LnProvenWeight",valueSchema:new ht,omitEmpty:!0},{key:"VotersCommitment",valueSchema:new ut,omitEmpty:!0})),this.encodingSchemaValue}constructor({blockheaderscommitment:e,firstattestedround:t,lastattestedround:n,lnprovenweight:a,voterscommitment:i}){this.blockheaderscommitment="string"==typeof e?O(e):e,this.firstattestedround=E(t),this.lastattestedround=E(n),this.lnprovenweight=E(a),this.voterscommitment="string"==typeof i?O(i):i}getEncodingSchema(){return wi.encodingSchema}toEncodingData(){return new Map([["BlockHeadersCommitment",this.blockheaderscommitment],["FirstAttestedRound",this.firstattestedround],["LastAttestedRound",this.lastattestedround],["LnProvenWeight",this.lnprovenweight],["VotersCommitment",this.voterscommitment]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofMessage: ${e}`);return new wi({blockheaderscommitment:e.get("BlockHeadersCommitment"),firstattestedround:e.get("FirstAttestedRound"),lastattestedround:e.get("LastAttestedRound"),lnprovenweight:e.get("LnProvenWeight"),voterscommitment:e.get("VotersCommitment")})}}class vi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"current_round",valueSchema:new ht,omitEmpty:!0},{key:"online-money",valueSchema:new ht,omitEmpty:!0},{key:"total-money",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({currentRound:e,onlineMoney:t,totalMoney:n}){this.currentRound=E(e),this.onlineMoney=E(t),this.totalMoney=E(n)}getEncodingSchema(){return vi.encodingSchema}toEncodingData(){return new Map([["current_round",this.currentRound],["online-money",this.onlineMoney],["total-money",this.totalMoney]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded SupplyResponse: ${e}`);return new vi({currentRound:e.get("current_round"),onlineMoney:e.get("online-money"),totalMoney:e.get("total-money")})}}class Si{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new ut,omitEmpty:!0},{key:"value",valueSchema:Ei.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key="string"==typeof e?O(e):e,this.value=t}getEncodingSchema(){return Si.encodingSchema}toEncodingData(){return new Map([["key",this.key],["value",this.value.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TealKeyValue: ${e}`);return new Si({key:e.get("key"),value:Ei.fromEncodingData(e.get("value")??new Map)})}}class Ei{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"bytes",valueSchema:new ut,omitEmpty:!0},{key:"type",valueSchema:new ht,omitEmpty:!0},{key:"uint",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({bytes:e,type:t,uint:n}){this.bytes="string"==typeof e?O(e):e,this.type=v(t),this.uint=E(n)}getEncodingSchema(){return Ei.encodingSchema}toEncodingData(){return new Map([["bytes",this.bytes],["type",this.type],["uint",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TealValue: ${e}`);return new Ei({bytes:e.get("bytes"),type:e.get("type"),uint:e.get("uint")})}}class ki{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"Deltas",valueSchema:new mt(Qa.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({deltas:e}){this.deltas=e}getEncodingSchema(){return ki.encodingSchema}toEncodingData(){return new Map([["Deltas",this.deltas.map((e=>e.toEncodingData()))]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionGroupLedgerStateDeltasForRoundResponse: ${e}`);return new ki({deltas:(e.get("Deltas")??[]).map((e=>Qa.fromEncodingData(e)))})}}class bi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"consensus-version",valueSchema:new ct,omitEmpty:!0},{key:"fee",valueSchema:new ht,omitEmpty:!0},{key:"genesis-hash",valueSchema:new ut,omitEmpty:!0},{key:"genesis-id",valueSchema:new ct,omitEmpty:!0},{key:"last-round",valueSchema:new ht,omitEmpty:!0},{key:"min-fee",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({consensusVersion:e,fee:t,genesisHash:n,genesisId:a,lastRound:i,minFee:r}){this.consensusVersion=e,this.fee=E(t),this.genesisHash="string"==typeof n?O(n):n,this.genesisId=a,this.lastRound=E(i),this.minFee=E(r)}getEncodingSchema(){return bi.encodingSchema}toEncodingData(){return new Map([["consensus-version",this.consensusVersion],["fee",this.fee],["genesis-hash",this.genesisHash],["genesis-id",this.genesisId],["last-round",this.lastRound],["min-fee",this.minFee]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionParametersResponse: ${e}`);return new bi({consensusVersion:e.get("consensus-version"),fee:e.get("fee"),genesisHash:e.get("genesis-hash"),genesisId:e.get("genesis-id"),lastRound:e.get("last-round"),minFee:e.get("min-fee")})}}class xi{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"idx",valueSchema:new ht,omitEmpty:!0},{key:"proof",valueSchema:new ut,omitEmpty:!0},{key:"stibhash",valueSchema:new ut,omitEmpty:!0},{key:"treedepth",valueSchema:new ht,omitEmpty:!0},{key:"hashtype",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({idx:e,proof:t,stibhash:n,treedepth:a,hashtype:i}){this.idx=v(e),this.proof="string"==typeof t?O(t):t,this.stibhash="string"==typeof n?O(n):n,this.treedepth=v(a),this.hashtype=i}getEncodingSchema(){return xi.encodingSchema}toEncodingData(){return new Map([["idx",this.idx],["proof",this.proof],["stibhash",this.stibhash],["treedepth",this.treedepth],["hashtype",this.hashtype]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionProofResponse: ${e}`);return new xi({idx:e.get("idx"),proof:e.get("proof"),stibhash:e.get("stibhash"),treedepth:e.get("treedepth"),hashtype:e.get("hashtype")})}}class Ai{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"build",valueSchema:La.encodingSchema,omitEmpty:!0},{key:"genesis_hash_b64",valueSchema:new ut,omitEmpty:!0},{key:"genesis_id",valueSchema:new ct,omitEmpty:!0},{key:"versions",valueSchema:new mt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({build:e,genesisHashB64:t,genesisId:n,versions:a}){this.build=e,this.genesisHashB64="string"==typeof t?O(t):t,this.genesisId=n,this.versions=a}getEncodingSchema(){return Ai.encodingSchema}toEncodingData(){return new Map([["build",this.build.toEncodingData()],["genesis_hash_b64",this.genesisHashB64],["genesis_id",this.genesisId],["versions",this.versions]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Version: ${e}`);return new Ai({build:La.fromEncodingData(e.get("build")??new Map),genesisHashB64:e.get("genesis_hash_b64"),genesisId:e.get("genesis_id"),versions:e.get("versions")})}}class Di{constructor(e){this.c=e,this.query={}}executeRequest(e,t){return this.c.get({relativePath:this.path(),query:this.query,requestHeaders:e,customOptions:t})}async do(e,t){const n=await this.executeRequest(e,t);return this.prepare(n)}async doRaw(e,t){return(await this.executeRequest(e,t)).body}}class Ti extends Di{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}`}exclude(e){return this.query.exclude=e,this}prepare(e){return rt(e.getJSONText(),ha)}}class Ii extends Di{constructor(e,t,n){super(e),this.assetID=n,this.account=t.toString()}path(){return`/v2/accounts/${this.account}/assets/${this.assetID}`}prepare(e){return rt(e.getJSONText(),la)}}class Mi extends Di{constructor(e,t,n){super(e),this.applicationID=n,this.account=t.toString()}path(){return`/v2/accounts/${this.account}/applications/${this.applicationID}`}prepare(e){return rt(e.getJSONText(),da)}}class Vi extends Di{constructor(e,t){super(e),this.round=t,this.query={format:"msgpack"}}path(){return`/v2/blocks/${this.round}`}prepare(e){return at(e.body,Ba)}}function Pi(e={}){let t=e;return Object.keys(t).every((e=>"content-type"!==e.toLowerCase()))&&(t={...e},t["Content-Type"]="text/plain"),t}class Ri extends Di{constructor(e,t){super(e),this.source=t}path(){return"/v2/teal/compile"}sourcemap(e=!0){return this.query.sourcemap=e,this}executeRequest(e,t){const n=Pi(e);return this.c.post({relativePath:this.path(),data:L(this.source),query:this.query,requestHeaders:n,customOptions:t})}prepare(e){return rt(e.getJSONText(),_a)}}class Bi extends Di{constructor(e,t){super(e),this.blob=it(t)}path(){return"/v2/teal/dryrun"}executeRequest(e,t){const n=Pi(e);return this.c.post({relativePath:this.path(),data:this.blob,requestHeaders:n,customOptions:t})}prepare(e){return rt(e.getJSONText(),Ka)}}class Ci extends Di{path(){return"/genesis"}prepare(e){return e.getJSONText()}}class Ui extends Di{constructor(e,t){super(e),this.index=t}path(){return`/v2/assets/${this.index}`}prepare(e){return rt(e.getJSONText(),Aa)}}class Oi extends Di{constructor(e,t){super(e),this.index=t}path(){return`/v2/applications/${this.index}`}prepare(e){return rt(e.getJSONText(),ya)}}class $i extends Di{constructor(e,t){super(e),this.round=t}path(){return`/v2/blocks/${this.round}/hash`}prepare(e){return rt(e.getJSONText(),Pa)}}class Ni extends Di{constructor(e,t){if(super(e),!Number.isInteger(t))throw Error("roundNumber should be an integer");this.round=t}path(){return`/v2/blocks/${this.round}/txids`}prepare(e){return rt(e.getJSONText(),Ca)}}class Li extends Di{constructor(e,t,n){super(e),this.index=t;const a=$(n);this.query.name=encodeURI(`b64:${a}`)}path(){return`/v2/applications/${this.index}/box`}prepare(e){return rt(e.getJSONText(),Ua)}}class _i extends Di{constructor(e,t){super(e),this.index=t,this.query.max=0}path(){return`/v2/applications/${this.index}/boxes`}max(e){return this.query.max=e,this}prepare(e){return rt(e.getJSONText(),Na)}}class zi extends Di{path(){return"/health"}prepare(e){}}class Fi extends Di{constructor(e,t){super(e),this.txid=t,this.query.format="msgpack"}prepare(e){return at(e.body,ni)}path(){return`/v2/transactions/pending/${this.txid}`}max(e){return this.query.max=e,this}}class Ki extends Di{constructor(e){super(e),this.query.format="msgpack"}path(){return"/v2/transactions/pending"}prepare(e){return at(e.body,ai)}max(e){return this.query.max=e,this}}class qi extends Di{constructor(e,t){super(e),this.address=t.toString(),this.query.format="msgpack"}prepare(e){return at(e.body,ai)}path(){return`/v2/accounts/${this.address}/transactions/pending`}max(e){return this.query.max=e,this}}class Hi extends Di{constructor(e,t,n){super(e),this.round=t,this.txID=n}path(){return`/v2/blocks/${this.round}/transactions/${this.txID}/proof`}hashType(e){return this.query.hashtype=e,this}prepare(e){return rt(e.getJSONText(),xi)}}function ji(e){return e&&void 0!==e.byteLength}class Gi extends Di{constructor(e,t){super(e);let n=t;if(Array.isArray(t)){if(!t.every(ji))throw new TypeError("Array elements must be byte arrays");n=y(...t)}else if(!ji(n))throw new TypeError("Argument must be byte array");this.txnBytesToPost=n}path(){return"/v2/transactions"}executeRequest(e,t){const n=function(e={}){let t=e;return Object.keys(t).every((e=>"content-type"!==e.toLowerCase()))&&(t={...e},t["Content-Type"]="application/x-binary"),t}(e);return this.c.post({relativePath:this.path(),data:this.txnBytesToPost,requestHeaders:n,customOptions:t})}prepare(e){return rt(e.getJSONText(),ii)}}class Ji extends Di{path(){return"/v2/status"}prepare(e){return rt(e.getJSONText(),ti)}}class Wi extends Di{constructor(e,t){if(super(e),this.round=t,!Number.isInteger(t))throw Error("round should be an integer")}path(){return`/v2/status/wait-for-block-after/${this.round}`}prepare(e){return rt(e.getJSONText(),ti)}}class Yi extends Di{path(){return"/v2/transactions/params"}prepare(e){const t=rt(e.getJSONText(),bi);return{flatFee:!1,fee:t.fee,firstValid:t.lastRound,lastValid:t.lastRound+BigInt(1e3),genesisID:t.genesisId,genesisHash:t.genesisHash,minFee:t.minFee,consensusVersion:t.consensusVersion}}}class Xi extends Di{path(){return"/v2/ledger/supply"}prepare(e){return rt(e.getJSONText(),vi)}}class Zi extends Di{path(){return"/versions"}prepare(e){return rt(e.getJSONText(),Ai)}}class Qi extends Di{constructor(e,t){super(e),this.round=t}path(){return`/v2/blocks/${this.round}/lightheader/proof`}prepare(e){return rt(e.getJSONText(),ei)}}class er extends Di{constructor(e,t){super(e),this.round=t}path(){return`/v2/stateproofs/${this.round}`}prepare(e){return rt(e.getJSONText(),yi)}}class tr extends Di{constructor(e,t){super(e),this.round=t}path(){return`/v2/ledger/sync/${this.round}`}executeRequest(e,t){return this.c.post({relativePath:this.path(),data:null,requestHeaders:e,customOptions:t})}prepare(e){}}class nr extends Di{path(){return"/v2/ledger/sync"}prepare(e){return rt(e.getJSONText(),Xa)}}class ar extends Di{constructor(e,t){super(e),this.offset=t}path(){return`/v2/devmode/blocks/offset/${this.offset}`}executeRequest(e,t){return this.c.post({relativePath:this.path(),data:null,requestHeaders:e,customOptions:t})}prepare(e){}}class ir extends Di{path(){return"/v2/devmode/blocks/offset"}prepare(e){return rt(e.getJSONText(),Ya)}}class rr extends Di{constructor(e,t){super(e),this.source=t}path(){return"/v2/teal/disassemble"}executeRequest(e,t){const n=function(e={}){let t=e;return Object.keys(t).every((e=>"content-type"!==e.toLowerCase()))&&(t={...e},t["Content-Type"]="text/plain"),t}(e);return this.c.post({relativePath:this.path(),data:L(this.source),query:this.query,requestHeaders:n,customOptions:t})}prepare(e){return rt(e.getJSONText(),za)}}class or extends Di{constructor(e,t){super(e),this.query.format="msgpack",this.requestBytes=it(t)}path(){return"/v2/transactions/simulate"}executeRequest(e,t){const n=function(e={}){let t=e;return Object.keys(t).every((e=>"content-type"!==e.toLowerCase()))&&(t={...e},t["Content-Type"]="application/msgpack"),t}(e);return this.c.post({relativePath:this.path(),data:this.requestBytes,query:this.query,requestHeaders:n,customOptions:t})}prepare(e){return at(e.body,hi)}}class sr extends Di{path(){return"/ready"}prepare(e){}}class cr extends Di{path(){return"/v2/ledger/sync"}executeRequest(e,t){return this.c.delete({relativePath:this.path(),data:void 0,requestHeaders:e,customOptions:t})}prepare(e){}}class hr extends Di{constructor(e,t){super(e),this.id=t,this.query={format:"msgpack"}}path(){return`/v2/deltas/txn/group/${this.id}`}prepare(e){return at(e.body,ca)}}class dr extends Di{constructor(e,t){super(e),this.round=t,this.query={format:"msgpack"}}path(){return`/v2/deltas/${this.round}`}prepare(e){return at(e.body,ca)}}class ur extends Di{constructor(e,t){super(e),this.round=t,this.query={format:"msgpack"}}path(){return`/v2/deltas/${this.round}/txn/group`}prepare(e){return at(e.body,ki)}}class lr extends ce{constructor(e,t,n,a={}){super("X-Algo-API-Token",e,t,n,a)}healthCheck(){return new zi(this.c)}versionsCheck(){return new Zi(this.c)}sendRawTransaction(e){return new Gi(this.c,e)}accountInformation(e){return new Ti(this.c,e)}accountAssetInformation(e,t){return new Ii(this.c,e,t)}accountApplicationInformation(e,t){return new Mi(this.c,e,t)}block(e){return new Vi(this.c,e)}getBlockHash(e){return new $i(this.c,e)}getBlockTxids(e){return new Ni(this.c,e)}pendingTransactionInformation(e){return new Fi(this.c,e)}pendingTransactionsInformation(){return new Ki(this.c)}pendingTransactionByAddress(e){return new qi(this.c,e)}status(){return new Ji(this.c)}statusAfterBlock(e){return new Wi(this.c,e)}getTransactionParams(){return new Yi(this.c)}supply(){return new Xi(this.c)}compile(e){return new Ri(this.c,e)}disassemble(e){return new rr(this.c,e)}dryrun(e){return new Bi(this.c,e)}getAssetByID(e){return new Ui(this.c,e)}getApplicationByID(e){return new Oi(this.c,e)}getApplicationBoxByName(e,t){return new Li(this.c,e,t)}getApplicationBoxes(e){return new _i(this.c,e)}genesis(){return new Ci(this.c)}getTransactionProof(e,t){return new Hi(this.c,e,t)}getLightBlockHeaderProof(e){return new Qi(this.c,e)}getStateProof(e){return new er(this.c,e)}simulateRawTransactions(e){const t=[];if(Array.isArray(e))for(const n of e)t.push(at(n,bn));else t.push(at(e,bn));const n=new si({txnGroups:[new ci({txns:t})]});return this.simulateTransactions(n)}simulateTransactions(e){return new or(this.c,e)}setBlockOffsetTimestamp(e){return new ar(this.c,e)}getBlockOffsetTimestamp(){return new ir(this.c)}setSyncRound(e){return new tr(this.c,e)}unsetSyncRound(){return new cr(this.c)}getSyncRound(){return new nr(this.c)}ready(){return new sr(this.c)}getLedgerStateDeltaForTransactionGroup(e){return new hr(this.c,e)}getLedgerStateDelta(e){return new dr(this.c,e)}getTransactionGroupLedgerStateDeltasForRound(e){return new ur(this.c,e)}}class gr extends ce{constructor(e,t="http://127.0.0.1",n=7833,a={}){super("X-KMD-API-Token",e,t,n,a)}async get(e){return(await this.c.get({relativePath:e})).parseBodyAsJSON({intDecoding:l.SAFE})}async delete(e,t){return(await this.c.delete({relativePath:e,data:t})).parseBodyAsJSON({intDecoding:l.SAFE})}async post(e,t){return(await this.c.post({relativePath:e,data:t})).parseBodyAsJSON({intDecoding:l.SAFE})}async versions(){return this.get("/versions")}async listWallets(){return this.get("/v1/wallets")}async createWallet(e,t,n=new Uint8Array,a="sqlite"){const i={wallet_name:e,wallet_driver_name:a,wallet_password:t,master_derivation_key:$(n)};return this.post("/v1/wallet",i)}async initWalletHandle(e,t){const n={wallet_id:e,wallet_password:t};return this.post("/v1/wallet/init",n)}async releaseWalletHandle(e){const t={wallet_handle_token:e};return this.post("/v1/wallet/release",t)}async renewWalletHandle(e){const t={wallet_handle_token:e};return this.post("/v1/wallet/renew",t)}async renameWallet(e,t,n){const a={wallet_id:e,wallet_password:t,wallet_name:n};return this.post("/v1/wallet/rename",a)}async getWallet(e){const t={wallet_handle_token:e};return this.post("/v1/wallet/info",t)}async exportMasterDerivationKey(e,t){const n={wallet_handle_token:e,wallet_password:t};return{master_derivation_key:O((await this.post("/v1/master-key/export",n)).master_derivation_key)}}async importKey(e,t){const n={wallet_handle_token:e,private_key:$(t)};return this.post("/v1/key/import",n)}async exportKey(e,t,n){const a={wallet_handle_token:e,address:n,wallet_password:t};return{private_key:O((await this.post("/v1/key/export",a)).private_key)}}async generateKey(e){const t={wallet_handle_token:e,display_mnemonic:!1};return this.post("/v1/key",t)}async deleteKey(e,t,n){const a={wallet_handle_token:e,address:n,wallet_password:t};return this.delete("/v1/key",a)}async listKeys(e){const t={wallet_handle_token:e};return this.post("/v1/key/list",t)}async signTransaction(e,t,n){const a={wallet_handle_token:e,wallet_password:t,transaction:$(n.toByte())};return O((await this.post("/v1/transaction/sign",a)).signed_transaction)}async signTransactionWithSpecificPublicKey(e,t,n,a){const i=L(a),r={wallet_handle_token:e,wallet_password:t,transaction:$(n.toByte()),public_key:$(i)};return O((await this.post("/v1/transaction/sign",r)).signed_transaction)}async listMultisig(e){const t={wallet_handle_token:e};return this.post("/v1/multisig/list",t)}async importMultisig(e,t,n,a){const i={wallet_handle_token:e,multisig_version:t,threshold:n,pks:a};return this.post("/v1/multisig/import",i)}async exportMultisig(e,t){const n={wallet_handle_token:e,address:t};return this.post("/v1/multisig/export",n)}async signMultisigTransaction(e,t,n,a,i){const r=L(a),o={wallet_handle_token:e,transaction:$(n.toByte()),public_key:$(r),partial_multisig:i,wallet_password:t};return this.post("/v1/multisig/sign",o)}async deleteMultisig(e,t,n){const a={wallet_handle_token:e,address:n,wallet_password:t};return this.delete("/v1/multisig",a)}}class mr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new ct,omitEmpty:!0},{key:"amount",valueSchema:new ht,omitEmpty:!0},{key:"amount-without-pending-rewards",valueSchema:new ht,omitEmpty:!0},{key:"min-balance",valueSchema:new ht,omitEmpty:!0},{key:"pending-rewards",valueSchema:new ht,omitEmpty:!0},{key:"rewards",valueSchema:new ht,omitEmpty:!0},{key:"round",valueSchema:new ht,omitEmpty:!0},{key:"status",valueSchema:new ct,omitEmpty:!0},{key:"total-apps-opted-in",valueSchema:new ht,omitEmpty:!0},{key:"total-assets-opted-in",valueSchema:new ht,omitEmpty:!0},{key:"total-box-bytes",valueSchema:new ht,omitEmpty:!0},{key:"total-boxes",valueSchema:new ht,omitEmpty:!0},{key:"total-created-apps",valueSchema:new ht,omitEmpty:!0},{key:"total-created-assets",valueSchema:new ht,omitEmpty:!0},{key:"apps-local-state",valueSchema:new kt(new mt(Sr.encodingSchema)),omitEmpty:!0},{key:"apps-total-extra-pages",valueSchema:new kt(new ht),omitEmpty:!0},{key:"apps-total-schema",valueSchema:new kt(Dr.encodingSchema),omitEmpty:!0},{key:"assets",valueSchema:new kt(new mt(Vr.encodingSchema)),omitEmpty:!0},{key:"auth-addr",valueSchema:new kt(new ct),omitEmpty:!0},{key:"closed-at-round",valueSchema:new kt(new ht),omitEmpty:!0},{key:"created-apps",valueSchema:new kt(new mt(vr.encodingSchema)),omitEmpty:!0},{key:"created-assets",valueSchema:new kt(new mt(Ir.encodingSchema)),omitEmpty:!0},{key:"created-at-round",valueSchema:new kt(new ht),omitEmpty:!0},{key:"deleted",valueSchema:new kt(new st),omitEmpty:!0},{key:"incentive-eligible",valueSchema:new kt(new st),omitEmpty:!0},{key:"last-heartbeat",valueSchema:new kt(new ht),omitEmpty:!0},{key:"last-proposed",valueSchema:new kt(new ht),omitEmpty:!0},{key:"participation",valueSchema:new kt(pr.encodingSchema),omitEmpty:!0},{key:"reward-base",valueSchema:new kt(new ht),omitEmpty:!0},{key:"sig-type",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,amount:t,amountWithoutPendingRewards:n,minBalance:a,pendingRewards:i,rewards:r,round:o,status:s,totalAppsOptedIn:c,totalAssetsOptedIn:h,totalBoxBytes:d,totalBoxes:u,totalCreatedApps:l,totalCreatedAssets:g,appsLocalState:m,appsTotalExtraPages:p,appsTotalSchema:f,assets:y,authAddr:w,closedAtRound:S,createdApps:k,createdAssets:b,createdAtRound:x,deleted:A,incentiveEligible:D,lastHeartbeat:T,lastProposed:I,participation:M,rewardBase:V,sigType:P}){this.address=e,this.amount=E(t),this.amountWithoutPendingRewards=E(n),this.minBalance=v(a),this.pendingRewards=E(i),this.rewards=E(r),this.round=E(o),this.status=s,this.totalAppsOptedIn=v(c),this.totalAssetsOptedIn=v(h),this.totalBoxBytes=v(d),this.totalBoxes=v(u),this.totalCreatedApps=v(l),this.totalCreatedAssets=v(g),this.appsLocalState=m,this.appsTotalExtraPages=void 0===p?void 0:v(p),this.appsTotalSchema=f,this.assets=y,this.authAddr="string"==typeof w?G.fromString(w):w,this.closedAtRound=void 0===S?void 0:E(S),this.createdApps=k,this.createdAssets=b,this.createdAtRound=void 0===x?void 0:E(x),this.deleted=A,this.incentiveEligible=D,this.lastHeartbeat=void 0===T?void 0:v(T),this.lastProposed=void 0===I?void 0:v(I),this.participation=M,this.rewardBase=void 0===V?void 0:E(V),this.sigType=P}getEncodingSchema(){return mr.encodingSchema}toEncodingData(){return new Map([["address",this.address],["amount",this.amount],["amount-without-pending-rewards",this.amountWithoutPendingRewards],["min-balance",this.minBalance],["pending-rewards",this.pendingRewards],["rewards",this.rewards],["round",this.round],["status",this.status],["total-apps-opted-in",this.totalAppsOptedIn],["total-assets-opted-in",this.totalAssetsOptedIn],["total-box-bytes",this.totalBoxBytes],["total-boxes",this.totalBoxes],["total-created-apps",this.totalCreatedApps],["total-created-assets",this.totalCreatedAssets],["apps-local-state",void 0!==this.appsLocalState?this.appsLocalState.map((e=>e.toEncodingData())):void 0],["apps-total-extra-pages",this.appsTotalExtraPages],["apps-total-schema",void 0!==this.appsTotalSchema?this.appsTotalSchema.toEncodingData():void 0],["assets",void 0!==this.assets?this.assets.map((e=>e.toEncodingData())):void 0],["auth-addr",void 0!==this.authAddr?this.authAddr.toString():void 0],["closed-at-round",this.closedAtRound],["created-apps",void 0!==this.createdApps?this.createdApps.map((e=>e.toEncodingData())):void 0],["created-assets",void 0!==this.createdAssets?this.createdAssets.map((e=>e.toEncodingData())):void 0],["created-at-round",this.createdAtRound],["deleted",this.deleted],["incentive-eligible",this.incentiveEligible],["last-heartbeat",this.lastHeartbeat],["last-proposed",this.lastProposed],["participation",void 0!==this.participation?this.participation.toEncodingData():void 0],["reward-base",this.rewardBase],["sig-type",this.sigType]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Account: ${e}`);return new mr({address:e.get("address"),amount:e.get("amount"),amountWithoutPendingRewards:e.get("amount-without-pending-rewards"),minBalance:e.get("min-balance"),pendingRewards:e.get("pending-rewards"),rewards:e.get("rewards"),round:e.get("round"),status:e.get("status"),totalAppsOptedIn:e.get("total-apps-opted-in"),totalAssetsOptedIn:e.get("total-assets-opted-in"),totalBoxBytes:e.get("total-box-bytes"),totalBoxes:e.get("total-boxes"),totalCreatedApps:e.get("total-created-apps"),totalCreatedAssets:e.get("total-created-assets"),appsLocalState:void 0!==e.get("apps-local-state")?e.get("apps-local-state").map((e=>Sr.fromEncodingData(e))):void 0,appsTotalExtraPages:e.get("apps-total-extra-pages"),appsTotalSchema:void 0!==e.get("apps-total-schema")?Dr.fromEncodingData(e.get("apps-total-schema")):void 0,assets:void 0!==e.get("assets")?e.get("assets").map((e=>Vr.fromEncodingData(e))):void 0,authAddr:e.get("auth-addr"),closedAtRound:e.get("closed-at-round"),createdApps:void 0!==e.get("created-apps")?e.get("created-apps").map((e=>vr.fromEncodingData(e))):void 0,createdAssets:void 0!==e.get("created-assets")?e.get("created-assets").map((e=>Ir.fromEncodingData(e))):void 0,createdAtRound:e.get("created-at-round"),deleted:e.get("deleted"),incentiveEligible:e.get("incentive-eligible"),lastHeartbeat:e.get("last-heartbeat"),lastProposed:e.get("last-proposed"),participation:void 0!==e.get("participation")?pr.fromEncodingData(e.get("participation")):void 0,rewardBase:e.get("reward-base"),sigType:e.get("sig-type")})}}class pr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"selection-participation-key",valueSchema:new ut,omitEmpty:!0},{key:"vote-first-valid",valueSchema:new ht,omitEmpty:!0},{key:"vote-key-dilution",valueSchema:new ht,omitEmpty:!0},{key:"vote-last-valid",valueSchema:new ht,omitEmpty:!0},{key:"vote-participation-key",valueSchema:new ut,omitEmpty:!0},{key:"state-proof-key",valueSchema:new kt(new ut),omitEmpty:!0})),this.encodingSchemaValue}constructor({selectionParticipationKey:e,voteFirstValid:t,voteKeyDilution:n,voteLastValid:a,voteParticipationKey:i,stateProofKey:r}){this.selectionParticipationKey="string"==typeof e?O(e):e,this.voteFirstValid=E(t),this.voteKeyDilution=E(n),this.voteLastValid=E(a),this.voteParticipationKey="string"==typeof i?O(i):i,this.stateProofKey="string"==typeof r?O(r):r}getEncodingSchema(){return pr.encodingSchema}toEncodingData(){return new Map([["selection-participation-key",this.selectionParticipationKey],["vote-first-valid",this.voteFirstValid],["vote-key-dilution",this.voteKeyDilution],["vote-last-valid",this.voteLastValid],["vote-participation-key",this.voteParticipationKey],["state-proof-key",this.stateProofKey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountParticipation: ${e}`);return new pr({selectionParticipationKey:e.get("selection-participation-key"),voteFirstValid:e.get("vote-first-valid"),voteKeyDilution:e.get("vote-key-dilution"),voteLastValid:e.get("vote-last-valid"),voteParticipationKey:e.get("vote-participation-key"),stateProofKey:e.get("state-proof-key")})}}class fr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"account",valueSchema:mr.encodingSchema,omitEmpty:!0},{key:"current-round",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({account:e,currentRound:t}){this.account=e,this.currentRound=E(t)}getEncodingSchema(){return fr.encodingSchema}toEncodingData(){return new Map([["account",this.account.toEncodingData()],["current-round",this.currentRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountResponse: ${e}`);return new fr({account:mr.fromEncodingData(e.get("account")??new Map),currentRound:e.get("current-round")})}}class yr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new ct,omitEmpty:!0},{key:"delta",valueSchema:new mt(qr.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,delta:t}){this.address=e,this.delta=t}getEncodingSchema(){return yr.encodingSchema}toEncodingData(){return new Map([["address",this.address],["delta",this.delta.map((e=>e.toEncodingData()))]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountStateDelta: ${e}`);return new yr({address:e.get("address"),delta:(e.get("delta")??[]).map((e=>qr.fromEncodingData(e)))})}}class wr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"accounts",valueSchema:new mt(mr.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new ht,omitEmpty:!0},{key:"next-token",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({accounts:e,currentRound:t,nextToken:n}){this.accounts=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return wr.encodingSchema}toEncodingData(){return new Map([["accounts",this.accounts.map((e=>e.toEncodingData()))],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AccountsResponse: ${e}`);return new wr({accounts:(e.get("accounts")??[]).map((e=>mr.fromEncodingData(e))),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class vr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new ht,omitEmpty:!0},{key:"params",valueSchema:xr.encodingSchema,omitEmpty:!0},{key:"created-at-round",valueSchema:new kt(new ht),omitEmpty:!0},{key:"deleted",valueSchema:new kt(new st),omitEmpty:!0},{key:"deleted-at-round",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,params:t,createdAtRound:n,deleted:a,deletedAtRound:i}){this.id=E(e),this.params=t,this.createdAtRound=void 0===n?void 0:E(n),this.deleted=a,this.deletedAtRound=void 0===i?void 0:E(i)}getEncodingSchema(){return vr.encodingSchema}toEncodingData(){return new Map([["id",this.id],["params",this.params.toEncodingData()],["created-at-round",this.createdAtRound],["deleted",this.deleted],["deleted-at-round",this.deletedAtRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Application: ${e}`);return new vr({id:e.get("id"),params:xr.fromEncodingData(e.get("params")??new Map),createdAtRound:e.get("created-at-round"),deleted:e.get("deleted"),deletedAtRound:e.get("deleted-at-round")})}}class Sr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"id",valueSchema:new ht,omitEmpty:!0},{key:"schema",valueSchema:Dr.encodingSchema,omitEmpty:!0},{key:"closed-out-at-round",valueSchema:new kt(new ht),omitEmpty:!0},{key:"deleted",valueSchema:new kt(new st),omitEmpty:!0},{key:"key-value",valueSchema:new kt(new mt(ro.encodingSchema)),omitEmpty:!0},{key:"opted-in-at-round",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({id:e,schema:t,closedOutAtRound:n,deleted:a,keyValue:i,optedInAtRound:r}){this.id=E(e),this.schema=t,this.closedOutAtRound=void 0===n?void 0:E(n),this.deleted=a,this.keyValue=i,this.optedInAtRound=void 0===r?void 0:E(r)}getEncodingSchema(){return Sr.encodingSchema}toEncodingData(){return new Map([["id",this.id],["schema",this.schema.toEncodingData()],["closed-out-at-round",this.closedOutAtRound],["deleted",this.deleted],["key-value",void 0!==this.keyValue?this.keyValue.map((e=>e.toEncodingData())):void 0],["opted-in-at-round",this.optedInAtRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLocalState: ${e}`);return new Sr({id:e.get("id"),schema:Dr.fromEncodingData(e.get("schema")??new Map),closedOutAtRound:e.get("closed-out-at-round"),deleted:e.get("deleted"),keyValue:void 0!==e.get("key-value")?e.get("key-value").map((e=>ro.fromEncodingData(e))):void 0,optedInAtRound:e.get("opted-in-at-round")})}}class Er{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"apps-local-states",valueSchema:new mt(Sr.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new ht,omitEmpty:!0},{key:"next-token",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({appsLocalStates:e,currentRound:t,nextToken:n}){this.appsLocalStates=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return Er.encodingSchema}toEncodingData(){return new Map([["apps-local-states",this.appsLocalStates.map((e=>e.toEncodingData()))],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLocalStatesResponse: ${e}`);return new Er({appsLocalStates:(e.get("apps-local-states")??[]).map((e=>Sr.fromEncodingData(e))),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class kr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"logs",valueSchema:new mt(new ut),omitEmpty:!0},{key:"txid",valueSchema:new ct,omitEmpty:!0})),this.encodingSchemaValue}constructor({logs:e,txid:t}){this.logs=e,this.txid=t}getEncodingSchema(){return kr.encodingSchema}toEncodingData(){return new Map([["logs",this.logs],["txid",this.txid]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLogData: ${e}`);return new kr({logs:e.get("logs"),txid:e.get("txid")})}}class br{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"application-id",valueSchema:new ht,omitEmpty:!0},{key:"current-round",valueSchema:new ht,omitEmpty:!0},{key:"log-data",valueSchema:new kt(new mt(kr.encodingSchema)),omitEmpty:!0},{key:"next-token",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({applicationId:e,currentRound:t,logData:n,nextToken:a}){this.applicationId=E(e),this.currentRound=E(t),this.logData=n,this.nextToken=a}getEncodingSchema(){return br.encodingSchema}toEncodingData(){return new Map([["application-id",this.applicationId],["current-round",this.currentRound],["log-data",void 0!==this.logData?this.logData.map((e=>e.toEncodingData())):void 0],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationLogsResponse: ${e}`);return new br({applicationId:e.get("application-id"),currentRound:e.get("current-round"),logData:void 0!==e.get("log-data")?e.get("log-data").map((e=>kr.fromEncodingData(e))):void 0,nextToken:e.get("next-token")})}}class xr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"approval-program",valueSchema:new ut,omitEmpty:!0},{key:"clear-state-program",valueSchema:new ut,omitEmpty:!0},{key:"creator",valueSchema:new kt(new ct),omitEmpty:!0},{key:"extra-program-pages",valueSchema:new kt(new ht),omitEmpty:!0},{key:"global-state",valueSchema:new kt(new mt(ro.encodingSchema)),omitEmpty:!0},{key:"global-state-schema",valueSchema:new kt(Dr.encodingSchema),omitEmpty:!0},{key:"local-state-schema",valueSchema:new kt(Dr.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({approvalProgram:e,clearStateProgram:t,creator:n,extraProgramPages:a,globalState:i,globalStateSchema:r,localStateSchema:o}){this.approvalProgram="string"==typeof e?O(e):e,this.clearStateProgram="string"==typeof t?O(t):t,this.creator="string"==typeof n?G.fromString(n):n,this.extraProgramPages=void 0===a?void 0:v(a),this.globalState=i,this.globalStateSchema=r,this.localStateSchema=o}getEncodingSchema(){return xr.encodingSchema}toEncodingData(){return new Map([["approval-program",this.approvalProgram],["clear-state-program",this.clearStateProgram],["creator",void 0!==this.creator?this.creator.toString():void 0],["extra-program-pages",this.extraProgramPages],["global-state",void 0!==this.globalState?this.globalState.map((e=>e.toEncodingData())):void 0],["global-state-schema",void 0!==this.globalStateSchema?this.globalStateSchema.toEncodingData():void 0],["local-state-schema",void 0!==this.localStateSchema?this.localStateSchema.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationParams: ${e}`);return new xr({approvalProgram:e.get("approval-program"),clearStateProgram:e.get("clear-state-program"),creator:e.get("creator"),extraProgramPages:e.get("extra-program-pages"),globalState:void 0!==e.get("global-state")?e.get("global-state").map((e=>ro.fromEncodingData(e))):void 0,globalStateSchema:void 0!==e.get("global-state-schema")?Dr.fromEncodingData(e.get("global-state-schema")):void 0,localStateSchema:void 0!==e.get("local-state-schema")?Dr.fromEncodingData(e.get("local-state-schema")):void 0})}}class Ar{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"current-round",valueSchema:new ht,omitEmpty:!0},{key:"application",valueSchema:new kt(vr.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({currentRound:e,application:t}){this.currentRound=E(e),this.application=t}getEncodingSchema(){return Ar.encodingSchema}toEncodingData(){return new Map([["current-round",this.currentRound],["application",void 0!==this.application?this.application.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationResponse: ${e}`);return new Ar({currentRound:e.get("current-round"),application:void 0!==e.get("application")?vr.fromEncodingData(e.get("application")):void 0})}}class Dr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"num-byte-slice",valueSchema:new ht,omitEmpty:!0},{key:"num-uint",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({numByteSlice:e,numUint:t}){this.numByteSlice=v(e),this.numUint=v(t)}getEncodingSchema(){return Dr.encodingSchema}toEncodingData(){return new Map([["num-byte-slice",this.numByteSlice],["num-uint",this.numUint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationStateSchema: ${e}`);return new Dr({numByteSlice:e.get("num-byte-slice"),numUint:e.get("num-uint")})}}class Tr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"applications",valueSchema:new mt(vr.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new ht,omitEmpty:!0},{key:"next-token",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({applications:e,currentRound:t,nextToken:n}){this.applications=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return Tr.encodingSchema}toEncodingData(){return new Map([["applications",this.applications.map((e=>e.toEncodingData()))],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ApplicationsResponse: ${e}`);return new Tr({applications:(e.get("applications")??[]).map((e=>vr.fromEncodingData(e))),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class Ir{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"index",valueSchema:new ht,omitEmpty:!0},{key:"params",valueSchema:Rr.encodingSchema,omitEmpty:!0},{key:"created-at-round",valueSchema:new kt(new ht),omitEmpty:!0},{key:"deleted",valueSchema:new kt(new st),omitEmpty:!0},{key:"destroyed-at-round",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({index:e,params:t,createdAtRound:n,deleted:a,destroyedAtRound:i}){this.index=E(e),this.params=t,this.createdAtRound=void 0===n?void 0:E(n),this.deleted=a,this.destroyedAtRound=void 0===i?void 0:E(i)}getEncodingSchema(){return Ir.encodingSchema}toEncodingData(){return new Map([["index",this.index],["params",this.params.toEncodingData()],["created-at-round",this.createdAtRound],["deleted",this.deleted],["destroyed-at-round",this.destroyedAtRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Asset: ${e}`);return new Ir({index:e.get("index"),params:Rr.fromEncodingData(e.get("params")??new Map),createdAtRound:e.get("created-at-round"),deleted:e.get("deleted"),destroyedAtRound:e.get("destroyed-at-round")})}}class Mr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"balances",valueSchema:new mt(Wr.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new ht,omitEmpty:!0},{key:"next-token",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({balances:e,currentRound:t,nextToken:n}){this.balances=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return Mr.encodingSchema}toEncodingData(){return new Map([["balances",this.balances.map((e=>e.toEncodingData()))],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetBalancesResponse: ${e}`);return new Mr({balances:(e.get("balances")??[]).map((e=>Wr.fromEncodingData(e))),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class Vr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"amount",valueSchema:new ht,omitEmpty:!0},{key:"asset-id",valueSchema:new ht,omitEmpty:!0},{key:"is-frozen",valueSchema:new st,omitEmpty:!0},{key:"deleted",valueSchema:new kt(new st),omitEmpty:!0},{key:"opted-in-at-round",valueSchema:new kt(new ht),omitEmpty:!0},{key:"opted-out-at-round",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({amount:e,assetId:t,isFrozen:n,deleted:a,optedInAtRound:i,optedOutAtRound:r}){this.amount=E(e),this.assetId=E(t),this.isFrozen=n,this.deleted=a,this.optedInAtRound=void 0===i?void 0:E(i),this.optedOutAtRound=void 0===r?void 0:E(r)}getEncodingSchema(){return Vr.encodingSchema}toEncodingData(){return new Map([["amount",this.amount],["asset-id",this.assetId],["is-frozen",this.isFrozen],["deleted",this.deleted],["opted-in-at-round",this.optedInAtRound],["opted-out-at-round",this.optedOutAtRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHolding: ${e}`);return new Vr({amount:e.get("amount"),assetId:e.get("asset-id"),isFrozen:e.get("is-frozen"),deleted:e.get("deleted"),optedInAtRound:e.get("opted-in-at-round"),optedOutAtRound:e.get("opted-out-at-round")})}}class Pr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"assets",valueSchema:new mt(Vr.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new ht,omitEmpty:!0},{key:"next-token",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({assets:e,currentRound:t,nextToken:n}){this.assets=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return Pr.encodingSchema}toEncodingData(){return new Map([["assets",this.assets.map((e=>e.toEncodingData()))],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetHoldingsResponse: ${e}`);return new Pr({assets:(e.get("assets")??[]).map((e=>Vr.fromEncodingData(e))),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class Rr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"creator",valueSchema:new ct,omitEmpty:!0},{key:"decimals",valueSchema:new ht,omitEmpty:!0},{key:"total",valueSchema:new ht,omitEmpty:!0},{key:"clawback",valueSchema:new kt(new ct),omitEmpty:!0},{key:"default-frozen",valueSchema:new kt(new st),omitEmpty:!0},{key:"freeze",valueSchema:new kt(new ct),omitEmpty:!0},{key:"manager",valueSchema:new kt(new ct),omitEmpty:!0},{key:"metadata-hash",valueSchema:new kt(new ut),omitEmpty:!0},{key:"name",valueSchema:new kt(new ct),omitEmpty:!0},{key:"name-b64",valueSchema:new kt(new ut),omitEmpty:!0},{key:"reserve",valueSchema:new kt(new ct),omitEmpty:!0},{key:"unit-name",valueSchema:new kt(new ct),omitEmpty:!0},{key:"unit-name-b64",valueSchema:new kt(new ut),omitEmpty:!0},{key:"url",valueSchema:new kt(new ct),omitEmpty:!0},{key:"url-b64",valueSchema:new kt(new ut),omitEmpty:!0})),this.encodingSchemaValue}constructor({creator:e,decimals:t,total:n,clawback:a,defaultFrozen:i,freeze:r,manager:o,metadataHash:s,name:c,nameB64:h,reserve:d,unitName:u,unitNameB64:l,url:g,urlB64:m}){this.creator=e,this.decimals=v(t),this.total=E(n),this.clawback=a,this.defaultFrozen=i,this.freeze=r,this.manager=o,this.metadataHash="string"==typeof s?O(s):s,this.name=c,this.nameB64="string"==typeof h?O(h):h,this.reserve=d,this.unitName=u,this.unitNameB64="string"==typeof l?O(l):l,this.url=g,this.urlB64="string"==typeof m?O(m):m}getEncodingSchema(){return Rr.encodingSchema}toEncodingData(){return new Map([["creator",this.creator],["decimals",this.decimals],["total",this.total],["clawback",this.clawback],["default-frozen",this.defaultFrozen],["freeze",this.freeze],["manager",this.manager],["metadata-hash",this.metadataHash],["name",this.name],["name-b64",this.nameB64],["reserve",this.reserve],["unit-name",this.unitName],["unit-name-b64",this.unitNameB64],["url",this.url],["url-b64",this.urlB64]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetParams: ${e}`);return new Rr({creator:e.get("creator"),decimals:e.get("decimals"),total:e.get("total"),clawback:e.get("clawback"),defaultFrozen:e.get("default-frozen"),freeze:e.get("freeze"),manager:e.get("manager"),metadataHash:e.get("metadata-hash"),name:e.get("name"),nameB64:e.get("name-b64"),reserve:e.get("reserve"),unitName:e.get("unit-name"),unitNameB64:e.get("unit-name-b64"),url:e.get("url"),urlB64:e.get("url-b64")})}}class Br{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"asset",valueSchema:Ir.encodingSchema,omitEmpty:!0},{key:"current-round",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({asset:e,currentRound:t}){this.asset=e,this.currentRound=E(t)}getEncodingSchema(){return Br.encodingSchema}toEncodingData(){return new Map([["asset",this.asset.toEncodingData()],["current-round",this.currentRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetResponse: ${e}`);return new Br({asset:Ir.fromEncodingData(e.get("asset")??new Map),currentRound:e.get("current-round")})}}class Cr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"assets",valueSchema:new mt(Ir.encodingSchema),omitEmpty:!0},{key:"current-round",valueSchema:new ht,omitEmpty:!0},{key:"next-token",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({assets:e,currentRound:t,nextToken:n}){this.assets=e,this.currentRound=E(t),this.nextToken=n}getEncodingSchema(){return Cr.encodingSchema}toEncodingData(){return new Map([["assets",this.assets.map((e=>e.toEncodingData()))],["current-round",this.currentRound],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded AssetsResponse: ${e}`);return new Cr({assets:(e.get("assets")??[]).map((e=>Ir.fromEncodingData(e))),currentRound:e.get("current-round"),nextToken:e.get("next-token")})}}class Ur{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"genesis-hash",valueSchema:new ut,omitEmpty:!0},{key:"genesis-id",valueSchema:new ct,omitEmpty:!0},{key:"previous-block-hash",valueSchema:new ut,omitEmpty:!0},{key:"round",valueSchema:new ht,omitEmpty:!0},{key:"seed",valueSchema:new ut,omitEmpty:!0},{key:"timestamp",valueSchema:new ht,omitEmpty:!0},{key:"transactions-root",valueSchema:new ut,omitEmpty:!0},{key:"transactions-root-sha256",valueSchema:new ut,omitEmpty:!0},{key:"bonus",valueSchema:new kt(new ht),omitEmpty:!0},{key:"fees-collected",valueSchema:new kt(new ht),omitEmpty:!0},{key:"participation-updates",valueSchema:new kt(Yr.encodingSchema),omitEmpty:!0},{key:"proposer",valueSchema:new kt(new ct),omitEmpty:!0},{key:"proposer-payout",valueSchema:new kt(new ht),omitEmpty:!0},{key:"rewards",valueSchema:new kt(Or.encodingSchema),omitEmpty:!0},{key:"state-proof-tracking",valueSchema:new kt(new mt(no.encodingSchema)),omitEmpty:!0},{key:"transactions",valueSchema:new kt(new mt(so.encodingSchema)),omitEmpty:!0},{key:"txn-counter",valueSchema:new kt(new ht),omitEmpty:!0},{key:"upgrade-state",valueSchema:new kt($r.encodingSchema),omitEmpty:!0},{key:"upgrade-vote",valueSchema:new kt(Nr.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({genesisHash:e,genesisId:t,previousBlockHash:n,round:a,seed:i,timestamp:r,transactionsRoot:o,transactionsRootSha256:s,bonus:c,feesCollected:h,participationUpdates:d,proposer:u,proposerPayout:l,rewards:g,stateProofTracking:m,transactions:p,txnCounter:f,upgradeState:y,upgradeVote:w}){this.genesisHash="string"==typeof e?O(e):e,this.genesisId=t,this.previousBlockHash="string"==typeof n?O(n):n,this.round=E(a),this.seed="string"==typeof i?O(i):i,this.timestamp=v(r),this.transactionsRoot="string"==typeof o?O(o):o,this.transactionsRootSha256="string"==typeof s?O(s):s,this.bonus=void 0===c?void 0:v(c),this.feesCollected=void 0===h?void 0:v(h),this.participationUpdates=d,this.proposer="string"==typeof u?G.fromString(u):u,this.proposerPayout=void 0===l?void 0:v(l),this.rewards=g,this.stateProofTracking=m,this.transactions=p,this.txnCounter=void 0===f?void 0:v(f),this.upgradeState=y,this.upgradeVote=w}getEncodingSchema(){return Ur.encodingSchema}toEncodingData(){return new Map([["genesis-hash",this.genesisHash],["genesis-id",this.genesisId],["previous-block-hash",this.previousBlockHash],["round",this.round],["seed",this.seed],["timestamp",this.timestamp],["transactions-root",this.transactionsRoot],["transactions-root-sha256",this.transactionsRootSha256],["bonus",this.bonus],["fees-collected",this.feesCollected],["participation-updates",void 0!==this.participationUpdates?this.participationUpdates.toEncodingData():void 0],["proposer",void 0!==this.proposer?this.proposer.toString():void 0],["proposer-payout",this.proposerPayout],["rewards",void 0!==this.rewards?this.rewards.toEncodingData():void 0],["state-proof-tracking",void 0!==this.stateProofTracking?this.stateProofTracking.map((e=>e.toEncodingData())):void 0],["transactions",void 0!==this.transactions?this.transactions.map((e=>e.toEncodingData())):void 0],["txn-counter",this.txnCounter],["upgrade-state",void 0!==this.upgradeState?this.upgradeState.toEncodingData():void 0],["upgrade-vote",void 0!==this.upgradeVote?this.upgradeVote.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Block: ${e}`);return new Ur({genesisHash:e.get("genesis-hash"),genesisId:e.get("genesis-id"),previousBlockHash:e.get("previous-block-hash"),round:e.get("round"),seed:e.get("seed"),timestamp:e.get("timestamp"),transactionsRoot:e.get("transactions-root"),transactionsRootSha256:e.get("transactions-root-sha256"),bonus:e.get("bonus"),feesCollected:e.get("fees-collected"),participationUpdates:void 0!==e.get("participation-updates")?Yr.fromEncodingData(e.get("participation-updates")):void 0,proposer:e.get("proposer"),proposerPayout:e.get("proposer-payout"),rewards:void 0!==e.get("rewards")?Or.fromEncodingData(e.get("rewards")):void 0,stateProofTracking:void 0!==e.get("state-proof-tracking")?e.get("state-proof-tracking").map((e=>no.fromEncodingData(e))):void 0,transactions:void 0!==e.get("transactions")?e.get("transactions").map((e=>so.fromEncodingData(e))):void 0,txnCounter:e.get("txn-counter"),upgradeState:void 0!==e.get("upgrade-state")?$r.fromEncodingData(e.get("upgrade-state")):void 0,upgradeVote:void 0!==e.get("upgrade-vote")?Nr.fromEncodingData(e.get("upgrade-vote")):void 0})}}class Or{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"fee-sink",valueSchema:new ct,omitEmpty:!0},{key:"rewards-calculation-round",valueSchema:new ht,omitEmpty:!0},{key:"rewards-level",valueSchema:new ht,omitEmpty:!0},{key:"rewards-pool",valueSchema:new ct,omitEmpty:!0},{key:"rewards-rate",valueSchema:new ht,omitEmpty:!0},{key:"rewards-residue",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({feeSink:e,rewardsCalculationRound:t,rewardsLevel:n,rewardsPool:a,rewardsRate:i,rewardsResidue:r}){this.feeSink=e,this.rewardsCalculationRound=E(t),this.rewardsLevel=E(n),this.rewardsPool=a,this.rewardsRate=E(i),this.rewardsResidue=E(r)}getEncodingSchema(){return Or.encodingSchema}toEncodingData(){return new Map([["fee-sink",this.feeSink],["rewards-calculation-round",this.rewardsCalculationRound],["rewards-level",this.rewardsLevel],["rewards-pool",this.rewardsPool],["rewards-rate",this.rewardsRate],["rewards-residue",this.rewardsResidue]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockRewards: ${e}`);return new Or({feeSink:e.get("fee-sink"),rewardsCalculationRound:e.get("rewards-calculation-round"),rewardsLevel:e.get("rewards-level"),rewardsPool:e.get("rewards-pool"),rewardsRate:e.get("rewards-rate"),rewardsResidue:e.get("rewards-residue")})}}class $r{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"current-protocol",valueSchema:new ct,omitEmpty:!0},{key:"next-protocol",valueSchema:new kt(new ct),omitEmpty:!0},{key:"next-protocol-approvals",valueSchema:new kt(new ht),omitEmpty:!0},{key:"next-protocol-switch-on",valueSchema:new kt(new ht),omitEmpty:!0},{key:"next-protocol-vote-before",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({currentProtocol:e,nextProtocol:t,nextProtocolApprovals:n,nextProtocolSwitchOn:a,nextProtocolVoteBefore:i}){this.currentProtocol=e,this.nextProtocol=t,this.nextProtocolApprovals=void 0===n?void 0:v(n),this.nextProtocolSwitchOn=void 0===a?void 0:E(a),this.nextProtocolVoteBefore=void 0===i?void 0:E(i)}getEncodingSchema(){return $r.encodingSchema}toEncodingData(){return new Map([["current-protocol",this.currentProtocol],["next-protocol",this.nextProtocol],["next-protocol-approvals",this.nextProtocolApprovals],["next-protocol-switch-on",this.nextProtocolSwitchOn],["next-protocol-vote-before",this.nextProtocolVoteBefore]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockUpgradeState: ${e}`);return new $r({currentProtocol:e.get("current-protocol"),nextProtocol:e.get("next-protocol"),nextProtocolApprovals:e.get("next-protocol-approvals"),nextProtocolSwitchOn:e.get("next-protocol-switch-on"),nextProtocolVoteBefore:e.get("next-protocol-vote-before")})}}class Nr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"upgrade-approve",valueSchema:new kt(new st),omitEmpty:!0},{key:"upgrade-delay",valueSchema:new kt(new ht),omitEmpty:!0},{key:"upgrade-propose",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({upgradeApprove:e,upgradeDelay:t,upgradePropose:n}){this.upgradeApprove=e,this.upgradeDelay=void 0===t?void 0:E(t),this.upgradePropose=n}getEncodingSchema(){return Nr.encodingSchema}toEncodingData(){return new Map([["upgrade-approve",this.upgradeApprove],["upgrade-delay",this.upgradeDelay],["upgrade-propose",this.upgradePropose]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BlockUpgradeVote: ${e}`);return new Nr({upgradeApprove:e.get("upgrade-approve"),upgradeDelay:e.get("upgrade-delay"),upgradePropose:e.get("upgrade-propose")})}}class Lr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"name",valueSchema:new ut,omitEmpty:!0},{key:"round",valueSchema:new ht,omitEmpty:!0},{key:"value",valueSchema:new ut,omitEmpty:!0})),this.encodingSchemaValue}constructor({name:e,round:t,value:n}){this.name="string"==typeof e?O(e):e,this.round=E(t),this.value="string"==typeof n?O(n):n}getEncodingSchema(){return Lr.encodingSchema}toEncodingData(){return new Map([["name",this.name],["round",this.round],["value",this.value]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Box: ${e}`);return new Lr({name:e.get("name"),round:e.get("round"),value:e.get("value")})}}class _r{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"name",valueSchema:new ut,omitEmpty:!0})),this.encodingSchemaValue}constructor({name:e}){this.name="string"==typeof e?O(e):e}getEncodingSchema(){return _r.encodingSchema}toEncodingData(){return new Map([["name",this.name]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxDescriptor: ${e}`);return new _r({name:e.get("name")})}}class zr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"application-id",valueSchema:new ht,omitEmpty:!0},{key:"boxes",valueSchema:new mt(_r.encodingSchema),omitEmpty:!0},{key:"next-token",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({applicationId:e,boxes:t,nextToken:n}){this.applicationId=E(e),this.boxes=t,this.nextToken=n}getEncodingSchema(){return zr.encodingSchema}toEncodingData(){return new Map([["application-id",this.applicationId],["boxes",this.boxes.map((e=>e.toEncodingData()))],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded BoxesResponse: ${e}`);return new zr({applicationId:e.get("application-id"),boxes:(e.get("boxes")??[]).map((e=>_r.fromEncodingData(e))),nextToken:e.get("next-token")})}}class Fr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"message",valueSchema:new ct,omitEmpty:!0},{key:"data",valueSchema:new kt(Ln.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({message:e,data:t}){this.message=e,this.data=t}getEncodingSchema(){return Fr.encodingSchema}toEncodingData(){return new Map([["message",this.message],["data",void 0!==this.data?this.data.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ErrorResponse: ${e}`);return new Fr({message:e.get("message"),data:void 0!==e.get("data")?Ln.fromEncodingData(e.get("data")):void 0})}}class Kr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"action",valueSchema:new ht,omitEmpty:!0},{key:"bytes",valueSchema:new kt(new ct),omitEmpty:!0},{key:"uint",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({action:e,bytes:t,uint:n}){this.action=v(e),this.bytes=t,this.uint=void 0===n?void 0:E(n)}getEncodingSchema(){return Kr.encodingSchema}toEncodingData(){return new Map([["action",this.action],["bytes",this.bytes],["uint",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EvalDelta: ${e}`);return new Kr({action:e.get("action"),bytes:e.get("bytes"),uint:e.get("uint")})}}class qr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new ct,omitEmpty:!0},{key:"value",valueSchema:Kr.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key=e,this.value=t}getEncodingSchema(){return qr.encodingSchema}toEncodingData(){return new Map([["key",this.key],["value",this.value.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded EvalDeltaKeyValue: ${e}`);return new qr({key:e.get("key"),value:Kr.fromEncodingData(e.get("value")??new Map)})}}class Hr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"hash-type",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({hashType:e}){this.hashType=void 0===e?void 0:v(e)}getEncodingSchema(){return Hr.encodingSchema}toEncodingData(){return new Map([["hash-type",this.hashType]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded HashFactory: ${e}`);return new Hr({hashType:e.get("hash-type")})}}class jr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"db-available",valueSchema:new st,omitEmpty:!0},{key:"is-migrating",valueSchema:new st,omitEmpty:!0},{key:"message",valueSchema:new ct,omitEmpty:!0},{key:"round",valueSchema:new ht,omitEmpty:!0},{key:"version",valueSchema:new ct,omitEmpty:!0},{key:"data",valueSchema:new kt(Ln.encodingSchema),omitEmpty:!0},{key:"errors",valueSchema:new kt(new mt(new ct)),omitEmpty:!0})),this.encodingSchemaValue}constructor({dbAvailable:e,isMigrating:t,message:n,round:a,version:i,data:r,errors:o}){this.dbAvailable=e,this.isMigrating=t,this.message=n,this.round=E(a),this.version=i,this.data=r,this.errors=o}getEncodingSchema(){return jr.encodingSchema}toEncodingData(){return new Map([["db-available",this.dbAvailable],["is-migrating",this.isMigrating],["message",this.message],["round",this.round],["version",this.version],["data",void 0!==this.data?this.data.toEncodingData():void 0],["errors",this.errors]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded HealthCheck: ${e}`);return new jr({dbAvailable:e.get("db-available"),isMigrating:e.get("is-migrating"),message:e.get("message"),round:e.get("round"),version:e.get("version"),data:void 0!==e.get("data")?Ln.fromEncodingData(e.get("data")):void 0,errors:e.get("errors")})}}class Gr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"block-headers-commitment",valueSchema:new kt(new ut),omitEmpty:!0},{key:"first-attested-round",valueSchema:new kt(new ht),omitEmpty:!0},{key:"latest-attested-round",valueSchema:new kt(new ht),omitEmpty:!0},{key:"ln-proven-weight",valueSchema:new kt(new ht),omitEmpty:!0},{key:"voters-commitment",valueSchema:new kt(new ut),omitEmpty:!0})),this.encodingSchemaValue}constructor({blockHeadersCommitment:e,firstAttestedRound:t,latestAttestedRound:n,lnProvenWeight:a,votersCommitment:i}){this.blockHeadersCommitment="string"==typeof e?O(e):e,this.firstAttestedRound=void 0===t?void 0:E(t),this.latestAttestedRound=void 0===n?void 0:E(n),this.lnProvenWeight=void 0===a?void 0:E(a),this.votersCommitment="string"==typeof i?O(i):i}getEncodingSchema(){return Gr.encodingSchema}toEncodingData(){return new Map([["block-headers-commitment",this.blockHeadersCommitment],["first-attested-round",this.firstAttestedRound],["latest-attested-round",this.latestAttestedRound],["ln-proven-weight",this.lnProvenWeight],["voters-commitment",this.votersCommitment]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded IndexerStateProofMessage: ${e}`);return new Gr({blockHeadersCommitment:e.get("block-headers-commitment"),firstAttestedRound:e.get("first-attested-round"),latestAttestedRound:e.get("latest-attested-round"),lnProvenWeight:e.get("ln-proven-weight"),votersCommitment:e.get("voters-commitment")})}}class Jr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"hash-factory",valueSchema:new kt(Hr.encodingSchema),omitEmpty:!0},{key:"path",valueSchema:new kt(new mt(new ut)),omitEmpty:!0},{key:"tree-depth",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({hashFactory:e,path:t,treeDepth:n}){this.hashFactory=e,this.path=t,this.treeDepth=void 0===n?void 0:v(n)}getEncodingSchema(){return Jr.encodingSchema}toEncodingData(){return new Map([["hash-factory",void 0!==this.hashFactory?this.hashFactory.toEncodingData():void 0],["path",this.path],["tree-depth",this.treeDepth]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded MerkleArrayProof: ${e}`);return new Jr({hashFactory:void 0!==e.get("hash-factory")?Hr.fromEncodingData(e.get("hash-factory")):void 0,path:e.get("path"),treeDepth:e.get("tree-depth")})}}class Wr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new ct,omitEmpty:!0},{key:"amount",valueSchema:new ht,omitEmpty:!0},{key:"is-frozen",valueSchema:new st,omitEmpty:!0},{key:"deleted",valueSchema:new kt(new st),omitEmpty:!0},{key:"opted-in-at-round",valueSchema:new kt(new ht),omitEmpty:!0},{key:"opted-out-at-round",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,amount:t,isFrozen:n,deleted:a,optedInAtRound:i,optedOutAtRound:r}){this.address=e,this.amount=E(t),this.isFrozen=n,this.deleted=a,this.optedInAtRound=void 0===i?void 0:E(i),this.optedOutAtRound=void 0===r?void 0:E(r)}getEncodingSchema(){return Wr.encodingSchema}toEncodingData(){return new Map([["address",this.address],["amount",this.amount],["is-frozen",this.isFrozen],["deleted",this.deleted],["opted-in-at-round",this.optedInAtRound],["opted-out-at-round",this.optedOutAtRound]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded MiniAssetHolding: ${e}`);return new Wr({address:e.get("address"),amount:e.get("amount"),isFrozen:e.get("is-frozen"),deleted:e.get("deleted"),optedInAtRound:e.get("opted-in-at-round"),optedOutAtRound:e.get("opted-out-at-round")})}}class Yr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"absent-participation-accounts",valueSchema:new kt(new mt(new ct)),omitEmpty:!0},{key:"expired-participation-accounts",valueSchema:new kt(new mt(new ct)),omitEmpty:!0})),this.encodingSchemaValue}constructor({absentParticipationAccounts:e,expiredParticipationAccounts:t}){this.absentParticipationAccounts=e,this.expiredParticipationAccounts=t}getEncodingSchema(){return Yr.encodingSchema}toEncodingData(){return new Map([["absent-participation-accounts",this.absentParticipationAccounts],["expired-participation-accounts",this.expiredParticipationAccounts]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded ParticipationUpdates: ${e}`);return new Yr({absentParticipationAccounts:e.get("absent-participation-accounts"),expiredParticipationAccounts:e.get("expired-participation-accounts")})}}class Xr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"part-proofs",valueSchema:new kt(Jr.encodingSchema),omitEmpty:!0},{key:"positions-to-reveal",valueSchema:new kt(new mt(new ht)),omitEmpty:!0},{key:"reveals",valueSchema:new kt(new mt(Qr.encodingSchema)),omitEmpty:!0},{key:"salt-version",valueSchema:new kt(new ht),omitEmpty:!0},{key:"sig-commit",valueSchema:new kt(new ut),omitEmpty:!0},{key:"sig-proofs",valueSchema:new kt(Jr.encodingSchema),omitEmpty:!0},{key:"signed-weight",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({partProofs:e,positionsToReveal:t,reveals:n,saltVersion:a,sigCommit:i,sigProofs:r,signedWeight:o}){this.partProofs=e,this.positionsToReveal=void 0===t?void 0:t.map(E),this.reveals=n,this.saltVersion=void 0===a?void 0:v(a),this.sigCommit="string"==typeof i?O(i):i,this.sigProofs=r,this.signedWeight=void 0===o?void 0:E(o)}getEncodingSchema(){return Xr.encodingSchema}toEncodingData(){return new Map([["part-proofs",void 0!==this.partProofs?this.partProofs.toEncodingData():void 0],["positions-to-reveal",this.positionsToReveal],["reveals",void 0!==this.reveals?this.reveals.map((e=>e.toEncodingData())):void 0],["salt-version",this.saltVersion],["sig-commit",this.sigCommit],["sig-proofs",void 0!==this.sigProofs?this.sigProofs.toEncodingData():void 0],["signed-weight",this.signedWeight]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofFields: ${e}`);return new Xr({partProofs:void 0!==e.get("part-proofs")?Jr.fromEncodingData(e.get("part-proofs")):void 0,positionsToReveal:e.get("positions-to-reveal"),reveals:void 0!==e.get("reveals")?e.get("reveals").map((e=>Qr.fromEncodingData(e))):void 0,saltVersion:e.get("salt-version"),sigCommit:e.get("sig-commit"),sigProofs:void 0!==e.get("sig-proofs")?Jr.fromEncodingData(e.get("sig-proofs")):void 0,signedWeight:e.get("signed-weight")})}}class Zr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"verifier",valueSchema:new kt(ao.encodingSchema),omitEmpty:!0},{key:"weight",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({verifier:e,weight:t}){this.verifier=e,this.weight=void 0===t?void 0:E(t)}getEncodingSchema(){return Zr.encodingSchema}toEncodingData(){return new Map([["verifier",void 0!==this.verifier?this.verifier.toEncodingData():void 0],["weight",this.weight]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofParticipant: ${e}`);return new Zr({verifier:void 0!==e.get("verifier")?ao.fromEncodingData(e.get("verifier")):void 0,weight:e.get("weight")})}}class Qr{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"participant",valueSchema:new kt(Zr.encodingSchema),omitEmpty:!0},{key:"position",valueSchema:new kt(new ht),omitEmpty:!0},{key:"sig-slot",valueSchema:new kt(eo.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({participant:e,position:t,sigSlot:n}){this.participant=e,this.position=void 0===t?void 0:E(t),this.sigSlot=n}getEncodingSchema(){return Qr.encodingSchema}toEncodingData(){return new Map([["participant",void 0!==this.participant?this.participant.toEncodingData():void 0],["position",this.position],["sig-slot",void 0!==this.sigSlot?this.sigSlot.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofReveal: ${e}`);return new Qr({participant:void 0!==e.get("participant")?Zr.fromEncodingData(e.get("participant")):void 0,position:e.get("position"),sigSlot:void 0!==e.get("sig-slot")?eo.fromEncodingData(e.get("sig-slot")):void 0})}}class eo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"lower-sig-weight",valueSchema:new kt(new ht),omitEmpty:!0},{key:"signature",valueSchema:new kt(to.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({lowerSigWeight:e,signature:t}){this.lowerSigWeight=void 0===e?void 0:E(e),this.signature=t}getEncodingSchema(){return eo.encodingSchema}toEncodingData(){return new Map([["lower-sig-weight",this.lowerSigWeight],["signature",void 0!==this.signature?this.signature.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofSigSlot: ${e}`);return new eo({lowerSigWeight:e.get("lower-sig-weight"),signature:void 0!==e.get("signature")?to.fromEncodingData(e.get("signature")):void 0})}}class to{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"falcon-signature",valueSchema:new kt(new ut),omitEmpty:!0},{key:"merkle-array-index",valueSchema:new kt(new ht),omitEmpty:!0},{key:"proof",valueSchema:new kt(Jr.encodingSchema),omitEmpty:!0},{key:"verifying-key",valueSchema:new kt(new ut),omitEmpty:!0})),this.encodingSchemaValue}constructor({falconSignature:e,merkleArrayIndex:t,proof:n,verifyingKey:a}){this.falconSignature="string"==typeof e?O(e):e,this.merkleArrayIndex=void 0===t?void 0:v(t),this.proof=n,this.verifyingKey="string"==typeof a?O(a):a}getEncodingSchema(){return to.encodingSchema}toEncodingData(){return new Map([["falcon-signature",this.falconSignature],["merkle-array-index",this.merkleArrayIndex],["proof",void 0!==this.proof?this.proof.toEncodingData():void 0],["verifying-key",this.verifyingKey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofSignature: ${e}`);return new to({falconSignature:e.get("falcon-signature"),merkleArrayIndex:e.get("merkle-array-index"),proof:void 0!==e.get("proof")?Jr.fromEncodingData(e.get("proof")):void 0,verifyingKey:e.get("verifying-key")})}}class no{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"next-round",valueSchema:new kt(new ht),omitEmpty:!0},{key:"online-total-weight",valueSchema:new kt(new ht),omitEmpty:!0},{key:"type",valueSchema:new kt(new ht),omitEmpty:!0},{key:"voters-commitment",valueSchema:new kt(new ut),omitEmpty:!0})),this.encodingSchemaValue}constructor({nextRound:e,onlineTotalWeight:t,type:n,votersCommitment:a}){this.nextRound=void 0===e?void 0:E(e),this.onlineTotalWeight=void 0===t?void 0:E(t),this.type=void 0===n?void 0:v(n),this.votersCommitment="string"==typeof a?O(a):a}getEncodingSchema(){return no.encodingSchema}toEncodingData(){return new Map([["next-round",this.nextRound],["online-total-weight",this.onlineTotalWeight],["type",this.type],["voters-commitment",this.votersCommitment]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofTracking: ${e}`);return new no({nextRound:e.get("next-round"),onlineTotalWeight:e.get("online-total-weight"),type:e.get("type"),votersCommitment:e.get("voters-commitment")})}}class ao{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"commitment",valueSchema:new kt(new ut),omitEmpty:!0},{key:"key-lifetime",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({commitment:e,keyLifetime:t}){this.commitment="string"==typeof e?O(e):e,this.keyLifetime=void 0===t?void 0:E(t)}getEncodingSchema(){return ao.encodingSchema}toEncodingData(){return new Map([["commitment",this.commitment],["key-lifetime",this.keyLifetime]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateProofVerifier: ${e}`);return new ao({commitment:e.get("commitment"),keyLifetime:e.get("key-lifetime")})}}class io{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"num-byte-slice",valueSchema:new ht,omitEmpty:!0},{key:"num-uint",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({numByteSlice:e,numUint:t}){this.numByteSlice=v(e),this.numUint=v(t)}getEncodingSchema(){return io.encodingSchema}toEncodingData(){return new Map([["num-byte-slice",this.numByteSlice],["num-uint",this.numUint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded StateSchema: ${e}`);return new io({numByteSlice:e.get("num-byte-slice"),numUint:e.get("num-uint")})}}class ro{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"key",valueSchema:new ut,omitEmpty:!0},{key:"value",valueSchema:oo.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({key:e,value:t}){this.key="string"==typeof e?O(e):e,this.value=t}getEncodingSchema(){return ro.encodingSchema}toEncodingData(){return new Map([["key",this.key],["value",this.value.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TealKeyValue: ${e}`);return new ro({key:e.get("key"),value:oo.fromEncodingData(e.get("value")??new Map)})}}class oo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"bytes",valueSchema:new ut,omitEmpty:!0},{key:"type",valueSchema:new ht,omitEmpty:!0},{key:"uint",valueSchema:new ht,omitEmpty:!0})),this.encodingSchemaValue}constructor({bytes:e,type:t,uint:n}){this.bytes="string"==typeof e?O(e):e,this.type=v(t),this.uint=E(n)}getEncodingSchema(){return oo.encodingSchema}toEncodingData(){return new Map([["bytes",this.bytes],["type",this.type],["uint",this.uint]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TealValue: ${e}`);return new oo({bytes:e.get("bytes"),type:e.get("type"),uint:e.get("uint")})}}class so{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"fee",valueSchema:new ht,omitEmpty:!0},{key:"first-valid",valueSchema:new ht,omitEmpty:!0},{key:"last-valid",valueSchema:new ht,omitEmpty:!0},{key:"sender",valueSchema:new ct,omitEmpty:!0},{key:"application-transaction",valueSchema:new kt(co.encodingSchema),omitEmpty:!0},{key:"asset-config-transaction",valueSchema:new kt(ho.encodingSchema),omitEmpty:!0},{key:"asset-freeze-transaction",valueSchema:new kt(uo.encodingSchema),omitEmpty:!0},{key:"asset-transfer-transaction",valueSchema:new kt(lo.encodingSchema),omitEmpty:!0},{key:"auth-addr",valueSchema:new kt(new ct),omitEmpty:!0},{key:"close-rewards",valueSchema:new kt(new ht),omitEmpty:!0},{key:"closing-amount",valueSchema:new kt(new ht),omitEmpty:!0},{key:"confirmed-round",valueSchema:new kt(new ht),omitEmpty:!0},{key:"created-application-index",valueSchema:new kt(new ht),omitEmpty:!0},{key:"created-asset-index",valueSchema:new kt(new ht),omitEmpty:!0},{key:"genesis-hash",valueSchema:new kt(new ut),omitEmpty:!0},{key:"genesis-id",valueSchema:new kt(new ct),omitEmpty:!0},{key:"global-state-delta",valueSchema:new kt(new mt(qr.encodingSchema)),omitEmpty:!0},{key:"group",valueSchema:new kt(new ut),omitEmpty:!0},{key:"id",valueSchema:new kt(new ct),omitEmpty:!0},{key:"inner-txns",valueSchema:new kt(new mt(so.encodingSchema)),omitEmpty:!0},{key:"intra-round-offset",valueSchema:new kt(new ht),omitEmpty:!0},{key:"keyreg-transaction",valueSchema:new kt(go.encodingSchema),omitEmpty:!0},{key:"lease",valueSchema:new kt(new ut),omitEmpty:!0},{key:"local-state-delta",valueSchema:new kt(new mt(yr.encodingSchema)),omitEmpty:!0},{key:"logs",valueSchema:new kt(new mt(new ut)),omitEmpty:!0},{key:"note",valueSchema:new kt(new ut),omitEmpty:!0},{key:"payment-transaction",valueSchema:new kt(mo.encodingSchema),omitEmpty:!0},{key:"receiver-rewards",valueSchema:new kt(new ht),omitEmpty:!0},{key:"rekey-to",valueSchema:new kt(new ct),omitEmpty:!0},{key:"round-time",valueSchema:new kt(new ht),omitEmpty:!0},{key:"sender-rewards",valueSchema:new kt(new ht),omitEmpty:!0},{key:"signature",valueSchema:new kt(fo.encodingSchema),omitEmpty:!0},{key:"state-proof-transaction",valueSchema:new kt(So.encodingSchema),omitEmpty:!0},{key:"tx-type",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({fee:e,firstValid:t,lastValid:n,sender:a,applicationTransaction:i,assetConfigTransaction:r,assetFreezeTransaction:o,assetTransferTransaction:s,authAddr:c,closeRewards:h,closingAmount:d,confirmedRound:u,createdApplicationIndex:l,createdAssetIndex:g,genesisHash:m,genesisId:p,globalStateDelta:f,group:y,id:w,innerTxns:S,intraRoundOffset:k,keyregTransaction:b,lease:x,localStateDelta:A,logs:D,note:T,paymentTransaction:I,receiverRewards:M,rekeyTo:V,roundTime:P,senderRewards:R,signature:B,stateProofTransaction:C,txType:U}){this.fee=E(e),this.firstValid=E(t),this.lastValid=E(n),this.sender=a,this.applicationTransaction=i,this.assetConfigTransaction=r,this.assetFreezeTransaction=o,this.assetTransferTransaction=s,this.authAddr="string"==typeof c?G.fromString(c):c,this.closeRewards=void 0===h?void 0:E(h),this.closingAmount=void 0===d?void 0:E(d),this.confirmedRound=void 0===u?void 0:E(u),this.createdApplicationIndex=void 0===l?void 0:E(l),this.createdAssetIndex=void 0===g?void 0:E(g),this.genesisHash="string"==typeof m?O(m):m,this.genesisId=p,this.globalStateDelta=f,this.group="string"==typeof y?O(y):y,this.id=w,this.innerTxns=S,this.intraRoundOffset=void 0===k?void 0:v(k),this.keyregTransaction=b,this.lease="string"==typeof x?O(x):x,this.localStateDelta=A,this.logs=D,this.note="string"==typeof T?O(T):T,this.paymentTransaction=I,this.receiverRewards=void 0===M?void 0:E(M),this.rekeyTo="string"==typeof V?G.fromString(V):V,this.roundTime=void 0===P?void 0:v(P),this.senderRewards=void 0===R?void 0:E(R),this.signature=B,this.stateProofTransaction=C,this.txType=U}getEncodingSchema(){return so.encodingSchema}toEncodingData(){return new Map([["fee",this.fee],["first-valid",this.firstValid],["last-valid",this.lastValid],["sender",this.sender],["application-transaction",void 0!==this.applicationTransaction?this.applicationTransaction.toEncodingData():void 0],["asset-config-transaction",void 0!==this.assetConfigTransaction?this.assetConfigTransaction.toEncodingData():void 0],["asset-freeze-transaction",void 0!==this.assetFreezeTransaction?this.assetFreezeTransaction.toEncodingData():void 0],["asset-transfer-transaction",void 0!==this.assetTransferTransaction?this.assetTransferTransaction.toEncodingData():void 0],["auth-addr",void 0!==this.authAddr?this.authAddr.toString():void 0],["close-rewards",this.closeRewards],["closing-amount",this.closingAmount],["confirmed-round",this.confirmedRound],["created-application-index",this.createdApplicationIndex],["created-asset-index",this.createdAssetIndex],["genesis-hash",this.genesisHash],["genesis-id",this.genesisId],["global-state-delta",void 0!==this.globalStateDelta?this.globalStateDelta.map((e=>e.toEncodingData())):void 0],["group",this.group],["id",this.id],["inner-txns",void 0!==this.innerTxns?this.innerTxns.map((e=>e.toEncodingData())):void 0],["intra-round-offset",this.intraRoundOffset],["keyreg-transaction",void 0!==this.keyregTransaction?this.keyregTransaction.toEncodingData():void 0],["lease",this.lease],["local-state-delta",void 0!==this.localStateDelta?this.localStateDelta.map((e=>e.toEncodingData())):void 0],["logs",this.logs],["note",this.note],["payment-transaction",void 0!==this.paymentTransaction?this.paymentTransaction.toEncodingData():void 0],["receiver-rewards",this.receiverRewards],["rekey-to",void 0!==this.rekeyTo?this.rekeyTo.toString():void 0],["round-time",this.roundTime],["sender-rewards",this.senderRewards],["signature",void 0!==this.signature?this.signature.toEncodingData():void 0],["state-proof-transaction",void 0!==this.stateProofTransaction?this.stateProofTransaction.toEncodingData():void 0],["tx-type",this.txType]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded Transaction: ${e}`);return new so({fee:e.get("fee"),firstValid:e.get("first-valid"),lastValid:e.get("last-valid"),sender:e.get("sender"),applicationTransaction:void 0!==e.get("application-transaction")?co.fromEncodingData(e.get("application-transaction")):void 0,assetConfigTransaction:void 0!==e.get("asset-config-transaction")?ho.fromEncodingData(e.get("asset-config-transaction")):void 0,assetFreezeTransaction:void 0!==e.get("asset-freeze-transaction")?uo.fromEncodingData(e.get("asset-freeze-transaction")):void 0,assetTransferTransaction:void 0!==e.get("asset-transfer-transaction")?lo.fromEncodingData(e.get("asset-transfer-transaction")):void 0,authAddr:e.get("auth-addr"),closeRewards:e.get("close-rewards"),closingAmount:e.get("closing-amount"),confirmedRound:e.get("confirmed-round"),createdApplicationIndex:e.get("created-application-index"),createdAssetIndex:e.get("created-asset-index"),genesisHash:e.get("genesis-hash"),genesisId:e.get("genesis-id"),globalStateDelta:void 0!==e.get("global-state-delta")?e.get("global-state-delta").map((e=>qr.fromEncodingData(e))):void 0,group:e.get("group"),id:e.get("id"),innerTxns:void 0!==e.get("inner-txns")?e.get("inner-txns").map((e=>so.fromEncodingData(e))):void 0,intraRoundOffset:e.get("intra-round-offset"),keyregTransaction:void 0!==e.get("keyreg-transaction")?go.fromEncodingData(e.get("keyreg-transaction")):void 0,lease:e.get("lease"),localStateDelta:void 0!==e.get("local-state-delta")?e.get("local-state-delta").map((e=>yr.fromEncodingData(e))):void 0,logs:e.get("logs"),note:e.get("note"),paymentTransaction:void 0!==e.get("payment-transaction")?mo.fromEncodingData(e.get("payment-transaction")):void 0,receiverRewards:e.get("receiver-rewards"),rekeyTo:e.get("rekey-to"),roundTime:e.get("round-time"),senderRewards:e.get("sender-rewards"),signature:void 0!==e.get("signature")?fo.fromEncodingData(e.get("signature")):void 0,stateProofTransaction:void 0!==e.get("state-proof-transaction")?So.fromEncodingData(e.get("state-proof-transaction")):void 0,txType:e.get("tx-type")})}}class co{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"application-id",valueSchema:new ht,omitEmpty:!0},{key:"accounts",valueSchema:new kt(new mt(new ct)),omitEmpty:!0},{key:"application-args",valueSchema:new kt(new mt(new ut)),omitEmpty:!0},{key:"approval-program",valueSchema:new kt(new ut),omitEmpty:!0},{key:"clear-state-program",valueSchema:new kt(new ut),omitEmpty:!0},{key:"extra-program-pages",valueSchema:new kt(new ht),omitEmpty:!0},{key:"foreign-apps",valueSchema:new kt(new mt(new ht)),omitEmpty:!0},{key:"foreign-assets",valueSchema:new kt(new mt(new ht)),omitEmpty:!0},{key:"global-state-schema",valueSchema:new kt(io.encodingSchema),omitEmpty:!0},{key:"local-state-schema",valueSchema:new kt(io.encodingSchema),omitEmpty:!0},{key:"on-completion",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({applicationId:e,accounts:t,applicationArgs:n,approvalProgram:a,clearStateProgram:i,extraProgramPages:r,foreignApps:o,foreignAssets:s,globalStateSchema:c,localStateSchema:h,onCompletion:d}){this.applicationId=E(e),this.accounts=void 0!==t?t.map((e=>"string"==typeof e?G.fromString(e):e)):void 0,this.applicationArgs=n,this.approvalProgram="string"==typeof a?O(a):a,this.clearStateProgram="string"==typeof i?O(i):i,this.extraProgramPages=void 0===r?void 0:v(r),this.foreignApps=void 0===o?void 0:o.map(E),this.foreignAssets=void 0===s?void 0:s.map(E),this.globalStateSchema=c,this.localStateSchema=h,this.onCompletion=d}getEncodingSchema(){return co.encodingSchema}toEncodingData(){return new Map([["application-id",this.applicationId],["accounts",void 0!==this.accounts?this.accounts.map((e=>e.toString())):void 0],["application-args",this.applicationArgs],["approval-program",this.approvalProgram],["clear-state-program",this.clearStateProgram],["extra-program-pages",this.extraProgramPages],["foreign-apps",this.foreignApps],["foreign-assets",this.foreignAssets],["global-state-schema",void 0!==this.globalStateSchema?this.globalStateSchema.toEncodingData():void 0],["local-state-schema",void 0!==this.localStateSchema?this.localStateSchema.toEncodingData():void 0],["on-completion",this.onCompletion]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionApplication: ${e}`);return new co({applicationId:e.get("application-id"),accounts:e.get("accounts"),applicationArgs:e.get("application-args"),approvalProgram:e.get("approval-program"),clearStateProgram:e.get("clear-state-program"),extraProgramPages:e.get("extra-program-pages"),foreignApps:e.get("foreign-apps"),foreignAssets:e.get("foreign-assets"),globalStateSchema:void 0!==e.get("global-state-schema")?io.fromEncodingData(e.get("global-state-schema")):void 0,localStateSchema:void 0!==e.get("local-state-schema")?io.fromEncodingData(e.get("local-state-schema")):void 0,onCompletion:e.get("on-completion")})}}class ho{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"asset-id",valueSchema:new kt(new ht),omitEmpty:!0},{key:"params",valueSchema:new kt(Rr.encodingSchema),omitEmpty:!0})),this.encodingSchemaValue}constructor({assetId:e,params:t}){this.assetId=void 0===e?void 0:E(e),this.params=t}getEncodingSchema(){return ho.encodingSchema}toEncodingData(){return new Map([["asset-id",this.assetId],["params",void 0!==this.params?this.params.toEncodingData():void 0]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionAssetConfig: ${e}`);return new ho({assetId:e.get("asset-id"),params:void 0!==e.get("params")?Rr.fromEncodingData(e.get("params")):void 0})}}class uo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"address",valueSchema:new ct,omitEmpty:!0},{key:"asset-id",valueSchema:new ht,omitEmpty:!0},{key:"new-freeze-status",valueSchema:new st,omitEmpty:!0})),this.encodingSchemaValue}constructor({address:e,assetId:t,newFreezeStatus:n}){this.address=e,this.assetId=E(t),this.newFreezeStatus=n}getEncodingSchema(){return uo.encodingSchema}toEncodingData(){return new Map([["address",this.address],["asset-id",this.assetId],["new-freeze-status",this.newFreezeStatus]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionAssetFreeze: ${e}`);return new uo({address:e.get("address"),assetId:e.get("asset-id"),newFreezeStatus:e.get("new-freeze-status")})}}class lo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"amount",valueSchema:new ht,omitEmpty:!0},{key:"asset-id",valueSchema:new ht,omitEmpty:!0},{key:"receiver",valueSchema:new ct,omitEmpty:!0},{key:"close-amount",valueSchema:new kt(new ht),omitEmpty:!0},{key:"close-to",valueSchema:new kt(new ct),omitEmpty:!0},{key:"sender",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({amount:e,assetId:t,receiver:n,closeAmount:a,closeTo:i,sender:r}){this.amount=E(e),this.assetId=E(t),this.receiver=n,this.closeAmount=void 0===a?void 0:E(a),this.closeTo=i,this.sender=r}getEncodingSchema(){return lo.encodingSchema}toEncodingData(){return new Map([["amount",this.amount],["asset-id",this.assetId],["receiver",this.receiver],["close-amount",this.closeAmount],["close-to",this.closeTo],["sender",this.sender]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionAssetTransfer: ${e}`);return new lo({amount:e.get("amount"),assetId:e.get("asset-id"),receiver:e.get("receiver"),closeAmount:e.get("close-amount"),closeTo:e.get("close-to"),sender:e.get("sender")})}}class go{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"non-participation",valueSchema:new kt(new st),omitEmpty:!0},{key:"selection-participation-key",valueSchema:new kt(new ut),omitEmpty:!0},{key:"state-proof-key",valueSchema:new kt(new ut),omitEmpty:!0},{key:"vote-first-valid",valueSchema:new kt(new ht),omitEmpty:!0},{key:"vote-key-dilution",valueSchema:new kt(new ht),omitEmpty:!0},{key:"vote-last-valid",valueSchema:new kt(new ht),omitEmpty:!0},{key:"vote-participation-key",valueSchema:new kt(new ut),omitEmpty:!0})),this.encodingSchemaValue}constructor({nonParticipation:e,selectionParticipationKey:t,stateProofKey:n,voteFirstValid:a,voteKeyDilution:i,voteLastValid:r,voteParticipationKey:o}){this.nonParticipation=e,this.selectionParticipationKey="string"==typeof t?O(t):t,this.stateProofKey="string"==typeof n?O(n):n,this.voteFirstValid=void 0===a?void 0:E(a),this.voteKeyDilution=void 0===i?void 0:E(i),this.voteLastValid=void 0===r?void 0:E(r),this.voteParticipationKey="string"==typeof o?O(o):o}getEncodingSchema(){return go.encodingSchema}toEncodingData(){return new Map([["non-participation",this.nonParticipation],["selection-participation-key",this.selectionParticipationKey],["state-proof-key",this.stateProofKey],["vote-first-valid",this.voteFirstValid],["vote-key-dilution",this.voteKeyDilution],["vote-last-valid",this.voteLastValid],["vote-participation-key",this.voteParticipationKey]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionKeyreg: ${e}`);return new go({nonParticipation:e.get("non-participation"),selectionParticipationKey:e.get("selection-participation-key"),stateProofKey:e.get("state-proof-key"),voteFirstValid:e.get("vote-first-valid"),voteKeyDilution:e.get("vote-key-dilution"),voteLastValid:e.get("vote-last-valid"),voteParticipationKey:e.get("vote-participation-key")})}}class mo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"amount",valueSchema:new ht,omitEmpty:!0},{key:"receiver",valueSchema:new ct,omitEmpty:!0},{key:"close-amount",valueSchema:new kt(new ht),omitEmpty:!0},{key:"close-remainder-to",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({amount:e,receiver:t,closeAmount:n,closeRemainderTo:a}){this.amount=E(e),this.receiver=t,this.closeAmount=void 0===n?void 0:E(n),this.closeRemainderTo=a}getEncodingSchema(){return mo.encodingSchema}toEncodingData(){return new Map([["amount",this.amount],["receiver",this.receiver],["close-amount",this.closeAmount],["close-remainder-to",this.closeRemainderTo]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionPayment: ${e}`);return new mo({amount:e.get("amount"),receiver:e.get("receiver"),closeAmount:e.get("close-amount"),closeRemainderTo:e.get("close-remainder-to")})}}class po{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"current-round",valueSchema:new ht,omitEmpty:!0},{key:"transaction",valueSchema:so.encodingSchema,omitEmpty:!0})),this.encodingSchemaValue}constructor({currentRound:e,transaction:t}){this.currentRound=E(e),this.transaction=t}getEncodingSchema(){return po.encodingSchema}toEncodingData(){return new Map([["current-round",this.currentRound],["transaction",this.transaction.toEncodingData()]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionResponse: ${e}`);return new po({currentRound:e.get("current-round"),transaction:so.fromEncodingData(e.get("transaction")??new Map)})}}class fo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"logicsig",valueSchema:new kt(yo.encodingSchema),omitEmpty:!0},{key:"multisig",valueSchema:new kt(wo.encodingSchema),omitEmpty:!0},{key:"sig",valueSchema:new kt(new ut),omitEmpty:!0})),this.encodingSchemaValue}constructor({logicsig:e,multisig:t,sig:n}){this.logicsig=e,this.multisig=t,this.sig="string"==typeof n?O(n):n}getEncodingSchema(){return fo.encodingSchema}toEncodingData(){return new Map([["logicsig",void 0!==this.logicsig?this.logicsig.toEncodingData():void 0],["multisig",void 0!==this.multisig?this.multisig.toEncodingData():void 0],["sig",this.sig]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionSignature: ${e}`);return new fo({logicsig:void 0!==e.get("logicsig")?yo.fromEncodingData(e.get("logicsig")):void 0,multisig:void 0!==e.get("multisig")?wo.fromEncodingData(e.get("multisig")):void 0,sig:e.get("sig")})}}class yo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"logic",valueSchema:new ut,omitEmpty:!0},{key:"args",valueSchema:new kt(new mt(new ut)),omitEmpty:!0},{key:"multisig-signature",valueSchema:new kt(wo.encodingSchema),omitEmpty:!0},{key:"signature",valueSchema:new kt(new ut),omitEmpty:!0})),this.encodingSchemaValue}constructor({logic:e,args:t,multisigSignature:n,signature:a}){this.logic="string"==typeof e?O(e):e,this.args=t,this.multisigSignature=n,this.signature="string"==typeof a?O(a):a}getEncodingSchema(){return yo.encodingSchema}toEncodingData(){return new Map([["logic",this.logic],["args",this.args],["multisig-signature",void 0!==this.multisigSignature?this.multisigSignature.toEncodingData():void 0],["signature",this.signature]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionSignatureLogicsig: ${e}`);return new yo({logic:e.get("logic"),args:e.get("args"),multisigSignature:void 0!==e.get("multisig-signature")?wo.fromEncodingData(e.get("multisig-signature")):void 0,signature:e.get("signature")})}}class wo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"subsignature",valueSchema:new kt(new mt(vo.encodingSchema)),omitEmpty:!0},{key:"threshold",valueSchema:new kt(new ht),omitEmpty:!0},{key:"version",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({subsignature:e,threshold:t,version:n}){this.subsignature=e,this.threshold=void 0===t?void 0:v(t),this.version=void 0===n?void 0:v(n)}getEncodingSchema(){return wo.encodingSchema}toEncodingData(){return new Map([["subsignature",void 0!==this.subsignature?this.subsignature.map((e=>e.toEncodingData())):void 0],["threshold",this.threshold],["version",this.version]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionSignatureMultisig: ${e}`);return new wo({subsignature:void 0!==e.get("subsignature")?e.get("subsignature").map((e=>vo.fromEncodingData(e))):void 0,threshold:e.get("threshold"),version:e.get("version")})}}class vo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"public-key",valueSchema:new kt(new ut),omitEmpty:!0},{key:"signature",valueSchema:new kt(new ut),omitEmpty:!0})),this.encodingSchemaValue}constructor({publicKey:e,signature:t}){this.publicKey="string"==typeof e?O(e):e,this.signature="string"==typeof t?O(t):t}getEncodingSchema(){return vo.encodingSchema}toEncodingData(){return new Map([["public-key",this.publicKey],["signature",this.signature]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionSignatureMultisigSubsignature: ${e}`);return new vo({publicKey:e.get("public-key"),signature:e.get("signature")})}}class So{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"message",valueSchema:new kt(Gr.encodingSchema),omitEmpty:!0},{key:"state-proof",valueSchema:new kt(Xr.encodingSchema),omitEmpty:!0},{key:"state-proof-type",valueSchema:new kt(new ht),omitEmpty:!0})),this.encodingSchemaValue}constructor({message:e,stateProof:t,stateProofType:n}){this.message=e,this.stateProof=t,this.stateProofType=void 0===n?void 0:v(n)}getEncodingSchema(){return So.encodingSchema}toEncodingData(){return new Map([["message",void 0!==this.message?this.message.toEncodingData():void 0],["state-proof",void 0!==this.stateProof?this.stateProof.toEncodingData():void 0],["state-proof-type",this.stateProofType]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionStateProof: ${e}`);return new So({message:void 0!==e.get("message")?Gr.fromEncodingData(e.get("message")):void 0,stateProof:void 0!==e.get("state-proof")?Xr.fromEncodingData(e.get("state-proof")):void 0,stateProofType:e.get("state-proof-type")})}}class Eo{static get encodingSchema(){return this.encodingSchemaValue||(this.encodingSchemaValue=new ft([]),this.encodingSchemaValue.pushEntries({key:"current-round",valueSchema:new ht,omitEmpty:!0},{key:"transactions",valueSchema:new mt(so.encodingSchema),omitEmpty:!0},{key:"next-token",valueSchema:new kt(new ct),omitEmpty:!0})),this.encodingSchemaValue}constructor({currentRound:e,transactions:t,nextToken:n}){this.currentRound=E(e),this.transactions=t,this.nextToken=n}getEncodingSchema(){return Eo.encodingSchema}toEncodingData(){return new Map([["current-round",this.currentRound],["transactions",this.transactions.map((e=>e.toEncodingData()))],["next-token",this.nextToken]])}static fromEncodingData(e){if(!(e instanceof Map))throw new Error(`Invalid decoded TransactionsResponse: ${e}`);return new Eo({currentRound:e.get("current-round"),transactions:(e.get("transactions")??[]).map((e=>so.fromEncodingData(e))),nextToken:e.get("next-token")})}}class ko extends Di{path(){return"/health"}prepare(e){return rt(e.getJSONText(),jr)}}class bo extends Di{constructor(e,t){super(e),this.index=t}path(){return`/v2/assets/${this.index}/balances`}limit(e){return this.query.limit=e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return rt(e.getJSONText(),Mr)}}function xo(e){return"string"==typeof e?e:$(e)}class Ao extends Di{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/transactions`}notePrefix(e){return this.query["note-prefix"]=xo(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}assetID(e){return this.query["asset-id"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e instanceof Date?e.toISOString():e,this}afterTime(e){return this.query["after-time"]=e instanceof Date?e.toISOString():e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}prepare(e){return rt(e.getJSONText(),Eo)}}class Do extends Di{constructor(e,t){super(e),this.index=t}path(){return`/v2/assets/${this.index}/transactions`}notePrefix(e){return this.query["note-prefix"]=xo(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e instanceof Date?e.toISOString():e,this}afterTime(e){return this.query["after-time"]=e instanceof Date?e.toISOString():e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}addressRole(e){return this.query["address-role"]=e,this}address(e){return this.query.address=e.toString(),this}excludeCloseTo(e){return this.query["exclude-close-to"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}prepare(e){return rt(e.getJSONText(),Eo)}}class To extends Di{constructor(e,t){super(e),this.round=t}path(){return`/v2/blocks/${this.round}`}headerOnly(e){return this.query["header-only"]=e,this}prepare(e){return rt(e.getJSONText(),Ur)}}class Io extends Di{constructor(e,t){super(e),this.txID=t}path(){return`/v2/transactions/${this.txID}`}prepare(e){return rt(e.getJSONText(),po)}}class Mo extends Di{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}`}round(e){return this.query.round=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}exclude(e){return this.query.exclude=e,this}prepare(e){return rt(e.getJSONText(),fr)}}class Vo extends Di{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/assets`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}assetId(e){return this.query["asset-id"]=e,this}prepare(e){return rt(e.getJSONText(),Pr)}}class Po extends Di{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/created-assets`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}assetID(e){return this.query["asset-id"]=e,this}prepare(e){return rt(e.getJSONText(),Cr)}}class Ro extends Di{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/apps-local-state`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}applicationID(e){return this.query["application-id"]=e,this}prepare(e){return rt(e.getJSONText(),Er)}}class Bo extends Di{constructor(e,t){super(e),this.account=t.toString()}path(){return`/v2/accounts/${this.account}/created-applications`}limit(e){return this.query.limit=e,this}round(e){return this.query.round=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}applicationID(e){return this.query["application-id"]=e,this}prepare(e){return rt(e.getJSONText(),Tr)}}class Co extends Di{constructor(e,t){super(e),this.index=t}path(){return`/v2/assets/${this.index}`}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return rt(e.getJSONText(),Br)}}class Uo extends Di{constructor(e,t){super(e),this.index=t}path(){return`/v2/applications/${this.index}`}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return rt(e.getJSONText(),Ar)}}class Oo extends Di{constructor(e,t){super(e),this.appID=t}path(){return`/v2/applications/${this.appID}/logs`}limit(e){return this.query.limit=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}nextToken(e){return this.query.next=e,this}sender(e){return this.query["sender-address"]=e,this}txid(e){return this.query.txid=e,this}prepare(e){return rt(e.getJSONText(),br)}}class $o extends Di{constructor(e,t,n){super(e),this.index=t;const a=$(n);this.query.name=encodeURI(`b64:${a}`)}path(){return`/v2/applications/${this.index}/box`}prepare(e){return rt(e.getJSONText(),Lr)}}class No extends Di{path(){return"/v2/accounts"}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}limit(e){return this.query.limit=e,this}assetID(e){return this.query["asset-id"]=e,this}nextToken(e){return this.query.next=e,this}round(e){return this.query.round=e,this}authAddr(e){return this.query["auth-addr"]=e.toString(),this}applicationID(e){return this.query["application-id"]=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}exclude(e){return this.query.exclude=e,this}prepare(e){return rt(e.getJSONText(),wr)}}class Lo extends Di{path(){return"/v2/transactions"}notePrefix(e){return this.query["note-prefix"]=xo(e),this}txType(e){return this.query["tx-type"]=e,this}sigType(e){return this.query["sig-type"]=e,this}txid(e){return this.query.txid=e,this}round(e){return this.query.round=e,this}minRound(e){return this.query["min-round"]=e,this}maxRound(e){return this.query["max-round"]=e,this}assetID(e){return this.query["asset-id"]=e,this}limit(e){return this.query.limit=e,this}beforeTime(e){return this.query["before-time"]=e instanceof Date?e.toISOString():e,this}afterTime(e){return this.query["after-time"]=e instanceof Date?e.toISOString():e,this}addressRole(e){return this.query["address-role"]=e,this}address(e){return this.query.address=e.toString(),this}excludeCloseTo(e){return this.query["exclude-close-to"]=e,this}nextToken(e){return this.query.next=e,this}rekeyTo(e){return this.query["rekey-to"]=e,this}applicationID(e){return this.query["application-id"]=e,this}currencyGreaterThan(e){return this.query["currency-greater-than"]=e.toString(),this}currencyLessThan(e){return this.query["currency-less-than"]=e,this}prepare(e){return rt(e.getJSONText(),Eo)}}class _o extends Di{path(){return"/v2/assets"}limit(e){return this.query.limit=e,this}creator(e){return this.query.creator=e.toString(),this}name(e){return this.query.name=e,this}unit(e){return this.query.unit=e,this}index(e){return this.query["asset-id"]=e,this}nextToken(e){return this.query.next=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return rt(e.getJSONText(),Cr)}}class zo extends Di{path(){return"/v2/applications"}index(e){return this.query["application-id"]=e,this}creator(e){return this.query.creator=e.toString(),this}nextToken(e){return this.query.next=e,this}limit(e){return this.query.limit=e,this}includeAll(e=!0){return this.query["include-all"]=e,this}prepare(e){return rt(e.getJSONText(),Tr)}}class Fo extends Di{constructor(e,t){super(e),this.index=t}path(){return`/v2/applications/${this.index}/boxes`}nextToken(e){return this.query.next=e,this}limit(e){return this.query.limit=e,this}prepare(e){return rt(e.getJSONText(),zr)}}class Ko extends ce{constructor(e,t="http://127.0.0.1",n=8080,a={}){super("X-Indexer-API-Token",e,t,n,a)}makeHealthCheck(){return new ko(this.c)}lookupAssetBalances(e){return new bo(this.c,e)}lookupAssetTransactions(e){return new Do(this.c,e)}lookupAccountTransactions(e){return new Ao(this.c,e)}lookupBlock(e){return new To(this.c,e)}lookupTransactionByID(e){return new Io(this.c,e)}lookupAccountByID(e){return new Mo(this.c,e)}lookupAccountAssets(e){return new Vo(this.c,e)}lookupAccountCreatedAssets(e){return new Po(this.c,e)}lookupAccountAppLocalStates(e){return new Ro(this.c,e)}lookupAccountCreatedApplications(e){return new Bo(this.c,e)}lookupAssetByID(e){return new Co(this.c,e)}lookupApplications(e){return new Uo(this.c,e)}lookupApplicationLogs(e){return new Oo(this.c,e)}searchAccounts(){return new No(this.c)}searchForTransactions(){return new Lo(this.c)}searchForAssets(){return new _o(this.c)}searchForApplications(){return new zo(this.c)}searchForApplicationBoxes(e){return new Fo(this.c,e)}lookupApplicationBoxByIDandName(e,t){return new $o(this.c,e,t)}}async function qo(e,t,n){const a=await e.status().do();if(void 0===a)throw new Error("Unable to get node status");const i=Number(a.lastRound)+1;let r=i;for(;r<i+n;){let n=!1;try{const a=await e.pendingTransactionInformation(t).do();if(a.confirmedRound)return a;if(a.poolError)throw n=!0,new Error(`Transaction Rejected: ${a.poolError}`)}catch(e){if(n)throw e}await e.statusAfterBlock(r).do(),r+=1}throw new Error(`Transaction not confirmed after ${n} rounds`)}function Ho(e,t){let n=e.toString(16);n.length!==2*t&&(n=n.padStart(2*t,"0"));const a=new Uint8Array(n.length/2);for(let e=0,t=0;e<n.length/2;e++,t+=2)a[e]=parseInt(n.slice(t,t+2),16);return a}function jo(e){let t=BigInt(0);const n=new DataView(e.buffer,e.byteOffset);for(let a=0;a<e.length;a++)t=BigInt(Number(n.getUint8(a)))+t*BigInt(256);return t}function Go(){const e=x((t=s().box.secretKeyLength,function(){const{navigator:e}=globalThis;return"object"==typeof e&&"ReactNative"===e.product}()&&console.warn("It looks like you're running in react-native. In order to perform common crypto operations you will need to polyfill common operations such as crypto.getRandomValues"),s().randomBytes(t)));var t;return{addr:new G(e.publicKey),sk:e.secretKey}}const Jo=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"],Wo="failed to decode mnemonic",Yo="the mnemonic contains a word that is not in the wordlist";function Xo(e){const t=[];let n=0,a=0;return e.forEach((function(e){n|=e<<a,a+=8,a>=11&&(t.push(2047&n),n>>=11,a-=11)})),a&&t.push(n),t}function Zo(e){return e.map((e=>Jo[e]))}function Qo(e){return Zo(Xo(b(e)))[0]}function es(e){if(e.length!==P)throw new RangeError(`Seed length must be ${P}`);const t=Zo(Xo(e)),n=Qo(e);return`${t.join(" ")} ${n}`}function ts(e){const t=e.split(" "),n=t.slice(0,24);for(const e of n)if(-1===Jo.indexOf(e))throw new Error(Yo);const a=t[t.length-1];let i=function(e){const t=[];let n=0,a=0;return e.forEach((function(e){for(n|=e<<a,a+=11;a>=8;)t.push(255&n),n>>=8,a-=8})),a&&t.push(n),new Uint8Array(t)}(n.map((e=>Jo.indexOf(e))));if(33!==i.length)throw new Error(Wo);if(0!==i[i.length-1])throw new Error(Wo);if(i=i.slice(0,i.length-1),Qo(i)===a)return i;throw new Error(Wo)}function ns(e){const t=x(ts(e));return{addr:new G(t.publicKey),sk:t.secretKey}}function as(e){return es(e.slice(0,P))}function is(e){return ts(e)}function rs(e){return es(e)}const os=16,ss=(new TextEncoder).encode("TG");function cs(e){const t=[];for(const n of e)t.push(n.rawTxID());const n=b(function(e){if(e.length>os)throw new Error(`${e.length} transactions grouped together but max group size is ${os}`);if(0===e.length)throw new Error("Cannot compute group ID of zero transactions");const t=qe({txlist:e});return y(ss,t)}(t));return Uint8Array.from(n)}function hs(e){const t=cs(e);for(const n of e)n.group=t;return e}function ds(e,t){let n,a;return t instanceof yn?(n=t.lsig,a=t.address()):(n=t,a=n.sig?new G(e.sender.publicKey):n.msig?an({version:n.msig.v,threshold:n.msig.thr,pks:n.msig.subsig.map((e=>e.pk))}):n.address()),function(e,t,n){if(!t.verify(n.publicKey))throw new Error("Logic signature verification failed. Ensure the program and signature are valid.");let a;I(n.publicKey,e.sender.publicKey)||(a=n);const i=new bn({lsig:t,txn:e,sgnr:a});return{txID:e.txID(),blob:it(i)}}(e,n,a)}function us(e,t){return ds(e,t)}const ls="Not enough multisig transactions to merge. Need at least two",gs="Cannot merge txs. txIDs differ",ms="Cannot merge txs. Auth addrs differ",ps="Cannot merge txs. Multisig preimages differ",fs="Cannot merge txs. subsigs are mismatched.",ys="Cannot add multisig signature. Signature is not of the correct length.",ws="Key does not exist";function vs(e,{version:t,threshold:n,addrs:a}){const i=nn(a),r={v:t,thr:n,subsig:i.map((e=>({pk:e})))},o=an({version:t,threshold:n,pks:i});let s;return e.sender.equals(o)||(s=o),it(new bn({txn:e,msig:r,sgnr:s}))}function Ss(e,{rawSig:t,myPk:n},{version:a,threshold:i,pks:r}){const o=at(vs(e,{version:a,threshold:i,addrs:r.map((e=>new G(e)))}),bn);let s=!1;if(o.msig.subsig.forEach(((e,a)=>{I(e.pk,n)&&(s=!0,o.msig.subsig[a].s=t)})),!s)throw new Error(ws);return it(o)}function Es(e,{version:t,threshold:n,pks:a},i){const r=D(i).publicKey;return Ss(e,{rawSig:e.rawSignTxn(i),myPk:r},{version:t,threshold:n,pks:a})}function ks(e){if(e.length<2)throw new Error(ls);const t=at(e[0],bn);if(!t.msig)throw new Error("Invalid multisig transaction, multisig structure missing at index 0");const n=t.txn.txID(),a=t.sgnr?t.sgnr.toString():void 0,i=an({version:t.msig.v,threshold:t.msig.thr,pks:t.msig.subsig.map((e=>e.pk))}),r=t.msig.subsig.map((e=>({...e})));for(let o=1;o<e.length;o++){const s=at(e[o],bn);if(!s.msig)throw new Error(`Invalid multisig transaction, multisig structure missing at index ${o}`);if(s.txn.txID()!==n)throw new Error(gs);if(a!==(s.sgnr?s.sgnr.toString():void 0))throw new Error(ms);if(s.msig.subsig.length!==t.msig.subsig.length)throw new Error(ps);const c=an({version:s.msig.v,threshold:s.msig.thr,pks:s.msig.subsig.map((e=>e.pk))});if(!i.equals(c))throw new Error(ps);s.msig.subsig.forEach(((e,t)=>{if(!e.s)return;const n=r[t];if(n.s&&!f(e.s,n.s))throw new Error(fs);n.s=e.s}))}const o={v:t.msig.v,thr:t.msig.thr,subsig:r},s=void 0!==a?t.sgnr:void 0;return it(new bn({msig:o,txn:t.txn,sgnr:s}))}function bs(e,{version:t,threshold:n,addrs:a},i){const r=Es(e,{version:t,threshold:n,pks:nn(a)},i);return{txID:e.txID(),blob:r}}function xs(e,{version:t,threshold:n,addrs:a},i){const r=nn(a),o=at(e,bn),s=Es(o.txn,{version:t,threshold:n,pks:r},i);return{txID:o.txn.txID(),blob:ks([e,s])}}function As(e,{version:t,threshold:n,addrs:a},i,r){const o=nn(a),s=at(e,bn),c=function(e,t,n,a){if(!A(a.length))throw new Error(ys);return Ss(e,{rawSig:a,myPk:("string"==typeof n?G.fromString(n):n).publicKey},t)}(s.txn,{version:t,threshold:n,pks:o},i,r);return{txID:s.txn.txID(),blob:ks([e,c])}}let Ds={},Ts={};function Is(e){let t=[],n=0,a=0;for(let i=0;i<e.length;i+=1){let r=Ds[e[i]];if(void 0===r)throw new Error("Invalid character ("+e[i]+")");const o=32&r;if(r&=31,a+=r<<n,o)n+=5;else{const e=1&a;a>>>=1,e?t.push(0===a?-2147483648:-a):t.push(a),a=n=0}}return t}"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split("").forEach((function(e,t){Ds[e]=t,Ts[t]=e}));class Ms{constructor({version:e,sources:t,names:n,mappings:a}){if(this.version=e,this.sources=t,this.names=n,this.mappings=a,3!==this.version)throw new Error(`Only version 3 is supported, got ${this.version}`);if(void 0===this.mappings)throw new Error("mapping undefined, cannot build source map without `mapping`");const i=this.mappings.split(";").map(Is);this.pcToLocation=new Map,this.sourceAndLineToPc=new Map;const r={line:0,column:0,sourceIndex:0,nameIndex:0};for(const[e,t]of i.entries()){if(t.length<4)continue;const n=t.length>4?t[4]:void 0,[,a,i,o]=t;r.sourceIndex+=a,r.line+=i,r.column+=o,void 0!==n&&(r.nameIndex+=n);const s=`${r.sourceIndex}:${r.line}`;let c=this.sourceAndLineToPc.get(s);void 0===c&&(c=[],this.sourceAndLineToPc.set(s,c));const h={pc:e,column:r.column},d={line:r.line,column:r.column,sourceIndex:r.sourceIndex};void 0!==n&&(h.nameIndex=r.nameIndex,d.nameIndex=r.nameIndex),c.push(h),this.pcToLocation.set(e,d)}}getPcs(){return Array.from(this.pcToLocation.keys())}getLocationForPc(e){return this.pcToLocation.get(e)}getPcsOnSourceLine(e,t){const n=this.sourceAndLineToPc.get(`${e}:${t}`);return void 0===n?[]:n}}const Vs=1380011588,Ps=30;async function Rs({client:e,txns:t,protocolVersion:n,latestTimestamp:a,round:i,sources:r}){const o=[],s=[],c=[],h=[],d=[];for(const e of t)if(e.txn.type===Qe.appl)if(d.push(e.txn.sender.toString()),d.push(...e.txn.applicationCall.accounts.map((e=>e.toString()))),c.push(...e.txn.applicationCall.foreignApps),d.push(...e.txn.applicationCall.foreignApps.map(Z).map((e=>e.toString()))),h.push(...e.txn.applicationCall.foreignAssets),e.txn.applicationCall.appIndex===BigInt(0))o.push(new ya({id:Vs,params:new ka({creator:e.txn.sender.toString(),approvalProgram:e.txn.applicationCall.approvalProgram,clearStateProgram:e.txn.applicationCall.clearProgram,localStateSchema:new xa({numUint:e.txn.applicationCall.numLocalInts,numByteSlice:e.txn.applicationCall.numLocalByteSlices}),globalStateSchema:new xa({numUint:e.txn.applicationCall.numGlobalInts,numByteSlice:e.txn.applicationCall.numGlobalByteSlices})})}));else{const{appIndex:t}=e.txn.applicationCall;c.push(t),d.push(Z(t).toString())}const u=[];for(const t of new Set(h))u.push(e.getAssetByID(t).do().then((e=>{d.push(e.params.creator)})));await Promise.all(u);const l=[];for(const t of new Set(c))l.push(e.getApplicationByID(t).do().then((e=>{o.push(e),d.push(e.params.creator.toString())})));await Promise.all(l);const g=[];for(const t of new Set(d))g.push(e.accountInformation(t).do().then((e=>{s.push(e)})));return await Promise.all(g),new Fa({txns:t.slice(),accounts:s,apps:o,latestTimestamp:a??0,round:i??0,protocolVersion:n??"",sources:r??[]})}function Bs(e,t){return e.length>t&&t>0?`${e.slice(0,t)}...`:e}function Cs(e,t){if(0===t.length)return"";let n=null;for(let a=0;a<t.length;a++)(a>e.length||p(e[a])!==p(t[a]))&&(n=a);if(null==n)return"";const a=t[n];return a.bytes.length>0?`${n} = 0x${_(a.bytes)}`:`${n} = ${a.uint.toString()}`}function Us(e,t){return`[${(t?e.reverse():e).map((e=>{switch(e.type){case 1:return`0x${_(e.bytes)}`;case 2:return e.uint.toString();default:return""}})).join(", ")}]`}function Os(e,t,n){const a=n.maxValueWidth||Ps,i=[["pc#","ln#","source","scratch","stack"]];for(let r=0;r<e.length;r++){const{line:o,error:s,pc:c,scratch:h,stack:d}=e[r],u=void 0!==h?h:[],l=r>0&&void 0!==e[r-1].scratch?e[r-1].scratch:[],g=s?`!! ${s} !!`:t[o];i.push([c.toString().padEnd(3," "),o.toString().padEnd(3," "),Bs(g,a),Bs(Cs(l,u),a),Bs(Us(d,n.topOfStackFirst),a)])}const r=i.reduce(((e,t)=>{const n=new Array(i[0].length).fill(0);for(let a=0;a<e.length;a++)n[a]=t[a].length>e[a]?t[a].length:e[a];return n}),new Array(i[0].length).fill(0));return`${i.map((e=>e.map(((e,t)=>e.padEnd(r[t]+1," "))).join("|").trim())).join("\n")}\n`}function $s(e,t){if(!e.appCallTrace||!e.disassembly)return"";let n=t;return n=void 0!==t?t:{maxValueWidth:Ps,topOfStackFirst:!1},Os(e.appCallTrace,e.disassembly,n)}function Ns(e,t){if(!e.logicSigTrace||!e.logicSigDisassembly)return"";let n;return n=void 0!==t?t:{maxValueWidth:Ps,topOfStackFirst:!0},Os(e.logicSigTrace,e.logicSigDisassembly,n)}function Ls({sender:e,receiver:t,amount:n,closeRemainderTo:a,suggestedParams:i,note:r,lease:o,rekeyTo:s}){return new Jt({type:Qe.pay,sender:e,note:r,lease:o,rekeyTo:s,suggestedParams:i,paymentParams:{receiver:t,amount:n,closeRemainderTo:a}})}function _s({sender:e,voteKey:t,selectionKey:n,stateProofKey:a,voteFirst:i,voteLast:r,voteKeyDilution:o,nonParticipation:s,suggestedParams:c,note:h,lease:d,rekeyTo:u}){return new Jt({type:Qe.keyreg,sender:e,note:h,lease:d,rekeyTo:u,suggestedParams:c,keyregParams:{voteKey:t,selectionKey:n,stateProofKey:a,voteFirst:i,voteLast:r,voteKeyDilution:o,nonParticipation:s}})}function zs({sender:e,assetIndex:t,total:n,decimals:a,defaultFrozen:i,manager:r,reserve:o,freeze:s,clawback:c,unitName:h,assetName:d,assetURL:u,assetMetadataHash:l,note:g,lease:m,rekeyTo:p,suggestedParams:f}){return new Jt({type:Qe.acfg,sender:e,note:g,lease:m,rekeyTo:p,suggestedParams:f,assetConfigParams:{assetIndex:t,total:n,decimals:a,defaultFrozen:i,manager:r,reserve:o,freeze:s,clawback:c,unitName:h,assetName:d,assetURL:u,assetMetadataHash:l}})}function Fs({sender:e,total:t,decimals:n,defaultFrozen:a,manager:i,reserve:r,freeze:o,clawback:s,unitName:c,assetName:h,assetURL:d,assetMetadataHash:u,note:l,lease:g,rekeyTo:m,suggestedParams:p}){return zs({sender:e,total:t,decimals:n,defaultFrozen:a,manager:i,reserve:r,freeze:o,clawback:s,unitName:c,assetName:h,assetURL:d,assetMetadataHash:u,note:l,lease:g,rekeyTo:m,suggestedParams:p})}function Ks({sender:e,assetIndex:t,manager:n,reserve:a,freeze:i,clawback:r,strictEmptyAddressChecking:o,note:s,lease:c,rekeyTo:h,suggestedParams:d}){if(!t)throw Error("assetIndex must be provided");if((o??1)&&(null==n||null==a||null==i||null==r))throw Error("strictEmptyAddressChecking is enabled, but an address is empty. If this is intentional, set strictEmptyAddressChecking to false.");return zs({sender:e,assetIndex:t,manager:n,reserve:a,freeze:i,clawback:r,note:s,lease:c,rekeyTo:h,suggestedParams:d})}function qs({sender:e,assetIndex:t,note:n,lease:a,rekeyTo:i,suggestedParams:r}){if(!t)throw Error("assetIndex must be provided");return zs({sender:e,assetIndex:t,note:n,lease:a,rekeyTo:i,suggestedParams:r})}function Hs({sender:e,assetIndex:t,freezeTarget:n,frozen:a,suggestedParams:i,note:r,lease:o,rekeyTo:s}){return new Jt({type:Qe.afrz,sender:e,note:r,lease:o,rekeyTo:s,suggestedParams:i,assetFreezeParams:{assetIndex:t,freezeTarget:n,frozen:a}})}function js({sender:e,receiver:t,amount:n,closeRemainderTo:a,assetSender:i,note:r,assetIndex:o,suggestedParams:s,rekeyTo:c,lease:h}){if(!o)throw Error("assetIndex must be provided");return new Jt({type:Qe.axfer,sender:e,note:r,lease:h,rekeyTo:c,suggestedParams:s,assetTransferParams:{assetIndex:o,receiver:t,amount:n,assetSender:i,closeRemainderTo:a}})}function Gs({sender:e,appIndex:t,onComplete:n,appArgs:a,accounts:i,foreignApps:r,foreignAssets:o,boxes:s,approvalProgram:c,clearProgram:h,numLocalInts:d,numLocalByteSlices:u,numGlobalInts:l,numGlobalByteSlices:g,extraPages:m,note:p,lease:f,rekeyTo:y,suggestedParams:w}){if(null==n)throw Error("onComplete must be provided");return new Jt({type:Qe.appl,sender:e,note:p,lease:f,rekeyTo:y,suggestedParams:w,appCallParams:{appIndex:t,onComplete:n,appArgs:a,accounts:i,foreignAssets:o,foreignApps:r,boxes:s,approvalProgram:c,clearProgram:h,numLocalInts:d,numLocalByteSlices:u,numGlobalInts:l,numGlobalByteSlices:g,extraPages:m}})}function Js({sender:e,onComplete:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,approvalProgram:s,clearProgram:c,numLocalInts:h,numLocalByteSlices:d,numGlobalInts:u,numGlobalByteSlices:l,extraPages:g,note:m,lease:p,rekeyTo:f,suggestedParams:y}){if(!s||!c)throw Error("approvalProgram and clearProgram must be provided");if(null==t)throw Error("onComplete must be provided");return Gs({sender:e,appIndex:0,onComplete:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,approvalProgram:s,clearProgram:c,numLocalInts:h,numLocalByteSlices:d,numGlobalInts:u,numGlobalByteSlices:l,extraPages:g,note:m,lease:p,rekeyTo:f,suggestedParams:y})}function Ws({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,approvalProgram:s,clearProgram:c,note:h,lease:d,rekeyTo:u,suggestedParams:l}){if(!t)throw Error("appIndex must be provided");if(!s||!c)throw Error("approvalProgram and clearProgram must be provided");return Gs({sender:e,appIndex:t,onComplete:et.UpdateApplicationOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,approvalProgram:s,clearProgram:c,note:h,lease:d,rekeyTo:u,suggestedParams:l})}function Ys({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,note:s,lease:c,rekeyTo:h,suggestedParams:d}){if(!t)throw Error("appIndex must be provided");return Gs({sender:e,appIndex:t,onComplete:et.DeleteApplicationOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,note:s,lease:c,rekeyTo:h,suggestedParams:d})}function Xs({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,note:s,lease:c,rekeyTo:h,suggestedParams:d}){if(!t)throw Error("appIndex must be provided");return Gs({sender:e,appIndex:t,onComplete:et.OptInOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,note:s,lease:c,rekeyTo:h,suggestedParams:d})}function Zs({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,note:s,lease:c,rekeyTo:h,suggestedParams:d}){if(!t)throw Error("appIndex must be provided");return Gs({sender:e,appIndex:t,onComplete:et.CloseOutOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,note:s,lease:c,rekeyTo:h,suggestedParams:d})}function Qs({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,note:s,lease:c,rekeyTo:h,suggestedParams:d}){if(!t)throw Error("appIndex must be provided");return Gs({sender:e,appIndex:t,onComplete:et.ClearStateOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,note:s,lease:c,rekeyTo:h,suggestedParams:d})}function ec({sender:e,appIndex:t,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,note:s,lease:c,rekeyTo:h,suggestedParams:d}){if(!t)throw Error("appIndex must be provided");return Gs({sender:e,appIndex:t,onComplete:et.NoOpOC,appArgs:n,accounts:a,foreignApps:i,foreignAssets:r,boxes:o,note:s,lease:c,rekeyTo:h,suggestedParams:d})}function tc(e){return(t,n)=>{const a=[];for(const i of n)a.push(t[i].signTxn(e.sk));return Promise.resolve(a)}}function nc(e){return(t,n)=>{const a=[];for(const i of n){const{blob:n}=ds(t[i],e);a.push(n)}return Promise.resolve(a)}}function ac(e,t){return(n,a)=>{const i=[];for(const r of a){const a=n[r],o=[];for(const n of t){const{blob:t}=bs(a,e,n);o.push(t)}o.length>1?i.push(ks(o)):i.push(o[0])}return Promise.resolve(i)}}function ic(){return(e,t)=>{const n=[];for(const a of t)n.push(An(e[a]));return Promise.resolve(n)}}function rc(e){return"object"==typeof e&&2===Object.keys(e).length&&"object"==typeof e.txn&&"function"==typeof e.signer}const oc=65535,sc=32,cc=1,hc=1,dc=2,uc=/^([a-z\d[\](),]+)\[(0|[1-9][\d]*)]$/,lc=/^ufixed([1-9][\d]*)x([1-9][\d]*)$/;class gc{static from(e){if(e.endsWith("[]")){const t=gc.from(e.slice(0,e.length-2));return new Ec(t)}if(e.endsWith("]")){const t=e.match(uc);if(!t||3!==t.length)throw new Error(`malformed static array string: ${e}`);const n=t[2],a=parseInt(n,10);if(a>oc)throw new Error(`array length exceeds limit ${oc}`);const i=gc.from(t[1]);return new Sc(i,a)}if(e.startsWith("uint")){const t=e=>[...e].every((e=>"0123456789".includes(e))),n=e.slice(4,e.length);if(!t(n))throw new Error(`malformed uint string: ${n}`);const a=parseInt(n,10);if(a>oc)throw new Error(`malformed uint string: ${a}`);return new mc(a)}if("byte"===e)return new wc;if(e.startsWith("ufixed")){const t=e.match(lc);if(!t||3!==t.length)throw new Error(`malformed ufixed type: ${e}`);const n=parseInt(t[1],10),a=parseInt(t[2],10);return new pc(n,a)}if("bool"===e)return new yc;if("address"===e)return new fc;if("string"===e)return new vc;if(e.length>=2&&"("===e[0]&&")"===e[e.length-1]){const t=kc.parseTupleContent(e.slice(1,e.length-1)),n=[];for(let e=0;e<t.length;e++){const a=gc.from(t[e]);n.push(a)}return new kc(n)}throw new Error(`cannot convert a string ${e} to an ABI type`)}}class mc extends gc{constructor(e){if(super(),e%8!=0||e<8||e>512)throw new Error(`unsupported uint type bitSize: ${e}`);this.bitSize=e}toString(){return`uint${this.bitSize}`}equals(e){return e instanceof mc&&this.bitSize===e.bitSize}isDynamic(){return!1}byteLen(){return this.bitSize/8}encode(e){if("bigint"!=typeof e&&"number"!=typeof e)throw new Error(`Cannot encode value as uint${this.bitSize}: ${e}`);if(e>=BigInt(2**this.bitSize)||e<BigInt(0))throw new Error(`${e} is not a non-negative int or too big to fit in size uint${this.bitSize}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error(`${e} should be converted into a BigInt before it is encoded`);return Ho(e,this.bitSize/8)}decode(e){if(e.length!==this.bitSize/8)throw new Error(`byte string must correspond to a uint${this.bitSize}`);return jo(e)}}class pc extends gc{constructor(e,t){if(super(),e%8!=0||e<8||e>512)throw new Error(`unsupported ufixed type bitSize: ${e}`);if(t>160||t<1)throw new Error(`unsupported ufixed type precision: ${t}`);this.bitSize=e,this.precision=t}toString(){return`ufixed${this.bitSize}x${this.precision}`}equals(e){return e instanceof pc&&this.bitSize===e.bitSize&&this.precision===e.precision}isDynamic(){return!1}byteLen(){return this.bitSize/8}encode(e){if("bigint"!=typeof e&&"number"!=typeof e)throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);if(e>=BigInt(2**this.bitSize)||e<BigInt(0))throw new Error(`${e} is not a non-negative int or too big to fit in size ${this.toString()}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error(`${e} should be converted into a BigInt before it is encoded`);return Ho(e,this.bitSize/8)}decode(e){if(e.length!==this.bitSize/8)throw new Error(`byte string must correspond to a ${this.toString()}`);return jo(e)}}class fc extends gc{toString(){return"address"}equals(e){return e instanceof fc}isDynamic(){return!1}byteLen(){return sc}encode(e){if("string"!=typeof e&&!(e instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);if("string"==typeof e)return J(e).publicKey;if(32!==e.byteLength)throw new Error("byte string must be 32 bytes long for an address");return e}decode(e){if(32!==e.byteLength)throw new Error("byte string must be 32 bytes long for an address");return Y(e)}}class yc extends gc{toString(){return"bool"}equals(e){return e instanceof yc}isDynamic(){return!1}byteLen(){return hc}encode(e){if("boolean"!=typeof e)throw new Error(`Cannot encode value as bool: ${e}`);return e?new Uint8Array([128]):new Uint8Array([0])}decode(e){if(1!==e.byteLength)throw new Error("bool string must be 1 byte long");const t=e[0];if(128===t)return!0;if(0===t)return!1;throw new Error("boolean could not be decoded from the byte string")}}class wc extends gc{toString(){return"byte"}equals(e){return e instanceof wc}isDynamic(){return!1}byteLen(){return cc}encode(e){if("number"!=typeof e&&"bigint"!=typeof e)throw new Error(`Cannot encode value as byte: ${e}`);if("bigint"==typeof e&&(e=Number(e)),e<0||e>255)throw new Error(`${e} cannot be encoded into a byte`);return new Uint8Array([e])}decode(e){if(1!==e.byteLength)throw new Error("byte string must be 1 byte long");return e[0]}}class vc extends gc{toString(){return"string"}equals(e){return e instanceof vc}isDynamic(){return!0}byteLen(){throw new Error(`${this.toString()} is a dynamic type`)}encode(e){if("string"!=typeof e&&!(e instanceof Uint8Array))throw new Error(`Cannot encode value as string: ${e}`);let t;t="string"==typeof e?(new TextEncoder).encode(e):e;const n=Ho(t.length,dc),a=new Uint8Array(t.length+dc);return a.set(n),a.set(t,dc),a}decode(e){if(e.length<dc)throw new Error(`byte string is too short to be decoded. Actual length is ${e.length}, but expected at least ${dc}`);const t=new DataView(e.buffer,e.byteOffset,dc).getUint16(0),n=e.slice(dc,e.length);if(t!==n.length)throw new Error(`string length bytes do not match the actual length of string. Expected ${t}, got ${n.length}`);return new TextDecoder("utf-8").decode(n)}}class Sc extends gc{constructor(e,t){if(super(),t<0)throw new Error(`static array must have a non negative length: ${t}`);this.childType=e,this.staticLength=t}toString(){return`${this.childType.toString()}[${this.staticLength}]`}equals(e){return e instanceof Sc&&this.staticLength===e.staticLength&&this.childType.equals(e.childType)}isDynamic(){return this.childType.isDynamic()}byteLen(){return this.childType.constructor===yc?Math.ceil(this.staticLength/8):this.staticLength*this.childType.byteLen()}encode(e){if(!(Array.isArray(e)||e instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);if(e.length!==this.staticLength)throw new Error(`Value array does not match static array length. Expected ${this.staticLength}, got ${e.length}`);return this.toABITupleType().encode(e)}decode(e){return this.toABITupleType().decode(e)}toABITupleType(){return new kc(Array(this.staticLength).fill(this.childType))}}class Ec extends gc{constructor(e){super(),this.childType=e}toString(){return`${this.childType.toString()}[]`}equals(e){return e instanceof Ec&&this.childType.equals(e.childType)}isDynamic(){return!0}byteLen(){throw new Error(`${this.toString()} is a dynamic type`)}encode(e){if(!(Array.isArray(e)||e instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);const t=this.toABITupleType(e.length),n=t.encode(e);return y(Ho(t.childTypes.length,dc),n)}decode(e){const t=new DataView(e.buffer,0,dc).getUint16(0);return this.toABITupleType(t).decode(e.slice(dc,e.length))}toABITupleType(e){return new kc(Array(e).fill(this.childType))}}class kc extends gc{constructor(e){if(super(),e.length>=oc)throw new Error("tuple type child type number larger than maximum uint16 error");this.childTypes=e}toString(){const e=[];for(let t=0;t<this.childTypes.length;t++)e[t]=this.childTypes[t].toString();return`(${e.join(",")})`}equals(e){return e instanceof kc&&this.childTypes.length===e.childTypes.length&&this.childTypes.every(((t,n)=>t.equals(e.childTypes[n])))}isDynamic(){return this.childTypes.some((e=>e.isDynamic()))}byteLen(){let e=0;for(let t=0;t<this.childTypes.length;t++)if(this.childTypes[t].constructor===yc){const n=xc(this.childTypes,t,1),a=n+1;t+=n,e+=Math.trunc((a+7)/8)}else e+=this.childTypes[t].byteLen();return e}encode(e){if(!(Array.isArray(e)||e instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${e}`);const t=Array.from(e);if(e.length>oc)throw new Error("length of tuple array should not exceed a uint16");const n=this.childTypes,a=[],i=[],r=new Map;let o=0;for(;o<n.length;){const e=n[o];if(e.isDynamic())r.set(a.length,!0),a.push(new Uint8Array([0,0])),i.push(e.encode(t[o]));else{if(e.constructor===yc){const e=xc(n,o,-1);let i=xc(n,o,1);if(e%8!=0)throw new Error("expected before index should have number of bool mod 8 equal 0");i=Math.min(7,i);const r=bc(t.slice(o,o+i+1));a.push(Ho(r,1)),o+=i}else{const n=e.encode(t[o]);a.push(n)}r.set(o,!1),i.push(new Uint8Array)}o+=1}let s=0;for(const e of a)s+=e.length;let c=0;for(let e=0;e<a.length;e++){if(r.get(e)){const t=s+c;if(t>oc)throw new Error(`byte length of ${t} should not exceed a uint16`);a[e]=Ho(t,dc)}c+=i[e].length}return y(...a,...i)}decode(e){const t=this.childTypes,n=[],a=[];let i=0,r=0;const o=new DataView(e.buffer);for(;i<t.length;){const s=t[i];if(s.isDynamic()){if(e.slice(r,e.length).length<dc)throw new Error("dynamic type in tuple is too short to be decoded");const t=o.getUint16(r);if(n.length>0&&(n[n.length-1].right=t,t<n[n.length-1].left))throw new Error("dynamic index segment miscalculation: left is greater than right index");const i={left:t,right:-1};n.push(i),a.push(null),r+=dc}else if(s.constructor===yc){const t=xc(this.childTypes,i,-1);let n=xc(this.childTypes,i,1);if(t%8!=0)throw new Error("expected before bool number mod 8 === 0");n=Math.min(7,n);for(let t=0;t<=n;t++){const n=128>>t;(e[r]&n)>0?a.push(new Uint8Array([128])):a.push(new Uint8Array([0]))}i+=n,r+=1}else{const t=s.byteLen();a.push(e.slice(r,r+t)),r+=t}if(i!==t.length-1&&r>=e.length)throw new Error("input byte not enough to decode");i+=1}if(n.length>0&&(n[n.length-1].right=e.length,r=e.length),r<e.length)throw new Error("input byte not fully consumed");for(let e=0;e<n.length;e++){const t=n[e];if(t.left>t.right)throw new Error("dynamic segment should display a [l, r] space with l <= r");if(e!==n.length-1&&t.right!==n[e+1].left)throw new Error("dynamic segment should be consecutive")}let s=0;for(let i=0;i<t.length;i++)t[i].isDynamic()&&(a[i]=e.slice(n[s].left,n[s].right),s+=1);const c=[];for(let e=0;e<t.length;e++){const n=t[e].decode(a[e]);c.push(n)}return c}static parseTupleContent(e){if(0===e.length)return[];if(e.endsWith(",")||e.startsWith(","))throw new Error("tuple string should not start with comma");if(e.includes(",,"))throw new Error("tuple string should not have consecutive commas");const t=[];let n=0,a="";for(const i of e)a+=i,"("===i?n+=1:")"===i?n-=1:","===i&&0===n&&(t.push(a.slice(0,a.length-1)),a="");if(0!==a.length&&t.push(a),0!==n)throw new Error("tuple string has mismatched parentheses");return t}}function bc(e){let t=0;if(e.length>8)throw new Error("value list passed in should be no greater than length 8");for(let n=0;n<e.length;n++){const a=e[n];if("boolean"!=typeof a)throw new Error("non-boolean values cannot be compressed into a byte");a&&(t|=1<<7-n)}return t}function xc(e,t,n){let a=0;for(;;){const i=t+n*a;if(e[i].constructor!==yc){a-=1;break}if(i!==e.length-1&&1===n)a+=1;else{if(!(i>0&&-1===n))break;a+=1}}return a}var Ac,Dc;function Tc(e){return e===Ac.any||e===Ac.pay||e===Ac.keyreg||e===Ac.acfg||e===Ac.axfer||e===Ac.afrz||e===Ac.appl}function Ic(e,t){return e===Ac.any||!!t.type&&t.type.toString()===e.toString()}function Mc(e){return e===Dc.account||e===Dc.application||e===Dc.asset}!function(e){e.any="txn",e.pay="pay",e.keyreg="keyreg",e.acfg="acfg",e.axfer="axfer",e.afrz="afrz",e.appl="appl"}(Ac||(Ac={})),function(e){e.account="account",e.application="application",e.asset="asset"}(Dc||(Dc={}));class Vc{constructor(e){if("string"!=typeof e.name||"object"!=typeof e.returns||!Array.isArray(e.args))throw new Error("Invalid ABIMethod parameters");this.name=e.name,this.description=e.desc,this.args=e.args.map((({type:e,name:t,desc:n})=>Tc(e)||Mc(e)?{type:e,name:t,description:n}:{type:gc.from(e),name:t,description:n})),this.returns={type:"void"===e.returns.type?e.returns.type:gc.from(e.returns.type),description:e.returns.desc},this.events=e.events,this.readonly=e.readonly}getSignature(){const e=this.args.map((e=>e.type.toString())).join(","),t=this.returns.type.toString();return`${this.name}(${e})${t}`}getSelector(){const e=b(this.getSignature());return new Uint8Array(e.slice(0,4))}txnCount(){let e=1;for(const t of this.args)"string"==typeof t.type&&Tc(t.type)&&(e+=1);return e}toJSON(){return{name:this.name,desc:this.description,args:this.args.map((({type:e,name:t,description:n})=>({type:e.toString(),name:t,desc:n}))),returns:{type:this.returns.type.toString(),desc:this.returns.description},events:this.events,readonly:this.readonly}}static fromSignature(e){const{name:t,args:n,returns:a}=function(e){const t=e.indexOf("(");if(-1===t)throw new Error(`Invalid method signature: ${e}`);let n=-1,a=0;for(let i=t;i<e.length;i++){const t=e[i];if("("===t)a+=1;else if(")"===t){if(0===a)break;if(a-=1,0===a){n=i;break}}}if(-1===n)throw new Error(`Invalid method signature: ${e}`);return{name:e.slice(0,t),args:kc.parseTupleContent(e.slice(t+1,n)),returns:e.slice(n+1)}}(e);return new Vc({name:t,args:n.map((e=>({type:e}))),returns:{type:a}})}}function Pc(e,t){if(null===e||!Array.isArray(e)||!e.every((e=>e instanceof Vc)))throw new Error("Methods list provided is null or not the correct type");const n=e.filter((e=>e.name===t));if(n.length>1)throw new Error(`found ${n.length} methods with the same name ${n.map((e=>e.getSignature())).join(",")}`);if(0===n.length)throw new Error(`found 0 methods with the name ${t}`);return n[0]}class Rc{constructor(e){if("string"!=typeof e.name||!Array.isArray(e.methods)||e.networks&&"object"!=typeof e.networks)throw new Error("Invalid ABIContract parameters");this.name=e.name,this.description=e.desc,this.networks=e.networks?{...e.networks}:{},this.methods=e.methods.map((e=>new Vc(e))),this.events=e.events}toJSON(){return{name:this.name,desc:this.description,networks:this.networks,methods:this.methods.map((e=>e.toJSON())),events:this.events}}getMethodByName(e){return Pc(this.methods,e)}}class Bc{constructor(e){if("string"!=typeof e.name||!Array.isArray(e.methods))throw new Error("Invalid ABIInterface parameters");this.name=e.name,this.description=e.desc,this.methods=e.methods.map((e=>new Vc(e)))}toJSON(){return{name:this.name,desc:this.description,methods:this.methods.map((e=>e.toJSON()))}}getMethodByName(e){return Pc(this.methods,e)}}const Cc=new Uint8Array([21,31,124,117]);var Uc;function Oc(e,t,n){if(null!=n&&e===n)return 0;const a=null==n?0:1;for(let n=0;n<t.length;n++)if(e===t[n])return n+a;return t.push(e),t.length-1+a}!function(e){e[e.BUILDING=0]="BUILDING",e[e.BUILT=1]="BUILT",e[e.SIGNED=2]="SIGNED",e[e.SUBMITTED=3]="SUBMITTED",e[e.COMMITTED=4]="COMMITTED"}(Uc||(Uc={}));class $c{constructor(){this.status=Uc.BUILDING,this.transactions=[],this.methodCalls=new Map,this.signedTxns=[],this.txIDs=[]}getStatus(){return this.status}count(){return this.transactions.length}clone(){const e=new $c;return e.transactions=this.transactions.map((({txn:e,signer:t})=>{const n=e.toEncodingData();return n.delete("grp"),{txn:Jt.fromEncodingData(n),signer:t}})),e.methodCalls=new Map(this.methodCalls),e}addTransaction(e){if(this.status!==Uc.BUILDING)throw new Error("Cannot add transactions when composer status is not BUILDING");if(this.transactions.length===$c.MAX_GROUP_SIZE)throw new Error(`Adding an additional transaction exceeds the maximum atomic group size of ${$c.MAX_GROUP_SIZE}`);if(e.txn.group&&e.txn.group.some((e=>0!==e)))throw new Error("Cannot add a transaction with nonzero group ID");this.transactions.push(e)}addMethodCall({appID:e,method:t,methodArgs:n,sender:a,suggestedParams:i,onComplete:r,approvalProgram:o,clearProgram:s,numGlobalInts:c,numGlobalByteSlices:h,numLocalInts:d,numLocalByteSlices:u,extraPages:l,appAccounts:g,appForeignApps:m,appForeignAssets:p,boxes:f,note:y,lease:w,rekeyTo:v,signer:S}){if(this.status!==Uc.BUILDING)throw new Error("Cannot add transactions when composer status is not BUILDING");if(this.transactions.length+t.txnCount()>$c.MAX_GROUP_SIZE)throw new Error(`Adding additional transactions exceeds the maximum atomic group size of ${$c.MAX_GROUP_SIZE}`);if(BigInt(e)===BigInt(0)){if(null==o||null==s||null==c||null==h||null==d||null==u)throw new Error("One of the following required parameters for application creation is missing: approvalProgram, clearProgram, numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices")}else if(r===et.UpdateApplicationOC){if(null==o||null==s)throw new Error("One of the following required parameters for OnApplicationComplete.UpdateApplicationOC is missing: approvalProgram, clearProgram");if(null!=c||null!=h||null!=d||null!=u||null!=l)throw new Error("One of the following application creation parameters were set on a non-creation call: numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices, extraPages")}else if(null!=o||null!=s||null!=c||null!=h||null!=d||null!=u||null!=l)throw new Error("One of the following application creation parameters were set on a non-creation call: approvalProgram, clearProgram, numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices, extraPages");if(null==n&&(n=[]),n.length!==t.args.length)throw new Error(`Incorrect number of method arguments. Expected ${t.args.length}, got ${n.length}`);let E=[],b=[];const x=[],A=[],D=[],T=new Map,I=f||[];for(let e=0;e<n.length;e++){let a=t.args[e].type;const i=n[e];if(Tc(a)){if(!rc(i)||!Ic(a,i.txn))throw new Error(`Expected ${a} TransactionWithSigner for argument at index ${e}`);if(i.txn.group&&i.txn.group.some((e=>0!==e)))throw new Error("Cannot add a transaction with nonzero group ID");x.push(i)}else{if(rc(i))throw new Error(`Expected non-transaction value for argument at index ${e}`);if(Mc(a)&&(T.set(A.length,E.length),A.push(a),D.push(i),a=new mc(8)),"string"==typeof a)throw new Error(`Unknown ABI type: ${a}`);E.push(a),b.push(i)}}const M=[],V=null==g?[]:g.map((e=>e.toString())),P=null==m?[]:m.map(k),R=null==p?[]:p.map(k);for(let t=0;t<A.length;t++){const n=A[t],i=D[t];let r=0;switch(n){case Dc.account:{const e=new fc;r=Oc(e.decode(e.encode(i)),V,a.toString());break}case Dc.application:{const t=new mc(64),n=t.decode(t.encode(i));if(n>Number.MAX_SAFE_INTEGER)throw new Error(`Expected safe integer for application value, got ${n}`);r=Oc(n,P,k(e));break}case Dc.asset:{const e=new mc(64),t=e.decode(e.encode(i));if(t>Number.MAX_SAFE_INTEGER)throw new Error(`Expected safe integer for asset value, got ${t}`);r=Oc(t,R);break}default:throw new Error(`Unknown reference type: ${n}`)}M.push(r)}for(let e=0;e<M.length;e++)b[T.get(e)]=M[e];if(E.length>15){const e=E.slice(14),t=b.slice(14);E=E.slice(0,14),b=b.slice(0,14),E.push(new kc(e)),b.push(t)}const B=[t.getSelector()];for(let e=0;e<E.length;e++)B.push(E[e].encode(b[e]));const C={txn:Gs({sender:a,appIndex:e,appArgs:B,accounts:V,foreignApps:P,foreignAssets:R,boxes:I,onComplete:null==r?et.NoOpOC:r,approvalProgram:o,clearProgram:s,numGlobalInts:c,numGlobalByteSlices:h,numLocalInts:d,numLocalByteSlices:u,extraPages:l,lease:w,note:y,rekeyTo:v,suggestedParams:i}),signer:S};this.transactions.push(...x,C),this.methodCalls.set(this.transactions.length-1,t)}buildGroup(){if(this.status===Uc.BUILDING){if(0===this.transactions.length)throw new Error("Cannot build a group with 0 transactions");this.transactions.length>1&&hs(this.transactions.map((e=>e.txn))),this.status=Uc.BUILT}return this.transactions}async gatherSignatures(){if(this.status>=Uc.SIGNED)return this.signedTxns;const e=this.buildGroup(),t=e.map((e=>e.txn)),n=new Map;for(let t=0;t<e.length;t++){const{signer:a}=e[t];n.has(a)||n.set(a,[]),n.get(a).push(t)}const a=Array.from(n),i=await Promise.all(a.map((([e,n])=>e(t,n)))),r=e.map((()=>null));for(let e=0;e<a.length;e++){const t=a[e][1],n=i[e];for(let e=0;e<t.length;e++)r[t[e]]=n[e]}if(!r.every((e=>null!=e)))throw new Error(`Missing signatures. Got ${r}`);const o=r.map(((e,t)=>{try{return at(e,bn).txn.txID()}catch(e){throw new Error(`Cannot decode signed transaction at index ${t}. ${e}`)}}));return this.signedTxns=r,this.txIDs=o,this.status=Uc.SIGNED,r}async submit(e){if(this.status>Uc.SUBMITTED)throw new Error("Transaction group cannot be resubmitted");const t=await this.gatherSignatures();return await e.sendRawTransaction(t).do(),this.status=Uc.SUBMITTED,this.txIDs}async simulate(e,t){if(this.status>Uc.SUBMITTED)throw new Error("Simulated Transaction group has already been submitted to the network");const n=(await this.gatherSignatures()).map((e=>at(e,bn))),a=null==t?new si({txnGroups:[]}):t;a.txnGroups=[new ci({txns:n})];const i=await e.simulateTransactions(a).do(),r=[];for(const[e,t]of this.methodCalls){const n=this.txIDs[e],a=i.txnGroups[0].txnResults[e].txnResult,o={txID:n,rawReturnValue:new Uint8Array,method:t};r.push($c.parseMethodResponse(t,o,a))}return{methodResults:r,simulateResponse:i}}async execute(e,t){if(this.status===Uc.COMMITTED)throw new Error("Transaction group has already been executed successfully");const n=await this.submit(e);this.status=Uc.SUBMITTED;const a=this.transactions.findIndex(((e,t)=>this.methodCalls.has(t))),i=-1===a?0:a,r=await qo(e,n[i],t);this.status=Uc.COMMITTED;const o=Number(r.confirmedRound),s=[];for(const[t,i]of this.methodCalls){const o=n[t];let c={txID:o,rawReturnValue:new Uint8Array,method:i};try{const n=t===a?r:await e.pendingTransactionInformation(o).do();c=$c.parseMethodResponse(i,c,n)}catch(e){c.decodeError=e}s.push(c)}return{confirmedRound:o,txIDs:n,methodResults:s}}static parseMethodResponse(e,t,n){const a=t;try{if(a.txInfo=n,"void"!==e.returns.type){const i=n.logs||[];if(0===i.length)throw new Error(`App call transaction did not log a return value ${p(n)}`);const r=i[i.length-1];if(r.byteLength<4||!f(r.slice(0,4),Cc))throw new Error(`App call transaction did not log a ABI return value ${p(n)}`);a.rawReturnValue=new Uint8Array(r.slice(4)),a.returnValue=e.returns.type.decode(t.rawReturnValue)}}catch(e){a.decodeError=e}return a}}$c.MAX_GROUP_SIZE=16;const Nc=Uint8Array.from([77,88]),Lc="The transaction sender address and multisig preimage do not match.";function _c(e,t){return{txID:e.txID(),blob:e.signTxn(t)}}function zc(e,t){return T(y(Nc,e),t)}function Fc(e,t,n){return M(y(Nc,e),t,("string"==typeof n?G.fromString(n):n).publicKey)}const Kc=new Error(Lc),qc=new Error(ee),Hc=i})(),a})()));
|
|
3
3
|
//# sourceMappingURL=algosdk.min.js.map
|