@aptos-labs/ts-sdk 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (476) hide show
  1. package/README.md +1 -0
  2. package/dist/{cjs → browser}/index.d.ts +431 -237
  3. package/dist/browser/index.global.js +44 -42
  4. package/dist/browser/index.global.js.map +1 -1
  5. package/dist/common/index.d.ts +5831 -0
  6. package/dist/common/index.js +406 -0
  7. package/dist/common/index.js.map +1 -0
  8. package/dist/esm/api/account.d.ts +292 -0
  9. package/dist/esm/api/account.mjs +2 -0
  10. package/dist/esm/api/account.mjs.map +1 -0
  11. package/dist/esm/api/ans.d.ts +79 -0
  12. package/dist/esm/api/ans.mjs +2 -0
  13. package/dist/esm/api/ans.mjs.map +1 -0
  14. package/dist/esm/api/aptos.d.ts +72 -0
  15. package/dist/esm/api/aptos.mjs +2 -0
  16. package/dist/esm/api/aptos.mjs.map +1 -0
  17. package/dist/esm/api/aptosConfig.d.ts +51 -0
  18. package/dist/esm/api/aptosConfig.mjs +2 -0
  19. package/dist/esm/api/aptosConfig.mjs.map +1 -0
  20. package/dist/esm/api/coin.d.ts +59 -0
  21. package/dist/esm/api/coin.mjs +2 -0
  22. package/dist/esm/api/coin.mjs.map +1 -0
  23. package/dist/esm/api/digitalAsset.d.ts +174 -0
  24. package/dist/esm/api/digitalAsset.mjs +2 -0
  25. package/dist/esm/api/digitalAsset.mjs.map +1 -0
  26. package/dist/esm/api/event.d.ts +74 -0
  27. package/dist/esm/api/event.mjs +2 -0
  28. package/dist/esm/api/event.mjs.map +1 -0
  29. package/dist/esm/api/faucet.d.ts +37 -0
  30. package/dist/esm/api/faucet.mjs +2 -0
  31. package/dist/esm/api/faucet.mjs.map +1 -0
  32. package/dist/esm/api/fungibleAsset.d.ts +72 -0
  33. package/dist/esm/api/fungibleAsset.mjs +2 -0
  34. package/dist/esm/api/fungibleAsset.mjs.map +1 -0
  35. package/dist/esm/api/general.d.ts +150 -0
  36. package/dist/esm/api/general.mjs +2 -0
  37. package/dist/esm/api/general.mjs.map +1 -0
  38. package/dist/esm/api/index.d.ts +46 -0
  39. package/dist/esm/api/index.mjs +2 -0
  40. package/dist/esm/api/index.mjs.map +1 -0
  41. package/dist/esm/api/staking.d.ts +53 -0
  42. package/dist/esm/api/staking.mjs +2 -0
  43. package/dist/esm/api/staking.mjs.map +1 -0
  44. package/dist/esm/api/transaction.d.ts +101 -0
  45. package/dist/esm/api/transaction.mjs +2 -0
  46. package/dist/esm/api/transaction.mjs.map +1 -0
  47. package/dist/esm/api/transactionSubmission.d.ts +142 -0
  48. package/dist/esm/api/transactionSubmission.mjs +2 -0
  49. package/dist/esm/api/transactionSubmission.mjs.map +1 -0
  50. package/dist/esm/bcs/consts.d.ts +14 -0
  51. package/dist/esm/bcs/consts.mjs +2 -0
  52. package/dist/esm/bcs/consts.mjs.map +1 -0
  53. package/dist/esm/bcs/deserializer.d.ts +150 -0
  54. package/dist/esm/bcs/deserializer.mjs +2 -0
  55. package/dist/esm/bcs/deserializer.mjs.map +1 -0
  56. package/dist/esm/bcs/index.d.ts +14 -0
  57. package/dist/esm/bcs/index.mjs +2 -0
  58. package/dist/esm/bcs/index.mjs.map +1 -0
  59. package/dist/esm/bcs/serializable/entryFunctionBytes.d.ts +40 -0
  60. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +2 -0
  61. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs.map +1 -0
  62. package/dist/esm/bcs/serializable/fixedBytes.d.ts +52 -0
  63. package/dist/esm/bcs/serializable/fixedBytes.mjs +2 -0
  64. package/dist/esm/bcs/serializable/fixedBytes.mjs.map +1 -0
  65. package/dist/esm/bcs/serializable/movePrimitives.d.ts +69 -0
  66. package/dist/esm/bcs/serializable/movePrimitives.mjs +2 -0
  67. package/dist/esm/bcs/serializable/movePrimitives.mjs.map +1 -0
  68. package/dist/esm/bcs/serializable/moveStructs.d.ts +284 -0
  69. package/dist/esm/bcs/serializable/moveStructs.mjs +2 -0
  70. package/dist/esm/bcs/serializable/moveStructs.mjs.map +1 -0
  71. package/dist/esm/bcs/serializer.d.ts +192 -0
  72. package/dist/esm/bcs/serializer.mjs +2 -0
  73. package/dist/esm/bcs/serializer.mjs.map +1 -0
  74. package/dist/esm/chunk-2444YR3Y.mjs +2 -0
  75. package/dist/esm/chunk-2444YR3Y.mjs.map +1 -0
  76. package/dist/esm/chunk-27P7PELS.mjs +2 -0
  77. package/dist/esm/chunk-27P7PELS.mjs.map +1 -0
  78. package/dist/esm/chunk-2B5QXKPU.mjs +2 -0
  79. package/dist/esm/chunk-2B5QXKPU.mjs.map +1 -0
  80. package/dist/esm/chunk-2MQZUGO6.mjs +2 -0
  81. package/dist/esm/chunk-2MQZUGO6.mjs.map +1 -0
  82. package/dist/esm/chunk-3JPVQHOR.mjs +2 -0
  83. package/dist/esm/chunk-3JPVQHOR.mjs.map +1 -0
  84. package/dist/esm/chunk-3OJN4I42.mjs +2 -0
  85. package/dist/esm/chunk-3OJN4I42.mjs.map +1 -0
  86. package/dist/esm/chunk-3YOV42H5.mjs +2 -0
  87. package/dist/esm/chunk-3YOV42H5.mjs.map +1 -0
  88. package/dist/esm/chunk-4WPQQPUF.mjs +1 -0
  89. package/dist/esm/chunk-4WPQQPUF.mjs.map +1 -0
  90. package/dist/esm/chunk-6FBKUTGF.mjs +2 -0
  91. package/dist/esm/chunk-6FBKUTGF.mjs.map +1 -0
  92. package/dist/esm/chunk-7AIV5FEN.mjs +2 -0
  93. package/dist/esm/chunk-7AIV5FEN.mjs.map +1 -0
  94. package/dist/esm/chunk-7AQXAH6Q.mjs +2 -0
  95. package/dist/esm/chunk-7AQXAH6Q.mjs.map +1 -0
  96. package/dist/esm/chunk-7TL2MY2B.mjs +2 -0
  97. package/dist/esm/chunk-7TL2MY2B.mjs.map +1 -0
  98. package/dist/esm/chunk-ADR4XQPR.mjs +2 -0
  99. package/dist/esm/chunk-ADR4XQPR.mjs.map +1 -0
  100. package/dist/esm/chunk-AH44UPM4.mjs +2 -0
  101. package/dist/esm/chunk-AH44UPM4.mjs.map +1 -0
  102. package/dist/esm/chunk-AY2HWVDO.mjs +2 -0
  103. package/dist/esm/chunk-AY2HWVDO.mjs.map +1 -0
  104. package/dist/esm/chunk-BC2NOUYT.mjs +2 -0
  105. package/dist/esm/chunk-BC2NOUYT.mjs.map +1 -0
  106. package/dist/esm/chunk-BIUGRAMO.mjs +2 -0
  107. package/dist/esm/chunk-BIUGRAMO.mjs.map +1 -0
  108. package/dist/esm/chunk-BREUBEPM.mjs +2 -0
  109. package/dist/esm/chunk-BREUBEPM.mjs.map +1 -0
  110. package/dist/esm/chunk-BSCOVLWS.mjs +1 -0
  111. package/dist/esm/chunk-BSCOVLWS.mjs.map +1 -0
  112. package/dist/esm/chunk-BTK34A5U.mjs +406 -0
  113. package/dist/esm/chunk-BTK34A5U.mjs.map +1 -0
  114. package/dist/esm/chunk-CZZJAR3B.mjs +2 -0
  115. package/dist/esm/chunk-CZZJAR3B.mjs.map +1 -0
  116. package/dist/esm/chunk-DNDWTM7A.mjs +2 -0
  117. package/dist/esm/chunk-DNDWTM7A.mjs.map +1 -0
  118. package/dist/esm/chunk-DNYVUM3K.mjs +2 -0
  119. package/dist/esm/chunk-DNYVUM3K.mjs.map +1 -0
  120. package/dist/esm/chunk-DXUIJ6KA.mjs +2 -0
  121. package/dist/esm/chunk-DXUIJ6KA.mjs.map +1 -0
  122. package/dist/esm/chunk-E72CFUU4.mjs +2 -0
  123. package/dist/esm/chunk-E72CFUU4.mjs.map +1 -0
  124. package/dist/esm/chunk-E7FWVXGX.mjs +1 -0
  125. package/dist/esm/chunk-E7FWVXGX.mjs.map +1 -0
  126. package/dist/esm/chunk-EKAOAGNQ.mjs +2 -0
  127. package/dist/esm/chunk-EKAOAGNQ.mjs.map +1 -0
  128. package/dist/esm/chunk-FBPNHF54.mjs +2 -0
  129. package/dist/esm/chunk-FBPNHF54.mjs.map +1 -0
  130. package/dist/esm/chunk-FHJ7F7Z6.mjs +2 -0
  131. package/dist/esm/chunk-FHJ7F7Z6.mjs.map +1 -0
  132. package/dist/esm/chunk-FNB6CFQR.mjs +2 -0
  133. package/dist/esm/chunk-FNB6CFQR.mjs.map +1 -0
  134. package/dist/esm/chunk-FYIFBLHU.mjs +2 -0
  135. package/dist/esm/chunk-FYIFBLHU.mjs.map +1 -0
  136. package/dist/esm/chunk-FZY4PMEE.mjs +1 -0
  137. package/dist/esm/chunk-FZY4PMEE.mjs.map +1 -0
  138. package/dist/esm/chunk-GUT3G5CG.mjs +2 -0
  139. package/dist/esm/chunk-GUT3G5CG.mjs.map +1 -0
  140. package/dist/esm/chunk-HH5RSP2H.mjs +2 -0
  141. package/dist/esm/chunk-HH5RSP2H.mjs.map +1 -0
  142. package/dist/esm/chunk-HTZTTZQJ.mjs +1 -0
  143. package/dist/esm/chunk-HTZTTZQJ.mjs.map +1 -0
  144. package/dist/esm/chunk-I5OYNCZS.mjs +1 -0
  145. package/dist/esm/chunk-I5OYNCZS.mjs.map +1 -0
  146. package/dist/esm/chunk-IPJKGHQY.mjs +2 -0
  147. package/dist/esm/chunk-IPJKGHQY.mjs.map +1 -0
  148. package/dist/esm/chunk-IXMH6AXJ.mjs +2 -0
  149. package/dist/esm/chunk-IXMH6AXJ.mjs.map +1 -0
  150. package/dist/esm/chunk-IZHPCZE3.mjs +2 -0
  151. package/dist/esm/chunk-IZHPCZE3.mjs.map +1 -0
  152. package/dist/esm/chunk-J3QOSJFP.mjs +2 -0
  153. package/dist/esm/chunk-J3QOSJFP.mjs.map +1 -0
  154. package/dist/esm/chunk-J5OKXARS.mjs +2 -0
  155. package/dist/esm/chunk-J5OKXARS.mjs.map +1 -0
  156. package/dist/esm/chunk-JTGGMXB7.mjs +2 -0
  157. package/dist/esm/chunk-JTGGMXB7.mjs.map +1 -0
  158. package/dist/esm/chunk-KC64ESLO.mjs +2 -0
  159. package/dist/esm/chunk-KC64ESLO.mjs.map +1 -0
  160. package/dist/esm/chunk-KFP7MDSD.mjs +2 -0
  161. package/dist/esm/chunk-KFP7MDSD.mjs.map +1 -0
  162. package/dist/esm/chunk-KJDY66XF.mjs +2 -0
  163. package/dist/esm/chunk-KJDY66XF.mjs.map +1 -0
  164. package/dist/esm/chunk-KNLMUSIO.mjs +2 -0
  165. package/dist/esm/chunk-KNLMUSIO.mjs.map +1 -0
  166. package/dist/esm/chunk-KPESAXVI.mjs +2 -0
  167. package/dist/esm/chunk-KPESAXVI.mjs.map +1 -0
  168. package/dist/esm/chunk-KWJ6XKNF.mjs +2 -0
  169. package/dist/esm/chunk-KWJ6XKNF.mjs.map +1 -0
  170. package/dist/esm/chunk-KYWYIK5P.mjs +2 -0
  171. package/dist/esm/chunk-KYWYIK5P.mjs.map +1 -0
  172. package/dist/esm/chunk-LAXIJRYU.mjs +2 -0
  173. package/dist/esm/chunk-LAXIJRYU.mjs.map +1 -0
  174. package/dist/esm/chunk-LR65XHSF.mjs +2 -0
  175. package/dist/esm/chunk-LR65XHSF.mjs.map +1 -0
  176. package/dist/esm/chunk-LU6VS7PJ.mjs +2 -0
  177. package/dist/esm/chunk-LU6VS7PJ.mjs.map +1 -0
  178. package/dist/esm/chunk-LV33NV4J.mjs +2 -0
  179. package/dist/esm/chunk-LV33NV4J.mjs.map +1 -0
  180. package/dist/esm/chunk-MIBLZSNS.mjs +2 -0
  181. package/dist/esm/chunk-MIBLZSNS.mjs.map +1 -0
  182. package/dist/esm/chunk-N2FKVZ4D.mjs +1 -0
  183. package/dist/esm/chunk-N2FKVZ4D.mjs.map +1 -0
  184. package/dist/esm/chunk-N6XWY4UT.mjs +2 -0
  185. package/dist/esm/chunk-N6XWY4UT.mjs.map +1 -0
  186. package/dist/esm/chunk-NKTKHC3Z.mjs +2 -0
  187. package/dist/esm/chunk-NKTKHC3Z.mjs.map +1 -0
  188. package/dist/esm/chunk-O243HOP3.mjs +2 -0
  189. package/dist/esm/chunk-O243HOP3.mjs.map +1 -0
  190. package/dist/esm/chunk-PDLUCVJB.mjs +2 -0
  191. package/dist/esm/chunk-PDLUCVJB.mjs.map +1 -0
  192. package/dist/esm/chunk-PJDVHU7X.mjs +2 -0
  193. package/dist/esm/chunk-PJDVHU7X.mjs.map +1 -0
  194. package/dist/esm/chunk-R7G3CLRI.mjs +1 -0
  195. package/dist/esm/chunk-R7G3CLRI.mjs.map +1 -0
  196. package/dist/esm/chunk-RMMOF53Q.mjs +1 -0
  197. package/dist/esm/chunk-RMMOF53Q.mjs.map +1 -0
  198. package/dist/esm/chunk-SJLO3JIH.mjs +2 -0
  199. package/dist/esm/chunk-SJLO3JIH.mjs.map +1 -0
  200. package/dist/esm/chunk-TCTZCPQ6.mjs +1 -0
  201. package/dist/esm/chunk-TCTZCPQ6.mjs.map +1 -0
  202. package/dist/esm/chunk-TXUMB5ZO.mjs +2 -0
  203. package/dist/esm/chunk-TXUMB5ZO.mjs.map +1 -0
  204. package/dist/esm/chunk-TYHBYRUA.mjs +2 -0
  205. package/dist/esm/chunk-TYHBYRUA.mjs.map +1 -0
  206. package/dist/esm/chunk-UQIOMAXE.mjs +2 -0
  207. package/dist/esm/chunk-UQIOMAXE.mjs.map +1 -0
  208. package/dist/esm/chunk-UVGCVCNG.mjs +2 -0
  209. package/dist/esm/chunk-UVGCVCNG.mjs.map +1 -0
  210. package/dist/esm/chunk-UYVPNUH3.mjs +1 -0
  211. package/dist/esm/chunk-UYVPNUH3.mjs.map +1 -0
  212. package/dist/esm/chunk-V3MBJJTL.mjs +1 -0
  213. package/dist/esm/chunk-V3MBJJTL.mjs.map +1 -0
  214. package/dist/esm/chunk-V6AAQLLJ.mjs +2 -0
  215. package/dist/esm/chunk-V6AAQLLJ.mjs.map +1 -0
  216. package/dist/esm/chunk-VAGYTPSI.mjs +2 -0
  217. package/dist/esm/chunk-VAGYTPSI.mjs.map +1 -0
  218. package/dist/esm/chunk-WGXAIQ7K.mjs +2 -0
  219. package/dist/esm/chunk-WGXAIQ7K.mjs.map +1 -0
  220. package/dist/esm/chunk-WNEZCERQ.mjs +2 -0
  221. package/dist/esm/chunk-WNEZCERQ.mjs.map +1 -0
  222. package/dist/esm/chunk-WVMDCC4V.mjs +2 -0
  223. package/dist/esm/chunk-WVMDCC4V.mjs.map +1 -0
  224. package/dist/esm/chunk-XFS5O5GJ.mjs +2 -0
  225. package/dist/esm/chunk-XFS5O5GJ.mjs.map +1 -0
  226. package/dist/esm/chunk-XFSL7O6Q.mjs +2 -0
  227. package/dist/esm/chunk-XFSL7O6Q.mjs.map +1 -0
  228. package/dist/esm/chunk-XNFEUXDS.mjs +2 -0
  229. package/dist/esm/chunk-XNFEUXDS.mjs.map +1 -0
  230. package/dist/esm/chunk-YS2OX7AB.mjs +2 -0
  231. package/dist/esm/chunk-YS2OX7AB.mjs.map +1 -0
  232. package/dist/esm/chunk-Z56AKXJ7.mjs +2 -0
  233. package/dist/esm/chunk-Z56AKXJ7.mjs.map +1 -0
  234. package/dist/esm/chunk-ZT2A5ABR.mjs +2 -0
  235. package/dist/esm/chunk-ZT2A5ABR.mjs.map +1 -0
  236. package/dist/esm/chunk-ZXJ5ZBTL.mjs +2 -0
  237. package/dist/esm/chunk-ZXJ5ZBTL.mjs.map +1 -0
  238. package/dist/esm/client/core.d.ts +24 -0
  239. package/dist/esm/client/core.mjs +2 -0
  240. package/dist/esm/client/core.mjs.map +1 -0
  241. package/dist/esm/client/get.d.ts +55 -0
  242. package/dist/esm/client/get.mjs +2 -0
  243. package/dist/esm/client/get.mjs.map +1 -0
  244. package/dist/esm/client/index.d.ts +11 -0
  245. package/dist/esm/client/index.mjs +2 -0
  246. package/dist/esm/client/index.mjs.map +1 -0
  247. package/dist/esm/client/post.d.ts +60 -0
  248. package/dist/esm/client/post.mjs +2 -0
  249. package/dist/esm/client/post.mjs.map +1 -0
  250. package/dist/esm/client/types.d.ts +46 -0
  251. package/dist/esm/client/types.mjs +2 -0
  252. package/dist/esm/client/types.mjs.map +1 -0
  253. package/dist/esm/core/account.d.ts +184 -0
  254. package/dist/esm/core/account.mjs +2 -0
  255. package/dist/esm/core/account.mjs.map +1 -0
  256. package/dist/esm/core/accountAddress.d.ts +244 -0
  257. package/dist/esm/core/accountAddress.mjs +2 -0
  258. package/dist/esm/core/accountAddress.mjs.map +1 -0
  259. package/dist/esm/core/authenticationKey.d.ts +74 -0
  260. package/dist/esm/core/authenticationKey.mjs +2 -0
  261. package/dist/esm/core/authenticationKey.mjs.map +1 -0
  262. package/dist/esm/core/common.d.ts +32 -0
  263. package/dist/esm/core/common.mjs +2 -0
  264. package/dist/esm/core/common.mjs.map +1 -0
  265. package/dist/esm/core/crypto/anyPublicKey.d.ts +54 -0
  266. package/dist/esm/core/crypto/anyPublicKey.mjs +2 -0
  267. package/dist/esm/core/crypto/anyPublicKey.mjs.map +1 -0
  268. package/dist/esm/core/crypto/anySignature.d.ts +31 -0
  269. package/dist/esm/core/crypto/anySignature.mjs +2 -0
  270. package/dist/esm/core/crypto/anySignature.mjs.map +1 -0
  271. package/dist/esm/core/crypto/asymmetricCrypto.d.ts +74 -0
  272. package/dist/esm/core/crypto/asymmetricCrypto.mjs +2 -0
  273. package/dist/esm/core/crypto/asymmetricCrypto.mjs.map +1 -0
  274. package/dist/esm/core/crypto/ed25519.d.ts +173 -0
  275. package/dist/esm/core/crypto/ed25519.mjs +2 -0
  276. package/dist/esm/core/crypto/ed25519.mjs.map +1 -0
  277. package/dist/esm/core/crypto/hdKey.d.ts +65 -0
  278. package/dist/esm/core/crypto/hdKey.mjs +2 -0
  279. package/dist/esm/core/crypto/hdKey.mjs.map +1 -0
  280. package/dist/esm/core/crypto/index.d.ts +17 -0
  281. package/dist/esm/core/crypto/index.mjs +2 -0
  282. package/dist/esm/core/crypto/index.mjs.map +1 -0
  283. package/dist/esm/core/crypto/multiEd25519.d.ts +126 -0
  284. package/dist/esm/core/crypto/multiEd25519.mjs +2 -0
  285. package/dist/esm/core/crypto/multiEd25519.mjs.map +1 -0
  286. package/dist/esm/core/crypto/multiKey.d.ts +52 -0
  287. package/dist/esm/core/crypto/multiKey.mjs +2 -0
  288. package/dist/esm/core/crypto/multiKey.mjs.map +1 -0
  289. package/dist/esm/core/crypto/secp256k1.d.ts +161 -0
  290. package/dist/esm/core/crypto/secp256k1.mjs +2 -0
  291. package/dist/esm/core/crypto/secp256k1.mjs.map +1 -0
  292. package/dist/esm/core/hex.d.ts +105 -0
  293. package/dist/esm/core/hex.mjs +2 -0
  294. package/dist/esm/core/hex.mjs.map +1 -0
  295. package/dist/esm/core/index.d.ts +21 -0
  296. package/dist/esm/core/index.mjs +2 -0
  297. package/dist/esm/core/index.mjs.map +1 -0
  298. package/dist/esm/index.d.ts +60 -5637
  299. package/dist/esm/index.mjs +1 -5444
  300. package/dist/esm/index.mjs.map +1 -1
  301. package/dist/esm/internal/account.d.ts +143 -0
  302. package/dist/esm/internal/account.mjs +2 -0
  303. package/dist/esm/internal/account.mjs.map +1 -0
  304. package/dist/esm/internal/ans.d.ts +83 -0
  305. package/dist/esm/internal/ans.mjs +2 -0
  306. package/dist/esm/internal/ans.mjs.map +1 -0
  307. package/dist/esm/internal/coin.d.ts +43 -0
  308. package/dist/esm/internal/coin.mjs +2 -0
  309. package/dist/esm/internal/coin.mjs.map +1 -0
  310. package/dist/esm/internal/digitalAsset.d.ts +118 -0
  311. package/dist/esm/internal/digitalAsset.mjs +2 -0
  312. package/dist/esm/internal/digitalAsset.mjs.map +1 -0
  313. package/dist/esm/internal/event.d.ts +45 -0
  314. package/dist/esm/internal/event.mjs +2 -0
  315. package/dist/esm/internal/event.mjs.map +1 -0
  316. package/dist/esm/internal/faucet.d.ts +29 -0
  317. package/dist/esm/internal/faucet.mjs +2 -0
  318. package/dist/esm/internal/faucet.mjs.map +1 -0
  319. package/dist/esm/internal/fungibleAsset.d.ts +38 -0
  320. package/dist/esm/internal/fungibleAsset.mjs +2 -0
  321. package/dist/esm/internal/fungibleAsset.mjs.map +1 -0
  322. package/dist/esm/internal/general.d.ts +60 -0
  323. package/dist/esm/internal/general.mjs +2 -0
  324. package/dist/esm/internal/general.mjs.map +1 -0
  325. package/dist/esm/internal/staking.d.ts +38 -0
  326. package/dist/esm/internal/staking.mjs +2 -0
  327. package/dist/esm/internal/staking.mjs.map +1 -0
  328. package/dist/esm/internal/transaction.d.ts +57 -0
  329. package/dist/esm/internal/transaction.mjs +2 -0
  330. package/dist/esm/internal/transaction.mjs.map +1 -0
  331. package/dist/esm/internal/transactionSubmission.d.ts +148 -0
  332. package/dist/esm/internal/transactionSubmission.mjs +2 -0
  333. package/dist/esm/internal/transactionSubmission.mjs.map +1 -0
  334. package/dist/esm/transactions/authenticator/account.d.ts +79 -0
  335. package/dist/esm/transactions/authenticator/account.mjs +2 -0
  336. package/dist/esm/transactions/authenticator/account.mjs.map +1 -0
  337. package/dist/esm/transactions/authenticator/index.d.ts +19 -0
  338. package/dist/esm/transactions/authenticator/index.mjs +2 -0
  339. package/dist/esm/transactions/authenticator/index.mjs.map +1 -0
  340. package/dist/esm/transactions/authenticator/transaction.d.ts +105 -0
  341. package/dist/esm/transactions/authenticator/transaction.mjs +2 -0
  342. package/dist/esm/transactions/authenticator/transaction.mjs.map +1 -0
  343. package/dist/esm/transactions/index.d.ts +39 -0
  344. package/dist/esm/transactions/index.mjs +2 -0
  345. package/dist/esm/transactions/index.mjs.map +1 -0
  346. package/dist/esm/transactions/instances/chainId.d.ts +21 -0
  347. package/dist/esm/transactions/instances/chainId.mjs +2 -0
  348. package/dist/esm/transactions/instances/chainId.mjs.map +1 -0
  349. package/dist/esm/transactions/instances/identifier.d.ts +23 -0
  350. package/dist/esm/transactions/instances/identifier.mjs +2 -0
  351. package/dist/esm/transactions/instances/identifier.mjs.map +1 -0
  352. package/dist/esm/transactions/instances/index.d.ts +29 -0
  353. package/dist/esm/transactions/instances/index.mjs +2 -0
  354. package/dist/esm/transactions/instances/index.mjs.map +1 -0
  355. package/dist/esm/transactions/instances/moduleId.d.ts +37 -0
  356. package/dist/esm/transactions/instances/moduleId.mjs +2 -0
  357. package/dist/esm/transactions/instances/moduleId.mjs.map +1 -0
  358. package/dist/esm/transactions/instances/rawTransaction.d.ts +98 -0
  359. package/dist/esm/transactions/instances/rawTransaction.mjs +2 -0
  360. package/dist/esm/transactions/instances/rawTransaction.mjs.map +1 -0
  361. package/dist/esm/transactions/instances/rotationProofChallenge.d.ts +37 -0
  362. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +2 -0
  363. package/dist/esm/transactions/instances/rotationProofChallenge.mjs.map +1 -0
  364. package/dist/esm/transactions/instances/signedTransaction.d.ts +46 -0
  365. package/dist/esm/transactions/instances/signedTransaction.mjs +2 -0
  366. package/dist/esm/transactions/instances/signedTransaction.mjs.map +1 -0
  367. package/dist/esm/transactions/instances/transactionArgument.d.ts +40 -0
  368. package/dist/esm/transactions/instances/transactionArgument.mjs +2 -0
  369. package/dist/esm/transactions/instances/transactionArgument.mjs.map +1 -0
  370. package/dist/esm/transactions/instances/transactionPayload.d.ts +211 -0
  371. package/dist/esm/transactions/instances/transactionPayload.mjs +2 -0
  372. package/dist/esm/transactions/instances/transactionPayload.mjs.map +1 -0
  373. package/dist/esm/transactions/transactionBuilder/helpers.d.ts +63 -0
  374. package/dist/esm/transactions/transactionBuilder/helpers.mjs +2 -0
  375. package/dist/esm/transactions/transactionBuilder/helpers.mjs.map +1 -0
  376. package/dist/esm/transactions/transactionBuilder/index.d.ts +35 -0
  377. package/dist/esm/transactions/transactionBuilder/index.mjs +2 -0
  378. package/dist/esm/transactions/transactionBuilder/index.mjs.map +1 -0
  379. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.ts +54 -0
  380. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +2 -0
  381. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs.map +1 -0
  382. package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.ts +128 -0
  383. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +2 -0
  384. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs.map +1 -0
  385. package/dist/esm/transactions/typeTag/index.d.ts +127 -0
  386. package/dist/esm/transactions/typeTag/index.mjs +2 -0
  387. package/dist/esm/transactions/typeTag/index.mjs.map +1 -0
  388. package/dist/esm/transactions/typeTag/parser.d.ts +47 -0
  389. package/dist/esm/transactions/typeTag/parser.mjs +2 -0
  390. package/dist/esm/transactions/typeTag/parser.mjs.map +1 -0
  391. package/dist/esm/transactions/types.d.ts +253 -0
  392. package/dist/esm/transactions/types.mjs +2 -0
  393. package/dist/esm/transactions/types.mjs.map +1 -0
  394. package/dist/esm/types/generated/operations.d.ts +604 -0
  395. package/dist/esm/types/generated/operations.mjs +1 -0
  396. package/dist/esm/types/generated/operations.mjs.map +1 -0
  397. package/dist/esm/types/generated/queries.d.ts +55 -0
  398. package/dist/esm/types/generated/queries.mjs +2 -0
  399. package/dist/esm/types/generated/queries.mjs.map +1 -0
  400. package/dist/esm/types/generated/types.d.ts +9458 -0
  401. package/dist/esm/types/generated/types.mjs +2 -0
  402. package/dist/esm/types/generated/types.mjs.map +1 -0
  403. package/dist/{types → esm/types}/index.d.ts +19 -451
  404. package/dist/esm/types/index.mjs +2 -0
  405. package/dist/esm/types/index.mjs.map +1 -0
  406. package/dist/esm/types/indexer.d.ts +62 -0
  407. package/dist/esm/types/indexer.mjs +2 -0
  408. package/dist/esm/types/indexer.mjs.map +1 -0
  409. package/dist/esm/utils/apiEndpoints.d.ts +14 -0
  410. package/dist/esm/utils/apiEndpoints.mjs +2 -0
  411. package/dist/esm/utils/apiEndpoints.mjs.map +1 -0
  412. package/dist/esm/utils/const.d.ts +42 -0
  413. package/dist/esm/utils/const.mjs +2 -0
  414. package/dist/esm/utils/const.mjs.map +1 -0
  415. package/dist/esm/utils/helpers.d.ts +7 -0
  416. package/dist/esm/utils/helpers.mjs +2 -0
  417. package/dist/esm/utils/helpers.mjs.map +1 -0
  418. package/dist/esm/utils/memoize.d.ts +20 -0
  419. package/dist/esm/utils/memoize.mjs +2 -0
  420. package/dist/esm/utils/memoize.mjs.map +1 -0
  421. package/dist/esm/version.d.ts +8 -0
  422. package/dist/esm/version.mjs +2 -0
  423. package/dist/esm/version.mjs.map +1 -0
  424. package/package.json +17 -13
  425. package/src/api/account.ts +17 -18
  426. package/src/api/ans.ts +58 -0
  427. package/src/api/aptos.ts +7 -1
  428. package/src/api/coin.ts +3 -3
  429. package/src/api/digitalAsset.ts +9 -8
  430. package/src/api/event.ts +4 -3
  431. package/src/api/faucet.ts +3 -2
  432. package/src/api/general.ts +2 -2
  433. package/src/api/staking.ts +5 -4
  434. package/src/api/transactionSubmission.ts +41 -20
  435. package/src/bcs/deserializer.ts +4 -4
  436. package/src/bcs/serializable/moveStructs.ts +13 -13
  437. package/src/bcs/serializer.ts +4 -4
  438. package/src/client/core.ts +18 -8
  439. package/src/core/account.ts +90 -33
  440. package/src/core/accountAddress.ts +34 -30
  441. package/src/core/authenticationKey.ts +11 -9
  442. package/src/core/crypto/ed25519.ts +48 -1
  443. package/src/core/crypto/hdKey.ts +105 -0
  444. package/src/core/crypto/index.ts +1 -0
  445. package/src/core/crypto/secp256k1.ts +36 -0
  446. package/src/index.ts +0 -1
  447. package/src/internal/account.ts +80 -58
  448. package/src/internal/ans.ts +175 -0
  449. package/src/internal/coin.ts +5 -5
  450. package/src/internal/digitalAsset.ts +16 -17
  451. package/src/internal/event.ts +8 -8
  452. package/src/internal/faucet.ts +4 -4
  453. package/src/internal/general.ts +3 -3
  454. package/src/internal/queries/getEvents.graphql +1 -0
  455. package/src/internal/staking.ts +8 -8
  456. package/src/internal/transactionSubmission.ts +78 -19
  457. package/src/transactions/instances/index.ts +1 -0
  458. package/src/transactions/instances/moduleId.ts +1 -1
  459. package/src/transactions/instances/rotationProofChallenge.ts +58 -0
  460. package/src/transactions/transactionBuilder/helpers.ts +5 -1
  461. package/src/transactions/transactionBuilder/remoteAbi.ts +4 -4
  462. package/src/transactions/transactionBuilder/transactionBuilder.ts +31 -49
  463. package/src/transactions/typeTag/index.ts +10 -10
  464. package/src/transactions/typeTag/parser.ts +1 -1
  465. package/src/transactions/types.ts +31 -20
  466. package/src/types/generated/operations.ts +19 -18
  467. package/src/types/generated/queries.ts +20 -19
  468. package/src/types/generated/types.ts +6 -0
  469. package/src/types/index.ts +15 -18
  470. package/src/utils/apiEndpoints.ts +8 -0
  471. package/src/version.ts +1 -1
  472. package/dist/cjs/index.js +0 -5631
  473. package/dist/cjs/index.js.map +0 -1
  474. package/dist/types/index.js +0 -176
  475. package/dist/types/index.js.map +0 -1
  476. package/src/utils/hdKey.ts +0 -113
@@ -1,5 +1,23 @@
1
- "use strict";var aptosSDK=(()=>{var Qd=Object.create;var xo=Object.defineProperty;var _c=Object.getOwnPropertyDescriptor;var Yd=Object.getOwnPropertyNames;var Xd=Object.getPrototypeOf,Zd=Object.prototype.hasOwnProperty;var vc=(r=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(r,{get:(t,e)=>(typeof require!="undefined"?require:t)[e]}):r)(function(r){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var ue=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),Ec=(r,t)=>{for(var e in t)xo(r,e,{get:t[e],enumerable:!0})},Sc=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Yd(t))!Zd.call(r,o)&&o!==e&&xo(r,o,{get:()=>t[o],enumerable:!(n=_c(t,o))||n.enumerable});return r};var Ss=(r,t,e)=>(e=r!=null?Qd(Xd(r)):{},Sc(t||!r||!r.__esModule?xo(e,"default",{value:r,enumerable:!0}):e,r)),Jd=r=>Sc(xo({},"__esModule",{value:!0}),r),Kr=(r,t,e,n)=>{for(var o=n>1?void 0:n?_c(t,e):t,s=r.length-1,a;s>=0;s--)(a=r[s])&&(o=(n?a(t,e,o):a(o))||o);return n&&o&&xo(t,e,o),o};var Jc=ue(()=>{});var eu=ue((nm,xi)=>{(function(r){"use strict";var t=function(c){var d,f=new Float64Array(16);if(c)for(d=0;d<c.length;d++)f[d]=c[d];return f},e=function(){throw new Error("no PRNG")},n=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var s=t(),a=t([1]),u=t([56129,1]),l=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]),y=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),m=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),v=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function A(c,d,f,i){c[d]=f>>24&255,c[d+1]=f>>16&255,c[d+2]=f>>8&255,c[d+3]=f&255,c[d+4]=i>>24&255,c[d+5]=i>>16&255,c[d+6]=i>>8&255,c[d+7]=i&255}function C(c,d,f,i,p){var x,b=0;for(x=0;x<p;x++)b|=c[d+x]^f[i+x];return(1&b-1>>>8)-1}function w(c,d,f,i){return C(c,d,f,i,16)}function E(c,d,f,i){return C(c,d,f,i,32)}function P(c,d,f,i){for(var p=i[0]&255|(i[1]&255)<<8|(i[2]&255)<<16|(i[3]&255)<<24,x=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,b=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,U=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,O=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,V=i[4]&255|(i[5]&255)<<8|(i[6]&255)<<16|(i[7]&255)<<24,M=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,Se=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,G=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,re=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,ie=i[8]&255|(i[9]&255)<<8|(i[10]&255)<<16|(i[11]&255)<<24,pe=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,de=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,se=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,ce=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,ae=i[12]&255|(i[13]&255)<<8|(i[14]&255)<<16|(i[15]&255)<<24,L=p,Y=x,N=b,K=U,j=O,D=V,T=M,_=Se,R=G,S=re,B=ie,k=pe,te=de,he=se,me=ce,ye=ae,g,we=0;we<20;we+=2)g=L+te|0,j^=g<<7|g>>>32-7,g=j+L|0,R^=g<<9|g>>>32-9,g=R+j|0,te^=g<<13|g>>>32-13,g=te+R|0,L^=g<<18|g>>>32-18,g=D+Y|0,S^=g<<7|g>>>32-7,g=S+D|0,he^=g<<9|g>>>32-9,g=he+S|0,Y^=g<<13|g>>>32-13,g=Y+he|0,D^=g<<18|g>>>32-18,g=B+T|0,me^=g<<7|g>>>32-7,g=me+B|0,N^=g<<9|g>>>32-9,g=N+me|0,T^=g<<13|g>>>32-13,g=T+N|0,B^=g<<18|g>>>32-18,g=ye+k|0,K^=g<<7|g>>>32-7,g=K+ye|0,_^=g<<9|g>>>32-9,g=_+K|0,k^=g<<13|g>>>32-13,g=k+_|0,ye^=g<<18|g>>>32-18,g=L+K|0,Y^=g<<7|g>>>32-7,g=Y+L|0,N^=g<<9|g>>>32-9,g=N+Y|0,K^=g<<13|g>>>32-13,g=K+N|0,L^=g<<18|g>>>32-18,g=D+j|0,T^=g<<7|g>>>32-7,g=T+D|0,_^=g<<9|g>>>32-9,g=_+T|0,j^=g<<13|g>>>32-13,g=j+_|0,D^=g<<18|g>>>32-18,g=B+S|0,k^=g<<7|g>>>32-7,g=k+B|0,R^=g<<9|g>>>32-9,g=R+k|0,S^=g<<13|g>>>32-13,g=S+R|0,B^=g<<18|g>>>32-18,g=ye+me|0,te^=g<<7|g>>>32-7,g=te+ye|0,he^=g<<9|g>>>32-9,g=he+te|0,me^=g<<13|g>>>32-13,g=me+he|0,ye^=g<<18|g>>>32-18;L=L+p|0,Y=Y+x|0,N=N+b|0,K=K+U|0,j=j+O|0,D=D+V|0,T=T+M|0,_=_+Se|0,R=R+G|0,S=S+re|0,B=B+ie|0,k=k+pe|0,te=te+de|0,he=he+se|0,me=me+ce|0,ye=ye+ae|0,c[0]=L>>>0&255,c[1]=L>>>8&255,c[2]=L>>>16&255,c[3]=L>>>24&255,c[4]=Y>>>0&255,c[5]=Y>>>8&255,c[6]=Y>>>16&255,c[7]=Y>>>24&255,c[8]=N>>>0&255,c[9]=N>>>8&255,c[10]=N>>>16&255,c[11]=N>>>24&255,c[12]=K>>>0&255,c[13]=K>>>8&255,c[14]=K>>>16&255,c[15]=K>>>24&255,c[16]=j>>>0&255,c[17]=j>>>8&255,c[18]=j>>>16&255,c[19]=j>>>24&255,c[20]=D>>>0&255,c[21]=D>>>8&255,c[22]=D>>>16&255,c[23]=D>>>24&255,c[24]=T>>>0&255,c[25]=T>>>8&255,c[26]=T>>>16&255,c[27]=T>>>24&255,c[28]=_>>>0&255,c[29]=_>>>8&255,c[30]=_>>>16&255,c[31]=_>>>24&255,c[32]=R>>>0&255,c[33]=R>>>8&255,c[34]=R>>>16&255,c[35]=R>>>24&255,c[36]=S>>>0&255,c[37]=S>>>8&255,c[38]=S>>>16&255,c[39]=S>>>24&255,c[40]=B>>>0&255,c[41]=B>>>8&255,c[42]=B>>>16&255,c[43]=B>>>24&255,c[44]=k>>>0&255,c[45]=k>>>8&255,c[46]=k>>>16&255,c[47]=k>>>24&255,c[48]=te>>>0&255,c[49]=te>>>8&255,c[50]=te>>>16&255,c[51]=te>>>24&255,c[52]=he>>>0&255,c[53]=he>>>8&255,c[54]=he>>>16&255,c[55]=he>>>24&255,c[56]=me>>>0&255,c[57]=me>>>8&255,c[58]=me>>>16&255,c[59]=me>>>24&255,c[60]=ye>>>0&255,c[61]=ye>>>8&255,c[62]=ye>>>16&255,c[63]=ye>>>24&255}function q(c,d,f,i){for(var p=i[0]&255|(i[1]&255)<<8|(i[2]&255)<<16|(i[3]&255)<<24,x=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,b=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,U=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,O=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,V=i[4]&255|(i[5]&255)<<8|(i[6]&255)<<16|(i[7]&255)<<24,M=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,Se=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,G=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,re=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,ie=i[8]&255|(i[9]&255)<<8|(i[10]&255)<<16|(i[11]&255)<<24,pe=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,de=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,se=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,ce=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,ae=i[12]&255|(i[13]&255)<<8|(i[14]&255)<<16|(i[15]&255)<<24,L=p,Y=x,N=b,K=U,j=O,D=V,T=M,_=Se,R=G,S=re,B=ie,k=pe,te=de,he=se,me=ce,ye=ae,g,we=0;we<20;we+=2)g=L+te|0,j^=g<<7|g>>>32-7,g=j+L|0,R^=g<<9|g>>>32-9,g=R+j|0,te^=g<<13|g>>>32-13,g=te+R|0,L^=g<<18|g>>>32-18,g=D+Y|0,S^=g<<7|g>>>32-7,g=S+D|0,he^=g<<9|g>>>32-9,g=he+S|0,Y^=g<<13|g>>>32-13,g=Y+he|0,D^=g<<18|g>>>32-18,g=B+T|0,me^=g<<7|g>>>32-7,g=me+B|0,N^=g<<9|g>>>32-9,g=N+me|0,T^=g<<13|g>>>32-13,g=T+N|0,B^=g<<18|g>>>32-18,g=ye+k|0,K^=g<<7|g>>>32-7,g=K+ye|0,_^=g<<9|g>>>32-9,g=_+K|0,k^=g<<13|g>>>32-13,g=k+_|0,ye^=g<<18|g>>>32-18,g=L+K|0,Y^=g<<7|g>>>32-7,g=Y+L|0,N^=g<<9|g>>>32-9,g=N+Y|0,K^=g<<13|g>>>32-13,g=K+N|0,L^=g<<18|g>>>32-18,g=D+j|0,T^=g<<7|g>>>32-7,g=T+D|0,_^=g<<9|g>>>32-9,g=_+T|0,j^=g<<13|g>>>32-13,g=j+_|0,D^=g<<18|g>>>32-18,g=B+S|0,k^=g<<7|g>>>32-7,g=k+B|0,R^=g<<9|g>>>32-9,g=R+k|0,S^=g<<13|g>>>32-13,g=S+R|0,B^=g<<18|g>>>32-18,g=ye+me|0,te^=g<<7|g>>>32-7,g=te+ye|0,he^=g<<9|g>>>32-9,g=he+te|0,me^=g<<13|g>>>32-13,g=me+he|0,ye^=g<<18|g>>>32-18;c[0]=L>>>0&255,c[1]=L>>>8&255,c[2]=L>>>16&255,c[3]=L>>>24&255,c[4]=D>>>0&255,c[5]=D>>>8&255,c[6]=D>>>16&255,c[7]=D>>>24&255,c[8]=B>>>0&255,c[9]=B>>>8&255,c[10]=B>>>16&255,c[11]=B>>>24&255,c[12]=ye>>>0&255,c[13]=ye>>>8&255,c[14]=ye>>>16&255,c[15]=ye>>>24&255,c[16]=T>>>0&255,c[17]=T>>>8&255,c[18]=T>>>16&255,c[19]=T>>>24&255,c[20]=_>>>0&255,c[21]=_>>>8&255,c[22]=_>>>16&255,c[23]=_>>>24&255,c[24]=R>>>0&255,c[25]=R>>>8&255,c[26]=R>>>16&255,c[27]=R>>>24&255,c[28]=S>>>0&255,c[29]=S>>>8&255,c[30]=S>>>16&255,c[31]=S>>>24&255}function I(c,d,f,i){P(c,d,f,i)}function J(c,d,f,i){q(c,d,f,i)}var F=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function W(c,d,f,i,p,x,b){var U=new Uint8Array(16),O=new Uint8Array(64),V,M;for(M=0;M<16;M++)U[M]=0;for(M=0;M<8;M++)U[M]=x[M];for(;p>=64;){for(I(O,U,b,F),M=0;M<64;M++)c[d+M]=f[i+M]^O[M];for(V=1,M=8;M<16;M++)V=V+(U[M]&255)|0,U[M]=V&255,V>>>=8;p-=64,d+=64,i+=64}if(p>0)for(I(O,U,b,F),M=0;M<p;M++)c[d+M]=f[i+M]^O[M];return 0}function ee(c,d,f,i,p){var x=new Uint8Array(16),b=new Uint8Array(64),U,O;for(O=0;O<16;O++)x[O]=0;for(O=0;O<8;O++)x[O]=i[O];for(;f>=64;){for(I(b,x,p,F),O=0;O<64;O++)c[d+O]=b[O];for(U=1,O=8;O<16;O++)U=U+(x[O]&255)|0,x[O]=U&255,U>>>=8;f-=64,d+=64}if(f>0)for(I(b,x,p,F),O=0;O<f;O++)c[d+O]=b[O];return 0}function Q(c,d,f,i,p){var x=new Uint8Array(32);J(x,i,p,F);for(var b=new Uint8Array(8),U=0;U<8;U++)b[U]=i[U+16];return ee(c,d,f,b,x)}function _e(c,d,f,i,p,x,b){var U=new Uint8Array(32);J(U,x,b,F);for(var O=new Uint8Array(8),V=0;V<8;V++)O[V]=x[V+16];return W(c,d,f,i,p,O,U)}var Ae=function(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;var d,f,i,p,x,b,U,O;d=c[0]&255|(c[1]&255)<<8,this.r[0]=d&8191,f=c[2]&255|(c[3]&255)<<8,this.r[1]=(d>>>13|f<<3)&8191,i=c[4]&255|(c[5]&255)<<8,this.r[2]=(f>>>10|i<<6)&7939,p=c[6]&255|(c[7]&255)<<8,this.r[3]=(i>>>7|p<<9)&8191,x=c[8]&255|(c[9]&255)<<8,this.r[4]=(p>>>4|x<<12)&255,this.r[5]=x>>>1&8190,b=c[10]&255|(c[11]&255)<<8,this.r[6]=(x>>>14|b<<2)&8191,U=c[12]&255|(c[13]&255)<<8,this.r[7]=(b>>>11|U<<5)&8065,O=c[14]&255|(c[15]&255)<<8,this.r[8]=(U>>>8|O<<8)&8191,this.r[9]=O>>>5&127,this.pad[0]=c[16]&255|(c[17]&255)<<8,this.pad[1]=c[18]&255|(c[19]&255)<<8,this.pad[2]=c[20]&255|(c[21]&255)<<8,this.pad[3]=c[22]&255|(c[23]&255)<<8,this.pad[4]=c[24]&255|(c[25]&255)<<8,this.pad[5]=c[26]&255|(c[27]&255)<<8,this.pad[6]=c[28]&255|(c[29]&255)<<8,this.pad[7]=c[30]&255|(c[31]&255)<<8};Ae.prototype.blocks=function(c,d,f){for(var i=this.fin?0:2048,p,x,b,U,O,V,M,Se,G,re,ie,pe,de,se,ce,ae,L,Y,N,K=this.h[0],j=this.h[1],D=this.h[2],T=this.h[3],_=this.h[4],R=this.h[5],S=this.h[6],B=this.h[7],k=this.h[8],te=this.h[9],he=this.r[0],me=this.r[1],ye=this.r[2],g=this.r[3],we=this.r[4],Ue=this.r[5],Be=this.r[6],xe=this.r[7],ve=this.r[8],Ee=this.r[9];f>=16;)p=c[d+0]&255|(c[d+1]&255)<<8,K+=p&8191,x=c[d+2]&255|(c[d+3]&255)<<8,j+=(p>>>13|x<<3)&8191,b=c[d+4]&255|(c[d+5]&255)<<8,D+=(x>>>10|b<<6)&8191,U=c[d+6]&255|(c[d+7]&255)<<8,T+=(b>>>7|U<<9)&8191,O=c[d+8]&255|(c[d+9]&255)<<8,_+=(U>>>4|O<<12)&8191,R+=O>>>1&8191,V=c[d+10]&255|(c[d+11]&255)<<8,S+=(O>>>14|V<<2)&8191,M=c[d+12]&255|(c[d+13]&255)<<8,B+=(V>>>11|M<<5)&8191,Se=c[d+14]&255|(c[d+15]&255)<<8,k+=(M>>>8|Se<<8)&8191,te+=Se>>>5|i,G=0,re=G,re+=K*he,re+=j*(5*Ee),re+=D*(5*ve),re+=T*(5*xe),re+=_*(5*Be),G=re>>>13,re&=8191,re+=R*(5*Ue),re+=S*(5*we),re+=B*(5*g),re+=k*(5*ye),re+=te*(5*me),G+=re>>>13,re&=8191,ie=G,ie+=K*me,ie+=j*he,ie+=D*(5*Ee),ie+=T*(5*ve),ie+=_*(5*xe),G=ie>>>13,ie&=8191,ie+=R*(5*Be),ie+=S*(5*Ue),ie+=B*(5*we),ie+=k*(5*g),ie+=te*(5*ye),G+=ie>>>13,ie&=8191,pe=G,pe+=K*ye,pe+=j*me,pe+=D*he,pe+=T*(5*Ee),pe+=_*(5*ve),G=pe>>>13,pe&=8191,pe+=R*(5*xe),pe+=S*(5*Be),pe+=B*(5*Ue),pe+=k*(5*we),pe+=te*(5*g),G+=pe>>>13,pe&=8191,de=G,de+=K*g,de+=j*ye,de+=D*me,de+=T*he,de+=_*(5*Ee),G=de>>>13,de&=8191,de+=R*(5*ve),de+=S*(5*xe),de+=B*(5*Be),de+=k*(5*Ue),de+=te*(5*we),G+=de>>>13,de&=8191,se=G,se+=K*we,se+=j*g,se+=D*ye,se+=T*me,se+=_*he,G=se>>>13,se&=8191,se+=R*(5*Ee),se+=S*(5*ve),se+=B*(5*xe),se+=k*(5*Be),se+=te*(5*Ue),G+=se>>>13,se&=8191,ce=G,ce+=K*Ue,ce+=j*we,ce+=D*g,ce+=T*ye,ce+=_*me,G=ce>>>13,ce&=8191,ce+=R*he,ce+=S*(5*Ee),ce+=B*(5*ve),ce+=k*(5*xe),ce+=te*(5*Be),G+=ce>>>13,ce&=8191,ae=G,ae+=K*Be,ae+=j*Ue,ae+=D*we,ae+=T*g,ae+=_*ye,G=ae>>>13,ae&=8191,ae+=R*me,ae+=S*he,ae+=B*(5*Ee),ae+=k*(5*ve),ae+=te*(5*xe),G+=ae>>>13,ae&=8191,L=G,L+=K*xe,L+=j*Be,L+=D*Ue,L+=T*we,L+=_*g,G=L>>>13,L&=8191,L+=R*ye,L+=S*me,L+=B*he,L+=k*(5*Ee),L+=te*(5*ve),G+=L>>>13,L&=8191,Y=G,Y+=K*ve,Y+=j*xe,Y+=D*Be,Y+=T*Ue,Y+=_*we,G=Y>>>13,Y&=8191,Y+=R*g,Y+=S*ye,Y+=B*me,Y+=k*he,Y+=te*(5*Ee),G+=Y>>>13,Y&=8191,N=G,N+=K*Ee,N+=j*ve,N+=D*xe,N+=T*Be,N+=_*Ue,G=N>>>13,N&=8191,N+=R*we,N+=S*g,N+=B*ye,N+=k*me,N+=te*he,G+=N>>>13,N&=8191,G=(G<<2)+G|0,G=G+re|0,re=G&8191,G=G>>>13,ie+=G,K=re,j=ie,D=pe,T=de,_=se,R=ce,S=ae,B=L,k=Y,te=N,d+=16,f-=16;this.h[0]=K,this.h[1]=j,this.h[2]=D,this.h[3]=T,this.h[4]=_,this.h[5]=R,this.h[6]=S,this.h[7]=B,this.h[8]=k,this.h[9]=te},Ae.prototype.finish=function(c,d){var f=new Uint16Array(10),i,p,x,b;if(this.leftover){for(b=this.leftover,this.buffer[b++]=1;b<16;b++)this.buffer[b]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(i=this.h[1]>>>13,this.h[1]&=8191,b=2;b<10;b++)this.h[b]+=i,i=this.h[b]>>>13,this.h[b]&=8191;for(this.h[0]+=i*5,i=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=i,i=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=i,f[0]=this.h[0]+5,i=f[0]>>>13,f[0]&=8191,b=1;b<10;b++)f[b]=this.h[b]+i,i=f[b]>>>13,f[b]&=8191;for(f[9]-=1<<13,p=(i^1)-1,b=0;b<10;b++)f[b]&=p;for(p=~p,b=0;b<10;b++)this.h[b]=this.h[b]&p|f[b];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,x=this.h[0]+this.pad[0],this.h[0]=x&65535,b=1;b<8;b++)x=(this.h[b]+this.pad[b]|0)+(x>>>16)|0,this.h[b]=x&65535;c[d+0]=this.h[0]>>>0&255,c[d+1]=this.h[0]>>>8&255,c[d+2]=this.h[1]>>>0&255,c[d+3]=this.h[1]>>>8&255,c[d+4]=this.h[2]>>>0&255,c[d+5]=this.h[2]>>>8&255,c[d+6]=this.h[3]>>>0&255,c[d+7]=this.h[3]>>>8&255,c[d+8]=this.h[4]>>>0&255,c[d+9]=this.h[4]>>>8&255,c[d+10]=this.h[5]>>>0&255,c[d+11]=this.h[5]>>>8&255,c[d+12]=this.h[6]>>>0&255,c[d+13]=this.h[6]>>>8&255,c[d+14]=this.h[7]>>>0&255,c[d+15]=this.h[7]>>>8&255},Ae.prototype.update=function(c,d,f){var i,p;if(this.leftover){for(p=16-this.leftover,p>f&&(p=f),i=0;i<p;i++)this.buffer[this.leftover+i]=c[d+i];if(f-=p,d+=p,this.leftover+=p,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(f>=16&&(p=f-f%16,this.blocks(c,d,p),d+=p,f-=p),f){for(i=0;i<f;i++)this.buffer[this.leftover+i]=c[d+i];this.leftover+=f}};function ge(c,d,f,i,p,x){var b=new Ae(x);return b.update(f,i,p),b.finish(c,d),0}function ze(c,d,f,i,p,x){var b=new Uint8Array(16);return ge(b,0,f,i,p,x),w(c,d,b,0)}function He(c,d,f,i,p){var x;if(f<32)return-1;for(_e(c,0,d,0,f,i,p),ge(c,16,c,32,f-32,c),x=0;x<16;x++)c[x]=0;return 0}function ct(c,d,f,i,p){var x,b=new Uint8Array(32);if(f<32||(Q(b,0,32,i,p),ze(d,16,d,32,f-32,b)!==0))return-1;for(_e(c,0,d,0,f,i,p),x=0;x<32;x++)c[x]=0;return 0}function z(c,d){var f;for(f=0;f<16;f++)c[f]=d[f]|0}function $(c){var d,f,i=1;for(d=0;d<16;d++)f=c[d]+i+65535,i=Math.floor(f/65536),c[d]=f-i*65536;c[0]+=i-1+37*(i-1)}function fe(c,d,f){for(var i,p=~(f-1),x=0;x<16;x++)i=p&(c[x]^d[x]),c[x]^=i,d[x]^=i}function Ce(c,d){var f,i,p,x=t(),b=t();for(f=0;f<16;f++)b[f]=d[f];for($(b),$(b),$(b),i=0;i<2;i++){for(x[0]=b[0]-65517,f=1;f<15;f++)x[f]=b[f]-65535-(x[f-1]>>16&1),x[f-1]&=65535;x[15]=b[15]-32767-(x[14]>>16&1),p=x[15]>>16&1,x[14]&=65535,fe(b,x,1-p)}for(f=0;f<16;f++)c[2*f]=b[f]&255,c[2*f+1]=b[f]>>8}function Re(c,d){var f=new Uint8Array(32),i=new Uint8Array(32);return Ce(f,c),Ce(i,d),E(f,0,i,0)}function We(c){var d=new Uint8Array(32);return Ce(d,c),d[0]&1}function at(c,d){var f;for(f=0;f<16;f++)c[f]=d[2*f]+(d[2*f+1]<<8);c[15]&=32767}function De(c,d,f){for(var i=0;i<16;i++)c[i]=d[i]+f[i]}function Xe(c,d,f){for(var i=0;i<16;i++)c[i]=d[i]-f[i]}function le(c,d,f){var i,p,x=0,b=0,U=0,O=0,V=0,M=0,Se=0,G=0,re=0,ie=0,pe=0,de=0,se=0,ce=0,ae=0,L=0,Y=0,N=0,K=0,j=0,D=0,T=0,_=0,R=0,S=0,B=0,k=0,te=0,he=0,me=0,ye=0,g=f[0],we=f[1],Ue=f[2],Be=f[3],xe=f[4],ve=f[5],Ee=f[6],Qe=f[7],Pe=f[8],Fe=f[9],$e=f[10],Ke=f[11],et=f[12],ut=f[13],ft=f[14],lt=f[15];i=d[0],x+=i*g,b+=i*we,U+=i*Ue,O+=i*Be,V+=i*xe,M+=i*ve,Se+=i*Ee,G+=i*Qe,re+=i*Pe,ie+=i*Fe,pe+=i*$e,de+=i*Ke,se+=i*et,ce+=i*ut,ae+=i*ft,L+=i*lt,i=d[1],b+=i*g,U+=i*we,O+=i*Ue,V+=i*Be,M+=i*xe,Se+=i*ve,G+=i*Ee,re+=i*Qe,ie+=i*Pe,pe+=i*Fe,de+=i*$e,se+=i*Ke,ce+=i*et,ae+=i*ut,L+=i*ft,Y+=i*lt,i=d[2],U+=i*g,O+=i*we,V+=i*Ue,M+=i*Be,Se+=i*xe,G+=i*ve,re+=i*Ee,ie+=i*Qe,pe+=i*Pe,de+=i*Fe,se+=i*$e,ce+=i*Ke,ae+=i*et,L+=i*ut,Y+=i*ft,N+=i*lt,i=d[3],O+=i*g,V+=i*we,M+=i*Ue,Se+=i*Be,G+=i*xe,re+=i*ve,ie+=i*Ee,pe+=i*Qe,de+=i*Pe,se+=i*Fe,ce+=i*$e,ae+=i*Ke,L+=i*et,Y+=i*ut,N+=i*ft,K+=i*lt,i=d[4],V+=i*g,M+=i*we,Se+=i*Ue,G+=i*Be,re+=i*xe,ie+=i*ve,pe+=i*Ee,de+=i*Qe,se+=i*Pe,ce+=i*Fe,ae+=i*$e,L+=i*Ke,Y+=i*et,N+=i*ut,K+=i*ft,j+=i*lt,i=d[5],M+=i*g,Se+=i*we,G+=i*Ue,re+=i*Be,ie+=i*xe,pe+=i*ve,de+=i*Ee,se+=i*Qe,ce+=i*Pe,ae+=i*Fe,L+=i*$e,Y+=i*Ke,N+=i*et,K+=i*ut,j+=i*ft,D+=i*lt,i=d[6],Se+=i*g,G+=i*we,re+=i*Ue,ie+=i*Be,pe+=i*xe,de+=i*ve,se+=i*Ee,ce+=i*Qe,ae+=i*Pe,L+=i*Fe,Y+=i*$e,N+=i*Ke,K+=i*et,j+=i*ut,D+=i*ft,T+=i*lt,i=d[7],G+=i*g,re+=i*we,ie+=i*Ue,pe+=i*Be,de+=i*xe,se+=i*ve,ce+=i*Ee,ae+=i*Qe,L+=i*Pe,Y+=i*Fe,N+=i*$e,K+=i*Ke,j+=i*et,D+=i*ut,T+=i*ft,_+=i*lt,i=d[8],re+=i*g,ie+=i*we,pe+=i*Ue,de+=i*Be,se+=i*xe,ce+=i*ve,ae+=i*Ee,L+=i*Qe,Y+=i*Pe,N+=i*Fe,K+=i*$e,j+=i*Ke,D+=i*et,T+=i*ut,_+=i*ft,R+=i*lt,i=d[9],ie+=i*g,pe+=i*we,de+=i*Ue,se+=i*Be,ce+=i*xe,ae+=i*ve,L+=i*Ee,Y+=i*Qe,N+=i*Pe,K+=i*Fe,j+=i*$e,D+=i*Ke,T+=i*et,_+=i*ut,R+=i*ft,S+=i*lt,i=d[10],pe+=i*g,de+=i*we,se+=i*Ue,ce+=i*Be,ae+=i*xe,L+=i*ve,Y+=i*Ee,N+=i*Qe,K+=i*Pe,j+=i*Fe,D+=i*$e,T+=i*Ke,_+=i*et,R+=i*ut,S+=i*ft,B+=i*lt,i=d[11],de+=i*g,se+=i*we,ce+=i*Ue,ae+=i*Be,L+=i*xe,Y+=i*ve,N+=i*Ee,K+=i*Qe,j+=i*Pe,D+=i*Fe,T+=i*$e,_+=i*Ke,R+=i*et,S+=i*ut,B+=i*ft,k+=i*lt,i=d[12],se+=i*g,ce+=i*we,ae+=i*Ue,L+=i*Be,Y+=i*xe,N+=i*ve,K+=i*Ee,j+=i*Qe,D+=i*Pe,T+=i*Fe,_+=i*$e,R+=i*Ke,S+=i*et,B+=i*ut,k+=i*ft,te+=i*lt,i=d[13],ce+=i*g,ae+=i*we,L+=i*Ue,Y+=i*Be,N+=i*xe,K+=i*ve,j+=i*Ee,D+=i*Qe,T+=i*Pe,_+=i*Fe,R+=i*$e,S+=i*Ke,B+=i*et,k+=i*ut,te+=i*ft,he+=i*lt,i=d[14],ae+=i*g,L+=i*we,Y+=i*Ue,N+=i*Be,K+=i*xe,j+=i*ve,D+=i*Ee,T+=i*Qe,_+=i*Pe,R+=i*Fe,S+=i*$e,B+=i*Ke,k+=i*et,te+=i*ut,he+=i*ft,me+=i*lt,i=d[15],L+=i*g,Y+=i*we,N+=i*Ue,K+=i*Be,j+=i*xe,D+=i*ve,T+=i*Ee,_+=i*Qe,R+=i*Pe,S+=i*Fe,B+=i*$e,k+=i*Ke,te+=i*et,he+=i*ut,me+=i*ft,ye+=i*lt,x+=38*Y,b+=38*N,U+=38*K,O+=38*j,V+=38*D,M+=38*T,Se+=38*_,G+=38*R,re+=38*S,ie+=38*B,pe+=38*k,de+=38*te,se+=38*he,ce+=38*me,ae+=38*ye,p=1,i=x+p+65535,p=Math.floor(i/65536),x=i-p*65536,i=b+p+65535,p=Math.floor(i/65536),b=i-p*65536,i=U+p+65535,p=Math.floor(i/65536),U=i-p*65536,i=O+p+65535,p=Math.floor(i/65536),O=i-p*65536,i=V+p+65535,p=Math.floor(i/65536),V=i-p*65536,i=M+p+65535,p=Math.floor(i/65536),M=i-p*65536,i=Se+p+65535,p=Math.floor(i/65536),Se=i-p*65536,i=G+p+65535,p=Math.floor(i/65536),G=i-p*65536,i=re+p+65535,p=Math.floor(i/65536),re=i-p*65536,i=ie+p+65535,p=Math.floor(i/65536),ie=i-p*65536,i=pe+p+65535,p=Math.floor(i/65536),pe=i-p*65536,i=de+p+65535,p=Math.floor(i/65536),de=i-p*65536,i=se+p+65535,p=Math.floor(i/65536),se=i-p*65536,i=ce+p+65535,p=Math.floor(i/65536),ce=i-p*65536,i=ae+p+65535,p=Math.floor(i/65536),ae=i-p*65536,i=L+p+65535,p=Math.floor(i/65536),L=i-p*65536,x+=p-1+37*(p-1),p=1,i=x+p+65535,p=Math.floor(i/65536),x=i-p*65536,i=b+p+65535,p=Math.floor(i/65536),b=i-p*65536,i=U+p+65535,p=Math.floor(i/65536),U=i-p*65536,i=O+p+65535,p=Math.floor(i/65536),O=i-p*65536,i=V+p+65535,p=Math.floor(i/65536),V=i-p*65536,i=M+p+65535,p=Math.floor(i/65536),M=i-p*65536,i=Se+p+65535,p=Math.floor(i/65536),Se=i-p*65536,i=G+p+65535,p=Math.floor(i/65536),G=i-p*65536,i=re+p+65535,p=Math.floor(i/65536),re=i-p*65536,i=ie+p+65535,p=Math.floor(i/65536),ie=i-p*65536,i=pe+p+65535,p=Math.floor(i/65536),pe=i-p*65536,i=de+p+65535,p=Math.floor(i/65536),de=i-p*65536,i=se+p+65535,p=Math.floor(i/65536),se=i-p*65536,i=ce+p+65535,p=Math.floor(i/65536),ce=i-p*65536,i=ae+p+65535,p=Math.floor(i/65536),ae=i-p*65536,i=L+p+65535,p=Math.floor(i/65536),L=i-p*65536,x+=p-1+37*(p-1),c[0]=x,c[1]=b,c[2]=U,c[3]=O,c[4]=V,c[5]=M,c[6]=Se,c[7]=G,c[8]=re,c[9]=ie,c[10]=pe,c[11]=de,c[12]=se,c[13]=ce,c[14]=ae,c[15]=L}function Je(c,d){le(c,d,d)}function Lr(c,d){var f=t(),i;for(i=0;i<16;i++)f[i]=d[i];for(i=253;i>=0;i--)Je(f,f),i!==2&&i!==4&&le(f,f,d);for(i=0;i<16;i++)c[i]=f[i]}function Ft(c,d){var f=t(),i;for(i=0;i<16;i++)f[i]=d[i];for(i=250;i>=0;i--)Je(f,f),i!==1&&le(f,f,d);for(i=0;i<16;i++)c[i]=f[i]}function Fr(c,d,f){var i=new Uint8Array(32),p=new Float64Array(80),x,b,U=t(),O=t(),V=t(),M=t(),Se=t(),G=t();for(b=0;b<31;b++)i[b]=d[b];for(i[31]=d[31]&127|64,i[0]&=248,at(p,f),b=0;b<16;b++)O[b]=p[b],M[b]=U[b]=V[b]=0;for(U[0]=M[0]=1,b=254;b>=0;--b)x=i[b>>>3]>>>(b&7)&1,fe(U,O,x),fe(V,M,x),De(Se,U,V),Xe(U,U,V),De(V,O,M),Xe(O,O,M),Je(M,Se),Je(G,U),le(U,V,U),le(V,O,Se),De(Se,U,V),Xe(U,U,V),Je(O,U),Xe(V,M,G),le(U,V,u),De(U,U,M),le(V,V,U),le(U,M,G),le(M,O,p),Je(O,Se),fe(U,O,x),fe(V,M,x);for(b=0;b<16;b++)p[b+16]=U[b],p[b+32]=V[b],p[b+48]=O[b],p[b+64]=M[b];var re=p.subarray(32),ie=p.subarray(16);return Lr(re,re),le(ie,ie,re),Ce(c,ie),0}function Ht(c,d){return Fr(c,d,o)}function dr(c,d){return e(d,32),Ht(c,d)}function bn(c,d,f){var i=new Uint8Array(32);return Fr(i,f,d),J(c,n,i,F)}var pr=He,Ut=ct;function $r(c,d,f,i,p,x){var b=new Uint8Array(32);return bn(b,p,x),pr(c,d,f,i,b)}function Jo(c,d,f,i,p,x){var b=new Uint8Array(32);return bn(b,p,x),Ut(c,d,f,i,b)}var po=[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 mc(c,d,f,i){for(var p=new Int32Array(16),x=new Int32Array(16),b,U,O,V,M,Se,G,re,ie,pe,de,se,ce,ae,L,Y,N,K,j,D,T,_,R,S,B,k,te=c[0],he=c[1],me=c[2],ye=c[3],g=c[4],we=c[5],Ue=c[6],Be=c[7],xe=d[0],ve=d[1],Ee=d[2],Qe=d[3],Pe=d[4],Fe=d[5],$e=d[6],Ke=d[7],et=0;i>=128;){for(j=0;j<16;j++)D=8*j+et,p[j]=f[D+0]<<24|f[D+1]<<16|f[D+2]<<8|f[D+3],x[j]=f[D+4]<<24|f[D+5]<<16|f[D+6]<<8|f[D+7];for(j=0;j<80;j++)if(b=te,U=he,O=me,V=ye,M=g,Se=we,G=Ue,re=Be,ie=xe,pe=ve,de=Ee,se=Qe,ce=Pe,ae=Fe,L=$e,Y=Ke,T=Be,_=Ke,R=_&65535,S=_>>>16,B=T&65535,k=T>>>16,T=(g>>>14|Pe<<32-14)^(g>>>18|Pe<<32-18)^(Pe>>>41-32|g<<32-(41-32)),_=(Pe>>>14|g<<32-14)^(Pe>>>18|g<<32-18)^(g>>>41-32|Pe<<32-(41-32)),R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,T=g&we^~g&Ue,_=Pe&Fe^~Pe&$e,R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,T=po[j*2],_=po[j*2+1],R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,T=p[j%16],_=x[j%16],R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,S+=R>>>16,B+=S>>>16,k+=B>>>16,N=B&65535|k<<16,K=R&65535|S<<16,T=N,_=K,R=_&65535,S=_>>>16,B=T&65535,k=T>>>16,T=(te>>>28|xe<<32-28)^(xe>>>34-32|te<<32-(34-32))^(xe>>>39-32|te<<32-(39-32)),_=(xe>>>28|te<<32-28)^(te>>>34-32|xe<<32-(34-32))^(te>>>39-32|xe<<32-(39-32)),R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,T=te&he^te&me^he&me,_=xe&ve^xe&Ee^ve&Ee,R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,S+=R>>>16,B+=S>>>16,k+=B>>>16,re=B&65535|k<<16,Y=R&65535|S<<16,T=V,_=se,R=_&65535,S=_>>>16,B=T&65535,k=T>>>16,T=N,_=K,R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,S+=R>>>16,B+=S>>>16,k+=B>>>16,V=B&65535|k<<16,se=R&65535|S<<16,he=b,me=U,ye=O,g=V,we=M,Ue=Se,Be=G,te=re,ve=ie,Ee=pe,Qe=de,Pe=se,Fe=ce,$e=ae,Ke=L,xe=Y,j%16===15)for(D=0;D<16;D++)T=p[D],_=x[D],R=_&65535,S=_>>>16,B=T&65535,k=T>>>16,T=p[(D+9)%16],_=x[(D+9)%16],R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,N=p[(D+1)%16],K=x[(D+1)%16],T=(N>>>1|K<<32-1)^(N>>>8|K<<32-8)^N>>>7,_=(K>>>1|N<<32-1)^(K>>>8|N<<32-8)^(K>>>7|N<<32-7),R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,N=p[(D+14)%16],K=x[(D+14)%16],T=(N>>>19|K<<32-19)^(K>>>61-32|N<<32-(61-32))^N>>>6,_=(K>>>19|N<<32-19)^(N>>>61-32|K<<32-(61-32))^(K>>>6|N<<32-6),R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,S+=R>>>16,B+=S>>>16,k+=B>>>16,p[D]=B&65535|k<<16,x[D]=R&65535|S<<16;T=te,_=xe,R=_&65535,S=_>>>16,B=T&65535,k=T>>>16,T=c[0],_=d[0],R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,S+=R>>>16,B+=S>>>16,k+=B>>>16,c[0]=te=B&65535|k<<16,d[0]=xe=R&65535|S<<16,T=he,_=ve,R=_&65535,S=_>>>16,B=T&65535,k=T>>>16,T=c[1],_=d[1],R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,S+=R>>>16,B+=S>>>16,k+=B>>>16,c[1]=he=B&65535|k<<16,d[1]=ve=R&65535|S<<16,T=me,_=Ee,R=_&65535,S=_>>>16,B=T&65535,k=T>>>16,T=c[2],_=d[2],R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,S+=R>>>16,B+=S>>>16,k+=B>>>16,c[2]=me=B&65535|k<<16,d[2]=Ee=R&65535|S<<16,T=ye,_=Qe,R=_&65535,S=_>>>16,B=T&65535,k=T>>>16,T=c[3],_=d[3],R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,S+=R>>>16,B+=S>>>16,k+=B>>>16,c[3]=ye=B&65535|k<<16,d[3]=Qe=R&65535|S<<16,T=g,_=Pe,R=_&65535,S=_>>>16,B=T&65535,k=T>>>16,T=c[4],_=d[4],R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,S+=R>>>16,B+=S>>>16,k+=B>>>16,c[4]=g=B&65535|k<<16,d[4]=Pe=R&65535|S<<16,T=we,_=Fe,R=_&65535,S=_>>>16,B=T&65535,k=T>>>16,T=c[5],_=d[5],R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,S+=R>>>16,B+=S>>>16,k+=B>>>16,c[5]=we=B&65535|k<<16,d[5]=Fe=R&65535|S<<16,T=Ue,_=$e,R=_&65535,S=_>>>16,B=T&65535,k=T>>>16,T=c[6],_=d[6],R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,S+=R>>>16,B+=S>>>16,k+=B>>>16,c[6]=Ue=B&65535|k<<16,d[6]=$e=R&65535|S<<16,T=Be,_=Ke,R=_&65535,S=_>>>16,B=T&65535,k=T>>>16,T=c[7],_=d[7],R+=_&65535,S+=_>>>16,B+=T&65535,k+=T>>>16,S+=R>>>16,B+=S>>>16,k+=B>>>16,c[7]=Be=B&65535|k<<16,d[7]=Ke=R&65535|S<<16,et+=128,i-=128}return i}function An(c,d,f){var i=new Int32Array(8),p=new Int32Array(8),x=new Uint8Array(256),b,U=f;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,p[0]=4089235720,p[1]=2227873595,p[2]=4271175723,p[3]=1595750129,p[4]=2917565137,p[5]=725511199,p[6]=4215389547,p[7]=327033209,mc(i,p,d,f),f%=128,b=0;b<f;b++)x[b]=d[U-f+b];for(x[f]=128,f=256-128*(f<112?1:0),x[f-9]=0,A(x,f-8,U/536870912|0,U<<3),mc(i,p,x,f),b=0;b<8;b++)A(c,8*b,i[b],p[b]);return 0}function ei(c,d){var f=t(),i=t(),p=t(),x=t(),b=t(),U=t(),O=t(),V=t(),M=t();Xe(f,c[1],c[0]),Xe(M,d[1],d[0]),le(f,f,M),De(i,c[0],c[1]),De(M,d[0],d[1]),le(i,i,M),le(p,c[3],d[3]),le(p,p,h),le(x,c[2],d[2]),De(x,x,x),Xe(b,i,f),Xe(U,x,p),De(O,x,p),De(V,i,f),le(c[0],b,U),le(c[1],V,O),le(c[2],O,U),le(c[3],b,V)}function xc(c,d,f){var i;for(i=0;i<4;i++)fe(c[i],d[i],f)}function gs(c,d){var f=t(),i=t(),p=t();Lr(p,d[2]),le(f,d[0],p),le(i,d[1],p),Ce(c,i),c[31]^=We(f)<<7}function ms(c,d,f){var i,p;for(z(c[0],s),z(c[1],a),z(c[2],a),z(c[3],s),p=255;p>=0;--p)i=f[p/8|0]>>(p&7)&1,xc(c,d,i),ei(d,c),ei(c,c),xc(c,d,i)}function ti(c,d){var f=[t(),t(),t(),t()];z(f[0],y),z(f[1],m),z(f[2],a),le(f[3],y,m),ms(c,f,d)}function xs(c,d,f){var i=new Uint8Array(64),p=[t(),t(),t(),t()],x;for(f||e(d,32),An(i,d,32),i[0]&=248,i[31]&=127,i[31]|=64,ti(p,i),gs(c,p),x=0;x<32;x++)d[x+32]=c[x];return 0}var ri=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 bs(c,d){var f,i,p,x;for(i=63;i>=32;--i){for(f=0,p=i-32,x=i-12;p<x;++p)d[p]+=f-16*d[i]*ri[p-(i-32)],f=Math.floor((d[p]+128)/256),d[p]-=f*256;d[p]+=f,d[i]=0}for(f=0,p=0;p<32;p++)d[p]+=f-(d[31]>>4)*ri[p],f=d[p]>>8,d[p]&=255;for(p=0;p<32;p++)d[p]-=f*ri[p];for(i=0;i<32;i++)d[i+1]+=d[i]>>8,c[i]=d[i]&255}function As(c){var d=new Float64Array(64),f;for(f=0;f<64;f++)d[f]=c[f];for(f=0;f<64;f++)c[f]=0;bs(c,d)}function bc(c,d,f,i){var p=new Uint8Array(64),x=new Uint8Array(64),b=new Uint8Array(64),U,O,V=new Float64Array(64),M=[t(),t(),t(),t()];An(p,i,32),p[0]&=248,p[31]&=127,p[31]|=64;var Se=f+64;for(U=0;U<f;U++)c[64+U]=d[U];for(U=0;U<32;U++)c[32+U]=p[32+U];for(An(b,c.subarray(32),f+32),As(b),ti(M,b),gs(c,M),U=32;U<64;U++)c[U]=i[U];for(An(x,c,f+64),As(x),U=0;U<64;U++)V[U]=0;for(U=0;U<32;U++)V[U]=b[U];for(U=0;U<32;U++)for(O=0;O<32;O++)V[U+O]+=x[U]*p[O];return bs(c.subarray(32),V),Se}function Kd(c,d){var f=t(),i=t(),p=t(),x=t(),b=t(),U=t(),O=t();return z(c[2],a),at(c[1],d),Je(p,c[1]),le(x,p,l),Xe(p,p,c[2]),De(x,c[2],x),Je(b,x),Je(U,b),le(O,U,b),le(f,O,p),le(f,f,x),Ft(f,f),le(f,f,p),le(f,f,x),le(f,f,x),le(c[0],f,x),Je(i,c[0]),le(i,i,x),Re(i,p)&&le(c[0],c[0],v),Je(i,c[0]),le(i,i,x),Re(i,p)?-1:(We(c[0])===d[31]>>7&&Xe(c[0],s,c[0]),le(c[3],c[0],c[1]),0)}function ws(c,d,f,i){var p,x=new Uint8Array(32),b=new Uint8Array(64),U=[t(),t(),t(),t()],O=[t(),t(),t(),t()];if(f<64||Kd(O,i))return-1;for(p=0;p<f;p++)c[p]=d[p];for(p=0;p<32;p++)c[p+32]=i[p];if(An(b,c,f),As(b),ms(U,O,b),ti(O,d.subarray(32)),ei(U,O),gs(x,U),f-=64,E(d,0,x,0)){for(p=0;p<f;p++)c[p]=0;return-1}for(p=0;p<f;p++)c[p]=d[p+64];return f}var Ts=32,ni=24,ho=32,Mn=16,yo=32,oi=32,go=32,mo=32,_s=32,Ac=ni,jd=ho,Vd=Mn,hr=64,wn=32,qn=64,vs=32,Es=64;r.lowlevel={crypto_core_hsalsa20:J,crypto_stream_xor:_e,crypto_stream:Q,crypto_stream_salsa20_xor:W,crypto_stream_salsa20:ee,crypto_onetimeauth:ge,crypto_onetimeauth_verify:ze,crypto_verify_16:w,crypto_verify_32:E,crypto_secretbox:He,crypto_secretbox_open:ct,crypto_scalarmult:Fr,crypto_scalarmult_base:Ht,crypto_box_beforenm:bn,crypto_box_afternm:pr,crypto_box:$r,crypto_box_open:Jo,crypto_box_keypair:dr,crypto_hash:An,crypto_sign:bc,crypto_sign_keypair:xs,crypto_sign_open:ws,crypto_secretbox_KEYBYTES:Ts,crypto_secretbox_NONCEBYTES:ni,crypto_secretbox_ZEROBYTES:ho,crypto_secretbox_BOXZEROBYTES:Mn,crypto_scalarmult_BYTES:yo,crypto_scalarmult_SCALARBYTES:oi,crypto_box_PUBLICKEYBYTES:go,crypto_box_SECRETKEYBYTES:mo,crypto_box_BEFORENMBYTES:_s,crypto_box_NONCEBYTES:Ac,crypto_box_ZEROBYTES:jd,crypto_box_BOXZEROBYTES:Vd,crypto_sign_BYTES:hr,crypto_sign_PUBLICKEYBYTES:wn,crypto_sign_SECRETKEYBYTES:qn,crypto_sign_SEEDBYTES:vs,crypto_hash_BYTES:Es,gf:t,D:l,L:ri,pack25519:Ce,unpack25519:at,M:le,A:De,S:Je,Z:Xe,pow2523:Ft,add:ei,set25519:z,modL:bs,scalarmult:ms,scalarbase:ti};function wc(c,d){if(c.length!==Ts)throw new Error("bad key size");if(d.length!==ni)throw new Error("bad nonce size")}function Wd(c,d){if(c.length!==go)throw new Error("bad public key size");if(d.length!==mo)throw new Error("bad secret key size")}function Bt(){for(var c=0;c<arguments.length;c++)if(!(arguments[c]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function Tc(c){for(var d=0;d<c.length;d++)c[d]=0}r.randomBytes=function(c){var d=new Uint8Array(c);return e(d,c),d},r.secretbox=function(c,d,f){Bt(c,d,f),wc(f,d);for(var i=new Uint8Array(ho+c.length),p=new Uint8Array(i.length),x=0;x<c.length;x++)i[x+ho]=c[x];return He(p,i,i.length,d,f),p.subarray(Mn)},r.secretbox.open=function(c,d,f){Bt(c,d,f),wc(f,d);for(var i=new Uint8Array(Mn+c.length),p=new Uint8Array(i.length),x=0;x<c.length;x++)i[x+Mn]=c[x];return i.length<32||ct(p,i,i.length,d,f)!==0?null:p.subarray(ho)},r.secretbox.keyLength=Ts,r.secretbox.nonceLength=ni,r.secretbox.overheadLength=Mn,r.scalarMult=function(c,d){if(Bt(c,d),c.length!==oi)throw new Error("bad n size");if(d.length!==yo)throw new Error("bad p size");var f=new Uint8Array(yo);return Fr(f,c,d),f},r.scalarMult.base=function(c){if(Bt(c),c.length!==oi)throw new Error("bad n size");var d=new Uint8Array(yo);return Ht(d,c),d},r.scalarMult.scalarLength=oi,r.scalarMult.groupElementLength=yo,r.box=function(c,d,f,i){var p=r.box.before(f,i);return r.secretbox(c,d,p)},r.box.before=function(c,d){Bt(c,d),Wd(c,d);var f=new Uint8Array(_s);return bn(f,c,d),f},r.box.after=r.secretbox,r.box.open=function(c,d,f,i){var p=r.box.before(f,i);return r.secretbox.open(c,d,p)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var c=new Uint8Array(go),d=new Uint8Array(mo);return dr(c,d),{publicKey:c,secretKey:d}},r.box.keyPair.fromSecretKey=function(c){if(Bt(c),c.length!==mo)throw new Error("bad secret key size");var d=new Uint8Array(go);return Ht(d,c),{publicKey:d,secretKey:new Uint8Array(c)}},r.box.publicKeyLength=go,r.box.secretKeyLength=mo,r.box.sharedKeyLength=_s,r.box.nonceLength=Ac,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(c,d){if(Bt(c,d),d.length!==qn)throw new Error("bad secret key size");var f=new Uint8Array(hr+c.length);return bc(f,c,c.length,d),f},r.sign.open=function(c,d){if(Bt(c,d),d.length!==wn)throw new Error("bad public key size");var f=new Uint8Array(c.length),i=ws(f,c,c.length,d);if(i<0)return null;for(var p=new Uint8Array(i),x=0;x<p.length;x++)p[x]=f[x];return p},r.sign.detached=function(c,d){for(var f=r.sign(c,d),i=new Uint8Array(hr),p=0;p<i.length;p++)i[p]=f[p];return i},r.sign.detached.verify=function(c,d,f){if(Bt(c,d,f),d.length!==hr)throw new Error("bad signature size");if(f.length!==wn)throw new Error("bad public key size");var i=new Uint8Array(hr+c.length),p=new Uint8Array(hr+c.length),x;for(x=0;x<hr;x++)i[x]=d[x];for(x=0;x<c.length;x++)i[x+hr]=c[x];return ws(p,i,i.length,f)>=0},r.sign.keyPair=function(){var c=new Uint8Array(wn),d=new Uint8Array(qn);return xs(c,d),{publicKey:c,secretKey:d}},r.sign.keyPair.fromSecretKey=function(c){if(Bt(c),c.length!==qn)throw new Error("bad secret key size");for(var d=new Uint8Array(wn),f=0;f<d.length;f++)d[f]=c[32+f];return{publicKey:d,secretKey:new Uint8Array(c)}},r.sign.keyPair.fromSeed=function(c){if(Bt(c),c.length!==vs)throw new Error("bad seed size");for(var d=new Uint8Array(wn),f=new Uint8Array(qn),i=0;i<32;i++)f[i]=c[i];return xs(d,f,!0),{publicKey:d,secretKey:f}},r.sign.publicKeyLength=wn,r.sign.secretKeyLength=qn,r.sign.seedLength=vs,r.sign.signatureLength=hr,r.hash=function(c){Bt(c);var d=new Uint8Array(Es);return An(d,c,c.length),d},r.hash.hashLength=Es,r.verify=function(c,d){return Bt(c,d),c.length===0||d.length===0||c.length!==d.length?!1:C(c,0,d,0,c.length)===0},r.setPRNG=function(c){e=c},function(){var c=typeof self!="undefined"?self.crypto||self.msCrypto:null;if(c&&c.getRandomValues){var d=65536;r.setPRNG(function(f,i){var p,x=new Uint8Array(i);for(p=0;p<i;p+=d)c.getRandomValues(x.subarray(p,p+Math.min(i-p,d)));for(p=0;p<i;p++)f[p]=x[p];Tc(x)})}else typeof vc!="undefined"&&(c=Jc(),c&&c.randomBytes&&r.setPRNG(function(f,i){var p,x=c.randomBytes(i);for(p=0;p<i;p++)f[p]=x[p];Tc(x)}))}()})(typeof xi!="undefined"&&xi.exports?xi.exports:self.nacl=self.nacl||{})});var Uo=ue(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.output=gt.exists=gt.hash=gt.bytes=gt.bool=gt.number=void 0;function Ii(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}gt.number=Ii;function Eu(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}gt.bool=Eu;function aa(r,...t){if(!(r instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(r.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${r.length}`)}gt.bytes=aa;function Su(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ii(r.outputLen),Ii(r.blockLen)}gt.hash=Su;function Uu(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}gt.exists=Uu;function Bu(r,t){aa(r);let e=t.outputLen;if(r.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}gt.output=Bu;var _h={number:Ii,bool:Eu,bytes:aa,hash:Su,exists:Uu,output:Bu};gt.default=_h});var Cu=ue(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.crypto=void 0;Ri.crypto={node:void 0,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0}});var kn=ue(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.randomBytes=Te.wrapConstructorWithOpts=Te.wrapConstructor=Te.checkOpts=Te.Hash=Te.concatBytes=Te.toBytes=Te.utf8ToBytes=Te.asyncLoop=Te.nextTick=Te.hexToBytes=Te.bytesToHex=Te.isLE=Te.rotr=Te.createView=Te.u32=Te.u8=void 0;var Pi=Cu(),vh=r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength);Te.u8=vh;var Eh=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4));Te.u32=Eh;var Sh=r=>new DataView(r.buffer,r.byteOffset,r.byteLength);Te.createView=Sh;var Uh=(r,t)=>r<<32-t|r>>>t;Te.rotr=Uh;Te.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Te.isLE)throw new Error("Non little-endian hardware is not supported");var Bh=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function Ch(r){if(!(r instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=Bh[r[e]];return t}Te.bytesToHex=Ch;function Ih(r){if(typeof r!="string")throw new TypeError("hexToBytes: expected string, got "+typeof r);if(r.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let t=new Uint8Array(r.length/2);for(let e=0;e<t.length;e++){let n=e*2,o=r.slice(n,n+2),s=Number.parseInt(o,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");t[e]=s}return t}Te.hexToBytes=Ih;var Rh=async()=>{};Te.nextTick=Rh;async function Ph(r,t,e){let n=Date.now();for(let o=0;o<r;o++){e(o);let s=Date.now()-n;s>=0&&s<t||(await(0,Te.nextTick)(),n+=s)}}Te.asyncLoop=Ph;function Iu(r){if(typeof r!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof r}`);return new TextEncoder().encode(r)}Te.utf8ToBytes=Iu;function ua(r){if(typeof r=="string"&&(r=Iu(r)),!(r instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof r})`);return r}Te.toBytes=ua;function kh(...r){if(!r.every(n=>n instanceof Uint8Array))throw new Error("Uint8Array list expected");if(r.length===1)return r[0];let t=r.reduce((n,o)=>n+o.length,0),e=new Uint8Array(t);for(let n=0,o=0;n<r.length;n++){let s=r[n];e.set(s,o),o+=s.length}return e}Te.concatBytes=kh;var ca=class{clone(){return this._cloneInto()}};Te.Hash=ca;var Oh=r=>Object.prototype.toString.call(r)==="[object Object]"&&r.constructor===Object;function zh(r,t){if(t!==void 0&&(typeof t!="object"||!Oh(t)))throw new TypeError("Options should be object or undefined");return Object.assign(r,t)}Te.checkOpts=zh;function Hh(r){let t=n=>r().update(ua(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}Te.wrapConstructor=Hh;function Dh(r){let t=(n,o)=>r(o).update(ua(n)).digest(),e=r({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=n=>r(n),t}Te.wrapConstructorWithOpts=Dh;function Mh(r=32){if(Pi.crypto.web)return Pi.crypto.web.getRandomValues(new Uint8Array(r));if(Pi.crypto.node)return new Uint8Array(Pi.crypto.node.randomBytes(r).buffer);throw new Error("The environment doesn't have randomBytes function")}Te.randomBytes=Mh});var Pu=ue(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.hmac=void 0;var ki=Uo(),Ru=kn(),Oi=class extends Ru.Hash{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,ki.default.hash(t);let n=(0,Ru.toBytes)(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=t.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),s.fill(0)}update(t){return ki.default.exists(this),this.iHash.update(t),this}digestInto(t){ki.default.exists(this),ki.default.bytes(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:n,finished:o,destroyed:s,blockLen:a,outputLen:u}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=a,t.outputLen=u,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},qh=(r,t,e)=>new Oi(r,t).update(e).digest();Bo.hmac=qh;Bo.hmac.create=(r,t)=>new Oi(r,t)});var zu=ue(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.pbkdf2Async=to.pbkdf2=void 0;var zi=Uo(),Nh=Pu(),eo=kn();function ku(r,t,e,n){zi.default.hash(r);let o=(0,eo.checkOpts)({dkLen:32,asyncTick:10},n),{c:s,dkLen:a,asyncTick:u}=o;if(zi.default.number(s),zi.default.number(a),zi.default.number(u),s<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let l=(0,eo.toBytes)(t),h=(0,eo.toBytes)(e),y=new Uint8Array(a),m=Nh.hmac.create(r,l),v=m._cloneInto().update(h);return{c:s,dkLen:a,asyncTick:u,DK:y,PRF:m,PRFSalt:v}}function Ou(r,t,e,n,o){return r.destroy(),t.destroy(),n&&n.destroy(),o.fill(0),e}function Gh(r,t,e,n){let{c:o,dkLen:s,DK:a,PRF:u,PRFSalt:l}=ku(r,t,e,n),h,y=new Uint8Array(4),m=(0,eo.createView)(y),v=new Uint8Array(u.outputLen);for(let A=1,C=0;C<s;A++,C+=u.outputLen){let w=a.subarray(C,C+u.outputLen);m.setInt32(0,A,!1),(h=l._cloneInto(h)).update(y).digestInto(v),w.set(v.subarray(0,w.length));for(let E=1;E<o;E++){u._cloneInto(h).update(v).digestInto(v);for(let P=0;P<w.length;P++)w[P]^=v[P]}}return Ou(u,l,a,h,v)}to.pbkdf2=Gh;async function Lh(r,t,e,n){let{c:o,dkLen:s,asyncTick:a,DK:u,PRF:l,PRFSalt:h}=ku(r,t,e,n),y,m=new Uint8Array(4),v=(0,eo.createView)(m),A=new Uint8Array(l.outputLen);for(let C=1,w=0;w<s;C++,w+=l.outputLen){let E=u.subarray(w,w+l.outputLen);v.setInt32(0,C,!1),(y=h._cloneInto(y)).update(m).digestInto(A),E.set(A.subarray(0,E.length)),await(0,eo.asyncLoop)(o-1,a,P=>{l._cloneInto(y).update(A).digestInto(A);for(let q=0;q<E.length;q++)E[q]^=A[q]})}return Ou(l,h,u,y,A)}to.pbkdf2Async=Lh});var da=ue(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.SHA2=void 0;var fa=Uo(),Co=kn();function Fh(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let o=BigInt(32),s=BigInt(4294967295),a=Number(e>>o&s),u=Number(e&s),l=n?4:0,h=n?0:4;r.setUint32(t+l,a,n),r.setUint32(t+h,u,n)}var la=class extends Co.Hash{constructor(t,e,n,o){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,Co.createView)(this.buffer)}update(t){fa.default.exists(this);let{view:e,buffer:n,blockLen:o}=this;t=(0,Co.toBytes)(t);let s=t.length;for(let a=0;a<s;){let u=Math.min(o-this.pos,s-a);if(u===o){let l=(0,Co.createView)(t);for(;o<=s-a;a+=o)this.process(l,a);continue}n.set(t.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){fa.default.exists(this),fa.default.output(t,this),this.finished=!0;let{buffer:e,view:n,blockLen:o,isLE:s}=this,{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let l=a;l<o;l++)e[l]=0;Fh(n,o-8,BigInt(this.length*8),s),this.process(n,0);let u=(0,Co.createView)(t);this.get().forEach((l,h)=>u.setUint32(4*h,l,s))}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:n,length:o,finished:s,destroyed:a,pos:u}=this;return t.length=o,t.pos=u,t.finished=s,t.destroyed=a,o%e&&t.buffer.set(n),t}};Hi.SHA2=la});var Hu=ue(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.sha256=void 0;var $h=da(),Vt=kn(),Kh=(r,t,e)=>r&t^~r&e,jh=(r,t,e)=>r&t^r&e^t&e,Vh=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),nn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),on=new Uint32Array(64),pa=class extends $h.SHA2{constructor(){super(64,32,8,!1),this.A=nn[0]|0,this.B=nn[1]|0,this.C=nn[2]|0,this.D=nn[3]|0,this.E=nn[4]|0,this.F=nn[5]|0,this.G=nn[6]|0,this.H=nn[7]|0}get(){let{A:t,B:e,C:n,D:o,E:s,F:a,G:u,H:l}=this;return[t,e,n,o,s,a,u,l]}set(t,e,n,o,s,a,u,l){this.A=t|0,this.B=e|0,this.C=n|0,this.D=o|0,this.E=s|0,this.F=a|0,this.G=u|0,this.H=l|0}process(t,e){for(let m=0;m<16;m++,e+=4)on[m]=t.getUint32(e,!1);for(let m=16;m<64;m++){let v=on[m-15],A=on[m-2],C=(0,Vt.rotr)(v,7)^(0,Vt.rotr)(v,18)^v>>>3,w=(0,Vt.rotr)(A,17)^(0,Vt.rotr)(A,19)^A>>>10;on[m]=w+on[m-7]+C+on[m-16]|0}let{A:n,B:o,C:s,D:a,E:u,F:l,G:h,H:y}=this;for(let m=0;m<64;m++){let v=(0,Vt.rotr)(u,6)^(0,Vt.rotr)(u,11)^(0,Vt.rotr)(u,25),A=y+v+Kh(u,l,h)+Vh[m]+on[m]|0,w=((0,Vt.rotr)(n,2)^(0,Vt.rotr)(n,13)^(0,Vt.rotr)(n,22))+jh(n,o,s)|0;y=h,h=l,l=u,u=a+A|0,a=s,s=o,o=n,n=A+w|0}n=n+this.A|0,o=o+this.B|0,s=s+this.C|0,a=a+this.D|0,u=u+this.E|0,l=l+this.F|0,h=h+this.G|0,y=y+this.H|0,this.set(n,o,s,a,u,l,h,y)}roundClean(){on.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};Di.sha256=(0,Vt.wrapConstructor)(()=>new pa)});var qu=ue(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.add=qt.toBig=qt.split=qt.fromBig=void 0;var Mi=BigInt(2**32-1),ha=BigInt(32);function ya(r,t=!1){return t?{h:Number(r&Mi),l:Number(r>>ha&Mi)}:{h:Number(r>>ha&Mi)|0,l:Number(r&Mi)|0}}qt.fromBig=ya;function Du(r,t=!1){let e=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o<r.length;o++){let{h:s,l:a}=ya(r[o],t);[e[o],n[o]]=[s,a]}return[e,n]}qt.split=Du;var Wh=(r,t)=>BigInt(r>>>0)<<ha|BigInt(t>>>0);qt.toBig=Wh;var Qh=(r,t,e)=>r>>>e,Yh=(r,t,e)=>r<<32-e|t>>>e,Xh=(r,t,e)=>r>>>e|t<<32-e,Zh=(r,t,e)=>r<<32-e|t>>>e,Jh=(r,t,e)=>r<<64-e|t>>>e-32,ey=(r,t,e)=>r>>>e-32|t<<64-e,ty=(r,t)=>t,ry=(r,t)=>r,ny=(r,t,e)=>r<<e|t>>>32-e,oy=(r,t,e)=>t<<e|r>>>32-e,iy=(r,t,e)=>t<<e-32|r>>>64-e,sy=(r,t,e)=>r<<e-32|t>>>64-e;function Mu(r,t,e,n){let o=(t>>>0)+(n>>>0);return{h:r+e+(o/2**32|0)|0,l:o|0}}qt.add=Mu;var ay=(r,t,e)=>(r>>>0)+(t>>>0)+(e>>>0),cy=(r,t,e,n)=>t+e+n+(r/2**32|0)|0,uy=(r,t,e,n)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0),fy=(r,t,e,n,o)=>t+e+n+o+(r/2**32|0)|0,ly=(r,t,e,n,o)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0)+(o>>>0),dy=(r,t,e,n,o,s)=>t+e+n+o+s+(r/2**32|0)|0,py={fromBig:ya,split:Du,toBig:qt.toBig,shrSH:Qh,shrSL:Yh,rotrSH:Xh,rotrSL:Zh,rotrBH:Jh,rotrBL:ey,rotr32H:ty,rotr32L:ry,rotlSH:ny,rotlSL:oy,rotlBH:iy,rotlBL:sy,add:Mu,add3L:ay,add3H:cy,add4L:uy,add4H:fy,add5H:dy,add5L:ly};qt.default=py});var Nu=ue(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.sha384=ir.sha512_256=ir.sha512=ir.SHA512=void 0;var hy=da(),be=qu(),xa=kn(),[yy,gy]=be.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),sn=new Uint32Array(80),an=new Uint32Array(80),ro=class extends hy.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:n,Bl:o,Ch:s,Cl:a,Dh:u,Dl:l,Eh:h,El:y,Fh:m,Fl:v,Gh:A,Gl:C,Hh:w,Hl:E}=this;return[t,e,n,o,s,a,u,l,h,y,m,v,A,C,w,E]}set(t,e,n,o,s,a,u,l,h,y,m,v,A,C,w,E){this.Ah=t|0,this.Al=e|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=a|0,this.Dh=u|0,this.Dl=l|0,this.Eh=h|0,this.El=y|0,this.Fh=m|0,this.Fl=v|0,this.Gh=A|0,this.Gl=C|0,this.Hh=w|0,this.Hl=E|0}process(t,e){for(let I=0;I<16;I++,e+=4)sn[I]=t.getUint32(e),an[I]=t.getUint32(e+=4);for(let I=16;I<80;I++){let J=sn[I-15]|0,F=an[I-15]|0,W=be.default.rotrSH(J,F,1)^be.default.rotrSH(J,F,8)^be.default.shrSH(J,F,7),ee=be.default.rotrSL(J,F,1)^be.default.rotrSL(J,F,8)^be.default.shrSL(J,F,7),Q=sn[I-2]|0,_e=an[I-2]|0,Ae=be.default.rotrSH(Q,_e,19)^be.default.rotrBH(Q,_e,61)^be.default.shrSH(Q,_e,6),ge=be.default.rotrSL(Q,_e,19)^be.default.rotrBL(Q,_e,61)^be.default.shrSL(Q,_e,6),ze=be.default.add4L(ee,ge,an[I-7],an[I-16]),He=be.default.add4H(ze,W,Ae,sn[I-7],sn[I-16]);sn[I]=He|0,an[I]=ze|0}let{Ah:n,Al:o,Bh:s,Bl:a,Ch:u,Cl:l,Dh:h,Dl:y,Eh:m,El:v,Fh:A,Fl:C,Gh:w,Gl:E,Hh:P,Hl:q}=this;for(let I=0;I<80;I++){let J=be.default.rotrSH(m,v,14)^be.default.rotrSH(m,v,18)^be.default.rotrBH(m,v,41),F=be.default.rotrSL(m,v,14)^be.default.rotrSL(m,v,18)^be.default.rotrBL(m,v,41),W=m&A^~m&w,ee=v&C^~v&E,Q=be.default.add5L(q,F,ee,gy[I],an[I]),_e=be.default.add5H(Q,P,J,W,yy[I],sn[I]),Ae=Q|0,ge=be.default.rotrSH(n,o,28)^be.default.rotrBH(n,o,34)^be.default.rotrBH(n,o,39),ze=be.default.rotrSL(n,o,28)^be.default.rotrBL(n,o,34)^be.default.rotrBL(n,o,39),He=n&s^n&u^s&u,ct=o&a^o&l^a&l;P=w|0,q=E|0,w=A|0,E=C|0,A=m|0,C=v|0,{h:m,l:v}=be.default.add(h|0,y|0,_e|0,Ae|0),h=u|0,y=l|0,u=s|0,l=a|0,s=n|0,a=o|0;let z=be.default.add3L(Ae,ze,ct);n=be.default.add3H(z,_e,ge,He),o=z|0}({h:n,l:o}=be.default.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:a}=be.default.add(this.Bh|0,this.Bl|0,s|0,a|0),{h:u,l}=be.default.add(this.Ch|0,this.Cl|0,u|0,l|0),{h,l:y}=be.default.add(this.Dh|0,this.Dl|0,h|0,y|0),{h:m,l:v}=be.default.add(this.Eh|0,this.El|0,m|0,v|0),{h:A,l:C}=be.default.add(this.Fh|0,this.Fl|0,A|0,C|0),{h:w,l:E}=be.default.add(this.Gh|0,this.Gl|0,w|0,E|0),{h:P,l:q}=be.default.add(this.Hh|0,this.Hl|0,P|0,q|0),this.set(n,o,s,a,u,l,h,y,m,v,A,C,w,E,P,q)}roundClean(){sn.fill(0),an.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};ir.SHA512=ro;var ga=class extends ro{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},ma=class extends ro{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}};ir.sha512=(0,xa.wrapConstructor)(()=>new ro);ir.sha512_256=(0,xa.wrapConstructor)(()=>new ga);ir.sha384=(0,xa.wrapConstructor)(()=>new ma)});var Zu=ue(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.bytes=X.stringToBytes=X.str=X.bytesToString=X.hex=X.utf8=X.bech32m=X.bech32=X.base58check=X.base58xmr=X.base58xrp=X.base58flickr=X.base58=X.base64url=X.base64=X.base32crockford=X.base32hex=X.base32=X.base16=X.utils=X.assertNumber=void 0;function cn(r){if(!Number.isSafeInteger(r))throw new Error(`Wrong integer: ${r}`)}X.assertNumber=cn;function Wt(...r){let t=(o,s)=>a=>o(s(a)),e=Array.from(r).reverse().reduce((o,s)=>o?t(o,s.encode):s.encode,void 0),n=r.reduce((o,s)=>o?t(o,s.decode):s.decode,void 0);return{encode:e,decode:n}}function sr(r){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(e=>{if(cn(e),e<0||e>=r.length)throw new Error(`Digit index outside alphabet: ${e} (alphabet: ${r.length})`);return r[e]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(e=>{if(typeof e!="string")throw new Error(`alphabet.decode: not string element=${e}`);let n=r.indexOf(e);if(n===-1)throw new Error(`Unknown letter: "${e}". Allowed: ${r}`);return n})}}}function ar(r=""){if(typeof r!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let e of t)if(typeof e!="string")throw new Error(`join.encode: non-string input=${e}`);return t.join(r)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(r)}}}function Po(r,t="="){if(cn(r),typeof t!="string")throw new Error("padding chr should be string");return{encode(e){if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("padding.encode input should be array of strings");for(let n of e)if(typeof n!="string")throw new Error(`padding.encode: non-string input=${n}`);for(;e.length*r%8;)e.push(t);return e},decode(e){if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("padding.encode input should be array of strings");for(let o of e)if(typeof o!="string")throw new Error(`padding.decode: non-string input=${o}`);let n=e.length;if(n*r%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&e[n-1]===t;n--)if(!((n-1)*r%8))throw new Error("Invalid padding: string has too much padding");return e.slice(0,n)}}}function ju(r){if(typeof r!="function")throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>r(t)}}function Gu(r,t,e){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(e<2)throw new Error(`convertRadix: wrong to=${e}, base cannot be less than 2`);if(!Array.isArray(r))throw new Error("convertRadix: data should be array");if(!r.length)return[];let n=0,o=[],s=Array.from(r);for(s.forEach(a=>{if(cn(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,u=!0;for(let l=n;l<s.length;l++){let h=s[l],y=t*a+h;if(!Number.isSafeInteger(y)||t*a/t!==a||y-h!==t*a)throw new Error("convertRadix: carry overflow");if(a=y%e,s[l]=Math.floor(y/e),!Number.isSafeInteger(s[l])||s[l]*e+a!==y)throw new Error("convertRadix: carry overflow");if(u)s[l]?u=!1:n=l;else continue}if(o.push(a),u)break}for(let a=0;a<r.length-1&&r[a]===0;a++)o.push(0);return o.reverse()}var Vu=(r,t)=>t?Vu(t,r%t):r,qi=(r,t)=>r+(t-Vu(r,t));function ba(r,t,e,n){if(!Array.isArray(r))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(e<=0||e>32)throw new Error(`convertRadix2: wrong to=${e}`);if(qi(t,e)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${e} carryBits=${qi(t,e)}`);let o=0,s=0,a=2**e-1,u=[];for(let l of r){if(cn(l),l>=2**t)throw new Error(`convertRadix2: invalid data word=${l} from=${t}`);if(o=o<<t|l,s+t>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=e;s-=e)u.push((o>>s-e&a)>>>0);o&=2**s-1}if(o=o<<e-s&a,!n&&s>=t)throw new Error("Excess padding");if(!n&&o)throw new Error(`Non-zero padding: ${o}`);return n&&s>0&&u.push(o>>>0),u}function Wu(r){return cn(r),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return Gu(Array.from(t),2**8,r)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(Gu(t,r,2**8))}}}function vr(r,t=!1){if(cn(r),r<=0||r>32)throw new Error("radix2: bits should be in (0..32]");if(qi(8,r)>32||qi(r,8)>32)throw new Error("radix2: carry overflow");return{encode:e=>{if(!(e instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return ba(Array.from(e),8,r,!t)},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(ba(e,r,8,t))}}}function Lu(r){if(typeof r!="function")throw new Error("unsafeWrapper fn should be function");return function(...t){try{return r.apply(null,t)}catch(e){}}}function Qu(r,t){if(cn(r),typeof t!="function")throw new Error("checksum fn should be function");return{encode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");let n=t(e).slice(0,r),o=new Uint8Array(e.length+r);return o.set(e),o.set(n,e.length),o},decode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");let n=e.slice(0,-r),o=t(n).slice(0,r),s=e.slice(-r);for(let a=0;a<r;a++)if(o[a]!==s[a])throw new Error("Invalid checksum");return n}}}X.utils={alphabet:sr,chain:Wt,checksum:Qu,radix:Wu,radix2:vr,join:ar,padding:Po};X.base16=Wt(vr(4),sr("0123456789ABCDEF"),ar(""));X.base32=Wt(vr(5),sr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Po(5),ar(""));X.base32hex=Wt(vr(5),sr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Po(5),ar(""));X.base32crockford=Wt(vr(5),sr("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),ar(""),ju(r=>r.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));X.base64=Wt(vr(6),sr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Po(6),ar(""));X.base64url=Wt(vr(6),sr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Po(6),ar(""));var wa=r=>Wt(Wu(58),sr(r),ar(""));X.base58=wa("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");X.base58flickr=wa("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");X.base58xrp=wa("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");var Fu=[0,2,3,5,6,7,9,10,11];X.base58xmr={encode(r){let t="";for(let e=0;e<r.length;e+=8){let n=r.subarray(e,e+8);t+=X.base58.encode(n).padStart(Fu[n.length],"1")}return t},decode(r){let t=[];for(let e=0;e<r.length;e+=11){let n=r.slice(e,e+11),o=Fu.indexOf(n.length),s=X.base58.decode(n);for(let a=0;a<s.length-o;a++)if(s[a]!==0)throw new Error("base58xmr: wrong padding");t=t.concat(Array.from(s.slice(s.length-o)))}return Uint8Array.from(t)}};var my=r=>Wt(Qu(4,t=>r(r(t))),X.base58);X.base58check=my;var Aa=Wt(sr("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),ar("")),$u=[996825010,642813549,513874426,1027748829,705979059];function Io(r){let t=r>>25,e=(r&33554431)<<5;for(let n=0;n<$u.length;n++)(t>>n&1)===1&&(e^=$u[n]);return e}function Ku(r,t,e=1){let n=r.length,o=1;for(let s=0;s<n;s++){let a=r.charCodeAt(s);if(a<33||a>126)throw new Error(`Invalid prefix (${r})`);o=Io(o)^a>>5}o=Io(o);for(let s=0;s<n;s++)o=Io(o)^r.charCodeAt(s)&31;for(let s of t)o=Io(o)^s;for(let s=0;s<6;s++)o=Io(o);return o^=e,Aa.encode(ba([o%2**30],30,5,!1))}function Yu(r){let t=r==="bech32"?1:734539939,e=vr(5),n=e.decode,o=e.encode,s=Lu(n);function a(y,m,v=90){if(typeof y!="string")throw new Error(`bech32.encode prefix should be string, not ${typeof y}`);if(!Array.isArray(m)||m.length&&typeof m[0]!="number")throw new Error(`bech32.encode words should be array of numbers, not ${typeof m}`);let A=y.length+7+m.length;if(v!==!1&&A>v)throw new TypeError(`Length ${A} exceeds limit ${v}`);return y=y.toLowerCase(),`${y}1${Aa.encode(m)}${Ku(y,m,t)}`}function u(y,m=90){if(typeof y!="string")throw new Error(`bech32.decode input should be string, not ${typeof y}`);if(y.length<8||m!==!1&&y.length>m)throw new TypeError(`Wrong string length: ${y.length} (${y}). Expected (8..${m})`);let v=y.toLowerCase();if(y!==v&&y!==y.toUpperCase())throw new Error("String must be lowercase or uppercase");y=v;let A=y.lastIndexOf("1");if(A===0||A===-1)throw new Error('Letter "1" must be present between prefix and data only');let C=y.slice(0,A),w=y.slice(A+1);if(w.length<6)throw new Error("Data must be at least 6 characters long");let E=Aa.decode(w).slice(0,-6),P=Ku(C,E,t);if(!w.endsWith(P))throw new Error(`Invalid checksum in ${y}: expected "${P}"`);return{prefix:C,words:E}}let l=Lu(u);function h(y){let{prefix:m,words:v}=u(y,!1);return{prefix:m,words:v,bytes:n(v)}}return{encode:a,decode:u,decodeToBytes:h,decodeUnsafe:l,fromWords:n,fromWordsUnsafe:s,toWords:o}}X.bech32=Yu("bech32");X.bech32m=Yu("bech32m");X.utf8={encode:r=>new TextDecoder().decode(r),decode:r=>new TextEncoder().encode(r)};X.hex=Wt(vr(4),sr("0123456789abcdef"),ar(""),ju(r=>{if(typeof r!="string"||r.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof r} with length ${r.length}`);return r.toLowerCase()}));var Ro={utf8:X.utf8,hex:X.hex,base16:X.base16,base32:X.base32,base64:X.base64,base64url:X.base64url,base58:X.base58,base58xmr:X.base58xmr},Xu=`Invalid encoding type. Available types: ${Object.keys(Ro).join(", ")}`,xy=(r,t)=>{if(typeof r!="string"||!Ro.hasOwnProperty(r))throw new TypeError(Xu);if(!(t instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return Ro[r].encode(t)};X.bytesToString=xy;X.str=X.bytesToString;var by=(r,t)=>{if(!Ro.hasOwnProperty(r))throw new TypeError(Xu);if(typeof t!="string")throw new TypeError("stringToBytes() expects string");return Ro[r].decode(t)};X.stringToBytes=by;X.bytes=X.stringToBytes});var uf=ue(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});_t.mnemonicToSeedSync=_t.mnemonicToSeed=_t.validateMnemonic=_t.entropyToMnemonic=_t.mnemonicToEntropy=_t.generateMnemonic=void 0;var Ju=Uo(),ef=zu(),Ay=Hu(),tf=Nu(),wy=kn(),Ni=Zu(),Ty=r=>r[0]==="\u3042\u3044\u3053\u304F\u3057\u3093";function rf(r){if(typeof r!="string")throw new TypeError(`Invalid mnemonic type: ${typeof r}`);return r.normalize("NFKD")}function Ta(r){let t=rf(r),e=t.split(" ");if(![12,15,18,21,24].includes(e.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:e}}function nf(r){Ju.default.bytes(r,16,20,24,28,32)}function _y(r,t=128){if(Ju.default.number(t),t%32!==0||t>256)throw new TypeError("Invalid entropy");return af((0,wy.randomBytes)(t/8),r)}_t.generateMnemonic=_y;var vy=r=>{let t=8-r.length/4;return new Uint8Array([(0,Ay.sha256)(r)[0]>>t<<t])};function of(r){if(!Array.isArray(r)||r.length!==2**11||typeof r[0]!="string")throw new Error("Worlist: expected array of 2048 strings");return r.forEach(t=>{if(typeof t!="string")throw new Error(`Wordlist: non-string element: ${t}`)}),Ni.utils.chain(Ni.utils.checksum(1,vy),Ni.utils.radix2(11,!0),Ni.utils.alphabet(r))}function sf(r,t){let{words:e}=Ta(r),n=of(t).decode(e);return nf(n),n}_t.mnemonicToEntropy=sf;function af(r,t){return nf(r),of(t).encode(r).join(Ty(t)?"\u3000":" ")}_t.entropyToMnemonic=af;function Ey(r,t){try{sf(r,t)}catch(e){return!1}return!0}_t.validateMnemonic=Ey;var cf=r=>rf(`mnemonic${r}`);function Sy(r,t=""){return(0,ef.pbkdf2Async)(tf.sha512,Ta(r).nfkd,cf(t),{c:2048,dkLen:64})}_t.mnemonicToSeed=Sy;function Uy(r,t=""){return(0,ef.pbkdf2)(tf.sha512,Ta(r).nfkd,cf(t),{c:2048,dkLen:64})}_t.mnemonicToSeedSync=Uy});var Ia=ue((OA,Xf)=>{"use strict";Xf.exports=function(t,e){return function(){for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];return t.apply(e,o)}}});var it=ue((zA,el)=>{"use strict";var Oy=Ia(),Pa=Object.prototype.toString,ka=function(r){return function(t){var e=Pa.call(t);return r[e]||(r[e]=e.slice(8,-1).toLowerCase())}}(Object.create(null));function On(r){return r=r.toLowerCase(),function(e){return ka(e)===r}}function Oa(r){return Array.isArray(r)}function Vi(r){return typeof r=="undefined"}function zy(r){return r!==null&&!Vi(r)&&r.constructor!==null&&!Vi(r.constructor)&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}var Zf=On("ArrayBuffer");function Hy(r){var t;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?t=ArrayBuffer.isView(r):t=r&&r.buffer&&Zf(r.buffer),t}function Dy(r){return typeof r=="string"}function My(r){return typeof r=="number"}function Jf(r){return r!==null&&typeof r=="object"}function ji(r){if(ka(r)!=="object")return!1;var t=Object.getPrototypeOf(r);return t===null||t===Object.prototype}var qy=On("Date"),Ny=On("File"),Gy=On("Blob"),Ly=On("FileList");function za(r){return Pa.call(r)==="[object Function]"}function Fy(r){return Jf(r)&&za(r.pipe)}function $y(r){var t="[object FormData]";return r&&(typeof FormData=="function"&&r instanceof FormData||Pa.call(r)===t||za(r.toString)&&r.toString()===t)}var Ky=On("URLSearchParams");function jy(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function Vy(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function Ha(r,t){if(!(r===null||typeof r=="undefined"))if(typeof r!="object"&&(r=[r]),Oa(r))for(var e=0,n=r.length;e<n;e++)t.call(null,r[e],e,r);else for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&t.call(null,r[o],o,r)}function Ra(){var r={};function t(o,s){ji(r[s])&&ji(o)?r[s]=Ra(r[s],o):ji(o)?r[s]=Ra({},o):Oa(o)?r[s]=o.slice():r[s]=o}for(var e=0,n=arguments.length;e<n;e++)Ha(arguments[e],t);return r}function Wy(r,t,e){return Ha(t,function(o,s){e&&typeof o=="function"?r[s]=Oy(o,e):r[s]=o}),r}function Qy(r){return r.charCodeAt(0)===65279&&(r=r.slice(1)),r}function Yy(r,t,e,n){r.prototype=Object.create(t.prototype,n),r.prototype.constructor=r,e&&Object.assign(r.prototype,e)}function Xy(r,t,e){var n,o,s,a={};t=t||{};do{for(n=Object.getOwnPropertyNames(r),o=n.length;o-- >0;)s=n[o],a[s]||(t[s]=r[s],a[s]=!0);r=Object.getPrototypeOf(r)}while(r&&(!e||e(r,t))&&r!==Object.prototype);return t}function Zy(r,t,e){r=String(r),(e===void 0||e>r.length)&&(e=r.length),e-=t.length;var n=r.indexOf(t,e);return n!==-1&&n===e}function Jy(r){if(!r)return null;var t=r.length;if(Vi(t))return null;for(var e=new Array(t);t-- >0;)e[t]=r[t];return e}var eg=function(r){return function(t){return r&&t instanceof r}}(typeof Uint8Array!="undefined"&&Object.getPrototypeOf(Uint8Array));el.exports={isArray:Oa,isArrayBuffer:Zf,isBuffer:zy,isFormData:$y,isArrayBufferView:Hy,isString:Dy,isNumber:My,isObject:Jf,isPlainObject:ji,isUndefined:Vi,isDate:qy,isFile:Ny,isBlob:Gy,isFunction:za,isStream:Fy,isURLSearchParams:Ky,isStandardBrowserEnv:Vy,forEach:Ha,merge:Ra,extend:Wy,trim:jy,stripBOM:Qy,inherits:Yy,toFlatObject:Xy,kindOf:ka,kindOfTest:On,endsWith:Zy,toArray:Jy,isTypedArray:eg,isFileList:Ly}});var Da=ue((HA,rl)=>{"use strict";var oo=it();function tl(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}rl.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(oo.isURLSearchParams(e))o=e.toString();else{var s=[];oo.forEach(e,function(l,h){l===null||typeof l=="undefined"||(oo.isArray(l)?h=h+"[]":l=[l],oo.forEach(l,function(m){oo.isDate(m)?m=m.toISOString():oo.isObject(m)&&(m=JSON.stringify(m)),s.push(tl(h)+"="+tl(m))}))}),o=s.join("&")}if(o){var a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}});var ol=ue((DA,nl)=>{"use strict";var tg=it();function Wi(){this.handlers=[]}Wi.prototype.use=function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};Wi.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)};Wi.prototype.forEach=function(t){tg.forEach(this.handlers,function(n){n!==null&&t(n)})};nl.exports=Wi});var sl=ue((MA,il)=>{"use strict";var rg=it();il.exports=function(t,e){rg.forEach(t,function(o,s){s!==e&&s.toUpperCase()===e.toUpperCase()&&(t[e]=o,delete t[s])})}});var zn=ue((qA,fl)=>{"use strict";var al=it();function io(r,t,e,n,o){Error.call(this),this.message=r,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),n&&(this.request=n),o&&(this.response=o)}al.inherits(io,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var cl=io.prototype,ul={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(r){ul[r]={value:r}});Object.defineProperties(io,ul);Object.defineProperty(cl,"isAxiosError",{value:!0});io.from=function(r,t,e,n,o,s){var a=Object.create(cl);return al.toFlatObject(r,a,function(l){return l!==Error.prototype}),io.call(a,r.message,t,e,n,o),a.name=r.name,s&&Object.assign(a,s),a};fl.exports=io});var Ma=ue((NA,ll)=>{"use strict";ll.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}});var qa=ue((GA,dl)=>{"use strict";var Qt=it();function ng(r,t){t=t||new FormData;var e=[];function n(s){return s===null?"":Qt.isDate(s)?s.toISOString():Qt.isArrayBuffer(s)||Qt.isTypedArray(s)?typeof Blob=="function"?new Blob([s]):Buffer.from(s):s}function o(s,a){if(Qt.isPlainObject(s)||Qt.isArray(s)){if(e.indexOf(s)!==-1)throw Error("Circular reference detected in "+a);e.push(s),Qt.forEach(s,function(l,h){if(!Qt.isUndefined(l)){var y=a?a+"."+h:h,m;if(l&&!a&&typeof l=="object"){if(Qt.endsWith(h,"{}"))l=JSON.stringify(l);else if(Qt.endsWith(h,"[]")&&(m=Qt.toArray(l))){m.forEach(function(v){!Qt.isUndefined(v)&&t.append(y,n(v))});return}}o(l,y)}}),e.pop()}else t.append(a,n(s))}return o(r),t}dl.exports=ng});var hl=ue((LA,pl)=>{"use strict";var Na=zn();pl.exports=function(t,e,n){var o=n.config.validateStatus;!n.status||!o||o(n.status)?t(n):e(new Na("Request failed with status code "+n.status,[Na.ERR_BAD_REQUEST,Na.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}});var gl=ue((FA,yl)=>{"use strict";var Qi=it();yl.exports=Qi.isStandardBrowserEnv()?function(){return{write:function(e,n,o,s,a,u){var l=[];l.push(e+"="+encodeURIComponent(n)),Qi.isNumber(o)&&l.push("expires="+new Date(o).toGMTString()),Qi.isString(s)&&l.push("path="+s),Qi.isString(a)&&l.push("domain="+a),u===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(e){var n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var xl=ue(($A,ml)=>{"use strict";ml.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}});var Al=ue((KA,bl)=>{"use strict";bl.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}});var Ga=ue((jA,wl)=>{"use strict";var og=xl(),ig=Al();wl.exports=function(t,e){return t&&!og(e)?ig(t,e):e}});var _l=ue((VA,Tl)=>{"use strict";var La=it(),sg=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];Tl.exports=function(t){var e={},n,o,s;return t&&La.forEach(t.split(`
2
- `),function(u){if(s=u.indexOf(":"),n=La.trim(u.substr(0,s)).toLowerCase(),o=La.trim(u.substr(s+1)),n){if(e[n]&&sg.indexOf(n)>=0)return;n==="set-cookie"?e[n]=(e[n]?e[n]:[]).concat([o]):e[n]=e[n]?e[n]+", "+o:o}}),e}});var Sl=ue((WA,El)=>{"use strict";var vl=it();El.exports=vl.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a"),n;function o(s){var a=s;return t&&(e.setAttribute("href",a),a=e.href),e.setAttribute("href",a),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return n=o(window.location.href),function(a){var u=vl.isString(a)?o(a):a;return u.protocol===n.protocol&&u.host===n.host}}():function(){return function(){return!0}}()});var zo=ue((QA,Bl)=>{"use strict";var Fa=zn(),ag=it();function Ul(r){Fa.call(this,r==null?"canceled":r,Fa.ERR_CANCELED),this.name="CanceledError"}ag.inherits(Ul,Fa,{__CANCEL__:!0});Bl.exports=Ul});var Il=ue((YA,Cl)=>{"use strict";Cl.exports=function(t){var e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}});var $a=ue((XA,Rl)=>{"use strict";var Ho=it(),cg=hl(),ug=gl(),fg=Da(),lg=Ga(),dg=_l(),pg=Sl(),hg=Ma(),Er=zn(),yg=zo(),gg=Il();Rl.exports=function(t){return new Promise(function(n,o){var s=t.data,a=t.headers,u=t.responseType,l;function h(){t.cancelToken&&t.cancelToken.unsubscribe(l),t.signal&&t.signal.removeEventListener("abort",l)}Ho.isFormData(s)&&Ho.isStandardBrowserEnv()&&delete a["Content-Type"];var y=new XMLHttpRequest;if(t.auth){var m=t.auth.username||"",v=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.Authorization="Basic "+btoa(m+":"+v)}var A=lg(t.baseURL,t.url);y.open(t.method.toUpperCase(),fg(A,t.params,t.paramsSerializer),!0),y.timeout=t.timeout;function C(){if(!!y){var P="getAllResponseHeaders"in y?dg(y.getAllResponseHeaders()):null,q=!u||u==="text"||u==="json"?y.responseText:y.response,I={data:q,status:y.status,statusText:y.statusText,headers:P,config:t,request:y};cg(function(F){n(F),h()},function(F){o(F),h()},I),y=null}}if("onloadend"in y?y.onloadend=C:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(C)},y.onabort=function(){!y||(o(new Er("Request aborted",Er.ECONNABORTED,t,y)),y=null)},y.onerror=function(){o(new Er("Network Error",Er.ERR_NETWORK,t,y,y)),y=null},y.ontimeout=function(){var q=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",I=t.transitional||hg;t.timeoutErrorMessage&&(q=t.timeoutErrorMessage),o(new Er(q,I.clarifyTimeoutError?Er.ETIMEDOUT:Er.ECONNABORTED,t,y)),y=null},Ho.isStandardBrowserEnv()){var w=(t.withCredentials||pg(A))&&t.xsrfCookieName?ug.read(t.xsrfCookieName):void 0;w&&(a[t.xsrfHeaderName]=w)}"setRequestHeader"in y&&Ho.forEach(a,function(q,I){typeof s=="undefined"&&I.toLowerCase()==="content-type"?delete a[I]:y.setRequestHeader(I,q)}),Ho.isUndefined(t.withCredentials)||(y.withCredentials=!!t.withCredentials),u&&u!=="json"&&(y.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&y.addEventListener("progress",t.onDownloadProgress),typeof t.onUploadProgress=="function"&&y.upload&&y.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(l=function(P){!y||(o(!P||P&&P.type?new yg:P),y.abort(),y=null)},t.cancelToken&&t.cancelToken.subscribe(l),t.signal&&(t.signal.aborted?l():t.signal.addEventListener("abort",l))),s||(s=null);var E=gg(A);if(E&&["http","https","file"].indexOf(E)===-1){o(new Er("Unsupported protocol "+E+":",Er.ERR_BAD_REQUEST,t));return}y.send(s)})}});var kl=ue((ZA,Pl)=>{Pl.exports=null});var Xi=ue((JA,Dl)=>{"use strict";var st=it(),Ol=sl(),zl=zn(),mg=Ma(),xg=qa(),bg={"Content-Type":"application/x-www-form-urlencoded"};function Hl(r,t){!st.isUndefined(r)&&st.isUndefined(r["Content-Type"])&&(r["Content-Type"]=t)}function Ag(){var r;return typeof XMLHttpRequest!="undefined"?r=$a():typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]"&&(r=$a()),r}function wg(r,t,e){if(st.isString(r))try{return(t||JSON.parse)(r),st.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(e||JSON.stringify)(r)}var Yi={transitional:mg,adapter:Ag(),transformRequest:[function(t,e){if(Ol(e,"Accept"),Ol(e,"Content-Type"),st.isFormData(t)||st.isArrayBuffer(t)||st.isBuffer(t)||st.isStream(t)||st.isFile(t)||st.isBlob(t))return t;if(st.isArrayBufferView(t))return t.buffer;if(st.isURLSearchParams(t))return Hl(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var n=st.isObject(t),o=e&&e["Content-Type"],s;if((s=st.isFileList(t))||n&&o==="multipart/form-data"){var a=this.env&&this.env.FormData;return xg(s?{"files[]":t}:t,a&&new a)}else if(n||o==="application/json")return Hl(e,"application/json"),wg(t);return t}],transformResponse:[function(t){var e=this.transitional||Yi.transitional,n=e&&e.silentJSONParsing,o=e&&e.forcedJSONParsing,s=!n&&this.responseType==="json";if(s||o&&st.isString(t)&&t.length)try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?zl.from(a,zl.ERR_BAD_RESPONSE,this,null,this.response):a}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:kl()},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};st.forEach(["delete","get","head"],function(t){Yi.headers[t]={}});st.forEach(["post","put","patch"],function(t){Yi.headers[t]=st.merge(bg)});Dl.exports=Yi});var ql=ue((e1,Ml)=>{"use strict";var Tg=it(),_g=Xi();Ml.exports=function(t,e,n){var o=this||_g;return Tg.forEach(n,function(a){t=a.call(o,t,e)}),t}});var Ka=ue((t1,Nl)=>{"use strict";Nl.exports=function(t){return!!(t&&t.__CANCEL__)}});var Fl=ue((r1,Ll)=>{"use strict";var Gl=it(),ja=ql(),vg=Ka(),Eg=Xi(),Sg=zo();function Va(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new Sg}Ll.exports=function(t){Va(t),t.headers=t.headers||{},t.data=ja.call(t,t.data,t.headers,t.transformRequest),t.headers=Gl.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Gl.forEach(["delete","get","head","post","put","patch","common"],function(o){delete t.headers[o]});var e=t.adapter||Eg.adapter;return e(t).then(function(o){return Va(t),o.data=ja.call(t,o.data,o.headers,t.transformResponse),o},function(o){return vg(o)||(Va(t),o&&o.response&&(o.response.data=ja.call(t,o.response.data,o.response.headers,t.transformResponse))),Promise.reject(o)})}});var Wa=ue((n1,$l)=>{"use strict";var kt=it();$l.exports=function(t,e){e=e||{};var n={};function o(y,m){return kt.isPlainObject(y)&&kt.isPlainObject(m)?kt.merge(y,m):kt.isPlainObject(m)?kt.merge({},m):kt.isArray(m)?m.slice():m}function s(y){if(kt.isUndefined(e[y])){if(!kt.isUndefined(t[y]))return o(void 0,t[y])}else return o(t[y],e[y])}function a(y){if(!kt.isUndefined(e[y]))return o(void 0,e[y])}function u(y){if(kt.isUndefined(e[y])){if(!kt.isUndefined(t[y]))return o(void 0,t[y])}else return o(void 0,e[y])}function l(y){if(y in e)return o(t[y],e[y]);if(y in t)return o(void 0,t[y])}var h={url:a,method:a,data:a,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:l};return kt.forEach(Object.keys(t).concat(Object.keys(e)),function(m){var v=h[m]||s,A=v(m);kt.isUndefined(A)&&v!==l||(n[m]=A)}),n}});var Qa=ue((o1,Kl)=>{Kl.exports={version:"0.27.2"}});var Wl=ue((i1,Vl)=>{"use strict";var Ug=Qa().version,un=zn(),Ya={};["object","boolean","number","function","string","symbol"].forEach(function(r,t){Ya[r]=function(n){return typeof n===r||"a"+(t<1?"n ":" ")+r}});var jl={};Ya.transitional=function(t,e,n){function o(s,a){return"[Axios v"+Ug+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return function(s,a,u){if(t===!1)throw new un(o(a," has been removed"+(e?" in "+e:"")),un.ERR_DEPRECATED);return e&&!jl[a]&&(jl[a]=!0,console.warn(o(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(s,a,u):!0}};function Bg(r,t,e){if(typeof r!="object")throw new un("options must be an object",un.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(r),o=n.length;o-- >0;){var s=n[o],a=t[s];if(a){var u=r[s],l=u===void 0||a(u,s,r);if(l!==!0)throw new un("option "+s+" must be "+l,un.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new un("Unknown option "+s,un.ERR_BAD_OPTION)}}Vl.exports={assertOptions:Bg,validators:Ya}});var ed=ue((s1,Jl)=>{"use strict";var Xl=it(),Cg=Da(),Ql=ol(),Yl=Fl(),Zi=Wa(),Ig=Ga(),Zl=Wl(),so=Zl.validators;function ao(r){this.defaults=r,this.interceptors={request:new Ql,response:new Ql}}ao.prototype.request=function(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=Zi(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var n=e.transitional;n!==void 0&&Zl.assertOptions(n,{silentJSONParsing:so.transitional(so.boolean),forcedJSONParsing:so.transitional(so.boolean),clarifyTimeoutError:so.transitional(so.boolean)},!1);var o=[],s=!0;this.interceptors.request.forEach(function(A){typeof A.runWhen=="function"&&A.runWhen(e)===!1||(s=s&&A.synchronous,o.unshift(A.fulfilled,A.rejected))});var a=[];this.interceptors.response.forEach(function(A){a.push(A.fulfilled,A.rejected)});var u;if(!s){var l=[Yl,void 0];for(Array.prototype.unshift.apply(l,o),l=l.concat(a),u=Promise.resolve(e);l.length;)u=u.then(l.shift(),l.shift());return u}for(var h=e;o.length;){var y=o.shift(),m=o.shift();try{h=y(h)}catch(v){m(v);break}}try{u=Yl(h)}catch(v){return Promise.reject(v)}for(;a.length;)u=u.then(a.shift(),a.shift());return u};ao.prototype.getUri=function(t){t=Zi(this.defaults,t);var e=Ig(t.baseURL,t.url);return Cg(e,t.params,t.paramsSerializer)};Xl.forEach(["delete","get","head","options"],function(t){ao.prototype[t]=function(e,n){return this.request(Zi(n||{},{method:t,url:e,data:(n||{}).data}))}});Xl.forEach(["post","put","patch"],function(t){function e(n){return function(s,a,u){return this.request(Zi(u||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}ao.prototype[t]=e(),ao.prototype[t+"Form"]=e(!0)});Jl.exports=ao});var rd=ue((a1,td)=>{"use strict";var Rg=zo();function co(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(o){t=o});var e=this;this.promise.then(function(n){if(!!e._listeners){var o,s=e._listeners.length;for(o=0;o<s;o++)e._listeners[o](n);e._listeners=null}}),this.promise.then=function(n){var o,s=new Promise(function(a){e.subscribe(a),o=a}).then(n);return s.cancel=function(){e.unsubscribe(o)},s},r(function(o){e.reason||(e.reason=new Rg(o),t(e.reason))})}co.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};co.prototype.subscribe=function(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]};co.prototype.unsubscribe=function(t){if(!!this._listeners){var e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}};co.source=function(){var t,e=new co(function(o){t=o});return{token:e,cancel:t}};td.exports=co});var od=ue((c1,nd)=>{"use strict";nd.exports=function(t){return function(n){return t.apply(null,n)}}});var sd=ue((u1,id)=>{"use strict";var Pg=it();id.exports=function(t){return Pg.isObject(t)&&t.isAxiosError===!0}});var ud=ue((f1,Xa)=>{"use strict";var ad=it(),kg=Ia(),Ji=ed(),Og=Wa(),zg=Xi();function cd(r){var t=new Ji(r),e=kg(Ji.prototype.request,t);return ad.extend(e,Ji.prototype,t),ad.extend(e,t),e.create=function(o){return cd(Og(r,o))},e}var vt=cd(zg);vt.Axios=Ji;vt.CanceledError=zo();vt.CancelToken=rd();vt.isCancel=Ka();vt.VERSION=Qa().version;vt.toFormData=qa();vt.AxiosError=zn();vt.Cancel=vt.CanceledError;vt.all=function(t){return Promise.all(t)};vt.spread=od();vt.isAxiosError=sd();Xa.exports=vt;Xa.exports.default=vt});var ld=ue((l1,fd)=>{fd.exports=ud()});var Fg={};Ec(Fg,{APTOS_PATH_REGEX:()=>lf,Account:()=>Pt,AccountAddress:()=>H,AccountAuthenticator:()=>Et,AccountAuthenticatorEd25519:()=>Yt,AccountAuthenticatorMultiEd25519:()=>uo,AccountAuthenticatorMultiKey:()=>fn,AccountAuthenticatorSingleKey:()=>Gt,AccountAuthenticatorVariant:()=>Rs,AddressInvalidReason:()=>$c,AnyPublicKeyVariant:()=>Ps,AnySignatureVariant:()=>ks,Aptos:()=>zt,AptosApiError:()=>er,AptosConfig:()=>Do,AuthenticationKey:()=>or,Bool:()=>qe,ChainId:()=>Ir,DeriveScheme:()=>Rc,Deserializer:()=>$n,Ed25519PrivateKey:()=>xr,Ed25519PublicKey:()=>Oe,Ed25519Signature:()=>Le,EntryFunction:()=>fr,EntryFunctionBytes:()=>Un,FeePayerRawTransaction:()=>Jt,FixedBytes:()=>tr,Hex:()=>Z,HexInvalidReason:()=>Lc,Identifier:()=>Me,KeyType:()=>_a,MimeType:()=>ii,ModuleId:()=>Rr,MoveAbility:()=>Cc,MoveFunctionVisibility:()=>Bc,MoveOption:()=>ot,MoveString:()=>rt,MoveVector:()=>Ie,MultiAgentRawTransaction:()=>Zt,MultiEd25519PublicKey:()=>Tt,MultiEd25519Signature:()=>Ar,MultiKey:()=>_r,MultiSig:()=>gn,MultisigTransactionPayload:()=>mn,Network:()=>ai,NetworkToChainId:()=>ci,NetworkToFaucetAPI:()=>Ds,NetworkToIndexerAPI:()=>si,NetworkToNodeAPI:()=>Hs,ParsingError:()=>yt,PrivateKey:()=>Bn,PublicKey:()=>Ct,RawTransaction:()=>St,RawTransactionWithData:()=>qo,RoleType:()=>Ic,Script:()=>yn,ScriptTransactionArgumentVariants:()=>Nn,Secp256k1PrivateKey:()=>Jr,Secp256k1PublicKey:()=>Mt,Secp256k1Signature:()=>nr,Serializable:()=>ne,Serializer:()=>$t,Signature:()=>Kt,SignedTransaction:()=>Ot,SigningScheme:()=>Gn,SigningSchemeInput:()=>zs,StructTag:()=>Lt,TransactionAuthenticator:()=>cr,TransactionAuthenticatorEd25519:()=>Sr,TransactionAuthenticatorFeePayer:()=>Br,TransactionAuthenticatorMultiAgent:()=>Ur,TransactionAuthenticatorMultiEd25519:()=>fo,TransactionAuthenticatorSingleSender:()=>Cr,TransactionAuthenticatorVariant:()=>Is,TransactionPayload:()=>ln,TransactionPayloadEntryFunction:()=>pn,TransactionPayloadMultisig:()=>hn,TransactionPayloadScript:()=>dn,TransactionPayloadVariants:()=>Bs,TransactionResponseType:()=>Os,TransactionVariants:()=>Cs,TypeTag:()=>Ve,TypeTagAddress:()=>qr,TypeTagBool:()=>Pr,TypeTagGeneric:()=>Nr,TypeTagParserError:()=>Ne,TypeTagParserErrorType:()=>Ad,TypeTagReference:()=>Hn,TypeTagSigner:()=>ur,TypeTagStruct:()=>Xt,TypeTagU128:()=>Dr,TypeTagU16:()=>Or,TypeTagU256:()=>Mr,TypeTagU32:()=>zr,TypeTagU64:()=>Hr,TypeTagU8:()=>kr,TypeTagVariants:()=>Us,TypeTagVector:()=>Gr,U128:()=>At,U16:()=>xt,U256:()=>wt,U32:()=>bt,U64:()=>Ze,U8:()=>pt,aptosCoinStructTag:()=>Dg,aptosRequest:()=>bo,buildTransaction:()=>cc,convertArgument:()=>sc,derivePrivateKeyFromMnemonic:()=>va,deriveTransactionType:()=>dc,deserializeFromScriptArgument:()=>md,ensureBoolean:()=>gi,fetchEntryFunctionAbi:()=>ic,findFirstNonSignerArg:()=>nc,generateMultiSignersSignedTransaction:()=>vd,generateRawTransaction:()=>_d,generateSignedTransaction:()=>lc,generateSignedTransactionForSimulation:()=>uc,generateTransactionPayload:()=>ac,generateTransactionPayloadWithABI:()=>wd,get:()=>qc,getAptosFullNode:()=>mt,getAuthenticatorForSimulation:()=>Fo,getFunctionParts:()=>ps,getSigningMessage:()=>Ed,isBcsAddress:()=>Lo,isBcsBool:()=>os,isBcsFixedBytes:()=>rc,isBcsString:()=>is,isBcsU128:()=>fs,isBcsU16:()=>as,isBcsU256:()=>ls,isBcsU32:()=>cs,isBcsU64:()=>us,isBcsU8:()=>ss,isBool:()=>ec,isLargeNumber:()=>Go,isNull:()=>tc,isNumber:()=>No,isScriptDataInput:()=>ds,isString:()=>Dn,isValidPath:()=>hf,objectStructTag:()=>Ng,optionStructTag:()=>qg,outOfRangeErrorMessage:()=>Fc,paginateWithCursor:()=>Tn,parseTypeTag:()=>lo,post:()=>fi,postAptosFaucet:()=>Ns,postAptosFullNode:()=>_n,postAptosIndexer:()=>qs,request:()=>Pc,sign:()=>fc,standardizeTypeTags:()=>oc,stringStructTag:()=>Mg,throwTypeMismatch:()=>Ge,validateNumberInRange:()=>gr});var er=class extends Error{constructor(e,n,o){super(o);this.name="AptosApiError",this.url=n.url,this.status=n.status,this.statusText=n.statusText,this.data=n.data,this.request=e}};var Uc="2.0.0";var ii=(n=>(n.JSON="application/json",n.BCS="application/x-bcs",n.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",n))(ii||{}),Us=(A=>(A[A.Bool=0]="Bool",A[A.U8=1]="U8",A[A.U64=2]="U64",A[A.U128=3]="U128",A[A.Address=4]="Address",A[A.Signer=5]="Signer",A[A.Vector=6]="Vector",A[A.Struct=7]="Struct",A[A.U16=8]="U16",A[A.U32=9]="U32",A[A.U256=10]="U256",A[A.Reference=254]="Reference",A[A.Generic=255]="Generic",A))(Us||{}),Nn=(h=>(h[h.U8=0]="U8",h[h.U64=1]="U64",h[h.U128=2]="U128",h[h.Address=3]="Address",h[h.U8Vector=4]="U8Vector",h[h.Bool=5]="Bool",h[h.U16=6]="U16",h[h.U32=7]="U32",h[h.U256=8]="U256",h))(Nn||{}),Bs=(n=>(n[n.Script=0]="Script",n[n.EntryFunction=2]="EntryFunction",n[n.Multisig=3]="Multisig",n))(Bs||{}),Cs=(e=>(e[e.MultiAgentTransaction=0]="MultiAgentTransaction",e[e.FeePayerTransaction=1]="FeePayerTransaction",e))(Cs||{}),Is=(s=>(s[s.Ed25519=0]="Ed25519",s[s.MultiEd25519=1]="MultiEd25519",s[s.MultiAgent=2]="MultiAgent",s[s.FeePayer=3]="FeePayer",s[s.SingleSender=4]="SingleSender",s))(Is||{}),Rs=(o=>(o[o.Ed25519=0]="Ed25519",o[o.MultiEd25519=1]="MultiEd25519",o[o.SingleKey=2]="SingleKey",o[o.MultiKey=3]="MultiKey",o))(Rs||{}),Ps=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1=1]="Secp256k1",e))(Ps||{}),ks=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1=1]="Secp256k1",e))(ks||{}),Os=(s=>(s.Pending="pending_transaction",s.User="user_transaction",s.Genesis="genesis_transaction",s.BlockMetadata="block_metadata_transaction",s.StateCheckpoint="state_checkpoint_transaction",s))(Os||{}),Bc=(n=>(n.PRIVATE="private",n.PUBLIC="public",n.FRIEND="friend",n))(Bc||{}),Cc=(o=>(o.STORE="store",o.DROP="drop",o.KEY="key",o.COPY="copy",o))(Cc||{}),Ic=(e=>(e.VALIDATOR="validator",e.FULL_NODE="full_node",e))(Ic||{}),Gn=(o=>(o[o.Ed25519=0]="Ed25519",o[o.MultiEd25519=1]="MultiEd25519",o[o.SingleKey=2]="SingleKey",o[o.MultiKey=3]="MultiKey",o))(Gn||{}),zs=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",e))(zs||{}),Rc=(s=>(s[s.DeriveAuid=251]="DeriveAuid",s[s.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",s[s.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",s[s.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",s[s.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",s))(Rc||{});var ep={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"};async function Pc(r,t){let{url:e,method:n,body:o,contentType:s,params:a,overrides:u}=r,l={...u==null?void 0:u.HEADERS,"x-aptos-client":`aptos-ts-sdk/${Uc}`,"content-type":s!=null?s:"application/json"};return u!=null&&u.TOKEN&&(l.Authorization=`Bearer ${u==null?void 0:u.TOKEN}`),t.provider({url:e,method:n,body:o,params:a,headers:l,overrides:u})}async function bo(r,t){var l;let{url:e,path:n}=r,o=`${e}/${n!=null?n:""}`,s=await Pc({...r,url:o},t.client),a={status:s.status,statusText:s.statusText,data:s.data,headers:s.headers,config:s.config,request:s.request,url:o};if(t.isIndexerRequest(e)){let h=a.data;if(h.errors)throw new er(r,a,(l=h.errors[0].message)!=null?l:`Unhandled Error ${s.status} : ${s.statusText}`);a.data=h.data}if(a.status>=200&&a.status<300)return a;let u=ep[a.status];throw new er(r,a,u!=null?u:`Unhandled Error ${s.status} : ${s.statusText}`)}var si={mainnet:"https://indexer.mainnet.aptoslabs.com/v1/graphql",testnet:"https://indexer-testnet.staging.gcp.aptosdev.com/v1/graphql",devnet:"https://indexer-devnet.staging.gcp.aptosdev.com/v1/graphql",local:"http://127.0.0.1:8090/v1/graphql"},Hs={mainnet:"https://fullnode.mainnet.aptoslabs.com/v1",testnet:"https://fullnode.testnet.aptoslabs.com/v1",devnet:"https://fullnode.devnet.aptoslabs.com/v1",local:"http://127.0.0.1:8080/v1"},Ds={mainnet:"https://faucet.mainnet.aptoslabs.com",testnet:"https://faucet.testnet.aptoslabs.com",devnet:"https://faucet.devnet.aptoslabs.com",local:"http://127.0.0.1:8081"},ai=(s=>(s.MAINNET="mainnet",s.TESTNET="testnet",s.DEVNET="devnet",s.LOCAL="local",s.CUSTOM="custom",s))(ai||{}),ci={mainnet:1,testnet:2};var kc="devnet",Oc=2e5,zc=20,ui=20,Hc="0x1::aptos_coin::AptosCoin",Dc="APTOS::RawTransaction",Ms="APTOS::RawTransactionWithData";async function qc(r){let{aptosConfig:t,overrides:e,params:n,contentType:o,acceptType:s,path:a,originMethod:u,type:l}=r,h=t.getRequestUrl(l);return bo({url:h,method:"GET",originMethod:u,path:a,contentType:o==null?void 0:o.valueOf(),acceptType:s==null?void 0:s.valueOf(),params:n,overrides:{...t.clientConfig,...e}},t)}async function mt(r){return qc({...r,type:0})}async function Tn(r){let t=[],e,n=r.params;for(;;){n.start=e;let o=await mt({aptosConfig:r.aptosConfig,originMethod:r.originMethod,path:r.path,params:n,overrides:r.overrides});if(e=o.headers["x-aptos-cursor"],delete o.headers,t.push(...o.data),e==null)break}return t}async function fi(r){let{type:t,originMethod:e,path:n,body:o,acceptType:s,contentType:a,params:u,aptosConfig:l,overrides:h}=r,y=l.getRequestUrl(t);return bo({url:y,method:"POST",originMethod:e,path:n,body:o,contentType:a==null?void 0:a.valueOf(),acceptType:s==null?void 0:s.valueOf(),params:u,overrides:{...l.clientConfig,...h}},l)}async function _n(r){return fi({...r,type:0})}async function qs(r){return fi({...r,type:1})}async function Ns(r){return fi({...r,type:2})}var tp={node:void 0,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0};var Nc=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)),li=r=>new DataView(r.buffer,r.byteOffset,r.byteLength);var rp=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!rp)throw new Error("Non little-endian hardware is not supported");var np=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function Ao(r){if(!(r instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=np[r[e]];return t}function di(r){if(typeof r!="string")throw new TypeError("hexToBytes: expected string, got "+typeof r);if(r.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let t=new Uint8Array(r.length/2);for(let e=0;e<t.length;e++){let n=e*2,o=r.slice(n,n+2),s=Number.parseInt(o,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");t[e]=s}return t}function op(r){if(typeof r!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof r}`);return new TextEncoder().encode(r)}function Vr(r){if(typeof r=="string"&&(r=op(r)),!(r instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof r})`);return r}var jr=class{clone(){return this._cloneInto()}};function Ln(r){let t=n=>r().update(Vr(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}function Gc(r){let t=(n,o)=>r(o).update(Vr(n)).digest(),e=r({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=n=>r(n),t}var pi=2**8-1,hi=2**16-1,yr=2**32-1,vn=BigInt(2)**BigInt(64)-BigInt(1),wo=BigInt(2)**BigInt(128)-BigInt(1),yi=BigInt(2)**BigInt(256)-BigInt(1);var yt=class extends Error{constructor(e,n){super(e);this.invalidReason=n}};var Lc=(n=>(n.TOO_SHORT="too_short",n.INVALID_LENGTH="invalid_length",n.INVALID_HEX_CHARS="invalid_hex_chars",n))(Lc||{}),Z=class{constructor(t){this.data=t}toUint8Array(){return this.data}toStringWithoutPrefix(){return Ao(this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromString(t){let e=t;if(e.startsWith("0x")&&(e=e.slice(2)),e.length===0)throw new yt("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(e.length%2!==0)throw new yt("Hex string must be an even number of hex characters.","invalid_length");try{return new Z(di(e))}catch(n){let o=n;throw new yt(`Hex string contains invalid hex characters: ${o.message}`,"invalid_hex_chars")}}static fromHexInput(t){return t instanceof Uint8Array?new Z(t):Z.fromString(t)}static isValid(t){try{return Z.fromString(t),{valid:!0}}catch(e){let n=e;return{valid:!1,invalidReason:n.invalidReason,invalidReasonMessage:n.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((e,n)=>e===t.data[n])}};var ne=class{bcsToBytes(){let t=new $t;return this.serialize(t),t.toUint8Array()}bcsToHex(){let t=this.bcsToBytes();return Z.fromHexInput(t)}},$t=class{constructor(t=64){if(t<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(t),this.offset=0}ensureBufferWillHandleSize(t){for(;this.buffer.byteLength<this.offset+t;){let e=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(e).set(new Uint8Array(this.buffer)),this.buffer=e}}appendToBuffer(t){this.ensureBufferWillHandleSize(t.length),new Uint8Array(this.buffer,this.offset).set(t),this.offset+=t.length}serializeWithFunction(t,e,n){this.ensureBufferWillHandleSize(e);let o=new DataView(this.buffer,this.offset);t.apply(o,[0,n,!0]),this.offset+=e}serializeStr(t){let e=new TextEncoder;this.serializeBytes(e.encode(t))}serializeBytes(t){this.serializeU32AsUleb128(t.length),this.appendToBuffer(t)}serializeFixedBytes(t){this.appendToBuffer(t)}serializeBool(t){gi(t);let e=t?1:0;this.appendToBuffer(new Uint8Array([e]))}serializeU8(t){this.appendToBuffer(new Uint8Array([t]))}serializeU16(t){this.serializeWithFunction(DataView.prototype.setUint16,2,t)}serializeU32(t){this.serializeWithFunction(DataView.prototype.setUint32,4,t)}serializeU64(t){let e=BigInt(t)&BigInt(yr),n=BigInt(t)>>BigInt(32);this.serializeU32(Number(e)),this.serializeU32(Number(n))}serializeU128(t){let e=BigInt(t)&vn,n=BigInt(t)>>BigInt(64);this.serializeU64(e),this.serializeU64(n)}serializeU256(t){let e=BigInt(t)&wo,n=BigInt(t)>>BigInt(128);this.serializeU128(e),this.serializeU128(n)}serializeU32AsUleb128(t){let e=t,n=[];for(;e>>>7!==0;)n.push(e&127|128),e>>>=7;n.push(e),this.appendToBuffer(new Uint8Array(n))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(t){t.serialize(this)}serializeVector(t){this.serializeU32AsUleb128(t.length),t.forEach(e=>{e.serialize(this)})}};Kr([En(0,pi)],$t.prototype,"serializeU8",1),Kr([En(0,hi)],$t.prototype,"serializeU16",1),Kr([En(0,yr)],$t.prototype,"serializeU32",1),Kr([En(BigInt(0),vn)],$t.prototype,"serializeU64",1),Kr([En(BigInt(0),wo)],$t.prototype,"serializeU128",1),Kr([En(BigInt(0),yi)],$t.prototype,"serializeU256",1),Kr([En(0,yr)],$t.prototype,"serializeU32AsUleb128",1);function gi(r){if(typeof r!="boolean")throw new Error(`${r} is not a boolean value`)}var Fc=(r,t,e)=>`${r} is out of range: [${t}, ${e}]`;function gr(r,t,e){let n=BigInt(r);if(n>BigInt(e)||n<BigInt(t))throw new Error(Fc(r,t,e))}function En(r,t){return(e,n,o)=>{let s=o.value;return o.value=function(u){return gr(u,r,t),s.apply(this,[u])},o}}var $c=(u=>(u.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",u.INVALID_HEX_CHARS="invalid_hex_chars",u.TOO_SHORT="too_short",u.TOO_LONG="too_long",u.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",u.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",u.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",u))($c||{}),tt=class extends ne{constructor(e){super();if(e.data.length!==tt.LENGTH)throw new yt("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=e.data}isSpecial(){return this.data.slice(0,this.data.length-1).every(e=>e===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let e=Ao(this.data);return this.isSpecial()&&(e=e[e.length-1]),e}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return Ao(this.data)}toUint8Array(){return this.data}serialize(e){e.serializeFixedBytes(this.data)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(3),e.serialize(this)}static deserialize(e){let n=e.deserializeFixedBytes(tt.LENGTH);return new tt({data:n})}static fromString(e){if(!e.startsWith("0x"))throw new yt("Hex string must start with a leading 0x.","leading_zero_x_required");let n=tt.fromStringRelaxed(e);if(e.length!==tt.LONG_STRING_LENGTH+2)if(n.isSpecial()){if(e.length!==3)throw new yt(`The given hex string ${e} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new yt(`The given hex string ${n} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return n}static fromStringRelaxed(e){let n=e;if(e.startsWith("0x")&&(n=e.slice(2)),n.length===0)throw new yt("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(n.length>64)throw new yt("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");let o;try{o=di(n.padStart(64,"0"))}catch(s){let a=s;throw new yt(`Hex characters are invalid: ${a.message}`,"invalid_hex_chars")}return new tt({data:o})}static fromHexInput(e){return e instanceof Uint8Array?new tt({data:e}):tt.fromString(e)}static fromHexInputRelaxed(e){return e instanceof Uint8Array?new tt({data:e}):tt.fromStringRelaxed(e)}static isValid(e){try{return e.relaxed?tt.fromStringRelaxed(e.input):tt.fromString(e.input),{valid:!0}}catch(n){let o=n;return{valid:!1,invalidReason:o.invalidReason,invalidReasonMessage:o.message}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((n,o)=>n===e.data[o])}},H=tt;H.LENGTH=32,H.LONG_STRING_LENGTH=64,H.ZERO=tt.fromString("0x0"),H.ONE=tt.fromString("0x1"),H.TWO=tt.fromString("0x2"),H.THREE=tt.fromString("0x3"),H.FOUR=tt.fromString("0x4");function Gs(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function ip(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}function Kc(r,...t){if(!(r instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(r.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${r.length}`)}function sp(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Gs(r.outputLen),Gs(r.blockLen)}function ap(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}function cp(r,t){Kc(r);let e=t.outputLen;if(r.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}var up={number:Gs,bool:ip,bytes:Kc,hash:sp,exists:ap,output:cp},dt=up;var mi=BigInt(4294967295),Ls=BigInt(32);function jc(r,t=!1){return t?{h:Number(r&mi),l:Number(r>>Ls&mi)}:{h:Number(r>>Ls&mi)|0,l:Number(r&mi)|0}}function fp(r,t=!1){let e=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o<r.length;o++){let{h:s,l:a}=jc(r[o],t);[e[o],n[o]]=[s,a]}return[e,n]}var lp=(r,t)=>BigInt(r>>>0)<<Ls|BigInt(t>>>0),dp=(r,t,e)=>r>>>e,pp=(r,t,e)=>r<<32-e|t>>>e,hp=(r,t,e)=>r>>>e|t<<32-e,yp=(r,t,e)=>r<<32-e|t>>>e,gp=(r,t,e)=>r<<64-e|t>>>e-32,mp=(r,t,e)=>r>>>e-32|t<<64-e,xp=(r,t)=>t,bp=(r,t)=>r,Ap=(r,t,e)=>r<<e|t>>>32-e,wp=(r,t,e)=>t<<e|r>>>32-e,Tp=(r,t,e)=>t<<e-32|r>>>64-e,_p=(r,t,e)=>r<<e-32|t>>>64-e;function vp(r,t,e,n){let o=(t>>>0)+(n>>>0);return{h:r+e+(o/2**32|0)|0,l:o|0}}var Ep=(r,t,e)=>(r>>>0)+(t>>>0)+(e>>>0),Sp=(r,t,e,n)=>t+e+n+(r/2**32|0)|0,Up=(r,t,e,n)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0),Bp=(r,t,e,n,o)=>t+e+n+o+(r/2**32|0)|0,Cp=(r,t,e,n,o)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0)+(o>>>0),Ip=(r,t,e,n,o,s)=>t+e+n+o+s+(r/2**32|0)|0,Rp={fromBig:jc,split:fp,toBig:lp,shrSH:dp,shrSL:pp,rotrSH:hp,rotrSL:yp,rotrBH:gp,rotrBL:mp,rotr32H:xp,rotr32L:bp,rotlSH:Ap,rotlSL:wp,rotlBH:Tp,rotlBL:_p,add:vp,add3L:Ep,add3H:Sp,add4L:Up,add4H:Bp,add5H:Ip,add5L:Cp},oe=Rp;var[Qc,Yc,Xc]=[[],[],[]],Pp=BigInt(0),To=BigInt(1),kp=BigInt(2),Op=BigInt(7),zp=BigInt(256),Hp=BigInt(113);for(let r=0,t=To,e=1,n=0;r<24;r++){[e,n]=[n,(2*e+3*n)%5],Qc.push(2*(5*n+e)),Yc.push((r+1)*(r+2)/2%64);let o=Pp;for(let s=0;s<7;s++)t=(t<<To^(t>>Op)*Hp)%zp,t&kp&&(o^=To<<(To<<BigInt(s))-To);Xc.push(o)}var[Dp,Mp]=oe.split(Xc,!0),Vc=(r,t,e)=>e>32?oe.rotlBH(r,t,e):oe.rotlSH(r,t,e),Wc=(r,t,e)=>e>32?oe.rotlBL(r,t,e):oe.rotlSL(r,t,e);function qp(r,t=24){let e=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let a=0;a<10;a++)e[a]=r[a]^r[a+10]^r[a+20]^r[a+30]^r[a+40];for(let a=0;a<10;a+=2){let u=(a+8)%10,l=(a+2)%10,h=e[l],y=e[l+1],m=Vc(h,y,1)^e[u],v=Wc(h,y,1)^e[u+1];for(let A=0;A<50;A+=10)r[a+A]^=m,r[a+A+1]^=v}let o=r[2],s=r[3];for(let a=0;a<24;a++){let u=Yc[a],l=Vc(o,s,u),h=Wc(o,s,u),y=Qc[a];o=r[y],s=r[y+1],r[y]=l,r[y+1]=h}for(let a=0;a<50;a+=10){for(let u=0;u<10;u++)e[u]=r[a+u];for(let u=0;u<10;u++)r[a+u]^=~e[(u+2)%10]&e[(u+4)%10]}r[0]^=Dp[n],r[1]^=Mp[n]}e.fill(0)}var Fn=class extends jr{constructor(t,e,n,o=!1,s=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=o,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,dt.number(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Nc(this.state)}keccak(){qp(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){dt.exists(this);let{blockLen:e,state:n}=this;t=Vr(t);let o=t.length;for(let s=0;s<o;){let a=Math.min(e-this.pos,o-s);for(let u=0;u<a;u++)n[this.pos++]^=t[s++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:e,pos:n,blockLen:o}=this;t[n]^=e,(e&128)!==0&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){dt.exists(this,!1),dt.bytes(t),this.finish();let e=this.state,{blockLen:n}=this;for(let o=0,s=t.length;o<s;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,s-o);t.set(e.subarray(this.posOut,this.posOut+a),o),this.posOut+=a,o+=a}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return dt.number(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(dt.output(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:e,suffix:n,outputLen:o,rounds:s,enableXOF:a}=this;return t||(t=new Fn(e,n,o,a,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=n,t.outputLen=o,t.enableXOF=a,t.destroyed=this.destroyed,t}},Wr=(r,t,e)=>Ln(()=>new Fn(t,r,e)),K0=Wr(6,144,224/8),Sn=Wr(6,136,256/8),j0=Wr(6,104,384/8),V0=Wr(6,72,512/8),W0=Wr(1,144,224/8),Q0=Wr(1,136,256/8),Y0=Wr(1,104,384/8),X0=Wr(1,72,512/8),Zc=(r,t,e)=>Gc((n={})=>new Fn(t,r,n.dkLen===void 0?e:n.dkLen,!0)),Z0=Zc(31,168,128/8),J0=Zc(31,136,256/8);var _o=Ss(eu());var $n=class{constructor(t){this.buffer=new ArrayBuffer(t.length),new Uint8Array(this.buffer).set(t,0),this.offset=0}read(t){if(this.offset+t>this.buffer.byteLength)throw new Error("Reached to the end of buffer");let e=this.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e}deserializeStr(){let t=this.deserializeBytes();return new TextDecoder().decode(t)}deserializeBytes(){let t=this.deserializeUleb128AsU32();return new Uint8Array(this.read(t))}deserializeFixedBytes(t){return new Uint8Array(this.read(t))}deserializeBool(){let t=new Uint8Array(this.read(1))[0];if(t!==1&&t!==0)throw new Error("Invalid boolean value");return t===1}deserializeU8(){return new DataView(this.read(1)).getUint8(0)}deserializeU16(){return new DataView(this.read(2)).getUint16(0,!0)}deserializeU32(){return new DataView(this.read(4)).getUint32(0,!0)}deserializeU64(){let t=this.deserializeU32(),e=this.deserializeU32();return BigInt(BigInt(e)<<BigInt(32)|BigInt(t))}deserializeU128(){let t=this.deserializeU64(),e=this.deserializeU64();return BigInt(e<<BigInt(64)|t)}deserializeU256(){let t=this.deserializeU128(),e=this.deserializeU128();return BigInt(e<<BigInt(128)|t)}deserializeUleb128AsU32(){let t=BigInt(0),e=0;for(;t<yr;){let n=this.deserializeU8();if(t|=BigInt(n&127)<<BigInt(e),(n&128)===0)break;e+=7}if(t>yr)throw new Error("Overflow while parsing uleb128-encoded uint32 value");return Number(t)}deserialize(t){return t.deserialize(this)}deserializeVector(t){let e=this.deserializeUleb128AsU32(),n=new Array;for(let o=0;o<e;o+=1)n.push(this.deserialize(t));return n}};var tr=class extends ne{constructor(e){super();this.value=Z.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,n){let o=e.deserializeFixedBytes(n);return new tr(o)}};var Un=class extends ne{constructor(e){super();this.value=new tr(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,n){let o=tr.deserialize(e,n);return new Un(o.value)}};var qe=class extends ne{constructor(e){super();gi(e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}static deserialize(e){return new qe(e.deserializeBool())}},pt=class extends ne{constructor(e){super();gr(e,0,pi),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new pt(e.deserializeU8())}},xt=class extends ne{constructor(e){super();gr(e,0,hi),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new xt(e.deserializeU16())}},bt=class extends ne{constructor(e){super();gr(e,0,yr),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new bt(e.deserializeU32())}},Ze=class extends ne{constructor(e){super();gr(e,BigInt(0),vn),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new Ze(e.deserializeU64())}},At=class extends ne{constructor(e){super();gr(e,BigInt(0),wo),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new At(e.deserializeU128())}},wt=class extends ne{constructor(e){super();gr(e,BigInt(0),yi),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new wt(e.deserializeU256())}};var Ie=class extends ne{constructor(e){super();this.values=e}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){if(!(this.values[0]instanceof pt))throw new Error("Script function arguments only accept u8 vectors");e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let n;if(Array.isArray(e)&&typeof e[0]=="number")n=e;else if(typeof e=="string"){let o=Z.fromHexInput(e);n=Array.from(o.toUint8Array())}else if(e instanceof Uint8Array)n=Array.from(e);else throw new Error("Invalid input type");return new Ie(n.map(o=>new pt(o)))}static U16(e){return new Ie(e.map(n=>new xt(n)))}static U32(e){return new Ie(e.map(n=>new bt(n)))}static U64(e){return new Ie(e.map(n=>new Ze(n)))}static U128(e){return new Ie(e.map(n=>new At(n)))}static U256(e){return new Ie(e.map(n=>new wt(n)))}static Bool(e){return new Ie(e.map(n=>new qe(n)))}static MoveString(e){return new Ie(e.map(n=>new rt(n)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,n){let o=e.deserializeUleb128AsU32(),s=new Array;for(let a=0;a<o;a+=1)s.push(n.deserialize(e));return new Ie(s)}},rt=class extends ne{constructor(e){super();this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){Ie.U8(this.bcsToBytes()).serializeForScriptFunction(e)}static deserialize(e){return new rt(e.deserializeStr())}},ot=class extends ne{constructor(e){super();typeof e!="undefined"&&e!==null?this.vec=new Ie([e]):this.vec=new Ie([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new ot(e!=null?new pt(e):void 0)}static U16(e){return new ot(e!=null?new xt(e):void 0)}static U32(e){return new ot(e!=null?new bt(e):void 0)}static U64(e){return new ot(e!=null?new Ze(e):void 0)}static U128(e){return new ot(e!=null?new At(e):void 0)}static U256(e){return new ot(e!=null?new wt(e):void 0)}static Bool(e){return new ot(e!=null?new qe(e):void 0)}static MoveString(e){return new ot(e!=null?new rt(e):void 0)}static deserialize(e,n){let o=Ie.deserialize(e,n);return new ot(o.values[0])}};var Ct=class extends ne{},Bn=class extends ne{},Kt=class extends ne{};var Kn=class extends Ct{constructor(e){super();let n=Z.fromHexInput(e);if(n.toUint8Array().length!==Kn.LENGTH)throw new Error(`PublicKey length should be ${Kn.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}verifySignature(e){let{message:n,signature:o}=e,s=Z.fromHexInput(n).toUint8Array(),a=Z.fromHexInput(o.toUint8Array()).toUint8Array();return _o.default.sign.detached.verify(s,a,this.key.toUint8Array())}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new Kn(n)}static load(e){let n=e.deserializeBytes();return new Kn(n)}},Oe=Kn;Oe.LENGTH=32;var mr=class extends Bn{constructor(e){super();let n=Z.fromHexInput(e);if(n.toUint8Array().length!==mr.LENGTH)throw new Error(`PrivateKey length should be ${mr.LENGTH}`);this.signingKeyPair=_o.default.sign.keyPair.fromSeed(n.toUint8Array().slice(0,mr.LENGTH))}toUint8Array(){return this.signingKeyPair.secretKey.slice(0,mr.LENGTH)}toString(){return Z.fromHexInput(this.toUint8Array()).toString()}sign(e){let n=Z.fromHexInput(e),o=_o.default.sign.detached(n.toUint8Array(),this.signingKeyPair.secretKey);return new Le(o)}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new mr(n)}static generate(){let e=_o.default.sign.keyPair();return new mr(e.secretKey.slice(0,mr.LENGTH))}publicKey(){let e=this.signingKeyPair.publicKey;return new Oe(e)}},xr=mr;xr.LENGTH=32;var jn=class extends Kt{constructor(e){super();let n=Z.fromHexInput(e);if(n.toUint8Array().length!==jn.LENGTH)throw new Error(`Signature length should be ${jn.LENGTH}`);this.data=n}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new jn(n)}static load(e){let n=e.deserializeBytes();return new jn(n)}},Le=jn;Le.LENGTH=64;var br=class extends Ct{constructor(e){super();let{publicKeys:n,threshold:o}=e;if(n.length>br.MAX_KEYS||n.length<br.MIN_KEYS)throw new Error(`Must have between ${br.MIN_KEYS} and ${br.MAX_KEYS} public keys, inclusive`);if(o<br.MIN_THRESHOLD||o>n.length)throw new Error(`Threshold must be between ${br.MIN_THRESHOLD} and ${n.length}, inclusive`);this.publicKeys=n,this.threshold=o}toUint8Array(){let e=new Uint8Array(this.publicKeys.length*Oe.LENGTH+1);return this.publicKeys.forEach((n,o)=>{e.set(n.toUint8Array(),o*Oe.LENGTH)}),e[this.publicKeys.length*Oe.LENGTH]=this.threshold,e}toString(){return Z.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("TODO - Method not implemented.")}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes(),o=n[n.length-1],s=[];for(let a=0;a<n.length-1;a+=Oe.LENGTH){let u=a;s.push(new Oe(n.subarray(u,u+Oe.LENGTH)))}return new br({publicKeys:s,threshold:o})}},Tt=br;Tt.MAX_KEYS=32,Tt.MIN_KEYS=2,Tt.MIN_THRESHOLD=1;var rr=class extends Kt{constructor(e){super();let{signatures:n,bitmap:o}=e;if(o.length!==rr.BITMAP_LEN)throw new Error(`"bitmap" length should be ${rr.BITMAP_LEN}`);if(n.length>rr.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${rr.MAX_SIGNATURES_SUPPORTED}`);this.signatures=n,this.bitmap=o}toUint8Array(){let e=new Uint8Array(this.signatures.length*Le.LENGTH+rr.BITMAP_LEN);return this.signatures.forEach((n,o)=>{e.set(n.toUint8Array(),o*Le.LENGTH)}),e.set(this.bitmap,this.signatures.length*Le.LENGTH),e}toString(){return Z.fromHexInput(this.toUint8Array()).toString()}static createBitmap(e){let{bits:n}=e,o=128,s=new Uint8Array([0,0,0,0]),a=new Set;return n.forEach(u=>{if(u>=rr.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${rr.MAX_SIGNATURES_SUPPORTED-1}.`);if(a.has(u))throw new Error("Duplicate bits detected.");a.add(u);let l=Math.floor(u/8),h=s[l];h|=o>>u%8,s[l]=h}),s}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes(),o=n.subarray(n.length-4),s=[];for(let a=0;a<n.length-o.length;a+=Le.LENGTH){let u=a;s.push(new Le(n.subarray(u,u+Le.LENGTH)))}return new rr({signatures:s,bitmap:o})}},Ar=rr;Ar.MAX_SIGNATURES_SUPPORTED=32,Ar.BITMAP_LEN=4;function tu(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function Fs(r,...t){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(r.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${r.length}`)}function ru(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");tu(r.outputLen),tu(r.blockLen)}function Vn(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}function nu(r,t){Fs(r);let e=t.outputLen;if(r.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}var bi=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var ou=r=>r instanceof Uint8Array;var Ai=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),jt=(r,t)=>r<<32-t|r>>>t,Np=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Np)throw new Error("Non little-endian hardware is not supported");function Gp(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function vo(r){if(typeof r=="string"&&(r=Gp(r)),!ou(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}function iu(...r){let t=new Uint8Array(r.reduce((n,o)=>n+o.length,0)),e=0;return r.forEach(n=>{if(!ou(n))throw new Error("Uint8Array expected");t.set(n,e),e+=n.length}),t}var Wn=class{clone(){return this._cloneInto()}},Zm={}.toString;function su(r){let t=n=>r().update(vo(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}function au(r=32){if(bi&&typeof bi.getRandomValues=="function")return bi.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}function Lp(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let o=BigInt(32),s=BigInt(4294967295),a=Number(e>>o&s),u=Number(e&s),l=n?4:0,h=n?0:4;r.setUint32(t+l,a,n),r.setUint32(t+h,u,n)}var wi=class extends Wn{constructor(t,e,n,o){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Ai(this.buffer)}update(t){Vn(this);let{view:e,buffer:n,blockLen:o}=this;t=vo(t);let s=t.length;for(let a=0;a<s;){let u=Math.min(o-this.pos,s-a);if(u===o){let l=Ai(t);for(;o<=s-a;a+=o)this.process(l,a);continue}n.set(t.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Vn(this),nu(t,this),this.finished=!0;let{buffer:e,view:n,blockLen:o,isLE:s}=this,{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let m=a;m<o;m++)e[m]=0;Lp(n,o-8,BigInt(this.length*8),s),this.process(n,0);let u=Ai(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let h=l/4,y=this.get();if(h>y.length)throw new Error("_sha2: outputLen bigger than state");for(let m=0;m<h;m++)u.setUint32(4*m,y[m],s)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:n,length:o,finished:s,destroyed:a,pos:u}=this;return t.length=o,t.pos=u,t.finished=s,t.destroyed=a,o%e&&t.buffer.set(n),t}};var Fp=(r,t,e)=>r&t^~r&e,$p=(r,t,e)=>r&t^r&e^t&e,Kp=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Qr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Yr=new Uint32Array(64),$s=class extends wi{constructor(){super(64,32,8,!1),this.A=Qr[0]|0,this.B=Qr[1]|0,this.C=Qr[2]|0,this.D=Qr[3]|0,this.E=Qr[4]|0,this.F=Qr[5]|0,this.G=Qr[6]|0,this.H=Qr[7]|0}get(){let{A:t,B:e,C:n,D:o,E:s,F:a,G:u,H:l}=this;return[t,e,n,o,s,a,u,l]}set(t,e,n,o,s,a,u,l){this.A=t|0,this.B=e|0,this.C=n|0,this.D=o|0,this.E=s|0,this.F=a|0,this.G=u|0,this.H=l|0}process(t,e){for(let m=0;m<16;m++,e+=4)Yr[m]=t.getUint32(e,!1);for(let m=16;m<64;m++){let v=Yr[m-15],A=Yr[m-2],C=jt(v,7)^jt(v,18)^v>>>3,w=jt(A,17)^jt(A,19)^A>>>10;Yr[m]=w+Yr[m-7]+C+Yr[m-16]|0}let{A:n,B:o,C:s,D:a,E:u,F:l,G:h,H:y}=this;for(let m=0;m<64;m++){let v=jt(u,6)^jt(u,11)^jt(u,25),A=y+v+Fp(u,l,h)+Kp[m]+Yr[m]|0,w=(jt(n,2)^jt(n,13)^jt(n,22))+$p(n,o,s)|0;y=h,h=l,l=u,u=a+A|0,a=s,s=o,o=n,n=A+w|0}n=n+this.A|0,o=o+this.B|0,s=s+this.C|0,a=a+this.D|0,u=u+this.E|0,l=l+this.F|0,h=h+this.G|0,y=y+this.H|0,this.set(n,o,s,a,u,l,h,y)}roundClean(){Yr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var cu=su(()=>new $s);var Ws={};Ec(Ws,{bitGet:()=>Zp,bitLen:()=>Xp,bitMask:()=>Eo,bitSet:()=>Jp,bytesToHex:()=>Cn,bytesToNumberBE:()=>wr,bytesToNumberLE:()=>vi,concatBytes:()=>Qn,createHmacDrbg:()=>Vs,ensureBytes:()=>It,equalBytes:()=>Qp,hexToBytes:()=>In,hexToNumber:()=>js,numberToBytesBE:()=>Xr,numberToBytesLE:()=>Ei,numberToHexUnpadded:()=>lu,numberToVarBytesBE:()=>Wp,utf8ToBytes:()=>Yp,validateObject:()=>Zr});var fu=BigInt(0),Ti=BigInt(1),jp=BigInt(2),_i=r=>r instanceof Uint8Array,Vp=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function Cn(r){if(!_i(r))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=Vp[r[e]];return t}function lu(r){let t=r.toString(16);return t.length&1?`0${t}`:t}function js(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}function In(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let t=r.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);let e=new Uint8Array(t/2);for(let n=0;n<e.length;n++){let o=n*2,s=r.slice(o,o+2),a=Number.parseInt(s,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");e[n]=a}return e}function wr(r){return js(Cn(r))}function vi(r){if(!_i(r))throw new Error("Uint8Array expected");return js(Cn(Uint8Array.from(r).reverse()))}function Xr(r,t){return In(r.toString(16).padStart(t*2,"0"))}function Ei(r,t){return Xr(r,t).reverse()}function Wp(r){return In(lu(r))}function It(r,t,e){let n;if(typeof t=="string")try{n=In(t)}catch(s){throw new Error(`${r} must be valid hex string, got "${t}". Cause: ${s}`)}else if(_i(t))n=Uint8Array.from(t);else throw new Error(`${r} must be hex string or Uint8Array`);let o=n.length;if(typeof e=="number"&&o!==e)throw new Error(`${r} expected ${e} bytes, got ${o}`);return n}function Qn(...r){let t=new Uint8Array(r.reduce((n,o)=>n+o.length,0)),e=0;return r.forEach(n=>{if(!_i(n))throw new Error("Uint8Array expected");t.set(n,e),e+=n.length}),t}function Qp(r,t){if(r.length!==t.length)return!1;for(let e=0;e<r.length;e++)if(r[e]!==t[e])return!1;return!0}function Yp(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function Xp(r){let t;for(t=0;r>fu;r>>=Ti,t+=1);return t}function Zp(r,t){return r>>BigInt(t)&Ti}var Jp=(r,t,e)=>r|(e?Ti:fu)<<BigInt(t),Eo=r=>(jp<<BigInt(r-1))-Ti,Ks=r=>new Uint8Array(r),uu=r=>Uint8Array.from(r);function Vs(r,t,e){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof e!="function")throw new Error("hmacFn must be a function");let n=Ks(r),o=Ks(r),s=0,a=()=>{n.fill(1),o.fill(0),s=0},u=(...m)=>e(o,n,...m),l=(m=Ks())=>{o=u(uu([0]),m),n=u(),m.length!==0&&(o=u(uu([1]),m),n=u())},h=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let m=0,v=[];for(;m<t;){n=u();let A=n.slice();v.push(A),m+=n.length}return Qn(...v)};return(m,v)=>{a(),l(m);let A;for(;!(A=v(h()));)l();return a(),A}}var eh={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||r instanceof Uint8Array,isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,t)=>t.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function Zr(r,t,e={}){let n=(o,s,a)=>{let u=eh[s];if(typeof u!="function")throw new Error(`Invalid validator "${s}", expected function`);let l=r[o];if(!(a&&l===void 0)&&!u(l,r))throw new Error(`Invalid param ${String(o)}=${l} (${typeof l}), expected ${s}`)};for(let[o,s]of Object.entries(t))n(o,s,!1);for(let[o,s]of Object.entries(e))n(o,s,!0);return r}var nt=BigInt(0),je=BigInt(1),Rn=BigInt(2),th=BigInt(3),Qs=BigInt(4),du=BigInt(5),pu=BigInt(8),rh=BigInt(9),nh=BigInt(16);function ht(r,t){let e=r%t;return e>=nt?e:t+e}function oh(r,t,e){if(e<=nt||t<nt)throw new Error("Expected power/modulo > 0");if(e===je)return nt;let n=je;for(;t>nt;)t&je&&(n=n*r%e),r=r*r%e,t>>=je;return n}function Rt(r,t,e){let n=r;for(;t-- >nt;)n*=n,n%=e;return n}function Si(r,t){if(r===nt||t<=nt)throw new Error(`invert: expected positive integers, got n=${r} mod=${t}`);let e=ht(r,t),n=t,o=nt,s=je,a=je,u=nt;for(;e!==nt;){let h=n/e,y=n%e,m=o-a*h,v=s-u*h;n=e,e=y,o=a,s=u,a=m,u=v}if(n!==je)throw new Error("invert: does not exist");return ht(o,t)}function ih(r){let t=(r-je)/Rn,e,n,o;for(e=r-je,n=0;e%Rn===nt;e/=Rn,n++);for(o=Rn;o<r&&oh(o,t,r)!==r-je;o++);if(n===1){let a=(r+je)/Qs;return function(l,h){let y=l.pow(h,a);if(!l.eql(l.sqr(y),h))throw new Error("Cannot find square root");return y}}let s=(e+je)/Rn;return function(u,l){if(u.pow(l,t)===u.neg(u.ONE))throw new Error("Cannot find square root");let h=n,y=u.pow(u.mul(u.ONE,o),e),m=u.pow(l,s),v=u.pow(l,e);for(;!u.eql(v,u.ONE);){if(u.eql(v,u.ZERO))return u.ZERO;let A=1;for(let w=u.sqr(v);A<h&&!u.eql(w,u.ONE);A++)w=u.sqr(w);let C=u.pow(y,je<<BigInt(h-A-1));y=u.sqr(C),m=u.mul(m,C),v=u.mul(v,y),h=A}return m}}function sh(r){if(r%Qs===th){let t=(r+je)/Qs;return function(n,o){let s=n.pow(o,t);if(!n.eql(n.sqr(s),o))throw new Error("Cannot find square root");return s}}if(r%pu===du){let t=(r-du)/pu;return function(n,o){let s=n.mul(o,Rn),a=n.pow(s,t),u=n.mul(o,a),l=n.mul(n.mul(u,Rn),a),h=n.mul(u,n.sub(l,n.ONE));if(!n.eql(n.sqr(h),o))throw new Error("Cannot find square root");return h}}return r%nh,ih(r)}var ah=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ys(r){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},e=ah.reduce((n,o)=>(n[o]="function",n),t);return Zr(r,e)}function ch(r,t,e){if(e<nt)throw new Error("Expected power > 0");if(e===nt)return r.ONE;if(e===je)return t;let n=r.ONE,o=t;for(;e>nt;)e&je&&(n=r.mul(n,o)),o=r.sqr(o),e>>=je;return n}function uh(r,t){let e=new Array(t.length),n=t.reduce((s,a,u)=>r.is0(a)?s:(e[u]=s,r.mul(s,a)),r.ONE),o=r.inv(n);return t.reduceRight((s,a,u)=>r.is0(a)?s:(e[u]=r.mul(s,e[u]),r.mul(s,a)),o),e}function Xs(r,t){let e=t!==void 0?t:r.toString(2).length,n=Math.ceil(e/8);return{nBitLength:e,nByteLength:n}}function hu(r,t,e=!1,n={}){if(r<=nt)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:o,nByteLength:s}=Xs(r,t);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let a=sh(r),u=Object.freeze({ORDER:r,BITS:o,BYTES:s,MASK:Eo(o),ZERO:nt,ONE:je,create:l=>ht(l,r),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return nt<=l&&l<r},is0:l=>l===nt,isOdd:l=>(l&je)===je,neg:l=>ht(-l,r),eql:(l,h)=>l===h,sqr:l=>ht(l*l,r),add:(l,h)=>ht(l+h,r),sub:(l,h)=>ht(l-h,r),mul:(l,h)=>ht(l*h,r),pow:(l,h)=>ch(u,l,h),div:(l,h)=>ht(l*Si(h,r),r),sqrN:l=>l*l,addN:(l,h)=>l+h,subN:(l,h)=>l-h,mulN:(l,h)=>l*h,inv:l=>Si(l,r),sqrt:n.sqrt||(l=>a(u,l)),invertBatch:l=>uh(u,l),cmov:(l,h,y)=>y?h:l,toBytes:l=>e?Ei(l,s):Xr(l,s),fromBytes:l=>{if(l.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${l.length}`);return e?vi(l):wr(l)}});return Object.freeze(u)}function yu(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let t=r.toString(2).length;return Math.ceil(t/8)}function Zs(r){let t=yu(r);return t+Math.ceil(t/2)}function gu(r,t,e=!1){let n=r.length,o=yu(t),s=Zs(t);if(n<16||n<s||n>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let a=e?wr(r):vi(r),u=ht(a,t-je)+je;return e?Ei(u,o):Xr(u,o)}var lh=BigInt(0),Js=BigInt(1);function mu(r,t){let e=(o,s)=>{let a=s.negate();return o?a:s},n=o=>{let s=Math.ceil(t/o)+1,a=2**(o-1);return{windows:s,windowSize:a}};return{constTimeNegate:e,unsafeLadder(o,s){let a=r.ZERO,u=o;for(;s>lh;)s&Js&&(a=a.add(u)),u=u.double(),s>>=Js;return a},precomputeWindow(o,s){let{windows:a,windowSize:u}=n(s),l=[],h=o,y=h;for(let m=0;m<a;m++){y=h,l.push(y);for(let v=1;v<u;v++)y=y.add(h),l.push(y);h=y.double()}return l},wNAF(o,s,a){let{windows:u,windowSize:l}=n(o),h=r.ZERO,y=r.BASE,m=BigInt(2**o-1),v=2**o,A=BigInt(o);for(let C=0;C<u;C++){let w=C*l,E=Number(a&m);a>>=A,E>l&&(E-=v,a+=Js);let P=w,q=w+Math.abs(E)-1,I=C%2!==0,J=E<0;E===0?y=y.add(e(I,s[P])):h=h.add(e(J,s[q]))}return{p:h,f:y}},wNAFCached(o,s,a,u){let l=o._WINDOW_SIZE||1,h=s.get(o);return h||(h=this.precomputeWindow(o,l),l!==1&&s.set(o,u(h))),this.wNAF(l,h,a)}}}function ea(r){return Ys(r.Fp),Zr(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Xs(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}function dh(r){let t=ea(r);Zr(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:e,Fp:n,a:o}=t;if(e){if(!n.eql(o,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof e!="object"||typeof e.beta!="bigint"||typeof e.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}var{bytesToNumberBE:ph,hexToBytes:hh}=Ws,Pn={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(r){let{Err:t}=Pn;if(r.length<2||r[0]!==2)throw new t("Invalid signature integer tag");let e=r[1],n=r.subarray(2,e+2);if(!e||n.length!==e)throw new t("Invalid signature integer: wrong length");if(n[0]&128)throw new t("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:ph(n),l:r.subarray(e+2)}},toSig(r){let{Err:t}=Pn,e=typeof r=="string"?hh(r):r;if(!(e instanceof Uint8Array))throw new Error("ui8a expected");let n=e.length;if(n<2||e[0]!=48)throw new t("Invalid signature tag");if(e[1]!==n-2)throw new t("Invalid signature: incorrect length");let{d:o,l:s}=Pn._parseInt(e.subarray(2)),{d:a,l:u}=Pn._parseInt(s);if(u.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:a}},hexFromSig(r){let t=h=>Number.parseInt(h[0],16)&8?"00"+h:h,e=h=>{let y=h.toString(16);return y.length&1?`0${y}`:y},n=t(e(r.s)),o=t(e(r.r)),s=n.length/2,a=o.length/2,u=e(s),l=e(a);return`30${e(a+s+4)}02${l}${o}02${u}${n}`}},Tr=BigInt(0),Dt=BigInt(1),px=BigInt(2),xu=BigInt(3),hx=BigInt(4);function yh(r){let t=dh(r),{Fp:e}=t,n=t.toBytes||((C,w,E)=>{let P=w.toAffine();return Qn(Uint8Array.from([4]),e.toBytes(P.x),e.toBytes(P.y))}),o=t.fromBytes||(C=>{let w=C.subarray(1),E=e.fromBytes(w.subarray(0,e.BYTES)),P=e.fromBytes(w.subarray(e.BYTES,2*e.BYTES));return{x:E,y:P}});function s(C){let{a:w,b:E}=t,P=e.sqr(C),q=e.mul(P,C);return e.add(e.add(q,e.mul(C,w)),E)}if(!e.eql(e.sqr(t.Gy),s(t.Gx)))throw new Error("bad generator point: equation left != right");function a(C){return typeof C=="bigint"&&Tr<C&&C<t.n}function u(C){if(!a(C))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function l(C){let{allowedPrivateKeyLengths:w,nByteLength:E,wrapPrivateKey:P,n:q}=t;if(w&&typeof C!="bigint"){if(C instanceof Uint8Array&&(C=Cn(C)),typeof C!="string"||!w.includes(C.length))throw new Error("Invalid key");C=C.padStart(E*2,"0")}let I;try{I=typeof C=="bigint"?C:wr(It("private key",C,E))}catch(J){throw new Error(`private key must be ${E} bytes, hex or bigint, not ${typeof C}`)}return P&&(I=ht(I,q)),u(I),I}let h=new Map;function y(C){if(!(C instanceof m))throw new Error("ProjectivePoint expected")}class m{constructor(w,E,P){if(this.px=w,this.py=E,this.pz=P,w==null||!e.isValid(w))throw new Error("x required");if(E==null||!e.isValid(E))throw new Error("y required");if(P==null||!e.isValid(P))throw new Error("z required")}static fromAffine(w){let{x:E,y:P}=w||{};if(!w||!e.isValid(E)||!e.isValid(P))throw new Error("invalid affine point");if(w instanceof m)throw new Error("projective point not allowed");let q=I=>e.eql(I,e.ZERO);return q(E)&&q(P)?m.ZERO:new m(E,P,e.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(w){let E=e.invertBatch(w.map(P=>P.pz));return w.map((P,q)=>P.toAffine(E[q])).map(m.fromAffine)}static fromHex(w){let E=m.fromAffine(o(It("pointHex",w)));return E.assertValidity(),E}static fromPrivateKey(w){return m.BASE.multiply(l(w))}_setWindowSize(w){this._WINDOW_SIZE=w,h.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!e.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:w,y:E}=this.toAffine();if(!e.isValid(w)||!e.isValid(E))throw new Error("bad point: x or y not FE");let P=e.sqr(E),q=s(w);if(!e.eql(P,q))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:w}=this.toAffine();if(e.isOdd)return!e.isOdd(w);throw new Error("Field doesn't support isOdd")}equals(w){y(w);let{px:E,py:P,pz:q}=this,{px:I,py:J,pz:F}=w,W=e.eql(e.mul(E,F),e.mul(I,q)),ee=e.eql(e.mul(P,F),e.mul(J,q));return W&&ee}negate(){return new m(this.px,e.neg(this.py),this.pz)}double(){let{a:w,b:E}=t,P=e.mul(E,xu),{px:q,py:I,pz:J}=this,F=e.ZERO,W=e.ZERO,ee=e.ZERO,Q=e.mul(q,q),_e=e.mul(I,I),Ae=e.mul(J,J),ge=e.mul(q,I);return ge=e.add(ge,ge),ee=e.mul(q,J),ee=e.add(ee,ee),F=e.mul(w,ee),W=e.mul(P,Ae),W=e.add(F,W),F=e.sub(_e,W),W=e.add(_e,W),W=e.mul(F,W),F=e.mul(ge,F),ee=e.mul(P,ee),Ae=e.mul(w,Ae),ge=e.sub(Q,Ae),ge=e.mul(w,ge),ge=e.add(ge,ee),ee=e.add(Q,Q),Q=e.add(ee,Q),Q=e.add(Q,Ae),Q=e.mul(Q,ge),W=e.add(W,Q),Ae=e.mul(I,J),Ae=e.add(Ae,Ae),Q=e.mul(Ae,ge),F=e.sub(F,Q),ee=e.mul(Ae,_e),ee=e.add(ee,ee),ee=e.add(ee,ee),new m(F,W,ee)}add(w){y(w);let{px:E,py:P,pz:q}=this,{px:I,py:J,pz:F}=w,W=e.ZERO,ee=e.ZERO,Q=e.ZERO,_e=t.a,Ae=e.mul(t.b,xu),ge=e.mul(E,I),ze=e.mul(P,J),He=e.mul(q,F),ct=e.add(E,P),z=e.add(I,J);ct=e.mul(ct,z),z=e.add(ge,ze),ct=e.sub(ct,z),z=e.add(E,q);let $=e.add(I,F);return z=e.mul(z,$),$=e.add(ge,He),z=e.sub(z,$),$=e.add(P,q),W=e.add(J,F),$=e.mul($,W),W=e.add(ze,He),$=e.sub($,W),Q=e.mul(_e,z),W=e.mul(Ae,He),Q=e.add(W,Q),W=e.sub(ze,Q),Q=e.add(ze,Q),ee=e.mul(W,Q),ze=e.add(ge,ge),ze=e.add(ze,ge),He=e.mul(_e,He),z=e.mul(Ae,z),ze=e.add(ze,He),He=e.sub(ge,He),He=e.mul(_e,He),z=e.add(z,He),ge=e.mul(ze,z),ee=e.add(ee,ge),ge=e.mul($,z),W=e.mul(ct,W),W=e.sub(W,ge),ge=e.mul(ct,ze),Q=e.mul($,Q),Q=e.add(Q,ge),new m(W,ee,Q)}subtract(w){return this.add(w.negate())}is0(){return this.equals(m.ZERO)}wNAF(w){return A.wNAFCached(this,h,w,E=>{let P=e.invertBatch(E.map(q=>q.pz));return E.map((q,I)=>q.toAffine(P[I])).map(m.fromAffine)})}multiplyUnsafe(w){let E=m.ZERO;if(w===Tr)return E;if(u(w),w===Dt)return this;let{endo:P}=t;if(!P)return A.unsafeLadder(this,w);let{k1neg:q,k1:I,k2neg:J,k2:F}=P.splitScalar(w),W=E,ee=E,Q=this;for(;I>Tr||F>Tr;)I&Dt&&(W=W.add(Q)),F&Dt&&(ee=ee.add(Q)),Q=Q.double(),I>>=Dt,F>>=Dt;return q&&(W=W.negate()),J&&(ee=ee.negate()),ee=new m(e.mul(ee.px,P.beta),ee.py,ee.pz),W.add(ee)}multiply(w){u(w);let E=w,P,q,{endo:I}=t;if(I){let{k1neg:J,k1:F,k2neg:W,k2:ee}=I.splitScalar(E),{p:Q,f:_e}=this.wNAF(F),{p:Ae,f:ge}=this.wNAF(ee);Q=A.constTimeNegate(J,Q),Ae=A.constTimeNegate(W,Ae),Ae=new m(e.mul(Ae.px,I.beta),Ae.py,Ae.pz),P=Q.add(Ae),q=_e.add(ge)}else{let{p:J,f:F}=this.wNAF(E);P=J,q=F}return m.normalizeZ([P,q])[0]}multiplyAndAddUnsafe(w,E,P){let q=m.BASE,I=(F,W)=>W===Tr||W===Dt||!F.equals(q)?F.multiplyUnsafe(W):F.multiply(W),J=I(this,E).add(I(w,P));return J.is0()?void 0:J}toAffine(w){let{px:E,py:P,pz:q}=this,I=this.is0();w==null&&(w=I?e.ONE:e.inv(q));let J=e.mul(E,w),F=e.mul(P,w),W=e.mul(q,w);if(I)return{x:e.ZERO,y:e.ZERO};if(!e.eql(W,e.ONE))throw new Error("invZ was invalid");return{x:J,y:F}}isTorsionFree(){let{h:w,isTorsionFree:E}=t;if(w===Dt)return!0;if(E)return E(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:w,clearCofactor:E}=t;return w===Dt?this:E?E(m,this):this.multiplyUnsafe(t.h)}toRawBytes(w=!0){return this.assertValidity(),n(m,this,w)}toHex(w=!0){return Cn(this.toRawBytes(w))}}m.BASE=new m(t.Gx,t.Gy,e.ONE),m.ZERO=new m(e.ZERO,e.ONE,e.ZERO);let v=t.nBitLength,A=mu(m,t.endo?Math.ceil(v/2):v);return{CURVE:t,ProjectivePoint:m,normPrivateKeyToScalar:l,weierstrassEquation:s,isWithinCurveOrder:a}}function gh(r){let t=ea(r);return Zr(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function bu(r){let t=gh(r),{Fp:e,n}=t,o=e.BYTES+1,s=2*e.BYTES+1;function a(z){return Tr<z&&z<e.ORDER}function u(z){return ht(z,n)}function l(z){return Si(z,n)}let{ProjectivePoint:h,normPrivateKeyToScalar:y,weierstrassEquation:m,isWithinCurveOrder:v}=yh({...t,toBytes(z,$,fe){let Ce=$.toAffine(),Re=e.toBytes(Ce.x),We=Qn;return fe?We(Uint8Array.from([$.hasEvenY()?2:3]),Re):We(Uint8Array.from([4]),Re,e.toBytes(Ce.y))},fromBytes(z){let $=z.length,fe=z[0],Ce=z.subarray(1);if($===o&&(fe===2||fe===3)){let Re=wr(Ce);if(!a(Re))throw new Error("Point is not on curve");let We=m(Re),at=e.sqrt(We),De=(at&Dt)===Dt;return(fe&1)===1!==De&&(at=e.neg(at)),{x:Re,y:at}}else if($===s&&fe===4){let Re=e.fromBytes(Ce.subarray(0,e.BYTES)),We=e.fromBytes(Ce.subarray(e.BYTES,2*e.BYTES));return{x:Re,y:We}}else throw new Error(`Point of length ${$} was invalid. Expected ${o} compressed bytes or ${s} uncompressed bytes`)}}),A=z=>Cn(Xr(z,t.nByteLength));function C(z){let $=n>>Dt;return z>$}function w(z){return C(z)?u(-z):z}let E=(z,$,fe)=>wr(z.slice($,fe));class P{constructor($,fe,Ce){this.r=$,this.s=fe,this.recovery=Ce,this.assertValidity()}static fromCompact($){let fe=t.nByteLength;return $=It("compactSignature",$,fe*2),new P(E($,0,fe),E($,fe,2*fe))}static fromDER($){let{r:fe,s:Ce}=Pn.toSig(It("DER",$));return new P(fe,Ce)}assertValidity(){if(!v(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!v(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit($){return new P(this.r,this.s,$)}recoverPublicKey($){let{r:fe,s:Ce,recovery:Re}=this,We=ee(It("msgHash",$));if(Re==null||![0,1,2,3].includes(Re))throw new Error("recovery id invalid");let at=Re===2||Re===3?fe+t.n:fe;if(at>=e.ORDER)throw new Error("recovery id 2 or 3 invalid");let De=(Re&1)===0?"02":"03",Xe=h.fromHex(De+A(at)),le=l(at),Je=u(-We*le),Lr=u(Ce*le),Ft=h.BASE.multiplyAndAddUnsafe(Xe,Je,Lr);if(!Ft)throw new Error("point at infinify");return Ft.assertValidity(),Ft}hasHighS(){return C(this.s)}normalizeS(){return this.hasHighS()?new P(this.r,u(-this.s),this.recovery):this}toDERRawBytes(){return In(this.toDERHex())}toDERHex(){return Pn.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return In(this.toCompactHex())}toCompactHex(){return A(this.r)+A(this.s)}}let q={isValidPrivateKey(z){try{return y(z),!0}catch($){return!1}},normPrivateKeyToScalar:y,randomPrivateKey:()=>{let z=Zs(t.n);return gu(t.randomBytes(z),t.n)},precompute(z=8,$=h.BASE){return $._setWindowSize(z),$.multiply(BigInt(3)),$}};function I(z,$=!0){return h.fromPrivateKey(z).toRawBytes($)}function J(z){let $=z instanceof Uint8Array,fe=typeof z=="string",Ce=($||fe)&&z.length;return $?Ce===o||Ce===s:fe?Ce===2*o||Ce===2*s:z instanceof h}function F(z,$,fe=!0){if(J(z))throw new Error("first arg must be private key");if(!J($))throw new Error("second arg must be public key");return h.fromHex($).multiply(y(z)).toRawBytes(fe)}let W=t.bits2int||function(z){let $=wr(z),fe=z.length*8-t.nBitLength;return fe>0?$>>BigInt(fe):$},ee=t.bits2int_modN||function(z){return u(W(z))},Q=Eo(t.nBitLength);function _e(z){if(typeof z!="bigint")throw new Error("bigint expected");if(!(Tr<=z&&z<Q))throw new Error(`bigint expected < 2^${t.nBitLength}`);return Xr(z,t.nByteLength)}function Ae(z,$,fe=ge){if(["recovered","canonical"].some(Ht=>Ht in fe))throw new Error("sign() legacy options not supported");let{hash:Ce,randomBytes:Re}=t,{lowS:We,prehash:at,extraEntropy:De}=fe;We==null&&(We=!0),z=It("msgHash",z),at&&(z=It("prehashed msgHash",Ce(z)));let Xe=ee(z),le=y($),Je=[_e(le),_e(Xe)];if(De!=null){let Ht=De===!0?Re(e.BYTES):De;Je.push(It("extraEntropy",Ht))}let Lr=Qn(...Je),Ft=Xe;function Fr(Ht){let dr=W(Ht);if(!v(dr))return;let bn=l(dr),pr=h.BASE.multiply(dr).toAffine(),Ut=u(pr.x);if(Ut===Tr)return;let $r=u(bn*u(Ft+Ut*le));if($r===Tr)return;let Jo=(pr.x===Ut?0:2)|Number(pr.y&Dt),po=$r;return We&&C($r)&&(po=w($r),Jo^=1),new P(Ut,po,Jo)}return{seed:Lr,k2sig:Fr}}let ge={lowS:t.lowS,prehash:!1},ze={lowS:t.lowS,prehash:!1};function He(z,$,fe=ge){let{seed:Ce,k2sig:Re}=Ae(z,$,fe),We=t;return Vs(We.hash.outputLen,We.nByteLength,We.hmac)(Ce,Re)}h.BASE._setWindowSize(8);function ct(z,$,fe,Ce=ze){var pr;let Re=z;if($=It("msgHash",$),fe=It("publicKey",fe),"strict"in Ce)throw new Error("options.strict was renamed to lowS");let{lowS:We,prehash:at}=Ce,De,Xe;try{if(typeof Re=="string"||Re instanceof Uint8Array)try{De=P.fromDER(Re)}catch(Ut){if(!(Ut instanceof Pn.Err))throw Ut;De=P.fromCompact(Re)}else if(typeof Re=="object"&&typeof Re.r=="bigint"&&typeof Re.s=="bigint"){let{r:Ut,s:$r}=Re;De=new P(Ut,$r)}else throw new Error("PARSE");Xe=h.fromHex(fe)}catch(Ut){if(Ut.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(We&&De.hasHighS())return!1;at&&($=t.hash($));let{r:le,s:Je}=De,Lr=ee($),Ft=l(Je),Fr=u(Lr*Ft),Ht=u(le*Ft),dr=(pr=h.BASE.multiplyAndAddUnsafe(Xe,Fr,Ht))==null?void 0:pr.toAffine();return dr?u(dr.x)===le:!1}return{CURVE:t,getPublicKey:I,getSharedSecret:F,sign:He,verify:ct,ProjectivePoint:h,Signature:P,utils:q}}var Ui=class extends Wn{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,ru(t);let n=vo(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=t.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),s.fill(0)}update(t){return Vn(this),this.iHash.update(t),this}digestInto(t){Vn(this),Fs(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:n,finished:o,destroyed:s,blockLen:a,outputLen:u}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=a,t.outputLen=u,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},ta=(r,t,e)=>new Ui(r,t).update(e).digest();ta.create=(r,t)=>new Ui(r,t);function mh(r){return{hash:r,hmac:(t,...e)=>ta(r,t,iu(...e)),randomBytes:au}}function Au(r,t){let e=n=>bu({...r,...mh(n)});return Object.freeze({...e(t),create:e})}var _u=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),wu=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),xh=BigInt(1),ra=BigInt(2),Tu=(r,t)=>(r+t/ra)/t;function bh(r){let t=_u,e=BigInt(3),n=BigInt(6),o=BigInt(11),s=BigInt(22),a=BigInt(23),u=BigInt(44),l=BigInt(88),h=r*r*r%t,y=h*h*r%t,m=Rt(y,e,t)*y%t,v=Rt(m,e,t)*y%t,A=Rt(v,ra,t)*h%t,C=Rt(A,o,t)*A%t,w=Rt(C,s,t)*C%t,E=Rt(w,u,t)*w%t,P=Rt(E,l,t)*E%t,q=Rt(P,u,t)*w%t,I=Rt(q,e,t)*y%t,J=Rt(I,a,t)*C%t,F=Rt(J,n,t)*h%t,W=Rt(F,ra,t);if(!na.eql(na.sqr(W),r))throw new Error("Cannot find square root");return W}var na=hu(_u,void 0,void 0,{sqrt:bh}),Yn=Au({a:BigInt(0),b:BigInt(7),Fp:na,n:wu,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let t=wu,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-xh*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=e,a=BigInt("0x100000000000000000000000000000000"),u=Tu(s*r,t),l=Tu(-n*r,t),h=ht(r-u*e-l*o,t),y=ht(-u*n-l*s,t),m=h>a,v=y>a;if(m&&(h=t-h),v&&(y=t-y),h>a||y>a)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:m,k1:h,k2neg:v,k2:y}}}},cu),Sx=BigInt(0);var Ux=Yn.ProjectivePoint;var Xn=class extends Ct{constructor(e){super();let n=Z.fromHexInput(e);if(n.toUint8Array().length!==Xn.LENGTH)throw new Error(`PublicKey length should be ${Xn.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}verifySignature(e){let{message:n,signature:o}=e,s=Z.fromHexInput(n).toUint8Array(),a=Sn(s),u=o.toUint8Array();return Yn.verify(u,a,this.toUint8Array())}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new Xn(n)}static load(e){let n=e.deserializeBytes();return new Xn(n)}},Mt=Xn;Mt.LENGTH=65;var Zn=class extends Bn{constructor(e){super();let n=Z.fromHexInput(e);if(n.toUint8Array().length!==Zn.LENGTH)throw new Error(`PrivateKey length should be ${Zn.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}sign(e){let n=Z.fromHexInput(e),o=Sn(n.toUint8Array()),s=Yn.sign(o,this.key.toUint8Array());return new nr(s.toCompactRawBytes())}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new Zn(n)}static generate(){let e=Yn.utils.randomPrivateKey();return new Zn(e)}publicKey(){let e=Yn.getPublicKey(this.key.toUint8Array(),!1);return new Mt(e)}},Jr=Zn;Jr.LENGTH=32;var Jn=class extends Kt{constructor(e){super();let n=Z.fromHexInput(e);if(n.toUint8Array().length!==Jn.LENGTH)throw new Error(`Signature length should be ${Jn.LENGTH}, recieved ${n.toUint8Array().length}`);this.data=n}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new Jn(n)}static load(e){let n=e.deserializeBytes();return new Jn(n)}},nr=Jn;nr.LENGTH=64;var Ye=class extends Ct{constructor(e){super();this.publicKey=e}toUint8Array(){return this.publicKey.toUint8Array()}toString(){return this.publicKey.toString()}verifySignature(e){let{message:n,signature:o}=e;return this.publicKey.verifySignature({message:n,signature:o})}serialize(e){if(this.publicKey instanceof Oe)e.serializeU32AsUleb128(0),this.publicKey.serialize(e);else if(this.publicKey instanceof Mt)e.serializeU32AsUleb128(1),this.publicKey.serialize(e);else throw new Error("Unknown public key type")}static deserialize(e){let n=e.deserializeUleb128AsU32();switch(n){case 0:return new Ye(Oe.load(e));case 1:return new Ye(Mt.load(e));default:throw new Error(`Unknown variant index for AnyPublicKey: ${n}`)}}};var _r=class extends Ct{constructor(e){super();let{publicKeys:n,signaturesRequired:o}=e;if(o<1)throw new Error("The number of required signatures needs to be greater then 0");if(n.length<o)throw new Error(`Provided ${n.length} public keys is smaller than the ${o} required signatures`);let s=[];n.forEach(a=>{a instanceof Ye?s.push(a):s.push(new Ye(a))}),this.publicKeys=s,this.signaturesRequired=o}toUint8Array(){return this.bcsToBytes()}createBitmap(e){let{bits:n}=e,o=128,s=new Uint8Array([0,0,0,0]),a=new Set;return n.forEach((u,l)=>{if(l+1>this.publicKeys.length)throw new Error(`Signature index ${l+1} is out of public keys range, ${this.publicKeys.length}.`);if(a.has(u))throw new Error(`Duplicate bit ${u} detected.`);a.add(u);let h=Math.floor(u/8),y=s[h];y|=o>>u%8,s[h]=y}),s}toString(){return Z.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("not implemented")}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let n=e.deserializeVector(Ye),o=e.deserializeU8();return new _r({publicKeys:n,signaturesRequired:o})}};var en=class extends ne{constructor(e){super();let{data:n}=e,o=Z.fromHexInput(n);if(o.toUint8Array().length!==en.LENGTH)throw new Error(`Authentication Key length should be ${en.LENGTH}`);this.data=o}serialize(e){e.serializeFixedBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeFixedBytes(en.LENGTH);return new en({data:n})}toString(){return this.data.toString()}toUint8Array(){return this.data.toUint8Array()}static fromPublicKeyAndScheme(e){let{publicKey:n,scheme:o}=e,s;switch(o){case 3:case 2:{let l=n.bcsToBytes();s=new Uint8Array([...l,o]);break}case 0:case 1:{let l=n.toUint8Array(),h=Z.fromHexInput(l).toUint8Array();s=new Uint8Array([...h,o]);break}default:throw new Error(`Scheme ${o} is not supported`)}let a=Sn.create();a.update(s);let u=a.digest();return new en({data:u})}static fromPublicKey(e){let{publicKey:n}=e,o;if(n instanceof Oe)o=0 .valueOf();else if(n instanceof Tt)o=1 .valueOf();else if(n instanceof Ye)o=2 .valueOf();else if(n instanceof _r)o=3 .valueOf();else throw new Error("No supported authentication scheme for public key");return en.fromPublicKeyAndScheme({publicKey:n,scheme:o})}derivedAddress(){return new H({data:this.data.toUint8Array()})}},or=en;or.LENGTH=32;var Bi=class extends jr{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,dt.hash(t);let n=Vr(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=t.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),s.fill(0)}update(t){return dt.exists(this),this.iHash.update(t),this}digestInto(t){dt.exists(this),dt.bytes(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:n,finished:o,destroyed:s,blockLen:a,outputLen:u}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=a,t.outputLen=u,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},oa=(r,t,e)=>new Bi(r,t).update(e).digest();oa.create=(r,t)=>new Bi(r,t);function Ah(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let o=BigInt(32),s=BigInt(4294967295),a=Number(e>>o&s),u=Number(e&s),l=n?4:0,h=n?0:4;r.setUint32(t+l,a,n),r.setUint32(t+h,u,n)}var Ci=class extends jr{constructor(t,e,n,o){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=li(this.buffer)}update(t){dt.exists(this);let{view:e,buffer:n,blockLen:o}=this;t=Vr(t);let s=t.length;for(let a=0;a<s;){let u=Math.min(o-this.pos,s-a);if(u===o){let l=li(t);for(;o<=s-a;a+=o)this.process(l,a);continue}n.set(t.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){dt.exists(this),dt.output(t,this),this.finished=!0;let{buffer:e,view:n,blockLen:o,isLE:s}=this,{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let l=a;l<o;l++)e[l]=0;Ah(n,o-8,BigInt(this.length*8),s),this.process(n,0);let u=li(t);this.get().forEach((l,h)=>u.setUint32(4*h,l,s))}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:n,length:o,finished:s,destroyed:a,pos:u}=this;return t.length=o,t.pos=u,t.finished=s,t.destroyed=a,o%e&&t.buffer.set(n),t}};var[wh,Th]=oe.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),tn=new Uint32Array(80),rn=new Uint32Array(80),So=class extends Ci{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:n,Bl:o,Ch:s,Cl:a,Dh:u,Dl:l,Eh:h,El:y,Fh:m,Fl:v,Gh:A,Gl:C,Hh:w,Hl:E}=this;return[t,e,n,o,s,a,u,l,h,y,m,v,A,C,w,E]}set(t,e,n,o,s,a,u,l,h,y,m,v,A,C,w,E){this.Ah=t|0,this.Al=e|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=a|0,this.Dh=u|0,this.Dl=l|0,this.Eh=h|0,this.El=y|0,this.Fh=m|0,this.Fl=v|0,this.Gh=A|0,this.Gl=C|0,this.Hh=w|0,this.Hl=E|0}process(t,e){for(let I=0;I<16;I++,e+=4)tn[I]=t.getUint32(e),rn[I]=t.getUint32(e+=4);for(let I=16;I<80;I++){let J=tn[I-15]|0,F=rn[I-15]|0,W=oe.rotrSH(J,F,1)^oe.rotrSH(J,F,8)^oe.shrSH(J,F,7),ee=oe.rotrSL(J,F,1)^oe.rotrSL(J,F,8)^oe.shrSL(J,F,7),Q=tn[I-2]|0,_e=rn[I-2]|0,Ae=oe.rotrSH(Q,_e,19)^oe.rotrBH(Q,_e,61)^oe.shrSH(Q,_e,6),ge=oe.rotrSL(Q,_e,19)^oe.rotrBL(Q,_e,61)^oe.shrSL(Q,_e,6),ze=oe.add4L(ee,ge,rn[I-7],rn[I-16]),He=oe.add4H(ze,W,Ae,tn[I-7],tn[I-16]);tn[I]=He|0,rn[I]=ze|0}let{Ah:n,Al:o,Bh:s,Bl:a,Ch:u,Cl:l,Dh:h,Dl:y,Eh:m,El:v,Fh:A,Fl:C,Gh:w,Gl:E,Hh:P,Hl:q}=this;for(let I=0;I<80;I++){let J=oe.rotrSH(m,v,14)^oe.rotrSH(m,v,18)^oe.rotrBH(m,v,41),F=oe.rotrSL(m,v,14)^oe.rotrSL(m,v,18)^oe.rotrBL(m,v,41),W=m&A^~m&w,ee=v&C^~v&E,Q=oe.add5L(q,F,ee,Th[I],rn[I]),_e=oe.add5H(Q,P,J,W,wh[I],tn[I]),Ae=Q|0,ge=oe.rotrSH(n,o,28)^oe.rotrBH(n,o,34)^oe.rotrBH(n,o,39),ze=oe.rotrSL(n,o,28)^oe.rotrBL(n,o,34)^oe.rotrBL(n,o,39),He=n&s^n&u^s&u,ct=o&a^o&l^a&l;P=w|0,q=E|0,w=A|0,E=C|0,A=m|0,C=v|0,{h:m,l:v}=oe.add(h|0,y|0,_e|0,Ae|0),h=u|0,y=l|0,u=s|0,l=a|0,s=n|0,a=o|0;let z=oe.add3L(Ae,ze,ct);n=oe.add3H(z,_e,ge,He),o=z|0}({h:n,l:o}=oe.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:a}=oe.add(this.Bh|0,this.Bl|0,s|0,a|0),{h:u,l}=oe.add(this.Ch|0,this.Cl|0,u|0,l|0),{h,l:y}=oe.add(this.Dh|0,this.Dl|0,h|0,y|0),{h:m,l:v}=oe.add(this.Eh|0,this.El|0,m|0,v|0),{h:A,l:C}=oe.add(this.Fh|0,this.Fl|0,A|0,C|0),{h:w,l:E}=oe.add(this.Gh|0,this.Gl|0,w|0,E|0),{h:P,l:q}=oe.add(this.Hh|0,this.Hl|0,P|0,q|0),this.set(n,o,s,a,u,l,h,y,m,v,A,C,w,E,P,q)}roundClean(){tn.fill(0),rn.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},ia=class extends So{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},sa=class extends So{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}},vu=Ln(()=>new So),db=Ln(()=>new ia),pb=Ln(()=>new sa);var ff=Ss(uf()),lf=/^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'?$/,_a=(t=>(t.ED25519="ed25519 seed",t))(_a||{}),By=2147483648,df=(r,t)=>{let e=oa.create(vu,r).update(t).digest();return{key:e.slice(0,32),chainCode:e.slice(32)}},Cy=({key:r,chainCode:t},e)=>{let n=new ArrayBuffer(4);new DataView(n).setUint32(0,e);let o=new Uint8Array(n),s=new Uint8Array([0]),a=new Uint8Array([...s,...r,...o]);return df(t,a)},Iy=r=>r.replace("'",""),pf=r=>r.split("/").slice(1).map(Iy),hf=r=>lf.test(r)?!pf(r).some(Number.isNaN):!1,Ry=r=>{let t=r.trim().split(/\s+/).map(e=>e.toLowerCase()).join(" ");return ff.mnemonicToSeedSync(t)},va=(r,t,e,n=By)=>{if(!hf(t))throw new Error("Invalid derivation path");let{key:o,chainCode:s}=df(r,Ry(e));return pf(t).map(u=>parseInt(u,10)).reduce((u,l)=>Cy(u,l+n),{key:o,chainCode:s})};var Pt=class{constructor(t){let{privateKey:e,address:n,legacy:o}=t;if(this.publicKey=e.publicKey(),this.publicKey instanceof Oe)o?this.signingScheme=0:(this.publicKey=new Ye(this.publicKey),this.signingScheme=2);else if(this.publicKey instanceof Tt)this.signingScheme=1;else if(this.publicKey instanceof Mt)this.publicKey=new Ye(this.publicKey),this.signingScheme=2;else throw new Error("Can not create new Account, unsupported public key type");this.privateKey=e,this.accountAddress=n}static generate(t){let e;switch(t==null?void 0:t.scheme){case 2:e=Jr.generate();break;default:e=xr.generate()}let n=e.publicKey();t!=null&&t.legacy||(n=new Ye(e.publicKey()));let o=new H({data:Pt.authKey({publicKey:n}).toUint8Array()});return new Pt({privateKey:e,address:o,legacy:t==null?void 0:t.legacy})}static fromPrivateKeyAndAddress(t){let{privateKey:e,address:n,legacy:o}=t;return new Pt({privateKey:e,address:n,legacy:o})}static fromDerivationPath(t){let{path:e,mnemonic:n}=t,{key:o}=va("ed25519 seed",e,n),s=new xr(o),a=s.publicKey(),u=Pt.authKey({publicKey:a}),l=new H({data:u.toUint8Array()});return new Pt({privateKey:s,address:l,legacy:!0})}static authKey(t){let{publicKey:e}=t;return or.fromPublicKey({publicKey:e}).data}sign(t){return this.privateKey.sign(t)}verifySignature(t){let{message:e,signature:n}=t,o=Z.fromHexInput(e).toUint8Array();return this.publicKey.verifySignature({message:o,signature:n})}};var Gi=`
1
+ "use strict";var aptosSDK=(()=>{var Wp=Object.create;var ko=Object.defineProperty;var cu=Object.getOwnPropertyDescriptor;var Qp=Object.getOwnPropertyNames;var Yp=Object.getPrototypeOf,Xp=Object.prototype.hasOwnProperty;var uu=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var fe=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),fu=(r,t)=>{for(var e in t)ko(r,e,{get:t[e],enumerable:!0})},du=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Qp(t))!Xp.call(r,o)&&o!==e&&ko(r,o,{get:()=>t[o],enumerable:!(n=cu(t,o))||n.enumerable});return r};var Zi=(r,t,e)=>(e=r!=null?Wp(Yp(r)):{},du(t||!r||!r.__esModule?ko(e,"default",{value:r,enumerable:!0}):e,r)),Zp=r=>du(ko({},"__esModule",{value:!0}),r),Jr=(r,t,e,n)=>{for(var o=n>1?void 0:n?cu(t,e):t,s=r.length-1,a;s>=0;s--)(a=r[s])&&(o=(n?a(t,e,o):a(o))||o);return n&&o&&ko(t,e,o),o};var qu=fe(()=>{});var Lu=fe((Fx,Ds)=>{(function(r){"use strict";var t=function(u){var l,d=new Float64Array(16);if(u)for(l=0;l<u.length;l++)d[l]=u[l];return d},e=function(){throw new Error("no PRNG")},n=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var s=t(),a=t([1]),c=t([56129,1]),f=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]),g=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),y=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),w=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function b(u,l,d,i){u[l]=d>>24&255,u[l+1]=d>>16&255,u[l+2]=d>>8&255,u[l+3]=d&255,u[l+4]=i>>24&255,u[l+5]=i>>16&255,u[l+6]=i>>8&255,u[l+7]=i&255}function I(u,l,d,i,p){var x,A=0;for(x=0;x<p;x++)A|=u[l+x]^d[i+x];return(1&A-1>>>8)-1}function T(u,l,d,i){return I(u,l,d,i,16)}function S(u,l,d,i){return I(u,l,d,i,32)}function R(u,l,d,i){for(var p=i[0]&255|(i[1]&255)<<8|(i[2]&255)<<16|(i[3]&255)<<24,x=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,A=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,B=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,N=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,Y=i[4]&255|(i[5]&255)<<8|(i[6]&255)<<16|(i[7]&255)<<24,L=l[0]&255|(l[1]&255)<<8|(l[2]&255)<<16|(l[3]&255)<<24,Be=l[4]&255|(l[5]&255)<<8|(l[6]&255)<<16|(l[7]&255)<<24,$=l[8]&255|(l[9]&255)<<8|(l[10]&255)<<16|(l[11]&255)<<24,re=l[12]&255|(l[13]&255)<<8|(l[14]&255)<<16|(l[15]&255)<<24,se=i[8]&255|(i[9]&255)<<8|(i[10]&255)<<16|(i[11]&255)<<24,ge=d[16]&255|(d[17]&255)<<8|(d[18]&255)<<16|(d[19]&255)<<24,he=d[20]&255|(d[21]&255)<<8|(d[22]&255)<<16|(d[23]&255)<<24,ie=d[24]&255|(d[25]&255)<<8|(d[26]&255)<<16|(d[27]&255)<<24,ue=d[28]&255|(d[29]&255)<<8|(d[30]&255)<<16|(d[31]&255)<<24,ae=i[12]&255|(i[13]&255)<<8|(i[14]&255)<<16|(i[15]&255)<<24,j=p,X=x,H=A,W=B,Q=N,q=Y,_=L,v=Be,P=$,U=re,C=se,k=ge,ee=he,ye=ie,xe=ue,me=ae,m,_e=0;_e<20;_e+=2)m=j+ee|0,Q^=m<<7|m>>>32-7,m=Q+j|0,P^=m<<9|m>>>32-9,m=P+Q|0,ee^=m<<13|m>>>32-13,m=ee+P|0,j^=m<<18|m>>>32-18,m=q+X|0,U^=m<<7|m>>>32-7,m=U+q|0,ye^=m<<9|m>>>32-9,m=ye+U|0,X^=m<<13|m>>>32-13,m=X+ye|0,q^=m<<18|m>>>32-18,m=C+_|0,xe^=m<<7|m>>>32-7,m=xe+C|0,H^=m<<9|m>>>32-9,m=H+xe|0,_^=m<<13|m>>>32-13,m=_+H|0,C^=m<<18|m>>>32-18,m=me+k|0,W^=m<<7|m>>>32-7,m=W+me|0,v^=m<<9|m>>>32-9,m=v+W|0,k^=m<<13|m>>>32-13,m=k+v|0,me^=m<<18|m>>>32-18,m=j+W|0,X^=m<<7|m>>>32-7,m=X+j|0,H^=m<<9|m>>>32-9,m=H+X|0,W^=m<<13|m>>>32-13,m=W+H|0,j^=m<<18|m>>>32-18,m=q+Q|0,_^=m<<7|m>>>32-7,m=_+q|0,v^=m<<9|m>>>32-9,m=v+_|0,Q^=m<<13|m>>>32-13,m=Q+v|0,q^=m<<18|m>>>32-18,m=C+U|0,k^=m<<7|m>>>32-7,m=k+C|0,P^=m<<9|m>>>32-9,m=P+k|0,U^=m<<13|m>>>32-13,m=U+P|0,C^=m<<18|m>>>32-18,m=me+xe|0,ee^=m<<7|m>>>32-7,m=ee+me|0,ye^=m<<9|m>>>32-9,m=ye+ee|0,xe^=m<<13|m>>>32-13,m=xe+ye|0,me^=m<<18|m>>>32-18;j=j+p|0,X=X+x|0,H=H+A|0,W=W+B|0,Q=Q+N|0,q=q+Y|0,_=_+L|0,v=v+Be|0,P=P+$|0,U=U+re|0,C=C+se|0,k=k+ge|0,ee=ee+he|0,ye=ye+ie|0,xe=xe+ue|0,me=me+ae|0,u[0]=j>>>0&255,u[1]=j>>>8&255,u[2]=j>>>16&255,u[3]=j>>>24&255,u[4]=X>>>0&255,u[5]=X>>>8&255,u[6]=X>>>16&255,u[7]=X>>>24&255,u[8]=H>>>0&255,u[9]=H>>>8&255,u[10]=H>>>16&255,u[11]=H>>>24&255,u[12]=W>>>0&255,u[13]=W>>>8&255,u[14]=W>>>16&255,u[15]=W>>>24&255,u[16]=Q>>>0&255,u[17]=Q>>>8&255,u[18]=Q>>>16&255,u[19]=Q>>>24&255,u[20]=q>>>0&255,u[21]=q>>>8&255,u[22]=q>>>16&255,u[23]=q>>>24&255,u[24]=_>>>0&255,u[25]=_>>>8&255,u[26]=_>>>16&255,u[27]=_>>>24&255,u[28]=v>>>0&255,u[29]=v>>>8&255,u[30]=v>>>16&255,u[31]=v>>>24&255,u[32]=P>>>0&255,u[33]=P>>>8&255,u[34]=P>>>16&255,u[35]=P>>>24&255,u[36]=U>>>0&255,u[37]=U>>>8&255,u[38]=U>>>16&255,u[39]=U>>>24&255,u[40]=C>>>0&255,u[41]=C>>>8&255,u[42]=C>>>16&255,u[43]=C>>>24&255,u[44]=k>>>0&255,u[45]=k>>>8&255,u[46]=k>>>16&255,u[47]=k>>>24&255,u[48]=ee>>>0&255,u[49]=ee>>>8&255,u[50]=ee>>>16&255,u[51]=ee>>>24&255,u[52]=ye>>>0&255,u[53]=ye>>>8&255,u[54]=ye>>>16&255,u[55]=ye>>>24&255,u[56]=xe>>>0&255,u[57]=xe>>>8&255,u[58]=xe>>>16&255,u[59]=xe>>>24&255,u[60]=me>>>0&255,u[61]=me>>>8&255,u[62]=me>>>16&255,u[63]=me>>>24&255}function M(u,l,d,i){for(var p=i[0]&255|(i[1]&255)<<8|(i[2]&255)<<16|(i[3]&255)<<24,x=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,A=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,B=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,N=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,Y=i[4]&255|(i[5]&255)<<8|(i[6]&255)<<16|(i[7]&255)<<24,L=l[0]&255|(l[1]&255)<<8|(l[2]&255)<<16|(l[3]&255)<<24,Be=l[4]&255|(l[5]&255)<<8|(l[6]&255)<<16|(l[7]&255)<<24,$=l[8]&255|(l[9]&255)<<8|(l[10]&255)<<16|(l[11]&255)<<24,re=l[12]&255|(l[13]&255)<<8|(l[14]&255)<<16|(l[15]&255)<<24,se=i[8]&255|(i[9]&255)<<8|(i[10]&255)<<16|(i[11]&255)<<24,ge=d[16]&255|(d[17]&255)<<8|(d[18]&255)<<16|(d[19]&255)<<24,he=d[20]&255|(d[21]&255)<<8|(d[22]&255)<<16|(d[23]&255)<<24,ie=d[24]&255|(d[25]&255)<<8|(d[26]&255)<<16|(d[27]&255)<<24,ue=d[28]&255|(d[29]&255)<<8|(d[30]&255)<<16|(d[31]&255)<<24,ae=i[12]&255|(i[13]&255)<<8|(i[14]&255)<<16|(i[15]&255)<<24,j=p,X=x,H=A,W=B,Q=N,q=Y,_=L,v=Be,P=$,U=re,C=se,k=ge,ee=he,ye=ie,xe=ue,me=ae,m,_e=0;_e<20;_e+=2)m=j+ee|0,Q^=m<<7|m>>>32-7,m=Q+j|0,P^=m<<9|m>>>32-9,m=P+Q|0,ee^=m<<13|m>>>32-13,m=ee+P|0,j^=m<<18|m>>>32-18,m=q+X|0,U^=m<<7|m>>>32-7,m=U+q|0,ye^=m<<9|m>>>32-9,m=ye+U|0,X^=m<<13|m>>>32-13,m=X+ye|0,q^=m<<18|m>>>32-18,m=C+_|0,xe^=m<<7|m>>>32-7,m=xe+C|0,H^=m<<9|m>>>32-9,m=H+xe|0,_^=m<<13|m>>>32-13,m=_+H|0,C^=m<<18|m>>>32-18,m=me+k|0,W^=m<<7|m>>>32-7,m=W+me|0,v^=m<<9|m>>>32-9,m=v+W|0,k^=m<<13|m>>>32-13,m=k+v|0,me^=m<<18|m>>>32-18,m=j+W|0,X^=m<<7|m>>>32-7,m=X+j|0,H^=m<<9|m>>>32-9,m=H+X|0,W^=m<<13|m>>>32-13,m=W+H|0,j^=m<<18|m>>>32-18,m=q+Q|0,_^=m<<7|m>>>32-7,m=_+q|0,v^=m<<9|m>>>32-9,m=v+_|0,Q^=m<<13|m>>>32-13,m=Q+v|0,q^=m<<18|m>>>32-18,m=C+U|0,k^=m<<7|m>>>32-7,m=k+C|0,P^=m<<9|m>>>32-9,m=P+k|0,U^=m<<13|m>>>32-13,m=U+P|0,C^=m<<18|m>>>32-18,m=me+xe|0,ee^=m<<7|m>>>32-7,m=ee+me|0,ye^=m<<9|m>>>32-9,m=ye+ee|0,xe^=m<<13|m>>>32-13,m=xe+ye|0,me^=m<<18|m>>>32-18;u[0]=j>>>0&255,u[1]=j>>>8&255,u[2]=j>>>16&255,u[3]=j>>>24&255,u[4]=q>>>0&255,u[5]=q>>>8&255,u[6]=q>>>16&255,u[7]=q>>>24&255,u[8]=C>>>0&255,u[9]=C>>>8&255,u[10]=C>>>16&255,u[11]=C>>>24&255,u[12]=me>>>0&255,u[13]=me>>>8&255,u[14]=me>>>16&255,u[15]=me>>>24&255,u[16]=_>>>0&255,u[17]=_>>>8&255,u[18]=_>>>16&255,u[19]=_>>>24&255,u[20]=v>>>0&255,u[21]=v>>>8&255,u[22]=v>>>16&255,u[23]=v>>>24&255,u[24]=P>>>0&255,u[25]=P>>>8&255,u[26]=P>>>16&255,u[27]=P>>>24&255,u[28]=U>>>0&255,u[29]=U>>>8&255,u[30]=U>>>16&255,u[31]=U>>>24&255}function E(u,l,d,i){R(u,l,d,i)}function K(u,l,d,i){M(u,l,d,i)}var D=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function F(u,l,d,i,p,x,A){var B=new Uint8Array(16),N=new Uint8Array(64),Y,L;for(L=0;L<16;L++)B[L]=0;for(L=0;L<8;L++)B[L]=x[L];for(;p>=64;){for(E(N,B,A,D),L=0;L<64;L++)u[l+L]=d[i+L]^N[L];for(Y=1,L=8;L<16;L++)Y=Y+(B[L]&255)|0,B[L]=Y&255,Y>>>=8;p-=64,l+=64,i+=64}if(p>0)for(E(N,B,A,D),L=0;L<p;L++)u[l+L]=d[i+L]^N[L];return 0}function J(u,l,d,i,p){var x=new Uint8Array(16),A=new Uint8Array(64),B,N;for(N=0;N<16;N++)x[N]=0;for(N=0;N<8;N++)x[N]=i[N];for(;d>=64;){for(E(A,x,p,D),N=0;N<64;N++)u[l+N]=A[N];for(B=1,N=8;N<16;N++)B=B+(x[N]&255)|0,x[N]=B&255,B>>>=8;d-=64,l+=64}if(d>0)for(E(A,x,p,D),N=0;N<d;N++)u[l+N]=A[N];return 0}function G(u,l,d,i,p){var x=new Uint8Array(32);K(x,i,p,D);for(var A=new Uint8Array(8),B=0;B<8;B++)A[B]=i[B+16];return J(u,l,d,A,x)}function oe(u,l,d,i,p,x,A){var B=new Uint8Array(32);K(B,x,A,D);for(var N=new Uint8Array(8),Y=0;Y<8;Y++)N[Y]=x[Y+16];return F(u,l,d,i,p,N,B)}var de=function(u){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;var l,d,i,p,x,A,B,N;l=u[0]&255|(u[1]&255)<<8,this.r[0]=l&8191,d=u[2]&255|(u[3]&255)<<8,this.r[1]=(l>>>13|d<<3)&8191,i=u[4]&255|(u[5]&255)<<8,this.r[2]=(d>>>10|i<<6)&7939,p=u[6]&255|(u[7]&255)<<8,this.r[3]=(i>>>7|p<<9)&8191,x=u[8]&255|(u[9]&255)<<8,this.r[4]=(p>>>4|x<<12)&255,this.r[5]=x>>>1&8190,A=u[10]&255|(u[11]&255)<<8,this.r[6]=(x>>>14|A<<2)&8191,B=u[12]&255|(u[13]&255)<<8,this.r[7]=(A>>>11|B<<5)&8065,N=u[14]&255|(u[15]&255)<<8,this.r[8]=(B>>>8|N<<8)&8191,this.r[9]=N>>>5&127,this.pad[0]=u[16]&255|(u[17]&255)<<8,this.pad[1]=u[18]&255|(u[19]&255)<<8,this.pad[2]=u[20]&255|(u[21]&255)<<8,this.pad[3]=u[22]&255|(u[23]&255)<<8,this.pad[4]=u[24]&255|(u[25]&255)<<8,this.pad[5]=u[26]&255|(u[27]&255)<<8,this.pad[6]=u[28]&255|(u[29]&255)<<8,this.pad[7]=u[30]&255|(u[31]&255)<<8};de.prototype.blocks=function(u,l,d){for(var i=this.fin?0:2048,p,x,A,B,N,Y,L,Be,$,re,se,ge,he,ie,ue,ae,j,X,H,W=this.h[0],Q=this.h[1],q=this.h[2],_=this.h[3],v=this.h[4],P=this.h[5],U=this.h[6],C=this.h[7],k=this.h[8],ee=this.h[9],ye=this.r[0],xe=this.r[1],me=this.r[2],m=this.r[3],_e=this.r[4],Ce=this.r[5],Ie=this.r[6],we=this.r[7],Se=this.r[8],Ue=this.r[9];d>=16;)p=u[l+0]&255|(u[l+1]&255)<<8,W+=p&8191,x=u[l+2]&255|(u[l+3]&255)<<8,Q+=(p>>>13|x<<3)&8191,A=u[l+4]&255|(u[l+5]&255)<<8,q+=(x>>>10|A<<6)&8191,B=u[l+6]&255|(u[l+7]&255)<<8,_+=(A>>>7|B<<9)&8191,N=u[l+8]&255|(u[l+9]&255)<<8,v+=(B>>>4|N<<12)&8191,P+=N>>>1&8191,Y=u[l+10]&255|(u[l+11]&255)<<8,U+=(N>>>14|Y<<2)&8191,L=u[l+12]&255|(u[l+13]&255)<<8,C+=(Y>>>11|L<<5)&8191,Be=u[l+14]&255|(u[l+15]&255)<<8,k+=(L>>>8|Be<<8)&8191,ee+=Be>>>5|i,$=0,re=$,re+=W*ye,re+=Q*(5*Ue),re+=q*(5*Se),re+=_*(5*we),re+=v*(5*Ie),$=re>>>13,re&=8191,re+=P*(5*Ce),re+=U*(5*_e),re+=C*(5*m),re+=k*(5*me),re+=ee*(5*xe),$+=re>>>13,re&=8191,se=$,se+=W*xe,se+=Q*ye,se+=q*(5*Ue),se+=_*(5*Se),se+=v*(5*we),$=se>>>13,se&=8191,se+=P*(5*Ie),se+=U*(5*Ce),se+=C*(5*_e),se+=k*(5*m),se+=ee*(5*me),$+=se>>>13,se&=8191,ge=$,ge+=W*me,ge+=Q*xe,ge+=q*ye,ge+=_*(5*Ue),ge+=v*(5*Se),$=ge>>>13,ge&=8191,ge+=P*(5*we),ge+=U*(5*Ie),ge+=C*(5*Ce),ge+=k*(5*_e),ge+=ee*(5*m),$+=ge>>>13,ge&=8191,he=$,he+=W*m,he+=Q*me,he+=q*xe,he+=_*ye,he+=v*(5*Ue),$=he>>>13,he&=8191,he+=P*(5*Se),he+=U*(5*we),he+=C*(5*Ie),he+=k*(5*Ce),he+=ee*(5*_e),$+=he>>>13,he&=8191,ie=$,ie+=W*_e,ie+=Q*m,ie+=q*me,ie+=_*xe,ie+=v*ye,$=ie>>>13,ie&=8191,ie+=P*(5*Ue),ie+=U*(5*Se),ie+=C*(5*we),ie+=k*(5*Ie),ie+=ee*(5*Ce),$+=ie>>>13,ie&=8191,ue=$,ue+=W*Ce,ue+=Q*_e,ue+=q*m,ue+=_*me,ue+=v*xe,$=ue>>>13,ue&=8191,ue+=P*ye,ue+=U*(5*Ue),ue+=C*(5*Se),ue+=k*(5*we),ue+=ee*(5*Ie),$+=ue>>>13,ue&=8191,ae=$,ae+=W*Ie,ae+=Q*Ce,ae+=q*_e,ae+=_*m,ae+=v*me,$=ae>>>13,ae&=8191,ae+=P*xe,ae+=U*ye,ae+=C*(5*Ue),ae+=k*(5*Se),ae+=ee*(5*we),$+=ae>>>13,ae&=8191,j=$,j+=W*we,j+=Q*Ie,j+=q*Ce,j+=_*_e,j+=v*m,$=j>>>13,j&=8191,j+=P*me,j+=U*xe,j+=C*ye,j+=k*(5*Ue),j+=ee*(5*Se),$+=j>>>13,j&=8191,X=$,X+=W*Se,X+=Q*we,X+=q*Ie,X+=_*Ce,X+=v*_e,$=X>>>13,X&=8191,X+=P*m,X+=U*me,X+=C*xe,X+=k*ye,X+=ee*(5*Ue),$+=X>>>13,X&=8191,H=$,H+=W*Ue,H+=Q*Se,H+=q*we,H+=_*Ie,H+=v*Ce,$=H>>>13,H&=8191,H+=P*_e,H+=U*m,H+=C*me,H+=k*xe,H+=ee*ye,$+=H>>>13,H&=8191,$=($<<2)+$|0,$=$+re|0,re=$&8191,$=$>>>13,se+=$,W=re,Q=se,q=ge,_=he,v=ie,P=ue,U=ae,C=j,k=X,ee=H,l+=16,d-=16;this.h[0]=W,this.h[1]=Q,this.h[2]=q,this.h[3]=_,this.h[4]=v,this.h[5]=P,this.h[6]=U,this.h[7]=C,this.h[8]=k,this.h[9]=ee},de.prototype.finish=function(u,l){var d=new Uint16Array(10),i,p,x,A;if(this.leftover){for(A=this.leftover,this.buffer[A++]=1;A<16;A++)this.buffer[A]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(i=this.h[1]>>>13,this.h[1]&=8191,A=2;A<10;A++)this.h[A]+=i,i=this.h[A]>>>13,this.h[A]&=8191;for(this.h[0]+=i*5,i=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=i,i=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=i,d[0]=this.h[0]+5,i=d[0]>>>13,d[0]&=8191,A=1;A<10;A++)d[A]=this.h[A]+i,i=d[A]>>>13,d[A]&=8191;for(d[9]-=1<<13,p=(i^1)-1,A=0;A<10;A++)d[A]&=p;for(p=~p,A=0;A<10;A++)this.h[A]=this.h[A]&p|d[A];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,x=this.h[0]+this.pad[0],this.h[0]=x&65535,A=1;A<8;A++)x=(this.h[A]+this.pad[A]|0)+(x>>>16)|0,this.h[A]=x&65535;u[l+0]=this.h[0]>>>0&255,u[l+1]=this.h[0]>>>8&255,u[l+2]=this.h[1]>>>0&255,u[l+3]=this.h[1]>>>8&255,u[l+4]=this.h[2]>>>0&255,u[l+5]=this.h[2]>>>8&255,u[l+6]=this.h[3]>>>0&255,u[l+7]=this.h[3]>>>8&255,u[l+8]=this.h[4]>>>0&255,u[l+9]=this.h[4]>>>8&255,u[l+10]=this.h[5]>>>0&255,u[l+11]=this.h[5]>>>8&255,u[l+12]=this.h[6]>>>0&255,u[l+13]=this.h[6]>>>8&255,u[l+14]=this.h[7]>>>0&255,u[l+15]=this.h[7]>>>8&255},de.prototype.update=function(u,l,d){var i,p;if(this.leftover){for(p=16-this.leftover,p>d&&(p=d),i=0;i<p;i++)this.buffer[this.leftover+i]=u[l+i];if(d-=p,l+=p,this.leftover+=p,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(d>=16&&(p=d-d%16,this.blocks(u,l,p),l+=p,d-=p),d){for(i=0;i<d;i++)this.buffer[this.leftover+i]=u[l+i];this.leftover+=d}};function ce(u,l,d,i,p,x){var A=new de(x);return A.update(d,i,p),A.finish(u,l),0}function Pe(u,l,d,i,p,x){var A=new Uint8Array(16);return ce(A,0,d,i,p,x),T(u,l,A,0)}function Oe(u,l,d,i,p){var x;if(d<32)return-1;for(oe(u,0,l,0,d,i,p),ce(u,16,u,32,d-32,u),x=0;x<16;x++)u[x]=0;return 0}function at(u,l,d,i,p){var x,A=new Uint8Array(32);if(d<32||(G(A,0,32,i,p),Pe(l,16,l,32,d-32,A)!==0))return-1;for(oe(u,0,l,0,d,i,p),x=0;x<32;x++)u[x]=0;return 0}function z(u,l){var d;for(d=0;d<16;d++)u[d]=l[d]|0}function V(u){var l,d,i=1;for(l=0;l<16;l++)d=u[l]+i+65535,i=Math.floor(d/65536),u[l]=d-i*65536;u[0]+=i-1+37*(i-1)}function le(u,l,d){for(var i,p=~(d-1),x=0;x<16;x++)i=p&(u[x]^l[x]),u[x]^=i,l[x]^=i}function Re(u,l){var d,i,p,x=t(),A=t();for(d=0;d<16;d++)A[d]=l[d];for(V(A),V(A),V(A),i=0;i<2;i++){for(x[0]=A[0]-65517,d=1;d<15;d++)x[d]=A[d]-65535-(x[d-1]>>16&1),x[d-1]&=65535;x[15]=A[15]-32767-(x[14]>>16&1),p=x[15]>>16&1,x[14]&=65535,le(A,x,1-p)}for(d=0;d<16;d++)u[2*d]=A[d]&255,u[2*d+1]=A[d]>>8}function ke(u,l){var d=new Uint8Array(32),i=new Uint8Array(32);return Re(d,u),Re(i,l),S(d,0,i,0)}function Ze(u){var l=new Uint8Array(32);return Re(l,u),l[0]&1}function dt(u,l){var d;for(d=0;d<16;d++)u[d]=l[2*d]+(l[2*d+1]<<8);u[15]&=32767}function Me(u,l,d){for(var i=0;i<16;i++)u[i]=l[i]+d[i]}function rt(u,l,d){for(var i=0;i<16;i++)u[i]=l[i]-d[i]}function pe(u,l,d){var i,p,x=0,A=0,B=0,N=0,Y=0,L=0,Be=0,$=0,re=0,se=0,ge=0,he=0,ie=0,ue=0,ae=0,j=0,X=0,H=0,W=0,Q=0,q=0,_=0,v=0,P=0,U=0,C=0,k=0,ee=0,ye=0,xe=0,me=0,m=d[0],_e=d[1],Ce=d[2],Ie=d[3],we=d[4],Se=d[5],Ue=d[6],Je=d[7],ze=d[8],Ve=d[9],We=d[10],Qe=d[11],ot=d[12],lt=d[13],pt=d[14],ht=d[15];i=l[0],x+=i*m,A+=i*_e,B+=i*Ce,N+=i*Ie,Y+=i*we,L+=i*Se,Be+=i*Ue,$+=i*Je,re+=i*ze,se+=i*Ve,ge+=i*We,he+=i*Qe,ie+=i*ot,ue+=i*lt,ae+=i*pt,j+=i*ht,i=l[1],A+=i*m,B+=i*_e,N+=i*Ce,Y+=i*Ie,L+=i*we,Be+=i*Se,$+=i*Ue,re+=i*Je,se+=i*ze,ge+=i*Ve,he+=i*We,ie+=i*Qe,ue+=i*ot,ae+=i*lt,j+=i*pt,X+=i*ht,i=l[2],B+=i*m,N+=i*_e,Y+=i*Ce,L+=i*Ie,Be+=i*we,$+=i*Se,re+=i*Ue,se+=i*Je,ge+=i*ze,he+=i*Ve,ie+=i*We,ue+=i*Qe,ae+=i*ot,j+=i*lt,X+=i*pt,H+=i*ht,i=l[3],N+=i*m,Y+=i*_e,L+=i*Ce,Be+=i*Ie,$+=i*we,re+=i*Se,se+=i*Ue,ge+=i*Je,he+=i*ze,ie+=i*Ve,ue+=i*We,ae+=i*Qe,j+=i*ot,X+=i*lt,H+=i*pt,W+=i*ht,i=l[4],Y+=i*m,L+=i*_e,Be+=i*Ce,$+=i*Ie,re+=i*we,se+=i*Se,ge+=i*Ue,he+=i*Je,ie+=i*ze,ue+=i*Ve,ae+=i*We,j+=i*Qe,X+=i*ot,H+=i*lt,W+=i*pt,Q+=i*ht,i=l[5],L+=i*m,Be+=i*_e,$+=i*Ce,re+=i*Ie,se+=i*we,ge+=i*Se,he+=i*Ue,ie+=i*Je,ue+=i*ze,ae+=i*Ve,j+=i*We,X+=i*Qe,H+=i*ot,W+=i*lt,Q+=i*pt,q+=i*ht,i=l[6],Be+=i*m,$+=i*_e,re+=i*Ce,se+=i*Ie,ge+=i*we,he+=i*Se,ie+=i*Ue,ue+=i*Je,ae+=i*ze,j+=i*Ve,X+=i*We,H+=i*Qe,W+=i*ot,Q+=i*lt,q+=i*pt,_+=i*ht,i=l[7],$+=i*m,re+=i*_e,se+=i*Ce,ge+=i*Ie,he+=i*we,ie+=i*Se,ue+=i*Ue,ae+=i*Je,j+=i*ze,X+=i*Ve,H+=i*We,W+=i*Qe,Q+=i*ot,q+=i*lt,_+=i*pt,v+=i*ht,i=l[8],re+=i*m,se+=i*_e,ge+=i*Ce,he+=i*Ie,ie+=i*we,ue+=i*Se,ae+=i*Ue,j+=i*Je,X+=i*ze,H+=i*Ve,W+=i*We,Q+=i*Qe,q+=i*ot,_+=i*lt,v+=i*pt,P+=i*ht,i=l[9],se+=i*m,ge+=i*_e,he+=i*Ce,ie+=i*Ie,ue+=i*we,ae+=i*Se,j+=i*Ue,X+=i*Je,H+=i*ze,W+=i*Ve,Q+=i*We,q+=i*Qe,_+=i*ot,v+=i*lt,P+=i*pt,U+=i*ht,i=l[10],ge+=i*m,he+=i*_e,ie+=i*Ce,ue+=i*Ie,ae+=i*we,j+=i*Se,X+=i*Ue,H+=i*Je,W+=i*ze,Q+=i*Ve,q+=i*We,_+=i*Qe,v+=i*ot,P+=i*lt,U+=i*pt,C+=i*ht,i=l[11],he+=i*m,ie+=i*_e,ue+=i*Ce,ae+=i*Ie,j+=i*we,X+=i*Se,H+=i*Ue,W+=i*Je,Q+=i*ze,q+=i*Ve,_+=i*We,v+=i*Qe,P+=i*ot,U+=i*lt,C+=i*pt,k+=i*ht,i=l[12],ie+=i*m,ue+=i*_e,ae+=i*Ce,j+=i*Ie,X+=i*we,H+=i*Se,W+=i*Ue,Q+=i*Je,q+=i*ze,_+=i*Ve,v+=i*We,P+=i*Qe,U+=i*ot,C+=i*lt,k+=i*pt,ee+=i*ht,i=l[13],ue+=i*m,ae+=i*_e,j+=i*Ce,X+=i*Ie,H+=i*we,W+=i*Se,Q+=i*Ue,q+=i*Je,_+=i*ze,v+=i*Ve,P+=i*We,U+=i*Qe,C+=i*ot,k+=i*lt,ee+=i*pt,ye+=i*ht,i=l[14],ae+=i*m,j+=i*_e,X+=i*Ce,H+=i*Ie,W+=i*we,Q+=i*Se,q+=i*Ue,_+=i*Je,v+=i*ze,P+=i*Ve,U+=i*We,C+=i*Qe,k+=i*ot,ee+=i*lt,ye+=i*pt,xe+=i*ht,i=l[15],j+=i*m,X+=i*_e,H+=i*Ce,W+=i*Ie,Q+=i*we,q+=i*Se,_+=i*Ue,v+=i*Je,P+=i*ze,U+=i*Ve,C+=i*We,k+=i*Qe,ee+=i*ot,ye+=i*lt,xe+=i*pt,me+=i*ht,x+=38*X,A+=38*H,B+=38*W,N+=38*Q,Y+=38*q,L+=38*_,Be+=38*v,$+=38*P,re+=38*U,se+=38*C,ge+=38*k,he+=38*ee,ie+=38*ye,ue+=38*xe,ae+=38*me,p=1,i=x+p+65535,p=Math.floor(i/65536),x=i-p*65536,i=A+p+65535,p=Math.floor(i/65536),A=i-p*65536,i=B+p+65535,p=Math.floor(i/65536),B=i-p*65536,i=N+p+65535,p=Math.floor(i/65536),N=i-p*65536,i=Y+p+65535,p=Math.floor(i/65536),Y=i-p*65536,i=L+p+65535,p=Math.floor(i/65536),L=i-p*65536,i=Be+p+65535,p=Math.floor(i/65536),Be=i-p*65536,i=$+p+65535,p=Math.floor(i/65536),$=i-p*65536,i=re+p+65535,p=Math.floor(i/65536),re=i-p*65536,i=se+p+65535,p=Math.floor(i/65536),se=i-p*65536,i=ge+p+65535,p=Math.floor(i/65536),ge=i-p*65536,i=he+p+65535,p=Math.floor(i/65536),he=i-p*65536,i=ie+p+65535,p=Math.floor(i/65536),ie=i-p*65536,i=ue+p+65535,p=Math.floor(i/65536),ue=i-p*65536,i=ae+p+65535,p=Math.floor(i/65536),ae=i-p*65536,i=j+p+65535,p=Math.floor(i/65536),j=i-p*65536,x+=p-1+37*(p-1),p=1,i=x+p+65535,p=Math.floor(i/65536),x=i-p*65536,i=A+p+65535,p=Math.floor(i/65536),A=i-p*65536,i=B+p+65535,p=Math.floor(i/65536),B=i-p*65536,i=N+p+65535,p=Math.floor(i/65536),N=i-p*65536,i=Y+p+65535,p=Math.floor(i/65536),Y=i-p*65536,i=L+p+65535,p=Math.floor(i/65536),L=i-p*65536,i=Be+p+65535,p=Math.floor(i/65536),Be=i-p*65536,i=$+p+65535,p=Math.floor(i/65536),$=i-p*65536,i=re+p+65535,p=Math.floor(i/65536),re=i-p*65536,i=se+p+65535,p=Math.floor(i/65536),se=i-p*65536,i=ge+p+65535,p=Math.floor(i/65536),ge=i-p*65536,i=he+p+65535,p=Math.floor(i/65536),he=i-p*65536,i=ie+p+65535,p=Math.floor(i/65536),ie=i-p*65536,i=ue+p+65535,p=Math.floor(i/65536),ue=i-p*65536,i=ae+p+65535,p=Math.floor(i/65536),ae=i-p*65536,i=j+p+65535,p=Math.floor(i/65536),j=i-p*65536,x+=p-1+37*(p-1),u[0]=x,u[1]=A,u[2]=B,u[3]=N,u[4]=Y,u[5]=L,u[6]=Be,u[7]=$,u[8]=re,u[9]=se,u[10]=ge,u[11]=he,u[12]=ie,u[13]=ue,u[14]=ae,u[15]=j}function nt(u,l){pe(u,l,l)}function Yr(u,l){var d=t(),i;for(i=0;i<16;i++)d[i]=l[i];for(i=253;i>=0;i--)nt(d,d),i!==2&&i!==4&&pe(d,d,l);for(i=0;i<16;i++)u[i]=d[i]}function Vt(u,l){var d=t(),i;for(i=0;i<16;i++)d[i]=l[i];for(i=250;i>=0;i--)nt(d,d),i!==1&&pe(d,d,l);for(i=0;i<16;i++)u[i]=d[i]}function Xr(u,l,d){var i=new Uint8Array(32),p=new Float64Array(80),x,A,B=t(),N=t(),Y=t(),L=t(),Be=t(),$=t();for(A=0;A<31;A++)i[A]=l[A];for(i[31]=l[31]&127|64,i[0]&=248,dt(p,d),A=0;A<16;A++)N[A]=p[A],L[A]=B[A]=Y[A]=0;for(B[0]=L[0]=1,A=254;A>=0;--A)x=i[A>>>3]>>>(A&7)&1,le(B,N,x),le(Y,L,x),Me(Be,B,Y),rt(B,B,Y),Me(Y,N,L),rt(N,N,L),nt(L,Be),nt($,B),pe(B,Y,B),pe(Y,N,Be),Me(Be,B,Y),rt(B,B,Y),nt(N,B),rt(Y,L,$),pe(B,Y,c),Me(B,B,L),pe(Y,Y,B),pe(B,L,$),pe(L,N,p),nt(N,Be),le(B,N,x),le(Y,L,x);for(A=0;A<16;A++)p[A+16]=B[A],p[A+32]=Y[A],p[A+48]=N[A],p[A+64]=L[A];var re=p.subarray(32),se=p.subarray(16);return Yr(re,re),pe(se,se,re),Re(u,se),0}function Mt(u,l){return Xr(u,l,o)}function Tr(u,l){return e(l,32),Mt(u,l)}function Rn(u,l,d){var i=new Uint8Array(32);return Xr(i,d,l),K(u,n,i,D)}var It=Oe,Zr=at;function Jn(u,l,d,i,p,x){var A=new Uint8Array(32);return Rn(A,p,x),It(u,l,d,i,A)}function bs(u,l,d,i,p,x){var A=new Uint8Array(32);return Rn(A,p,x),Zr(u,l,d,i,A)}var Bo=[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 ru(u,l,d,i){for(var p=new Int32Array(16),x=new Int32Array(16),A,B,N,Y,L,Be,$,re,se,ge,he,ie,ue,ae,j,X,H,W,Q,q,_,v,P,U,C,k,ee=u[0],ye=u[1],xe=u[2],me=u[3],m=u[4],_e=u[5],Ce=u[6],Ie=u[7],we=l[0],Se=l[1],Ue=l[2],Je=l[3],ze=l[4],Ve=l[5],We=l[6],Qe=l[7],ot=0;i>=128;){for(Q=0;Q<16;Q++)q=8*Q+ot,p[Q]=d[q+0]<<24|d[q+1]<<16|d[q+2]<<8|d[q+3],x[Q]=d[q+4]<<24|d[q+5]<<16|d[q+6]<<8|d[q+7];for(Q=0;Q<80;Q++)if(A=ee,B=ye,N=xe,Y=me,L=m,Be=_e,$=Ce,re=Ie,se=we,ge=Se,he=Ue,ie=Je,ue=ze,ae=Ve,j=We,X=Qe,_=Ie,v=Qe,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=(m>>>14|ze<<32-14)^(m>>>18|ze<<32-18)^(ze>>>41-32|m<<32-(41-32)),v=(ze>>>14|m<<32-14)^(ze>>>18|m<<32-18)^(m>>>41-32|ze<<32-(41-32)),P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,_=m&_e^~m&Ce,v=ze&Ve^~ze&We,P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,_=Bo[Q*2],v=Bo[Q*2+1],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,_=p[Q%16],v=x[Q%16],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,H=C&65535|k<<16,W=P&65535|U<<16,_=H,v=W,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=(ee>>>28|we<<32-28)^(we>>>34-32|ee<<32-(34-32))^(we>>>39-32|ee<<32-(39-32)),v=(we>>>28|ee<<32-28)^(ee>>>34-32|we<<32-(34-32))^(ee>>>39-32|we<<32-(39-32)),P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,_=ee&ye^ee&xe^ye&xe,v=we&Se^we&Ue^Se&Ue,P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,re=C&65535|k<<16,X=P&65535|U<<16,_=Y,v=ie,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=H,v=W,P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,Y=C&65535|k<<16,ie=P&65535|U<<16,ye=A,xe=B,me=N,m=Y,_e=L,Ce=Be,Ie=$,ee=re,Se=se,Ue=ge,Je=he,ze=ie,Ve=ue,We=ae,Qe=j,we=X,Q%16===15)for(q=0;q<16;q++)_=p[q],v=x[q],P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=p[(q+9)%16],v=x[(q+9)%16],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,H=p[(q+1)%16],W=x[(q+1)%16],_=(H>>>1|W<<32-1)^(H>>>8|W<<32-8)^H>>>7,v=(W>>>1|H<<32-1)^(W>>>8|H<<32-8)^(W>>>7|H<<32-7),P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,H=p[(q+14)%16],W=x[(q+14)%16],_=(H>>>19|W<<32-19)^(W>>>61-32|H<<32-(61-32))^H>>>6,v=(W>>>19|H<<32-19)^(H>>>61-32|W<<32-(61-32))^(W>>>6|H<<32-6),P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,p[q]=C&65535|k<<16,x[q]=P&65535|U<<16;_=ee,v=we,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[0],v=l[0],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[0]=ee=C&65535|k<<16,l[0]=we=P&65535|U<<16,_=ye,v=Se,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[1],v=l[1],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[1]=ye=C&65535|k<<16,l[1]=Se=P&65535|U<<16,_=xe,v=Ue,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[2],v=l[2],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[2]=xe=C&65535|k<<16,l[2]=Ue=P&65535|U<<16,_=me,v=Je,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[3],v=l[3],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[3]=me=C&65535|k<<16,l[3]=Je=P&65535|U<<16,_=m,v=ze,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[4],v=l[4],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[4]=m=C&65535|k<<16,l[4]=ze=P&65535|U<<16,_=_e,v=Ve,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[5],v=l[5],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[5]=_e=C&65535|k<<16,l[5]=Ve=P&65535|U<<16,_=Ce,v=We,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[6],v=l[6],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[6]=Ce=C&65535|k<<16,l[6]=We=P&65535|U<<16,_=Ie,v=Qe,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[7],v=l[7],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[7]=Ie=C&65535|k<<16,l[7]=Qe=P&65535|U<<16,ot+=128,i-=128}return i}function Pn(u,l,d){var i=new Int32Array(8),p=new Int32Array(8),x=new Uint8Array(256),A,B=d;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,p[0]=4089235720,p[1]=2227873595,p[2]=4271175723,p[3]=1595750129,p[4]=2917565137,p[5]=725511199,p[6]=4215389547,p[7]=327033209,ru(i,p,l,d),d%=128,A=0;A<d;A++)x[A]=l[B-d+A];for(x[d]=128,d=256-128*(d<112?1:0),x[d-9]=0,b(x,d-8,B/536870912|0,B<<3),ru(i,p,x,d),A=0;A<8;A++)b(u,8*A,i[A],p[A]);return 0}function As(u,l){var d=t(),i=t(),p=t(),x=t(),A=t(),B=t(),N=t(),Y=t(),L=t();rt(d,u[1],u[0]),rt(L,l[1],l[0]),pe(d,d,L),Me(i,u[0],u[1]),Me(L,l[0],l[1]),pe(i,i,L),pe(p,u[3],l[3]),pe(p,p,h),pe(x,u[2],l[2]),Me(x,x,x),rt(A,i,d),rt(B,x,p),Me(N,x,p),Me(Y,i,d),pe(u[0],A,B),pe(u[1],Y,N),pe(u[2],N,B),pe(u[3],A,Y)}function nu(u,l,d){var i;for(i=0;i<4;i++)le(u[i],l[i],d)}function Gi(u,l){var d=t(),i=t(),p=t();Yr(p,l[2]),pe(d,l[0],p),pe(i,l[1],p),Re(u,i),u[31]^=Ze(d)<<7}function Fi(u,l,d){var i,p;for(z(u[0],s),z(u[1],a),z(u[2],a),z(u[3],s),p=255;p>=0;--p)i=d[p/8|0]>>(p&7)&1,nu(u,l,i),As(l,u),As(u,u),nu(u,l,i)}function ws(u,l){var d=[t(),t(),t(),t()];z(d[0],g),z(d[1],y),z(d[2],a),pe(d[3],g,y),Fi(u,d,l)}function $i(u,l,d){var i=new Uint8Array(64),p=[t(),t(),t(),t()],x;for(d||e(l,32),Pn(i,l,32),i[0]&=248,i[31]&=127,i[31]|=64,ws(p,i),Gi(u,p),x=0;x<32;x++)l[x+32]=u[x];return 0}var Ts=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 Ki(u,l){var d,i,p,x;for(i=63;i>=32;--i){for(d=0,p=i-32,x=i-12;p<x;++p)l[p]+=d-16*l[i]*Ts[p-(i-32)],d=Math.floor((l[p]+128)/256),l[p]-=d*256;l[p]+=d,l[i]=0}for(d=0,p=0;p<32;p++)l[p]+=d-(l[31]>>4)*Ts[p],d=l[p]>>8,l[p]&=255;for(p=0;p<32;p++)l[p]-=d*Ts[p];for(i=0;i<32;i++)l[i+1]+=l[i]>>8,u[i]=l[i]&255}function ji(u){var l=new Float64Array(64),d;for(d=0;d<64;d++)l[d]=u[d];for(d=0;d<64;d++)u[d]=0;Ki(u,l)}function ou(u,l,d,i){var p=new Uint8Array(64),x=new Uint8Array(64),A=new Uint8Array(64),B,N,Y=new Float64Array(64),L=[t(),t(),t(),t()];Pn(p,i,32),p[0]&=248,p[31]&=127,p[31]|=64;var Be=d+64;for(B=0;B<d;B++)u[64+B]=l[B];for(B=0;B<32;B++)u[32+B]=p[32+B];for(Pn(A,u.subarray(32),d+32),ji(A),ws(L,A),Gi(u,L),B=32;B<64;B++)u[B]=i[B];for(Pn(x,u,d+64),ji(x),B=0;B<64;B++)Y[B]=0;for(B=0;B<32;B++)Y[B]=A[B];for(B=0;B<32;B++)for(N=0;N<32;N++)Y[B+N]+=x[B]*p[N];return Ki(u.subarray(32),Y),Be}function $p(u,l){var d=t(),i=t(),p=t(),x=t(),A=t(),B=t(),N=t();return z(u[2],a),dt(u[1],l),nt(p,u[1]),pe(x,p,f),rt(p,p,u[2]),Me(x,u[2],x),nt(A,x),nt(B,A),pe(N,B,A),pe(d,N,p),pe(d,d,x),Vt(d,d),pe(d,d,p),pe(d,d,x),pe(d,d,x),pe(u[0],d,x),nt(i,u[0]),pe(i,i,x),ke(i,p)&&pe(u[0],u[0],w),nt(i,u[0]),pe(i,i,x),ke(i,p)?-1:(Ze(u[0])===l[31]>>7&&rt(u[0],s,u[0]),pe(u[3],u[0],u[1]),0)}function Vi(u,l,d,i){var p,x=new Uint8Array(32),A=new Uint8Array(64),B=[t(),t(),t(),t()],N=[t(),t(),t(),t()];if(d<64||$p(N,i))return-1;for(p=0;p<d;p++)u[p]=l[p];for(p=0;p<32;p++)u[p+32]=i[p];if(Pn(A,u,d),ji(A),Fi(B,N,A),ws(N,l.subarray(32)),As(B,N),Gi(x,B),d-=64,S(l,0,x,0)){for(p=0;p<d;p++)u[p]=0;return-1}for(p=0;p<d;p++)u[p]=l[p+64];return d}var Wi=32,_s=24,Co=32,eo=16,Io=32,vs=32,Ro=32,Po=32,Qi=32,su=_s,Kp=Co,jp=eo,_r=64,kn=32,to=64,Yi=32,Xi=64;r.lowlevel={crypto_core_hsalsa20:K,crypto_stream_xor:oe,crypto_stream:G,crypto_stream_salsa20_xor:F,crypto_stream_salsa20:J,crypto_onetimeauth:ce,crypto_onetimeauth_verify:Pe,crypto_verify_16:T,crypto_verify_32:S,crypto_secretbox:Oe,crypto_secretbox_open:at,crypto_scalarmult:Xr,crypto_scalarmult_base:Mt,crypto_box_beforenm:Rn,crypto_box_afternm:It,crypto_box:Jn,crypto_box_open:bs,crypto_box_keypair:Tr,crypto_hash:Pn,crypto_sign:ou,crypto_sign_keypair:$i,crypto_sign_open:Vi,crypto_secretbox_KEYBYTES:Wi,crypto_secretbox_NONCEBYTES:_s,crypto_secretbox_ZEROBYTES:Co,crypto_secretbox_BOXZEROBYTES:eo,crypto_scalarmult_BYTES:Io,crypto_scalarmult_SCALARBYTES:vs,crypto_box_PUBLICKEYBYTES:Ro,crypto_box_SECRETKEYBYTES:Po,crypto_box_BEFORENMBYTES:Qi,crypto_box_NONCEBYTES:su,crypto_box_ZEROBYTES:Kp,crypto_box_BOXZEROBYTES:jp,crypto_sign_BYTES:_r,crypto_sign_PUBLICKEYBYTES:kn,crypto_sign_SECRETKEYBYTES:to,crypto_sign_SEEDBYTES:Yi,crypto_hash_BYTES:Xi,gf:t,D:f,L:Ts,pack25519:Re,unpack25519:dt,M:pe,A:Me,S:nt,Z:rt,pow2523:Vt,add:As,set25519:z,modL:Ki,scalarmult:Fi,scalarbase:ws};function iu(u,l){if(u.length!==Wi)throw new Error("bad key size");if(l.length!==_s)throw new Error("bad nonce size")}function Vp(u,l){if(u.length!==Ro)throw new Error("bad public key size");if(l.length!==Po)throw new Error("bad secret key size")}function Rt(){for(var u=0;u<arguments.length;u++)if(!(arguments[u]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function au(u){for(var l=0;l<u.length;l++)u[l]=0}r.randomBytes=function(u){var l=new Uint8Array(u);return e(l,u),l},r.secretbox=function(u,l,d){Rt(u,l,d),iu(d,l);for(var i=new Uint8Array(Co+u.length),p=new Uint8Array(i.length),x=0;x<u.length;x++)i[x+Co]=u[x];return Oe(p,i,i.length,l,d),p.subarray(eo)},r.secretbox.open=function(u,l,d){Rt(u,l,d),iu(d,l);for(var i=new Uint8Array(eo+u.length),p=new Uint8Array(i.length),x=0;x<u.length;x++)i[x+eo]=u[x];return i.length<32||at(p,i,i.length,l,d)!==0?null:p.subarray(Co)},r.secretbox.keyLength=Wi,r.secretbox.nonceLength=_s,r.secretbox.overheadLength=eo,r.scalarMult=function(u,l){if(Rt(u,l),u.length!==vs)throw new Error("bad n size");if(l.length!==Io)throw new Error("bad p size");var d=new Uint8Array(Io);return Xr(d,u,l),d},r.scalarMult.base=function(u){if(Rt(u),u.length!==vs)throw new Error("bad n size");var l=new Uint8Array(Io);return Mt(l,u),l},r.scalarMult.scalarLength=vs,r.scalarMult.groupElementLength=Io,r.box=function(u,l,d,i){var p=r.box.before(d,i);return r.secretbox(u,l,p)},r.box.before=function(u,l){Rt(u,l),Vp(u,l);var d=new Uint8Array(Qi);return Rn(d,u,l),d},r.box.after=r.secretbox,r.box.open=function(u,l,d,i){var p=r.box.before(d,i);return r.secretbox.open(u,l,p)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var u=new Uint8Array(Ro),l=new Uint8Array(Po);return Tr(u,l),{publicKey:u,secretKey:l}},r.box.keyPair.fromSecretKey=function(u){if(Rt(u),u.length!==Po)throw new Error("bad secret key size");var l=new Uint8Array(Ro);return Mt(l,u),{publicKey:l,secretKey:new Uint8Array(u)}},r.box.publicKeyLength=Ro,r.box.secretKeyLength=Po,r.box.sharedKeyLength=Qi,r.box.nonceLength=su,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(u,l){if(Rt(u,l),l.length!==to)throw new Error("bad secret key size");var d=new Uint8Array(_r+u.length);return ou(d,u,u.length,l),d},r.sign.open=function(u,l){if(Rt(u,l),l.length!==kn)throw new Error("bad public key size");var d=new Uint8Array(u.length),i=Vi(d,u,u.length,l);if(i<0)return null;for(var p=new Uint8Array(i),x=0;x<p.length;x++)p[x]=d[x];return p},r.sign.detached=function(u,l){for(var d=r.sign(u,l),i=new Uint8Array(_r),p=0;p<i.length;p++)i[p]=d[p];return i},r.sign.detached.verify=function(u,l,d){if(Rt(u,l,d),l.length!==_r)throw new Error("bad signature size");if(d.length!==kn)throw new Error("bad public key size");var i=new Uint8Array(_r+u.length),p=new Uint8Array(_r+u.length),x;for(x=0;x<_r;x++)i[x]=l[x];for(x=0;x<u.length;x++)i[x+_r]=u[x];return Vi(p,i,i.length,d)>=0},r.sign.keyPair=function(){var u=new Uint8Array(kn),l=new Uint8Array(to);return $i(u,l),{publicKey:u,secretKey:l}},r.sign.keyPair.fromSecretKey=function(u){if(Rt(u),u.length!==to)throw new Error("bad secret key size");for(var l=new Uint8Array(kn),d=0;d<l.length;d++)l[d]=u[32+d];return{publicKey:l,secretKey:new Uint8Array(u)}},r.sign.keyPair.fromSeed=function(u){if(Rt(u),u.length!==Yi)throw new Error("bad seed size");for(var l=new Uint8Array(kn),d=new Uint8Array(to),i=0;i<32;i++)d[i]=u[i];return $i(l,d,!0),{publicKey:l,secretKey:d}},r.sign.publicKeyLength=kn,r.sign.secretKeyLength=to,r.sign.seedLength=Yi,r.sign.signatureLength=_r,r.hash=function(u){Rt(u);var l=new Uint8Array(Xi);return Pn(l,u,u.length),l},r.hash.hashLength=Xi,r.verify=function(u,l){return Rt(u,l),u.length===0||l.length===0||u.length!==l.length?!1:I(u,0,l,0,u.length)===0},r.setPRNG=function(u){e=u},function(){var u=typeof self<"u"?self.crypto||self.msCrypto:null;if(u&&u.getRandomValues){var l=65536;r.setPRNG(function(d,i){var p,x=new Uint8Array(i);for(p=0;p<i;p+=l)u.getRandomValues(x.subarray(p,p+Math.min(i-p,l)));for(p=0;p<i;p++)d[p]=x[p];au(x)})}else typeof uu<"u"&&(u=qu(),u&&u.randomBytes&&r.setPRNG(function(d,i){var p,x=u.randomBytes(i);for(p=0;p<i;p++)d[p]=x[p];au(x)}))}()})(typeof Ds<"u"&&Ds.exports?Ds.exports:self.nacl=self.nacl||{})});var Ho=fe(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.output=xt.exists=xt.hash=xt.bytes=xt.bool=xt.number=void 0;function Ls(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}xt.number=Ls;function Gu(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}xt.bool=Gu;function xa(r,...t){if(!(r instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(r.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${r.length}`)}xt.bytes=xa;function Fu(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ls(r.outputLen),Ls(r.blockLen)}xt.hash=Fu;function $u(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}xt.exists=$u;function Ku(r,t){xa(r);let e=t.outputLen;if(r.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}xt.output=Ku;var Gh={number:Ls,bool:Gu,bytes:xa,hash:Fu,exists:$u,output:Ku};xt.default=Gh});var ju=fe(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.crypto=void 0;Hs.crypto={node:void 0,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0}});var Hn=fe(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.randomBytes=Ee.wrapConstructorWithOpts=Ee.wrapConstructor=Ee.checkOpts=Ee.Hash=Ee.concatBytes=Ee.toBytes=Ee.utf8ToBytes=Ee.asyncLoop=Ee.nextTick=Ee.hexToBytes=Ee.bytesToHex=Ee.isLE=Ee.rotr=Ee.createView=Ee.u32=Ee.u8=void 0;var Gs=ju(),Fh=r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength);Ee.u8=Fh;var $h=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4));Ee.u32=$h;var Kh=r=>new DataView(r.buffer,r.byteOffset,r.byteLength);Ee.createView=Kh;var jh=(r,t)=>r<<32-t|r>>>t;Ee.rotr=jh;Ee.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Ee.isLE)throw new Error("Non little-endian hardware is not supported");var Vh=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function Wh(r){if(!(r instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=Vh[r[e]];return t}Ee.bytesToHex=Wh;function Qh(r){if(typeof r!="string")throw new TypeError("hexToBytes: expected string, got "+typeof r);if(r.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let t=new Uint8Array(r.length/2);for(let e=0;e<t.length;e++){let n=e*2,o=r.slice(n,n+2),s=Number.parseInt(o,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");t[e]=s}return t}Ee.hexToBytes=Qh;var Yh=async()=>{};Ee.nextTick=Yh;async function Xh(r,t,e){let n=Date.now();for(let o=0;o<r;o++){e(o);let s=Date.now()-n;s>=0&&s<t||(await(0,Ee.nextTick)(),n+=s)}}Ee.asyncLoop=Xh;function Vu(r){if(typeof r!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof r}`);return new TextEncoder().encode(r)}Ee.utf8ToBytes=Vu;function Aa(r){if(typeof r=="string"&&(r=Vu(r)),!(r instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof r})`);return r}Ee.toBytes=Aa;function Zh(...r){if(!r.every(n=>n instanceof Uint8Array))throw new Error("Uint8Array list expected");if(r.length===1)return r[0];let t=r.reduce((n,o)=>n+o.length,0),e=new Uint8Array(t);for(let n=0,o=0;n<r.length;n++){let s=r[n];e.set(s,o),o+=s.length}return e}Ee.concatBytes=Zh;var ba=class{clone(){return this._cloneInto()}};Ee.Hash=ba;var Jh=r=>Object.prototype.toString.call(r)==="[object Object]"&&r.constructor===Object;function e0(r,t){if(t!==void 0&&(typeof t!="object"||!Jh(t)))throw new TypeError("Options should be object or undefined");return Object.assign(r,t)}Ee.checkOpts=e0;function t0(r){let t=n=>r().update(Aa(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}Ee.wrapConstructor=t0;function r0(r){let t=(n,o)=>r(o).update(Aa(n)).digest(),e=r({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=n=>r(n),t}Ee.wrapConstructorWithOpts=r0;function n0(r=32){if(Gs.crypto.web)return Gs.crypto.web.getRandomValues(new Uint8Array(r));if(Gs.crypto.node)return new Uint8Array(Gs.crypto.node.randomBytes(r).buffer);throw new Error("The environment doesn't have randomBytes function")}Ee.randomBytes=n0});var Qu=fe(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.hmac=void 0;var Fs=Ho(),Wu=Hn(),$s=class extends Wu.Hash{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,Fs.default.hash(t);let n=(0,Wu.toBytes)(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=t.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),s.fill(0)}update(t){return Fs.default.exists(this),this.iHash.update(t),this}digestInto(t){Fs.default.exists(this),Fs.default.bytes(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:n,finished:o,destroyed:s,blockLen:a,outputLen:c}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=a,t.outputLen=c,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},o0=(r,t,e)=>new $s(r,t).update(e).digest();Go.hmac=o0;Go.hmac.create=(r,t)=>new $s(r,t)});var Zu=fe(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.pbkdf2Async=ao.pbkdf2=void 0;var Ks=Ho(),s0=Qu(),io=Hn();function Yu(r,t,e,n){Ks.default.hash(r);let o=(0,io.checkOpts)({dkLen:32,asyncTick:10},n),{c:s,dkLen:a,asyncTick:c}=o;if(Ks.default.number(s),Ks.default.number(a),Ks.default.number(c),s<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let f=(0,io.toBytes)(t),h=(0,io.toBytes)(e),g=new Uint8Array(a),y=s0.hmac.create(r,f),w=y._cloneInto().update(h);return{c:s,dkLen:a,asyncTick:c,DK:g,PRF:y,PRFSalt:w}}function Xu(r,t,e,n,o){return r.destroy(),t.destroy(),n&&n.destroy(),o.fill(0),e}function i0(r,t,e,n){let{c:o,dkLen:s,DK:a,PRF:c,PRFSalt:f}=Yu(r,t,e,n),h,g=new Uint8Array(4),y=(0,io.createView)(g),w=new Uint8Array(c.outputLen);for(let b=1,I=0;I<s;b++,I+=c.outputLen){let T=a.subarray(I,I+c.outputLen);y.setInt32(0,b,!1),(h=f._cloneInto(h)).update(g).digestInto(w),T.set(w.subarray(0,T.length));for(let S=1;S<o;S++){c._cloneInto(h).update(w).digestInto(w);for(let R=0;R<T.length;R++)T[R]^=w[R]}}return Xu(c,f,a,h,w)}ao.pbkdf2=i0;async function a0(r,t,e,n){let{c:o,dkLen:s,asyncTick:a,DK:c,PRF:f,PRFSalt:h}=Yu(r,t,e,n),g,y=new Uint8Array(4),w=(0,io.createView)(y),b=new Uint8Array(f.outputLen);for(let I=1,T=0;T<s;I++,T+=f.outputLen){let S=c.subarray(T,T+f.outputLen);w.setInt32(0,I,!1),(g=h._cloneInto(g)).update(y).digestInto(b),S.set(b.subarray(0,S.length)),await(0,io.asyncLoop)(o-1,a,R=>{f._cloneInto(g).update(b).digestInto(b);for(let M=0;M<S.length;M++)S[M]^=b[M]})}return Xu(f,h,c,g,b)}ao.pbkdf2Async=a0});var _a=fe(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.SHA2=void 0;var wa=Ho(),Fo=Hn();function c0(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let o=BigInt(32),s=BigInt(4294967295),a=Number(e>>o&s),c=Number(e&s),f=n?4:0,h=n?0:4;r.setUint32(t+f,a,n),r.setUint32(t+h,c,n)}var Ta=class extends Fo.Hash{constructor(t,e,n,o){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,Fo.createView)(this.buffer)}update(t){wa.default.exists(this);let{view:e,buffer:n,blockLen:o}=this;t=(0,Fo.toBytes)(t);let s=t.length;for(let a=0;a<s;){let c=Math.min(o-this.pos,s-a);if(c===o){let f=(0,Fo.createView)(t);for(;o<=s-a;a+=o)this.process(f,a);continue}n.set(t.subarray(a,a+c),this.pos),this.pos+=c,a+=c,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){wa.default.exists(this),wa.default.output(t,this),this.finished=!0;let{buffer:e,view:n,blockLen:o,isLE:s}=this,{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let f=a;f<o;f++)e[f]=0;c0(n,o-8,BigInt(this.length*8),s),this.process(n,0);let c=(0,Fo.createView)(t);this.get().forEach((f,h)=>c.setUint32(4*h,f,s))}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:n,length:o,finished:s,destroyed:a,pos:c}=this;return t.length=o,t.pos=c,t.finished=s,t.destroyed=a,o%e&&t.buffer.set(n),t}};js.SHA2=Ta});var Ju=fe(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.sha256=void 0;var u0=_a(),Yt=Hn(),f0=(r,t,e)=>r&t^~r&e,d0=(r,t,e)=>r&t^r&e^t&e,l0=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),sn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),an=new Uint32Array(64),va=class extends u0.SHA2{constructor(){super(64,32,8,!1),this.A=sn[0]|0,this.B=sn[1]|0,this.C=sn[2]|0,this.D=sn[3]|0,this.E=sn[4]|0,this.F=sn[5]|0,this.G=sn[6]|0,this.H=sn[7]|0}get(){let{A:t,B:e,C:n,D:o,E:s,F:a,G:c,H:f}=this;return[t,e,n,o,s,a,c,f]}set(t,e,n,o,s,a,c,f){this.A=t|0,this.B=e|0,this.C=n|0,this.D=o|0,this.E=s|0,this.F=a|0,this.G=c|0,this.H=f|0}process(t,e){for(let y=0;y<16;y++,e+=4)an[y]=t.getUint32(e,!1);for(let y=16;y<64;y++){let w=an[y-15],b=an[y-2],I=(0,Yt.rotr)(w,7)^(0,Yt.rotr)(w,18)^w>>>3,T=(0,Yt.rotr)(b,17)^(0,Yt.rotr)(b,19)^b>>>10;an[y]=T+an[y-7]+I+an[y-16]|0}let{A:n,B:o,C:s,D:a,E:c,F:f,G:h,H:g}=this;for(let y=0;y<64;y++){let w=(0,Yt.rotr)(c,6)^(0,Yt.rotr)(c,11)^(0,Yt.rotr)(c,25),b=g+w+f0(c,f,h)+l0[y]+an[y]|0,T=((0,Yt.rotr)(n,2)^(0,Yt.rotr)(n,13)^(0,Yt.rotr)(n,22))+d0(n,o,s)|0;g=h,h=f,f=c,c=a+b|0,a=s,s=o,o=n,n=b+T|0}n=n+this.A|0,o=o+this.B|0,s=s+this.C|0,a=a+this.D|0,c=c+this.E|0,f=f+this.F|0,h=h+this.G|0,g=g+this.H|0,this.set(n,o,s,a,c,f,h,g)}roundClean(){an.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};Vs.sha256=(0,Yt.wrapConstructor)(()=>new va)});var rf=fe(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.add=qt.toBig=qt.split=qt.fromBig=void 0;var Ws=BigInt(2**32-1),Ea=BigInt(32);function Sa(r,t=!1){return t?{h:Number(r&Ws),l:Number(r>>Ea&Ws)}:{h:Number(r>>Ea&Ws)|0,l:Number(r&Ws)|0}}qt.fromBig=Sa;function ef(r,t=!1){let e=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o<r.length;o++){let{h:s,l:a}=Sa(r[o],t);[e[o],n[o]]=[s,a]}return[e,n]}qt.split=ef;var p0=(r,t)=>BigInt(r>>>0)<<Ea|BigInt(t>>>0);qt.toBig=p0;var h0=(r,t,e)=>r>>>e,g0=(r,t,e)=>r<<32-e|t>>>e,y0=(r,t,e)=>r>>>e|t<<32-e,m0=(r,t,e)=>r<<32-e|t>>>e,x0=(r,t,e)=>r<<64-e|t>>>e-32,b0=(r,t,e)=>r>>>e-32|t<<64-e,A0=(r,t)=>t,w0=(r,t)=>r,T0=(r,t,e)=>r<<e|t>>>32-e,_0=(r,t,e)=>t<<e|r>>>32-e,v0=(r,t,e)=>t<<e-32|r>>>64-e,E0=(r,t,e)=>r<<e-32|t>>>64-e;function tf(r,t,e,n){let o=(t>>>0)+(n>>>0);return{h:r+e+(o/2**32|0)|0,l:o|0}}qt.add=tf;var S0=(r,t,e)=>(r>>>0)+(t>>>0)+(e>>>0),U0=(r,t,e,n)=>t+e+n+(r/2**32|0)|0,B0=(r,t,e,n)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0),C0=(r,t,e,n,o)=>t+e+n+o+(r/2**32|0)|0,I0=(r,t,e,n,o)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0)+(o>>>0),R0=(r,t,e,n,o,s)=>t+e+n+o+s+(r/2**32|0)|0,P0={fromBig:Sa,split:ef,toBig:qt.toBig,shrSH:h0,shrSL:g0,rotrSH:y0,rotrSL:m0,rotrBH:x0,rotrBL:b0,rotr32H:A0,rotr32L:w0,rotlSH:T0,rotlSL:_0,rotlBH:v0,rotlBL:E0,add:tf,add3L:S0,add3H:U0,add4L:B0,add4H:C0,add5H:R0,add5L:I0};qt.default=P0});var nf=fe(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.sha384=fr.sha512_256=fr.sha512=fr.SHA512=void 0;var k0=_a(),Te=rf(),Ca=Hn(),[O0,z0]=Te.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),cn=new Uint32Array(80),un=new Uint32Array(80),co=class extends k0.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:n,Bl:o,Ch:s,Cl:a,Dh:c,Dl:f,Eh:h,El:g,Fh:y,Fl:w,Gh:b,Gl:I,Hh:T,Hl:S}=this;return[t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S]}set(t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S){this.Ah=t|0,this.Al=e|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=a|0,this.Dh=c|0,this.Dl=f|0,this.Eh=h|0,this.El=g|0,this.Fh=y|0,this.Fl=w|0,this.Gh=b|0,this.Gl=I|0,this.Hh=T|0,this.Hl=S|0}process(t,e){for(let E=0;E<16;E++,e+=4)cn[E]=t.getUint32(e),un[E]=t.getUint32(e+=4);for(let E=16;E<80;E++){let K=cn[E-15]|0,D=un[E-15]|0,F=Te.default.rotrSH(K,D,1)^Te.default.rotrSH(K,D,8)^Te.default.shrSH(K,D,7),J=Te.default.rotrSL(K,D,1)^Te.default.rotrSL(K,D,8)^Te.default.shrSL(K,D,7),G=cn[E-2]|0,oe=un[E-2]|0,de=Te.default.rotrSH(G,oe,19)^Te.default.rotrBH(G,oe,61)^Te.default.shrSH(G,oe,6),ce=Te.default.rotrSL(G,oe,19)^Te.default.rotrBL(G,oe,61)^Te.default.shrSL(G,oe,6),Pe=Te.default.add4L(J,ce,un[E-7],un[E-16]),Oe=Te.default.add4H(Pe,F,de,cn[E-7],cn[E-16]);cn[E]=Oe|0,un[E]=Pe|0}let{Ah:n,Al:o,Bh:s,Bl:a,Ch:c,Cl:f,Dh:h,Dl:g,Eh:y,El:w,Fh:b,Fl:I,Gh:T,Gl:S,Hh:R,Hl:M}=this;for(let E=0;E<80;E++){let K=Te.default.rotrSH(y,w,14)^Te.default.rotrSH(y,w,18)^Te.default.rotrBH(y,w,41),D=Te.default.rotrSL(y,w,14)^Te.default.rotrSL(y,w,18)^Te.default.rotrBL(y,w,41),F=y&b^~y&T,J=w&I^~w&S,G=Te.default.add5L(M,D,J,z0[E],un[E]),oe=Te.default.add5H(G,R,K,F,O0[E],cn[E]),de=G|0,ce=Te.default.rotrSH(n,o,28)^Te.default.rotrBH(n,o,34)^Te.default.rotrBH(n,o,39),Pe=Te.default.rotrSL(n,o,28)^Te.default.rotrBL(n,o,34)^Te.default.rotrBL(n,o,39),Oe=n&s^n&c^s&c,at=o&a^o&f^a&f;R=T|0,M=S|0,T=b|0,S=I|0,b=y|0,I=w|0,{h:y,l:w}=Te.default.add(h|0,g|0,oe|0,de|0),h=c|0,g=f|0,c=s|0,f=a|0,s=n|0,a=o|0;let z=Te.default.add3L(de,Pe,at);n=Te.default.add3H(z,oe,ce,Oe),o=z|0}({h:n,l:o}=Te.default.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:a}=Te.default.add(this.Bh|0,this.Bl|0,s|0,a|0),{h:c,l:f}=Te.default.add(this.Ch|0,this.Cl|0,c|0,f|0),{h,l:g}=Te.default.add(this.Dh|0,this.Dl|0,h|0,g|0),{h:y,l:w}=Te.default.add(this.Eh|0,this.El|0,y|0,w|0),{h:b,l:I}=Te.default.add(this.Fh|0,this.Fl|0,b|0,I|0),{h:T,l:S}=Te.default.add(this.Gh|0,this.Gl|0,T|0,S|0),{h:R,l:M}=Te.default.add(this.Hh|0,this.Hl|0,R|0,M|0),this.set(n,o,s,a,c,f,h,g,y,w,b,I,T,S,R,M)}roundClean(){cn.fill(0),un.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};fr.SHA512=co;var Ua=class extends co{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},Ba=class extends co{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}};fr.sha512=(0,Ca.wrapConstructor)(()=>new co);fr.sha512_256=(0,Ca.wrapConstructor)(()=>new Ua);fr.sha384=(0,Ca.wrapConstructor)(()=>new Ba)});var yf=fe(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.bytes=Z.stringToBytes=Z.str=Z.bytesToString=Z.hex=Z.utf8=Z.bech32m=Z.bech32=Z.base58check=Z.base58xmr=Z.base58xrp=Z.base58flickr=Z.base58=Z.base64url=Z.base64=Z.base32crockford=Z.base32hex=Z.base32=Z.base16=Z.utils=Z.assertNumber=void 0;function fn(r){if(!Number.isSafeInteger(r))throw new Error(`Wrong integer: ${r}`)}Z.assertNumber=fn;function Xt(...r){let t=(o,s)=>a=>o(s(a)),e=Array.from(r).reverse().reduce((o,s)=>o?t(o,s.encode):s.encode,void 0),n=r.reduce((o,s)=>o?t(o,s.decode):s.decode,void 0);return{encode:e,decode:n}}function dr(r){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(e=>{if(fn(e),e<0||e>=r.length)throw new Error(`Digit index outside alphabet: ${e} (alphabet: ${r.length})`);return r[e]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(e=>{if(typeof e!="string")throw new Error(`alphabet.decode: not string element=${e}`);let n=r.indexOf(e);if(n===-1)throw new Error(`Unknown letter: "${e}". Allowed: ${r}`);return n})}}}function lr(r=""){if(typeof r!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let e of t)if(typeof e!="string")throw new Error(`join.encode: non-string input=${e}`);return t.join(r)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(r)}}}function jo(r,t="="){if(fn(r),typeof t!="string")throw new Error("padding chr should be string");return{encode(e){if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("padding.encode input should be array of strings");for(let n of e)if(typeof n!="string")throw new Error(`padding.encode: non-string input=${n}`);for(;e.length*r%8;)e.push(t);return e},decode(e){if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("padding.encode input should be array of strings");for(let o of e)if(typeof o!="string")throw new Error(`padding.decode: non-string input=${o}`);let n=e.length;if(n*r%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&e[n-1]===t;n--)if(!((n-1)*r%8))throw new Error("Invalid padding: string has too much padding");return e.slice(0,n)}}}function ff(r){if(typeof r!="function")throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>r(t)}}function of(r,t,e){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(e<2)throw new Error(`convertRadix: wrong to=${e}, base cannot be less than 2`);if(!Array.isArray(r))throw new Error("convertRadix: data should be array");if(!r.length)return[];let n=0,o=[],s=Array.from(r);for(s.forEach(a=>{if(fn(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,c=!0;for(let f=n;f<s.length;f++){let h=s[f],g=t*a+h;if(!Number.isSafeInteger(g)||t*a/t!==a||g-h!==t*a)throw new Error("convertRadix: carry overflow");if(a=g%e,s[f]=Math.floor(g/e),!Number.isSafeInteger(s[f])||s[f]*e+a!==g)throw new Error("convertRadix: carry overflow");if(c)s[f]?c=!1:n=f;else continue}if(o.push(a),c)break}for(let a=0;a<r.length-1&&r[a]===0;a++)o.push(0);return o.reverse()}var df=(r,t)=>t?df(t,r%t):r,Qs=(r,t)=>r+(t-df(r,t));function Ia(r,t,e,n){if(!Array.isArray(r))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(e<=0||e>32)throw new Error(`convertRadix2: wrong to=${e}`);if(Qs(t,e)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${e} carryBits=${Qs(t,e)}`);let o=0,s=0,a=2**e-1,c=[];for(let f of r){if(fn(f),f>=2**t)throw new Error(`convertRadix2: invalid data word=${f} from=${t}`);if(o=o<<t|f,s+t>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=e;s-=e)c.push((o>>s-e&a)>>>0);o&=2**s-1}if(o=o<<e-s&a,!n&&s>=t)throw new Error("Excess padding");if(!n&&o)throw new Error(`Non-zero padding: ${o}`);return n&&s>0&&c.push(o>>>0),c}function lf(r){return fn(r),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return of(Array.from(t),2**8,r)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(of(t,r,2**8))}}}function Sr(r,t=!1){if(fn(r),r<=0||r>32)throw new Error("radix2: bits should be in (0..32]");if(Qs(8,r)>32||Qs(r,8)>32)throw new Error("radix2: carry overflow");return{encode:e=>{if(!(e instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return Ia(Array.from(e),8,r,!t)},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(Ia(e,r,8,t))}}}function sf(r){if(typeof r!="function")throw new Error("unsafeWrapper fn should be function");return function(...t){try{return r.apply(null,t)}catch{}}}function pf(r,t){if(fn(r),typeof t!="function")throw new Error("checksum fn should be function");return{encode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");let n=t(e).slice(0,r),o=new Uint8Array(e.length+r);return o.set(e),o.set(n,e.length),o},decode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");let n=e.slice(0,-r),o=t(n).slice(0,r),s=e.slice(-r);for(let a=0;a<r;a++)if(o[a]!==s[a])throw new Error("Invalid checksum");return n}}}Z.utils={alphabet:dr,chain:Xt,checksum:pf,radix:lf,radix2:Sr,join:lr,padding:jo};Z.base16=Xt(Sr(4),dr("0123456789ABCDEF"),lr(""));Z.base32=Xt(Sr(5),dr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),jo(5),lr(""));Z.base32hex=Xt(Sr(5),dr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),jo(5),lr(""));Z.base32crockford=Xt(Sr(5),dr("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),lr(""),ff(r=>r.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));Z.base64=Xt(Sr(6),dr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),jo(6),lr(""));Z.base64url=Xt(Sr(6),dr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),jo(6),lr(""));var Pa=r=>Xt(lf(58),dr(r),lr(""));Z.base58=Pa("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");Z.base58flickr=Pa("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");Z.base58xrp=Pa("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");var af=[0,2,3,5,6,7,9,10,11];Z.base58xmr={encode(r){let t="";for(let e=0;e<r.length;e+=8){let n=r.subarray(e,e+8);t+=Z.base58.encode(n).padStart(af[n.length],"1")}return t},decode(r){let t=[];for(let e=0;e<r.length;e+=11){let n=r.slice(e,e+11),o=af.indexOf(n.length),s=Z.base58.decode(n);for(let a=0;a<s.length-o;a++)if(s[a]!==0)throw new Error("base58xmr: wrong padding");t=t.concat(Array.from(s.slice(s.length-o)))}return Uint8Array.from(t)}};var N0=r=>Xt(pf(4,t=>r(r(t))),Z.base58);Z.base58check=N0;var Ra=Xt(dr("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),lr("")),cf=[996825010,642813549,513874426,1027748829,705979059];function $o(r){let t=r>>25,e=(r&33554431)<<5;for(let n=0;n<cf.length;n++)(t>>n&1)===1&&(e^=cf[n]);return e}function uf(r,t,e=1){let n=r.length,o=1;for(let s=0;s<n;s++){let a=r.charCodeAt(s);if(a<33||a>126)throw new Error(`Invalid prefix (${r})`);o=$o(o)^a>>5}o=$o(o);for(let s=0;s<n;s++)o=$o(o)^r.charCodeAt(s)&31;for(let s of t)o=$o(o)^s;for(let s=0;s<6;s++)o=$o(o);return o^=e,Ra.encode(Ia([o%2**30],30,5,!1))}function hf(r){let t=r==="bech32"?1:734539939,e=Sr(5),n=e.decode,o=e.encode,s=sf(n);function a(g,y,w=90){if(typeof g!="string")throw new Error(`bech32.encode prefix should be string, not ${typeof g}`);if(!Array.isArray(y)||y.length&&typeof y[0]!="number")throw new Error(`bech32.encode words should be array of numbers, not ${typeof y}`);let b=g.length+7+y.length;if(w!==!1&&b>w)throw new TypeError(`Length ${b} exceeds limit ${w}`);return g=g.toLowerCase(),`${g}1${Ra.encode(y)}${uf(g,y,t)}`}function c(g,y=90){if(typeof g!="string")throw new Error(`bech32.decode input should be string, not ${typeof g}`);if(g.length<8||y!==!1&&g.length>y)throw new TypeError(`Wrong string length: ${g.length} (${g}). Expected (8..${y})`);let w=g.toLowerCase();if(g!==w&&g!==g.toUpperCase())throw new Error("String must be lowercase or uppercase");g=w;let b=g.lastIndexOf("1");if(b===0||b===-1)throw new Error('Letter "1" must be present between prefix and data only');let I=g.slice(0,b),T=g.slice(b+1);if(T.length<6)throw new Error("Data must be at least 6 characters long");let S=Ra.decode(T).slice(0,-6),R=uf(I,S,t);if(!T.endsWith(R))throw new Error(`Invalid checksum in ${g}: expected "${R}"`);return{prefix:I,words:S}}let f=sf(c);function h(g){let{prefix:y,words:w}=c(g,!1);return{prefix:y,words:w,bytes:n(w)}}return{encode:a,decode:c,decodeToBytes:h,decodeUnsafe:f,fromWords:n,fromWordsUnsafe:s,toWords:o}}Z.bech32=hf("bech32");Z.bech32m=hf("bech32m");Z.utf8={encode:r=>new TextDecoder().decode(r),decode:r=>new TextEncoder().encode(r)};Z.hex=Xt(Sr(4),dr("0123456789abcdef"),lr(""),ff(r=>{if(typeof r!="string"||r.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof r} with length ${r.length}`);return r.toLowerCase()}));var Ko={utf8:Z.utf8,hex:Z.hex,base16:Z.base16,base32:Z.base32,base64:Z.base64,base64url:Z.base64url,base58:Z.base58,base58xmr:Z.base58xmr},gf=`Invalid encoding type. Available types: ${Object.keys(Ko).join(", ")}`,D0=(r,t)=>{if(typeof r!="string"||!Ko.hasOwnProperty(r))throw new TypeError(gf);if(!(t instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return Ko[r].encode(t)};Z.bytesToString=D0;Z.str=Z.bytesToString;var M0=(r,t)=>{if(!Ko.hasOwnProperty(r))throw new TypeError(gf);if(typeof t!="string")throw new TypeError("stringToBytes() expects string");return Ko[r].decode(t)};Z.stringToBytes=M0;Z.bytes=Z.stringToBytes});var Sf=fe(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.mnemonicToSeedSync=vt.mnemonicToSeed=vt.validateMnemonic=vt.entropyToMnemonic=vt.mnemonicToEntropy=vt.generateMnemonic=void 0;var mf=Ho(),xf=Zu(),q0=Ju(),bf=nf(),L0=Hn(),Ys=yf(),H0=r=>r[0]==="\u3042\u3044\u3053\u304F\u3057\u3093";function Af(r){if(typeof r!="string")throw new TypeError(`Invalid mnemonic type: ${typeof r}`);return r.normalize("NFKD")}function ka(r){let t=Af(r),e=t.split(" ");if(![12,15,18,21,24].includes(e.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:e}}function wf(r){mf.default.bytes(r,16,20,24,28,32)}function G0(r,t=128){if(mf.default.number(t),t%32!==0||t>256)throw new TypeError("Invalid entropy");return vf((0,L0.randomBytes)(t/8),r)}vt.generateMnemonic=G0;var F0=r=>{let t=8-r.length/4;return new Uint8Array([(0,q0.sha256)(r)[0]>>t<<t])};function Tf(r){if(!Array.isArray(r)||r.length!==2**11||typeof r[0]!="string")throw new Error("Worlist: expected array of 2048 strings");return r.forEach(t=>{if(typeof t!="string")throw new Error(`Wordlist: non-string element: ${t}`)}),Ys.utils.chain(Ys.utils.checksum(1,F0),Ys.utils.radix2(11,!0),Ys.utils.alphabet(r))}function _f(r,t){let{words:e}=ka(r),n=Tf(t).decode(e);return wf(n),n}vt.mnemonicToEntropy=_f;function vf(r,t){return wf(r),Tf(t).encode(r).join(H0(t)?"\u3000":" ")}vt.entropyToMnemonic=vf;function $0(r,t){try{_f(r,t)}catch{return!1}return!0}vt.validateMnemonic=$0;var Ef=r=>Af(`mnemonic${r}`);function K0(r,t=""){return(0,xf.pbkdf2Async)(bf.sha512,ka(r).nfkd,Ef(t),{c:2048,dkLen:64})}vt.mnemonicToSeed=K0;function j0(r,t=""){return(0,xf.pbkdf2)(bf.sha512,ka(r).nfkd,Ef(t),{c:2048,dkLen:64})}vt.mnemonicToSeedSync=j0});var hc=fe((Qw,$d)=>{"use strict";$d.exports=function(t,e){return function(){for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];return t.apply(e,o)}}});var ut=fe((Yw,Vd)=>{"use strict";var hy=hc(),yc=Object.prototype.toString,mc=function(r){return function(t){var e=yc.call(t);return r[e]||(r[e]=e.slice(8,-1).toLowerCase())}}(Object.create(null));function Qn(r){return r=r.toLowerCase(),function(e){return mc(e)===r}}function xc(r){return Array.isArray(r)}function bi(r){return typeof r>"u"}function gy(r){return r!==null&&!bi(r)&&r.constructor!==null&&!bi(r.constructor)&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}var Kd=Qn("ArrayBuffer");function yy(r){var t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(r):t=r&&r.buffer&&Kd(r.buffer),t}function my(r){return typeof r=="string"}function xy(r){return typeof r=="number"}function jd(r){return r!==null&&typeof r=="object"}function xi(r){if(mc(r)!=="object")return!1;var t=Object.getPrototypeOf(r);return t===null||t===Object.prototype}var by=Qn("Date"),Ay=Qn("File"),wy=Qn("Blob"),Ty=Qn("FileList");function bc(r){return yc.call(r)==="[object Function]"}function _y(r){return jd(r)&&bc(r.pipe)}function vy(r){var t="[object FormData]";return r&&(typeof FormData=="function"&&r instanceof FormData||yc.call(r)===t||bc(r.toString)&&r.toString()===t)}var Ey=Qn("URLSearchParams");function Sy(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function Uy(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function Ac(r,t){if(!(r===null||typeof r>"u"))if(typeof r!="object"&&(r=[r]),xc(r))for(var e=0,n=r.length;e<n;e++)t.call(null,r[e],e,r);else for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&t.call(null,r[o],o,r)}function gc(){var r={};function t(o,s){xi(r[s])&&xi(o)?r[s]=gc(r[s],o):xi(o)?r[s]=gc({},o):xc(o)?r[s]=o.slice():r[s]=o}for(var e=0,n=arguments.length;e<n;e++)Ac(arguments[e],t);return r}function By(r,t,e){return Ac(t,function(o,s){e&&typeof o=="function"?r[s]=hy(o,e):r[s]=o}),r}function Cy(r){return r.charCodeAt(0)===65279&&(r=r.slice(1)),r}function Iy(r,t,e,n){r.prototype=Object.create(t.prototype,n),r.prototype.constructor=r,e&&Object.assign(r.prototype,e)}function Ry(r,t,e){var n,o,s,a={};t=t||{};do{for(n=Object.getOwnPropertyNames(r),o=n.length;o-- >0;)s=n[o],a[s]||(t[s]=r[s],a[s]=!0);r=Object.getPrototypeOf(r)}while(r&&(!e||e(r,t))&&r!==Object.prototype);return t}function Py(r,t,e){r=String(r),(e===void 0||e>r.length)&&(e=r.length),e-=t.length;var n=r.indexOf(t,e);return n!==-1&&n===e}function ky(r){if(!r)return null;var t=r.length;if(bi(t))return null;for(var e=new Array(t);t-- >0;)e[t]=r[t];return e}var Oy=function(r){return function(t){return r&&t instanceof r}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array));Vd.exports={isArray:xc,isArrayBuffer:Kd,isBuffer:gy,isFormData:vy,isArrayBufferView:yy,isString:my,isNumber:xy,isObject:jd,isPlainObject:xi,isUndefined:bi,isDate:by,isFile:Ay,isBlob:wy,isFunction:bc,isStream:_y,isURLSearchParams:Ey,isStandardBrowserEnv:Uy,forEach:Ac,merge:gc,extend:By,trim:Sy,stripBOM:Cy,inherits:Iy,toFlatObject:Ry,kindOf:mc,kindOfTest:Qn,endsWith:Py,toArray:ky,isTypedArray:Oy,isFileList:Ty}});var wc=fe((Xw,Qd)=>{"use strict";var Ao=ut();function Wd(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}Qd.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(Ao.isURLSearchParams(e))o=e.toString();else{var s=[];Ao.forEach(e,function(f,h){f===null||typeof f>"u"||(Ao.isArray(f)?h=h+"[]":f=[f],Ao.forEach(f,function(y){Ao.isDate(y)?y=y.toISOString():Ao.isObject(y)&&(y=JSON.stringify(y)),s.push(Wd(h)+"="+Wd(y))}))}),o=s.join("&")}if(o){var a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}});var Xd=fe((Zw,Yd)=>{"use strict";var zy=ut();function Ai(){this.handlers=[]}Ai.prototype.use=function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};Ai.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)};Ai.prototype.forEach=function(t){zy.forEach(this.handlers,function(n){n!==null&&t(n)})};Yd.exports=Ai});var Jd=fe((Jw,Zd)=>{"use strict";var Ny=ut();Zd.exports=function(t,e){Ny.forEach(t,function(o,s){s!==e&&s.toUpperCase()===e.toUpperCase()&&(t[e]=o,delete t[s])})}});var Yn=fe((e2,nl)=>{"use strict";var el=ut();function wo(r,t,e,n,o){Error.call(this),this.message=r,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),n&&(this.request=n),o&&(this.response=o)}el.inherits(wo,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var tl=wo.prototype,rl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(r){rl[r]={value:r}});Object.defineProperties(wo,rl);Object.defineProperty(tl,"isAxiosError",{value:!0});wo.from=function(r,t,e,n,o,s){var a=Object.create(tl);return el.toFlatObject(r,a,function(f){return f!==Error.prototype}),wo.call(a,r.message,t,e,n,o),a.name=r.name,s&&Object.assign(a,s),a};nl.exports=wo});var Tc=fe((t2,ol)=>{"use strict";ol.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}});var _c=fe((r2,sl)=>{"use strict";var tr=ut();function Dy(r,t){t=t||new FormData;var e=[];function n(s){return s===null?"":tr.isDate(s)?s.toISOString():tr.isArrayBuffer(s)||tr.isTypedArray(s)?typeof Blob=="function"?new Blob([s]):Buffer.from(s):s}function o(s,a){if(tr.isPlainObject(s)||tr.isArray(s)){if(e.indexOf(s)!==-1)throw Error("Circular reference detected in "+a);e.push(s),tr.forEach(s,function(f,h){if(!tr.isUndefined(f)){var g=a?a+"."+h:h,y;if(f&&!a&&typeof f=="object"){if(tr.endsWith(h,"{}"))f=JSON.stringify(f);else if(tr.endsWith(h,"[]")&&(y=tr.toArray(f))){y.forEach(function(w){!tr.isUndefined(w)&&t.append(g,n(w))});return}}o(f,g)}}),e.pop()}else t.append(a,n(s))}return o(r),t}sl.exports=Dy});var al=fe((n2,il)=>{"use strict";var vc=Yn();il.exports=function(t,e,n){var o=n.config.validateStatus;!n.status||!o||o(n.status)?t(n):e(new vc("Request failed with status code "+n.status,[vc.ERR_BAD_REQUEST,vc.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}});var ul=fe((o2,cl)=>{"use strict";var wi=ut();cl.exports=wi.isStandardBrowserEnv()?function(){return{write:function(e,n,o,s,a,c){var f=[];f.push(e+"="+encodeURIComponent(n)),wi.isNumber(o)&&f.push("expires="+new Date(o).toGMTString()),wi.isString(s)&&f.push("path="+s),wi.isString(a)&&f.push("domain="+a),c===!0&&f.push("secure"),document.cookie=f.join("; ")},read:function(e){var n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var dl=fe((s2,fl)=>{"use strict";fl.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}});var pl=fe((i2,ll)=>{"use strict";ll.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}});var Ec=fe((a2,hl)=>{"use strict";var My=dl(),qy=pl();hl.exports=function(t,e){return t&&!My(e)?qy(t,e):e}});var yl=fe((c2,gl)=>{"use strict";var Sc=ut(),Ly=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];gl.exports=function(t){var e={},n,o,s;return t&&Sc.forEach(t.split(`
2
+ `),function(c){if(s=c.indexOf(":"),n=Sc.trim(c.substr(0,s)).toLowerCase(),o=Sc.trim(c.substr(s+1)),n){if(e[n]&&Ly.indexOf(n)>=0)return;n==="set-cookie"?e[n]=(e[n]?e[n]:[]).concat([o]):e[n]=e[n]?e[n]+", "+o:o}}),e}});var bl=fe((u2,xl)=>{"use strict";var ml=ut();xl.exports=ml.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a"),n;function o(s){var a=s;return t&&(e.setAttribute("href",a),a=e.href),e.setAttribute("href",a),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return n=o(window.location.href),function(a){var c=ml.isString(a)?o(a):a;return c.protocol===n.protocol&&c.host===n.host}}():function(){return function(){return!0}}()});var Jo=fe((f2,wl)=>{"use strict";var Uc=Yn(),Hy=ut();function Al(r){Uc.call(this,r??"canceled",Uc.ERR_CANCELED),this.name="CanceledError"}Hy.inherits(Al,Uc,{__CANCEL__:!0});wl.exports=Al});var _l=fe((d2,Tl)=>{"use strict";Tl.exports=function(t){var e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}});var Bc=fe((l2,vl)=>{"use strict";var es=ut(),Gy=al(),Fy=ul(),$y=wc(),Ky=Ec(),jy=yl(),Vy=bl(),Wy=Tc(),kr=Yn(),Qy=Jo(),Yy=_l();vl.exports=function(t){return new Promise(function(n,o){var s=t.data,a=t.headers,c=t.responseType,f;function h(){t.cancelToken&&t.cancelToken.unsubscribe(f),t.signal&&t.signal.removeEventListener("abort",f)}es.isFormData(s)&&es.isStandardBrowserEnv()&&delete a["Content-Type"];var g=new XMLHttpRequest;if(t.auth){var y=t.auth.username||"",w=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.Authorization="Basic "+btoa(y+":"+w)}var b=Ky(t.baseURL,t.url);g.open(t.method.toUpperCase(),$y(b,t.params,t.paramsSerializer),!0),g.timeout=t.timeout;function I(){if(!!g){var R="getAllResponseHeaders"in g?jy(g.getAllResponseHeaders()):null,M=!c||c==="text"||c==="json"?g.responseText:g.response,E={data:M,status:g.status,statusText:g.statusText,headers:R,config:t,request:g};Gy(function(D){n(D),h()},function(D){o(D),h()},E),g=null}}if("onloadend"in g?g.onloadend=I:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(I)},g.onabort=function(){!g||(o(new kr("Request aborted",kr.ECONNABORTED,t,g)),g=null)},g.onerror=function(){o(new kr("Network Error",kr.ERR_NETWORK,t,g,g)),g=null},g.ontimeout=function(){var M=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",E=t.transitional||Wy;t.timeoutErrorMessage&&(M=t.timeoutErrorMessage),o(new kr(M,E.clarifyTimeoutError?kr.ETIMEDOUT:kr.ECONNABORTED,t,g)),g=null},es.isStandardBrowserEnv()){var T=(t.withCredentials||Vy(b))&&t.xsrfCookieName?Fy.read(t.xsrfCookieName):void 0;T&&(a[t.xsrfHeaderName]=T)}"setRequestHeader"in g&&es.forEach(a,function(M,E){typeof s>"u"&&E.toLowerCase()==="content-type"?delete a[E]:g.setRequestHeader(E,M)}),es.isUndefined(t.withCredentials)||(g.withCredentials=!!t.withCredentials),c&&c!=="json"&&(g.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&g.addEventListener("progress",t.onDownloadProgress),typeof t.onUploadProgress=="function"&&g.upload&&g.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(f=function(R){!g||(o(!R||R&&R.type?new Qy:R),g.abort(),g=null)},t.cancelToken&&t.cancelToken.subscribe(f),t.signal&&(t.signal.aborted?f():t.signal.addEventListener("abort",f))),s||(s=null);var S=Yy(b);if(S&&["http","https","file"].indexOf(S)===-1){o(new kr("Unsupported protocol "+S+":",kr.ERR_BAD_REQUEST,t));return}g.send(s)})}});var Sl=fe((p2,El)=>{El.exports=null});var _i=fe((h2,Il)=>{"use strict";var ft=ut(),Ul=Jd(),Bl=Yn(),Xy=Tc(),Zy=_c(),Jy={"Content-Type":"application/x-www-form-urlencoded"};function Cl(r,t){!ft.isUndefined(r)&&ft.isUndefined(r["Content-Type"])&&(r["Content-Type"]=t)}function em(){var r;return typeof XMLHttpRequest<"u"?r=Bc():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(r=Bc()),r}function tm(r,t,e){if(ft.isString(r))try{return(t||JSON.parse)(r),ft.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(e||JSON.stringify)(r)}var Ti={transitional:Xy,adapter:em(),transformRequest:[function(t,e){if(Ul(e,"Accept"),Ul(e,"Content-Type"),ft.isFormData(t)||ft.isArrayBuffer(t)||ft.isBuffer(t)||ft.isStream(t)||ft.isFile(t)||ft.isBlob(t))return t;if(ft.isArrayBufferView(t))return t.buffer;if(ft.isURLSearchParams(t))return Cl(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var n=ft.isObject(t),o=e&&e["Content-Type"],s;if((s=ft.isFileList(t))||n&&o==="multipart/form-data"){var a=this.env&&this.env.FormData;return Zy(s?{"files[]":t}:t,a&&new a)}else if(n||o==="application/json")return Cl(e,"application/json"),tm(t);return t}],transformResponse:[function(t){var e=this.transitional||Ti.transitional,n=e&&e.silentJSONParsing,o=e&&e.forcedJSONParsing,s=!n&&this.responseType==="json";if(s||o&&ft.isString(t)&&t.length)try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?Bl.from(a,Bl.ERR_BAD_RESPONSE,this,null,this.response):a}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Sl()},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};ft.forEach(["delete","get","head"],function(t){Ti.headers[t]={}});ft.forEach(["post","put","patch"],function(t){Ti.headers[t]=ft.merge(Jy)});Il.exports=Ti});var Pl=fe((g2,Rl)=>{"use strict";var rm=ut(),nm=_i();Rl.exports=function(t,e,n){var o=this||nm;return rm.forEach(n,function(a){t=a.call(o,t,e)}),t}});var Cc=fe((y2,kl)=>{"use strict";kl.exports=function(t){return!!(t&&t.__CANCEL__)}});var Nl=fe((m2,zl)=>{"use strict";var Ol=ut(),Ic=Pl(),om=Cc(),sm=_i(),im=Jo();function Rc(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new im}zl.exports=function(t){Rc(t),t.headers=t.headers||{},t.data=Ic.call(t,t.data,t.headers,t.transformRequest),t.headers=Ol.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Ol.forEach(["delete","get","head","post","put","patch","common"],function(o){delete t.headers[o]});var e=t.adapter||sm.adapter;return e(t).then(function(o){return Rc(t),o.data=Ic.call(t,o.data,o.headers,t.transformResponse),o},function(o){return om(o)||(Rc(t),o&&o.response&&(o.response.data=Ic.call(t,o.response.data,o.response.headers,t.transformResponse))),Promise.reject(o)})}});var Pc=fe((x2,Dl)=>{"use strict";var zt=ut();Dl.exports=function(t,e){e=e||{};var n={};function o(g,y){return zt.isPlainObject(g)&&zt.isPlainObject(y)?zt.merge(g,y):zt.isPlainObject(y)?zt.merge({},y):zt.isArray(y)?y.slice():y}function s(g){if(zt.isUndefined(e[g])){if(!zt.isUndefined(t[g]))return o(void 0,t[g])}else return o(t[g],e[g])}function a(g){if(!zt.isUndefined(e[g]))return o(void 0,e[g])}function c(g){if(zt.isUndefined(e[g])){if(!zt.isUndefined(t[g]))return o(void 0,t[g])}else return o(void 0,e[g])}function f(g){if(g in e)return o(t[g],e[g]);if(g in t)return o(void 0,t[g])}var h={url:a,method:a,data:a,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:f};return zt.forEach(Object.keys(t).concat(Object.keys(e)),function(y){var w=h[y]||s,b=w(y);zt.isUndefined(b)&&w!==f||(n[y]=b)}),n}});var kc=fe((b2,Ml)=>{Ml.exports={version:"0.27.2"}});var Hl=fe((A2,Ll)=>{"use strict";var am=kc().version,Tn=Yn(),Oc={};["object","boolean","number","function","string","symbol"].forEach(function(r,t){Oc[r]=function(n){return typeof n===r||"a"+(t<1?"n ":" ")+r}});var ql={};Oc.transitional=function(t,e,n){function o(s,a){return"[Axios v"+am+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return function(s,a,c){if(t===!1)throw new Tn(o(a," has been removed"+(e?" in "+e:"")),Tn.ERR_DEPRECATED);return e&&!ql[a]&&(ql[a]=!0,console.warn(o(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(s,a,c):!0}};function cm(r,t,e){if(typeof r!="object")throw new Tn("options must be an object",Tn.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(r),o=n.length;o-- >0;){var s=n[o],a=t[s];if(a){var c=r[s],f=c===void 0||a(c,s,r);if(f!==!0)throw new Tn("option "+s+" must be "+f,Tn.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new Tn("Unknown option "+s,Tn.ERR_BAD_OPTION)}}Ll.exports={assertOptions:cm,validators:Oc}});var Vl=fe((w2,jl)=>{"use strict";var $l=ut(),um=wc(),Gl=Xd(),Fl=Nl(),vi=Pc(),fm=Ec(),Kl=Hl(),To=Kl.validators;function _o(r){this.defaults=r,this.interceptors={request:new Gl,response:new Gl}}_o.prototype.request=function(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=vi(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var n=e.transitional;n!==void 0&&Kl.assertOptions(n,{silentJSONParsing:To.transitional(To.boolean),forcedJSONParsing:To.transitional(To.boolean),clarifyTimeoutError:To.transitional(To.boolean)},!1);var o=[],s=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(e)===!1||(s=s&&b.synchronous,o.unshift(b.fulfilled,b.rejected))});var a=[];this.interceptors.response.forEach(function(b){a.push(b.fulfilled,b.rejected)});var c;if(!s){var f=[Fl,void 0];for(Array.prototype.unshift.apply(f,o),f=f.concat(a),c=Promise.resolve(e);f.length;)c=c.then(f.shift(),f.shift());return c}for(var h=e;o.length;){var g=o.shift(),y=o.shift();try{h=g(h)}catch(w){y(w);break}}try{c=Fl(h)}catch(w){return Promise.reject(w)}for(;a.length;)c=c.then(a.shift(),a.shift());return c};_o.prototype.getUri=function(t){t=vi(this.defaults,t);var e=fm(t.baseURL,t.url);return um(e,t.params,t.paramsSerializer)};$l.forEach(["delete","get","head","options"],function(t){_o.prototype[t]=function(e,n){return this.request(vi(n||{},{method:t,url:e,data:(n||{}).data}))}});$l.forEach(["post","put","patch"],function(t){function e(n){return function(s,a,c){return this.request(vi(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}_o.prototype[t]=e(),_o.prototype[t+"Form"]=e(!0)});jl.exports=_o});var Ql=fe((T2,Wl)=>{"use strict";var dm=Jo();function vo(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(o){t=o});var e=this;this.promise.then(function(n){if(!!e._listeners){var o,s=e._listeners.length;for(o=0;o<s;o++)e._listeners[o](n);e._listeners=null}}),this.promise.then=function(n){var o,s=new Promise(function(a){e.subscribe(a),o=a}).then(n);return s.cancel=function(){e.unsubscribe(o)},s},r(function(o){e.reason||(e.reason=new dm(o),t(e.reason))})}vo.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};vo.prototype.subscribe=function(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]};vo.prototype.unsubscribe=function(t){if(!!this._listeners){var e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}};vo.source=function(){var t,e=new vo(function(o){t=o});return{token:e,cancel:t}};Wl.exports=vo});var Xl=fe((_2,Yl)=>{"use strict";Yl.exports=function(t){return function(n){return t.apply(null,n)}}});var Jl=fe((v2,Zl)=>{"use strict";var lm=ut();Zl.exports=function(t){return lm.isObject(t)&&t.isAxiosError===!0}});var rp=fe((E2,zc)=>{"use strict";var ep=ut(),pm=hc(),Ei=Vl(),hm=Pc(),gm=_i();function tp(r){var t=new Ei(r),e=pm(Ei.prototype.request,t);return ep.extend(e,Ei.prototype,t),ep.extend(e,t),e.create=function(o){return tp(hm(r,o))},e}var Ut=tp(gm);Ut.Axios=Ei;Ut.CanceledError=Jo();Ut.CancelToken=Ql();Ut.isCancel=Cc();Ut.VERSION=kc().version;Ut.toFormData=_c();Ut.AxiosError=Yn();Ut.Cancel=Ut.CanceledError;Ut.all=function(t){return Promise.all(t)};Ut.spread=Xl();Ut.isAxiosError=Jl();zc.exports=Ut;zc.exports.default=Ut});var op=fe((S2,np)=>{np.exports=rp()});var Cm={};fu(Cm,{APTOS_BIP44_REGEX:()=>Cf,APTOS_HARDENED_REGEX:()=>Bf,Account:()=>St,AccountAddress:()=>O,AccountAuthenticator:()=>Bt,AccountAuthenticatorEd25519:()=>rr,AccountAuthenticatorMultiEd25519:()=>Eo,AccountAuthenticatorMultiKey:()=>_n,AccountAuthenticatorSingleKey:()=>Kt,AccountAuthenticatorVariant:()=>na,AddressInvalidReason:()=>Iu,AnyPublicKeyVariant:()=>oa,AnySignatureVariant:()=>sa,Aptos:()=>Ct,AptosApiError:()=>cr,AptosConfig:()=>ts,AuthenticationKey:()=>Ft,Bool:()=>Le,CKDPriv:()=>Da,ChainId:()=>Mr,DeriveScheme:()=>yu,Deserializer:()=>qo,Ed25519PrivateKey:()=>Zt,Ed25519PublicKey:()=>De,Ed25519Signature:()=>je,EntryFunction:()=>wr,EntryFunctionBytes:()=>qn,FeePayerRawTransaction:()=>sr,FixedBytes:()=>ur,HARDENED_OFFSET:()=>Oa,Hex:()=>be,HexInvalidReason:()=>Bu,Identifier:()=>qe,KeyType:()=>If,MimeType:()=>Es,ModuleId:()=>qr,MoveAbility:()=>hu,MoveFunctionVisibility:()=>pu,MoveOption:()=>tt,MoveString:()=>Ge,MoveVector:()=>ve,MultiAgentRawTransaction:()=>or,MultiEd25519PublicKey:()=>Et,MultiEd25519Signature:()=>Br,MultiKey:()=>Pr,MultiSig:()=>Cn,MultisigTransactionPayload:()=>In,Network:()=>zo,NetworkToChainId:()=>Us,NetworkToFaucetAPI:()=>ua,NetworkToIndexerAPI:()=>Ss,NetworkToNetworkName:()=>Jp,NetworkToNodeAPI:()=>ca,ParsingError:()=>mt,PrivateKey:()=>Ln,PublicKey:()=>Pt,RawTransaction:()=>Nt,RawTransactionWithData:()=>os,RoleType:()=>gu,RotationProofChallenge:()=>rs,Script:()=>Bn,ScriptTransactionArgumentVariants:()=>ro,Secp256k1PrivateKey:()=>mr,Secp256k1PublicKey:()=>Gt,Secp256k1Signature:()=>xr,Serializable:()=>te,Serializer:()=>Wt,Signature:()=>Qt,SignedTransaction:()=>Dt,SigningScheme:()=>no,SigningSchemeInput:()=>aa,StructTag:()=>jt,TransactionAuthenticator:()=>br,TransactionAuthenticatorEd25519:()=>Or,TransactionAuthenticatorFeePayer:()=>Nr,TransactionAuthenticatorMultiAgent:()=>zr,TransactionAuthenticatorMultiEd25519:()=>So,TransactionAuthenticatorSingleSender:()=>Dr,TransactionAuthenticatorVariant:()=>ra,TransactionPayload:()=>vn,TransactionPayloadEntryFunction:()=>Sn,TransactionPayloadMultisig:()=>Un,TransactionPayloadScript:()=>En,TransactionPayloadVariants:()=>ea,TransactionResponseType:()=>ia,TransactionVariants:()=>ta,TypeTag:()=>Xe,TypeTagAddress:()=>Vr,TypeTagBool:()=>Lr,TypeTagGeneric:()=>Wr,TypeTagParserError:()=>$e,TypeTagParserErrorType:()=>pp,TypeTagReference:()=>Xn,TypeTagSigner:()=>Ar,TypeTagStruct:()=>nr,TypeTagU128:()=>Kr,TypeTagU16:()=>Gr,TypeTagU256:()=>jr,TypeTagU32:()=>Fr,TypeTagU64:()=>$r,TypeTagU8:()=>Hr,TypeTagVariants:()=>Ji,TypeTagVector:()=>Qr,U128:()=>Tt,U16:()=>At,U256:()=>_t,U32:()=>wt,U64:()=>He,U8:()=>st,aptosCoinStructTag:()=>mm,aptosRequest:()=>Oo,buildTransaction:()=>jc,convertArgument:()=>$c,deriveKey:()=>Xs,deriveTransactionType:()=>Yc,deserializeFromScriptArgument:()=>fp,ensureBoolean:()=>zs,fetchEntryFunctionAbi:()=>Fc,findFirstNonSignerArg:()=>Hc,generateMultiSignersSignedTransaction:()=>mp,generateRawTransaction:()=>yp,generateSignedTransaction:()=>Qc,generateSignedTransactionForSimulation:()=>Vc,generateTransactionPayload:()=>Kc,generateTransactionPayloadWithABI:()=>hp,get:()=>Eu,getAptosFullNode:()=>bt,getAuthenticatorForSimulation:()=>cs,getFunctionParts:()=>qi,getSigningMessage:()=>xp,isBcsAddress:()=>as,isBcsBool:()=>Ii,isBcsFixedBytes:()=>Lc,isBcsString:()=>Ri,isBcsU128:()=>Ni,isBcsU16:()=>ki,isBcsU256:()=>Di,isBcsU32:()=>Oi,isBcsU64:()=>zi,isBcsU8:()=>Pi,isBool:()=>Mc,isLargeNumber:()=>is,isNull:()=>qc,isNumber:()=>ss,isScriptDataInput:()=>Mi,isString:()=>Zn,isValidBIP44Path:()=>za,isValidHardenedPath:()=>Na,mnemonicToSeed:()=>Vo,objectStructTag:()=>Am,optionStructTag:()=>bm,outOfRangeErrorMessage:()=>Cu,paginateWithCursor:()=>On,parseTypeTag:()=>Uo,post:()=>Cs,postAptosFaucet:()=>la,postAptosFullNode:()=>zn,postAptosIndexer:()=>da,request:()=>xu,sign:()=>Wc,splitPath:()=>Ma,standardizeTypeTags:()=>Gc,stringStructTag:()=>xm,throwTypeMismatch:()=>Ke,validateNumberInRange:()=>Er});var cr=class extends Error{constructor(e,n,o){super(o);this.name="AptosApiError",this.url=n.url,this.status=n.status,this.statusText=n.statusText,this.data=n.data,this.request=e}};var lu="0.0.4";var Es=(n=>(n.JSON="application/json",n.BCS="application/x-bcs",n.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",n))(Es||{}),Ji=(b=>(b[b.Bool=0]="Bool",b[b.U8=1]="U8",b[b.U64=2]="U64",b[b.U128=3]="U128",b[b.Address=4]="Address",b[b.Signer=5]="Signer",b[b.Vector=6]="Vector",b[b.Struct=7]="Struct",b[b.U16=8]="U16",b[b.U32=9]="U32",b[b.U256=10]="U256",b[b.Reference=254]="Reference",b[b.Generic=255]="Generic",b))(Ji||{}),ro=(h=>(h[h.U8=0]="U8",h[h.U64=1]="U64",h[h.U128=2]="U128",h[h.Address=3]="Address",h[h.U8Vector=4]="U8Vector",h[h.Bool=5]="Bool",h[h.U16=6]="U16",h[h.U32=7]="U32",h[h.U256=8]="U256",h))(ro||{}),ea=(n=>(n[n.Script=0]="Script",n[n.EntryFunction=2]="EntryFunction",n[n.Multisig=3]="Multisig",n))(ea||{}),ta=(e=>(e[e.MultiAgentTransaction=0]="MultiAgentTransaction",e[e.FeePayerTransaction=1]="FeePayerTransaction",e))(ta||{}),ra=(s=>(s[s.Ed25519=0]="Ed25519",s[s.MultiEd25519=1]="MultiEd25519",s[s.MultiAgent=2]="MultiAgent",s[s.FeePayer=3]="FeePayer",s[s.SingleSender=4]="SingleSender",s))(ra||{}),na=(o=>(o[o.Ed25519=0]="Ed25519",o[o.MultiEd25519=1]="MultiEd25519",o[o.SingleKey=2]="SingleKey",o[o.MultiKey=3]="MultiKey",o))(na||{}),oa=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1=1]="Secp256k1",e))(oa||{}),sa=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1=1]="Secp256k1",e))(sa||{}),ia=(s=>(s.Pending="pending_transaction",s.User="user_transaction",s.Genesis="genesis_transaction",s.BlockMetadata="block_metadata_transaction",s.StateCheckpoint="state_checkpoint_transaction",s))(ia||{}),pu=(n=>(n.PRIVATE="private",n.PUBLIC="public",n.FRIEND="friend",n))(pu||{}),hu=(o=>(o.STORE="store",o.DROP="drop",o.KEY="key",o.COPY="copy",o))(hu||{}),gu=(e=>(e.VALIDATOR="validator",e.FULL_NODE="full_node",e))(gu||{}),no=(o=>(o[o.Ed25519=0]="Ed25519",o[o.MultiEd25519=1]="MultiEd25519",o[o.SingleKey=2]="SingleKey",o[o.MultiKey=3]="MultiKey",o))(no||{}),aa=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",e))(aa||{}),yu=(s=>(s[s.DeriveAuid=251]="DeriveAuid",s[s.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",s[s.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",s[s.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",s[s.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",s))(yu||{});var mu={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"};async function xu(r,t){let{url:e,method:n,body:o,contentType:s,params:a,overrides:c}=r,f={...c?.HEADERS,"x-aptos-client":`aptos-ts-sdk/${lu}`,"content-type":s??"application/json"};return c?.AUTH_TOKEN&&e.includes("faucet")&&(f.Authorization=`Bearer ${c?.AUTH_TOKEN}`),t.provider({url:e,method:n,body:o,params:a,headers:f,overrides:c})}async function Oo(r,t){let{url:e,path:n}=r,o=`${e}/${n??""}`,s=await xu({...r,url:o},t.client),a={status:s.status,statusText:s.statusText,data:s.data,headers:s.headers,config:s.config,request:s.request,url:o};if(t.isIndexerRequest(e)){let f=a.data;if(f.errors)throw new cr(r,a,f.errors[0].message??`Unhandled Error ${s.status} : ${s.statusText}`);a.data=f.data}if(a.status>=200&&a.status<300)return a;let c;throw"message"in s.data&&"error_code"in s.data?c=JSON.stringify(s.data):a.status in mu?c=mu[a.status]:c=`Unhandled Error ${s.status} : ${s.statusText}`,new cr(r,a,c)}var Ss={mainnet:"https://indexer.mainnet.aptoslabs.com/v1/graphql",testnet:"https://indexer-testnet.staging.gcp.aptosdev.com/v1/graphql",devnet:"https://indexer-devnet.staging.gcp.aptosdev.com/v1/graphql",local:"http://127.0.0.1:8090/v1/graphql"},ca={mainnet:"https://fullnode.mainnet.aptoslabs.com/v1",testnet:"https://fullnode.testnet.aptoslabs.com/v1",devnet:"https://fullnode.devnet.aptoslabs.com/v1",local:"http://127.0.0.1:8080/v1"},ua={mainnet:"https://faucet.mainnet.aptoslabs.com",testnet:"https://faucet.testnet.aptoslabs.com",devnet:"https://faucet.devnet.aptoslabs.com",local:"http://127.0.0.1:8081"},zo=(s=>(s.MAINNET="mainnet",s.TESTNET="testnet",s.DEVNET="devnet",s.LOCAL="local",s.CUSTOM="custom",s))(zo||{}),Us={mainnet:1,testnet:2},Jp={mainnet:"mainnet",testnet:"testnet",devnet:"devnet",local:"local",custom:"custom"};var bu="devnet",Au=2e5,wu=20,Bs=20,Tu="0x1::aptos_coin::AptosCoin",_u="APTOS::RawTransaction",fa="APTOS::RawTransactionWithData";async function Eu(r){let{aptosConfig:t,overrides:e,params:n,contentType:o,acceptType:s,path:a,originMethod:c,type:f}=r,h=t.getRequestUrl(f);return Oo({url:h,method:"GET",originMethod:c,path:a,contentType:o?.valueOf(),acceptType:s?.valueOf(),params:n,overrides:{...t.clientConfig,...e}},t)}async function bt(r){return Eu({...r,type:0})}async function On(r){let t=[],e,n=r.params;for(;;){n.start=e;let o=await bt({aptosConfig:r.aptosConfig,originMethod:r.originMethod,path:r.path,params:n,overrides:r.overrides});if(e=o.headers["x-aptos-cursor"],delete o.headers,t.push(...o.data),e==null)break}return t}async function Cs(r){let{type:t,originMethod:e,path:n,body:o,acceptType:s,contentType:a,params:c,aptosConfig:f,overrides:h}=r,g=f.getRequestUrl(t);return Oo({url:g,method:"POST",originMethod:e,path:n,body:o,contentType:a?.valueOf(),acceptType:s?.valueOf(),params:c,overrides:{...f.clientConfig,...h}},f)}async function zn(r){return Cs({...r,type:0})}async function da(r){return Cs({...r,type:1})}async function la(r){return Cs({...r,type:2})}var eh={node:void 0,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0};var Su=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)),Is=r=>new DataView(r.buffer,r.byteOffset,r.byteLength);var th=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!th)throw new Error("Non little-endian hardware is not supported");var rh=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function No(r){if(!(r instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=rh[r[e]];return t}function Rs(r){if(typeof r!="string")throw new TypeError("hexToBytes: expected string, got "+typeof r);if(r.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let t=new Uint8Array(r.length/2);for(let e=0;e<t.length;e++){let n=e*2,o=r.slice(n,n+2),s=Number.parseInt(o,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");t[e]=s}return t}function nh(r){if(typeof r!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof r}`);return new TextEncoder().encode(r)}function tn(r){if(typeof r=="string"&&(r=nh(r)),!(r instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof r})`);return r}var en=class{clone(){return this._cloneInto()}};function oo(r){let t=n=>r().update(tn(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}function Uu(r){let t=(n,o)=>r(o).update(tn(n)).digest(),e=r({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=n=>r(n),t}var Ps=2**8-1,ks=2**16-1,vr=2**32-1,Nn=BigInt(2)**BigInt(64)-BigInt(1),Do=BigInt(2)**BigInt(128)-BigInt(1),Os=BigInt(2)**BigInt(256)-BigInt(1);var mt=class extends Error{constructor(e,n){super(e);this.invalidReason=n}};var Bu=(n=>(n.TOO_SHORT="too_short",n.INVALID_LENGTH="invalid_length",n.INVALID_HEX_CHARS="invalid_hex_chars",n))(Bu||{}),be=class{constructor(t){this.data=t}toUint8Array(){return this.data}toStringWithoutPrefix(){return No(this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromString(t){let e=t;if(e.startsWith("0x")&&(e=e.slice(2)),e.length===0)throw new mt("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(e.length%2!==0)throw new mt("Hex string must be an even number of hex characters.","invalid_length");try{return new be(Rs(e))}catch(n){let o=n;throw new mt(`Hex string contains invalid hex characters: ${o.message}`,"invalid_hex_chars")}}static fromHexInput(t){return t instanceof Uint8Array?new be(t):be.fromString(t)}static isValid(t){try{return be.fromString(t),{valid:!0}}catch(e){let n=e;return{valid:!1,invalidReason:n.invalidReason,invalidReasonMessage:n.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((e,n)=>e===t.data[n])}};var te=class{bcsToBytes(){let t=new Wt;return this.serialize(t),t.toUint8Array()}bcsToHex(){let t=this.bcsToBytes();return be.fromHexInput(t)}},Wt=class{constructor(t=64){if(t<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(t),this.offset=0}ensureBufferWillHandleSize(t){for(;this.buffer.byteLength<this.offset+t;){let e=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(e).set(new Uint8Array(this.buffer)),this.buffer=e}}appendToBuffer(t){this.ensureBufferWillHandleSize(t.length),new Uint8Array(this.buffer,this.offset).set(t),this.offset+=t.length}serializeWithFunction(t,e,n){this.ensureBufferWillHandleSize(e);let o=new DataView(this.buffer,this.offset);t.apply(o,[0,n,!0]),this.offset+=e}serializeStr(t){let e=new TextEncoder;this.serializeBytes(e.encode(t))}serializeBytes(t){this.serializeU32AsUleb128(t.length),this.appendToBuffer(t)}serializeFixedBytes(t){this.appendToBuffer(t)}serializeBool(t){zs(t);let e=t?1:0;this.appendToBuffer(new Uint8Array([e]))}serializeU8(t){this.appendToBuffer(new Uint8Array([t]))}serializeU16(t){this.serializeWithFunction(DataView.prototype.setUint16,2,t)}serializeU32(t){this.serializeWithFunction(DataView.prototype.setUint32,4,t)}serializeU64(t){let e=BigInt(t)&BigInt(vr),n=BigInt(t)>>BigInt(32);this.serializeU32(Number(e)),this.serializeU32(Number(n))}serializeU128(t){let e=BigInt(t)&Nn,n=BigInt(t)>>BigInt(64);this.serializeU64(e),this.serializeU64(n)}serializeU256(t){let e=BigInt(t)&Do,n=BigInt(t)>>BigInt(128);this.serializeU128(e),this.serializeU128(n)}serializeU32AsUleb128(t){let e=t,n=[];for(;e>>>7!==0;)n.push(e&127|128),e>>>=7;n.push(e),this.appendToBuffer(new Uint8Array(n))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(t){t.serialize(this)}serializeVector(t){this.serializeU32AsUleb128(t.length),t.forEach(e=>{e.serialize(this)})}};Jr([Dn(0,Ps)],Wt.prototype,"serializeU8",1),Jr([Dn(0,ks)],Wt.prototype,"serializeU16",1),Jr([Dn(0,vr)],Wt.prototype,"serializeU32",1),Jr([Dn(BigInt(0),Nn)],Wt.prototype,"serializeU64",1),Jr([Dn(BigInt(0),Do)],Wt.prototype,"serializeU128",1),Jr([Dn(BigInt(0),Os)],Wt.prototype,"serializeU256",1),Jr([Dn(0,vr)],Wt.prototype,"serializeU32AsUleb128",1);function zs(r){if(typeof r!="boolean")throw new Error(`${r} is not a boolean value`)}var Cu=(r,t,e)=>`${r} is out of range: [${t}, ${e}]`;function Er(r,t,e){let n=BigInt(r);if(n>BigInt(e)||n<BigInt(t))throw new Error(Cu(r,t,e))}function Dn(r,t){return(e,n,o)=>{let s=o.value;return o.value=function(c){return Er(c,r,t),s.apply(this,[c])},o}}var Iu=(c=>(c.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",c.INVALID_HEX_CHARS="invalid_hex_chars",c.TOO_SHORT="too_short",c.TOO_LONG="too_long",c.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",c.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",c.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",c))(Iu||{}),et=class extends te{constructor(e){super();if(e.length!==et.LENGTH)throw new mt("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=e}isSpecial(){return this.data.slice(0,this.data.length-1).every(e=>e===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let e=No(this.data);return this.isSpecial()&&(e=e[e.length-1]),e}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return No(this.data)}toUint8Array(){return this.data}serialize(e){e.serializeFixedBytes(this.data)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(3),e.serialize(this)}static deserialize(e){let n=e.deserializeFixedBytes(et.LENGTH);return new et(n)}static fromString(e){if(!e.startsWith("0x"))throw new mt("Hex string must start with a leading 0x.","leading_zero_x_required");let n=et.fromStringRelaxed(e);if(e.length!==et.LONG_STRING_LENGTH+2)if(n.isSpecial()){if(e.length!==3)throw new mt(`The given hex string ${e} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new mt(`The given hex string ${n} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return n}static fromStringRelaxed(e){let n=e;if(e.startsWith("0x")&&(n=e.slice(2)),n.length===0)throw new mt("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(n.length>64)throw new mt("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");let o;try{o=Rs(n.padStart(64,"0"))}catch(s){let a=s;throw new mt(`Hex characters are invalid: ${a.message}`,"invalid_hex_chars")}return new et(o)}static fromRelaxed(e){return e instanceof et?e:e instanceof Uint8Array?new et(e):et.fromStringRelaxed(e)}static from(e){return e instanceof et?e:e instanceof Uint8Array?new et(e):et.fromString(e)}static isValid(e){try{return e.relaxed?et.fromRelaxed(e.input):et.from(e.input),{valid:!0}}catch(n){let o=n;return{valid:!1,invalidReason:o.invalidReason,invalidReasonMessage:o.message}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((n,o)=>n===e.data[o])}},O=et;O.LENGTH=32,O.LONG_STRING_LENGTH=64,O.ZERO=et.from("0x0"),O.ONE=et.from("0x1"),O.TWO=et.from("0x2"),O.THREE=et.from("0x3"),O.FOUR=et.from("0x4");function pa(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function oh(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}function Ru(r,...t){if(!(r instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(r.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${r.length}`)}function sh(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");pa(r.outputLen),pa(r.blockLen)}function ih(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}function ah(r,t){Ru(r);let e=t.outputLen;if(r.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}var ch={number:pa,bool:oh,bytes:Ru,hash:sh,exists:ih,output:ah},gt=ch;var Ns=BigInt(4294967295),ha=BigInt(32);function Pu(r,t=!1){return t?{h:Number(r&Ns),l:Number(r>>ha&Ns)}:{h:Number(r>>ha&Ns)|0,l:Number(r&Ns)|0}}function uh(r,t=!1){let e=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o<r.length;o++){let{h:s,l:a}=Pu(r[o],t);[e[o],n[o]]=[s,a]}return[e,n]}var fh=(r,t)=>BigInt(r>>>0)<<ha|BigInt(t>>>0),dh=(r,t,e)=>r>>>e,lh=(r,t,e)=>r<<32-e|t>>>e,ph=(r,t,e)=>r>>>e|t<<32-e,hh=(r,t,e)=>r<<32-e|t>>>e,gh=(r,t,e)=>r<<64-e|t>>>e-32,yh=(r,t,e)=>r>>>e-32|t<<64-e,mh=(r,t)=>t,xh=(r,t)=>r,bh=(r,t,e)=>r<<e|t>>>32-e,Ah=(r,t,e)=>t<<e|r>>>32-e,wh=(r,t,e)=>t<<e-32|r>>>64-e,Th=(r,t,e)=>r<<e-32|t>>>64-e;function _h(r,t,e,n){let o=(t>>>0)+(n>>>0);return{h:r+e+(o/2**32|0)|0,l:o|0}}var vh=(r,t,e)=>(r>>>0)+(t>>>0)+(e>>>0),Eh=(r,t,e,n)=>t+e+n+(r/2**32|0)|0,Sh=(r,t,e,n)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0),Uh=(r,t,e,n,o)=>t+e+n+o+(r/2**32|0)|0,Bh=(r,t,e,n,o)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0)+(o>>>0),Ch=(r,t,e,n,o,s)=>t+e+n+o+s+(r/2**32|0)|0,Ih={fromBig:Pu,split:uh,toBig:fh,shrSH:dh,shrSL:lh,rotrSH:ph,rotrSL:hh,rotrBH:gh,rotrBL:yh,rotr32H:mh,rotr32L:xh,rotlSH:bh,rotlSL:Ah,rotlBH:wh,rotlBL:Th,add:_h,add3L:vh,add3H:Eh,add4L:Sh,add4H:Uh,add5H:Ch,add5L:Bh},ne=Ih;var[zu,Nu,Du]=[[],[],[]],Rh=BigInt(0),Mo=BigInt(1),Ph=BigInt(2),kh=BigInt(7),Oh=BigInt(256),zh=BigInt(113);for(let r=0,t=Mo,e=1,n=0;r<24;r++){[e,n]=[n,(2*e+3*n)%5],zu.push(2*(5*n+e)),Nu.push((r+1)*(r+2)/2%64);let o=Rh;for(let s=0;s<7;s++)t=(t<<Mo^(t>>kh)*zh)%Oh,t&Ph&&(o^=Mo<<(Mo<<BigInt(s))-Mo);Du.push(o)}var[Nh,Dh]=ne.split(Du,!0),ku=(r,t,e)=>e>32?ne.rotlBH(r,t,e):ne.rotlSH(r,t,e),Ou=(r,t,e)=>e>32?ne.rotlBL(r,t,e):ne.rotlSL(r,t,e);function Mh(r,t=24){let e=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let a=0;a<10;a++)e[a]=r[a]^r[a+10]^r[a+20]^r[a+30]^r[a+40];for(let a=0;a<10;a+=2){let c=(a+8)%10,f=(a+2)%10,h=e[f],g=e[f+1],y=ku(h,g,1)^e[c],w=Ou(h,g,1)^e[c+1];for(let b=0;b<50;b+=10)r[a+b]^=y,r[a+b+1]^=w}let o=r[2],s=r[3];for(let a=0;a<24;a++){let c=Nu[a],f=ku(o,s,c),h=Ou(o,s,c),g=zu[a];o=r[g],s=r[g+1],r[g]=f,r[g+1]=h}for(let a=0;a<50;a+=10){for(let c=0;c<10;c++)e[c]=r[a+c];for(let c=0;c<10;c++)r[a+c]^=~e[(c+2)%10]&e[(c+4)%10]}r[0]^=Nh[n],r[1]^=Dh[n]}e.fill(0)}var so=class extends en{constructor(t,e,n,o=!1,s=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=o,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,gt.number(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Su(this.state)}keccak(){Mh(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){gt.exists(this);let{blockLen:e,state:n}=this;t=tn(t);let o=t.length;for(let s=0;s<o;){let a=Math.min(e-this.pos,o-s);for(let c=0;c<a;c++)n[this.pos++]^=t[s++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:e,pos:n,blockLen:o}=this;t[n]^=e,(e&128)!==0&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){gt.exists(this,!1),gt.bytes(t),this.finish();let e=this.state,{blockLen:n}=this;for(let o=0,s=t.length;o<s;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,s-o);t.set(e.subarray(this.posOut,this.posOut+a),o),this.posOut+=a,o+=a}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return gt.number(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(gt.output(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:e,suffix:n,outputLen:o,rounds:s,enableXOF:a}=this;return t||(t=new so(e,n,o,a,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=n,t.outputLen=o,t.enableXOF=a,t.destroyed=this.destroyed,t}},rn=(r,t,e)=>oo(()=>new so(t,r,e)),Rx=rn(6,144,224/8),Mn=rn(6,136,256/8),Px=rn(6,104,384/8),kx=rn(6,72,512/8),Ox=rn(1,144,224/8),zx=rn(1,136,256/8),Nx=rn(1,104,384/8),Dx=rn(1,72,512/8),Mu=(r,t,e)=>Uu((n={})=>new so(t,r,n.dkLen===void 0?e:n.dkLen,!0)),Mx=Mu(31,168,128/8),qx=Mu(31,136,256/8);var Wo=Zi(Lu());var qo=class{constructor(t){this.buffer=new ArrayBuffer(t.length),new Uint8Array(this.buffer).set(t,0),this.offset=0}read(t){if(this.offset+t>this.buffer.byteLength)throw new Error("Reached to the end of buffer");let e=this.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e}deserializeStr(){let t=this.deserializeBytes();return new TextDecoder().decode(t)}deserializeBytes(){let t=this.deserializeUleb128AsU32();return new Uint8Array(this.read(t))}deserializeFixedBytes(t){return new Uint8Array(this.read(t))}deserializeBool(){let t=new Uint8Array(this.read(1))[0];if(t!==1&&t!==0)throw new Error("Invalid boolean value");return t===1}deserializeU8(){return new DataView(this.read(1)).getUint8(0)}deserializeU16(){return new DataView(this.read(2)).getUint16(0,!0)}deserializeU32(){return new DataView(this.read(4)).getUint32(0,!0)}deserializeU64(){let t=this.deserializeU32(),e=this.deserializeU32();return BigInt(BigInt(e)<<BigInt(32)|BigInt(t))}deserializeU128(){let t=this.deserializeU64(),e=this.deserializeU64();return BigInt(e<<BigInt(64)|t)}deserializeU256(){let t=this.deserializeU128(),e=this.deserializeU128();return BigInt(e<<BigInt(128)|t)}deserializeUleb128AsU32(){let t=BigInt(0),e=0;for(;t<vr;){let n=this.deserializeU8();if(t|=BigInt(n&127)<<BigInt(e),(n&128)===0)break;e+=7}if(t>vr)throw new Error("Overflow while parsing uleb128-encoded uint32 value");return Number(t)}deserialize(t){return t.deserialize(this)}deserializeVector(t){let e=this.deserializeUleb128AsU32(),n=new Array;for(let o=0;o<e;o+=1)n.push(this.deserialize(t));return n}};var ur=class extends te{constructor(e){super();this.value=be.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,n){let o=e.deserializeFixedBytes(n);return new ur(o)}};var qn=class extends te{constructor(e){super();this.value=new ur(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,n){let o=ur.deserialize(e,n);return new qn(o.value)}};var Le=class extends te{constructor(e){super();zs(e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}static deserialize(e){return new Le(e.deserializeBool())}},st=class extends te{constructor(e){super();Er(e,0,Ps),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new st(e.deserializeU8())}},At=class extends te{constructor(e){super();Er(e,0,ks),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new At(e.deserializeU16())}},wt=class extends te{constructor(e){super();Er(e,0,vr),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new wt(e.deserializeU32())}},He=class extends te{constructor(e){super();Er(e,BigInt(0),Nn),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new He(e.deserializeU64())}},Tt=class extends te{constructor(e){super();Er(e,BigInt(0),Do),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new Tt(e.deserializeU128())}},_t=class extends te{constructor(e){super();Er(e,BigInt(0),Os),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new _t(e.deserializeU256())}};var ve=class extends te{constructor(e){super();this.values=e}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){if(!(this.values[0]instanceof st)&&this.values[0]!==void 0)throw new Error("Script function arguments only accept u8 vectors");e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let n;if(Array.isArray(e)&&typeof e[0]=="number")n=e;else if(typeof e=="string"){let o=be.fromHexInput(e);n=Array.from(o.toUint8Array())}else if(e instanceof Uint8Array)n=Array.from(e);else throw new Error("Invalid input type");return new ve(n.map(o=>new st(o)))}static U16(e){return new ve(e.map(n=>new At(n)))}static U32(e){return new ve(e.map(n=>new wt(n)))}static U64(e){return new ve(e.map(n=>new He(n)))}static U128(e){return new ve(e.map(n=>new Tt(n)))}static U256(e){return new ve(e.map(n=>new _t(n)))}static Bool(e){return new ve(e.map(n=>new Le(n)))}static MoveString(e){return new ve(e.map(n=>new Ge(n)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,n){let o=e.deserializeUleb128AsU32(),s=new Array;for(let a=0;a<o;a+=1)s.push(n.deserialize(e));return new ve(s)}},Ge=class extends te{constructor(e){super();this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){let n=this.bcsToBytes().slice(1);ve.U8(n).serializeForScriptFunction(e)}static deserialize(e){return new Ge(e.deserializeStr())}},tt=class extends te{constructor(e){super();typeof e<"u"&&e!==null?this.vec=new ve([e]):this.vec=new ve([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new tt(e!=null?new st(e):void 0)}static U16(e){return new tt(e!=null?new At(e):void 0)}static U32(e){return new tt(e!=null?new wt(e):void 0)}static U64(e){return new tt(e!=null?new He(e):void 0)}static U128(e){return new tt(e!=null?new Tt(e):void 0)}static U256(e){return new tt(e!=null?new _t(e):void 0)}static Bool(e){return new tt(e!=null?new Le(e):void 0)}static MoveString(e){return new tt(e!=null?new Ge(e):void 0)}static deserialize(e,n){let o=ve.deserialize(e,n);return new tt(o.values[0])}};var Pt=class extends te{},Ln=class extends te{},Qt=class extends te{};var Ms=class extends en{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,gt.hash(t);let n=tn(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=t.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),s.fill(0)}update(t){return gt.exists(this),this.iHash.update(t),this}digestInto(t){gt.exists(this),gt.bytes(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:n,finished:o,destroyed:s,blockLen:a,outputLen:c}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=a,t.outputLen=c,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},ga=(r,t,e)=>new Ms(r,t).update(e).digest();ga.create=(r,t)=>new Ms(r,t);function qh(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let o=BigInt(32),s=BigInt(4294967295),a=Number(e>>o&s),c=Number(e&s),f=n?4:0,h=n?0:4;r.setUint32(t+f,a,n),r.setUint32(t+h,c,n)}var qs=class extends en{constructor(t,e,n,o){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Is(this.buffer)}update(t){gt.exists(this);let{view:e,buffer:n,blockLen:o}=this;t=tn(t);let s=t.length;for(let a=0;a<s;){let c=Math.min(o-this.pos,s-a);if(c===o){let f=Is(t);for(;o<=s-a;a+=o)this.process(f,a);continue}n.set(t.subarray(a,a+c),this.pos),this.pos+=c,a+=c,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){gt.exists(this),gt.output(t,this),this.finished=!0;let{buffer:e,view:n,blockLen:o,isLE:s}=this,{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let f=a;f<o;f++)e[f]=0;qh(n,o-8,BigInt(this.length*8),s),this.process(n,0);let c=Is(t);this.get().forEach((f,h)=>c.setUint32(4*h,f,s))}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:n,length:o,finished:s,destroyed:a,pos:c}=this;return t.length=o,t.pos=c,t.finished=s,t.destroyed=a,o%e&&t.buffer.set(n),t}};var[Lh,Hh]=ne.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),nn=new Uint32Array(80),on=new Uint32Array(80),Lo=class extends qs{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:n,Bl:o,Ch:s,Cl:a,Dh:c,Dl:f,Eh:h,El:g,Fh:y,Fl:w,Gh:b,Gl:I,Hh:T,Hl:S}=this;return[t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S]}set(t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S){this.Ah=t|0,this.Al=e|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=a|0,this.Dh=c|0,this.Dl=f|0,this.Eh=h|0,this.El=g|0,this.Fh=y|0,this.Fl=w|0,this.Gh=b|0,this.Gl=I|0,this.Hh=T|0,this.Hl=S|0}process(t,e){for(let E=0;E<16;E++,e+=4)nn[E]=t.getUint32(e),on[E]=t.getUint32(e+=4);for(let E=16;E<80;E++){let K=nn[E-15]|0,D=on[E-15]|0,F=ne.rotrSH(K,D,1)^ne.rotrSH(K,D,8)^ne.shrSH(K,D,7),J=ne.rotrSL(K,D,1)^ne.rotrSL(K,D,8)^ne.shrSL(K,D,7),G=nn[E-2]|0,oe=on[E-2]|0,de=ne.rotrSH(G,oe,19)^ne.rotrBH(G,oe,61)^ne.shrSH(G,oe,6),ce=ne.rotrSL(G,oe,19)^ne.rotrBL(G,oe,61)^ne.shrSL(G,oe,6),Pe=ne.add4L(J,ce,on[E-7],on[E-16]),Oe=ne.add4H(Pe,F,de,nn[E-7],nn[E-16]);nn[E]=Oe|0,on[E]=Pe|0}let{Ah:n,Al:o,Bh:s,Bl:a,Ch:c,Cl:f,Dh:h,Dl:g,Eh:y,El:w,Fh:b,Fl:I,Gh:T,Gl:S,Hh:R,Hl:M}=this;for(let E=0;E<80;E++){let K=ne.rotrSH(y,w,14)^ne.rotrSH(y,w,18)^ne.rotrBH(y,w,41),D=ne.rotrSL(y,w,14)^ne.rotrSL(y,w,18)^ne.rotrBL(y,w,41),F=y&b^~y&T,J=w&I^~w&S,G=ne.add5L(M,D,J,Hh[E],on[E]),oe=ne.add5H(G,R,K,F,Lh[E],nn[E]),de=G|0,ce=ne.rotrSH(n,o,28)^ne.rotrBH(n,o,34)^ne.rotrBH(n,o,39),Pe=ne.rotrSL(n,o,28)^ne.rotrBL(n,o,34)^ne.rotrBL(n,o,39),Oe=n&s^n&c^s&c,at=o&a^o&f^a&f;R=T|0,M=S|0,T=b|0,S=I|0,b=y|0,I=w|0,{h:y,l:w}=ne.add(h|0,g|0,oe|0,de|0),h=c|0,g=f|0,c=s|0,f=a|0,s=n|0,a=o|0;let z=ne.add3L(de,Pe,at);n=ne.add3H(z,oe,ce,Oe),o=z|0}({h:n,l:o}=ne.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:a}=ne.add(this.Bh|0,this.Bl|0,s|0,a|0),{h:c,l:f}=ne.add(this.Ch|0,this.Cl|0,c|0,f|0),{h,l:g}=ne.add(this.Dh|0,this.Dl|0,h|0,g|0),{h:y,l:w}=ne.add(this.Eh|0,this.El|0,y|0,w|0),{h:b,l:I}=ne.add(this.Fh|0,this.Fl|0,b|0,I|0),{h:T,l:S}=ne.add(this.Gh|0,this.Gl|0,T|0,S|0),{h:R,l:M}=ne.add(this.Hh|0,this.Hl|0,R|0,M|0),this.set(n,o,s,a,c,f,h,g,y,w,b,I,T,S,R,M)}roundClean(){nn.fill(0),on.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},ya=class extends Lo{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},ma=class extends Lo{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}},Hu=oo(()=>new Lo),Db=oo(()=>new ya),Mb=oo(()=>new ma);var Uf=Zi(Sf()),Bf=/^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'?$/,Cf=/^m\/44'\/637'\/[0-9]+'\/[0-9]+\/[0-9]+$/,If=(t=>(t.ED25519="ed25519 seed",t))(If||{}),Oa=2147483648;function za(r){return Cf.test(r)}function Na(r){return Bf.test(r)}var Xs=(r,t)=>{let e=ga.create(Hu,r).update(t).digest();return{key:e.slice(0,32),chainCode:e.slice(32)}},Da=({key:r,chainCode:t},e)=>{let n=new ArrayBuffer(4);new DataView(n).setUint32(0,e);let o=new Uint8Array(n),s=new Uint8Array([0]),a=new Uint8Array([...s,...r,...o]);return Xs(t,a)},V0=r=>r.replace("'",""),Ma=r=>r.split("/").slice(1).map(V0),Vo=r=>{let t=r.trim().split(/\s+/).map(e=>e.toLowerCase()).join(" ");return Uf.mnemonicToSeedSync(t)};var uo=class extends Pt{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==uo.LENGTH)throw new Error(`PublicKey length should be ${uo.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}verifySignature(e){let{message:n,signature:o}=e,s=be.fromHexInput(n).toUint8Array(),a=o.toUint8Array();return Wo.default.sign.detached.verify(s,a,this.key.toUint8Array())}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new uo(n)}static load(e){let n=e.deserializeBytes();return new uo(n)}},De=uo;De.LENGTH=32;var Lt=class extends Ln{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==Lt.LENGTH)throw new Error(`PrivateKey length should be ${Lt.LENGTH}`);this.signingKeyPair=Wo.default.sign.keyPair.fromSeed(n.toUint8Array().slice(0,Lt.LENGTH))}toUint8Array(){return this.signingKeyPair.secretKey.slice(0,Lt.LENGTH)}toString(){return be.fromHexInput(this.toUint8Array()).toString()}sign(e){let n=be.fromHexInput(e),o=Wo.default.sign.detached(n.toUint8Array(),this.signingKeyPair.secretKey);return new je(o)}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new Lt(n)}static generate(){let e=Wo.default.sign.keyPair();return new Lt(e.secretKey.slice(0,Lt.LENGTH))}publicKey(){let e=this.signingKeyPair.publicKey;return new De(e)}static fromDerivationPath(e,n){if(!Na(e))throw new Error(`Invalid derivation path ${e}`);return Lt.fromDerivationPathInner(e,Vo(n))}static fromDerivationPathInner(e,n,o=Oa){let{key:s,chainCode:a}=Xs(Lt.SLIP_0010_SEED,n),c=Ma(e).map(h=>parseInt(h,10)),{key:f}=c.reduce((h,g)=>Da(h,g+o),{key:s,chainCode:a});return new Lt(f)}},Zt=Lt;Zt.LENGTH=32,Zt.SLIP_0010_SEED="ed25519 seed";var fo=class extends Qt{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==fo.LENGTH)throw new Error(`Signature length should be ${fo.LENGTH}`);this.data=n}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new fo(n)}static load(e){let n=e.deserializeBytes();return new fo(n)}},je=fo;je.LENGTH=64;var Ur=class extends Pt{constructor(e){super();let{publicKeys:n,threshold:o}=e;if(n.length>Ur.MAX_KEYS||n.length<Ur.MIN_KEYS)throw new Error(`Must have between ${Ur.MIN_KEYS} and ${Ur.MAX_KEYS} public keys, inclusive`);if(o<Ur.MIN_THRESHOLD||o>n.length)throw new Error(`Threshold must be between ${Ur.MIN_THRESHOLD} and ${n.length}, inclusive`);this.publicKeys=n,this.threshold=o}toUint8Array(){let e=new Uint8Array(this.publicKeys.length*De.LENGTH+1);return this.publicKeys.forEach((n,o)=>{e.set(n.toUint8Array(),o*De.LENGTH)}),e[this.publicKeys.length*De.LENGTH]=this.threshold,e}toString(){return be.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("TODO - Method not implemented.")}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes(),o=n[n.length-1],s=[];for(let a=0;a<n.length-1;a+=De.LENGTH){let c=a;s.push(new De(n.subarray(c,c+De.LENGTH)))}return new Ur({publicKeys:s,threshold:o})}},Et=Ur;Et.MAX_KEYS=32,Et.MIN_KEYS=2,Et.MIN_THRESHOLD=1;var pr=class extends Qt{constructor(e){super();let{signatures:n,bitmap:o}=e;if(o.length!==pr.BITMAP_LEN)throw new Error(`"bitmap" length should be ${pr.BITMAP_LEN}`);if(n.length>pr.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${pr.MAX_SIGNATURES_SUPPORTED}`);this.signatures=n,this.bitmap=o}toUint8Array(){let e=new Uint8Array(this.signatures.length*je.LENGTH+pr.BITMAP_LEN);return this.signatures.forEach((n,o)=>{e.set(n.toUint8Array(),o*je.LENGTH)}),e.set(this.bitmap,this.signatures.length*je.LENGTH),e}toString(){return be.fromHexInput(this.toUint8Array()).toString()}static createBitmap(e){let{bits:n}=e,o=128,s=new Uint8Array([0,0,0,0]),a=new Set;return n.forEach(c=>{if(c>=pr.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${pr.MAX_SIGNATURES_SUPPORTED-1}.`);if(a.has(c))throw new Error("Duplicate bits detected.");a.add(c);let f=Math.floor(c/8),h=s[f];h|=o>>c%8,s[f]=h}),s}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes(),o=n.subarray(n.length-4),s=[];for(let a=0;a<n.length-o.length;a+=je.LENGTH){let c=a;s.push(new je(n.subarray(c,c+je.LENGTH)))}return new pr({signatures:s,bitmap:o})}},Br=pr;Br.MAX_SIGNATURES_SUPPORTED=32,Br.BITMAP_LEN=4;function Rf(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function Cr(r,...t){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(r.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${r.length}`)}function Pf(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Rf(r.outputLen),Rf(r.blockLen)}function lo(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}function kf(r,t){Cr(r);let e=t.outputLen;if(r.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}var Zs=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var qa=r=>r instanceof Uint8Array;var dn=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),Jt=(r,t)=>r<<32-t|r>>>t,W0=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!W0)throw new Error("Non little-endian hardware is not supported");var Q0=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function Of(r){if(!qa(r))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=Q0[r[e]];return t}function zf(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let t=r.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);let e=new Uint8Array(t/2);for(let n=0;n<e.length;n++){let o=n*2,s=r.slice(o,o+2),a=Number.parseInt(s,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");e[n]=a}return e}function La(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function Qo(r){if(typeof r=="string"&&(r=La(r)),!qa(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}function Gn(...r){let t=new Uint8Array(r.reduce((n,o)=>n+o.length,0)),e=0;return r.forEach(n=>{if(!qa(n))throw new Error("Uint8Array expected");t.set(n,e),e+=n.length}),t}var po=class{clone(){return this._cloneInto()}},dA={}.toString;function ho(r){let t=n=>r().update(Qo(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}function Nf(r=32){if(Zs&&typeof Zs.getRandomValues=="function")return Zs.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}function Y0(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let o=BigInt(32),s=BigInt(4294967295),a=Number(e>>o&s),c=Number(e&s),f=n?4:0,h=n?0:4;r.setUint32(t+f,a,n),r.setUint32(t+h,c,n)}var ln=class extends po{constructor(t,e,n,o){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=dn(this.buffer)}update(t){lo(this);let{view:e,buffer:n,blockLen:o}=this;t=Qo(t);let s=t.length;for(let a=0;a<s;){let c=Math.min(o-this.pos,s-a);if(c===o){let f=dn(t);for(;o<=s-a;a+=o)this.process(f,a);continue}n.set(t.subarray(a,a+c),this.pos),this.pos+=c,a+=c,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){lo(this),kf(t,this),this.finished=!0;let{buffer:e,view:n,blockLen:o,isLE:s}=this,{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let y=a;y<o;y++)e[y]=0;Y0(n,o-8,BigInt(this.length*8),s),this.process(n,0);let c=dn(t),f=this.outputLen;if(f%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let h=f/4,g=this.get();if(h>g.length)throw new Error("_sha2: outputLen bigger than state");for(let y=0;y<h;y++)c.setUint32(4*y,g[y],s)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:n,length:o,finished:s,destroyed:a,pos:c}=this;return t.length=o,t.pos=c,t.finished=s,t.destroyed=a,o%e&&t.buffer.set(n),t}};var X0=(r,t,e)=>r&t^~r&e,Z0=(r,t,e)=>r&t^r&e^t&e,J0=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),pn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),hn=new Uint32Array(64),Ha=class extends ln{constructor(){super(64,32,8,!1),this.A=pn[0]|0,this.B=pn[1]|0,this.C=pn[2]|0,this.D=pn[3]|0,this.E=pn[4]|0,this.F=pn[5]|0,this.G=pn[6]|0,this.H=pn[7]|0}get(){let{A:t,B:e,C:n,D:o,E:s,F:a,G:c,H:f}=this;return[t,e,n,o,s,a,c,f]}set(t,e,n,o,s,a,c,f){this.A=t|0,this.B=e|0,this.C=n|0,this.D=o|0,this.E=s|0,this.F=a|0,this.G=c|0,this.H=f|0}process(t,e){for(let y=0;y<16;y++,e+=4)hn[y]=t.getUint32(e,!1);for(let y=16;y<64;y++){let w=hn[y-15],b=hn[y-2],I=Jt(w,7)^Jt(w,18)^w>>>3,T=Jt(b,17)^Jt(b,19)^b>>>10;hn[y]=T+hn[y-7]+I+hn[y-16]|0}let{A:n,B:o,C:s,D:a,E:c,F:f,G:h,H:g}=this;for(let y=0;y<64;y++){let w=Jt(c,6)^Jt(c,11)^Jt(c,25),b=g+w+X0(c,f,h)+J0[y]+hn[y]|0,T=(Jt(n,2)^Jt(n,13)^Jt(n,22))+Z0(n,o,s)|0;g=h,h=f,f=c,c=a+b|0,a=s,s=o,o=n,n=b+T|0}n=n+this.A|0,o=o+this.B|0,s=s+this.C|0,a=a+this.D|0,c=c+this.E|0,f=f+this.F|0,h=h+this.G|0,g=g+this.H|0,this.set(n,o,s,a,c,f,h,g)}roundClean(){hn.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Yo=ho(()=>new Ha);var Ka={};fu(Ka,{bitGet:()=>ig,bitLen:()=>sg,bitMask:()=>Xo,bitSet:()=>ag,bytesToHex:()=>Fn,bytesToNumberBE:()=>Ir,bytesToNumberLE:()=>ti,concatBytes:()=>go,createHmacDrbg:()=>$a,ensureBytes:()=>kt,equalBytes:()=>ng,hexToBytes:()=>$n,hexToNumber:()=>Fa,numberToBytesBE:()=>gn,numberToBytesLE:()=>ri,numberToHexUnpadded:()=>qf,numberToVarBytesBE:()=>rg,utf8ToBytes:()=>og,validateObject:()=>yn});var Mf=BigInt(0),Js=BigInt(1),eg=BigInt(2),ei=r=>r instanceof Uint8Array,tg=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function Fn(r){if(!ei(r))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=tg[r[e]];return t}function qf(r){let t=r.toString(16);return t.length&1?`0${t}`:t}function Fa(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}function $n(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let t=r.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);let e=new Uint8Array(t/2);for(let n=0;n<e.length;n++){let o=n*2,s=r.slice(o,o+2),a=Number.parseInt(s,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");e[n]=a}return e}function Ir(r){return Fa(Fn(r))}function ti(r){if(!ei(r))throw new Error("Uint8Array expected");return Fa(Fn(Uint8Array.from(r).reverse()))}function gn(r,t){return $n(r.toString(16).padStart(t*2,"0"))}function ri(r,t){return gn(r,t).reverse()}function rg(r){return $n(qf(r))}function kt(r,t,e){let n;if(typeof t=="string")try{n=$n(t)}catch(s){throw new Error(`${r} must be valid hex string, got "${t}". Cause: ${s}`)}else if(ei(t))n=Uint8Array.from(t);else throw new Error(`${r} must be hex string or Uint8Array`);let o=n.length;if(typeof e=="number"&&o!==e)throw new Error(`${r} expected ${e} bytes, got ${o}`);return n}function go(...r){let t=new Uint8Array(r.reduce((n,o)=>n+o.length,0)),e=0;return r.forEach(n=>{if(!ei(n))throw new Error("Uint8Array expected");t.set(n,e),e+=n.length}),t}function ng(r,t){if(r.length!==t.length)return!1;for(let e=0;e<r.length;e++)if(r[e]!==t[e])return!1;return!0}function og(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function sg(r){let t;for(t=0;r>Mf;r>>=Js,t+=1);return t}function ig(r,t){return r>>BigInt(t)&Js}var ag=(r,t,e)=>r|(e?Js:Mf)<<BigInt(t),Xo=r=>(eg<<BigInt(r-1))-Js,Ga=r=>new Uint8Array(r),Df=r=>Uint8Array.from(r);function $a(r,t,e){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof e!="function")throw new Error("hmacFn must be a function");let n=Ga(r),o=Ga(r),s=0,a=()=>{n.fill(1),o.fill(0),s=0},c=(...y)=>e(o,n,...y),f=(y=Ga())=>{o=c(Df([0]),y),n=c(),y.length!==0&&(o=c(Df([1]),y),n=c())},h=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let y=0,w=[];for(;y<t;){n=c();let b=n.slice();w.push(b),y+=n.length}return go(...w)};return(y,w)=>{a(),f(y);let b;for(;!(b=w(h()));)f();return a(),b}}var cg={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||r instanceof Uint8Array,isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,t)=>t.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function yn(r,t,e={}){let n=(o,s,a)=>{let c=cg[s];if(typeof c!="function")throw new Error(`Invalid validator "${s}", expected function`);let f=r[o];if(!(a&&f===void 0)&&!c(f,r))throw new Error(`Invalid param ${String(o)}=${f} (${typeof f}), expected ${s}`)};for(let[o,s]of Object.entries(t))n(o,s,!1);for(let[o,s]of Object.entries(e))n(o,s,!0);return r}var it=BigInt(0),Ye=BigInt(1),Kn=BigInt(2),ug=BigInt(3),ja=BigInt(4),Lf=BigInt(5),Hf=BigInt(8),fg=BigInt(9),dg=BigInt(16);function ct(r,t){let e=r%t;return e>=it?e:t+e}function lg(r,t,e){if(e<=it||t<it)throw new Error("Expected power/modulo > 0");if(e===Ye)return it;let n=Ye;for(;t>it;)t&Ye&&(n=n*r%e),r=r*r%e,t>>=Ye;return n}function Ot(r,t,e){let n=r;for(;t-- >it;)n*=n,n%=e;return n}function ni(r,t){if(r===it||t<=it)throw new Error(`invert: expected positive integers, got n=${r} mod=${t}`);let e=ct(r,t),n=t,o=it,s=Ye,a=Ye,c=it;for(;e!==it;){let h=n/e,g=n%e,y=o-a*h,w=s-c*h;n=e,e=g,o=a,s=c,a=y,c=w}if(n!==Ye)throw new Error("invert: does not exist");return ct(o,t)}function pg(r){let t=(r-Ye)/Kn,e,n,o;for(e=r-Ye,n=0;e%Kn===it;e/=Kn,n++);for(o=Kn;o<r&&lg(o,t,r)!==r-Ye;o++);if(n===1){let a=(r+Ye)/ja;return function(f,h){let g=f.pow(h,a);if(!f.eql(f.sqr(g),h))throw new Error("Cannot find square root");return g}}let s=(e+Ye)/Kn;return function(c,f){if(c.pow(f,t)===c.neg(c.ONE))throw new Error("Cannot find square root");let h=n,g=c.pow(c.mul(c.ONE,o),e),y=c.pow(f,s),w=c.pow(f,e);for(;!c.eql(w,c.ONE);){if(c.eql(w,c.ZERO))return c.ZERO;let b=1;for(let T=c.sqr(w);b<h&&!c.eql(T,c.ONE);b++)T=c.sqr(T);let I=c.pow(g,Ye<<BigInt(h-b-1));g=c.sqr(I),y=c.mul(y,I),w=c.mul(w,g),h=b}return y}}function hg(r){if(r%ja===ug){let t=(r+Ye)/ja;return function(n,o){let s=n.pow(o,t);if(!n.eql(n.sqr(s),o))throw new Error("Cannot find square root");return s}}if(r%Hf===Lf){let t=(r-Lf)/Hf;return function(n,o){let s=n.mul(o,Kn),a=n.pow(s,t),c=n.mul(o,a),f=n.mul(n.mul(c,Kn),a),h=n.mul(c,n.sub(f,n.ONE));if(!n.eql(n.sqr(h),o))throw new Error("Cannot find square root");return h}}return r%dg,pg(r)}var gg=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Va(r){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},e=gg.reduce((n,o)=>(n[o]="function",n),t);return yn(r,e)}function yg(r,t,e){if(e<it)throw new Error("Expected power > 0");if(e===it)return r.ONE;if(e===Ye)return t;let n=r.ONE,o=t;for(;e>it;)e&Ye&&(n=r.mul(n,o)),o=r.sqr(o),e>>=Ye;return n}function mg(r,t){let e=new Array(t.length),n=t.reduce((s,a,c)=>r.is0(a)?s:(e[c]=s,r.mul(s,a)),r.ONE),o=r.inv(n);return t.reduceRight((s,a,c)=>r.is0(a)?s:(e[c]=r.mul(s,e[c]),r.mul(s,a)),o),e}function Wa(r,t){let e=t!==void 0?t:r.toString(2).length,n=Math.ceil(e/8);return{nBitLength:e,nByteLength:n}}function Gf(r,t,e=!1,n={}){if(r<=it)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:o,nByteLength:s}=Wa(r,t);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let a=hg(r),c=Object.freeze({ORDER:r,BITS:o,BYTES:s,MASK:Xo(o),ZERO:it,ONE:Ye,create:f=>ct(f,r),isValid:f=>{if(typeof f!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof f}`);return it<=f&&f<r},is0:f=>f===it,isOdd:f=>(f&Ye)===Ye,neg:f=>ct(-f,r),eql:(f,h)=>f===h,sqr:f=>ct(f*f,r),add:(f,h)=>ct(f+h,r),sub:(f,h)=>ct(f-h,r),mul:(f,h)=>ct(f*h,r),pow:(f,h)=>yg(c,f,h),div:(f,h)=>ct(f*ni(h,r),r),sqrN:f=>f*f,addN:(f,h)=>f+h,subN:(f,h)=>f-h,mulN:(f,h)=>f*h,inv:f=>ni(f,r),sqrt:n.sqrt||(f=>a(c,f)),invertBatch:f=>mg(c,f),cmov:(f,h,g)=>g?h:f,toBytes:f=>e?ri(f,s):gn(f,s),fromBytes:f=>{if(f.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${f.length}`);return e?ti(f):Ir(f)}});return Object.freeze(c)}function Ff(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let t=r.toString(2).length;return Math.ceil(t/8)}function Qa(r){let t=Ff(r);return t+Math.ceil(t/2)}function $f(r,t,e=!1){let n=r.length,o=Ff(t),s=Qa(t);if(n<16||n<s||n>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let a=e?Ir(r):ti(r),c=ct(a,t-Ye)+Ye;return e?ri(c,o):gn(c,o)}var bg=BigInt(0),Ya=BigInt(1);function Kf(r,t){let e=(o,s)=>{let a=s.negate();return o?a:s},n=o=>{let s=Math.ceil(t/o)+1,a=2**(o-1);return{windows:s,windowSize:a}};return{constTimeNegate:e,unsafeLadder(o,s){let a=r.ZERO,c=o;for(;s>bg;)s&Ya&&(a=a.add(c)),c=c.double(),s>>=Ya;return a},precomputeWindow(o,s){let{windows:a,windowSize:c}=n(s),f=[],h=o,g=h;for(let y=0;y<a;y++){g=h,f.push(g);for(let w=1;w<c;w++)g=g.add(h),f.push(g);h=g.double()}return f},wNAF(o,s,a){let{windows:c,windowSize:f}=n(o),h=r.ZERO,g=r.BASE,y=BigInt(2**o-1),w=2**o,b=BigInt(o);for(let I=0;I<c;I++){let T=I*f,S=Number(a&y);a>>=b,S>f&&(S-=w,a+=Ya);let R=T,M=T+Math.abs(S)-1,E=I%2!==0,K=S<0;S===0?g=g.add(e(E,s[R])):h=h.add(e(K,s[M]))}return{p:h,f:g}},wNAFCached(o,s,a,c){let f=o._WINDOW_SIZE||1,h=s.get(o);return h||(h=this.precomputeWindow(o,f),f!==1&&s.set(o,c(h))),this.wNAF(f,h,a)}}}function Xa(r){return Va(r.Fp),yn(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Wa(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}function Ag(r){let t=Xa(r);yn(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:e,Fp:n,a:o}=t;if(e){if(!n.eql(o,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof e!="object"||typeof e.beta!="bigint"||typeof e.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}var{bytesToNumberBE:wg,hexToBytes:Tg}=Ka,jn={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(r){let{Err:t}=jn;if(r.length<2||r[0]!==2)throw new t("Invalid signature integer tag");let e=r[1],n=r.subarray(2,e+2);if(!e||n.length!==e)throw new t("Invalid signature integer: wrong length");if(n[0]&128)throw new t("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:wg(n),l:r.subarray(e+2)}},toSig(r){let{Err:t}=jn,e=typeof r=="string"?Tg(r):r;if(!(e instanceof Uint8Array))throw new Error("ui8a expected");let n=e.length;if(n<2||e[0]!=48)throw new t("Invalid signature tag");if(e[1]!==n-2)throw new t("Invalid signature: incorrect length");let{d:o,l:s}=jn._parseInt(e.subarray(2)),{d:a,l:c}=jn._parseInt(s);if(c.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:a}},hexFromSig(r){let t=h=>Number.parseInt(h[0],16)&8?"00"+h:h,e=h=>{let g=h.toString(16);return g.length&1?`0${g}`:g},n=t(e(r.s)),o=t(e(r.r)),s=n.length/2,a=o.length/2,c=e(s),f=e(a);return`30${e(a+s+4)}02${f}${o}02${c}${n}`}},Rr=BigInt(0),Ht=BigInt(1),SA=BigInt(2),jf=BigInt(3),UA=BigInt(4);function _g(r){let t=Ag(r),{Fp:e}=t,n=t.toBytes||((I,T,S)=>{let R=T.toAffine();return go(Uint8Array.from([4]),e.toBytes(R.x),e.toBytes(R.y))}),o=t.fromBytes||(I=>{let T=I.subarray(1),S=e.fromBytes(T.subarray(0,e.BYTES)),R=e.fromBytes(T.subarray(e.BYTES,2*e.BYTES));return{x:S,y:R}});function s(I){let{a:T,b:S}=t,R=e.sqr(I),M=e.mul(R,I);return e.add(e.add(M,e.mul(I,T)),S)}if(!e.eql(e.sqr(t.Gy),s(t.Gx)))throw new Error("bad generator point: equation left != right");function a(I){return typeof I=="bigint"&&Rr<I&&I<t.n}function c(I){if(!a(I))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function f(I){let{allowedPrivateKeyLengths:T,nByteLength:S,wrapPrivateKey:R,n:M}=t;if(T&&typeof I!="bigint"){if(I instanceof Uint8Array&&(I=Fn(I)),typeof I!="string"||!T.includes(I.length))throw new Error("Invalid key");I=I.padStart(S*2,"0")}let E;try{E=typeof I=="bigint"?I:Ir(kt("private key",I,S))}catch{throw new Error(`private key must be ${S} bytes, hex or bigint, not ${typeof I}`)}return R&&(E=ct(E,M)),c(E),E}let h=new Map;function g(I){if(!(I instanceof y))throw new Error("ProjectivePoint expected")}class y{constructor(T,S,R){if(this.px=T,this.py=S,this.pz=R,T==null||!e.isValid(T))throw new Error("x required");if(S==null||!e.isValid(S))throw new Error("y required");if(R==null||!e.isValid(R))throw new Error("z required")}static fromAffine(T){let{x:S,y:R}=T||{};if(!T||!e.isValid(S)||!e.isValid(R))throw new Error("invalid affine point");if(T instanceof y)throw new Error("projective point not allowed");let M=E=>e.eql(E,e.ZERO);return M(S)&&M(R)?y.ZERO:new y(S,R,e.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(T){let S=e.invertBatch(T.map(R=>R.pz));return T.map((R,M)=>R.toAffine(S[M])).map(y.fromAffine)}static fromHex(T){let S=y.fromAffine(o(kt("pointHex",T)));return S.assertValidity(),S}static fromPrivateKey(T){return y.BASE.multiply(f(T))}_setWindowSize(T){this._WINDOW_SIZE=T,h.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!e.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:T,y:S}=this.toAffine();if(!e.isValid(T)||!e.isValid(S))throw new Error("bad point: x or y not FE");let R=e.sqr(S),M=s(T);if(!e.eql(R,M))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:T}=this.toAffine();if(e.isOdd)return!e.isOdd(T);throw new Error("Field doesn't support isOdd")}equals(T){g(T);let{px:S,py:R,pz:M}=this,{px:E,py:K,pz:D}=T,F=e.eql(e.mul(S,D),e.mul(E,M)),J=e.eql(e.mul(R,D),e.mul(K,M));return F&&J}negate(){return new y(this.px,e.neg(this.py),this.pz)}double(){let{a:T,b:S}=t,R=e.mul(S,jf),{px:M,py:E,pz:K}=this,D=e.ZERO,F=e.ZERO,J=e.ZERO,G=e.mul(M,M),oe=e.mul(E,E),de=e.mul(K,K),ce=e.mul(M,E);return ce=e.add(ce,ce),J=e.mul(M,K),J=e.add(J,J),D=e.mul(T,J),F=e.mul(R,de),F=e.add(D,F),D=e.sub(oe,F),F=e.add(oe,F),F=e.mul(D,F),D=e.mul(ce,D),J=e.mul(R,J),de=e.mul(T,de),ce=e.sub(G,de),ce=e.mul(T,ce),ce=e.add(ce,J),J=e.add(G,G),G=e.add(J,G),G=e.add(G,de),G=e.mul(G,ce),F=e.add(F,G),de=e.mul(E,K),de=e.add(de,de),G=e.mul(de,ce),D=e.sub(D,G),J=e.mul(de,oe),J=e.add(J,J),J=e.add(J,J),new y(D,F,J)}add(T){g(T);let{px:S,py:R,pz:M}=this,{px:E,py:K,pz:D}=T,F=e.ZERO,J=e.ZERO,G=e.ZERO,oe=t.a,de=e.mul(t.b,jf),ce=e.mul(S,E),Pe=e.mul(R,K),Oe=e.mul(M,D),at=e.add(S,R),z=e.add(E,K);at=e.mul(at,z),z=e.add(ce,Pe),at=e.sub(at,z),z=e.add(S,M);let V=e.add(E,D);return z=e.mul(z,V),V=e.add(ce,Oe),z=e.sub(z,V),V=e.add(R,M),F=e.add(K,D),V=e.mul(V,F),F=e.add(Pe,Oe),V=e.sub(V,F),G=e.mul(oe,z),F=e.mul(de,Oe),G=e.add(F,G),F=e.sub(Pe,G),G=e.add(Pe,G),J=e.mul(F,G),Pe=e.add(ce,ce),Pe=e.add(Pe,ce),Oe=e.mul(oe,Oe),z=e.mul(de,z),Pe=e.add(Pe,Oe),Oe=e.sub(ce,Oe),Oe=e.mul(oe,Oe),z=e.add(z,Oe),ce=e.mul(Pe,z),J=e.add(J,ce),ce=e.mul(V,z),F=e.mul(at,F),F=e.sub(F,ce),ce=e.mul(at,Pe),G=e.mul(V,G),G=e.add(G,ce),new y(F,J,G)}subtract(T){return this.add(T.negate())}is0(){return this.equals(y.ZERO)}wNAF(T){return b.wNAFCached(this,h,T,S=>{let R=e.invertBatch(S.map(M=>M.pz));return S.map((M,E)=>M.toAffine(R[E])).map(y.fromAffine)})}multiplyUnsafe(T){let S=y.ZERO;if(T===Rr)return S;if(c(T),T===Ht)return this;let{endo:R}=t;if(!R)return b.unsafeLadder(this,T);let{k1neg:M,k1:E,k2neg:K,k2:D}=R.splitScalar(T),F=S,J=S,G=this;for(;E>Rr||D>Rr;)E&Ht&&(F=F.add(G)),D&Ht&&(J=J.add(G)),G=G.double(),E>>=Ht,D>>=Ht;return M&&(F=F.negate()),K&&(J=J.negate()),J=new y(e.mul(J.px,R.beta),J.py,J.pz),F.add(J)}multiply(T){c(T);let S=T,R,M,{endo:E}=t;if(E){let{k1neg:K,k1:D,k2neg:F,k2:J}=E.splitScalar(S),{p:G,f:oe}=this.wNAF(D),{p:de,f:ce}=this.wNAF(J);G=b.constTimeNegate(K,G),de=b.constTimeNegate(F,de),de=new y(e.mul(de.px,E.beta),de.py,de.pz),R=G.add(de),M=oe.add(ce)}else{let{p:K,f:D}=this.wNAF(S);R=K,M=D}return y.normalizeZ([R,M])[0]}multiplyAndAddUnsafe(T,S,R){let M=y.BASE,E=(D,F)=>F===Rr||F===Ht||!D.equals(M)?D.multiplyUnsafe(F):D.multiply(F),K=E(this,S).add(E(T,R));return K.is0()?void 0:K}toAffine(T){let{px:S,py:R,pz:M}=this,E=this.is0();T==null&&(T=E?e.ONE:e.inv(M));let K=e.mul(S,T),D=e.mul(R,T),F=e.mul(M,T);if(E)return{x:e.ZERO,y:e.ZERO};if(!e.eql(F,e.ONE))throw new Error("invZ was invalid");return{x:K,y:D}}isTorsionFree(){let{h:T,isTorsionFree:S}=t;if(T===Ht)return!0;if(S)return S(y,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:T,clearCofactor:S}=t;return T===Ht?this:S?S(y,this):this.multiplyUnsafe(t.h)}toRawBytes(T=!0){return this.assertValidity(),n(y,this,T)}toHex(T=!0){return Fn(this.toRawBytes(T))}}y.BASE=new y(t.Gx,t.Gy,e.ONE),y.ZERO=new y(e.ZERO,e.ONE,e.ZERO);let w=t.nBitLength,b=Kf(y,t.endo?Math.ceil(w/2):w);return{CURVE:t,ProjectivePoint:y,normPrivateKeyToScalar:f,weierstrassEquation:s,isWithinCurveOrder:a}}function vg(r){let t=Xa(r);return yn(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Vf(r){let t=vg(r),{Fp:e,n}=t,o=e.BYTES+1,s=2*e.BYTES+1;function a(z){return Rr<z&&z<e.ORDER}function c(z){return ct(z,n)}function f(z){return ni(z,n)}let{ProjectivePoint:h,normPrivateKeyToScalar:g,weierstrassEquation:y,isWithinCurveOrder:w}=_g({...t,toBytes(z,V,le){let Re=V.toAffine(),ke=e.toBytes(Re.x),Ze=go;return le?Ze(Uint8Array.from([V.hasEvenY()?2:3]),ke):Ze(Uint8Array.from([4]),ke,e.toBytes(Re.y))},fromBytes(z){let V=z.length,le=z[0],Re=z.subarray(1);if(V===o&&(le===2||le===3)){let ke=Ir(Re);if(!a(ke))throw new Error("Point is not on curve");let Ze=y(ke),dt=e.sqrt(Ze),Me=(dt&Ht)===Ht;return(le&1)===1!==Me&&(dt=e.neg(dt)),{x:ke,y:dt}}else if(V===s&&le===4){let ke=e.fromBytes(Re.subarray(0,e.BYTES)),Ze=e.fromBytes(Re.subarray(e.BYTES,2*e.BYTES));return{x:ke,y:Ze}}else throw new Error(`Point of length ${V} was invalid. Expected ${o} compressed bytes or ${s} uncompressed bytes`)}}),b=z=>Fn(gn(z,t.nByteLength));function I(z){let V=n>>Ht;return z>V}function T(z){return I(z)?c(-z):z}let S=(z,V,le)=>Ir(z.slice(V,le));class R{constructor(V,le,Re){this.r=V,this.s=le,this.recovery=Re,this.assertValidity()}static fromCompact(V){let le=t.nByteLength;return V=kt("compactSignature",V,le*2),new R(S(V,0,le),S(V,le,2*le))}static fromDER(V){let{r:le,s:Re}=jn.toSig(kt("DER",V));return new R(le,Re)}assertValidity(){if(!w(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!w(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(V){return new R(this.r,this.s,V)}recoverPublicKey(V){let{r:le,s:Re,recovery:ke}=this,Ze=J(kt("msgHash",V));if(ke==null||![0,1,2,3].includes(ke))throw new Error("recovery id invalid");let dt=ke===2||ke===3?le+t.n:le;if(dt>=e.ORDER)throw new Error("recovery id 2 or 3 invalid");let Me=(ke&1)===0?"02":"03",rt=h.fromHex(Me+b(dt)),pe=f(dt),nt=c(-Ze*pe),Yr=c(Re*pe),Vt=h.BASE.multiplyAndAddUnsafe(rt,nt,Yr);if(!Vt)throw new Error("point at infinify");return Vt.assertValidity(),Vt}hasHighS(){return I(this.s)}normalizeS(){return this.hasHighS()?new R(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return $n(this.toDERHex())}toDERHex(){return jn.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return $n(this.toCompactHex())}toCompactHex(){return b(this.r)+b(this.s)}}let M={isValidPrivateKey(z){try{return g(z),!0}catch{return!1}},normPrivateKeyToScalar:g,randomPrivateKey:()=>{let z=Qa(t.n);return $f(t.randomBytes(z),t.n)},precompute(z=8,V=h.BASE){return V._setWindowSize(z),V.multiply(BigInt(3)),V}};function E(z,V=!0){return h.fromPrivateKey(z).toRawBytes(V)}function K(z){let V=z instanceof Uint8Array,le=typeof z=="string",Re=(V||le)&&z.length;return V?Re===o||Re===s:le?Re===2*o||Re===2*s:z instanceof h}function D(z,V,le=!0){if(K(z))throw new Error("first arg must be private key");if(!K(V))throw new Error("second arg must be public key");return h.fromHex(V).multiply(g(z)).toRawBytes(le)}let F=t.bits2int||function(z){let V=Ir(z),le=z.length*8-t.nBitLength;return le>0?V>>BigInt(le):V},J=t.bits2int_modN||function(z){return c(F(z))},G=Xo(t.nBitLength);function oe(z){if(typeof z!="bigint")throw new Error("bigint expected");if(!(Rr<=z&&z<G))throw new Error(`bigint expected < 2^${t.nBitLength}`);return gn(z,t.nByteLength)}function de(z,V,le=ce){if(["recovered","canonical"].some(Mt=>Mt in le))throw new Error("sign() legacy options not supported");let{hash:Re,randomBytes:ke}=t,{lowS:Ze,prehash:dt,extraEntropy:Me}=le;Ze==null&&(Ze=!0),z=kt("msgHash",z),dt&&(z=kt("prehashed msgHash",Re(z)));let rt=J(z),pe=g(V),nt=[oe(pe),oe(rt)];if(Me!=null){let Mt=Me===!0?ke(e.BYTES):Me;nt.push(kt("extraEntropy",Mt))}let Yr=go(...nt),Vt=rt;function Xr(Mt){let Tr=F(Mt);if(!w(Tr))return;let Rn=f(Tr),It=h.BASE.multiply(Tr).toAffine(),Zr=c(It.x);if(Zr===Rr)return;let Jn=c(Rn*c(Vt+Zr*pe));if(Jn===Rr)return;let bs=(It.x===Zr?0:2)|Number(It.y&Ht),Bo=Jn;return Ze&&I(Jn)&&(Bo=T(Jn),bs^=1),new R(Zr,Bo,bs)}return{seed:Yr,k2sig:Xr}}let ce={lowS:t.lowS,prehash:!1},Pe={lowS:t.lowS,prehash:!1};function Oe(z,V,le=ce){let{seed:Re,k2sig:ke}=de(z,V,le),Ze=t;return $a(Ze.hash.outputLen,Ze.nByteLength,Ze.hmac)(Re,ke)}h.BASE._setWindowSize(8);function at(z,V,le,Re=Pe){let ke=z;if(V=kt("msgHash",V),le=kt("publicKey",le),"strict"in Re)throw new Error("options.strict was renamed to lowS");let{lowS:Ze,prehash:dt}=Re,Me,rt;try{if(typeof ke=="string"||ke instanceof Uint8Array)try{Me=R.fromDER(ke)}catch(It){if(!(It instanceof jn.Err))throw It;Me=R.fromCompact(ke)}else if(typeof ke=="object"&&typeof ke.r=="bigint"&&typeof ke.s=="bigint"){let{r:It,s:Zr}=ke;Me=new R(It,Zr)}else throw new Error("PARSE");rt=h.fromHex(le)}catch(It){if(It.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Ze&&Me.hasHighS())return!1;dt&&(V=t.hash(V));let{r:pe,s:nt}=Me,Yr=J(V),Vt=f(nt),Xr=c(Yr*Vt),Mt=c(pe*Vt),Tr=h.BASE.multiplyAndAddUnsafe(rt,Xr,Mt)?.toAffine();return Tr?c(Tr.x)===pe:!1}return{CURVE:t,getPublicKey:E,getSharedSecret:D,sign:Oe,verify:at,ProjectivePoint:h,Signature:R,utils:M}}var oi=class extends po{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,Pf(t);let n=Qo(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=t.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),s.fill(0)}update(t){return lo(this),this.iHash.update(t),this}digestInto(t){lo(this),Cr(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:n,finished:o,destroyed:s,blockLen:a,outputLen:c}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=a,t.outputLen=c,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},yo=(r,t,e)=>new oi(r,t).update(e).digest();yo.create=(r,t)=>new oi(r,t);function Eg(r){return{hash:r,hmac:(t,...e)=>yo(r,t,Gn(...e)),randomBytes:Nf}}function Wf(r,t){let e=n=>Vf({...r,...Eg(n)});return Object.freeze({...e(t),create:e})}var Xf=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Qf=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Sg=BigInt(1),Za=BigInt(2),Yf=(r,t)=>(r+t/Za)/t;function Ug(r){let t=Xf,e=BigInt(3),n=BigInt(6),o=BigInt(11),s=BigInt(22),a=BigInt(23),c=BigInt(44),f=BigInt(88),h=r*r*r%t,g=h*h*r%t,y=Ot(g,e,t)*g%t,w=Ot(y,e,t)*g%t,b=Ot(w,Za,t)*h%t,I=Ot(b,o,t)*b%t,T=Ot(I,s,t)*I%t,S=Ot(T,c,t)*T%t,R=Ot(S,f,t)*S%t,M=Ot(R,c,t)*T%t,E=Ot(M,e,t)*g%t,K=Ot(E,a,t)*I%t,D=Ot(K,n,t)*h%t,F=Ot(D,Za,t);if(!Ja.eql(Ja.sqr(F),r))throw new Error("Cannot find square root");return F}var Ja=Gf(Xf,void 0,void 0,{sqrt:Ug}),yt=Wf({a:BigInt(0),b:BigInt(7),Fp:Ja,n:Qf,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let t=Qf,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Sg*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=e,a=BigInt("0x100000000000000000000000000000000"),c=Yf(s*r,t),f=Yf(-n*r,t),h=ct(r-c*e-f*o,t),g=ct(-c*n-f*s,t),y=h>a,w=g>a;if(y&&(h=t-h),w&&(g=t-g),h>a||g>a)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:y,k1:h,k2neg:w,k2:g}}}},Yo),qA=BigInt(0);var LA=yt.ProjectivePoint;var Bg=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Jf=Uint8Array.from({length:16},(r,t)=>t),Cg=Jf.map(r=>(9*r+5)%16),tc=[Jf],rc=[Cg];for(let r=0;r<4;r++)for(let t of[tc,rc])t.push(t[r].map(e=>Bg[e]));var ed=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(r=>new Uint8Array(r)),Ig=tc.map((r,t)=>r.map(e=>ed[t][e])),Rg=rc.map((r,t)=>r.map(e=>ed[t][e])),Pg=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),kg=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),si=(r,t)=>r<<t|r>>>32-t;function Zf(r,t,e,n){return r===0?t^e^n:r===1?t&e|~t&n:r===2?(t|~e)^n:r===3?t&n|e&~n:t^(e|~n)}var ii=new Uint32Array(16),ec=class extends ln{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:t,h1:e,h2:n,h3:o,h4:s}=this;return[t,e,n,o,s]}set(t,e,n,o,s){this.h0=t|0,this.h1=e|0,this.h2=n|0,this.h3=o|0,this.h4=s|0}process(t,e){for(let b=0;b<16;b++,e+=4)ii[b]=t.getUint32(e,!0);let n=this.h0|0,o=n,s=this.h1|0,a=s,c=this.h2|0,f=c,h=this.h3|0,g=h,y=this.h4|0,w=y;for(let b=0;b<5;b++){let I=4-b,T=Pg[b],S=kg[b],R=tc[b],M=rc[b],E=Ig[b],K=Rg[b];for(let D=0;D<16;D++){let F=si(n+Zf(b,s,c,h)+ii[R[D]]+T,E[D])+y|0;n=y,y=h,h=si(c,10)|0,c=s,s=F}for(let D=0;D<16;D++){let F=si(o+Zf(I,a,f,g)+ii[M[D]]+S,K[D])+w|0;o=w,w=g,g=si(f,10)|0,f=a,a=F}}this.set(this.h1+c+g|0,this.h2+h+w|0,this.h3+y+o|0,this.h4+n+a|0,this.h0+s+f|0)}roundClean(){ii.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}},td=ho(()=>new ec);var ai=BigInt(4294967295),nc=BigInt(32);function rd(r,t=!1){return t?{h:Number(r&ai),l:Number(r>>nc&ai)}:{h:Number(r>>nc&ai)|0,l:Number(r&ai)|0}}function Og(r,t=!1){let e=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o<r.length;o++){let{h:s,l:a}=rd(r[o],t);[e[o],n[o]]=[s,a]}return[e,n]}var zg=(r,t)=>BigInt(r>>>0)<<nc|BigInt(t>>>0),Ng=(r,t,e)=>r>>>e,Dg=(r,t,e)=>r<<32-e|t>>>e,Mg=(r,t,e)=>r>>>e|t<<32-e,qg=(r,t,e)=>r<<32-e|t>>>e,Lg=(r,t,e)=>r<<64-e|t>>>e-32,Hg=(r,t,e)=>r>>>e-32|t<<64-e,Gg=(r,t)=>t,Fg=(r,t)=>r,$g=(r,t,e)=>r<<e|t>>>32-e,Kg=(r,t,e)=>t<<e|r>>>32-e,jg=(r,t,e)=>t<<e-32|r>>>64-e,Vg=(r,t,e)=>r<<e-32|t>>>64-e;function Wg(r,t,e,n){let o=(t>>>0)+(n>>>0);return{h:r+e+(o/2**32|0)|0,l:o|0}}var Qg=(r,t,e)=>(r>>>0)+(t>>>0)+(e>>>0),Yg=(r,t,e,n)=>t+e+n+(r/2**32|0)|0,Xg=(r,t,e,n)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0),Zg=(r,t,e,n,o)=>t+e+n+o+(r/2**32|0)|0,Jg=(r,t,e,n,o)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0)+(o>>>0),ey=(r,t,e,n,o,s)=>t+e+n+o+s+(r/2**32|0)|0;var ty={fromBig:rd,split:Og,toBig:zg,shrSH:Ng,shrSL:Dg,rotrSH:Mg,rotrSL:qg,rotrBH:Lg,rotrBL:Hg,rotr32H:Gg,rotr32L:Fg,rotlSH:$g,rotlSL:Kg,rotlBH:jg,rotlBL:Vg,add:Wg,add3L:Qg,add3H:Yg,add4L:Xg,add4H:Zg,add5H:ey,add5L:Jg},Ae=ty;var[ry,ny]=(()=>Ae.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))))(),mn=new Uint32Array(80),xn=new Uint32Array(80),oc=class extends ln{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:n,Bl:o,Ch:s,Cl:a,Dh:c,Dl:f,Eh:h,El:g,Fh:y,Fl:w,Gh:b,Gl:I,Hh:T,Hl:S}=this;return[t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S]}set(t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S){this.Ah=t|0,this.Al=e|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=a|0,this.Dh=c|0,this.Dl=f|0,this.Eh=h|0,this.El=g|0,this.Fh=y|0,this.Fl=w|0,this.Gh=b|0,this.Gl=I|0,this.Hh=T|0,this.Hl=S|0}process(t,e){for(let E=0;E<16;E++,e+=4)mn[E]=t.getUint32(e),xn[E]=t.getUint32(e+=4);for(let E=16;E<80;E++){let K=mn[E-15]|0,D=xn[E-15]|0,F=Ae.rotrSH(K,D,1)^Ae.rotrSH(K,D,8)^Ae.shrSH(K,D,7),J=Ae.rotrSL(K,D,1)^Ae.rotrSL(K,D,8)^Ae.shrSL(K,D,7),G=mn[E-2]|0,oe=xn[E-2]|0,de=Ae.rotrSH(G,oe,19)^Ae.rotrBH(G,oe,61)^Ae.shrSH(G,oe,6),ce=Ae.rotrSL(G,oe,19)^Ae.rotrBL(G,oe,61)^Ae.shrSL(G,oe,6),Pe=Ae.add4L(J,ce,xn[E-7],xn[E-16]),Oe=Ae.add4H(Pe,F,de,mn[E-7],mn[E-16]);mn[E]=Oe|0,xn[E]=Pe|0}let{Ah:n,Al:o,Bh:s,Bl:a,Ch:c,Cl:f,Dh:h,Dl:g,Eh:y,El:w,Fh:b,Fl:I,Gh:T,Gl:S,Hh:R,Hl:M}=this;for(let E=0;E<80;E++){let K=Ae.rotrSH(y,w,14)^Ae.rotrSH(y,w,18)^Ae.rotrBH(y,w,41),D=Ae.rotrSL(y,w,14)^Ae.rotrSL(y,w,18)^Ae.rotrBL(y,w,41),F=y&b^~y&T,J=w&I^~w&S,G=Ae.add5L(M,D,J,ny[E],xn[E]),oe=Ae.add5H(G,R,K,F,ry[E],mn[E]),de=G|0,ce=Ae.rotrSH(n,o,28)^Ae.rotrBH(n,o,34)^Ae.rotrBH(n,o,39),Pe=Ae.rotrSL(n,o,28)^Ae.rotrBL(n,o,34)^Ae.rotrBL(n,o,39),Oe=n&s^n&c^s&c,at=o&a^o&f^a&f;R=T|0,M=S|0,T=b|0,S=I|0,b=y|0,I=w|0,{h:y,l:w}=Ae.add(h|0,g|0,oe|0,de|0),h=c|0,g=f|0,c=s|0,f=a|0,s=n|0,a=o|0;let z=Ae.add3L(de,Pe,at);n=Ae.add3H(z,oe,ce,Oe),o=z|0}({h:n,l:o}=Ae.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:a}=Ae.add(this.Bh|0,this.Bl|0,s|0,a|0),{h:c,l:f}=Ae.add(this.Ch|0,this.Cl|0,c|0,f|0),{h,l:g}=Ae.add(this.Dh|0,this.Dl|0,h|0,g|0),{h:y,l:w}=Ae.add(this.Eh|0,this.El|0,y|0,w|0),{h:b,l:I}=Ae.add(this.Fh|0,this.Fl|0,b|0,I|0),{h:T,l:S}=Ae.add(this.Gh|0,this.Gl|0,T|0,S|0),{h:R,l:M}=Ae.add(this.Hh|0,this.Hl|0,R|0,M|0),this.set(n,o,s,a,c,f,h,g,y,w,b,I,T,S,R,M)}roundClean(){mn.fill(0),xn.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var sc=ho(()=>new oc);function Vn(r){if(!Number.isSafeInteger(r))throw new Error(`Wrong integer: ${r}`)}function er(...r){let t=(o,s)=>a=>o(s(a)),e=Array.from(r).reverse().reduce((o,s)=>o?t(o,s.encode):s.encode,void 0),n=r.reduce((o,s)=>o?t(o,s.decode):s.decode,void 0);return{encode:e,decode:n}}function hr(r){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(e=>{if(Vn(e),e<0||e>=r.length)throw new Error(`Digit index outside alphabet: ${e} (alphabet: ${r.length})`);return r[e]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(e=>{if(typeof e!="string")throw new Error(`alphabet.decode: not string element=${e}`);let n=r.indexOf(e);if(n===-1)throw new Error(`Unknown letter: "${e}". Allowed: ${r}`);return n})}}}function gr(r=""){if(typeof r!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let e of t)if(typeof e!="string")throw new Error(`join.encode: non-string input=${e}`);return t.join(r)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(r)}}}function ui(r,t="="){if(Vn(r),typeof t!="string")throw new Error("padding chr should be string");return{encode(e){if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("padding.encode input should be array of strings");for(let n of e)if(typeof n!="string")throw new Error(`padding.encode: non-string input=${n}`);for(;e.length*r%8;)e.push(t);return e},decode(e){if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("padding.encode input should be array of strings");for(let o of e)if(typeof o!="string")throw new Error(`padding.decode: non-string input=${o}`);let n=e.length;if(n*r%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&e[n-1]===t;n--)if(!((n-1)*r%8))throw new Error("Invalid padding: string has too much padding");return e.slice(0,n)}}}function sd(r){if(typeof r!="function")throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>r(t)}}function nd(r,t,e){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(e<2)throw new Error(`convertRadix: wrong to=${e}, base cannot be less than 2`);if(!Array.isArray(r))throw new Error("convertRadix: data should be array");if(!r.length)return[];let n=0,o=[],s=Array.from(r);for(s.forEach(a=>{if(Vn(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,c=!0;for(let f=n;f<s.length;f++){let h=s[f],g=t*a+h;if(!Number.isSafeInteger(g)||t*a/t!==a||g-h!==t*a)throw new Error("convertRadix: carry overflow");a=g%e;let y=Math.floor(g/e);if(s[f]=y,!Number.isSafeInteger(y)||y*e+a!==g)throw new Error("convertRadix: carry overflow");if(c)y?c=!1:n=f;else continue}if(o.push(a),c)break}for(let a=0;a<r.length-1&&r[a]===0;a++)o.push(0);return o.reverse()}var id=(r,t)=>t?id(t,r%t):r,ci=(r,t)=>r+(t-id(r,t));function od(r,t,e,n){if(!Array.isArray(r))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(e<=0||e>32)throw new Error(`convertRadix2: wrong to=${e}`);if(ci(t,e)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${e} carryBits=${ci(t,e)}`);let o=0,s=0,a=2**e-1,c=[];for(let f of r){if(Vn(f),f>=2**t)throw new Error(`convertRadix2: invalid data word=${f} from=${t}`);if(o=o<<t|f,s+t>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=e;s-=e)c.push((o>>s-e&a)>>>0);o&=2**s-1}if(o=o<<e-s&a,!n&&s>=t)throw new Error("Excess padding");if(!n&&o)throw new Error(`Non-zero padding: ${o}`);return n&&s>0&&c.push(o>>>0),c}function oy(r){return Vn(r),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return nd(Array.from(t),2**8,r)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(nd(t,r,2**8))}}}function bn(r,t=!1){if(Vn(r),r<=0||r>32)throw new Error("radix2: bits should be in (0..32]");if(ci(8,r)>32||ci(r,8)>32)throw new Error("radix2: carry overflow");return{encode:e=>{if(!(e instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return od(Array.from(e),8,r,!t)},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(od(e,r,8,t))}}}function sy(r,t){if(Vn(r),typeof t!="function")throw new Error("checksum fn should be function");return{encode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");let n=t(e).slice(0,r),o=new Uint8Array(e.length+r);return o.set(e),o.set(n,e.length),o},decode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");let n=e.slice(0,-r),o=t(n).slice(0,r),s=e.slice(-r);for(let a=0;a<r;a++)if(o[a]!==s[a])throw new Error("Invalid checksum");return n}}}var YA=er(bn(4),hr("0123456789ABCDEF"),gr("")),XA=er(bn(5),hr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),ui(5),gr("")),ZA=er(bn(5),hr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),ui(5),gr("")),JA=er(bn(5),hr("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),gr(""),sd(r=>r.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),e1=er(bn(6),hr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),ui(6),gr("")),t1=er(bn(6),hr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),ui(6),gr("")),r1=er(bn(6),hr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),gr("")),iy=r=>er(oy(58),hr(r),gr("")),ay=iy("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var ad=r=>er(sy(4,t=>r(r(t))),ay),n1=er(hr("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),gr(""));var o1=er(bn(4),hr("0123456789abcdef"),gr(""),sd(r=>{if(typeof r!="string"||r.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof r} with length ${r.length}`);return r.toLowerCase()}));var fi=yt.ProjectivePoint,ic=ad(Yo);function cd(r){return BigInt(`0x${Of(r)}`)}function cy(r){return zf(r.toString(16).padStart(64,"0"))}var uy=La("Bitcoin seed"),ac={private:76066276,public:76067358},cc=2147483648,fy=r=>td(Yo(r)),dy=r=>dn(r).getUint32(0,!1),di=r=>{if(!Number.isSafeInteger(r)||r<0||r>2**32-1)throw new Error(`Invalid number=${r}. Should be from 0 to 2 ** 32 - 1`);let t=new Uint8Array(4);return dn(t).setUint32(0,r,!1),t},yr=class{get fingerprint(){if(!this.pubHash)throw new Error("No publicKey set!");return dy(this.pubHash)}get identifier(){return this.pubHash}get pubKeyHash(){return this.pubHash}get privateKey(){return this.privKeyBytes||null}get publicKey(){return this.pubKey||null}get privateExtendedKey(){let t=this.privateKey;if(!t)throw new Error("No private key");return ic.encode(this.serialize(this.versions.private,Gn(new Uint8Array([0]),t)))}get publicExtendedKey(){if(!this.pubKey)throw new Error("No public key");return ic.encode(this.serialize(this.versions.public,this.pubKey))}static fromMasterSeed(t,e=ac){if(Cr(t),8*t.length<128||8*t.length>512)throw new Error(`HDKey: wrong seed length=${t.length}. Should be between 128 and 512 bits; 256 bits is advised)`);let n=yo(sc,uy,t);return new yr({versions:e,chainCode:n.slice(32),privateKey:n.slice(0,32)})}static fromExtendedKey(t,e=ac){let n=ic.decode(t),o=dn(n),s=o.getUint32(0,!1),a={versions:e,depth:n[4],parentFingerprint:o.getUint32(5,!1),index:o.getUint32(9,!1),chainCode:n.slice(13,45)},c=n.slice(45),f=c[0]===0;if(s!==e[f?"private":"public"])throw new Error("Version mismatch");return f?new yr({...a,privateKey:c.slice(1)}):new yr({...a,publicKey:c})}static fromJSON(t){return yr.fromExtendedKey(t.xpriv)}constructor(t){if(this.depth=0,this.index=0,this.chainCode=null,this.parentFingerprint=0,!t||typeof t!="object")throw new Error("HDKey.constructor must not be called directly");if(this.versions=t.versions||ac,this.depth=t.depth||0,this.chainCode=t.chainCode,this.index=t.index||0,this.parentFingerprint=t.parentFingerprint||0,!this.depth&&(this.parentFingerprint||this.index))throw new Error("HDKey: zero depth with non-zero index/parent fingerprint");if(t.publicKey&&t.privateKey)throw new Error("HDKey: publicKey and privateKey at same time.");if(t.privateKey){if(!yt.utils.isValidPrivateKey(t.privateKey))throw new Error("Invalid private key");this.privKey=typeof t.privateKey=="bigint"?t.privateKey:cd(t.privateKey),this.privKeyBytes=cy(this.privKey),this.pubKey=yt.getPublicKey(t.privateKey,!0)}else if(t.publicKey)this.pubKey=fi.fromHex(t.publicKey).toRawBytes(!0);else throw new Error("HDKey: no public or private key provided");this.pubHash=fy(this.pubKey)}derive(t){if(!/^[mM]'?/.test(t))throw new Error('Path must start with "m" or "M"');if(/^[mM]'?$/.test(t))return this;let e=t.replace(/^[mM]'?\//,"").split("/"),n=this;for(let o of e){let s=/^(\d+)('?)$/.exec(o),a=s&&s[1];if(!s||s.length!==3||typeof a!="string")throw new Error(`Invalid child index: ${o}`);let c=+a;if(!Number.isSafeInteger(c)||c>=cc)throw new Error("Invalid index");s[2]==="'"&&(c+=cc),n=n.deriveChild(c)}return n}deriveChild(t){if(!this.pubKey||!this.chainCode)throw new Error("No publicKey or chainCode set");let e=di(t);if(t>=cc){let c=this.privateKey;if(!c)throw new Error("Could not derive hardened child key");e=Gn(new Uint8Array([0]),c,e)}else e=Gn(this.pubKey,e);let n=yo(sc,this.chainCode,e),o=cd(n.slice(0,32)),s=n.slice(32);if(!yt.utils.isValidPrivateKey(o))throw new Error("Tweak bigger than curve order");let a={versions:this.versions,chainCode:s,depth:this.depth+1,parentFingerprint:this.fingerprint,index:t};try{if(this.privateKey){let c=ct(this.privKey+o,yt.CURVE.n);if(!yt.utils.isValidPrivateKey(c))throw new Error("The tweak was out of range or the resulted private key is invalid");a.privateKey=c}else{let c=fi.fromHex(this.pubKey).add(fi.fromPrivateKey(o));if(c.equals(fi.ZERO))throw new Error("The tweak was equal to negative P, which made the result key invalid");a.publicKey=c.toRawBytes(!0)}return new yr(a)}catch{return this.deriveChild(t+1)}}sign(t){if(!this.privateKey)throw new Error("No privateKey set!");return Cr(t,32),yt.sign(t,this.privKey).toCompactRawBytes()}verify(t,e){if(Cr(t,32),Cr(e,64),!this.publicKey)throw new Error("No publicKey set!");let n;try{n=yt.Signature.fromCompact(e)}catch{return!1}return yt.verify(n,t,this.publicKey)}wipePrivateData(){return this.privKey=void 0,this.privKeyBytes&&(this.privKeyBytes.fill(0),this.privKeyBytes=void 0),this}toJSON(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}}serialize(t,e){if(!this.chainCode)throw new Error("No chainCode set");return Cr(e,33),Gn(di(t),new Uint8Array([this.depth]),di(this.parentFingerprint),di(this.index),this.chainCode,e)}};var mo=class extends Pt{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==mo.LENGTH)throw new Error(`PublicKey length should be ${mo.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}verifySignature(e){let{message:n,signature:o}=e,s=be.fromHexInput(n).toUint8Array(),a=Mn(s),c=o.toUint8Array();return yt.verify(c,a,this.toUint8Array())}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new mo(n)}static load(e){let n=e.deserializeBytes();return new mo(n)}},Gt=mo;Gt.LENGTH=65;var An=class extends Ln{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==An.LENGTH)throw new Error(`PrivateKey length should be ${An.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}sign(e){let n=be.fromHexInput(e),o=Mn(n.toUint8Array()),s=yt.sign(o,this.key.toUint8Array());return new xr(s.toCompactRawBytes())}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new An(n)}static generate(){let e=yt.utils.randomPrivateKey();return new An(e)}publicKey(){let e=yt.getPublicKey(this.key.toUint8Array(),!1);return new Gt(e)}static fromDerivationPath(e,n){if(!za(e))throw new Error(`Invalid derivation path ${e}`);return An.fromDerivationPathInner(e,Vo(n))}static fromDerivationPathInner(e,n){let{privateKey:o}=yr.fromMasterSeed(n).derive(e);if(o===null)throw new Error("Invalid key");return new An(o)}},mr=An;mr.LENGTH=32;var xo=class extends Qt{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==xo.LENGTH)throw new Error(`Signature length should be ${xo.LENGTH}, recieved ${n.toUint8Array().length}`);this.data=n}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new xo(n)}static load(e){let n=e.deserializeBytes();return new xo(n)}},xr=xo;xr.LENGTH=64;var Fe=class extends Pt{constructor(e){super();this.publicKey=e}toUint8Array(){return this.publicKey.toUint8Array()}toString(){return this.publicKey.toString()}verifySignature(e){let{message:n,signature:o}=e;return this.publicKey.verifySignature({message:n,signature:o})}serialize(e){if(this.publicKey instanceof De)e.serializeU32AsUleb128(0),this.publicKey.serialize(e);else if(this.publicKey instanceof Gt)e.serializeU32AsUleb128(1),this.publicKey.serialize(e);else throw new Error("Unknown public key type")}static deserialize(e){let n=e.deserializeUleb128AsU32();switch(n){case 0:return new Fe(De.load(e));case 1:return new Fe(Gt.load(e));default:throw new Error(`Unknown variant index for AnyPublicKey: ${n}`)}}};var Pr=class extends Pt{constructor(e){super();let{publicKeys:n,signaturesRequired:o}=e;if(o<1)throw new Error("The number of required signatures needs to be greater then 0");if(n.length<o)throw new Error(`Provided ${n.length} public keys is smaller than the ${o} required signatures`);let s=[];n.forEach(a=>{a instanceof Fe?s.push(a):s.push(new Fe(a))}),this.publicKeys=s,this.signaturesRequired=o}toUint8Array(){return this.bcsToBytes()}createBitmap(e){let{bits:n}=e,o=128,s=new Uint8Array([0,0,0,0]),a=new Set;return n.forEach((c,f)=>{if(f+1>this.publicKeys.length)throw new Error(`Signature index ${f+1} is out of public keys range, ${this.publicKeys.length}.`);if(a.has(c))throw new Error(`Duplicate bit ${c} detected.`);a.add(c);let h=Math.floor(c/8),g=s[h];g|=o>>c%8,s[h]=g}),s}toString(){return be.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("not implemented")}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let n=e.deserializeVector(Fe),o=e.deserializeU8();return new Pr({publicKeys:n,signaturesRequired:o})}};var wn=class extends te{constructor(e){super();let{data:n}=e,o=be.fromHexInput(n);if(o.toUint8Array().length!==wn.LENGTH)throw new Error(`Authentication Key length should be ${wn.LENGTH}`);this.data=o}serialize(e){e.serializeFixedBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeFixedBytes(wn.LENGTH);return new wn({data:n})}toString(){return this.data.toString()}toUint8Array(){return this.data.toUint8Array()}static fromPublicKeyAndScheme(e){let{publicKey:n,scheme:o}=e,s;switch(o){case 3:case 2:{let f=n.bcsToBytes();s=new Uint8Array([...f,o]);break}case 0:case 1:{let f=n.toUint8Array(),h=be.fromHexInput(f).toUint8Array();s=new Uint8Array([...h,o]);break}default:throw new Error(`Scheme ${o} is not supported`)}let a=Mn.create();a.update(s);let c=a.digest();return new wn({data:c})}static fromPublicKey(e){let{publicKey:n}=e,o;if(n instanceof De)o=0 .valueOf();else if(n instanceof Et)o=1 .valueOf();else if(n instanceof Fe)o=2 .valueOf();else if(n instanceof Pr)o=3 .valueOf();else throw new Error("No supported authentication scheme for public key");return wn.fromPublicKeyAndScheme({publicKey:n,scheme:o})}derivedAddress(){return new O(this.data.toUint8Array())}},Ft=wn;Ft.LENGTH=32;var St=class{constructor(t){let{privateKey:e,address:n,legacy:o}=t,s=o??!0;if(this.publicKey=e.publicKey(),this.publicKey instanceof De)s?this.signingScheme=0:(this.publicKey=new Fe(this.publicKey),this.signingScheme=2);else if(this.publicKey instanceof Et)this.signingScheme=1;else if(this.publicKey instanceof Gt)this.publicKey=new Fe(this.publicKey),this.signingScheme=2;else throw new Error("Can not create new Account, unsupported public key type");this.privateKey=e,this.accountAddress=n}static generate(t){let e=t?.legacy??!0,n,o;switch(t?.scheme){case 2:n=mr.generate(),o=new Fe(n.publicKey());break;default:n=Zt.generate(),e===!1?o=new Fe(n.publicKey()):o=n.publicKey()}let a=Ft.fromPublicKey({publicKey:o}).derivedAddress();return new St({privateKey:n,address:a,legacy:t?.legacy})}static fromPrivateKey(t){let{privateKey:e,legacy:n}=t,o=n??!0,s;if(e instanceof mr)s=new Fe(e.publicKey());else if(e instanceof Zt)o?s=e.publicKey():s=new Fe(e.publicKey());else throw new Error(`Unsupported private key ${e}`);let c=Ft.fromPublicKey({publicKey:s}).derivedAddress();return new St({privateKey:e,address:c,legacy:o})}static fromPrivateKeyAndAddress(t){let{privateKey:e,address:n,legacy:o}=t;return new St({privateKey:e,address:n,legacy:o})}static fromDerivationPath(t){let{path:e,mnemonic:n,scheme:o,legacy:s}=t,a;switch(o){case 2:a=mr.fromDerivationPath(e,n);break;case 0:a=Zt.fromDerivationPath(e,n);break;default:throw new Error(`Unsupported scheme ${o}`)}return St.fromPrivateKey({privateKey:a,legacy:s})}static authKey(t){let{publicKey:e}=t;return Ft.fromPublicKey({publicKey:e})}sign(t){return this.privateKey.sign(t)}verifySignature(t){let{message:e,signature:n}=t,o=be.fromHexInput(e).toUint8Array();return this.publicKey.verifySignature({message:o,signature:n})}};var ly=`
3
+ fragment TokenActivitiesFields on token_activities_v2 {
4
+ after_value
5
+ before_value
6
+ entry_function_id_str
7
+ event_account_address
8
+ event_index
9
+ from_address
10
+ is_fungible_v2
11
+ property_version_v1
12
+ to_address
13
+ token_amount
14
+ token_data_id
15
+ token_standard
16
+ transaction_timestamp
17
+ transaction_version
18
+ type
19
+ }
20
+ `,li=`
3
21
  fragment CurrentTokenOwnershipFields on current_token_ownerships_v2 {
4
22
  token_standard
5
23
  token_properties_mutated_v1
@@ -45,25 +63,7 @@
45
63
  }
46
64
  }
47
65
  }
48
- `,Py=`
49
- fragment TokenActivitiesFields on token_activities_v2 {
50
- after_value
51
- before_value
52
- entry_function_id_str
53
- event_account_address
54
- event_index
55
- from_address
56
- is_fungible_v2
57
- property_version_v1
58
- to_address
59
- token_amount
60
- token_data_id
61
- token_standard
62
- transaction_timestamp
63
- transaction_version
64
- type
65
- }
66
- `,yf=`
66
+ `,ud=`
67
67
  query getAccountCoinsCount($address: String) {
68
68
  current_fungible_asset_balances_aggregate(
69
69
  where: {owner_address: {_eq: $address}}
@@ -73,7 +73,7 @@
73
73
  }
74
74
  }
75
75
  }
76
- `,gf=`
76
+ `,fd=`
77
77
  query getAccountCoinsData($where_condition: current_fungible_asset_balances_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_fungible_asset_balances_order_by!]) {
78
78
  current_fungible_asset_balances(
79
79
  where: $where_condition
@@ -106,7 +106,7 @@
106
106
  }
107
107
  }
108
108
  }
109
- `,mf=`
109
+ `,dd=`
110
110
  query getAccountCollectionsWithOwnedTokens($where_condition: current_collection_ownership_v2_view_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_collection_ownership_v2_view_order_by!]) {
111
111
  current_collection_ownership_v2_view(
112
112
  where: $where_condition
@@ -140,7 +140,7 @@
140
140
  single_token_uri
141
141
  }
142
142
  }
143
- `,xf=`
143
+ `,ld=`
144
144
  query getAccountOwnedObjects($where_condition: current_objects_bool_exp, $offset: Int, $limit: Int, $order_by: [current_objects_order_by!]) {
145
145
  current_objects(
146
146
  where: $where_condition
@@ -157,7 +157,7 @@
157
157
  is_deleted
158
158
  }
159
159
  }
160
- `,bf=`
160
+ `,pd=`
161
161
  query getAccountOwnedTokens($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
162
162
  current_token_ownerships_v2(
163
163
  where: $where_condition
@@ -168,7 +168,7 @@
168
168
  ...CurrentTokenOwnershipFields
169
169
  }
170
170
  }
171
- ${Gi}`,Gb=`
171
+ ${li}`,rw=`
172
172
  query getAccountOwnedTokensByTokenData($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
173
173
  current_token_ownerships_v2(
174
174
  where: $where_condition
@@ -179,7 +179,7 @@
179
179
  ...CurrentTokenOwnershipFields
180
180
  }
181
181
  }
182
- ${Gi}`,Af=`
182
+ ${li}`,hd=`
183
183
  query getAccountOwnedTokensFromCollection($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
184
184
  current_token_ownerships_v2(
185
185
  where: $where_condition
@@ -190,7 +190,7 @@
190
190
  ...CurrentTokenOwnershipFields
191
191
  }
192
192
  }
193
- ${Gi}`,wf=`
193
+ ${li}`,gd=`
194
194
  query getAccountTokensCount($where_condition: current_token_ownerships_v2_bool_exp, $offset: Int, $limit: Int) {
195
195
  current_token_ownerships_v2_aggregate(
196
196
  where: $where_condition
@@ -202,7 +202,7 @@
202
202
  }
203
203
  }
204
204
  }
205
- `,Tf=`
205
+ `,yd=`
206
206
  query getAccountTransactionsCount($address: String) {
207
207
  account_transactions_aggregate(where: {account_address: {_eq: $address}}) {
208
208
  aggregate {
@@ -210,13 +210,13 @@
210
210
  }
211
211
  }
212
212
  }
213
- `,_f=`
213
+ `,md=`
214
214
  query getChainTopUserTransactions($limit: Int) {
215
215
  user_transactions(limit: $limit, order_by: {version: desc}) {
216
216
  version
217
217
  }
218
218
  }
219
- `,vf=`
219
+ `,xd=`
220
220
  query getCollectionData($where_condition: current_collections_v2_bool_exp!) {
221
221
  current_collections_v2(where: $where_condition) {
222
222
  collection_id
@@ -235,7 +235,7 @@
235
235
  uri
236
236
  }
237
237
  }
238
- `,Ef=`
238
+ `,bd=`
239
239
  query getCurrentFungibleAssetBalances($where_condition: current_fungible_asset_balances_bool_exp, $offset: Int, $limit: Int) {
240
240
  current_fungible_asset_balances(
241
241
  where: $where_condition
@@ -253,7 +253,7 @@
253
253
  token_standard
254
254
  }
255
255
  }
256
- `,Sf=`
256
+ `,Ad=`
257
257
  query getDelegatedStakingActivities($delegatorAddress: String, $poolAddress: String) {
258
258
  delegated_staking_activities(
259
259
  where: {delegator_address: {_eq: $delegatorAddress}, pool_address: {_eq: $poolAddress}}
@@ -266,7 +266,7 @@
266
266
  transaction_version
267
267
  }
268
268
  }
269
- `,Uf=`
269
+ `,wd=`
270
270
  query getEvents($where_condition: events_bool_exp, $offset: Int, $limit: Int, $order_by: [events_order_by!]) {
271
271
  events(
272
272
  where: $where_condition
@@ -282,9 +282,10 @@
282
282
  transaction_block_height
283
283
  transaction_version
284
284
  type
285
+ indexed_type
285
286
  }
286
287
  }
287
- `,Bf=`
288
+ `,Td=`
288
289
  query getFungibleAssetActivities($where_condition: fungible_asset_activities_bool_exp, $offset: Int, $limit: Int) {
289
290
  fungible_asset_activities(
290
291
  where: $where_condition
@@ -309,7 +310,7 @@
309
310
  type
310
311
  }
311
312
  }
312
- `,Cf=`
313
+ `,_d=`
313
314
  query getFungibleAssetMetadata($where_condition: fungible_asset_metadata_bool_exp, $offset: Int, $limit: Int) {
314
315
  fungible_asset_metadata(where: $where_condition, offset: $offset, limit: $limit) {
315
316
  icon_uri
@@ -326,14 +327,14 @@
326
327
  token_standard
327
328
  }
328
329
  }
329
- `,Ea=`
330
+ `,uc=`
330
331
  query getNumberOfDelegators($where_condition: num_active_delegator_per_pool_bool_exp!, $order_by: [num_active_delegator_per_pool_order_by!]) {
331
332
  num_active_delegator_per_pool(where: $where_condition, order_by: $order_by) {
332
333
  num_active_delegator
333
334
  pool_address
334
335
  }
335
336
  }
336
- `,If=`
337
+ `,vd=`
337
338
  query getProcessorStatus {
338
339
  processor_status {
339
340
  last_success_version
@@ -341,7 +342,7 @@
341
342
  last_updated
342
343
  }
343
344
  }
344
- `,Rf=`
345
+ `,Ed=`
345
346
  query getTokenActivity($where_condition: token_activities_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [token_activities_v2_order_by!]) {
346
347
  token_activities_v2(
347
348
  where: $where_condition
@@ -352,7 +353,7 @@
352
353
  ...TokenActivitiesFields
353
354
  }
354
355
  }
355
- ${Py}`,Sa=`
356
+ ${ly}`,fc=`
356
357
  query getCurrentTokenOwnership($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
357
358
  current_token_ownerships_v2(
358
359
  where: $where_condition
@@ -363,7 +364,7 @@
363
364
  ...CurrentTokenOwnershipFields
364
365
  }
365
366
  }
366
- ${Gi}`,Pf=`
367
+ ${li}`,Sd=`
367
368
  query getTokenData($where_condition: current_token_datas_v2_bool_exp, $offset: Int, $limit: Int, $order_by: [current_token_datas_v2_order_by!]) {
368
369
  current_token_datas_v2(
369
370
  where: $where_condition
@@ -402,9 +403,10 @@
402
403
  }
403
404
  }
404
405
  }
405
- `;async function Li(r){let{aptosConfig:t}=r,{data:e}=await mt({aptosConfig:t,originMethod:"getLedgerInfo",path:""});return e}async function kf(r){let{aptosConfig:t,ledgerVersion:e,options:n}=r,{data:o}=await mt({aptosConfig:t,originMethod:"getBlockByVersion",path:`blocks/by_version/${e}`,params:{with_transactions:n==null?void 0:n.withTransactions}});return o}async function Of(r){let{aptosConfig:t,blockHeight:e,options:n}=r,{data:o}=await mt({aptosConfig:t,originMethod:"getBlockByHeight",path:`blocks/by_height/${e}`,params:{with_transactions:n==null?void 0:n.withTransactions}});return o}async function Fi(r){let{aptosConfig:t,handle:e,data:n,options:o}=r;return(await _n({aptosConfig:t,originMethod:"getTableItem",path:`tables/${e}/item`,params:{ledger_version:o==null?void 0:o.ledgerVersion},body:n})).data}async function zf(r){var s,a;let{aptosConfig:t,payload:e,options:n}=r,{data:o}=await _n({aptosConfig:t,originMethod:"view",path:"view",params:{ledger_version:n==null?void 0:n.ledgerVersion},body:{function:e.function,type_arguments:(s=e.typeArguments)!=null?s:[],arguments:(a=e.functionArguments)!=null?a:[]}});return o}async function Hf(r){let{aptosConfig:t,limit:e}=r;return(await ke({aptosConfig:t,query:{query:_f,variables:{limit:e}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function ke(r){let{aptosConfig:t,query:e,originMethod:n}=r,{data:o}=await qs({aptosConfig:t,originMethod:n!=null?n:"queryIndexer",path:"",body:e,overrides:{WITH_CREDENTIALS:!1}});return o}async function ky(r){let{aptosConfig:t}=r;return(await ke({aptosConfig:t,query:{query:If},originMethod:"getProcessorStatuses"})).processor_status}async function $i(r){return(await ky({aptosConfig:r.aptosConfig}))[0].last_success_version}var Ua=new Map;function no(r,t,e){return async(...n)=>{if(Ua.has(t)){let{value:s,timestamp:a}=Ua.get(t);if(e===void 0||Date.now()-a<=e)return s}let o=await r(...n);return Ua.set(t,{value:o,timestamp:Date.now()}),o}}async function ko(r){let{aptosConfig:t,accountAddress:e}=r,{data:n}=await mt({aptosConfig:t,originMethod:"getInfo",path:`accounts/${H.fromHexInput(e).toString()}`});return n}async function qf(r){var o;let{aptosConfig:t,accountAddress:e,options:n}=r;return Tn({aptosConfig:t,originMethod:"getModules",path:`accounts/${H.fromHexInput(e).toString()}/modules`,params:{ledger_version:n==null?void 0:n.ledgerVersion,start:n==null?void 0:n.offset,limit:(o=n==null?void 0:n.limit)!=null?o:1e3}})}async function Ki(r){var t;return((t=r.options)==null?void 0:t.ledgerVersion)!==void 0?Df(r):no(async()=>Df(r),`module-${r.accountAddress}-${r.moduleName}`,1e3*60*5)()}async function Df(r){let{aptosConfig:t,accountAddress:e,moduleName:n,options:o}=r,{data:s}=await mt({aptosConfig:t,originMethod:"getModule",path:`accounts/${H.fromHexInput(e).toString()}/module/${n}`,params:{ledger_version:o==null?void 0:o.ledgerVersion}});return s}async function Nf(r){let{aptosConfig:t,accountAddress:e,options:n}=r;return Tn({aptosConfig:t,originMethod:"getTransactions",path:`accounts/${H.fromHexInput(e).toString()}/transactions`,params:{start:n==null?void 0:n.offset,limit:n==null?void 0:n.limit}})}async function Gf(r){var o;let{aptosConfig:t,accountAddress:e,options:n}=r;return Tn({aptosConfig:t,originMethod:"getResources",path:`accounts/${H.fromHexInput(e).toString()}/resources`,params:{ledger_version:n==null?void 0:n.ledgerVersion,start:n==null?void 0:n.offset,limit:(o=n==null?void 0:n.limit)!=null?o:999}})}async function Ba(r){let{aptosConfig:t,accountAddress:e,resourceType:n,options:o}=r,{data:s}=await mt({aptosConfig:t,originMethod:"getResource",path:`accounts/${H.fromHexInput(e).toString()}/resource/${n}`,params:{ledger_version:o==null?void 0:o.ledgerVersion}});return s.data}async function Ca(r){let{aptosConfig:t,authenticationKey:e,options:n}=r,o=await Ba({aptosConfig:t,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:n}),{address_map:{handle:s}}=o;try{let a=await Fi({aptosConfig:t,handle:s,data:{key:Z.fromHexInput(e).toString(),key_type:"address",value_type:"address"},options:n});return H.fromHexInput(a)}catch(a){if(a instanceof er&&a.data.error_code==="table_item_not_found")return H.fromHexInput(e);throw a}}async function Lf(r){let{aptosConfig:t,accountAddress:e}=r,o={owner_address:{_eq:H.fromHexInput(e).toString()},amount:{_gt:"0"}},a=await ke({aptosConfig:t,query:{query:wf,variables:{where_condition:o}},originMethod:"getAccountTokensCount"});if(!a.current_token_ownerships_v2_aggregate.aggregate)throw Error("Failed to get the count of account tokens");return a.current_token_ownerships_v2_aggregate.aggregate.count}async function Ff(r){var l,h;let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:H.fromHexInput(e).toString()},amount:{_gt:0}};n!=null&&n.tokenStandard&&(s.token_standard={_eq:n==null?void 0:n.tokenStandard});let a={query:bf,variables:{where_condition:s,offset:(l=n==null?void 0:n.pagination)==null?void 0:l.offset,limit:(h=n==null?void 0:n.pagination)==null?void 0:h.limit,order_by:n==null?void 0:n.orderBy}};return(await ke({aptosConfig:t,query:a,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function $f(r){var y,m;let{aptosConfig:t,accountAddress:e,collectionAddress:n,options:o}=r,s=H.fromHexInput(e).toString(),a=Z.fromHexInput(n).toString(),u={owner_address:{_eq:s},current_token_data:{collection_id:{_eq:a}},amount:{_gt:0}};o!=null&&o.tokenStandard&&(u.token_standard={_eq:o==null?void 0:o.tokenStandard});let l={query:Af,variables:{where_condition:u,offset:(y=o==null?void 0:o.pagination)==null?void 0:y.offset,limit:(m=o==null?void 0:o.pagination)==null?void 0:m.limit,order_by:o==null?void 0:o.orderBy}};return(await ke({aptosConfig:t,query:l,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function Kf(r){var l,h;let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:H.fromHexInput(e).toString()},amount:{_gt:0}};n!=null&&n.tokenStandard&&(s.current_collection={token_standard:{_eq:n==null?void 0:n.tokenStandard}});let a={query:mf,variables:{where_condition:s,offset:(l=n==null?void 0:n.pagination)==null?void 0:l.offset,limit:(h=n==null?void 0:n.pagination)==null?void 0:h.limit,order_by:n==null?void 0:n.orderBy}};return(await ke({aptosConfig:t,query:a,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function jf(r){let{aptosConfig:t,accountAddress:e}=r,n=H.fromHexInput(e).toString(),s=await ke({aptosConfig:t,query:{query:Tf,variables:{address:n}},originMethod:"getAccountTransactionsCount"});if(!s.account_transactions_aggregate.aggregate)throw Error("Failed to get the count of account transactions");return s.account_transactions_aggregate.aggregate.count}async function Vf(r){var l,h;let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:H.fromHexInput(e).toString()}},a={query:gf,variables:{where_condition:s,offset:(l=n==null?void 0:n.pagination)==null?void 0:l.offset,limit:(h=n==null?void 0:n.pagination)==null?void 0:h.limit,order_by:n==null?void 0:n.orderBy}};return(await ke({aptosConfig:t,query:a,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function Wf(r){let{aptosConfig:t,accountAddress:e}=r,n=H.fromHexInput(e).toString(),s=await ke({aptosConfig:t,query:{query:yf,variables:{address:n}},originMethod:"getAccountCoinsCount"});if(!s.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return s.current_fungible_asset_balances_aggregate.aggregate.count}async function Qf(r){var l,h;let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:H.fromHexInput(e).toString()}},a={query:xf,variables:{where_condition:s,offset:(l=n==null?void 0:n.pagination)==null?void 0:l.offset,limit:(h=n==null?void 0:n.pagination)==null?void 0:h.limit,order_by:n==null?void 0:n.orderBy}};return(await ke({aptosConfig:t,query:a,originMethod:"getAccountOwnedObjects"})).current_objects}async function Yf(r){let{aptosConfig:t,privateKey:e}=r,n=new Ye(e.publicKey());if(e instanceof Jr){let o=or.fromPublicKeyAndScheme({publicKey:n,scheme:2}),s=new H({data:o.toUint8Array()});return Pt.fromPrivateKeyAndAddress({privateKey:e,address:s})}if(e instanceof xr){let o=or.fromPublicKeyAndScheme({publicKey:n,scheme:2});if(await Mf({authKey:o,aptosConfig:t})){let l=new H({data:o.toUint8Array()});return Pt.fromPrivateKeyAndAddress({privateKey:e,address:l})}let a=or.fromPublicKeyAndScheme({publicKey:n,scheme:0});if(await Mf({authKey:a,aptosConfig:t})){let l=new H({data:a.toUint8Array()});return Pt.fromPrivateKeyAndAddress({privateKey:e,address:l,legacy:!0})}}throw new Error(`Can't derive account from private key ${e}`)}async function Mf(r){let{aptosConfig:t,authKey:e}=r,n=await Ca({aptosConfig:t,authenticationKey:e.toString()});try{return await ko({aptosConfig:t,accountAddress:n.toString()}),!0}catch(o){if(o.status===404)return!1;throw new Error(`Error while looking for an account info ${n.toString()}`)}}var Oo=class{constructor(t){this.config=t}async getAccountInfo(t){return ko({aptosConfig:this.config,...t})}async getAccountModules(t){return qf({aptosConfig:this.config,...t})}async getAccountModule(t){return Ki({aptosConfig:this.config,...t})}async getAccountTransactions(t){return Nf({aptosConfig:this.config,...t})}async getAccountResources(t){return Gf({aptosConfig:this.config,...t})}async getAccountResource(t){return Ba({aptosConfig:this.config,...t})}async lookupOriginalAccountAddress(t){return Ca({aptosConfig:this.config,...t})}async getAccountTokensCount(t){return Lf({aptosConfig:this.config,...t})}async getAccountOwnedTokens(t){return Ff({aptosConfig:this.config,...t})}async getAccountOwnedTokensFromCollectionAddress(t){return $f({aptosConfig:this.config,...t})}async getAccountCollectionsWithOwnedTokens(t){return Kf({aptosConfig:this.config,...t})}async getAccountTransactionsCount(t){return jf({aptosConfig:this.config,...t})}async getAccountCoinsData(t){return Vf({aptosConfig:this.config,...t})}async getAccountCoinsCount(t){return Wf({aptosConfig:this.config,...t})}async getAccountOwnedObjects(t){return Qf({aptosConfig:this.config,...t})}async deriveAccountFromPrivateKey(t){return Yf({aptosConfig:this.config,...t})}};var dd=Ss(ld(),1);async function pd(r){var t;let{params:e,method:n,url:o,headers:s,body:a,overrides:u}=r,l={headers:s,method:n,url:o,params:e,data:a,withCredentials:(t=u==null?void 0:u.WITH_CREDENTIALS)!=null?t:!0};try{let h=await(0,dd.default)(l);return{status:h.status,statusText:h.statusText,data:h.data,headers:h.headers,config:h.config}}catch(h){let y=h;if(y.response)return y.response;throw h}}var Do=class{constructor(t){var e,n,o;this.network=(e=t==null?void 0:t.network)!=null?e:kc,this.fullnode=t==null?void 0:t.fullnode,this.faucet=t==null?void 0:t.faucet,this.indexer=t==null?void 0:t.indexer,this.client=(n=t==null?void 0:t.client)!=null?n:{provider:pd},this.clientConfig=(o=t==null?void 0:t.clientConfig)!=null?o:{}}getRequestUrl(t){switch(t){case 0:if(this.fullnode!==void 0)return this.fullnode;if(this.network==="custom")throw new Error("Please provide a custom full node url");return Hs[this.network];case 2:if(this.faucet!==void 0)return this.faucet;if(this.network==="custom")throw new Error("Please provide a custom faucet url");return Ds[this.network];case 1:if(this.indexer!==void 0)return this.indexer;if(this.network==="custom")throw new Error("Please provide a custom indexer url");return si[this.network];default:throw Error(`apiType ${t} is not supported`)}}isIndexerRequest(t){return si[this.network]===t}};var Nt=class extends Kt{constructor(e){super();this.signature=e}toUint8Array(){return this.signature.toUint8Array()}toString(){return this.signature.toString()}serialize(e){if(this.signature instanceof Le)e.serializeU32AsUleb128(0),this.signature.serialize(e);else if(this.signature instanceof nr)e.serializeU32AsUleb128(1),this.signature.serialize(e);else throw new Error("Unknown signature type")}static deserialize(e){let n=e.deserializeUleb128AsU32();switch(n){case 0:return new Nt(Le.load(e));case 1:return new Nt(nr.load(e));default:throw new Error(`Unknown variant index for AnySignature: ${n}`)}}};async function Za(r){return new Promise(t=>{setTimeout(t,r)})}async function hd(r){let{aptosConfig:t,options:e}=r;return Tn({aptosConfig:t,originMethod:"getTransactions",path:"transactions",params:{start:e==null?void 0:e.offset,limit:e==null?void 0:e.limit}})}async function es(r){let{aptosConfig:t}=r;return no(async()=>{let{data:e}=await mt({aptosConfig:t,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return e},`gas-price-${t.network}`,1e3*60*5)()}async function yd(r){let{aptosConfig:t,ledgerVersion:e}=r,{data:n}=await mt({aptosConfig:t,originMethod:"getTransactionByVersion",path:`transactions/by_version/${e}`});return n}async function ts(r){let{aptosConfig:t,transactionHash:e}=r,{data:n}=await mt({aptosConfig:t,path:`transactions/by_hash/${e}`,originMethod:"getTransactionByHash"});return n}async function gd(r){let{aptosConfig:t,transactionHash:e}=r;try{return(await ts({aptosConfig:t,transactionHash:e})).type==="pending_transaction"}catch(n){if((n==null?void 0:n.status)===404)return!0;throw n}}async function rs(r){var A,C,w;let{aptosConfig:t,transactionHash:e,options:n}=r,o=(A=n==null?void 0:n.timeoutSecs)!=null?A:ui,s=(C=n==null?void 0:n.checkSuccess)!=null?C:!0,a=(w=n==null?void 0:n.indexerVersionCheck)!=null?w:!0,u=!0,l=0,h,y,m=200,v=1.5;for(;u&&!(l>=o);){try{if(h=await ts({aptosConfig:t,transactionHash:e}),u=h.type==="pending_transaction",!u)break}catch(E){if(!(E instanceof er)||(y=E,E.status!==404&&E.status>=400&&E.status<500))throw E}await Za(m),l+=m/1e3,m*=v}if(h===void 0)throw y||new Mo(`Fetching transaction ${e} failed and timed out after ${o} seconds`,h);if(h.type==="pending_transaction")throw new Mo(`Transaction ${e} timed out in pending state after ${o} seconds`,h);if(!s)return h;if(!h.success)throw new Ja(`Transaction ${e} failed with an error: ${h.vm_status}`,h);if(a)try{await Hg({aptosConfig:t,ledgerVersion:Number(h.version)})}catch(E){throw new Mo(`Transaction ${e} committed, but timed out waiting for indexer to sync with ledger version ${h.version}.You can disable this check by setting \`indexerVersionCheck\` to false in the \`extraArgs\` parameter.`,h)}return h}async function Hg(r){let{aptosConfig:t,ledgerVersion:e}=r,n=3e3,o=new Date().getTime(),s=-1;for(;s<e;){if(new Date().getTime()-o>n)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(s=await $i({aptosConfig:t}),s>=e)break;await Za(200)}}var Mo=class extends Error{constructor(e,n){super(e);this.lastSubmittedTransaction=n}},Ja=class extends Error{constructor(e,n){super(e);this.transaction=n}};var Et=class extends ne{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return Yt.load(t);case 1:return uo.load(t);case 2:return Gt.load(t);case 3:return fn.load(t);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${e}`)}}},Yt=class extends Et{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Oe.deserialize(e),o=Le.deserialize(e);return new Yt(n,o)}},uo=class extends Et{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Tt.deserialize(e),o=Ar.deserialize(e);return new uo(n,o)}},Gt=class extends Et{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(2),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Ye.deserialize(e),o=Nt.deserialize(e);return new Gt(n,o)}},fn=class extends Et{constructor(e,n,o){super();this.public_keys=e,this.signatures=n,this.signatures_bitmap=o}serialize(e){e.serializeU32AsUleb128(3),this.public_keys.serialize(e),e.serializeVector(this.signatures),e.serializeBytes(this.signatures_bitmap)}static load(e){let n=_r.deserialize(e),o=e.deserializeVector(Nt),s=e.deserializeBytes();return new fn(n,o,s)}};var cr=class extends ne{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return Sr.load(t);case 1:return fo.load(t);case 2:return Ur.load(t);case 3:return Br.load(t);case 4:return Cr.load(t);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${e}`)}}},Sr=class extends cr{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Oe.deserialize(e),o=Le.deserialize(e);return new Sr(n,o)}},fo=class extends cr{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Tt.deserialize(e),o=Ar.deserialize(e);return new fo(n,o)}},Ur=class extends cr{constructor(e,n,o){super();this.sender=e,this.secondary_signer_addresses=n,this.secondary_signers=o}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let n=Et.deserialize(e),o=e.deserializeVector(H),s=e.deserializeVector(Et);return new Ur(n,o,s)}},Br=class extends cr{constructor(e,n,o,s){super();this.sender=e,this.secondary_signer_addresses=n,this.secondary_signers=o,this.fee_payer=s}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let n=Et.deserialize(e),o=e.deserializeVector(H),s=e.deserializeVector(Et),a=H.deserialize(e),u=Et.deserialize(e),l={address:a,authenticator:u};return new Br(n,o,s,l)}},Cr=class extends cr{constructor(e){super();this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let n=Et.deserialize(e);return new Cr(n)}};var Ir=class extends ne{constructor(e){super();this.chainId=e}serialize(e){e.serializeU8(this.chainId)}static deserialize(e){let n=e.deserializeU8();return new Ir(n)}};var Me=class extends ne{constructor(e){super();this.identifier=e}serialize(e){e.serializeStr(this.identifier)}static deserialize(e){let n=e.deserializeStr();return new Me(n)}};var Rr=class extends ne{constructor(e,n){super();this.address=e,this.name=n}static fromStr(e){let n=e.split("::");if(n.length!==2)throw new Error("Invalid module id.");return new Rr(H.fromString(n[0]),new Me(n[1]))}serialize(e){this.address.serialize(e),this.name.serialize(e)}static deserialize(e){let n=H.deserialize(e),o=Me.deserialize(e);return new Rr(n,o)}};var Ve=class extends ne{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return Pr.load(t);case 1:return kr.load(t);case 2:return Hr.load(t);case 3:return Dr.load(t);case 4:return qr.load(t);case 5:return ur.load(t);case 6:return Gr.load(t);case 7:return Xt.load(t);case 8:return Or.load(t);case 9:return zr.load(t);case 10:return Mr.load(t);case 255:return Nr.load(t);default:throw new Error(`Unknown variant index for TypeTag: ${e}`)}}isBool(){return this instanceof Pr}isAddress(){return this instanceof qr}isGeneric(){return this instanceof Nr}isSigner(){return this instanceof ur}isVector(){return this instanceof Gr}isStruct(){return this instanceof Xt}isU8(){return this instanceof kr}isU16(){return this instanceof Or}isU32(){return this instanceof zr}isU64(){return this instanceof Hr}isU128(){return this instanceof Dr}isU256(){return this instanceof Mr}},Pr=class extends Ve{toString(){return"bool"}serialize(t){t.serializeU32AsUleb128(0)}static load(t){return new Pr}},kr=class extends Ve{toString(){return"u8"}serialize(t){t.serializeU32AsUleb128(1)}static load(t){return new kr}},Or=class extends Ve{toString(){return"u16"}serialize(t){t.serializeU32AsUleb128(8)}static load(t){return new Or}},zr=class extends Ve{toString(){return"u32"}serialize(t){t.serializeU32AsUleb128(9)}static load(t){return new zr}},Hr=class extends Ve{toString(){return"u64"}serialize(t){t.serializeU32AsUleb128(2)}static load(t){return new Hr}},Dr=class extends Ve{toString(){return"u128"}serialize(t){t.serializeU32AsUleb128(3)}static load(t){return new Dr}},Mr=class extends Ve{toString(){return"u256"}serialize(t){t.serializeU32AsUleb128(10)}static load(t){return new Mr}},qr=class extends Ve{toString(){return"address"}serialize(t){t.serializeU32AsUleb128(4)}static load(t){return new qr}},ur=class extends Ve{toString(){return"signer"}serialize(t){t.serializeU32AsUleb128(5)}static load(t){return new ur}},Hn=class extends Ve{constructor(e){super();this.value=e}toString(){return`&${this.value.toString()}`}serialize(e){e.serializeU32AsUleb128(254)}static load(e){let n=Ve.deserialize(e);return new Hn(n)}},Nr=class extends Ve{constructor(e){super();this.value=e}toString(){return`T${this.value}`}serialize(e){e.serializeU32AsUleb128(255),e.serializeU32(this.value)}static load(e){let n=e.deserializeU32();return new Nr(n)}},Gr=class extends Ve{constructor(e){super();this.value=e}toString(){return`vector<${this.value.toString()}>`}serialize(e){e.serializeU32AsUleb128(6),this.value.serialize(e)}static load(e){let n=Ve.deserialize(e);return new Gr(n)}},Xt=class extends Ve{constructor(e){super();this.value=e}toString(){let e="";return this.value.type_args.length>0&&(e=`<${this.value.type_args.map(n=>n.toString()).join(", ")}>`),`${this.value.address.toString()}::${this.value.module_name.identifier}::${this.value.name.identifier}${e}`}serialize(e){e.serializeU32AsUleb128(7),this.value.serialize(e)}static load(e){let n=Lt.deserialize(e);return new Xt(n)}isTypeTag(e,n,o){return this.value.module_name.identifier===n&&this.value.name.identifier===o&&this.value.address.equals(e)}isString(){return this.isTypeTag(H.ONE,"string","String")}isOption(){return this.isTypeTag(H.ONE,"option","Option")}isObject(){return this.isTypeTag(H.ONE,"object","Object")}},Lt=class extends ne{constructor(e,n,o,s){super();this.address=e,this.module_name=n,this.name=o,this.type_args=s}serialize(e){e.serialize(this.address),e.serialize(this.module_name),e.serialize(this.name),e.serializeVector(this.type_args)}static deserialize(e){let n=H.deserialize(e),o=Me.deserialize(e),s=Me.deserialize(e),a=e.deserializeVector(Ve);return new Lt(n,o,s,a)}};function Dg(){return new Lt(H.ONE,new Me("aptos_coin"),new Me("AptosCoin"),[])}function Mg(){return new Lt(H.ONE,new Me("string"),new Me("String"),[])}function qg(r){return new Lt(H.ONE,new Me("option"),new Me("Option"),[r])}function Ng(r){return new Lt(H.ONE,new Me("object"),new Me("Object"),[r])}function md(r){let t=r.deserializeUleb128AsU32();switch(t){case 0:return pt.deserialize(r);case 1:return Ze.deserialize(r);case 2:return At.deserialize(r);case 3:return H.deserialize(r);case 4:return Ie.deserialize(r,pt);case 5:return qe.deserialize(r);case 6:return xt.deserialize(r);case 7:return bt.deserialize(r);case 8:return wt.deserialize(r);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${t}`)}}var ln=class extends ne{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return dn.load(t);case 2:return pn.load(t);case 3:return hn.load(t);default:throw new Error(`Unknown variant index for TransactionPayload: ${e}`)}}},dn=class extends ln{constructor(e){super();this.script=e}serialize(e){e.serializeU32AsUleb128(0),this.script.serialize(e)}static load(e){let n=yn.deserialize(e);return new dn(n)}},pn=class extends ln{constructor(e){super();this.entryFunction=e}serialize(e){e.serializeU32AsUleb128(2),this.entryFunction.serialize(e)}static load(e){let n=fr.deserialize(e);return new pn(n)}},hn=class extends ln{constructor(e){super();this.multiSig=e}serialize(e){e.serializeU32AsUleb128(3),this.multiSig.serialize(e)}static load(e){let n=gn.deserialize(e);return new hn(n)}},fr=class{constructor(t,e,n,o){this.module_name=t,this.function_name=e,this.type_args=n,this.args=o}static build(t,e,n,o){return new fr(Rr.fromStr(t),new Me(e),n,o)}serialize(t){this.module_name.serialize(t),this.function_name.serialize(t),t.serializeVector(this.type_args),t.serializeU32AsUleb128(this.args.length),this.args.forEach(e=>{e.serializeForEntryFunction(t)})}static deserialize(t){let e=Rr.deserialize(t),n=Me.deserialize(t),o=t.deserializeVector(Ve),s=t.deserializeUleb128AsU32(),a=new Array;for(let u=0;u<s;u+=1){let l=t.deserializeUleb128AsU32(),h=Un.deserialize(t,l);a.push(h)}return new fr(e,n,o,a)}},yn=class{constructor(t,e,n){this.bytecode=t,this.type_args=e,this.args=n}serialize(t){t.serializeBytes(this.bytecode),t.serializeVector(this.type_args),t.serializeU32AsUleb128(this.args.length),this.args.forEach(e=>{e.serializeForScriptFunction(t)})}static deserialize(t){let e=t.deserializeBytes(),n=t.deserializeVector(Ve),o=t.deserializeUleb128AsU32(),s=new Array;for(let a=0;a<o;a+=1){let u=md(t);s.push(u)}return new yn(e,n,s)}},gn=class{constructor(t,e){this.multisig_address=t,this.transaction_payload=e}serialize(t){this.multisig_address.serialize(t),this.transaction_payload===void 0?t.serializeBool(!1):(t.serializeBool(!0),this.transaction_payload.serialize(t))}static deserialize(t){let e=H.deserialize(t),n=t.deserializeBool(),o;return n&&(o=mn.deserialize(t)),new gn(e,o)}},mn=class{constructor(t){this.transaction_payload=t}serialize(t){t.serializeU32AsUleb128(0),this.transaction_payload.serialize(t)}static deserialize(t){return t.deserializeUleb128AsU32(),new mn(fr.deserialize(t))}};var St=class extends ne{constructor(e,n,o,s,a,u,l){super();this.sender=e,this.sequence_number=n,this.payload=o,this.max_gas_amount=s,this.gas_unit_price=a,this.expiration_timestamp_secs=u,this.chain_id=l}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let n=H.deserialize(e),o=e.deserializeU64(),s=ln.deserialize(e),a=e.deserializeU64(),u=e.deserializeU64(),l=e.deserializeU64(),h=Ir.deserialize(e);return new St(n,o,s,a,u,l,h)}},qo=class extends ne{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return Zt.load(t);case 1:return Jt.load(t);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${e}`)}}},Zt=class extends qo{constructor(e,n){super();this.raw_txn=e,this.secondary_signer_addresses=n}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let n=St.deserialize(e),o=e.deserializeVector(H);return new Zt(n,o)}},Jt=class extends qo{constructor(e,n,o){super();this.raw_txn=e,this.secondary_signer_addresses=n,this.fee_payer_address=o}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let n=St.deserialize(e),o=e.deserializeVector(H),s=H.deserialize(e);return new Jt(n,o,s)}};var Ot=class extends ne{constructor(e,n){super();this.raw_txn=e,this.authenticator=n}serialize(e){this.raw_txn.serialize(e),this.authenticator.serialize(e)}static deserialize(e){let n=St.deserialize(e),o=cr.deserialize(e);return new Ot(n,o)}};function xd(r){return!!r.match(/^[_a-zA-Z0-9]+$/)}function bd(r){return!!r.match(/\s/)}function Gg(r,t){let e=t;for(;e<r.length;e+=1){let n=r[e];if(!bd(n))break}return e}var Ad=(m=>(m.InvalidTypeTag="unknown type",m.UnexpectedTypeArgumentClose="unexpected '>'",m.UnexpectedWhitespaceCharacter="unexpected whitespace character",m.UnexpectedComma="unexpected ','",m.TypeArgumentCountMismatch="type argument count doesn't match expected amount",m.MissingTypeArgumentClose="no matching '>' for '<'",m.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",m.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",m.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",m.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",m.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",m))(Ad||{}),Ne=class extends Error{constructor(t,e){super(`Failed to parse typeTag '${t}', ${e}`)}};function lo(r,t){var h;let e=(h=t==null?void 0:t.allowGenerics)!=null?h:!1,n=[],o=[],s=[],a=0,u="",l=1;for(;a<r.length;){let y=r[a];if(y==="<")n.push({savedExpectedTypes:l,savedStr:u,savedTypes:s}),u="",s=[],l=1;else if(y===">"){if(u!==""){let w=ns(u,o,e);s.push(w)}let m=n.pop();if(m===void 0)throw new Ne(r,"unexpected '>'");if(l!==s.length)throw new Ne(r,"type argument count doesn't match expected amount");let{savedStr:v,savedTypes:A,savedExpectedTypes:C}=m;o=s,s=A,u=v,l=C}else if(y===","){if(u.length!==0){let m=ns(u,o,e);o=[],s.push(m),u="",l+=1}}else if(bd(y)){let m=!1;if(u.length!==0){let A=ns(u,o,e);o=[],s.push(A),u="",m=!0}a=Gg(r,a);let v=r[a];if(a<r.length&&m&&v!==","&&v!==">")throw new Ne(r,"unexpected whitespace character");continue}else u+=y;a+=1}if(n.length>0)throw new Ne(r,"no matching '>' for '<'");switch(s.length){case 0:return ns(u,o,e);case 1:if(u==="")return s[0];throw new Ne(r,"unexpected ','");default:throw new Ne(r,"unexpected whitespace character")}}function ns(r,t,e){switch(r){case"&signer":if(t.length>0)throw new Ne(r,"primitive types not expected to have type arguments");return new Hn(new ur);case"signer":if(t.length>0)throw new Ne(r,"primitive types not expected to have type arguments");return new ur;case"bool":if(t.length>0)throw new Ne(r,"primitive types not expected to have type arguments");return new Pr;case"address":if(t.length>0)throw new Ne(r,"primitive types not expected to have type arguments");return new qr;case"u8":if(t.length>0)throw new Ne(r,"primitive types not expected to have type arguments");return new kr;case"u16":if(t.length>0)throw new Ne(r,"primitive types not expected to have type arguments");return new Or;case"u32":if(t.length>0)throw new Ne(r,"primitive types not expected to have type arguments");return new zr;case"u64":if(t.length>0)throw new Ne(r,"primitive types not expected to have type arguments");return new Hr;case"u128":if(t.length>0)throw new Ne(r,"primitive types not expected to have type arguments");return new Dr;case"u256":if(t.length>0)throw new Ne(r,"primitive types not expected to have type arguments");return new Mr;case"vector":if(t.length!==1)throw new Ne(r,"vector type expected to have exactly one type argument");return new Gr(t[0]);default:if(e&&r.match(/^T[0-9]+$/))return new Nr(Number(r.split("T")[1]));if(!r.match(/.*:.*/))throw new Ne(r,"unknown type");let n=r.split("::");if(n.length!==3)throw new Ne(r,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");if(!xd(n[1]))throw new Ne(r,"module name must only contain alphanumeric or '_' characters");if(!xd(n[2]))throw new Ne(r,"struct name must only contain alphanumeric or '_' characters");return new Xt(new Lt(H.fromString(n[0]),new Me(n[1]),new Me(n[2]),t))}}function ec(r){return typeof r=="boolean"}function Dn(r){return typeof r=="string"}function No(r){return typeof r=="number"}function Go(r){return typeof r=="number"||typeof r=="bigint"||typeof r=="string"}function tc(r){return r==null}function os(r){return r instanceof qe}function Lo(r){return r instanceof H}function is(r){return r instanceof rt}function rc(r){return r instanceof tr}function ss(r){return r instanceof pt}function as(r){return r instanceof xt}function cs(r){return r instanceof bt}function us(r){return r instanceof Ze}function fs(r){return r instanceof At}function ls(r){return r instanceof wt}function ds(r){return"bytecode"in r}function Ge(r,t){throw new Error(`Type mismatch for argument ${t}, expected '${r}'`)}function nc(r){return r.params.findIndex(t=>t!=="signer"&&t!=="&signer")}function ps(r){let t=r.split("::");if(t.length!==3)throw new Error(`Invalid function ${r}`);let e=t[0],n=t[1],o=t[2];return{moduleAddress:e,moduleName:n,functionName:o}}function oc(r){var t;return(t=r==null?void 0:r.map(e=>Dn(e)?lo(e):e))!=null?t:[]}async function ic(r,t,e,n){var l;let s=(l=(await Ki({aptosConfig:n,accountAddress:r,moduleName:t})).abi)==null?void 0:l.exposed_functions.find(h=>h.name===e);if(!s)throw new Error(`Could not find entry function ABI for '${r}::${t}::${e}'`);if(!s.is_entry)throw new Error(`'${r}::${t}::${e}' is not an entry function`);let a=nc(s),u=[];for(let h=a;h<s.params.length;h+=1)u.push(lo(s.params[h],{allowGenerics:!0}));return{typeParameters:s.generic_type_params,parameters:u}}function sc(r,t,e,n,o){if(n>=t.parameters.length)throw new Error(`Too many arguments for '${r}', expected ${t.parameters.length}`);return os(e)||ss(e)||as(e)||cs(e)||us(e)||fs(e)||ls(e)||Lo(e)||is(e)||rc(e)||e instanceof Ie||e instanceof ot?(Lg(t,e,n),e):hs(e,t.parameters[n],n,o)}function hs(r,t,e,n){if(t.isBool()){if(ec(r))return new qe(r);Ge("boolean",e)}if(t.isAddress()){if(Dn(r))return H.fromString(r);Ge("string",e)}if(t.isU8()){if(No(r))return new pt(r);Ge("number",e)}if(t.isU16()){if(No(r))return new xt(r);Ge("number",e)}if(t.isU32()){if(No(r))return new bt(r);Ge("number",e)}if(t.isU64()){if(Go(r))return new Ze(BigInt(r));Ge("bigint | number | string",e)}if(t.isU128()){if(Go(r))return new At(BigInt(r));Ge("bigint | number | string",e)}if(t.isU256()){if(Go(r))return new wt(BigInt(r));Ge("bigint | number | string",e)}if(t.isGeneric()){let o=t.value;if(o<0||o>=n.length)throw new Error(`Generic argument ${t.toString()} is invalid for argument ${e}`);hs(r,n[o],e,n)}if(t.isVector()){if(t.value.isU8()&&Dn(r))return Ie.U8(Z.fromHexInput(r).toUint8Array());if(Array.isArray(r))return new Ie(r.map(o=>hs(o,t.value,e,n)));throw new Error(`Type mismatch for argument ${e}, type '${t.toString()}'`)}if(t.isStruct()){if(t.isString()){if(Dn(r))return new rt(r);Ge("string",e)}if(t.isObject()){if(Dn(r))return H.fromString(r);Ge("string",e)}if(t.isOption())return tc(r)?new ot(null):new ot(hs(r,t.value.type_args[0],e,n));throw new Error(`Unsupported struct input type for argument ${e}, type '${t.toString()}'`)}throw new Error(`Type mismatch for argument ${e}, type '${t.toString()}'`)}function Lg(r,t,e){let n=r.parameters[e];if(n.isBool()){if(os(t))return;Ge("Bool",e)}if(n.isAddress()){if(Lo(t))return;Ge("AccountAddress",e)}if(n.isU8()){if(ss(t))return;Ge("U8",e)}if(n.isU16()){if(as(t))return;Ge("U16",e)}if(n.isU32()){if(cs(t))return;Ge("U32",e)}if(n.isU64()){if(us(t))return;Ge("U64",e)}if(n.isU128()){if(fs(t))return;Ge("U128",e)}if(n.isU256()){if(ls(t))return;Ge("U256",e)}if(n.isVector()){if(t instanceof Ie)return;Ge("MoveVector",e)}if(n instanceof Xt){if(n.isString()){if(is(t))return;Ge("MoveString",e)}if(n.isObject()){if(Lo(t))return;Ge("AccountAddress",e)}if(n.isOption()){if(t instanceof ot)return;Ge("MoveOption",e)}}throw new Error(`Type mismatch for argument ${e}, expected '${n.toString()}'`)}async function ac(r){if(ds(r))return Td(r);let{moduleAddress:t,moduleName:e,functionName:n}=ps(r.function),o=await no(async()=>ic(t,e,n,r.aptosConfig),`entry-function-${r.aptosConfig.network}-${t}-${e}-${n}`,1e3*60*5)();return wd(r,o)}function wd(r,t){if(ds(r))return Td(r);let{moduleAddress:e,moduleName:n,functionName:o}=ps(r.function),s=oc(r.typeArguments);if(s.length!==t.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${t.typeParameters.length}, received ${s.length}`);let a=r.functionArguments.map((l,h)=>sc(r.function,t,l,h,s));if(a.length!==t.parameters.length)throw new Error(`Too few arguments for '${e}::${n}::${o}', expected ${t.parameters.length} but got ${a.length}`);let u=fr.build(`${e}::${n}`,o,s,a);if("multisigAddress"in r){let l;return typeof r.multisigAddress=="string"?l=H.fromString(r.multisigAddress):l=r.multisigAddress,new hn(new gn(l,new mn(u)))}return new pn(u)}function Td(r){var t;return new dn(new yn(Z.fromHexInput(r.bytecode).toUint8Array(),(t=r.typeArguments)!=null?t:[],r.functionArguments))}async function _d(r){let{aptosConfig:t,sender:e,payload:n,options:o}=r,s=o!=null&&o.accountSequenceNumber?Promise.resolve({sequence_number:o.accountSequenceNumber}):ko({aptosConfig:t,accountAddress:e}),a=ci[t.network]?Promise.resolve({chain_id:ci[t.network]}):Li({aptosConfig:t}),u=o!=null&&o.gasUnitPrice?Promise.resolve({gas_estimate:o.gasUnitPrice}):es({aptosConfig:t}),[{sequence_number:l},{chain_id:h},{gas_estimate:y}]=await Promise.all([s,a,u]),{maxGasAmount:m,gasUnitPrice:v,expireTimestamp:A}={maxGasAmount:BigInt(Oc),gasUnitPrice:BigInt(y),expireTimestamp:BigInt(Math.floor(Date.now()/1e3)+zc),...o};return new St(H.fromHexInput(e),BigInt(l),n,BigInt(m),BigInt(v),BigInt(A),new Ir(h))}async function cc(r){let{aptosConfig:t,sender:e,payload:n,options:o,secondarySignerAddresses:s,feePayerAddress:a}=r,u=await _d({aptosConfig:t,sender:e,payload:n,options:o});if(a){let l=s?s.map(h=>H.fromHexInput(h)):[];return{rawTransaction:u.bcsToBytes(),secondarySignerAddresses:l,feePayerAddress:H.fromHexInput(a)}}if(s){let l=s.map(h=>H.fromHexInput(h));return{rawTransaction:u.bcsToBytes(),secondarySignerAddresses:l}}return{rawTransaction:u.bcsToBytes()}}function uc(r){var h,y;let{signerPublicKey:t,transaction:e,secondarySignersPublicKeys:n,feePayerPublicKey:o}=r,s=new $n(e.rawTransaction),a=St.deserialize(s),u=Fo(t);if(e.feePayerAddress){let m=new Jt(a,(h=e.secondarySignerAddresses)!=null?h:[],e.feePayerAddress),v=[];n&&(v=n.map(w=>Fo(w)));let A=Fo(o),C=new Br(u,(y=e.secondarySignerAddresses)!=null?y:[],v,{address:e.feePayerAddress,authenticator:A});return new Ot(m.raw_txn,C).bcsToBytes()}if(e.secondarySignerAddresses){let m=new Zt(a,e.secondarySignerAddresses),v=[];v=n.map(C=>Fo(C));let A=new Ur(u,e.secondarySignerAddresses,v);return new Ot(m.raw_txn,A).bcsToBytes()}let l;if(u instanceof Yt)l=new Sr(u.public_key,u.signature);else if(u instanceof Gt)l=new Cr(u);else throw new Error("Invalid public key");return new Ot(a,l).bcsToBytes()}function Fo(r){if(r instanceof Ye){if(r.publicKey instanceof Oe)return new Gt(r,new Nt(new Le(new Uint8Array(64))));if(r.publicKey instanceof Mt)return new Gt(r,new Nt(new nr(new Uint8Array(64))))}return new Yt(new Oe(r.toUint8Array()),new Le(new Uint8Array(64)))}function fc(r){let{signer:t,transaction:e}=r,n=dc(e),o=Ed(n),s=t.sign(o);switch(t.signingScheme){case 0:return new Yt(new Oe(t.publicKey.toUint8Array()),new Le(s.toUint8Array()));case 2:return new Gt(t.publicKey,new Nt(s));default:throw new Error(`Cannot sign transaction, signing scheme ${t.signingScheme} not supported`)}}function lc(r){let{transaction:t,senderAuthenticator:e,secondarySignerAuthenticators:n}=r,o=dc(t);if(n)return vd(o,e,n);if(e instanceof Yt){let s=new Sr(e.public_key,e.signature);return new Ot(o,s).bcsToBytes()}if(e instanceof Gt||e instanceof fn){let s=new Cr(e);return new Ot(o,s).bcsToBytes()}throw new Error(`Cannot generate a signed transaction, ${e} is not a supported account authentication scheme`)}function dc(r){var n;let t=new $n(r.rawTransaction),e=St.deserialize(t);return r.feePayerAddress?new Jt(e,(n=r.secondarySignerAddresses)!=null?n:[],r.feePayerAddress):r.secondarySignerAddresses?new Zt(e,r.secondarySignerAddresses):e}function vd(r,t,e){if(r instanceof Jt){if(!e.feePayerAuthenticator)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");let{feePayerAuthenticator:n,additionalSignersAuthenticators:o}=e,s=new Br(t,r.secondary_signer_addresses,o!=null?o:[],{address:r.fee_payer_address,authenticator:n});return new Ot(r.raw_txn,s).bcsToBytes()}if(r instanceof Zt){if(!e.additionalSignersAuthenticators)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");let{additionalSignersAuthenticators:n}=e,o=new Ur(t,r.secondary_signer_addresses,n!=null?n:[]);return new Ot(r.raw_txn,o).bcsToBytes()}throw new Error(`Cannot prepare multi signers transaction to submission, ${typeof r} transaction is not supported`)}function Ed(r){let t=Sn.create();if(r instanceof St)t.update(Dc);else if(r instanceof Zt)t.update(Ms);else if(r instanceof Jt)t.update(Ms);else throw new Error(`Unknown transaction type to sign on: ${r}`);let e=t.digest(),n=r.bcsToBytes(),o=new Uint8Array(e.length+n.length);return o.set(e),o.set(n,e.length),o}async function xn(r){let{aptosConfig:t,sender:e,data:n,options:o,secondarySignerAddresses:s,feePayerAddress:a}=r,u;"bytecode"in n?u=n:"multisigAddress"in n?u={aptosConfig:t,multisigAddress:n.multisigAddress,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments}:u={aptosConfig:t,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments};let l=await ac(u);return cc({aptosConfig:t,sender:e,payload:l,options:o,secondarySignerAddresses:s,feePayerAddress:a})}function pc(r){return fc({...r})}async function Sd(r){var h,y,m,v,A,C;let{aptosConfig:t,transaction:e,signerPublicKey:n,secondarySignersPublicKeys:o,feePayerPublicKey:s,options:a}=r,u=uc({transaction:e,signerPublicKey:n,secondarySignersPublicKeys:o,feePayerPublicKey:s,options:a}),{data:l}=await _n({aptosConfig:t,body:u,path:"transactions/simulate",params:{estimate_gas_unit_price:(y=(h=r.options)==null?void 0:h.estimateGasUnitPrice)!=null?y:!1,estimate_max_gas_amount:(v=(m=r.options)==null?void 0:m.estimateMaxGasAmount)!=null?v:!1,estimate_prioritized_gas_unit_price:(C=(A=r.options)==null?void 0:A.estimatePrioritizedGasUnitPrice)!=null?C:!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return l}async function hc(r){let{aptosConfig:t}=r,e=lc({...r}),{data:n}=await _n({aptosConfig:t,body:e,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return n}async function Ud(r){let{aptosConfig:t,signer:e,transaction:n}=r,o=pc({signer:e,transaction:n});return hc({aptosConfig:t,transaction:n,senderAuthenticator:o})}async function Bd(r){let{aptosConfig:t,account:e,metadataBytes:n,moduleBytecode:o,options:s}=r,a=o.map(l=>Ie.U8(l));return await xn({aptosConfig:t,sender:e,data:{function:"0x1::code::publish_package_txn",functionArguments:[Ie.U8(n),new Ie(a)]},options:s})}async function Cd(r){let{aptosConfig:t,sender:e,recipient:n,amount:o,coinType:s,options:a}=r,u=s!=null?s:Hc;return await xn({aptosConfig:t,sender:e.accountAddress.toString(),data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[lo(u)],functionArguments:[H.fromHexInput(n),new Ze(o)]},options:a})}var $o=class{constructor(t){this.config=t}async transferCoinTransaction(t){return Cd({aptosConfig:this.config,...t})}};async function Id(r){let{aptosConfig:t,options:e,creator:n}=r;return await xn({aptosConfig:t,sender:n.accountAddress.toString(),data:{function:"0x4::aptos_token::mint",functionArguments:[new rt(r.collection),new rt(r.description),new rt(r.name),new rt(r.uri),Ie.MoveString([]),Ie.MoveString([]),new Ie([])]},options:e})}async function Rd(r){let{aptosConfig:t,tokenAddress:e}=r,n={token_data_id:{_eq:Z.fromHexInput(e).toString()}};return(await ke({aptosConfig:t,query:{query:Pf,variables:{where_condition:n}},originMethod:"getTokenData"})).current_token_datas_v2[0]}async function Pd(r){let{aptosConfig:t,tokenAddress:e}=r,n={token_data_id:{_eq:Z.fromHexInput(e).toString()}};return(await ke({aptosConfig:t,query:{query:Sa,variables:{where_condition:n}},originMethod:"getCurrentTokenOwnership"})).current_token_ownerships_v2[0]}async function kd(r){var u,l;let{aptosConfig:t,ownerAddress:e,options:n}=r,o={owner_address:{_eq:Z.fromHexInput(e).toString()}},s={query:Sa,variables:{where_condition:o,offset:(u=n==null?void 0:n.pagination)==null?void 0:u.offset,limit:(l=n==null?void 0:n.pagination)==null?void 0:l.limit,order_by:n==null?void 0:n.orderBy}};return(await ke({aptosConfig:t,query:s,originMethod:"getOwnedTokens"})).current_token_ownerships_v2}async function Od(r){var u,l;let{aptosConfig:t,tokenAddress:e,options:n}=r,o={token_data_id:{_eq:Z.fromHexInput(e).toString()}},s={query:Rf,variables:{where_condition:o,offset:(u=n==null?void 0:n.pagination)==null?void 0:u.offset,limit:(l=n==null?void 0:n.pagination)==null?void 0:l.limit,order_by:n==null?void 0:n.orderBy}};return(await ke({aptosConfig:t,query:s,originMethod:"getTokenActivity"})).token_activities_v2}async function zd(r){var s,a,u,l,h,y,m,v,A,C,w,E;let{aptosConfig:t,options:e,creator:n}=r;return await xn({aptosConfig:t,sender:n.accountAddress.toString(),data:{function:"0x4::aptos_token::create_collection",functionArguments:[new rt(r.description),new Ze((s=r.maxSupply)!=null?s:vn),new rt(r.name),new rt(r.uri),new qe((a=r.mutableDescription)!=null?a:!0),new qe((u=r.mutableRoyalty)!=null?u:!0),new qe((l=r.mutableURI)!=null?l:!0),new qe((h=r.mutableTokenDescription)!=null?h:!0),new qe((y=r.mutableTokenName)!=null?y:!0),new qe((m=r.mutableTokenProperties)!=null?m:!0),new qe((v=r.mutableTokenURI)!=null?v:!0),new qe((A=r.tokensBurnableByCreator)!=null?A:!0),new qe((C=r.tokensFreezableByCreator)!=null?C:!0),new Ze((w=r.royaltyNumerator)!=null?w:0),new Ze((E=r.royaltyDenominator)!=null?E:1)]},options:e})}async function yc(r){var h;let{aptosConfig:t,creatorAddress:e,collectionName:n,options:o}=r,s=Z.fromHexInput(e).toString(),a={collection_name:{_eq:n},creator_address:{_eq:s}};return o!=null&&o.tokenStandard&&(a.token_standard={_eq:(h=o==null?void 0:o.tokenStandard)!=null?h:"v2"}),(await ke({aptosConfig:t,query:{query:vf,variables:{where_condition:a}},originMethod:"getCollectionData"})).current_collections_v2[0]}async function Hd(r){return(await yc(r)).collection_id}var Ko=class{constructor(t){this.config=t}async createCollectionTransaction(t){return zd({aptosConfig:this.config,...t})}async getCollectionData(t){return yc({aptosConfig:this.config,...t})}async getCollectionId(t){return Hd({aptosConfig:this.config,...t})}async mintTokenTransaction(t){return Id({aptosConfig:this.config,...t})}async getTokenData(t){return Rd({aptosConfig:this.config,...t})}async getCurrentTokenOwnership(t){return Pd({aptosConfig:this.config,...t})}async getOwnedTokens(t){return kd({aptosConfig:this.config,...t})}async getTokenActivity(t){return Od({aptosConfig:this.config,...t})}};async function Dd(r){let{accountAddress:t,aptosConfig:e,creationNumber:n}=r,s={account_address:{_eq:H.fromHexInput(t).toString()},creation_number:{_eq:n}};return ys({aptosConfig:e,options:{where:s}})}async function Md(r){let{accountAddress:t,aptosConfig:e,eventType:n,options:o}=r,u={where:{account_address:{_eq:H.fromHexInput(t).toString()},type:{_eq:n}},pagination:o==null?void 0:o.pagination,orderBy:o==null?void 0:o.orderBy};return ys({aptosConfig:e,options:u})}async function ys(r){var s,a;let{aptosConfig:t,options:e}=r,n={query:Uf,variables:{where_condition:e==null?void 0:e.where,offset:(s=e==null?void 0:e.pagination)==null?void 0:s.offset,limit:(a=e==null?void 0:e.pagination)==null?void 0:a.limit,order_by:e==null?void 0:e.orderBy}};return(await ke({aptosConfig:t,query:n,originMethod:"getEvents"})).events}var jo=class{constructor(t){this.config=t}async getAccountEventsByCreationNumber(t){return Dd({aptosConfig:this.config,...t})}async getAccountEventsByEventType(t){return Md({aptosConfig:this.config,...t})}async getEvents(t){return ys({aptosConfig:this.config,...t})}};async function qd(r){let{aptosConfig:t,accountAddress:e,amount:n,options:o}=r,s=(o==null?void 0:o.timeoutSecs)||ui,{data:a}=await Ns({aptosConfig:t,path:"fund",body:{address:H.fromHexInput(e).toString(),amount:n},originMethod:"fundAccount"}),u=a.txn_hashes[0];return await rs({aptosConfig:t,transactionHash:u,options:{timeoutSecs:s,checkSuccess:o==null?void 0:o.checkSuccess,indexerVersionCheck:o==null?void 0:o.indexerVersionCheck}}),u}var Vo=class{constructor(t){this.config=t}async fundAccount(t){return qd({aptosConfig:this.config,...t})}};async function gc(r){var s,a;let{aptosConfig:t,options:e}=r,n={query:Cf,variables:{where_condition:e==null?void 0:e.where,limit:(s=e==null?void 0:e.pagination)==null?void 0:s.limit,offset:(a=e==null?void 0:e.pagination)==null?void 0:a.offset}};return(await ke({aptosConfig:t,query:n,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function Nd(r){var s,a;let{aptosConfig:t,options:e}=r,n={query:Bf,variables:{where_condition:e==null?void 0:e.where,limit:(s=e==null?void 0:e.pagination)==null?void 0:s.limit,offset:(a=e==null?void 0:e.pagination)==null?void 0:a.offset}};return(await ke({aptosConfig:t,query:n,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function Gd(r){var s,a;let{aptosConfig:t,options:e}=r,n={query:Ef,variables:{where_condition:e==null?void 0:e.where,limit:(s=e==null?void 0:e.pagination)==null?void 0:s.limit,offset:(a=e==null?void 0:e.pagination)==null?void 0:a.offset}};return(await ke({aptosConfig:t,query:n,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var Wo=class{constructor(t){this.config=t}async getFungibleAssetMetadata(t){return gc({aptosConfig:this.config,...t})}async getFungibleAssetMetadataByAssetType(t){return(await gc({aptosConfig:this.config,options:{where:{asset_type:{_eq:t}}}}))[0]}async getFungibleAssetActivities(t){return Nd({aptosConfig:this.config,...t})}async getCurrentFungibleAssetBalances(t){return Gd({aptosConfig:this.config,...t})}};var Qo=class{constructor(t){this.config=t}async getLedgerInfo(){return Li({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(t){return kf({aptosConfig:this.config,...t})}async getBlockByHeight(t){return Of({aptosConfig:this.config,...t})}async getTableItem(t){return Fi({aptosConfig:this.config,...t})}async view(t){return zf({aptosConfig:this.config,...t})}async getChainTopUserTransactions(t){return Hf({aptosConfig:this.config,...t})}async queryIndexer(t){return ke({aptosConfig:this.config,...t})}async getIndexerLastSuccessVersion(){return $i({aptosConfig:this.config})}};async function Ld(r){let{aptosConfig:t,poolAddress:e}=r,n=Z.fromHexInput(e).toString(),s=await ke({aptosConfig:t,query:{query:Ea,variables:{where_condition:{pool_address:{_eq:n}}}}});if(s.num_active_delegator_per_pool.length===0)throw Error("Delegator pool not found");return s.num_active_delegator_per_pool[0].num_active_delegator}async function Fd(r){let{aptosConfig:t,options:e}=r,n={query:Ea,variables:{where_condition:{},order_by:e==null?void 0:e.orderBy}};return(await ke({aptosConfig:t,query:n})).num_active_delegator_per_pool}async function $d(r){let{aptosConfig:t,delegatorAddress:e,poolAddress:n}=r,o={query:Sf,variables:{delegatorAddress:Z.fromHexInput(e).toString(),poolAddress:Z.fromHexInput(n).toString()}};return(await ke({aptosConfig:t,query:o})).delegated_staking_activities}var Yo=class{constructor(t){this.config=t}async getNumberOfDelegators(t){return Ld({aptosConfig:this.config,...t})}async getNumberOfDelegatorsForAllPools(t){return Fd({aptosConfig:this.config,...t})}async getDelegatedStakingActivities(t){return $d({aptosConfig:this.config,...t})}};var Xo=class{constructor(t){this.config=t}async getTransactions(t){return hd({aptosConfig:this.config,...t})}async getTransactionByVersion(t){return yd({aptosConfig:this.config,...t})}async getTransactionByHash(t){return ts({aptosConfig:this.config,...t})}async isPendingTransaction(t){return gd({aptosConfig:this.config,...t})}async waitForTransaction(t){return rs({aptosConfig:this.config,...t})}async getGasPriceEstimation(){return es({aptosConfig:this.config})}};var Zo=class{constructor(t){this.config=t}async generateTransaction(t){return xn({aptosConfig:this.config,...t})}signTransaction(t){return pc({...t})}async simulateTransaction(t){return Sd({aptosConfig:this.config,...t})}async submitTransaction(t){return hc({aptosConfig:this.config,...t})}async signAndSubmitTransaction(t){let{signer:e,transaction:n}=t;return Ud({aptosConfig:this.config,signer:e,transaction:n})}async publishPackageTransaction(t){return Bd({aptosConfig:this.config,...t})}};var zt=class{constructor(t){this.config=new Do(t),this.account=new Oo(this.config),this.coin=new $o(this.config),this.digitalAsset=new Ko(this.config),this.event=new jo(this.config),this.faucet=new Vo(this.config),this.fungibleAsset=new Wo(this.config),this.general=new Qo(this.config),this.staking=new Yo(this.config),this.transaction=new Xo(this.config),this.transactionSubmission=new Zo(this.config)}};function lr(r,t,e){Object.getOwnPropertyNames(t.prototype).forEach(n=>{let o=Object.getOwnPropertyDescriptor(t.prototype,n);!o||(o.value=function(...s){return this[e][n](...s)},Object.defineProperty(r.prototype,n,o))})}lr(zt,Oo,"account");lr(zt,$o,"coin");lr(zt,Ko,"digitalAsset");lr(zt,jo,"event");lr(zt,Vo,"faucet");lr(zt,Wo,"fungibleAsset");lr(zt,Qo,"general");lr(zt,Yo,"staking");lr(zt,Xo,"transaction");lr(zt,Zo,"transactionSubmission");return Jd(Fg);})();
406
+ `;async function pi(r){let{aptosConfig:t}=r,{data:e}=await bt({aptosConfig:t,originMethod:"getLedgerInfo",path:""});return e}async function Ud(r){let{aptosConfig:t,ledgerVersion:e,options:n}=r,{data:o}=await bt({aptosConfig:t,originMethod:"getBlockByVersion",path:`blocks/by_version/${e}`,params:{with_transactions:n?.withTransactions}});return o}async function Bd(r){let{aptosConfig:t,blockHeight:e,options:n}=r,{data:o}=await bt({aptosConfig:t,originMethod:"getBlockByHeight",path:`blocks/by_height/${e}`,params:{with_transactions:n?.withTransactions}});return o}async function hi(r){let{aptosConfig:t,handle:e,data:n,options:o}=r;return(await zn({aptosConfig:t,originMethod:"getTableItem",path:`tables/${e}/item`,params:{ledger_version:o?.ledgerVersion},body:n})).data}async function gi(r){let{aptosConfig:t,payload:e,options:n}=r,{data:o}=await zn({aptosConfig:t,originMethod:"view",path:"view",params:{ledger_version:n?.ledgerVersion},body:{function:e.function,type_arguments:e.typeArguments??[],arguments:e.functionArguments??[]}});return o}async function Cd(r){let{aptosConfig:t,limit:e}=r;return(await Ne({aptosConfig:t,query:{query:md,variables:{limit:e}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function Ne(r){let{aptosConfig:t,query:e,originMethod:n}=r,{data:o}=await da({aptosConfig:t,originMethod:n??"queryIndexer",path:"",body:e,overrides:{WITH_CREDENTIALS:!1}});return o}async function py(r){let{aptosConfig:t}=r;return(await Ne({aptosConfig:t,query:{query:vd},originMethod:"getProcessorStatuses"})).processor_status}async function yi(r){return(await py({aptosConfig:r.aptosConfig}))[0].last_success_version}var dc=new Map;function bo(r,t,e){return async(...n)=>{if(dc.has(t)){let{value:s,timestamp:a}=dc.get(t);if(e===void 0||Date.now()-a<=e)return s}let o=await r(...n);return dc.set(t,{value:o,timestamp:Date.now()}),o}}async function Wn(r){let{aptosConfig:t,accountAddress:e}=r,{data:n}=await bt({aptosConfig:t,originMethod:"getInfo",path:`accounts/${O.from(e).toString()}`});return n}async function Pd(r){let{aptosConfig:t,accountAddress:e,options:n}=r;return On({aptosConfig:t,originMethod:"getModules",path:`accounts/${O.from(e).toString()}/modules`,params:{ledger_version:n?.ledgerVersion,start:n?.offset,limit:n?.limit??1e3}})}async function mi(r){return r.options?.ledgerVersion!==void 0?Id(r):bo(async()=>Id(r),`module-${r.accountAddress}-${r.moduleName}`,1e3*60*5)()}async function Id(r){let{aptosConfig:t,accountAddress:e,moduleName:n,options:o}=r,{data:s}=await bt({aptosConfig:t,originMethod:"getModule",path:`accounts/${O.from(e).toString()}/module/${n}`,params:{ledger_version:o?.ledgerVersion}});return s}async function kd(r){let{aptosConfig:t,accountAddress:e,options:n}=r;return On({aptosConfig:t,originMethod:"getTransactions",path:`accounts/${O.from(e).toString()}/transactions`,params:{start:n?.offset,limit:n?.limit}})}async function Od(r){let{aptosConfig:t,accountAddress:e,options:n}=r;return On({aptosConfig:t,originMethod:"getResources",path:`accounts/${O.from(e).toString()}/resources`,params:{ledger_version:n?.ledgerVersion,start:n?.offset,limit:n?.limit??999}})}async function lc(r){let{aptosConfig:t,accountAddress:e,resourceType:n,options:o}=r,{data:s}=await bt({aptosConfig:t,originMethod:"getResource",path:`accounts/${O.from(e).toString()}/resource/${n}`,params:{ledger_version:o?.ledgerVersion}});return s.data}async function pc(r){let{aptosConfig:t,authenticationKey:e,options:n}=r,o=await lc({aptosConfig:t,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:n}),{address_map:{handle:s}}=o,a=O.from(e);try{let c=await hi({aptosConfig:t,handle:s,data:{key:a.toString(),key_type:"address",value_type:"address"},options:n});return O.from(c)}catch(c){if(c instanceof cr&&c.data.error_code==="table_item_not_found")return a;throw c}}async function zd(r){let{aptosConfig:t,accountAddress:e}=r,o={owner_address:{_eq:O.from(e).toStringLong()},amount:{_gt:0}},a=await Ne({aptosConfig:t,query:{query:gd,variables:{where_condition:o}},originMethod:"getAccountTokensCount"});if(!a.current_token_ownerships_v2_aggregate.aggregate)throw Error("Failed to get the count of account tokens");return a.current_token_ownerships_v2_aggregate.aggregate.count}async function Nd(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:O.from(e).toStringLong()},amount:{_gt:0}};n?.tokenStandard&&(s.token_standard={_eq:n?.tokenStandard});let a={query:pd,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:a,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function Dd(r){let{aptosConfig:t,accountAddress:e,collectionAddress:n,options:o}=r,s=O.from(e).toStringLong(),a=O.from(n).toStringLong(),c={owner_address:{_eq:s},current_token_data:{collection_id:{_eq:a}},amount:{_gt:0}};o?.tokenStandard&&(c.token_standard={_eq:o?.tokenStandard});let f={query:hd,variables:{where_condition:c,offset:o?.pagination?.offset,limit:o?.pagination?.limit,order_by:o?.orderBy}};return(await Ne({aptosConfig:t,query:f,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function Md(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:O.from(e).toStringLong()},amount:{_gt:0}};n?.tokenStandard&&(s.current_collection={token_standard:{_eq:n?.tokenStandard}});let a={query:dd,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:a,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function qd(r){let{aptosConfig:t,accountAddress:e}=r,n=O.from(e).toStringLong(),s=await Ne({aptosConfig:t,query:{query:yd,variables:{address:n}},originMethod:"getAccountTransactionsCount"});if(!s.account_transactions_aggregate.aggregate)throw Error("Failed to get the count of account transactions");return s.account_transactions_aggregate.aggregate.count}async function Ld(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:O.from(e).toStringLong()}},a={query:fd,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:a,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function Hd(r){let{aptosConfig:t,accountAddress:e}=r,n=O.from(e).toStringLong(),s=await Ne({aptosConfig:t,query:{query:ud,variables:{address:n}},originMethod:"getAccountCoinsCount"});if(!s.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return s.current_fungible_asset_balances_aggregate.aggregate.count}async function Gd(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:O.from(e).toStringLong()}},a={query:ld,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:a,originMethod:"getAccountOwnedObjects"})).current_objects}async function Fd(r){let{aptosConfig:t,privateKey:e}=r,n=new Fe(e.publicKey());if(e instanceof mr){let s=Ft.fromPublicKeyAndScheme({publicKey:n,scheme:2}).derivedAddress();return St.fromPrivateKeyAndAddress({privateKey:e,address:s})}if(e instanceof Zt){let o=Ft.fromPublicKeyAndScheme({publicKey:n,scheme:2});if(await Rd({authKey:o,aptosConfig:t})){let f=o.derivedAddress();return St.fromPrivateKeyAndAddress({privateKey:e,address:f,legacy:!1})}let a=Ft.fromPublicKeyAndScheme({publicKey:n,scheme:0});if(await Rd({authKey:a,aptosConfig:t})){let f=a.derivedAddress();return St.fromPrivateKeyAndAddress({privateKey:e,address:f,legacy:!0})}}throw new Error(`Can't derive account from private key ${e}`)}async function Rd(r){let{aptosConfig:t,authKey:e}=r,n=await pc({aptosConfig:t,authenticationKey:e.derivedAddress()});try{return await Wn({aptosConfig:t,accountAddress:n}),!0}catch(o){if(o.status===404)return!1;throw new Error(`Error while looking for an account info ${n.toString()}`)}}var Zo=class{constructor(t){this.config=t}async getAccountInfo(t){return Wn({aptosConfig:this.config,...t})}async getAccountModules(t){return Pd({aptosConfig:this.config,...t})}async getAccountModule(t){return mi({aptosConfig:this.config,...t})}async getAccountTransactions(t){return kd({aptosConfig:this.config,...t})}async getAccountResources(t){return Od({aptosConfig:this.config,...t})}async getAccountResource(t){return lc({aptosConfig:this.config,...t})}async lookupOriginalAccountAddress(t){return pc({aptosConfig:this.config,...t})}async getAccountTokensCount(t){return zd({aptosConfig:this.config,...t})}async getAccountOwnedTokens(t){return Nd({aptosConfig:this.config,...t})}async getAccountOwnedTokensFromCollectionAddress(t){return Dd({aptosConfig:this.config,...t})}async getAccountCollectionsWithOwnedTokens(t){return Md({aptosConfig:this.config,...t})}async getAccountTransactionsCount(t){return qd({aptosConfig:this.config,...t})}async getAccountCoinsData(t){return Ld({aptosConfig:this.config,...t})}async getAccountCoinsCount(t){return Hd({aptosConfig:this.config,...t})}async getAccountOwnedObjects(t){return Gd({aptosConfig:this.config,...t})}async deriveAccountFromPrivateKey(t){return Fd({aptosConfig:this.config,...t})}};var sp=Zi(op(),1);async function ip(r){var t;let{params:e,method:n,url:o,headers:s,body:a,overrides:c}=r,f={headers:s,method:n,url:o,params:e,data:a,withCredentials:(t=c?.WITH_CREDENTIALS)!=null?t:!0};try{let h=await(0,sp.default)(f);return{status:h.status,statusText:h.statusText,data:h.data,headers:h.headers,config:h.config}}catch(h){let g=h;if(g.response)return g.response;throw h}}var ts=class{constructor(t){this.network=t?.network??bu,this.fullnode=t?.fullnode,this.faucet=t?.faucet,this.indexer=t?.indexer,this.client=t?.client??{provider:ip},this.clientConfig=t?.clientConfig??{}}getRequestUrl(t){switch(t){case 0:if(this.fullnode!==void 0)return this.fullnode;if(this.network==="custom")throw new Error("Please provide a custom full node url");return ca[this.network];case 2:if(this.faucet!==void 0)return this.faucet;if(this.network==="custom")throw new Error("Please provide a custom faucet url");return ua[this.network];case 1:if(this.indexer!==void 0)return this.indexer;if(this.network==="custom")throw new Error("Please provide a custom indexer url");return Ss[this.network];default:throw Error(`apiType ${t} is not supported`)}}isIndexerRequest(t){return Ss[this.network]===t}};var rs=class extends te{constructor(e){super();this.accountAddress=O.ONE;this.moduleName=new Ge("account");this.structName=new Ge("RotationProofChallenge");this.sequenceNumber=new He(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=ve.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};var $t=class extends Qt{constructor(e){super();this.signature=e}toUint8Array(){return this.signature.toUint8Array()}toString(){return this.signature.toString()}serialize(e){if(this.signature instanceof je)e.serializeU32AsUleb128(0),this.signature.serialize(e);else if(this.signature instanceof xr)e.serializeU32AsUleb128(1),this.signature.serialize(e);else throw new Error("Unknown signature type")}static deserialize(e){let n=e.deserializeUleb128AsU32();switch(n){case 0:return new $t(je.load(e));case 1:return new $t(xr.load(e));default:throw new Error(`Unknown variant index for AnySignature: ${n}`)}}};async function Nc(r){return new Promise(t=>{setTimeout(t,r)})}async function ap(r){let{aptosConfig:t,options:e}=r;return On({aptosConfig:t,originMethod:"getTransactions",path:"transactions",params:{start:e?.offset,limit:e?.limit}})}async function Si(r){let{aptosConfig:t}=r;return bo(async()=>{let{data:e}=await bt({aptosConfig:t,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return e},`gas-price-${t.network}`,1e3*60*5)()}async function cp(r){let{aptosConfig:t,ledgerVersion:e}=r,{data:n}=await bt({aptosConfig:t,originMethod:"getTransactionByVersion",path:`transactions/by_version/${e}`});return n}async function Ui(r){let{aptosConfig:t,transactionHash:e}=r,{data:n}=await bt({aptosConfig:t,path:`transactions/by_hash/${e}`,originMethod:"getTransactionByHash"});return n}async function up(r){let{aptosConfig:t,transactionHash:e}=r;try{return(await Ui({aptosConfig:t,transactionHash:e})).type==="pending_transaction"}catch(n){if(n?.status===404)return!0;throw n}}async function Bi(r){let{aptosConfig:t,transactionHash:e,options:n}=r,o=n?.timeoutSecs??Bs,s=n?.checkSuccess??!0,a=n?.indexerVersionCheck??!0,c=!0,f=0,h,g,y=200,w=1.5;for(;c&&!(f>=o);){try{if(h=await Ui({aptosConfig:t,transactionHash:e}),c=h.type==="pending_transaction",!c)break}catch(b){if(!(b instanceof cr)||(g=b,b.status!==404&&b.status>=400&&b.status<500))throw b}await Nc(y),f+=y/1e3,y*=w}if(h===void 0)throw g||new ns(`Fetching transaction ${e} failed and timed out after ${o} seconds`,h);if(h.type==="pending_transaction")throw new ns(`Transaction ${e} timed out in pending state after ${o} seconds`,h);if(!s)return h;if(!h.success)throw new Dc(`Transaction ${e} failed with an error: ${h.vm_status}`,h);if(a)try{await ym({aptosConfig:t,ledgerVersion:Number(h.version)})}catch{throw new ns(`Transaction ${e} committed, but timed out waiting for indexer to sync with ledger version ${h.version}.You can disable this check by setting \`indexerVersionCheck\` to false in the \`extraArgs\` parameter.`,h)}return h}async function ym(r){let{aptosConfig:t,ledgerVersion:e}=r,n=3e3,o=new Date().getTime(),s=-1;for(;s<e;){if(new Date().getTime()-o>n)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(s=await yi({aptosConfig:t}),s>=e)break;await Nc(200)}}var ns=class extends Error{constructor(e,n){super(e);this.lastSubmittedTransaction=n}},Dc=class extends Error{constructor(e,n){super(e);this.transaction=n}};var Bt=class extends te{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return rr.load(t);case 1:return Eo.load(t);case 2:return Kt.load(t);case 3:return _n.load(t);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${e}`)}}},rr=class extends Bt{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=De.deserialize(e),o=je.deserialize(e);return new rr(n,o)}},Eo=class extends Bt{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Et.deserialize(e),o=Br.deserialize(e);return new Eo(n,o)}},Kt=class extends Bt{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(2),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Fe.deserialize(e),o=$t.deserialize(e);return new Kt(n,o)}},_n=class extends Bt{constructor(e,n,o){super();this.public_keys=e,this.signatures=n,this.signatures_bitmap=o}serialize(e){e.serializeU32AsUleb128(3),this.public_keys.serialize(e),e.serializeVector(this.signatures),e.serializeBytes(this.signatures_bitmap)}static load(e){let n=Pr.deserialize(e),o=e.deserializeVector($t),s=e.deserializeBytes();return new _n(n,o,s)}};var br=class extends te{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return Or.load(t);case 1:return So.load(t);case 2:return zr.load(t);case 3:return Nr.load(t);case 4:return Dr.load(t);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${e}`)}}},Or=class extends br{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=De.deserialize(e),o=je.deserialize(e);return new Or(n,o)}},So=class extends br{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Et.deserialize(e),o=Br.deserialize(e);return new So(n,o)}},zr=class extends br{constructor(e,n,o){super();this.sender=e,this.secondary_signer_addresses=n,this.secondary_signers=o}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let n=Bt.deserialize(e),o=e.deserializeVector(O),s=e.deserializeVector(Bt);return new zr(n,o,s)}},Nr=class extends br{constructor(e,n,o,s){super();this.sender=e,this.secondary_signer_addresses=n,this.secondary_signers=o,this.fee_payer=s}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let n=Bt.deserialize(e),o=e.deserializeVector(O),s=e.deserializeVector(Bt),a=O.deserialize(e),c=Bt.deserialize(e),f={address:a,authenticator:c};return new Nr(n,o,s,f)}},Dr=class extends br{constructor(e){super();this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let n=Bt.deserialize(e);return new Dr(n)}};var Mr=class extends te{constructor(e){super();this.chainId=e}serialize(e){e.serializeU8(this.chainId)}static deserialize(e){let n=e.deserializeU8();return new Mr(n)}};var qe=class extends te{constructor(e){super();this.identifier=e}serialize(e){e.serializeStr(this.identifier)}static deserialize(e){let n=e.deserializeStr();return new qe(n)}};var qr=class extends te{constructor(e,n){super();this.address=e,this.name=n}static fromStr(e){let n=e.split("::");if(n.length!==2)throw new Error("Invalid module id.");return new qr(O.fromStringRelaxed(n[0]),new qe(n[1]))}serialize(e){this.address.serialize(e),this.name.serialize(e)}static deserialize(e){let n=O.deserialize(e),o=qe.deserialize(e);return new qr(n,o)}};var Xe=class extends te{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return Lr.load(t);case 1:return Hr.load(t);case 2:return $r.load(t);case 3:return Kr.load(t);case 4:return Vr.load(t);case 5:return Ar.load(t);case 6:return Qr.load(t);case 7:return nr.load(t);case 8:return Gr.load(t);case 9:return Fr.load(t);case 10:return jr.load(t);case 255:return Wr.load(t);default:throw new Error(`Unknown variant index for TypeTag: ${e}`)}}isBool(){return this instanceof Lr}isAddress(){return this instanceof Vr}isGeneric(){return this instanceof Wr}isSigner(){return this instanceof Ar}isVector(){return this instanceof Qr}isStruct(){return this instanceof nr}isU8(){return this instanceof Hr}isU16(){return this instanceof Gr}isU32(){return this instanceof Fr}isU64(){return this instanceof $r}isU128(){return this instanceof Kr}isU256(){return this instanceof jr}},Lr=class extends Xe{toString(){return"bool"}serialize(t){t.serializeU32AsUleb128(0)}static load(t){return new Lr}},Hr=class extends Xe{toString(){return"u8"}serialize(t){t.serializeU32AsUleb128(1)}static load(t){return new Hr}},Gr=class extends Xe{toString(){return"u16"}serialize(t){t.serializeU32AsUleb128(8)}static load(t){return new Gr}},Fr=class extends Xe{toString(){return"u32"}serialize(t){t.serializeU32AsUleb128(9)}static load(t){return new Fr}},$r=class extends Xe{toString(){return"u64"}serialize(t){t.serializeU32AsUleb128(2)}static load(t){return new $r}},Kr=class extends Xe{toString(){return"u128"}serialize(t){t.serializeU32AsUleb128(3)}static load(t){return new Kr}},jr=class extends Xe{toString(){return"u256"}serialize(t){t.serializeU32AsUleb128(10)}static load(t){return new jr}},Vr=class extends Xe{toString(){return"address"}serialize(t){t.serializeU32AsUleb128(4)}static load(t){return new Vr}},Ar=class extends Xe{toString(){return"signer"}serialize(t){t.serializeU32AsUleb128(5)}static load(t){return new Ar}},Xn=class extends Xe{constructor(e){super();this.value=e}toString(){return`&${this.value.toString()}`}serialize(e){e.serializeU32AsUleb128(254)}static load(e){let n=Xe.deserialize(e);return new Xn(n)}},Wr=class extends Xe{constructor(e){super();this.value=e}toString(){return`T${this.value}`}serialize(e){e.serializeU32AsUleb128(255),e.serializeU32(this.value)}static load(e){let n=e.deserializeU32();return new Wr(n)}},Qr=class extends Xe{constructor(e){super();this.value=e}toString(){return`vector<${this.value.toString()}>`}serialize(e){e.serializeU32AsUleb128(6),this.value.serialize(e)}static load(e){let n=Xe.deserialize(e);return new Qr(n)}},nr=class extends Xe{constructor(e){super();this.value=e}toString(){let e="";return this.value.typeArgs.length>0&&(e=`<${this.value.typeArgs.map(n=>n.toString()).join(", ")}>`),`${this.value.address.toString()}::${this.value.moduleName.identifier}::${this.value.name.identifier}${e}`}serialize(e){e.serializeU32AsUleb128(7),this.value.serialize(e)}static load(e){let n=jt.deserialize(e);return new nr(n)}isTypeTag(e,n,o){return this.value.moduleName.identifier===n&&this.value.name.identifier===o&&this.value.address.equals(e)}isString(){return this.isTypeTag(O.ONE,"string","String")}isOption(){return this.isTypeTag(O.ONE,"option","Option")}isObject(){return this.isTypeTag(O.ONE,"object","Object")}},jt=class extends te{constructor(e,n,o,s){super();this.address=e,this.moduleName=n,this.name=o,this.typeArgs=s}serialize(e){e.serialize(this.address),e.serialize(this.moduleName),e.serialize(this.name),e.serializeVector(this.typeArgs)}static deserialize(e){let n=O.deserialize(e),o=qe.deserialize(e),s=qe.deserialize(e),a=e.deserializeVector(Xe);return new jt(n,o,s,a)}};function mm(){return new jt(O.ONE,new qe("aptos_coin"),new qe("AptosCoin"),[])}function xm(){return new jt(O.ONE,new qe("string"),new qe("String"),[])}function bm(r){return new jt(O.ONE,new qe("option"),new qe("Option"),[r])}function Am(r){return new jt(O.ONE,new qe("object"),new qe("Object"),[r])}function fp(r){let t=r.deserializeUleb128AsU32();switch(t){case 0:return st.deserialize(r);case 1:return He.deserialize(r);case 2:return Tt.deserialize(r);case 3:return O.deserialize(r);case 4:return ve.deserialize(r,st);case 5:return Le.deserialize(r);case 6:return At.deserialize(r);case 7:return wt.deserialize(r);case 8:return _t.deserialize(r);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${t}`)}}var vn=class extends te{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return En.load(t);case 2:return Sn.load(t);case 3:return Un.load(t);default:throw new Error(`Unknown variant index for TransactionPayload: ${e}`)}}},En=class extends vn{constructor(e){super();this.script=e}serialize(e){e.serializeU32AsUleb128(0),this.script.serialize(e)}static load(e){let n=Bn.deserialize(e);return new En(n)}},Sn=class extends vn{constructor(e){super();this.entryFunction=e}serialize(e){e.serializeU32AsUleb128(2),this.entryFunction.serialize(e)}static load(e){let n=wr.deserialize(e);return new Sn(n)}},Un=class extends vn{constructor(e){super();this.multiSig=e}serialize(e){e.serializeU32AsUleb128(3),this.multiSig.serialize(e)}static load(e){let n=Cn.deserialize(e);return new Un(n)}},wr=class{constructor(t,e,n,o){this.module_name=t,this.function_name=e,this.type_args=n,this.args=o}static build(t,e,n,o){return new wr(qr.fromStr(t),new qe(e),n,o)}serialize(t){this.module_name.serialize(t),this.function_name.serialize(t),t.serializeVector(this.type_args),t.serializeU32AsUleb128(this.args.length),this.args.forEach(e=>{e.serializeForEntryFunction(t)})}static deserialize(t){let e=qr.deserialize(t),n=qe.deserialize(t),o=t.deserializeVector(Xe),s=t.deserializeUleb128AsU32(),a=new Array;for(let c=0;c<s;c+=1){let f=t.deserializeUleb128AsU32(),h=qn.deserialize(t,f);a.push(h)}return new wr(e,n,o,a)}},Bn=class{constructor(t,e,n){this.bytecode=t,this.type_args=e,this.args=n}serialize(t){t.serializeBytes(this.bytecode),t.serializeVector(this.type_args),t.serializeU32AsUleb128(this.args.length),this.args.forEach(e=>{e.serializeForScriptFunction(t)})}static deserialize(t){let e=t.deserializeBytes(),n=t.deserializeVector(Xe),o=t.deserializeUleb128AsU32(),s=new Array;for(let a=0;a<o;a+=1){let c=fp(t);s.push(c)}return new Bn(e,n,s)}},Cn=class{constructor(t,e){this.multisig_address=t,this.transaction_payload=e}serialize(t){this.multisig_address.serialize(t),this.transaction_payload===void 0?t.serializeBool(!1):(t.serializeBool(!0),this.transaction_payload.serialize(t))}static deserialize(t){let e=O.deserialize(t),n=t.deserializeBool(),o;return n&&(o=In.deserialize(t)),new Cn(e,o)}},In=class{constructor(t){this.transaction_payload=t}serialize(t){t.serializeU32AsUleb128(0),this.transaction_payload.serialize(t)}static deserialize(t){return t.deserializeUleb128AsU32(),new In(wr.deserialize(t))}};var Nt=class extends te{constructor(e,n,o,s,a,c,f){super();this.sender=e,this.sequence_number=n,this.payload=o,this.max_gas_amount=s,this.gas_unit_price=a,this.expiration_timestamp_secs=c,this.chain_id=f}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let n=O.deserialize(e),o=e.deserializeU64(),s=vn.deserialize(e),a=e.deserializeU64(),c=e.deserializeU64(),f=e.deserializeU64(),h=Mr.deserialize(e);return new Nt(n,o,s,a,c,f,h)}},os=class extends te{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return or.load(t);case 1:return sr.load(t);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${e}`)}}},or=class extends os{constructor(e,n){super();this.raw_txn=e,this.secondary_signer_addresses=n}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let n=Nt.deserialize(e),o=e.deserializeVector(O);return new or(n,o)}},sr=class extends os{constructor(e,n,o){super();this.raw_txn=e,this.secondary_signer_addresses=n,this.fee_payer_address=o}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let n=Nt.deserialize(e),o=e.deserializeVector(O),s=O.deserialize(e);return new sr(n,o,s)}};var Dt=class extends te{constructor(e,n){super();this.raw_txn=e,this.authenticator=n}serialize(e){this.raw_txn.serialize(e),this.authenticator.serialize(e)}static deserialize(e){let n=Nt.deserialize(e),o=br.deserialize(e);return new Dt(n,o)}};function dp(r){return!!r.match(/^[_a-zA-Z0-9]+$/)}function lp(r){return!!r.match(/\s/)}function wm(r,t){let e=t;for(;e<r.length;e+=1){let n=r[e];if(!lp(n))break}return e}var pp=(y=>(y.InvalidTypeTag="unknown type",y.UnexpectedTypeArgumentClose="unexpected '>'",y.UnexpectedWhitespaceCharacter="unexpected whitespace character",y.UnexpectedComma="unexpected ','",y.TypeArgumentCountMismatch="type argument count doesn't match expected amount",y.MissingTypeArgumentClose="no matching '>' for '<'",y.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",y.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",y.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",y.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",y.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",y))(pp||{}),$e=class extends Error{constructor(t,e){super(`Failed to parse typeTag '${t}', ${e}`)}};function Uo(r,t){let e=t?.allowGenerics??!1,n=[],o=[],s=[],a=0,c="",f=1;for(;a<r.length;){let h=r[a];if(h==="<")n.push({savedExpectedTypes:f,savedStr:c,savedTypes:s}),c="",s=[],f=1;else if(h===">"){if(c!==""){let I=Ci(c,o,e);s.push(I)}let g=n.pop();if(g===void 0)throw new $e(r,"unexpected '>'");if(f!==s.length)throw new $e(r,"type argument count doesn't match expected amount");let{savedStr:y,savedTypes:w,savedExpectedTypes:b}=g;o=s,s=w,c=y,f=b}else if(h===","){if(c.length!==0){let g=Ci(c,o,e);o=[],s.push(g),c="",f+=1}}else if(lp(h)){let g=!1;if(c.length!==0){let w=Ci(c,o,e);o=[],s.push(w),c="",g=!0}a=wm(r,a);let y=r[a];if(a<r.length&&g&&y!==","&&y!==">")throw new $e(r,"unexpected whitespace character");continue}else c+=h;a+=1}if(n.length>0)throw new $e(r,"no matching '>' for '<'");switch(s.length){case 0:return Ci(c,o,e);case 1:if(c==="")return s[0];throw new $e(r,"unexpected ','");default:throw new $e(r,"unexpected whitespace character")}}function Ci(r,t,e){switch(r){case"&signer":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Xn(new Ar);case"signer":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Ar;case"bool":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Lr;case"address":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Vr;case"u8":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Hr;case"u16":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Gr;case"u32":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Fr;case"u64":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new $r;case"u128":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Kr;case"u256":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new jr;case"vector":if(t.length!==1)throw new $e(r,"vector type expected to have exactly one type argument");return new Qr(t[0]);default:if(e&&r.match(/^T[0-9]+$/))return new Wr(Number(r.split("T")[1]));if(!r.match(/.*:.*/))throw new $e(r,"unknown type");let n=r.split("::");if(n.length!==3)throw new $e(r,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");if(!dp(n[1]))throw new $e(r,"module name must only contain alphanumeric or '_' characters");if(!dp(n[2]))throw new $e(r,"struct name must only contain alphanumeric or '_' characters");return new nr(new jt(O.fromStringRelaxed(n[0]),new qe(n[1]),new qe(n[2]),t))}}function Mc(r){return typeof r=="boolean"}function Zn(r){return typeof r=="string"}function ss(r){return typeof r=="number"}function is(r){return typeof r=="number"||typeof r=="bigint"||typeof r=="string"}function qc(r){return r==null}function Ii(r){return r instanceof Le}function as(r){return r instanceof O}function Ri(r){return r instanceof Ge}function Lc(r){return r instanceof ur}function Pi(r){return r instanceof st}function ki(r){return r instanceof At}function Oi(r){return r instanceof wt}function zi(r){return r instanceof He}function Ni(r){return r instanceof Tt}function Di(r){return r instanceof _t}function Mi(r){return"bytecode"in r}function Ke(r,t){throw new Error(`Type mismatch for argument ${t}, expected '${r}'`)}function Hc(r){let t=r.params.findIndex(e=>e!=="signer"&&e!=="&signer");return t<0?r.params.length:t}function qi(r){let t=r.split("::");if(t.length!==3)throw new Error(`Invalid function ${r}`);let e=t[0],n=t[1],o=t[2];return{moduleAddress:e,moduleName:n,functionName:o}}function Gc(r){return r?.map(t=>Zn(t)?Uo(t):t)??[]}async function Fc(r,t,e,n){let s=(await mi({aptosConfig:n,accountAddress:r,moduleName:t})).abi?.exposed_functions.find(f=>f.name===e);if(!s)throw new Error(`Could not find entry function ABI for '${r}::${t}::${e}'`);if(!s.is_entry)throw new Error(`'${r}::${t}::${e}' is not an entry function`);let a=Hc(s),c=[];for(let f=a;f<s.params.length;f+=1)c.push(Uo(s.params[f],{allowGenerics:!0}));return{typeParameters:s.generic_type_params,parameters:c}}function $c(r,t,e,n,o){if(n>=t.parameters.length)throw new Error(`Too many arguments for '${r}', expected ${t.parameters.length}`);return Ii(e)||Pi(e)||ki(e)||Oi(e)||zi(e)||Ni(e)||Di(e)||as(e)||Ri(e)||Lc(e)||e instanceof ve||e instanceof tt?(Tm(t,e,n),e):Li(e,t.parameters[n],n,o)}function Li(r,t,e,n){if(t.isBool()){if(Mc(r))return new Le(r);Ke("boolean",e)}if(t.isAddress()){if(Zn(r))return O.fromStringRelaxed(r);Ke("string",e)}if(t.isU8()){if(ss(r))return new st(r);Ke("number",e)}if(t.isU16()){if(ss(r))return new At(r);Ke("number",e)}if(t.isU32()){if(ss(r))return new wt(r);Ke("number",e)}if(t.isU64()){if(is(r))return new He(BigInt(r));Ke("bigint | number | string",e)}if(t.isU128()){if(is(r))return new Tt(BigInt(r));Ke("bigint | number | string",e)}if(t.isU256()){if(is(r))return new _t(BigInt(r));Ke("bigint | number | string",e)}if(t.isGeneric()){let o=t.value;if(o<0||o>=n.length)throw new Error(`Generic argument ${t.toString()} is invalid for argument ${e}`);Li(r,n[o],e,n)}if(t.isVector()){if(t.value.isU8()&&Zn(r))return ve.U8(be.fromHexInput(r).toUint8Array());if(Array.isArray(r))return new ve(r.map(o=>Li(o,t.value,e,n)));throw new Error(`Type mismatch for argument ${e}, type '${t.toString()}'`)}if(t.isStruct()){if(t.isString()){if(Zn(r))return new Ge(r);Ke("string",e)}if(t.isObject()){if(Zn(r))return O.fromStringRelaxed(r);Ke("string",e)}if(t.isOption())return qc(r)?new tt(null):new tt(Li(r,t.value.typeArgs[0],e,n));throw new Error(`Unsupported struct input type for argument ${e}, type '${t.toString()}'`)}throw new Error(`Type mismatch for argument ${e}, type '${t.toString()}'`)}function Tm(r,t,e){let n=r.parameters[e];if(n.isBool()){if(Ii(t))return;Ke("Bool",e)}if(n.isAddress()){if(as(t))return;Ke("AccountAddress",e)}if(n.isU8()){if(Pi(t))return;Ke("U8",e)}if(n.isU16()){if(ki(t))return;Ke("U16",e)}if(n.isU32()){if(Oi(t))return;Ke("U32",e)}if(n.isU64()){if(zi(t))return;Ke("U64",e)}if(n.isU128()){if(Ni(t))return;Ke("U128",e)}if(n.isU256()){if(Di(t))return;Ke("U256",e)}if(n.isVector()){if(t instanceof ve)return;Ke("MoveVector",e)}if(n instanceof nr){if(n.isString()){if(Ri(t))return;Ke("MoveString",e)}if(n.isObject()){if(as(t))return;Ke("AccountAddress",e)}if(n.isOption()){if(t instanceof tt)return;Ke("MoveOption",e)}}throw new Error(`Type mismatch for argument ${e}, expected '${n.toString()}'`)}async function Kc(r){if(Mi(r))return gp(r);let{moduleAddress:t,moduleName:e,functionName:n}=qi(r.function),o=await bo(async()=>Fc(t,e,n,r.aptosConfig),`entry-function-${r.aptosConfig.network}-${t}-${e}-${n}`,1e3*60*5)();return hp(r,o)}function hp(r,t){if(Mi(r))return gp(r);let{moduleAddress:e,moduleName:n,functionName:o}=qi(r.function),s=Gc(r.typeArguments);if(s.length!==t.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${t.typeParameters.length}, received ${s.length}`);let a=r.functionArguments.map((f,h)=>$c(r.function,t,f,h,s));if(a.length!==t.parameters.length)throw new Error(`Too few arguments for '${e}::${n}::${o}', expected ${t.parameters.length} but got ${a.length}`);let c=wr.build(`${e}::${n}`,o,s,a);if("multisigAddress"in r){let f;return typeof r.multisigAddress=="string"?f=O.from(r.multisigAddress):f=r.multisigAddress,new Un(new Cn(f,new In(c)))}return new Sn(c)}function gp(r){return new En(new Bn(be.fromHexInput(r.bytecode).toUint8Array(),r.typeArguments??[],r.functionArguments))}async function yp(r){let{aptosConfig:t,sender:e,payload:n,options:o}=r,s=o?.accountSequenceNumber?Promise.resolve({sequence_number:o.accountSequenceNumber}):Wn({aptosConfig:t,accountAddress:e}),a=Us[t.network]?Promise.resolve({chain_id:Us[t.network]}):pi({aptosConfig:t}),c=o?.gasUnitPrice?Promise.resolve({gas_estimate:o.gasUnitPrice}):Si({aptosConfig:t}),[{sequence_number:f},{chain_id:h},{gas_estimate:g}]=await Promise.all([s,a,c]),{maxGasAmount:y,gasUnitPrice:w,expireTimestamp:b}={maxGasAmount:BigInt(Au),gasUnitPrice:BigInt(g),expireTimestamp:BigInt(Math.floor(Date.now()/1e3)+wu),...o};return new Nt(O.fromRelaxed(e),BigInt(f),n,BigInt(y),BigInt(w),BigInt(b),new Mr(h))}async function jc(r){let{aptosConfig:t,sender:e,payload:n,options:o,secondarySignerAddresses:s,feePayerAddress:a}=r,c=await yp({aptosConfig:t,sender:e,payload:n,options:o});if(a){let f=s?s.map(h=>O.fromRelaxed(h)):[];return{rawTransaction:c,secondarySignerAddresses:f,feePayerAddress:O.fromRelaxed(a)}}if(s){let f=s.map(h=>O.fromRelaxed(h));return{rawTransaction:c,secondarySignerAddresses:f}}return{rawTransaction:c}}function Vc(r){let{signerPublicKey:t,transaction:e,secondarySignersPublicKeys:n,feePayerPublicKey:o}=r,s=new qo(e.rawTransaction.bcsToBytes()),a=Nt.deserialize(s),c=cs(t);if(e.feePayerAddress){let h=new sr(a,e.secondarySignerAddresses??[],e.feePayerAddress),g=[];n&&(g=n.map(b=>cs(b)));let y=cs(o),w=new Nr(c,e.secondarySignerAddresses??[],g,{address:e.feePayerAddress,authenticator:y});return new Dt(h.raw_txn,w).bcsToBytes()}if(e.secondarySignerAddresses){let h=new or(a,e.secondarySignerAddresses),g=[];g=n.map(w=>cs(w));let y=new zr(c,e.secondarySignerAddresses,g);return new Dt(h.raw_txn,y).bcsToBytes()}let f;if(c instanceof rr)f=new Or(c.public_key,c.signature);else if(c instanceof Kt)f=new Dr(c);else throw new Error("Invalid public key");return new Dt(a,f).bcsToBytes()}function cs(r){if(r instanceof Fe){if(r.publicKey instanceof De)return new Kt(r,new $t(new je(new Uint8Array(64))));if(r.publicKey instanceof Gt)return new Kt(r,new $t(new xr(new Uint8Array(64))))}return new rr(new De(r.toUint8Array()),new je(new Uint8Array(64)))}function Wc(r){let{signer:t,transaction:e}=r,n=Yc(e),o=xp(n),s=t.sign(o);switch(t.signingScheme){case 0:return new rr(new De(t.publicKey.toUint8Array()),new je(s.toUint8Array()));case 2:return new Kt(t.publicKey,new $t(s));default:throw new Error(`Cannot sign transaction, signing scheme ${t.signingScheme} not supported`)}}function Qc(r){let{transaction:t,senderAuthenticator:e,feePayerAuthenticator:n,additionalSignersAuthenticators:o}=r,s=Yc(t);if(n||o)return mp(s,e,n,o);if(e instanceof rr){let a=new Or(e.public_key,e.signature);return new Dt(s,a).bcsToBytes()}if(e instanceof Kt||e instanceof _n){let a=new Dr(e);return new Dt(s,a).bcsToBytes()}throw new Error(`Cannot generate a signed transaction, ${e} is not a supported account authentication scheme`)}function Yc(r){return r.feePayerAddress?new sr(r.rawTransaction,r.secondarySignerAddresses??[],r.feePayerAddress):r.secondarySignerAddresses?new or(r.rawTransaction,r.secondarySignerAddresses):r.rawTransaction}function mp(r,t,e,n){if(r instanceof sr){if(!e)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");let o=new Nr(t,r.secondary_signer_addresses,n??[],{address:r.fee_payer_address,authenticator:e});return new Dt(r.raw_txn,o).bcsToBytes()}if(r instanceof or){if(!n)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");let o=new zr(t,r.secondary_signer_addresses,n??[]);return new Dt(r.raw_txn,o).bcsToBytes()}throw new Error(`Cannot prepare multi signers transaction to submission, ${typeof r} transaction is not supported`)}function xp(r){let t=Mn.create();if(r instanceof Nt)t.update(_u);else if(r instanceof or)t.update(fa);else if(r instanceof sr)t.update(fa);else throw new Error(`Unknown transaction type to sign on: ${r}`);let e=t.digest(),n=r.bcsToBytes(),o=new Uint8Array(e.length+n.length);return o.set(e),o.set(n,e.length),o}async function ir(r){let{aptosConfig:t,sender:e,data:n,options:o,secondarySignerAddresses:s,hasFeePayer:a}=r,c;a===!0&&(c=O.ZERO.toString());let f;"bytecode"in n?f=n:"multisigAddress"in n?f={aptosConfig:t,multisigAddress:n.multisigAddress,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments}:f={aptosConfig:t,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments};let h=await Kc(f);return jc({aptosConfig:t,sender:e,payload:h,options:o,secondarySignerAddresses:s,feePayerAddress:c})}function Xc(r){return Wc({...r})}async function bp(r){let{aptosConfig:t,transaction:e,signerPublicKey:n,secondarySignersPublicKeys:o,feePayerPublicKey:s,options:a}=r,c=Vc({transaction:e,signerPublicKey:n,secondarySignersPublicKeys:o,feePayerPublicKey:s,options:a}),{data:f}=await zn({aptosConfig:t,body:c,path:"transactions/simulate",params:{estimate_gas_unit_price:r.options?.estimateGasUnitPrice??!1,estimate_max_gas_amount:r.options?.estimateMaxGasAmount??!1,estimate_prioritized_gas_unit_price:r.options?.estimatePrioritizedGasUnitPrice??!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return f}async function Zc(r){let{aptosConfig:t}=r,e=Qc({...r}),{data:n}=await zn({aptosConfig:t,body:e,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return n}async function Jc(r){let{aptosConfig:t,signer:e,transaction:n}=r,o=Xc({signer:e,transaction:n});return Zc({aptosConfig:t,transaction:n,senderAuthenticator:o})}async function Ap(r){let{aptosConfig:t,account:e,metadataBytes:n,moduleBytecode:o,options:s}=r,a=o.map(f=>ve.U8(f));return await ir({aptosConfig:t,sender:O.fromRelaxed(e),data:{function:"0x1::code::publish_package_txn",functionArguments:[ve.U8(n),new ve(a)]},options:s})}async function wp(r){let{aptosConfig:t,fromAccount:e,toNewPrivateKey:n}=r,o=await Wn({aptosConfig:t,accountAddress:e.accountAddress.toString()}),s=St.fromPrivateKey({privateKey:n,legacy:!0}),c=new rs({sequenceNumber:BigInt(o.sequence_number),originator:e.accountAddress,currentAuthKey:O.from(o.authentication_key),newPublicKey:s.publicKey}).bcsToBytes(),f=e.sign(c),h=s.sign(c),g=await ir({aptosConfig:t,sender:e.accountAddress.toString(),data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new st(e.signingScheme.valueOf()),ve.U8(e.publicKey.toUint8Array()),new st(s.signingScheme.valueOf()),ve.U8(s.publicKey.toUint8Array()),ve.U8(f.toUint8Array()),ve.U8(h.toUint8Array())]}});return await Jc({aptosConfig:t,signer:e,transaction:g})}async function Tp(r){let{aptosConfig:t,sender:e,recipient:n,amount:o,coinType:s,options:a}=r,c=s??Tu;return await ir({aptosConfig:t,sender:e.accountAddress,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[Uo(c)],functionArguments:[O.from(n),new He(o)]},options:a})}var us=class{constructor(t){this.config=t}async transferCoinTransaction(t){return Tp({aptosConfig:this.config,...t})}};async function _p(r){let{aptosConfig:t,options:e,creator:n}=r;return await ir({aptosConfig:t,sender:n.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[new Ge(r.collection),new Ge(r.description),new Ge(r.name),new Ge(r.uri),ve.MoveString([]),ve.MoveString([]),new ve([])]},options:e})}async function vp(r){let{aptosConfig:t,tokenAddress:e}=r,n={token_data_id:{_eq:O.from(e).toStringLong()}};return(await Ne({aptosConfig:t,query:{query:Sd,variables:{where_condition:n}},originMethod:"getTokenData"})).current_token_datas_v2[0]}async function Ep(r){let{aptosConfig:t,tokenAddress:e}=r,n={token_data_id:{_eq:O.from(e).toStringLong()}};return(await Ne({aptosConfig:t,query:{query:fc,variables:{where_condition:n}},originMethod:"getCurrentTokenOwnership"})).current_token_ownerships_v2[0]}async function Sp(r){let{aptosConfig:t,ownerAddress:e,options:n}=r,o={owner_address:{_eq:O.from(e).toStringLong()}},s={query:fc,variables:{where_condition:o,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:s,originMethod:"getOwnedTokens"})).current_token_ownerships_v2}async function Up(r){let{aptosConfig:t,tokenAddress:e,options:n}=r,o={token_data_id:{_eq:O.from(e).toStringLong()}},s={query:Ed,variables:{where_condition:o,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:s,originMethod:"getTokenActivity"})).token_activities_v2}async function Bp(r){let{aptosConfig:t,options:e,creator:n}=r;return await ir({aptosConfig:t,sender:n.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new Ge(r.description),new He(r.maxSupply??Nn),new Ge(r.name),new Ge(r.uri),new Le(r.mutableDescription??!0),new Le(r.mutableRoyalty??!0),new Le(r.mutableURI??!0),new Le(r.mutableTokenDescription??!0),new Le(r.mutableTokenName??!0),new Le(r.mutableTokenProperties??!0),new Le(r.mutableTokenURI??!0),new Le(r.tokensBurnableByCreator??!0),new Le(r.tokensFreezableByCreator??!0),new He(r.royaltyNumerator??0),new He(r.royaltyDenominator??1)]},options:e})}async function eu(r){let{aptosConfig:t,creatorAddress:e,collectionName:n,options:o}=r,s=O.from(e),a={collection_name:{_eq:n},creator_address:{_eq:s.toStringLong()}};return o?.tokenStandard&&(a.token_standard={_eq:o?.tokenStandard??"v2"}),(await Ne({aptosConfig:t,query:{query:xd,variables:{where_condition:a}},originMethod:"getCollectionData"})).current_collections_v2[0]}async function Cp(r){return(await eu(r)).collection_id}var fs=class{constructor(t){this.config=t}async createCollectionTransaction(t){return Bp({aptosConfig:this.config,...t})}async getCollectionData(t){return eu({aptosConfig:this.config,...t})}async getCollectionId(t){return Cp({aptosConfig:this.config,...t})}async mintTokenTransaction(t){return _p({aptosConfig:this.config,...t})}async getTokenData(t){return vp({aptosConfig:this.config,...t})}async getCurrentTokenOwnership(t){return Ep({aptosConfig:this.config,...t})}async getOwnedTokens(t){return Sp({aptosConfig:this.config,...t})}async getTokenActivity(t){return Up({aptosConfig:this.config,...t})}};async function Ip(r){let{accountAddress:t,aptosConfig:e,creationNumber:n}=r,s={account_address:{_eq:O.from(t).toStringLong()},creation_number:{_eq:n}};return Hi({aptosConfig:e,options:{where:s}})}async function Rp(r){let{accountAddress:t,aptosConfig:e,eventType:n,options:o}=r,c={where:{account_address:{_eq:O.fromRelaxed(t).toStringLong()},indexed_type:{_eq:n}},pagination:o?.pagination,orderBy:o?.orderBy};return Hi({aptosConfig:e,options:c})}async function Hi(r){let{aptosConfig:t,options:e}=r,n={query:wd,variables:{where_condition:e?.where,offset:e?.pagination?.offset,limit:e?.pagination?.limit,order_by:e?.orderBy}};return(await Ne({aptosConfig:t,query:n,originMethod:"getEvents"})).events}var ds=class{constructor(t){this.config=t}async getAccountEventsByCreationNumber(t){return Ip({aptosConfig:this.config,...t})}async getAccountEventsByEventType(t){return Rp({aptosConfig:this.config,...t})}async getEvents(t){return Hi({aptosConfig:this.config,...t})}};async function Pp(r){let{aptosConfig:t,accountAddress:e,amount:n,options:o}=r,s=o?.timeoutSecs||Bs,{data:a}=await la({aptosConfig:t,path:"fund",body:{address:O.fromRelaxed(e).toString(),amount:n},originMethod:"fundAccount"}),c=a.txn_hashes[0];return await Bi({aptosConfig:t,transactionHash:c,options:{timeoutSecs:s,checkSuccess:o?.checkSuccess,indexerVersionCheck:o?.indexerVersionCheck}}),c}var ls=class{constructor(t){this.config=t}async fundAccount(t){return Pp({aptosConfig:this.config,...t})}};async function tu(r){let{aptosConfig:t,options:e}=r,n={query:_d,variables:{where_condition:e?.where,limit:e?.pagination?.limit,offset:e?.pagination?.offset}};return(await Ne({aptosConfig:t,query:n,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function kp(r){let{aptosConfig:t,options:e}=r,n={query:Td,variables:{where_condition:e?.where,limit:e?.pagination?.limit,offset:e?.pagination?.offset}};return(await Ne({aptosConfig:t,query:n,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function Op(r){let{aptosConfig:t,options:e}=r,n={query:bd,variables:{where_condition:e?.where,limit:e?.pagination?.limit,offset:e?.pagination?.offset}};return(await Ne({aptosConfig:t,query:n,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var ps=class{constructor(t){this.config=t}async getFungibleAssetMetadata(t){return tu({aptosConfig:this.config,...t})}async getFungibleAssetMetadataByAssetType(t){return(await tu({aptosConfig:this.config,options:{where:{asset_type:{_eq:t}}}}))[0]}async getFungibleAssetActivities(t){return kp({aptosConfig:this.config,...t})}async getCurrentFungibleAssetBalances(t){return Op({aptosConfig:this.config,...t})}};var hs=class{constructor(t){this.config=t}async getLedgerInfo(){return pi({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(t){return Ud({aptosConfig:this.config,...t})}async getBlockByHeight(t){return Bd({aptosConfig:this.config,...t})}async getTableItem(t){return hi({aptosConfig:this.config,...t})}async view(t){return gi({aptosConfig:this.config,...t})}async getChainTopUserTransactions(t){return Cd({aptosConfig:this.config,...t})}async queryIndexer(t){return Ne({aptosConfig:this.config,...t})}async getIndexerLastSuccessVersion(){return yi({aptosConfig:this.config})}};var zp=["A name must be between 3 and 63 characters long,","and can only contain lowercase a-z, 0-9, and hyphens.","A name may not start or end with a hyphen."].join(" ");function Np(r){return!(!r||r.length<3||r.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(r))}function Dp(r){let[t,e,...n]=r.replace(/\.apt$/,"").split(".");if(n.length>0)throw new Error(`${r} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!Np(t))throw new Error(`${t} is not valid. ${zp}`);if(e&&!Np(e))throw new Error(`${e} is not valid. ${zp}`);return{domainName:e||t,subdomainName:e?t:void 0}}var _m="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",vm={["testnet"]:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",["mainnet"]:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",["local"]:_m,["custom"]:null,["devnet"]:null};function Mp(r){let t=vm[r.network];if(!t)throw new Error(`The ANS contract is not deployed to ${r.network}`);return t}var Em=r=>({vec:[r]}),Sm=()=>({vec:[]}),Um=r=>r!=null?Em(r):Sm(),Bm=r=>{if(!!r&&typeof r=="object"&&"vec"in r&&Array.isArray(r.vec))return r.vec[0]};async function qp(r){let{aptosConfig:t,name:e}=r,n=Mp(t),{domainName:o,subdomainName:s}=Dp(e),a=await gi({aptosConfig:t,payload:{function:`${n}::router::get_owner_addr`,functionArguments:[o,Um(s)]}}),c=Bm(a[0]);return c?O.fromRelaxed(c).toString():void 0}async function Lp(r){let{aptosConfig:t,expiration:e,name:n,sender:o,targetAddress:s,toAddress:a,options:c}=r,f=Mp(t),{domainName:h,subdomainName:g}=Dp(n),y=e.policy==="subdomain:independent"||e.policy==="subdomain:follow-domain";if(g&&!y)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(y&&!g)throw new Error(`Policy is set to ${e.policy} but no subdomain was provided`);if(e.policy==="domain"){if(e.years!==1)throw new Error("For now, names can only be registered for 1 year at a time");let w=e.years*31536e3;return await ir({aptosConfig:t,sender:o.accountAddress.toString(),data:{function:`${f}::router::register_domain`,functionArguments:[new Ge(h),new He(w),new tt(s?O.from(s):null),new tt(a?O.from(a):null)]},options:c})}throw new Error(`Policy ${e.policy} is not supported yet`)}var gs=class{constructor(t){this.config=t}async getOwnerAddress(t){return qp({aptosConfig:this.config,...t})}async registerName(t){return Lp({aptosConfig:this.config,...t})}};async function Hp(r){let{aptosConfig:t,poolAddress:e}=r,n=O.fromRelaxed(e).toStringLong(),s=await Ne({aptosConfig:t,query:{query:uc,variables:{where_condition:{pool_address:{_eq:n}}}}});if(s.num_active_delegator_per_pool.length===0)throw Error("Delegator pool not found");return s.num_active_delegator_per_pool[0].num_active_delegator}async function Gp(r){let{aptosConfig:t,options:e}=r,n={query:uc,variables:{where_condition:{},order_by:e?.orderBy}};return(await Ne({aptosConfig:t,query:n})).num_active_delegator_per_pool}async function Fp(r){let{aptosConfig:t,delegatorAddress:e,poolAddress:n}=r,o={query:Ad,variables:{delegatorAddress:O.fromRelaxed(e).toStringLong(),poolAddress:O.fromRelaxed(n).toStringLong()}};return(await Ne({aptosConfig:t,query:o})).delegated_staking_activities}var ys=class{constructor(t){this.config=t}async getNumberOfDelegators(t){return Hp({aptosConfig:this.config,...t})}async getNumberOfDelegatorsForAllPools(t){return Gp({aptosConfig:this.config,...t})}async getDelegatedStakingActivities(t){return Fp({aptosConfig:this.config,...t})}};var ms=class{constructor(t){this.config=t}async getTransactions(t){return ap({aptosConfig:this.config,...t})}async getTransactionByVersion(t){return cp({aptosConfig:this.config,...t})}async getTransactionByHash(t){return Ui({aptosConfig:this.config,...t})}async isPendingTransaction(t){return up({aptosConfig:this.config,...t})}async waitForTransaction(t){return Bi({aptosConfig:this.config,...t})}async getGasPriceEstimation(){return Si({aptosConfig:this.config})}};var xs=class{constructor(t){this.config=t}async generateTransaction(t){return ir({aptosConfig:this.config,...t})}signTransaction(t){let{signer:e,transaction:n,asFeePayer:o}=t;return o&&(n.feePayerAddress=e.accountAddress),Xc({signer:e,transaction:n})}async simulateTransaction(t){return bp({aptosConfig:this.config,...t})}async submitTransaction(t){return Zc({aptosConfig:this.config,...t})}async signAndSubmitTransaction(t){let{signer:e,transaction:n}=t;return Jc({aptosConfig:this.config,signer:e,transaction:n})}async publishPackageTransaction(t){return Ap({aptosConfig:this.config,...t})}async rotateAuthKey(t){return wp({aptosConfig:this.config,...t})}};var Ct=class{constructor(t){this.config=new ts(t),this.account=new Zo(this.config),this.ans=new gs(this.config),this.coin=new us(this.config),this.digitalAsset=new fs(this.config),this.event=new ds(this.config),this.faucet=new ls(this.config),this.fungibleAsset=new ps(this.config),this.general=new hs(this.config),this.staking=new ys(this.config),this.transaction=new ms(this.config),this.transactionSubmission=new xs(this.config)}};function ar(r,t,e){Object.getOwnPropertyNames(t.prototype).forEach(n=>{let o=Object.getOwnPropertyDescriptor(t.prototype,n);!o||(o.value=function(...s){return this[e][n](...s)},Object.defineProperty(r.prototype,n,o))})}ar(Ct,Zo,"account");ar(Ct,gs,"ans");ar(Ct,us,"coin");ar(Ct,fs,"digitalAsset");ar(Ct,ds,"event");ar(Ct,ls,"faucet");ar(Ct,ps,"fungibleAsset");ar(Ct,hs,"general");ar(Ct,ys,"staking");ar(Ct,ms,"transaction");ar(Ct,xs,"transactionSubmission");return Zp(Cm);})();
406
407
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
407
408
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
408
409
  /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
410
+ /*! scure-bip32 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */
409
411
  /*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */
410
412
  //# sourceMappingURL=index.global.js.map