@dcl/vesting-dashboard 3.7.0 → 3.7.1-19868070294.commit-e76f047

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 (151) hide show
  1. package/assets/PhArrowCircleDown-b4d1b9f0.js +14 -0
  2. package/assets/PhArrowClockwise-35e72491.js +14 -0
  3. package/assets/PhArrowDown-57c22b7e.js +14 -0
  4. package/assets/PhArrowLeft-f48f6a32.js +14 -0
  5. package/assets/PhArrowRight-86fee956.js +14 -0
  6. package/assets/PhArrowSquareOut-7b8bc76d.js +14 -0
  7. package/assets/PhArrowUp-cb14a0b1.js +14 -0
  8. package/assets/PhArrowUpRight-72a93a0e.js +14 -0
  9. package/assets/PhArrowsClockwise-ecc02e05.js +14 -0
  10. package/assets/PhArrowsDownUp-336a1435.js +14 -0
  11. package/assets/PhArrowsLeftRight-fbdccc02.js +14 -0
  12. package/assets/PhBank-31d2eba3.js +14 -0
  13. package/assets/PhBrowser-90d21d12.js +14 -0
  14. package/assets/PhCaretDown-3aabbdc5.js +14 -0
  15. package/assets/PhCaretLeft-282326ec.js +14 -0
  16. package/assets/PhCaretRight-7b09ae84.js +14 -0
  17. package/assets/PhCaretUp-e4584d94.js +14 -0
  18. package/assets/PhCheck-5730aae2.js +14 -0
  19. package/assets/PhCircleHalf-7d16bc06.js +14 -0
  20. package/assets/PhClock-8b060e99.js +14 -0
  21. package/assets/PhCompass-45d3bde6.js +14 -0
  22. package/assets/PhCopy-f77992ef.js +14 -0
  23. package/assets/PhCreditCard-c353277e.js +14 -0
  24. package/assets/PhCurrencyDollar-510272c7.js +14 -0
  25. package/assets/PhDesktop-49e8128e.js +14 -0
  26. package/assets/PhDeviceMobile-cfdf19ef.js +14 -0
  27. package/assets/PhDotsThree-69a484e4.js +14 -0
  28. package/assets/PhEnvelope-fc3dd2a0.js +14 -0
  29. package/assets/PhFunnelSimple-5abe9858.js +14 -0
  30. package/assets/PhGlobe-a1b4ca91.js +14 -0
  31. package/assets/PhIdentificationCard-80541484.js +14 -0
  32. package/assets/PhImage-6bbac6b7.js +14 -0
  33. package/assets/PhInfo-3481abef.js +14 -0
  34. package/assets/PhLightbulb-26b52ed2.js +14 -0
  35. package/assets/PhMagnifyingGlass-4dfb76cc.js +14 -0
  36. package/assets/PhPaperPlaneRight-e6cf54ef.js +14 -0
  37. package/assets/PhPlus-f5753116.js +14 -0
  38. package/assets/PhPower-8bf5c9c7.js +14 -0
  39. package/assets/PhPuzzlePiece-93f1c92b.js +14 -0
  40. package/assets/PhQrCode-03aa9f8a.js +14 -0
  41. package/assets/PhQuestion-6c2bd1ad.js +14 -0
  42. package/assets/PhQuestionMark-820f14af.js +14 -0
  43. package/assets/PhSealCheck-137e0b1b.js +14 -0
  44. package/assets/PhSignOut-ed65c268.js +14 -0
  45. package/assets/PhSpinner-19f53f69.js +14 -0
  46. package/assets/PhTrash-acb3ad59.js +14 -0
  47. package/assets/PhUser-92aa32ba.js +14 -0
  48. package/assets/PhVault-ed94ef20.js +14 -0
  49. package/assets/PhWarning-b2396b99.js +14 -0
  50. package/assets/PhWarningCircle-0f363973.js +14 -0
  51. package/assets/PhX-522d79dd.js +14 -0
  52. package/assets/basic-eeeaaaeb.js +1435 -0
  53. package/assets/core-84b3ed1e.js +254 -0
  54. package/assets/features-21cad012.js +5 -0
  55. package/assets/{fortmatic-544d83cd.js → fortmatic-f30106eb.js} +1 -1
  56. package/assets/{index-c655b8a4.js → index-04415554.js} +1 -1
  57. package/assets/index-069f2f19.js +40 -0
  58. package/assets/index-388893ce.js +1321 -0
  59. package/assets/index-516a1ffc.js +26 -0
  60. package/assets/{index-083f8aea.css → index-91d98a83.css} +7 -7
  61. package/assets/{index-4f5a2d6d.js → index-be0620a9.js} +1 -1
  62. package/assets/{index-eabed5f8.js → index-cf405d3f.js} +1 -1
  63. package/assets/index-ec27bc27.js +7 -0
  64. package/assets/{index-fa03581b.js → index-fec77d48.js} +136 -130
  65. package/assets/native-bf1092f7.js +1 -0
  66. package/assets/property-70d704fc.js +27 -0
  67. package/assets/w3m-modal-4a2f6c0b.js +1209 -0
  68. package/index.html +4 -4
  69. package/package.json +3 -3
  70. package/assets/add-acf9b1b4.js +0 -15
  71. package/assets/all-wallets-8da20287.js +0 -6
  72. package/assets/app-store-e67aed93.js +0 -17
  73. package/assets/apple-729c27b3.js +0 -18
  74. package/assets/arrow-bottom-circle-813b263a.js +0 -11
  75. package/assets/arrow-bottom-d6bb311f.js +0 -8
  76. package/assets/arrow-left-3f704ffa.js +0 -8
  77. package/assets/arrow-right-17ab2e3f.js +0 -8
  78. package/assets/arrow-top-54da8ce5.js +0 -8
  79. package/assets/bank-e1f4c3fc.js +0 -14
  80. package/assets/basic-ad614917.js +0 -2128
  81. package/assets/browser-eb97127f.js +0 -14
  82. package/assets/card-b0c5c8c1.js +0 -14
  83. package/assets/checkmark-bf5ef01d.js +0 -11
  84. package/assets/checkmark-bold-7e354e06.js +0 -8
  85. package/assets/chevron-bottom-d89d2664.js +0 -8
  86. package/assets/chevron-left-c5f39fe4.js +0 -8
  87. package/assets/chevron-right-d3c55332.js +0 -8
  88. package/assets/chevron-top-d80ad128.js +0 -8
  89. package/assets/chrome-store-d9e64081.js +0 -61
  90. package/assets/clock-e0f81e9c.js +0 -8
  91. package/assets/close-27f760b9.js +0 -8
  92. package/assets/coinPlaceholder-7de9c936.js +0 -8
  93. package/assets/compass-b58b98ec.js +0 -8
  94. package/assets/copy-be90f370.js +0 -15
  95. package/assets/core-22576ab2.js +0 -910
  96. package/assets/cursor-57ee0abd.js +0 -3
  97. package/assets/cursor-transparent-57538744.js +0 -12
  98. package/assets/desktop-5acc8b3e.js +0 -9
  99. package/assets/disconnect-d3f01128.js +0 -8
  100. package/assets/discord-8dae2632.js +0 -17
  101. package/assets/etherscan-81f5f92a.js +0 -6
  102. package/assets/exclamation-triangle-886b7149.js +0 -4
  103. package/assets/extension-0e9ba8a4.js +0 -8
  104. package/assets/external-link-b676fc52.js +0 -8
  105. package/assets/facebook-8d75c929.js +0 -26
  106. package/assets/farcaster-aa884f8f.js +0 -12
  107. package/assets/filters-90e66ffd.js +0 -8
  108. package/assets/github-693f2bd4.js +0 -18
  109. package/assets/google-484b54cf.js +0 -18
  110. package/assets/help-circle-45787a88.js +0 -12
  111. package/assets/id-3b4cbdd1.js +0 -12
  112. package/assets/image-96c3f9d0.js +0 -4
  113. package/assets/index-22afa741.js +0 -7
  114. package/assets/index-f40605ee.js +0 -394
  115. package/assets/index.es-6a347079.js +0 -26
  116. package/assets/info-165d435a.js +0 -3
  117. package/assets/info-circle-5b599100.js +0 -12
  118. package/assets/lightbulb-c8f2bf4d.js +0 -3
  119. package/assets/mail-30ba2d81.js +0 -8
  120. package/assets/mobile-e938b174.js +0 -9
  121. package/assets/more-4e55b5a2.js +0 -11
  122. package/assets/network-placeholder-9e336806.js +0 -14
  123. package/assets/nftPlaceholder-8e616704.js +0 -8
  124. package/assets/off-a0926c5e.js +0 -8
  125. package/assets/play-store-dc96d93b.js +0 -32
  126. package/assets/plus-db04badc.js +0 -13
  127. package/assets/qr-code-e9ab5aef.js +0 -6
  128. package/assets/recycle-horizontal-e5f00cf2.js +0 -9
  129. package/assets/refresh-6674ef4c.js +0 -8
  130. package/assets/reown-logo-377bcb99.js +0 -12
  131. package/assets/search-3013ef36.js +0 -8
  132. package/assets/secp256k1-20c931a5.js +0 -1
  133. package/assets/secp256k1-c7caed23.js +0 -1
  134. package/assets/send-042fe740.js +0 -15
  135. package/assets/swapHorizontal-cdd26797.js +0 -8
  136. package/assets/swapHorizontalBold-c0c1ec1e.js +0 -8
  137. package/assets/swapHorizontalMedium-12dd3e75.js +0 -16
  138. package/assets/swapHorizontalRoundedBold-d4067e2b.js +0 -8
  139. package/assets/swapVertical-2c2ae8b1.js +0 -8
  140. package/assets/telegram-c0a71203.js +0 -16
  141. package/assets/three-dots-8119300b.js +0 -5
  142. package/assets/twitch-8d0de139.js +0 -18
  143. package/assets/twitterIcon-26917bdd.js +0 -6
  144. package/assets/verify-a135ffbd.js +0 -8
  145. package/assets/verify-filled-29fa924e.js +0 -8
  146. package/assets/w3m-modal-742fa0d2.js +0 -642
  147. package/assets/wallet-5649743f.js +0 -8
  148. package/assets/wallet-placeholder-32773694.js +0 -14
  149. package/assets/walletconnect-3189ad6b.js +0 -30
  150. package/assets/warning-circle-37a8b22f.js +0 -12
  151. package/assets/x-ee5c9ccd.js +0 -12
