@dcl/auth-site 4.11.8 → 4.11.10-22674067433.commit-ec9ee87

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 (87) hide show
  1. package/assets/{ConstantsUtil-BQX7HsnL.js → ConstantsUtil-ESae-Z7-.js} +1 -1
  2. package/assets/{ContentfulRichText-DPkYryOf.js → ContentfulRichText-BtJfWm5x.js} +1 -1
  3. package/assets/{ExchangeController-BtY8fyq4.js → ExchangeController-IT3Dhd87.js} +1 -1
  4. package/assets/{HelpersUtil-DOwFo-Hj.js → HelpersUtil-DSNS5n-9.js} +1 -1
  5. package/assets/{NetworkUtil-Q1lCpwj_.js → NetworkUtil-BCvAceLL.js} +1 -1
  6. package/assets/{SwapController-7mDynTpf.js → SwapController-yDy01m5V.js} +1 -1
  7. package/assets/{biconomy-YBhnQs0Z.js → biconomy-B599Ur_0.js} +1 -1
  8. package/assets/{ccip-CoDft_oZ.js → ccip-_ZVU0YUG.js} +1 -1
  9. package/assets/{data-capture-hn5RW27t.js → data-capture-CzsW3pB7.js} +1 -1
  10. package/assets/{email-Cw2bOsdf.js → email-DWs9f9tH.js} +1 -1
  11. package/assets/{embedded-wallet-Dy44bHKo.js → embedded-wallet-P7U24FrG.js} +1 -1
  12. package/assets/{engine-BgpMSu3z.js → engine-DAuziGro.js} +1 -1
  13. package/assets/{extractIPFS-DtJENuR3.js → extractIPFS-DgGO_4eF.js} +1 -1
  14. package/assets/{features-BrCPmpJa.js → features--CaJUF7o.js} +1 -1
  15. package/assets/{fortmatic--CQzqtS9.js → fortmatic-BouPZqQI.js} +1 -1
  16. package/assets/{getInstalledModules-D33UIat_.js → getInstalledModules-Bdsr8t_C.js} +1 -1
  17. package/assets/{if-defined-DxVOAnDJ.js → if-defined-2xQLKahR.js} +1 -1
  18. package/assets/{in-app-wallet-calls-DRfida1Q.js → in-app-wallet-calls-D8l_xpYN.js} +1 -1
  19. package/assets/{index-CvydQ1vk.js → index-B9z9f635.js} +1 -1
  20. package/assets/{index--pHzy7s2.js → index-BIUEtDdG.js} +1 -1
  21. package/assets/{index-Uy6hLFQC.js → index-BQsAkTBu.js} +1 -1
  22. package/assets/{index-CPzYtLiL.js → index-BsWozatx.js} +1 -1
  23. package/assets/{index-DCXzB2v1.js → index-Bv3VmA8e.js} +1 -1
  24. package/assets/{index-Bfage5zm.js → index-C0hHgKRI.js} +1 -1
  25. package/assets/index-CA6Zy4Du.js +7 -0
  26. package/assets/{index-BbKlEfMM.js → index-CO5QKdxX.js} +1 -1
  27. package/assets/{index-Bdvs1sUD.js → index-CPXKpbtw.js} +1 -1
  28. package/assets/{index-BHlm8SCH.js → index-CQzRvO-C.js} +1 -1
  29. package/assets/{index-DRXgbQMf.js → index-CRA7VI9s.js} +1 -1
  30. package/assets/{index-5jFMQWem.js → index-CRvDhax9.js} +1 -1
  31. package/assets/{index-eS9nZBQ_.js → index-CUEaPFt-.js} +1 -1
  32. package/assets/{index-MkbCxs5D.js → index-CzHm4Ry3.js} +1 -1
  33. package/assets/{index-DvqnfQWj.js → index-CziCm94K.js} +1 -1
  34. package/assets/{index-Dtt62zfL.js → index-D0cHggih.js} +1 -1
  35. package/assets/{index-9C1IqxMv.js → index-D8AVDivV.js} +2 -2
  36. package/assets/{index-B5Fdda1I.js → index-D9rT-G2z.js} +1 -1
  37. package/assets/{index-DpWV6lC8.js → index-DAoSp5q5.js} +1 -1
  38. package/assets/{index-BTnr35AK.js → index-DIWcFA1F.js} +1 -1
  39. package/assets/{index-E0XCM0NA.js → index-DJO0bodJ.js} +1 -1
  40. package/assets/{index-CiAQnYPP.js → index-DPpJj3DF.js} +1 -1
  41. package/assets/{index-DJ695yh_.js → index-DRQzckTJ.js} +1 -1
  42. package/assets/{index-C7TTCW_t.js → index-DUoxxqna.js} +1 -1
  43. package/assets/{index-ouqtXSfx.js → index-DdCktyEF.js} +1 -1
  44. package/assets/{index-BQN7rTUi.js → index-Dl7iro_s.js} +1 -1
  45. package/assets/{index-BmjTa3C-.js → index-DvSlA4j0.js} +1 -1
  46. package/assets/index-DvuTX_1c.css +1 -0
  47. package/assets/{index-CUUkiX9o.js → index-EfYw_r-L.js} +1 -1
  48. package/assets/{index-BXXQsin7.js → index-HAgxNzWE.js} +1 -1
  49. package/assets/{index-CaZow84H.js → index-JH3zlM2a.js} +3 -3
  50. package/assets/{index-R1VG2j7u.js → index-JRJx2NpU.js} +1 -1
  51. package/assets/{index-CS6tZIdW.js → index-L_5Cs_kx.js} +1 -1
  52. package/assets/{index-DyZswp29.js → index-MkZbQyDw.js} +4 -4
  53. package/assets/{index-CEhWzJgu.js → index-MubCrWiB.js} +1 -1
  54. package/assets/{index-Clzc2P--.js → index-UvGAZXmw.js} +1 -1
  55. package/assets/{index-DBe-eY34.js → index-VsMuUpAO.js} +1 -1
  56. package/assets/{index-smXKM05U.js → index-fG1WBhYz.js} +75 -75
  57. package/assets/{index-t2b1wICj.js → index-gcHRu1bF.js} +1 -1
  58. package/assets/{index-Cma6p8BZ.js → index-jq6mMx3J.js} +1 -1
  59. package/assets/{index-Dl9CriuY.js → index-ppPPH70g.js} +1 -1
  60. package/assets/{index-CYwzS9fA.js → index-vWAYjUUv.js} +1 -1
  61. package/assets/{index-Cgg-yTxS.js → index-xFdcXlRb.js} +1 -1
  62. package/assets/{networks-CrhisHPn.js → networks-ZUADr5kB.js} +1 -1
  63. package/assets/{onramp-DejOUU3P.js → onramp-WAW9ejhZ.js} +1 -1
  64. package/assets/{openzeppelin-Ddp-5yhC.js → openzeppelin-DV82z7lJ.js} +1 -1
  65. package/assets/{parse-typed-data-Po2p-S7R.js → parse-typed-data-8DIRR0Kb.js} +1 -1
  66. package/assets/{passkeys-DwQyYlOZ.js → passkeys-BOJeUfAK.js} +1 -1
  67. package/assets/{pay-with-exchange-CGRG4qQr.js → pay-with-exchange-CNJhpLnE.js} +1 -1
  68. package/assets/{receive-BNVhIEvD.js → receive-ss1HRI3I.js} +1 -1
  69. package/assets/{ref-B0xYOT3W.js → ref-CoyvS0l-.js} +1 -1
  70. package/assets/{resolveImplementation-DhJsVmpC.js → resolveImplementation-C5lycJfC.js} +1 -1
  71. package/assets/{secp256k1-XiyJaJsr.js → secp256k1-DW9CEMKa.js} +1 -1
  72. package/assets/{send-CxnYme-U.js → send-C4Og1BUJ.js} +1 -1
  73. package/assets/{send-eip712-transaction-U1q3xlwZ.js → send-eip712-transaction-C2PvhNcm.js} +1 -1
  74. package/assets/{send-gasless-transaction-DwTTxkHu.js → send-gasless-transaction-DIQuGEL1.js} +2 -2
  75. package/assets/{socials-DuPEDP2_.js → socials-C7aTr6Px.js} +1 -1
  76. package/assets/{swaps-Cm5JGszN.js → swaps-BDatuUE1.js} +1 -1
  77. package/assets/{thirdweb-DJ6M-BwS.js → thirdweb-juEAwwxR.js} +3 -3
  78. package/assets/{transactions-b5klMiOZ.js → transactions-Do481Xcb.js} +1 -1
  79. package/assets/ui-BsoeejM4.js +762 -0
  80. package/assets/{vendor-BEhhKlB7.js → vendor-C-guZ9WP.js} +1 -1
  81. package/assets/{w3m-modal-B70d65lJ.js → w3m-modal-Cj2A1qC_.js} +1 -1
  82. package/assets/{web-connector-Dvwf76uN.js → web-connector-DIFP2_dO.js} +3 -3
  83. package/index.html +5 -6
  84. package/package.json +3 -3
  85. package/assets/index-BTojvMex.css +0 -1
  86. package/assets/index-CEMvQ_XD.js +0 -21
  87. package/assets/ui-XR5Y2K5q.js +0 -741
