@dcl/explorer-website 2.6.1-25865517797.commit-b7a7cba → 2.7.0

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 (141) hide show
  1. package/assets/{ConstantsUtil-ByjAYmvC.js → ConstantsUtil-BYRHWuZV.js} +1 -1
  2. package/assets/{ExchangeController-Bp8ztJrX.js → ExchangeController-N42lbf3C.js} +1 -1
  3. package/assets/{HelpersUtil-Dp4e1zvd.js → HelpersUtil-DFmhrbIH.js} +1 -1
  4. package/assets/{NetworkUtil-DqGcuBfF.js → NetworkUtil-DM5H1DOt.js} +1 -1
  5. package/assets/{SwapController-DUCq2f7d.js → SwapController-SgAc8zJM.js} +1 -1
  6. package/assets/{W3MFrameProviderSingleton-9eitOT0j.js → W3MFrameProviderSingleton-dGwr0u32.js} +3 -3
  7. package/assets/{basic-C7tUDecp.js → basic-CDUVa7W3.js} +1 -1
  8. package/assets/{biconomy-plHCR2Qq.js → biconomy-Dj37CYYZ.js} +1 -1
  9. package/assets/{browser-VYI7gorG.js → browser-h4rN6CV4.js} +1 -1
  10. package/assets/browser-ponyfill-LG9Rjmfj.js +1 -0
  11. package/assets/{ccip-Bldffu31.js → ccip-Cv_5kGJ0.js} +1 -1
  12. package/assets/{ccip-CrAifiNa.js → ccip-TlIoUAte.js} +1 -1
  13. package/assets/{chains-DTVDhUwv.js → chains-CsuV2rnE.js} +1 -1
  14. package/assets/{common-BEf2T7Hi.js → common-C9wbti_7.js} +1 -1
  15. package/assets/{controller-B8Iy-6V9.js → controller-DpEeOSLx.js} +2 -2
  16. package/assets/{core-XFvzSI58.js → core-BGvtiIgG.js} +4 -4
  17. package/assets/{custom-cPmISGcH.js → custom-BbQhcg55.js} +1 -1
  18. package/assets/{data-capture-DnvAEYWK.js → data-capture-C5UoNnMk.js} +1 -1
  19. package/assets/decimals-DA8L6Gte.js +1 -0
  20. package/assets/{decimals-8g2-fBFa.js → decimals-mBEEumco.js} +1 -1
  21. package/assets/{detectExtension-yvI5WWZb.js → detectExtension-oDT7CrDk.js} +1 -1
  22. package/assets/{email-C8DRQjTT.js → email-CUatRSQC.js} +1 -1
  23. package/assets/{embedded-wallet-BxgtT1uV.js → embedded-wallet-DZAeJhJN.js} +1 -1
  24. package/assets/{engine-BERe87yT.js → engine-AXDB-0h6.js} +1 -1
  25. package/assets/{estimate-l1-fee-BTeKvFv5.js → estimate-l1-fee-Bxwscz8f.js} +1 -1
  26. package/assets/eth_estimateGas-DFXalA2X.js +1 -0
  27. package/assets/{eth_getStorageAt-SbVMAQY-.js → eth_getStorageAt-Dr4zmiJF.js} +1 -1
  28. package/assets/{eth_getTransactionCount-qv0oO1Md.js → eth_getTransactionCount-cZacEETx.js} +1 -1
  29. package/assets/{ethereum-BP59xYBe.js → ethereum-CIBzGnJl.js} +1 -1
  30. package/assets/{extractIPFS-BOFlZk7U.js → extractIPFS-Czsz8-sO.js} +1 -1
  31. package/assets/{features-DVWd8_kC.js → features-fx-atM_l.js} +1 -1
  32. package/assets/{fetchTokenMetadata-BaJXN6RH.js → fetchTokenMetadata-uG4nb_Kh.js} +2 -2
  33. package/assets/{fortmatic-DARkeYTE.js → fortmatic-boxtmFta.js} +1 -1
  34. package/assets/get-ecosystem-wallet-info-BI2Fd0Vd.js +1 -0
  35. package/assets/{getBalance-D6wpo61w.js → getBalance-CC2S0qtL.js} +2 -2
  36. package/assets/{getInstalledModules-Dkj379ys.js → getInstalledModules-53n5UYt2.js} +1 -1
  37. package/assets/{getNFT-HMkoXD7L.js → getNFT-C3FPakLN.js} +2 -2
  38. package/assets/{getNFT-Drn4rxrk.js → getNFT-CnaK4j2q.js} +1 -1
  39. package/assets/{hashTypedData-CMDSWYgs.js → hashTypedData-C4JiqOxU.js} +1 -1
  40. package/assets/{hashTypedData-B5shS-rs.js → hashTypedData-D1Ievn97.js} +1 -1
  41. package/assets/{in-app-wallet-calls-l9-2W_Em.js → in-app-wallet-calls-khLeeKNu.js} +1 -1
  42. package/assets/{index-BIPd_vR5.js → index-0P32tQWj.js} +1 -1
  43. package/assets/{index-DIlwNfpB.js → index-1quVm3wk.js} +1 -1
  44. package/assets/{index-DbAu4Peg.js → index-B2PoGJRP.js} +3 -3
  45. package/assets/{index-BaGjqMte.js → index-B5w_jZpc.js} +2 -2
  46. package/assets/{index-CE5G6IEJ.js → index-B6j-Tckn.js} +1 -1
  47. package/assets/{index-CjiwjbqL.js → index-BCiKer83.js} +1 -1
  48. package/assets/{index-C8NSq3HK.js → index-BCqrDgyR.js} +1 -1
  49. package/assets/{index-BXAxcybX.js → index-BE5nQY53.js} +1 -1
  50. package/assets/{index-C51HwlD0.js → index-BF9Yx_yV.js} +1 -1
  51. package/assets/{index-CWGeCZBJ.js → index-BJCYEGPg.js} +1 -1
  52. package/assets/{index-Cy1X3n_C.js → index-BT0xQ-Xd.js} +1 -1
  53. package/assets/{index-0ShVRzxt.js → index-BVi4iI8y.js} +1 -1
  54. package/assets/{index-BDgZ3gDE.js → index-BVvMg9ZB.js} +1 -1
  55. package/assets/{index-DFE6t65x.js → index-BpxeqYFx.js} +1 -1
  56. package/assets/{index-B5ECjSS9.js → index-Bv6LvzLS.js} +1 -1
  57. package/assets/{index-i4VBSYqA.js → index-BvCGPTHO.js} +1 -1
  58. package/assets/index-Bzi38pjx.css +1 -0
  59. package/assets/{index-CH0zI801.js → index-C5oPclal.js} +1 -1
  60. package/assets/{index-D2ZBQG8w.js → index-C6-AvlPm.js} +1 -1
  61. package/assets/{index-CWnFK_-0.js → index-C9EMW8qD.js} +1 -1
  62. package/assets/{index-C-uqursN.js → index-C9vcJp9T.js} +1 -1
  63. package/assets/{index-DK-ZMNLh.js → index-CO3lXLzl.js} +1 -1
  64. package/assets/{index-DS2Lm9tG.js → index-CYBDya_s.js} +1 -1
  65. package/assets/{index-okvlQSs2.js → index-Coj3uG35.js} +1 -1
  66. package/assets/{index-Cu4ZjLNb.js → index-CqbvjyBi.js} +5 -5
  67. package/assets/{index-wds8TuUm.js → index-CwfOYq8B.js} +1 -1
  68. package/assets/{index-aoxVkzFE.js → index-Cz0JdeQb.js} +1 -1
  69. package/assets/{index-C5ciuua_.js → index-D-YuFp2i.js} +1 -1
  70. package/assets/{index-I68folnJ.js → index-D4NLrlUn.js} +1 -1
  71. package/assets/{index-B7Jt3b4d.js → index-D8PaxcsI.js} +1 -1
  72. package/assets/{index-r_1z0VI_.js → index-D9ey6cqT.js} +1 -1
  73. package/assets/{index-B-vyBZw9.js → index-DRYOQXZX.js} +1 -1
  74. package/assets/{index-DOnRCLNP.js → index-DT1PkdGa.js} +2 -2
  75. package/assets/{index-DWRq2SN_.js → index-DXCSroqX.js} +1 -1
  76. package/assets/{index-mZa0UiRt.js → index-DXs78xw9.js} +1 -1
  77. package/assets/{index-kXKMGszW.js → index-DZ0punK7.js} +1 -1
  78. package/assets/{index-B9U0GcYk.js → index-D_m5AL3D.js} +1 -1
  79. package/assets/{index-BxdNwV86.js → index-Dc148hav.js} +1 -1
  80. package/assets/{index-DP1DuCnR.js → index-DgDxBH9m.js} +1 -1
  81. package/assets/{index-DfWsAOhN.js → index-Dm7tCcMc.js} +3 -3
  82. package/assets/{index-D0LvjNIX.js → index-DmIGOG39.js} +1 -1
  83. package/assets/{index-JfVynEph.js → index-DmK5ktNw.js} +1 -1
  84. package/assets/{index-Cp7mdTuR.js → index-Eyans5--.js} +1 -1
  85. package/assets/{index-DPxCDCvr.js → index-KK8ZylE4.js} +1 -1
  86. package/assets/{index-DvJmANzU.js → index-TUD0QlWP.js} +1 -1
  87. package/assets/{index-TBthDmkl.js → index-ak5cSl-l.js} +1 -1
  88. package/assets/{index-8M7OkBFm.js → index-bVr8-SEv.js} +1 -1
  89. package/assets/{index-BlykZ8Gp.js → index-prLj8b2x.js} +1 -1
  90. package/assets/{index-BKL7nv1p.js → index-vajj2FBo.js} +1 -1
  91. package/assets/{index.es-YpI01v2I.js → index.es-C85F8NOj.js} +1 -1
  92. package/assets/{index.es-CkxUaFYS.js → index.es-DYgSAVrd.js} +1 -1
  93. package/assets/{index.es-cEGj7JU0.js → index.es-XXBqJXMm.js} +4 -4
  94. package/assets/{localBatchGatewayRequest-CNIOIq-Z.js → localBatchGatewayRequest-DbQn1s0J.js} +1 -1
  95. package/assets/{networks-DJ72puSk.js → networks-DMqekeph.js} +1 -1
  96. package/assets/{onramp--l5ZLxWE.js → onramp-qvbxoSMm.js} +1 -1
  97. package/assets/{openzeppelin-CqtRqxtF.js → openzeppelin-B6Und3LJ.js} +1 -1
  98. package/assets/{ownerOf-cWkgEtd8.js → ownerOf-CUoSe2c5.js} +1 -1
  99. package/assets/{parseEventLogs-D1xiFnCH.js → parseEventLogs-BxtEI7tW.js} +3 -3
  100. package/assets/{parseNft-DH5KlHPI.js → parseNft-DB_pGzOu.js} +2 -2
  101. package/assets/{parseSignature-HAlgOHnm.js → parseSignature-Csyua1uA.js} +3 -3
  102. package/assets/{parseSignature-BYhcrVdX.js → parseSignature-O0fAqZoB.js} +1 -1
  103. package/assets/{pay-with-exchange-CiXPJJ6-.js → pay-with-exchange-1MlV9x6H.js} +1 -1
  104. package/assets/{qr-overlay-CmFgwJBd.js → qr-overlay-DA6htUdY.js} +3 -3
  105. package/assets/{receive-t2TxUItI.js → receive-JnpfZY7d.js} +1 -1
  106. package/assets/{resolveImplementation-iG9WRRnW.js → resolveImplementation-B8d2Q-Ro.js} +1 -1
  107. package/assets/{rpc-sIdV4wiJ.js → rpc-DkFFCBh9.js} +1 -1
  108. package/assets/{secp256k1-Rk5k9i7o.js → secp256k1-BCPsQ5nJ.js} +1 -1
  109. package/assets/{secp256k1-Co_Jve4c.js → secp256k1-BZmrY8e3.js} +1 -1
  110. package/assets/{secp256k1-Bg2aUJRs.js → secp256k1-TIizaas9.js} +1 -1
  111. package/assets/{send-ByB5fOtm.js → send-DsnDja5n.js} +1 -1
  112. package/assets/{send-batch-transaction-D79MC_wr.js → send-batch-transaction-jNcvidMH.js} +1 -1
  113. package/assets/{send-eip712-transaction-CB6qLgks.js → send-eip712-transaction-DDJVOUpU.js} +2 -2
  114. package/assets/{send-gasless-transaction-Dt1qtUR8.js → send-gasless-transaction-DXjarWmh.js} +2 -2
  115. package/assets/{session-proposal-CY0k9Jnm.js → session-proposal-xJguSOgr.js} +1 -1
  116. package/assets/{session-request-B_2glC9e.js → session-request-BhD4eDPG.js} +2 -2
  117. package/assets/{sha256-Dy8KQE_5.js → sha256-CbjS9vFa.js} +1 -1
  118. package/assets/{signing-gNn6SJWz.js → signing-tKzVzr3v.js} +5 -5
  119. package/assets/{socials-Dx84-PrV.js → socials-CER945jA.js} +1 -1
  120. package/assets/{swaps-CK9Sfcew.js → swaps-Dy4hNTFm.js} +1 -1
  121. package/assets/{thirdweb-Bx5V_C1s.js → thirdweb-CNCkvOQU.js} +3 -3
  122. package/assets/{totalSupply-O-VFDoRO.js → totalSupply-BQvZy7Uc.js} +1 -1
  123. package/assets/{transactionReceipt-BqEjx5q-.js → transactionReceipt-DA1xo-2g.js} +1 -1
  124. package/assets/{transactions-BLOC2qYE.js → transactions-CwEfhngY.js} +1 -1
  125. package/assets/{utils-h8VUSGPW.js → utils-BUWGRgBa.js} +1 -1
  126. package/assets/{verifyHash-CNJ6t8Wp.js → verifyHash-CX9Livyx.js} +1 -1
  127. package/assets/{w3m-modal-nzPxg0Fr.js → w3m-modal-B1spewtI.js} +1 -1
  128. package/assets/{w3m-modal-CCQuGDus.js → w3m-modal-B6M729n4.js} +1 -1
  129. package/assets/{wait-for-tx-receipt-5pSBMNe2.js → wait-for-tx-receipt-BLruoSfj.js} +1 -1
  130. package/assets/{wallets-Bz03-Btm.js → wallets-vCTTbbau.js} +6 -6
  131. package/assets/{web-connector-CAOe_uvv.js → web-connector-h9SB5qXs.js} +3 -3
  132. package/assets/{writeContract-CCar3Ocq.js → writeContract-C9KDDivM.js} +1 -1
  133. package/assets/{zora-sepolia-D6mjhB5j.js → zora-sepolia-pCyxGzqm.js} +1 -1
  134. package/assets/{zoraTestnet-WLSFziQl.js → zoraTestnet-ChmlUfs6.js} +1 -1
  135. package/index.html +4 -4
  136. package/package.json +3 -3
  137. package/assets/browser-ponyfill-BmgQyNz0.js +0 -1
  138. package/assets/decimals-DR6jraOc.js +0 -1
  139. package/assets/eth_estimateGas-DKKwG-Ue.js +0 -1
  140. package/assets/get-ecosystem-wallet-info-Cvjz8DFX.js +0 -1
  141. package/assets/index-829Uxa3Y.css +0 -1
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PhArrowCircleDown-BtlNV0TZ.js","assets/property-CnFDNXw5.js","assets/PhArrowClockwise-mOiWYLMV.js","assets/PhArrowDown-CkoOD89h.js","assets/PhArrowLeft-C0jlxVhM.js","assets/PhArrowRight-BI-V03Xf.js","assets/PhArrowSquareOut-DnQ7n_B4.js","assets/PhArrowsDownUp-PZosTqZG.js","assets/PhArrowsLeftRight-CYsRQ2qh.js","assets/PhArrowUp-izKvURUW.js","assets/PhArrowUpRight-Bn-JhHsY.js","assets/PhArrowsClockwise-Brtx2Re-.js","assets/PhBank-hhPAIPVb.js","assets/PhBrowser-BjzAmrHO.js","assets/PhCaretDown-ddSjwcwm.js","assets/PhCaretLeft-B7YLoNEF.js","assets/PhCaretRight-BY8D5MIg.js","assets/PhCaretUp-BG10nSut.js","assets/PhCheck-DrKd7pBC.js","assets/PhCircleHalf-Bk9C4DvT.js","assets/PhClock-Sj17weCB.js","assets/PhCompass-Df1ugFO-.js","assets/PhCopy-rgttky8E.js","assets/PhCreditCard-CZpdid2n.js","assets/PhCurrencyDollar-B6IKKjue.js","assets/PhDesktop-BuCDXYJj.js","assets/PhDeviceMobile-CnybhXY-.js","assets/PhDotsThree-CSAEcba1.js","assets/PhVault-B8m1usHw.js","assets/PhEnvelope-SmaNeXoQ.js","assets/PhFunnelSimple-DKx35ITq.js","assets/PhGlobe-q1mqj65V.js","assets/PhIdentificationCard-BeLXJpfZ.js","assets/PhImage-BYrKfN9k.js","assets/PhInfo-X33f06Ej.js","assets/PhLightbulb-DMZJsowR.js","assets/PhMagnifyingGlass-B6D0sWFL.js","assets/PhPaperPlaneRight-Dvo-nXr9.js","assets/PhPlus-CBvZvLax.js","assets/PhPower-D8-AcNM6.js","assets/PhPuzzlePiece-C-7mYqGO.js","assets/PhQrCode-uIXlI5ER.js","assets/PhQuestion-rUoqC2sC.js","assets/PhQuestionMark-W55Txvvb.js","assets/PhSealCheck-BeVLq9PH.js","assets/PhSignOut-Cq2PivQ6.js","assets/PhSpinner-CZMtAFdX.js","assets/PhTrash-BamrmMsN.js","assets/PhUser-A2fxqIV0.js","assets/PhWallet-WVAuHGpA.js","assets/PhWarning-CpkID9oi.js","assets/PhWarningCircle-Cm58gXb9.js","assets/PhX-C3b4cCEy.js"])))=>i.map(i=>d[i]);
2
- import{a as M,i as y,b as x,w as h}from"./lit-element-Cn7T8F1W.js";import{n as s,a as Z}from"./class-map-mFRv1nW8.js";import{r as P,v as c,d as A}from"./index-DbAu4Peg.js";import{_ as r}from"./index-Cu4ZjLNb.js";const L=".",C={getSpacingStyles(t,e){if(Array.isArray(t))return t[e]?`var(--apkt-spacing-${t[e]})`:void 0;if(typeof t=="string")return`var(--apkt-spacing-${t})`},getFormattedDate(t){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(t)},formatCurrency(t=0,e={}){const i=Number(t);return isNaN(i)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2,...e}).format(i)},getHostName(t){try{return new URL(t).hostname}catch{return""}},getTruncateString({string:t,charsStart:e,charsEnd:i,truncate:o}){return t.length<=e+i?t:o==="end"?`${t.substring(0,e)}...`:o==="start"?`...${t.substring(t.length-i)}`:`${t.substring(0,Math.floor(e))}...${t.substring(t.length-Math.floor(i))}`},generateAvatarColors(t){const i=t.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),o=this.hexToRgb(i),n=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),a=100-3*Number(n?.replace("px","")),p=`${a}% ${a}% at 65% 40%`,d=[];for(let u=0;u<5;u+=1){const m=this.tintColor(o,.15*u);d.push(`rgb(${m[0]}, ${m[1]}, ${m[2]})`)}return`
2
+ import{a as M,i as y,b as x,w as h}from"./lit-element-Cn7T8F1W.js";import{n as s,a as Z}from"./class-map-mFRv1nW8.js";import{r as P,v as c,d as A}from"./index-B2PoGJRP.js";import{_ as r}from"./index-CqbvjyBi.js";const L=".",C={getSpacingStyles(t,e){if(Array.isArray(t))return t[e]?`var(--apkt-spacing-${t[e]})`:void 0;if(typeof t=="string")return`var(--apkt-spacing-${t})`},getFormattedDate(t){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(t)},formatCurrency(t=0,e={}){const i=Number(t);return isNaN(i)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2,...e}).format(i)},getHostName(t){try{return new URL(t).hostname}catch{return""}},getTruncateString({string:t,charsStart:e,charsEnd:i,truncate:o}){return t.length<=e+i?t:o==="end"?`${t.substring(0,e)}...`:o==="start"?`...${t.substring(t.length-i)}`:`${t.substring(0,Math.floor(e))}...${t.substring(t.length-Math.floor(i))}`},generateAvatarColors(t){const i=t.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),o=this.hexToRgb(i),n=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),a=100-3*Number(n?.replace("px","")),p=`${a}% ${a}% at 65% 40%`,d=[];for(let u=0;u<5;u+=1){const m=this.tintColor(o,.15*u);d.push(`rgb(${m[0]}, ${m[1]}, ${m[2]})`)}return`
3
3
  --local-color-1: ${d[0]};
4
4
  --local-color-2: ${d[1]};
5
5
  --local-color-3: ${d[2]};