@@ -0,0 +1,7 @@
1
+ import{c as L,d as Jr,B as O,s as Cu,g as Gr,r as Yt,f as Ka,e as Xa,p as ni,a as Ru}from"./index-fec77d48.js";function Iu(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var bi={},Zt={},Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.walletLogo=void 0;const Au=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};Zr.walletLogo=Au;var Qr={};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.LINK_API_URL=void 0;Qr.LINK_API_URL="https://www.walletlink.org";var S={},er={},He={};Object.defineProperty(He,"__esModule",{value:!0});He.errorValues=He.standardErrorCodes=void 0;He.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};He.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var Kr={},Xr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=He,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(h,f=r){if(h&&Number.isInteger(h)){const _=h.toString();if(u(t.errorValues,_))return t.errorValues[_].message;if(c(h))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return f}e.getMessageFromCode=n;function s(h){if(!Number.isInteger(h))return!1;const f=h.toString();return!!(t.errorValues[f]||c(h))}e.isValidCode=s;function i(h){var f;if(typeof h=="number")return h;if(o(h))return(f=h.code)!==null&&f!==void 0?f:h.errorCode}e.getErrorCode=i;function o(h){return typeof h=="object"&&h!==null&&(typeof h.code=="number"||typeof h.errorCode=="number")}function a(h,{shouldIncludeStack:f=!1}={}){const _={};if(h&&typeof h=="object"&&!Array.isArray(h)&&u(h,"code")&&s(h.code)){const p=h;_.code=p.code,p.message&&typeof p.message=="string"?(_.message=p.message,u(p,"data")&&(_.data=p.data)):(_.message=n(_.code),_.data={originalError:l(h)})}else _.code=t.standardErrorCodes.rpc.internal,_.message=d(h,"message")?h.message:r,_.data={originalError:l(h)};return f&&(_.stack=d(h,"stack")?h.stack:void 0),_}e.serialize=a;function c(h){return h>=-32099&&h<=-32e3}function l(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function u(h,f){return Object.prototype.hasOwnProperty.call(h,f)}function d(h,f){return typeof h=="object"&&h!==null&&f in h&&typeof h[f]=="string"}})(Xr);Object.defineProperty(Kr,"__esModule",{value:!0});Kr.standardErrors=void 0;const oe=He,Ya=Xr;Kr.standardErrors={rpc:{parse:e=>ye(oe.standardErrorCodes.rpc.parse,e),invalidRequest:e=>ye(oe.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>ye(oe.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>ye(oe.standardErrorCodes.rpc.methodNotFound,e),internal:e=>ye(oe.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return ye(t,e)},invalidInput:e=>ye(oe.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>ye(oe.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>ye(oe.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>ye(oe.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>ye(oe.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>ye(oe.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>ft(oe.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>ft(oe.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>ft(oe.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>ft(oe.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>ft(oe.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>ft(oe.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new rc(t,r,n)}}};function ye(e,t){const[r,n]=ec(t);return new tc(e,r||(0,Ya.getMessageFromCode)(e),n)}function ft(e,t){const[r,n]=ec(t);return new rc(e,r||(0,Ya.getMessageFromCode)(e),n)}function ec(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let tc=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},rc=class extends tc{constructor(t,r,n){if(!Nu(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function Nu(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var Yr={},$t={};Object.defineProperty($t,"__esModule",{value:!0});$t.isErrorResponse=void 0;function Lu(e){return e.errorMessage!==void 0}$t.isErrorResponse=Lu;var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.LIB_VERSION=void 0;Ot.LIB_VERSION="3.9.3";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.serializeError=void 0;const Mu=$t,Tu=Ot,Pu=He,$u=Xr;function Ou(e,t){const r=(0,$u.serialize)(xu(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",Tu.LIB_VERSION),n.searchParams.set("code",r.code.toString());const s=Fu(r.data,t);return s&&n.searchParams.set("method",s),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}Yr.serializeError=Ou;function xu(e){return typeof e=="string"?{message:e,code:Pu.standardErrorCodes.rpc.internal}:(0,Mu.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function Fu(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=He;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=Kr;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=Yr;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const s=Xr;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return s.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return s.getMessageFromCode}})})(er);var ne={};Object.defineProperty(ne,"__esModule",{value:!0});ne.ProviderType=ne.RegExpString=ne.IntNumber=ne.BigIntString=ne.AddressString=ne.HexString=ne.OpaqueType=void 0;function tr(){return e=>e}ne.OpaqueType=tr;ne.HexString=tr();ne.AddressString=tr();ne.BigIntString=tr();function ju(e){return Math.floor(e)}ne.IntNumber=ju;ne.RegExpString=tr();var Lo;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Lo||(ne.ProviderType=Lo={}));var Bu=L&&L.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(S,"__esModule",{value:!0});S.isMobileWeb=S.getLocation=S.isInIFrame=S.createQrUrl=S.getFavicon=S.range=S.isBigNumber=S.ensureParsedJSONObject=S.ensureBN=S.ensureRegExpString=S.ensureIntNumber=S.ensureBuffer=S.ensureAddressString=S.ensureEvenLengthHexString=S.ensureHexString=S.isHexString=S.prepend0x=S.strip0x=S.has0xPrefix=S.hexStringFromIntNumber=S.intNumberFromHexString=S.bigIntStringFromBN=S.hexStringFromBuffer=S.hexStringToUint8Array=S.uint8ArrayToHex=S.randomBytesHex=void 0;const qe=Bu(Jr),lt=er,Se=ne,nc=/^[0-9]*$/,sc=/^[a-f0-9]*$/;function Du(e){return ic(crypto.getRandomValues(new Uint8Array(e)))}S.randomBytesHex=Du;function ic(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}S.uint8ArrayToHex=ic;function Hu(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}S.hexStringToUint8Array=Hu;function Uu(e,t=!1){const r=e.toString("hex");return(0,Se.HexString)(t?`0x${r}`:r)}S.hexStringFromBuffer=Uu;function Vu(e){return(0,Se.BigIntString)(e.toString(10))}S.bigIntStringFromBN=Vu;function Wu(e){return(0,Se.IntNumber)(new qe.default(nr(e,!1),16).toNumber())}S.intNumberFromHexString=Wu;function zu(e){return(0,Se.HexString)(`0x${new qe.default(e).toString(16)}`)}S.hexStringFromIntNumber=zu;function yi(e){return e.startsWith("0x")||e.startsWith("0X")}S.has0xPrefix=yi;function en(e){return yi(e)?e.slice(2):e}S.strip0x=en;function oc(e){return yi(e)?`0x${e.slice(2)}`:`0x${e}`}S.prepend0x=oc;function rr(e){if(typeof e!="string")return!1;const t=en(e).toLowerCase();return sc.test(t)}S.isHexString=rr;function ac(e,t=!1){if(typeof e=="string"){const r=en(e).toLowerCase();if(sc.test(r))return(0,Se.HexString)(t?`0x${r}`:r)}throw lt.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}S.ensureHexString=ac;function nr(e,t=!1){let r=ac(e,!1);return r.length%2===1&&(r=(0,Se.HexString)(`0${r}`)),t?(0,Se.HexString)(`0x${r}`):r}S.ensureEvenLengthHexString=nr;function qu(e){if(typeof e=="string"){const t=en(e).toLowerCase();if(rr(t)&&t.length===40)return(0,Se.AddressString)(oc(t))}throw lt.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}S.ensureAddressString=qu;function Ju(e){if(O.isBuffer(e))return e;if(typeof e=="string"){if(rr(e)){const t=nr(e,!1);return O.from(t,"hex")}return O.from(e,"utf8")}throw lt.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}S.ensureBuffer=Ju;function cc(e){if(typeof e=="number"&&Number.isInteger(e))return(0,Se.IntNumber)(e);if(typeof e=="string"){if(nc.test(e))return(0,Se.IntNumber)(Number(e));if(rr(e))return(0,Se.IntNumber)(new qe.default(nr(e,!1),16).toNumber())}throw lt.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}S.ensureIntNumber=cc;function Gu(e){if(e instanceof RegExp)return(0,Se.RegExpString)(e.toString());throw lt.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}S.ensureRegExpString=Gu;function Zu(e){if(e!==null&&(qe.default.isBN(e)||lc(e)))return new qe.default(e.toString(10),10);if(typeof e=="number")return new qe.default(cc(e));if(typeof e=="string"){if(nc.test(e))return new qe.default(e,10);if(rr(e))return new qe.default(nr(e,!1),16)}throw lt.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}S.ensureBN=Zu;function Qu(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw lt.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}S.ensureParsedJSONObject=Qu;function lc(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}S.isBigNumber=lc;function Ku(e,t){return Array.from({length:t-e},(r,n)=>e+n)}S.range=Ku;function Xu(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}S.getFavicon=Xu;function Yu(e,t,r,n,s,i){const o=n?"parent-id":"id",a=new URLSearchParams({[o]:e,secret:t,server:r,v:s,chainId:i.toString()}).toString();return`${r}/#/link?${a}`}S.createQrUrl=Yu;function uc(){try{return window.frameElement!==null}catch{return!1}}S.isInIFrame=uc;function ed(){try{return uc()&&window.top?window.top.location:window.location}catch{return window.location}}S.getLocation=ed;function td(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}S.isMobileWeb=td;var tn={};Object.defineProperty(tn,"__esModule",{value:!0});tn.ScopedLocalStorage=void 0;class rd{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const s=localStorage.key(n);typeof s=="string"&&s.startsWith(t)&&r.push(s)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}tn.ScopedLocalStorage=rd;var Ct={},dc={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function s(c,l,u){this.fn=c,this.context=l,this.once=u||!1}function i(c,l,u,d,h){if(typeof u!="function")throw new TypeError("The listener must be a function");var f=new s(u,d||c,h),_=r?r+l:l;return c._events[_]?c._events[_].fn?c._events[_]=[c._events[_],f]:c._events[_].push(f):(c._events[_]=f,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new n:delete c._events[l]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],u,d;if(this._eventsCount===0)return l;for(d in u=this._events)t.call(u,d)&&l.push(r?d.slice(1):d);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},a.prototype.listeners=function(l){var u=r?r+l:l,d=this._events[u];if(!d)return[];if(d.fn)return[d.fn];for(var h=0,f=d.length,_=new Array(f);h<f;h++)_[h]=d[h].fn;return _},a.prototype.listenerCount=function(l){var u=r?r+l:l,d=this._events[u];return d?d.fn?1:d.length:0},a.prototype.emit=function(l,u,d,h,f,_){var p=r?r+l:l;if(!this._events[p])return!1;var g=this._events[p],b=arguments.length,y,m;if(g.fn){switch(g.once&&this.removeListener(l,g.fn,void 0,!0),b){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,u),!0;case 3:return g.fn.call(g.context,u,d),!0;case 4:return g.fn.call(g.context,u,d,h),!0;case 5:return g.fn.call(g.context,u,d,h,f),!0;case 6:return g.fn.call(g.context,u,d,h,f,_),!0}for(m=1,y=new Array(b-1);m<b;m++)y[m-1]=arguments[m];g.fn.apply(g.context,y)}else{var I=g.length,v;for(m=0;m<I;m++)switch(g[m].once&&this.removeListener(l,g[m].fn,void 0,!0),b){case 1:g[m].fn.call(g[m].context);break;case 2:g[m].fn.call(g[m].context,u);break;case 3:g[m].fn.call(g[m].context,u,d);break;case 4:g[m].fn.call(g[m].context,u,d,h);break;default:if(!y)for(v=1,y=new Array(b-1);v<b;v++)y[v-1]=arguments[v];g[m].fn.apply(g[m].context,y)}}return!0},a.prototype.on=function(l,u,d){return i(this,l,u,d,!1)},a.prototype.once=function(l,u,d){return i(this,l,u,d,!0)},a.prototype.removeListener=function(l,u,d,h){var f=r?r+l:l;if(!this._events[f])return this;if(!u)return o(this,f),this;var _=this._events[f];if(_.fn)_.fn===u&&(!h||_.once)&&(!d||_.context===d)&&o(this,f);else{for(var p=0,g=[],b=_.length;p<b;p++)(_[p].fn!==u||h&&!_[p].once||d&&_[p].context!==d)&&g.push(_[p]);g.length?this._events[f]=g.length===1?g[0]:g:o(this,f)}return this},a.prototype.removeAllListeners=function(l){var u;return l?(u=r?r+l:l,this._events[u]&&o(this,u)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a})(dc);var nd=dc.exports,sr={},ir={},xt={};Object.defineProperty(xt,"__esModule",{value:!0});xt.EVENTS=void 0;xt.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var Ee={};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.RelayAbstract=Ee.APP_VERSION_KEY=Ee.LOCAL_STORAGE_ADDRESSES_KEY=Ee.WALLET_USER_NAME_KEY=void 0;const Mo=er;Ee.WALLET_USER_NAME_KEY="walletUsername";Ee.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Ee.APP_VERSION_KEY="AppVersion";class sd{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Mo.standardErrors.rpc.parse({});const s=n,{error:i}=s;if(i)throw(0,Mo.serializeError)(i,t.method);return s})}}Ee.RelayAbstract=sd;var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.Session=void 0;const To=Cu,Po=S,$o="session:id",Oo="session:secret",xo="session:linked";class wi{constructor(t,r,n,s){this._storage=t,this._id=r||(0,Po.randomBytesHex)(16),this._secret=n||(0,Po.randomBytesHex)(32),this._key=new To.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(t){const r=t.getItem($o),n=t.getItem(xo),s=t.getItem(Oo);return r&&s?new wi(t,r,s,n==="1"):null}static hash(t){return new To.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem($o,this._id),this._storage.setItem(Oo,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(xo,this._linked?"1":"0")}}Ft.Session=wi;var rn={},nn={};Object.defineProperty(nn,"__esModule",{value:!0});nn.Cipher=void 0;const Sr=S;class id{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.importKey("raw",(0,Sr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},s,i.encode(t)),a=16,c=o.slice(o.byteLength-a),l=o.slice(0,o.byteLength-a),u=new Uint8Array(c),d=new Uint8Array(l),h=new Uint8Array([...n,...u,...d]);return(0,Sr.uint8ArrayToHex)(h)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,s)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,Sr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,Sr.hexStringToUint8Array)(t),a=o.slice(0,12),c=o.slice(12,28),l=o.slice(28),u=new Uint8Array([...l,...c]),d={name:"AES-GCM",iv:new Uint8Array(a)};try{const h=await window.crypto.subtle.decrypt(d,i,u),f=new TextDecoder;n(f.decode(h))}catch(h){s(h)}})()})}}nn.Cipher=id;var sn={};Object.defineProperty(sn,"__esModule",{value:!0});sn.WalletLinkHTTP=void 0;class od{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const s=`${r}:${n}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:s}=await r.json();if(s)throw new Error(`Check unseen events failed: ${s}`);const i=(t=n==null?void 0:n.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${r.status}`)}}sn.WalletLinkHTTP=od;var Rt={};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.WalletLinkWebSocket=Rt.ConnectionState=void 0;var wt;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(wt||(Rt.ConnectionState=wt={}));class ad{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let s;try{this.webSocket=s=new this.WebSocketClass(this.url)}catch(i){r(i);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,wt.CONNECTING),s.onclose=i=>{var o;this.clearWebSocket(),r(new Error(`websocket error ${i.code}: ${i.reason}`)),(o=this.connectionStateListener)===null||o===void 0||o.call(this,wt.DISCONNECTED)},s.onopen=i=>{var o;t(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,wt.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},s.onmessage=i=>{var o,a;if(i.data==="h")(o=this.incomingDataListener)===null||o===void 0||o.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(i.data);(a=this.incomingDataListener)===null||a===void 0||a.call(this,c)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,wt.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}Rt.WalletLinkWebSocket=ad;Object.defineProperty(rn,"__esModule",{value:!0});rn.WalletLinkConnection=void 0;const pt=ne,cd=nn,Ne=xt,Fo=Ee,gt=Ft,ld=sn,kr=Rt,jo=1e4,ud=6e4;class dd{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:s,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,pt.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",l=>a.JsonRpcUrl&&this.handleChainUpdated(l,a.JsonRpcUrl)]]).forEach((l,u)=>{const d=a[u];d!==void 0&&l(d)})},this.handleDestroyed=a=>{var c,l;a==="1"&&((c=this.listener)===null||c===void 0||c.resetAndReload(),(l=this.diagnostic)===null||l===void 0||l.log(Ne.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:gt.Session.hash(this.session.id)}))},this.handleAccountUpdated=async a=>{var c,l;try{const u=await this.cipher.decrypt(a);(c=this.listener)===null||c===void 0||c.accountUpdated(u)}catch{(l=this.diagnostic)===null||l===void 0||l.log(Ne.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(a,c)=>{var l,u;try{const d=await this.cipher.decrypt(c);(l=this.listener)===null||l===void 0||l.metadataUpdated(a,d)}catch{(u=this.diagnostic)===null||u===void 0||u.log(Ne.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:a})}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(Fo.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(Fo.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,c)=>{var l,u;try{const d=await this.cipher.decrypt(a),h=await this.cipher.decrypt(c);(l=this.listener)===null||l===void 0||l.chainUpdated(d,h)}catch{(u=this.diagnostic)===null||u===void 0||u.log(Ne.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new cd.Cipher(t.secret),this.diagnostic=s,this.listener=n;const o=new kr.WalletLinkWebSocket(`${r}/rpc`,i);o.setConnectionStateListener(async a=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(Ne.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:gt.Session.hash(t.id)});let l=!1;switch(a){case kr.ConnectionState.DISCONNECTED:if(!this.destroyed){const u=async()=>{await new Promise(d=>setTimeout(d,5e3)),this.destroyed||o.connect().catch(()=>{u()})};u()}break;case kr.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),l=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},jo),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case kr.ConnectionState.CONNECTING:break}this.connected!==l&&(this.connected=l)}),o.setIncomingDataListener(a=>{var c,l,u;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const d=a.type==="IsLinkedOK"?a.linked:void 0;(c=this.diagnostic)===null||c===void 0||c.log(Ne.EVENTS.LINKED,{sessionIdHash:gt.Session.hash(t.id),linked:d,type:a.type,onlineGuests:a.onlineGuests}),this.linked=d||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(l=this.diagnostic)===null||l===void 0||l.log(Ne.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:gt.Session.hash(t.id),metadata_keys:a&&a.metadata?Object.keys(a.metadata):void 0}),this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((u=this.requestResolutions.get(a.id))===null||u===void 0||u(a))}),this.ws=o,this.http=new ld.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(Ne.EVENTS.STARTED_CONNECTING,{sessionIdHash:gt.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(Ne.EVENTS.DISCONNECTED,{sessionIdHash:gt.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const s=await this.cipher.decrypt(t.data),i=JSON.parse(s);if(i.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(i)}catch{(n=this.diagnostic)===null||n===void 0||n.log(Ne.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,pt.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const s=await this.makeRequest(n);if(s.type==="Fail")throw new Error(s.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const s=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:(0,pt.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:s,callWebhook:n};return this.setOnceLinked(async()=>{const o=await this.makeRequest(i);if(o.type==="Fail")throw new Error(o.error||"failed to publish event");return o.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>jo*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=ud){const n=t.id;this.sendData(t);let s;return Promise.race([new Promise((i,o)=>{s=window.setTimeout(()=>{o(new Error(`request ${n} timed out`))},r)}),new Promise(i=>{this.requestResolutions.set(n,o=>{clearTimeout(s),i(o),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,pt.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,pt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,pt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}rn.WalletLinkConnection=dd;var or={},ar={},vi={};Object.defineProperty(vi,"__esModule",{value:!0});vi.default=(()=>'@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}')();var hd=L&&L.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ar,"__esModule",{value:!0});ar.injectCssReset=void 0;const fd=hd(vi);function pd(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(fd.default)),document.documentElement.appendChild(e)}ar.injectCssReset=pd;var on={},cr,q,hc,fc,tt,Bo,pc,gc,_c,Ei,si,ii,mc,Qt={},bc=[],gd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,lr=Array.isArray;function Oe(e,t){for(var r in t)e[r]=t[r];return e}function Si(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function oi(e,t,r){var n,s,i,o={};for(i in t)i=="key"?n=t[i]:i=="ref"?s=t[i]:o[i]=t[i];if(arguments.length>2&&(o.children=arguments.length>3?cr.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)o[i]===void 0&&(o[i]=e.defaultProps[i]);return qt(e,o,n,s,null)}function qt(e,t,r,n,s){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++hc,__i:-1,__u:0};return s==null&&q.vnode!=null&&q.vnode(i),i}function _d(){return{current:null}}function ur(e){return e.children}function Jt(e,t){this.props=e,this.context=t}function It(e,t){if(t==null)return e.__?It(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?It(e):null}function yc(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return yc(e)}}function ai(e){(!e.__d&&(e.__d=!0)&&tt.push(e)&&!Hr.__r++||Bo!=q.debounceRendering)&&((Bo=q.debounceRendering)||pc)(Hr)}function Hr(){for(var e,t,r,n,s,i,o,a=1;tt.length;)tt.length>a&&tt.sort(gc),e=tt.shift(),a=tt.length,e.__d&&(r=void 0,n=void 0,s=(n=(t=e).__v).__e,i=[],o=[],t.__P&&((r=Oe({},n)).__v=n.__v+1,q.vnode&&q.vnode(r),ki(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[s]:null,i,s??It(n),!!(32&n.__u),o),r.__v=n.__v,r.__.__k[r.__i]=r,Sc(i,r,o),n.__e=n.__=null,r.__e!=s&&yc(r)));Hr.__r=0}function wc(e,t,r,n,s,i,o,a,c,l,u){var d,h,f,_,p,g,b,y=n&&n.__k||bc,m=t.length;for(c=md(r,t,y,c,m),d=0;d<m;d++)(f=r.__k[d])!=null&&(h=f.__i==-1?Qt:y[f.__i]||Qt,f.__i=d,g=ki(e,f,h,s,i,o,a,c,l,u),_=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&Ci(h.ref,null,f),u.push(f.ref,f.__c||_,f)),p==null&&_!=null&&(p=_),(b=!!(4&f.__u))||h.__k===f.__k?c=vc(f,c,e,b):typeof f.type=="function"&&g!==void 0?c=g:_&&(c=_.nextSibling),f.__u&=-7);return r.__e=p,c}function md(e,t,r,n,s){var i,o,a,c,l,u=r.length,d=u,h=0;for(e.__k=new Array(s),i=0;i<s;i++)(o=t[i])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=e.__k[i]=qt(null,o,null,null,null):lr(o)?o=e.__k[i]=qt(ur,{children:o},null,null,null):o.constructor==null&&o.__b>0?o=e.__k[i]=qt(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[i]=o,c=i+h,o.__=e,o.__b=e.__b+1,(l=o.__i=bd(o,r,c,d))!=-1&&(d--,(a=r[l])&&(a.__u|=2)),a==null||a.__v==null?(l==-1&&(s>u?h--:s<u&&h++),typeof o.type!="function"&&(o.__u|=4)):l!=c&&(l==c-1?h--:l==c+1?h++:(l>c?h--:h++,o.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<u;i++)(a=r[i])!=null&&!(2&a.__u)&&(a.__e==n&&(n=It(a)),Cc(a,a));return n}function vc(e,t,r,n){var s,i;if(typeof e.type=="function"){for(s=e.__k,i=0;s&&i<s.length;i++)s[i]&&(s[i].__=e,t=vc(s[i],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=It(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Ec(e,t){return t=t||[],e==null||typeof e=="boolean"||(lr(e)?e.some(function(r){Ec(r,t)}):t.push(e)),t}function bd(e,t,r,n){var s,i,o,a=e.key,c=e.type,l=t[r],u=l!=null&&(2&l.__u)==0;if(l===null&&a==null||u&&a==l.key&&c==l.type)return r;if(n>(u?1:0)){for(s=r-1,i=r+1;s>=0||i<t.length;)if((l=t[o=s>=0?s--:i++])!=null&&!(2&l.__u)&&a==l.key&&c==l.type)return o}return-1}function Do(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||gd.test(t)?r:r+"px"}function Cr(e,t,r,n,s){var i,o;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Do(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||Do(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(_c,"$1")),o=t.toLowerCase(),t=o in e||t=="onFocusOut"||t=="onFocusIn"?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r.u=n.u:(r.u=Ei,e.addEventListener(t,i?ii:si,i)):e.removeEventListener(t,i?ii:si,i);else{if(s=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function Ho(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Ei++;else if(t.t<r.u)return;return r(q.event?q.event(t):t)}}}function ki(e,t,r,n,s,i,o,a,c,l){var u,d,h,f,_,p,g,b,y,m,I,v,A,H,G,ee,J,W=t.type;if(t.constructor!=null)return null;128&r.__u&&(c=!!(32&r.__u),i=[a=t.__e=r.__e]),(u=q.__b)&&u(t);e:if(typeof W=="function")try{if(b=t.props,y="prototype"in W&&W.prototype.render,m=(u=W.contextType)&&n[u.__c],I=u?m?m.props.value:u.__:n,r.__c?g=(d=t.__c=r.__c).__=d.__E:(y?t.__c=d=new W(b,I):(t.__c=d=new Jt(b,I),d.constructor=W,d.render=wd),m&&m.sub(d),d.state||(d.state={}),d.__n=n,h=d.__d=!0,d.__h=[],d._sb=[]),y&&d.__s==null&&(d.__s=d.state),y&&W.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=Oe({},d.__s)),Oe(d.__s,W.getDerivedStateFromProps(b,d.__s))),f=d.props,_=d.state,d.__v=t,h)y&&W.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),y&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(y&&W.getDerivedStateFromProps==null&&b!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(b,I),t.__v==r.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(b,d.__s,I)===!1){for(t.__v!=r.__v&&(d.props=b,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(U){U&&(U.__=t)}),v=0;v<d._sb.length;v++)d.__h.push(d._sb[v]);d._sb=[],d.__h.length&&o.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(b,d.__s,I),y&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,_,p)})}if(d.context=I,d.props=b,d.__P=e,d.__e=!1,A=q.__r,H=0,y){for(d.state=d.__s,d.__d=!1,A&&A(t),u=d.render(d.props,d.state,d.context),G=0;G<d._sb.length;G++)d.__h.push(d._sb[G]);d._sb=[]}else do d.__d=!1,A&&A(t),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++H<25);d.state=d.__s,d.getChildContext!=null&&(n=Oe(Oe({},n),d.getChildContext())),y&&!h&&d.getSnapshotBeforeUpdate!=null&&(p=d.getSnapshotBeforeUpdate(f,_)),ee=u,u!=null&&u.type===ur&&u.key==null&&(ee=kc(u.props.children)),a=wc(e,lr(ee)?ee:[ee],t,r,n,s,i,o,a,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),g&&(d.__E=d.__=null)}catch(U){if(t.__v=null,c||i!=null)if(U.then){for(t.__u|=c?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,t.__e=a}else{for(J=i.length;J--;)Si(i[J]);ci(t)}else t.__e=r.__e,t.__k=r.__k,U.then||ci(t);q.__e(U,t,r)}else i==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=yd(r.__e,t,r,n,s,i,o,c,l);return(u=q.diffed)&&u(t),128&t.__u?void 0:a}function ci(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(ci)}function Sc(e,t,r){for(var n=0;n<r.length;n++)Ci(r[n],r[++n],r[++n]);q.__c&&q.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(i){i.call(s)})}catch(i){q.__e(i,s.__v)}})}function kc(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:lr(e)?e.map(kc):Oe({},e)}function yd(e,t,r,n,s,i,o,a,c){var l,u,d,h,f,_,p,g=r.props||Qt,b=t.props,y=t.type;if(y=="svg"?s="http://www.w3.org/2000/svg":y=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),i!=null){for(l=0;l<i.length;l++)if((f=i[l])&&"setAttribute"in f==!!y&&(y?f.localName==y:f.nodeType==3)){e=f,i[l]=null;break}}if(e==null){if(y==null)return document.createTextNode(b);e=document.createElementNS(s,y,b.is&&b),a&&(q.__m&&q.__m(t,i),a=!1),i=null}if(y==null)g===b||a&&e.data==b||(e.data=b);else{if(i=i&&cr.call(e.childNodes),!a&&i!=null)for(g={},l=0;l<e.attributes.length;l++)g[(f=e.attributes[l]).name]=f.value;for(l in g)if(f=g[l],l!="children"){if(l=="dangerouslySetInnerHTML")d=f;else if(!(l in b)){if(l=="value"&&"defaultValue"in b||l=="checked"&&"defaultChecked"in b)continue;Cr(e,l,null,f,s)}}for(l in b)f=b[l],l=="children"?h=f:l=="dangerouslySetInnerHTML"?u=f:l=="value"?_=f:l=="checked"?p=f:a&&typeof f!="function"||g[l]===f||Cr(e,l,f,g[l],s);if(u)a||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),wc(t.type=="template"?e.content:e,lr(h)?h:[h],t,r,n,y=="foreignObject"?"http://www.w3.org/1999/xhtml":s,i,o,i?i[0]:r.__k&&It(r,0),a,c),i!=null)for(l=i.length;l--;)Si(i[l]);a||(l="value",y=="progress"&&_==null?e.removeAttribute("value"):_!=null&&(_!==e[l]||y=="progress"&&!_||y=="option"&&_!=g[l])&&Cr(e,l,_,g[l],s),l="checked",p!=null&&p!=e[l]&&Cr(e,l,p,g[l],s))}return e}function Ci(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(s){q.__e(s,r)}}function Cc(e,t,r){var n,s;if(q.unmount&&q.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||Ci(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){q.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(s=0;s<n.length;s++)n[s]&&Cc(n[s],t,r||typeof e.type!="function");r||Si(e.__e),e.__c=e.__=e.__e=void 0}function wd(e,t,r){return this.constructor(e,r)}function Rc(e,t,r){var n,s,i,o;t==document&&(t=document.documentElement),q.__&&q.__(e,t),s=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],o=[],ki(t,e=(!n&&r||t).__k=oi(ur,null,[e]),s||Qt,Qt,t.namespaceURI,!n&&r?[r]:s?null:t.firstChild?cr.call(t.childNodes):null,i,!n&&r?r:s?s.__e:t.firstChild,n,o),Sc(i,e,o)}function Ic(e,t){Rc(e,t,Ic)}function vd(e,t,r){var n,s,i,o,a=Oe({},e.props);for(i in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)i=="key"?n=t[i]:i=="ref"?s=t[i]:a[i]=t[i]===void 0&&o!=null?o[i]:t[i];return arguments.length>2&&(a.children=arguments.length>3?cr.call(arguments,2):r),qt(e.type,a,n||e.key,s||e.ref,null)}function Ed(e){function t(r){var n,s;return this.getChildContext||(n=new Set,(s={})[t.__c]=this,this.getChildContext=function(){return s},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&n.forEach(function(o){o.__e=!0,ai(o)})},this.sub=function(i){n.add(i);var o=i.componentWillUnmount;i.componentWillUnmount=function(){n&&n.delete(i),o&&o.call(i)}}),r.children}return t.__c="__cC"+mc++,t.__=e,t.Provider=t.__l=(t.Consumer=function(r,n){return r.children(n)}).contextType=t,t}cr=bc.slice,q={__e:function(e,t,r,n){for(var s,i,o;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(e)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,n||{}),o=s.__d),o)return s.__E=s}catch(a){e=a}throw e}},hc=0,fc=function(e){return e!=null&&e.constructor==null},Jt.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Oe({},this.state),typeof e=="function"&&(e=e(Oe({},r),this.props)),e&&Oe(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),ai(this))},Jt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ai(this))},Jt.prototype.render=ur,tt=[],pc=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,gc=function(e,t){return e.__v.__b-t.__v.__b},Hr.__r=0,_c=/(PointerCapture)$|Capture$/i,Ei=0,si=Ho(!1),ii=Ho(!0),mc=0;const Sd=Object.freeze(Object.defineProperty({__proto__:null,Component:Jt,Fragment:ur,cloneElement:vd,createContext:Ed,createElement:oi,createRef:_d,h:oi,hydrate:Ic,get isValidElement(){return fc},get options(){return q},render:Rc,toChildArray:Ec},Symbol.toStringTag,{value:"Module"})),pe=Gr(Sd);var an={},Ue,V,Fs,Uo,At=0,Ac=[],X=q,Vo=X.__b,Wo=X.__r,zo=X.diffed,qo=X.__c,Jo=X.unmount,Go=X.__;function ut(e,t){X.__h&&X.__h(V,e,At||t),At=0;var r=V.__H||(V.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Nc(e){return At=1,Lc(Tc,e)}function Lc(e,t,r){var n=ut(Ue++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Tc(void 0,t),function(a){var c=n.__N?n.__N[0]:n.__[0],l=n.t(c,a);c!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=V,!V.__f)){var s=function(a,c,l){if(!n.__c.__H)return!0;var u=n.__c.__H.__.filter(function(h){return!!h.__c});if(u.every(function(h){return!h.__N}))return!i||i.call(this,a,c,l);var d=n.__c.props!==a;return u.forEach(function(h){if(h.__N){var f=h.__[0];h.__=h.__N,h.__N=void 0,f!==h.__[0]&&(d=!0)}}),i&&i.call(this,a,c,l)||d};V.__f=!0;var i=V.shouldComponentUpdate,o=V.componentWillUpdate;V.componentWillUpdate=function(a,c,l){if(this.__e){var u=i;i=void 0,s(a,c,l),i=u}o&&o.call(this,a,c,l)},V.shouldComponentUpdate=s}return n.__N||n.__}function kd(e,t){var r=ut(Ue++,3);!X.__s&&Ii(r.__H,t)&&(r.__=e,r.u=t,V.__H.__h.push(r))}function Mc(e,t){var r=ut(Ue++,4);!X.__s&&Ii(r.__H,t)&&(r.__=e,r.u=t,V.__h.push(r))}function Cd(e){return At=5,Ri(function(){return{current:e}},[])}function Rd(e,t,r){At=6,Mc(function(){if(typeof e=="function"){var n=e(t());return function(){e(null),n&&typeof n=="function"&&n()}}if(e)return e.current=t(),function(){return e.current=null}},r==null?r:r.concat(e))}function Ri(e,t){var r=ut(Ue++,7);return Ii(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Id(e,t){return At=8,Ri(function(){return e},t)}function Ad(e){var t=V.context[e.__c],r=ut(Ue++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(V)),t.props.value):e.__}function Nd(e,t){X.useDebugValue&&X.useDebugValue(t?t(e):e)}function Ld(e){var t=ut(Ue++,10),r=Nc();return t.__=e,V.componentDidCatch||(V.componentDidCatch=function(n,s){t.__&&t.__(n,s),r[1](n)}),[r[0],function(){r[1](void 0)}]}function Md(){var e=ut(Ue++,11);if(!e.__){for(var t=V.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function Td(){for(var e;e=Ac.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Br),e.__H.__h.forEach(li),e.__H.__h=[]}catch(t){e.__H.__h=[],X.__e(t,e.__v)}}X.__b=function(e){V=null,Vo&&Vo(e)},X.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Go&&Go(e,t)},X.__r=function(e){Wo&&Wo(e),Ue=0;var t=(V=e.__c).__H;t&&(Fs===V?(t.__h=[],V.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Br),t.__h.forEach(li),t.__h=[],Ue=0)),Fs=V},X.diffed=function(e){zo&&zo(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ac.push(t)!==1&&Uo===X.requestAnimationFrame||((Uo=X.requestAnimationFrame)||Pd)(Td)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Fs=V=null},X.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Br),r.__h=r.__h.filter(function(n){return!n.__||li(n)})}catch(n){t.some(function(s){s.__h&&(s.__h=[])}),t=[],X.__e(n,r.__v)}}),qo&&qo(e,t)},X.unmount=function(e){Jo&&Jo(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Br(n)}catch(s){t=s}}),r.__H=void 0,t&&X.__e(t,r.__v))};var Zo=typeof requestAnimationFrame=="function";function Pd(e){var t,r=function(){clearTimeout(n),Zo&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);Zo&&(t=requestAnimationFrame(r))}function Br(e){var t=V,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),V=t}function li(e){var t=V;e.__c=e.__(),V=t}function Ii(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Tc(e,t){return typeof t=="function"?t(e):t}const $d=Object.freeze(Object.defineProperty({__proto__:null,useCallback:Id,useContext:Ad,useDebugValue:Nd,useEffect:kd,useErrorBoundary:Ld,useId:Md,useImperativeHandle:Rd,useLayoutEffect:Mc,useMemo:Ri,useReducer:Lc,useRef:Cd,useState:Nc},Symbol.toStringTag,{value:"Module"})),cn=Gr($d);var Nt={},ln={};Object.defineProperty(ln,"__esModule",{value:!0});ln.CloseIcon=void 0;const Qo=pe;function Od(e){return(0,Qo.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Qo.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}ln.CloseIcon=Od;var un={};Object.defineProperty(un,"__esModule",{value:!0});un.CoinbaseWalletRound=void 0;const Rr=pe;function xd(e){return(0,Rr.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Rr.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,Rr.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,Rr.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}un.CoinbaseWalletRound=xd;var dn={};Object.defineProperty(dn,"__esModule",{value:!0});dn.QRCodeIcon=void 0;const Ut=pe;function Fd(e){return(0,Ut.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ut.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,Ut.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,Ut.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,Ut.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}dn.QRCodeIcon=Fd;var hn={};function Pc(e){this.mode=me.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],s=this.data.charCodeAt(t);s>65536?(n[0]=240|(s&1835008)>>>18,n[1]=128|(s&258048)>>>12,n[2]=128|(s&4032)>>>6,n[3]=128|s&63):s>2048?(n[0]=224|(s&61440)>>>12,n[1]=128|(s&4032)>>>6,n[2]=128|s&63):s>128?(n[0]=192|(s&1984)>>>6,n[1]=128|s&63):n[0]=s,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Pc.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function xe(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}xe.prototype={addData:function(e){var t=new Pc(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=xe.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=K.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),s=1;this.make();for(var i=0;i<this.modules.length;i++)for(var o=i*s,a=0;a<this.modules[i].length;a++){var c=a*s,l=this.modules[i][a];l&&(n.beginFill(0,100),n.moveTo(c,o),n.lineTo(c+s,o),n.lineTo(c+s,o+s),n.lineTo(c,o+s),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=K.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],s=e[r];if(this.modules[n][s]==null)for(var i=-2;i<=2;i++)for(var o=-2;o<=2;o++)i==-2||i==2||o==-2||o==2||i==0&&o==0?this.modules[n+i][s+o]=!0:this.modules[n+i][s+o]=!1}},setupTypeNumber:function(e){for(var t=K.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=K.getBCHTypeInfo(r),s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<6?this.modules[s][8]=i:s<8?this.modules[s+1][8]=i:this.modules[this.moduleCount-15+s][8]=i}for(var s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=i:s<9?this.modules[8][15-s-1+1]=i:this.modules[8][15-s-1]=i}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,s=7,i=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[n][o-a]==null){var c=!1;i<e.length&&(c=(e[i]>>>s&1)==1);var l=K.getMask(t,n,o-a);l&&(c=!c),this.modules[n][o-a]=c,s--,s==-1&&(i++,s=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};xe.PAD0=236;xe.PAD1=17;xe.createData=function(e,t,r){for(var n=$e.getRSBlocks(e,t),s=new $c,i=0;i<r.length;i++){var o=r[i];s.put(o.mode,4),s.put(o.getLength(),K.getLengthInBits(o.mode,e)),o.write(s)}for(var a=0,i=0;i<n.length;i++)a+=n[i].dataCount;if(s.getLengthInBits()>a*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+a*8+")");for(s.getLengthInBits()+4<=a*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=a*8||(s.put(xe.PAD0,8),s.getLengthInBits()>=a*8));)s.put(xe.PAD1,8);return xe.createBytes(s,n)};xe.createBytes=function(e,t){for(var r=0,n=0,s=0,i=new Array(t.length),o=new Array(t.length),a=0;a<t.length;a++){var c=t[a].dataCount,l=t[a].totalCount-c;n=Math.max(n,c),s=Math.max(s,l),i[a]=new Array(c);for(var u=0;u<i[a].length;u++)i[a][u]=255&e.buffer[u+r];r+=c;var d=K.getErrorCorrectPolynomial(l),h=new vt(i[a],d.getLength()-1),f=h.mod(d);o[a]=new Array(d.getLength()-1);for(var u=0;u<o[a].length;u++){var _=u+f.getLength()-o[a].length;o[a][u]=_>=0?f.get(_):0}}for(var p=0,u=0;u<t.length;u++)p+=t[u].totalCount;for(var g=new Array(p),b=0,u=0;u<n;u++)for(var a=0;a<t.length;a++)u<i[a].length&&(g[b++]=i[a][u]);for(var u=0;u<s;u++)for(var a=0;a<t.length;a++)u<o[a].length&&(g[b++]=o[a][u]);return g};var me={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Je={L:1,M:0,Q:3,H:2},We={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},K={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;K.getBCHDigit(t)-K.getBCHDigit(K.G15)>=0;)t^=K.G15<<K.getBCHDigit(t)-K.getBCHDigit(K.G15);return(e<<10|t)^K.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;K.getBCHDigit(t)-K.getBCHDigit(K.G18)>=0;)t^=K.G18<<K.getBCHDigit(t)-K.getBCHDigit(K.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return K.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case We.PATTERN000:return(t+r)%2==0;case We.PATTERN001:return t%2==0;case We.PATTERN010:return r%3==0;case We.PATTERN011:return(t+r)%3==0;case We.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case We.PATTERN101:return t*r%2+t*r%3==0;case We.PATTERN110:return(t*r%2+t*r%3)%2==0;case We.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new vt([1],0),r=0;r<e;r++)t=t.multiply(new vt([1,ie.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case me.MODE_NUMBER:return 10;case me.MODE_ALPHA_NUM:return 9;case me.MODE_8BIT_BYTE:return 8;case me.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case me.MODE_NUMBER:return 12;case me.MODE_ALPHA_NUM:return 11;case me.MODE_8BIT_BYTE:return 16;case me.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case me.MODE_NUMBER:return 14;case me.MODE_ALPHA_NUM:return 13;case me.MODE_8BIT_BYTE:return 16;case me.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var s=0;s<t;s++){for(var i=0,o=e.isDark(n,s),a=-1;a<=1;a++)if(!(n+a<0||t<=n+a))for(var c=-1;c<=1;c++)s+c<0||t<=s+c||a==0&&c==0||o==e.isDark(n+a,s+c)&&i++;i>5&&(r+=3+i-5)}for(var n=0;n<t-1;n++)for(var s=0;s<t-1;s++){var l=0;e.isDark(n,s)&&l++,e.isDark(n+1,s)&&l++,e.isDark(n,s+1)&&l++,e.isDark(n+1,s+1)&&l++,(l==0||l==4)&&(r+=3)}for(var n=0;n<t;n++)for(var s=0;s<t-6;s++)e.isDark(n,s)&&!e.isDark(n,s+1)&&e.isDark(n,s+2)&&e.isDark(n,s+3)&&e.isDark(n,s+4)&&!e.isDark(n,s+5)&&e.isDark(n,s+6)&&(r+=40);for(var s=0;s<t;s++)for(var n=0;n<t-6;n++)e.isDark(n,s)&&!e.isDark(n+1,s)&&e.isDark(n+2,s)&&e.isDark(n+3,s)&&e.isDark(n+4,s)&&!e.isDark(n+5,s)&&e.isDark(n+6,s)&&(r+=40);for(var u=0,s=0;s<t;s++)for(var n=0;n<t;n++)e.isDark(n,s)&&u++;var d=Math.abs(100*u/t/t-50)/5;return r+=d*10,r}},ie={glog:function(e){if(e<1)throw new Error("glog("+e+")");return ie.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return ie.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var ae=0;ae<8;ae++)ie.EXP_TABLE[ae]=1<<ae;for(var ae=8;ae<256;ae++)ie.EXP_TABLE[ae]=ie.EXP_TABLE[ae-4]^ie.EXP_TABLE[ae-5]^ie.EXP_TABLE[ae-6]^ie.EXP_TABLE[ae-8];for(var ae=0;ae<255;ae++)ie.LOG_TABLE[ie.EXP_TABLE[ae]]=ae;function vt(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}vt.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=ie.gexp(ie.glog(this.get(r))+ie.glog(e.get(n)));return new vt(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=ie.glog(this.get(0))-ie.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=ie.gexp(ie.glog(e.get(n))+t);return new vt(r,0).mod(e)}};function $e(e,t){this.totalCount=e,this.dataCount=t}$e.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];$e.getRSBlocks=function(e,t){var r=$e.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,s=[],i=0;i<n;i++)for(var o=r[i*3+0],a=r[i*3+1],c=r[i*3+2],l=0;l<o;l++)s.push(new $e(a,c));return s};$e.getRsBlockTable=function(e,t){switch(t){case Je.L:return $e.RS_BLOCK_TABLE[(e-1)*4+0];case Je.M:return $e.RS_BLOCK_TABLE[(e-1)*4+1];case Je.Q:return $e.RS_BLOCK_TABLE[(e-1)*4+2];case Je.H:return $e.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function $c(){this.buffer=[],this.length=0}$c.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var js=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Oc(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(c){switch(c){case"L":return Je.L;case"M":return Je.M;case"Q":return Je.Q;case"H":return Je.H;default:throw new Error("Unknwon error correction level: "+c)}}function n(c,l){for(var u=s(c),d=1,h=0,f=0,_=js.length;f<=_;f++){var p=js[f];if(!p)throw new Error("Content too long: expected "+h+" but got "+u);switch(l){case"L":h=p[0];break;case"M":h=p[1];break;case"Q":h=p[2];break;case"H":h=p[3];break;default:throw new Error("Unknwon error correction level: "+l)}if(u<=h)break;d++}if(d>js.length)throw new Error("Content too long");return d}function s(c){var l=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return l.length+(l.length!=c?3:0)}var i=this.options.content,o=n(i,this.options.ecl),a=r(this.options.ecl);this.qrcode=new xe(o,a),this.qrcode.addData(i),this.qrcode.make()}Oc.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,s=n?" ":"",i=n?`\r
2
+ `:"",o=t.width,a=t.height,c=r.length,l=o/(c+2*t.padding),u=a/(c+2*t.padding),d=typeof t.join<"u"?!!t.join:!1,h=typeof t.swap<"u"?!!t.swap:!1,f=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,_=typeof t.predefined<"u"?!!t.predefined:!1,p=_?s+'<defs><path id="qrmodule" d="M0 0 h'+u+" v"+l+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+i:"",g=s+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+i,b="",y="",m=0;m<c;m++)for(var I=0;I<c;I++){var v=r[I][m];if(v){var A=I*l+t.padding*l,H=m*u+t.padding*u;if(h){var G=A;A=H,H=G}if(d){var ee=l+A,J=u+H;A=Number.isInteger(A)?Number(A):A.toFixed(2),H=Number.isInteger(H)?Number(H):H.toFixed(2),ee=Number.isInteger(ee)?Number(ee):ee.toFixed(2),J=Number.isInteger(J)?Number(J):J.toFixed(2),y+="M"+A+","+H+" V"+J+" H"+ee+" V"+H+" H"+A+" Z "}else _?b+=s+'<use x="'+A.toString()+'" y="'+H.toString()+'" href="#qrmodule" />'+i:b+=s+'<rect x="'+A.toString()+'" y="'+H.toString()+'" width="'+l+'" height="'+u+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+i}}d&&(b=s+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+y+'" />');let W="";if(this.options.image!==void 0&&this.options.image.svg){const Qe=o*this.options.image.width/100,E=a*this.options.image.height/100,w=o/2-Qe/2,R=a/2-E/2;W+=`<svg x="${w}" y="${R}" width="${Qe}" height="${E}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,W+=this.options.image.svg+i,W+="</svg>"}var U="";switch(e.container){case"svg":f&&(U+='<?xml version="1.0" standalone="yes"?>'+i),U+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+i,U+=p+g+b,U+=W,U+="</svg>";break;case"svg-viewbox":f&&(U+='<?xml version="1.0" standalone="yes"?>'+i),U+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+i,U+=p+g+b,U+=W,U+="</svg>";break;case"g":U+='<g width="'+o+'" height="'+a+'">'+i,U+=p+g+b,U+=W,U+="</g>";break;default:U+=(p+g+b+W).replace(/^\s+/,"");break}return U};var jd=Oc,Bd=L&&L.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hn,"__esModule",{value:!0});hn.QRCode=void 0;const Dd=pe,Ko=cn,Hd=Bd(jd),Ud=e=>{const[t,r]=(0,Ko.useState)("");return(0,Ko.useEffect)(()=>{var n,s;const i=new Hd.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(s=e.height)!==null&&s!==void 0?s:256,padding:0,image:e.image}),o=O.from(i.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,Dd.h)("img",{src:t,alt:"QR Code"}):null};hn.QRCode=Ud;var fn={},Ai={};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.default=(()=>".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}")();var Vd=L&&L.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fn,"__esModule",{value:!0});fn.Spinner=void 0;const Ir=pe,Wd=Vd(Ai),zd=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,Ir.h)("div",{class:"-cbwsdk-spinner"},(0,Ir.h)("style",null,Wd.default),(0,Ir.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,Ir.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};fn.Spinner=zd;var Ni={};Object.defineProperty(Ni,"__esModule",{value:!0});Ni.default=(()=>".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}")();var xc=L&&L.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.CoinbaseWalletSteps=Nt.ConnectContent=void 0;const ot=xc(Yt),j=pe,qd=S,Jd=Ot,Gd=ln,Zd=un,Qd=dn,Kd=hn,Xd=fn,Yd=xc(Ni),Bs={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Fc},eh=e=>e==="light"?"#FFFFFF":"#0A0B0D";function th(e){const{theme:t}=e,r=(0,qd.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=Bs.steps;return(0,j.h)("div",{"data-testid":"connect-content",className:(0,ot.default)("-cbwsdk-connect-content",t)},(0,j.h)("style",null,Yd.default),(0,j.h)("div",{className:"-cbwsdk-connect-content-header"},(0,j.h)("h2",{className:(0,ot.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,j.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,j.h)(Gd.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,j.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,j.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,j.h)(rh,{title:Bs.title,description:Bs.description,theme:t})),(0,j.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,j.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,j.h)(Kd.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,j.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Jd.LIB_VERSION}),(0,j.h)("input",{type:"hidden",value:r})),(0,j.h)(n,{theme:t}),!e.isConnected&&(0,j.h)("div",{"data-testid":"connecting-spinner",className:(0,ot.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,j.h)(Xd.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,j.h)("p",null,"Connecting...")))))}Nt.ConnectContent=th;function rh({title:e,description:t,theme:r}){return(0,j.h)("div",{className:(0,ot.default)("-cbwsdk-connect-item",r)},(0,j.h)("div",null,(0,j.h)(Zd.CoinbaseWalletRound,null)),(0,j.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,j.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,j.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function Fc({theme:e}){return(0,j.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,j.h)("li",{className:(0,ot.default)("-cbwsdk-wallet-steps-item",e)},(0,j.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,j.h)("li",{className:(0,ot.default)("-cbwsdk-wallet-steps-item",e)},(0,j.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,j.h)("span",null,"Tap ",(0,j.h)("strong",null,"Scan")," "),(0,j.h)("span",{className:(0,ot.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,j.h)(Qd.QRCodeIcon,{fill:eh(e)})))))}Nt.CoinbaseWalletSteps=Fc;var pn={},gn={};Object.defineProperty(gn,"__esModule",{value:!0});gn.ArrowLeftIcon=void 0;const Xo=pe;function nh(e){return(0,Xo.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,Xo.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}gn.ArrowLeftIcon=nh;var _n={};Object.defineProperty(_n,"__esModule",{value:!0});_n.LaptopIcon=void 0;const Ds=pe;function sh(e){return(0,Ds.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ds.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Ds.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}_n.LaptopIcon=sh;var mn={};Object.defineProperty(mn,"__esModule",{value:!0});mn.SafeIcon=void 0;const Yo=pe;function ih(e){return(0,Yo.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Yo.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}mn.SafeIcon=ih;var Li={};Object.defineProperty(Li,"__esModule",{value:!0});Li.default=(()=>".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}")();var jc=L&&L.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pn,"__esModule",{value:!0});pn.TryExtensionContent=void 0;const Ke=jc(Yt),re=pe,Hs=cn,oh=gn,ah=_n,ch=mn,lh=jc(Li);function uh({theme:e}){const[t,r]=(0,Hs.useState)(!1),n=(0,Hs.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),s=(0,Hs.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,re.h)("div",{class:(0,Ke.default)("-cbwsdk-try-extension",e)},(0,re.h)("style",null,lh.default),(0,re.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,re.h)("h3",{class:(0,Ke.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,re.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,re.h)("button",{class:(0,Ke.default)("-cbwsdk-try-extension-cta",e),onClick:s},t?"Refresh":"Install"),(0,re.h)("div",null,!t&&(0,re.h)(oh.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,re.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,re.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,re.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,re.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,re.h)("span",{class:(0,Ke.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,re.h)(ah.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,re.h)("div",{class:(0,Ke.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,re.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,re.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,re.h)("span",{class:(0,Ke.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,re.h)(ch.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,re.h)("div",{class:(0,Ke.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}pn.TryExtensionContent=uh;var Mi={};Object.defineProperty(Mi,"__esModule",{value:!0});Mi.default=(()=>".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}")();var Bc=L&&L.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(an,"__esModule",{value:!0});an.ConnectDialog=void 0;const Us=Bc(Yt),Xe=pe,Vs=cn,dh=Nt,hh=pn,fh=Bc(Mi),ph=e=>{const{isOpen:t,darkMode:r}=e,[n,s]=(0,Vs.useState)(!t),[i,o]=(0,Vs.useState)(!t);(0,Vs.useEffect)(()=>{const c=[window.setTimeout(()=>{o(!t)},10)];return t?s(!1):c.push(window.setTimeout(()=>{s(!0)},360)),()=>{c.forEach(window.clearTimeout)}},[t]);const a=r?"dark":"light";return(0,Xe.h)("div",{class:(0,Us.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,Xe.h)("style",null,fh.default),(0,Xe.h)("div",{class:(0,Us.default)("-cbwsdk-connect-dialog-backdrop",a,i&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,Xe.h)("div",{class:"-cbwsdk-connect-dialog"},(0,Xe.h)("div",{class:(0,Us.default)("-cbwsdk-connect-dialog-box",i&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,Xe.h)(dh.ConnectContent,{theme:a,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,Xe.h)(hh.TryExtensionContent,{theme:a}))))};an.ConnectDialog=ph;Object.defineProperty(on,"__esModule",{value:!0});on.LinkFlow=void 0;const Ws=pe,gh=an;class _h{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,Ws.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,Ws.render)((0,Ws.h)(gh.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}on.LinkFlow=_h;var Ti={},Pi={};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.default=(()=>".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}")();(function(e){var t=L&&L.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(Yt),n=pe,s=cn,i=t(Pi),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class c{constructor(h){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=h.darkMode}attach(h){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",h.appendChild(this.root),this.render()}presentItem(h){const f=this.nextItemKey++;return this.items.set(f,h),this.render(),()=>{this.items.delete(f),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([h,f])=>(0,n.h)(e.SnackbarInstance,Object.assign({},f,{key:h}))))),this.root)}}e.Snackbar=c;const l=d=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,i.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},d.children));e.SnackbarContainer=l;const u=({autoExpand:d,message:h,menuItems:f})=>{const[_,p]=(0,s.useState)(!0),[g,b]=(0,s.useState)(d??!1);(0,s.useEffect)(()=>{const m=[window.setTimeout(()=>{p(!1)},1),window.setTimeout(()=>{b(!0)},1e4)];return()=>{m.forEach(window.clearTimeout)}});const y=()=>{b(!g)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",_&&"-cbwsdk-snackbar-instance-hidden",g&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:y},(0,n.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},h),(0,n.h)("div",{class:"-gear-container"},!g&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:a,class:"-gear-icon",title:"Expand"}))),f&&f.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},f.map((m,I)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",m.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:m.onClick,key:I},(0,n.h)("svg",{width:m.svgWidth,height:m.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":m.defaultFillRule,"clip-rule":m.defaultClipRule,d:m.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",m.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},m.info)))))};e.SnackbarInstance=u})(Ti);Object.defineProperty(or,"__esModule",{value:!0});or.WalletLinkRelayUI=void 0;const mh=ar,bh=on,yh=Ti;class wh{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new yh.Snackbar({darkMode:t.darkMode}),this.linkFlow=new bh.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,mh.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}or.WalletLinkRelayUI=wh;Object.defineProperty(ir,"__esModule",{value:!0});ir.WalletLinkRelay=void 0;const _t=er,vh=ne,Q=S,Ye=xt,ea=Ee,ze=Ft,Eh=rn,et=$t,Sh=or;class De extends ea.RelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=o=>{var a;this.isLinked=o;const c=this.storage.getItem(ea.LOCAL_STORAGE_ADDRESSES_KEY);if(o&&(this.session.linked=o),this.isUnlinkedErrorState=!1,c){const l=c.split(" "),u=this.storage.getItem("IsStandaloneSigning")==="true";if(l[0]!==""&&!o&&this.session.linked&&!u){this.isUnlinkedErrorState=!0;const d=this.getSessionIdHash();(a=this.diagnostic)===null||a===void 0||a.log(Ye.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:d})}}},this.metadataUpdated=(o,a)=>{this.storage.setItem(o,a)},this.chainUpdated=(o,a)=>{this.chainCallbackParams.chainId===o&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:o,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(o,a))},this.accountUpdated=o=>{this.accountsCallback&&this.accountsCallback([o]),De.accountRequestCallbackIds.size>0&&(Array.from(De.accountRequestCallbackIds.values()).forEach(a=>{const c={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[o]}};this.invokeCallback(Object.assign(Object.assign({},c),{id:a}))}),De.accountRequestCallbackIds.clear())},this.connectedUpdated=o=>{this.ui.setConnected(o)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:s,connection:i}=this.subscribe();this._session=n,this.connection=i,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=s}subscribe(){const t=ze.Session.load(this.storage)||new ze.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,s=new Eh.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:i,darkMode:o}=this.options,a=this.options.uiConstructor({linkAPIUrl:r,version:i,darkMode:o,session:t});return s.connect(),{session:t,ui:a,connection:s}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(Ye.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const s=ze.Session.load(this.storage);if((s==null?void 0:s.id)===this._session.id?this.storage.clear():s&&((r=this.diagnostic)===null||r===void 0||r.log(Ye.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:ze.Session.hash(s.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:i,ui:o,connection:a}=this.subscribe();this._session=i,this.connection=a,this.ui=o,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(Ye.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,s){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,Q.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:s||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Q.hexStringFromBuffer)(t,!0),signature:(0,Q.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Q.bigIntStringFromBN)(t.weiValue),data:(0,Q.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Q.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,Q.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,Q.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,Q.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Q.bigIntStringFromBN)(t.weiValue),data:(0,Q.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Q.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,Q.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Q.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,Q.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Q.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,Q.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,Q.randomBytesHex)(8),s=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,o),r==null||r()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,c=>{if(r==null||r(),(0,et.isErrorResponse)(c))return a(new Error(c.errorMessage));o(c)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:s}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof Sh.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const s={type:"WEB3_REQUEST",id:t,request:r},i=ze.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(Ye.EVENTS.WEB3_REQUEST,{eventId:s.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?ze.Session.hash(i.id):"",isSessionMismatched:((i==null?void 0:i.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",s,!0).then(o=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(Ye.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:s.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?ze.Session.hash(i.id):"",isSessionMismatched:((i==null?void 0:i.id)!==this._session.id).toString()})}).catch(o=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s.id,response:{method:r.method,errorMessage:o.message}})})}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(Ye.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){De.accountRequestCallbackIds.forEach(s=>this.invokeCallback(Object.assign(Object.assign({},t),{id:s}))),De.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,s){var i;const o=(i=n==null?void 0:n.message)!==null&&i!==void 0?i:(0,_t.getMessageFromCode)(s);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:o,errorCode:s}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,Q.randomBytesHex)(8),n=i=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,i)};return{promise:new Promise((i,o)=>{if(this.relayEventManager.callbacks.set(r,a=>{if(this.ui.hideRequestEthereumAccounts(),(0,et.isErrorResponse)(a))return o(new Error(a.errorMessage));i(a)}),this.ui.inlineAccountsResponse()){const a=c=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:c}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:a})}else{const a=_t.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(a)})}De.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider",params:{providerOptions:t}},n=(0,Q.randomBytesHex)(8),s=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},i=new Promise((o,a)=>{this.relayEventManager.callbacks.set(n,u=>{if((0,et.isErrorResponse)(u))return a(new Error(u.errorMessage));o(u)});const c=u=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:vh.ProviderType.Unselected}})},l=u=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:u}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:l,onCancel:c,providerOptions:t})});return{cancel:s,promise:i}}watchAsset(t,r,n,s,i,o){const a={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:s,image:i},chainId:o}};let c=null;const l=(0,Q.randomBytesHex)(8),u=h=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,h),c==null||c()};this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}));const d=new Promise((h,f)=>{this.relayEventManager.callbacks.set(l,g=>{if(c==null||c(),(0,et.isErrorResponse)(g))return f(new Error(g.errorMessage));h(g)});const _=g=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!1}})},p=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:p,onCancel:_,type:t,address:r,symbol:n,decimals:s,image:i,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)});return{cancel:u,promise:d}}addEthereumChain(t,r,n,s,i,o){const a={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:s,chainName:i,iconUrls:n,nativeCurrency:o}};let c=null;const l=(0,Q.randomBytesHex)(8),u=h=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,h),c==null||c()};return this.ui.inlineAddEthereumChain(t)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload})),{promise:new Promise((h,f)=>{this.relayEventManager.callbacks.set(l,g=>{if(c==null||c(),(0,et.isErrorResponse)(g))return f(new Error(g.errorMessage));h(g)});const _=g=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},p=g=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:g}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:_,onApprove:p,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)}),cancel:u}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},s=(0,Q.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,n.method,a)};return{promise:new Promise((a,c)=>{this.relayEventManager.callbacks.set(s,d=>{if((0,et.isErrorResponse)(d)&&d.errorCode)return c(_t.standardErrors.provider.custom({code:d.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,et.isErrorResponse)(d))return c(new Error(d.errorMessage));a(d)});const l=d=>{var h;if(d){const f=(h=(0,_t.getErrorCode)(d))!==null&&h!==void 0?h:_t.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(s,"switchEthereumChain",d instanceof Error?d:_t.standardErrors.provider.unsupportedChain(t),f)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},u=d=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:d}}})};this.ui.switchEthereumChain({onCancel:l,onApprove:u,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(s,n)}),cancel:i}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return ze.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=i=>{this.handleErrorResponse(t,r.method,i)},s=i=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:i})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:s,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:s,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:s,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:s});break;default:n();break}}}ir.WalletLinkRelay=De;De.accountRequestCallbackIds=new Set;var dr={},bn={},Dc={};(function(e){var t=L&&L.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,o,a)}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=L&&L.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ti,e)})(Dc);var $i={};Object.defineProperty($i,"__esModule",{value:!0});$i.default=(()=>".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}")();var Hc=L&&L.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bn,"__esModule",{value:!0});bn.RedirectDialog=void 0;const kh=Hc(Yt),Pe=pe,Ch=ar,Rh=Dc,Ih=Hc($i);class Ah{constructor(){this.root=null}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,Ch.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,Pe.render)(null,this.root),t&&(0,Pe.render)((0,Pe.h)(Nh,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}bn.RedirectDialog=Ah;const Nh=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:s})=>{const i=r?"dark":"light";return(0,Pe.h)(Rh.SnackbarContainer,{darkMode:r},(0,Pe.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Pe.h)("style",null,Ih.default),(0,Pe.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:s}),(0,Pe.h)("div",{class:(0,kh.default)("-cbwsdk-redirect-dialog-box",i)},(0,Pe.h)("p",null,e),(0,Pe.h)("button",{onClick:n},t))))};Object.defineProperty(dr,"__esModule",{value:!0});dr.MobileRelayUI=void 0;const Lh=bn;class Mh{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new Lh.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}redirectToCoinbaseWallet(t){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),t&&r.searchParams.append("wl_url",t);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}dr.MobileRelayUI=Mh;Object.defineProperty(sr,"__esModule",{value:!0});sr.MobileRelay=void 0;const Th=S,Ph=ir,$h=dr;class Oh extends Ph.WalletLinkRelay{constructor(t){var r;super(t),this._enableMobileWalletLink=(r=t.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,Th.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(t,r){if(super.publishWeb3RequestEvent(t,r),!(this._enableMobileWalletLink&&this.ui instanceof $h.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(t){super.handleWeb3ResponseMessage(t)}connectAndSignIn(t){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}sr.MobileRelay=Oh;const{Transform:xh}=Ka;var Fh=e=>class Uc extends xh{constructor(r,n,s,i,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=s,this._hashBitLength=i,this._options=o,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,s){let i=null;try{this.update(r,n)}catch(o){i=o}s(i)}_flush(r){let n=null;try{this.push(this.digest())}catch(s){n=s}r(n)}update(r,n){if(!O.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return O.isBuffer(r)||(r=O.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Uc(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:jh}=Ka;var Bh=e=>class Vc extends jh{constructor(r,n,s,i){super(i),this._rate=r,this._capacity=n,this._delimitedSuffix=s,this._options=i,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,s){let i=null;try{this.update(r,n)}catch(o){i=o}s(i)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!O.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return O.isBuffer(r)||(r=O.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let s=this._state.squeeze(r);return n!==void 0&&(s=s.toString(n)),s}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Vc(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const Dh=Fh,Hh=Bh;var Uh=function(e){const t=Dh(e),r=Hh(e);return function(n,s){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,s);case"keccak256":return new t(1088,512,null,256,s);case"keccak384":return new t(832,768,null,384,s);case"keccak512":return new t(576,1024,null,512,s);case"sha3-224":return new t(1152,448,6,224,s);case"sha3-256":return new t(1088,512,6,256,s);case"sha3-384":return new t(832,768,6,384,s);case"sha3-512":return new t(576,1024,6,512,s);case"shake128":return new r(1344,256,31,s);case"shake256":return new r(1088,512,31,s);default:throw new Error("Invald algorithm: "+n)}}},Wc={};const ta=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];Wc.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],i=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],a=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],u=e[8]^e[18]^e[28]^e[38]^e[48],d=e[9]^e[19]^e[29]^e[39]^e[49];let h=u^(s<<1|i>>>31),f=d^(i<<1|s>>>31);const _=e[0]^h,p=e[1]^f,g=e[10]^h,b=e[11]^f,y=e[20]^h,m=e[21]^f,I=e[30]^h,v=e[31]^f,A=e[40]^h,H=e[41]^f;h=r^(o<<1|a>>>31),f=n^(a<<1|o>>>31);const G=e[2]^h,ee=e[3]^f,J=e[12]^h,W=e[13]^f,U=e[22]^h,Qe=e[23]^f,E=e[32]^h,w=e[33]^f,R=e[42]^h,k=e[43]^f;h=s^(c<<1|l>>>31),f=i^(l<<1|c>>>31);const N=e[4]^h,C=e[5]^f,T=e[14]^h,D=e[15]^f,$=e[24]^h,z=e[25]^f,le=e[34]^h,Z=e[35]^f,Ve=e[44]^h,co=e[45]^f;h=o^(u<<1|d>>>31),f=a^(d<<1|u>>>31);const lo=e[6]^h,uo=e[7]^f,ho=e[16]^h,fo=e[17]^f,po=e[26]^h,go=e[27]^f,_o=e[36]^h,mo=e[37]^f,bo=e[46]^h,yo=e[47]^f;h=c^(r<<1|n>>>31),f=l^(n<<1|r>>>31);const wo=e[8]^h,vo=e[9]^f,Eo=e[18]^h,So=e[19]^f,ko=e[28]^h,Co=e[29]^f,Ro=e[38]^h,Io=e[39]^f,Ao=e[48]^h,No=e[49]^f,Hn=_,Un=p,Vn=b<<4|g>>>28,Wn=g<<4|b>>>28,zn=y<<3|m>>>29,qn=m<<3|y>>>29,Jn=v<<9|I>>>23,Gn=I<<9|v>>>23,Zn=A<<18|H>>>14,Qn=H<<18|A>>>14,Kn=G<<1|ee>>>31,Xn=ee<<1|G>>>31,Yn=W<<12|J>>>20,es=J<<12|W>>>20,ts=U<<10|Qe>>>22,rs=Qe<<10|U>>>22,ns=w<<13|E>>>19,ss=E<<13|w>>>19,is=R<<2|k>>>30,os=k<<2|R>>>30,as=C<<30|N>>>2,cs=N<<30|C>>>2,ls=T<<6|D>>>26,us=D<<6|T>>>26,ds=z<<11|$>>>21,hs=$<<11|z>>>21,fs=le<<15|Z>>>17,ps=Z<<15|le>>>17,gs=co<<29|Ve>>>3,_s=Ve<<29|co>>>3,ms=lo<<28|uo>>>4,bs=uo<<28|lo>>>4,ys=fo<<23|ho>>>9,ws=ho<<23|fo>>>9,vs=po<<25|go>>>7,Es=go<<25|po>>>7,Ss=_o<<21|mo>>>11,ks=mo<<21|_o>>>11,Cs=yo<<24|bo>>>8,Rs=bo<<24|yo>>>8,Is=wo<<27|vo>>>5,As=vo<<27|wo>>>5,Ns=Eo<<20|So>>>12,Ls=So<<20|Eo>>>12,Ms=Co<<7|ko>>>25,Ts=ko<<7|Co>>>25,Ps=Ro<<8|Io>>>24,$s=Io<<8|Ro>>>24,Os=Ao<<14|No>>>18,xs=No<<14|Ao>>>18;e[0]=Hn^~Yn&ds,e[1]=Un^~es&hs,e[10]=ms^~Ns&zn,e[11]=bs^~Ls&qn,e[20]=Kn^~ls&vs,e[21]=Xn^~us&Es,e[30]=Is^~Vn&ts,e[31]=As^~Wn&rs,e[40]=as^~ys&Ms,e[41]=cs^~ws&Ts,e[2]=Yn^~ds&Ss,e[3]=es^~hs&ks,e[12]=Ns^~zn&ns,e[13]=Ls^~qn&ss,e[22]=ls^~vs&Ps,e[23]=us^~Es&$s,e[32]=Vn^~ts&fs,e[33]=Wn^~rs&ps,e[42]=ys^~Ms&Jn,e[43]=ws^~Ts&Gn,e[4]=ds^~Ss&Os,e[5]=hs^~ks&xs,e[14]=zn^~ns&gs,e[15]=qn^~ss&_s,e[24]=vs^~Ps&Zn,e[25]=Es^~$s&Qn,e[34]=ts^~fs&Cs,e[35]=rs^~ps&Rs,e[44]=Ms^~Jn&is,e[45]=Ts^~Gn&os,e[6]=Ss^~Os&Hn,e[7]=ks^~xs&Un,e[16]=ns^~gs&ms,e[17]=ss^~_s&bs,e[26]=Ps^~Zn&Kn,e[27]=$s^~Qn&Xn,e[36]=fs^~Cs&Is,e[37]=ps^~Rs&As,e[46]=Jn^~is&as,e[47]=Gn^~os&cs,e[8]=Os^~Hn&Yn,e[9]=xs^~Un&es,e[18]=gs^~ms&Ns,e[19]=_s^~bs&Ls,e[28]=Zn^~Kn&ls,e[29]=Qn^~Xn&us,e[38]=Cs^~Is&Vn,e[39]=Rs^~As&Wn,e[48]=is^~as&ys,e[49]=os^~cs&ws,e[0]^=ta[t*2],e[1]^=ta[t*2+1]}};const Ur=Wc;function jt(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}jt.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};jt.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(Ur.p1600(this.state),this.count=0)};jt.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&Ur.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),Ur.p1600(this.state),this.count=0,this.squeezing=!0};jt.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=O.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Ur.p1600(this.state),this.count=0);return t};jt.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var Vh=jt,Wh=Uh(Vh);const zh=Wh,qh=Jr;function zc(e){return O.allocUnsafe(e).fill(0)}function qc(e,t,r){const n=zc(t);return e=yn(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function Jh(e,t){return qc(e,t,!0)}function yn(e){if(!O.isBuffer(e))if(Array.isArray(e))e=O.from(e);else if(typeof e=="string")Jc(e)?e=O.from(Qh(Gc(e)),"hex"):e=O.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=O.allocUnsafe(0);else if(qh.isBN(e))e=e.toArrayLike(O);else if(e.toArray)e=O.from(e.toArray());else throw new Error("invalid type");return e}function Gh(e){return e=yn(e),"0x"+e.toString("hex")}function Zh(e,t){return e=yn(e),t||(t=256),zh("keccak"+t).update(e).digest()}function Qh(e){return e.length%2?"0"+e:e}function Jc(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function Gc(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var Zc={zeros:zc,setLength:qc,setLengthRight:Jh,isHexString:Jc,stripHexPrefix:Gc,toBuffer:yn,bufferToHex:Gh,keccak:Zh};const at=Zc,st=Jr;function Qc(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function Et(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function ra(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Kc(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function rt(e){var t=typeof e;if(t==="string")return at.isHexString(e)?new st(at.stripHexPrefix(e),16):new st(e,10);if(t==="number")return new st(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function Te(e,t){var r,n,s,i;if(e==="address")return Te("uint160",rt(t));if(e==="bool")return Te("uint8",t?1:0);if(e==="string")return Te("bytes",new O(t,"utf8"));if(Xh(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=Kc(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);s=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(i in t)s.push(Te(e,t[i]));if(r==="dynamic"){var o=Te("uint256",t.length);s.unshift(o)}return O.concat(s)}else{if(e==="bytes")return t=new O(t),s=O.concat([Te("uint256",t.length),t]),t.length%32!==0&&(s=O.concat([s,at.zeros(32-t.length%32)])),s;if(e.startsWith("bytes")){if(r=Et(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return at.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Et(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=rt(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(O,"be",32)}else if(e.startsWith("int")){if(r=Et(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=rt(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(O,"be",32)}else if(e.startsWith("ufixed")){if(r=ra(e),n=rt(t),n<0)throw new Error("Supplied ufixed is negative");return Te("uint256",n.mul(new st(2).pow(new st(r[1]))))}else if(e.startsWith("fixed"))return r=ra(e),Te("int256",rt(t).mul(new st(2).pow(new st(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function Kh(e){return e==="string"||e==="bytes"||Kc(e)==="dynamic"}function Xh(e){return e.lastIndexOf("]")===e.length-1}function Yh(e,t){var r=[],n=[],s=32*e.length;for(var i in e){var o=Qc(e[i]),a=t[i],c=Te(o,a);Kh(o)?(r.push(Te("uint256",s)),n.push(c),s+=c.length):r.push(c)}return O.concat(r.concat(n))}function Xc(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,s=[],i=0;i<e.length;i++){var o=Qc(e[i]),a=t[i];if(o==="bytes")s.push(a);else if(o==="string")s.push(new O(a,"utf8"));else if(o==="bool")s.push(new O(a?"01":"00","hex"));else if(o==="address")s.push(at.setLength(a,20));else if(o.startsWith("bytes")){if(r=Et(o),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);s.push(at.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=Et(o),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=rt(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());s.push(n.toArrayLike(O,"be",r/8))}else if(o.startsWith("int")){if(r=Et(o),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=rt(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());s.push(n.toTwos(r).toArrayLike(O,"be",r/8))}else throw new Error("Unsupported or invalid type: "+o)}return O.concat(s)}function ef(e,t){return at.keccak(Xc(e,t))}var tf={rawEncode:Yh,solidityPack:Xc,soliditySHA3:ef};const Re=Zc,Gt=tf,Yc={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},zs={encodeData(e,t,r,n=!0){const s=["bytes32"],i=[this.hashType(e,r)];if(n){const o=(a,c,l)=>{if(r[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Re.keccak(this.encodeData(c,l,r,n))];if(l===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",Re.keccak(l)];if(c==="string")return typeof l=="string"&&(l=O.from(l,"utf8")),["bytes32",Re.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const u=c.slice(0,c.lastIndexOf("[")),d=l.map(h=>o(a,u,h));return["bytes32",Re.keccak(Gt.rawEncode(d.map(([h])=>h),d.map(([,h])=>h)))]}return[c,l]};for(const a of r[e]){const[c,l]=o(a.name,a.type,t[a.name]);s.push(c),i.push(l)}}else for(const o of r[e]){let a=t[o.name];if(a!==void 0)if(o.type==="bytes")s.push("bytes32"),a=Re.keccak(a),i.push(a);else if(o.type==="string")s.push("bytes32"),typeof a=="string"&&(a=O.from(a,"utf8")),a=Re.keccak(a),i.push(a);else if(r[o.type]!==void 0)s.push("bytes32"),a=Re.keccak(this.encodeData(o.type,a,r,n)),i.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");s.push(o.type),i.push(a)}}return Gt.rawEncode(s,i)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(s=>s!==e);n=[e].concat(n.sort());for(const s of n){if(!t[s])throw new Error("No type definition specified: "+s);r+=s+"("+t[s].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const s of this.findTypeDependencies(n.type,t,r))!r.includes(s)&&r.push(s);return r},hashStruct(e,t,r,n=!0){return Re.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return Re.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in Yc.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[O.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),Re.keccak(O.concat(n))}};var rf={TYPED_MESSAGE_SCHEMA:Yc,TypedDataUtils:zs,hashForSignTypedDataLegacy:function(e){return nf(e.data)},hashForSignTypedData_v3:function(e){return zs.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return zs.hash(e.data)}};function nf(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(i){return i.type==="bytes"?Re.toBuffer(i.value):i.value}),n=e.map(function(i){return i.type}),s=e.map(function(i){if(!i.name)throw t;return i.type+" "+i.name});return Gt.soliditySHA3(["bytes32","bytes32"],[Gt.soliditySHA3(new Array(e.length).fill("string"),s),Gt.soliditySHA3(n,r)])}var Lt={};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.filterFromParam=Lt.FilterPolyfill=void 0;const yt=ne,de=S,sf=5*60*1e3,nt={jsonrpc:"2.0",id:0};class of{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,yt.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=el(t),n=this.makeFilterId(),s=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",s),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,de.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,de.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,de.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,de.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,de.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(Ar())}async getFilterLogs(t){const r=(0,de.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},nt),{method:"eth_getLogs",params:[na(n)]})):Ar()}makeFilterId(){return(0,yt.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(s,i)=>{if(s)return n(s);if(Array.isArray(i)||i==null)return n(new Error(`unexpected response received: ${JSON.stringify(i)}`));r(i)})})}deleteFilter(t){console.info(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return Ar();const s=await this.getCurrentBlockHeight(),i=r.toBlock==="latest"?s:r.toBlock;if(n>s||n>Number(r.toBlock))return Nr();console.info(`Fetching logs from ${n} to ${i} for filter ${t}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},nt),{method:"eth_getLogs",params:[na(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:i}))]}));if(Array.isArray(o.result)){const a=o.result.map(l=>(0,de.intNumberFromHexString)(l.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>n){const l=(0,yt.IntNumber)(c+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${l}`),this.cursors.set(t,l)}}return o}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return Ar();const n=await this.getCurrentBlockHeight();if(r>n)return Nr();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const s=(await Promise.all((0,de.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,yt.IntNumber)(o))))).filter(o=>!!o),i=(0,yt.IntNumber)(r+s.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${i}`),this.cursors.set(t,i),Object.assign(Object.assign({},nt),{result:s})}async getPendingTransactionFilterChanges(t){return Promise.resolve(Nr())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),s=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,s),s}setFilterTimeout(t){const r=this.timeouts.get(t);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${t}) timed out`),this.deleteFilter(t)},sf);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},nt),{method:"eth_blockNumber",params:[]}));return(0,de.intNumberFromHexString)((0,de.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},nt),{method:"eth_getBlockByNumber",params:[(0,de.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,de.ensureHexString)(r.result.hash):null}}Lt.FilterPolyfill=of;function el(e){return{fromBlock:sa(e.fromBlock),toBlock:sa(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}Lt.filterFromParam=el;function na(e){const t={fromBlock:ia(e.fromBlock),toBlock:ia(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function sa(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,yt.IntNumber)(0);if((0,de.isHexString)(e))return(0,de.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function ia(e){return e==="latest"?e:(0,de.hexStringFromIntNumber)(e)}function Ar(){return Object.assign(Object.assign({},nt),{error:{code:-32e3,message:"filter not found"}})}function Nr(){return Object.assign(Object.assign({},nt),{result:[]})}var wn={},tl={},vn={},Oi=af;function af(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const oa=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let s=0;s<arguments.length;s++)n[s]=arguments[s];return new r((s,i)=>{t.errorFirst?n.push(function(o,a){if(t.multiArgs){const c=new Array(arguments.length-1);for(let l=1;l<arguments.length;l++)c[l-1]=arguments[l];o?(c.unshift(o),i(c)):s(c)}else o?i(o):s(a)}):n.push(function(o){if(t.multiArgs){const a=new Array(arguments.length-1);for(let c=0;c<arguments.length;c++)a[c]=arguments[c];s(a)}else s(o)}),e.apply(this,n)})};var cf=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=s=>{const i=o=>typeof o=="string"?s===o:o.test(s);return t.include?t.include.some(i):!t.exclude.some(i)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):oa(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const s in e){const i=e[s];n[s]=typeof i=="function"&&r(s)?oa(i,t):i}return n},hr={},fr={};Object.defineProperty(fr,"__esModule",{value:!0});const lf=Xa;function aa(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function uf(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let df=class extends lf.EventEmitter{emit(t,...r){let n=t==="error";const s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const i=s[t];if(i===void 0)return!1;if(typeof i=="function")aa(i,this,r);else{const o=i.length,a=uf(i);for(let c=0;c<o;c+=1)aa(a[c],this,r)}return!0}};fr.default=df;var hf=L&&L.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hr,"__esModule",{value:!0});hr.BaseBlockTracker=void 0;const ff=hf(fr),pf=1e3,gf=(e,t)=>e+t,ca=["sync","latest"];class _f extends ff.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*pf,this._usePastBlocks=t.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){ca.includes(t)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return ca.map(t=>this.listenerCount(t)).reduce(gf)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=la(t),s=la(r);return this._usePastBlocks&&n<s||n>s}_newPotentialLatest(t){this._shouldUseNewBlock(t)&&this._setCurrentBlock(t)}_setCurrentBlock(t){const r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}hr.BaseBlockTracker=_f;function la(e){return Number.parseInt(e,16)}var rl={},nl={},ce={};class sl extends TypeError{constructor(t,r){let n;const{message:s,explanation:i,...o}=t,{path:a}=t,c=a.length===0?s:`At path: ${a.join(".")} -- ${s}`;super(i??c),i!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function mf(e){return ke(e)&&typeof e[Symbol.iterator]=="function"}function ke(e){return typeof e=="object"&&e!=null}function ua(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function se(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function bf(e){const{done:t,value:r}=e.next();return t?void 0:r}function yf(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:s,branch:i}=t,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${se(n)}\``}=e;return{value:n,type:o,refinement:a,key:s[s.length-1],path:s,branch:i,...e,message:c}}function*ui(e,t,r,n){mf(e)||(e=[e]);for(const s of e){const i=yf(s,t,r,n);i&&(yield i)}}function*xi(e,t,r={}){const{path:n=[],branch:s=[e],coerce:i=!1,mask:o=!1}=r,a={path:n,branch:s};if(i&&(e=t.coercer(e,a),o&&t.type!=="type"&&ke(t.schema)&&ke(e)&&!Array.isArray(e)))for(const l in e)t.schema[l]===void 0&&delete e[l];let c="valid";for(const l of t.validator(e,a))l.explanation=r.message,c="not_valid",yield[l,void 0];for(let[l,u,d]of t.entries(e,a)){const h=xi(u,d,{path:l===void 0?n:[...n,l],branch:l===void 0?s:[...s,u],coerce:i,mask:o,message:r.message});for(const f of h)f[0]?(c=f[0].refinement!=null?"not_refined":"not_valid",yield[f[0],void 0]):i&&(u=f[1],l===void 0?e=u:e instanceof Map?e.set(l,u):e instanceof Set?e.add(u):ke(e)&&(u!==void 0||l in e)&&(e[l]=u))}if(c!=="not_valid")for(const l of t.refiner(e,a))l.explanation=r.message,c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,e])}class te{constructor(t){const{type:r,schema:n,validator:s,refiner:i,coercer:o=c=>c,entries:a=function*(){}}=t;this.type=r,this.schema=n,this.entries=a,this.coercer=o,s?this.validator=(c,l)=>{const u=s(c,l);return ui(u,l,this,c)}:this.validator=()=>[],i?this.refiner=(c,l)=>{const u=i(c,l);return ui(u,l,this,c)}:this.refiner=()=>[]}assert(t,r){return il(t,this,r)}create(t,r){return ol(t,this,r)}is(t){return Fi(t,this)}mask(t,r){return al(t,this,r)}validate(t,r={}){return Bt(t,this,r)}}function il(e,t,r){const n=Bt(e,t,{message:r});if(n[0])throw n[0]}function ol(e,t,r){const n=Bt(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function al(e,t,r){const n=Bt(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Fi(e,t){return!Bt(e,t)[0]}function Bt(e,t,r={}){const n=xi(e,t,r),s=bf(n);return s[0]?[new sl(s[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,s[1]]}function wf(...e){const t=e[0].type==="type",r=e.map(s=>s.schema),n=Object.assign({},...r);return t?gr(n):pr(n)}function ge(e,t){return new te({type:e,schema:null,validator:t})}function vf(e,t){return new te({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function Ef(e){return new te({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function Sf(e){let t;return new te({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function kf(e,t){const{schema:r}=e,n={...r};for(const s of t)delete n[s];switch(e.type){case"type":return gr(n);default:return pr(n)}}function Cf(e){const t=e instanceof te,r=t?{...e.schema}:{...e};for(const n in r)r[n]=cl(r[n]);return t&&e.type==="type"?gr(r):pr(r)}function Rf(e,t){const{schema:r}=e,n={};for(const s of t)n[s]=r[s];switch(e.type){case"type":return gr(n);default:return pr(n)}}function If(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),ge(e,t)}function Af(){return ge("any",()=>!0)}function Nf(e){return new te({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${se(t)}`}})}function Lf(){return ge("bigint",e=>typeof e=="bigint")}function Mf(){return ge("boolean",e=>typeof e=="boolean")}function Tf(){return ge("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${se(e)}`)}function Pf(e){const t={},r=e.map(n=>se(n)).join();for(const n of e)t[n]=n;return new te({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${se(n)}`}})}function $f(){return ge("func",e=>typeof e=="function"||`Expected a function, but received: ${se(e)}`)}function Of(e){return ge("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${se(t)}`)}function xf(){return ge("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${se(e)}`)}function Ff(e){return new te({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function jf(e){const t=se(e),r=typeof e;return new te({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${se(n)}`}})}function Bf(e,t){return new te({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,s]of r.entries())yield[n,n,e],yield[n,s,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${se(r)}`}})}function ji(){return ge("never",()=>!1)}function Df(e){return new te({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function Hf(){return ge("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${se(e)}`)}function pr(e){const t=e?Object.keys(e):[],r=ji();return new te({type:"object",schema:e||null,*entries(n){if(e&&ke(n)){const s=new Set(Object.keys(n));for(const i of t)s.delete(i),yield[i,n[i],e[i]];for(const i of s)yield[i,n[i],r]}},validator(n){return ke(n)||`Expected an object, but received: ${se(n)}`},coercer(n){return ke(n)?{...n}:n}})}function cl(e){return new te({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function Uf(e,t){return new te({type:"record",schema:null,*entries(r){if(ke(r))for(const n in r){const s=r[n];yield[n,n,e],yield[n,s,t]}},validator(r){return ke(r)||`Expected an object, but received: ${se(r)}`}})}function Vf(){return ge("regexp",e=>e instanceof RegExp)}function Wf(e){return new te({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${se(t)}`}})}function ll(){return ge("string",e=>typeof e=="string"||`Expected a string, but received: ${se(e)}`)}function zf(e){const t=ji();return new te({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let s=0;s<n;s++)yield[s,r[s],e[s]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${se(r)}`}})}function gr(e){const t=Object.keys(e);return new te({type:"type",schema:e,*entries(r){if(ke(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return ke(r)||`Expected an object, but received: ${se(r)}`},coercer(r){return ke(r)?{...r}:r}})}function qf(e){const t=e.map(r=>r.type).join(" | ");return new te({type:"union",schema:null,coercer(r){for(const n of e){const[s,i]=n.validate(r,{coerce:!0});if(!s)return i}return r},validator(r,n){const s=[];for(const i of e){const[...o]=xi(r,i,n),[a]=o;if(a[0])for(const[c]of o)c&&s.push(c);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${se(r)}`,...s]}})}function ul(){return ge("unknown",()=>!0)}function Bi(e,t,r){return new te({...e,coercer:(n,s)=>Fi(n,t)?e.coercer(r(n,s),s):e.coercer(n,s)})}function Jf(e,t,r={}){return Bi(e,ul(),n=>{const s=typeof t=="function"?t():t;if(n===void 0)return s;if(!r.strict&&ua(n)&&ua(s)){const i={...n};let o=!1;for(const a in s)i[a]===void 0&&(i[a]=s[a],o=!0);if(o)return i}return n})}function Gf(e){return Bi(e,ll(),t=>t.trim())}function Zf(e){return dt(e,"empty",t=>{const r=dl(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function dl(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Qf(e,t,r={}){const{exclusive:n}=r;return dt(e,"max",s=>n?s<t:s<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${s}\``)}function Kf(e,t,r={}){const{exclusive:n}=r;return dt(e,"min",s=>n?s>t:s>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${s}\``)}function Xf(e){return dt(e,"nonempty",t=>dl(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function Yf(e,t){return dt(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function e0(e,t,r=t){const n=`Expected a ${e.type}`,s=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return dt(e,"size",i=>{if(typeof i=="number"||i instanceof Date)return t<=i&&i<=r||`${n} ${s} but received \`${i}\``;if(i instanceof Map||i instanceof Set){const{size:o}=i;return t<=o&&o<=r||`${n} with a size ${s} but received one with a size of \`${o}\``}else{const{length:o}=i;return t<=o&&o<=r||`${n} with a length ${s} but received one with a length of \`${o}\``}})}function dt(e,t,r){return new te({...e,*refiner(n,s){yield*e.refiner(n,s);const i=r(n,s),o=ui(i,s,e,n);for(const a of o)yield{...a,refinement:t}}})}const t0=Object.freeze(Object.defineProperty({__proto__:null,Struct:te,StructError:sl,any:Af,array:Nf,assert:il,assign:wf,bigint:Lf,boolean:Mf,coerce:Bi,create:ol,date:Tf,defaulted:Jf,define:ge,deprecated:vf,dynamic:Ef,empty:Zf,enums:Pf,func:$f,instance:Of,integer:xf,intersection:Ff,is:Fi,lazy:Sf,literal:jf,map:Bf,mask:al,max:Qf,min:Kf,never:ji,nonempty:Xf,nullable:Df,number:Hf,object:pr,omit:kf,optional:cl,partial:Cf,pattern:Yf,pick:Rf,record:Uf,refine:dt,regexp:Vf,set:Wf,size:e0,string:ll,struct:If,trimmed:Gf,tuple:zf,type:gr,union:qf,unknown:ul,validate:Bt},Symbol.toStringTag,{value:"Module"})),ht=Gr(t0);Object.defineProperty(ce,"__esModule",{value:!0});ce.assertExhaustive=ce.assertStruct=ce.assert=ce.AssertionError=void 0;const r0=ht;function n0(e){return typeof e=="object"&&e!==null&&"message"in e}function s0(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function i0(e){const t=n0(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function hl(e,t){return s0(e)?new e({message:t}):e({message:t})}class Di extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}ce.AssertionError=Di;function o0(e,t="Assertion failed.",r=Di){if(!e)throw t instanceof Error?t:hl(r,t)}ce.assert=o0;function a0(e,t,r="Assertion failed",n=Di){try{(0,r0.assert)(e,t)}catch(s){throw hl(n,`${r}: ${i0(s)}.`)}}ce.assertStruct=a0;function c0(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}ce.assertExhaustive=c0;var _r={};Object.defineProperty(_r,"__esModule",{value:!0});_r.base64=void 0;const l0=ht,u0=ce,d0=(e,t={})=>{var r,n;const s=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,i=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let o;i==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,u0.assert)(i==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return s?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,l0.pattern)(e,a)};_r.base64=d0;var B={},mr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=ht,r=ce;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(l){return(0,t.is)(l,e.HexStruct)}e.isHexString=n;function s(l){return(0,t.is)(l,e.StrictHexStruct)}e.isStrictHexString=s;function i(l){(0,r.assert)(n(l),"Value must be a hexadecimal string.")}e.assertIsHexString=i;function o(l){(0,r.assert)(s(l),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=o;function a(l){return l.startsWith("0x")?l:l.startsWith("0X")?`0x${l.substring(2)}`:`0x${l}`}e.add0x=a;function c(l){return l.startsWith("0x")||l.startsWith("0X")?l.substring(2):l}e.remove0x=c})(mr);Object.defineProperty(B,"__esModule",{value:!0});B.createDataView=B.concatBytes=B.valueToBytes=B.stringToBytes=B.numberToBytes=B.signedBigIntToBytes=B.bigIntToBytes=B.hexToBytes=B.bytesToString=B.bytesToNumber=B.bytesToSignedBigInt=B.bytesToBigInt=B.bytesToHex=B.assertIsBytes=B.isBytes=void 0;const be=ce,di=mr,da=48,ha=58,fa=87;function h0(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const f0=h0();function Hi(e){return e instanceof Uint8Array}B.isBytes=Hi;function Dt(e){(0,be.assert)(Hi(e),"Value must be a Uint8Array.")}B.assertIsBytes=Dt;function fl(e){if(Dt(e),e.length===0)return"0x";const t=f0(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,di.add0x)(r.join(""))}B.bytesToHex=fl;function pl(e){Dt(e);const t=fl(e);return BigInt(t)}B.bytesToBigInt=pl;function p0(e){Dt(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}B.bytesToSignedBigInt=p0;function g0(e){Dt(e);const t=pl(e);return(0,be.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}B.bytesToNumber=g0;function _0(e){return Dt(e),new TextDecoder().decode(e)}B.bytesToString=_0;function En(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,di.assertIsHexString)(e);const r=(0,di.remove0x)(e).toLowerCase(),n=r.length%2===0?r:`0${r}`,s=new Uint8Array(n.length/2);for(let i=0;i<s.length;i++){const o=n.charCodeAt(i*2),a=n.charCodeAt(i*2+1),c=o-(o<ha?da:fa),l=a-(a<ha?da:fa);s[i]=c*16+l}return s}B.hexToBytes=En;function gl(e){(0,be.assert)(typeof e=="bigint","Value must be a bigint."),(0,be.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return En(t)}B.bigIntToBytes=gl;function m0(e,t){(0,be.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function b0(e,t){(0,be.assert)(typeof e=="bigint","Value must be a bigint."),(0,be.assert)(typeof t=="number","Byte length must be a number."),(0,be.assert)(t>0,"Byte length must be greater than 0."),(0,be.assert)(m0(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let s=0;s<n.length;s++)n[s]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}B.signedBigIntToBytes=b0;function _l(e){(0,be.assert)(typeof e=="number","Value must be a number."),(0,be.assert)(e>=0,"Value must be a non-negative number."),(0,be.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return En(t)}B.numberToBytes=_l;function ml(e){return(0,be.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}B.stringToBytes=ml;function bl(e){if(typeof e=="bigint")return gl(e);if(typeof e=="number")return _l(e);if(typeof e=="string")return e.startsWith("0x")?En(e):ml(e);if(Hi(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}B.valueToBytes=bl;function y0(e){const t=new Array(e.length);let r=0;for(let s=0;s<e.length;s++){const i=bl(e[s]);t[s]=i,r+=i.length}const n=new Uint8Array(r);for(let s=0,i=0;s<t.length;s++)n.set(t[s],i),i+=t[s].length;return n}B.concatBytes=y0;function w0(e){if(typeof O<"u"&&e instanceof O){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}B.createDataView=w0;var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.ChecksumStruct=void 0;const pa=ht,v0=_r;Sn.ChecksumStruct=(0,pa.size)((0,v0.base64)((0,pa.string)(),{paddingRequired:!0}),44,44);var Fe={};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.createHex=Fe.createBytes=Fe.createBigInt=Fe.createNumber=void 0;const Y=ht,E0=ce,yl=B,kn=mr,wl=(0,Y.union)([(0,Y.number)(),(0,Y.bigint)(),(0,Y.string)(),kn.StrictHexStruct]),S0=(0,Y.coerce)((0,Y.number)(),wl,Number),k0=(0,Y.coerce)((0,Y.bigint)(),wl,BigInt);(0,Y.union)([kn.StrictHexStruct,(0,Y.instance)(Uint8Array)]);const C0=(0,Y.coerce)((0,Y.instance)(Uint8Array),(0,Y.union)([kn.StrictHexStruct]),yl.hexToBytes),R0=(0,Y.coerce)(kn.StrictHexStruct,(0,Y.instance)(Uint8Array),yl.bytesToHex);function I0(e){try{const t=(0,Y.create)(e,S0);return(0,E0.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof Y.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}Fe.createNumber=I0;function A0(e){try{return(0,Y.create)(e,k0)}catch(t){throw t instanceof Y.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Fe.createBigInt=A0;function N0(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,Y.create)(e,C0)}catch(t){throw t instanceof Y.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Fe.createBytes=N0;function L0(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,Y.create)(e,R0)}catch(t){throw t instanceof Y.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Fe.createHex=L0;var Mt={},vl=L&&L.__classPrivateFieldSet||function(e,t,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r},he=L&&L.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Ce,Le;Object.defineProperty(Mt,"__esModule",{value:!0});Mt.FrozenSet=Mt.FrozenMap=void 0;class Ui{constructor(t){Ce.set(this,void 0),vl(this,Ce,new Map(t),"f"),Object.freeze(this)}get size(){return he(this,Ce,"f").size}[(Ce=new WeakMap,Symbol.iterator)](){return he(this,Ce,"f")[Symbol.iterator]()}entries(){return he(this,Ce,"f").entries()}forEach(t,r){return he(this,Ce,"f").forEach((n,s,i)=>t.call(r,n,s,this))}get(t){return he(this,Ce,"f").get(t)}has(t){return he(this,Ce,"f").has(t)}keys(){return he(this,Ce,"f").keys()}values(){return he(this,Ce,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}Mt.FrozenMap=Ui;class Vi{constructor(t){Le.set(this,void 0),vl(this,Le,new Set(t),"f"),Object.freeze(this)}get size(){return he(this,Le,"f").size}[(Le=new WeakMap,Symbol.iterator)](){return he(this,Le,"f")[Symbol.iterator]()}entries(){return he(this,Le,"f").entries()}forEach(t,r){return he(this,Le,"f").forEach((n,s,i)=>t.call(r,n,s,this))}has(t){return he(this,Le,"f").has(t)}keys(){return he(this,Le,"f").keys()}values(){return he(this,Le,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}Mt.FrozenSet=Vi;Object.freeze(Ui);Object.freeze(Ui.prototype);Object.freeze(Vi);Object.freeze(Vi.prototype);var El={};Object.defineProperty(El,"__esModule",{value:!0});var Sl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=ht,r=ce,n=()=>(0,t.define)("finite number",v=>(0,t.is)(v,(0,t.number)())&&Number.isFinite(v));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(v,A)=>{function H(G,ee){const W=[...ee.validator(G,A)];return W.length>0?W:!0}try{const G=H(v,e.UnsafeJsonStruct);return G!==!0?G:H(JSON.parse(JSON.stringify(v)),e.UnsafeJsonStruct)}catch(G){return G instanceof RangeError?"Circular reference detected":!1}});function s(v){return(0,t.is)(v,e.JsonStruct)}e.isValidJson=s;function i(v){(0,r.assertStruct)(v,e.JsonStruct,"Invalid JSON value");const A=JSON.stringify(v);return new TextEncoder().encode(A).byteLength}e.getJsonSize=i,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function o(v){return(0,t.is)(v,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=o;function a(v,A){(0,r.assertStruct)(v,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",A)}e.assertIsJsonRpcNotification=a;function c(v){return(0,t.is)(v,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=c;function l(v,A){(0,r.assertStruct)(v,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",A)}e.assertIsJsonRpcRequest=l,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function u(v){return(0,t.is)(v,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=u;function d(v,A){(0,r.assertStruct)(v,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",A)}e.assertIsPendingJsonRpcResponse=d;function h(v){return(0,t.is)(v,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=h;function f(v,A){(0,r.assertStruct)(v,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",A)}e.assertIsJsonRpcResponse=f;function _(v){return(0,t.is)(v,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=_;function p(v,A){(0,r.assertStruct)(v,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",A)}e.assertIsJsonRpcSuccess=p;function g(v){return(0,t.is)(v,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=g;function b(v,A){(0,r.assertStruct)(v,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",A)}e.assertIsJsonRpcFailure=b;function y(v){return(0,t.is)(v,e.JsonRpcErrorStruct)}e.isJsonRpcError=y;function m(v,A){(0,r.assertStruct)(v,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",A)}e.assertIsJsonRpcError=m;function I(v){const{permitEmptyString:A,permitFractions:H,permitNull:G}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},v);return J=>!!(typeof J=="number"&&(H||Number.isInteger(J))||typeof J=="string"&&(A||J.length>0)||G&&J===null)}e.getJsonRpcIdValidator=I})(Sl);var kl={};Object.defineProperty(kl,"__esModule",{value:!0});var Tt={},hi={exports:{}},qs,ga;function M0(){if(ga)return qs;ga=1;var e=1e3,t=e*60,r=t*60,n=r*24,s=n*7,i=n*365.25;qs=function(u,d){d=d||{};var h=typeof u;if(h==="string"&&u.length>0)return o(u);if(h==="number"&&isFinite(u))return d.long?c(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function o(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var h=parseFloat(d[1]),f=(d[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return h*i;case"weeks":case"week":case"w":return h*s;case"days":case"day":case"d":return h*n;case"hours":case"hour":case"hrs":case"hr":case"h":return h*r;case"minutes":case"minute":case"mins":case"min":case"m":return h*t;case"seconds":case"second":case"secs":case"sec":case"s":return h*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(u){var d=Math.abs(u);return d>=n?Math.round(u/n)+"d":d>=r?Math.round(u/r)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function c(u){var d=Math.abs(u);return d>=n?l(u,d,n,"day"):d>=r?l(u,d,r,"hour"):d>=t?l(u,d,t,"minute"):d>=e?l(u,d,e,"second"):u+" ms"}function l(u,d,h,f){var _=d>=h*1.5;return Math.round(u/h)+" "+f+(_?"s":"")}return qs}function T0(e){r.debug=r,r.default=r,r.coerce=c,r.disable=i,r.enable=s,r.enabled=o,r.humanize=M0(),r.destroy=l,Object.keys(e).forEach(u=>{r[u]=e[u]}),r.names=[],r.skips=[],r.formatters={};function t(u){let d=0;for(let h=0;h<u.length;h++)d=(d<<5)-d+u.charCodeAt(h),d|=0;return r.colors[Math.abs(d)%r.colors.length]}r.selectColor=t;function r(u){let d,h=null,f,_;function p(...g){if(!p.enabled)return;const b=p,y=Number(new Date),m=y-(d||y);b.diff=m,b.prev=d,b.curr=y,d=y,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let I=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(A,H)=>{if(A==="%%")return"%";I++;const G=r.formatters[H];if(typeof G=="function"){const ee=g[I];A=G.call(b,ee),g.splice(I,1),I--}return A}),r.formatArgs.call(b,g),(b.log||r.log).apply(b,g)}return p.namespace=u,p.useColors=r.useColors(),p.color=r.selectColor(u),p.extend=n,p.destroy=r.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(f!==r.namespaces&&(f=r.namespaces,_=r.enabled(u)),_),set:g=>{h=g}}),typeof r.init=="function"&&r.init(p),p}function n(u,d){const h=r(this.namespace+(typeof d>"u"?":":d)+u);return h.log=this.log,h}function s(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let d;const h=(typeof u=="string"?u:"").split(/[\s,]+/),f=h.length;for(d=0;d<f;d++)h[d]&&(u=h[d].replace(/\*/g,".*?"),u[0]==="-"?r.skips.push(new RegExp("^"+u.slice(1)+"$")):r.names.push(new RegExp("^"+u+"$")))}function i(){const u=[...r.names.map(a),...r.skips.map(a).map(d=>"-"+d)].join(",");return r.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let d,h;for(d=0,h=r.skips.length;d<h;d++)if(r.skips[d].test(u))return!1;for(d=0,h=r.names.length;d<h;d++)if(r.names[d].test(u))return!0;return!1}function a(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function c(u){return u instanceof Error?u.stack||u.message:u}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var P0=T0;(function(e,t){t.formatArgs=n,t.save=s,t.load=i,t.useColors=r,t.storage=o(),t.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;c.splice(1,0,l,"color: inherit");let u=0,d=0;c[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(u++,h==="%c"&&(d=u))}),c.splice(d,0,l)}t.log=console.debug||console.log||(()=>{});function s(c){try{c?t.storage.setItem("debug",c):t.storage.removeItem("debug")}catch{}}function i(){let c;try{c=t.storage.getItem("debug")}catch{}return!c&&typeof ni<"u"&&"env"in ni&&(c={}.DEBUG),c}function o(){try{return localStorage}catch{}}e.exports=P0(t);const{formatters:a}=e.exports;a.j=function(c){try{return JSON.stringify(c)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(hi,hi.exports);var $0=hi.exports,O0=L&&L.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.createModuleLogger=Tt.createProjectLogger=void 0;const x0=O0($0),F0=(0,x0.default)("metamask");function j0(e){return F0.extend(e)}Tt.createProjectLogger=j0;function B0(e,t){return e.extend(t)}Tt.createModuleLogger=B0;var Cl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(l){return Array.isArray(l)&&l.length>0}e.isNonEmptyArray=t;function r(l){return l==null}e.isNullOrUndefined=r;function n(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}e.isObject=n;const s=(l,u)=>Object.hasOwnProperty.call(l,u);e.hasProperty=s,function(l){l[l.Null=4]="Null",l[l.Comma=1]="Comma",l[l.Wrapper=1]="Wrapper",l[l.True=4]="True",l[l.False=5]="False",l[l.Quote=1]="Quote",l[l.Colon=1]="Colon",l[l.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function i(l){if(typeof l!="object"||l===null)return!1;try{let u=l;for(;Object.getPrototypeOf(u)!==null;)u=Object.getPrototypeOf(u);return Object.getPrototypeOf(l)===u}catch{return!1}}e.isPlainObject=i;function o(l){return l.charCodeAt(0)<=127}e.isASCII=o;function a(l){var u;return l.split("").reduce((h,f)=>o(f)?h+1:h+2,0)+((u=l.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&u!==void 0?u:[]).length}e.calculateStringSize=a;function c(l){return l.toString().length}e.calculateNumberSize=c})(Cl);var je={};Object.defineProperty(je,"__esModule",{value:!0});je.hexToBigInt=je.hexToNumber=je.bigIntToHex=je.numberToHex=void 0;const St=ce,Kt=mr,D0=e=>((0,St.assert)(typeof e=="number","Value must be a number."),(0,St.assert)(e>=0,"Value must be a non-negative number."),(0,St.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Kt.add0x)(e.toString(16)));je.numberToHex=D0;const H0=e=>((0,St.assert)(typeof e=="bigint","Value must be a bigint."),(0,St.assert)(e>=0,"Value must be a non-negative bigint."),(0,Kt.add0x)(e.toString(16)));je.bigIntToHex=H0;const U0=e=>{(0,Kt.assertIsHexString)(e);const t=parseInt(e,16);return(0,St.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};je.hexToNumber=U0;const V0=e=>((0,Kt.assertIsHexString)(e),BigInt((0,Kt.add0x)(e)));je.hexToBigInt=V0;var Rl={};Object.defineProperty(Rl,"__esModule",{value:!0});var Il={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(i){i[i.Millisecond=1]="Millisecond",i[i.Second=1e3]="Second",i[i.Minute=6e4]="Minute",i[i.Hour=36e5]="Hour",i[i.Day=864e5]="Day",i[i.Week=6048e5]="Week",i[i.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=i=>Number.isInteger(i)&&i>=0,r=(i,o)=>{if(!t(i))throw new Error(`"${o}" must be a non-negative integer. Received: "${i}".`)};function n(i,o){return r(i,"count"),i*o}e.inMilliseconds=n;function s(i){return r(i,"timestamp"),Date.now()-i}e.timeSince=s})(Il);var Al={};Object.defineProperty(Al,"__esModule",{value:!0});var Nl={},fi={exports:{}};const W0="2.0.0",Ll=256,z0=Number.MAX_SAFE_INTEGER||9007199254740991,q0=16,J0=Ll-6,G0=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Cn={MAX_LENGTH:Ll,MAX_SAFE_COMPONENT_LENGTH:q0,MAX_SAFE_BUILD_LENGTH:J0,MAX_SAFE_INTEGER:z0,RELEASE_TYPES:G0,SEMVER_SPEC_VERSION:W0,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Z0=typeof ni=="object"&&{}&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Rn=Z0;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=Cn,i=Rn;t=e.exports={};const o=t.re=[],a=t.safeRe=[],c=t.src=[],l=t.safeSrc=[],u=t.t={};let d=0;const h="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",s],[h,n]],_=g=>{for(const[b,y]of f)g=g.split(`${b}*`).join(`${b}{0,${y}}`).split(`${b}+`).join(`${b}{1,${y}}`);return g},p=(g,b,y)=>{const m=_(b),I=d++;i(g,I,b),u[g]=I,c[I]=b,l[I]=m,o[I]=new RegExp(b,y?"g":void 0),a[I]=new RegExp(m,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),p("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${h}+`),p("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),p("FULL",`^${c[u.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),p("LOOSE",`^${c[u.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),p("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),p("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",c[u.COERCE],!0),p("COERCERTLFULL",c[u.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(fi,fi.exports);var br=fi.exports;const Q0=Object.freeze({loose:!0}),K0=Object.freeze({}),X0=e=>e?typeof e!="object"?Q0:e:K0;var Wi=X0;const _a=/^[0-9]+$/,Ml=(e,t)=>{const r=_a.test(e),n=_a.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Y0=(e,t)=>Ml(t,e);var Tl={compareIdentifiers:Ml,rcompareIdentifiers:Y0};const Lr=Rn,{MAX_LENGTH:ma,MAX_SAFE_INTEGER:Mr}=Cn,{safeRe:Tr,t:Pr}=br,e1=Wi,{compareIdentifiers:mt}=Tl;let t1=class Me{constructor(t,r){if(r=e1(r),t instanceof Me){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>ma)throw new TypeError(`version is longer than ${ma} characters`);Lr("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?Tr[Pr.LOOSE]:Tr[Pr.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Mr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Mr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Mr||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){const i=+s;if(i>=0&&i<Mr)return i}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Lr("SemVer.compare",this.version,this.options,t),!(t instanceof Me)){if(typeof t=="string"&&t===this.version)return 0;t=new Me(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof Me||(t=new Me(t,this.options)),mt(this.major,t.major)||mt(this.minor,t.minor)||mt(this.patch,t.patch)}comparePre(t){if(t instanceof Me||(t=new Me(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],s=t.prerelease[r];if(Lr("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return mt(n,s)}while(++r)}compareBuild(t){t instanceof Me||(t=new Me(t,this.options));let r=0;do{const n=this.build[r],s=t.build[r];if(Lr("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return mt(n,s)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){const s=`-${r}`.match(this.options.loose?Tr[Pr.PRERELEASELOOSE]:Tr[Pr.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),mt(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var fe=t1;const ba=fe,r1=(e,t,r=!1)=>{if(e instanceof ba)return e;try{return new ba(e,t)}catch(n){if(!r)return null;throw n}};var Ht=r1;const n1=Ht,s1=(e,t)=>{const r=n1(e,t);return r?r.version:null};var i1=s1;const o1=Ht,a1=(e,t)=>{const r=o1(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var c1=a1;const ya=fe,l1=(e,t,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new ya(e instanceof ya?e.version:e,r).inc(t,n,s).version}catch{return null}};var u1=l1;const wa=Ht,d1=(e,t)=>{const r=wa(e,null,!0),n=wa(t,null,!0),s=r.compare(n);if(s===0)return null;const i=s>0,o=i?r:n,a=i?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}const u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};var h1=d1;const f1=fe,p1=(e,t)=>new f1(e,t).major;var g1=p1;const _1=fe,m1=(e,t)=>new _1(e,t).minor;var b1=m1;const y1=fe,w1=(e,t)=>new y1(e,t).patch;var v1=w1;const E1=Ht,S1=(e,t)=>{const r=E1(e,t);return r&&r.prerelease.length?r.prerelease:null};var k1=S1;const va=fe,C1=(e,t,r)=>new va(e,r).compare(new va(t,r));var Ie=C1;const R1=Ie,I1=(e,t,r)=>R1(t,e,r);var A1=I1;const N1=Ie,L1=(e,t)=>N1(e,t,!0);var M1=L1;const Ea=fe,T1=(e,t,r)=>{const n=new Ea(e,r),s=new Ea(t,r);return n.compare(s)||n.compareBuild(s)};var zi=T1;const P1=zi,$1=(e,t)=>e.sort((r,n)=>P1(r,n,t));var O1=$1;const x1=zi,F1=(e,t)=>e.sort((r,n)=>x1(n,r,t));var j1=F1;const B1=Ie,D1=(e,t,r)=>B1(e,t,r)>0;var In=D1;const H1=Ie,U1=(e,t,r)=>H1(e,t,r)<0;var qi=U1;const V1=Ie,W1=(e,t,r)=>V1(e,t,r)===0;var Pl=W1;const z1=Ie,q1=(e,t,r)=>z1(e,t,r)!==0;var $l=q1;const J1=Ie,G1=(e,t,r)=>J1(e,t,r)>=0;var Ji=G1;const Z1=Ie,Q1=(e,t,r)=>Z1(e,t,r)<=0;var Gi=Q1;const K1=Pl,X1=$l,Y1=In,ep=Ji,tp=qi,rp=Gi,np=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return K1(e,r,n);case"!=":return X1(e,r,n);case">":return Y1(e,r,n);case">=":return ep(e,r,n);case"<":return tp(e,r,n);case"<=":return rp(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var Ol=np;const sp=fe,ip=Ht,{safeRe:$r,t:Or}=br,op=(e,t)=>{if(e instanceof sp)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?$r[Or.COERCEFULL]:$r[Or.COERCE]);else{const c=t.includePrerelease?$r[Or.COERCERTLFULL]:$r[Or.COERCERTL];let l;for(;(l=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;const n=r[2],s=r[3]||"0",i=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return ip(`${n}.${s}.${i}${o}${a}`,t)};var ap=op;class cp{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(t,r)}return this}}var lp=cp,Js,Sa;function Ae(){if(Sa)return Js;Sa=1;const e=/\s+/g;class t{constructor(w,R){if(R=s(R),w instanceof t)return w.loose===!!R.loose&&w.includePrerelease===!!R.includePrerelease?w:new t(w.raw,R);if(w instanceof i)return this.raw=w.value,this.set=[[w]],this.formatted=void 0,this;if(this.options=R,this.loose=!!R.loose,this.includePrerelease=!!R.includePrerelease,this.raw=w.trim().replace(e," "),this.set=this.raw.split("||").map(k=>this.parseRange(k.trim())).filter(k=>k.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const k=this.set[0];if(this.set=this.set.filter(N=>!p(N[0])),this.set.length===0)this.set=[k];else if(this.set.length>1){for(const N of this.set)if(N.length===1&&g(N[0])){this.set=[N];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let w=0;w<this.set.length;w++){w>0&&(this.formatted+="||");const R=this.set[w];for(let k=0;k<R.length;k++)k>0&&(this.formatted+=" "),this.formatted+=R[k].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(w){const k=((this.options.includePrerelease&&f)|(this.options.loose&&_))+":"+w,N=n.get(k);if(N)return N;const C=this.options.loose,T=C?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];w=w.replace(T,U(this.options.includePrerelease)),o("hyphen replace",w),w=w.replace(c[l.COMPARATORTRIM],u),o("comparator trim",w),w=w.replace(c[l.TILDETRIM],d),o("tilde trim",w),w=w.replace(c[l.CARETTRIM],h),o("caret trim",w);let D=w.split(" ").map(Z=>y(Z,this.options)).join(" ").split(/\s+/).map(Z=>W(Z,this.options));C&&(D=D.filter(Z=>(o("loose invalid filter",Z,this.options),!!Z.match(c[l.COMPARATORLOOSE])))),o("range list",D);const $=new Map,z=D.map(Z=>new i(Z,this.options));for(const Z of z){if(p(Z))return[Z];$.set(Z.value,Z)}$.size>1&&$.has("")&&$.delete("");const le=[...$.values()];return n.set(k,le),le}intersects(w,R){if(!(w instanceof t))throw new TypeError("a Range is required");return this.set.some(k=>b(k,R)&&w.set.some(N=>b(N,R)&&k.every(C=>N.every(T=>C.intersects(T,R)))))}test(w){if(!w)return!1;if(typeof w=="string")try{w=new a(w,this.options)}catch{return!1}for(let R=0;R<this.set.length;R++)if(Qe(this.set[R],w,this.options))return!0;return!1}}Js=t;const r=lp,n=new r,s=Wi,i=An(),o=Rn,a=fe,{safeRe:c,t:l,comparatorTrimReplace:u,tildeTrimReplace:d,caretTrimReplace:h}=br,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:_}=Cn,p=E=>E.value==="<0.0.0-0",g=E=>E.value==="",b=(E,w)=>{let R=!0;const k=E.slice();let N=k.pop();for(;R&&k.length;)R=k.every(C=>N.intersects(C,w)),N=k.pop();return R},y=(E,w)=>(o("comp",E,w),E=A(E,w),o("caret",E),E=I(E,w),o("tildes",E),E=G(E,w),o("xrange",E),E=J(E,w),o("stars",E),E),m=E=>!E||E.toLowerCase()==="x"||E==="*",I=(E,w)=>E.trim().split(/\s+/).map(R=>v(R,w)).join(" "),v=(E,w)=>{const R=w.loose?c[l.TILDELOOSE]:c[l.TILDE];return E.replace(R,(k,N,C,T,D)=>{o("tilde",E,k,N,C,T,D);let $;return m(N)?$="":m(C)?$=`>=${N}.0.0 <${+N+1}.0.0-0`:m(T)?$=`>=${N}.${C}.0 <${N}.${+C+1}.0-0`:D?(o("replaceTilde pr",D),$=`>=${N}.${C}.${T}-${D} <${N}.${+C+1}.0-0`):$=`>=${N}.${C}.${T} <${N}.${+C+1}.0-0`,o("tilde return",$),$})},A=(E,w)=>E.trim().split(/\s+/).map(R=>H(R,w)).join(" "),H=(E,w)=>{o("caret",E,w);const R=w.loose?c[l.CARETLOOSE]:c[l.CARET],k=w.includePrerelease?"-0":"";return E.replace(R,(N,C,T,D,$)=>{o("caret",E,N,C,T,D,$);let z;return m(C)?z="":m(T)?z=`>=${C}.0.0${k} <${+C+1}.0.0-0`:m(D)?C==="0"?z=`>=${C}.${T}.0${k} <${C}.${+T+1}.0-0`:z=`>=${C}.${T}.0${k} <${+C+1}.0.0-0`:$?(o("replaceCaret pr",$),C==="0"?T==="0"?z=`>=${C}.${T}.${D}-${$} <${C}.${T}.${+D+1}-0`:z=`>=${C}.${T}.${D}-${$} <${C}.${+T+1}.0-0`:z=`>=${C}.${T}.${D}-${$} <${+C+1}.0.0-0`):(o("no pr"),C==="0"?T==="0"?z=`>=${C}.${T}.${D}${k} <${C}.${T}.${+D+1}-0`:z=`>=${C}.${T}.${D}${k} <${C}.${+T+1}.0-0`:z=`>=${C}.${T}.${D} <${+C+1}.0.0-0`),o("caret return",z),z})},G=(E,w)=>(o("replaceXRanges",E,w),E.split(/\s+/).map(R=>ee(R,w)).join(" ")),ee=(E,w)=>{E=E.trim();const R=w.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return E.replace(R,(k,N,C,T,D,$)=>{o("xRange",E,k,N,C,T,D,$);const z=m(C),le=z||m(T),Z=le||m(D),Ve=Z;return N==="="&&Ve&&(N=""),$=w.includePrerelease?"-0":"",z?N===">"||N==="<"?k="<0.0.0-0":k="*":N&&Ve?(le&&(T=0),D=0,N===">"?(N=">=",le?(C=+C+1,T=0,D=0):(T=+T+1,D=0)):N==="<="&&(N="<",le?C=+C+1:T=+T+1),N==="<"&&($="-0"),k=`${N+C}.${T}.${D}${$}`):le?k=`>=${C}.0.0${$} <${+C+1}.0.0-0`:Z&&(k=`>=${C}.${T}.0${$} <${C}.${+T+1}.0-0`),o("xRange return",k),k})},J=(E,w)=>(o("replaceStars",E,w),E.trim().replace(c[l.STAR],"")),W=(E,w)=>(o("replaceGTE0",E,w),E.trim().replace(c[w.includePrerelease?l.GTE0PRE:l.GTE0],"")),U=E=>(w,R,k,N,C,T,D,$,z,le,Z,Ve)=>(m(k)?R="":m(N)?R=`>=${k}.0.0${E?"-0":""}`:m(C)?R=`>=${k}.${N}.0${E?"-0":""}`:T?R=`>=${R}`:R=`>=${R}${E?"-0":""}`,m(z)?$="":m(le)?$=`<${+z+1}.0.0-0`:m(Z)?$=`<${z}.${+le+1}.0-0`:Ve?$=`<=${z}.${le}.${Z}-${Ve}`:E?$=`<${z}.${le}.${+Z+1}-0`:$=`<=${$}`,`${R} ${$}`.trim()),Qe=(E,w,R)=>{for(let k=0;k<E.length;k++)if(!E[k].test(w))return!1;if(w.prerelease.length&&!R.includePrerelease){for(let k=0;k<E.length;k++)if(o(E[k].semver),E[k].semver!==i.ANY&&E[k].semver.prerelease.length>0){const N=E[k].semver;if(N.major===w.major&&N.minor===w.minor&&N.patch===w.patch)return!0}return!1}return!0};return Js}var Gs,ka;function An(){if(ka)return Gs;ka=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(u,d){if(d=r(d),u instanceof t){if(u.loose===!!d.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),o("comparator",u,d),this.options=d,this.loose=!!d.loose,this.parse(u),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(u){const d=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],h=u.match(d);if(!h)throw new TypeError(`Invalid comparator: ${u}`);this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=""),h[2]?this.semver=new a(h[2],this.options.loose):this.semver=e}toString(){return this.value}test(u){if(o("Comparator.test",u,this.options.loose),this.semver===e||u===e)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return i(u,this.operator,this.semver,this.options)}intersects(u,d){if(!(u instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(u.value,d).test(this.value):u.operator===""?u.value===""?!0:new c(this.value,d).test(u.semver):(d=r(d),d.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||i(this.semver,"<",u.semver,d)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||i(this.semver,">",u.semver,d)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}Gs=t;const r=Wi,{safeRe:n,t:s}=br,i=Ol,o=Rn,a=fe,c=Ae();return Gs}const up=Ae(),dp=(e,t,r)=>{try{t=new up(t,r)}catch{return!1}return t.test(e)};var Nn=dp;const hp=Ae(),fp=(e,t)=>new hp(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var pp=fp;const gp=fe,_p=Ae(),mp=(e,t,r)=>{let n=null,s=null,i=null;try{i=new _p(t,r)}catch{return null}return e.forEach(o=>{i.test(o)&&(!n||s.compare(o)===-1)&&(n=o,s=new gp(n,r))}),n};var bp=mp;const yp=fe,wp=Ae(),vp=(e,t,r)=>{let n=null,s=null,i=null;try{i=new wp(t,r)}catch{return null}return e.forEach(o=>{i.test(o)&&(!n||s.compare(o)===1)&&(n=o,s=new yp(n,r))}),n};var Ep=vp;const Zs=fe,Sp=Ae(),Ca=In,kp=(e,t)=>{e=new Sp(e,t);let r=new Zs("0.0.0");if(e.test(r)||(r=new Zs("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){const s=e.set[n];let i=null;s.forEach(o=>{const a=new Zs(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||Ca(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||Ca(r,i))&&(r=i)}return r&&e.test(r)?r:null};var Cp=kp;const Rp=Ae(),Ip=(e,t)=>{try{return new Rp(e,t).range||"*"}catch{return null}};var Ap=Ip;const Np=fe,xl=An(),{ANY:Lp}=xl,Mp=Ae(),Tp=Nn,Ra=In,Ia=qi,Pp=Gi,$p=Ji,Op=(e,t,r,n)=>{e=new Np(e,n),t=new Mp(t,n);let s,i,o,a,c;switch(r){case">":s=Ra,i=Pp,o=Ia,a=">",c=">=";break;case"<":s=Ia,i=$p,o=Ra,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Tp(e,t,n))return!1;for(let l=0;l<t.set.length;++l){const u=t.set[l];let d=null,h=null;if(u.forEach(f=>{f.semver===Lp&&(f=new xl(">=0.0.0")),d=d||f,h=h||f,s(f.semver,d.semver,n)?d=f:o(f.semver,h.semver,n)&&(h=f)}),d.operator===a||d.operator===c||(!h.operator||h.operator===a)&&i(e,h.semver))return!1;if(h.operator===c&&o(e,h.semver))return!1}return!0};var Zi=Op;const xp=Zi,Fp=(e,t,r)=>xp(e,t,">",r);var jp=Fp;const Bp=Zi,Dp=(e,t,r)=>Bp(e,t,"<",r);var Hp=Dp;const Aa=Ae(),Up=(e,t,r)=>(e=new Aa(e,r),t=new Aa(t,r),e.intersects(t,r));var Vp=Up;const Wp=Nn,zp=Ie;var qp=(e,t,r)=>{const n=[];let s=null,i=null;const o=e.sort((u,d)=>zp(u,d,r));for(const u of o)Wp(u,t,r)?(i=u,s||(s=u)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);const a=[];for(const[u,d]of n)u===d?a.push(u):!d&&u===o[0]?a.push("*"):d?u===o[0]?a.push(`<=${d}`):a.push(`${u} - ${d}`):a.push(`>=${u}`);const c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length<l.length?c:t};const Na=Ae(),Qi=An(),{ANY:Qs}=Qi,Vt=Nn,Ki=Ie,Jp=(e,t,r={})=>{if(e===t)return!0;e=new Na(e,r),t=new Na(t,r);let n=!1;e:for(const s of e.set){for(const i of t.set){const o=Zp(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},Gp=[new Qi(">=0.0.0-0")],La=[new Qi(">=0.0.0")],Zp=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Qs){if(t.length===1&&t[0].semver===Qs)return!0;r.includePrerelease?e=Gp:e=La}if(t.length===1&&t[0].semver===Qs){if(r.includePrerelease)return!0;t=La}const n=new Set;let s,i;for(const f of e)f.operator===">"||f.operator===">="?s=Ma(s,f,r):f.operator==="<"||f.operator==="<="?i=Ta(i,f,r):n.add(f.semver);if(n.size>1)return null;let o;if(s&&i){if(o=Ki(s.semver,i.semver,r),o>0)return null;if(o===0&&(s.operator!==">="||i.operator!=="<="))return null}for(const f of n){if(s&&!Vt(f,String(s),r)||i&&!Vt(f,String(i),r))return null;for(const _ of t)if(!Vt(f,String(_),r))return!1;return!0}let a,c,l,u,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;d&&d.prerelease.length===1&&i.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(const f of t){if(u=u||f.operator===">"||f.operator===">=",l=l||f.operator==="<"||f.operator==="<=",s){if(h&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===h.major&&f.semver.minor===h.minor&&f.semver.patch===h.patch&&(h=!1),f.operator===">"||f.operator===">="){if(a=Ma(s,f,r),a===f&&a!==s)return!1}else if(s.operator===">="&&!Vt(s.semver,String(f),r))return!1}if(i){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator==="<"||f.operator==="<="){if(c=Ta(i,f,r),c===f&&c!==i)return!1}else if(i.operator==="<="&&!Vt(i.semver,String(f),r))return!1}if(!f.operator&&(i||s)&&o!==0)return!1}return!(s&&l&&!i&&o!==0||i&&u&&!s&&o!==0||h||d)},Ma=(e,t,r)=>{if(!e)return t;const n=Ki(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Ta=(e,t,r)=>{if(!e)return t;const n=Ki(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var Qp=Jp;const Ks=br,Pa=Cn,Kp=fe,$a=Tl,Xp=Ht,Yp=i1,eg=c1,tg=u1,rg=h1,ng=g1,sg=b1,ig=v1,og=k1,ag=Ie,cg=A1,lg=M1,ug=zi,dg=O1,hg=j1,fg=In,pg=qi,gg=Pl,_g=$l,mg=Ji,bg=Gi,yg=Ol,wg=ap,vg=An(),Eg=Ae(),Sg=Nn,kg=pp,Cg=bp,Rg=Ep,Ig=Cp,Ag=Ap,Ng=Zi,Lg=jp,Mg=Hp,Tg=Vp,Pg=qp,$g=Qp;var Og={parse:Xp,valid:Yp,clean:eg,inc:tg,diff:rg,major:ng,minor:sg,patch:ig,prerelease:og,compare:ag,rcompare:cg,compareLoose:lg,compareBuild:ug,sort:dg,rsort:hg,gt:fg,lt:pg,eq:gg,neq:_g,gte:mg,lte:bg,cmp:yg,coerce:wg,Comparator:vg,Range:Eg,satisfies:Sg,toComparators:kg,maxSatisfying:Cg,minSatisfying:Rg,minVersion:Ig,validRange:Ag,outside:Ng,gtr:Lg,ltr:Mg,intersects:Tg,simplifyRange:Pg,subset:$g,SemVer:Kp,re:Ks.re,src:Ks.src,tokens:Ks.t,SEMVER_SPEC_VERSION:Pa.SEMVER_SPEC_VERSION,RELEASE_TYPES:Pa.RELEASE_TYPES,compareIdentifiers:$a.compareIdentifiers,rcompareIdentifiers:$a.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=Og,r=ht,n=ce;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",d=>(0,t.valid)(d)===null?`Expected SemVer version, got "${d}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",d=>(0,t.validRange)(d)===null?`Expected SemVer range, got "${d}"`:!0);function s(d){return(0,r.is)(d,e.VersionStruct)}e.isValidSemVerVersion=s;function i(d){return(0,r.is)(d,e.VersionRangeStruct)}e.isValidSemVerRange=i;function o(d){(0,n.assertStruct)(d,e.VersionStruct)}e.assertIsSemVerVersion=o;function a(d){(0,n.assertStruct)(d,e.VersionRangeStruct)}e.assertIsSemVerRange=a;function c(d,h){return(0,t.gt)(d,h)}e.gtVersion=c;function l(d,h){return(0,t.gtr)(d,h)}e.gtRange=l;function u(d,h){return(0,t.satisfies)(d,h,{includePrerelease:!0})}e.satisfiesVersionRange=u})(Nl);(function(e){var t=L&&L.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,o,a)}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=L&&L.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(ce,e),r(_r,e),r(B,e),r(Sn,e),r(Fe,e),r(Mt,e),r(El,e),r(mr,e),r(Sl,e),r(kl,e),r(Tt,e),r(Cl,e),r(je,e),r(Rl,e),r(Il,e),r(Al,e),r(Nl,e)})(nl);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=nl;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(rl);var Fl=L&&L.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vn,"__esModule",{value:!0});vn.PollingBlockTracker=void 0;const xg=Fl(Oi),Fg=Fl(cf),jg=hr,Oa=rl,xa=(0,Oa.createModuleLogger)(Oa.projectLogger,"polling-block-tracker"),Bg=(0,xg.default)(),Dg=1e3;class Hg extends jg.BaseBlockTracker{constructor(t={}){var r;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},t),{blockResetDuration:(r=t.blockResetDuration)!==null&&r!==void 0?r:t.pollingInterval})),this._provider=t.provider,this._pollingInterval=t.pollingInterval||20*Dg,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=t.keepEventLoopActive===void 0?!0:t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const r=Fa(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
3
+ ${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const s=Fa(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await s}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:Bg(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),xa("Making request",t);const r=await(0,Fg.default)(n=>this._provider.sendAsync(t,n))();if(xa("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
4
+ ${r.error.message}`);return r.result}}vn.PollingBlockTracker=Hg;function Fa(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var Ln={},Ug=L&&L.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.SubscribeBlockTracker=void 0;const Vg=Ug(Oi),Wg=hr,zg=(0,Vg.default)();class qg extends Wg.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...r){return new Promise((n,s)=>{this._provider.sendAsync({id:zg(),method:t,params:r,jsonrpc:"2.0"},(i,o)=>{i?s(i):n(o.result)})})}_handleSubData(t,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}Ln.SubscribeBlockTracker=qg;(function(e){var t=L&&L.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i),Object.defineProperty(n,o,{enumerable:!0,get:function(){return s[i]}})}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=L&&L.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(vn,e),r(Ln,e)})(tl);var Xi={},Mn={},yr={};Object.defineProperty(yr,"__esModule",{value:!0});yr.getUniqueId=void 0;const jl=4294967295;let Xs=Math.floor(Math.random()*jl);function Jg(){return Xs=(Xs+1)%jl,Xs}yr.getUniqueId=Jg;Object.defineProperty(Mn,"__esModule",{value:!0});Mn.createIdRemapMiddleware=void 0;const Gg=yr;function Zg(){return(e,t,r,n)=>{const s=e.id,i=Gg.getUniqueId();e.id=i,t.id=i,r(o=>{e.id=s,t.id=s,o()})}}Mn.createIdRemapMiddleware=Zg;var Tn={};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.createAsyncMiddleware=void 0;function Qg(e){return async(t,r,n,s)=>{let i;const o=new Promise(u=>{i=u});let a=null,c=!1;const l=async()=>{c=!0,n(u=>{a=u,i()}),await o};try{await e(t,r,l),c?(await o,a(null)):s(null)}catch(u){a?a(u):s(u)}}}Tn.createAsyncMiddleware=Qg;var Pn={};Object.defineProperty(Pn,"__esModule",{value:!0});Pn.createScaffoldMiddleware=void 0;function Kg(e){return(t,r,n,s)=>{const i=e[t.method];return i===void 0?n():typeof i=="function"?i(t,r,n,s):(r.result=i,s())}}Pn.createScaffoldMiddleware=Kg;var wr={},Yi={};Object.defineProperty(Yi,"__esModule",{value:!0});const Xg=Xa;function ja(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Yg(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let e_=class extends Xg.EventEmitter{emit(t,...r){let n=t==="error";const s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const i=s[t];if(i===void 0)return!1;if(typeof i=="function")ja(i,this,r);else{const o=i.length,a=Yg(i);for(let c=0;c<o;c+=1)ja(a[c],this,r)}return!0}};Yi.default=e_;var Bl={},Ge={},t_=Xt;Xt.default=Xt;Xt.stable=Ul;Xt.stableStringify=Ul;var Vr="[...]",Dl="[Circular]",ct=[],it=[];function Hl(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Xt(e,t,r,n){typeof n>"u"&&(n=Hl()),pi(e,"",0,[],void 0,0,n);var s;try{it.length===0?s=JSON.stringify(e,t,r):s=JSON.stringify(e,Vl(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;ct.length!==0;){var i=ct.pop();i.length===4?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return s}function kt(e,t,r,n){var s=Object.getOwnPropertyDescriptor(n,r);s.get!==void 0?s.configurable?(Object.defineProperty(n,r,{value:e}),ct.push([n,r,t,s])):it.push([t,r,e]):(n[r]=e,ct.push([n,r,t]))}function pi(e,t,r,n,s,i,o){i+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){kt(Dl,e,t,s);return}if(typeof o.depthLimit<"u"&&i>o.depthLimit){kt(Vr,e,t,s);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){kt(Vr,e,t,s);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)pi(e[a],a,a,n,e,i,o);else{var c=Object.keys(e);for(a=0;a<c.length;a++){var l=c[a];pi(e[l],l,a,n,e,i,o)}}n.pop()}}function r_(e,t){return e<t?-1:e>t?1:0}function Ul(e,t,r,n){typeof n>"u"&&(n=Hl());var s=gi(e,"",0,[],void 0,0,n)||e,i;try{it.length===0?i=JSON.stringify(s,t,r):i=JSON.stringify(s,Vl(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;ct.length!==0;){var o=ct.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function gi(e,t,r,n,s,i,o){i+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){kt(Dl,e,t,s);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&i>o.depthLimit){kt(Vr,e,t,s);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){kt(Vr,e,t,s);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)gi(e[a],a,a,n,e,i,o);else{var c={},l=Object.keys(e).sort(r_);for(a=0;a<l.length;a++){var u=l[a];gi(e[u],u,a,n,e,i,o),c[u]=e[u]}if(typeof s<"u")ct.push([s,t,e]),s[t]=c;else return c}n.pop()}}function Vl(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(it.length>0)for(var n=0;n<it.length;n++){var s=it[n];if(s[1]===t&&s[0]===r){r=s[2],it.splice(n,1);break}}return e.call(this,t,r)}}Object.defineProperty(Ge,"__esModule",{value:!0});Ge.EthereumProviderError=Ge.EthereumRpcError=void 0;const n_=t_;class Wl extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return n_.default(this.serialize(),o_,2)}}Ge.EthereumRpcError=Wl;class s_ extends Wl{constructor(t,r,n){if(!i_(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}Ge.EthereumProviderError=s_;function i_(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function o_(e,t){if(t!=="[Circular]")return t}var eo={},Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.errorValues=Ze.errorCodes=void 0;Ze.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Ze.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Ze,r=Ge,n=t.errorCodes.rpc.internal,s="Unspecified error message. This is a bug, please report it.",i={code:n,message:o(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(h,f=s){if(Number.isInteger(h)){const _=h.toString();if(d(t.errorValues,_))return t.errorValues[_].message;if(l(h))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return f}e.getMessageFromCode=o;function a(h){if(!Number.isInteger(h))return!1;const f=h.toString();return!!(t.errorValues[f]||l(h))}e.isValidCode=a;function c(h,{fallbackError:f=i,shouldIncludeStack:_=!1}={}){var p,g;if(!f||!Number.isInteger(f.code)||typeof f.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(h instanceof r.EthereumRpcError)return h.serialize();const b={};if(h&&typeof h=="object"&&!Array.isArray(h)&&d(h,"code")&&a(h.code)){const m=h;b.code=m.code,m.message&&typeof m.message=="string"?(b.message=m.message,d(m,"data")&&(b.data=m.data)):(b.message=o(b.code),b.data={originalError:u(h)})}else{b.code=f.code;const m=(p=h)===null||p===void 0?void 0:p.message;b.message=m&&typeof m=="string"?m:f.message,b.data={originalError:u(h)}}const y=(g=h)===null||g===void 0?void 0:g.stack;return _&&h&&y&&typeof y=="string"&&(b.stack=y),b}e.serializeError=c;function l(h){return h>=-32099&&h<=-32e3}function u(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function d(h,f){return Object.prototype.hasOwnProperty.call(h,f)}})(eo);var $n={};Object.defineProperty($n,"__esModule",{value:!0});$n.ethErrors=void 0;const to=Ge,zl=eo,ue=Ze;$n.ethErrors={rpc:{parse:e=>we(ue.errorCodes.rpc.parse,e),invalidRequest:e=>we(ue.errorCodes.rpc.invalidRequest,e),invalidParams:e=>we(ue.errorCodes.rpc.invalidParams,e),methodNotFound:e=>we(ue.errorCodes.rpc.methodNotFound,e),internal:e=>we(ue.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return we(t,e)},invalidInput:e=>we(ue.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>we(ue.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>we(ue.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>we(ue.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>we(ue.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>we(ue.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Wt(ue.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>Wt(ue.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>Wt(ue.errorCodes.provider.unsupportedMethod,e),disconnected:e=>Wt(ue.errorCodes.provider.disconnected,e),chainDisconnected:e=>Wt(ue.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new to.EthereumProviderError(t,r,n)}}};function we(e,t){const[r,n]=ql(t);return new to.EthereumRpcError(e,r||zl.getMessageFromCode(e),n)}function Wt(e,t){const[r,n]=ql(t);return new to.EthereumProviderError(e,r||zl.getMessageFromCode(e),n)}function ql(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Ge;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=eo;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=$n;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const s=Ze;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return s.errorCodes}})})(Bl);var a_=L&&L.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wr,"__esModule",{value:!0});wr.JsonRpcEngine=void 0;const c_=a_(Yi),ve=Bl;class Be extends c_.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,s)=>{try{const[i,o,a]=await Be._runAllMiddleware(t,r,this._middleware);return o?(await Be._runReturnHandlers(a),s(i)):n(async c=>{try{await Be._runReturnHandlers(a)}catch(l){return c(l)}return c()})}catch(i){return s(i)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,s)=>{r(s)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const o=new ve.EthereumRpcError(ve.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof t.method!="string"){const o=new ve.EthereumRpcError(ve.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(o,{id:t.id,jsonrpc:"2.0",error:o})}const n=Object.assign({},t),s={id:n.id,jsonrpc:n.jsonrpc};let i=null;try{await this._processRequest(n,s)}catch(o){i=o}return i&&(delete s.result,s.error||(s.error=ve.serializeError(i))),r(i,s)}async _processRequest(t,r){const[n,s,i]=await Be._runAllMiddleware(t,r,this._middleware);if(Be._checkForCompletion(t,r,s),await Be._runReturnHandlers(i),n)throw n}static async _runAllMiddleware(t,r,n){const s=[];let i=null,o=!1;for(const a of n)if([i,o]=await Be._runMiddleware(t,r,a,s),o)break;return[i,o,s.reverse()]}static _runMiddleware(t,r,n,s){return new Promise(i=>{const o=c=>{const l=c||r.error;l&&(r.error=ve.serializeError(l)),i([l,!0])},a=c=>{r.error?o(r.error):(c&&(typeof c!="function"&&o(new ve.EthereumRpcError(ve.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof c}" for request:
5
+ ${Ys(t)}`,{request:t})),s.push(c)),i([null,!1]))};try{n(t,r,a,o)}catch(c){o(c)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((n,s)=>{r(i=>i?s(i):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new ve.EthereumRpcError(ve.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
6
+ ${Ys(t)}`,{request:t});if(!n)throw new ve.EthereumRpcError(ve.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
7
+ ${Ys(t)}`,{request:t})}}wr.JsonRpcEngine=Be;function Ys(e){return JSON.stringify(e,null,2)}var On={};Object.defineProperty(On,"__esModule",{value:!0});On.mergeMiddleware=void 0;const l_=wr;function u_(e){const t=new l_.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}On.mergeMiddleware=u_;(function(e){var t=L&&L.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i),Object.defineProperty(n,o,{enumerable:!0,get:function(){return s[i]}})}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=L&&L.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(Mn,e),r(Tn,e),r(Pn,e),r(yr,e),r(wr,e),r(On,e)})(Xi);var Jl={},ro={},_i=function(e,t){return _i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])},_i(e,t)};function Gl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");_i(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Wr=function(){return Wr=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Wr.apply(this,arguments)};function Zl(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 s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function Ql(e,t,r,n){var s=arguments.length,i=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i}function Kl(e,t){return function(r,n){t(r,n,e)}}function Xl(e,t,r,n,s,i){function o(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!t&&e?n.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),d,h=!1,f=r.length-1;f>=0;f--){var _={};for(var p in n)_[p]=p==="access"?{}:n[p];for(var p in n.access)_.access[p]=n.access[p];_.addInitializer=function(b){if(h)throw new TypeError("Cannot add initializers after decoration has completed");i.push(o(b||null))};var g=(0,r[f])(a==="accessor"?{get:u.get,set:u.set}:u[c],_);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(d=o(g.get))&&(u.get=d),(d=o(g.set))&&(u.set=d),(d=o(g.init))&&s.unshift(d)}else(d=o(g))&&(a==="field"?s.unshift(d):u[c]=d)}l&&Object.defineProperty(l,n.name,u),h=!0}function Yl(e,t,r){for(var n=arguments.length>2,s=0;s<t.length;s++)r=n?t[s].call(e,r):t[s].call(e);return n?r:void 0}function eu(e){return typeof e=="symbol"?e:"".concat(e)}function tu(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function ru(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function nu(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function a(u){try{l(n.next(u))}catch(d){o(d)}}function c(u){try{l(n.throw(u))}catch(d){o(d)}}function l(u){u.done?i(u.value):s(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})}function su(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(n=1,s&&(i=l[0]&2?s.return:l[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,l[1])).done)return i;switch(s=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,s=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){r.label=l[1];break}if(l[0]===6&&r.label<i[1]){r.label=i[1],i=l;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(l);break}i[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(u){l=[6,u],s=0}finally{n=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var xn=Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]};function iu(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&xn(t,e,r)}function zr(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 no(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),s,i=[],o;try{for(;(t===void 0||t-- >0)&&!(s=n.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return i}function ou(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(no(arguments[t]));return e}function au(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),s=0,t=0;t<r;t++)for(var i=arguments[t],o=0,a=i.length;o<a;o++,s++)n[s]=i[o];return n}function cu(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,i;n<s;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function Pt(e){return this instanceof Pt?(this.v=e,this):new Pt(e)}function lu(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(f){return function(_){return Promise.resolve(_).then(f,d)}}function a(f,_){n[f]&&(s[f]=function(p){return new Promise(function(g,b){i.push([f,p,g,b])>1||c(f,p)})},_&&(s[f]=_(s[f])))}function c(f,_){try{l(n[f](_))}catch(p){h(i[0][3],p)}}function l(f){f.value instanceof Pt?Promise.resolve(f.value.v).then(u,d):h(i[0][2],f)}function u(f){c("next",f)}function d(f){c("throw",f)}function h(f,_){f(_),i.shift(),i.length&&c(i[0][0],i[0][1])}}function uu(e){var t,r;return t={},n("next"),n("throw",function(s){throw s}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(s,i){t[s]=e[s]?function(o){return(r=!r)?{value:Pt(e[s](o)),done:!1}:i?i(o):o}:i}}function du(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 zr=="function"?zr(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(o){return new Promise(function(a,c){o=e[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(l){i({value:l,done:a})},o)}}function hu(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var d_=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},mi=function(e){return mi=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},mi(e)};function fu(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=mi(e),n=0;n<r.length;n++)r[n]!=="default"&&xn(t,e,r[n]);return d_(t,e),t}function pu(e){return e&&e.__esModule?e:{default:e}}function gu(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function _u(e,t,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r}function mu(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function bu(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,s;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(s=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this)}catch(i){return Promise.reject(i)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var h_=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function yu(e){function t(i){e.error=e.hasError?new h_(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}var r,n=0;function s(){for(;r=e.stack.pop();)try{if(!r.async&&n===1)return n=0,e.stack.push(r),Promise.resolve().then(s);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(s,function(o){return t(o),s()})}else n|=1}catch(o){t(o)}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return s()}function wu(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,s,i,o){return n?t?".jsx":".js":s&&(!i||!o)?r:s+i+"."+o.toLowerCase()+"js"}):e}const f_={__extends:Gl,__assign:Wr,__rest:Zl,__decorate:Ql,__param:Kl,__esDecorate:Xl,__runInitializers:Yl,__propKey:eu,__setFunctionName:tu,__metadata:ru,__awaiter:nu,__generator:su,__createBinding:xn,__exportStar:iu,__values:zr,__read:no,__spread:ou,__spreadArrays:au,__spreadArray:cu,__await:Pt,__asyncGenerator:lu,__asyncDelegator:uu,__asyncValues:du,__makeTemplateObject:hu,__importStar:fu,__importDefault:pu,__classPrivateFieldGet:gu,__classPrivateFieldSet:_u,__classPrivateFieldIn:mu,__addDisposableResource:bu,__disposeResources:yu,__rewriteRelativeImportExtension:wu},p_=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:bu,get __assign(){return Wr},__asyncDelegator:uu,__asyncGenerator:lu,__asyncValues:du,__await:Pt,__awaiter:nu,__classPrivateFieldGet:gu,__classPrivateFieldIn:mu,__classPrivateFieldSet:_u,__createBinding:xn,__decorate:Ql,__disposeResources:yu,__esDecorate:Xl,__exportStar:iu,__extends:Gl,__generator:su,__importDefault:pu,__importStar:fu,__makeTemplateObject:hu,__metadata:ru,__param:Kl,__propKey:eu,__read:no,__rest:Zl,__rewriteRelativeImportExtension:wu,__runInitializers:Yl,__setFunctionName:tu,__spread:ou,__spreadArray:cu,__spreadArrays:au,__values:zr,default:f_},Symbol.toStringTag,{value:"Module"})),so=Gr(p_);var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0});var Ba=so,g_=function(){function e(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return e.prototype.acquire=function(){var t=this,r=this.isLocked(),n=new Promise(function(s){return t._queue.push(s)});return r||this._dispatch(),n},e.prototype.runExclusive=function(t){return Ba.__awaiter(this,void 0,void 0,function(){var r,n,s;return Ba.__generator(this,function(i){switch(i.label){case 0:return[4,this.acquire()];case 1:r=i.sent(),n=r[0],s=r[1],i.label=2;case 2:return i.trys.push([2,,4,5]),[4,t(n)];case 3:return[2,i.sent()];case 4:return s(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,t._value++,t._dispatch())},r([this._value--,this._currentReleaser])}},e}();Fn.default=g_;Object.defineProperty(ro,"__esModule",{value:!0});var Da=so,__=Fn,m_=function(){function e(){this._semaphore=new __.default(1)}return e.prototype.acquire=function(){return Da.__awaiter(this,void 0,void 0,function(){var t,r;return Da.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=n.sent(),r=t[1],[2,r]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();ro.default=m_;var jn={};Object.defineProperty(jn,"__esModule",{value:!0});jn.withTimeout=void 0;var xr=so;function b_(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(s,i){return xr.__awaiter(n,void 0,void 0,function(){var o,a,c;return xr.__generator(this,function(l){switch(l.label){case 0:return o=!1,setTimeout(function(){o=!0,i(r)},t),[4,e.acquire()];case 1:return a=l.sent(),o?(c=Array.isArray(a)?a[1]:a,c()):s(a),[2]}})})})},runExclusive:function(s){return xr.__awaiter(this,void 0,void 0,function(){var i,o;return xr.__generator(this,function(a){switch(a.label){case 0:i=function(){},a.label=1;case 1:return a.trys.push([1,,7,8]),[4,this.acquire()];case 2:return o=a.sent(),Array.isArray(o)?(i=o[1],[4,s(o[0])]):[3,4];case 3:return[2,a.sent()];case 4:return i=o,[4,s()];case 5:return[2,a.sent()];case 6:return[3,8];case 7:return i(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}jn.withTimeout=b_;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=ro;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=Fn;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=jn;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(Jl);var y_=v_,w_=Object.prototype.hasOwnProperty;function v_(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)w_.call(r,n)&&(e[n]=r[n])}return e}const E_=y_,S_=Oi();var k_=M;function M(e){const t=this;t.currentProvider=e}M.prototype.getBalance=vr(2,"eth_getBalance");M.prototype.getCode=vr(2,"eth_getCode");M.prototype.getTransactionCount=vr(2,"eth_getTransactionCount");M.prototype.getStorageAt=vr(3,"eth_getStorageAt");M.prototype.call=vr(2,"eth_call");M.prototype.protocolVersion=x("eth_protocolVersion");M.prototype.syncing=x("eth_syncing");M.prototype.coinbase=x("eth_coinbase");M.prototype.mining=x("eth_mining");M.prototype.hashrate=x("eth_hashrate");M.prototype.gasPrice=x("eth_gasPrice");M.prototype.accounts=x("eth_accounts");M.prototype.blockNumber=x("eth_blockNumber");M.prototype.getBlockTransactionCountByHash=x("eth_getBlockTransactionCountByHash");M.prototype.getBlockTransactionCountByNumber=x("eth_getBlockTransactionCountByNumber");M.prototype.getUncleCountByBlockHash=x("eth_getUncleCountByBlockHash");M.prototype.getUncleCountByBlockNumber=x("eth_getUncleCountByBlockNumber");M.prototype.sign=x("eth_sign");M.prototype.sendTransaction=x("eth_sendTransaction");M.prototype.sendRawTransaction=x("eth_sendRawTransaction");M.prototype.estimateGas=x("eth_estimateGas");M.prototype.getBlockByHash=x("eth_getBlockByHash");M.prototype.getBlockByNumber=x("eth_getBlockByNumber");M.prototype.getTransactionByHash=x("eth_getTransactionByHash");M.prototype.getTransactionByBlockHashAndIndex=x("eth_getTransactionByBlockHashAndIndex");M.prototype.getTransactionByBlockNumberAndIndex=x("eth_getTransactionByBlockNumberAndIndex");M.prototype.getTransactionReceipt=x("eth_getTransactionReceipt");M.prototype.getUncleByBlockHashAndIndex=x("eth_getUncleByBlockHashAndIndex");M.prototype.getUncleByBlockNumberAndIndex=x("eth_getUncleByBlockNumberAndIndex");M.prototype.getCompilers=x("eth_getCompilers");M.prototype.compileLLL=x("eth_compileLLL");M.prototype.compileSolidity=x("eth_compileSolidity");M.prototype.compileSerpent=x("eth_compileSerpent");M.prototype.newFilter=x("eth_newFilter");M.prototype.newBlockFilter=x("eth_newBlockFilter");M.prototype.newPendingTransactionFilter=x("eth_newPendingTransactionFilter");M.prototype.uninstallFilter=x("eth_uninstallFilter");M.prototype.getFilterChanges=x("eth_getFilterChanges");M.prototype.getFilterLogs=x("eth_getFilterLogs");M.prototype.getLogs=x("eth_getLogs");M.prototype.getWork=x("eth_getWork");M.prototype.submitWork=x("eth_submitWork");M.prototype.submitHashrate=x("eth_submitHashrate");M.prototype.sendAsync=function(e,t){this.currentProvider.sendAsync(C_(e),function(n,s){if(!n&&s.error&&(n=new Error("EthQuery - RPC Error - "+s.error.message)),n)return t(n);t(null,s.result)})};function x(e){return function(){const t=this;var r=[].slice.call(arguments),n=r.pop();t.sendAsync({method:e,params:r},n)}}function vr(e,t){return function(){const r=this;var n=[].slice.call(arguments),s=n.pop();n.length<e&&n.push("latest"),r.sendAsync({method:t,params:n},s)}}function C_(e){return E_({id:S_(),jsonrpc:"2.0",params:[]},e)}const Ha=(e,t,r,n)=>function(...s){const i=t.promiseModule;return new i((o,a)=>{t.multiArgs?s.push((...l)=>{t.errorFirst?l[0]?a(l):(l.shift(),o(l)):o(l)}):t.errorFirst?s.push((l,u)=>{l?a(l):o(u)}):s.push(o),Reflect.apply(e,this===r?n:this,s)})},Ua=new WeakMap;var R_=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);const n=(o,a)=>{let c=Ua.get(o);if(c||(c={},Ua.set(o,c)),a in c)return c[a];const l=_=>typeof _=="string"||typeof a=="symbol"?a===_:_.test(a),u=Reflect.getOwnPropertyDescriptor(o,a),d=u===void 0||u.writable||u.configurable,f=(t.include?t.include.some(l):!t.exclude.some(l))&&d;return c[a]=f,f},s=new WeakMap,i=new Proxy(e,{apply(o,a,c){const l=s.get(o);if(l)return Reflect.apply(l,a,c);const u=t.excludeMain?o:Ha(o,t,i,o);return s.set(o,u),Reflect.apply(u,a,c)},get(o,a){const c=o[a];if(!n(o,a)||c===Function.prototype[a])return c;const l=s.get(c);if(l)return l;if(typeof c=="function"){const u=Ha(c,t,i,o);return s.set(c,u),u}return c}});return i};const I_=fr.default;let A_=class extends I_{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(r=>this.emit("update",r))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};var io=A_;const N_=io;let L_=class extends N_{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}};var M_=L_,Er={minBlockRef:T_,maxBlockRef:P_,sortBlockRefs:oo,bnToHex:$_,blockRefIsNumber:O_,hexToInt:qr,incrementHexInt:x_,intToHex:vu,unsafeRandomBytes:F_};function T_(...e){return oo(e)[0]}function P_(...e){const t=oo(e);return t[t.length-1]}function oo(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:qr(t)-qr(r))}function $_(e){return"0x"+e.toString(16)}function O_(e){return e&&!["earliest","latest","pending"].includes(e)}function qr(e){return e==null?e:Number.parseInt(e,16)}function x_(e){if(e==null)return e;const t=qr(e);return vu(t+1)}function vu(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function F_(e){let t="0x";for(let r=0;r<e;r++)t+=Va(),t+=Va();return t}function Va(){return Math.floor(Math.random()*16).toString(16)}const j_=k_,B_=R_,D_=M_,{bnToHex:Xm,hexToInt:Fr,incrementHexInt:H_,minBlockRef:U_,blockRefIsNumber:V_}=Er;let W_=class extends D_{constructor({provider:t,params:r}){super(),this.type="log",this.ethQuery=new j_(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(n=>n.toLowerCase()))}async initialize({currentBlock:t}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=t),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=U_(this.params.toBlock,t),s=Object.assign({},this.params,{toBlock:n}),i=await this._fetchLogs(s);this.addInitialResults(i)}async update({oldBlock:t,newBlock:r}){const n=r;let s;t?s=H_(t):s=r;const i=Object.assign({},this.params,{fromBlock:s,toBlock:n}),a=(await this._fetchLogs(i)).filter(c=>this.matchLog(c));this.addResults(a)}async _fetchLogs(t){return await B_(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(Fr(this.params.fromBlock)>=Fr(t.blockNumber)||V_(this.params.toBlock)&&Fr(this.params.toBlock)<=Fr(t.blockNumber))return!1;const r=t.address&&t.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((s,i)=>{let o=t.topics[i];if(!o)return!1;o=o.toLowerCase();let a=Array.isArray(s)?s:[s];return a.includes(null)?!0:(a=a.map(u=>u.toLowerCase()),a.includes(o))})}};var z_=W_,ao=q_;async function q_({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=Wa(t),i=Wa(r)-n+1,o=Array(i).fill().map((c,l)=>n+l).map(J_);let a=await Promise.all(o.map(c=>Z_(e,"eth_getBlockByNumber",[c,!1])));return a=a.filter(c=>c!==null),a}function Wa(e){return e==null?e:Number.parseInt(e,16)}function J_(e){return e==null?e:"0x"+e.toString(16)}function G_(e,t){return new Promise((r,n)=>{e.sendAsync(t,(s,i)=>{s?n(s):i.error?n(i.error):i.result?r(i.result):n(new Error("Result was empty"))})})}async function Z_(e,t,r){for(let n=0;n<3;n++)try{return await G_(e,{id:1,jsonrpc:"2.0",method:t,params:r})}catch(s){console.error(`provider.sendAsync failed: ${s.stack||s.message||s}`)}return null}const Q_=io,K_=ao,{incrementHexInt:X_}=Er;let Y_=class extends Q_{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,s=X_(t),o=(await K_({provider:this.provider,fromBlock:s,toBlock:n})).map(a=>a.hash);this.addResults(o)}};var em=Y_;const tm=io,rm=ao,{incrementHexInt:nm}=Er;let sm=class extends tm{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=nm(t),s=await rm({provider:this.provider,fromBlock:n,toBlock:r}),i=[];for(const o of s)i.push(...o.transactions);this.addResults(i)}};var im=sm;const om=Jl.Mutex,{createAsyncMiddleware:am,createScaffoldMiddleware:cm}=Xi,lm=z_,um=em,dm=im,{intToHex:Eu,hexToInt:ei}=Er;var hm=fm;function fm({blockTracker:e,provider:t}){let r=0,n={};const s=new om,i=pm({mutex:s}),o=cm({eth_newFilter:i(ti(c)),eth_newBlockFilter:i(ti(l)),eth_newPendingTransactionFilter:i(ti(u)),eth_uninstallFilter:i(Dr(f)),eth_getFilterChanges:i(Dr(d)),eth_getFilterLogs:i(Dr(h))}),a=async({oldBlock:y,newBlock:m})=>{if(n.length===0)return;const I=await s.acquire();try{await Promise.all(bt(n).map(async v=>{try{await v.update({oldBlock:y,newBlock:m})}catch(A){console.error(A)}}))}catch(v){console.error(v)}I()};return o.newLogFilter=c,o.newBlockFilter=l,o.newPendingTransactionFilter=u,o.uninstallFilter=f,o.getFilterChanges=d,o.getFilterLogs=h,o.destroy=()=>{g()},o;async function c(y){const m=new lm({provider:t,params:y});return await _(m),m}async function l(){const y=new um({provider:t});return await _(y),y}async function u(){const y=new dm({provider:t});return await _(y),y}async function d(y){const m=ei(y),I=n[m];if(!I)throw new Error(`No filter for index "${m}"`);return I.getChangesAndClear()}async function h(y){const m=ei(y),I=n[m];if(!I)throw new Error(`No filter for index "${m}"`);let v=[];return I.type==="log"&&(v=I.getAllResults()),v}async function f(y){const m=ei(y),v=!!n[m];return v&&await p(m),v}async function _(y){const m=bt(n).length,I=await e.getLatestBlock();await y.initialize({currentBlock:I}),r++,n[r]=y,y.id=r,y.idHex=Eu(r);const v=bt(n).length;return b({prevFilterCount:m,newFilterCount:v}),r}async function p(y){const m=bt(n).length;delete n[y];const I=bt(n).length;b({prevFilterCount:m,newFilterCount:I})}async function g(){const y=bt(n).length;n={},b({prevFilterCount:y,newFilterCount:0})}function b({prevFilterCount:y,newFilterCount:m}){if(y===0&&m>0){e.on("sync",a);return}if(y>0&&m===0){e.removeListener("sync",a);return}}}function ti(e){return Dr(async(...t)=>{const r=await e(...t);return Eu(r.id)})}function Dr(e){return am(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function pm({mutex:e}){return t=>async(r,n,s,i)=>{(await e.acquire())(),t(r,n,s,i)}}function bt(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const gm=fr.default,{createAsyncMiddleware:za,createScaffoldMiddleware:_m}=Xi,mm=hm,{unsafeRandomBytes:bm,incrementHexInt:ym}=Er,wm=ao;var vm=Em;function Em({blockTracker:e,provider:t}){const r={},n=mm({blockTracker:e,provider:t});let s=!1;const i=new gm,o=_m({eth_subscribe:za(a),eth_unsubscribe:za(c)});return o.destroy=u,{events:i,middleware:o};async function a(d,h){if(s)throw new Error("SubscriptionManager - attempting to use after destroying");const f=d.params[0],_=bm(16);let p;switch(f){case"newHeads":p=g({subId:_});break;case"logs":const y=d.params[1],m=await n.newLogFilter(y);p=b({subId:_,filter:m});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${f}"`)}r[_]=p,h.result=_;return;function g({subId:y}){const m={type:f,destroy:async()=>{e.removeListener("sync",m.update)},update:async({oldBlock:I,newBlock:v})=>{const A=v,H=ym(I);(await wm({provider:t,fromBlock:H,toBlock:A})).map(Sm).filter(J=>J!==null).forEach(J=>{l(y,J)})}};return e.on("sync",m.update),m}function b({subId:y,filter:m}){return m.on("update",v=>l(y,v)),{type:f,destroy:async()=>await n.uninstallFilter(m.idHex)}}}async function c(d,h){if(s)throw new Error("SubscriptionManager - attempting to use after destroying");const f=d.params[0],_=r[f];if(!_){h.result=!1;return}delete r[f],await _.destroy(),h.result=!0}function l(d,h){i.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:d,result:h}})}function u(){i.removeAllListeners();for(const d in r)r[d].destroy(),delete r[d];s=!0}}function Sm(e){return e==null?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}Object.defineProperty(wn,"__esModule",{value:!0});wn.SubscriptionManager=void 0;const km=tl,Cm=vm,qa=()=>{};class Rm{constructor(t){const r=new km.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:s}=Cm({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=s}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,qa,qa),r}destroy(){this.subscriptionMiddleware.destroy()}}wn.SubscriptionManager=Rm;var Su=L&&L.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.CoinbaseWalletProvider=void 0;const Im=Su(Jr),Am=nd,F=er,P=S,Nm=sr,Ja=Ee,jr=Ft,_e=$t,ri=Su(rf),zt=xt,Lm=Lt,Mm=wn,Ga="DefaultChainId",Za="DefaultJsonRpcUrl";class Tm extends Am.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new Lm.FilterPolyfill(this),this._subscriptionManager=new Mm.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=t.qrUrl;const s=this.getChainId(),i=(0,P.prepend0x)(s.toString(16));this.emit("connect",{chainIdStr:i});const o=this._storage.getItem(Ja.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const a=o.split(" ");a[0]!==""&&(this._addresses=a.map(c=>(0,P.ensureAddressString)(c)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",a=>{var c;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"&&a.data.data.action==="dappChainSwitched"){const l=a.data.data.chainId,u=(c=a.data.data.jsonRpcUrl)!==null&&c!==void 0?c:this.jsonRpcUrl;this.updateProviderInfo(u,Number(l))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,P.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return(t=this._storage.getItem(Za))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(Za,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,r){this.jsonRpcUrl=t;const n=this.getChainId();this._storage.setItem(Ga,r.toString(10)),((0,P.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,s,i,o){const c=await(await this.initializeRelay()).watchAsset(t,r,n,s,i,o==null?void 0:o.toString()).promise;return(0,_e.isErrorResponse)(c)?!1:!!c.result}async addEthereumChain(t,r,n,s,i,o){var a,c;if((0,P.ensureIntNumber)(t)===this.getChainId())return!1;const l=await this.initializeRelay(),u=l.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!u&&await l.requestEthereumAccounts().promise;const d=await l.addEthereumChain(t.toString(),r,i,n,s,o).promise;return(0,_e.isErrorResponse)(d)?!1:(((a=d.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],t),((c=d.result)===null||c===void 0?void 0:c.isApproved)===!0)}async switchEthereumChain(t){const n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if((0,_e.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===F.standardErrorCodes.provider.unsupportedChain?F.standardErrors.provider.unsupportedChain():F.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const s=n.result;s.isApproved&&s.rpcUrl.length>0&&this.updateProviderInfo(s.rpcUrl,t)}setAppInfo(t,r){this.initializeRelay().then(n=>n.setAppInfo(t,r))}async enable(){var t;return(t=this.diagnostic)===null||t===void 0||t.log(zt.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?jr.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(t,r){try{const n=this._send(t,r);if(n instanceof Promise)return n.catch(s=>{throw(0,F.serializeError)(s,t)})}catch(n){throw(0,F.serializeError)(n,t)}}_send(t,r){if(typeof t=="string"){const s=t,i=Array.isArray(r)?r:r!==void 0?[r]:[],o={jsonrpc:"2.0",id:0,method:s,params:i};return this._sendRequestAsync(o).then(a=>a.result)}if(typeof r=="function"){const s=t,i=r;return this._sendAsync(s,i)}if(Array.isArray(t))return t.map(i=>this._sendRequest(i));const n=t;return this._sendRequest(n)}async sendAsync(t,r){try{return this._sendAsync(t,r).catch(n=>{throw(0,F.serializeError)(n,t)})}catch(n){return Promise.reject((0,F.serializeError)(n,t))}}async _sendAsync(t,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(t)){const s=r;this._sendMultipleRequestsAsync(t).then(i=>s(null,i)).catch(i=>s(i,null));return}const n=r;return this._sendRequestAsync(t).then(s=>n(null,s)).catch(s=>n(s,null))}async request(t){try{return this._request(t).catch(r=>{throw(0,F.serializeError)(r,t.method)})}catch(r){return Promise.reject((0,F.serializeError)(r,t.method))}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw F.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:r,params:n}=t;if(typeof r!="string"||r.length===0)throw F.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw F.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const s=n===void 0?[]:n,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:s,jsonrpc:"2.0",id:i})).result}async scanQRCode(t){const n=await(await this.initializeRelay()).scanQRCode((0,P.ensureRegExpString)(t)).promise;if((0,_e.isErrorResponse)(n))throw(0,F.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,F.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(t,r){const s=await(await this.initializeRelay()).genericRequest(t,r).promise;if((0,_e.isErrorResponse)(s))throw(0,F.serializeError)(s.errorMessage,"generic");if(typeof s.result!="string")throw(0,F.serializeError)("result was not a string","generic");return s.result}async connectAndSignIn(t){var r;(r=this.diagnostic)===null||r===void 0||r.log(zt.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?jr.Session.hash(this._relay.session.id):void 0});let n;try{const i=await this.initializeRelay();if(!(i instanceof Nm.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await i.connectAndSignIn(t).promise,(0,_e.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(i){throw typeof i.message=="string"&&i.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied account authorization"):i}if(!n.result)throw new Error("accounts received is empty");const{accounts:s}=n.result;return this._setAddresses(s),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(t){const n=await(await this.initializeRelay()).selectProvider(t).promise;if((0,_e.isErrorResponse)(n))throw(0,F.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,F.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){const r={jsonrpc:"2.0",id:t.id},{method:n}=t;if(r.result=this._handleSynchronousMethods(t),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(t,r){if(!Array.isArray(t))throw new Error("addresses is not an array");const n=t.map(s=>(0,P.ensureAddressString)(s));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(Ja.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(t){return new Promise((r,n)=>{try{const s=this._handleSynchronousMethods(t);if(s!==void 0)return r({jsonrpc:"2.0",id:t.id,result:s});const i=this._handleAsynchronousFilterMethods(t);if(i!==void 0){i.then(a=>r(Object.assign(Object.assign({},a),{id:t.id}))).catch(a=>n(a));return}const o=this._handleSubscriptionMethods(t);if(o!==void 0){o.then(a=>r({jsonrpc:"2.0",id:t.id,result:a.result})).catch(a=>n(a));return}}catch(s){return n(s)}this._handleAsynchronousMethods(t).then(s=>s&&r(Object.assign(Object.assign({},s),{id:t.id}))).catch(s=>n(s))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl).catch(i=>{var o;throw(i.code===F.standardErrorCodes.rpc.methodNotFound||i.code===F.standardErrorCodes.rpc.methodNotSupported)&&((o=this.diagnostic)===null||o===void 0||o.log(zt.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?jr.Session.hash(this._relay.session.id):void 0})),i})}_handleAsynchronousFilterMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(t){switch(t.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const r=(0,P.ensureAddressString)(t);return this._addresses.map(s=>(0,P.ensureAddressString)(s)).includes(r)}catch{}return!1}_ensureKnownAddress(t){var r;if(!this._isKnownAddress(t))throw(r=this.diagnostic)===null||r===void 0||r.log(zt.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const r=t.from?(0,P.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,P.ensureAddressString)(t.to):null,s=t.value!=null?(0,P.ensureBN)(t.value):new Im.default(0),i=t.data?(0,P.ensureBuffer)(t.data):O.alloc(0),o=t.nonce!=null?(0,P.ensureIntNumber)(t.nonce):null,a=t.gasPrice!=null?(0,P.ensureBN)(t.gasPrice):null,c=t.maxFeePerGas!=null?(0,P.ensureBN)(t.maxFeePerGas):null,l=t.maxPriorityFeePerGas!=null?(0,P.ensureBN)(t.maxPriorityFeePerGas):null,u=t.gas!=null?(0,P.ensureBN)(t.gas):null,d=t.chainId?(0,P.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:s,data:i,nonce:o,gasPriceInWei:a,maxFeePerGas:c,maxPriorityFeePerGas:l,gasLimit:u,chainId:d}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw F.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw F.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,s){this._ensureKnownAddress(r);try{const o=await(await this.initializeRelay()).signEthereumMessage(t,r,n,s).promise;if((0,_e.isErrorResponse)(o))throw new Error(o.errorMessage);return{jsonrpc:"2.0",id:0,result:o.result}}catch(i){throw typeof i.message=="string"&&i.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied message signature"):i}}async _ethereumAddressFromSignedMessage(t,r,n){const i=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;if((0,_e.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,P.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(Ga);if(!t)return(0,P.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,P.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log(zt.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?jr.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,_e.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const r=(0,P.ensureAddressString)(t[0]),n=(0,P.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,P.ensureBuffer)(t[0]),n=(0,P.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,P.ensureBuffer)(t[0]),n=(0,P.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,P.ensureBuffer)(t[0]),n=(0,P.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const s=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,_e.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,P.ensureBuffer)(t[0]),s=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,_e.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}async _eth_sendTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const s=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,_e.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,P.ensureParsedJSONObject)(t[0]),n=(0,P.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const s=ri.default.hashForSignTypedDataLegacy({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(s,n,!1,i)}async _eth_signTypedData_v3(t){this._requireAuthorization();const r=(0,P.ensureAddressString)(t[0]),n=(0,P.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const s=ri.default.hashForSignTypedData_v3({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(s,r,!1,i)}async _eth_signTypedData_v4(t){this._requireAuthorization();const r=(0,P.ensureAddressString)(t[0]),n=(0,P.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const s=ri.default.hashForSignTypedData_v4({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(s,r,!1,i)}async _cbwallet_arbitrary(t){const r=t[0],n=t[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(t){var r,n,s,i;const o=t[0];if(((r=o.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||o.chainName.trim()==="")throw F.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw F.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,(n=o.rpcUrls)!==null&&n!==void 0?n:[],(s=o.blockExplorerUrls)!==null&&s!==void 0?s:[],o.chainName,(i=o.iconUrls)!==null&&i!==void 0?i:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){const r=t[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const r=Array.isArray(t)?t[0]:t;if(!r.type)throw F.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw F.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw F.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw F.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:s,symbol:i,image:o,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,s,i,a,o,n)}}_eth_uninstallFilter(t){const r=(0,P.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(t){const r=t[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(t){const r=(0,P.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,P.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(t=>(t.setAccountsCallback((r,n)=>this._setAddresses(r,n)),t.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t))}}Ct.CoinbaseWalletProvider=Tm;var Bn={};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.RelayEventManager=void 0;const Pm=S;class $m{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,Pm.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}Bn.RelayEventManager=$m;Object.defineProperty(Zt,"__esModule",{value:!0});Zt.CoinbaseWalletSDK=void 0;const Om=Zr,xm=Qr,Qa=S,Fm=tn,jm=Ct,Bm=sr,Dm=dr,Hm=Bn,Um=or,Vm=ir,ku=Ot;class Dn{constructor(t){var r,n,s;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const i=t.linkAPIUrl||xm.LINK_API_URL;typeof t.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=(s=t.reloadOnDisconnect)!==null&&s!==void 0?s:!0;const o=new URL(i),a=`${o.protocol}//${o.host}`;if(this._storage=new Fm.ScopedLocalStorage(`-walletlink:${a}`),this._storage.setItem("version",Dn.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new Hm.RelayEventManager;const c=(0,Qa.isMobileWeb)(),l=t.uiConstructor||(d=>c?new Dm.MobileRelayUI(d):new Um.WalletLinkRelayUI(d)),u={linkAPIUrl:i,version:ku.LIB_VERSION,darkMode:!!t.darkMode,headlessMode:!!t.headlessMode,uiConstructor:l,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:t.enableMobileWalletLink};this._relay=c?new Bm.MobileRelay(u):new Vm.WalletLinkRelay(u),this.setAppInfo(t.appName,t.appLogoUrl),!t.headlessMode&&this._relay.attachUI()}makeWeb3Provider(t="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const s=this.coinbaseBrowser;if(s)return s;const i=this._relay;if(!i||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||i.setConnectDisabled(!0),new jm.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(i),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,r){var n;this._appName=t||"DApp",this._appLogoUrl=r||(0,Qa.getFavicon)();const s=this.walletExtension;s?this.isCipherProvider(s)||s.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(t=this._relay)===null||t===void 0||t.resetAndReload()}getQrUrl(){var t,r;return(r=(t=this._relay)===null||t===void 0?void 0:t.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(t,r=240){return(0,Om.walletLogo)(t,r)}get walletExtension(){var t;return(t=window.coinbaseWalletExtension)!==null&&t!==void 0?t:window.walletLinkExtension}get coinbaseBrowser(){var t,r;try{const n=(t=window.ethereum)!==null&&t!==void 0?t:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(t){return typeof t.isCipher=="boolean"&&t.isCipher}}Zt.CoinbaseWalletSDK=Dn;Dn.VERSION=ku.LIB_VERSION;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=Zt,r=Ct;var n=Zt;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var s=Ct;Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return s.CoinbaseWalletProvider}}),e.default=t.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=t.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=t.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(bi);const Wm=Ru(bi),rb=Iu({__proto__:null,default:Wm},[bi]);export{rb as i};