@@ -0,0 +1,7 @@
1
+ import{a as jt,p as As,ao as au,g as cu}from"./thirdweb-juEAwwxR.js";import{b as Ht,a as D,e as uu,f as lu,h as du,i as hu,l as fu,m as gu,n as pu,o as mu,p as Ic}from"./ui-BsoeejM4.js";import{eq as bu,er as wu,es as yu,et as Ns}from"./index-fG1WBhYz.js";function vu(e,n){for(var r=0;r<n.length;r++){const t=n[r];if(typeof t!="string"&&!Array.isArray(t)){for(const l in t)if(l!=="default"&&!(l in e)){const c=Object.getOwnPropertyDescriptor(t,l);c&&Object.defineProperty(e,l,c.get?c:{enumerable:!0,get:()=>t[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Gr={},Fe={},qe={},yi;function Eu(){if(yi)return qe;yi=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.walletLogo=void 0;const e=(n,r)=>{let t;switch(n){case"standard":return t=r,`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 t=r,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${r}' height='${t}' 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 t=(.1*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 t=(.25*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 t=(.1*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 t=(.25*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 t=r,`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 `}};return qe.walletLogo=e,qe}var De={},vi;function _u(){return vi||(vi=1,Object.defineProperty(De,"__esModule",{value:!0}),De.LINK_API_URL=void 0,De.LINK_API_URL="https://www.walletlink.org"),De}var O={},Zr={},de={},Ei;function Ut(){return Ei||(Ei=1,Object.defineProperty(de,"__esModule",{value:!0}),de.errorValues=de.standardErrorCodes=void 0,de.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}},de.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."}}),de}var je={},Qr={},_i;function Ts(){return _i||(_i=1,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 n=Ut(),r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function t(a,s=r){if(a&&Number.isInteger(a)){const f=a.toString();if(h(n.errorValues,f))return n.errorValues[f].message;if(g(a))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return s}e.getMessageFromCode=t;function l(a){if(!Number.isInteger(a))return!1;const s=a.toString();return!!(n.errorValues[s]||g(a))}e.isValidCode=l;function c(a){var s;if(typeof a=="number")return a;if(o(a))return(s=a.code)!==null&&s!==void 0?s:a.errorCode}e.getErrorCode=c;function o(a){return typeof a=="object"&&a!==null&&(typeof a.code=="number"||typeof a.errorCode=="number")}function p(a,{shouldIncludeStack:s=!1}={}){const f={};if(a&&typeof a=="object"&&!Array.isArray(a)&&h(a,"code")&&l(a.code)){const m=a;f.code=m.code,m.message&&typeof m.message=="string"?(f.message=m.message,h(m,"data")&&(f.data=m.data)):(f.message=t(f.code),f.data={originalError:u(a)})}else f.code=n.standardErrorCodes.rpc.internal,f.message=i(a,"message")?a.message:r,f.data={originalError:u(a)};return s&&(f.stack=i(a,"stack")?a.stack:void 0),f}e.serialize=p;function g(a){return a>=-32099&&a<=-32e3}function u(a){return a&&typeof a=="object"&&!Array.isArray(a)?Object.assign({},a):a}function h(a,s){return Object.prototype.hasOwnProperty.call(a,s)}function i(a,s){return typeof a=="object"&&a!==null&&s in a&&typeof a[s]=="string"}}(Qr)),Qr}var Ri;function Ru(){if(Ri)return je;Ri=1,Object.defineProperty(je,"__esModule",{value:!0}),je.standardErrors=void 0;const e=Ut(),n=Ts();je.standardErrors={rpc:{parse:g=>r(e.standardErrorCodes.rpc.parse,g),invalidRequest:g=>r(e.standardErrorCodes.rpc.invalidRequest,g),invalidParams:g=>r(e.standardErrorCodes.rpc.invalidParams,g),methodNotFound:g=>r(e.standardErrorCodes.rpc.methodNotFound,g),internal:g=>r(e.standardErrorCodes.rpc.internal,g),server:g=>{if(!g||typeof g!="object"||Array.isArray(g))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:u}=g;if(!Number.isInteger(u)||u>-32005||u<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return r(u,g)},invalidInput:g=>r(e.standardErrorCodes.rpc.invalidInput,g),resourceNotFound:g=>r(e.standardErrorCodes.rpc.resourceNotFound,g),resourceUnavailable:g=>r(e.standardErrorCodes.rpc.resourceUnavailable,g),transactionRejected:g=>r(e.standardErrorCodes.rpc.transactionRejected,g),methodNotSupported:g=>r(e.standardErrorCodes.rpc.methodNotSupported,g),limitExceeded:g=>r(e.standardErrorCodes.rpc.limitExceeded,g)},provider:{userRejectedRequest:g=>t(e.standardErrorCodes.provider.userRejectedRequest,g),unauthorized:g=>t(e.standardErrorCodes.provider.unauthorized,g),unsupportedMethod:g=>t(e.standardErrorCodes.provider.unsupportedMethod,g),disconnected:g=>t(e.standardErrorCodes.provider.disconnected,g),chainDisconnected:g=>t(e.standardErrorCodes.provider.chainDisconnected,g),unsupportedChain:g=>t(e.standardErrorCodes.provider.unsupportedChain,g),custom:g=>{if(!g||typeof g!="object"||Array.isArray(g))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:u,message:h,data:i}=g;if(!h||typeof h!="string")throw new Error('"message" must be a nonempty string');return new o(u,h,i)}}};function r(g,u){const[h,i]=l(u);return new c(g,h||(0,n.getMessageFromCode)(g),i)}function t(g,u){const[h,i]=l(u);return new o(g,h||(0,n.getMessageFromCode)(g),i)}function l(g){if(g){if(typeof g=="string")return[g];if(typeof g=="object"&&!Array.isArray(g)){const{message:u,data:h}=g;if(u&&typeof u!="string")throw new Error("Must specify string message.");return[u||void 0,h]}}return[]}class c extends Error{constructor(u,h,i){if(!Number.isInteger(u))throw new Error('"code" must be an integer.');if(!h||typeof h!="string")throw new Error('"message" must be a nonempty string.');super(h),this.code=u,i!==void 0&&(this.data=i)}}class o extends c{constructor(u,h,i){if(!p(u))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(u,h,i)}}function p(g){return Number.isInteger(g)&&g>=1e3&&g<=4999}return je}var He={},Ue={},Si;function Ps(){if(Si)return Ue;Si=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.isErrorResponse=void 0;function e(n){return n.errorMessage!==void 0}return Ue.isErrorResponse=e,Ue}var We={},Ci;function Os(){return Ci||(Ci=1,Object.defineProperty(We,"__esModule",{value:!0}),We.LIB_VERSION=void 0,We.LIB_VERSION="3.9.3"),We}var ki;function Su(){if(ki)return He;ki=1,Object.defineProperty(He,"__esModule",{value:!0}),He.serializeError=void 0;const e=Ps(),n=Os(),r=Ut(),t=Ts();function l(p,g){const u=(0,t.serialize)(c(p),{shouldIncludeStack:!0}),h=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");h.searchParams.set("version",n.LIB_VERSION),h.searchParams.set("code",u.code.toString());const i=o(u.data,g);return i&&h.searchParams.set("method",i),h.searchParams.set("message",u.message),Object.assign(Object.assign({},u),{docUrl:h.href})}He.serializeError=l;function c(p){return typeof p=="string"?{message:p,code:r.standardErrorCodes.rpc.internal}:(0,e.isErrorResponse)(p)?Object.assign(Object.assign({},p),{message:p.errorMessage,code:p.errorCode,data:{method:p.method}}):p}function o(p,g){const u=p==null?void 0:p.method;if(u)return u;if(g!==void 0){if(typeof g=="string")return g;if(Array.isArray(g)){if(g.length>0)return g[0].method}else return g.method}}return He}var Ii;function Wt(){return Ii||(Ii=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const n=Ut();Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return n.standardErrorCodes}});const r=Ru();Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const t=Su();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return t.serializeError}});const l=Ts();Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return l.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return l.getMessageFromCode}})}(Zr)),Zr}var J={},Ai;function Vt(){if(Ai)return J;Ai=1,Object.defineProperty(J,"__esModule",{value:!0}),J.ProviderType=J.RegExpString=J.IntNumber=J.BigIntString=J.AddressString=J.HexString=J.OpaqueType=void 0;function e(){return t=>t}J.OpaqueType=e,J.HexString=e(),J.AddressString=e(),J.BigIntString=e();function n(t){return Math.floor(t)}J.IntNumber=n,J.RegExpString=e();var r;return function(t){t.CoinbaseWallet="CoinbaseWallet",t.MetaMask="MetaMask",t.Unselected=""}(r||(J.ProviderType=r={})),J}var Li;function ce(){if(Li)return O;Li=1;var e=O&&O.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(O,"__esModule",{value:!0}),O.isMobileWeb=O.getLocation=O.isInIFrame=O.createQrUrl=O.getFavicon=O.range=O.isBigNumber=O.ensureParsedJSONObject=O.ensureBN=O.ensureRegExpString=O.ensureIntNumber=O.ensureBuffer=O.ensureAddressString=O.ensureEvenLengthHexString=O.ensureHexString=O.isHexString=O.prepend0x=O.strip0x=O.has0xPrefix=O.hexStringFromIntNumber=O.intNumberFromHexString=O.bigIntStringFromBN=O.hexStringFromBuffer=O.hexStringToUint8Array=O.uint8ArrayToHex=O.randomBytesHex=void 0;const n=e(Ht()),r=Wt(),t=Vt(),l=/^[0-9]*$/,c=/^[a-f0-9]*$/;function o(R){return p(crypto.getRandomValues(new Uint8Array(R)))}O.randomBytesHex=o;function p(R){return[...R].map(I=>I.toString(16).padStart(2,"0")).join("")}O.uint8ArrayToHex=p;function g(R){return new Uint8Array(R.match(/.{1,2}/g).map(I=>parseInt(I,16)))}O.hexStringToUint8Array=g;function u(R,I=!1){const M=R.toString("hex");return(0,t.HexString)(I?`0x${M}`:M)}O.hexStringFromBuffer=u;function h(R){return(0,t.BigIntString)(R.toString(10))}O.bigIntStringFromBN=h;function i(R){return(0,t.IntNumber)(new n.default(y(R,!1),16).toNumber())}O.intNumberFromHexString=i;function a(R){return(0,t.HexString)(`0x${new n.default(R).toString(16)}`)}O.hexStringFromIntNumber=a;function s(R){return R.startsWith("0x")||R.startsWith("0X")}O.has0xPrefix=s;function f(R){return s(R)?R.slice(2):R}O.strip0x=f;function m(R){return s(R)?`0x${R.slice(2)}`:`0x${R}`}O.prepend0x=m;function b(R){if(typeof R!="string")return!1;const I=f(R).toLowerCase();return c.test(I)}O.isHexString=b;function d(R,I=!1){if(typeof R=="string"){const M=f(R).toLowerCase();if(c.test(M))return(0,t.HexString)(I?`0x${M}`:M)}throw r.standardErrors.rpc.invalidParams(`"${String(R)}" is not a hexadecimal string`)}O.ensureHexString=d;function y(R,I=!1){let M=d(R,!1);return M.length%2===1&&(M=(0,t.HexString)(`0${M}`)),I?(0,t.HexString)(`0x${M}`):M}O.ensureEvenLengthHexString=y;function w(R){if(typeof R=="string"){const I=f(R).toLowerCase();if(b(I)&&I.length===40)return(0,t.AddressString)(m(I))}throw r.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(R)}`)}O.ensureAddressString=w;function v(R){if(D.isBuffer(R))return R;if(typeof R=="string"){if(b(R)){const I=y(R,!1);return D.from(I,"hex")}return D.from(R,"utf8")}throw r.standardErrors.rpc.invalidParams(`Not binary data: ${String(R)}`)}O.ensureBuffer=v;function E(R){if(typeof R=="number"&&Number.isInteger(R))return(0,t.IntNumber)(R);if(typeof R=="string"){if(l.test(R))return(0,t.IntNumber)(Number(R));if(b(R))return(0,t.IntNumber)(new n.default(y(R,!1),16).toNumber())}throw r.standardErrors.rpc.invalidParams(`Not an integer: ${String(R)}`)}O.ensureIntNumber=E;function S(R){if(R instanceof RegExp)return(0,t.RegExpString)(R.toString());throw r.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(R)}`)}O.ensureRegExpString=S;function _(R){if(R!==null&&(n.default.isBN(R)||T(R)))return new n.default(R.toString(10),10);if(typeof R=="number")return new n.default(E(R));if(typeof R=="string"){if(l.test(R))return new n.default(R,10);if(b(R))return new n.default(y(R,!1),16)}throw r.standardErrors.rpc.invalidParams(`Not an integer: ${String(R)}`)}O.ensureBN=_;function C(R){if(typeof R=="string")return JSON.parse(R);if(typeof R=="object")return R;throw r.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(R)}`)}O.ensureParsedJSONObject=C;function T(R){if(R==null||typeof R.constructor!="function")return!1;const{constructor:I}=R;return typeof I.config=="function"&&typeof I.EUCLID=="number"}O.isBigNumber=T;function N(R,I){return Array.from({length:I-R},(M,L)=>R+L)}O.range=N;function x(){const R=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:I,host:M}=document.location,L=R?R.getAttribute("href"):null;return!L||L.startsWith("javascript:")||L.startsWith("vbscript:")?null:L.startsWith("http://")||L.startsWith("https://")||L.startsWith("data:")?L:L.startsWith("//")?I+L:`${I}//${M}${L}`}O.getFavicon=x;function F(R,I,M,L,P,j){const B=L?"parent-id":"id",H=new URLSearchParams({[B]:R,secret:I,server:M,v:P,chainId:j.toString()}).toString();return`${M}/#/link?${H}`}O.createQrUrl=F;function V(){try{return window.frameElement!==null}catch{return!1}}O.isInIFrame=V;function A(){try{return V()&&window.top?window.top.location:window.location}catch{return window.location}}O.getLocation=A;function k(){var R;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((R=window==null?void 0:window.navigator)===null||R===void 0?void 0:R.userAgent)}return O.isMobileWeb=k,O}var Ve={},Mi;function Cu(){if(Mi)return Ve;Mi=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.ScopedLocalStorage=void 0;let e=class{constructor(r){this.scope=r}setItem(r,t){localStorage.setItem(this.scopedKey(r),t)}getItem(r){return localStorage.getItem(this.scopedKey(r))}removeItem(r){localStorage.removeItem(this.scopedKey(r))}clear(){const r=this.scopedKey(""),t=[];for(let l=0;l<localStorage.length;l++){const c=localStorage.key(l);typeof c=="string"&&c.startsWith(r)&&t.push(c)}t.forEach(l=>localStorage.removeItem(l))}scopedKey(r){return`${this.scope}:${r}`}};return Ve.ScopedLocalStorage=e,Ve}var he={},ze={},$e={},Je={},Ni;function xs(){return Ni||(Ni=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.EVENTS=void 0,Je.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"}),Je}var Y={},Ti;function Bs(){if(Ti)return Y;Ti=1,Object.defineProperty(Y,"__esModule",{value:!0}),Y.RelayAbstract=Y.APP_VERSION_KEY=Y.LOCAL_STORAGE_ADDRESSES_KEY=Y.WALLET_USER_NAME_KEY=void 0;const e=Wt();Y.WALLET_USER_NAME_KEY="walletUsername",Y.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",Y.APP_VERSION_KEY="AppVersion";let n=class{async makeEthereumJSONRPCRequest(t,l){if(!l)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(l,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(c=>c.json()).then(c=>{if(!c)throw e.standardErrors.rpc.parse({});const o=c,{error:p}=o;if(p)throw(0,e.serializeError)(p,t.method);return o})}};return Y.RelayAbstract=n,Y}var Ge={},Pi;function Fs(){if(Pi)return Ge;Pi=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.Session=void 0;const e=uu(),n=ce(),r="session:id",t="session:secret",l="session:linked";let c=class Ac{constructor(p,g,u,h){this._storage=p,this._id=g||(0,n.randomBytesHex)(16),this._secret=u||(0,n.randomBytesHex)(32),this._key=new e.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!h}static load(p){const g=p.getItem(r),u=p.getItem(l),h=p.getItem(t);return g&&h?new Ac(p,g,h,u==="1"):null}static hash(p){return new e.sha256().update(p).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(p){this._linked=p,this.persistLinked()}save(){return this._storage.setItem(r,this._id),this._storage.setItem(t,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(l,this._linked?"1":"0")}};return Ge.Session=c,Ge}var Ze={},Qe={},Oi;function ku(){if(Oi)return Qe;Oi=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.Cipher=void 0;const e=ce();let n=class{constructor(t){this.secret=t}async encrypt(t){const l=this.secret;if(l.length!==64)throw Error("secret must be 256 bits");const c=crypto.getRandomValues(new Uint8Array(12)),o=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(l),{name:"aes-gcm"},!1,["encrypt","decrypt"]),p=new TextEncoder,g=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:c},o,p.encode(t)),u=16,h=g.slice(g.byteLength-u),i=g.slice(0,g.byteLength-u),a=new Uint8Array(h),s=new Uint8Array(i),f=new Uint8Array([...c,...a,...s]);return(0,e.uint8ArrayToHex)(f)}async decrypt(t){const l=this.secret;if(l.length!==64)throw Error("secret must be 256 bits");return new Promise((c,o)=>{(async function(){const p=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(l),{name:"aes-gcm"},!1,["encrypt","decrypt"]),g=(0,e.hexStringToUint8Array)(t),u=g.slice(0,12),h=g.slice(12,28),i=g.slice(28),a=new Uint8Array([...i,...h]),s={name:"AES-GCM",iv:new Uint8Array(u)};try{const f=await window.crypto.subtle.decrypt(s,p,a),m=new TextDecoder;c(m.decode(f))}catch(f){o(f)}})()})}};return Qe.Cipher=n,Qe}var Ke={},xi;function Iu(){if(xi)return Ke;xi=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.WalletLinkHTTP=void 0;let e=class{constructor(r,t,l){this.linkAPIUrl=r,this.sessionId=t;const c=`${t}:${l}`;this.auth=`Basic ${btoa(c)}`}async markUnseenEventsAsSeen(r){return Promise.all(r.map(t=>fetch(`${this.linkAPIUrl}/events/${t.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(t=>console.error("Unabled to mark event as failed:",t))}async fetchUnseenEvents(){var r;const t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){const{events:l,error:c}=await t.json();if(c)throw new Error(`Check unseen events failed: ${c}`);const o=(r=l==null?void 0:l.filter(p=>p.event==="Web3Response").map(p=>({type:"Event",sessionId:this.sessionId,eventId:p.id,event:p.event,data:p.data})))!==null&&r!==void 0?r:[];return this.markUnseenEventsAsSeen(o),o}throw new Error(`Check unseen events failed: ${t.status}`)}};return Ke.WalletLinkHTTP=e,Ke}var fe={},Bi;function Au(){if(Bi)return fe;Bi=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.WalletLinkWebSocket=fe.ConnectionState=void 0;var e;(function(r){r[r.DISCONNECTED=0]="DISCONNECTED",r[r.CONNECTING=1]="CONNECTING",r[r.CONNECTED=2]="CONNECTED"})(e||(fe.ConnectionState=e={}));let n=class{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,l=WebSocket){this.WebSocketClass=l,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,l)=>{var c;let o;try{this.webSocket=o=new this.WebSocketClass(this.url)}catch(p){l(p);return}(c=this.connectionStateListener)===null||c===void 0||c.call(this,e.CONNECTING),o.onclose=p=>{var g;this.clearWebSocket(),l(new Error(`websocket error ${p.code}: ${p.reason}`)),(g=this.connectionStateListener)===null||g===void 0||g.call(this,e.DISCONNECTED)},o.onopen=p=>{var g;t(),(g=this.connectionStateListener)===null||g===void 0||g.call(this,e.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},o.onmessage=p=>{var g,u;if(p.data==="h")(g=this.incomingDataListener)===null||g===void 0||g.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(p.data);(u=this.incomingDataListener)===null||u===void 0||u.call(this,h)}catch{}}})}disconnect(){var t;const{webSocket:l}=this;if(l){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,e.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{l.close()}catch{}}}sendData(t){const{webSocket:l}=this;if(!l){this.pendingData.push(t),this.connect();return}l.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}};return fe.WalletLinkWebSocket=n,fe}var Fi;function Lu(){if(Fi)return Ze;Fi=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.WalletLinkConnection=void 0;const e=Vt(),n=ku(),r=xs(),t=Bs(),l=Fs(),c=Iu(),o=Au(),p=1e4,g=6e4;let u=class{constructor({session:i,linkAPIUrl:a,listener:s,diagnostic:f,WebSocketClass:m=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,e.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=d=>{if(!d)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",w=>d.JsonRpcUrl&&this.handleChainUpdated(w,d.JsonRpcUrl)]]).forEach((w,v)=>{const E=d[v];E!==void 0&&w(E)})},this.handleDestroyed=d=>{var y,w;d==="1"&&((y=this.listener)===null||y===void 0||y.resetAndReload(),(w=this.diagnostic)===null||w===void 0||w.log(r.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:l.Session.hash(this.session.id)}))},this.handleAccountUpdated=async d=>{var y,w;try{const v=await this.cipher.decrypt(d);(y=this.listener)===null||y===void 0||y.accountUpdated(v)}catch{(w=this.diagnostic)===null||w===void 0||w.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(d,y)=>{var w,v;try{const E=await this.cipher.decrypt(y);(w=this.listener)===null||w===void 0||w.metadataUpdated(d,E)}catch{(v=this.diagnostic)===null||v===void 0||v.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:d})}},this.handleWalletUsernameUpdated=async d=>{this.handleMetadataUpdated(t.WALLET_USER_NAME_KEY,d)},this.handleAppVersionUpdated=async d=>{this.handleMetadataUpdated(t.APP_VERSION_KEY,d)},this.handleChainUpdated=async(d,y)=>{var w,v;try{const E=await this.cipher.decrypt(d),S=await this.cipher.decrypt(y);(w=this.listener)===null||w===void 0||w.chainUpdated(E,S)}catch{(v=this.diagnostic)===null||v===void 0||v.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=i,this.cipher=new n.Cipher(i.secret),this.diagnostic=f,this.listener=s;const b=new o.WalletLinkWebSocket(`${a}/rpc`,m);b.setConnectionStateListener(async d=>{var y;(y=this.diagnostic)===null||y===void 0||y.log(r.EVENTS.CONNECTED_STATE_CHANGE,{state:d,sessionIdHash:l.Session.hash(i.id)});let w=!1;switch(d){case o.ConnectionState.DISCONNECTED:if(!this.destroyed){const v=async()=>{await new Promise(E=>setTimeout(E,5e3)),this.destroyed||b.connect().catch(()=>{v()})};v()}break;case o.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),w=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},p),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case o.ConnectionState.CONNECTING:break}this.connected!==w&&(this.connected=w)}),b.setIncomingDataListener(d=>{var y,w,v;switch(d.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const E=d.type==="IsLinkedOK"?d.linked:void 0;(y=this.diagnostic)===null||y===void 0||y.log(r.EVENTS.LINKED,{sessionIdHash:l.Session.hash(i.id),linked:E,type:d.type,onlineGuests:d.onlineGuests}),this.linked=E||d.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(w=this.diagnostic)===null||w===void 0||w.log(r.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:l.Session.hash(i.id),metadata_keys:d&&d.metadata?Object.keys(d.metadata):void 0}),this.handleSessionMetadataUpdated(d.metadata);break}case"Event":{this.handleIncomingEvent(d);break}}d.id!==void 0&&((v=this.requestResolutions.get(d.id))===null||v===void 0||v(d))}),this.ws=b,this.http=new c.WalletLinkHTTP(a,i.id,i.key)}connect(){var i;if(this.destroyed)throw new Error("instance is destroyed");(i=this.diagnostic)===null||i===void 0||i.log(r.EVENTS.STARTED_CONNECTING,{sessionIdHash:l.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var i;this.destroyed=!0,this.ws.disconnect(),(i=this.diagnostic)===null||i===void 0||i.log(r.EVENTS.DISCONNECTED,{sessionIdHash:l.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(i){var a,s;this._connected=i,i&&((a=this.onceConnected)===null||a===void 0||a.call(this)),(s=this.listener)===null||s===void 0||s.connectedUpdated(i)}setOnceConnected(i){return new Promise(a=>{this.connected?i().then(a):this.onceConnected=()=>{i().then(a),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(i){var a,s;this._linked=i,i&&((a=this.onceLinked)===null||a===void 0||a.call(this)),(s=this.listener)===null||s===void 0||s.linkedUpdated(i)}setOnceLinked(i){return new Promise(a=>{this.linked?i().then(a):this.onceLinked=()=>{i().then(a),this.onceLinked=void 0}})}async handleIncomingEvent(i){var a,s;if(!(i.type!=="Event"||i.event!=="Web3Response"))try{const f=await this.cipher.decrypt(i.data),m=JSON.parse(f);if(m.type!=="WEB3_RESPONSE")return;(a=this.listener)===null||a===void 0||a.handleWeb3ResponseMessage(m)}catch{(s=this.diagnostic)===null||s===void 0||s.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(i=>setTimeout(i,250));try{await this.fetchUnseenEventsAPI()}catch(i){console.error("Unable to check for unseen events",i)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(a=>this.handleIncomingEvent(a))}async setSessionMetadata(i,a){const s={type:"SetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[i]:a}};return this.setOnceConnected(async()=>{const f=await this.makeRequest(s);if(f.type==="Fail")throw new Error(f.error||"failed to set session metadata")})}async publishEvent(i,a,s=!1){const f=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},a),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),m={type:"PublishEvent",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:i,data:f,callWebhook:s};return this.setOnceLinked(async()=>{const b=await this.makeRequest(m);if(b.type==="Fail")throw new Error(b.error||"failed to publish event");return b.eventId})}sendData(i){this.ws.sendData(JSON.stringify(i))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>p*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(i,a=g){const s=i.id;this.sendData(i);let f;return Promise.race([new Promise((m,b)=>{f=window.setTimeout(()=>{b(new Error(`request ${s} timed out`))},a)}),new Promise(m=>{this.requestResolutions.set(s,b=>{clearTimeout(f),m(b),this.requestResolutions.delete(s)})})])}async authenticate(){const i={type:"HostSession",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},a=await this.makeRequest(i);if(a.type==="Fail")throw new Error(a.error||"failed to authentcate")}sendIsLinked(){const i={type:"IsLinked",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(i)}sendGetSessionConfig(){const i={type:"GetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(i)}};return Ze.WalletLinkConnection=u,Ze}var Xe={},ge={},kt={},qi;function Mu(){return qi||(qi=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.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}'),kt}var Di;function Lc(){if(Di)return ge;Di=1;var e=ge&&ge.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ge,"__esModule",{value:!0}),ge.injectCssReset=void 0;const n=e(Mu());function r(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(n.default)),document.documentElement.appendChild(t)}return ge.injectCssReset=r,ge}var Ye={};const Z=jt(bu);var pe={};const yt=jt(wu),zt=jt(yu);var oe={},et={},ji;function Nu(){if(ji)return et;ji=1,Object.defineProperty(et,"__esModule",{value:!0}),et.CloseIcon=void 0;const e=Z;function n(r){return(0,e.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.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"}))}return et.CloseIcon=n,et}var tt={},Hi;function Tu(){if(Hi)return tt;Hi=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.CoinbaseWalletRound=void 0;const e=Z;function n(r){return(0,e.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,e.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,e.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"}))}return tt.CoinbaseWalletRound=n,tt}var rt={},Ui;function Pu(){if(Ui)return rt;Ui=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.QRCodeIcon=void 0;const e=Z;function n(r){return(0,e.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,e.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,e.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,e.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}return rt.QRCodeIcon=n,rt}var me={},Kr,Wi;function Ou(){if(Wi)return Kr;Wi=1;function e(s){this.mode=r.MODE_8BIT_BYTE,this.data=s,this.parsedData=[];for(var f=0,m=this.data.length;f<m;f++){var b=[],d=this.data.charCodeAt(f);d>65536?(b[0]=240|(d&1835008)>>>18,b[1]=128|(d&258048)>>>12,b[2]=128|(d&4032)>>>6,b[3]=128|d&63):d>2048?(b[0]=224|(d&61440)>>>12,b[1]=128|(d&4032)>>>6,b[2]=128|d&63):d>128?(b[0]=192|(d&1984)>>>6,b[1]=128|d&63):b[0]=d,this.parsedData.push(b)}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))}e.prototype={getLength:function(s){return this.parsedData.length},write:function(s){for(var f=0,m=this.parsedData.length;f<m;f++)s.put(this.parsedData[f],8)}};function n(s,f){this.typeNumber=s,this.errorCorrectLevel=f,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}n.prototype={addData:function(s){var f=new e(s);this.dataList.push(f),this.dataCache=null},isDark:function(s,f){if(s<0||this.moduleCount<=s||f<0||this.moduleCount<=f)throw new Error(s+","+f);return this.modules[s][f]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(s,f){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var m=0;m<this.moduleCount;m++){this.modules[m]=new Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[m][b]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(s,f),this.typeNumber>=7&&this.setupTypeNumber(s),this.dataCache==null&&(this.dataCache=n.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,f)},setupPositionProbePattern:function(s,f){for(var m=-1;m<=7;m++)if(!(s+m<=-1||this.moduleCount<=s+m))for(var b=-1;b<=7;b++)f+b<=-1||this.moduleCount<=f+b||(0<=m&&m<=6&&(b==0||b==6)||0<=b&&b<=6&&(m==0||m==6)||2<=m&&m<=4&&2<=b&&b<=4?this.modules[s+m][f+b]=!0:this.modules[s+m][f+b]=!1)},getBestMaskPattern:function(){for(var s=0,f=0,m=0;m<8;m++){this.makeImpl(!0,m);var b=c.getLostPoint(this);(m==0||s>b)&&(s=b,f=m)}return f},createMovieClip:function(s,f,m){var b=s.createEmptyMovieClip(f,m),d=1;this.make();for(var y=0;y<this.modules.length;y++)for(var w=y*d,v=0;v<this.modules[y].length;v++){var E=v*d,S=this.modules[y][v];S&&(b.beginFill(0,100),b.moveTo(E,w),b.lineTo(E+d,w),b.lineTo(E+d,w+d),b.lineTo(E,w+d),b.endFill())}return b},setupTimingPattern:function(){for(var s=8;s<this.moduleCount-8;s++)this.modules[s][6]==null&&(this.modules[s][6]=s%2==0);for(var f=8;f<this.moduleCount-8;f++)this.modules[6][f]==null&&(this.modules[6][f]=f%2==0)},setupPositionAdjustPattern:function(){for(var s=c.getPatternPosition(this.typeNumber),f=0;f<s.length;f++)for(var m=0;m<s.length;m++){var b=s[f],d=s[m];if(this.modules[b][d]==null)for(var y=-2;y<=2;y++)for(var w=-2;w<=2;w++)y==-2||y==2||w==-2||w==2||y==0&&w==0?this.modules[b+y][d+w]=!0:this.modules[b+y][d+w]=!1}},setupTypeNumber:function(s){for(var f=c.getBCHTypeNumber(this.typeNumber),m=0;m<18;m++){var b=!s&&(f>>m&1)==1;this.modules[Math.floor(m/3)][m%3+this.moduleCount-8-3]=b}for(var m=0;m<18;m++){var b=!s&&(f>>m&1)==1;this.modules[m%3+this.moduleCount-8-3][Math.floor(m/3)]=b}},setupTypeInfo:function(s,f){for(var m=this.errorCorrectLevel<<3|f,b=c.getBCHTypeInfo(m),d=0;d<15;d++){var y=!s&&(b>>d&1)==1;d<6?this.modules[d][8]=y:d<8?this.modules[d+1][8]=y:this.modules[this.moduleCount-15+d][8]=y}for(var d=0;d<15;d++){var y=!s&&(b>>d&1)==1;d<8?this.modules[8][this.moduleCount-d-1]=y:d<9?this.modules[8][15-d-1+1]=y:this.modules[8][15-d-1]=y}this.modules[this.moduleCount-8][8]=!s},mapData:function(s,f){for(var m=-1,b=this.moduleCount-1,d=7,y=0,w=this.moduleCount-1;w>0;w-=2)for(w==6&&w--;;){for(var v=0;v<2;v++)if(this.modules[b][w-v]==null){var E=!1;y<s.length&&(E=(s[y]>>>d&1)==1);var S=c.getMask(f,b,w-v);S&&(E=!E),this.modules[b][w-v]=E,d--,d==-1&&(y++,d=7)}if(b+=m,b<0||this.moduleCount<=b){b-=m,m=-m;break}}}},n.PAD0=236,n.PAD1=17,n.createData=function(s,f,m){for(var b=u.getRSBlocks(s,f),d=new h,y=0;y<m.length;y++){var w=m[y];d.put(w.mode,4),d.put(w.getLength(),c.getLengthInBits(w.mode,s)),w.write(d)}for(var v=0,y=0;y<b.length;y++)v+=b[y].dataCount;if(d.getLengthInBits()>v*8)throw new Error("code length overflow. ("+d.getLengthInBits()+">"+v*8+")");for(d.getLengthInBits()+4<=v*8&&d.put(0,4);d.getLengthInBits()%8!=0;)d.putBit(!1);for(;!(d.getLengthInBits()>=v*8||(d.put(n.PAD0,8),d.getLengthInBits()>=v*8));)d.put(n.PAD1,8);return n.createBytes(d,b)},n.createBytes=function(s,f){for(var m=0,b=0,d=0,y=new Array(f.length),w=new Array(f.length),v=0;v<f.length;v++){var E=f[v].dataCount,S=f[v].totalCount-E;b=Math.max(b,E),d=Math.max(d,S),y[v]=new Array(E);for(var _=0;_<y[v].length;_++)y[v][_]=255&s.buffer[_+m];m+=E;var C=c.getErrorCorrectPolynomial(S),T=new g(y[v],C.getLength()-1),N=T.mod(C);w[v]=new Array(C.getLength()-1);for(var _=0;_<w[v].length;_++){var x=_+N.getLength()-w[v].length;w[v][_]=x>=0?N.get(x):0}}for(var F=0,_=0;_<f.length;_++)F+=f[_].totalCount;for(var V=new Array(F),A=0,_=0;_<b;_++)for(var v=0;v<f.length;v++)_<y[v].length&&(V[A++]=y[v][_]);for(var _=0;_<d;_++)for(var v=0;v<f.length;v++)_<w[v].length&&(V[A++]=w[v][_]);return V};for(var r={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},t={L:1,M:0,Q:3,H:2},l={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},c={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(s){for(var f=s<<10;c.getBCHDigit(f)-c.getBCHDigit(c.G15)>=0;)f^=c.G15<<c.getBCHDigit(f)-c.getBCHDigit(c.G15);return(s<<10|f)^c.G15_MASK},getBCHTypeNumber:function(s){for(var f=s<<12;c.getBCHDigit(f)-c.getBCHDigit(c.G18)>=0;)f^=c.G18<<c.getBCHDigit(f)-c.getBCHDigit(c.G18);return s<<12|f},getBCHDigit:function(s){for(var f=0;s!=0;)f++,s>>>=1;return f},getPatternPosition:function(s){return c.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,f,m){switch(s){case l.PATTERN000:return(f+m)%2==0;case l.PATTERN001:return f%2==0;case l.PATTERN010:return m%3==0;case l.PATTERN011:return(f+m)%3==0;case l.PATTERN100:return(Math.floor(f/2)+Math.floor(m/3))%2==0;case l.PATTERN101:return f*m%2+f*m%3==0;case l.PATTERN110:return(f*m%2+f*m%3)%2==0;case l.PATTERN111:return(f*m%3+(f+m)%2)%2==0;default:throw new Error("bad maskPattern:"+s)}},getErrorCorrectPolynomial:function(s){for(var f=new g([1],0),m=0;m<s;m++)f=f.multiply(new g([1,o.gexp(m)],0));return f},getLengthInBits:function(s,f){if(1<=f&&f<10)switch(s){case r.MODE_NUMBER:return 10;case r.MODE_ALPHA_NUM:return 9;case r.MODE_8BIT_BYTE:return 8;case r.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(f<27)switch(s){case r.MODE_NUMBER:return 12;case r.MODE_ALPHA_NUM:return 11;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(f<41)switch(s){case r.MODE_NUMBER:return 14;case r.MODE_ALPHA_NUM:return 13;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 12;default:throw new Error("mode:"+s)}else throw new Error("type:"+f)},getLostPoint:function(s){for(var f=s.getModuleCount(),m=0,b=0;b<f;b++)for(var d=0;d<f;d++){for(var y=0,w=s.isDark(b,d),v=-1;v<=1;v++)if(!(b+v<0||f<=b+v))for(var E=-1;E<=1;E++)d+E<0||f<=d+E||v==0&&E==0||w==s.isDark(b+v,d+E)&&y++;y>5&&(m+=3+y-5)}for(var b=0;b<f-1;b++)for(var d=0;d<f-1;d++){var S=0;s.isDark(b,d)&&S++,s.isDark(b+1,d)&&S++,s.isDark(b,d+1)&&S++,s.isDark(b+1,d+1)&&S++,(S==0||S==4)&&(m+=3)}for(var b=0;b<f;b++)for(var d=0;d<f-6;d++)s.isDark(b,d)&&!s.isDark(b,d+1)&&s.isDark(b,d+2)&&s.isDark(b,d+3)&&s.isDark(b,d+4)&&!s.isDark(b,d+5)&&s.isDark(b,d+6)&&(m+=40);for(var d=0;d<f;d++)for(var b=0;b<f-6;b++)s.isDark(b,d)&&!s.isDark(b+1,d)&&s.isDark(b+2,d)&&s.isDark(b+3,d)&&s.isDark(b+4,d)&&!s.isDark(b+5,d)&&s.isDark(b+6,d)&&(m+=40);for(var _=0,d=0;d<f;d++)for(var b=0;b<f;b++)s.isDark(b,d)&&_++;var C=Math.abs(100*_/f/f-50)/5;return m+=C*10,m}},o={glog:function(s){if(s<1)throw new Error("glog("+s+")");return o.LOG_TABLE[s]},gexp:function(s){for(;s<0;)s+=255;for(;s>=256;)s-=255;return o.EXP_TABLE[s]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},p=0;p<8;p++)o.EXP_TABLE[p]=1<<p;for(var p=8;p<256;p++)o.EXP_TABLE[p]=o.EXP_TABLE[p-4]^o.EXP_TABLE[p-5]^o.EXP_TABLE[p-6]^o.EXP_TABLE[p-8];for(var p=0;p<255;p++)o.LOG_TABLE[o.EXP_TABLE[p]]=p;function g(s,f){if(s.length==null)throw new Error(s.length+"/"+f);for(var m=0;m<s.length&&s[m]==0;)m++;this.num=new Array(s.length-m+f);for(var b=0;b<s.length-m;b++)this.num[b]=s[b+m]}g.prototype={get:function(s){return this.num[s]},getLength:function(){return this.num.length},multiply:function(s){for(var f=new Array(this.getLength()+s.getLength()-1),m=0;m<this.getLength();m++)for(var b=0;b<s.getLength();b++)f[m+b]^=o.gexp(o.glog(this.get(m))+o.glog(s.get(b)));return new g(f,0)},mod:function(s){if(this.getLength()-s.getLength()<0)return this;for(var f=o.glog(this.get(0))-o.glog(s.get(0)),m=new Array(this.getLength()),b=0;b<this.getLength();b++)m[b]=this.get(b);for(var b=0;b<s.getLength();b++)m[b]^=o.gexp(o.glog(s.get(b))+f);return new g(m,0).mod(s)}};function u(s,f){this.totalCount=s,this.dataCount=f}u.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]],u.getRSBlocks=function(s,f){var m=u.getRsBlockTable(s,f);if(m==null)throw new Error("bad rs block @ typeNumber:"+s+"/errorCorrectLevel:"+f);for(var b=m.length/3,d=[],y=0;y<b;y++)for(var w=m[y*3+0],v=m[y*3+1],E=m[y*3+2],S=0;S<w;S++)d.push(new u(v,E));return d},u.getRsBlockTable=function(s,f){switch(f){case t.L:return u.RS_BLOCK_TABLE[(s-1)*4+0];case t.M:return u.RS_BLOCK_TABLE[(s-1)*4+1];case t.Q:return u.RS_BLOCK_TABLE[(s-1)*4+2];case t.H:return u.RS_BLOCK_TABLE[(s-1)*4+3];default:return}};function h(){this.buffer=[],this.length=0}h.prototype={get:function(s){var f=Math.floor(s/8);return(this.buffer[f]>>>7-s%8&1)==1},put:function(s,f){for(var m=0;m<f;m++)this.putBit((s>>>f-m-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(s){var f=Math.floor(this.length/8);this.buffer.length<=f&&this.buffer.push(0),s&&(this.buffer[f]|=128>>>this.length%8),this.length++}};var i=[[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 a(s){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof s=="string"&&(s={content:s}),s)for(var f in s)this.options[f]=s[f];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 m(E){switch(E){case"L":return t.L;case"M":return t.M;case"Q":return t.Q;case"H":return t.H;default:throw new Error("Unknwon error correction level: "+E)}}function b(E,S){for(var _=d(E),C=1,T=0,N=0,x=i.length;N<=x;N++){var F=i[N];if(!F)throw new Error("Content too long: expected "+T+" but got "+_);switch(S){case"L":T=F[0];break;case"M":T=F[1];break;case"Q":T=F[2];break;case"H":T=F[3];break;default:throw new Error("Unknwon error correction level: "+S)}if(_<=T)break;C++}if(C>i.length)throw new Error("Content too long");return C}function d(E){var S=encodeURI(E).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return S.length+(S.length!=E?3:0)}var y=this.options.content,w=b(y,this.options.ecl),v=m(this.options.ecl);this.qrcode=new n(w,v),this.qrcode.addData(y),this.qrcode.make()}return a.prototype.svg=function(s){var f=this.options||{},m=this.qrcode.modules;typeof s>"u"&&(s={container:f.container||"svg"});for(var b=typeof f.pretty<"u"?!!f.pretty:!0,d=b?" ":"",y=b?`\r
2
+ `:"",w=f.width,v=f.height,E=m.length,S=w/(E+2*f.padding),_=v/(E+2*f.padding),C=typeof f.join<"u"?!!f.join:!1,T=typeof f.swap<"u"?!!f.swap:!1,N=typeof f.xmlDeclaration<"u"?!!f.xmlDeclaration:!0,x=typeof f.predefined<"u"?!!f.predefined:!1,F=x?d+'<defs><path id="qrmodule" d="M0 0 h'+_+" v"+S+' H0 z" style="fill:'+f.color+';shape-rendering:crispEdges;" /></defs>'+y:"",V=d+'<rect x="0" y="0" width="'+w+'" height="'+v+'" style="fill:'+f.background+';shape-rendering:crispEdges;"/>'+y,A="",k="",R=0;R<E;R++)for(var I=0;I<E;I++){var M=m[I][R];if(M){var L=I*S+f.padding*S,P=R*_+f.padding*_;if(T){var j=L;L=P,P=j}if(C){var B=S+L,H=_+P;L=Number.isInteger(L)?Number(L):L.toFixed(2),P=Number.isInteger(P)?Number(P):P.toFixed(2),B=Number.isInteger(B)?Number(B):B.toFixed(2),H=Number.isInteger(H)?Number(H):H.toFixed(2),k+="M"+L+","+P+" V"+H+" H"+B+" V"+P+" H"+L+" Z "}else x?A+=d+'<use x="'+L.toString()+'" y="'+P.toString()+'" href="#qrmodule" />'+y:A+=d+'<rect x="'+L.toString()+'" y="'+P.toString()+'" width="'+S+'" height="'+_+'" style="fill:'+f.color+';shape-rendering:crispEdges;"/>'+y}}C&&(A=d+'<path x="0" y="0" style="fill:'+f.color+';shape-rendering:crispEdges;" d="'+k+'" />');let W="";if(this.options.image!==void 0&&this.options.image.svg){const X=w*this.options.image.width/100,Be=v*this.options.image.height/100,St=w/2-X/2,Ct=v/2-Be/2;W+=`<svg x="${St}" y="${Ct}" width="${X}" height="${Be}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,W+=this.options.image.svg+y,W+="</svg>"}var q="";switch(s.container){case"svg":N&&(q+='<?xml version="1.0" standalone="yes"?>'+y),q+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+w+'" height="'+v+'">'+y,q+=F+V+A,q+=W,q+="</svg>";break;case"svg-viewbox":N&&(q+='<?xml version="1.0" standalone="yes"?>'+y),q+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+w+" "+v+'">'+y,q+=F+V+A,q+=W,q+="</svg>";break;case"g":q+='<g width="'+w+'" height="'+v+'">'+y,q+=F+V+A,q+=W,q+="</g>";break;default:q+=(F+V+A+W).replace(/^\s+/,"");break}return q},Kr=a,Kr}var Vi;function xu(){if(Vi)return me;Vi=1;var e=me&&me.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(me,"__esModule",{value:!0}),me.QRCode=void 0;const n=Z,r=zt,t=e(Ou()),l=c=>{const[o,p]=(0,r.useState)("");return(0,r.useEffect)(()=>{var g,u;const h=new t.default({content:c.content,background:c.bgColor||"#ffffff",color:c.fgColor||"#000000",container:"svg",ecl:"M",width:(g=c.width)!==null&&g!==void 0?g:256,height:(u=c.height)!==null&&u!==void 0?u:256,padding:0,image:c.image}),i=D.from(h.svg(),"utf8").toString("base64");p(`data:image/svg+xml;base64,${i}`)},[c.bgColor,c.content,c.fgColor,c.height,c.image,c.width]),o?(0,n.h)("img",{src:o,alt:"QR Code"}):null};return me.QRCode=l,me}var be={},It={},zi;function Bu(){return zi||(zi=1,Object.defineProperty(It,"__esModule",{value:!0}),It.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)}}"),It}var $i;function Fu(){if($i)return be;$i=1;var e=be&&be.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(be,"__esModule",{value:!0}),be.Spinner=void 0;const n=Z,r=e(Bu()),t=l=>{var c;const o=(c=l.size)!==null&&c!==void 0?c:64,p=l.color||"#000";return(0,n.h)("div",{class:"-cbwsdk-spinner"},(0,n.h)("style",null,r.default),(0,n.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:o,height:o}},(0,n.h)("circle",{style:{cx:50,cy:50,r:45,stroke:p}})))};return be.Spinner=t,be}var At={},Ji;function qu(){return Ji||(Ji=1,Object.defineProperty(At,"__esModule",{value:!0}),At.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}"),At}var Gi;function Du(){if(Gi)return oe;Gi=1;var e=oe&&oe.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(oe,"__esModule",{value:!0}),oe.CoinbaseWalletSteps=oe.ConnectContent=void 0;const n=e(yt),r=Z,t=ce(),l=Os(),c=Nu(),o=Tu(),p=Pu(),g=xu(),u=Fu(),h=e(qu()),i={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:m},a=b=>b==="light"?"#FFFFFF":"#0A0B0D";function s(b){const{theme:d}=b,y=(0,t.createQrUrl)(b.sessionId,b.sessionSecret,b.linkAPIUrl,b.isParentConnection,b.version,b.chainId),w=i.steps;return(0,r.h)("div",{"data-testid":"connect-content",className:(0,n.default)("-cbwsdk-connect-content",d)},(0,r.h)("style",null,h.default),(0,r.h)("div",{className:"-cbwsdk-connect-content-header"},(0,r.h)("h2",{className:(0,n.default)("-cbwsdk-connect-content-heading",d)},"Scan to connect with our mobile app"),b.onCancel&&(0,r.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:b.onCancel},(0,r.h)(c.CloseIcon,{fill:d==="light"?"#0A0B0D":"#FFFFFF"}))),(0,r.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,r.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,r.h)(f,{title:i.title,description:i.description,theme:d})),(0,r.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,r.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,r.h)(g.QRCode,{content:y,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,r.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:l.LIB_VERSION}),(0,r.h)("input",{type:"hidden",value:y})),(0,r.h)(w,{theme:d}),!b.isConnected&&(0,r.h)("div",{"data-testid":"connecting-spinner",className:(0,n.default)("-cbwsdk-connect-content-qr-connecting",d)},(0,r.h)(u.Spinner,{size:36,color:d==="dark"?"#FFF":"#000"}),(0,r.h)("p",null,"Connecting...")))))}oe.ConnectContent=s;function f({title:b,description:d,theme:y}){return(0,r.h)("div",{className:(0,n.default)("-cbwsdk-connect-item",y)},(0,r.h)("div",null,(0,r.h)(o.CoinbaseWalletRound,null)),(0,r.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,r.h)("h3",{className:"-cbwsdk-connect-item-title"},b),(0,r.h)("p",{className:"-cbwsdk-connect-item-description"},d)))}function m({theme:b}){return(0,r.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,r.h)("li",{className:(0,n.default)("-cbwsdk-wallet-steps-item",b)},(0,r.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,r.h)("li",{className:(0,n.default)("-cbwsdk-wallet-steps-item",b)},(0,r.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,r.h)("span",null,"Tap ",(0,r.h)("strong",null,"Scan")," "),(0,r.h)("span",{className:(0,n.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",b)},(0,r.h)(p.QRCodeIcon,{fill:a(b)})))))}return oe.CoinbaseWalletSteps=m,oe}var we={},nt={},Zi;function ju(){if(Zi)return nt;Zi=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.ArrowLeftIcon=void 0;const e=Z;function n(r){return(0,e.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.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"}))}return nt.ArrowLeftIcon=n,nt}var st={},Qi;function Hu(){if(Qi)return st;Qi=1,Object.defineProperty(st,"__esModule",{value:!0}),st.LaptopIcon=void 0;const e=Z;function n(r){return(0,e.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,e.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"}))}return st.LaptopIcon=n,st}var it={},Ki;function Uu(){if(Ki)return it;Ki=1,Object.defineProperty(it,"__esModule",{value:!0}),it.SafeIcon=void 0;const e=Z;function n(r){return(0,e.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.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"}))}return it.SafeIcon=n,it}var Lt={},Xi;function Wu(){return Xi||(Xi=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.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}"),Lt}var Yi;function Vu(){if(Yi)return we;Yi=1;var e=we&&we.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(we,"__esModule",{value:!0}),we.TryExtensionContent=void 0;const n=e(yt),r=Z,t=zt,l=ju(),c=Hu(),o=Uu(),p=e(Wu());function g({theme:u}){const[h,i]=(0,t.useState)(!1),a=(0,t.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),s=(0,t.useCallback)(()=>{h?window.location.reload():(a(),i(!0))},[a,h]);return(0,r.h)("div",{class:(0,n.default)("-cbwsdk-try-extension",u)},(0,r.h)("style",null,p.default),(0,r.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,r.h)("h3",{class:(0,n.default)("-cbwsdk-try-extension-heading",u)},"Or try the Coinbase Wallet browser extension"),(0,r.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,r.h)("button",{class:(0,n.default)("-cbwsdk-try-extension-cta",u),onClick:s},h?"Refresh":"Install"),(0,r.h)("div",null,!h&&(0,r.h)(l.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:u==="light"?"#0052FF":"#588AF5"})))),(0,r.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,r.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,r.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,r.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,r.h)("span",{class:(0,n.default)("-cbwsdk-try-extension-list-item-icon",u)},(0,r.h)(c.LaptopIcon,{fill:u==="light"?"#0A0B0D":"#FFFFFF"}))),(0,r.h)("div",{class:(0,n.default)("-cbwsdk-try-extension-list-item-copy",u)},"Connect with dapps with just one click on your desktop browser")),(0,r.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,r.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,r.h)("span",{class:(0,n.default)("-cbwsdk-try-extension-list-item-icon",u)},(0,r.h)(o.SafeIcon,{fill:u==="light"?"#0A0B0D":"#FFFFFF"}))),(0,r.h)("div",{class:(0,n.default)("-cbwsdk-try-extension-list-item-copy",u)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}return we.TryExtensionContent=g,we}var Mt={},eo;function zu(){return eo||(eo=1,Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.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}"),Mt}var to;function $u(){if(to)return pe;to=1;var e=pe&&pe.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(pe,"__esModule",{value:!0}),pe.ConnectDialog=void 0;const n=e(yt),r=Z,t=zt,l=Du(),c=Vu(),o=e(zu()),p=g=>{const{isOpen:u,darkMode:h}=g,[i,a]=(0,t.useState)(!u),[s,f]=(0,t.useState)(!u);(0,t.useEffect)(()=>{const b=[window.setTimeout(()=>{f(!u)},10)];return u?a(!1):b.push(window.setTimeout(()=>{a(!0)},360)),()=>{b.forEach(window.clearTimeout)}},[u]);const m=h?"dark":"light";return(0,r.h)("div",{class:(0,n.default)("-cbwsdk-connect-dialog-container",i&&"-cbwsdk-connect-dialog-container-hidden")},(0,r.h)("style",null,o.default),(0,r.h)("div",{class:(0,n.default)("-cbwsdk-connect-dialog-backdrop",m,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,r.h)("div",{class:"-cbwsdk-connect-dialog"},(0,r.h)("div",{class:(0,n.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},g.connectDisabled?null:(0,r.h)(l.ConnectContent,{theme:m,version:g.version,sessionId:g.sessionId,sessionSecret:g.sessionSecret,linkAPIUrl:g.linkAPIUrl,isConnected:g.isConnected,isParentConnection:g.isParentConnection,chainId:g.chainId,onCancel:g.onCancel}),(0,r.h)(c.TryExtensionContent,{theme:m}))))};return pe.ConnectDialog=p,pe}var ro;function Ju(){if(ro)return Ye;ro=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.LinkFlow=void 0;const e=Z,n=$u();let r=class{constructor(l){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=l.darkMode,this.version=l.version,this.sessionId=l.sessionId,this.sessionSecret=l.sessionSecret,this.linkAPIUrl=l.linkAPIUrl,this.isParentConnection=l.isParentConnection}attach(l){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",l.appendChild(this.root),this.render()}setConnected(l){this.connected!==l&&(this.connected=l,this.render())}setChainId(l){this.chainId!==l&&(this.chainId=l,this.render())}detach(){var l;this.root&&((0,e.render)(null,this.root),(l=this.root.parentElement)===null||l===void 0||l.removeChild(this.root))}setConnectDisabled(l){this.connectDisabled=l}open(l){this.isOpen=!0,this.onCancel=l.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,e.render)((0,e.h)(n.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)}};return Ye.LinkFlow=r,Ye}var ot={},Nt={},no;function Gu(){return no||(no=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.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}"),Nt}var so;function Mc(){return so||(so=1,function(e){var n=ot&&ot.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=n(yt),t=Z,l=zt,c=n(Gu()),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",p="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class g{constructor(a){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=a.darkMode}attach(a){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",a.appendChild(this.root),this.render()}presentItem(a){const s=this.nextItemKey++;return this.items.set(s,a),this.render(),()=>{this.items.delete(s),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,t.render)((0,t.h)("div",null,(0,t.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([a,s])=>(0,t.h)(e.SnackbarInstance,Object.assign({},s,{key:a}))))),this.root)}}e.Snackbar=g;const u=i=>(0,t.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,t.h)("style",null,c.default),(0,t.h)("div",{class:"-cbwsdk-snackbar"},i.children));e.SnackbarContainer=u;const h=({autoExpand:i,message:a,menuItems:s})=>{const[f,m]=(0,l.useState)(!0),[b,d]=(0,l.useState)(i??!1);(0,l.useEffect)(()=>{const w=[window.setTimeout(()=>{m(!1)},1),window.setTimeout(()=>{d(!0)},1e4)];return()=>{w.forEach(window.clearTimeout)}});const y=()=>{d(!b)};return(0,t.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",f&&"-cbwsdk-snackbar-instance-hidden",b&&"-cbwsdk-snackbar-instance-expanded")},(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:y},(0,t.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},a),(0,t.h)("div",{class:"-gear-container"},!b&&(0,t.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,t.h)("img",{src:p,class:"-gear-icon",title:"Expand"}))),s&&s.length>0&&(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},s.map((w,v)=>(0,t.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",w.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:w.onClick,key:v},(0,t.h)("svg",{width:w.svgWidth,height:w.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.h)("path",{"fill-rule":w.defaultFillRule,"clip-rule":w.defaultClipRule,d:w.path,fill:"#AAAAAA"})),(0,t.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",w.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},w.info)))))};e.SnackbarInstance=h}(ot)),ot}var io;function Nc(){if(io)return Xe;io=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.WalletLinkRelayUI=void 0;const e=Lc(),n=Ju(),r=Mc();let t=class{constructor(c){this.standalone=null,this.attached=!1,this.snackbar=new r.Snackbar({darkMode:c.darkMode}),this.linkFlow=new n.LinkFlow({darkMode:c.darkMode,version:c.version,sessionId:c.session.id,sessionSecret:c.session.secret,linkAPIUrl:c.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const c=document.documentElement,o=document.createElement("div");o.className="-cbwsdk-css-reset",c.appendChild(o),this.linkFlow.attach(o),this.snackbar.attach(o),this.attached=!0,(0,e.injectCssReset)()}setConnected(c){this.linkFlow.setConnected(c)}setChainId(c){this.linkFlow.setChainId(c)}setConnectDisabled(c){this.linkFlow.setConnectDisabled(c)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(c){this.linkFlow.open({onCancel:c.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(c){let o;return c.isUnlinkedErrorState?o={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:c.onResetConnection}]}:o={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:c.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:c.onResetConnection}]},this.snackbar.presentItem(o)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(c){this.standalone=c}isStandalone(){var c;return(c=this.standalone)!==null&&c!==void 0?c:!1}};return Xe.WalletLinkRelayUI=t,Xe}var oo;function Tc(){if(oo)return $e;oo=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.WalletLinkRelay=void 0;const e=Wt(),n=Vt(),r=ce(),t=xs(),l=Bs(),c=Fs(),o=Lu(),p=Ps(),g=Nc();let u=class Ne extends l.RelayAbstract{constructor(i){var a;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=b=>{var d;this.isLinked=b;const y=this.storage.getItem(l.LOCAL_STORAGE_ADDRESSES_KEY);if(b&&(this.session.linked=b),this.isUnlinkedErrorState=!1,y){const w=y.split(" "),v=this.storage.getItem("IsStandaloneSigning")==="true";if(w[0]!==""&&!b&&this.session.linked&&!v){this.isUnlinkedErrorState=!0;const E=this.getSessionIdHash();(d=this.diagnostic)===null||d===void 0||d.log(t.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:E})}}},this.metadataUpdated=(b,d)=>{this.storage.setItem(b,d)},this.chainUpdated=(b,d)=>{this.chainCallbackParams.chainId===b&&this.chainCallbackParams.jsonRpcUrl===d||(this.chainCallbackParams={chainId:b,jsonRpcUrl:d},this.chainCallback&&this.chainCallback(b,d))},this.accountUpdated=b=>{this.accountsCallback&&this.accountsCallback([b]),Ne.accountRequestCallbackIds.size>0&&(Array.from(Ne.accountRequestCallbackIds.values()).forEach(d=>{const y={type:"WEB3_RESPONSE",id:d,response:{method:"requestEthereumAccounts",result:[b]}};this.invokeCallback(Object.assign(Object.assign({},y),{id:d}))}),Ne.accountRequestCallbackIds.clear())},this.connectedUpdated=b=>{this.ui.setConnected(b)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=i.linkAPIUrl,this.storage=i.storage,this.options=i;const{session:s,ui:f,connection:m}=this.subscribe();this._session=s,this.connection=m,this.relayEventManager=i.relayEventManager,this.diagnostic=i.diagnosticLogger,this._reloadOnDisconnect=(a=i.reloadOnDisconnect)!==null&&a!==void 0?a:!0,this.ui=f}subscribe(){const i=c.Session.load(this.storage)||new c.Session(this.storage).save(),{linkAPIUrl:a,diagnostic:s}=this,f=new o.WalletLinkConnection({session:i,linkAPIUrl:a,diagnostic:s,listener:this}),{version:m,darkMode:b}=this.options,d=this.options.uiConstructor({linkAPIUrl:a,version:m,darkMode:b,session:i});return f.connect(),{session:i,ui:d,connection:f}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(i=>setTimeout(()=>i(null),1e3))]).then(()=>{var i,a;const s=this.ui.isStandalone();(i=this.diagnostic)===null||i===void 0||i.log(t.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const f=c.Session.load(this.storage);if((f==null?void 0:f.id)===this._session.id?this.storage.clear():f&&((a=this.diagnostic)===null||a===void 0||a.log(t.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:c.Session.hash(f.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:m,ui:b,connection:d}=this.subscribe();this._session=m,this.connection=d,this.ui=b,s&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(i=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(t.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${i}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(i,a){this.appName=i,this.appLogoUrl=a}getStorageItem(i){return this.storage.getItem(i)}get session(){return this._session}setStorageItem(i,a){this.storage.setItem(i,a)}signEthereumMessage(i,a,s,f){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,r.hexStringFromBuffer)(i,!0),address:a,addPrefix:s,typedDataJson:f||null}})}ethereumAddressFromSignedMessage(i,a,s){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,r.hexStringFromBuffer)(i,!0),signature:(0,r.hexStringFromBuffer)(a,!0),addPrefix:s}})}signEthereumTransaction(i){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:i.fromAddress,toAddress:i.toAddress,weiValue:(0,r.bigIntStringFromBN)(i.weiValue),data:(0,r.hexStringFromBuffer)(i.data,!0),nonce:i.nonce,gasPriceInWei:i.gasPriceInWei?(0,r.bigIntStringFromBN)(i.gasPriceInWei):null,maxFeePerGas:i.gasPriceInWei?(0,r.bigIntStringFromBN)(i.gasPriceInWei):null,maxPriorityFeePerGas:i.gasPriceInWei?(0,r.bigIntStringFromBN)(i.gasPriceInWei):null,gasLimit:i.gasLimit?(0,r.bigIntStringFromBN)(i.gasLimit):null,chainId:i.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(i){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:i.fromAddress,toAddress:i.toAddress,weiValue:(0,r.bigIntStringFromBN)(i.weiValue),data:(0,r.hexStringFromBuffer)(i.data,!0),nonce:i.nonce,gasPriceInWei:i.gasPriceInWei?(0,r.bigIntStringFromBN)(i.gasPriceInWei):null,maxFeePerGas:i.maxFeePerGas?(0,r.bigIntStringFromBN)(i.maxFeePerGas):null,maxPriorityFeePerGas:i.maxPriorityFeePerGas?(0,r.bigIntStringFromBN)(i.maxPriorityFeePerGas):null,gasLimit:i.gasLimit?(0,r.bigIntStringFromBN)(i.gasLimit):null,chainId:i.chainId,shouldSubmit:!0}})}submitEthereumTransaction(i,a){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,r.hexStringFromBuffer)(i,!0),chainId:a}})}scanQRCode(i){return this.sendRequest({method:"scanQRCode",params:{regExp:i}})}getQRCodeUrl(){return(0,r.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(i,a){return this.sendRequest({method:"generic",params:{action:a,data:i}})}sendGenericMessage(i){return this.sendRequest(i)}sendRequest(i){let a=null;const s=(0,r.randomBytesHex)(8),f=b=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,i.method,b),a==null||a()};return{promise:new Promise((b,d)=>{this.ui.isStandalone()||(a=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:f,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(s,y=>{if(a==null||a(),(0,p.isErrorResponse)(y))return d(new Error(y.errorMessage));b(y)}),this.ui.isStandalone()?this.sendRequestStandalone(s,i):this.publishWeb3RequestEvent(s,i)}),cancel:f}}setConnectDisabled(i){this.ui.setConnectDisabled(i)}setAccountsCallback(i){this.accountsCallback=i}setChainCallback(i){this.chainCallback=i}setDappDefaultChainCallback(i){this.dappDefaultChain=i,this.ui instanceof g.WalletLinkRelayUI&&this.ui.setChainId(i)}publishWeb3RequestEvent(i,a){var s;const f={type:"WEB3_REQUEST",id:i,request:a},m=c.Session.load(this.storage);(s=this.diagnostic)===null||s===void 0||s.log(t.EVENTS.WEB3_REQUEST,{eventId:f.id,method:`relay::${a.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:m?c.Session.hash(m.id):"",isSessionMismatched:((m==null?void 0:m.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",f,!0).then(b=>{var d;(d=this.diagnostic)===null||d===void 0||d.log(t.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:f.id,method:`relay::${a.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:m?c.Session.hash(m.id):"",isSessionMismatched:((m==null?void 0:m.id)!==this._session.id).toString()})}).catch(b=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:f.id,response:{method:a.method,errorMessage:b.message}})})}publishWeb3RequestCanceledEvent(i){const a={type:"WEB3_REQUEST_CANCELED",id:i};this.publishEvent("Web3RequestCanceled",a,!1).then()}publishEvent(i,a,s){return this.connection.publishEvent(i,a,s)}handleWeb3ResponseMessage(i){var a;const{response:s}=i;if((a=this.diagnostic)===null||a===void 0||a.log(t.EVENTS.WEB3_RESPONSE,{eventId:i.id,method:`relay::${s.method}`,sessionIdHash:this.getSessionIdHash()}),s.method==="requestEthereumAccounts"){Ne.accountRequestCallbackIds.forEach(f=>this.invokeCallback(Object.assign(Object.assign({},i),{id:f}))),Ne.accountRequestCallbackIds.clear();return}this.invokeCallback(i)}handleErrorResponse(i,a,s,f){var m;const b=(m=s==null?void 0:s.message)!==null&&m!==void 0?m:(0,e.getMessageFromCode)(f);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:a,errorMessage:b,errorCode:f}})}invokeCallback(i){const a=this.relayEventManager.callbacks.get(i.id);a&&(a(i.response),this.relayEventManager.callbacks.delete(i.id))}requestEthereumAccounts(){const i={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},a=(0,r.randomBytesHex)(8),s=m=>{this.publishWeb3RequestCanceledEvent(a),this.handleErrorResponse(a,i.method,m)};return{promise:new Promise((m,b)=>{if(this.relayEventManager.callbacks.set(a,d=>{if(this.ui.hideRequestEthereumAccounts(),(0,p.isErrorResponse)(d))return b(new Error(d.errorMessage));m(d)}),this.ui.inlineAccountsResponse()){const d=y=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:y}})};this.ui.requestEthereumAccounts({onCancel:s,onAccounts:d})}else{const d=e.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>s(d)})}Ne.accountRequestCallbackIds.add(a),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(a,i)}),cancel:s}}selectProvider(i){const a={method:"selectProvider"},s=(0,r.randomBytesHex)(8),f=b=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,a.method,b)},m=new Promise((b,d)=>{this.relayEventManager.callbacks.set(s,v=>{if((0,p.isErrorResponse)(v))return d(new Error(v.errorMessage));b(v)});const y=v=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"selectProvider",result:n.ProviderType.Unselected}})},w=v=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"selectProvider",result:v}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:w,onCancel:y,providerOptions:i})});return{cancel:f,promise:m}}watchAsset(i,a,s,f,m,b){const d={method:"watchAsset",params:{type:i,options:{address:a,symbol:s,decimals:f,image:m},chainId:b}};let y=null;const w=(0,r.randomBytesHex)(8),v=S=>{this.publishWeb3RequestCanceledEvent(w),this.handleErrorResponse(w,d.method,S),y==null||y()};this.ui.inlineWatchAsset()||(y=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:v,onResetConnection:this.resetAndReload}));const E=new Promise((S,_)=>{this.relayEventManager.callbacks.set(w,N=>{if(y==null||y(),(0,p.isErrorResponse)(N))return _(new Error(N.errorMessage));S(N)});const C=N=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:w,response:{method:"watchAsset",result:!1}})},T=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:w,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:T,onCancel:C,type:i,address:a,symbol:s,decimals:f,image:m,chainId:b}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(w,d)});return{cancel:v,promise:E}}addEthereumChain(i,a,s,f,m,b){const d={method:"addEthereumChain",params:{chainId:i,rpcUrls:a,blockExplorerUrls:f,chainName:m,iconUrls:s,nativeCurrency:b}};let y=null;const w=(0,r.randomBytesHex)(8),v=S=>{this.publishWeb3RequestCanceledEvent(w),this.handleErrorResponse(w,d.method,S),y==null||y()};return this.ui.inlineAddEthereumChain(i)||(y=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:v,onResetConnection:this.resetAndReload})),{promise:new Promise((S,_)=>{this.relayEventManager.callbacks.set(w,N=>{if(y==null||y(),(0,p.isErrorResponse)(N))return _(new Error(N.errorMessage));S(N)});const C=N=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:w,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},T=N=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:w,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:N}}})};this.ui.inlineAddEthereumChain(i)&&this.ui.addEthereumChain({onCancel:C,onApprove:T,chainId:d.params.chainId,rpcUrls:d.params.rpcUrls,blockExplorerUrls:d.params.blockExplorerUrls,chainName:d.params.chainName,iconUrls:d.params.iconUrls,nativeCurrency:d.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(i)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(w,d)}),cancel:v}}switchEthereumChain(i,a){const s={method:"switchEthereumChain",params:Object.assign({chainId:i},{address:a})},f=(0,r.randomBytesHex)(8),m=d=>{this.publishWeb3RequestCanceledEvent(f),this.handleErrorResponse(f,s.method,d)};return{promise:new Promise((d,y)=>{this.relayEventManager.callbacks.set(f,E=>{if((0,p.isErrorResponse)(E)&&E.errorCode)return y(e.standardErrors.provider.custom({code:E.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,p.isErrorResponse)(E))return y(new Error(E.errorMessage));d(E)});const w=E=>{var S;if(E){const _=(S=(0,e.getErrorCode)(E))!==null&&S!==void 0?S:e.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(f,"switchEthereumChain",E instanceof Error?E:e.standardErrors.provider.unsupportedChain(i),_)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:f,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},v=E=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:f,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:E}}})};this.ui.switchEthereumChain({onCancel:w,onApprove:v,chainId:s.params.chainId,address:s.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(f,s)}),cancel:m}}inlineAddEthereumChain(i){return this.ui.inlineAddEthereumChain(i)}getSessionIdHash(){return c.Session.hash(this._session.id)}sendRequestStandalone(i,a){const s=m=>{this.handleErrorResponse(i,a.method,m)},f=m=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:m})};switch(a.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:a,onSuccess:f,onCancel:s});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:a,onSuccess:f,onCancel:s});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:a,onSuccess:f,onCancel:s});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:a,onSuccess:f});break;default:s();break}}};return $e.WalletLinkRelay=u,u.accountRequestCallbackIds=new Set,$e}var at={},ye={},ve={},ao;function Zu(){return ao||(ao=1,function(e){var n=ve&&ve.__createBinding||(Object.create?function(t,l,c,o){o===void 0&&(o=c);var p=Object.getOwnPropertyDescriptor(l,c);(!p||("get"in p?!l.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return l[c]}}),Object.defineProperty(t,o,p)}:function(t,l,c,o){o===void 0&&(o=c),t[o]=l[c]}),r=ve&&ve.__exportStar||function(t,l){for(var c in t)c!=="default"&&!Object.prototype.hasOwnProperty.call(l,c)&&n(l,t,c)};Object.defineProperty(e,"__esModule",{value:!0}),r(Mc(),e)}(ve)),ve}var Tt={},co;function Qu(){return co||(co=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.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}"),Tt}var uo;function Ku(){if(uo)return ye;uo=1;var e=ye&&ye.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(ye,"__esModule",{value:!0}),ye.RedirectDialog=void 0;const n=e(yt),r=Z,t=Lc(),l=Zu(),c=e(Qu());let o=class{constructor(){this.root=null}attach(){const u=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",u.appendChild(this.root),(0,t.injectCssReset)()}present(u){this.render(u)}clear(){this.render(null)}render(u){this.root&&((0,r.render)(null,this.root),u&&(0,r.render)((0,r.h)(p,Object.assign({},u,{onDismiss:()=>{this.clear()}})),this.root))}};ye.RedirectDialog=o;const p=({title:g,buttonText:u,darkMode:h,onButtonClick:i,onDismiss:a})=>{const s=h?"dark":"light";return(0,r.h)(l.SnackbarContainer,{darkMode:h},(0,r.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,r.h)("style",null,c.default),(0,r.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:a}),(0,r.h)("div",{class:(0,n.default)("-cbwsdk-redirect-dialog-box",s)},(0,r.h)("p",null,g),(0,r.h)("button",{onClick:i},u))))};return ye}var lo;function Pc(){if(lo)return at;lo=1,Object.defineProperty(at,"__esModule",{value:!0}),at.MobileRelayUI=void 0;const e=Ku();let n=class{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new e.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 l=new URL("https://go.cb-w.com/walletlink");l.searchParams.append("redirect_url",window.location.href),t&&l.searchParams.append("wl_url",t);const c=document.createElement("a");c.target="cbw-opener",c.href=l.href,c.rel="noreferrer noopener",c.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}};return at.MobileRelayUI=n,at}var ho;function Oc(){if(ho)return ze;ho=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.MobileRelay=void 0;const e=ce(),n=Tc(),r=Pc();let t=class extends n.WalletLinkRelay{constructor(c){var o;super(c),this._enableMobileWalletLink=(o=c.enableMobileWalletLink)!==null&&o!==void 0?o:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const c=(0,e.getLocation)();c.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(c.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(c,o){if(super.publishWeb3RequestEvent(c,o),!(this._enableMobileWalletLink&&this.ui instanceof r.MobileRelayUI))return;let p=!1;switch(o.method){case"requestEthereumAccounts":case"connectAndSignIn":p=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:p=!0,this.ui.openCoinbaseWalletDeeplink();break}p&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(c){super.handleWeb3ResponseMessage(c)}connectAndSignIn(c){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:c.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:c.statement,resources:c.resources}})}};return ze.MobileRelay=t,ze}var Pt={exports:{}},fo;function xc(){return fo||(fo=1,function(e,n){n=e.exports=lu(),n.Stream=n,n.Readable=n,n.Writable=du(),n.Duplex=hu(),n.Transform=fu(),n.PassThrough=gu(),n.finished=pu(),n.pipeline=mu()}(Pt,Pt.exports)),Pt.exports}var Xr,go;function Xu(){if(go)return Xr;go=1;const{Transform:e}=xc();return Xr=n=>class Bc extends e{constructor(t,l,c,o,p){super(p),this._rate=t,this._capacity=l,this._delimitedSuffix=c,this._hashBitLength=o,this._options=p,this._state=new n,this._state.initialize(t,l),this._finalized=!1}_transform(t,l,c){let o=null;try{this.update(t,l)}catch(p){o=p}c(o)}_flush(t){let l=null;try{this.push(this.digest())}catch(c){l=c}t(l)}update(t,l){if(!D.isBuffer(t)&&typeof t!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return D.isBuffer(t)||(t=D.from(t,l)),this._state.absorb(t),this}digest(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let l=this._state.squeeze(this._hashBitLength/8);return t!==void 0&&(l=l.toString(t)),this._resetState(),l}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new Bc(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}},Xr}var Yr,po;function Yu(){if(po)return Yr;po=1;const{Transform:e}=xc();return Yr=n=>class Fc extends e{constructor(t,l,c,o){super(o),this._rate=t,this._capacity=l,this._delimitedSuffix=c,this._options=o,this._state=new n,this._state.initialize(t,l),this._finalized=!1}_transform(t,l,c){let o=null;try{this.update(t,l)}catch(p){o=p}c(o)}_flush(){}_read(t){this.push(this.squeeze(t))}update(t,l){if(!D.isBuffer(t)&&typeof t!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return D.isBuffer(t)||(t=D.from(t,l)),this._state.absorb(t),this}squeeze(t,l){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let c=this._state.squeeze(t);return l!==void 0&&(c=c.toString(l)),c}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new Fc(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}},Yr}var en,mo;function el(){if(mo)return en;mo=1;const e=Xu(),n=Yu();return en=function(r){const t=e(r),l=n(r);return function(c,o){switch(typeof c=="string"?c.toLowerCase():c){case"keccak224":return new t(1152,448,null,224,o);case"keccak256":return new t(1088,512,null,256,o);case"keccak384":return new t(832,768,null,384,o);case"keccak512":return new t(576,1024,null,512,o);case"sha3-224":return new t(1152,448,6,224,o);case"sha3-256":return new t(1088,512,6,256,o);case"sha3-384":return new t(832,768,6,384,o);case"sha3-512":return new t(576,1024,6,512,o);case"shake128":return new l(1344,256,31,o);case"shake256":return new l(1088,512,31,o);default:throw new Error("Invald algorithm: "+c)}}},en}var tn={},bo;function tl(){if(bo)return tn;bo=1;const e=[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];return tn.p1600=function(n){for(let r=0;r<24;++r){const t=n[0]^n[10]^n[20]^n[30]^n[40],l=n[1]^n[11]^n[21]^n[31]^n[41],c=n[2]^n[12]^n[22]^n[32]^n[42],o=n[3]^n[13]^n[23]^n[33]^n[43],p=n[4]^n[14]^n[24]^n[34]^n[44],g=n[5]^n[15]^n[25]^n[35]^n[45],u=n[6]^n[16]^n[26]^n[36]^n[46],h=n[7]^n[17]^n[27]^n[37]^n[47],i=n[8]^n[18]^n[28]^n[38]^n[48],a=n[9]^n[19]^n[29]^n[39]^n[49];let s=i^(c<<1|o>>>31),f=a^(o<<1|c>>>31);const m=n[0]^s,b=n[1]^f,d=n[10]^s,y=n[11]^f,w=n[20]^s,v=n[21]^f,E=n[30]^s,S=n[31]^f,_=n[40]^s,C=n[41]^f;s=t^(p<<1|g>>>31),f=l^(g<<1|p>>>31);const T=n[2]^s,N=n[3]^f,x=n[12]^s,F=n[13]^f,V=n[22]^s,A=n[23]^f,k=n[32]^s,R=n[33]^f,I=n[42]^s,M=n[43]^f;s=c^(u<<1|h>>>31),f=o^(h<<1|u>>>31);const L=n[4]^s,P=n[5]^f,j=n[14]^s,B=n[15]^f,H=n[24]^s,W=n[25]^f,q=n[34]^s,X=n[35]^f,Be=n[44]^s,St=n[45]^f;s=p^(i<<1|a>>>31),f=g^(a<<1|i>>>31);const Ct=n[6]^s,ei=n[7]^f,ti=n[16]^s,ri=n[17]^f,ni=n[26]^s,si=n[27]^f,ii=n[36]^s,oi=n[37]^f,ai=n[46]^s,ci=n[47]^f;s=u^(t<<1|l>>>31),f=h^(l<<1|t>>>31);const ui=n[8]^s,li=n[9]^f,di=n[18]^s,hi=n[19]^f,fi=n[28]^s,gi=n[29]^f,pi=n[38]^s,mi=n[39]^f,bi=n[48]^s,wi=n[49]^f,Xt=m,Yt=b,er=y<<4|d>>>28,tr=d<<4|y>>>28,rr=w<<3|v>>>29,nr=v<<3|w>>>29,sr=S<<9|E>>>23,ir=E<<9|S>>>23,or=_<<18|C>>>14,ar=C<<18|_>>>14,cr=T<<1|N>>>31,ur=N<<1|T>>>31,lr=F<<12|x>>>20,dr=x<<12|F>>>20,hr=V<<10|A>>>22,fr=A<<10|V>>>22,gr=R<<13|k>>>19,pr=k<<13|R>>>19,mr=I<<2|M>>>30,br=M<<2|I>>>30,wr=P<<30|L>>>2,yr=L<<30|P>>>2,vr=j<<6|B>>>26,Er=B<<6|j>>>26,_r=W<<11|H>>>21,Rr=H<<11|W>>>21,Sr=q<<15|X>>>17,Cr=X<<15|q>>>17,kr=St<<29|Be>>>3,Ir=Be<<29|St>>>3,Ar=Ct<<28|ei>>>4,Lr=ei<<28|Ct>>>4,Mr=ri<<23|ti>>>9,Nr=ti<<23|ri>>>9,Tr=ni<<25|si>>>7,Pr=si<<25|ni>>>7,Or=ii<<21|oi>>>11,xr=oi<<21|ii>>>11,Br=ci<<24|ai>>>8,Fr=ai<<24|ci>>>8,qr=ui<<27|li>>>5,Dr=li<<27|ui>>>5,jr=di<<20|hi>>>12,Hr=hi<<20|di>>>12,Ur=gi<<7|fi>>>25,Wr=fi<<7|gi>>>25,Vr=pi<<8|mi>>>24,zr=mi<<8|pi>>>24,$r=bi<<14|wi>>>18,Jr=wi<<14|bi>>>18;n[0]=Xt^~lr&_r,n[1]=Yt^~dr&Rr,n[10]=Ar^~jr&rr,n[11]=Lr^~Hr&nr,n[20]=cr^~vr&Tr,n[21]=ur^~Er&Pr,n[30]=qr^~er&hr,n[31]=Dr^~tr&fr,n[40]=wr^~Mr&Ur,n[41]=yr^~Nr&Wr,n[2]=lr^~_r&Or,n[3]=dr^~Rr&xr,n[12]=jr^~rr&gr,n[13]=Hr^~nr&pr,n[22]=vr^~Tr&Vr,n[23]=Er^~Pr&zr,n[32]=er^~hr&Sr,n[33]=tr^~fr&Cr,n[42]=Mr^~Ur&sr,n[43]=Nr^~Wr&ir,n[4]=_r^~Or&$r,n[5]=Rr^~xr&Jr,n[14]=rr^~gr&kr,n[15]=nr^~pr&Ir,n[24]=Tr^~Vr&or,n[25]=Pr^~zr&ar,n[34]=hr^~Sr&Br,n[35]=fr^~Cr&Fr,n[44]=Ur^~sr&mr,n[45]=Wr^~ir&br,n[6]=Or^~$r&Xt,n[7]=xr^~Jr&Yt,n[16]=gr^~kr&Ar,n[17]=pr^~Ir&Lr,n[26]=Vr^~or&cr,n[27]=zr^~ar&ur,n[36]=Sr^~Br&qr,n[37]=Cr^~Fr&Dr,n[46]=sr^~mr&wr,n[47]=ir^~br&yr,n[8]=$r^~Xt&lr,n[9]=Jr^~Yt&dr,n[18]=kr^~Ar&jr,n[19]=Ir^~Lr&Hr,n[28]=or^~cr&vr,n[29]=ar^~ur&Er,n[38]=Br^~qr&er,n[39]=Fr^~Dr&tr,n[48]=mr^~wr&Mr,n[49]=br^~yr&Nr,n[0]^=e[r*2],n[1]^=e[r*2+1]}},tn}var rn,wo;function rl(){if(wo)return rn;wo=1;const e=tl();function n(){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}return n.prototype.initialize=function(r,t){for(let l=0;l<50;++l)this.state[l]=0;this.blockSize=r/8,this.count=0,this.squeezing=!1},n.prototype.absorb=function(r){for(let t=0;t<r.length;++t)this.state[~~(this.count/4)]^=r[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(e.p1600(this.state),this.count=0)},n.prototype.absorbLastFewBits=function(r){this.state[~~(this.count/4)]^=r<<8*(this.count%4),r&128&&this.count===this.blockSize-1&&e.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),e.p1600(this.state),this.count=0,this.squeezing=!0},n.prototype.squeeze=function(r){this.squeezing||this.absorbLastFewBits(1);const t=D.alloc(r);for(let l=0;l<r;++l)t[l]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(e.p1600(this.state),this.count=0);return t},n.prototype.copy=function(r){for(let t=0;t<50;++t)r.state[t]=this.state[t];r.blockSize=this.blockSize,r.count=this.count,r.squeezing=this.squeezing},rn=n,rn}var nn,yo;function nl(){return yo||(yo=1,nn=el()(rl())),nn}var sn,vo;function qc(){if(vo)return sn;vo=1;const e=nl(),n=Ht();function r(i){return D.allocUnsafe(i).fill(0)}function t(i,a,s){const f=r(a);return i=c(i),s?i.length<a?(i.copy(f),f):i.slice(0,a):i.length<a?(i.copy(f,a-i.length),f):i.slice(-a)}function l(i,a){return t(i,a,!0)}function c(i){if(!D.isBuffer(i))if(Array.isArray(i))i=D.from(i);else if(typeof i=="string")u(i)?i=D.from(g(h(i)),"hex"):i=D.from(i);else if(typeof i=="number")i=intToBuffer(i);else if(i==null)i=D.allocUnsafe(0);else if(n.isBN(i))i=i.toArrayLike(D);else if(i.toArray)i=D.from(i.toArray());else throw new Error("invalid type");return i}function o(i){return i=c(i),"0x"+i.toString("hex")}function p(i,a){return i=c(i),a||(a=256),e("keccak"+a).update(i).digest()}function g(i){return i.length%2?"0"+i:i}function u(i){return typeof i=="string"&&i.match(/^0x[0-9A-Fa-f]*$/)}function h(i){return typeof i=="string"&&i.startsWith("0x")?i.slice(2):i}return sn={zeros:r,setLength:t,setLengthRight:l,isHexString:u,stripHexPrefix:h,toBuffer:c,bufferToHex:o,keccak:p},sn}var on,Eo;function sl(){if(Eo)return on;Eo=1;const e=qc(),n=Ht();function r(s){return s.startsWith("int[")?"int256"+s.slice(3):s==="int"?"int256":s.startsWith("uint[")?"uint256"+s.slice(4):s==="uint"?"uint256":s.startsWith("fixed[")?"fixed128x128"+s.slice(5):s==="fixed"?"fixed128x128":s.startsWith("ufixed[")?"ufixed128x128"+s.slice(6):s==="ufixed"?"ufixed128x128":s}function t(s){return parseInt(/^\D+(\d+)$/.exec(s)[1],10)}function l(s){var f=/^\D+(\d+)x(\d+)$/.exec(s);return[parseInt(f[1],10),parseInt(f[2],10)]}function c(s){var f=s.match(/(.*)\[(.*?)\]$/);return f?f[2]===""?"dynamic":parseInt(f[2],10):null}function o(s){var f=typeof s;if(f==="string")return e.isHexString(s)?new n(e.stripHexPrefix(s),16):new n(s,10);if(f==="number")return new n(s);if(s.toArray)return s;throw new Error("Argument is not a number")}function p(s,f){var m,b,d,y;if(s==="address")return p("uint160",o(f));if(s==="bool")return p("uint8",f?1:0);if(s==="string")return p("bytes",new D(f,"utf8"));if(u(s)){if(typeof f.length>"u")throw new Error("Not an array?");if(m=c(s),m!=="dynamic"&&m!==0&&f.length>m)throw new Error("Elements exceed array size: "+m);d=[],s=s.slice(0,s.lastIndexOf("[")),typeof f=="string"&&(f=JSON.parse(f));for(y in f)d.push(p(s,f[y]));if(m==="dynamic"){var w=p("uint256",f.length);d.unshift(w)}return D.concat(d)}else{if(s==="bytes")return f=new D(f),d=D.concat([p("uint256",f.length),f]),f.length%32!==0&&(d=D.concat([d,e.zeros(32-f.length%32)])),d;if(s.startsWith("bytes")){if(m=t(s),m<1||m>32)throw new Error("Invalid bytes<N> width: "+m);return e.setLengthRight(f,32)}else if(s.startsWith("uint")){if(m=t(s),m%8||m<8||m>256)throw new Error("Invalid uint<N> width: "+m);if(b=o(f),b.bitLength()>m)throw new Error("Supplied uint exceeds width: "+m+" vs "+b.bitLength());if(b<0)throw new Error("Supplied uint is negative");return b.toArrayLike(D,"be",32)}else if(s.startsWith("int")){if(m=t(s),m%8||m<8||m>256)throw new Error("Invalid int<N> width: "+m);if(b=o(f),b.bitLength()>m)throw new Error("Supplied int exceeds width: "+m+" vs "+b.bitLength());return b.toTwos(256).toArrayLike(D,"be",32)}else if(s.startsWith("ufixed")){if(m=l(s),b=o(f),b<0)throw new Error("Supplied ufixed is negative");return p("uint256",b.mul(new n(2).pow(new n(m[1]))))}else if(s.startsWith("fixed"))return m=l(s),p("int256",o(f).mul(new n(2).pow(new n(m[1]))))}throw new Error("Unsupported or invalid type: "+s)}function g(s){return s==="string"||s==="bytes"||c(s)==="dynamic"}function u(s){return s.lastIndexOf("]")===s.length-1}function h(s,f){var m=[],b=[],d=32*s.length;for(var y in s){var w=r(s[y]),v=f[y],E=p(w,v);g(w)?(m.push(p("uint256",d)),b.push(E),d+=E.length):m.push(E)}return D.concat(m.concat(b))}function i(s,f){if(s.length!==f.length)throw new Error("Number of types are not matching the values");for(var m,b,d=[],y=0;y<s.length;y++){var w=r(s[y]),v=f[y];if(w==="bytes")d.push(v);else if(w==="string")d.push(new D(v,"utf8"));else if(w==="bool")d.push(new D(v?"01":"00","hex"));else if(w==="address")d.push(e.setLength(v,20));else if(w.startsWith("bytes")){if(m=t(w),m<1||m>32)throw new Error("Invalid bytes<N> width: "+m);d.push(e.setLengthRight(v,m))}else if(w.startsWith("uint")){if(m=t(w),m%8||m<8||m>256)throw new Error("Invalid uint<N> width: "+m);if(b=o(v),b.bitLength()>m)throw new Error("Supplied uint exceeds width: "+m+" vs "+b.bitLength());d.push(b.toArrayLike(D,"be",m/8))}else if(w.startsWith("int")){if(m=t(w),m%8||m<8||m>256)throw new Error("Invalid int<N> width: "+m);if(b=o(v),b.bitLength()>m)throw new Error("Supplied int exceeds width: "+m+" vs "+b.bitLength());d.push(b.toTwos(m).toArrayLike(D,"be",m/8))}else throw new Error("Unsupported or invalid type: "+w)}return D.concat(d)}function a(s,f){return e.keccak(i(s,f))}return on={rawEncode:h,solidityPack:i,soliditySHA3:a},on}var an,_o;function il(){if(_o)return an;_o=1;const e=qc(),n=sl(),r={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"]},t={encodeData(c,o,p,g=!0){const u=["bytes32"],h=[this.hashType(c,p)];if(g){const i=(a,s,f)=>{if(p[s]!==void 0)return["bytes32",f==null?"0x0000000000000000000000000000000000000000000000000000000000000000":e.keccak(this.encodeData(s,f,p,g))];if(f===void 0)throw new Error(`missing value for field ${a} of type ${s}`);if(s==="bytes")return["bytes32",e.keccak(f)];if(s==="string")return typeof f=="string"&&(f=D.from(f,"utf8")),["bytes32",e.keccak(f)];if(s.lastIndexOf("]")===s.length-1){const m=s.slice(0,s.lastIndexOf("[")),b=f.map(d=>i(a,m,d));return["bytes32",e.keccak(n.rawEncode(b.map(([d])=>d),b.map(([,d])=>d)))]}return[s,f]};for(const a of p[c]){const[s,f]=i(a.name,a.type,o[a.name]);u.push(s),h.push(f)}}else for(const i of p[c]){let a=o[i.name];if(a!==void 0)if(i.type==="bytes")u.push("bytes32"),a=e.keccak(a),h.push(a);else if(i.type==="string")u.push("bytes32"),typeof a=="string"&&(a=D.from(a,"utf8")),a=e.keccak(a),h.push(a);else if(p[i.type]!==void 0)u.push("bytes32"),a=e.keccak(this.encodeData(i.type,a,p,g)),h.push(a);else{if(i.type.lastIndexOf("]")===i.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");u.push(i.type),h.push(a)}}return n.rawEncode(u,h)},encodeType(c,o){let p="",g=this.findTypeDependencies(c,o).filter(u=>u!==c);g=[c].concat(g.sort());for(const u of g){if(!o[u])throw new Error("No type definition specified: "+u);p+=u+"("+o[u].map(({name:i,type:a})=>a+" "+i).join(",")+")"}return p},findTypeDependencies(c,o,p=[]){if(c=c.match(/^\w*/)[0],p.includes(c)||o[c]===void 0)return p;p.push(c);for(const g of o[c])for(const u of this.findTypeDependencies(g.type,o,p))!p.includes(u)&&p.push(u);return p},hashStruct(c,o,p,g=!0){return e.keccak(this.encodeData(c,o,p,g))},hashType(c,o){return e.keccak(this.encodeType(c,o))},sanitizeData(c){const o={};for(const p in r.properties)c[p]&&(o[p]=c[p]);return o.types&&(o.types=Object.assign({EIP712Domain:[]},o.types)),o},hash(c,o=!0){const p=this.sanitizeData(c),g=[D.from("1901","hex")];return g.push(this.hashStruct("EIP712Domain",p.domain,p.types,o)),p.primaryType!=="EIP712Domain"&&g.push(this.hashStruct(p.primaryType,p.message,p.types,o)),e.keccak(D.concat(g))}};an={TYPED_MESSAGE_SCHEMA:r,TypedDataUtils:t,hashForSignTypedDataLegacy:function(c){return l(c.data)},hashForSignTypedData_v3:function(c){return t.hash(c.data,!1)},hashForSignTypedData_v4:function(c){return t.hash(c.data)}};function l(c){const o=new Error("Expect argument to be non-empty array");if(typeof c!="object"||!c.length)throw o;const p=c.map(function(h){return h.type==="bytes"?e.toBuffer(h.value):h.value}),g=c.map(function(h){return h.type}),u=c.map(function(h){if(!h.name)throw o;return h.type+" "+h.name});return n.soliditySHA3(["bytes32","bytes32"],[n.soliditySHA3(new Array(c.length).fill("string"),u),n.soliditySHA3(g,p)])}return an}var Ee={},Ro;function ol(){if(Ro)return Ee;Ro=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.filterFromParam=Ee.FilterPolyfill=void 0;const e=Vt(),n=ce(),r=5*60*1e3,t={jsonrpc:"2.0",id:0};let l=class{constructor(a){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,e.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=a}async newFilter(a){const s=c(a),f=this.makeFilterId(),m=await this.setInitialCursorPosition(f,s.fromBlock);return console.info(`Installing new log filter(${f}):`,s,"initial cursor position:",m),this.logFilters.set(f,s),this.setFilterTimeout(f),(0,n.hexStringFromIntNumber)(f)}async newBlockFilter(){const a=this.makeFilterId(),s=await this.setInitialCursorPosition(a,"latest");return console.info(`Installing new block filter (${a}) with initial cursor position:`,s),this.blockFilters.add(a),this.setFilterTimeout(a),(0,n.hexStringFromIntNumber)(a)}async newPendingTransactionFilter(){const a=this.makeFilterId(),s=await this.setInitialCursorPosition(a,"latest");return console.info(`Installing new block filter (${a}) with initial cursor position:`,s),this.pendingTransactionFilters.add(a),this.setFilterTimeout(a),(0,n.hexStringFromIntNumber)(a)}uninstallFilter(a){const s=(0,n.intNumberFromHexString)(a);return console.info(`Uninstalling filter (${s})`),this.deleteFilter(s),!0}getFilterChanges(a){const s=(0,n.intNumberFromHexString)(a);return this.timeouts.has(s)&&this.setFilterTimeout(s),this.logFilters.has(s)?this.getLogFilterChanges(s):this.blockFilters.has(s)?this.getBlockFilterChanges(s):this.pendingTransactionFilters.has(s)?this.getPendingTransactionFilterChanges(s):Promise.resolve(u())}async getFilterLogs(a){const s=(0,n.intNumberFromHexString)(a),f=this.logFilters.get(s);return f?this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getLogs",params:[o(f)]})):u()}makeFilterId(){return(0,e.IntNumber)(++this.nextFilterId)}sendAsyncPromise(a){return new Promise((s,f)=>{this.provider.sendAsync(a,(m,b)=>{if(m)return f(m);if(Array.isArray(b)||b==null)return f(new Error(`unexpected response received: ${JSON.stringify(b)}`));s(b)})})}deleteFilter(a){console.info(`Deleting filter (${a})`),this.logFilters.delete(a),this.blockFilters.delete(a),this.pendingTransactionFilters.delete(a),this.cursors.delete(a),this.timeouts.delete(a)}async getLogFilterChanges(a){const s=this.logFilters.get(a),f=this.cursors.get(a);if(!f||!s)return u();const m=await this.getCurrentBlockHeight(),b=s.toBlock==="latest"?m:s.toBlock;if(f>m||f>Number(s.toBlock))return h();console.info(`Fetching logs from ${f} to ${b} for filter ${a}`);const d=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getLogs",params:[o(Object.assign(Object.assign({},s),{fromBlock:f,toBlock:b}))]}));if(Array.isArray(d.result)){const y=d.result.map(v=>(0,n.intNumberFromHexString)(v.blockNumber||"0x0")),w=Math.max(...y);if(w&&w>f){const v=(0,e.IntNumber)(w+1);console.info(`Moving cursor position for filter (${a}) from ${f} to ${v}`),this.cursors.set(a,v)}}return d}async getBlockFilterChanges(a){const s=this.cursors.get(a);if(!s)return u();const f=await this.getCurrentBlockHeight();if(s>f)return h();console.info(`Fetching blocks from ${s} to ${f} for filter (${a})`);const m=(await Promise.all((0,n.range)(s,f+1).map(d=>this.getBlockHashByNumber((0,e.IntNumber)(d))))).filter(d=>!!d),b=(0,e.IntNumber)(s+m.length);return console.info(`Moving cursor position for filter (${a}) from ${s} to ${b}`),this.cursors.set(a,b),Object.assign(Object.assign({},t),{result:m})}async getPendingTransactionFilterChanges(a){return Promise.resolve(h())}async setInitialCursorPosition(a,s){const f=await this.getCurrentBlockHeight(),m=typeof s=="number"&&s>f?s:f;return this.cursors.set(a,m),m}setFilterTimeout(a){const s=this.timeouts.get(a);s&&window.clearTimeout(s);const f=window.setTimeout(()=>{console.info(`Filter (${a}) timed out`),this.deleteFilter(a)},r);this.timeouts.set(a,f)}async getCurrentBlockHeight(){const a=new Date;if(a.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=a;const s=await this._getCurrentBlockHeight();this.currentBlockHeight=s,this.resolvers.forEach(f=>f(s)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(s=>this.resolvers.push(s))}async _getCurrentBlockHeight(){const{result:a}=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_blockNumber",params:[]}));return(0,n.intNumberFromHexString)((0,n.ensureHexString)(a))}async getBlockHashByNumber(a){const s=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getBlockByNumber",params:[(0,n.hexStringFromIntNumber)(a),!1]}));return s.result&&typeof s.result.hash=="string"?(0,n.ensureHexString)(s.result.hash):null}};Ee.FilterPolyfill=l;function c(i){return{fromBlock:p(i.fromBlock),toBlock:p(i.toBlock),addresses:i.address===void 0?null:Array.isArray(i.address)?i.address:[i.address],topics:i.topics||[]}}Ee.filterFromParam=c;function o(i){const a={fromBlock:g(i.fromBlock),toBlock:g(i.toBlock),topics:i.topics};return i.addresses!==null&&(a.address=i.addresses),a}function p(i){if(i===void 0||i==="latest"||i==="pending")return"latest";if(i==="earliest")return(0,e.IntNumber)(0);if((0,n.isHexString)(i))return(0,n.intNumberFromHexString)(i);throw new Error(`Invalid block option: ${String(i)}`)}function g(i){return i==="latest"?i:(0,n.hexStringFromIntNumber)(i)}function u(){return Object.assign(Object.assign({},t),{error:{code:-32e3,message:"filter not found"}})}function h(){return Object.assign(Object.assign({},t),{result:[]})}return Ee}var ct={},_e={},Re={},cn,So;function qs(){if(So)return cn;So=1,cn=e;function e(n){n=n||{};var r=n.max||Number.MAX_SAFE_INTEGER,t=typeof n.start<"u"?n.start:Math.floor(Math.random()*r);return function(){return t=t%r,t++}}return cn}var un,Co;function al(){if(Co)return un;Co=1;const e=(n,r)=>function(){const t=r.promiseModule,l=new Array(arguments.length);for(let c=0;c<arguments.length;c++)l[c]=arguments[c];return new t((c,o)=>{r.errorFirst?l.push(function(p,g){if(r.multiArgs){const u=new Array(arguments.length-1);for(let h=1;h<arguments.length;h++)u[h-1]=arguments[h];p?(u.unshift(p),o(u)):c(u)}else p?o(p):c(g)}):l.push(function(p){if(r.multiArgs){const g=new Array(arguments.length-1);for(let u=0;u<arguments.length;u++)g[u]=arguments[u];c(g)}else c(p)}),n.apply(this,l)})};return un=(n,r)=>{r=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},r);const t=c=>{const o=p=>typeof p=="string"?c===p:p.test(c);return r.include?r.include.some(o):!r.exclude.some(o)};let l;typeof n=="function"?l=function(){return r.excludeMain?n.apply(this,arguments):e(n,r).apply(this,arguments)}:l=Object.create(Object.getPrototypeOf(n));for(const c in n){const o=n[c];l[c]=typeof o=="function"&&t(c)?e(o,r):o}return l},un}var Se={},Ot={},ko;function Ds(){if(ko)return Ot;ko=1,Object.defineProperty(Ot,"__esModule",{value:!0});const e=Ic();function n(l,c,o){try{Reflect.apply(l,c,o)}catch(p){setTimeout(()=>{throw p})}}function r(l){const c=l.length,o=new Array(c);for(let p=0;p<c;p+=1)o[p]=l[p];return o}class t extends e.EventEmitter{emit(c,...o){let p=c==="error";const g=this._events;if(g!==void 0)p=p&&g.error===void 0;else if(!p)return!1;if(p){let h;if(o.length>0&&([h]=o),h instanceof Error)throw h;const i=new Error(`Unhandled error.${h?` (${h.message})`:""}`);throw i.context=h,i}const u=g[c];if(u===void 0)return!1;if(typeof u=="function")n(u,this,o);else{const h=u.length,i=r(u);for(let a=0;a<h;a+=1)n(i[a],this,o)}return!0}}return Ot.default=t,Ot}var Io;function Dc(){if(Io)return Se;Io=1;var e=Se&&Se.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(Se,"__esModule",{value:!0}),Se.BaseBlockTracker=void 0;const n=e(Ds()),r=1e3,t=(p,g)=>p+g,l=["sync","latest"];let c=class extends n.default{constructor(g){super(),this._blockResetDuration=g.blockResetDuration||20*r,this._usePastBlocks=g.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(u=>this.once("latest",u))}removeAllListeners(g){return g?super.removeAllListeners(g):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(g){l.includes(g)&&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 l.map(g=>this.listenerCount(g)).reduce(t)}_shouldUseNewBlock(g){const u=this._currentBlock;if(!u)return!0;const h=o(g),i=o(u);return this._usePastBlocks&&h<i||h>i}_newPotentialLatest(g){this._shouldUseNewBlock(g)&&this._setCurrentBlock(g)}_setCurrentBlock(g){const u=this._currentBlock;this._currentBlock=g,this.emit("latest",g),this.emit("sync",{oldBlock:u,newBlock:g})}_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}};Se.BaseBlockTracker=c;function o(p){return Number.parseInt(p,16)}return Se}var ln={},Ce={},ee={};class jc extends TypeError{constructor(n,r){let t;const{message:l,explanation:c,...o}=n,{path:p}=n,g=p.length===0?l:`At path: ${p.join(".")} -- ${l}`;super(c??g),c!=null&&(this.cause=g),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>t??(t=[n,...r()])}}function cl(e){return K(e)&&typeof e[Symbol.iterator]=="function"}function K(e){return typeof e=="object"&&e!=null}function Ao(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const n=Object.getPrototypeOf(e);return n===null||n===Object.prototype}function $(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function ul(e){const{done:n,value:r}=e.next();return n?void 0:r}function ll(e,n,r,t){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:l,branch:c}=n,{type:o}=r,{refinement:p,message:g=`Expected a value of type \`${o}\`${p?` with refinement \`${p}\``:""}, but received: \`${$(t)}\``}=e;return{value:t,type:o,refinement:p,key:l[l.length-1],path:l,branch:c,...e,message:g}}function*Ls(e,n,r,t){cl(e)||(e=[e]);for(const l of e){const c=ll(l,n,r,t);c&&(yield c)}}function*js(e,n,r={}){const{path:t=[],branch:l=[e],coerce:c=!1,mask:o=!1}=r,p={path:t,branch:l};if(c&&(e=n.coercer(e,p),o&&n.type!=="type"&&K(n.schema)&&K(e)&&!Array.isArray(e)))for(const u in e)n.schema[u]===void 0&&delete e[u];let g="valid";for(const u of n.validator(e,p))u.explanation=r.message,g="not_valid",yield[u,void 0];for(let[u,h,i]of n.entries(e,p)){const a=js(h,i,{path:u===void 0?t:[...t,u],branch:u===void 0?l:[...l,h],coerce:c,mask:o,message:r.message});for(const s of a)s[0]?(g=s[0].refinement!=null?"not_refined":"not_valid",yield[s[0],void 0]):c&&(h=s[1],u===void 0?e=h:e instanceof Map?e.set(u,h):e instanceof Set?e.add(h):K(e)&&(h!==void 0||u in e)&&(e[u]=h))}if(g!=="not_valid")for(const u of n.refiner(e,p))u.explanation=r.message,g="not_refined",yield[u,void 0];g==="valid"&&(yield[void 0,e])}class z{constructor(n){const{type:r,schema:t,validator:l,refiner:c,coercer:o=g=>g,entries:p=function*(){}}=n;this.type=r,this.schema=t,this.entries=p,this.coercer=o,l?this.validator=(g,u)=>{const h=l(g,u);return Ls(h,u,this,g)}:this.validator=()=>[],c?this.refiner=(g,u)=>{const h=c(g,u);return Ls(h,u,this,g)}:this.refiner=()=>[]}assert(n,r){return Hc(n,this,r)}create(n,r){return Uc(n,this,r)}is(n){return Hs(n,this)}mask(n,r){return Wc(n,this,r)}validate(n,r={}){return Oe(n,this,r)}}function Hc(e,n,r){const t=Oe(e,n,{message:r});if(t[0])throw t[0]}function Uc(e,n,r){const t=Oe(e,n,{coerce:!0,message:r});if(t[0])throw t[0];return t[1]}function Wc(e,n,r){const t=Oe(e,n,{coerce:!0,mask:!0,message:r});if(t[0])throw t[0];return t[1]}function Hs(e,n){return!Oe(e,n)[0]}function Oe(e,n,r={}){const t=js(e,n,r),l=ul(t);return l[0]?[new jc(l[0],function*(){for(const o of t)o[0]&&(yield o[0])}),void 0]:[void 0,l[1]]}function dl(...e){const n=e[0].type==="type",r=e.map(l=>l.schema),t=Object.assign({},...r);return n?Et(t):vt(t)}function Q(e,n){return new z({type:e,schema:null,validator:n})}function hl(e,n){return new z({...e,refiner:(r,t)=>r===void 0||e.refiner(r,t),validator(r,t){return r===void 0?!0:(n(r,t),e.validator(r,t))}})}function fl(e){return new z({type:"dynamic",schema:null,*entries(n,r){yield*e(n,r).entries(n,r)},validator(n,r){return e(n,r).validator(n,r)},coercer(n,r){return e(n,r).coercer(n,r)},refiner(n,r){return e(n,r).refiner(n,r)}})}function gl(e){let n;return new z({type:"lazy",schema:null,*entries(r,t){n??(n=e()),yield*n.entries(r,t)},validator(r,t){return n??(n=e()),n.validator(r,t)},coercer(r,t){return n??(n=e()),n.coercer(r,t)},refiner(r,t){return n??(n=e()),n.refiner(r,t)}})}function pl(e,n){const{schema:r}=e,t={...r};for(const l of n)delete t[l];switch(e.type){case"type":return Et(t);default:return vt(t)}}function ml(e){const n=e instanceof z,r=n?{...e.schema}:{...e};for(const t in r)r[t]=Vc(r[t]);return n&&e.type==="type"?Et(r):vt(r)}function bl(e,n){const{schema:r}=e,t={};for(const l of n)t[l]=r[l];switch(e.type){case"type":return Et(t);default:return vt(t)}}function wl(e,n){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Q(e,n)}function yl(){return Q("any",()=>!0)}function vl(e){return new z({type:"array",schema:e,*entries(n){if(e&&Array.isArray(n))for(const[r,t]of n.entries())yield[r,t,e]},coercer(n){return Array.isArray(n)?n.slice():n},validator(n){return Array.isArray(n)||`Expected an array value, but received: ${$(n)}`}})}function El(){return Q("bigint",e=>typeof e=="bigint")}function _l(){return Q("boolean",e=>typeof e=="boolean")}function Rl(){return Q("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${$(e)}`)}function Sl(e){const n={},r=e.map(t=>$(t)).join();for(const t of e)n[t]=t;return new z({type:"enums",schema:n,validator(t){return e.includes(t)||`Expected one of \`${r}\`, but received: ${$(t)}`}})}function Cl(){return Q("func",e=>typeof e=="function"||`Expected a function, but received: ${$(e)}`)}function kl(e){return Q("instance",n=>n instanceof e||`Expected a \`${e.name}\` instance, but received: ${$(n)}`)}function Il(){return Q("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${$(e)}`)}function Al(e){return new z({type:"intersection",schema:null,*entries(n,r){for(const t of e)yield*t.entries(n,r)},*validator(n,r){for(const t of e)yield*t.validator(n,r)},*refiner(n,r){for(const t of e)yield*t.refiner(n,r)}})}function Ll(e){const n=$(e),r=typeof e;return new z({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(t){return t===e||`Expected the literal \`${n}\`, but received: ${$(t)}`}})}function Ml(e,n){return new z({type:"map",schema:null,*entries(r){if(e&&n&&r instanceof Map)for(const[t,l]of r.entries())yield[t,t,e],yield[t,l,n]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${$(r)}`}})}function Us(){return Q("never",()=>!1)}function Nl(e){return new z({...e,validator:(n,r)=>n===null||e.validator(n,r),refiner:(n,r)=>n===null||e.refiner(n,r)})}function Tl(){return Q("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${$(e)}`)}function vt(e){const n=e?Object.keys(e):[],r=Us();return new z({type:"object",schema:e||null,*entries(t){if(e&&K(t)){const l=new Set(Object.keys(t));for(const c of n)l.delete(c),yield[c,t[c],e[c]];for(const c of l)yield[c,t[c],r]}},validator(t){return K(t)||`Expected an object, but received: ${$(t)}`},coercer(t){return K(t)?{...t}:t}})}function Vc(e){return new z({...e,validator:(n,r)=>n===void 0||e.validator(n,r),refiner:(n,r)=>n===void 0||e.refiner(n,r)})}function Pl(e,n){return new z({type:"record",schema:null,*entries(r){if(K(r))for(const t in r){const l=r[t];yield[t,t,e],yield[t,l,n]}},validator(r){return K(r)||`Expected an object, but received: ${$(r)}`}})}function Ol(){return Q("regexp",e=>e instanceof RegExp)}function xl(e){return new z({type:"set",schema:null,*entries(n){if(e&&n instanceof Set)for(const r of n)yield[r,r,e]},coercer(n){return n instanceof Set?new Set(n):n},validator(n){return n instanceof Set||`Expected a \`Set\` object, but received: ${$(n)}`}})}function zc(){return Q("string",e=>typeof e=="string"||`Expected a string, but received: ${$(e)}`)}function Bl(e){const n=Us();return new z({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const t=Math.max(e.length,r.length);for(let l=0;l<t;l++)yield[l,r[l],e[l]||n]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${$(r)}`}})}function Et(e){const n=Object.keys(e);return new z({type:"type",schema:e,*entries(r){if(K(r))for(const t of n)yield[t,r[t],e[t]]},validator(r){return K(r)||`Expected an object, but received: ${$(r)}`},coercer(r){return K(r)?{...r}:r}})}function Fl(e){const n=e.map(r=>r.type).join(" | ");return new z({type:"union",schema:null,coercer(r){for(const t of e){const[l,c]=t.validate(r,{coerce:!0});if(!l)return c}return r},validator(r,t){const l=[];for(const c of e){const[...o]=js(r,c,t),[p]=o;if(p[0])for(const[g]of o)g&&l.push(g);else return[]}return[`Expected the value to satisfy a union of \`${n}\`, but received: ${$(r)}`,...l]}})}function $c(){return Q("unknown",()=>!0)}function Ws(e,n,r){return new z({...e,coercer:(t,l)=>Hs(t,n)?e.coercer(r(t,l),l):e.coercer(t,l)})}function ql(e,n,r={}){return Ws(e,$c(),t=>{const l=typeof n=="function"?n():n;if(t===void 0)return l;if(!r.strict&&Ao(t)&&Ao(l)){const c={...t};let o=!1;for(const p in l)c[p]===void 0&&(c[p]=l[p],o=!0);if(o)return c}return t})}function Dl(e){return Ws(e,zc(),n=>n.trim())}function jl(e){return Te(e,"empty",n=>{const r=Jc(n);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function Jc(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Hl(e,n,r={}){const{exclusive:t}=r;return Te(e,"max",l=>t?l<n:l<=n||`Expected a ${e.type} less than ${t?"":"or equal to "}${n} but received \`${l}\``)}function Ul(e,n,r={}){const{exclusive:t}=r;return Te(e,"min",l=>t?l>n:l>=n||`Expected a ${e.type} greater than ${t?"":"or equal to "}${n} but received \`${l}\``)}function Wl(e){return Te(e,"nonempty",n=>Jc(n)>0||`Expected a nonempty ${e.type} but received an empty one`)}function Vl(e,n){return Te(e,"pattern",r=>n.test(r)||`Expected a ${e.type} matching \`/${n.source}/\` but received "${r}"`)}function zl(e,n,r=n){const t=`Expected a ${e.type}`,l=n===r?`of \`${n}\``:`between \`${n}\` and \`${r}\``;return Te(e,"size",c=>{if(typeof c=="number"||c instanceof Date)return n<=c&&c<=r||`${t} ${l} but received \`${c}\``;if(c instanceof Map||c instanceof Set){const{size:o}=c;return n<=o&&o<=r||`${t} with a size ${l} but received one with a size of \`${o}\``}else{const{length:o}=c;return n<=o&&o<=r||`${t} with a length ${l} but received one with a length of \`${o}\``}})}function Te(e,n,r){return new z({...e,*refiner(t,l){yield*e.refiner(t,l);const c=r(t,l),o=Ls(c,l,e,t);for(const p of o)yield{...p,refinement:n}}})}const $l=Object.freeze(Object.defineProperty({__proto__:null,Struct:z,StructError:jc,any:yl,array:vl,assert:Hc,assign:dl,bigint:El,boolean:_l,coerce:Ws,create:Uc,date:Rl,defaulted:ql,define:Q,deprecated:hl,dynamic:fl,empty:jl,enums:Sl,func:Cl,instance:kl,integer:Il,intersection:Al,is:Hs,lazy:gl,literal:Ll,map:Ml,mask:Wc,max:Hl,min:Ul,never:Us,nonempty:Wl,nullable:Nl,number:Tl,object:vt,omit:pl,optional:Vc,partial:ml,pattern:Vl,pick:bl,record:Pl,refine:Te,regexp:Ol,set:xl,size:zl,string:zc,struct:wl,trimmed:Dl,tuple:Bl,type:Et,union:Fl,unknown:$c,validate:Oe},Symbol.toStringTag,{value:"Module"})),Pe=jt($l);var Lo;function le(){if(Lo)return ee;Lo=1,Object.defineProperty(ee,"__esModule",{value:!0}),ee.assertExhaustive=ee.assertStruct=ee.assert=ee.AssertionError=void 0;const e=Pe;function n(u){return typeof u=="object"&&u!==null&&"message"in u}function r(u){var h,i;return typeof((i=(h=u==null?void 0:u.prototype)===null||h===void 0?void 0:h.constructor)===null||i===void 0?void 0:i.name)=="string"}function t(u){const h=n(u)?u.message:String(u);return h.endsWith(".")?h.slice(0,-1):h}function l(u,h){return r(u)?new u({message:h}):u({message:h})}class c extends Error{constructor(h){super(h.message),this.code="ERR_ASSERTION"}}ee.AssertionError=c;function o(u,h="Assertion failed.",i=c){if(!u)throw h instanceof Error?h:l(i,h)}ee.assert=o;function p(u,h,i="Assertion failed",a=c){try{(0,e.assert)(u,h)}catch(s){throw l(a,`${i}: ${t(s)}.`)}}ee.assertStruct=p;function g(u){throw new Error("Invalid branch reached. Should be detected during compilation.")}return ee.assertExhaustive=g,ee}var ut={},Mo;function Gc(){if(Mo)return ut;Mo=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.base64=void 0;const e=Pe,n=le(),r=(t,l={})=>{var c,o;const p=(c=l.paddingRequired)!==null&&c!==void 0?c:!1,g=(o=l.characterSet)!==null&&o!==void 0?o:"base64";let u;g==="base64"?u=String.raw`[A-Za-z0-9+\/]`:((0,n.assert)(g==="base64url"),u=String.raw`[-_A-Za-z0-9]`);let h;return p?h=new RegExp(`^(?:${u}{4})*(?:${u}{3}=|${u}{2}==)?$`,"u"):h=new RegExp(`^(?:${u}{4})*(?:${u}{2,3}|${u}{3}=|${u}{2}==)?$`,"u"),(0,e.pattern)(t,h)};return ut.base64=r,ut}var U={},dn={},No;function $t(){return No||(No=1,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 n=Pe,r=le();e.HexStruct=(0,n.pattern)((0,n.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]+$/iu);function t(u){return(0,n.is)(u,e.HexStruct)}e.isHexString=t;function l(u){return(0,n.is)(u,e.StrictHexStruct)}e.isStrictHexString=l;function c(u){(0,r.assert)(t(u),"Value must be a hexadecimal string.")}e.assertIsHexString=c;function o(u){(0,r.assert)(l(u),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=o;function p(u){return u.startsWith("0x")?u:u.startsWith("0X")?`0x${u.substring(2)}`:`0x${u}`}e.add0x=p;function g(u){return u.startsWith("0x")||u.startsWith("0X")?u.substring(2):u}e.remove0x=g}(dn)),dn}var To;function Zc(){if(To)return U;To=1,Object.defineProperty(U,"__esModule",{value:!0}),U.createDataView=U.concatBytes=U.valueToBytes=U.stringToBytes=U.numberToBytes=U.signedBigIntToBytes=U.bigIntToBytes=U.hexToBytes=U.bytesToString=U.bytesToNumber=U.bytesToSignedBigInt=U.bytesToBigInt=U.bytesToHex=U.assertIsBytes=U.isBytes=void 0;const e=le(),n=$t(),r=48,t=58,l=87;function c(){const _=[];return()=>{if(_.length===0)for(let C=0;C<256;C++)_.push(C.toString(16).padStart(2,"0"));return _}}const o=c();function p(_){return _ instanceof Uint8Array}U.isBytes=p;function g(_){(0,e.assert)(p(_),"Value must be a Uint8Array.")}U.assertIsBytes=g;function u(_){if(g(_),_.length===0)return"0x";const C=o(),T=new Array(_.length);for(let N=0;N<_.length;N++)T[N]=C[_[N]];return(0,n.add0x)(T.join(""))}U.bytesToHex=u;function h(_){g(_);const C=u(_);return BigInt(C)}U.bytesToBigInt=h;function i(_){g(_);let C=BigInt(0);for(const T of _)C=(C<<BigInt(8))+BigInt(T);return BigInt.asIntN(_.length*8,C)}U.bytesToSignedBigInt=i;function a(_){g(_);const C=h(_);return(0,e.assert)(C<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(C)}U.bytesToNumber=a;function s(_){return g(_),new TextDecoder().decode(_)}U.bytesToString=s;function f(_){var C;if(((C=_==null?void 0:_.toLowerCase)===null||C===void 0?void 0:C.call(_))==="0x")return new Uint8Array;(0,n.assertIsHexString)(_);const T=(0,n.remove0x)(_).toLowerCase(),N=T.length%2===0?T:`0${T}`,x=new Uint8Array(N.length/2);for(let F=0;F<x.length;F++){const V=N.charCodeAt(F*2),A=N.charCodeAt(F*2+1),k=V-(V<t?r:l),R=A-(A<t?r:l);x[F]=k*16+R}return x}U.hexToBytes=f;function m(_){(0,e.assert)(typeof _=="bigint","Value must be a bigint."),(0,e.assert)(_>=BigInt(0),"Value must be a non-negative bigint.");const C=_.toString(16);return f(C)}U.bigIntToBytes=m;function b(_,C){(0,e.assert)(C>0);const T=_>>BigInt(31);return!((~_&T)+(_&~T)>>BigInt(C*8+-1))}function d(_,C){(0,e.assert)(typeof _=="bigint","Value must be a bigint."),(0,e.assert)(typeof C=="number","Byte length must be a number."),(0,e.assert)(C>0,"Byte length must be greater than 0."),(0,e.assert)(b(_,C),"Byte length is too small to represent the given value.");let T=_;const N=new Uint8Array(C);for(let x=0;x<N.length;x++)N[x]=Number(BigInt.asUintN(8,T)),T>>=BigInt(8);return N.reverse()}U.signedBigIntToBytes=d;function y(_){(0,e.assert)(typeof _=="number","Value must be a number."),(0,e.assert)(_>=0,"Value must be a non-negative number."),(0,e.assert)(Number.isSafeInteger(_),"Value is not a safe integer. Use `bigIntToBytes` instead.");const C=_.toString(16);return f(C)}U.numberToBytes=y;function w(_){return(0,e.assert)(typeof _=="string","Value must be a string."),new TextEncoder().encode(_)}U.stringToBytes=w;function v(_){if(typeof _=="bigint")return m(_);if(typeof _=="number")return y(_);if(typeof _=="string")return _.startsWith("0x")?f(_):w(_);if(p(_))return _;throw new TypeError(`Unsupported value type: "${typeof _}".`)}U.valueToBytes=v;function E(_){const C=new Array(_.length);let T=0;for(let x=0;x<_.length;x++){const F=v(_[x]);C[x]=F,T+=F.length}const N=new Uint8Array(T);for(let x=0,F=0;x<C.length;x++)N.set(C[x],F),F+=C[x].length;return N}U.concatBytes=E;function S(_){if(typeof D<"u"&&_ instanceof D){const C=_.buffer.slice(_.byteOffset,_.byteOffset+_.byteLength);return new DataView(C)}return new DataView(_.buffer,_.byteOffset,_.byteLength)}return U.createDataView=S,U}var lt={},Po;function Jl(){if(Po)return lt;Po=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.ChecksumStruct=void 0;const e=Pe,n=Gc();return lt.ChecksumStruct=(0,e.size)((0,n.base64)((0,e.string)(),{paddingRequired:!0}),44,44),lt}var te={},Oo;function Gl(){if(Oo)return te;Oo=1,Object.defineProperty(te,"__esModule",{value:!0}),te.createHex=te.createBytes=te.createBigInt=te.createNumber=void 0;const e=Pe,n=le(),r=Zc(),t=$t(),l=(0,e.union)([(0,e.number)(),(0,e.bigint)(),(0,e.string)(),t.StrictHexStruct]),c=(0,e.coerce)((0,e.number)(),l,Number),o=(0,e.coerce)((0,e.bigint)(),l,BigInt);(0,e.union)([t.StrictHexStruct,(0,e.instance)(Uint8Array)]);const p=(0,e.coerce)((0,e.instance)(Uint8Array),(0,e.union)([t.StrictHexStruct]),r.hexToBytes),g=(0,e.coerce)(t.StrictHexStruct,(0,e.instance)(Uint8Array),r.bytesToHex);function u(s){try{const f=(0,e.create)(s,c);return(0,n.assert)(Number.isFinite(f),`Expected a number-like value, got "${s}".`),f}catch(f){throw f instanceof e.StructError?new Error(`Expected a number-like value, got "${s}".`):f}}te.createNumber=u;function h(s){try{return(0,e.create)(s,o)}catch(f){throw f instanceof e.StructError?new Error(`Expected a number-like value, got "${String(f.value)}".`):f}}te.createBigInt=h;function i(s){if(typeof s=="string"&&s.toLowerCase()==="0x")return new Uint8Array;try{return(0,e.create)(s,p)}catch(f){throw f instanceof e.StructError?new Error(`Expected a bytes-like value, got "${String(f.value)}".`):f}}te.createBytes=i;function a(s){if(s instanceof Uint8Array&&s.length===0||typeof s=="string"&&s.toLowerCase()==="0x")return"0x";try{return(0,e.create)(s,g)}catch(f){throw f instanceof e.StructError?new Error(`Expected a bytes-like value, got "${String(f.value)}".`):f}}return te.createHex=a,te}var re={},xo;function Zl(){if(xo)return re;xo=1;var e=re&&re.__classPrivateFieldSet||function(o,p,g,u,h){if(u==="m")throw new TypeError("Private method is not writable");if(u==="a"&&!h)throw new TypeError("Private accessor was defined without a setter");if(typeof p=="function"?o!==p||!h:!p.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return u==="a"?h.call(o,g):h?h.value=g:p.set(o,g),g},n=re&&re.__classPrivateFieldGet||function(o,p,g,u){if(g==="a"&&!u)throw new TypeError("Private accessor was defined without a getter");if(typeof p=="function"?o!==p||!u:!p.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return g==="m"?u:g==="a"?u.call(o):u?u.value:p.get(o)},r,t;Object.defineProperty(re,"__esModule",{value:!0}),re.FrozenSet=re.FrozenMap=void 0;class l{constructor(p){r.set(this,void 0),e(this,r,new Map(p),"f"),Object.freeze(this)}get size(){return n(this,r,"f").size}[(r=new WeakMap,Symbol.iterator)](){return n(this,r,"f")[Symbol.iterator]()}entries(){return n(this,r,"f").entries()}forEach(p,g){return n(this,r,"f").forEach((u,h,i)=>p.call(g,u,h,this))}get(p){return n(this,r,"f").get(p)}has(p){return n(this,r,"f").has(p)}keys(){return n(this,r,"f").keys()}values(){return n(this,r,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([p,g])=>`${String(p)} => ${String(g)}`).join(", ")} `:""}}`}}re.FrozenMap=l;class c{constructor(p){t.set(this,void 0),e(this,t,new Set(p),"f"),Object.freeze(this)}get size(){return n(this,t,"f").size}[(t=new WeakMap,Symbol.iterator)](){return n(this,t,"f")[Symbol.iterator]()}entries(){return n(this,t,"f").entries()}forEach(p,g){return n(this,t,"f").forEach((u,h,i)=>p.call(g,u,h,this))}has(p){return n(this,t,"f").has(p)}keys(){return n(this,t,"f").keys()}values(){return n(this,t,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(p=>String(p)).join(", ")} `:""}}`}}return re.FrozenSet=c,Object.freeze(l),Object.freeze(l.prototype),Object.freeze(c),Object.freeze(c.prototype),re}var hn={},Bo;function Ql(){return Bo||(Bo=1,Object.defineProperty(hn,"__esModule",{value:!0})),hn}var fn={},Fo;function Kl(){return Fo||(Fo=1,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 n=Pe,r=le(),t=()=>(0,n.define)("finite number",E=>(0,n.is)(E,(0,n.number)())&&Number.isFinite(E));e.UnsafeJsonStruct=(0,n.union)([(0,n.literal)(null),(0,n.boolean)(),t(),(0,n.string)(),(0,n.array)((0,n.lazy)(()=>e.UnsafeJsonStruct)),(0,n.record)((0,n.string)(),(0,n.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,n.define)("Json",(E,S)=>{function _(C,T){const x=[...T.validator(C,S)];return x.length>0?x:!0}try{const C=_(E,e.UnsafeJsonStruct);return C!==!0?C:_(JSON.parse(JSON.stringify(E)),e.UnsafeJsonStruct)}catch(C){return C instanceof RangeError?"Circular reference detected":!1}});function l(E){return(0,n.is)(E,e.JsonStruct)}e.isValidJson=l;function c(E){(0,r.assertStruct)(E,e.JsonStruct,"Invalid JSON value");const S=JSON.stringify(E);return new TextEncoder().encode(S).byteLength}e.getJsonSize=c,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,n.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,n.nullable)((0,n.union)([(0,n.number)(),(0,n.string)()])),e.JsonRpcErrorStruct=(0,n.object)({code:(0,n.integer)(),message:(0,n.string)(),data:(0,n.optional)(e.JsonStruct),stack:(0,n.optional)((0,n.string)())}),e.JsonRpcParamsStruct=(0,n.optional)((0,n.union)([(0,n.record)((0,n.string)(),e.JsonStruct),(0,n.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,n.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,n.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,n.omit)(e.JsonRpcRequestStruct,["id"]);function o(E){return(0,n.is)(E,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=o;function p(E,S){(0,r.assertStruct)(E,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",S)}e.assertIsJsonRpcNotification=p;function g(E){return(0,n.is)(E,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=g;function u(E,S){(0,r.assertStruct)(E,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",S)}e.assertIsJsonRpcRequest=u,e.PendingJsonRpcResponseStruct=(0,n.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,n.optional)((0,n.unknown)()),error:(0,n.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,n.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,n.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,n.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function h(E){return(0,n.is)(E,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=h;function i(E,S){(0,r.assertStruct)(E,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",S)}e.assertIsPendingJsonRpcResponse=i;function a(E){return(0,n.is)(E,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=a;function s(E,S){(0,r.assertStruct)(E,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",S)}e.assertIsJsonRpcResponse=s;function f(E){return(0,n.is)(E,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=f;function m(E,S){(0,r.assertStruct)(E,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",S)}e.assertIsJsonRpcSuccess=m;function b(E){return(0,n.is)(E,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=b;function d(E,S){(0,r.assertStruct)(E,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",S)}e.assertIsJsonRpcFailure=d;function y(E){return(0,n.is)(E,e.JsonRpcErrorStruct)}e.isJsonRpcError=y;function w(E,S){(0,r.assertStruct)(E,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",S)}e.assertIsJsonRpcError=w;function v(E){const{permitEmptyString:S,permitFractions:_,permitNull:C}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},E);return N=>!!(typeof N=="number"&&(_||Number.isInteger(N))||typeof N=="string"&&(S||N.length>0)||C&&N===null)}e.getJsonRpcIdValidator=v}(fn)),fn}var gn={},qo;function Xl(){return qo||(qo=1,Object.defineProperty(gn,"__esModule",{value:!0})),gn}var ae={},xt={exports:{}},pn,Do;function Yl(){if(Do)return pn;Do=1;var e=1e3,n=e*60,r=n*60,t=r*24,l=t*7,c=t*365.25;pn=function(h,i){i=i||{};var a=typeof h;if(a==="string"&&h.length>0)return o(h);if(a==="number"&&isFinite(h))return i.long?g(h):p(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))};function o(h){if(h=String(h),!(h.length>100)){var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(i){var a=parseFloat(i[1]),s=(i[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"yrs":case"yr":case"y":return a*c;case"weeks":case"week":case"w":return a*l;case"days":case"day":case"d":return a*t;case"hours":case"hour":case"hrs":case"hr":case"h":return a*r;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}function p(h){var i=Math.abs(h);return i>=t?Math.round(h/t)+"d":i>=r?Math.round(h/r)+"h":i>=n?Math.round(h/n)+"m":i>=e?Math.round(h/e)+"s":h+"ms"}function g(h){var i=Math.abs(h);return i>=t?u(h,i,t,"day"):i>=r?u(h,i,r,"hour"):i>=n?u(h,i,n,"minute"):i>=e?u(h,i,e,"second"):h+" ms"}function u(h,i,a,s){var f=i>=a*1.5;return Math.round(h/a)+" "+s+(f?"s":"")}return pn}var mn,jo;function ed(){if(jo)return mn;jo=1;function e(n){t.debug=t,t.default=t,t.coerce=u,t.disable=p,t.enable=c,t.enabled=g,t.humanize=Yl(),t.destroy=h,Object.keys(n).forEach(i=>{t[i]=n[i]}),t.names=[],t.skips=[],t.formatters={};function r(i){let a=0;for(let s=0;s<i.length;s++)a=(a<<5)-a+i.charCodeAt(s),a|=0;return t.colors[Math.abs(a)%t.colors.length]}t.selectColor=r;function t(i){let a,s=null,f,m;function b(...d){if(!b.enabled)return;const y=b,w=Number(new Date),v=w-(a||w);y.diff=v,y.prev=a,y.curr=w,a=w,d[0]=t.coerce(d[0]),typeof d[0]!="string"&&d.unshift("%O");let E=0;d[0]=d[0].replace(/%([a-zA-Z%])/g,(_,C)=>{if(_==="%%")return"%";E++;const T=t.formatters[C];if(typeof T=="function"){const N=d[E];_=T.call(y,N),d.splice(E,1),E--}return _}),t.formatArgs.call(y,d),(y.log||t.log).apply(y,d)}return b.namespace=i,b.useColors=t.useColors(),b.color=t.selectColor(i),b.extend=l,b.destroy=t.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>s!==null?s:(f!==t.namespaces&&(f=t.namespaces,m=t.enabled(i)),m),set:d=>{s=d}}),typeof t.init=="function"&&t.init(b),b}function l(i,a){const s=t(this.namespace+(typeof a>"u"?":":a)+i);return s.log=this.log,s}function c(i){t.save(i),t.namespaces=i,t.names=[],t.skips=[];const a=(typeof i=="string"?i:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const s of a)s[0]==="-"?t.skips.push(s.slice(1)):t.names.push(s)}function o(i,a){let s=0,f=0,m=-1,b=0;for(;s<i.length;)if(f<a.length&&(a[f]===i[s]||a[f]==="*"))a[f]==="*"?(m=f,b=s,f++):(s++,f++);else if(m!==-1)f=m+1,b++,s=b;else return!1;for(;f<a.length&&a[f]==="*";)f++;return f===a.length}function p(){const i=[...t.names,...t.skips.map(a=>"-"+a)].join(",");return t.enable(""),i}function g(i){for(const a of t.skips)if(o(i,a))return!1;for(const a of t.names)if(o(i,a))return!0;return!1}function u(i){return i instanceof Error?i.stack||i.message:i}function h(){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 t.enable(t.load()),t}return mn=e,mn}var Ho;function td(){return Ho||(Ho=1,function(e,n){var r={};n.formatArgs=l,n.save=c,n.load=o,n.useColors=t,n.storage=p(),n.destroy=(()=>{let u=!1;return()=>{u||(u=!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`."))}})(),n.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 t(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let u;return 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&&(u=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(u[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function l(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const h="color: "+this.color;u.splice(1,0,h,"color: inherit");let i=0,a=0;u[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(i++,s==="%c"&&(a=i))}),u.splice(a,0,h)}n.log=console.debug||console.log||(()=>{});function c(u){try{u?n.storage.setItem("debug",u):n.storage.removeItem("debug")}catch{}}function o(){let u;try{u=n.storage.getItem("debug")||n.storage.getItem("DEBUG")}catch{}return!u&&typeof As<"u"&&"env"in As&&(u=r.DEBUG),u}function p(){try{return localStorage}catch{}}e.exports=ed()(n);const{formatters:g}=e.exports;g.j=function(u){try{return JSON.stringify(u)}catch(h){return"[UnexpectedJSONParseError]: "+h.message}}}(xt,xt.exports)),xt.exports}var Uo;function rd(){if(Uo)return ae;Uo=1;var e=ae&&ae.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(ae,"__esModule",{value:!0}),ae.createModuleLogger=ae.createProjectLogger=void 0;const r=(0,e(td()).default)("metamask");function t(c){return r.extend(c)}ae.createProjectLogger=t;function l(c,o){return c.extend(o)}return ae.createModuleLogger=l,ae}var bn={},Wo;function nd(){return Wo||(Wo=1,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 n(u){return Array.isArray(u)&&u.length>0}e.isNonEmptyArray=n;function r(u){return u==null}e.isNullOrUndefined=r;function t(u){return!!u&&typeof u=="object"&&!Array.isArray(u)}e.isObject=t;const l=(u,h)=>Object.hasOwnProperty.call(u,h);e.hasProperty=l,function(u){u[u.Null=4]="Null",u[u.Comma=1]="Comma",u[u.Wrapper=1]="Wrapper",u[u.True=4]="True",u[u.False=5]="False",u[u.Quote=1]="Quote",u[u.Colon=1]="Colon",u[u.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function c(u){if(typeof u!="object"||u===null)return!1;try{let h=u;for(;Object.getPrototypeOf(h)!==null;)h=Object.getPrototypeOf(h);return Object.getPrototypeOf(u)===h}catch{return!1}}e.isPlainObject=c;function o(u){return u.charCodeAt(0)<=127}e.isASCII=o;function p(u){var h;return u.split("").reduce((a,s)=>o(s)?a+1:a+2,0)+((h=u.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&h!==void 0?h:[]).length}e.calculateStringSize=p;function g(u){return u.toString().length}e.calculateNumberSize=g}(bn)),bn}var ne={},Vo;function sd(){if(Vo)return ne;Vo=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.hexToBigInt=ne.hexToNumber=ne.bigIntToHex=ne.numberToHex=void 0;const e=le(),n=$t(),r=o=>((0,e.assert)(typeof o=="number","Value must be a number."),(0,e.assert)(o>=0,"Value must be a non-negative number."),(0,e.assert)(Number.isSafeInteger(o),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,n.add0x)(o.toString(16)));ne.numberToHex=r;const t=o=>((0,e.assert)(typeof o=="bigint","Value must be a bigint."),(0,e.assert)(o>=0,"Value must be a non-negative bigint."),(0,n.add0x)(o.toString(16)));ne.bigIntToHex=t;const l=o=>{(0,n.assertIsHexString)(o);const p=parseInt(o,16);return(0,e.assert)(Number.isSafeInteger(p),"Value is not a safe integer. Use `hexToBigInt` instead."),p};ne.hexToNumber=l;const c=o=>((0,n.assertIsHexString)(o),BigInt((0,n.add0x)(o)));return ne.hexToBigInt=c,ne}var wn={},zo;function id(){return zo||(zo=1,Object.defineProperty(wn,"__esModule",{value:!0})),wn}var yn={},$o;function od(){return $o||($o=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(c){c[c.Millisecond=1]="Millisecond",c[c.Second=1e3]="Second",c[c.Minute=6e4]="Minute",c[c.Hour=36e5]="Hour",c[c.Day=864e5]="Day",c[c.Week=6048e5]="Week",c[c.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const n=c=>Number.isInteger(c)&&c>=0,r=(c,o)=>{if(!n(c))throw new Error(`"${o}" must be a non-negative integer. Received: "${c}".`)};function t(c,o){return r(c,"count"),c*o}e.inMilliseconds=t;function l(c){return r(c,"timestamp"),Date.now()-c}e.timeSince=l}(yn)),yn}var vn={},Jo;function ad(){return Jo||(Jo=1,Object.defineProperty(vn,"__esModule",{value:!0})),vn}var En={},Bt={exports:{}},_n,Go;function Jt(){if(Go)return _n;Go=1;const e="2.0.0",n=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,t=16,l=n-6;return _n={MAX_LENGTH:n,MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:l,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},_n}var Rn,Zo;function Gt(){if(Zo)return Rn;Zo=1;var e={};return Rn=typeof As=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{},Rn}var Qo;function _t(){return Qo||(Qo=1,function(e,n){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:t,MAX_LENGTH:l}=Jt(),c=Gt();n=e.exports={};const o=n.re=[],p=n.safeRe=[],g=n.src=[],u=n.safeSrc=[],h=n.t={};let i=0;const a="[a-zA-Z0-9-]",s=[["\\s",1],["\\d",l],[a,t]],f=b=>{for(const[d,y]of s)b=b.split(`${d}*`).join(`${d}{0,${y}}`).split(`${d}+`).join(`${d}{1,${y}}`);return b},m=(b,d,y)=>{const w=f(d),v=i++;c(b,v,d),h[b]=v,g[v]=d,u[v]=w,o[v]=new RegExp(d,y?"g":void 0),p[v]=new RegExp(w,y?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${a}*`),m("MAINVERSION",`(${g[h.NUMERICIDENTIFIER]})\\.(${g[h.NUMERICIDENTIFIER]})\\.(${g[h.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${g[h.NUMERICIDENTIFIERLOOSE]})\\.(${g[h.NUMERICIDENTIFIERLOOSE]})\\.(${g[h.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${g[h.NONNUMERICIDENTIFIER]}|${g[h.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${g[h.NONNUMERICIDENTIFIER]}|${g[h.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${g[h.PRERELEASEIDENTIFIER]}(?:\\.${g[h.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${g[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${g[h.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${a}+`),m("BUILD",`(?:\\+(${g[h.BUILDIDENTIFIER]}(?:\\.${g[h.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${g[h.MAINVERSION]}${g[h.PRERELEASE]}?${g[h.BUILD]}?`),m("FULL",`^${g[h.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${g[h.MAINVERSIONLOOSE]}${g[h.PRERELEASELOOSE]}?${g[h.BUILD]}?`),m("LOOSE",`^${g[h.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${g[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${g[h.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${g[h.XRANGEIDENTIFIER]})(?:\\.(${g[h.XRANGEIDENTIFIER]})(?:\\.(${g[h.XRANGEIDENTIFIER]})(?:${g[h.PRERELEASE]})?${g[h.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${g[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${g[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${g[h.XRANGEIDENTIFIERLOOSE]})(?:${g[h.PRERELEASELOOSE]})?${g[h.BUILD]}?)?)?`),m("XRANGE",`^${g[h.GTLT]}\\s*${g[h.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${g[h.GTLT]}\\s*${g[h.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),m("COERCE",`${g[h.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",g[h.COERCEPLAIN]+`(?:${g[h.PRERELEASE]})?(?:${g[h.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",g[h.COERCE],!0),m("COERCERTLFULL",g[h.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${g[h.LONETILDE]}\\s+`,!0),n.tildeTrimReplace="$1~",m("TILDE",`^${g[h.LONETILDE]}${g[h.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${g[h.LONETILDE]}${g[h.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${g[h.LONECARET]}\\s+`,!0),n.caretTrimReplace="$1^",m("CARET",`^${g[h.LONECARET]}${g[h.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${g[h.LONECARET]}${g[h.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${g[h.GTLT]}\\s*(${g[h.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${g[h.GTLT]}\\s*(${g[h.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${g[h.GTLT]}\\s*(${g[h.LOOSEPLAIN]}|${g[h.XRANGEPLAIN]})`,!0),n.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${g[h.XRANGEPLAIN]})\\s+-\\s+(${g[h.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${g[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${g[h.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Bt,Bt.exports)),Bt.exports}var Sn,Ko;function Vs(){if(Ko)return Sn;Ko=1;const e=Object.freeze({loose:!0}),n=Object.freeze({});return Sn=t=>t?typeof t!="object"?e:t:n,Sn}var Cn,Xo;function Qc(){if(Xo)return Cn;Xo=1;const e=/^[0-9]+$/,n=(t,l)=>{if(typeof t=="number"&&typeof l=="number")return t===l?0:t<l?-1:1;const c=e.test(t),o=e.test(l);return c&&o&&(t=+t,l=+l),t===l?0:c&&!o?-1:o&&!c?1:t<l?-1:1};return Cn={compareIdentifiers:n,rcompareIdentifiers:(t,l)=>n(l,t)},Cn}var kn,Yo;function G(){if(Yo)return kn;Yo=1;const e=Gt(),{MAX_LENGTH:n,MAX_SAFE_INTEGER:r}=Jt(),{safeRe:t,t:l}=_t(),c=Vs(),{compareIdentifiers:o}=Qc();class p{constructor(u,h){if(h=c(h),u instanceof p){if(u.loose===!!h.loose&&u.includePrerelease===!!h.includePrerelease)return u;u=u.version}else if(typeof u!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>n)throw new TypeError(`version is longer than ${n} characters`);e("SemVer",u,h),this.options=h,this.loose=!!h.loose,this.includePrerelease=!!h.includePrerelease;const i=u.trim().match(h.loose?t[l.LOOSE]:t[l.FULL]);if(!i)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(a=>{if(/^[0-9]+$/.test(a)){const s=+a;if(s>=0&&s<r)return s}return a}):this.prerelease=[],this.build=i[5]?i[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(u){if(e("SemVer.compare",this.version,this.options,u),!(u instanceof p)){if(typeof u=="string"&&u===this.version)return 0;u=new p(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof p||(u=new p(u,this.options)),this.major<u.major?-1:this.major>u.major?1:this.minor<u.minor?-1:this.minor>u.minor?1:this.patch<u.patch?-1:this.patch>u.patch?1:0}comparePre(u){if(u instanceof p||(u=new p(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let h=0;do{const i=this.prerelease[h],a=u.prerelease[h];if(e("prerelease compare",h,i,a),i===void 0&&a===void 0)return 0;if(a===void 0)return 1;if(i===void 0)return-1;if(i===a)continue;return o(i,a)}while(++h)}compareBuild(u){u instanceof p||(u=new p(u,this.options));let h=0;do{const i=this.build[h],a=u.build[h];if(e("build compare",h,i,a),i===void 0&&a===void 0)return 0;if(a===void 0)return 1;if(i===void 0)return-1;if(i===a)continue;return o(i,a)}while(++h)}inc(u,h,i){if(u.startsWith("pre")){if(!h&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(h){const a=`-${h}`.match(this.options.loose?t[l.PRERELEASELOOSE]:t[l.PRERELEASE]);if(!a||a[1]!==h)throw new Error(`invalid identifier: ${h}`)}}switch(u){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",h,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",h,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",h,i),this.inc("pre",h,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",h,i),this.inc("pre",h,i);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 a=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[a];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(h===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(a)}}if(h){let s=[h,a];i===!1&&(s=[h]),o(this.prerelease[0],h)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return kn=p,kn}var In,ea;function xe(){if(ea)return In;ea=1;const e=G();return In=(r,t,l=!1)=>{if(r instanceof e)return r;try{return new e(r,t)}catch(c){if(!l)return null;throw c}},In}var An,ta;function cd(){if(ta)return An;ta=1;const e=xe();return An=(r,t)=>{const l=e(r,t);return l?l.version:null},An}var Ln,ra;function ud(){if(ra)return Ln;ra=1;const e=xe();return Ln=(r,t)=>{const l=e(r.trim().replace(/^[=v]+/,""),t);return l?l.version:null},Ln}var Mn,na;function ld(){if(na)return Mn;na=1;const e=G();return Mn=(r,t,l,c,o)=>{typeof l=="string"&&(o=c,c=l,l=void 0);try{return new e(r instanceof e?r.version:r,l).inc(t,c,o).version}catch{return null}},Mn}var Nn,sa;function dd(){if(sa)return Nn;sa=1;const e=xe();return Nn=(r,t)=>{const l=e(r,null,!0),c=e(t,null,!0),o=l.compare(c);if(o===0)return null;const p=o>0,g=p?l:c,u=p?c:l,h=!!g.prerelease.length;if(!!u.prerelease.length&&!h){if(!u.patch&&!u.minor)return"major";if(u.compareMain(g)===0)return u.minor&&!u.patch?"minor":"patch"}const a=h?"pre":"";return l.major!==c.major?a+"major":l.minor!==c.minor?a+"minor":l.patch!==c.patch?a+"patch":"prerelease"},Nn}var Tn,ia;function hd(){if(ia)return Tn;ia=1;const e=G();return Tn=(r,t)=>new e(r,t).major,Tn}var Pn,oa;function fd(){if(oa)return Pn;oa=1;const e=G();return Pn=(r,t)=>new e(r,t).minor,Pn}var On,aa;function gd(){if(aa)return On;aa=1;const e=G();return On=(r,t)=>new e(r,t).patch,On}var xn,ca;function pd(){if(ca)return xn;ca=1;const e=xe();return xn=(r,t)=>{const l=e(r,t);return l&&l.prerelease.length?l.prerelease:null},xn}var Bn,ua;function se(){if(ua)return Bn;ua=1;const e=G();return Bn=(r,t,l)=>new e(r,l).compare(new e(t,l)),Bn}var Fn,la;function md(){if(la)return Fn;la=1;const e=se();return Fn=(r,t,l)=>e(t,r,l),Fn}var qn,da;function bd(){if(da)return qn;da=1;const e=se();return qn=(r,t)=>e(r,t,!0),qn}var Dn,ha;function zs(){if(ha)return Dn;ha=1;const e=G();return Dn=(r,t,l)=>{const c=new e(r,l),o=new e(t,l);return c.compare(o)||c.compareBuild(o)},Dn}var jn,fa;function wd(){if(fa)return jn;fa=1;const e=zs();return jn=(r,t)=>r.sort((l,c)=>e(l,c,t)),jn}var Hn,ga;function yd(){if(ga)return Hn;ga=1;const e=zs();return Hn=(r,t)=>r.sort((l,c)=>e(c,l,t)),Hn}var Un,pa;function Zt(){if(pa)return Un;pa=1;const e=se();return Un=(r,t,l)=>e(r,t,l)>0,Un}var Wn,ma;function $s(){if(ma)return Wn;ma=1;const e=se();return Wn=(r,t,l)=>e(r,t,l)<0,Wn}var Vn,ba;function Kc(){if(ba)return Vn;ba=1;const e=se();return Vn=(r,t,l)=>e(r,t,l)===0,Vn}var zn,wa;function Xc(){if(wa)return zn;wa=1;const e=se();return zn=(r,t,l)=>e(r,t,l)!==0,zn}var $n,ya;function Js(){if(ya)return $n;ya=1;const e=se();return $n=(r,t,l)=>e(r,t,l)>=0,$n}var Jn,va;function Gs(){if(va)return Jn;va=1;const e=se();return Jn=(r,t,l)=>e(r,t,l)<=0,Jn}var Gn,Ea;function Yc(){if(Ea)return Gn;Ea=1;const e=Kc(),n=Xc(),r=Zt(),t=Js(),l=$s(),c=Gs();return Gn=(p,g,u,h)=>{switch(g){case"===":return typeof p=="object"&&(p=p.version),typeof u=="object"&&(u=u.version),p===u;case"!==":return typeof p=="object"&&(p=p.version),typeof u=="object"&&(u=u.version),p!==u;case"":case"=":case"==":return e(p,u,h);case"!=":return n(p,u,h);case">":return r(p,u,h);case">=":return t(p,u,h);case"<":return l(p,u,h);case"<=":return c(p,u,h);default:throw new TypeError(`Invalid operator: ${g}`)}},Gn}var Zn,_a;function vd(){if(_a)return Zn;_a=1;const e=G(),n=xe(),{safeRe:r,t}=_t();return Zn=(c,o)=>{if(c instanceof e)return c;if(typeof c=="number"&&(c=String(c)),typeof c!="string")return null;o=o||{};let p=null;if(!o.rtl)p=c.match(o.includePrerelease?r[t.COERCEFULL]:r[t.COERCE]);else{const s=o.includePrerelease?r[t.COERCERTLFULL]:r[t.COERCERTL];let f;for(;(f=s.exec(c))&&(!p||p.index+p[0].length!==c.length);)(!p||f.index+f[0].length!==p.index+p[0].length)&&(p=f),s.lastIndex=f.index+f[1].length+f[2].length;s.lastIndex=-1}if(p===null)return null;const g=p[2],u=p[3]||"0",h=p[4]||"0",i=o.includePrerelease&&p[5]?`-${p[5]}`:"",a=o.includePrerelease&&p[6]?`+${p[6]}`:"";return n(`${g}.${u}.${h}${i}${a}`,o)},Zn}var Qn,Ra;function Ed(){if(Ra)return Qn;Ra=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const t=this.map.get(r);if(t!==void 0)return this.map.delete(r),this.map.set(r,t),t}delete(r){return this.map.delete(r)}set(r,t){if(!this.delete(r)&&t!==void 0){if(this.map.size>=this.max){const c=this.map.keys().next().value;this.delete(c)}this.map.set(r,t)}return this}}return Qn=e,Qn}var Kn,Sa;function ie(){if(Sa)return Kn;Sa=1;const e=/\s+/g;class n{constructor(k,R){if(R=l(R),k instanceof n)return k.loose===!!R.loose&&k.includePrerelease===!!R.includePrerelease?k:new n(k.raw,R);if(k instanceof c)return this.raw=k.value,this.set=[[k]],this.formatted=void 0,this;if(this.options=R,this.loose=!!R.loose,this.includePrerelease=!!R.includePrerelease,this.raw=k.trim().replace(e," "),this.set=this.raw.split("||").map(I=>this.parseRange(I.trim())).filter(I=>I.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const I=this.set[0];if(this.set=this.set.filter(M=>!m(M[0])),this.set.length===0)this.set=[I];else if(this.set.length>1){for(const M of this.set)if(M.length===1&&b(M[0])){this.set=[M];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let k=0;k<this.set.length;k++){k>0&&(this.formatted+="||");const R=this.set[k];for(let I=0;I<R.length;I++)I>0&&(this.formatted+=" "),this.formatted+=R[I].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(k){const I=((this.options.includePrerelease&&s)|(this.options.loose&&f))+":"+k,M=t.get(I);if(M)return M;const L=this.options.loose,P=L?g[u.HYPHENRANGELOOSE]:g[u.HYPHENRANGE];k=k.replace(P,F(this.options.includePrerelease)),o("hyphen replace",k),k=k.replace(g[u.COMPARATORTRIM],h),o("comparator trim",k),k=k.replace(g[u.TILDETRIM],i),o("tilde trim",k),k=k.replace(g[u.CARETTRIM],a),o("caret trim",k);let j=k.split(" ").map(q=>y(q,this.options)).join(" ").split(/\s+/).map(q=>x(q,this.options));L&&(j=j.filter(q=>(o("loose invalid filter",q,this.options),!!q.match(g[u.COMPARATORLOOSE])))),o("range list",j);const B=new Map,H=j.map(q=>new c(q,this.options));for(const q of H){if(m(q))return[q];B.set(q.value,q)}B.size>1&&B.has("")&&B.delete("");const W=[...B.values()];return t.set(I,W),W}intersects(k,R){if(!(k instanceof n))throw new TypeError("a Range is required");return this.set.some(I=>d(I,R)&&k.set.some(M=>d(M,R)&&I.every(L=>M.every(P=>L.intersects(P,R)))))}test(k){if(!k)return!1;if(typeof k=="string")try{k=new p(k,this.options)}catch{return!1}for(let R=0;R<this.set.length;R++)if(V(this.set[R],k,this.options))return!0;return!1}}Kn=n;const r=Ed(),t=new r,l=Vs(),c=Qt(),o=Gt(),p=G(),{safeRe:g,t:u,comparatorTrimReplace:h,tildeTrimReplace:i,caretTrimReplace:a}=_t(),{FLAG_INCLUDE_PRERELEASE:s,FLAG_LOOSE:f}=Jt(),m=A=>A.value==="<0.0.0-0",b=A=>A.value==="",d=(A,k)=>{let R=!0;const I=A.slice();let M=I.pop();for(;R&&I.length;)R=I.every(L=>M.intersects(L,k)),M=I.pop();return R},y=(A,k)=>(A=A.replace(g[u.BUILD],""),o("comp",A,k),A=S(A,k),o("caret",A),A=v(A,k),o("tildes",A),A=C(A,k),o("xrange",A),A=N(A,k),o("stars",A),A),w=A=>!A||A.toLowerCase()==="x"||A==="*",v=(A,k)=>A.trim().split(/\s+/).map(R=>E(R,k)).join(" "),E=(A,k)=>{const R=k.loose?g[u.TILDELOOSE]:g[u.TILDE];return A.replace(R,(I,M,L,P,j)=>{o("tilde",A,I,M,L,P,j);let B;return w(M)?B="":w(L)?B=`>=${M}.0.0 <${+M+1}.0.0-0`:w(P)?B=`>=${M}.${L}.0 <${M}.${+L+1}.0-0`:j?(o("replaceTilde pr",j),B=`>=${M}.${L}.${P}-${j} <${M}.${+L+1}.0-0`):B=`>=${M}.${L}.${P} <${M}.${+L+1}.0-0`,o("tilde return",B),B})},S=(A,k)=>A.trim().split(/\s+/).map(R=>_(R,k)).join(" "),_=(A,k)=>{o("caret",A,k);const R=k.loose?g[u.CARETLOOSE]:g[u.CARET],I=k.includePrerelease?"-0":"";return A.replace(R,(M,L,P,j,B)=>{o("caret",A,M,L,P,j,B);let H;return w(L)?H="":w(P)?H=`>=${L}.0.0${I} <${+L+1}.0.0-0`:w(j)?L==="0"?H=`>=${L}.${P}.0${I} <${L}.${+P+1}.0-0`:H=`>=${L}.${P}.0${I} <${+L+1}.0.0-0`:B?(o("replaceCaret pr",B),L==="0"?P==="0"?H=`>=${L}.${P}.${j}-${B} <${L}.${P}.${+j+1}-0`:H=`>=${L}.${P}.${j}-${B} <${L}.${+P+1}.0-0`:H=`>=${L}.${P}.${j}-${B} <${+L+1}.0.0-0`):(o("no pr"),L==="0"?P==="0"?H=`>=${L}.${P}.${j}${I} <${L}.${P}.${+j+1}-0`:H=`>=${L}.${P}.${j}${I} <${L}.${+P+1}.0-0`:H=`>=${L}.${P}.${j} <${+L+1}.0.0-0`),o("caret return",H),H})},C=(A,k)=>(o("replaceXRanges",A,k),A.split(/\s+/).map(R=>T(R,k)).join(" ")),T=(A,k)=>{A=A.trim();const R=k.loose?g[u.XRANGELOOSE]:g[u.XRANGE];return A.replace(R,(I,M,L,P,j,B)=>{o("xRange",A,I,M,L,P,j,B);const H=w(L),W=H||w(P),q=W||w(j),X=q;return M==="="&&X&&(M=""),B=k.includePrerelease?"-0":"",H?M===">"||M==="<"?I="<0.0.0-0":I="*":M&&X?(W&&(P=0),j=0,M===">"?(M=">=",W?(L=+L+1,P=0,j=0):(P=+P+1,j=0)):M==="<="&&(M="<",W?L=+L+1:P=+P+1),M==="<"&&(B="-0"),I=`${M+L}.${P}.${j}${B}`):W?I=`>=${L}.0.0${B} <${+L+1}.0.0-0`:q&&(I=`>=${L}.${P}.0${B} <${L}.${+P+1}.0-0`),o("xRange return",I),I})},N=(A,k)=>(o("replaceStars",A,k),A.trim().replace(g[u.STAR],"")),x=(A,k)=>(o("replaceGTE0",A,k),A.trim().replace(g[k.includePrerelease?u.GTE0PRE:u.GTE0],"")),F=A=>(k,R,I,M,L,P,j,B,H,W,q,X)=>(w(I)?R="":w(M)?R=`>=${I}.0.0${A?"-0":""}`:w(L)?R=`>=${I}.${M}.0${A?"-0":""}`:P?R=`>=${R}`:R=`>=${R}${A?"-0":""}`,w(H)?B="":w(W)?B=`<${+H+1}.0.0-0`:w(q)?B=`<${H}.${+W+1}.0-0`:X?B=`<=${H}.${W}.${q}-${X}`:A?B=`<${H}.${W}.${+q+1}-0`:B=`<=${B}`,`${R} ${B}`.trim()),V=(A,k,R)=>{for(let I=0;I<A.length;I++)if(!A[I].test(k))return!1;if(k.prerelease.length&&!R.includePrerelease){for(let I=0;I<A.length;I++)if(o(A[I].semver),A[I].semver!==c.ANY&&A[I].semver.prerelease.length>0){const M=A[I].semver;if(M.major===k.major&&M.minor===k.minor&&M.patch===k.patch)return!0}return!1}return!0};return Kn}var Xn,Ca;function Qt(){if(Ca)return Xn;Ca=1;const e=Symbol("SemVer ANY");class n{static get ANY(){return e}constructor(h,i){if(i=r(i),h instanceof n){if(h.loose===!!i.loose)return h;h=h.value}h=h.trim().split(/\s+/).join(" "),o("comparator",h,i),this.options=i,this.loose=!!i.loose,this.parse(h),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(h){const i=this.options.loose?t[l.COMPARATORLOOSE]:t[l.COMPARATOR],a=h.match(i);if(!a)throw new TypeError(`Invalid comparator: ${h}`);this.operator=a[1]!==void 0?a[1]:"",this.operator==="="&&(this.operator=""),a[2]?this.semver=new p(a[2],this.options.loose):this.semver=e}toString(){return this.value}test(h){if(o("Comparator.test",h,this.options.loose),this.semver===e||h===e)return!0;if(typeof h=="string")try{h=new p(h,this.options)}catch{return!1}return c(h,this.operator,this.semver,this.options)}intersects(h,i){if(!(h instanceof n))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new g(h.value,i).test(this.value):h.operator===""?h.value===""?!0:new g(this.value,i).test(h.semver):(i=r(i),i.includePrerelease&&(this.value==="<0.0.0-0"||h.value==="<0.0.0-0")||!i.includePrerelease&&(this.value.startsWith("<0.0.0")||h.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&h.operator.startsWith(">")||this.operator.startsWith("<")&&h.operator.startsWith("<")||this.semver.version===h.semver.version&&this.operator.includes("=")&&h.operator.includes("=")||c(this.semver,"<",h.semver,i)&&this.operator.startsWith(">")&&h.operator.startsWith("<")||c(this.semver,">",h.semver,i)&&this.operator.startsWith("<")&&h.operator.startsWith(">")))}}Xn=n;const r=Vs(),{safeRe:t,t:l}=_t(),c=Yc(),o=Gt(),p=G(),g=ie();return Xn}var Yn,ka;function Kt(){if(ka)return Yn;ka=1;const e=ie();return Yn=(r,t,l)=>{try{t=new e(t,l)}catch{return!1}return t.test(r)},Yn}var es,Ia;function _d(){if(Ia)return es;Ia=1;const e=ie();return es=(r,t)=>new e(r,t).set.map(l=>l.map(c=>c.value).join(" ").trim().split(" ")),es}var ts,Aa;function Rd(){if(Aa)return ts;Aa=1;const e=G(),n=ie();return ts=(t,l,c)=>{let o=null,p=null,g=null;try{g=new n(l,c)}catch{return null}return t.forEach(u=>{g.test(u)&&(!o||p.compare(u)===-1)&&(o=u,p=new e(o,c))}),o},ts}var rs,La;function Sd(){if(La)return rs;La=1;const e=G(),n=ie();return rs=(t,l,c)=>{let o=null,p=null,g=null;try{g=new n(l,c)}catch{return null}return t.forEach(u=>{g.test(u)&&(!o||p.compare(u)===1)&&(o=u,p=new e(o,c))}),o},rs}var ns,Ma;function Cd(){if(Ma)return ns;Ma=1;const e=G(),n=ie(),r=Zt();return ns=(l,c)=>{l=new n(l,c);let o=new e("0.0.0");if(l.test(o)||(o=new e("0.0.0-0"),l.test(o)))return o;o=null;for(let p=0;p<l.set.length;++p){const g=l.set[p];let u=null;g.forEach(h=>{const i=new e(h.semver.version);switch(h.operator){case">":i.prerelease.length===0?i.patch++:i.prerelease.push(0),i.raw=i.format();case"":case">=":(!u||r(i,u))&&(u=i);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${h.operator}`)}}),u&&(!o||r(o,u))&&(o=u)}return o&&l.test(o)?o:null},ns}var ss,Na;function kd(){if(Na)return ss;Na=1;const e=ie();return ss=(r,t)=>{try{return new e(r,t).range||"*"}catch{return null}},ss}var is,Ta;function Zs(){if(Ta)return is;Ta=1;const e=G(),n=Qt(),{ANY:r}=n,t=ie(),l=Kt(),c=Zt(),o=$s(),p=Gs(),g=Js();return is=(h,i,a,s)=>{h=new e(h,s),i=new t(i,s);let f,m,b,d,y;switch(a){case">":f=c,m=p,b=o,d=">",y=">=";break;case"<":f=o,m=g,b=c,d="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(l(h,i,s))return!1;for(let w=0;w<i.set.length;++w){const v=i.set[w];let E=null,S=null;if(v.forEach(_=>{_.semver===r&&(_=new n(">=0.0.0")),E=E||_,S=S||_,f(_.semver,E.semver,s)?E=_:b(_.semver,S.semver,s)&&(S=_)}),E.operator===d||E.operator===y||(!S.operator||S.operator===d)&&m(h,S.semver))return!1;if(S.operator===y&&b(h,S.semver))return!1}return!0},is}var os,Pa;function Id(){if(Pa)return os;Pa=1;const e=Zs();return os=(r,t,l)=>e(r,t,">",l),os}var as,Oa;function Ad(){if(Oa)return as;Oa=1;const e=Zs();return as=(r,t,l)=>e(r,t,"<",l),as}var cs,xa;function Ld(){if(xa)return cs;xa=1;const e=ie();return cs=(r,t,l)=>(r=new e(r,l),t=new e(t,l),r.intersects(t,l)),cs}var us,Ba;function Md(){if(Ba)return us;Ba=1;const e=Kt(),n=se();return us=(r,t,l)=>{const c=[];let o=null,p=null;const g=r.sort((a,s)=>n(a,s,l));for(const a of g)e(a,t,l)?(p=a,o||(o=a)):(p&&c.push([o,p]),p=null,o=null);o&&c.push([o,null]);const u=[];for(const[a,s]of c)a===s?u.push(a):!s&&a===g[0]?u.push("*"):s?a===g[0]?u.push(`<=${s}`):u.push(`${a} - ${s}`):u.push(`>=${a}`);const h=u.join(" || "),i=typeof t.raw=="string"?t.raw:String(t);return h.length<i.length?h:t},us}var ls,Fa;function Nd(){if(Fa)return ls;Fa=1;const e=ie(),n=Qt(),{ANY:r}=n,t=Kt(),l=se(),c=(i,a,s={})=>{if(i===a)return!0;i=new e(i,s),a=new e(a,s);let f=!1;e:for(const m of i.set){for(const b of a.set){const d=g(m,b,s);if(f=f||d!==null,d)continue e}if(f)return!1}return!0},o=[new n(">=0.0.0-0")],p=[new n(">=0.0.0")],g=(i,a,s)=>{if(i===a)return!0;if(i.length===1&&i[0].semver===r){if(a.length===1&&a[0].semver===r)return!0;s.includePrerelease?i=o:i=p}if(a.length===1&&a[0].semver===r){if(s.includePrerelease)return!0;a=p}const f=new Set;let m,b;for(const C of i)C.operator===">"||C.operator===">="?m=u(m,C,s):C.operator==="<"||C.operator==="<="?b=h(b,C,s):f.add(C.semver);if(f.size>1)return null;let d;if(m&&b){if(d=l(m.semver,b.semver,s),d>0)return null;if(d===0&&(m.operator!==">="||b.operator!=="<="))return null}for(const C of f){if(m&&!t(C,String(m),s)||b&&!t(C,String(b),s))return null;for(const T of a)if(!t(C,String(T),s))return!1;return!0}let y,w,v,E,S=b&&!s.includePrerelease&&b.semver.prerelease.length?b.semver:!1,_=m&&!s.includePrerelease&&m.semver.prerelease.length?m.semver:!1;S&&S.prerelease.length===1&&b.operator==="<"&&S.prerelease[0]===0&&(S=!1);for(const C of a){if(E=E||C.operator===">"||C.operator===">=",v=v||C.operator==="<"||C.operator==="<=",m){if(_&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===_.major&&C.semver.minor===_.minor&&C.semver.patch===_.patch&&(_=!1),C.operator===">"||C.operator===">="){if(y=u(m,C,s),y===C&&y!==m)return!1}else if(m.operator===">="&&!t(m.semver,String(C),s))return!1}if(b){if(S&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===S.major&&C.semver.minor===S.minor&&C.semver.patch===S.patch&&(S=!1),C.operator==="<"||C.operator==="<="){if(w=h(b,C,s),w===C&&w!==b)return!1}else if(b.operator==="<="&&!t(b.semver,String(C),s))return!1}if(!C.operator&&(b||m)&&d!==0)return!1}return!(m&&v&&!b&&d!==0||b&&E&&!m&&d!==0||_||S)},u=(i,a,s)=>{if(!i)return a;const f=l(i.semver,a.semver,s);return f>0?i:f<0||a.operator===">"&&i.operator===">="?a:i},h=(i,a,s)=>{if(!i)return a;const f=l(i.semver,a.semver,s);return f<0?i:f>0||a.operator==="<"&&i.operator==="<="?a:i};return ls=c,ls}var ds,qa;function Td(){if(qa)return ds;qa=1;const e=_t(),n=Jt(),r=G(),t=Qc(),l=xe(),c=cd(),o=ud(),p=ld(),g=dd(),u=hd(),h=fd(),i=gd(),a=pd(),s=se(),f=md(),m=bd(),b=zs(),d=wd(),y=yd(),w=Zt(),v=$s(),E=Kc(),S=Xc(),_=Js(),C=Gs(),T=Yc(),N=vd(),x=Qt(),F=ie(),V=Kt(),A=_d(),k=Rd(),R=Sd(),I=Cd(),M=kd(),L=Zs(),P=Id(),j=Ad(),B=Ld(),H=Md(),W=Nd();return ds={parse:l,valid:c,clean:o,inc:p,diff:g,major:u,minor:h,patch:i,prerelease:a,compare:s,rcompare:f,compareLoose:m,compareBuild:b,sort:d,rsort:y,gt:w,lt:v,eq:E,neq:S,gte:_,lte:C,cmp:T,coerce:N,Comparator:x,Range:F,satisfies:V,toComparators:A,maxSatisfying:k,minSatisfying:R,minVersion:I,validRange:M,outside:L,gtr:P,ltr:j,intersects:B,simplifyRange:H,subset:W,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:n.SEMVER_SPEC_VERSION,RELEASE_TYPES:n.RELEASE_TYPES,compareIdentifiers:t.compareIdentifiers,rcompareIdentifiers:t.rcompareIdentifiers},ds}var Da;function Pd(){return Da||(Da=1,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 n=Td(),r=Pe,t=le();e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",i=>(0,n.valid)(i)===null?`Expected SemVer version, got "${i}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",i=>(0,n.validRange)(i)===null?`Expected SemVer range, got "${i}"`:!0);function l(i){return(0,r.is)(i,e.VersionStruct)}e.isValidSemVerVersion=l;function c(i){return(0,r.is)(i,e.VersionRangeStruct)}e.isValidSemVerRange=c;function o(i){(0,t.assertStruct)(i,e.VersionStruct)}e.assertIsSemVerVersion=o;function p(i){(0,t.assertStruct)(i,e.VersionRangeStruct)}e.assertIsSemVerRange=p;function g(i,a){return(0,n.gt)(i,a)}e.gtVersion=g;function u(i,a){return(0,n.gtr)(i,a)}e.gtRange=u;function h(i,a){return(0,n.satisfies)(i,a,{includePrerelease:!0})}e.satisfiesVersionRange=h}(En)),En}var ja;function Od(){return ja||(ja=1,function(e){var n=Ce&&Ce.__createBinding||(Object.create?function(t,l,c,o){o===void 0&&(o=c);var p=Object.getOwnPropertyDescriptor(l,c);(!p||("get"in p?!l.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return l[c]}}),Object.defineProperty(t,o,p)}:function(t,l,c,o){o===void 0&&(o=c),t[o]=l[c]}),r=Ce&&Ce.__exportStar||function(t,l){for(var c in t)c!=="default"&&!Object.prototype.hasOwnProperty.call(l,c)&&n(l,t,c)};Object.defineProperty(e,"__esModule",{value:!0}),r(le(),e),r(Gc(),e),r(Zc(),e),r(Jl(),e),r(Gl(),e),r(Zl(),e),r(Ql(),e),r($t(),e),r(Kl(),e),r(Xl(),e),r(rd(),e),r(nd(),e),r(sd(),e),r(id(),e),r(od(),e),r(ad(),e),r(Pd(),e)}(Ce)),Ce}var Ha;function xd(){return Ha||(Ha=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const n=Od();Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return n.createModuleLogger}}),e.projectLogger=(0,n.createProjectLogger)("eth-block-tracker")}(ln)),ln}var Ua;function Bd(){if(Ua)return Re;Ua=1;var e=Re&&Re.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(Re,"__esModule",{value:!0}),Re.PollingBlockTracker=void 0;const n=e(qs()),r=e(al()),t=Dc(),l=xd(),c=(0,l.createModuleLogger)(l.projectLogger,"polling-block-tracker"),o=(0,n.default)(),p=1e3;let g=class extends t.BaseBlockTracker{constructor(i={}){var a;if(!i.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},i),{blockResetDuration:(a=i.blockResetDuration)!==null&&a!==void 0?a:i.pollingInterval})),this._provider=i.provider,this._pollingInterval=i.pollingInterval||20*p,this._retryTimeout=i.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=i.keepEventLoopActive===void 0?!0:i.keepEventLoopActive,this._setSkipCacheFlag=i.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var i;this._isRunning;)try{await this._updateLatestBlock();const a=u(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await a}catch(a){const s=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
3
+ ${(i=a.stack)!==null&&i!==void 0?i:a}`);try{this.emit("error",s)}catch{console.error(s)}const f=u(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await f}}async _updateLatestBlock(){const i=await this._fetchLatestBlock();this._newPotentialLatest(i)}async _fetchLatestBlock(){const i={jsonrpc:"2.0",id:o(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(i.skipCache=!0),c("Making request",i);const a=await(0,r.default)(s=>this._provider.sendAsync(i,s))();if(c("Got response",a),a.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
4
+ ${a.error.message}`);return a.result}};Re.PollingBlockTracker=g;function u(h,i){return new Promise(a=>{const s=setTimeout(a,h);s.unref&&i&&s.unref()})}return Re}var ke={},Wa;function Fd(){if(Wa)return ke;Wa=1;var e=ke&&ke.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(ke,"__esModule",{value:!0}),ke.SubscribeBlockTracker=void 0;const n=e(qs()),r=Dc(),t=(0,n.default)();let l=class extends r.BaseBlockTracker{constructor(o={}){if(!o.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(o),this._provider=o.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const o=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(o)}catch(o){this.emit("error",o)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(o){this.emit("error",o)}}_call(o,...p){return new Promise((g,u)=>{this._provider.sendAsync({id:t(),method:o,params:p,jsonrpc:"2.0"},(h,i)=>{h?u(h):g(i.result)})})}_handleSubData(o,p){var g;p.method==="eth_subscription"&&((g=p.params)===null||g===void 0?void 0:g.subscription)===this._subscriptionId&&this._newPotentialLatest(p.params.result.number)}};return ke.SubscribeBlockTracker=l,ke}var Va;function qd(){return Va||(Va=1,function(e){var n=_e&&_e.__createBinding||(Object.create?function(t,l,c,o){o===void 0&&(o=c),Object.defineProperty(t,o,{enumerable:!0,get:function(){return l[c]}})}:function(t,l,c,o){o===void 0&&(o=c),t[o]=l[c]}),r=_e&&_e.__exportStar||function(t,l){for(var c in t)c!=="default"&&!Object.prototype.hasOwnProperty.call(l,c)&&n(l,t,c)};Object.defineProperty(e,"__esModule",{value:!0}),r(Bd(),e),r(Fd(),e)}(_e)),_e}var Ie={},dt={},ht={},za;function eu(){if(za)return ht;za=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.getUniqueId=void 0;const e=4294967295;let n=Math.floor(Math.random()*e);function r(){return n=(n+1)%e,n}return ht.getUniqueId=r,ht}var $a;function Dd(){if($a)return dt;$a=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.createIdRemapMiddleware=void 0;const e=eu();function n(){return(r,t,l,c)=>{const o=r.id,p=e.getUniqueId();r.id=p,t.id=p,l(g=>{r.id=o,t.id=o,g()})}}return dt.createIdRemapMiddleware=n,dt}var ft={},Ja;function jd(){if(Ja)return ft;Ja=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.createAsyncMiddleware=void 0;function e(n){return async(r,t,l,c)=>{let o;const p=new Promise(i=>{o=i});let g=null,u=!1;const h=async()=>{u=!0,l(i=>{g=i,o()}),await p};try{await n(r,t,h),u?(await p,g(null)):c(null)}catch(i){g?g(i):c(i)}}}return ft.createAsyncMiddleware=e,ft}var gt={},Ga;function Hd(){if(Ga)return gt;Ga=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.createScaffoldMiddleware=void 0;function e(n){return(r,t,l,c)=>{const o=n[r.method];return o===void 0?l():typeof o=="function"?o(r,t,l,c):(t.result=o,c())}}return gt.createScaffoldMiddleware=e,gt}var Ae={},Ft={},Za;function Ud(){if(Za)return Ft;Za=1,Object.defineProperty(Ft,"__esModule",{value:!0});const e=Ic();function n(l,c,o){try{Reflect.apply(l,c,o)}catch(p){setTimeout(()=>{throw p})}}function r(l){const c=l.length,o=new Array(c);for(let p=0;p<c;p+=1)o[p]=l[p];return o}class t extends e.EventEmitter{emit(c,...o){let p=c==="error";const g=this._events;if(g!==void 0)p=p&&g.error===void 0;else if(!p)return!1;if(p){let h;if(o.length>0&&([h]=o),h instanceof Error)throw h;const i=new Error(`Unhandled error.${h?` (${h.message})`:""}`);throw i.context=h,i}const u=g[c];if(u===void 0)return!1;if(typeof u=="function")n(u,this,o);else{const h=u.length,i=r(u);for(let a=0;a<h;a+=1)n(i[a],this,o)}return!0}}return Ft.default=t,Ft}var hs={},Le={},fs,Qa;function Wd(){if(Qa)return fs;Qa=1,fs=c,c.default=c,c.stable=u,c.stableStringify=u;var e="[...]",n="[Circular]",r=[],t=[];function l(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function c(a,s,f,m){typeof m>"u"&&(m=l()),p(a,"",0,[],void 0,0,m);var b;try{t.length===0?b=JSON.stringify(a,s,f):b=JSON.stringify(a,i(s),f)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;r.length!==0;){var d=r.pop();d.length===4?Object.defineProperty(d[0],d[1],d[3]):d[0][d[1]]=d[2]}}return b}function o(a,s,f,m){var b=Object.getOwnPropertyDescriptor(m,f);b.get!==void 0?b.configurable?(Object.defineProperty(m,f,{value:a}),r.push([m,f,s,b])):t.push([s,f,a]):(m[f]=a,r.push([m,f,s]))}function p(a,s,f,m,b,d,y){d+=1;var w;if(typeof a=="object"&&a!==null){for(w=0;w<m.length;w++)if(m[w]===a){o(n,a,s,b);return}if(typeof y.depthLimit<"u"&&d>y.depthLimit){o(e,a,s,b);return}if(typeof y.edgesLimit<"u"&&f+1>y.edgesLimit){o(e,a,s,b);return}if(m.push(a),Array.isArray(a))for(w=0;w<a.length;w++)p(a[w],w,w,m,a,d,y);else{var v=Object.keys(a);for(w=0;w<v.length;w++){var E=v[w];p(a[E],E,w,m,a,d,y)}}m.pop()}}function g(a,s){return a<s?-1:a>s?1:0}function u(a,s,f,m){typeof m>"u"&&(m=l());var b=h(a,"",0,[],void 0,0,m)||a,d;try{t.length===0?d=JSON.stringify(b,s,f):d=JSON.stringify(b,i(s),f)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;r.length!==0;){var y=r.pop();y.length===4?Object.defineProperty(y[0],y[1],y[3]):y[0][y[1]]=y[2]}}return d}function h(a,s,f,m,b,d,y){d+=1;var w;if(typeof a=="object"&&a!==null){for(w=0;w<m.length;w++)if(m[w]===a){o(n,a,s,b);return}try{if(typeof a.toJSON=="function")return}catch{return}if(typeof y.depthLimit<"u"&&d>y.depthLimit){o(e,a,s,b);return}if(typeof y.edgesLimit<"u"&&f+1>y.edgesLimit){o(e,a,s,b);return}if(m.push(a),Array.isArray(a))for(w=0;w<a.length;w++)h(a[w],w,w,m,a,d,y);else{var v={},E=Object.keys(a).sort(g);for(w=0;w<E.length;w++){var S=E[w];h(a[S],S,w,m,a,d,y),v[S]=a[S]}if(typeof b<"u")r.push([b,s,a]),b[s]=v;else return v}m.pop()}}function i(a){return a=typeof a<"u"?a:function(s,f){return f},function(s,f){if(t.length>0)for(var m=0;m<t.length;m++){var b=t[m];if(b[1]===s&&b[0]===f){f=b[2],t.splice(m,1);break}}return a.call(this,s,f)}}return fs}var Ka;function Qs(){if(Ka)return Le;Ka=1,Object.defineProperty(Le,"__esModule",{value:!0}),Le.EthereumProviderError=Le.EthereumRpcError=void 0;const e=Wd();class n extends Error{constructor(o,p,g){if(!Number.isInteger(o))throw new Error('"code" must be an integer.');if(!p||typeof p!="string")throw new Error('"message" must be a nonempty string.');super(p),this.code=o,g!==void 0&&(this.data=g)}serialize(){const o={code:this.code,message:this.message};return this.data!==void 0&&(o.data=this.data),this.stack&&(o.stack=this.stack),o}toString(){return e.default(this.serialize(),l,2)}}Le.EthereumRpcError=n;class r extends n{constructor(o,p,g){if(!t(o))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(o,p,g)}}Le.EthereumProviderError=r;function t(c){return Number.isInteger(c)&&c>=1e3&&c<=4999}function l(c,o){if(o!=="[Circular]")return o}return Le}var gs={},Me={},Xa;function Ks(){return Xa||(Xa=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.errorValues=Me.errorCodes=void 0,Me.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}},Me.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."}}),Me}var Ya;function tu(){return Ya||(Ya=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=Ks(),r=Qs(),t=n.errorCodes.rpc.internal,l="Unspecified error message. This is a bug, please report it.",c={code:t,message:o(t)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(a,s=l){if(Number.isInteger(a)){const f=a.toString();if(i(n.errorValues,f))return n.errorValues[f].message;if(u(a))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return s}e.getMessageFromCode=o;function p(a){if(!Number.isInteger(a))return!1;const s=a.toString();return!!(n.errorValues[s]||u(a))}e.isValidCode=p;function g(a,{fallbackError:s=c,shouldIncludeStack:f=!1}={}){var m,b;if(!s||!Number.isInteger(s.code)||typeof s.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(a instanceof r.EthereumRpcError)return a.serialize();const d={};if(a&&typeof a=="object"&&!Array.isArray(a)&&i(a,"code")&&p(a.code)){const w=a;d.code=w.code,w.message&&typeof w.message=="string"?(d.message=w.message,i(w,"data")&&(d.data=w.data)):(d.message=o(d.code),d.data={originalError:h(a)})}else{d.code=s.code;const w=(m=a)===null||m===void 0?void 0:m.message;d.message=w&&typeof w=="string"?w:s.message,d.data={originalError:h(a)}}const y=(b=a)===null||b===void 0?void 0:b.stack;return f&&a&&y&&typeof y=="string"&&(d.stack=y),d}e.serializeError=g;function u(a){return a>=-32099&&a<=-32e3}function h(a){return a&&typeof a=="object"&&!Array.isArray(a)?Object.assign({},a):a}function i(a,s){return Object.prototype.hasOwnProperty.call(a,s)}}(gs)),gs}var pt={},ec;function Vd(){if(ec)return pt;ec=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.ethErrors=void 0;const e=Qs(),n=tu(),r=Ks();pt.ethErrors={rpc:{parse:o=>t(r.errorCodes.rpc.parse,o),invalidRequest:o=>t(r.errorCodes.rpc.invalidRequest,o),invalidParams:o=>t(r.errorCodes.rpc.invalidParams,o),methodNotFound:o=>t(r.errorCodes.rpc.methodNotFound,o),internal:o=>t(r.errorCodes.rpc.internal,o),server:o=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:p}=o;if(!Number.isInteger(p)||p>-32005||p<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return t(p,o)},invalidInput:o=>t(r.errorCodes.rpc.invalidInput,o),resourceNotFound:o=>t(r.errorCodes.rpc.resourceNotFound,o),resourceUnavailable:o=>t(r.errorCodes.rpc.resourceUnavailable,o),transactionRejected:o=>t(r.errorCodes.rpc.transactionRejected,o),methodNotSupported:o=>t(r.errorCodes.rpc.methodNotSupported,o),limitExceeded:o=>t(r.errorCodes.rpc.limitExceeded,o)},provider:{userRejectedRequest:o=>l(r.errorCodes.provider.userRejectedRequest,o),unauthorized:o=>l(r.errorCodes.provider.unauthorized,o),unsupportedMethod:o=>l(r.errorCodes.provider.unsupportedMethod,o),disconnected:o=>l(r.errorCodes.provider.disconnected,o),chainDisconnected:o=>l(r.errorCodes.provider.chainDisconnected,o),custom:o=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:p,message:g,data:u}=o;if(!g||typeof g!="string")throw new Error('"message" must be a nonempty string');return new e.EthereumProviderError(p,g,u)}}};function t(o,p){const[g,u]=c(p);return new e.EthereumRpcError(o,g||n.getMessageFromCode(o),u)}function l(o,p){const[g,u]=c(p);return new e.EthereumProviderError(o,g||n.getMessageFromCode(o),u)}function c(o){if(o){if(typeof o=="string")return[o];if(typeof o=="object"&&!Array.isArray(o)){const{message:p,data:g}=o;if(p&&typeof p!="string")throw new Error("Must specify string message.");return[p||void 0,g]}}return[]}return pt}var tc;function zd(){return tc||(tc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const n=Qs();Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return n.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return n.EthereumProviderError}});const r=tu();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const t=Vd();Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return t.ethErrors}});const l=Ks();Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return l.errorCodes}})}(hs)),hs}var rc;function ru(){if(rc)return Ae;rc=1;var e=Ae&&Ae.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.JsonRpcEngine=void 0;const n=e(Ud()),r=zd();let t=class ue extends n.default{constructor(){super(),this._middleware=[]}push(o){this._middleware.push(o)}handle(o,p){if(p&&typeof p!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(o)?p?this._handleBatch(o,p):this._handleBatch(o):p?this._handle(o,p):this._promiseHandle(o)}asMiddleware(){return async(o,p,g,u)=>{try{const[h,i,a]=await ue._runAllMiddleware(o,p,this._middleware);return i?(await ue._runReturnHandlers(a),u(h)):g(async s=>{try{await ue._runReturnHandlers(a)}catch(f){return s(f)}return s()})}catch(h){return u(h)}}}async _handleBatch(o,p){try{const g=await Promise.all(o.map(this._promiseHandle.bind(this)));return p?p(null,g):g}catch(g){if(p)return p(g);throw g}}_promiseHandle(o){return new Promise(p=>{this._handle(o,(g,u)=>{p(u)})})}async _handle(o,p){if(!o||Array.isArray(o)||typeof o!="object"){const i=new r.EthereumRpcError(r.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof o}`,{request:o});return p(i,{id:void 0,jsonrpc:"2.0",error:i})}if(typeof o.method!="string"){const i=new r.EthereumRpcError(r.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof o.method}`,{request:o});return p(i,{id:o.id,jsonrpc:"2.0",error:i})}const g=Object.assign({},o),u={id:g.id,jsonrpc:g.jsonrpc};let h=null;try{await this._processRequest(g,u)}catch(i){h=i}return h&&(delete u.result,u.error||(u.error=r.serializeError(h))),p(h,u)}async _processRequest(o,p){const[g,u,h]=await ue._runAllMiddleware(o,p,this._middleware);if(ue._checkForCompletion(o,p,u),await ue._runReturnHandlers(h),g)throw g}static async _runAllMiddleware(o,p,g){const u=[];let h=null,i=!1;for(const a of g)if([h,i]=await ue._runMiddleware(o,p,a,u),i)break;return[h,i,u.reverse()]}static _runMiddleware(o,p,g,u){return new Promise(h=>{const i=s=>{const f=s||p.error;f&&(p.error=r.serializeError(f)),h([f,!0])},a=s=>{p.error?i(p.error):(s&&(typeof s!="function"&&i(new r.EthereumRpcError(r.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof s}" for request:
5
+ ${l(o)}`,{request:o})),u.push(s)),h([null,!1]))};try{g(o,p,a,i)}catch(s){i(s)}})}static async _runReturnHandlers(o){for(const p of o)await new Promise((g,u)=>{p(h=>h?u(h):g())})}static _checkForCompletion(o,p,g){if(!("result"in p)&&!("error"in p))throw new r.EthereumRpcError(r.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
6
+ ${l(o)}`,{request:o});if(!g)throw new r.EthereumRpcError(r.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
7
+ ${l(o)}`,{request:o})}};Ae.JsonRpcEngine=t;function l(c){return JSON.stringify(c,null,2)}return Ae}var mt={},nc;function $d(){if(nc)return mt;nc=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.mergeMiddleware=void 0;const e=ru();function n(r){const t=new e.JsonRpcEngine;return r.forEach(l=>t.push(l)),t.asMiddleware()}return mt.mergeMiddleware=n,mt}var sc;function nu(){return sc||(sc=1,function(e){var n=Ie&&Ie.__createBinding||(Object.create?function(t,l,c,o){o===void 0&&(o=c),Object.defineProperty(t,o,{enumerable:!0,get:function(){return l[c]}})}:function(t,l,c,o){o===void 0&&(o=c),t[o]=l[c]}),r=Ie&&Ie.__exportStar||function(t,l){for(var c in t)c!=="default"&&!Object.prototype.hasOwnProperty.call(l,c)&&n(l,t,c)};Object.defineProperty(e,"__esModule",{value:!0}),r(Dd(),e),r(jd(),e),r(Hd(),e),r(eu(),e),r(ru(),e),r($d(),e)}(Ie)),Ie}var ps={},qt={},Dt={},ic;function su(){if(ic)return Dt;ic=1,Object.defineProperty(Dt,"__esModule",{value:!0});var e=Ns,n=function(){function r(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return r.prototype.acquire=function(){var t=this,l=this.isLocked(),c=new Promise(function(o){return t._queue.push(o)});return l||this._dispatch(),c},r.prototype.runExclusive=function(t){return e.__awaiter(this,void 0,void 0,function(){var l,c,o;return e.__generator(this,function(p){switch(p.label){case 0:return[4,this.acquire()];case 1:l=p.sent(),c=l[0],o=l[1],p.label=2;case 2:return p.trys.push([2,,4,5]),[4,t(c)];case 3:return[2,p.sent()];case 4:return o(),[7];case 5:return[2]}})})},r.prototype.isLocked=function(){return this._value<=0},r.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()}},r.prototype._dispatch=function(){var t=this,l=this._queue.shift();if(l){var c=!1;this._currentReleaser=function(){c||(c=!0,t._value++,t._dispatch())},l([this._value--,this._currentReleaser])}},r}();return Dt.default=n,Dt}var oc;function Jd(){if(oc)return qt;oc=1,Object.defineProperty(qt,"__esModule",{value:!0});var e=Ns,n=su(),r=function(){function t(){this._semaphore=new n.default(1)}return t.prototype.acquire=function(){return e.__awaiter(this,void 0,void 0,function(){var l,c;return e.__generator(this,function(o){switch(o.label){case 0:return[4,this._semaphore.acquire()];case 1:return l=o.sent(),c=l[1],[2,c]}})})},t.prototype.runExclusive=function(l){return this._semaphore.runExclusive(function(){return l()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();return qt.default=r,qt}var bt={},ac;function Gd(){if(ac)return bt;ac=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.withTimeout=void 0;var e=Ns;function n(r,t,l){var c=this;return l===void 0&&(l=new Error("timeout")),{acquire:function(){return new Promise(function(o,p){return e.__awaiter(c,void 0,void 0,function(){var g,u,h;return e.__generator(this,function(i){switch(i.label){case 0:return g=!1,setTimeout(function(){g=!0,p(l)},t),[4,r.acquire()];case 1:return u=i.sent(),g?(h=Array.isArray(u)?u[1]:u,h()):o(u),[2]}})})})},runExclusive:function(o){return e.__awaiter(this,void 0,void 0,function(){var p,g;return e.__generator(this,function(u){switch(u.label){case 0:p=function(){},u.label=1;case 1:return u.trys.push([1,,7,8]),[4,this.acquire()];case 2:return g=u.sent(),Array.isArray(g)?(p=g[1],[4,o(g[0])]):[3,4];case 3:return[2,u.sent()];case 4:return p=g,[4,o()];case 5:return[2,u.sent()];case 6:return[3,8];case 7:return p(),[7];case 8:return[2]}})})},release:function(){r.release()},isLocked:function(){return r.isLocked()}}}return bt.withTimeout=n,bt}var cc;function Zd(){return cc||(cc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var n=Jd();Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return n.default}});var r=su();Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var t=Gd();Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return t.withTimeout}})}(ps)),ps}var ms,uc;function Qd(){if(uc)return ms;uc=1,ms=n;var e=Object.prototype.hasOwnProperty;function n(){for(var r={},t=0;t<arguments.length;t++){var l=arguments[t];for(var c in l)e.call(l,c)&&(r[c]=l[c])}return r}return ms}var bs,lc;function Kd(){if(lc)return bs;lc=1;const e=Qd(),n=qs()();bs=r;function r(o){const p=this;p.currentProvider=o}r.prototype.getBalance=l(2,"eth_getBalance"),r.prototype.getCode=l(2,"eth_getCode"),r.prototype.getTransactionCount=l(2,"eth_getTransactionCount"),r.prototype.getStorageAt=l(3,"eth_getStorageAt"),r.prototype.call=l(2,"eth_call"),r.prototype.protocolVersion=t("eth_protocolVersion"),r.prototype.syncing=t("eth_syncing"),r.prototype.coinbase=t("eth_coinbase"),r.prototype.mining=t("eth_mining"),r.prototype.hashrate=t("eth_hashrate"),r.prototype.gasPrice=t("eth_gasPrice"),r.prototype.accounts=t("eth_accounts"),r.prototype.blockNumber=t("eth_blockNumber"),r.prototype.getBlockTransactionCountByHash=t("eth_getBlockTransactionCountByHash"),r.prototype.getBlockTransactionCountByNumber=t("eth_getBlockTransactionCountByNumber"),r.prototype.getUncleCountByBlockHash=t("eth_getUncleCountByBlockHash"),r.prototype.getUncleCountByBlockNumber=t("eth_getUncleCountByBlockNumber"),r.prototype.sign=t("eth_sign"),r.prototype.sendTransaction=t("eth_sendTransaction"),r.prototype.sendRawTransaction=t("eth_sendRawTransaction"),r.prototype.estimateGas=t("eth_estimateGas"),r.prototype.getBlockByHash=t("eth_getBlockByHash"),r.prototype.getBlockByNumber=t("eth_getBlockByNumber"),r.prototype.getTransactionByHash=t("eth_getTransactionByHash"),r.prototype.getTransactionByBlockHashAndIndex=t("eth_getTransactionByBlockHashAndIndex"),r.prototype.getTransactionByBlockNumberAndIndex=t("eth_getTransactionByBlockNumberAndIndex"),r.prototype.getTransactionReceipt=t("eth_getTransactionReceipt"),r.prototype.getUncleByBlockHashAndIndex=t("eth_getUncleByBlockHashAndIndex"),r.prototype.getUncleByBlockNumberAndIndex=t("eth_getUncleByBlockNumberAndIndex"),r.prototype.getCompilers=t("eth_getCompilers"),r.prototype.compileLLL=t("eth_compileLLL"),r.prototype.compileSolidity=t("eth_compileSolidity"),r.prototype.compileSerpent=t("eth_compileSerpent"),r.prototype.newFilter=t("eth_newFilter"),r.prototype.newBlockFilter=t("eth_newBlockFilter"),r.prototype.newPendingTransactionFilter=t("eth_newPendingTransactionFilter"),r.prototype.uninstallFilter=t("eth_uninstallFilter"),r.prototype.getFilterChanges=t("eth_getFilterChanges"),r.prototype.getFilterLogs=t("eth_getFilterLogs"),r.prototype.getLogs=t("eth_getLogs"),r.prototype.getWork=t("eth_getWork"),r.prototype.submitWork=t("eth_submitWork"),r.prototype.submitHashrate=t("eth_submitHashrate"),r.prototype.sendAsync=function(o,p){this.currentProvider.sendAsync(c(o),function(u,h){if(!u&&h.error&&(u=new Error("EthQuery - RPC Error - "+h.error.message)),u)return p(u);p(null,h.result)})};function t(o){return function(){const p=this;var g=[].slice.call(arguments),u=g.pop();p.sendAsync({method:o,params:g},u)}}function l(o,p){return function(){const g=this;var u=[].slice.call(arguments),h=u.pop();u.length<o&&u.push("latest"),g.sendAsync({method:p,params:u},h)}}function c(o){return e({id:n(),jsonrpc:"2.0",params:[]},o)}return bs}var ws,dc;function Xd(){if(dc)return ws;dc=1;const e=(r,t,l,c)=>function(...o){const p=t.promiseModule;return new p((g,u)=>{t.multiArgs?o.push((...i)=>{t.errorFirst?i[0]?u(i):(i.shift(),g(i)):g(i)}):t.errorFirst?o.push((i,a)=>{i?u(i):g(a)}):o.push(g),Reflect.apply(r,this===l?c:this,o)})},n=new WeakMap;return ws=(r,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const l=typeof r;if(!(r!==null&&(l==="object"||l==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${r===null?"null":l}\``);const c=(g,u)=>{let h=n.get(g);if(h||(h={},n.set(g,h)),u in h)return h[u];const i=b=>typeof b=="string"||typeof u=="symbol"?u===b:b.test(u),a=Reflect.getOwnPropertyDescriptor(g,u),s=a===void 0||a.writable||a.configurable,m=(t.include?t.include.some(i):!t.exclude.some(i))&&s;return h[u]=m,m},o=new WeakMap,p=new Proxy(r,{apply(g,u,h){const i=o.get(g);if(i)return Reflect.apply(i,u,h);const a=t.excludeMain?g:e(g,t,p,g);return o.set(g,a),Reflect.apply(a,u,h)},get(g,u){const h=g[u];if(!c(g,u)||h===Function.prototype[u])return h;const i=o.get(h);if(i)return i;if(typeof h=="function"){const a=e(h,t,p,g);return o.set(h,a),a}return h}});return p},ws}var ys,hc;function Xs(){if(hc)return ys;hc=1;const e=Ds().default;class n extends e{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(l=>this.emit("update",l))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}}return ys=n,ys}var vs,fc;function Yd(){if(fc)return vs;fc=1;const e=Xs();class n extends e{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}}return vs=n,vs}var Es,gc;function Rt(){if(gc)return Es;gc=1,Es={minBlockRef:e,maxBlockRef:n,sortBlockRefs:r,bnToHex:t,blockRefIsNumber:l,hexToInt:c,incrementHexInt:o,intToHex:p,unsafeRandomBytes:g};function e(...h){return r(h)[0]}function n(...h){const i=r(h);return i[i.length-1]}function r(h){return h.sort((i,a)=>i==="latest"||a==="earliest"?1:a==="latest"||i==="earliest"?-1:c(i)-c(a))}function t(h){return"0x"+h.toString(16)}function l(h){return h&&!["earliest","latest","pending"].includes(h)}function c(h){return h==null?h:Number.parseInt(h,16)}function o(h){if(h==null)return h;const i=c(h);return p(i+1)}function p(h){if(h==null)return h;let i=h.toString(16);return i.length%2&&(i="0"+i),"0x"+i}function g(h){let i="0x";for(let a=0;a<h;a++)i+=u(),i+=u();return i}function u(){return Math.floor(Math.random()*16).toString(16)}return Es}var _s,pc;function eh(){if(pc)return _s;pc=1;const e=Kd(),n=Xd(),r=Yd(),{bnToHex:t,hexToInt:l,incrementHexInt:c,minBlockRef:o,blockRefIsNumber:p}=Rt();class g extends r{constructor({provider:h,params:i}){super(),this.type="log",this.ethQuery=new e(h),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},i),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(a=>a.toLowerCase()))}async initialize({currentBlock:h}){let i=this.params.fromBlock;["latest","pending"].includes(i)&&(i=h),i==="earliest"&&(i="0x0"),this.params.fromBlock=i;const a=o(this.params.toBlock,h),s=Object.assign({},this.params,{toBlock:a}),f=await this._fetchLogs(s);this.addInitialResults(f)}async update({oldBlock:h,newBlock:i}){const a=i;let s;h?s=c(h):s=i;const f=Object.assign({},this.params,{fromBlock:s,toBlock:a}),b=(await this._fetchLogs(f)).filter(d=>this.matchLog(d));this.addResults(b)}async _fetchLogs(h){return await n(a=>this.ethQuery.getLogs(h,a))()}matchLog(h){if(l(this.params.fromBlock)>=l(h.blockNumber)||p(this.params.toBlock)&&l(this.params.toBlock)<=l(h.blockNumber))return!1;const i=h.address&&h.address.toLowerCase();return this.params.address&&i&&!this.params.address.includes(i)?!1:this.params.topics.every((s,f)=>{let m=h.topics[f];if(!m)return!1;m=m.toLowerCase();let b=Array.isArray(s)?s:[s];return b.includes(null)?!0:(b=b.map(w=>w.toLowerCase()),b.includes(m))})}}return _s=g,_s}var Rs,mc;function Ys(){if(mc)return Rs;mc=1,Rs=e;async function e({provider:c,fromBlock:o,toBlock:p}){o||(o=p);const g=n(o),h=n(p)-g+1,i=Array(h).fill().map((s,f)=>g+f).map(r);let a=await Promise.all(i.map(s=>l(c,"eth_getBlockByNumber",[s,!1])));return a=a.filter(s=>s!==null),a}function n(c){return c==null?c:Number.parseInt(c,16)}function r(c){return c==null?c:"0x"+c.toString(16)}function t(c,o){return new Promise((p,g)=>{c.sendAsync(o,(u,h)=>{u?g(u):h.error?g(h.error):h.result?p(h.result):g(new Error("Result was empty"))})})}async function l(c,o,p){for(let g=0;g<3;g++)try{return await t(c,{id:1,jsonrpc:"2.0",method:o,params:p})}catch(u){console.error(`provider.sendAsync failed: ${u.stack||u.message||u}`)}return null}return Rs}var Ss,bc;function th(){if(bc)return Ss;bc=1;const e=Xs(),n=Ys(),{incrementHexInt:r}=Rt();class t extends e{constructor({provider:c,params:o}){super(),this.type="block",this.provider=c}async update({oldBlock:c,newBlock:o}){const p=o,g=r(c),h=(await n({provider:this.provider,fromBlock:g,toBlock:p})).map(i=>i.hash);this.addResults(h)}}return Ss=t,Ss}var Cs,wc;function rh(){if(wc)return Cs;wc=1;const e=Xs(),n=Ys(),{incrementHexInt:r}=Rt();class t extends e{constructor({provider:c}){super(),this.type="tx",this.provider=c}async update({oldBlock:c}){const o=c,p=r(c),g=await n({provider:this.provider,fromBlock:p,toBlock:o}),u=[];for(const h of g)u.push(...h.transactions);this.addResults(u)}}return Cs=t,Cs}var ks,yc;function nh(){if(yc)return ks;yc=1;const e=Zd().Mutex,{createAsyncMiddleware:n,createScaffoldMiddleware:r}=nu(),t=eh(),l=th(),c=rh(),{intToHex:o,hexToInt:p}=Rt();ks=g;function g({blockTracker:s,provider:f}){let m=0,b={};const d=new e,y=i({mutex:d}),w=r({eth_newFilter:y(u(E)),eth_newBlockFilter:y(u(S)),eth_newPendingTransactionFilter:y(u(_)),eth_uninstallFilter:y(h(N)),eth_getFilterChanges:y(h(C)),eth_getFilterLogs:y(h(T))}),v=async({oldBlock:k,newBlock:R})=>{if(b.length===0)return;const I=await d.acquire();try{await Promise.all(a(b).map(async M=>{try{await M.update({oldBlock:k,newBlock:R})}catch(L){console.error(L)}}))}catch(M){console.error(M)}I()};return w.newLogFilter=E,w.newBlockFilter=S,w.newPendingTransactionFilter=_,w.uninstallFilter=N,w.getFilterChanges=C,w.getFilterLogs=T,w.destroy=()=>{V()},w;async function E(k){const R=new t({provider:f,params:k});return await x(R),R}async function S(){const k=new l({provider:f});return await x(k),k}async function _(){const k=new c({provider:f});return await x(k),k}async function C(k){const R=p(k),I=b[R];if(!I)throw new Error(`No filter for index "${R}"`);return I.getChangesAndClear()}async function T(k){const R=p(k),I=b[R];if(!I)throw new Error(`No filter for index "${R}"`);let M=[];return I.type==="log"&&(M=I.getAllResults()),M}async function N(k){const R=p(k),M=!!b[R];return M&&await F(R),M}async function x(k){const R=a(b).length,I=await s.getLatestBlock();await k.initialize({currentBlock:I}),m++,b[m]=k,k.id=m,k.idHex=o(m);const M=a(b).length;return A({prevFilterCount:R,newFilterCount:M}),m}async function F(k){const R=a(b).length;delete b[k];const I=a(b).length;A({prevFilterCount:R,newFilterCount:I})}async function V(){const k=a(b).length;b={},A({prevFilterCount:k,newFilterCount:0})}function A({prevFilterCount:k,newFilterCount:R}){if(k===0&&R>0){s.on("sync",v);return}if(k>0&&R===0){s.removeListener("sync",v);return}}}function u(s){return h(async(...f)=>{const m=await s(...f);return o(m.id)})}function h(s){return n(async(f,m)=>{const b=await s.apply(null,f.params);m.result=b})}function i({mutex:s}){return f=>async(m,b,d,y)=>{(await s.acquire())(),f(m,b,d,y)}}function a(s,f){const m=[];for(let b in s)m.push(s[b]);return m}return ks}var Is,vc;function sh(){if(vc)return Is;vc=1;const e=Ds().default,{createAsyncMiddleware:n,createScaffoldMiddleware:r}=nu(),t=nh(),{unsafeRandomBytes:l,incrementHexInt:c}=Rt(),o=Ys();Is=p;function p({blockTracker:u,provider:h}){const i={},a=t({blockTracker:u,provider:h});let s=!1;const f=new e,m=r({eth_subscribe:n(b),eth_unsubscribe:n(d)});return m.destroy=w,{events:f,middleware:m};async function b(v,E){if(s)throw new Error("SubscriptionManager - attempting to use after destroying");const S=v.params[0],_=l(16);let C;switch(S){case"newHeads":C=T({subId:_});break;case"logs":const x=v.params[1],F=await a.newLogFilter(x);C=N({subId:_,filter:F});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${S}"`)}i[_]=C,E.result=_;return;function T({subId:x}){const F={type:S,destroy:async()=>{u.removeListener("sync",F.update)},update:async({oldBlock:V,newBlock:A})=>{const k=A,R=c(V);(await o({provider:h,fromBlock:R,toBlock:k})).map(g).filter(L=>L!==null).forEach(L=>{y(x,L)})}};return u.on("sync",F.update),F}function N({subId:x,filter:F}){return F.on("update",A=>y(x,A)),{type:S,destroy:async()=>await a.uninstallFilter(F.idHex)}}}async function d(v,E){if(s)throw new Error("SubscriptionManager - attempting to use after destroying");const S=v.params[0],_=i[S];if(!_){E.result=!1;return}delete i[S],await _.destroy(),E.result=!0}function y(v,E){f.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:v,result:E}})}function w(){f.removeAllListeners();for(const v in i)i[v].destroy(),delete i[v];s=!0}}function g(u){return u==null?null:{hash:u.hash,parentHash:u.parentHash,sha3Uncles:u.sha3Uncles,miner:u.miner,stateRoot:u.stateRoot,transactionsRoot:u.transactionsRoot,receiptsRoot:u.receiptsRoot,logsBloom:u.logsBloom,difficulty:u.difficulty,number:u.number,gasLimit:u.gasLimit,gasUsed:u.gasUsed,nonce:u.nonce,mixHash:u.mixHash,timestamp:u.timestamp,extraData:u.extraData}}return Is}var Ec;function ih(){if(Ec)return ct;Ec=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.SubscriptionManager=void 0;const e=qd(),n=sh(),r=()=>{};let t=class{constructor(c){const o=new e.PollingBlockTracker({provider:c,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:p,middleware:g}=n({blockTracker:o,provider:c});this.events=p,this.subscriptionMiddleware=g}async handleRequest(c){const o={};return await this.subscriptionMiddleware(c,o,r,r),o}destroy(){this.subscriptionMiddleware.destroy()}};return ct.SubscriptionManager=t,ct}var _c;function Ms(){if(_c)return he;_c=1;var e=he&&he.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(he,"__esModule",{value:!0}),he.CoinbaseWalletProvider=void 0;const n=e(Ht()),r=au(),t=Wt(),l=ce(),c=Oc(),o=Bs(),p=Fs(),g=Ps(),u=e(il()),h=xs(),i=ol(),a=ih(),s="DefaultChainId",f="DefaultJsonRpcUrl";let m=class extends r.EventEmitter{constructor(d){var y,w;super(),this._filterPolyfill=new i.FilterPolyfill(this),this._subscriptionManager=new a.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=d.chainId,this._jsonRpcUrlFromOpts=d.jsonRpcUrl,this._overrideIsMetaMask=d.overrideIsMetaMask,this._relayProvider=d.relayProvider,this._storage=d.storage,this._relayEventManager=d.relayEventManager,this.diagnostic=d.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(y=d.overrideIsCoinbaseWallet)!==null&&y!==void 0?y:!0,this.isCoinbaseBrowser=(w=d.overrideIsCoinbaseBrowser)!==null&&w!==void 0?w:!1,this.qrUrl=d.qrUrl;const v=this.getChainId(),E=(0,l.prepend0x)(v.toString(16));this.emit("connect",{chainIdStr:E});const S=this._storage.getItem(o.LOCAL_STORAGE_ADDRESSES_KEY);if(S){const _=S.split(" ");_[0]!==""&&(this._addresses=_.map(C=>(0,l.ensureAddressString)(C)),this.emit("accountsChanged",_))}this._subscriptionManager.events.on("notification",_=>{this.emit("message",{type:_.method,data:_.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",_=>{var C;if(!(_.origin!==location.origin||_.source!==window)&&_.data.type==="walletLinkMessage"&&_.data.data.action==="dappChainSwitched"){const T=_.data.data.chainId,N=(C=_.data.data.jsonRpcUrl)!==null&&C!==void 0?C:this.jsonRpcUrl;this.updateProviderInfo(N,Number(T))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,l.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 d;return(d=this._storage.getItem(f))!==null&&d!==void 0?d:this._jsonRpcUrlFromOpts}set jsonRpcUrl(d){this._storage.setItem(f,d)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(d,y){this.isCoinbaseBrowser||(this._chainIdFromOpts=y,this._jsonRpcUrlFromOpts=d),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(d,y){this.jsonRpcUrl=d;const w=this.getChainId();this._storage.setItem(s,y.toString(10)),((0,l.ensureIntNumber)(y)!==w||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(d,y,w,v,E,S){const C=await(await this.initializeRelay()).watchAsset(d,y,w,v,E,S==null?void 0:S.toString()).promise;return(0,g.isErrorResponse)(C)?!1:!!C.result}async addEthereumChain(d,y,w,v,E,S){var _,C;if((0,l.ensureIntNumber)(d)===this.getChainId())return!1;const T=await this.initializeRelay(),N=T.inlineAddEthereumChain(d.toString());!this._isAuthorized()&&!N&&await T.requestEthereumAccounts().promise;const x=await T.addEthereumChain(d.toString(),y,E,w,v,S).promise;return(0,g.isErrorResponse)(x)?!1:(((_=x.result)===null||_===void 0?void 0:_.isApproved)===!0&&this.updateProviderInfo(y[0],d),((C=x.result)===null||C===void 0?void 0:C.isApproved)===!0)}async switchEthereumChain(d){const w=await(await this.initializeRelay()).switchEthereumChain(d.toString(10),this.selectedAddress||void 0).promise;if((0,g.isErrorResponse)(w)){if(!w.errorCode)return;throw w.errorCode===t.standardErrorCodes.provider.unsupportedChain?t.standardErrors.provider.unsupportedChain():t.standardErrors.provider.custom({message:w.errorMessage,code:w.errorCode})}const v=w.result;v.isApproved&&v.rpcUrl.length>0&&this.updateProviderInfo(v.rpcUrl,d)}setAppInfo(d,y){this.initializeRelay().then(w=>w.setAppInfo(d,y))}async enable(){var d;return(d=this.diagnostic)===null||d===void 0||d.log(h.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?p.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(d,y){try{const w=this._send(d,y);if(w instanceof Promise)return w.catch(v=>{throw(0,t.serializeError)(v,d)})}catch(w){throw(0,t.serializeError)(w,d)}}_send(d,y){if(typeof d=="string"){const v=d,E=Array.isArray(y)?y:y!==void 0?[y]:[],S={jsonrpc:"2.0",id:0,method:v,params:E};return this._sendRequestAsync(S).then(_=>_.result)}if(typeof y=="function"){const v=d,E=y;return this._sendAsync(v,E)}if(Array.isArray(d))return d.map(E=>this._sendRequest(E));const w=d;return this._sendRequest(w)}async sendAsync(d,y){try{return this._sendAsync(d,y).catch(w=>{throw(0,t.serializeError)(w,d)})}catch(w){return Promise.reject((0,t.serializeError)(w,d))}}async _sendAsync(d,y){if(typeof y!="function")throw new Error("callback is required");if(Array.isArray(d)){const v=y;this._sendMultipleRequestsAsync(d).then(E=>v(null,E)).catch(E=>v(E,null));return}const w=y;return this._sendRequestAsync(d).then(v=>w(null,v)).catch(v=>w(v,null))}async request(d){try{return this._request(d).catch(y=>{throw(0,t.serializeError)(y,d.method)})}catch(y){return Promise.reject((0,t.serializeError)(y,d.method))}}async _request(d){if(!d||typeof d!="object"||Array.isArray(d))throw t.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:d});const{method:y,params:w}=d;if(typeof y!="string"||y.length===0)throw t.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:d});if(w!==void 0&&!Array.isArray(w)&&(typeof w!="object"||w===null))throw t.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:d});const v=w===void 0?[]:w,E=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:y,params:v,jsonrpc:"2.0",id:E})).result}async scanQRCode(d){const w=await(await this.initializeRelay()).scanQRCode((0,l.ensureRegExpString)(d)).promise;if((0,g.isErrorResponse)(w))throw(0,t.serializeError)(w.errorMessage,"scanQRCode");if(typeof w.result!="string")throw(0,t.serializeError)("result was not a string","scanQRCode");return w.result}async genericRequest(d,y){const v=await(await this.initializeRelay()).genericRequest(d,y).promise;if((0,g.isErrorResponse)(v))throw(0,t.serializeError)(v.errorMessage,"generic");if(typeof v.result!="string")throw(0,t.serializeError)("result was not a string","generic");return v.result}async connectAndSignIn(d){var y;(y=this.diagnostic)===null||y===void 0||y.log(h.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?p.Session.hash(this._relay.session.id):void 0});let w;try{const E=await this.initializeRelay();if(!(E instanceof c.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(w=await E.connectAndSignIn(d).promise,(0,g.isErrorResponse)(w))throw new Error(w.errorMessage)}catch(E){throw typeof E.message=="string"&&E.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied account authorization"):E}if(!w.result)throw new Error("accounts received is empty");const{accounts:v}=w.result;return this._setAddresses(v),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),w.result}async selectProvider(d){const w=await(await this.initializeRelay()).selectProvider(d).promise;if((0,g.isErrorResponse)(w))throw(0,t.serializeError)(w.errorMessage,"selectProvider");if(typeof w.result!="string")throw(0,t.serializeError)("result was not a string","selectProvider");return w.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(d){const y={jsonrpc:"2.0",id:d.id},{method:w}=d;if(y.result=this._handleSynchronousMethods(d),y.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${w} synchronously without a callback. Please provide a callback parameter to call ${w} asynchronously.`);return y}_setAddresses(d,y){if(!Array.isArray(d))throw new Error("addresses is not an array");const w=d.map(v=>(0,l.ensureAddressString)(v));JSON.stringify(w)!==JSON.stringify(this._addresses)&&(this._addresses=w,this.emit("accountsChanged",this._addresses),this._storage.setItem(o.LOCAL_STORAGE_ADDRESSES_KEY,w.join(" ")))}_sendRequestAsync(d){return new Promise((y,w)=>{try{const v=this._handleSynchronousMethods(d);if(v!==void 0)return y({jsonrpc:"2.0",id:d.id,result:v});const E=this._handleAsynchronousFilterMethods(d);if(E!==void 0){E.then(_=>y(Object.assign(Object.assign({},_),{id:d.id}))).catch(_=>w(_));return}const S=this._handleSubscriptionMethods(d);if(S!==void 0){S.then(_=>y({jsonrpc:"2.0",id:d.id,result:_.result})).catch(_=>w(_));return}}catch(v){return w(v)}this._handleAsynchronousMethods(d).then(v=>v&&y(Object.assign(Object.assign({},v),{id:d.id}))).catch(v=>w(v))})}_sendMultipleRequestsAsync(d){return Promise.all(d.map(y=>this._sendRequestAsync(y)))}_handleSynchronousMethods(d){const{method:y}=d,w=d.params||[];switch(y){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(w);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(d){const{method:y}=d,w=d.params||[];switch(y){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(w);case"eth_ecRecover":return this._eth_ecRecover(w);case"personal_sign":return this._personal_sign(w);case"personal_ecRecover":return this._personal_ecRecover(w);case"eth_signTransaction":return this._eth_signTransaction(w);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(w);case"eth_sendTransaction":return this._eth_sendTransaction(w);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(w);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(w);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(w);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(w);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(w);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(w);case"wallet_watchAsset":return this._wallet_watchAsset(w)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(d,this.jsonRpcUrl).catch(E=>{var S;throw(E.code===t.standardErrorCodes.rpc.methodNotFound||E.code===t.standardErrorCodes.rpc.methodNotSupported)&&((S=this.diagnostic)===null||S===void 0||S.log(h.EVENTS.METHOD_NOT_IMPLEMENTED,{method:d.method,sessionIdHash:this._relay?p.Session.hash(this._relay.session.id):void 0})),E})}_handleAsynchronousFilterMethods(d){const{method:y}=d,w=d.params||[];switch(y){case"eth_newFilter":return this._eth_newFilter(w);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(w);case"eth_getFilterLogs":return this._eth_getFilterLogs(w)}}_handleSubscriptionMethods(d){switch(d.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(d)}}_isKnownAddress(d){try{const y=(0,l.ensureAddressString)(d);return this._addresses.map(v=>(0,l.ensureAddressString)(v)).includes(y)}catch{}return!1}_ensureKnownAddress(d){var y;if(!this._isKnownAddress(d))throw(y=this.diagnostic)===null||y===void 0||y.log(h.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(d){const y=d.from?(0,l.ensureAddressString)(d.from):this.selectedAddress;if(!y)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(y);const w=d.to?(0,l.ensureAddressString)(d.to):null,v=d.value!=null?(0,l.ensureBN)(d.value):new n.default(0),E=d.data?(0,l.ensureBuffer)(d.data):D.alloc(0),S=d.nonce!=null?(0,l.ensureIntNumber)(d.nonce):null,_=d.gasPrice!=null?(0,l.ensureBN)(d.gasPrice):null,C=d.maxFeePerGas!=null?(0,l.ensureBN)(d.maxFeePerGas):null,T=d.maxPriorityFeePerGas!=null?(0,l.ensureBN)(d.maxPriorityFeePerGas):null,N=d.gas!=null?(0,l.ensureBN)(d.gas):null,x=d.chainId?(0,l.ensureIntNumber)(d.chainId):this.getChainId();return{fromAddress:y,toAddress:w,weiValue:v,data:E,nonce:S,gasPriceInWei:_,maxFeePerGas:C,maxPriorityFeePerGas:T,gasLimit:N,chainId:x}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw t.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw t.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(d,y,w,v){this._ensureKnownAddress(y);try{const S=await(await this.initializeRelay()).signEthereumMessage(d,y,w,v).promise;if((0,g.isErrorResponse)(S))throw new Error(S.errorMessage);return{jsonrpc:"2.0",id:0,result:S.result}}catch(E){throw typeof E.message=="string"&&E.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied message signature"):E}}async _ethereumAddressFromSignedMessage(d,y,w){const E=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(d,y,w).promise;if((0,g.isErrorResponse)(E))throw new Error(E.errorMessage);return{jsonrpc:"2.0",id:0,result:E.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,l.hexStringFromIntNumber)(this.getChainId())}getChainId(){const d=this._storage.getItem(s);if(!d)return(0,l.ensureIntNumber)(this._chainIdFromOpts);const y=parseInt(d,10);return(0,l.ensureIntNumber)(y)}async _eth_requestAccounts(){var d;if((d=this.diagnostic)===null||d===void 0||d.log(h.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?p.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let y;try{if(y=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,g.isErrorResponse)(y))throw new Error(y.errorMessage)}catch(w){throw typeof w.message=="string"&&w.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied account authorization"):w}if(!y.result)throw new Error("accounts received is empty");return this._setAddresses(y.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(d){this._requireAuthorization();const y=(0,l.ensureAddressString)(d[0]),w=(0,l.ensureBuffer)(d[1]);return this._signEthereumMessage(w,y,!1)}_eth_ecRecover(d){const y=(0,l.ensureBuffer)(d[0]),w=(0,l.ensureBuffer)(d[1]);return this._ethereumAddressFromSignedMessage(y,w,!1)}_personal_sign(d){this._requireAuthorization();const y=(0,l.ensureBuffer)(d[0]),w=(0,l.ensureAddressString)(d[1]);return this._signEthereumMessage(y,w,!0)}_personal_ecRecover(d){const y=(0,l.ensureBuffer)(d[0]),w=(0,l.ensureBuffer)(d[1]);return this._ethereumAddressFromSignedMessage(y,w,!0)}async _eth_signTransaction(d){this._requireAuthorization();const y=this._prepareTransactionParams(d[0]||{});try{const v=await(await this.initializeRelay()).signEthereumTransaction(y).promise;if((0,g.isErrorResponse)(v))throw new Error(v.errorMessage);return{jsonrpc:"2.0",id:0,result:v.result}}catch(w){throw typeof w.message=="string"&&w.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied transaction signature"):w}}async _eth_sendRawTransaction(d){const y=(0,l.ensureBuffer)(d[0]),v=await(await this.initializeRelay()).submitEthereumTransaction(y,this.getChainId()).promise;if((0,g.isErrorResponse)(v))throw new Error(v.errorMessage);return{jsonrpc:"2.0",id:0,result:v.result}}async _eth_sendTransaction(d){this._requireAuthorization();const y=this._prepareTransactionParams(d[0]||{});try{const v=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(y).promise;if((0,g.isErrorResponse)(v))throw new Error(v.errorMessage);return{jsonrpc:"2.0",id:0,result:v.result}}catch(w){throw typeof w.message=="string"&&w.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied transaction signature"):w}}async _eth_signTypedData_v1(d){this._requireAuthorization();const y=(0,l.ensureParsedJSONObject)(d[0]),w=(0,l.ensureAddressString)(d[1]);this._ensureKnownAddress(w);const v=u.default.hashForSignTypedDataLegacy({data:y}),E=JSON.stringify(y,null,2);return this._signEthereumMessage(v,w,!1,E)}async _eth_signTypedData_v3(d){this._requireAuthorization();const y=(0,l.ensureAddressString)(d[0]),w=(0,l.ensureParsedJSONObject)(d[1]);this._ensureKnownAddress(y);const v=u.default.hashForSignTypedData_v3({data:w}),E=JSON.stringify(w,null,2);return this._signEthereumMessage(v,y,!1,E)}async _eth_signTypedData_v4(d){this._requireAuthorization();const y=(0,l.ensureAddressString)(d[0]),w=(0,l.ensureParsedJSONObject)(d[1]);this._ensureKnownAddress(y);const v=u.default.hashForSignTypedData_v4({data:w}),E=JSON.stringify(w,null,2);return this._signEthereumMessage(v,y,!1,E)}async _cbwallet_arbitrary(d){const y=d[0],w=d[1];if(typeof w!="string")throw new Error("parameter must be a string");if(typeof y!="object"||y===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(y,w)}}async _wallet_addEthereumChain(d){var y,w,v,E;const S=d[0];if(((y=S.rpcUrls)===null||y===void 0?void 0:y.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!S.chainName||S.chainName.trim()==="")throw t.standardErrors.rpc.invalidParams("chainName is a required field");if(!S.nativeCurrency)throw t.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const _=parseInt(S.chainId,16);return await this.addEthereumChain(_,(w=S.rpcUrls)!==null&&w!==void 0?w:[],(v=S.blockExplorerUrls)!==null&&v!==void 0?v:[],S.chainName,(E=S.iconUrls)!==null&&E!==void 0?E:[],S.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(d){const y=d[0];return await this.switchEthereumChain(parseInt(y.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(d){const y=Array.isArray(d)?d[0]:d;if(!y.type)throw t.standardErrors.rpc.invalidParams("Type is required");if((y==null?void 0:y.type)!=="ERC20")throw t.standardErrors.rpc.invalidParams(`Asset of type '${y.type}' is not supported`);if(!(y!=null&&y.options))throw t.standardErrors.rpc.invalidParams("Options are required");if(!(y!=null&&y.options.address))throw t.standardErrors.rpc.invalidParams("Address is required");const w=this.getChainId(),{address:v,symbol:E,image:S,decimals:_}=y.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(y.type,v,E,_,S,w)}}_eth_uninstallFilter(d){const y=(0,l.ensureHexString)(d[0]);return this._filterPolyfill.uninstallFilter(y)}async _eth_newFilter(d){const y=d[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(y)}}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(d){const y=(0,l.ensureHexString)(d[0]);return this._filterPolyfill.getFilterChanges(y)}_eth_getFilterLogs(d){const y=(0,l.ensureHexString)(d[0]);return this._filterPolyfill.getFilterLogs(y)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(d=>(d.setAccountsCallback((y,w)=>this._setAddresses(y,w)),d.setChainCallback((y,w)=>{this.updateProviderInfo(w,parseInt(y,10))}),d.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=d,d))}};return he.CoinbaseWalletProvider=m,he}var wt={},Rc;function oh(){if(Rc)return wt;Rc=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.RelayEventManager=void 0;const e=ce();let n=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,l=(0,e.prepend0x)(t.toString(16));return this.callbacks.get(l)&&this.callbacks.delete(l),t}};return wt.RelayEventManager=n,wt}var Sc;function Cc(){if(Sc)return Fe;Sc=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.CoinbaseWalletSDK=void 0;const e=Eu(),n=_u(),r=ce(),t=Cu(),l=Ms(),c=Oc(),o=Pc(),p=oh(),g=Nc(),u=Tc(),h=Os();let i=class iu{constructor(s){var f,m,b;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const d=s.linkAPIUrl||n.LINK_API_URL;typeof s.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=s.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(f=s.overrideIsCoinbaseWallet)!==null&&f!==void 0?f:!0,this._overrideIsCoinbaseBrowser=(m=s.overrideIsCoinbaseBrowser)!==null&&m!==void 0?m:!1,this._diagnosticLogger=s.diagnosticLogger,this._reloadOnDisconnect=(b=s.reloadOnDisconnect)!==null&&b!==void 0?b:!0;const y=new URL(d),w=`${y.protocol}//${y.host}`;if(this._storage=new t.ScopedLocalStorage(`-walletlink:${w}`),this._storage.setItem("version",iu.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new p.RelayEventManager;const v=(0,r.isMobileWeb)(),E=s.uiConstructor||(_=>v?new o.MobileRelayUI(_):new g.WalletLinkRelayUI(_)),S={linkAPIUrl:d,version:h.LIB_VERSION,darkMode:!!s.darkMode,headlessMode:!!s.headlessMode,uiConstructor:E,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:s.enableMobileWalletLink};this._relay=v?new c.MobileRelay(S):new u.WalletLinkRelay(S),this.setAppInfo(s.appName,s.appLogoUrl),!s.headlessMode&&this._relay.attachUI()}makeWeb3Provider(s="",f=1){const m=this.walletExtension;if(m)return this.isCipherProvider(m)||m.setProviderInfo(s,f),this._reloadOnDisconnect===!1&&typeof m.disableReloadOnDisconnect=="function"&&m.disableReloadOnDisconnect(),m;const b=this.coinbaseBrowser;if(b)return b;const d=this._relay;if(!d||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return s||d.setConnectDisabled(!0),new l.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(d),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:s,chainId:f,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(s,f){var m;this._appName=s||"DApp",this._appLogoUrl=f||(0,r.getFavicon)();const b=this.walletExtension;b?this.isCipherProvider(b)||b.setAppInfo(this._appName,this._appLogoUrl):(m=this._relay)===null||m===void 0||m.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var s;const f=this===null||this===void 0?void 0:this.walletExtension;f?f.close():(s=this._relay)===null||s===void 0||s.resetAndReload()}getQrUrl(){var s,f;return(f=(s=this._relay)===null||s===void 0?void 0:s.getQRCodeUrl())!==null&&f!==void 0?f:null}getCoinbaseWalletLogo(s,f=240){return(0,e.walletLogo)(s,f)}get walletExtension(){var s;return(s=window.coinbaseWalletExtension)!==null&&s!==void 0?s:window.walletLinkExtension}get coinbaseBrowser(){var s,f;try{const m=(s=window.ethereum)!==null&&s!==void 0?s:(f=window.top)===null||f===void 0?void 0:f.ethereum;return m&&"isCoinbaseBrowser"in m&&m.isCoinbaseBrowser?m:void 0}catch{return}}isCipherProvider(s){return typeof s.isCipher=="boolean"&&s.isCipher}};return Fe.CoinbaseWalletSDK=i,i.VERSION=h.LIB_VERSION,Fe}var kc;function ah(){return kc||(kc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const n=Cc(),r=Ms();var t=Cc();Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return t.CoinbaseWalletSDK}});var l=Ms();Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return l.CoinbaseWalletProvider}}),e.default=n.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=n.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=n.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)}(Gr)),Gr}var ou=ah();const ch=cu(ou),Mh=vu({__proto__:null,default:ch},[ou]);export{Mh as i};