@@ -1,4 +1,4 @@
1
- import{i as b,b as l}from"./lit-element-Cn7T8F1W.js";import{n as s}from"./class-map-mFRv1nW8.js";import{c as p}from"./index-wds8TuUm.js";import{d as m,r as f,e as v}from"./index-DbAu4Peg.js";const h=m`
1
+ import{i as b,b as l}from"./lit-element-Cn7T8F1W.js";import{n as s}from"./class-map-mFRv1nW8.js";import{c as p}from"./index-CwfOYq8B.js";import{d as m,r as f,e as v}from"./index-B2PoGJRP.js";const h=m`
2
2
  button {
3
3
  border: none;
4
4
  background: transparent;
@@ -1,4 +1,4 @@
1
- import{i as u,b as h}from"./lit-element-Cn7T8F1W.js";import{n as d}from"./class-map-mFRv1nW8.js";import{o as f}from"./if-defined-DsPifBxM.js";import{c as p}from"./index-wds8TuUm.js";import{d as m,r as g,e as b}from"./index-DbAu4Peg.js";const y=m`
1
+ import{i as u,b as h}from"./lit-element-Cn7T8F1W.js";import{n as d}from"./class-map-mFRv1nW8.js";import{o as f}from"./if-defined-DsPifBxM.js";import{c as p}from"./index-CwfOYq8B.js";import{d as m,r as g,e as b}from"./index-B2PoGJRP.js";const y=m`
2
2
  :host {
3
3
  display: inline-flex;
4
4
  justify-content: center;
@@ -1,4 +1,4 @@
1
- import{i as m,b as n}from"./lit-element-Cn7T8F1W.js";import{n as r}from"./class-map-mFRv1nW8.js";import{c as u}from"./index-wds8TuUm.js";import"./index-i4VBSYqA.js";import"./index-TBthDmkl.js";import{d as g,r as p,e as x}from"./index-DbAu4Peg.js";const b=g`
1
+ import{i as m,b as n}from"./lit-element-Cn7T8F1W.js";import{n as r}from"./class-map-mFRv1nW8.js";import{c as u}from"./index-CwfOYq8B.js";import"./index-BvCGPTHO.js";import"./index-ak5cSl-l.js";import{d as g,r as p,e as x}from"./index-B2PoGJRP.js";const b=g`
2
2
  button {
3
3
  display: block;
4
4
  display: flex;
@@ -1,4 +1,4 @@
1
- import{i as g,b as e}from"./lit-element-Cn7T8F1W.js";import{r as f,n as w}from"./class-map-mFRv1nW8.js";import{d as y,r as k,e as P}from"./index-DbAu4Peg.js";import{c as b}from"./index-wds8TuUm.js";import"./index-DvJmANzU.js";import{H as x}from"./HelpersUtil-Dp4e1zvd.js";import{R as u,E as A}from"./W3MFrameProviderSingleton-9eitOT0j.js";import{o as v}from"./if-defined-DsPifBxM.js";import"./index-C5ciuua_.js";import"./index-BIPd_vR5.js";const I=y`
1
+ import{i as g,b as e}from"./lit-element-Cn7T8F1W.js";import{r as f,n as w}from"./class-map-mFRv1nW8.js";import{d as y,r as k,e as P}from"./index-B2PoGJRP.js";import{c as b}from"./index-CwfOYq8B.js";import"./index-TUD0QlWP.js";import{H as x}from"./HelpersUtil-DFmhrbIH.js";import{R as u,E as A}from"./W3MFrameProviderSingleton-dGwr0u32.js";import{o as v}from"./if-defined-DsPifBxM.js";import"./index-D-YuFp2i.js";import"./index-0P32tQWj.js";const I=y`
2
2
  :host {
3
3
  display: block;
4
4
  }
@@ -1,3 +1,3 @@
1
- import{d as G}from"./index-B-vyBZw9.js";function P(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function V(e,r){return Array.isArray(r)?r.length===0?!0:e?r.every(n=>typeof n=="string"):r.every(n=>Number.isSafeInteger(n)):!1}function I(e,r){if(typeof r!="string")throw new Error(`${e}: string expected`);return!0}function B(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function v(e){if(!Array.isArray(e))throw new Error("array expected")}function S(e,r){if(!V(!0,r))throw new Error(`${e}: array of strings expected`)}function K(e,r){if(!V(!1,r))throw new Error(`${e}: array of numbers expected`)}function J(...e){const r=s=>s,n=(s,u)=>i=>s(u(i)),b=e.map(s=>s.encode).reduceRight(n,r),d=e.map(s=>s.decode).reduce(n,r);return{encode:b,decode:d}}function Q(e){const r=typeof e=="string"?e.split(""):e,n=r.length;S("alphabet",r);const b=new Map(r.map((d,s)=>[d,s]));return{encode:d=>(v(d),d.map(s=>{if(!Number.isSafeInteger(s)||s<0||s>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${s}". Allowed: ${e}`);return r[s]})),decode:d=>(v(d),d.map(s=>{I("alphabet.decode",s);const u=b.get(s);if(u===void 0)throw new Error(`Unknown letter: "${s}". Allowed: ${e}`);return u}))}}function W(e=""){return I("join",e),{encode:r=>(S("join.decode",r),r.join(e)),decode:r=>(I("join.decode",r),r.split(e))}}function fe(e,r="="){return B(e),I("padding",r),{encode(n){for(S("padding.encode",n);n.length*e%8;)n.push(r);return n},decode(n){S("padding.decode",n);let b=n.length;if(b*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;b>0&&n[b-1]===r;b--)if((b-1)*e%8===0)throw new Error("padding: invalid, string has too much padding");return n.slice(0,b)}}}function _(e,r,n){if(r<2)throw new Error(`convertRadix: invalid from=${r}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(v(e),!e.length)return[];let b=0;const d=[],s=Array.from(e,i=>{if(B(i),i<0||i>=r)throw new Error(`invalid integer: ${i}`);return i}),u=s.length;for(;;){let i=0,a=!0;for(let w=b;w<u;w++){const p=s[w],x=r*i,A=x+p;if(!Number.isSafeInteger(A)||x/r!==i||A-p!==x)throw new Error("convertRadix: carry overflow");const m=A/n;i=A%n;const l=Math.floor(m);if(s[w]=l,!Number.isSafeInteger(l)||l*n+i!==A)throw new Error("convertRadix: carry overflow");if(a)l?a=!1:b=w;else continue}if(d.push(i),a)break}for(let i=0;i<e.length-1&&e[i]===0;i++)d.push(0);return d.reverse()}const X=(e,r)=>r===0?e:X(r,e%r),$=(e,r)=>e+(r-X(e,r)),R=(()=>{let e=[];for(let r=0;r<40;r++)e.push(2**r);return e})();function F(e,r,n,b){if(v(e),r<=0||r>32)throw new Error(`convertRadix2: wrong from=${r}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if($(r,n)>32)throw new Error(`convertRadix2: carry overflow from=${r} to=${n} carryBits=${$(r,n)}`);let d=0,s=0;const u=R[r],i=R[n]-1,a=[];for(const w of e){if(B(w),w>=u)throw new Error(`convertRadix2: invalid data word=${w} from=${r}`);if(d=d<<r|w,s+r>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${r}`);for(s+=r;s>=n;s-=n)a.push((d>>s-n&i)>>>0);const p=R[s];if(p===void 0)throw new Error("invalid carry");d&=p-1}if(d=d<<n-s&i,!b&&s>=r)throw new Error("Excess padding");if(!b&&d>0)throw new Error(`Non-zero padding: ${d}`);return b&&s>0&&a.push(d>>>0),a}function ae(e){B(e);const r=2**8;return{encode:n=>{if(!P(n))throw new Error("radix.encode input should be Uint8Array");return _(Array.from(n),r,e)},decode:n=>(K("radix.decode",n),Uint8Array.from(_(n,e,r)))}}function le(e,r=!1){if(B(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if($(8,e)>32||$(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!P(n))throw new Error("radix2.encode input should be Uint8Array");return F(Array.from(n),8,e,!r)},decode:n=>(K("radix2.decode",n),Uint8Array.from(F(n,e,8,r)))}}const be=J(le(5),Q("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),fe(5),W("")),se=e=>J(ae(58),Q(e),W("")),we=se("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function D(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Y(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?D(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function ge(e,r){r||(r=e.reduce((d,s)=>d+s.length,0));const n=Y(r);let b=0;for(const d of e)n.set(d,b),b+=d.length;return D(n)}function Z(e,r,n,b){return{name:e,prefix:r,encoder:{name:e,prefix:r,encode:n},decoder:{decode:b}}}const q=Z("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),T=Z("ascii","a",e=>{let r="a";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return r},e=>{e=e.substring(1);const r=Y(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}),ee={utf8:q,"utf-8":q,hex:G.base16,latin1:T,ascii:T,binary:T,...G};function pe(e,r="utf8"){const n=ee[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?D(globalThis.Buffer.from(e,"utf-8")):n.decoder.decode(`${n.prefix}${e}`)}function ye(e,r="utf8"){const n=ee[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):n.encoder.encode(e).substring(1)}var H,N;function re(){if(N)return H;N=1;const e="Input must be an string, Buffer or Uint8Array";function r(u){let i;if(u instanceof Uint8Array)i=u;else if(typeof u=="string")i=new TextEncoder().encode(u);else throw new Error(e);return i}function n(u){return Array.prototype.map.call(u,function(i){return(i<16?"0":"")+i.toString(16)}).join("")}function b(u){return(4294967296+u).toString(16).substring(1)}function d(u,i,a){let w=`
1
+ import{d as G}from"./index-DRYOQXZX.js";function P(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function V(e,r){return Array.isArray(r)?r.length===0?!0:e?r.every(n=>typeof n=="string"):r.every(n=>Number.isSafeInteger(n)):!1}function I(e,r){if(typeof r!="string")throw new Error(`${e}: string expected`);return!0}function B(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function v(e){if(!Array.isArray(e))throw new Error("array expected")}function S(e,r){if(!V(!0,r))throw new Error(`${e}: array of strings expected`)}function K(e,r){if(!V(!1,r))throw new Error(`${e}: array of numbers expected`)}function J(...e){const r=s=>s,n=(s,u)=>i=>s(u(i)),b=e.map(s=>s.encode).reduceRight(n,r),d=e.map(s=>s.decode).reduce(n,r);return{encode:b,decode:d}}function Q(e){const r=typeof e=="string"?e.split(""):e,n=r.length;S("alphabet",r);const b=new Map(r.map((d,s)=>[d,s]));return{encode:d=>(v(d),d.map(s=>{if(!Number.isSafeInteger(s)||s<0||s>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${s}". Allowed: ${e}`);return r[s]})),decode:d=>(v(d),d.map(s=>{I("alphabet.decode",s);const u=b.get(s);if(u===void 0)throw new Error(`Unknown letter: "${s}". Allowed: ${e}`);return u}))}}function W(e=""){return I("join",e),{encode:r=>(S("join.decode",r),r.join(e)),decode:r=>(I("join.decode",r),r.split(e))}}function fe(e,r="="){return B(e),I("padding",r),{encode(n){for(S("padding.encode",n);n.length*e%8;)n.push(r);return n},decode(n){S("padding.decode",n);let b=n.length;if(b*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;b>0&&n[b-1]===r;b--)if((b-1)*e%8===0)throw new Error("padding: invalid, string has too much padding");return n.slice(0,b)}}}function _(e,r,n){if(r<2)throw new Error(`convertRadix: invalid from=${r}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(v(e),!e.length)return[];let b=0;const d=[],s=Array.from(e,i=>{if(B(i),i<0||i>=r)throw new Error(`invalid integer: ${i}`);return i}),u=s.length;for(;;){let i=0,a=!0;for(let w=b;w<u;w++){const p=s[w],x=r*i,A=x+p;if(!Number.isSafeInteger(A)||x/r!==i||A-p!==x)throw new Error("convertRadix: carry overflow");const m=A/n;i=A%n;const l=Math.floor(m);if(s[w]=l,!Number.isSafeInteger(l)||l*n+i!==A)throw new Error("convertRadix: carry overflow");if(a)l?a=!1:b=w;else continue}if(d.push(i),a)break}for(let i=0;i<e.length-1&&e[i]===0;i++)d.push(0);return d.reverse()}const X=(e,r)=>r===0?e:X(r,e%r),$=(e,r)=>e+(r-X(e,r)),R=(()=>{let e=[];for(let r=0;r<40;r++)e.push(2**r);return e})();function F(e,r,n,b){if(v(e),r<=0||r>32)throw new Error(`convertRadix2: wrong from=${r}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if($(r,n)>32)throw new Error(`convertRadix2: carry overflow from=${r} to=${n} carryBits=${$(r,n)}`);let d=0,s=0;const u=R[r],i=R[n]-1,a=[];for(const w of e){if(B(w),w>=u)throw new Error(`convertRadix2: invalid data word=${w} from=${r}`);if(d=d<<r|w,s+r>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${r}`);for(s+=r;s>=n;s-=n)a.push((d>>s-n&i)>>>0);const p=R[s];if(p===void 0)throw new Error("invalid carry");d&=p-1}if(d=d<<n-s&i,!b&&s>=r)throw new Error("Excess padding");if(!b&&d>0)throw new Error(`Non-zero padding: ${d}`);return b&&s>0&&a.push(d>>>0),a}function ae(e){B(e);const r=2**8;return{encode:n=>{if(!P(n))throw new Error("radix.encode input should be Uint8Array");return _(Array.from(n),r,e)},decode:n=>(K("radix.decode",n),Uint8Array.from(_(n,e,r)))}}function le(e,r=!1){if(B(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if($(8,e)>32||$(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!P(n))throw new Error("radix2.encode input should be Uint8Array");return F(Array.from(n),8,e,!r)},decode:n=>(K("radix2.decode",n),Uint8Array.from(F(n,e,8,r)))}}const be=J(le(5),Q("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),fe(5),W("")),se=e=>J(ae(58),Q(e),W("")),we=se("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function D(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Y(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?D(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function ge(e,r){r||(r=e.reduce((d,s)=>d+s.length,0));const n=Y(r);let b=0;for(const d of e)n.set(d,b),b+=d.length;return D(n)}function Z(e,r,n,b){return{name:e,prefix:r,encoder:{name:e,prefix:r,encode:n},decoder:{decode:b}}}const q=Z("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),T=Z("ascii","a",e=>{let r="a";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return r},e=>{e=e.substring(1);const r=Y(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}),ee={utf8:q,"utf-8":q,hex:G.base16,latin1:T,ascii:T,binary:T,...G};function pe(e,r="utf8"){const n=ee[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?D(globalThis.Buffer.from(e,"utf-8")):n.decoder.decode(`${n.prefix}${e}`)}function ye(e,r="utf8"){const n=ee[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):n.encoder.encode(e).substring(1)}var H,N;function re(){if(N)return H;N=1;const e="Input must be an string, Buffer or Uint8Array";function r(u){let i;if(u instanceof Uint8Array)i=u;else if(typeof u=="string")i=new TextEncoder().encode(u);else throw new Error(e);return i}function n(u){return Array.prototype.map.call(u,function(i){return(i<16?"0":"")+i.toString(16)}).join("")}function b(u){return(4294967296+u).toString(16).substring(1)}function d(u,i,a){let w=`
2
2
  `+u+" = ";for(let p=0;p<i.length;p+=2){if(a===32)w+=b(i[p]).toUpperCase(),w+=" ",w+=b(i[p+1]).toUpperCase();else if(a===64)w+=b(i[p+1]).toUpperCase(),w+=b(i[p]).toUpperCase();else throw new Error("Invalid size "+a);p%6===4?w+=`
3
3
  `+new Array(u.length+4).join(" "):p<i.length-2&&(w+=" ")}console.log(w)}function s(u,i,a){let w=new Date().getTime();const p=new Uint8Array(i);for(let A=0;A<i;A++)p[A]=A%256;const x=new Date().getTime();console.log("Generated random input in "+(x-w)+"ms"),w=x;for(let A=0;A<a;A++){const m=u(p),l=new Date().getTime(),h=l-w;w=l,console.log("Hashed in "+h+"ms: "+m.substring(0,20)+"..."),console.log(Math.round(i/(1<<20)/(h/1e3)*100)/100+" MB PER SECOND")}}return H={normalizeInput:r,toHex:n,debugPrint:d,testSpeed:s},H}var C,O;function ue(){if(O)return C;O=1;const e=re();function r(t,c,o){const g=t[c]+t[o];let y=t[c+1]+t[o+1];g>=4294967296&&y++,t[c]=g,t[c+1]=y}function n(t,c,o,g){let y=t[c]+o;o<0&&(y+=4294967296);let U=t[c+1]+g;y>=4294967296&&U++,t[c]=y,t[c+1]=U}function b(t,c){return t[c]^t[c+1]<<8^t[c+2]<<16^t[c+3]<<24}function d(t,c,o,g,y,U){const ne=w[y],te=w[y+1],oe=w[U],ie=w[U+1];r(a,t,c),n(a,t,ne,te);let k=a[g]^a[t],E=a[g+1]^a[t+1];a[g]=E,a[g+1]=k,r(a,o,g),k=a[c]^a[o],E=a[c+1]^a[o+1],a[c]=k>>>24^E<<8,a[c+1]=E>>>24^k<<8,r(a,t,c),n(a,t,oe,ie),k=a[g]^a[t],E=a[g+1]^a[t+1],a[g]=k>>>16^E<<16,a[g+1]=E>>>16^k<<16,r(a,o,g),k=a[c]^a[o],E=a[c+1]^a[o+1],a[c]=E>>>31^k<<1,a[c+1]=k>>>31^E<<1}const s=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),u=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],i=new Uint8Array(u.map(function(t){return t*2})),a=new Uint32Array(32),w=new Uint32Array(32);function p(t,c){let o=0;for(o=0;o<16;o++)a[o]=t.h[o],a[o+16]=s[o];for(a[24]=a[24]^t.t,a[25]=a[25]^t.t/4294967296,c&&(a[28]=~a[28],a[29]=~a[29]),o=0;o<32;o++)w[o]=b(t.b,4*o);for(o=0;o<12;o++)d(0,8,16,24,i[o*16+0],i[o*16+1]),d(2,10,18,26,i[o*16+2],i[o*16+3]),d(4,12,20,28,i[o*16+4],i[o*16+5]),d(6,14,22,30,i[o*16+6],i[o*16+7]),d(0,10,20,30,i[o*16+8],i[o*16+9]),d(2,12,22,24,i[o*16+10],i[o*16+11]),d(4,14,16,26,i[o*16+12],i[o*16+13]),d(6,8,18,28,i[o*16+14],i[o*16+15]);for(o=0;o<16;o++)t.h[o]=t.h[o]^a[o]^a[o+16]}const x=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function A(t,c,o,g){if(t===0||t>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(c&&c.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(o&&o.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(g&&g.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const y={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:t};x.fill(0),x[0]=t,c&&(x[1]=c.length),x[2]=1,x[3]=1,o&&x.set(o,32),g&&x.set(g,48);for(let U=0;U<16;U++)y.h[U]=s[U]^b(x,U*4);return c&&(m(y,c),y.c=128),y}function m(t,c){for(let o=0;o<c.length;o++)t.c===128&&(t.t+=t.c,p(t,!1),t.c=0),t.b[t.c++]=c[o]}function l(t){for(t.t+=t.c;t.c<128;)t.b[t.c++]=0;p(t,!0);const c=new Uint8Array(t.outlen);for(let o=0;o<t.outlen;o++)c[o]=t.h[o>>2]>>8*(o&3);return c}function h(t,c,o,g,y){o=o||64,t=e.normalizeInput(t),g&&(g=e.normalizeInput(g)),y&&(y=e.normalizeInput(y));const U=A(o,c,g,y);return m(U,t),l(U)}function f(t,c,o,g,y){const U=h(t,c,o,g,y);return e.toHex(U)}return C={blake2b:h,blake2bHex:f,blake2bInit:A,blake2bUpdate:m,blake2bFinal:l},C}var M,z;function ce(){if(z)return M;z=1;const e=re();function r(l,h){return l[h]^l[h+1]<<8^l[h+2]<<16^l[h+3]<<24}function n(l,h,f,t,c,o){u[l]=u[l]+u[h]+c,u[t]=b(u[t]^u[l],16),u[f]=u[f]+u[t],u[h]=b(u[h]^u[f],12),u[l]=u[l]+u[h]+o,u[t]=b(u[t]^u[l],8),u[f]=u[f]+u[t],u[h]=b(u[h]^u[f],7)}function b(l,h){return l>>>h^l<<32-h}const d=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),u=new Uint32Array(16),i=new Uint32Array(16);function a(l,h){let f=0;for(f=0;f<8;f++)u[f]=l.h[f],u[f+8]=d[f];for(u[12]^=l.t,u[13]^=l.t/4294967296,h&&(u[14]=~u[14]),f=0;f<16;f++)i[f]=r(l.b,4*f);for(f=0;f<10;f++)n(0,4,8,12,i[s[f*16+0]],i[s[f*16+1]]),n(1,5,9,13,i[s[f*16+2]],i[s[f*16+3]]),n(2,6,10,14,i[s[f*16+4]],i[s[f*16+5]]),n(3,7,11,15,i[s[f*16+6]],i[s[f*16+7]]),n(0,5,10,15,i[s[f*16+8]],i[s[f*16+9]]),n(1,6,11,12,i[s[f*16+10]],i[s[f*16+11]]),n(2,7,8,13,i[s[f*16+12]],i[s[f*16+13]]),n(3,4,9,14,i[s[f*16+14]],i[s[f*16+15]]);for(f=0;f<8;f++)l.h[f]^=u[f]^u[f+8]}function w(l,h){if(!(l>0&&l<=32))throw new Error("Incorrect output length, should be in [1, 32]");const f=h?h.length:0;if(h&&!(f>0&&f<=32))throw new Error("Incorrect key length, should be in [1, 32]");const t={h:new Uint32Array(d),b:new Uint8Array(64),c:0,t:0,outlen:l};return t.h[0]^=16842752^f<<8^l,f>0&&(p(t,h),t.c=64),t}function p(l,h){for(let f=0;f<h.length;f++)l.c===64&&(l.t+=l.c,a(l,!1),l.c=0),l.b[l.c++]=h[f]}function x(l){for(l.t+=l.c;l.c<64;)l.b[l.c++]=0;a(l,!0);const h=new Uint8Array(l.outlen);for(let f=0;f<l.outlen;f++)h[f]=l.h[f>>2]>>8*(f&3)&255;return h}function A(l,h,f){f=f||32,l=e.normalizeInput(l);const t=w(f,h);return p(t,l),x(t)}function m(l,h,f){const t=A(l,h,f);return e.toHex(t)}return M={blake2s:A,blake2sHex:m,blake2sInit:w,blake2sUpdate:p,blake2sFinal:x},M}var j,L;function de(){if(L)return j;L=1;const e=ue(),r=ce();return j={blake2b:e.blake2b,blake2bHex:e.blake2bHex,blake2bInit:e.blake2bInit,blake2bUpdate:e.blake2bUpdate,blake2bFinal:e.blake2bFinal,blake2s:r.blake2s,blake2sHex:r.blake2sHex,blake2sInit:r.blake2sInit,blake2sUpdate:r.blake2sUpdate,blake2sFinal:r.blake2sFinal},j}var Ae=de();export{be as a,we as b,ge as c,Ae as d,pe as f,ye as t};
@@ -1 +1 @@
1
- import{a as en,e as nt}from"./index-Cu4ZjLNb.js";import{c as tn}from"./index-DS2Lm9tG.js";var Fe={};var Ge=function(e,t){return Ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)n.hasOwnProperty(o)&&(r[o]=n[o])},Ge(e,t)};function rn(e,t){Ge(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Je=function(){return Je=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Je.apply(this,arguments)};function nn(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function on(e,t,r,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(i=(o<3?s(i):o>3?s(t,r,i):s(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}function sn(e,t){return function(r,n){t(r,n,e)}}function an(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function un(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function c(u){try{f(n.next(u))}catch(d){s(d)}}function a(u){try{f(n.throw(u))}catch(d){s(d)}}function f(u){u.done?i(u.value):o(u.value).then(c,a)}f((n=n.apply(e,t||[])).next())})}function cn(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(f){return function(u){return a([f,u])}}function a(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=f[0]&2?o.return:f[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,f[1])).done)return i;switch(o=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,o=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){r.label=f[1];break}if(f[0]===6&&r.label<i[1]){r.label=i[1],i=f;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(f);break}i[2]&&r.ops.pop(),r.trys.pop();continue}f=t.call(e,r)}catch(u){f=[6,u],o=0}finally{n=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function fn(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}function hn(e,t){for(var r in e)r!=="default"&&!t.hasOwnProperty(r)&&(t[r]=e[r])}function Ze(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function or(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(c){s={error:c}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i}function ln(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(or(arguments[t]));return e}function dn(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var i=arguments[t],s=0,c=i.length;s<c;s++,o++)n[o]=i[s];return n}function we(e){return this instanceof we?(this.v=e,this):new we(e)}function Dn(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o={},s("next"),s("throw"),s("return"),o[Symbol.asyncIterator]=function(){return this},o;function s(D){n[D]&&(o[D]=function(b){return new Promise(function(h,p){i.push([D,b,h,p])>1||c(D,b)})})}function c(D,b){try{a(n[D](b))}catch(h){d(i[0][3],h)}}function a(D){D.value instanceof we?Promise.resolve(D.value.v).then(f,u):d(i[0][2],D)}function f(D){c("next",D)}function u(D){c("throw",D)}function d(D,b){D(b),i.shift(),i.length&&c(i[0][0],i[0][1])}}function bn(e){var t,r;return t={},n("next"),n("throw",function(o){throw o}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(o,i){t[o]=e[o]?function(s){return(r=!r)?{value:we(e[o](s)),done:o==="return"}:i?i(s):s}:i}}function pn(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Ze=="function"?Ze(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(s){return new Promise(function(c,a){s=e[i](s),o(c,a,s.done,s.value)})}}function o(i,s,c,a){Promise.resolve(a).then(function(f){i({value:f,done:c})},s)}}function gn(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function wn(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function En(e){return e&&e.__esModule?e:{default:e}}function yn(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function mn(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}const _n=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Je},__asyncDelegator:bn,__asyncGenerator:Dn,__asyncValues:pn,__await:we,__awaiter:un,__classPrivateFieldGet:yn,__classPrivateFieldSet:mn,__createBinding:fn,__decorate:on,__exportStar:hn,__extends:rn,__generator:cn,__importDefault:En,__importStar:wn,__makeTemplateObject:gn,__metadata:an,__param:sn,__read:or,__rest:nn,__spread:ln,__spreadArrays:dn,__values:Ze},Symbol.toStringTag,{value:"Module"})),Ae=en(_n);var Pe={},de={},_t;function vn(){if(_t)return de;_t=1,Object.defineProperty(de,"__esModule",{value:!0}),de.delay=void 0;function e(t){return new Promise(r=>{setTimeout(()=>{r(!0)},t)})}return de.delay=e,de}var oe={},je={},ie={},vt;function Cn(){return vt||(vt=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.ONE_THOUSAND=ie.ONE_HUNDRED=void 0,ie.ONE_HUNDRED=100,ie.ONE_THOUSAND=1e3),ie}var Me={},Ct;function Sn(){return Ct||(Ct=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_YEAR=e.FOUR_WEEKS=e.THREE_WEEKS=e.TWO_WEEKS=e.ONE_WEEK=e.THIRTY_DAYS=e.SEVEN_DAYS=e.FIVE_DAYS=e.THREE_DAYS=e.ONE_DAY=e.TWENTY_FOUR_HOURS=e.TWELVE_HOURS=e.SIX_HOURS=e.THREE_HOURS=e.ONE_HOUR=e.SIXTY_MINUTES=e.THIRTY_MINUTES=e.TEN_MINUTES=e.FIVE_MINUTES=e.ONE_MINUTE=e.SIXTY_SECONDS=e.THIRTY_SECONDS=e.TEN_SECONDS=e.FIVE_SECONDS=e.ONE_SECOND=void 0,e.ONE_SECOND=1,e.FIVE_SECONDS=5,e.TEN_SECONDS=10,e.THIRTY_SECONDS=30,e.SIXTY_SECONDS=60,e.ONE_MINUTE=e.SIXTY_SECONDS,e.FIVE_MINUTES=e.ONE_MINUTE*5,e.TEN_MINUTES=e.ONE_MINUTE*10,e.THIRTY_MINUTES=e.ONE_MINUTE*30,e.SIXTY_MINUTES=e.ONE_MINUTE*60,e.ONE_HOUR=e.SIXTY_MINUTES,e.THREE_HOURS=e.ONE_HOUR*3,e.SIX_HOURS=e.ONE_HOUR*6,e.TWELVE_HOURS=e.ONE_HOUR*12,e.TWENTY_FOUR_HOURS=e.ONE_HOUR*24,e.ONE_DAY=e.TWENTY_FOUR_HOURS,e.THREE_DAYS=e.ONE_DAY*3,e.FIVE_DAYS=e.ONE_DAY*5,e.SEVEN_DAYS=e.ONE_DAY*7,e.THIRTY_DAYS=e.ONE_DAY*30,e.ONE_WEEK=e.SEVEN_DAYS,e.TWO_WEEKS=e.ONE_WEEK*2,e.THREE_WEEKS=e.ONE_WEEK*3,e.FOUR_WEEKS=e.ONE_WEEK*4,e.ONE_YEAR=e.ONE_DAY*365})(Me)),Me}var St;function ir(){return St||(St=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Ae;t.__exportStar(Cn(),e),t.__exportStar(Sn(),e)})(je)),je}var Ot;function On(){if(Ot)return oe;Ot=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.fromMiliseconds=oe.toMiliseconds=void 0;const e=ir();function t(n){return n*e.ONE_THOUSAND}oe.toMiliseconds=t;function r(n){return Math.floor(n/e.ONE_THOUSAND)}return oe.fromMiliseconds=r,oe}var xt;function xn(){return xt||(xt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Ae;t.__exportStar(vn(),e),t.__exportStar(On(),e)})(Pe)),Pe}var ce={},At;function An(){if(At)return ce;At=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.Watch=void 0;class e{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const o=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:o})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return ce.Watch=e,ce.default=e,ce}var Le={},De={},Bt;function Bn(){if(Bt)return De;Bt=1,Object.defineProperty(De,"__esModule",{value:!0}),De.IWatch=void 0;class e{}return De.IWatch=e,De}var Rt;function Rn(){return Rt||(Rt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Ae.__exportStar(Bn(),e)})(Le)),Le}var Tt;function Tn(){return Tt||(Tt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Ae;t.__exportStar(xn(),e),t.__exportStar(An(),e),t.__exportStar(Rn(),e),t.__exportStar(ir(),e)})(Fe)),Fe}var ot=Tn();class Un{}let Nn=class extends Un{constructor(t){super()}};const Ut=ot.FIVE_SECONDS,In={pulse:"heartbeat_pulse"};class sr extends Nn{constructor(t){super(t),this.events=new nt.EventEmitter,this.interval=Ut,this.interval=t?.interval||Ut}static async init(t){const r=new sr(t);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),ot.toMiliseconds(this.interval))}pulse(){this.events.emit(In.pulse)}}const Fn=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Pn=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,jn=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Mn(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){Ln(e);return}return t}function Ln(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function su(e,t={}){if(typeof e!="string")return e;if(e[0]==='"'&&e[e.length-1]==='"'&&e.indexOf("\\")===-1)return e.slice(1,-1);const r=e.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!jn.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(Fn.test(e)||Pn.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,Mn)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}const zn=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r),Hn=e=>{const t=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=e.replace(t,'$1"$2n"$3');return JSON.parse(r,(n,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function ar(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return Hn(e)}catch{return e}}function ur(e){return typeof e=="string"?e:zn(e)||""}function Wn(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function cr(e,...t){if(!Wn(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Nt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function qn(e,t){cr(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const fe=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;const ze=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function kn(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function fr(e){return typeof e=="string"&&(e=kn(e)),cr(e),e}class $n{clone(){return this._cloneInto()}}function Vn(e){const t=n=>e().update(fr(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function hr(e=32){if(fe&&typeof fe.getRandomValues=="function")return fe.getRandomValues(new Uint8Array(e));if(fe&&typeof fe.randomBytes=="function")return fe.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}function Yn(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),s=Number(r>>o&i),c=Number(r&i),a=n?4:0,f=n?0:4;e.setUint32(t+a,s,n),e.setUint32(t+f,c,n)}class Kn extends $n{constructor(t,r,n,o){super(),this.blockLen=t,this.outputLen=r,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=ze(this.buffer)}update(t){Nt(this);const{view:r,buffer:n,blockLen:o}=this;t=fr(t);const i=t.length;for(let s=0;s<i;){const c=Math.min(o-this.pos,i-s);if(c===o){const a=ze(t);for(;o<=i-s;s+=o)this.process(a,s);continue}n.set(t.subarray(s,s+c),this.pos),this.pos+=c,s+=c,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Nt(this),qn(t,this),this.finished=!0;const{buffer:r,view:n,blockLen:o,isLE:i}=this;let{pos:s}=this;r[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>o-s&&(this.process(n,0),s=0);for(let d=s;d<o;d++)r[d]=0;Yn(n,o-8,BigInt(this.length*8),i),this.process(n,0);const c=ze(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const f=a/4,u=this.get();if(f>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<f;d++)c.setUint32(4*d,u[d],i)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:n,length:o,finished:i,destroyed:s,pos:c}=this;return t.length=o,t.pos=c,t.finished=i,t.destroyed=s,o%r&&t.buffer.set(n),t}}const _e=BigInt(2**32-1),Xe=BigInt(32);function lr(e,t=!1){return t?{h:Number(e&_e),l:Number(e>>Xe&_e)}:{h:Number(e>>Xe&_e)|0,l:Number(e&_e)|0}}function Gn(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:i,l:s}=lr(e[o],t);[r[o],n[o]]=[i,s]}return[r,n]}const Jn=(e,t)=>BigInt(e>>>0)<<Xe|BigInt(t>>>0),Zn=(e,t,r)=>e>>>r,Xn=(e,t,r)=>e<<32-r|t>>>r,Qn=(e,t,r)=>e>>>r|t<<32-r,eo=(e,t,r)=>e<<32-r|t>>>r,to=(e,t,r)=>e<<64-r|t>>>r-32,ro=(e,t,r)=>e>>>r-32|t<<64-r,no=(e,t)=>t,oo=(e,t)=>e,io=(e,t,r)=>e<<r|t>>>32-r,so=(e,t,r)=>t<<r|e>>>32-r,ao=(e,t,r)=>t<<r-32|e>>>64-r,uo=(e,t,r)=>e<<r-32|t>>>64-r;function co(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:o|0}}const fo=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),ho=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,lo=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),Do=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,bo=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),po=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0,S={fromBig:lr,split:Gn,toBig:Jn,shrSH:Zn,shrSL:Xn,rotrSH:Qn,rotrSL:eo,rotrBH:to,rotrBL:ro,rotr32H:no,rotr32L:oo,rotlSH:io,rotlSL:so,rotlBH:ao,rotlBL:uo,add:co,add3L:fo,add3H:ho,add4L:lo,add4H:Do,add5H:po,add5L:bo},[go,wo]=S.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),ee=new Uint32Array(80),te=new Uint32Array(80);class Eo extends Kn{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:r,Bh:n,Bl:o,Ch:i,Cl:s,Dh:c,Dl:a,Eh:f,El:u,Fh:d,Fl:D,Gh:b,Gl:h,Hh:p,Hl:m}=this;return[t,r,n,o,i,s,c,a,f,u,d,D,b,h,p,m]}set(t,r,n,o,i,s,c,a,f,u,d,D,b,h,p,m){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=o|0,this.Ch=i|0,this.Cl=s|0,this.Dh=c|0,this.Dl=a|0,this.Eh=f|0,this.El=u|0,this.Fh=d|0,this.Fl=D|0,this.Gh=b|0,this.Gl=h|0,this.Hh=p|0,this.Hl=m|0}process(t,r){for(let l=0;l<16;l++,r+=4)ee[l]=t.getUint32(r),te[l]=t.getUint32(r+=4);for(let l=16;l<80;l++){const E=ee[l-15]|0,O=te[l-15]|0,N=S.rotrSH(E,O,1)^S.rotrSH(E,O,8)^S.shrSH(E,O,7),R=S.rotrSL(E,O,1)^S.rotrSL(E,O,8)^S.shrSL(E,O,7),x=ee[l-2]|0,F=te[l-2]|0,ae=S.rotrSH(x,F,19)^S.rotrBH(x,F,61)^S.shrSH(x,F,6),re=S.rotrSL(x,F,19)^S.rotrBL(x,F,61)^S.shrSL(x,F,6),ue=S.add4L(R,re,te[l-7],te[l-16]),le=S.add4H(ue,N,ae,ee[l-7],ee[l-16]);ee[l]=le|0,te[l]=ue|0}let{Ah:n,Al:o,Bh:i,Bl:s,Ch:c,Cl:a,Dh:f,Dl:u,Eh:d,El:D,Fh:b,Fl:h,Gh:p,Gl:m,Hh:_,Hl:w}=this;for(let l=0;l<80;l++){const E=S.rotrSH(d,D,14)^S.rotrSH(d,D,18)^S.rotrBH(d,D,41),O=S.rotrSL(d,D,14)^S.rotrSL(d,D,18)^S.rotrBL(d,D,41),N=d&b^~d&p,R=D&h^~D&m,x=S.add5L(w,O,R,wo[l],te[l]),F=S.add5H(x,_,E,N,go[l],ee[l]),ae=x|0,re=S.rotrSH(n,o,28)^S.rotrBH(n,o,34)^S.rotrBH(n,o,39),ue=S.rotrSL(n,o,28)^S.rotrBL(n,o,34)^S.rotrBL(n,o,39),le=n&i^n&c^i&c,Ne=o&s^o&a^s&a;_=p|0,w=m|0,p=b|0,m=h|0,b=d|0,h=D|0,{h:d,l:D}=S.add(f|0,u|0,F|0,ae|0),f=c|0,u=a|0,c=i|0,a=s|0,i=n|0,s=o|0;const v=S.add3L(ae,ue,Ne);n=S.add3H(v,F,re,le),o=v|0}({h:n,l:o}=S.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:i,l:s}=S.add(this.Bh|0,this.Bl|0,i|0,s|0),{h:c,l:a}=S.add(this.Ch|0,this.Cl|0,c|0,a|0),{h:f,l:u}=S.add(this.Dh|0,this.Dl|0,f|0,u|0),{h:d,l:D}=S.add(this.Eh|0,this.El|0,d|0,D|0),{h:b,l:h}=S.add(this.Fh|0,this.Fl|0,b|0,h|0),{h:p,l:m}=S.add(this.Gh|0,this.Gl|0,p|0,m|0),{h:_,l:w}=S.add(this.Hh|0,this.Hl|0,_|0,w|0),this.set(n,o,i,s,c,a,f,u,d,D,b,h,p,m,_,w)}roundClean(){ee.fill(0),te.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const yo=Vn(()=>new Eo);const it=BigInt(0),dr=BigInt(1),mo=BigInt(2);function st(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function at(e){if(!st(e))throw new Error("Uint8Array expected")}function He(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}const _o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ut(e){at(e);let t="";for(let r=0;r<e.length;r++)t+=_o[e[r]];return t}function Dr(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?it:BigInt("0x"+e)}const Z={_0:48,_9:57,A:65,F:70,a:97,f:102};function It(e){if(e>=Z._0&&e<=Z._9)return e-Z._0;if(e>=Z.A&&e<=Z.F)return e-(Z.A-10);if(e>=Z.a&&e<=Z.f)return e-(Z.a-10)}function br(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){const s=It(e.charCodeAt(i)),c=It(e.charCodeAt(i+1));if(s===void 0||c===void 0){const a=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+a+'" at index '+i)}n[o]=s*16+c}return n}function vo(e){return Dr(ut(e))}function Se(e){return at(e),Dr(ut(Uint8Array.from(e).reverse()))}function pr(e,t){return br(e.toString(16).padStart(t*2,"0"))}function Qe(e,t){return pr(e,t).reverse()}function X(e,t,r){let n;if(typeof t=="string")try{n=br(t)}catch(i){throw new Error(e+" must be hex string or Uint8Array, cause: "+i)}else if(st(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=n.length;if(typeof r=="number"&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function Ft(...e){let t=0;for(let n=0;n<e.length;n++){const o=e[n];at(o),t+=o.length}const r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){const i=e[n];r.set(i,o),o+=i.length}return r}const We=e=>typeof e=="bigint"&&it<=e;function Co(e,t,r){return We(e)&&We(t)&&We(r)&&t<=e&&e<r}function be(e,t,r,n){if(!Co(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function So(e){let t;for(t=0;e>it;e>>=dr,t+=1);return t}const Oo=e=>(mo<<BigInt(e-1))-dr,xo={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||st(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function ct(e,t,r={}){const n=(o,i,s)=>{const c=xo[i];if(typeof c!="function")throw new Error("invalid validator function");const a=e[o];if(!(s&&a===void 0)&&!c(a,e))throw new Error("param "+String(o)+" is invalid. Expected "+i+", got "+a)};for(const[o,i]of Object.entries(t))n(o,i,!1);for(const[o,i]of Object.entries(r))n(o,i,!0);return e}function Pt(e){const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(o!==void 0)return o;const i=e(r,...n);return t.set(r,i),i}}const z=BigInt(0),M=BigInt(1),se=BigInt(2),Ao=BigInt(3),et=BigInt(4),jt=BigInt(5),Mt=BigInt(8);function L(e,t){const r=e%t;return r>=z?r:t+r}function Bo(e,t,r){if(t<z)throw new Error("invalid exponent, negatives unsupported");if(r<=z)throw new Error("invalid modulus");if(r===M)return z;let n=M;for(;t>z;)t&M&&(n=n*e%r),e=e*e%r,t>>=M;return n}function K(e,t,r){let n=e;for(;t-- >z;)n*=n,n%=r;return n}function Lt(e,t){if(e===z)throw new Error("invert: expected non-zero number");if(t<=z)throw new Error("invert: expected positive modulus, got "+t);let r=L(e,t),n=t,o=z,i=M;for(;r!==z;){const s=n/r,c=n%r,a=o-i*s;n=r,r=c,o=i,i=a}if(n!==M)throw new Error("invert: does not exist");return L(o,t)}function Ro(e){const t=(e-M)/se;let r,n,o;for(r=e-M,n=0;r%se===z;r/=se,n++);for(o=se;o<e&&Bo(o,t,e)!==e-M;o++)if(o>1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const s=(e+M)/et;return function(c,a){const f=c.pow(a,s);if(!c.eql(c.sqr(f),a))throw new Error("Cannot find square root");return f}}const i=(r+M)/se;return function(s,c){if(s.pow(c,t)===s.neg(s.ONE))throw new Error("Cannot find square root");let a=n,f=s.pow(s.mul(s.ONE,o),r),u=s.pow(c,i),d=s.pow(c,r);for(;!s.eql(d,s.ONE);){if(s.eql(d,s.ZERO))return s.ZERO;let D=1;for(let h=s.sqr(d);D<a&&!s.eql(h,s.ONE);D++)h=s.sqr(h);const b=s.pow(f,M<<BigInt(a-D-1));f=s.sqr(b),u=s.mul(u,b),d=s.mul(d,f),a=D}return u}}function To(e){if(e%et===Ao){const t=(e+M)/et;return function(r,n){const o=r.pow(n,t);if(!r.eql(r.sqr(o),n))throw new Error("Cannot find square root");return o}}if(e%Mt===jt){const t=(e-jt)/Mt;return function(r,n){const o=r.mul(n,se),i=r.pow(o,t),s=r.mul(n,i),c=r.mul(r.mul(s,se),i),a=r.mul(s,r.sub(c,r.ONE));if(!r.eql(r.sqr(a),n))throw new Error("Cannot find square root");return a}}return Ro(e)}const Uo=(e,t)=>(L(e,t)&M)===M,No=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Io(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=No.reduce((n,o)=>(n[o]="function",n),t);return ct(e,r)}function Fo(e,t,r){if(r<z)throw new Error("invalid exponent, negatives unsupported");if(r===z)return e.ONE;if(r===M)return t;let n=e.ONE,o=t;for(;r>z;)r&M&&(n=e.mul(n,o)),o=e.sqr(o),r>>=M;return n}function Po(e,t){const r=new Array(t.length),n=t.reduce((i,s,c)=>e.is0(s)?i:(r[c]=i,e.mul(i,s)),e.ONE),o=e.inv(n);return t.reduceRight((i,s,c)=>e.is0(s)?i:(r[c]=e.mul(i,r[c]),e.mul(i,s)),o),r}function gr(e,t){const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function wr(e,t,r=!1,n={}){if(e<=z)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:i}=gr(e,t);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const c=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:i,MASK:Oo(o),ZERO:z,ONE:M,create:a=>L(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof a);return z<=a&&a<e},is0:a=>a===z,isOdd:a=>(a&M)===M,neg:a=>L(-a,e),eql:(a,f)=>a===f,sqr:a=>L(a*a,e),add:(a,f)=>L(a+f,e),sub:(a,f)=>L(a-f,e),mul:(a,f)=>L(a*f,e),pow:(a,f)=>Fo(c,a,f),div:(a,f)=>L(a*Lt(f,e),e),sqrN:a=>a*a,addN:(a,f)=>a+f,subN:(a,f)=>a-f,mulN:(a,f)=>a*f,inv:a=>Lt(a,e),sqrt:n.sqrt||(a=>(s||(s=To(e)),s(c,a))),invertBatch:a=>Po(c,a),cmov:(a,f,u)=>u?f:a,toBytes:a=>r?Qe(a,i):pr(a,i),fromBytes:a=>{if(a.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+a.length);return r?Se(a):vo(a)}});return Object.freeze(c)}const zt=BigInt(0),ve=BigInt(1);function qe(e,t){const r=t.negate();return e?r:t}function Er(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function ke(e,t){Er(e,t);const r=Math.ceil(t/e)+1,n=2**(e-1);return{windows:r,windowSize:n}}function jo(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function Mo(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}const $e=new WeakMap,yr=new WeakMap;function Ve(e){return yr.get(e)||1}function Lo(e,t){return{constTimeNegate:qe,hasPrecomputes(r){return Ve(r)!==1},unsafeLadder(r,n,o=e.ZERO){let i=r;for(;n>zt;)n&ve&&(o=o.add(i)),i=i.double(),n>>=ve;return o},precomputeWindow(r,n){const{windows:o,windowSize:i}=ke(n,t),s=[];let c=r,a=c;for(let f=0;f<o;f++){a=c,s.push(a);for(let u=1;u<i;u++)a=a.add(c),s.push(a);c=a.double()}return s},wNAF(r,n,o){const{windows:i,windowSize:s}=ke(r,t);let c=e.ZERO,a=e.BASE;const f=BigInt(2**r-1),u=2**r,d=BigInt(r);for(let D=0;D<i;D++){const b=D*s;let h=Number(o&f);o>>=d,h>s&&(h-=u,o+=ve);const p=b,m=b+Math.abs(h)-1,_=D%2!==0,w=h<0;h===0?a=a.add(qe(_,n[p])):c=c.add(qe(w,n[m]))}return{p:c,f:a}},wNAFUnsafe(r,n,o,i=e.ZERO){const{windows:s,windowSize:c}=ke(r,t),a=BigInt(2**r-1),f=2**r,u=BigInt(r);for(let d=0;d<s;d++){const D=d*c;if(o===zt)break;let b=Number(o&a);if(o>>=u,b>c&&(b-=f,o+=ve),b===0)continue;let h=n[D+Math.abs(b)-1];b<0&&(h=h.negate()),i=i.add(h)}return i},getPrecomputes(r,n,o){let i=$e.get(n);return i||(i=this.precomputeWindow(n,r),r!==1&&$e.set(n,o(i))),i},wNAFCached(r,n,o){const i=Ve(r);return this.wNAF(i,this.getPrecomputes(i,r,o),n)},wNAFCachedUnsafe(r,n,o,i){const s=Ve(r);return s===1?this.unsafeLadder(r,n,i):this.wNAFUnsafe(s,this.getPrecomputes(s,r,o),n,i)},setWindowSize(r,n){Er(n,t),yr.set(r,n),$e.delete(r)}}}function zo(e,t,r,n){if(jo(r,e),Mo(n,t),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const o=e.ZERO,i=So(BigInt(r.length)),s=i>12?i-3:i>4?i-2:i?2:1,c=(1<<s)-1,a=new Array(c+1).fill(o),f=Math.floor((t.BITS-1)/s)*s;let u=o;for(let d=f;d>=0;d-=s){a.fill(o);for(let b=0;b<n.length;b++){const h=n[b],p=Number(h>>BigInt(d)&BigInt(c));a[p]=a[p].add(r[b])}let D=o;for(let b=a.length-1,h=o;b>0;b--)h=h.add(a[b]),D=D.add(h);if(u=u.add(D),d!==0)for(let b=0;b<s;b++)u=u.double()}return u}function Ho(e){return Io(e.Fp),ct(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...gr(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const Y=BigInt(0),$=BigInt(1),Ce=BigInt(2),Wo=BigInt(8),qo={zip215:!0};function ko(e){const t=Ho(e);return ct(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function $o(e){const t=ko(e),{Fp:r,n,prehash:o,hash:i,randomBytes:s,nByteLength:c,h:a}=t,f=Ce<<BigInt(c*8)-$,u=r.create,d=wr(t.n,t.nBitLength),D=t.uvRatio||((v,g)=>{try{return{isValid:!0,value:r.sqrt(v*r.inv(g))}}catch{return{isValid:!1,value:Y}}}),b=t.adjustScalarBytes||(v=>v),h=t.domain||((v,g,y)=>{if(He("phflag",y),g.length||y)throw new Error("Contexts/pre-hash are not supported");return v});function p(v,g){be("coordinate "+v,g,Y,f)}function m(v){if(!(v instanceof l))throw new Error("ExtendedPoint expected")}const _=Pt((v,g)=>{const{ex:y,ey:C,ez:A}=v,B=v.is0();g==null&&(g=B?Wo:r.inv(A));const T=u(y*g),P=u(C*g),I=u(A*g);if(B)return{x:Y,y:$};if(I!==$)throw new Error("invZ was invalid");return{x:T,y:P}}),w=Pt(v=>{const{a:g,d:y}=t;if(v.is0())throw new Error("bad point: ZERO");const{ex:C,ey:A,ez:B,et:T}=v,P=u(C*C),I=u(A*A),j=u(B*B),H=u(j*j),k=u(P*g),G=u(j*u(k+I)),J=u(H+u(y*u(P*I)));if(G!==J)throw new Error("bad point: equation left != right (1)");const V=u(C*A),Q=u(B*T);if(V!==Q)throw new Error("bad point: equation left != right (2)");return!0});class l{constructor(g,y,C,A){this.ex=g,this.ey=y,this.ez=C,this.et=A,p("x",g),p("y",y),p("z",C),p("t",A),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(g){if(g instanceof l)throw new Error("extended point not allowed");const{x:y,y:C}=g||{};return p("x",y),p("y",C),new l(y,C,$,u(y*C))}static normalizeZ(g){const y=r.invertBatch(g.map(C=>C.ez));return g.map((C,A)=>C.toAffine(y[A])).map(l.fromAffine)}static msm(g,y){return zo(l,d,g,y)}_setWindowSize(g){N.setWindowSize(this,g)}assertValidity(){w(this)}equals(g){m(g);const{ex:y,ey:C,ez:A}=this,{ex:B,ey:T,ez:P}=g,I=u(y*P),j=u(B*A),H=u(C*P),k=u(T*A);return I===j&&H===k}is0(){return this.equals(l.ZERO)}negate(){return new l(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){const{a:g}=t,{ex:y,ey:C,ez:A}=this,B=u(y*y),T=u(C*C),P=u(Ce*u(A*A)),I=u(g*B),j=y+C,H=u(u(j*j)-B-T),k=I+T,G=k-P,J=I-T,V=u(H*G),Q=u(k*J),ne=u(H*J),me=u(G*k);return new l(V,Q,me,ne)}add(g){m(g);const{a:y,d:C}=t,{ex:A,ey:B,ez:T,et:P}=this,{ex:I,ey:j,ez:H,et:k}=g;if(y===BigInt(-1)){const bt=u((B-A)*(j+I)),pt=u((B+A)*(j-I)),Ie=u(pt-bt);if(Ie===Y)return this.double();const gt=u(T*Ce*k),wt=u(P*Ce*H),Et=wt+gt,yt=pt+bt,mt=wt-gt,Jr=u(Et*Ie),Zr=u(yt*mt),Xr=u(Et*mt),Qr=u(Ie*yt);return new l(Jr,Zr,Qr,Xr)}const G=u(A*I),J=u(B*j),V=u(P*C*k),Q=u(T*H),ne=u((A+B)*(I+j)-G-J),me=Q-V,dt=Q+V,Dt=u(J-y*G),Vr=u(ne*me),Yr=u(dt*Dt),Kr=u(ne*Dt),Gr=u(me*dt);return new l(Vr,Yr,Gr,Kr)}subtract(g){return this.add(g.negate())}wNAF(g){return N.wNAFCached(this,g,l.normalizeZ)}multiply(g){const y=g;be("scalar",y,$,n);const{p:C,f:A}=this.wNAF(y);return l.normalizeZ([C,A])[0]}multiplyUnsafe(g,y=l.ZERO){const C=g;return be("scalar",C,Y,n),C===Y?O:this.is0()||C===$?this:N.wNAFCachedUnsafe(this,C,l.normalizeZ,y)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}isTorsionFree(){return N.unsafeLadder(this,n).is0()}toAffine(g){return _(this,g)}clearCofactor(){const{h:g}=t;return g===$?this:this.multiplyUnsafe(g)}static fromHex(g,y=!1){const{d:C,a:A}=t,B=r.BYTES;g=X("pointHex",g,B),He("zip215",y);const T=g.slice(),P=g[B-1];T[B-1]=P&-129;const I=Se(T),j=y?f:r.ORDER;be("pointHex.y",I,Y,j);const H=u(I*I),k=u(H-$),G=u(C*H-A);let{isValid:J,value:V}=D(k,G);if(!J)throw new Error("Point.fromHex: invalid y coordinate");const Q=(V&$)===$,ne=(P&128)!==0;if(!y&&V===Y&&ne)throw new Error("Point.fromHex: x=0 and x_0=1");return ne!==Q&&(V=u(-V)),l.fromAffine({x:V,y:I})}static fromPrivateKey(g){return F(g).point}toRawBytes(){const{x:g,y}=this.toAffine(),C=Qe(y,r.BYTES);return C[C.length-1]|=g&$?128:0,C}toHex(){return ut(this.toRawBytes())}}l.BASE=new l(t.Gx,t.Gy,$,u(t.Gx*t.Gy)),l.ZERO=new l(Y,$,$,Y);const{BASE:E,ZERO:O}=l,N=Lo(l,c*8);function R(v){return L(v,n)}function x(v){return R(Se(v))}function F(v){const g=r.BYTES;v=X("private key",v,g);const y=X("hashed private key",i(v),2*g),C=b(y.slice(0,g)),A=y.slice(g,2*g),B=x(C),T=E.multiply(B),P=T.toRawBytes();return{head:C,prefix:A,scalar:B,point:T,pointBytes:P}}function ae(v){return F(v).pointBytes}function re(v=new Uint8Array,...g){const y=Ft(...g);return x(i(h(y,X("context",v),!!o)))}function ue(v,g,y={}){v=X("message",v),o&&(v=o(v));const{prefix:C,scalar:A,pointBytes:B}=F(g),T=re(y.context,C,v),P=E.multiply(T).toRawBytes(),I=re(y.context,P,B,v),j=R(T+I*A);be("signature.s",j,Y,n);const H=Ft(P,Qe(j,r.BYTES));return X("result",H,r.BYTES*2)}const le=qo;function Ne(v,g,y,C=le){const{context:A,zip215:B}=C,T=r.BYTES;v=X("signature",v,2*T),g=X("message",g),y=X("publicKey",y,T),B!==void 0&&He("zip215",B),o&&(g=o(g));const P=Se(v.slice(T,2*T));let I,j,H;try{I=l.fromHex(y,B),j=l.fromHex(v.slice(0,T),B),H=E.multiplyUnsafe(P)}catch{return!1}if(!B&&I.isSmallOrder())return!1;const k=re(A,j.toRawBytes(),I.toRawBytes(),g);return j.add(I.multiplyUnsafe(k)).subtract(H).clearCofactor().equals(l.ZERO)}return E._setWindowSize(8),{CURVE:t,getPublicKey:ae,sign:ue,verify:Ne,ExtendedPoint:l,utils:{getExtendedPublicKey:F,randomPrivateKey:()=>s(r.BYTES),precompute(v=8,g=l.BASE){return g._setWindowSize(v),g.multiply(BigInt(3)),g}}}}BigInt(0),BigInt(1);const ft=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Ht=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const Vo=BigInt(1),Wt=BigInt(2);BigInt(3);const Yo=BigInt(5),Ko=BigInt(8);function Go(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),i=ft,s=e*e%i*e%i,c=K(s,Wt,i)*s%i,a=K(c,Vo,i)*e%i,f=K(a,Yo,i)*a%i,u=K(f,t,i)*f%i,d=K(u,r,i)*u%i,D=K(d,n,i)*d%i,b=K(D,o,i)*D%i,h=K(b,o,i)*D%i,p=K(h,t,i)*f%i;return{pow_p_5_8:K(p,Wt,i)*e%i,b2:s}}function Jo(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function Zo(e,t){const r=ft,n=L(t*t*t,r),o=L(n*n*t,r),i=Go(e*o).pow_p_5_8;let s=L(e*n*i,r);const c=L(t*s*s,r),a=s,f=L(s*Ht,r),u=c===e,d=c===L(-e,r),D=c===L(-e*Ht,r);return u&&(s=a),(d||D)&&(s=f),Uo(s,r)&&(s=L(-s,r)),{isValid:u||d,value:s}}const Xo=wr(ft,void 0,!0),Qo={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Xo,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:Ko,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:yo,randomBytes:hr,adjustScalarBytes:Jo,uvRatio:Zo},mr=$o(Qo),ei="EdDSA",ti="JWT",Oe=".",Be="base64url",_r="utf8",vr="utf8",ri=":",ni="did",oi="key",qt="base58btc",ii="z",si="K36",ai=32;function ht(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Cr(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?ht(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function Sr(e,t){t||(t=e.reduce((o,i)=>o+i.length,0));const r=Cr(t);let n=0;for(const o of e)r.set(o,n),n+=o.length;return ht(r)}function ui(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<e.length;o++){var i=e.charAt(o),s=i.charCodeAt(0);if(r[s]!==255)throw new TypeError(i+" is ambiguous");r[s]=o}var c=e.length,a=e.charAt(0),f=Math.log(c)/Math.log(256),u=Math.log(256)/Math.log(c);function d(h){if(h instanceof Uint8Array||(ArrayBuffer.isView(h)?h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength):Array.isArray(h)&&(h=Uint8Array.from(h))),!(h instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(h.length===0)return"";for(var p=0,m=0,_=0,w=h.length;_!==w&&h[_]===0;)_++,p++;for(var l=(w-_)*u+1>>>0,E=new Uint8Array(l);_!==w;){for(var O=h[_],N=0,R=l-1;(O!==0||N<m)&&R!==-1;R--,N++)O+=256*E[R]>>>0,E[R]=O%c>>>0,O=O/c>>>0;if(O!==0)throw new Error("Non-zero carry");m=N,_++}for(var x=l-m;x!==l&&E[x]===0;)x++;for(var F=a.repeat(p);x<l;++x)F+=e.charAt(E[x]);return F}function D(h){if(typeof h!="string")throw new TypeError("Expected String");if(h.length===0)return new Uint8Array;var p=0;if(h[p]!==" "){for(var m=0,_=0;h[p]===a;)m++,p++;for(var w=(h.length-p)*f+1>>>0,l=new Uint8Array(w);h[p];){var E=r[h.charCodeAt(p)];if(E===255)return;for(var O=0,N=w-1;(E!==0||O<_)&&N!==-1;N--,O++)E+=c*l[N]>>>0,l[N]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");_=O,p++}if(h[p]!==" "){for(var R=w-_;R!==w&&l[R]===0;)R++;for(var x=new Uint8Array(m+(w-R)),F=m;R!==w;)x[F++]=l[R++];return x}}}function b(h){var p=D(h);if(p)return p;throw new Error(`Non-${t} character`)}return{encode:d,decodeUnsafe:D,decode:b}}var ci=ui,fi=ci;const Or=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},hi=e=>new TextEncoder().encode(e),li=e=>new TextDecoder().decode(e);class di{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Di{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return xr(this,t)}}class bi{constructor(t){this.decoders=t}or(t){return xr(this,t)}decode(t){const r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const xr=(e,t)=>new bi({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class pi{constructor(t,r,n,o){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new di(t,r,n),this.decoder=new Di(t,r,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Re=({name:e,prefix:t,encode:r,decode:n})=>new pi(e,t,r,n),Ee=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:o}=fi(r,t);return Re({prefix:e,name:t,encode:n,decode:i=>Or(o(i))})},gi=(e,t,r,n)=>{const o={};for(let u=0;u<t.length;++u)o[t[u]]=u;let i=e.length;for(;e[i-1]==="=";)--i;const s=new Uint8Array(i*r/8|0);let c=0,a=0,f=0;for(let u=0;u<i;++u){const d=o[e[u]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);a=a<<r|d,c+=r,c>=8&&(c-=8,s[f++]=255&a>>c)}if(c>=r||255&a<<8-c)throw new SyntaxError("Unexpected end of data");return s},wi=(e,t,r)=>{const n=t[t.length-1]==="=",o=(1<<r)-1;let i="",s=0,c=0;for(let a=0;a<e.length;++a)for(c=c<<8|e[a],s+=8;s>r;)s-=r,i+=t[o&c>>s];if(s&&(i+=t[o&c<<r-s]),n)for(;i.length*r&7;)i+="=";return i},W=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Re({prefix:t,name:e,encode(o){return wi(o,n,r)},decode(o){return gi(o,n,r,e)}}),Ei=Re({prefix:"\0",name:"identity",encode:e=>li(e),decode:e=>hi(e)});var yi=Object.freeze({__proto__:null,identity:Ei});const mi=W({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var _i=Object.freeze({__proto__:null,base2:mi});const vi=W({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Ci=Object.freeze({__proto__:null,base8:vi});const Si=Ee({prefix:"9",name:"base10",alphabet:"0123456789"});var Oi=Object.freeze({__proto__:null,base10:Si});const xi=W({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ai=W({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Bi=Object.freeze({__proto__:null,base16:xi,base16upper:Ai});const Ri=W({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ti=W({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ui=W({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ni=W({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ii=W({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Fi=W({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Pi=W({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ji=W({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Mi=W({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Li=Object.freeze({__proto__:null,base32:Ri,base32upper:Ti,base32pad:Ui,base32padupper:Ni,base32hex:Ii,base32hexupper:Fi,base32hexpad:Pi,base32hexpadupper:ji,base32z:Mi});const zi=Ee({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Hi=Ee({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Wi=Object.freeze({__proto__:null,base36:zi,base36upper:Hi});const qi=Ee({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ki=Ee({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var $i=Object.freeze({__proto__:null,base58btc:qi,base58flickr:ki});const Vi=W({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Yi=W({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ki=W({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Gi=W({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Ji=Object.freeze({__proto__:null,base64:Vi,base64pad:Yi,base64url:Ki,base64urlpad:Gi});const Ar=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Zi=Ar.reduce((e,t,r)=>(e[r]=t,e),[]),Xi=Ar.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function Qi(e){return e.reduce((t,r)=>(t+=Zi[r],t),"")}function es(e){const t=[];for(const r of e){const n=Xi[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}const ts=Re({prefix:"🚀",name:"base256emoji",encode:Qi,decode:es});var rs=Object.freeze({__proto__:null,base256emoji:ts}),ns=Br,kt=128,os=-128,is=Math.pow(2,31);function Br(e,t,r){t=t||[],r=r||0;for(var n=r;e>=is;)t[r++]=e&255|kt,e/=128;for(;e&os;)t[r++]=e&255|kt,e>>>=7;return t[r]=e|0,Br.bytes=r-n+1,t}var ss=tt,as=128,$t=127;function tt(e,n){var r=0,n=n||0,o=0,i=n,s,c=e.length;do{if(i>=c)throw tt.bytes=0,new RangeError("Could not decode varint");s=e[i++],r+=o<28?(s&$t)<<o:(s&$t)*Math.pow(2,o),o+=7}while(s>=as);return tt.bytes=i-n,r}var us=Math.pow(2,7),cs=Math.pow(2,14),fs=Math.pow(2,21),hs=Math.pow(2,28),ls=Math.pow(2,35),ds=Math.pow(2,42),Ds=Math.pow(2,49),bs=Math.pow(2,56),ps=Math.pow(2,63),gs=function(e){return e<us?1:e<cs?2:e<fs?3:e<hs?4:e<ls?5:e<ds?6:e<Ds?7:e<bs?8:e<ps?9:10},ws={encode:ns,decode:ss,encodingLength:gs},Rr=ws;const Vt=(e,t,r=0)=>(Rr.encode(e,t,r),t),Yt=e=>Rr.encodingLength(e),rt=(e,t)=>{const r=t.byteLength,n=Yt(e),o=n+Yt(r),i=new Uint8Array(o+r);return Vt(e,i,0),Vt(r,i,n),i.set(t,o),new Es(e,r,t,i)};class Es{constructor(t,r,n,o){this.code=t,this.size=r,this.digest=n,this.bytes=o}}const Tr=({name:e,code:t,encode:r})=>new ys(e,t,r);class ys{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){const r=this.encode(t);return r instanceof Uint8Array?rt(this.code,r):r.then(n=>rt(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Ur=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),ms=Tr({name:"sha2-256",code:18,encode:Ur("SHA-256")}),_s=Tr({name:"sha2-512",code:19,encode:Ur("SHA-512")});var vs=Object.freeze({__proto__:null,sha256:ms,sha512:_s});const Nr=0,Cs="identity",Ir=Or,Ss=e=>rt(Nr,Ir(e)),Os={code:Nr,name:Cs,encode:Ir,digest:Ss};var xs=Object.freeze({__proto__:null,identity:Os});new TextEncoder,new TextDecoder;const Kt={...yi,..._i,...Ci,...Oi,...Bi,...Li,...Wi,...$i,...Ji,...rs};({...vs,...xs});function Fr(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Gt=Fr("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),Ye=Fr("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=Cr(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),Pr={utf8:Gt,"utf-8":Gt,hex:Kt.base16,latin1:Ye,ascii:Ye,binary:Ye,...Kt};function Te(e,t="utf8"){const r=Pr[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}function he(e,t="utf8"){const r=Pr[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?ht(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function Jt(e){return ar(Te(he(e,Be),_r))}function xe(e){return Te(he(ur(e),_r),Be)}function As(e){const t=he(si,qt),r=ii+Te(Sr([t,e]),qt);return[ni,oi,r].join(ri)}function Bs(e){return Te(e,Be)}function Rs(e){return he(e,Be)}function Ts(e){return he([xe(e.header),xe(e.payload)].join(Oe),vr)}function Us(e){return[xe(e.header),xe(e.payload),Bs(e.signature)].join(Oe)}function au(e){const t=e.split(Oe),r=Jt(t[0]),n=Jt(t[1]),o=Rs(t[2]),i=he(t.slice(0,2).join(Oe),vr);return{header:r,payload:n,signature:o,data:i}}function uu(e=hr(ai)){const t=mr.getPublicKey(e);return{secretKey:Sr([e,t]),publicKey:t}}async function cu(e,t,r,n,o=ot.fromMiliseconds(Date.now())){const i={alg:ei,typ:ti},s=As(n.publicKey),c=o+r,a={iss:s,sub:e,aud:t,iat:o,exp:c},f=Ts({header:i,payload:a}),u=mr.sign(f,n.secretKey.slice(0,32));return Us({header:i,payload:a,signature:u})}var U={},Zt;function jr(){if(Zt)return U;Zt=1,Object.defineProperty(U,"__esModule",{value:!0}),U.getLocalStorage=U.getLocalStorageOrThrow=U.getCrypto=U.getCryptoOrThrow=U.getLocation=U.getLocationOrThrow=U.getNavigator=U.getNavigatorOrThrow=U.getDocument=U.getDocumentOrThrow=U.getFromWindowOrThrow=U.getFromWindow=void 0;function e(D){let b;return typeof window<"u"&&typeof window[D]<"u"&&(b=window[D]),b}U.getFromWindow=e;function t(D){const b=e(D);if(!b)throw new Error(`${D} is not defined in Window`);return b}U.getFromWindowOrThrow=t;function r(){return t("document")}U.getDocumentOrThrow=r;function n(){return e("document")}U.getDocument=n;function o(){return t("navigator")}U.getNavigatorOrThrow=o;function i(){return e("navigator")}U.getNavigator=i;function s(){return t("location")}U.getLocationOrThrow=s;function c(){return e("location")}U.getLocation=c;function a(){return t("crypto")}U.getCryptoOrThrow=a;function f(){return e("crypto")}U.getCrypto=f;function u(){return t("localStorage")}U.getLocalStorageOrThrow=u;function d(){return e("localStorage")}return U.getLocalStorage=d,U}var fu=jr(),pe={},Xt;function Ns(){if(Xt)return pe;Xt=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.getWindowMetadata=void 0;const e=jr();function t(){let r,n;try{r=e.getDocumentOrThrow(),n=e.getLocationOrThrow()}catch{return null}function o(){const b=r.getElementsByTagName("link"),h=[];for(let p=0;p<b.length;p++){const m=b[p],_=m.getAttribute("rel");if(_&&_.toLowerCase().indexOf("icon")>-1){const w=m.getAttribute("href");if(w)if(w.toLowerCase().indexOf("https:")===-1&&w.toLowerCase().indexOf("http:")===-1&&w.indexOf("//")!==0){let l=n.protocol+"//"+n.host;if(w.indexOf("/")===0)l+=w;else{const E=n.pathname.split("/");E.pop();const O=E.join("/");l+=O+"/"+w}h.push(l)}else if(w.indexOf("//")===0){const l=n.protocol+w;h.push(l)}else h.push(w)}}return h}function i(...b){const h=r.getElementsByTagName("meta");for(let p=0;p<h.length;p++){const m=h[p],_=["itemprop","property","name"].map(w=>m.getAttribute(w)).filter(w=>w?b.includes(w):!1);if(_.length&&_){const w=m.getAttribute("content");if(w)return w}}return""}function s(){let b=i("name","og:site_name","og:title","twitter:title");return b||(b=r.title),b}function c(){return i("description","og:description","twitter:description","keywords")}const a=s(),f=c(),u=n.origin,d=o();return{description:f,url:u,icons:d,name:a}}return pe.getWindowMetadata=t,pe}var hu=Ns();function Is(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<e.length;o++){var i=e.charAt(o),s=i.charCodeAt(0);if(r[s]!==255)throw new TypeError(i+" is ambiguous");r[s]=o}var c=e.length,a=e.charAt(0),f=Math.log(c)/Math.log(256),u=Math.log(256)/Math.log(c);function d(h){if(h instanceof Uint8Array||(ArrayBuffer.isView(h)?h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength):Array.isArray(h)&&(h=Uint8Array.from(h))),!(h instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(h.length===0)return"";for(var p=0,m=0,_=0,w=h.length;_!==w&&h[_]===0;)_++,p++;for(var l=(w-_)*u+1>>>0,E=new Uint8Array(l);_!==w;){for(var O=h[_],N=0,R=l-1;(O!==0||N<m)&&R!==-1;R--,N++)O+=256*E[R]>>>0,E[R]=O%c>>>0,O=O/c>>>0;if(O!==0)throw new Error("Non-zero carry");m=N,_++}for(var x=l-m;x!==l&&E[x]===0;)x++;for(var F=a.repeat(p);x<l;++x)F+=e.charAt(E[x]);return F}function D(h){if(typeof h!="string")throw new TypeError("Expected String");if(h.length===0)return new Uint8Array;var p=0;if(h[p]!==" "){for(var m=0,_=0;h[p]===a;)m++,p++;for(var w=(h.length-p)*f+1>>>0,l=new Uint8Array(w);h[p];){var E=r[h.charCodeAt(p)];if(E===255)return;for(var O=0,N=w-1;(E!==0||O<_)&&N!==-1;N--,O++)E+=c*l[N]>>>0,l[N]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");_=O,p++}if(h[p]!==" "){for(var R=w-_;R!==w&&l[R]===0;)R++;for(var x=new Uint8Array(m+(w-R)),F=m;R!==w;)x[F++]=l[R++];return x}}}function b(h){var p=D(h);if(p)return p;throw new Error(`Non-${t} character`)}return{encode:d,decodeUnsafe:D,decode:b}}var Fs=Is,Ps=Fs;const js=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Ms=e=>new TextEncoder().encode(e),Ls=e=>new TextDecoder().decode(e);class zs{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Hs{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Mr(this,t)}}class Ws{constructor(t){this.decoders=t}or(t){return Mr(this,t)}decode(t){const r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Mr=(e,t)=>new Ws({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class qs{constructor(t,r,n,o){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new zs(t,r,n),this.decoder=new Hs(t,r,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Ue=({name:e,prefix:t,encode:r,decode:n})=>new qs(e,t,r,n),ye=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:o}=Ps(r,t);return Ue({prefix:e,name:t,encode:n,decode:i=>js(o(i))})},ks=(e,t,r,n)=>{const o={};for(let u=0;u<t.length;++u)o[t[u]]=u;let i=e.length;for(;e[i-1]==="=";)--i;const s=new Uint8Array(i*r/8|0);let c=0,a=0,f=0;for(let u=0;u<i;++u){const d=o[e[u]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);a=a<<r|d,c+=r,c>=8&&(c-=8,s[f++]=255&a>>c)}if(c>=r||255&a<<8-c)throw new SyntaxError("Unexpected end of data");return s},$s=(e,t,r)=>{const n=t[t.length-1]==="=",o=(1<<r)-1;let i="",s=0,c=0;for(let a=0;a<e.length;++a)for(c=c<<8|e[a],s+=8;s>r;)s-=r,i+=t[o&c>>s];if(s&&(i+=t[o&c<<r-s]),n)for(;i.length*r&7;)i+="=";return i},q=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Ue({prefix:t,name:e,encode(o){return $s(o,n,r)},decode(o){return ks(o,n,r,e)}}),Vs=Ue({prefix:"\0",name:"identity",encode:e=>Ls(e),decode:e=>Ms(e)}),Ys=Object.freeze(Object.defineProperty({__proto__:null,identity:Vs},Symbol.toStringTag,{value:"Module"})),Ks=q({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Gs=Object.freeze(Object.defineProperty({__proto__:null,base2:Ks},Symbol.toStringTag,{value:"Module"})),Js=q({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Zs=Object.freeze(Object.defineProperty({__proto__:null,base8:Js},Symbol.toStringTag,{value:"Module"})),Xs=ye({prefix:"9",name:"base10",alphabet:"0123456789"}),Qs=Object.freeze(Object.defineProperty({__proto__:null,base10:Xs},Symbol.toStringTag,{value:"Module"})),ea=q({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),ta=q({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),ra=Object.freeze(Object.defineProperty({__proto__:null,base16:ea,base16upper:ta},Symbol.toStringTag,{value:"Module"})),na=q({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),oa=q({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),ia=q({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),sa=q({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),aa=q({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),ua=q({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),ca=q({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),fa=q({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ha=q({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),la=Object.freeze(Object.defineProperty({__proto__:null,base32:na,base32hex:aa,base32hexpad:ca,base32hexpadupper:fa,base32hexupper:ua,base32pad:ia,base32padupper:sa,base32upper:oa,base32z:ha},Symbol.toStringTag,{value:"Module"})),da=ye({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Da=ye({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),ba=Object.freeze(Object.defineProperty({__proto__:null,base36:da,base36upper:Da},Symbol.toStringTag,{value:"Module"})),pa=ye({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ga=ye({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),wa=Object.freeze(Object.defineProperty({__proto__:null,base58btc:pa,base58flickr:ga},Symbol.toStringTag,{value:"Module"})),Ea=q({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ya=q({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ma=q({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),_a=q({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),va=Object.freeze(Object.defineProperty({__proto__:null,base64:Ea,base64pad:ya,base64url:ma,base64urlpad:_a},Symbol.toStringTag,{value:"Module"})),Lr=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Ca=Lr.reduce((e,t,r)=>(e[r]=t,e),[]),Sa=Lr.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function Oa(e){return e.reduce((t,r)=>(t+=Ca[r],t),"")}function xa(e){const t=[];for(const r of e){const n=Sa[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}const Aa=Ue({prefix:"🚀",name:"base256emoji",encode:Oa,decode:xa}),Ba=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:Aa},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const lu={...Ys,...Gs,...Zs,...Qs,...ra,...la,...ba,...wa,...va,...Ba},du={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},Ra="PARSE_ERROR",Ta="INVALID_REQUEST",Ua="METHOD_NOT_FOUND",Na="INVALID_PARAMS",zr="INTERNAL_ERROR",lt="SERVER_ERROR",Ia=[-32700,-32600,-32601,-32602,-32603],ge={[Ra]:{code:-32700,message:"Parse error"},[Ta]:{code:-32600,message:"Invalid Request"},[Ua]:{code:-32601,message:"Method not found"},[Na]:{code:-32602,message:"Invalid params"},[zr]:{code:-32603,message:"Internal error"},[lt]:{code:-32e3,message:"Server error"}},Hr=lt;function Fa(e){return Ia.includes(e)}function Qt(e){return Object.keys(ge).includes(e)?ge[e]:ge[Hr]}function Pa(e){const t=Object.values(ge).find(r=>r.code===e);return t||ge[Hr]}function ja(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${t}`):e}function Wr(e=3){const t=Date.now()*Math.pow(10,e),r=Math.floor(Math.random()*Math.pow(10,e));return t+r}function Ma(e=6){return BigInt(Wr(e))}function La(e,t,r){return{id:r||Wr(),jsonrpc:"2.0",method:e,params:t}}function Du(e,t){return{id:e,jsonrpc:"2.0",result:t}}function za(e,t,r){return{id:e,jsonrpc:"2.0",error:Ha(t)}}function Ha(e,t){return typeof e>"u"?Qt(zr):(typeof e=="string"&&(e=Object.assign(Object.assign({},Qt(lt)),{message:e})),Fa(e.code)&&(e=Pa(e.code)),e)}class Wa{}class qa extends Wa{constructor(){super()}}class ka extends qa{constructor(t){super()}}const $a="^https?:",Va="^wss?:";function Ya(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(!(!t||!t.length))return t[0]}function qr(e,t){const r=Ya(e);return typeof r>"u"?!1:new RegExp(t).test(r)}function bu(e){return qr(e,$a)}function er(e){return qr(e,Va)}function Ka(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}function kr(e){return typeof e=="object"&&"id"in e&&"jsonrpc"in e&&e.jsonrpc==="2.0"}function pu(e){return kr(e)&&"method"in e}function Ga(e){return kr(e)&&(Ja(e)||$r(e))}function Ja(e){return"result"in e}function $r(e){return"error"in e}class gu extends ka{constructor(t){super(t),this.events=new nt.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(t),this.connection.connected&&this.registerEventListeners()}async connect(t=this.connection){await this.open(t)}async disconnect(){await this.close()}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async request(t,r){return this.requestStrict(La(t.method,t.params||[],t.id||Ma().toString()),r)}async requestStrict(t,r){return new Promise(async(n,o)=>{if(!this.connection.connected)try{await this.open()}catch(i){o(i)}this.events.on(`${t.id}`,i=>{$r(i)?o(i.error):n(i.result)});try{await this.connection.send(t,r)}catch(i){o(i)}})}setConnection(t=this.connection){return t}onPayload(t){this.events.emit("payload",t),Ga(t)?this.events.emit(`${t.id}`,t):this.events.emit("message",{type:t.method,data:t.params})}onClose(t){t&&t.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${t.code} ${t.reason?`(${t.reason})`:""}`)),this.events.emit("disconnect")}async open(t=this.connection){this.connection===t&&this.connection.connected||(this.connection.connected&&this.close(),typeof t=="string"&&(await this.connection.open(t),t=this.connection),this.connection=this.setConnection(t),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",t=>this.onPayload(t)),this.connection.on("close",t=>this.onClose(t)),this.connection.on("error",t=>this.events.emit("error",t)),this.connection.on("register_error",t=>this.onClose()),this.hasRegisteredEventListeners=!0)}}var Ke,tr;function Za(){return tr||(tr=1,Ke=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}),Ke}const Xa=()=>typeof WebSocket<"u"?WebSocket:typeof globalThis<"u"&&typeof globalThis.WebSocket<"u"?globalThis.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:Za(),Qa=()=>typeof WebSocket<"u"||typeof globalThis<"u"&&typeof globalThis.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",rr=e=>e.split("?")[0],nr=10,eu=Xa();class wu{constructor(t){if(this.url=t,this.events=new nt.EventEmitter,this.registering=!1,!er(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);this.url=t}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async open(t=this.url){await this.register(t)}async close(){return new Promise((t,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),t()},this.socket.close()})}async send(t){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ur(t))}catch(r){this.onError(t.id,r)}}register(t=this.url){if(!er(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,o)=>{this.events.once("register_error",i=>{this.resetMaxListeners(),o(i)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return o(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=t,this.registering=!0,new Promise((r,n)=>{const o=tn.isReactNative()?void 0:{rejectUnauthorized:!Ka(t)},i=new eu(t,[],o);Qa()?i.onerror=s=>{const c=s;n(this.emitError(c.error))}:i.on("error",s=>{n(this.emitError(s))}),i.onopen=()=>{this.onOpen(i),r(i)}})}onOpen(t){t.onmessage=r=>this.onPayload(r),t.onclose=r=>this.onClose(r),this.socket=t,this.registering=!1,this.events.emit("open")}onClose(t){this.socket=void 0,this.registering=!1,this.events.emit("close",t)}onPayload(t){if(typeof t.data>"u")return;const r=typeof t.data=="string"?ar(t.data):t.data;this.events.emit("payload",r)}onError(t,r){const n=this.parseError(r),o=n.message||n.toString(),i=za(t,o);this.events.emit("payload",i)}parseError(t,r=this.url){return ja(t,rr(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>nr&&this.events.setMaxListeners(nr)}emitError(t){const r=this.parseError(new Error(t?.message||`WebSocket connection failed for host: ${rr(this.url)}`));return this.events.emit("register_error",r),r}}function tu(e){if(e.length>=255)throw new TypeError("Alphabet too long");const t=new Uint8Array(256);for(let f=0;f<t.length;f++)t[f]=255;for(let f=0;f<e.length;f++){const u=e.charAt(f),d=u.charCodeAt(0);if(t[d]!==255)throw new TypeError(u+" is ambiguous");t[d]=f}const r=e.length,n=e.charAt(0),o=Math.log(r)/Math.log(256),i=Math.log(256)/Math.log(r);function s(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";let u=0,d=0,D=0;const b=f.length;for(;D!==b&&f[D]===0;)D++,u++;const h=(b-D)*i+1>>>0,p=new Uint8Array(h);for(;D!==b;){let w=f[D],l=0;for(let E=h-1;(w!==0||l<d)&&E!==-1;E--,l++)w+=256*p[E]>>>0,p[E]=w%r>>>0,w=w/r>>>0;if(w!==0)throw new Error("Non-zero carry");d=l,D++}let m=h-d;for(;m!==h&&p[m]===0;)m++;let _=n.repeat(u);for(;m<h;++m)_+=e.charAt(p[m]);return _}function c(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;let u=0,d=0,D=0;for(;f[u]===n;)d++,u++;const b=(f.length-u)*o+1>>>0,h=new Uint8Array(b);for(;u<f.length;){const w=f.charCodeAt(u);if(w>255)return;let l=t[w];if(l===255)return;let E=0;for(let O=b-1;(l!==0||E<D)&&O!==-1;O--,E++)l+=r*h[O]>>>0,h[O]=l%256>>>0,l=l/256>>>0;if(l!==0)throw new Error("Non-zero carry");D=E,u++}let p=b-D;for(;p!==b&&h[p]===0;)p++;const m=new Uint8Array(d+(b-p));let _=d;for(;p!==b;)m[_++]=h[p++];return m}function a(f){const u=c(f);if(u)return u;throw new Error("Non-base"+r+" character")}return{encode:s,decodeUnsafe:c,decode:a}}var ru="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const Eu=tu(ru);export{du as C,Un as I,uu as P,As as Q,ar as a,Du as b,La as c,lu as d,hu as e,za as f,ot as g,fu as h,bu as i,au as j,Eu as k,su as l,sr as m,wu as n,gu as o,ja as p,pu as q,In as r,ur as s,Ga as t,cu as u,Ma as v,Ja as w,$r as x,Wr as y};
1
+ import{a as en,e as nt}from"./index-CqbvjyBi.js";import{c as tn}from"./index-CYBDya_s.js";var Fe={};var Ge=function(e,t){return Ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)n.hasOwnProperty(o)&&(r[o]=n[o])},Ge(e,t)};function rn(e,t){Ge(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Je=function(){return Je=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Je.apply(this,arguments)};function nn(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function on(e,t,r,n){var o=arguments.length,i=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(i=(o<3?s(i):o>3?s(t,r,i):s(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}function sn(e,t){return function(r,n){t(r,n,e)}}function an(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function un(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function c(u){try{f(n.next(u))}catch(d){s(d)}}function a(u){try{f(n.throw(u))}catch(d){s(d)}}function f(u){u.done?i(u.value):o(u.value).then(c,a)}f((n=n.apply(e,t||[])).next())})}function cn(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(f){return function(u){return a([f,u])}}function a(f){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=f[0]&2?o.return:f[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,f[1])).done)return i;switch(o=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return r.label++,{value:f[1],done:!1};case 5:r.label++,o=f[1],f=[0];continue;case 7:f=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){r=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){r.label=f[1];break}if(f[0]===6&&r.label<i[1]){r.label=i[1],i=f;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(f);break}i[2]&&r.ops.pop(),r.trys.pop();continue}f=t.call(e,r)}catch(u){f=[6,u],o=0}finally{n=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function fn(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}function hn(e,t){for(var r in e)r!=="default"&&!t.hasOwnProperty(r)&&(t[r]=e[r])}function Ze(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function or(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(c){s={error:c}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i}function ln(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(or(arguments[t]));return e}function dn(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var i=arguments[t],s=0,c=i.length;s<c;s++,o++)n[o]=i[s];return n}function we(e){return this instanceof we?(this.v=e,this):new we(e)}function Dn(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o={},s("next"),s("throw"),s("return"),o[Symbol.asyncIterator]=function(){return this},o;function s(D){n[D]&&(o[D]=function(b){return new Promise(function(h,p){i.push([D,b,h,p])>1||c(D,b)})})}function c(D,b){try{a(n[D](b))}catch(h){d(i[0][3],h)}}function a(D){D.value instanceof we?Promise.resolve(D.value.v).then(f,u):d(i[0][2],D)}function f(D){c("next",D)}function u(D){c("throw",D)}function d(D,b){D(b),i.shift(),i.length&&c(i[0][0],i[0][1])}}function bn(e){var t,r;return t={},n("next"),n("throw",function(o){throw o}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(o,i){t[o]=e[o]?function(s){return(r=!r)?{value:we(e[o](s)),done:o==="return"}:i?i(s):s}:i}}function pn(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Ze=="function"?Ze(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(s){return new Promise(function(c,a){s=e[i](s),o(c,a,s.done,s.value)})}}function o(i,s,c,a){Promise.resolve(a).then(function(f){i({value:f,done:c})},s)}}function gn(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function wn(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function En(e){return e&&e.__esModule?e:{default:e}}function yn(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function mn(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}const _n=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Je},__asyncDelegator:bn,__asyncGenerator:Dn,__asyncValues:pn,__await:we,__awaiter:un,__classPrivateFieldGet:yn,__classPrivateFieldSet:mn,__createBinding:fn,__decorate:on,__exportStar:hn,__extends:rn,__generator:cn,__importDefault:En,__importStar:wn,__makeTemplateObject:gn,__metadata:an,__param:sn,__read:or,__rest:nn,__spread:ln,__spreadArrays:dn,__values:Ze},Symbol.toStringTag,{value:"Module"})),Ae=en(_n);var Pe={},de={},_t;function vn(){if(_t)return de;_t=1,Object.defineProperty(de,"__esModule",{value:!0}),de.delay=void 0;function e(t){return new Promise(r=>{setTimeout(()=>{r(!0)},t)})}return de.delay=e,de}var oe={},je={},ie={},vt;function Cn(){return vt||(vt=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.ONE_THOUSAND=ie.ONE_HUNDRED=void 0,ie.ONE_HUNDRED=100,ie.ONE_THOUSAND=1e3),ie}var Me={},Ct;function Sn(){return Ct||(Ct=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_YEAR=e.FOUR_WEEKS=e.THREE_WEEKS=e.TWO_WEEKS=e.ONE_WEEK=e.THIRTY_DAYS=e.SEVEN_DAYS=e.FIVE_DAYS=e.THREE_DAYS=e.ONE_DAY=e.TWENTY_FOUR_HOURS=e.TWELVE_HOURS=e.SIX_HOURS=e.THREE_HOURS=e.ONE_HOUR=e.SIXTY_MINUTES=e.THIRTY_MINUTES=e.TEN_MINUTES=e.FIVE_MINUTES=e.ONE_MINUTE=e.SIXTY_SECONDS=e.THIRTY_SECONDS=e.TEN_SECONDS=e.FIVE_SECONDS=e.ONE_SECOND=void 0,e.ONE_SECOND=1,e.FIVE_SECONDS=5,e.TEN_SECONDS=10,e.THIRTY_SECONDS=30,e.SIXTY_SECONDS=60,e.ONE_MINUTE=e.SIXTY_SECONDS,e.FIVE_MINUTES=e.ONE_MINUTE*5,e.TEN_MINUTES=e.ONE_MINUTE*10,e.THIRTY_MINUTES=e.ONE_MINUTE*30,e.SIXTY_MINUTES=e.ONE_MINUTE*60,e.ONE_HOUR=e.SIXTY_MINUTES,e.THREE_HOURS=e.ONE_HOUR*3,e.SIX_HOURS=e.ONE_HOUR*6,e.TWELVE_HOURS=e.ONE_HOUR*12,e.TWENTY_FOUR_HOURS=e.ONE_HOUR*24,e.ONE_DAY=e.TWENTY_FOUR_HOURS,e.THREE_DAYS=e.ONE_DAY*3,e.FIVE_DAYS=e.ONE_DAY*5,e.SEVEN_DAYS=e.ONE_DAY*7,e.THIRTY_DAYS=e.ONE_DAY*30,e.ONE_WEEK=e.SEVEN_DAYS,e.TWO_WEEKS=e.ONE_WEEK*2,e.THREE_WEEKS=e.ONE_WEEK*3,e.FOUR_WEEKS=e.ONE_WEEK*4,e.ONE_YEAR=e.ONE_DAY*365})(Me)),Me}var St;function ir(){return St||(St=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Ae;t.__exportStar(Cn(),e),t.__exportStar(Sn(),e)})(je)),je}var Ot;function On(){if(Ot)return oe;Ot=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.fromMiliseconds=oe.toMiliseconds=void 0;const e=ir();function t(n){return n*e.ONE_THOUSAND}oe.toMiliseconds=t;function r(n){return Math.floor(n/e.ONE_THOUSAND)}return oe.fromMiliseconds=r,oe}var xt;function xn(){return xt||(xt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Ae;t.__exportStar(vn(),e),t.__exportStar(On(),e)})(Pe)),Pe}var ce={},At;function An(){if(At)return ce;At=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.Watch=void 0;class e{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const o=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:o})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return ce.Watch=e,ce.default=e,ce}var Le={},De={},Bt;function Bn(){if(Bt)return De;Bt=1,Object.defineProperty(De,"__esModule",{value:!0}),De.IWatch=void 0;class e{}return De.IWatch=e,De}var Rt;function Rn(){return Rt||(Rt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Ae.__exportStar(Bn(),e)})(Le)),Le}var Tt;function Tn(){return Tt||(Tt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Ae;t.__exportStar(xn(),e),t.__exportStar(An(),e),t.__exportStar(Rn(),e),t.__exportStar(ir(),e)})(Fe)),Fe}var ot=Tn();class Un{}let Nn=class extends Un{constructor(t){super()}};const Ut=ot.FIVE_SECONDS,In={pulse:"heartbeat_pulse"};class sr extends Nn{constructor(t){super(t),this.events=new nt.EventEmitter,this.interval=Ut,this.interval=t?.interval||Ut}static async init(t){const r=new sr(t);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),ot.toMiliseconds(this.interval))}pulse(){this.events.emit(In.pulse)}}const Fn=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Pn=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,jn=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Mn(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){Ln(e);return}return t}function Ln(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function su(e,t={}){if(typeof e!="string")return e;if(e[0]==='"'&&e[e.length-1]==='"'&&e.indexOf("\\")===-1)return e.slice(1,-1);const r=e.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!jn.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(Fn.test(e)||Pn.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,Mn)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}const zn=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r),Hn=e=>{const t=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=e.replace(t,'$1"$2n"$3');return JSON.parse(r,(n,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function ar(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return Hn(e)}catch{return e}}function ur(e){return typeof e=="string"?e:zn(e)||""}function Wn(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function cr(e,...t){if(!Wn(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Nt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function qn(e,t){cr(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const fe=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;const ze=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function kn(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function fr(e){return typeof e=="string"&&(e=kn(e)),cr(e),e}class $n{clone(){return this._cloneInto()}}function Vn(e){const t=n=>e().update(fr(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function hr(e=32){if(fe&&typeof fe.getRandomValues=="function")return fe.getRandomValues(new Uint8Array(e));if(fe&&typeof fe.randomBytes=="function")return fe.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}function Yn(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),s=Number(r>>o&i),c=Number(r&i),a=n?4:0,f=n?0:4;e.setUint32(t+a,s,n),e.setUint32(t+f,c,n)}class Kn extends $n{constructor(t,r,n,o){super(),this.blockLen=t,this.outputLen=r,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=ze(this.buffer)}update(t){Nt(this);const{view:r,buffer:n,blockLen:o}=this;t=fr(t);const i=t.length;for(let s=0;s<i;){const c=Math.min(o-this.pos,i-s);if(c===o){const a=ze(t);for(;o<=i-s;s+=o)this.process(a,s);continue}n.set(t.subarray(s,s+c),this.pos),this.pos+=c,s+=c,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Nt(this),qn(t,this),this.finished=!0;const{buffer:r,view:n,blockLen:o,isLE:i}=this;let{pos:s}=this;r[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>o-s&&(this.process(n,0),s=0);for(let d=s;d<o;d++)r[d]=0;Yn(n,o-8,BigInt(this.length*8),i),this.process(n,0);const c=ze(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const f=a/4,u=this.get();if(f>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<f;d++)c.setUint32(4*d,u[d],i)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:n,length:o,finished:i,destroyed:s,pos:c}=this;return t.length=o,t.pos=c,t.finished=i,t.destroyed=s,o%r&&t.buffer.set(n),t}}const _e=BigInt(2**32-1),Xe=BigInt(32);function lr(e,t=!1){return t?{h:Number(e&_e),l:Number(e>>Xe&_e)}:{h:Number(e>>Xe&_e)|0,l:Number(e&_e)|0}}function Gn(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:i,l:s}=lr(e[o],t);[r[o],n[o]]=[i,s]}return[r,n]}const Jn=(e,t)=>BigInt(e>>>0)<<Xe|BigInt(t>>>0),Zn=(e,t,r)=>e>>>r,Xn=(e,t,r)=>e<<32-r|t>>>r,Qn=(e,t,r)=>e>>>r|t<<32-r,eo=(e,t,r)=>e<<32-r|t>>>r,to=(e,t,r)=>e<<64-r|t>>>r-32,ro=(e,t,r)=>e>>>r-32|t<<64-r,no=(e,t)=>t,oo=(e,t)=>e,io=(e,t,r)=>e<<r|t>>>32-r,so=(e,t,r)=>t<<r|e>>>32-r,ao=(e,t,r)=>t<<r-32|e>>>64-r,uo=(e,t,r)=>e<<r-32|t>>>64-r;function co(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:o|0}}const fo=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),ho=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,lo=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),Do=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,bo=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),po=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0,S={fromBig:lr,split:Gn,toBig:Jn,shrSH:Zn,shrSL:Xn,rotrSH:Qn,rotrSL:eo,rotrBH:to,rotrBL:ro,rotr32H:no,rotr32L:oo,rotlSH:io,rotlSL:so,rotlBH:ao,rotlBL:uo,add:co,add3L:fo,add3H:ho,add4L:lo,add4H:Do,add5H:po,add5L:bo},[go,wo]=S.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),ee=new Uint32Array(80),te=new Uint32Array(80);class Eo extends Kn{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:r,Bh:n,Bl:o,Ch:i,Cl:s,Dh:c,Dl:a,Eh:f,El:u,Fh:d,Fl:D,Gh:b,Gl:h,Hh:p,Hl:m}=this;return[t,r,n,o,i,s,c,a,f,u,d,D,b,h,p,m]}set(t,r,n,o,i,s,c,a,f,u,d,D,b,h,p,m){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=o|0,this.Ch=i|0,this.Cl=s|0,this.Dh=c|0,this.Dl=a|0,this.Eh=f|0,this.El=u|0,this.Fh=d|0,this.Fl=D|0,this.Gh=b|0,this.Gl=h|0,this.Hh=p|0,this.Hl=m|0}process(t,r){for(let l=0;l<16;l++,r+=4)ee[l]=t.getUint32(r),te[l]=t.getUint32(r+=4);for(let l=16;l<80;l++){const E=ee[l-15]|0,O=te[l-15]|0,N=S.rotrSH(E,O,1)^S.rotrSH(E,O,8)^S.shrSH(E,O,7),R=S.rotrSL(E,O,1)^S.rotrSL(E,O,8)^S.shrSL(E,O,7),x=ee[l-2]|0,F=te[l-2]|0,ae=S.rotrSH(x,F,19)^S.rotrBH(x,F,61)^S.shrSH(x,F,6),re=S.rotrSL(x,F,19)^S.rotrBL(x,F,61)^S.shrSL(x,F,6),ue=S.add4L(R,re,te[l-7],te[l-16]),le=S.add4H(ue,N,ae,ee[l-7],ee[l-16]);ee[l]=le|0,te[l]=ue|0}let{Ah:n,Al:o,Bh:i,Bl:s,Ch:c,Cl:a,Dh:f,Dl:u,Eh:d,El:D,Fh:b,Fl:h,Gh:p,Gl:m,Hh:_,Hl:w}=this;for(let l=0;l<80;l++){const E=S.rotrSH(d,D,14)^S.rotrSH(d,D,18)^S.rotrBH(d,D,41),O=S.rotrSL(d,D,14)^S.rotrSL(d,D,18)^S.rotrBL(d,D,41),N=d&b^~d&p,R=D&h^~D&m,x=S.add5L(w,O,R,wo[l],te[l]),F=S.add5H(x,_,E,N,go[l],ee[l]),ae=x|0,re=S.rotrSH(n,o,28)^S.rotrBH(n,o,34)^S.rotrBH(n,o,39),ue=S.rotrSL(n,o,28)^S.rotrBL(n,o,34)^S.rotrBL(n,o,39),le=n&i^n&c^i&c,Ne=o&s^o&a^s&a;_=p|0,w=m|0,p=b|0,m=h|0,b=d|0,h=D|0,{h:d,l:D}=S.add(f|0,u|0,F|0,ae|0),f=c|0,u=a|0,c=i|0,a=s|0,i=n|0,s=o|0;const v=S.add3L(ae,ue,Ne);n=S.add3H(v,F,re,le),o=v|0}({h:n,l:o}=S.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:i,l:s}=S.add(this.Bh|0,this.Bl|0,i|0,s|0),{h:c,l:a}=S.add(this.Ch|0,this.Cl|0,c|0,a|0),{h:f,l:u}=S.add(this.Dh|0,this.Dl|0,f|0,u|0),{h:d,l:D}=S.add(this.Eh|0,this.El|0,d|0,D|0),{h:b,l:h}=S.add(this.Fh|0,this.Fl|0,b|0,h|0),{h:p,l:m}=S.add(this.Gh|0,this.Gl|0,p|0,m|0),{h:_,l:w}=S.add(this.Hh|0,this.Hl|0,_|0,w|0),this.set(n,o,i,s,c,a,f,u,d,D,b,h,p,m,_,w)}roundClean(){ee.fill(0),te.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const yo=Vn(()=>new Eo);const it=BigInt(0),dr=BigInt(1),mo=BigInt(2);function st(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function at(e){if(!st(e))throw new Error("Uint8Array expected")}function He(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}const _o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ut(e){at(e);let t="";for(let r=0;r<e.length;r++)t+=_o[e[r]];return t}function Dr(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?it:BigInt("0x"+e)}const Z={_0:48,_9:57,A:65,F:70,a:97,f:102};function It(e){if(e>=Z._0&&e<=Z._9)return e-Z._0;if(e>=Z.A&&e<=Z.F)return e-(Z.A-10);if(e>=Z.a&&e<=Z.f)return e-(Z.a-10)}function br(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let o=0,i=0;o<r;o++,i+=2){const s=It(e.charCodeAt(i)),c=It(e.charCodeAt(i+1));if(s===void 0||c===void 0){const a=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+a+'" at index '+i)}n[o]=s*16+c}return n}function vo(e){return Dr(ut(e))}function Se(e){return at(e),Dr(ut(Uint8Array.from(e).reverse()))}function pr(e,t){return br(e.toString(16).padStart(t*2,"0"))}function Qe(e,t){return pr(e,t).reverse()}function X(e,t,r){let n;if(typeof t=="string")try{n=br(t)}catch(i){throw new Error(e+" must be hex string or Uint8Array, cause: "+i)}else if(st(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=n.length;if(typeof r=="number"&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function Ft(...e){let t=0;for(let n=0;n<e.length;n++){const o=e[n];at(o),t+=o.length}const r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){const i=e[n];r.set(i,o),o+=i.length}return r}const We=e=>typeof e=="bigint"&&it<=e;function Co(e,t,r){return We(e)&&We(t)&&We(r)&&t<=e&&e<r}function be(e,t,r,n){if(!Co(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function So(e){let t;for(t=0;e>it;e>>=dr,t+=1);return t}const Oo=e=>(mo<<BigInt(e-1))-dr,xo={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||st(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function ct(e,t,r={}){const n=(o,i,s)=>{const c=xo[i];if(typeof c!="function")throw new Error("invalid validator function");const a=e[o];if(!(s&&a===void 0)&&!c(a,e))throw new Error("param "+String(o)+" is invalid. Expected "+i+", got "+a)};for(const[o,i]of Object.entries(t))n(o,i,!1);for(const[o,i]of Object.entries(r))n(o,i,!0);return e}function Pt(e){const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(o!==void 0)return o;const i=e(r,...n);return t.set(r,i),i}}const z=BigInt(0),M=BigInt(1),se=BigInt(2),Ao=BigInt(3),et=BigInt(4),jt=BigInt(5),Mt=BigInt(8);function L(e,t){const r=e%t;return r>=z?r:t+r}function Bo(e,t,r){if(t<z)throw new Error("invalid exponent, negatives unsupported");if(r<=z)throw new Error("invalid modulus");if(r===M)return z;let n=M;for(;t>z;)t&M&&(n=n*e%r),e=e*e%r,t>>=M;return n}function K(e,t,r){let n=e;for(;t-- >z;)n*=n,n%=r;return n}function Lt(e,t){if(e===z)throw new Error("invert: expected non-zero number");if(t<=z)throw new Error("invert: expected positive modulus, got "+t);let r=L(e,t),n=t,o=z,i=M;for(;r!==z;){const s=n/r,c=n%r,a=o-i*s;n=r,r=c,o=i,i=a}if(n!==M)throw new Error("invert: does not exist");return L(o,t)}function Ro(e){const t=(e-M)/se;let r,n,o;for(r=e-M,n=0;r%se===z;r/=se,n++);for(o=se;o<e&&Bo(o,t,e)!==e-M;o++)if(o>1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const s=(e+M)/et;return function(c,a){const f=c.pow(a,s);if(!c.eql(c.sqr(f),a))throw new Error("Cannot find square root");return f}}const i=(r+M)/se;return function(s,c){if(s.pow(c,t)===s.neg(s.ONE))throw new Error("Cannot find square root");let a=n,f=s.pow(s.mul(s.ONE,o),r),u=s.pow(c,i),d=s.pow(c,r);for(;!s.eql(d,s.ONE);){if(s.eql(d,s.ZERO))return s.ZERO;let D=1;for(let h=s.sqr(d);D<a&&!s.eql(h,s.ONE);D++)h=s.sqr(h);const b=s.pow(f,M<<BigInt(a-D-1));f=s.sqr(b),u=s.mul(u,b),d=s.mul(d,f),a=D}return u}}function To(e){if(e%et===Ao){const t=(e+M)/et;return function(r,n){const o=r.pow(n,t);if(!r.eql(r.sqr(o),n))throw new Error("Cannot find square root");return o}}if(e%Mt===jt){const t=(e-jt)/Mt;return function(r,n){const o=r.mul(n,se),i=r.pow(o,t),s=r.mul(n,i),c=r.mul(r.mul(s,se),i),a=r.mul(s,r.sub(c,r.ONE));if(!r.eql(r.sqr(a),n))throw new Error("Cannot find square root");return a}}return Ro(e)}const Uo=(e,t)=>(L(e,t)&M)===M,No=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Io(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=No.reduce((n,o)=>(n[o]="function",n),t);return ct(e,r)}function Fo(e,t,r){if(r<z)throw new Error("invalid exponent, negatives unsupported");if(r===z)return e.ONE;if(r===M)return t;let n=e.ONE,o=t;for(;r>z;)r&M&&(n=e.mul(n,o)),o=e.sqr(o),r>>=M;return n}function Po(e,t){const r=new Array(t.length),n=t.reduce((i,s,c)=>e.is0(s)?i:(r[c]=i,e.mul(i,s)),e.ONE),o=e.inv(n);return t.reduceRight((i,s,c)=>e.is0(s)?i:(r[c]=e.mul(i,r[c]),e.mul(i,s)),o),r}function gr(e,t){const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function wr(e,t,r=!1,n={}){if(e<=z)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:i}=gr(e,t);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const c=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:i,MASK:Oo(o),ZERO:z,ONE:M,create:a=>L(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof a);return z<=a&&a<e},is0:a=>a===z,isOdd:a=>(a&M)===M,neg:a=>L(-a,e),eql:(a,f)=>a===f,sqr:a=>L(a*a,e),add:(a,f)=>L(a+f,e),sub:(a,f)=>L(a-f,e),mul:(a,f)=>L(a*f,e),pow:(a,f)=>Fo(c,a,f),div:(a,f)=>L(a*Lt(f,e),e),sqrN:a=>a*a,addN:(a,f)=>a+f,subN:(a,f)=>a-f,mulN:(a,f)=>a*f,inv:a=>Lt(a,e),sqrt:n.sqrt||(a=>(s||(s=To(e)),s(c,a))),invertBatch:a=>Po(c,a),cmov:(a,f,u)=>u?f:a,toBytes:a=>r?Qe(a,i):pr(a,i),fromBytes:a=>{if(a.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+a.length);return r?Se(a):vo(a)}});return Object.freeze(c)}const zt=BigInt(0),ve=BigInt(1);function qe(e,t){const r=t.negate();return e?r:t}function Er(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function ke(e,t){Er(e,t);const r=Math.ceil(t/e)+1,n=2**(e-1);return{windows:r,windowSize:n}}function jo(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function Mo(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}const $e=new WeakMap,yr=new WeakMap;function Ve(e){return yr.get(e)||1}function Lo(e,t){return{constTimeNegate:qe,hasPrecomputes(r){return Ve(r)!==1},unsafeLadder(r,n,o=e.ZERO){let i=r;for(;n>zt;)n&ve&&(o=o.add(i)),i=i.double(),n>>=ve;return o},precomputeWindow(r,n){const{windows:o,windowSize:i}=ke(n,t),s=[];let c=r,a=c;for(let f=0;f<o;f++){a=c,s.push(a);for(let u=1;u<i;u++)a=a.add(c),s.push(a);c=a.double()}return s},wNAF(r,n,o){const{windows:i,windowSize:s}=ke(r,t);let c=e.ZERO,a=e.BASE;const f=BigInt(2**r-1),u=2**r,d=BigInt(r);for(let D=0;D<i;D++){const b=D*s;let h=Number(o&f);o>>=d,h>s&&(h-=u,o+=ve);const p=b,m=b+Math.abs(h)-1,_=D%2!==0,w=h<0;h===0?a=a.add(qe(_,n[p])):c=c.add(qe(w,n[m]))}return{p:c,f:a}},wNAFUnsafe(r,n,o,i=e.ZERO){const{windows:s,windowSize:c}=ke(r,t),a=BigInt(2**r-1),f=2**r,u=BigInt(r);for(let d=0;d<s;d++){const D=d*c;if(o===zt)break;let b=Number(o&a);if(o>>=u,b>c&&(b-=f,o+=ve),b===0)continue;let h=n[D+Math.abs(b)-1];b<0&&(h=h.negate()),i=i.add(h)}return i},getPrecomputes(r,n,o){let i=$e.get(n);return i||(i=this.precomputeWindow(n,r),r!==1&&$e.set(n,o(i))),i},wNAFCached(r,n,o){const i=Ve(r);return this.wNAF(i,this.getPrecomputes(i,r,o),n)},wNAFCachedUnsafe(r,n,o,i){const s=Ve(r);return s===1?this.unsafeLadder(r,n,i):this.wNAFUnsafe(s,this.getPrecomputes(s,r,o),n,i)},setWindowSize(r,n){Er(n,t),yr.set(r,n),$e.delete(r)}}}function zo(e,t,r,n){if(jo(r,e),Mo(n,t),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const o=e.ZERO,i=So(BigInt(r.length)),s=i>12?i-3:i>4?i-2:i?2:1,c=(1<<s)-1,a=new Array(c+1).fill(o),f=Math.floor((t.BITS-1)/s)*s;let u=o;for(let d=f;d>=0;d-=s){a.fill(o);for(let b=0;b<n.length;b++){const h=n[b],p=Number(h>>BigInt(d)&BigInt(c));a[p]=a[p].add(r[b])}let D=o;for(let b=a.length-1,h=o;b>0;b--)h=h.add(a[b]),D=D.add(h);if(u=u.add(D),d!==0)for(let b=0;b<s;b++)u=u.double()}return u}function Ho(e){return Io(e.Fp),ct(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...gr(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const Y=BigInt(0),$=BigInt(1),Ce=BigInt(2),Wo=BigInt(8),qo={zip215:!0};function ko(e){const t=Ho(e);return ct(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function $o(e){const t=ko(e),{Fp:r,n,prehash:o,hash:i,randomBytes:s,nByteLength:c,h:a}=t,f=Ce<<BigInt(c*8)-$,u=r.create,d=wr(t.n,t.nBitLength),D=t.uvRatio||((v,g)=>{try{return{isValid:!0,value:r.sqrt(v*r.inv(g))}}catch{return{isValid:!1,value:Y}}}),b=t.adjustScalarBytes||(v=>v),h=t.domain||((v,g,y)=>{if(He("phflag",y),g.length||y)throw new Error("Contexts/pre-hash are not supported");return v});function p(v,g){be("coordinate "+v,g,Y,f)}function m(v){if(!(v instanceof l))throw new Error("ExtendedPoint expected")}const _=Pt((v,g)=>{const{ex:y,ey:C,ez:A}=v,B=v.is0();g==null&&(g=B?Wo:r.inv(A));const T=u(y*g),P=u(C*g),I=u(A*g);if(B)return{x:Y,y:$};if(I!==$)throw new Error("invZ was invalid");return{x:T,y:P}}),w=Pt(v=>{const{a:g,d:y}=t;if(v.is0())throw new Error("bad point: ZERO");const{ex:C,ey:A,ez:B,et:T}=v,P=u(C*C),I=u(A*A),j=u(B*B),H=u(j*j),k=u(P*g),G=u(j*u(k+I)),J=u(H+u(y*u(P*I)));if(G!==J)throw new Error("bad point: equation left != right (1)");const V=u(C*A),Q=u(B*T);if(V!==Q)throw new Error("bad point: equation left != right (2)");return!0});class l{constructor(g,y,C,A){this.ex=g,this.ey=y,this.ez=C,this.et=A,p("x",g),p("y",y),p("z",C),p("t",A),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(g){if(g instanceof l)throw new Error("extended point not allowed");const{x:y,y:C}=g||{};return p("x",y),p("y",C),new l(y,C,$,u(y*C))}static normalizeZ(g){const y=r.invertBatch(g.map(C=>C.ez));return g.map((C,A)=>C.toAffine(y[A])).map(l.fromAffine)}static msm(g,y){return zo(l,d,g,y)}_setWindowSize(g){N.setWindowSize(this,g)}assertValidity(){w(this)}equals(g){m(g);const{ex:y,ey:C,ez:A}=this,{ex:B,ey:T,ez:P}=g,I=u(y*P),j=u(B*A),H=u(C*P),k=u(T*A);return I===j&&H===k}is0(){return this.equals(l.ZERO)}negate(){return new l(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){const{a:g}=t,{ex:y,ey:C,ez:A}=this,B=u(y*y),T=u(C*C),P=u(Ce*u(A*A)),I=u(g*B),j=y+C,H=u(u(j*j)-B-T),k=I+T,G=k-P,J=I-T,V=u(H*G),Q=u(k*J),ne=u(H*J),me=u(G*k);return new l(V,Q,me,ne)}add(g){m(g);const{a:y,d:C}=t,{ex:A,ey:B,ez:T,et:P}=this,{ex:I,ey:j,ez:H,et:k}=g;if(y===BigInt(-1)){const bt=u((B-A)*(j+I)),pt=u((B+A)*(j-I)),Ie=u(pt-bt);if(Ie===Y)return this.double();const gt=u(T*Ce*k),wt=u(P*Ce*H),Et=wt+gt,yt=pt+bt,mt=wt-gt,Jr=u(Et*Ie),Zr=u(yt*mt),Xr=u(Et*mt),Qr=u(Ie*yt);return new l(Jr,Zr,Qr,Xr)}const G=u(A*I),J=u(B*j),V=u(P*C*k),Q=u(T*H),ne=u((A+B)*(I+j)-G-J),me=Q-V,dt=Q+V,Dt=u(J-y*G),Vr=u(ne*me),Yr=u(dt*Dt),Kr=u(ne*Dt),Gr=u(me*dt);return new l(Vr,Yr,Gr,Kr)}subtract(g){return this.add(g.negate())}wNAF(g){return N.wNAFCached(this,g,l.normalizeZ)}multiply(g){const y=g;be("scalar",y,$,n);const{p:C,f:A}=this.wNAF(y);return l.normalizeZ([C,A])[0]}multiplyUnsafe(g,y=l.ZERO){const C=g;return be("scalar",C,Y,n),C===Y?O:this.is0()||C===$?this:N.wNAFCachedUnsafe(this,C,l.normalizeZ,y)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}isTorsionFree(){return N.unsafeLadder(this,n).is0()}toAffine(g){return _(this,g)}clearCofactor(){const{h:g}=t;return g===$?this:this.multiplyUnsafe(g)}static fromHex(g,y=!1){const{d:C,a:A}=t,B=r.BYTES;g=X("pointHex",g,B),He("zip215",y);const T=g.slice(),P=g[B-1];T[B-1]=P&-129;const I=Se(T),j=y?f:r.ORDER;be("pointHex.y",I,Y,j);const H=u(I*I),k=u(H-$),G=u(C*H-A);let{isValid:J,value:V}=D(k,G);if(!J)throw new Error("Point.fromHex: invalid y coordinate");const Q=(V&$)===$,ne=(P&128)!==0;if(!y&&V===Y&&ne)throw new Error("Point.fromHex: x=0 and x_0=1");return ne!==Q&&(V=u(-V)),l.fromAffine({x:V,y:I})}static fromPrivateKey(g){return F(g).point}toRawBytes(){const{x:g,y}=this.toAffine(),C=Qe(y,r.BYTES);return C[C.length-1]|=g&$?128:0,C}toHex(){return ut(this.toRawBytes())}}l.BASE=new l(t.Gx,t.Gy,$,u(t.Gx*t.Gy)),l.ZERO=new l(Y,$,$,Y);const{BASE:E,ZERO:O}=l,N=Lo(l,c*8);function R(v){return L(v,n)}function x(v){return R(Se(v))}function F(v){const g=r.BYTES;v=X("private key",v,g);const y=X("hashed private key",i(v),2*g),C=b(y.slice(0,g)),A=y.slice(g,2*g),B=x(C),T=E.multiply(B),P=T.toRawBytes();return{head:C,prefix:A,scalar:B,point:T,pointBytes:P}}function ae(v){return F(v).pointBytes}function re(v=new Uint8Array,...g){const y=Ft(...g);return x(i(h(y,X("context",v),!!o)))}function ue(v,g,y={}){v=X("message",v),o&&(v=o(v));const{prefix:C,scalar:A,pointBytes:B}=F(g),T=re(y.context,C,v),P=E.multiply(T).toRawBytes(),I=re(y.context,P,B,v),j=R(T+I*A);be("signature.s",j,Y,n);const H=Ft(P,Qe(j,r.BYTES));return X("result",H,r.BYTES*2)}const le=qo;function Ne(v,g,y,C=le){const{context:A,zip215:B}=C,T=r.BYTES;v=X("signature",v,2*T),g=X("message",g),y=X("publicKey",y,T),B!==void 0&&He("zip215",B),o&&(g=o(g));const P=Se(v.slice(T,2*T));let I,j,H;try{I=l.fromHex(y,B),j=l.fromHex(v.slice(0,T),B),H=E.multiplyUnsafe(P)}catch{return!1}if(!B&&I.isSmallOrder())return!1;const k=re(A,j.toRawBytes(),I.toRawBytes(),g);return j.add(I.multiplyUnsafe(k)).subtract(H).clearCofactor().equals(l.ZERO)}return E._setWindowSize(8),{CURVE:t,getPublicKey:ae,sign:ue,verify:Ne,ExtendedPoint:l,utils:{getExtendedPublicKey:F,randomPrivateKey:()=>s(r.BYTES),precompute(v=8,g=l.BASE){return g._setWindowSize(v),g.multiply(BigInt(3)),g}}}}BigInt(0),BigInt(1);const ft=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Ht=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const Vo=BigInt(1),Wt=BigInt(2);BigInt(3);const Yo=BigInt(5),Ko=BigInt(8);function Go(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),i=ft,s=e*e%i*e%i,c=K(s,Wt,i)*s%i,a=K(c,Vo,i)*e%i,f=K(a,Yo,i)*a%i,u=K(f,t,i)*f%i,d=K(u,r,i)*u%i,D=K(d,n,i)*d%i,b=K(D,o,i)*D%i,h=K(b,o,i)*D%i,p=K(h,t,i)*f%i;return{pow_p_5_8:K(p,Wt,i)*e%i,b2:s}}function Jo(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function Zo(e,t){const r=ft,n=L(t*t*t,r),o=L(n*n*t,r),i=Go(e*o).pow_p_5_8;let s=L(e*n*i,r);const c=L(t*s*s,r),a=s,f=L(s*Ht,r),u=c===e,d=c===L(-e,r),D=c===L(-e*Ht,r);return u&&(s=a),(d||D)&&(s=f),Uo(s,r)&&(s=L(-s,r)),{isValid:u||d,value:s}}const Xo=wr(ft,void 0,!0),Qo={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Xo,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:Ko,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:yo,randomBytes:hr,adjustScalarBytes:Jo,uvRatio:Zo},mr=$o(Qo),ei="EdDSA",ti="JWT",Oe=".",Be="base64url",_r="utf8",vr="utf8",ri=":",ni="did",oi="key",qt="base58btc",ii="z",si="K36",ai=32;function ht(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Cr(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?ht(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function Sr(e,t){t||(t=e.reduce((o,i)=>o+i.length,0));const r=Cr(t);let n=0;for(const o of e)r.set(o,n),n+=o.length;return ht(r)}function ui(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<e.length;o++){var i=e.charAt(o),s=i.charCodeAt(0);if(r[s]!==255)throw new TypeError(i+" is ambiguous");r[s]=o}var c=e.length,a=e.charAt(0),f=Math.log(c)/Math.log(256),u=Math.log(256)/Math.log(c);function d(h){if(h instanceof Uint8Array||(ArrayBuffer.isView(h)?h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength):Array.isArray(h)&&(h=Uint8Array.from(h))),!(h instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(h.length===0)return"";for(var p=0,m=0,_=0,w=h.length;_!==w&&h[_]===0;)_++,p++;for(var l=(w-_)*u+1>>>0,E=new Uint8Array(l);_!==w;){for(var O=h[_],N=0,R=l-1;(O!==0||N<m)&&R!==-1;R--,N++)O+=256*E[R]>>>0,E[R]=O%c>>>0,O=O/c>>>0;if(O!==0)throw new Error("Non-zero carry");m=N,_++}for(var x=l-m;x!==l&&E[x]===0;)x++;for(var F=a.repeat(p);x<l;++x)F+=e.charAt(E[x]);return F}function D(h){if(typeof h!="string")throw new TypeError("Expected String");if(h.length===0)return new Uint8Array;var p=0;if(h[p]!==" "){for(var m=0,_=0;h[p]===a;)m++,p++;for(var w=(h.length-p)*f+1>>>0,l=new Uint8Array(w);h[p];){var E=r[h.charCodeAt(p)];if(E===255)return;for(var O=0,N=w-1;(E!==0||O<_)&&N!==-1;N--,O++)E+=c*l[N]>>>0,l[N]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");_=O,p++}if(h[p]!==" "){for(var R=w-_;R!==w&&l[R]===0;)R++;for(var x=new Uint8Array(m+(w-R)),F=m;R!==w;)x[F++]=l[R++];return x}}}function b(h){var p=D(h);if(p)return p;throw new Error(`Non-${t} character`)}return{encode:d,decodeUnsafe:D,decode:b}}var ci=ui,fi=ci;const Or=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},hi=e=>new TextEncoder().encode(e),li=e=>new TextDecoder().decode(e);class di{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Di{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return xr(this,t)}}class bi{constructor(t){this.decoders=t}or(t){return xr(this,t)}decode(t){const r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const xr=(e,t)=>new bi({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class pi{constructor(t,r,n,o){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new di(t,r,n),this.decoder=new Di(t,r,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Re=({name:e,prefix:t,encode:r,decode:n})=>new pi(e,t,r,n),Ee=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:o}=fi(r,t);return Re({prefix:e,name:t,encode:n,decode:i=>Or(o(i))})},gi=(e,t,r,n)=>{const o={};for(let u=0;u<t.length;++u)o[t[u]]=u;let i=e.length;for(;e[i-1]==="=";)--i;const s=new Uint8Array(i*r/8|0);let c=0,a=0,f=0;for(let u=0;u<i;++u){const d=o[e[u]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);a=a<<r|d,c+=r,c>=8&&(c-=8,s[f++]=255&a>>c)}if(c>=r||255&a<<8-c)throw new SyntaxError("Unexpected end of data");return s},wi=(e,t,r)=>{const n=t[t.length-1]==="=",o=(1<<r)-1;let i="",s=0,c=0;for(let a=0;a<e.length;++a)for(c=c<<8|e[a],s+=8;s>r;)s-=r,i+=t[o&c>>s];if(s&&(i+=t[o&c<<r-s]),n)for(;i.length*r&7;)i+="=";return i},W=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Re({prefix:t,name:e,encode(o){return wi(o,n,r)},decode(o){return gi(o,n,r,e)}}),Ei=Re({prefix:"\0",name:"identity",encode:e=>li(e),decode:e=>hi(e)});var yi=Object.freeze({__proto__:null,identity:Ei});const mi=W({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var _i=Object.freeze({__proto__:null,base2:mi});const vi=W({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Ci=Object.freeze({__proto__:null,base8:vi});const Si=Ee({prefix:"9",name:"base10",alphabet:"0123456789"});var Oi=Object.freeze({__proto__:null,base10:Si});const xi=W({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ai=W({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Bi=Object.freeze({__proto__:null,base16:xi,base16upper:Ai});const Ri=W({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ti=W({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ui=W({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ni=W({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ii=W({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Fi=W({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Pi=W({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ji=W({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Mi=W({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Li=Object.freeze({__proto__:null,base32:Ri,base32upper:Ti,base32pad:Ui,base32padupper:Ni,base32hex:Ii,base32hexupper:Fi,base32hexpad:Pi,base32hexpadupper:ji,base32z:Mi});const zi=Ee({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Hi=Ee({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Wi=Object.freeze({__proto__:null,base36:zi,base36upper:Hi});const qi=Ee({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ki=Ee({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var $i=Object.freeze({__proto__:null,base58btc:qi,base58flickr:ki});const Vi=W({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Yi=W({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ki=W({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Gi=W({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Ji=Object.freeze({__proto__:null,base64:Vi,base64pad:Yi,base64url:Ki,base64urlpad:Gi});const Ar=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Zi=Ar.reduce((e,t,r)=>(e[r]=t,e),[]),Xi=Ar.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function Qi(e){return e.reduce((t,r)=>(t+=Zi[r],t),"")}function es(e){const t=[];for(const r of e){const n=Xi[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}const ts=Re({prefix:"🚀",name:"base256emoji",encode:Qi,decode:es});var rs=Object.freeze({__proto__:null,base256emoji:ts}),ns=Br,kt=128,os=-128,is=Math.pow(2,31);function Br(e,t,r){t=t||[],r=r||0;for(var n=r;e>=is;)t[r++]=e&255|kt,e/=128;for(;e&os;)t[r++]=e&255|kt,e>>>=7;return t[r]=e|0,Br.bytes=r-n+1,t}var ss=tt,as=128,$t=127;function tt(e,n){var r=0,n=n||0,o=0,i=n,s,c=e.length;do{if(i>=c)throw tt.bytes=0,new RangeError("Could not decode varint");s=e[i++],r+=o<28?(s&$t)<<o:(s&$t)*Math.pow(2,o),o+=7}while(s>=as);return tt.bytes=i-n,r}var us=Math.pow(2,7),cs=Math.pow(2,14),fs=Math.pow(2,21),hs=Math.pow(2,28),ls=Math.pow(2,35),ds=Math.pow(2,42),Ds=Math.pow(2,49),bs=Math.pow(2,56),ps=Math.pow(2,63),gs=function(e){return e<us?1:e<cs?2:e<fs?3:e<hs?4:e<ls?5:e<ds?6:e<Ds?7:e<bs?8:e<ps?9:10},ws={encode:ns,decode:ss,encodingLength:gs},Rr=ws;const Vt=(e,t,r=0)=>(Rr.encode(e,t,r),t),Yt=e=>Rr.encodingLength(e),rt=(e,t)=>{const r=t.byteLength,n=Yt(e),o=n+Yt(r),i=new Uint8Array(o+r);return Vt(e,i,0),Vt(r,i,n),i.set(t,o),new Es(e,r,t,i)};class Es{constructor(t,r,n,o){this.code=t,this.size=r,this.digest=n,this.bytes=o}}const Tr=({name:e,code:t,encode:r})=>new ys(e,t,r);class ys{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){const r=this.encode(t);return r instanceof Uint8Array?rt(this.code,r):r.then(n=>rt(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Ur=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),ms=Tr({name:"sha2-256",code:18,encode:Ur("SHA-256")}),_s=Tr({name:"sha2-512",code:19,encode:Ur("SHA-512")});var vs=Object.freeze({__proto__:null,sha256:ms,sha512:_s});const Nr=0,Cs="identity",Ir=Or,Ss=e=>rt(Nr,Ir(e)),Os={code:Nr,name:Cs,encode:Ir,digest:Ss};var xs=Object.freeze({__proto__:null,identity:Os});new TextEncoder,new TextDecoder;const Kt={...yi,..._i,...Ci,...Oi,...Bi,...Li,...Wi,...$i,...Ji,...rs};({...vs,...xs});function Fr(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Gt=Fr("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),Ye=Fr("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=Cr(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),Pr={utf8:Gt,"utf-8":Gt,hex:Kt.base16,latin1:Ye,ascii:Ye,binary:Ye,...Kt};function Te(e,t="utf8"){const r=Pr[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}function he(e,t="utf8"){const r=Pr[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?ht(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function Jt(e){return ar(Te(he(e,Be),_r))}function xe(e){return Te(he(ur(e),_r),Be)}function As(e){const t=he(si,qt),r=ii+Te(Sr([t,e]),qt);return[ni,oi,r].join(ri)}function Bs(e){return Te(e,Be)}function Rs(e){return he(e,Be)}function Ts(e){return he([xe(e.header),xe(e.payload)].join(Oe),vr)}function Us(e){return[xe(e.header),xe(e.payload),Bs(e.signature)].join(Oe)}function au(e){const t=e.split(Oe),r=Jt(t[0]),n=Jt(t[1]),o=Rs(t[2]),i=he(t.slice(0,2).join(Oe),vr);return{header:r,payload:n,signature:o,data:i}}function uu(e=hr(ai)){const t=mr.getPublicKey(e);return{secretKey:Sr([e,t]),publicKey:t}}async function cu(e,t,r,n,o=ot.fromMiliseconds(Date.now())){const i={alg:ei,typ:ti},s=As(n.publicKey),c=o+r,a={iss:s,sub:e,aud:t,iat:o,exp:c},f=Ts({header:i,payload:a}),u=mr.sign(f,n.secretKey.slice(0,32));return Us({header:i,payload:a,signature:u})}var U={},Zt;function jr(){if(Zt)return U;Zt=1,Object.defineProperty(U,"__esModule",{value:!0}),U.getLocalStorage=U.getLocalStorageOrThrow=U.getCrypto=U.getCryptoOrThrow=U.getLocation=U.getLocationOrThrow=U.getNavigator=U.getNavigatorOrThrow=U.getDocument=U.getDocumentOrThrow=U.getFromWindowOrThrow=U.getFromWindow=void 0;function e(D){let b;return typeof window<"u"&&typeof window[D]<"u"&&(b=window[D]),b}U.getFromWindow=e;function t(D){const b=e(D);if(!b)throw new Error(`${D} is not defined in Window`);return b}U.getFromWindowOrThrow=t;function r(){return t("document")}U.getDocumentOrThrow=r;function n(){return e("document")}U.getDocument=n;function o(){return t("navigator")}U.getNavigatorOrThrow=o;function i(){return e("navigator")}U.getNavigator=i;function s(){return t("location")}U.getLocationOrThrow=s;function c(){return e("location")}U.getLocation=c;function a(){return t("crypto")}U.getCryptoOrThrow=a;function f(){return e("crypto")}U.getCrypto=f;function u(){return t("localStorage")}U.getLocalStorageOrThrow=u;function d(){return e("localStorage")}return U.getLocalStorage=d,U}var fu=jr(),pe={},Xt;function Ns(){if(Xt)return pe;Xt=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.getWindowMetadata=void 0;const e=jr();function t(){let r,n;try{r=e.getDocumentOrThrow(),n=e.getLocationOrThrow()}catch{return null}function o(){const b=r.getElementsByTagName("link"),h=[];for(let p=0;p<b.length;p++){const m=b[p],_=m.getAttribute("rel");if(_&&_.toLowerCase().indexOf("icon")>-1){const w=m.getAttribute("href");if(w)if(w.toLowerCase().indexOf("https:")===-1&&w.toLowerCase().indexOf("http:")===-1&&w.indexOf("//")!==0){let l=n.protocol+"//"+n.host;if(w.indexOf("/")===0)l+=w;else{const E=n.pathname.split("/");E.pop();const O=E.join("/");l+=O+"/"+w}h.push(l)}else if(w.indexOf("//")===0){const l=n.protocol+w;h.push(l)}else h.push(w)}}return h}function i(...b){const h=r.getElementsByTagName("meta");for(let p=0;p<h.length;p++){const m=h[p],_=["itemprop","property","name"].map(w=>m.getAttribute(w)).filter(w=>w?b.includes(w):!1);if(_.length&&_){const w=m.getAttribute("content");if(w)return w}}return""}function s(){let b=i("name","og:site_name","og:title","twitter:title");return b||(b=r.title),b}function c(){return i("description","og:description","twitter:description","keywords")}const a=s(),f=c(),u=n.origin,d=o();return{description:f,url:u,icons:d,name:a}}return pe.getWindowMetadata=t,pe}var hu=Ns();function Is(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<e.length;o++){var i=e.charAt(o),s=i.charCodeAt(0);if(r[s]!==255)throw new TypeError(i+" is ambiguous");r[s]=o}var c=e.length,a=e.charAt(0),f=Math.log(c)/Math.log(256),u=Math.log(256)/Math.log(c);function d(h){if(h instanceof Uint8Array||(ArrayBuffer.isView(h)?h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength):Array.isArray(h)&&(h=Uint8Array.from(h))),!(h instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(h.length===0)return"";for(var p=0,m=0,_=0,w=h.length;_!==w&&h[_]===0;)_++,p++;for(var l=(w-_)*u+1>>>0,E=new Uint8Array(l);_!==w;){for(var O=h[_],N=0,R=l-1;(O!==0||N<m)&&R!==-1;R--,N++)O+=256*E[R]>>>0,E[R]=O%c>>>0,O=O/c>>>0;if(O!==0)throw new Error("Non-zero carry");m=N,_++}for(var x=l-m;x!==l&&E[x]===0;)x++;for(var F=a.repeat(p);x<l;++x)F+=e.charAt(E[x]);return F}function D(h){if(typeof h!="string")throw new TypeError("Expected String");if(h.length===0)return new Uint8Array;var p=0;if(h[p]!==" "){for(var m=0,_=0;h[p]===a;)m++,p++;for(var w=(h.length-p)*f+1>>>0,l=new Uint8Array(w);h[p];){var E=r[h.charCodeAt(p)];if(E===255)return;for(var O=0,N=w-1;(E!==0||O<_)&&N!==-1;N--,O++)E+=c*l[N]>>>0,l[N]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");_=O,p++}if(h[p]!==" "){for(var R=w-_;R!==w&&l[R]===0;)R++;for(var x=new Uint8Array(m+(w-R)),F=m;R!==w;)x[F++]=l[R++];return x}}}function b(h){var p=D(h);if(p)return p;throw new Error(`Non-${t} character`)}return{encode:d,decodeUnsafe:D,decode:b}}var Fs=Is,Ps=Fs;const js=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Ms=e=>new TextEncoder().encode(e),Ls=e=>new TextDecoder().decode(e);class zs{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Hs{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Mr(this,t)}}class Ws{constructor(t){this.decoders=t}or(t){return Mr(this,t)}decode(t){const r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Mr=(e,t)=>new Ws({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class qs{constructor(t,r,n,o){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new zs(t,r,n),this.decoder=new Hs(t,r,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Ue=({name:e,prefix:t,encode:r,decode:n})=>new qs(e,t,r,n),ye=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:o}=Ps(r,t);return Ue({prefix:e,name:t,encode:n,decode:i=>js(o(i))})},ks=(e,t,r,n)=>{const o={};for(let u=0;u<t.length;++u)o[t[u]]=u;let i=e.length;for(;e[i-1]==="=";)--i;const s=new Uint8Array(i*r/8|0);let c=0,a=0,f=0;for(let u=0;u<i;++u){const d=o[e[u]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);a=a<<r|d,c+=r,c>=8&&(c-=8,s[f++]=255&a>>c)}if(c>=r||255&a<<8-c)throw new SyntaxError("Unexpected end of data");return s},$s=(e,t,r)=>{const n=t[t.length-1]==="=",o=(1<<r)-1;let i="",s=0,c=0;for(let a=0;a<e.length;++a)for(c=c<<8|e[a],s+=8;s>r;)s-=r,i+=t[o&c>>s];if(s&&(i+=t[o&c<<r-s]),n)for(;i.length*r&7;)i+="=";return i},q=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Ue({prefix:t,name:e,encode(o){return $s(o,n,r)},decode(o){return ks(o,n,r,e)}}),Vs=Ue({prefix:"\0",name:"identity",encode:e=>Ls(e),decode:e=>Ms(e)}),Ys=Object.freeze(Object.defineProperty({__proto__:null,identity:Vs},Symbol.toStringTag,{value:"Module"})),Ks=q({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Gs=Object.freeze(Object.defineProperty({__proto__:null,base2:Ks},Symbol.toStringTag,{value:"Module"})),Js=q({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Zs=Object.freeze(Object.defineProperty({__proto__:null,base8:Js},Symbol.toStringTag,{value:"Module"})),Xs=ye({prefix:"9",name:"base10",alphabet:"0123456789"}),Qs=Object.freeze(Object.defineProperty({__proto__:null,base10:Xs},Symbol.toStringTag,{value:"Module"})),ea=q({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),ta=q({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),ra=Object.freeze(Object.defineProperty({__proto__:null,base16:ea,base16upper:ta},Symbol.toStringTag,{value:"Module"})),na=q({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),oa=q({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),ia=q({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),sa=q({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),aa=q({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),ua=q({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),ca=q({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),fa=q({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ha=q({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),la=Object.freeze(Object.defineProperty({__proto__:null,base32:na,base32hex:aa,base32hexpad:ca,base32hexpadupper:fa,base32hexupper:ua,base32pad:ia,base32padupper:sa,base32upper:oa,base32z:ha},Symbol.toStringTag,{value:"Module"})),da=ye({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Da=ye({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),ba=Object.freeze(Object.defineProperty({__proto__:null,base36:da,base36upper:Da},Symbol.toStringTag,{value:"Module"})),pa=ye({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ga=ye({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),wa=Object.freeze(Object.defineProperty({__proto__:null,base58btc:pa,base58flickr:ga},Symbol.toStringTag,{value:"Module"})),Ea=q({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ya=q({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ma=q({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),_a=q({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),va=Object.freeze(Object.defineProperty({__proto__:null,base64:Ea,base64pad:ya,base64url:ma,base64urlpad:_a},Symbol.toStringTag,{value:"Module"})),Lr=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Ca=Lr.reduce((e,t,r)=>(e[r]=t,e),[]),Sa=Lr.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function Oa(e){return e.reduce((t,r)=>(t+=Ca[r],t),"")}function xa(e){const t=[];for(const r of e){const n=Sa[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}const Aa=Ue({prefix:"🚀",name:"base256emoji",encode:Oa,decode:xa}),Ba=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:Aa},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const lu={...Ys,...Gs,...Zs,...Qs,...ra,...la,...ba,...wa,...va,...Ba},du={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},Ra="PARSE_ERROR",Ta="INVALID_REQUEST",Ua="METHOD_NOT_FOUND",Na="INVALID_PARAMS",zr="INTERNAL_ERROR",lt="SERVER_ERROR",Ia=[-32700,-32600,-32601,-32602,-32603],ge={[Ra]:{code:-32700,message:"Parse error"},[Ta]:{code:-32600,message:"Invalid Request"},[Ua]:{code:-32601,message:"Method not found"},[Na]:{code:-32602,message:"Invalid params"},[zr]:{code:-32603,message:"Internal error"},[lt]:{code:-32e3,message:"Server error"}},Hr=lt;function Fa(e){return Ia.includes(e)}function Qt(e){return Object.keys(ge).includes(e)?ge[e]:ge[Hr]}function Pa(e){const t=Object.values(ge).find(r=>r.code===e);return t||ge[Hr]}function ja(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${t}`):e}function Wr(e=3){const t=Date.now()*Math.pow(10,e),r=Math.floor(Math.random()*Math.pow(10,e));return t+r}function Ma(e=6){return BigInt(Wr(e))}function La(e,t,r){return{id:r||Wr(),jsonrpc:"2.0",method:e,params:t}}function Du(e,t){return{id:e,jsonrpc:"2.0",result:t}}function za(e,t,r){return{id:e,jsonrpc:"2.0",error:Ha(t)}}function Ha(e,t){return typeof e>"u"?Qt(zr):(typeof e=="string"&&(e=Object.assign(Object.assign({},Qt(lt)),{message:e})),Fa(e.code)&&(e=Pa(e.code)),e)}class Wa{}class qa extends Wa{constructor(){super()}}class ka extends qa{constructor(t){super()}}const $a="^https?:",Va="^wss?:";function Ya(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(!(!t||!t.length))return t[0]}function qr(e,t){const r=Ya(e);return typeof r>"u"?!1:new RegExp(t).test(r)}function bu(e){return qr(e,$a)}function er(e){return qr(e,Va)}function Ka(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}function kr(e){return typeof e=="object"&&"id"in e&&"jsonrpc"in e&&e.jsonrpc==="2.0"}function pu(e){return kr(e)&&"method"in e}function Ga(e){return kr(e)&&(Ja(e)||$r(e))}function Ja(e){return"result"in e}function $r(e){return"error"in e}class gu extends ka{constructor(t){super(t),this.events=new nt.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(t),this.connection.connected&&this.registerEventListeners()}async connect(t=this.connection){await this.open(t)}async disconnect(){await this.close()}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async request(t,r){return this.requestStrict(La(t.method,t.params||[],t.id||Ma().toString()),r)}async requestStrict(t,r){return new Promise(async(n,o)=>{if(!this.connection.connected)try{await this.open()}catch(i){o(i)}this.events.on(`${t.id}`,i=>{$r(i)?o(i.error):n(i.result)});try{await this.connection.send(t,r)}catch(i){o(i)}})}setConnection(t=this.connection){return t}onPayload(t){this.events.emit("payload",t),Ga(t)?this.events.emit(`${t.id}`,t):this.events.emit("message",{type:t.method,data:t.params})}onClose(t){t&&t.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${t.code} ${t.reason?`(${t.reason})`:""}`)),this.events.emit("disconnect")}async open(t=this.connection){this.connection===t&&this.connection.connected||(this.connection.connected&&this.close(),typeof t=="string"&&(await this.connection.open(t),t=this.connection),this.connection=this.setConnection(t),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",t=>this.onPayload(t)),this.connection.on("close",t=>this.onClose(t)),this.connection.on("error",t=>this.events.emit("error",t)),this.connection.on("register_error",t=>this.onClose()),this.hasRegisteredEventListeners=!0)}}var Ke,tr;function Za(){return tr||(tr=1,Ke=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}),Ke}const Xa=()=>typeof WebSocket<"u"?WebSocket:typeof globalThis<"u"&&typeof globalThis.WebSocket<"u"?globalThis.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:Za(),Qa=()=>typeof WebSocket<"u"||typeof globalThis<"u"&&typeof globalThis.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",rr=e=>e.split("?")[0],nr=10,eu=Xa();class wu{constructor(t){if(this.url=t,this.events=new nt.EventEmitter,this.registering=!1,!er(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);this.url=t}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async open(t=this.url){await this.register(t)}async close(){return new Promise((t,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),t()},this.socket.close()})}async send(t){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ur(t))}catch(r){this.onError(t.id,r)}}register(t=this.url){if(!er(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,o)=>{this.events.once("register_error",i=>{this.resetMaxListeners(),o(i)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return o(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=t,this.registering=!0,new Promise((r,n)=>{const o=tn.isReactNative()?void 0:{rejectUnauthorized:!Ka(t)},i=new eu(t,[],o);Qa()?i.onerror=s=>{const c=s;n(this.emitError(c.error))}:i.on("error",s=>{n(this.emitError(s))}),i.onopen=()=>{this.onOpen(i),r(i)}})}onOpen(t){t.onmessage=r=>this.onPayload(r),t.onclose=r=>this.onClose(r),this.socket=t,this.registering=!1,this.events.emit("open")}onClose(t){this.socket=void 0,this.registering=!1,this.events.emit("close",t)}onPayload(t){if(typeof t.data>"u")return;const r=typeof t.data=="string"?ar(t.data):t.data;this.events.emit("payload",r)}onError(t,r){const n=this.parseError(r),o=n.message||n.toString(),i=za(t,o);this.events.emit("payload",i)}parseError(t,r=this.url){return ja(t,rr(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>nr&&this.events.setMaxListeners(nr)}emitError(t){const r=this.parseError(new Error(t?.message||`WebSocket connection failed for host: ${rr(this.url)}`));return this.events.emit("register_error",r),r}}function tu(e){if(e.length>=255)throw new TypeError("Alphabet too long");const t=new Uint8Array(256);for(let f=0;f<t.length;f++)t[f]=255;for(let f=0;f<e.length;f++){const u=e.charAt(f),d=u.charCodeAt(0);if(t[d]!==255)throw new TypeError(u+" is ambiguous");t[d]=f}const r=e.length,n=e.charAt(0),o=Math.log(r)/Math.log(256),i=Math.log(256)/Math.log(r);function s(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";let u=0,d=0,D=0;const b=f.length;for(;D!==b&&f[D]===0;)D++,u++;const h=(b-D)*i+1>>>0,p=new Uint8Array(h);for(;D!==b;){let w=f[D],l=0;for(let E=h-1;(w!==0||l<d)&&E!==-1;E--,l++)w+=256*p[E]>>>0,p[E]=w%r>>>0,w=w/r>>>0;if(w!==0)throw new Error("Non-zero carry");d=l,D++}let m=h-d;for(;m!==h&&p[m]===0;)m++;let _=n.repeat(u);for(;m<h;++m)_+=e.charAt(p[m]);return _}function c(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;let u=0,d=0,D=0;for(;f[u]===n;)d++,u++;const b=(f.length-u)*o+1>>>0,h=new Uint8Array(b);for(;u<f.length;){const w=f.charCodeAt(u);if(w>255)return;let l=t[w];if(l===255)return;let E=0;for(let O=b-1;(l!==0||E<D)&&O!==-1;O--,E++)l+=r*h[O]>>>0,h[O]=l%256>>>0,l=l/256>>>0;if(l!==0)throw new Error("Non-zero carry");D=E,u++}let p=b-D;for(;p!==b&&h[p]===0;)p++;const m=new Uint8Array(d+(b-p));let _=d;for(;p!==b;)m[_++]=h[p++];return m}function a(f){const u=c(f);if(u)return u;throw new Error("Non-base"+r+" character")}return{encode:s,decodeUnsafe:c,decode:a}}var ru="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const Eu=tu(ru);export{du as C,Un as I,uu as P,As as Q,ar as a,Du as b,La as c,lu as d,hu as e,za as f,ot as g,fu as h,bu as i,au as j,Eu as k,su as l,sr as m,wu as n,gu as o,ja as p,pu as q,In as r,ur as s,Ga as t,cu as u,Ma as v,Ja as w,$r as x,Wr as y};